From 743e07bd10a6a330c241036100c54bf95cef8eca Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 29 Dec 2005 14:42:02 +0000 Subject: [PATCH 002/811] Fixed spacing of labels above text box, FSK441 and JT6M modes. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@32 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wsjt.py b/wsjt.py index 0f681ad22..604eb3b84 100644 --- a/wsjt.py +++ b/wsjt.py @@ -479,7 +479,7 @@ def ModeFSK441(event=NONE): mode.set("FSK441") cleartext() Audio.gcom1.trperiod=30 - lab2.configure(text='FileID T Width dB Rpt DF') + lab2.configure(text='FileID T Width dB Rpt DF') lab1.configure(text='Time (s)',bg="green") lab4.configure(fg='black') lab5.configure(fg='black') @@ -561,7 +561,7 @@ def ModeJT6M(event=NONE): if lauto: toggleauto() cleartext() ModeFSK441() - lab2.configure(text='FileID T Width dB DF') + lab2.configure(text='FileID T Width dB DF') mode.set("JT6M") isync=isync6m lsync.configure(text=slabel+str(isync)) From 9bdd9d7691ab2aa542049484eadf6bc61c1301f4 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 29 Dec 2005 15:02:29 +0000 Subject: [PATCH 003/811] Delete JT65code; remove extra 160 ms ping from mtdecode; fix "go" script for Linux. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@33 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- JT65code | Bin 432484 -> 0 bytes go | 3 ++- mtdecode.f | 6 +++--- wsjt.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) delete mode 100755 JT65code diff --git a/JT65code b/JT65code deleted file mode 100755 index 8bfa92f86244d6713cdc7640b6437268f7f8b0fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 432484 zcmb?^4`5WqwfAmz0}C$hqCq1@i5e{wv_w#eU=0aZQY3XD1gH`L1&owGDeMX;;g6fO zTraC>E3eq1g-_e^T3TpJ+f>1qKuVy}HXv<-pr#tzyWO3EJ29 z0=xIl%$YOioH=vm%$d1&*K1Snayp$3`!CDkaxhgNb$iC*x^GlJDH`j@cl2`%$G_`w zbvRfyb^~DWX~aE0+4#8eap7}@AC&QPDen1U8F43DLzx4gefPK={II^mZFTY=a*U8u4s&d-%ymnjgFDQ%fFx;8RN$ z+_>c7WuetKtz3T7&8iHjg|^9`t;C&bhi#Fr>+!i2pDXYgjZZ#4H{rv->+rb}pG)we zT=;i6J_GT&mI?gj;p4%FG>*cDe>dWD5k9vtfxiNLF2iRiK4b9VA6R$XfX@hghT{WL z9V77}U8L!w{>U%?*dM8XB4=a_O3lo;_hzIslLM@b99)OtGX$TjtvnyDS6TOzDgQ23 z7sp^++5i2mH1*;dd_INGC-M0NKKv_Gm$dKOP;uLnZchbrDeGS%y$k7waAi7#&pxCN zS>=Dm^(fM7t@KL3okp5+Bm4=ZJCXi^m0pJHd89A3@GZdAYq&k+mGIXiorg5_faxlH zMj`zJEByhk6Oir?IQDx4*QrPsS>g_`Mw^n*0()*BJW2JZEdKBp?R(d0@r;*+b zr6j(e1HKdKcdYV1A$=a{saE62Fa7q}ip`YlVo@1p!P(m%7xci`HIG{-CJSE2ko z(xq1Vdq{g>H!ro)Kg2Z;>7mFc{G+&zLfY1!|3G>I(j50Je;(-<=k^o*7>p4^+hG6Y z<0cp7Qvq-5b2IYhq~LoU#TrF+OWiPW#379I%5+Y5#6@%$@Sc-02G+ zdU$1U;fm5F^H;81xY99q?n6tLFPpnEIDbWO?py*tsDPI&U-r=Ar8SO~!4(hItZ^*; zJZdeixpk~#<--r*Cb(wh!XOJ5u2`{rg=6W$rAwDTve5C+!r;PXj{xh6`KyrkVD$>z z11h+D$=rvRq1|Qkmk?M`&R?=*`Gby!SI!Rx*AVUe1q&>s%O0G+a^Zt$ef|T>R|FmN zm&{+W)bXH#2X2dpxrtXlDKaG{VqKZu4GEW9x2iiPtR5ONut z2`$4k@p)BIHB53I3_iSknPcSxD?Sfgt0AHw*awHfhnFr~zG%UGNM+$tQoNLu)dU^O zYZfk}gdj2?T@V8O4?ehXC8Z28En7Yp{LUAob5V`bo%@-4Af5#eFPj@$xp0AF?!wg% zlW=x})hA2mKfKJbWaYwzpSLhWqz^7xzH%YJ7TH8CTCospKm1V5iscV3oxk$)jzz&0 zAqX+J5S7sQvPT|X0ahkY{Y**e+?z2KPA)B-JLaa*$(+LE9rY#)|6KCTJN3_=L{H1m41!*Q6`F|e(?!gyBd?}j@)<}DDlxr<*v#Y}wUpd)dM z7Z8c-{rF~oC9coGT{UlG?Fsx{pUX7MVy%+SW16ZEYm{_8({!0)dn8@JbUxGDB|V&J zaO8;9OL`R3qnX|y>CsGcT8-66dMwk$OwW__IHt>(4oG?e(*dT7C0)$)Y^Fy`dJ@y~ zn9i4U8PjAa=9lzTrfZmXNIJmuYNoqBM8@?qnBKs2yQF6`y@}~oNzY-rp6NzO&trNk z(|aVnfa&c_Zs~2m-G^*_b|Od(ltysFkK_*Ak&RZ&y)0OrVle6kn~!nTbVAF z^aiHem>w%X0WICVe?ULTf^l+x@CB2L3(M)fU^d6?iF4wCLCEdvMY^Fy`x|!*DOy^7bFw@mc`z3vp=^CaTNP}-j;h*oZ?SL;(-FkmN&$OAZ`l{5Dsg-VFNQyIJQQ!305=cyy)Ev7u3z={nAd=u zL)on4JaRDl6SfuoFMd}xjDp9*0h}uo+`I9>;m^6)_Aq@$fw%C;OC~DmQwuyux@~j^ zfNqBy1%SJR`o#(ZP|CbS>yd-{+2}sHeY6c5J9A+aS|W3x0T2!DIQU>saW@-xu*|rd znk?l|WL`AV3i;@f8Az-9u<6z#Wk|MYdjylV_fA&Ub_ot`yUKh~)%Ji$UE3Lr@P<{j zZ7te9z&p%e!9~=y^Woa_&fp^R1RU&^>=WZWo}K8Smh98G6Y{i1w3RT1m>vB+QLRzW z+QGY)VmBMG?sM3tsXYM{lM39h;tq)6N5EtL{V^2GLqTjd;9In2p>9%v2U7r;TLRQN zszkMB-Cbb*5hMYFH?7b^oRXtGPM|MiY$7WM^5oU8fU6ZIZ&cd~gq~<*VG^~}y6X;y z!_c-y8rLl_&EKGA2CtZ!K;B_gO7eQRFJ3pWr;ma)#rg)yk`$PeBlvm*U$JHE=_HHN zf5M{B@e|Co=0klDz{Pfpb~KfMqZcIL?Q{a@oSTR0q*)~@C0R&o^`j_y3q?lc3^b|9 zbcNfUP}I5R+a~~@AqB2*TeQ|xB3ds<#NX11;0oECh?dM6eueu$k9iyDPo$zhaY6L% zd1*o(PV{ew6_0KtqB07o5u2!F|3Hyab5STYZczA@scf^2dKcB&RGEwll&!jpWvA8n zX;&caqCVQ`bjar?qlrDQ0X#!ua4~?QBbB9&3$ipSoh7&z4%3&)lD3WfG_cP`GG8+l zZJop))jAbzW;$(IpshvgQXpOFWm`0sok2t3z5!+aXoS-;?l4r&;DVvzrir17ij^P* zk5Onz6~0+jK)F;!`Sg5HxZ^m0GQ=?o4Yg?9q{TKF-4_(coOE$eJ50yp(z2z+(lXln z;VPBuA|GmKBX=8eO&2N{+P)(PIfH~d3qZElHZqT)0i@kb8=8llwI6jj&b8_Xo8rS# zA=mbX{0Sf=^K-BB||-Lo_;m&awh$tswxEdD{3h{45 zyd}~Yx}gUWYcLr~J1y}sO~_Z#mW>I}9Eqfr>_xSA2=Sjnji=a#N(XtHAWtZeaAQ{A zK<^T0z76E+8>oXo6KtR)d+E*nkwBN*K-qm``U8R9gWu-+iS~}~C#`yGQ+t+^U+3Dg z4`++NfueUYgq#>e^Uyy?{!vEM{J<%9L3BZZ`(*Ymi0aLzli7QCJ#w;)_qdz zJej>OiQRuP*U(I5Up98ql(uMKk(Z;K`JwzuCy&Bf)Rp2MDpaON3TOkh?vZk%M}{LA z-p_Bxnt?5nBoaf4T^c(-X}37CjV*+w!%3lzK#MS2O--?3dUTY+j5bEAyODCEN5&!< z-p_AoLvExE!ez8Un_z4qh~37|TY5~wbrCiKqqmUEpehXCsQgXZaihHZGkSC!3WYb` z=#dHd4)5o;v@17kcMFSMl}X;B+Hq=?Ar)}v)^iHX1Ba;b-3f^8Xqm1Zjr|bQ5v4(6 zkE^EWlJ`8OYOsGm(Gz^AyT4Z~5w;qCm9n{2ex5hVy#OQN_n zLQU{utA|gZhfl;e13kvRp`C#amkEA;3x2r~{JevbcvGyS7X?x6%j_Vdnc8rsSl8MN ztu5Sr+4>x#vaNx8RC?2hV|sKds>d8^OZjKG`OS&Gs5lhtXrReHv_^w%Eqpaz>X$A10ZRasw%FVHn=eZ)r|$ zq`BFuIb#d6xE!_ZvXaFUl*Rgkltm|G(Qat%mMq#+WHAqQDGOeeEO@7D9RL?ubWj%i zF*hk$EI_Hqf;W1k8sFjl{1)QmMu=l^pRyo`EsLd~E=3j{kVS_ji!P2=PS4c(gVs1_ zI;z%s-#VZe8?SY(uLOs>tZNLdYouD>L~4XGehX!CBa|&slo?x?l`6Ir>}9~7NcwW@3Ib%J=BeAY~OjU!< zTnB@Jq5TZ)hW3oEZ4K9Mb*$;%qHP5v?8-A659A{_r&n%+F9*QwxQx`c>)MOq+7|`z zMFG^d!=f0KTRCWr%5AtH^&&1ZpXC3S7?WIUJ`rOQdkh+h3GRB-XFht%YxsMdPiHF~ zLRTehK6*H+ou{wS4ieg9!=f8w5~7g-~hXa+l(AkK(ey=JIxI52G=g%T6Hb?1M}H1-SGlxinGJ zw7BfTRL8!&NVx3k;qpuxmuGso+$UV_!!QZgHVW~LipzaAm(7aH!@}iZcyHm_qXKwT z0JX!yWuxMpxFT>!dV8L zOzZB{@D;^DS}@2VL(F=lBla?c1)}_vnWA4tqeY{e2%_3C)?JP^Nj`**(Ri#6PXGK< zha;YXdoFQnZA6`n7s%S|oHWLX6VoE5lx>(8!?oMRhHgh0@W13jS><-xP`f446xCWt zOBgMsiZV4SXn}MB#Ol*j$keEy1$h9FX&pKRL6a6P{NDt1Ao4{a5f!?ssVvX8`%A@ z*!dXKvM{Z&4B*V>#`V!$hxCsM#e&?7a8IWE&hAa+Edw}Hf=2+HPfWgvp zkwzMDCV7Tx&YJXl!)KCrUmxVj_8V6AF71p<>u_nNOY3won9(oQMqdslAWbVwE|ZG; z4_J=c&YtD>yCmqWvm-fh1e`)|dl%biIWEil>scgVeV{s>(_Iq!JH4Tujn39+&d)`L zd00wVN|>y&idEdMXy9yW8-3Jb_a$ph{8wwS7m~Fu%B*!b+#FO3JZywbO72-$t2$Io z`V^@l3{G_rP0J5NW$G5f?;xmX3rzAKEl+}J3v`qi?xlHiBwQqNOjjtX$v%aD4%(cId_(Jq)_-XoZ|F7s6fPIZCT?6k z?^|RuZIS)%9^o+ZEV9fF*q2PQ{e+c+4yXb9^zReCVnHv$XWfTZpF%zeho!0eCnysh zb|-mwA6cn9{H-?+*9Z@m=l3hrjJ;x2vi<&ZRwbq_#yfYDajVj=SxL`m>4V-a{WP^w zD=W>gD%qNmYBH>r9!I5Kd#kC|!h*Y3ko&%ooP7r*-7r8DQwV*vLOmU3H<1aL+6)2D zeqXx#0&QeWKbaHb&rn$yK`R-cnKRW>AJdL2m7C0Vrlqx$2AbK<4IkAG7OGIH2nHrK zNLG_<*4lKG)7KO|#!^)K3#GFQ*a$(7G%BYZ;N0@;gAL$%Cy_X*wV$kg-S<=N^+kgm z-bHZSPA+XbRn>iR>FX!8(H&emhy`T^&0=K)4y z+#|RR$S4fL{ur=v^f*?aY5<$z=1F#BYBoB)MXLiAddj?ja08*bP0|%^-fos#$*q@L ztoJ4Igua3#5PLGTO^lLVW@ww6+Wm|L)Hk&cw7Ch^Gj2g-F!ZfGZI89u4RnF+7GLdAF*QnkA)iY#<8k`ir-M(!tW z01dQS6bmBT1&VUJd{aIZfEx#}OtiwSDs>099#Xm@zlVLY^aSyRZGQF zm)@l*czVQWb_TtWw!b%BVcJdT#_JhQLzn z7EPd#Tjl4l*tQ8cEZF!h*yKhCkb*{p&bj&FWyqBbrVq}~ew$XmnM9U?NVfmclCjn7 z2St5K<|xQ8w(wiu!UK=t{rncfZ7~$G(NANzB?_UJCkk^G=A&)n@ z97qlCKZAQgEjJ`jY_BUqAd1M+Ob=I)#uh@^m@kEhV9b|VTRLj9<81&~BH{6ZZX~he zK2mP<$ay5g`}r+x%8jr?IIz>ZL4w!~UItcLw9d4Cz^;(5?g|hYu01nkeRfK3IAHsP zUEb&sH@?IB`7KS$jr4}--WCs`<%Fd(BKOi8UgnZ~-sllOzQgwJGn9&>6R&S_H ztJ9Dk=toE70aQ5QjULIzcX&U)r8&6~PFUP$M-aqrEBgPag0${*dq>Og=yIcea<5YM zx3FK(yITrSOZeu^1rKILx5y;AWfY<1kd{-wXKUwM}k4hNnfVFZ3Q94F~>Qtmy-nez>W7nEu*`gL)Nqn&Hf6x$JKQaegu4fL_V` zVjeH5I&-&Pg{8omk$5OT+ZL|fCK2mxK#gX$X3yhxw6!>vjW)wM-yo_B zkV%Hop%%l+04Rp7z2|PMA5dM!refItQ4BZp00bGfzHNq?-^1`>Vfb(#o6i=*t%~6j z(!(dPiVfGciC{VRis?HMlJd{1BN z2Ga5~SU#V-?DzHYvg7US^mEza=U>itw7}V3?iAIO5}yjN{=L6%AoX;U&ByqhPPw(cUr`{RYhb|(r zfry67#qTVohRnjawy3+XfwDzcq6||n!7cxqEx6uoCux(jquoYTHzo-f6bPajOOkNy zVbS-)O5dBUrVhg@q%~s=zihOGQ&JdrxLAjw+UXE}mBU5G(ow;ERM%R=wXK4?RpCC` z*F0U-Y8#$gftpcU8W)T_Ijh=Kb?2cPhh{##iH(ki1vKY zKSlZ5AO+`f7evt$eiZ+pjpv2Udy@|nRGt19bfPlO#v6Z#mV0WM@5p#ul)+PmJ+TCp;}6~inN>cQ%OMgIUI@RVO$|Fs&$ctZcZ|dCeQHl zFsTd?IX3?bcxSvp-S2+qJD-%gO&?g3idC)i!qtq*P93K$x&7)Ao8BtN%T4#hP1^1I$V2NX3Nv6 zowmN7GpIa`c}^B$d_fattsz`Pd(mcQGZ<@PUuNhP2E!hv!GmiZul zXSlXgnw3eA4>zDqE*Pz$p+qBl^WOl1)Hc4K)`oz1gsM=_J}TjDn`K)lqAx0Ks1F|>x65&)HIB> zVwYQHJGh2j+3G0-MEd$GeY&P~z+pZd?5k@B0@zLv+8nNJmX2*k7CN5Co>MzErKv+t zOC^TF8KpSf#~M}+Q1i%i(*5*GOVTS(pgzJU(_t2q?x)0snIoe>Hec}!W_JED1Un8; zE9~|yJ!6vAfV4m(24QiBntE33V&JfxPl;W`Ul0k<2S}GiKQ$OA3rga*LSGjgUSSF| zz=?3}36aPN6oIZ*Vd_LGQ#MhM{|}xLq0ks)EY$hB(WBi5Ldx&S&t-mUVkd3 zkln#Zk1)>(q>m}$2&#j5JpO?#?0OL%H>qvsTS6J}?}=9MnHq40AeU_guHlZN+Rw(? zAB+EvaPy3eHGQf(a0Ux@Zi1~FfB@gd;k<=LS#BT7*m*r?=8o*cO{(8@RAX)ifnKvlYjJxElW!?l|Q)nn-Z0fxzAf*K4Q1GCtSNn1iwcKeh=E?9ND+v z-+GeL?jS)Y*6`Nk?GfC@?gv$nbrWSBnTGF%z^$G%-KJ&86f>*eaFvoVTy)2J97gRX zAeP*E`Cf)Bsv0sLxIttAwa%=jz&m-WLfaRv-6u@!BNNgvd@q}QT)j%S_oeFgN&~GB ze`ESHF?dEs>GqeU1Rq1RLZ-R?B1xYD|iZeL3L<$LvV*x0mC#9`5GzTcxS-CnCx zuAOA@3n0K+!Y#rrR=d3y-d*Ha7M{^E#G_kP45#&6?AQlt2@O{t*=l`_Y-@epFJ*mw z!l*pK_4NsBeQk%B5N17r#qy8PfK1w4x%XH*$KH==SVDkYqD$bnO$CNz$=+CrwFIBf zufkLMXHHg8QDp(H1_T!1bfN48cIKn-WCD=;e0QyiFZqxI|ICLy6tLb(9tmur-;h2XJ4pcAMHU&$h?E4lm+P;N{SSOehSBQmRp>7|w{%$YPFF zaFn&j0syEbKEA#d=fcydN3=gU2fO5H)blB`qD*qh16*wpAy|UUj5&7MP8m6}IRM#kN}Nh%aHVm9$Q52Pl8hOQMHeX2

*0love% zen_nK1|ukoBE4NmKLJrI(xu87XjX3z5|PL55R9wP=SGY5SB^8x?8ILRv#FZqO0`1~C55VXa5%qA-y9|A0=Z^6yK%fqi#jsRyk$yvb9Eawrf|-`VGj-f+H9 zq>h)nSsf*37tvAvf4!rm%KuCNQbh@%m#dfAQDv#!(sxIl#31bHx^3vplMX~{u1M>= zAM|uyo(%IyxkBH_ptRh zG6=AawwbSvDK}qxTd(YlIYu?6EZM+>*XDBcpDvR+#!5$9x!9H^FYj3 z>51QtNPl;i^=uK=2BCp4bQt@Ced6l7hCm;q+_>OIF@->Dx;Ps)49gD{-b}n`; zE?wNuJP4OG+?@Zy4EjUa0z_Wq)C?O}Cuc5NmlYpnM0qNvfs3D!Ql1>%9>eX|Cq)lO zB|G7W9|?EDtn;u-0LPpHiCc)?oCkv)ZuVy)zZu9s)o^nUT5p6cbA>4QV4aCccMnYB zKa`1s1m38?WkT{s>yH9Q3bDqd2wt_9#BkV}9BB+MD4cJxu$OSSPs<**%p#U+Z2bm= zLK{9!CbX_}!PG@_K|cHd2WxYa2k-b2cWqXDI0r@mj*)i+6x{P9OQ6snFuT}&ord>&!%TSNuOi>F_yB<&JRk1# zVniltJZ9Z@aa^a_Z)bSTmFXFN^MPbWB6QxIp;Cfw)=WH)GAdl_ajf>>J0J0HyfUnf zsubIXNh4hAcdQ=Vz**$Ua?fk+MVcQ}CqdQ-NRDG&8c0qm$V>sr&A^hI3Nl7O@*Jy& z^fWY5%PlL?@>0PV9pOkEzSwDQ_>S<*&`~A&)5DiRboJCO(@We^kf)avz^ND6bU~uf zbG#-jV7Bj6^-CemuJCG)BQz8+iBOk$tHNvx;j3^C`a7tUjwY74hr^W4OA6PDv?FNz6PACra_+DYJ!&bWKK!z0t ztQkR)x!?{@9+Av;~%Hi~9@Tw#3cm!mIs`PzwHLB}%(Nulb{72JwGWrEKx_ zBYtw}*GqEcCPy#Hlbc+|ocWrj;7T{JQrok-n^ObY*gfgYCqSfoOV=t2c z_NkfdP=9!W-w|9TbdQ^JT7*4QP{X~%vR!11e>5shvBbpQ`1qmB|ham1uk%Yx=r_IGgKiSPu zk}4H5?Y>QE=+8isY)7<37oNHA{<)a7F=yBRuk5NALO3ljt*{pEYEFcU9f^?N)V?Ls zwK-5@HBewo#B(!Yb4-!e3B}+xEPJeH>@idesg1$tOJf2NCCan|!#KFw^2FibaAJFy z8Z$w0Oz#kSN8OO%pWg_9E)P_qVGKwcnW|e56rRfzRiLwhxxjAnE~N*j$G9(L?9F{U zd)X0xnj9XcmTFXC)byKgz92Pwh`Y_G@^3sSP^xK55A3G&KAO^9@??EBYqj7b3-yE} zb_lTlr+u}t^E~#*rMo)t&NQ}!KsJSV8Pr~UPrYu7ht1-pwvPDQh?t07D97GXhhcSJ zk=Ba7`xPpu;>eEu5IG2yg!e^=!4b+c%7L@hmMRvo;xw=@zTOB)ncZ(*9H;#|22o{) zz9kno>@>vgFtY0eTQpB~@Dv;ck?iTYd~&G6w>yxhx4PU{pf@_qHlR-F$0#vbqk0R` zk8$6w*ZnxjU#wL8msW^+DDGM!1%RPYQu*Sj0~yaKG6ZA*hB-`5DtVT&PEb za(KUB4f$Fk`4;-v*AQau87|R?(9H?fr_`xMawz$5ZH~kDl#}Bm)FJi_h8PX=Jue(e zWxm~|dBXc?z7IP?ht>Ica3h_lofxm>pywFKNEM(MNgsNtfMN}DtgQL z%x=no2eGRVUl?)nvLF%dt_+#(5}EEoyP=zH)rm&PWI$cSLA&Q0f}MjEE|L_-26A!| zPVnA4wB92}4*ca*ZefeK$QI6^o#5!Sx{M=`ML47@Jr_)$yX>Chv3T^{5;PFc5u6w^ zTO{|H2y<0m=m>2^b6_TNTzENV(E;Dn&qMqwITAY=3~kwViCy$PmX@E;qd6SPJ$=Gw ze-)2@6vXdLwHMM4*0fs!d$9|z%^!hh=UAi69d!>DK6ZT|qQVmh#JokmBWy)~M)+0z z5rXh8EbjK_dWoCBtsoi?yn$)-4XFv3|M9#)#%du+1n&TlVq~b#r5~ry#FOkRCfHZ~ zkb@ad$@a%RgtD9pfrT+R64l626!ci3q*;I*^UJtnD~b%Xko#|hz(!>^+Iz5Qc+>B-7bIeNG3nr4f?SaL?JNT*n9PMA@4n#03ev7e% zwvx=%Z8?mNveSo=9!>;eOL2-&uH&_KxU1KT6i5m+Bj3ef0Oo{dgi1(;b~tt=M}pQq zUMdAGgN(dHY=EpT7&&gU^bc*1*V-V7?}{X3Lq&wG4n1<P`v&OAk@EgJZQ6wN+cG`g)H`)mk%uGxwKsg$*h{0VblMA4ZY zyGe|kMCPyuVQ*b$#qst@Yv2VVNpu|FDOZnMqb? zZ$5?8H@^B4k|F%JdhHEA315S!IRbHL#?FbLS5YE^Le($A)zL=4h!ieq;0zhyL3U z9~Pb}dVl@Z`q}BT;F~(z5+QHE%z0KgKzRQ*rA6nLngXshruBv`jtcxB~bgmN*1 z6df|~V$Vwd`trze7{;NIQ=#j0I7(RcgmUy+gql4ThS&lO6t;go+dnws{nbPDvw)j6 z)7dsFV18|@-SVls*O(dY8s*-Z6`ujYuNomwZH|8S$(%7yx(heC$85?eEd5N;t84#q z-~B?P985I=`H|!LyP*L)&fxb);)C?Fg^lBf?ZR zXTCdvXF`I5MD7yyiC?(cXK(LQ4W`=0p2Au|c|ISPd%j=FWkB-VHrE=!-s!!uUm`MVi9T z?Bv|1szh_PFrsBl&2sDB=RC3gp7B$&Jb2;lQ}ft4N8+RFOUGArtvwW{e5whM_#xXe zf1?SD=-8W;BGyZd(&VaLvTZ;3MfZ;8R)5#cnf_~Vp!oRXVc)< ze7jCMkNu`p24pwkz5|qD4ruq8_Yq4fcf9(0VzTzOL5eA#T@Vmb8RKXfq)QgJQ>W~~`Ibb9eF+$e( z{hLdG7|xPKsIY{=M!rJ>tx*>b)x+4=guC4#ECIaJ&F{lm)DP-7QdQ5Hj20p^ElGBC zr5lv%2>v}U$XR|om|Ya=VvoS;RP(5xIlltbUkQF^RtVX!ICIPsU$*;kcB($3n#I~Y zQr1#j&5Kc713epV3|at7A2|}bS_vj$_5*4Qz5x2|h`oicdSwTVlHuWQXYkYbS}`cx z?ecw*OVjwR`q}WK?K0n-vfN+y?=;byNg@6!W9G0pB{ zcsw6MqnRF|SaOz|spcl?qx19+ z;SwB@3E6e;oT5V*nQJeh5#bx$y7ZFj7!K<>>Y+u(l$ywq;3s!TCpU(!i6lZ-Dbxw` zDxkJI8XmZ#urXd!AHIVEa@tTIn&$#ZsC)oXwov&;#{tvj#*{K>j^8Nv=!HhfJTx4? zT#Z5KDUG4|Gt@3Tg*vLQ12fRkIJMd3%yy$0-HP*8Nt}0Pg{5RGmP}jhh~DK1B(nEm zpO*63f`hS^d_vR@nSJK~d3*wNuhTQL!hAyfb?;1JDO!PHG-tZm^mHOI``+lJtKBmL z<^n+6msFH*LF6DTy0Dwx5c(e*W(dv$wK1p>V*)*T1RhXvAhFV84nh0uoyO2*cI$86 zBf<~|20Ai?b-0%vykhnZmSTJ%Yn}8Agt;4kyW>g5K(%;Y7DNwOnw=8jz_f1kl?fOO^x{ z=NlzUTqSb?W;aMeGiHGx_Q`wdfFLRDaUjxCwmCqf)F{5Z-m)A2q-F4n?s&oOuhax# zQ|B?tCdG%s4tN(kO#W0!Y5}=E61*OT0rM$HI$73IJjrS)-rurc9CpFWZ5wcLxCFz0 z`fRI8OGz%_#TGyp{6elVyV_OdsW3a#YLK&i=rUCjsK$gfe)bZ5cJ(@!j%%x>3)H1) z*oKSXIFBbdC_3Asm%g<{-M!V$gL)gzsg>ckOG@Sy9bAXQOkknHd<+fAU;$s@26`CI zP=Qrz%95g2*IgCR+eREt5q)h`M6Y1~kboMi8^kW-Z26~YZs(j4+nfvS@3GD1>r|5`T4%!Iqx4t$mQB6u9qfi<>i1ZEgz zv%?1x;bRFM8zbc%FjiBh8utd^>KnD~=YH?o{SW5{aKn|Oe>xF@LyqMfo?J9(XeRWK zmb5cx?#AG&($7{bb|yldLLrB#b0BO|rdx3su;@7@)*3kNoqE{<^Xm60z0ehkyTDXy z4sI!40=gY~AURzp{SB-~J>dkN_x6Xfj=dwAu@Ga#YA?7TP=O`rO!N0oCKBdY9J}Nw zXbhHz6YgLhzE=6diL6zh4kw%|io|aRuAnb|Bl`)PLNmp8u13?Q_fAX}HbSWgFy`T{4fuPAAO0 zQy{;`^t00{u<-YqH-ctN0e~(#7`$Zqh=Uc25emcT-HQU`nhVf8nE6cjLwE2>e66}T z{9)Fr+ru9^SKJaG2z&n_dHE!HnFWOLTs7zL-aOwWylCE8&hCKu7o<`c0UUTiHH^zL zcx0;z69tj3hj4EHY{Lmyy7-v-hSR)`tZ(Sx^}70ozwmlxeZ%{_UWzuo)&Ib)d0Uxu zG*_O$IkRG8XDhmr64JayU7`M%O&?J9Os$V`qSJC>s-eZ8VWwFlrr8^)-T-GO`rL3N zE6g~I7EalOKXip?{i_>MR$<0A2_wirzx&M(Hd>1cYxa`0FHd}6H_>C<4=*BEDmqgL z=Sy#5#~i_;aAwYvC5Z{uo3wL5_k^-g-pq>W)67?}dIv!KlKLmJHaSZs-maYsIZN)2 zoLc|ap1Dzc7w)1WfB{DXlNa|fJA?khMtMNxnMUlqm~l@%Ha@A+%nb2u#q^VvJ*ml! zob^TiA9nZ5Z-=4uhv1E0Z&aD^c%IsfTr!*gU_Z>i=9OR%B*j9=h748xO##RaY+xVI zj2vI*YuUgI{+T{MW7QqJH~NLm{^9OC-xm*M!&fYb_^TmX#u?a9T{bXIn~6mRCK*jl zGF*)DNV96iT7!lzg{pSWnrZH9hLKqZE`S4~XV$Uf$of38a7qm>LfsG0kg6QW!>NS4 z3c>F(-?iO)Uu0JjWD_kqoTf{sD`a&a0@>9Hzt!ZiE0J{(@hh6Ap|YYm%luLg&e=(v znKWy9z!|V)8^g{5wGOh~gKQ<9t%CDZ=+ebm3d2Rsz;F#Pz&5Cy9lu77 zuLoyk3eGJ(IOp_%6LyVM{q!I({1X0b5@(D!Uq+5ar!xiT#2%b{%s!J&SVZD{kT}<* z;w;2qk3H0b^Lrp!Rkj7U3_~C*IF8@2U$tG%V4j>GL7yPy3f_cocW_+n+fdq`ekwlz zyguNyr`QVM!#V=T=;8gAFCvRCS5q~tk>abH4C=7*4Jq})X&iT9xbRb>^86I!O63cX_SS07J}Kp zN&mp=lP_Uh#6L?Km2CJBkS&{I$!RjOHHpubjn6{hAwKwuR)2lY5Nl{18H-^cLheFI z%ZAxN!oL`;Zb}}rV+`|IZvnW=uRl&tD%RKoSBA8}aSadai&HU=_{}@%8h#ZyvaW*1 zgS?T<3n%j&#$En%ZHRv(JH9+g%N!!ZUwkfjw`gG=v*UNC=b?Wb@!ODBcq-n{ya(?b zC^hbK7ad&tzJ6C;9C3EBQ=uX85MZcxgE0-72a81#JGNt02nPX6F?bE1outH*&0L^` zYII);1-_Spd4o@qXh$G2?HN9I)& zDHL`;Jz$jO!i1}(BO ztTXr{>ty#?=MBuE7pBeGXPy82$U5#`b;S3WK;L7vd&h8w4RF+>(ql~Va`tV3)C!Lj z{k``3Xw~7D;0PdA1s`bAW$y8lF7x=FrhV1j#ze$`i~hd0!yJj$ZCx}1xeWf*2?`}z zG*k3Qi&r!HPLxc;pht2dR|xMZ)=_SsOVhpVi$VY{5vS_(Fe)T zX8!Mc=VN{1F^}}lcQgM7z4I{-d(3Ck^AZ1ma5eAZe$!u|w9Pds<XnzT8>nRLC?IQ+dYyIdF=nLsOb+N5-@3 zk*<%rKV#&)8g)mgHTpBd*8<*{@v2*&F?_>Ba8uN@woQ*n?p=(Z<8fZ~p3Hz=TW4N; zgLGaBpBsUO3yK~-EpYQ*h%o*Db>$I{op(R;KAWC5lzF$O=Y5uWd{QB$?(5(-PP37C zB-h6GX~4k>gb(EzS2K#Z7-?Ih#Ew-=M|2BOty6ePLQM<$*u;%0NmdyvjC{lGQ&tpk5?C@*qK6#AuN1iV7oFHOP)$L5RWH8y6Kmm!81 zXz6@)Uw}&msb3jhJ<1sx0)*AuVPdPfGi`ojg3|p{p=;EtxOfy+$O6=!1bS2fS(Dfl zSY2Nv4@iy28H)nd7n#2fA*o(H=uJ z@pz+>%(d0?So|Ubs6T8*UgC!=F~cgL9Pf`cFDD|*Q!g;&8(b{i5MB+cR97XjpSfKz zSSEcNRDF~z{jDmsh_s-6-${jqW|SLKBzPwgInJH=6u~^giwGV~g%==W zIzz~h5;i0XWy8ilS8tTS`l$YGPd0g5Dhkz{(f};`WrM*Sk_I7zL0FuZgm}M51Yl8_ zg}t3@iVV`T`$nnWMj1`$%HTxMmRM1pSh2wT?O!;2FmxhE^aJZJj~rQ@9sa<9H35eM znuz@vXskF~V1`~c+mfWUhdnxSN`IVgUd!XQgViFg99wUBoKBp&n}ItfS{|p1z`x*7 zj(~>K&TLO`q%j3b+>qay?NRX(mXxt%uqxSHkd4vYaN3pa(I2Nrf$q72T6wVPeV*Yj&RYwM701p_nY@i(Y2U6{IUA9?% z5<%kF9~a47qw1Ko990NUJI$|P#b7l>b0Pg6902$~3A}Yq0koM2+p0ZBwH0S=DvN7* zlTmN^c?E!!AlmZVzyh~%h_Mk)MT#?NejmCBtxE~}kF!)(m?@h9lQ9H)gtHShGZMFO z>&1L0F2o&)eHNtKey;iBfa1epz6wv-vV%4s*t$6qJC&2lN5yoLN5ExdfT}`OV=J{1 zhX<}TuYXeoKFzv6TFhE8PuZc8xt}rpH}QKyQnh7+t#mch2oZU=!l{6X7XfGF)S80n=T23)%CMh|ebLi+XR#$N6>ptgP0))iQtS;; z*_bn?42P}Pj1qC>@1QF$dx>LON+jkS|D=A_ytBWI3Y=3=-N0z@rQIS=yIZI@=H&vH z+ATZKi)dT6g?@7n#tikR){||N`>~HU#DSiPx(7J3;se3Q4kn!*`wR~D6sph;YFVP9 zc8MTg+#XnN5F$|VFcyqozFEYbzRxIUlg#TN7__gK<|J`7uVF%w%kp=@}B@yYmto@eW=@d@>yp{OKh9p+;2@Ldc8Z0nCLkn>S`sXxx; z=}dEdGXHx*xfd*w9@%x2ahH@?CIAqurIkFCSemSlYIu7W9 zLOwl89fZ#_8ZBYg!gu(9J5k=Xrc=LaEc22Z%-|Vv-q^VrzP>V2vuo%jK`mT_uF^|6VF>efxlFef<{aZ?9QxD{;p4dWK z^a>D3VSnpg(uk9T+(G9yezE9<`TYW*s{micEv0!tjbpZKST7AKEUV?7`R!N^6LxrIfA{F0+|ZG7DOyt*)7w_%WNA6)jyI zFjp)`gXs33a9br+xA3MDMa8C8;J^%Wu~FZ~JH*Amge%0ec&&L5Qq~Wo0J0;Gw3LV^ z*-|nbfR2`uQFO~&O2(93*f%S%cicN27`ui}wB&e56)u#knN)$^a zbEH}pb*ZJqtu7)py){;gG6-LZ`ywo+@l)&|Ii?jv+V5j>?i~5D-7VRi!7(8hu zNY&F1$wvfWAXwJHOXxDSR)V`kr-7F8CCV1;^9MdE5j0$h_Go9+{EjKfeeU?VV}*?a zegQvEf7d!Yi@9zH*O!prCi<32e&Nwnt{p6R7OH{6r8@#BgR+!@n_^XfVH&>HR+Sy~ z0$Vy29p6$aLQM9$l5?q&dZ`k((#)1pGz6wfi+N#({~X>BWVC~eT|_uiX!`4?geDeP zG+mWOlN5lazg}|znw0LQMZRYa;LOckTv87;?wSMVnciH$bf}PA%Uv>nkTui%C0HV|cW;DsSlF$% zS?7glzc_oLZXV)VIB>(1*$;!w7{pr+sw1Iy?bw~n^Zvy!yYT-IHT0VIlt3r$lj-`D zerQdW{yxxDm}}oagUUw=-dXg1Eh$@^!0w8-VwU+`)QR6v&qE+xI0Q1wTnACKxC=PM z2@-XWuRw_z1|0U0?Ff*}`3&oUcldU}>u_D)uMGR>chtiu2Zx2bJ;58|qYE216ghD0 zDL#(pz!!y8Vr0Fcj>V&3nA~49%}pqH9^UE~>1usqgc7d3AC3YTf9@W951nA0-3pGH z4hO0XbXS;%Ac@b-cHNIXHvIRR_kw}DDYC{N&Io1w@UBglT27L+E`!~U92ciEG*#KD zdM=2u0sVn9csssU_`)A#g|3#UMtlTx!x%Iby_V|m2&n{we1r=Dvke{{4~ z!INW~>d5ev@Z0Z&56sXjJxAiZlz#%DDZ3aL3x=@Q{>mpXN`jC*Sc82m3%9=!ZoF1M zR525$9X#g6#WX%NP-P$kO3K`dfcXUS?VcAOlV=0u_(qj?@o;lIL@kmI6+?+DW|~76 z!uYrgFoqoF)ycx^SQvGW378)&5Mi}w9`rH?0fs>AZ{Vgry^mDCShhbn8Er1kGQan_ zEztgl9HR~uJM)Fd@apQ@*4<-P;E0Ab?Z}jIBsiYcoaQ5_cF2(*AECz95{|70lBh15 zp16fsiCb#$9WdJ-l19?Tnl}wEBh(=;57azh)N{s%#VKmpAag&MQgSb=#;lh;&N5G- zaYkSX=EXuqQO8N42$G8r3nyHmAv*{NMX@@qY%G@9+2(&kF44&eo-ff54z5|u^Ce2o zxBm!(_YQUcHe_#H!qx<~*fsu`eLcn9CUbqQWENqoknrQ;gHk?H#9|gF=bZKQo-wCo1r@Ck!E6 zk4X7siP%R75RJ^ncR>H~0$j|Q7mE;++^za7WA@;zUI_+-IO4afdpGZIQuo=szgFEt zVvhJ_>YlDq98Z5ysQqxCB!85>A!XDJAxY!whL9TH(-A;fTT&M3Z`9khjOR#eZ9X=i zqFbtQ3t1ZOr+mA!)c%uIp)-2s zr>yuvo0?Y;!f>t|#)c~KOpx9hFavwUqI?ppnnyqAJvL`^KX2Um!bVx{aIq8pTq4|* zHO*Z2TY={4Z?CWJ0f>5f1#Exf=79PBgNel4+1OIsE3tt^JGy?16=rDfBHcY^`+Ky4@g1OW%5gMb{(Vbgt2d>Yo5ptFqq zX4LLEUv%XCZ~4A@!1v|GaR)-#39TWHWAT_R8_XS0O1P|o7EJEJ(^zsIBMl#W*WOTV zHXk2s>9((qbDUA$fVjc67QSf~KCXsseAao4G~Ku2F)AEbGFHM6ShSXmB@4>jHqhLr zDleLdu2K5?%4?X3Rk$Yj(4l_$hwgITFnyNPi{77=*u$z7=J5ISer8pePop~zO}Z^B z-~7UFIGM)>alWfCUqile9|K~L;h)V>F$hDZ)B98K_gDBoW!9oDVk0t%>4C9n{DeF4 zw7YtCPoCDRL=XT!g6PaL<}5(Gp>-$Y*agI`V7hP^RIfY} zFvkc?m->-~)OIp(U6g@qIB?+?18UFWhjq?gpLpNl805e@0Y8F_Uj{gH^8CrAXWytY z-_XpHwRqV|$06-q@5!Ydc(CuSs<&~2T5tPafkOvf7rXR-fN!gciG@4=ZCt0S+CdwR zAOD+ll_&Wu?|7>gzXlClIIVozk}K(YY+HacLvq8hB? z8`uaw2}@Rc9pV>ATU8(62Da;iH2I|0-SKgCld?#!_i*3!bwXYIWKebnlv1OKV!~ZB{=JmfzrT$B2=*M^IHm_51^_KuGf^`)OTWjf_ctmVaZYpkD}LtU*Di796X*5{JtHR- zx{JmA=PTx$>2=}d?8c1S+|fyc@jKMFc}P&sXg%jPRl_}U(rs?v?pEjJ;X~fLLk-xt z#G-r=++FN~%>}zvjkTA1FHhN}_!T+*dEv1i;HJox|o!h{Pv4m5<%fD{;%VaQmPomzKakXdU zjH}%x@`m!VYYzB!=UlDNxY`>&=>1IS_jst{e($=Wa)wd=JNlv9wAkBQa~7;p*M`GP90AwOEit~C)Ek-5Z6?SOYB!|$Kf;lQphPh zkrEt(g>`wCFKSYcD?Km2h%zi=>J67Hsqt#ZgKiN`*V@k5L5>2@!RDyi6X?iD%T|X%o!LkQ0r!cTmH2Kp=Cg8X=;Kyx+5G`+G`WD{M zft=_Z7dosn{7yGzozSaHy{g0a)K>QJ5!6IW#?aa;UQrxjeV7uf01TZ#|x6gxx^ztKfW|~-B=yJMCK8$!-sP5?C^mc%4pa`;KA^=x~t4x zdy(NDR*Zu2{no#k;4eIMB9iemLnfr!3Vm^`SnD|rkvd=9mqEA0HiETKKVzH`>SQG7 zkUKi#33vEyyrmjTm`G~G;Q`8T=Z6bd7`5=Cd>#2!TLVp5EoTk|{lo;iJL6ZMb92uBq@KQxg z4%9DGUAlN-e@t-~m3R80Lx2{0d$d`2+Y})uD{{IXCTWmB zC}{28B3O^jAHdY$-502=W2!|lo-2hCdyP`BUV?AzO52YUsCij*4zK)ClOx6{Uke?o zkxnS2A!H6z@AleRn8U(NFa~On>*a7mI#i5gQZ6Re(|CZj+=H3o3MXGL>NTe3x{aJ% z-|l11-%;5ApS^bvjHEomWY)+sH!*QX4=EYNcC=;Qg7;=RFrLU2d^&U16^h&5#%cuwt# zrzWH_`G4-z^=mabgr3b))05(1nFo~+zM zApZN@cY-^%Is4jg=LOy-t^&zLoz9tc;MK{*+Q8byQamsW?KZBiRFY}0td%UkQ4;L>XA zU&acX=2mm|UqptsmoV*aPak6)+?B_e#-^sSKYaMejy@wGBca`Ej4cu+@fHBbR zNy#rO-m_tlH=f1z=eJUEm(aEb*;|6gV&_|1tLzz$y`^1W=lto!cC&mET1RF_ue^#6 zZyyf|J4JVAp9fE?6%=-keqP?@E}3EM;ne3W4(={=H(lxq zE%*V>AY)d#7FwALVE9_m+@cfOdnzZXQBunsM<3K?(E|jJ*Aj;QRJInP;$jENik-L6 zuY8V{EcMqP0ypbyEI3NnO|?& zr}F13DI~`Na(s;(E67pFK91y&|Dq?g;}4?nD@VeEA0d>>CHS^NIE_>N# zffHT{hxu9LUub=Yk&Q=B{riGyBWj&46Cb}gq)Y}|+o0Ez=4ZD_s`WMR;xDGh`aw$8 zTK70zRc)tGhotLPlue^{!T5na_bv1zz4nA2A2 zE?Gxw7YEZq-6?Goi(<|D0u|)-Z6D`*yo(q=E6g8A9}eyiS_PgCz3J^J1Y97kqmG{@ z)xoayX&pEny1L%=6m(T){;}yYS8#g*6Jw5GGGhKo^wSwv(Q-ByZ^3f9WSPI-bsI!l zip|=bAasx}+$X27*o6})^b=T&+kau!LNPwD{99-J_D_mu$GjwgW{ zy9e$&~q)fYIoEv0C8b7$Z*V3o`a%8F#tlS0n2Xj)lGe$dyJ z(%cz*+jb9%=JuosEbrso+mOVK8jIuy+q-D>a0@RTv>n+PDTAz2e!p?`3>U z`aoOpF3!?E@-Fh@4py05xR}C@yij~}t2y~QRL_2jNU*Fxh8BQVEL@orUfxlk0~Gde zp!MRVc)yjQS}nOApns(%bDz$2vSIi6n3Fx|!Fo?t(Zc?K$ch4;Jko((#( zf`Y~X5$Z;zFHq@@jwSP5tdN?m_vX>JwgPi)4_P7YrwP66F9*bDEB>{I^db> z2@W*Po)Zwi)T!;=sp4$U91-?h?6=;$0+efVjFj%wIkM36^x1&!%Z(yX&ad}NhQBaow{afXRj@;Dbov#pIA*zQip=?R z4(Aor)_64;qf?;uoO>>F(yo&tP9*HmH#}RK_<><9X<&|H*F;5Aj-$TA+lHkswV6M8h!~wnQQd7jY;43$~O+j zP~?`R+!8`P-XXfeay!GR{+)6bGTwE*e?;FLw^9?;{eq>oq+diR(#%`{%OH{<=u_?(hl{(F>H_|!}J0^*@U3yJ1neY8Vp z(N-C2O=(MSEpsoH#4>U{!x$I#h3u7)x$q_Oy+2u&D>;QxN{On9{?U zX+Fq-tSpI%Fe2X#(l^J+r(>@QZ0@=m0i_PFh3ZAM))MHV;uA*GjDgnlN*nDnLEG1S z34?$%*mQ(lLfh~rFIK97uUWR2)&4EgL>((u-q06-I`g+O+2z6v5E6kYMFxD$kI`;( z@~bw0U&@<0J%t<6GLyh`o~ga1gnOPFXzAQ|rGTiduJ4r5_d_%X?eMfX5Wa1l(dWc% z^KDP}*Z*q^S;SA*=&Pi@t6Dl62@joB|25Jj-WuSi#lfEeS9*P zd4R*#_&cN4A>K`M4iGEQz3DX+LS~Yco|SIvl$nYJd(xaw&itv)#H#Zr*4g--sIwM+ z<}I)F(p1ziblyW!;|gkAyp(Ig+}0mwKxJ84C|RY?l7#4B>ugxtdi%db-g&F*e<^J^ zmtsqntxTcVJx(#`BKix_`DXWJm#gP5`=^r6}7u)F26sXKWhYEgw!+HQ{x@hdq*Tj+EqB z1LJbj@bi-LWtHW3D$9RLLQt~&m?vnkX?VXReWdbySLKm}#)~%%_sWOI`4Cudzud>m zhFdoc@0Bml%aNqedq@6guQ7c$RlUK&{4LXzeM58Se!LE9+FT-mCRbPue{6 z(aZVQlO})VpF>fHJ!$@Vv*-z`QFx=-{5Bn)RQ+H~Jj;U`{wp^~T#R`_#6O6YS1qrJ&MM z1R&u`T)JkIB*QR(u|@DRFk`Idbe|C2$TKEO8vPqC&#~iot91~Ir5y9her*jg%RV;d zvgh`(S=Jw3+Hbgtx-Hm5E&)v~M`TaVYh39uIPs@sn3(-iIEP`3!MN$9DJCi2+W{`I zRcrXtq_3XTE`_7k8?x@5$k0j0Koz~BoxcnqIjc9DvwB&@ zWm)!Fy$l62aaPZxblO_$AR^pQXZZd@a-@Q^)SxWsn*ZW$Pn^|Tz?|j9F<;KXI>+?r zS=9MDYmWmaen`(#XFVo~`gY(nY_(lh3UY|f%D$HL zjbq#A8Dlu^#wZ$4KE7%^ZaD0CpQz*x>&kHGlF|8Ov#55~3DiUiLEKO5g6 zDV4zY%#rvyh;gn@wrv!@RhyG#$7y5nHZLtSx>zUNE(tSkS35hf+{7OBD05bi`osg1 zhVP+1b~5G%dl7=8&IHeqqWb)Acc?of^v)1Xz=j{LyxDKvM{g&j=pBr1StJBb%j0}5 zy>D#v7?oKqu`PmxQR&@SP;~Ig96@bZcsTTcBws$xV}>5oPhRXzZ0TGXl+c;A*1sGA zAp0!z{%)qJNvKWy2}VeV{&MgOl}coSCKXNwh+namjJp+ z{WnSR8=EqD0#3<#*$&sXx1?^&9j|*WrXu{q7j;(lgLX&yTBeH@b})FUNduWf34AIx zGMG#BA#0sIt4Waf9BqJ;bcYou1E*c}8(VwUY}i2&6}G#I+03En7XX@O$$2q0gX3_L zS^B?zEo-d?0z0bOVO%xlzR8Ryyh{&MvW9)jsPs5pz!n(W8U;nW^%nVZ*|XZD`(dKT z+@$+qqTbrVDMR$0|QAHuN&KOY5qMF?5dX@5D zzhZff>V}VWmaMFPAdj*uZGOwc-c%9ZAx6Wqj&B8Xs<>CMmy35rE@!$d@iJes%n1s${VjzYyzq!9o#k24OyP0WmXIZf&HdIm z86e!JQJw{!4l_s`QhR=Kcu^^>*ntzIX=T(vOEFAw28=_y7NYeTEfJtpj+VX&I-`9i zQ!etcLQceDP{g7T&*8=I{X0CAz#&_SHC&FIV>j{cktayJ@V!`=RouI=Dm>{#qmSl&18**5M+h+*gOJv2AVAO2=uYz=_} z9y(8CoAf)I3DzGFFUH2K85_OEWz=mf7DbICdbG&*&`|1S(d!iN^_xrCzR)e~loq;m z3zddtUbb-uHEx9G&Mb(1B|+%1%N+KGI&=NC)}c43o~uyjiZJGS zOybciah#(hQKgT`CQqy~?xUO%*j%Vy?M+%o{kU<7@sQr3Bu5cEtkUGOzIz4HUm% zJlAkW^7)U;PeN$@cJ}2bc^em3;=@$@+J>l|6<3!tkU)65;HqcTJZkcPj?yrpdwy3* zQ93O1CfkE}f<33bF~0R^<{Y<)OKRe#wEf5G(c#uY1R$)C#Y^(rT05SKw#g z=GpLEgqccsXL*);zxge6B46`8()V)RK)>xZCNj6&<9-RV-Nc+(i|^ssWZy&F z>bkNPh+Ey83_c}12eXE!f6Vpo*v`5jrlxc zqs@)2f)xF%g5>TpI3bk~x6At%a3N?#F84#^nr^mwAxKL<-yL!~{h!5gY3YBND-ta5 zTBc@!I*)k;_7Ga99OE{gq5N0~NH<_!JB2n)Np6$)zReH5WArazsdNM0l<0K*s&k*1 zMY9Acu;XLnNL@nP@osq!fZ`H=9F7uNb4p7S}-rv%Zss-qxM!Y)KRu4 zBP9B0PpZUNU_mA;vYzr>l0<|Vlf@Wjd0D|Kqr&+-=rJKSk_l2x3DuBucl34}H%5uK z{#5xi)&8XJHly#guZkj7{WQtoA_F9nvt$W7bd=a&Np@(v@lzQTNxBC7UXfGWqihnn z!83|qYq+K0qp;^PV>x~ZS@~d}bhTR5Ov)nq^7v}7ZcI!$kDRUAv#1sq-(T{4EDV}v zb8jRaF!-z48Y%68%?Y)VRa@Lu&20`{>|%3uQ$tSD3Afh$(|7u|A4Ku#3oc?z7guBj z=9$6V;$T+8iAFy`pk`ELrB-Dh=U4XAk+X+p>`GIWy7=4Z7 z2Kyu){=B)u&$hEvl8nLwAP=vpT)YW$)V@51H8~jStb~GN2K!n%*Qq<-S~}Nf80X7^ z<`Sn#ar!cKF+Iy-8i~s|RFMd*6%fe%kthu)gOHIcrV_-N&&QPwtX^Af^we4Vr>n}Msm8zpEHW8Q8!n6G2R`ohT&6WZV~7Qwp3Cci zK60yP{z7Dl$b73Ab--+h+a!gLS@W@Equy%kH)p{YI|}+}RY5n_vFwF}J6L4BRG{j% ztx0j($bocotP*{c4oqDXJHNKh+M%T=Dn^F5LF6NU@Sl*)s@xev1{a78Gt!35LF6RFq5`IbA>=AnE6`%0(+xafA?(}t3$2s$SXX+%i;2& z61VT$Y^l1MjZd-aeJoT6GF!Db&JMO1QG7I(WdB3t-127Hh2bP)Enw31|AC{4u! zWus*NKcrmQ?Y?eqXlQKUEdDf(3k_uuJ7{Q3AXnl~hla8P<3mH&1+IzaJo2UJ{71eP zt$1WjbnYXoqH|cg7Pt0wS{@**n_H6Ud%S;5M!51~p+UH^kk6;Ix?B4~hkSFdl&^hj z(!%8zM^nS)g{?dJIj7B-gP-|VHjpFb^uD^bd6s@(UIcfMIDzPMfh$6CV=4O0~ ze~#KX*(dRs^h{&1VJ>5xGp^iCcOy$LznXz${(15XBjz7{jx{8wnw7oK2$jgA7z>Ti z%{&SiH5nB7c9z#=xAl~E?q$Ht*HGQqDK%`>b4SQ%Y*DC15JILBS^6m0~A;A zd>s=E?5nL`oyh`V@yb-Z<XRz*S17S2OJw9c;S9wQj6$d(P|$@_B>!VV{b9Ra$0F zY8T&+B!8^AF}ch~%`9iL9G5|qkewRdijV^Mi~~@7u}*3K$M9ak&~+?4Ge^QLt@GO0 zc>s3uKZf<)V_@mNL-)FY)g~JvzI8c@9QPLQZ%p5iS=_Zs@SN0co}{5)&~6NlZn>e zw!RF5^rQ&`z#1;=ve)1jx!(n+fE(b>Z7f%l$NpVp0!@ihd^&#`GnvWtowi(>*mx%U z&pj>mv`&CY91(dIrjs}#^1SZCbU7XpZn>2g_6JdSm8c2dCts`WGaRx?&7We6Z_TF? z;_xQ`3g0Ist2MNnSEgaZ$XAX9i2lhuX=slLwAz(8S{)We-`am#EO!0k*oC`jC#@>v z>yl-$3!j(Q6iak&8G^m?nrfZMD;``aE5}(GJZ|}vWF!wQB`_g2%1VVa>ayBCV@{B( zg1jldAF_?8<{JE2Lx*qm(+Z$X*SSrCSJdp%>nNI1kEKva=Gbk4*lo9k?;B#}Qf=Mz zb2X-!lulX{Zn=jvKLPixyQZjqLzTr}vS^=*4`#MJ%V+cMUGg`1A34vuo7OJDJLs$Y zI_o8R+-l(6O!fm8hvlM}u(<7!CgCm+{MPwU(%7k%rLD34PP1FbF1g1Wu$hCnI z3(2iM07iOSs5KA}A4XvPaq6^?@}D_={oDWNj6`gu3qBOyU6`gSNU;1{8c`jJ@P|Z$0wvN^4F)( z%4%!g%OJ!4=%ci1BvO0+CP-x^kWwrM@3TIpkI(&?bG|^{xr27Zdy3_YzhlSeLNWSO zi^uR|LdjZdB^iWkV0=g;ME2K0-XA;Yt`}K;i}IiLE)2I!mkhD<$gvw#&HKK?yBU^Z zrut^yJ(FkSwW1e`b^*31mf0OV%e?O`mF#0NUWv~k54mZl06I!)ERQPa@=vMh^ z^!23WN4190lQx~Fnfy~+qF^Bqb?+e@HQjvlty%NHrZ-*v3eTd>O~WoKBmS4;i?Zpn zMV54A@T6sv(EUbA0h5X0TvpKRMA(GCkBQ30E}8Hzoa|ti zp#ViQ8SmV|m7uz;FG7cJRxqhop;IC_%$#oPipiV9%rY!s%`rFN2@0AZztR2W77& z0%J$GFTp?LRIu123FMjn0PFY@77>I#5b9j#w@fOHUfJH#xlQKZK&t7VDZwkJ@TW1I ztmC57iSwvH2F{313cZn{&(6Hz(P=(iYkZ7pJqb2m$pt@3IAUZ<(q(ca-D};f5^ec{ z7Gmf98#8D^@5zyL&Mu71n{MabJ1Q^fUMnk+SH`&z@;J)c<7`hTI_is-ppb~j=@V>H z1~|^IQr6_E6yufldBwe}%9}1ZH#mUVN4|O-k?|pUmRye}*10l;EfWF;cUN0~(gjsi z&AWD>EcqbiSk^~e!+cI@^r?1|WL_NSgbz(qAwq2t4qt1Yz#@ei4vQ?_$@PeCF~L~B z1$H~O&k@w$7%p0co~DeSpDoZCXG9KYeV;+*iL9N!bqaWa@ZyTYEi zD$l0lUj{-m?Sbs7mj2UDp1C(Pi%ixFd-V+)>Zt&zeCp{Lk=`td#1_ z0(g-PxS~H9uvv(G3H$vkss3EwLw*3C?>VpBz?^GC-tdMcXVsGQD1@8o+IuLp%k6up zGwdndnhT0OX?gq&rtg{8lQxN`3sY7GY(B-$UCsO_nqoQ83q#B_LLf6+^7@|GyG2Ty zlLZp)V+!JDa$y%v>wAm|QgRa(O!#%Oly);(7U6zPU;imhI`XyMi(g(o^m4_}(u8b& z()As*clv!x;4EP_=1wq)MW@d*C)`NNR!QbOwC{0`w=6W2Z>Us>S)UoiupQWy6!X#^ zV{=NW-1uZuq!d;S=l-V}Dtp4Yd%NCDEs$Snh_8U*)YUbVGN*^{)Q_!eBXdgD%4ybb zC77Qaf{hYq6KA%vXfgle(N zmXIEY49SGv=s*vK+(jT?1A6pK5}=hF`elR-iMoPvi_PPeP%{Wk?!$ zT1eos{sj*6ZQsSIbhWJ-8eZM_}t$G(1gL9~!!Po9q<(nqT2#XlPL&YugyfTc`4h zmC6;7)f+If<@pi)jEU40`K5mL$@7oZvxdFnQ`NN4kbm2WeDgJL48rV$uuE-Jo z01uZtZUas#*XER4uuTl=zUE3*ZYky1pms%e>T-C(yCO4Gxz?SEqqp7+y*RtgU%t7b z<1Xp*wa7WVm`W3@+}2DDy#)6MIo5GWU+@k6VZ8GpxXZb3cN>nsu80gi@Fdy_w*l*C zjy<>{59w#lJh&oT_46co{*ijtG}wN`ron=3r;!}kDDBVPHks$-ZjG*J-!_G`==JT} z^5wU-ecLqoUC_R5s{B^AZ#!LnFKgd+hWuXCzU@r;J*Pbx%(n58c1ruUTz-4f>LJ99 z@7QZA#p_0|GmmLGWSgaIv!ET?#cF^O#?Em0(a_KtzB{gf$t3*k_tL$JhjEm)mZ=<} zBiVsz{8>9Tbi^CDC^8o&YY!dq1+EDlnc!>Q0TPi}lD24NcDSLxE*v~uYYh#fcGOrh zefT}mo7$^avexhCoZ4Z(^{RX$#0idW^Tf?PGKIPsI}2C(;^jM3`F@28@{9g=MZQZV z$#vYN;c&H}d{*mjCOD%kXN!;oz!K2sTg<7E*Z5-$sJOEjWR6S-t5c7vAo4>#)85QD?5mycijIOnC0U@?G6;bN;%j*T%GXvq6JkYT$+upM`; z0ayCRgP*Bl>---;H@N^D-ir5+Cb0FxAvNYAZvp{aA9Bk2T862@zjA84eYcWR;i|a< zl(_sxu)Tqz;9{+I$_8>Ya4lVA_ODxcdK`|NQ33>ft6R<)nKHSYA##$21BD#+|AdX2 zIQv`Uflt2Bkx9mmz&JHghB|HpOLy?3aM|D30a%k~GYXS?q!4hSVaQ%YmLxh`&w+r@ zC(YsC9g^Km_IB$b^(|a3(ANIWDFu5PWx2lQAdsk@dt`a&Da(_lSsQF{lLOf{(=OmE zw7kjwKujKu){W8+_wo^6E~ne`BKaghjM>>TEp9wPXWfh>ihNDMN#pP zp~034oP6t#P(b=V-Pc?u!}7?uz*xK2&Qo&mu%m{@ZT?qF|0wlZg70k=6~^)dMy`gg zSK&MElQ;m?){k~jz21seI@^qG9Z-(_7~;DJ9%1$@yMIz27ErOrBvWm*wJ<#vOTABCx>LshzMLS48^>@PLU(F@ z`MlsKzzDYpQr)T7cbB_e{(8}wt?#oqb($BqsoEH;t6o*(G=4p|Um_gEe@bERxxJKE zN$I)WZ+}>sEsk&rg;Nt+iddx|$63p`M|4@7+*IN6eEDw2j|nNamkbv! zbjyayFn?3h!*8oNQ#J*-V<^fbwn{Aaxm15ik1h&`-IPD&~%=gGbf-s-#2 zD&5_2BjY`~l=Z6i`Uokgo#qL_%fn^wiGV#XG<-^6R%rOt05-HqoNXAMjA?23w7|)s z;VFUK5MFcK4>L6|CNz9HYr5exxQ9qV5u}V=s@tfOwGJzOU30tCoV3T*PEPFg`Rp;(2c&(O5n~Or7DSqp5H>Fe^-Iu4j&!K39 z-6oN*ZiQ#TN9!g)e+9QYrLgQOLp`qli(SZd4p+OlqF*xx7V4DRQX6LlzD~gF!eG>W z`9ybx?4k87&_p`8UamaR8T{ePCxXzKGy^QKgE}85l`=!VruwZ6{Wbj9I!!iXQ20A0 z5u;!&3Cmzz00{s9$7U_6uJv07TZ_+)O$EEVMD6evC$e>Q z#Z7a>c}@K2!gsujsx#*WmUU5yVHLi^cNXubL4xQw_5QPOyIpfG%T9Hz8LKMPe*Uyy zOr|xlqtYDiUo>{2S0sR~8M7VL(?tM0#`@7%aJ*CLnoMQWlYQK_ijP`T%jIj@cJv8X zOKhFDJ9UOyuXm@;8hpK+Hq}}4t6&t)i1j3g$_Ou%dW%177>nOzcWPmI@rN4*L5hPJ z)m9_@%GaV!hpb9|tNqJP)-mDx79VB`!gR)XfoQpPtu580SQmfS9vw!@<-8mBUCm!# z3j{zV;@nowoZBg`lQ)VFS*UZ2-`d1XMr}rmS!YK)wJ^eFqYQmoru*gaPb!f0{3(O=M~F-pB%u;F%`;t#n-hR22Ba<_S( zl<>RvSM$O-S?v0ds5|u>djeHh&QK*4s(GbM?t-~*yXp$R#=x4YjR+#j-rAS?btpkx;Vqm%@IoBhkGjthx=8~M^zKs(W zRj)j|&RPxqfUhofVJsB)sr#)&E-DN>pE7h5&E1>=$eN+J0U0Ia6Ex-5dWcLgf$^Fk zx;V#Q@KLqgvX-YnXW5vAC(W+5TF6PJXaV>s!sb{zz8-H%;KYSs82d(!Aohyx6RzN) ziego-z7<#_W4uO~s8yceiU+WmL{i z$_=FEQWa6*sa6^VfvXiUbES@2YuV{iiKsUh2<;`naE?{^HB}+nRf{-%`$L&Nyd_&ux3o9rT&7~tzQuJmHzGaTzroCdqFrcIUCQh z*3pAuU-(o_V28hTR8vJbO^H0ppG)~V z>ziL4)fS1$TaAQ~!hUNkr6U->ow0G%=2$kHIo`6 zipiOe)EHsrwtjVoGfWhQzLviV0n6<=eIVc_t6(xg(JTPo+EvuamX8-v!}m`RhFHuUTyI9Aa;T#2sq$>7l# z7Y&_5R6E^eD=Rp6%FJKc5wCmE912XZdgcv3Y=PN z4w<7@i|!(FzA-7&rF21Y&qm)OzuQMzu{@_5U8T;tt0m4A!c)GMGZ=-*0#Oae1Y^8~1`0*=z^V&HD1JeYI<1@ts?pQTyQNyKo2Zm5?q^VxhC5~ci+v+k zgo0|=>N5}r-SCL+zqm4t@E6yD0tC&hA{e~D~J%ytE^>q(eTEr z6|l%yncrzOmycO*;xHQLpEp24i)F<^0}wv4hqU%%q~!}{wvv`Fw(L$Yks7A!KaMle zB256rMC#j_U}iIsBONs#U6;Tja07!xbwjQ7*N>C==;EYImnsSfD`izHR=N^gqf?EY z3vE8SR56VsViX_!5@>%%zVtnD3?GFKmq0~)5?STr|FMWr7d2E|N^eSg6HHjk0dJ-R8pIwZ*yc zH24ocPdIOy9=)3Lq=2j!%)5oFH1A1Tl4MeRC+e=Gue`$ggl!5fX3i5%(X(;KiX=|? z0PN*J6)YqJ`FThid4)8_vR2@miVL|X4&p8521s9X4_p+@XqN^r&DEoT!=oE+DSoBl zrh@&1gGoValiJABx&6@AeqF-0MDP=`x99J(W+K!UM8DkKP1Ihb)x>+02V- z?K6)X)G9eXH`tx-ipcmDoV51em(cz-44dlbL{)p3tms{5anMt6dItb zTvr^^I{z?tj*^*itc@;8aLi~|`PINKTO&+txaQ)+UX?gQfs*YIcf&_DmiJ2qnQY>k+>~LiqBI2N;rLDKZ_z5(x;5=4w_Ow&{Y1iF?=kipUB3IDOX+$e#ocwn zejeR>-$=!Qc6dA?S$etgzT0@ocmH5Y*E=ch?h{@zUg3qiRrbD9v`@Vclj$JY2Dz4? z=B>;RxaJ`9h*5EfXkbf;l;Mq42@dN`oN~ujy%kV*FVwsR3d9y$=;125QVFkvkxlcpiV4lAc(|wHQE94C^FU9< zgX)P`35SW5z%lYJjv`giF0BH^d*~x>h;Rq* z=Z-+5VwYL5*)5mPKW|p_nl<;IQ1krYmmem|0k6J?Djszc!1ZAs4j47hx;cJO@xb64 z05O9P0^I$fS@i%=eGffn20PtV_nQsRrUo~UZ@7PU!?Qj5R?D6WF`K(qO<0>YJJ`8u z9Le%-C!1Bz8+)W9gxbX~sptyNu04U`t31WstGywBgle9486TJxyXc4KigssqW$u?i z7fT7rCOB914u1Io-$PXoy7xHPR2>jpsydA4K(%OhYSm`r==kN*;G&rOgABsIH_r{ z1$J#x-!7tO33JrI}$2;s$y76K`clZiiWej$O`!;gXP5(T77Z5v$ zLK4`C!&-aTR`wxZQ$Pajo9q2AZ29e5*DT`H&jxCAVhr`jh=LO|F zgRzT>=YA0vv*C1cut_iIBG#ADOMqm+1ES{eM)6mjr-Rwpam6@6i=2;A1wLh7<9y>= zo@iG4#>0e9<$P|J$9U1GdJ8wMa8?Qt6{;+S_X2$@ zSI-riXg!=-1#h|ECOFgRCOlE=Z$X;5rRpsehSjL^h|`ug)Z<+Mxb^QwFiP`X^7d5p z@hn%l$j`bj_f#Ax<$-_?1r-Nmt^>vi=6vq#HEMPl!mDlE0`rRNgXq`qHk=? ztE!^5sspBsrCpGV8j~otKtxu}tLuLakZSzE<3Xr7vn;B{2@U2gX->XuD)xE>)?lp>qBPnE$BCcPB|DAe@x~%=@VV0?wP8?^ud1mK=@Bef~^$Bqtb(D zc%JS&)hV|?gI2;oB+B7N_Oo7P|Lv5X48g<}Ds)CEkq5Xnhxid9^`SI!ewriaIq19V zJbd8>sxfp;=LUj|E%|4Az0tHSt{M1*>@DsxCzlp@y$$SNicx%LvcB?xCCiiFvOn<%9gPm1Q71j$JmBo4q zubjjgLJ4QmbPnHC=BKn<78YycFl}R&s6PZK{qd*H$MtM&cr`>-swMtm3@4TT1FFCS zy85JC2g#-PU`%qb$4QvknGWo-IEX0=Rc%T2{#**O9&kk#QBcZlp5>GqlPI@HmrKB0 zDdpH7az##|oQ+SS=vDGrCIsbhr|>B)bm0C@JO;!TvwoRWc;mUwhkN56PPY+FQ127I zb>Nxhiu^l&pn;82qV!9WLpda3-O@C0!4;amm&HMI7{^aLP+nS4w5xUUOW9Po!LdinP}|G46w$W!5pPX6_A ztW=#V{&c-8P7B5E;$^WL7$2S0&a{N0Re`qnsEQNEyHY-auNJX;ZS2qd01de6VPpBD zQIxrdsgwCrX{2VuE=1^f)R6AiYA>Otp2OPQ!VUyZ(k-UL8mp+BW^$5RE+ zR;dEJdDQ`m)hW7inB`G!O}DmTr@LXX;_TRklFhn+lqJjRWz^MLXYpcA5Ojrs2#s+K z@KlE~HpQ-MrI8~d7lg{Ch@y^fQSI4P+^uTekW;X;pj$VCkFMxgJV-vW5gLJsobfi% zI&#JPha&~7o9vlhVOP+r@e6xeZpFXCZ#_(YFxPlCiVMwT2hW4-=nK<1IDSd{YxJZ& zPeTNHmgKcy$KGSI4ocv;I37E$Js~Gi+?uJj;b^y^Y1JaaC2Zssq*_ z3v!A12T&`@vzhI{B$%vZl(t%X^|IZZAnin|Pd6tB=FGBM8SffO-`Y!pD8&TfKEPu{ zl*M)e*#mi{TQ{m!;l)W_k!VWR%2(^hIJ!vlMe2}MrOmLjD!HMu%2(?)JF5~Fl2H}1 zme|QkG%4sRcbT0mLmj{>ZJ$F%aMU=+SL-B|HOHKzTF5qz>HtCs&*y0rr+G{J{ zcVxjhyXHY(i}0n{@L<=wso@{p%tXQ^2^29{9X?>*p%Q*nPqI?+2fOmg9Y|5jNEJ|P9C?wtCfv3#?^qO$5iR+KCx(GwJ8Lqq12a zG`&PJxCN@_C#)8$KQ+sTMzzOmxF@rxXrI%fP*m&iM#Iy(u-&fniE28vd+JMSHA8#Q z%3e9G{e>EQdmku8&^x=Y9U7JXw>JS`*7C0(wj(~IcGB4WiO1OM`&kz<@m~;3S2_%DWpd2c;r74%H<^{XArfdHiQE6o7t-1)o<`#f zbr!a!lo>VN$RReWNegurp}e=c*(gU4Y?}4kUgE&RPis9^hJbn)4Z?nUHV~s zK&x~ss0MvbY49YwaM0VDF2Y?3%RLr$T@BvWjP5H`va@~QtRprZZlyEZD!i=~&;0#K zN$w4_ZdvV2N=8M8o|nc(3);R@ej9v2y_%~j3(JW&Zej4-3S$HhZYJ8uyDCW(khG(h+K5Zau z64T(kXllCvo@8W1j-pza6`h0wJHgnQB+RqGXRxp6ppxe(x42>EYVn9$;|gFfaAD z0?P-Qvz&;LSZuLQt9BeUNle_Wu##;(sHvuopPfCp7Pvk@Bky#T!a1|^g21O#$>wAwJq~_;U3%dNnLS3e?--eVjXl{U%k0+`o>|(0kVAv~)#Y z7kTc?gfr{(Y9dATm-Q!0XnqU@PS=RaR4cPA{Hg@MZDd&PDeLUwevMjTg-OyI7#lXJeP!ks9AOYM%Z_bA;Nm`F}D;bo_r| zj_CM*GDpmy+nK`KDmvo&eXQzfRQ#kl;&qOBBR&#ygmnJMIii(;JYtU6s)UA`Be>2) z<_NDnM^rLLpxs9=i(&R}c(k~|yDCro4AlJaXE@lbdi2WTJ)p2U0{2m{JGDq2f?l~e z`LA)akFx^!C+CW<-jdM#pXMwA7ODT~93l55{KGi{`&1{IJ!^u0R<{qm^}n1a$^h`s z%o97v|39B6nmN@z%5w7!0FIm|X8$>Gq$h35&UK%Z{s^6K}B&WYL}-PZ_}m7Qq+lpsz*Z&kERAs=q@|zQnnU$r7+z@ zf2vemWn!nUQb*c4_7=X%mhl`}V{#wjGm9C_?v6rumz&bK&O9jbesaz9HgBns-tx<4RbLiPU)O zj9$Mrm;G2q87|h_ISUHN4+ANKY>Vc!=0xSbyn0WVy9|3NZ`~diFFd6VN!ngX`xA*?~PZ*+;i8J`%0H=}c7yuxh)SOdD6>&#%Xm5^cPL8ixb~cI*a`CQQt4zb>Y-{MK zm$P$6y^Uie1Z1{auZNE21Wt`!(jK1MOWg0m=(orx&lzi`sdIXeHDs~Ha?#o^ar~(l zjPc2eoTXz|MKUg3{?Xd&jQ)W?ha!coJGTj{lqlFi#OvZ6tIFKZ(N3;;!S|76V5SuMNQRfk)4x4xpulna^8Qu|&BIxYRqv2>~=?N~Z(;Iv-bl%fIUU)~>z7M5f+ ze$lr*(RJHLcHJ57*V?9B(R?ttkJTfF_H?6vuunV*bBqsLIqeiJ;*77-s$&n=L)-ez zG}}HLXq|P345Vt^myZ+mOR0noQnoKTefLlB-VK`f&b4{ZzhcwT=d;!>_dU_AnGcrh zh{1clCtgsjSH8lxeW$xSiT&(29+Ku97DtJw;oHwjien*!#KaiVuJ&??bx#W7&DD0cfAZTh?XR;J~hoJ9`vEb{Iq#cw-oc~=9!wcn}u?LAxGy_Ye2`Qf$x(0hdt z#=yhywZY!vzExjTgi&Iym~%m`Y<}i6?+Z5Rq3DP>NHbmhS(E32H3*Z@WAR@|8$lZh z#eEx7XWRIq-Q~^u0<*SDmq`2GE8O&nbXVi7u*V2zNq6CdB(u{b_ujVgWDXu=E>$f4 zvWPbvZrCGVbc}3U-db%fxE;n?YzwwOeLK!rD#Y_YkZVjrPNyX1RA2KirBm3@2+Iwg zR&<5nY!#MdwpP6FyMxnfu1zsPf7OY;JKE*#C~wdE?r7%Oz-!NU|BjTdL&~+)x4q(h zb?iYrT<_ic&QppjyH4I;{Q9c&wY7MLEs`wviX*0GQo2Lf^Z|8FMkeMK<3km1+4v-o zG5AVouWL||B!@UQ$MEcHEywoD9@0kii}LH8iJZUJ*k5gQEnFERc>Qg6iNWv??zXl& zkm6n#BCdZxE9EydYQjDXrY86bP3K2EUR>dt93dROMiqUL7f2w)wwIXW{B6V*=}ifY ziI(%56F4P0JA8%k^97MZQjq72HPa&pc!rAGZI1Tcv6BS2`nL8AeCBMPeji)=Tg4TJ zr4yduJD#G&ILX~1TbZhDI87*LIcx9@oNwJ9;;ecYhg)~m^P%?(@fH-nD{)~Hufgpf z($A`&#D!TpDONxy$*9R#b=~YLYgL`mf3Lg3I)MwSL@XbO1^X-yyX;Do7(Kq0lPF_0 zyxPJZBVL7vlllr*%;WXdc?iVOW9T%}M)%dG!{566StBJ7KChVt`lBD9d7PyRf)m7^f1gAd@b~nYw&d$ zi-iVP+9_RQ;W6X!zI8yVww~H3>vVfaUKxrHNgYZ*J|^?1kaH>F<^6KD3AaXkbgf&8 z6j9ko+yJFH1-kN5G4^pdR>G}h`D^QlYq9NOOt#mFHi%xB(wM#=;ET>_4;}SzzKzNH z3(>;bxQ6^qvOa23^*g=b z=;V2<5I6un64$2+ZCriL(nlKKZN5>f$t#|XZ+3chE>@vTz$^6m|s7cB)XuF$cb z6pTxeH}-phU|pDaHw5$i#QQ7`+eULlJ~{ZGe+>TI!CZme2}e>KmT_{=4akYt#zp^W2T|l6N+rhAhj_Tu99n;}M)hp6a|e~pOOg7{qcNgQA6l7TZC%GRO-o&VDAe$( z8{GN3>O}sgurE#wgml_O41{uj-O9ph>l|{2OQwiCBiI;&ka+G5;vD6G{^~PFW9>;i zD?^#Noc<0@?h&=a)o}>llkPP6TiBiU20t#D*L&RZwL9%g=acZ{jr=tRT6;r>+_F99 zp5Oak@PoO=E_IL9=Yxsg>1V;r&@emSOAYobptOTzXY)Sa&pN|byJFE4b>C+5KEoTFa6IbFV+O+RmNMAa+-Vc&DIri` z=JqkrtSGj^_xLWN;tsE1mD?+AOBHp-)5Yp%MVIBhs?$mh9xS(SMbK^4sJNKcCmyfL zA!v%{{fbq91MW$&Tsc)u35?rlxI zs(E+tB?&YPBVDENaQbnDnX`iP5^%?!jl$aEmd(w{;n~iSCS!X*YJN_0r(M(U>5=|9M<+EcJA! z&sv~x;wXvJA0~70|5~=dKFPA>bHMz^vPD>Dlx+DNa6i9n5!OkTEsA%fhQK&=r-Ch7 z@L>|ZQEYQu*)m5Nvr`6NZW%eWPv8EZEG6J6;=H^=W7L2ykO6JTfX1)t9eW^ad7@>T z>4H0sThBsRgL`5OB~Oel%^RaDovJEj-|{o-RD9qFkt9B-Hgn8*oQ26`w^L+^Sn7{E z)11?jnl#TSF`AfXd=Kt%x2Eom7`<0z?g~a|po(fNdLqpKx$8Lhv+5AJLLI5Csa=s& zU5VvX@=w-r@$u>yEn}$5BXvO-Y0#mhx|ALyHa44ZMF%r?1tzuZUN^pFcOwzNTx-TC z|7vv(Sgk`~BO^~J{MquycmWM&|N4xIEb^nAG3g`J7d;0Nr)=B zg!*kOx;XUA5EVCl9_xbT?V{tJD?09FQ9qf&6`%UK`%*97qJCxD&}px0Ki_CcQrcM7 z2ViB}KyNvR79fxj>$HDE+S&iVt`-%E{ z{msH>)!?Lpk{5LvuR9S@bbL92uUH4pR4B82&RSGg?YFLdL?8Ut7x?MnbT z)bViuzMK+Ol4SijCDuM$e9UOK2RSV6YBk=9p4F0IclrdQ{YWON! zTg{QyTz5=W?ZgDtar8B+fudw6hK8cC7d$lf`pLoG9;emSO>^3*%oX^;=I`fJ@F=s{78{CP-~cduW{?RklqKL|Rp{!pYIE ztNrk$H5;py;KIGjp(B}r_rWUgo`fKOo81mN!*Bh&wc|IY+t~xWeBOQ(x6pxONJKHs8ywCfhp|&3pMoi`KVR z3_A0Ss_y~~ZToHi#+-9%qWqq8zNQQNyQ>eSC zVK6`Nj$C2=q|=m_?b-JMb+R;Zj#l$Hdeif|1yDL7XYSjrAA^j-Kj^#TN19fpKL)Rm zAUSj`o_RypHWJ&kGLRSjrp&u5h^spk2!2iL(kFojSJvb>ZGM$vw0VPZp$J*{XSRZK zF0pxsW)hoM?%U?B6@ig0{&1Oc-wFnQr~FSO`?FcK^(7a0xq5NdR0j6h)G=c3v(({< z-`tWkwC3CjPsmZpqH9ULtQZEr|_iGGvJLCcFx~{xy>6Qf%tBHF{$v{0>-54XL?L(!S^tq>4)EtyIonM ztZ}M9;x2Qs9}AO$P)zGuc1(TRBI7(0nEeW-vb&EMI86?bj1@@(Cl6sn|IBf~&ZI^; zn8knAPpCrC9R<5q&xBT91hImlINv&lcCrpX$Sqt6zGBD)h>TnEm4LTozOQAQfSFIm zGud)?HFdbmbnn-EEgYh9S?7&RUg2vglw`SkK;>?0lH5QNTeISIyAPr_2rWMXxsgym zkjh>infw)B%PW%nhmpwvUyJN>S-%;Xyk4ITDLSYEXtY~*j{N*3U&|ILwQgiG4U&CI z>q{h;Ooyj!bl>3pseiqHoG41sa&Rs>Xw4ywwuJpJg@#Mk)*>JdZC1R~^=A*;o|!wN zuNnjDxsK;v`}ty?pEU;9wBYm@=X$-?edl5n?TpTCA0b0K>Eh^#Bhy?zu;u0VZ%*1M znu_pL@-ivzwbB>GN5T3L`w(&yh8iDV_ua9UQ3Pil+9KmavtJYHzx8#!UlAJmij3d+ zGJd}%<99(YuTC+JbQ|#-j?98d{OZ04O`OO{balIvXQzZue@4$MvO2*icvmNzx{(>w ztH+gM`7G*G<0A4J^p?3ykDGO%5&0VsRo?i#mG;Y|@!PAnTCAsmp_+!^^4;-M3em95 zTb=Q%>bal1s-Eb2CGWp%eV-IQ8J=m80jkzGf%G?RsNG;7adX!J&svhGqHygDz?c3) z<^YZB^L&gfba2(QyZ|WCakflnXg@$6ku^C9K;Zfz6$32i|BS$Oh_z*OpXl(umR@o= z{d0(P-G;~PHoQQJZbS4!RoBWdTiZyp{+;U8-cRVrjKFw0OG4Ubt(;-~L|_y1+kyEV z$^9)Scd}Gk;$-;>Sp@YOmCKe&vqAgeUnY2G7atuNbBQWIVnmgTIX>Z5Cy77W_%$#@J{^7q(lE$fxemQDNPq!n#L= zb&oCxP9^B3@gajubi+9FT2m0`5jkI$pvMLlra1j=-vM7(AL*9MJ<(R3s#dk0(esAx zxXlkJKM{NUlu}l$`b0Rqp!@IRr2fn2yXrsr{u>$la=)XnCv5ivgmh$>+)h7!$YHC| zeft_|(iM9IOGN|vc81fpoqSF1+lP6#ex|cNo0HtPUvm03Yy(`ca@l>GLErvg_TD`{ zs_NVupCprH2!j(OK-2)Ef)cq%xG3RLbDNL=NhX<0zzfDeCM1|!GkbHfgd`55Y`4>n zwVtD=^;C{}UTkS=dr-j}2~rX)wc&DXP^{5I>mDbyQ8*ATW!~?z*4{HaA*g-N?~j+? z?+2gB-g{l2^{i(-&$FKOthFBaS-c5T(D@pTD@dUA?@E>luwz0+6CYw;19ccBe?tT~ z7@ZNT{1@H_%PL(*e^9OyS2bW_s-73VD?Y-vK1Mm};0E4b-@?ZwdNU+*Qf>;CKC&}8wrBrbnVU~sPE)y2ho{j>woLW z|3+T0GK!_t(b~(uj5pyBKpnUE*@Mg!QG&I9-=m}@+LZ^@4qyUjoWVf@NE> z4UnDPcA6YqZ2f$a?k@#d0ft4Lt@K9!_)MO^(Oi&%l~-tUGUf+Oa895o^3R4HB2bJv z{qh8w`$Hr3K99sQn}lP#s+C$T_J_m)cA1-)~Q5ST3xM?vcI&sD({xL{8!LC5>vTYy_HpvYSfH{pst7lk31+|wdwoAMba8~QOvVhnMNJXQ9Jkv6rvI?3AJ+%9q=r$6oY&#v*V^{vfw44O$ip-t2z^dt-4!ng0zsz6fW`Q}4BcUX>QmDzoXTCMNV1>Hvvg zZu(O|;2F3P?kQ)KC)s-fpN@V>Q`BAp>qDBSzEAVi!x4K?Tb~JhznTnVaKp`7p^uX<;qTfPonk>dL z)PV|!RkQikENU{&uh!Y#A~s~~s<3P&D>0)p_>jeX4@Zg{m3zsihU4?HaeNr~shI0& z?u%n^uE1gB%5KygydFF*U*X_aj)l{6d9NNTD;dHujc8)aEWEThp^vw z+rG3j6Sxj%Kw zav0EHVjSX9-7+ugs1m0Z`YtX$4c}VYg?=kmzK1Bn{292YvDEp@{tolX>E%<04j5mNejF{miD-yhdl%3!XZ$m z&;%H%{?5V~}a5TbXx_Kn@dLzDNV}g{kcn42q^x3va=Oiz5&5)2F zduk~I=4bL#lwN+AN|K+VSjjlrvzYQn`ATo^5|Ne_4qhS`w8}<{6wUMOp)?DPqc@ut zvfNuRj?L9Iz+K=au50Fc7|>>%1?qVxaiO@?@_0Tf@XL#-#I!Rpi!V|U;@0NteFa^w zo55=QapW77^vRG7+PUDR*EW=@t}LIqCh9Pg>;h1TqhZ= z=_F~`n;n>nw9x*so$1UY)ImlOipzA7+hCx#nvn?P79i%f{Q-c4ML1zLU6<+o1%l8l zrf~lGGnUMA;a1DmUsL#nn=D&N(+ZFe6majkAi$J(p_C?^RhX1q$Q4F-F3hxeVaN?B z^27A@H3Fn4A%-3{)-xWwt*XoNVF zUjvg|UMx^P!M58)3&bqNikH@9<|yS46p|{;S~OjlzGwmb32>oTwh>WAyRt#cDVR7Q zGyKX=SqTE&8%K6<<&P&pLysZQhjV&W4UufGH0Ej53Qy82=t8|gM+77PEX1K&Ha=Ua z#p;^29OD^?+d`{_)sGU(GY+r@$T1zgMglJ<8S@TYWWigd!FG#Z9z!P-8!fNqBqwFT z)pG>y>>HzeK>()V&!SZE3DtF1)SpJRN4wzQlzSsNl_qwX;6M{1p2H zrt+5mn3{MaCvIw;w;BY8Tcd~w6*vK_txVw30*Z-2o*1+yWuu_LJXAI0!b94bhP#){A!CI1O+jxs`3 zX2d_k<2w}>Qao+1ehuC0d$tSx=uo~_2=0Q5_~vN92i^uiepE)!=0Du=cL6%AkDYP?j(j$8jHsF zB!){l=RJ6AGRX*RrJvjU=k0`}m{`IWAbH+|tOS7(&uZ!xJrXGqAyL`9fDvW{nS7iB zC9Oo+w8nLc+O~Zoa*)a7D84#l>5B+JS@{WLL}qxPFoL)h`3dRpVNwj3d@-b3yg#F~ zLNBGYc>VM-i87{&BexTVFux5>ApH4k19pXMot)9FS28G1s`!BHyol)`u9LW?GnR6o z2r}m1gELkVd%4z*4jNo$2HW>k_XQo2uiy%(Ug);zkB~{N#l5=^|DIBHJ@?r{&QHfi6tUGG2~H`9v)=Ig5}(;9kVDF-~!WT3y^-`ZyYUx;XVd4qhfr z>~wMQ`g}Cm)5Qhx8Lp2efVwzZ>kG$4;3TL5v>!Db7lD(-(OPIYE&?aT1-HOop0zsy zBMXOb4G)jN$HEJ>@Ca-y{0`oCqka?VN1FU8{|svYh$wK7!$AG}0QK*G6tHl46pb~w zI3(_+u_3QFUsO3KpOn-BZh0(Aa|HVPV(Nt$k@yyy_8o`z&Mw)YJGtPQGm58(vv}cK z5Q0%=3{u*aBM|+Z?W6>={c0MT=pil_$|a}rROOfbcpt#Qor{s%Gq70Ps@07-)^#WZ z2J$aHqIuPT)UTbHPb$3?I8c_OshCCL7-O?f+<`l+Gy|uYr`UmZ=^eNvGQTlXXik|@ z@wmq4;^ljBcZ~QMez+pkw!>ci98lzYwuf=Kr=Uy|mm`}V7g|ynmk#A)V1Vgx-1`eg=-c~Zi&0pF02dwb%hFBEw{c+i>4??Ir^bC<$615mgUtL%d19Q+__KuUq#+f%O}b%MB~!axr;_X%}Rip zHAei37YQJ-|Z)MS(%GQof|*6=LW z4%nqy=q+LcbJ(%R+jBk|lXw{D&%?KIDSR7orvdJY7sh+en}lnFNtU;hgEyiNEPIoK z)E9Cx?Q4W~4xXVr4=Nwlwx#;&!bl8v-ITE3~y)G8?Vwm|H!gTF{L z?GVKNx>eZMO08l0>n7{klDut9aB`J2hRp}?NS4M(%Z#}1745M72dktYH08o0*<}p5FVu=Ix-ZI6xjg66@wb))#rYyl1l3 zwMw??*e#RZ<`L?iq(n-fjKxIi(I`LXoSNyE+%$RcTibKA{> zuBZw79JEI-o(2}zl7OAoJ=~w=P8$wmww-Sj?gsve+jW7flnBaV(v!KTqn& z&ZX-k`Yl^Ym!LCI3;M~$SG|`bym^}z>kM0($%i4vgG=8AY?epc5Cko%6+Hy~fL{f| z?NkK{HlyI`7KL&>7PBobJ2zC&&(=uZo$5A;@Ix%8- z2-6@4ChUOla#6xA6+8PeTVli*1sbP0Fy0sKtrjgd799h6Ol@^S3glm!{EVnUcAUv9}5MbT{-i`6MLisuF-6mRX-(+GAY1jju zio;pFAGY)|Wkf3k?MFGFbjM@SS&I^|qQ?$)77}r<&2g!xIpMMBOoWSHVf$>#WX+Dj z#)p}zELsEVkQ~~O6uMJcw3UN%gaNZLS53Oa zD6KG+gf=X~_p~MEm?e33B)%EA1MJ|kVmt?aoV;YwGf_*7qgR+Zmn;Ht7zQ;WBDYh} zfVK;LlQ4>C;m^~)99Db`Ckj#bb2yY=fy59jt)d~txDR7$i1*{5_teV4aTSEdha#`R=x6Pfx_!bDUTA58A$R5hiAw&a3%skkPprghNn0ln1NdY5=p$ zEZ>`m(T-yPFuL=s>A#chDJ^;F1$~=ivB!VIcfd5{80j7900=dTup?*99sS-j*zrFG zM+Us#G6Cp&XTx~3A!bv`v`uE|?iA^}R?sFndO$`)w=;+45Z(m9LD*S2SK252N%~ki z+!2}-(_|iljwv>A+CP^@y26MK;ih$l6=j%cz<8F@qLThbT6vZljnYOc#1H)tz|4oT z1CU~}z#eBS_SUctxAA6h-T79x_(Y--6}Xwck>xM`bAhIJMw5|@5_!bwb)F~=|OaJl;!uc4~R_i zXGK7K^AH(kA$`c9{2@b~8Zu3qbUH>8$&g1YsG(w_vNBvRPO5{}WeDErm&#M54OXe# zC~d%Gv&;cW^CD_sOS|Zh46XSnkMvS=^?WPMm9Tz~`Y?5v*qO^+FLD!6prJE&I)BXK zj}-o}(u3yx&8y%ox(7|=NqgoW8sd z7q^DoDL`-)vZGw|qbg_Z7`RgQWGQ>PMD&z0E!&K74DH4-Rl+8AhY7T`X=G}hJl2yZnY8jeFI9Fp%$ zf**hsO*{D6Tmo}Z?-9C@8akLPCJAG3liIaYkSD~;9?>mDfk|B}kA^*j1+{kcjvuj4 z8jaO+oE8bxo7zU8%GO|9+l^rSEmSn)@sNsu5x6o-xkg-BN4cSij+3*E9ZC`dHC_dk zo($B)FsSIhZ-VuD8JDF3TyP~o+|MAk;5r#86ZdHf$*8*6I3?n6)fCd-vG^a69B7N-g(kSI&N=g1m#D1UK1^Y(!oouK__6xIV5}Z*<+9sgw zY@Gq?C9v6{0RxPIP~14Cr{HpBVsG%}+7i42<-$DRZSS-V;Lxg&FcBzeHHbGL{BUom zV1Rv+8RW}gJi@?sVz6kU&3Paal88I`Z2flMDuppAC#!@{{e}1$mtc$!-pi(aP&aA& z6ssfAAZDv|^rH?8QfS#<25%>LvT?_!a3ih@9gCwJCP*JpSeEf{uat#5EuqtH(!8OIZEA zynfv6i_15~gpXnZ-$#kmE`lSLaO4>{1Qax1+nGxY1ZM~I(j!=mwSe}P66Vj73fI<2 zTdtG7f?Y2N1+f>Oz=@i)CAjVQZggQtE;AnOJ^K0C?mbqNaI>v9_4v_V43;wEw&O?Z zdex@lK(`fTbVHwV8cXsY*?P1Fg>{F^aQR0l5E?FpTiL0w;&o^DF@hN_oxv_%PA&Tc zP&A=!3+mU<_9-&!(1y0_`m7H)Q_yF+!e~XDC>=*1 z7K0{m`W3jQt@m&RF2U|)vBF=_L_#U68V#iKbPd$iJD66^LLmU5s>6eIO_Z%qYru_z z8xZMt;At@Y4#HCbgP)W_GJcTXCwdyk>1jZ1K_VScgYhvKu5vwGxC)U?+JIi#_NGCH zr5-(cb!{9B+iO(T5ZF*8qi~>Y4v0^KkoIutAiOeN?1hIy7;mF6FY_ql$@m9`9MCu5w+r(Hg|W4bS4sACVkV9OlGe^-4EXaj#cD5vhJr&$9_B0aZOy$TVlCcinyHeJ(6aR%%0hSnZ(*WX z%kxzv4_a>VzK1lpBp8R?d1+l4riY*~G|xlabAalBRJC~jg%YxQyzFijI^&xA5zsjn zgX=p#D6hDh^P;t&bTFs~m>pNVTXvoXgDMG<3SRv?!qty&XSiZaUlj-q~jcLB-{x%#2t?bHW5A`;8ivUxz?-v z4(qPKGo?HtP5>eo)3kw3Y-an%SI@b~Qj)54u2aSaLYQG{w$q3%#S3Gzg?+w}k z!%(%rOyH}mo_q_Lf#+{%I?`K_K94mA0E;o9g0KjfI2bsjV>|(CV2r(w#z^{n62=P* zlyL_Gm?7gDZ%nxU8RcG{7Nbo|JmO$r3=$&^OTRXpp7qTv>OxrM%9O{@Al^6F=NYph z;iEXVLl*hMss}_UR%VVVf52`A3<*koP)sGN$3#iAdYVs$MC_Mf>{4Zv>Y_++KFWda z1rr8lCE{%mr_^ne&{4hXfn4fD)@_P-O_;Uz^4>eP0=f|-?MtXtCo&>3GSY?vP>9qH z97i3PN*##Z>@ngbG=~oVP-2iIAX8mul(UfC$9tJC`ekio_p>@x-3o+7x)tr2EMvZL z=*gviv?mX($q;9vIn=4NZqX}3c~Y2>P}wwACBZ8->3w)Y=$bUNAB%B5l)fKF>iSW= zPi+v5Aib{RK^z~Tv*9mGbTTsB?_}_*f^2B99B;mKyzb(0!|{v9laJS3QsoIYcMOXE z2=O23;$eLq6n{MWxN^J~zrPf3{j!bO& z`ak+M`9F%}M|RpjEW~Eu#JdYR8%_!Yr{|n1Enpmwo2{0uzd~0d5OU+3QJ4^zO4{(b z1j|+j*rDefWJes}42(uFWQPK|ankN6QS#xK0e8^eC|q{v>5qbs_ei><9`p_dC_7W6 z=(P5>g`{b)@5xBOC}eVH95&lSs+###>@d$@EivSKdL4yg9bz2%cn0ZKQd}p*3&g~# zlb&D;bK(j76riy27KXz`aAX?+2%w;g7o+7dD2CdPrQ2mjjK5fB2GqfX*$<3JMx@Z9 z!r<9Dy25m5-jl=Y%qFE%*ldSj6wu2->1Z@RK5^gTE~p z0{WO|l^%z~z&?`0esCy&VSE}|hc+t=duC_czP-c1{yCVo@99qvMfgnvd@AgRSwx2# zku05=@tusJaNmV(nLxTBK>pym{^ziphsFE#9PeXf2i))pT(ZGysMcE2YA}e`^IjMu zFCzmk`UD3Uh7*R{wW%}i`@^;CS_b}KRq$)jER z`-K_@-7A}{cr)B+J!BvvnQ=2Xj)e^FN5Tg>*AS#LK9H&UE7CP?$Kon^w*$f64>wJ9 zd=#7bO1$X<^W@{r{a6w|VEfX1ybe}|{ts96;pJY^k#M#o(j`aIIm79kYC1^kdvOej zY?~^vHCFB_#`wDZ!%u$wg9Y5vb(i-b?w+_L#Cv)#(ThCx1+t8T4^(+v zm;Sze2Yq3W4}D#bN9|;0bN+c&9{aK`?ccWV(xv@a9{Uq~dd`Q0SybPY5T-z$^Yd6` zP;uwAjPaaL7LtPIQN+?H7=8>@Z3UMMG25S}oKP3wZxgj;3P~I2r!m4<=C{Mr7=zca zrzsf6p1>3sE%CvUk9Y%LBE?LIZyl9E9#=0BISM2B7ffunOD|D}Xdy-xV$y}c?uImE zA=lC*Qi!M5s+DQg<`<^cDO5+hvL(cLRJ9e|qtsckk%q$2y&M)IqiP$)6(bJ8ESf{c z;#N}JJbfI4k;Oeoao6eN7;G%Ah2s7`NmnLo35)v?#eJfWvr?N_+zyKStuD^fdlz#{ ztlm#CKj$$Ko7KU?EMOOO$?ITKdPEKMDK@Y0=Z-UBDn36maTM-lI)`d93r1_UOr*`>P_DemO7nbDR_|Cd0hg!_bD27)`-g!Otm}jX7E%sAPe3+W&m%Z%>Pdmef z48JXaGx`|Md(lLLctV#H;6sH)T-2Wtav$g0fL3FcfK<@*=Y^xc~58_4R9rj z_t832bvh^G9x}boAX1m7FtVSJg7@#wu;OoMN;3ZXwLzlt4HOKIX53+dHN^{CXs-!8 zH_6h_yh>dN-ju-1aLhkR^%px4IWSnYBbwJm`D{QJGVU)|GrkUr!D-@_x1GS6y7vQY zo_xfZszx4fdy#}WpL))PgxS8#ZaP_U#QHJ5%%6G&VtvIgt;el$_!k`Km-@45m)nJS z+|#fguGeO|eoAW%mto9akVM7~vKL^5QF#=3S#Mz{fR*SJPMLjhbSP8cI|Wv|qD-M( zU0RaAqaW2I+2BXC`igyn2sB^_DYOrprEC(7o@FN5aaX4No%0^gzy=n`uaHo*z>O>r zB!QGi5lB+Kkyig5iBuvkc>sC%vT@0Yaze`!5;n2)&#M8Hmux7kYODA+w3Wqs!eO+P zK0*APP6oKv&*I32!qekyOT@(;$WAf@CvD44^1L%Ph;y;CS+Wc*S%TQd>}|u~Gle?K z*W7~)E2LFDN;eG2C>q9ws9bEUUbE#dl!cdWXRzHTNh# z3g=B^EDGczg1VQXyd@A^;YAo;PFvsR(X=N?VzewVx|SG4S3S;1+V{$iFG8V<5I=bA zp?>O&B_gk#7ia49`VmO~PW^n(DC)tpr+yAI%{DvZ@#|ugAPx-x8>lA6SxtVp)mg;+ zC*Q|{*Uc@%R>L2mj04{Pg};UaUaG9+fcGUlYzMqQ!(;gY@6YkbJ>cDm2Ye}i!5_b* zM^&eHH=fZ3yu6N=7|4n@DT3hiw&Tro8^O6BZ{$7E>FvTBUhsBEeM8o67LAu9c(GDp z$5V`fL(yZB_i4m;dVj)F84R0l3)}(L1wIZE znP^`(7g7mP;Cj^V5KE^VV?2tqkI*ZWT^Y%^4me;)>{Q-I_ff%*BSx6GV)!DS7+OTe z-Is9wkp|yy?t!MDg7zHBAr#20a?nM(mx3(58!>_Ry_G_I^sTK3@nhSGuH#Srd|ecn zKLjX&u6&FNWFG-VqD_Tg0!c&T~3Owk2SEi=eNuTWC37oNS-O9aJx;&k|}Km29@ z6g<|bzDeEz#CCcw;x7pUkNSGjs6=wKep>g0}u`UWi zjA8li6{v`%%|N*?Q3j4_@dL9YNwj~F-Rw*^Ss4Irp5aOij`USdPv`-(7*=> z!`dcGlKvKTy|`4xgqR5$#Fijk=McI{3M+d73C8j?FQEyTh}6ols$7G*gUzxx8Q^%{ zBK$(})q0uZf5Rx=e;_nN(CLSEnNmDVEB1qj1?Na-N@PZd7t`AJpoO8YetGsVl2aF` z&HXVF%HAYYC9xi3JxeWGXGlBJ(HmRhX`ibOHRW~=Kk0=8loq@aMW|j>9OLmw7h))r z-=a~BBQQCZERXkr;%Ee{Q^yX6qDo@yLV2%D?{JHZ|2&xL}*`MNF zo@YpBQ*OAITh`l21+o{qq3gg=pCDF5qnb zWx}N3LO*=A=s>D#uwP`RJnsZWIb@UJgUP z73ou(6}TBoVlRztz?>r+A1hFfDo8s55QN~%W9y|7Zcq~#WvwXVli1djZacYozb|Pv z&TM8-0%Zk#DCp+pPr{Zf+=8{@r5mlZ|h}Zg;ZoCHN%f=^J$dkg~NQv5? zr1@(xoq+ERFp{F#b+*a~r{nH*(O6<4n3B&!<`^;d0fo+)P0_PR`Rk7 zZ*K_etkVhEHrjp&boKB@H-8-Bk1l%1c_thYgzDCsP+h@EIJaV*cBv7bn`&6M)D?9A zN4JQ*ZY;(fB7{rbF}4%waH=@rjtSYiSPm1VXCO=OA~RC-Qi@(maY*W?3@|S0G8iw* zpevFx^iYN#%D%SU7moka8vI(90~)!UtlX5 z*uq>G(pP3q$fF5c8H2C|n$+~MhOE+II0IFY^b{Co=4yhn$BF zWVkdFE>EbqG;v%~SQwW*gv(tTE{_qWj!{crX1EOZN4JK{9!kM*v5Qc1j8LP?z;MYc zP?4`Ik}`BthHk21XQa2N$HO&zLk0%Ypzi&K3=E_}HFQ%OI1B{RAp+?TfwUt6(x4i? zA;aYabckx;MN$o2R6`fl@B*`k?=e#+m5$oU=!X*Lj5-vipB*aw#NkL6MnAYb4fJye z>{>@Z4}3lS3?6S^M@{WSF`c$I`QuyAR-#HN{k(OU zG0V>?r29X~YEW5a~~ zJ9O!x>5gDh1HC%|JSWnz&em!YlylGG30c?XezupKna!>8+@g`g`duevd zNT2al-`t0p--+jo*;4=Olf1#=v!6@-9p{Z51CwyqOwtd1!V`TL_s{_r(#NM>gzY^B zoB5pPj!&a;B$GTh8a8H#$;69nePo)=4D~uHhN&N6onbk27GEX~39H z4(NICGAe_tl)AKv`6V|-UUAY74}U6krFNJ2#I7>w56G3;iMwTy5AzM*svRf_b}aIH zK$&DZGb;~4ff=+JF$}|fki%z*DfSCymLkweO*#Xm$a`kvBrw6W_9cL&Gbfe_T|Aj0 zgN`o}KSwmSix&Fkl6@NPM<#jsY~$_(lyLSFRodBJAof3RC$ax|JKey^yhAvU0UIA* zK=2L(?pSDhfrWQ@zAzST+JjY`j!&X-WF6=z#yEN*^ey9PN|4&c>$}BQd{NFBdnhJn z>`tIi${B53h);-?5UD0(yF8zxoR7%);68?Nu6L9HK8NM)ge=dwX;=|Ghx5FH$@pe| z1X(yAp56&-S;07d&j74{bUNgS4O4IfQWC`@B#Q!)*rgtsxYUDo-fsEx8yR@uif6t< zMz80jeYlWz`3=?Q8^YIn^1Phb2V%?u=coz1j9t0M5()FzsMxY>pai zc{|Q$|Ib{{`P>bwaXNnc@9C^h5;`za8L@@z;}9zgYv$vMabP~|p4gh+Wml5W^V(i| zNM_tOFYF4j%7QzYHXnS^Ux>*~nL>Uq&r@|YD|GIU8B6a-9ye_)!A2)bAiN86m)k+- zIFskPv?CbKXe;#vMm6<=XPv~7j)ty{!7s>%{?w{XrI5^n@% zn$6AFeT4j7$e*ni0Mu;m3ub`^aeHC=mh`u+$e(&iRRxKI*mlXKv0a!Xd@AR}9+JL1 zs*Ko2Y{j-qDvctZv`n(?5_|ScqKxMlSs(57IZ=t(YkW+YC;e{O##xx=09v2%StK&Z z=EO`GWz30UGVHyd8<%aw3=C71(aie_58?CORw``(*`#RAD9PrTH1oi2ly=cVXZT_7 z(`T5k2XU{LVhqlXMvOYai_hjO^$gJEEiGi;->r#W%kgP^463k~SCxt1lBr z2S`gy;yBF2P_5MKyk=7k;kIBWQ55JR{&m*!gf?=9QCnt(R!&>8HN79}#2j1jd=RhI z)f4yuGNI2iu?Nv?d96q4qyyp-JN}j^y^mdqBh=3?U@Ve0B}(4~74%d5=WN>v$g`g= zH1&Q+`!;~@dA=nK#6)o#kU+qi#Tzk$l#GDRF7C2*1h-Vn&KG=*QND-E zu)4l@=Pd@qdRRf=x{Af2FTg9X`O&bj>?=x?$=sR-Q%0=kKx{B77ilSqRiT`L zmOv&G0DKz(jAJbce?`C_;JuaLogE~D8geNwLY@R?Qd{`sb+x8b3HQ!a?MW$e_OM&Nh^%1JM0 zVXJ%6%Yq`~KuanF={H-*$05@QyACxY1V3S(7>jVsSDs7SVfSQ{gaAr&devir=AvqkKuEqDiCSt|h&*3_8w5%eF^Q zQE()1tv2M0Y91%ftQWy5oSi|rOQWMA+0#O-fQ{4X?6q*-q-P#0=s)_| z9xFS2)*ZFWWlfP&5x>Lk_FfbaD8+^49AHE2Q zHx{tv0RW8cs4XUWGXg`x7x(Mh@987^jGPE&RA7#Yf}O-?^uji5@btp*zmJNS#opBY z>0+PcI@z2e^}-!XwVlBzm6iUkBAlHa>^63*aKH!spstE?_-J%QgR-X4#-YW%1K6ApcHJ$ zbVucSIwEv4%8xHOiijmjI31!b`@jUw#Z9*P1c9k&G(i zTS?L1@)%rIKZ2PigVS&pNB0)>?9qvSY2VU~J+){^(S8$zpP`+Pw_CO|$LbIh0V54JuB#{~$ z=;iBuW+u~pnHF?!>V9ceFFI9jGNL6HrO!^in0{Qf)HT;a`LOjZOl)359rhO(d2mnh z8951q;h5At4d;X!zmuMnzW#RfTW0$4=39M6Is)1tC&ew5lH#(&ane5NOeXXQL?*~a z9Q|S(mmz!+vYnugS#^TUyC4HpvH2yAcMzf;?_vt>FagHJUf9)ieX{Z*b{YHyX{m)# ztWQis`b3Uw5!3uj=s=}{L;$JMHZX$ryZWT0$*KEQCv(DuElDm&;+Vz0Jn$2rvzLDc zXGv$uO0X)a*p+rLUDWJzDs(8pQL6rXF!ur2lSCELKFoXeC!V#@Sq27SRxwV#2kR!E zc!JxR1U(6dJG@K4+ma~vM%Y?eR+jN_vswI+Mp&eOgyri^I{7-2%U8BH=K3JEM;qZ_ z5u6}rnCLkc`(fxg3Wqb%GnNsfy6@R$N;}AQ!k7iz;z)Z;F~=MiXa}@@TA6lWAB<2R zAk(5B0zuW#vWyll(T^ORA;G5E%J-MbSxouKGFiN>6v>lAv&u4xO-Q=f0D&4@iE`9* z;(e3`q>Kc`;RJWeS&1w#QCuWvnc1sZOpD~YMJ*Yc2{I+QPDrUM z+(w* z`T~Urz*s;cK$2nceh1$w2!R!7zO-6MLd#S~JL&*pv>YUyBXIpYzUUOD=)g}{xR#1GbVgFO;w!ib z?a|6xfSy2|i5X%wIs$Lz4Do)g4zZNCp#>;FH_*XR3^CLZ!TI5wGs8J2hjY?~b)Z$v z$vO>nv#Axa(d(`3zS6e&4BIPN5Iok4WILpK za1p`@Lm4a_-r#p)aF8ykhEJt%z#vY->I1}OvTP@(>d_c7n6&V-a)Ysup=s?A-E#Ry zvAyrXUwIVGP*21vct76U2Tpdt_E)&$LZbD3xav*3$j&!$MXbtiQulACStEu$2)|%A zSPgXPo+#U!w59~9O<(v6Q!i;D6khNq)(?D1jA2PIP21k|d;5xl6f*?+qh;1>C2gN4D)C-s9X2mPH(> z$#{|3YfQqOu-cFw+HA&If5G**AHkd;+=Rc0!lK|>=p8n4#6U5-u(Oq>gE$o^I#>u< z-%i>zg*f+PR)h@(^fZE0*g4sVr;)0~W4_4Z&4^bsWI?j=9A>!yn1bZr$$;Di2nkLG zBo%-O%cha6xjWAG*n|9aCnnf%+O+bPGL%nabNWqFL*mOJ@l7OMm!K$2ABR4@)8~Y> zsGzG@a_*E0UMAY$=_u7cE!7TM$w42Gx(-|_9lUr}`Oc8ILs?Fiw*w@gaV-Vu{;)Fa z@U7|r+ux-;iPU$OJJv->t9B@l@cn?Wf!)lqlW9wdg^tdoJDr1VLQ18aC*w6Zl;`*i z0ej591H!~q0Fw=t^W*TuVhW0cd_gW2>tp^Y>ysZpSAFu{1R5WXuh z@Sli9dlu7%7|RcSi?2QOitX?XMxQxKvT)1YFA>4(SxnPR%MWO(6O8e*dPedvA1SYk z$py37+PQ?!HOVeO71E9rwhb~+iHy>j#k7aT;&bAI4o+KP0t`6&vUk$q&tY$g&o~@l zDWv$#f#5pAH*4c!n#x*!uoXpWb;q-?W?^yLUeud3xZc2zkkY@H_MBLJ0lZ(SE=oal z;WRd>$jF;a(v5Iymg5)G~BZUV$Piqqf;DU4h+1LsrQ_M;nc z+8=DbIFZSroP`$$8%<&g_D18FoiaYW^2CM3Wr&|cLt}=&1impVlm$GF_F7D^Q|#FA zU>N0Kxs%ltA(K$)36ZW8G71v|bXl6;g9E>|dQiJ31hW4PUIKLKqF=UkVKj|6YdaKz z${?6y*&Z!hJDs%x9*88cFzm4Xnu?JoZR07X?Ez3K}fP)|kx^WEAK_SlP zr=3zm@=4BiqI^StKMlazLFD=_hQ}Tu^+x|}Rf28?ekJKUCPIyC@Ym#+ra{7S{ zc4D0YHo7{b$ce9pI6N&<@L6ot}Q|u|I9ux*gHjGtKOrmRAc-r*=!{ z+1yn*`l-~95cq6RIL1DJaUQ~S_UK=Z_Ogi2Sp=1hCE%l<@vyVvA<5Y#b)5Z6y0fb( z5l*J*oiLVc?Y3-P4vNXgTn>jEhG5Y=uY!8kc{0!s+tS%pJ)Lk1!9S1lgyHO}6M-WL zRoiR%;l71ppXHz0P5UfcqmYJa#3+oM?ipK1J3=iCbm3d=A3HH^xZXIEI&GxyW4aI9 zwrWy_%!6Q57l$p|ZXk3Q?8LUkZM4_jhZ9bYNRZMUl5Ib=M?4`lcZ&PL?_U)BuN@G2;1mz}#XZL_^eXA!m2X4ih8*0bMEJ%Judw{@+bD~T^l%~-@m`dws^ zDL9P`u%2N~N~u+xfD~|mftuBCc?&n7P=_6}c%P(p6m+K-bb)Mum2}&Fh84krN#``@ z{u>IqK#GhoFbD01YUtRDAep%cPXR7ZoqUk#OB?>zGW#D!o)wk;w6c4(CyTDEr z6y7&~^8C?o_G6%n`iFIlhIDbi)Dc7t$21x`CO7X-1yyvxPe8WqKl&*M;}D~wV?;$T zeBf-x6GuN|RCMSlQPHsxNPmK-l$@AGcH`s}@ucMJIr~{UhR9**KvO1>lC77~k~o(W zw(reb8N5y?e7&jt*WpU2f zz)#==JtTN7VMLmwKVo!aSi-XG>=$oLKWusA6-3i8#JIBo!#!-44}0-c>R*gW%cJig zg>G>D4xjqLg^93!e95+xY|Q8f*s&`Ou~1`2g!~GDilOur#ebe;CNX2gQ@< z@4Cy`$uOyDyfM}?Y!l&xMKo7%lGEJ#@H)i60n#qRN0>Z-&Y)K%EVaKP{1YpJIGv2N zEANp`TNjElNFDHiVlOr{v`2zfD=q&^9Hr0B@|Q5v?7eO8Y}poNP?pXlUu4{NM1*CC!7mDXRF{_C zF>g&nrE6xD!RfA8>snydLaaB{x!e?V)6`oX)eTKTbwz!pRSlbYYwFZn3wZnjtJQkz z^orTD5oE8esHwLKu8jgqVXs*8pevkdy7i73t7`C!xa1xdYqidx(6vo9l?W}FQBqV=QgY`U zgJDj7D>_KV!&K8XXc#Lx(b6@*#F6cm#RWA6$Mf+l(3>_6Rr$~ zx#;j+*?8jDn8n+<3r}kX)rSV+UuJ3P?ez_YO)j@#LsO05DsKXUn<}TKF0f`*R9Y+6 ztU*^B@(W9COKc^EemDc>*i>z*;LU7f&>V+#8VB6T} zLT6W6r?{zFD;ia2ox;lDP*9xER8jA)ay3o2u0>T-+`8gsTCMq2)=dqfbwfqHU=2-}A2hI(KLkh_H@8b&CzroK@Ww4$>y z;LzqK7j;WhL!GsXz;0-C)dM6#*ou<;Qrn;^2Ysmd8MP30hGqvv9vd@AVx0~9<@xb!`1Gx?03g86w6}24jH5?nOT`H*q z2dg((zYd_B8VnJTCmR`q!39#kDe|={P#`XN7Z1*Euoab92g9z?r^rLiOa0hB8YDVyRGbz#eO z?^<4ZPQF68mS#TU^=+Z|ntHdZNg$q|Bhom5K(s#S+JwO()>qzWSdu=k+*z1kT5iDT z5oQ_+U28GI*SoA@Jw}wukf5cJMpRzguoeZ>Y69fJn)*ruzSoGgD7Bo_BrS@mOhnJ3 zURDl;jlOGZ+(J1Yxe#*YY$RxF3+&cKzhjdz4;xO?PH=s+SrPV);$afk)1JWi8`Rzxz7N+Rl zwJ>^iUm;vea{}=xsj;TH_+~uP z^?6^uLb#Tu7xDVOqW8=-f=JTO?H21?l{4Jc6^#(iO-&V>@OLf3pfprAK*o|5Lt+d1 zguaYSmK0hUOW6R$2i$)(4GzpZrZ7El>Xga_x1~HmLO!a@e{8K6;1>ECm zYGCSCrHj-p4y+qm0wk+ip891S1dk!7Xhor+(3V+ZbCeqHm}{6f$1r=YA;(!@FE4iH zm$ElQ{*uC?5}RRperf4)n;|QIiJ>sFG{4NohI+2uS#DdIZL^o=7Zp0fLHUKYl~B;b z-_F7uTS@Nnq7~tgqOu_Y_t;8`a`MZ<3GxfeGMDG)guioa0HXlfK5-bT)?Q-E&Uc{N za7alJ>S15mdA96j_9Dz1$_pGzh6J%sNB$DlL@EvMNT~(qIqmGVz*bORT4XP`L!YEn z?7Ji%fqB4JUeWSMaKXylOkhw;Rgk$dbNTY3>~Mg?wxqyTSjzE3<>Z4yve?Y5q7pS@ zexcJ*PFP?O4x25fyrhuB?zr1gid@+!a~X>T=r*3sw$h$im;;t;FF_kJv(QBZ#`1he zX}QB@$2_UDsDuUO*m5(S%S+3FHjcz1)@hl`%k9gZ95l3QML8-_Kb?hH&fHvE2_Qjx zSRtha_MCiP9;b_P=p(uLYOUEk20{6myjz?OTe+hYozG+VD-#f`ID8j5O9y@D7xK>> zS5<{rD=>W%(?x^BCD63dfN2$mQG(%aOc@Is_@_I;P*_xGGtdd46wm(LG{t=ryax#z zx`r5R_3LYz8tU2TTwl>tQ?VKos09gz8N>cdKv7I(UkgRVkk!yo>w<=8aPYYeRg{pR zRsorZ;jR5c#L%h{yVy$M2_+&_>^hg#)zk!?n=A_M1%`y-07x)UYf&i6m)%fTN4AjK zntI|%oEs7Fx_>LGT|za0t*da81*EFB0rD4WQ)2^^V(7MOT#dvR+*WsWgNSJ@lrOw( z0NY^77V=sfn;ODGC3tVCCL%tfR+@bGbY;RvB|IE1L0NVw30crs$7|Fb=s#} zNzzQW5_h{Y-{Mzzur2AtA zTd~GPcqcO(n?tZpUF#AUv#N8|H8f#PLG~d+WRU~7$IOsszF=x%qqRyD#3ok)&AnZ2 z5Oo+qnRPTqNa+$98fVlsV1B8VhT0x2_6#jIL@M>etSw#jK}NRs+bb z?wW^O%!))-ZYo`C5)mjjkX5*a)tGhx1-a@gv4aHIdSK*kvaTlMT2sYZCena6Fp3Iy zP38q4D+&4^V6*2A8T3#uVX)l5DYO;Ib&ROTWT?}GA`fA*bwa~D&ksT2~3A2zM#!@Dv$PfU|Ko(B` z4ssY2Nhb2h2%SAIOcH}$@)|Z!FV|o?3M&^OpXq9ur8W&RT_NBTV3Z&bQZHC9)$6h{ zzMe3(3Z3F=f;wK9S;*2DizsWc6NNqBk!*e|#NM!GicU^%X=Xwq}>p|FJOcY_mf`h_vQ5{yEnxV5k(L*$~x z%oYyok!u4uJpf?Tr6bw|8u_5x2+<6!Y*5SjhuW!xI}AU!74lt`BN(}juz8>&C=FDN zUTvS6O2Qb!#$B@pZwYlZYnmEV`2zsh6t1$y&9qULc@6sL!D0HqAvTij+6~bSp%PwO za$Bd~S3z~?5YDmuk2TMbOQaI+Gqs~sVcdXLHEkgM534^Uo(Wt%3=HG<&EV!+i01@N zUNXco1Ug(~HKy)CpM$CJULj)(F+U;?l{x@-0ayZ&2rcbZ)Nj&y7`SKh!<|4%3)XcQ zmj`P=VkpSE2BU)^Yfv!2WLah!G>9~&2X%=|<+ZN*wOBc!fub`$)8Yd0-2xIL0G9YW zk|b1AuEU_^0HazpGvFf4w*f1PYz2r+UV5b=ZI`d)xU`jeTL1QgO7mX!o zI`v^~5R{Bz57Miv5kPRd7JnlJWBinsIBlAKMJ*)57SsROyh0sDyb27D$V|m;g)syR zHN#M)20h~synL`@wI_*ziuJ3-Dy(=hU`wkJ!jvMcQ*D4b1=EjO%x6Fhviq`YFtkl?_WtEp4EZy1zz2&tD5h4RoX5>KdU|U=*;m zutrD`R;fCnMkpgp^tz59)kT>)S~!oet*VMzx2EbAG1dy~p&eL5M=_+@@U_UuxYiZP z>(SFGDbA272^%0Wpd(DTvhuAiRKlp@Yw>G?l!0XCRcT`!Uu^vpBSd5tGip9xfkZRd zbc9bDU|yPT<)$VG#{_O^(zO)WRjp5#_bd-_(5w}FWHpm3oPQA*v?xiUMV)km5eu{g zNxVdhQTgSSO6K9th#ec<1?I!(n3gc~L;tc06Q*Jo5lKRG>3yPYZ!0Tp9P!dIN)tSp{yIHFMsqn_xK^=3iK35cgy@cZfD_ z#DRrnW9ndQ$K?eium*BwLkya10enQOrG#x-!io zte4P4uC^AVpG|I<$QjhuugeTbhwGV!CYaXU31lNPs2Koa#ylN_ZceprA`@yGyR9QS`=a5dX5+2yH_f#1b`FWvWXm*bTrc; zaikW>W{gwGjH_cCVGvfRn$-VkerkVCet~XnpU?I%<)k$buCeo_g(+(cH-VsrrMLux zj*zD2LnUfrT3S_26D9x&q-KI%A}j*qOYOyohlDK>2B|`;-Q83HK7QLA9L1#~Z*whVtHg2`DH2VRRsIa{u+zcx08~8&h)T#z1 z`&BywZ-vg9q180}ldo@=Bl8v4xQEZEhEnfik_YVqRw&g6ij7!eLfQ~QxVQ#$pkYeN z9GZq}#+WV<8(<|2lPeMwZHk6>rT%}mDa)8;!hfSa^h)o=rdfus`=1nb`TxP`{V}@# z(f)7sKU_leEJJdP?tgUhxB9Q;kB%VX|Eq6N(J{u@xOmfugpuY^*H{uqUpppg?6~pC z*Ij=@%7lrNtT*0t^W-VF+&VS&wrSI6%)EV8+Uz-V=iPDV{PYD27cKtIT^SXt*HpTy z)>hZ7d$6{yzM=8EVA$gN4I4K-bnktu?k|7f%JJXZ+`Ofwwe4ZgR_`N^Zj&C9ANPI# z2mU91_~ehC`lo+>`k8^k`F?+*R`y+3pxK63Qff4=|6p5q^Uc;cf!ecb!W zr~h^G&wu$$349*x`|B5f>;LkrQ>Xv?%-Ml+=Pz8uN$iIIY5Oy?vawXUBrkvIvgHMZ zMRx46FLjo!Sb6t7y!}^>|G%RB4y;)-E=ey52KH&NXJR3i|3#eoGW-D1Njuj@*BX(T z7xJKrm#~Q>O{GW&fQ`>JEGKq|t5vSocU(&LX(k(oS`XbPEU)8kb3H}A~M0) z3IWZR#PA8(3s3FvVjZ-K)!fTggB`lcT31AFYRjlFYQ-;P*0qyYT}I_2r~tYEDal6C&4eSvYAW@P>k8fZYINgh8`F7^b*yUzFJemm4S%4@|>D`OYJf1-;!hB`J5si#Z* zZdcP$`?P-B+6v!C{C1+uzOAvQAL98y8~h*f^W(Qm_sc`N2fVQ+6TtDd^#CJmE23fWLo3Cp<(if*IB@I@40<&D-qD{I!m zI?fzYXdMUBBRHe5qK40>g=#Z4bpa1@qe`I3Dj=zLLGK=l#Y7q71HZ}m&BZSVKdmh7 z8LPcq#n0=mV%Rm%o3)p#`1#%c7feCsvEvx7;!XhQBQDciuD0Z zuCCutxVk$5(4UK@o5ip0e;-{FxazrU@lxM4S9dQM3{ScDS_=yKjt{i=Jw;}EQ zPsKOOuI@Jc_ssf&U;g^)=B@`nzs0k5<7K9TtEyxE`qaK3#NKn;RR!}(clG|;GdE`TYo~vaboI8tV0bn@@%)pWuC-Td8;GNhzQz9O zfBpF)*7C2;f7Ax&+x`dL&Hc&4E+Ae7&7wBE^xDzuGTp!V-_*SYR9suO?~S`laQ6fW z79h9>_u%fq9Reh{LvWYi5Fofa1b0h9kl^l42=Lh5eeT!y_UZS|d*8iK%#jtURxO#o zJ?EaQ>OYEs2g@Vy_s?7e7-Ztfy+s8)Y<~aQfJe{=FnI45`)dkXG3-6k>IyLUm*}PT ziIFeo;XZns$** z>mKlrQ^W@tsxx7GUyOeauw~+T1ex=%E&>d}wA35u1aC4~cIknqkIn$6OZr=a)B`bS zt}_=NrHBtO=%3aXwdQDb9?}^;N)aDmSnbc$XyF(ctsC2qesqa+=PykpzBc?;INa?MQxVV zTP!G&TI&}tG#;IZ4=_laO(!r=8ku0F#L%IkcK+F~`hj#@00yfO!Sm&+lUrlhr4f0l zk-zfHPbEW^m~;s0xxJ=*gBt6Kg!R~DCV(MV(27d<)9TG>9fr(`2A|Pm z6Y&8Cu2^{+A$v$WwrU$h;^&;-l3HG}>f<)WVbg>qk~y z0fs1Kb+JBjN@pT@$}Bg1`=b+h5V^pA(G7rMO1N2fucS&gCbIge-a2u^r}b_^{*RMO{!K`^$0gze4A3bU&F5K!G}-5(qP>g!5tyNFe=&-nF$`e9gViqo z%J`v^>8rNJrWt>aeyuLh{b&qu){|n)nR#nqY>#oOGXjZsWg~VT@zDU>ISMe?m18TO zM_=K7+M=82<70LT+fd_vYz*u!mdTUzn;wdBV-g( zSHmSCK{233Qp#CgGYZeHze)e`R9Ao@?w!L-r}F7(YDS%tt6X&N*Z1rvr5iAhCJ+F_ zrmLXDM1KDe8gYuWM)=GY^LxZDn^5vc#SpF~ZcQqF3Z)zm`@XY7BL32yYnrjX_)#&m z4;#^B8TRAm>{Gdq4cYGhv>@TzO4EHbB0i8yUGNuQo*o^$vwdzh#errk(IrTG5raLC z_E-V|Fib!H{(Y*U(*nk{3dRW!%3wYS9eu&#wen+O01}4xgp-FMZycW#GJs6tJ=T_L zv8sw5L0Rr&sjdJ6a~C1Q5+6~(N7VFuD-V7*3}@EWUXeolY+M zM2ylJY&LH4gNj)(3*%!E@d1WD!4cCZlry*`0X90-)DY6U)FVakI@fDMcdtDL0~mH+ zA;H>KiF@d0GJFqdNASq%K-7Hx^~eYMk;qH{L#8D!#q$6Yt99xX&YB)}OZuUgJ%@}f z5d@D!#0MCtNLb4b(!nVFI~)l=tRWH2gHx~6ZPoMz8$E_h`upE3u1~qOt;B~cO&S!B z81NE^dJW&=m>L&-Psw)tOG=v*AZ+}z^uv?R!OJAX{WsEiAC_A$ij$@BQ#0MDA z+0WntQeIyK(Y;x$?AFSv> zM>>v=uo>YtUiV8tOieR3Zaw>sSV zb~iLu@(PZ;G4fJ>h*muY5g%Zb`p|m4%XsB71j2C3F<+( z^ABJ+-0%r`PFd8SkG=%AQq0-9AT8}$Q8vsWtv;Si`3R0`fT21pqUxwh^;Asl4ZWit zL6f1Er@Ds&JdS4z0Zi>95b*(q;MU%N=AfE>gL=$)k)@#GBX5URD?ug)ySfnKm`5Pu z0}Lh2+nJR`k*B-q2CvmDiglWU1)C|wclbGys}p}l+zkM60~qwHlIeUjCI)ixcT4MW zb*3xI#4BnI)A+F+XZLBF~J46FXoqaj~NuXy}3Z9ckx<$LE~;vRp5!Do!xv^jN* z4B}DvdtGu%BS5S9n!Wx!nTC=4&GVNof?(zcO*$`rNf$>lbc#L-25rm``3Pp#fD?%B zwNDsFi0(PRP47mT_kOM2@Hxi_M)0kJfSirr z1gQh+D9DTW00Z`l``qf+Tl__d*TH4u+2$PQB%+3bLSgjrWI6mYXyl-tOaOzqqlJ{pQlhoS(84t@BChR_}D|zsd%SXkvJNl&>|~n&d{qGu#=Lu$}>SyZ-iX<@son2bF0-2z7NvX6^H{Dle@eE z%pRpnaKcThn5hxrrj~ykOv-$aD#x*tUTnOR(`S$t@c{;+9n9K)`f&rKu+DKYP#r5$nrN7ATAO0K<@dtxXDX%#bnS z*oe)qvX5~IbmwfkrW#$rACAV}^OBiPW-vN~Y7p-H0vN#g;uztRenMVzVxuyxI8yAK zj!eMKLVfvBHq?aoo;44Wnq*TJgk>gx0s6((2E(;B<{{x5scpws<*7rc6!g-#lcJ7L zWnS*!{1`1M;UOR_;sXqLC^2EHhf{jhkr-}?uiiMLLdliRdbm+)i$1aSHHYQatU>rv z#dS9jL=9l@6#LoYUeB-+GNGmY>kX#73|6S6oULxnn1;>sC{!w%-Vf}Pfux{&R09ll zdRh%{GFBXG$VSJPpXf*W7}pYqGtYg%?WRAPlBw_97)GSZ&jMW$A7Ef#8p_5da(NY5 zfJW?Kzd9Cn6`Rz4t}ya;{$~S&fBJYR0(ZSI1L%tQ00X=QG^=Hl(wi|!rFecGcf7XE zjoY5DNk}GYx_K)}xI~R?H0g>^X3+++)fHe^bO^kPWTi83kR|`jz69slG0}1zcnQsYo+-z#3~TyL zlzP$*9lrx)MSOt4SU7ic5`1_|AgIU$$%5W)ki6j}|0fa6BwYkgE+r(pb}J>9s!zWN zXlByg`F7{nrToiCT6mavkwSHFKAd^>o06;^ah^Pz1OmBFfSZmBcB^HteJe<8mq-#+9Z#aWxy|skM(Qlt_4*QA7D_}D91iq ziO;JDY$rnzEfbo!UU~t``6lY~O3;#z?crK{&SE?nh$a)j5EtxbIqZ5Q;F;G` zAf|37Lwaic772d;{V_4tH#3)F%LtZQpQ9IMNBJPkuvw~045!s3VlS{JrQh6=7 z$k3^+M`4mdv$_Hd(=MqrVkxEbR9dJp z$RR*e#0MC7RZ+U}ZRAiFE6ThpF9jRp<>gvZB|kVK5@KuaGx%+-)p+n1*S2eXLI6z> zA7Egv5})^f7A|f4&LPNqL89O=I;z4vZ3=o!Fp z>Sv;wHr@X2my6)1Km$98y7`tkS&18c;%3xUU5|~muvrGy@%^pYEQC#vtgZk1g#pSc+2WvI2}CeBM}zI8Z1V)TkpPdh&f1w|1bV5o<1S}U?rQ67qAP(bg% z@lR|$Ig*&gVqc0Op-bR9tGp4OYT5EyY{mH6(#QmY$pkQ@Axn5^QWoVxY%IsU?src5 z)!fr!Cu0V0v79z^%sJwFsr0lV&d;<}o3Y{39*8oai&%O0RjcwK2RZDP9V^_fRIk-@ z`oc5e*kMC;5+cR?%$~^FiHB~UT+dP|1U|fim;rH6Q6>-E536AiDiF+e>`40U8t$D* z5XrRdz;1yx@`2~4HY+(}#t}g|O(0{jEC`DD07GGJQFcjNcK`+%9t{?w&IxB{Yx6_HYsjL}(Y&q- zjNEetPS+bw#I3=nP^#XcR%9 zF%!5~^K>Nc3yNyaPaS+D z$&$CBy($GJ--@HG!FkdUm(%|8`*uE|=}QQ5M>W83%^|aw4hu%WS!!Ycmf7rQHzXY9 zm$%%Rk!)o(<$%JYd{0+0f@a|U3jb_o&nZvo4GO9-0^U+;H@ zjh0cNFDQht;**<@eYtj_tcLum-hG~Gj~mMCE5%L-s4)QgWAN)L&Ez^rCgTVSq~~b~ zqgL_+o*QCPtd0@fXUq#evjz1+X6bL#n)9Avdp)mAtpT;_3NVzE`S(MnU~FIZl=B>* zpJ7l%2ib)fxPpoH(v4i|MaW8jl!3>^Zm1CaVeWPG9yJQoM0|ij-y!t`16Dg>aov@v zTzy!l{>LYdsvUI*_03Vl#g(2QPclD7SMw~-SHkE%P48u@^l$? zFKq5`mP`k=5WZHaO%hS>%kn-GnqTVvnnI%MAx+Y=B3RL-m1b^HlNrDy5Hi3W?bk-O zf{vCO)Lih4ego~2zJr#Gw=o-3&IjOKOYO;hQW}0WpWn-<8UL{ILDc<5O+p4j0C%nc z3}dCI%;KWNAss}FYq6KTPLVex8&}IA&9W8n(^h@Z2X8y$BF*3V*8dWw3gen#>qyB3 zJqB!>!AnDpgo?q~wRamoccjNJGJ>`pYAS=>pYu}f6PB5b?Tn+kMrEujH8hdDf*U~K z0WFych=cjFn}y@f6OY?Ns5w$BYn!ukC+>ZB5lEOJ`&5ReIxS7&Mr+i zqdRA(2Q3jFU_hQeyZiXiV|yLwXH+#u<{K=Xp$eur7G{subeW|w!2;_*niN{k7H7%K zVvUD5GJ!lN4^qhlFbMLFUyPEkvmWQipZO~nekgrMSOcE?q>V?hc!9Bt^oD{z>$*Mz zc8mD@7xjA%L<&)bSdgl&0D~wC!7SEiU&uD`!_l-n*+l#&TxXx_+w2M;!@+6EqJYA*Vjs(xm3dx`~q zppb^LYFQlYNz5eY_tEP*QQS`}UtvwAQ`pxlYK&iR{ad2ud*4YK~i0yrbMkLh( z^%=|QEBwmY>O}0%zyuy>SZeK#Fe2kVv=N=ukSS`1ot_gkKXFhJ@c{;joZsKFpe)z6 ze#l3;tl*fKN<3$F9QUNy(9S<)#HVN(8)%KW+*3mQfn5EpgFk(}M>*D54}_8lV6bA} z=U~Jk^okdY{i@>Zasy>^cq&5ZR30=XGPvbaT7!Glvh?#)Hm8ti@Q;2zoPhQG)vHAi zs;&S78DcTcxI%+-J2zYT*(tMbFf(<07o0+}9hdbYHU&NNIc)IpcCn z_ZRorHU}XQA7IGk&~o+_Zt|!`$|^?t~co~{_2e5 zInOY5^vm=#AwMQUH>A&$a;v}QSB$moK9%tLv`=%Sz1d2*dIBO*`1@y|scDMy;|U*@ zF;%z)sx)Ks5u8JMSgRkDI9M`qyJ6aVCbgk&*EC$O$6qKLv4!>s;9y|Ko^RTN6a$@L zc_+wxu?)|tHO>N<||WC zd>|t;0l73J>P0?L(Y4n7T z4Uc9ll-`EVRK7DcPB@)(xbfpDP1jSqKwI{3Tu?cx0R}wmtnWAq&*7Cux+o{aTNUaTKFlpCrIaw^9t(NY-59dtl~Fs#%C3qk;KFJ04*`l3X+|?~sTr z36dY-9RCgig&^Gd05Gu2Q1;{`CN_8IIVaCF+Z|JRG*!SvJAGIPu+(RxX~NYLk_U^O z6>HK#P5EAJ|1m?^LZYa_rS+f~M5-&m0Pj=1%yIRra%fo&O0t@>z1i}!C)p3FA%iU9 zb?7g}?h8^;;488QCDYQd+~K_B#QC^3YPqkQEA>D`#0MA{LPG6vHr9Nh96n&%hY)mE zk(fE=3%Nt=JxlT>n$&$`;QkfXF=X37z>AWmgS9AL*!@|<%km1JWud#tAYcH)VnscV zQ;<*06aFEKmsP>@f$4B!qB3Skc{A5hF_b?scg&vCh*Tx*33}Ib_Cu&0Dws`YQ8{~t z+sT4Pbp;rV-+g3~{1mom%MC$5>0hRnkNZqV!v~&^Px5qnu}0G{73ru`*&nP>A|P`7 z6uGV@37(&^N!Fp0BM3MlAKn0lOBeDzd!<%WHaf(>swDeH5%+IjJ42aXa5(e}nn(8^ zAoDj&t$|0pBFW2fl}5JyJRP0^V0V@ zNXSe;9O7ap#fV!i3gU?!4yce%13oetq_GJwnVfvA9VMz{12xnZ{f0&0m ztlVsj(S)QI83`$&}K!kzKx;{iXWbN(>iHW=5dkjfLe z&u$iAk-v&nbF_*Xd&&KSEjnE9B}CI)aP+vk)uEEKwlOP~@^6!xaX)Sb1k9#FecL`@ z{zDt!Ls#p~&Q>Ba(^v^I{6{=d53`77Ps5d;&xGM-I+rLAi7!RGIopPh zc&*Ibs}IA5q*UHdhC~#?$7YO{ev3rB!<|EBmq1(of%@b^YHFeMr{)j{R97Gl%-M!@ z)t|C2DSnn%Q2I8PKm|t_$NDK+4#FL0*8AIntHpQVNL^SQsP(wMRS<=@R z)W}9>00IO=e1PGU=_n~og=L{q(-^ppxk0StZn4dAUsS9-qvzkDNxz0V!>x3@fxP-4$! z8b?V{uPG8ggDI-;hrTU!88|)pvfgq$ztG%8j!WIUz&R^A^YGObVA%bf2iK^vwGw%< z8q*6GJoRclG2W?3a%EJi2s20Ou=2tTGWiovosre+%fa670Sz4*M%A+=t}PpegfiN% z9$v%;7&6}oKFjZlah>e;T;6(C^32lj_kq-BCnqd-H3PP{HNG=Q=nyJQN$2Ec^I$vN zSvf;pry+92nsuSa;ojrsj1Qhn00R}a_;=yiB@OB&N4xkL{U3z!dsXhH(o!a-4cpL$ zk!6y8>|Wc)tl7N-W5oQz5x;p_2!0LN;1~nt#4j&97t>m zNA48_y@7t`dJC14Ote2XYa{rHRVL$<;SFmmHqwu8nAi$n(O*_}z;b(M^CDD&9$dr+ z;*f@RNc_=N3hoN~K z_>ZqHAECIm<%If*3Ljj=2N=+ms*_2>yYw0?F-)8|do!O%zgII2l>Kt#0foP!?iIOX z_z^KA;cc4SBnVPA0fJ2UIdbptIX&ma|E;ZY1$H zY3)2b8lZB6rkZV^_&BzEkEb7#y{zcnv;B^*mA>X;Tqc=7BY9O>!WUk#yeKcMwR7r&!Dw1^Kd$b1M6+1_vx0LQugsuEOhyRC;ff{w z>)540XD^CeOr3B!(y8CFlV)GoNsIx^Z31N}!KGqKXegQMPi6MX#jkInb)((7Zy9p2 z9{8vR82oRn1HoE-rAYWUZ=NvYEsBh8ON1^YD?0P{CECgK?X`B_3B_0EH5MUr>2MA8 z`D)q)2wr9^CImAxx(hd}T&52!;sXpx7f*8`8l&A(xg&nrpL!arp{Ll@8Nj5;@$Ox5 z`0f?9F5U^n>))dBtCaAcWqlND9G77CLil|XBrf$+|Cc8j)B}t70K@f;__E8(3+c_wa!OptoD7xj-@?f*qmqfWh@3_7>Da1? z@$}K`UrSddV%gdJVba$0eya~hILL^aWL&jD?z@-aK4OtiK}*qYgu`DF#iLQ$;QKO6%jg_6y1Aew;i@$&{qSB`C&zTfFXEy zgV!nQ2mzMSj6P6@0)<0s{jWO0vV)CBIQ3;g;}*gt5hKp)_sv`CuOpf3sv!GU*T0 z%B|B*jvEYE$=-e5WQ)v{0GL8~jkpwH5Z=)hLTXSQuE=os4azFZO< z7Ses&2Nm%FhSjUam;5kEOzP{187eX6=4!b@qhL^9q^<({Q6kLMtZl*gBif!wp~QULvp>_>__C4QSc+=)kIpt ztXDab9#uxh*@O&Z3vH(^?%S{z1c?rvHBwxcO5+^KBo`O~nrG4#&vArSC^cX+9}M7b zV}LYh2U7!TjKd_ z0vyQn?>gyyBVO*u4w6oF9h6iLDKh~KV>f*zKauKq!_F3cVq7#nU}u>Rhs3Gy>gR>T zV^=2mNB=_6(BG+5D)=GsWZEe4HEW0i>J#oCI0qlRfWdsJ{^Fb9B}@e-dar58)Ghv`JZ(g>=Jh-NkV*ni2qZaI z=K*i*GkRN%7YwY^i;j@*U-{5<$tl}At;#H?X^5g@9g_z?V08r;kS#N3I3(uD-x{cF zz!=is22jTKbwl+Zz2&X+4zWYx300TB46+zrc>V=->6X|06}tPI(5~r-Ty80Me_QM> zjn_u4pG$xbwGU(fgCHS|B#yP}XM>$j!Q}gMS6MYH`-?b7%_gi~K~)@l^mVOK^Tl{@ zMkkZ9Z*JL9-n=%&s-F?)=YHyHmcn8&-Bo(pWN!3;B0j(%8s2H|NL_8ZoA$b_xJYH2 zG0LUX+@+x!9Nha;z!Q$S#Fp=BdS0|AU9=&X*T~`+Wl$z*k|M`XC)5z&uW|V2tOv`` z&RQQR2zT284C) zcY<9H3)wS>36&_Q?B1pp!4G@*C9K*%CEC?~UOMSReH;!a#5J|Is`K@i>(C~W<5Ja` z$cmI|l#taNnPBQv^k-_R7o&MF5g%Z%G7HYM#S0oiAu0L#glW69{?%YXfIh^ymR)zF z)}qWhHYt2pgexQuMRIgX_`qazC~?&{QpO3l0^7h|B#Ql!wB+5IkNRI29x9mt1~PS$F_p|!QFx{ttPG1Hw2mj@gX1+er??uiU ziM}Lj?iPP(5h^xxPBg{F)XGCK011%GV$pr;E-7LUw{i9|>70Qa|Ja>6fZGQRL;p1j zL`pmb`3mo0*XvnZWCiBQg`U@$SMg}<-WjV7U@znNEj47#@!00dgBV;NO2h{kxUO*) zZY&&CxSs}%Q{POje)4IxXiKLHRn%B56-R(QEdS)lUNcuN!zLVeMrpKOPQ7)c2p>S? zAq+vj#Y^-h5am6TqFd3j+Cz!>00YsHi{38+u_D@u0>X|n2G7^w&G;R7qqV7>Z*5Fi zDXQI6#1TIzyZJ%OZ;jTS__?)5x1=+s$5<*Leu`#~p3HmY{v=sP-M-1@fszSeh-y$> zS`O7w8z7PX&_A|nSJqMK-|vN%fI4o>00v$btXE{jIgqClPY@Y{mD-c2+cQ^(xA|m= zIDu1f4snKB$imDPV!DO2rNjv4Npxs5gsNG00SLo z6uw{~cjgSf%}tMo9SJvN1WHd#YMa0Bp*0lVb9<|%N$>9xe5K_W<`8`EwpCmUkbOIO zu%J2uVAE)g2Ateje(^A8PeFco@o)@7xL^H5WuH<@20Xi1x8X>mLF<0CyoA!38ddxB ziRZyfiqAB`FYP!iUA2*sUbrNcs7s1`7-KTV>d&M?A2_*?*8RQo{EUena{%pOj%pwd z;2w;Lnt>B7_8HUP1DUWfy5;9BY^^0nP`}4bS=&`mmzi{zP`(wGq9K~cUnY;#Z< z#M!?zKB8?>Iq#YEn%%WN8Q!1OJy&`d5g%ZHw%oYr%OPvvB@*Dt-!<2mk5MIHp>;%( z{_uzj{UZLh-U@#xbpWSYh=pVkI!X4Q2-{8M5zp z_Q|N7D5{&C7TxOV(gc2p3wk*<&u$T;Ma$~{U<{sN6|(g>5)802LQBf*YLhj#;YBMu zsvLFipGp!NlC45eE=+IOXtIK_W?CL26i*!Z)pw=0zz=BN{G9!gJ+%Fa@~H+g?&5IY zZPJ5OS0D~{Egr$?&Q?nl;<6S62=!FatexsEA8WCa-c8yk?B}_mROtzZG4+9g-%^pZ zztAGDO3awWtABppf37S4odqi8b?tbEkgGAm;SKnMi1+{ld!0=wt^$Q+rC}hhBzs!Z z5Ae}8W%78_YgcN%(-I-QSANT4&AYph&{xeVUFbtaepf_t-f71ZXJ3Ctaou3Smd6qe z%cx(mR{w$*e28QM7~qo_t=!|v2)&PT-r6Hzl#0TmeaSD{gFe=3d(m$!vuGY?XHb!o zi;1^hjWDYQu9>hI7aD-sK{3vvJ56$KM&Yy`1LNPa0U5H&Ecy`D6<}bv-XJsIw*TPY z#A(dKreUGQC_gEtQApG}+Kztw+s6cbn`6hFgU7(rH=JF%38v@d!*2aY{r(F4n;E{0 z38Zof|7Fsox=_pt_e=GM5b*(q#lx^dMzkQ!rY?%ZDtA}d z%_=JOIYoZoBctkrV|vcXhDZJ4P=e84^0xPF(U>$mrbT(XvarJy7A|TRIalbh@z@^T z1ISE39Om%H`-&PPIWUF%NE`yWaI%=%Rd-CB-Xvr(YFLL4h`O)(RfRf1P7y-CYeA{8 zTTgQQy<@D7>&2*x5x{dr#~YgJkYMnE-~k48Q7bC333;hb>ILm+2ytd2>-%$S%fx3*p1vBMYPO=D$AX zynQ`1`d&8Kwg*2M)-a#)q(RRoMCw&$jKP9<4_}84=daaYTRnWKg}(P+T>*woqJ+@J ztRgZ4;aI~L6ga9>Ldw%7f=X9=hFx$=C`MS!$Saf_#$^y#?}H#&SN$QV_eE;IGN8i7Q4={ws9oL&OY7}hAuO6b7IaD@C=JG*^f86+V z{Nvdh$rIyKLB~4GUv|hw?w`-R%HvhXw0E3iIQ(C^{m_+k~FmxsN(UJuX+itBHWkfJb z2XISM5_9h7)s_wDztRzzIXSb{fZVkplkY;xtKZnvpToCr1dt}ggR>$KO3&lJ9+A#m7@~U^7 z?F(8aL4M>9e!h>PQ7g2AGg3Cf)cpZ{WIjD4%9th}U(?nT+N;)^nd(T|vU}XShz~IE z5|v%?NIipE4f_$f`_-0c)GqY!t(MHb;7S-edx`lb5!{p#RfzC}2tNl|!#C%_-;(b1 z3av+(`voDZ={b5gWaWKnA6{0cBSL?7U`Djky6T6AgeTpTV+En2U&_2Y`(q%VPD3Gf0VC7}KP`uf9Hk*%YYNq=vUG0v~v3y?WbbvKX z8G`o`k5l-ZgKYS|t1G~8`hz9*MD3-Sc84kz>owGZB2jugI9!B|tz<_Hf@!`p?;uJlzpV6FuJ*JHL&ja^WMpZxJ70*wsIGT`H|$Ai0Xly{Y$Dz?rkH zrs5(9RwK7w6<>E8Mw{EdS-*T)M7 zR~-eT@kS-iyv6$r!rfi~L+0kBmZgp7O3L~)_hqJyfr|oLX!nNtvw5|7o)NWMF>-7V z)dF>=b!sJ37aYUdwQXI5>t%DU4OaG#&;^0@%xA)=BxEzf8sFnj35v4t_|5KF#0MCt zB56m77#y4t0|cMV(=qNSCqUONgtmWw-K6>)sp+>tk-25HM4P04M+TIN(|)XX%1_oq z2XvBPNCYy%S9uv1!%EUAx#CKlTt@?;stjJ-@b@g@0}S<}{b+HE{PJAs;@@A7t)&*6 z5F{El_Hb8})Ex2@@9(Lh5r^8gJ0%Yi;}lAkYy`sVK-LJWrj($wkchylSXk@}gt3zFYJj4PZ#aJX6{<<&Pr9G2yCs;)5pD6MAu2u=dp5D5~zc_UBJc z3h}ipJn6Y{9bjQ86?97Q9F{ z<)}(kcFq&cd>`-}c9aFC0}r;y@~UL_*x|j!I=p10V_K?K{#MRU)YR!Onf8UnNM~QJ zrBl_Y(p>?;Un=1B%Lk8LJ58!SmfT1vk=61K~bbCi)8U_a2A2nZ2K#Tg_$0G`~ z8{&R13RRL#gyJV{14LU5?nnY_7D{w(>(x4ben{F;4S(f)nX z`AZxFJt;)BE&Oj`yaHT<%we-Uuspqf!uh!qziz9e#g}~y9p$pTE(PvY#0MC>E#|g( z9c~dQIPbpKjeP4X-y;sus!&|+6EgzS9OL4H`sEmzAf4Ouc8c0@YtfanE+&Arja88N z`l3npIVJsOf`SMS`PyyxoUv`hp=kIs-=8A)D&hkS{&-69>;l&>N^$Yj4u!8`qE}21 z8xyr%!xxds%a>HbWF|XA1D`y#zh>wVi8a^4Pg?p2-VPy_a5!5Qd{{Lbex9JhQ1tG$ zOX-@qw^qAj`h&Kb@7=QZW&lId`;2`=!6OVych9;SrH$oTX9%wRs|oc^Q_)XORwd28 zRKr?1w&O34SNm00QHOo6Eh*u;kabRKOct0_onO@b|iO=oDk}RHI-z z99anmX2%cuT3s1@4)lT4oV!vO_|kOIQ?}bHVo23_RP{yan%B zgHOv8j`p9^loSf&1;N_uI>j;OuR78+`#Ab8+3I%`#?1$4%iE_^^&u}xHu=981-K!0 zlnw=CvsgBL61d0e3gl9-p9vJ@u&v+^MU6MO`fP7rF+(v483xPlDcM(w@R(s`#Y@D9 zfp?{hn`pk?9>(h5d$P9xm!6SCfPOjP)JtExhW6b!l7H$vLzk=H8Y+wVn((uV@I8w7 z07FSU*pn(4HgVzfPRzHf(3o$|u(l-+J_qGzb9<{Yz?(chv{}%DnMNRj=qpV`Fgq%= z&oiQbLJSt7GIu4t^)tp>ne%##_vts1dE#TbCr>X9BTb6s?@`1D81xSzto_KKjO1~~ z4Gi3gbTLNF5}eE56p6At4X9pXxS6PCGFTzueG!GQYkkEA*QCHJa6V@p4^~m6xa}3A zyBwH@cZA12!J6?pxpmBX{CoW*m`+UU{oN1%!)gr*b$mY7Nt7f0-nLoHj3ye=sk{re zy4KZrdZ^Xv8AbTsmQw~Z>Q}bRr<-te#fdC}lPXUSAl_=ECHgJS+2#v)HF(35LK2ok zw%|S`vL|Z#Wm?QHF9m5)VnBhXFIL&2d1!+ezk$Miyt2I@ zUWVvGiV==_Dx7{u>*}{CRmnsdioq9*t9VltHc?^koFJx;s9{bRHSXhK^wiy0j7F08 zC*lJP+Osybh1yVG1q|W@5crMlE)p5`*7I;Hp~8}VvMNjoeS4)2eWSm-uhX{BbbyaC%Reh!0zDYhq?!TKEsvj83b=qlHyXWp5OT*u*eQ z`Lz(K5_UvopsD5L1eClT>cNU=Q*Tg*_39OVcW>1dV8Hg@*^H*LT2oGpmj$C;#t=Sm z5XzG_^K>f4X`i9wWka&IC&z+j$~9yQ-c=2dWc5Cq<9qa#-?EY1HO-a$&oxl5fZ zYaVI?Y}_)W)fM(~T3@t#GqNOe{>_#H`^yP;Tt*TS7WL6DG+)?-p-z_0 zTCdo2<$DwH0S4q--0x~d1zwU1RmHFyjNikY6+L-8nE2hk$<4G8KU2pIg2E@QYSyHh z6WrAJ898Z4tA3ks5U6}DfHMmd5d5|0*%lEPzfnuWn(_xKJ?M$+k$B%V-28^SrSHXn z-$56=^5ASzlk#=c57MO$+Tv`JPqk;X+U3?^|M2Qd(zj-}f+s#7{i^yK6eJ?LwI->L z`s>I|xPVV`ih2~~z?a-5|?;_6=e1%@o*+YCTE25b}h8)7(Vso`n&rj@HAf{crEY1e?`F z-xWQvKK2!x--e*+Pv8lXy!~VtkkTjDFzsWl@bbPye1Jhcn9WcBljgXdpMr9$)OtkM zk}z{{A=3}m7r(KeL7{{!JG`hWKK?ksdqulyh}zuWQWx}@->}3g?1a($bvr13v26^x9ZQ#=)~6JiJuzI;b^p|*-1?%eYiX$pPGY2ad`m`r zucDFUd09WRa8LhndCxsnSAe11oNUuS`#8jL_msQTIQ~SEDs#j*B3~9wDwB%cOvjy5 zK_O{wpmqr^7)-z2%Xu&pK?Bit-{Pm4@@#$+di$)EbXqX!+r3%pEmi*+b7PfA4oYH&CHm_lO27xKKC2!+$r!kB`4mx{9}= zFM(L?_LaY(W$)m8UP7RalqVxzs@5e(Mf+)*j4wELFXc?cO&PC}ZD96;)6lS<7yUf| z+-(6cNGJ+_!Mx~?(ti#$L%3JEq>$4jcDSzfIYGIt_&Eb7lHcCJMfS!K#k@YU+fsD& z`5^oN!J&T07%!ink!9nLh=yK8fx;J`*9s8F)O7ORy@$P!86W1jADjq?Q7n;DJ? zFjCwiT5f#E!+;$X>YZ;h_h4R?43vYctMe(3kR2ydlV^ZBou~ z1hgs8WH;5npjn^0Ip>6Kw6sRl%Zw2 zmSgCk^L!I1BtUuzmAb5EnQM7(3|uRkv_b`e2W-SItL>HjY_^_-S0Iawm&pf2v`;Bf zPwC6Q_@a0L|3ziLD0nmZyQSG~#g81K>FAx48I#Ny$S=;Qga|Jjl$bPKw7~(>C8eHj zzuhn?O(qMInXb=7&A-J2s592{N%!9>;}+(4Z>pj(QkbrHA>E6J z4=_yG%vZ_K^4d?g>Ul!&q&c|S?J<_UEP8Dcm*AtjUxV4j?>}rVFkiPYd&~)!(@Ax` zt=;#|4YJBN!GvoByS4f{ta9H#u$3S{JiEvw&rOCS=tHf-S}COe96$Vh9Mu2=9g|v+ zUmr6!f9tY65cbmQk5-~xKSScOAziSKPNl9c!v??c1~7>2g%3gh=LXn30J z`S@lvBs;Mr;@BGNoNwZX+LZL>cKBXGK2wpbLOzNb{V)VYP*#UX|4D!Db?oc_R0VX1Xx|DQ{6!k3F-9P918q}Y&MIywR;pOL@A{B$>=-x-By%W6`Tt`wWG zUhp>RyfR* zpD5~gMUHNBs#;c_|M}_)FtAgU!8R*?tIIxK3PO)57LF74E3_cQXXZI%`?93kgqe?U zBhI&hWY;}R(Eg4ZH`CEV_3ah%@FreEO9Fc89DIRTh49=|awTnBjBnX2{TEWYL``YV zbgZ9fjWG}m|MMcgkiHSAv%aO1F{zQ0y}7k1skybIv8k~=slBnj5g72Fu92~!xs|>p zE!|5}V6=s~^*>&)G|8D_;HfXrN(#-D0{kw*H_u8Mee>eWWyC3at|37O0Wl9G$ z++S%scjNwDOT2sS&)UBm|KHsodAI+cHGmJX3mWdPH0ir>|E|H^z4mAA-;Mw8?gzWu z|4-W;-_IUsxWCdOd+)B%ziG2~Yy4UJcjN!N`zP=A|FZ_f&&A%{(OB2uKb3;N_x*X1 z&@i^Qxx1TfjrAQ#4Q-sP9q)<{>D>~*T}^6ZLJHKEyDnQNM_~1THN}6P`X5E&ude}A zv;QC4g8}m`ZA{G#^)3HVL;nv2>c1cW^ZzKfCN}o}fqqBue?tG;N`IekVs35j==Ohk z>HcHBwT&Z#K7+NBmBC%j|Ld3TKjz<^5SFC>Z`1#F{q9Z%eMg|0+uGb+ia%ERr>pT_ zuGv371^5kZtZXffUH@_Y|L*`4?@l*TM>ktzQYweLv&Go{?+^4HNR3@>jSU^|POSf} zBY&F@9EU)@{>Ku3beKEbC6}F(x&6Og##Z0n!C3e1e@9)1yZwOsM%c#Q-pSUH)X3Q0 z-1%-I;N3qX|EI?iK%Q9NIsLc0#aiFW_-|=LSAwmmoWDF))xP~+P^-QvAK(=qnW-nsmwH<@wIc(w*+>wcK`xx z_>Tbpl`ACsM?{_V?alQK?%w*)P&v?$-rcfydFgcbF6_V9=o~a$(_d%>cVmF|$Jl>< z{72va>(Bq&wf=cL@Oa@bHUPb99vY7A=l{78-i-m;A7lUd@gIHvuRs4-i~gV1|6{E` z>-%FoFa~)1<&NR6G=SIkPxkm@uYdjtjQd~geFt0=NB{oZ0g5eFEV1O&vv;vKPB;(& z6{RTH6)X|4p<=&aH}=?)XgpD)CidPXXzUt|8jZb1jT((5cJKduzq1Q-Mh(fE_x=Cg z&zsTNefF7WzVqGL+1cIMxkc5gSk?U%oK{;mv}2>{38!UWNkjXq*44XwC7r5O@w@V+ zB~7>WrepagPS=xd!n7ZH7=i6cX^5m#wJJ_a{~TP@z;$D24^Pc{kb`$Fq%7tzkr z5J{(MRh*Xm@6!BPTe|)t_C?3t88fKgN6E%j8Rc9P23p}eQC4{3?C&q>NYyvtwGsah4kD_>gD(rU|9^HtRoPRqWM zhW3~0r&Ssv=~S(X(~|#Pnm=PpJ-%e~&*c4YJHC2bdHwiy#eSzH(*8zWadRL4mS_Q= zmiV^(#J6}ue3$<3P76Z$uSeQ%J&d^uAAkDe7zZ6iU8`c9`>X3eW9tU?hxD{=rTH`q z>$Jqb>L2B+qU^hF=S`fR_IIz}R2FgOG#oqfg>n8Skn+mr)pK4mi+J1{25zSG(TufHYu;(SI|1G$C`Ai zR>l8neg7F-v*ADKX>HSRPps1t)9R;wywj@xyLEc`|Bc6o>Owu9gdI3OX^Gq}Z=ikt z7sdGN(qCFzG+Ywvw8XUT=XltosOsCjwoPeo;?z8U761P(|F8P}SM!}g-KHf{dp(YN zuXF2)*)N<{bAGD_ODDTxY#=q(x< z#3P;Fuk!0rdJD?07HK{ZzqZw1Tc^CW!&}hkcut}>TY_F)nfR3;Ue$@$U*z@Z8%OW= zJJ3t4J|Yxv4!gIHRo*)G5skX`=|gXYwU>7CWu5lA%?Gc1@j{Q@7E>v&y%P&beMuLG zH>)PCEW9o394%54qw&_(DaluV;Da(r_@=X^Ckq<09-)OsoFy*6HQzZKXrst}#(Pj^4P!frGPLL$+p~SgZf$V{oTu~25*-8P2IsUM^LnYR{ha4! zM8|iG?ny7aX<`H3V@E|t)ygPLriQU-BwcYj^^C?@7DbdbI<`k|%o)_?b1>DlU)MhL z=DouJ6HWXfu5sV)nCH;Zgl<625mZTiLJx7lC{X5(>CvZ;sU&7S#N*5>MQJ4)_rQD& z-8E3YJfEONzXYU>zEA)wu=~N*)K3W9y?cS65C;&CFd;6Y!L@>0`@RAavQ5`Aa zBZtF*4Ol2{+zpuc89-LZgt;J^18-> zTl(>tF4I?M?lpGhrJJG6O4xgWEBeFbknG9xC&VUQAN|#PoASkiOE{n3=X90zC(VaG zI5y@~yGtK}`*45TZfy#0yI298PcCF_VoM8)6P|I;SvJw{n#9l>0_3U zXy={0Bw+V|?}EV%+Www@On8eqw$Bfbc6WQeFbG`R{Q-TJ-7DUqO4~eNo<6>-PD60{ zPSkE?j%=2{)vyaAF8O@;(hppN{`(pZU;bXhJf9AmbK|?hmAt{#E0(q2_bUU={Q7X# z^gj8j-S7fec|`9veJ8j#oY;DxHF;p0kUHQ>9+?>UxNi4anT9^^YOHXrZw+u3+tv6M zGX}Nx?KpMG>{YR2tAZ1U*0;;)yD#92gfp81zWF$PWpJG`wr#XzPOZeistr5L`>amQ z^59PT92m5?!{e^!f2lvmIOW+lWx(Zd$p1I&bvJ11@~hsm`tU&ra-@`L5@H zg-PG%0(X94&XAR{LvDQgLyO<`{M@N;c5s1(`gundt8`~h{IWK4$BcZO1>A)h;UDg- zedAKc5-avsj!P_-5nND?9ARDeZCZO{li0>~Tv_tj`924-7xUjOzUA5%)Gq=I5P1mAjm#bf$J5YD! z7gI*Px_lGdFR zRd7?cyy($pN3I$kUR#$AE^~h0q?ZoI;yF9I968qX)y|B|26aqmmiy)lha=4YS^J?Y z&(|*Us(ahUzQf&p!1a5%pylV~GmPt(G`MrUHIqE&Ja;%U4cizN-SNTndORow4! z#=`5`wccE1;Nq|ExPi;oeNKI^Lw5`X5?r{Em}JDC?vNw@p+!#N*) z5xMcP!x2*KNbjJzUwItt`Q`I~=+fPCfLm^j>Q=2=?7eOY#@ns7Cq>5mhI65EpQso0 zX7A2_(<7@P=t|DrkI?>JJ!~BtxHNa0_PiA=0=K62<>sf3&5q8N^Fp`M`@dZ} z@FD8ziD$Fl!b0cytgh52B)rgx;}0B;hwH8cb&AXBGUi6((qDhx?!)rn!rR?y5I8Aa z>uaStjH=kzl4Z<&hhvw&ua9TOCZYGnW*D=z*UJ2teswsO)HyZ8BlDTkbqgNNzxz?p z!`k4=99h@*)52Fue&1=TeTLW0`qS^>SiZ^^yKBju{j)B9RC9vW-|OyOhvQMM7oE0D zvo*imc<|?!ciIOu1Q&BRq}}};ee+kkci1i6w$d->|AM~h*L;zoxy#&(^eX&*y+!#- zzr5pcq<`TTI&Ey*-TlAI+^mF0n@P>Vb?ywN~uD{C!OA@As~{?Qk4^w54I} zuQAsLX3yTb$fsj|%LLB$!((fk)uT2ydHl=xty?C(CQKM3F2ai(Q%O*}}T`T;fLs7-Sg+6QBs?zC64N4uzeM;1t z{m6FR;n*16Is9qq97Sqcj5V*WNZ0xFPq+rmJsP~Z{=y}Bx{uC3;=}Pps(|ZgofWwB z{l2S5WS+GrbLF`wCth%c8kG1;N3Vg^zn*?-_`vATuQ(i+J8$l@<=MfSdlz1Klyy;tagQ#et~z+d zRIkwTfvLomsYM$1^JoHYNpVYbwllM8RXUyL*^~A&t1r2PYs#9nZCpPZZ)th)%c-85 z3r=zYS9$#O7N<8kykhoNJ)Pmu5mW1n4#$tH&NTbw$*u8?=cRX>l9aG-!v%-qyP38| zGtMV^4{+J^V}mQrnq~)Aw$M=jfsJc*&7Sl$Q&}mSJr*|_+9a59gZdop2b=p z)%+~qos50FR@M9A`!fzlxvGad_sTsZ@Nv?sBNr#wij)O6WnkX+m%QBi|1kez=NtvS z?~gj|aCq)L8oBXA-tSJDf}d?&v3l9XAJOjb-489c;Df@~i<~>KYRHb!wZN^b+qX&j z!^Il;g`7LlX394Orkz4x*ST3h#&fqa8~aSyD6&0B_sdD-ojAgGecmz2Kl=`C*7A#c zp8nt-R!LWX)R&9%CS>^HmwjgkU77cT!_lbwf&tZvd^&#Phuh0^T{$Gr^Airo>2Z5{ z4KgK9cM;bRBlUO&ZJT=u_lvid?X`D2hHLGrJk4ik`QZ3~0y)-IoBZ)t+rD==R*dY| zbkXe_S#7Ug7F^P^_wGF4o_|z1sP4}j8V;ydToQy`!*QUw+is zQCF6p%?fVIjPvcQ7F>Fwu}6>Rg_^Z?blnYI?vGn8wJ+Mgq;D3-v#iD;JHK@}BCYnY z`NMN2)~)qf(xRsU{R@IC)jCgbzH;rq{bW>yxQD%odLA zocW>3%_7b=W0uN&PMm4$c9r{rxRTv|QMp9oo*JjC+(K}c4L(la%vlUB+rr~FRNYc= zrLT{eqH-(1Jv9Ba4xCNrSA(mxr0o@K+jVX|xE=fQPsFyX&TRr$erw_?Y=5hBTfx=p zmI+^&u=LY895#n*(LLjYxG`4e&@>$1-ilu)M2Dq1hbHORQ2gX6VH=o7=Wu#BD#wo+ zEhaBbnUIas(&3f6%M!7+dCF55PJPGW{K?0}ygLW=yy%7;?VCo7u#d=P(K&Q~j!g@D zEZn;=-(;Obx9cb|>A>MySxqU&36}szd`+*9Mr4@w1Uk--%Z%e>`bqPyW!gl4F)o<$ zwD11D^Nl-Gy(}OOmsN*laE})=ihSgYP5uiVxWqdaFZ*`RoOM0RU3#v1 zBVYAz-L3?|UP=Ct0&ZU%;TJ~ywmbhtw4=&qo3n0@XEEd z(yidj_OKthuHC>*Y?ANR%VO8wcmMi3{^Pau&Gn5(?@rxb{ktRA_RovNrl6m}me~FE zhGlLpZeP?5_!XNL`U2a^4KuFg+vBs_?a=J**gQf79j-idQjbyy zTCe%|!PWQ6+7i#9$&I7mXm_Yk^afZ| z6F9dCrB?hf-RHeBt9s7BSDS_v1?P9~!Requ$D8&$m${CxWN%vnT$z5S#$-KYe$X}J zn1y2RhtCgzE8Dfv)E3wCe_6bEorv(+ZF}~?&q#YO={oyl{JIgY{YpDt#D?U`hl<(0 zyT+oJqdB%LeNuAmnfB3!9pG9P+_U;g(aHO7n(D>n$kz03v(%e{wWo6r4Edz<#66d`Tx^btHh4_B z`7CCQm^Q7=`WbtYPrU>e~*9_8z!qMJLb7YuSJMQK`+BK0W=i>I{sg&n}jK z{-lP%&koFwk860_y15PxX3M4RmJb{Pb;Fmh?f31WVAmTt zVqUmq7oz%&&dC$D)<1fuT)M%77e!S28r+0ZC%@}GqPb|CtyhU@% zx+m6LLX3{vIeN#+hX=1$G>1&wUt0VO?zwldDNp=vZ0VA7Yx&{6HRezDzJ9vJwd$wEEa5Cib|7qce@t5ZIdQ|Lg-buZeoCVjSR_j%!esd3fH*MDSsH65# z2{=2mI=oo~JQ!=j*Z9dzye^-`_TW>8bSj*2GzWXq^_U>Cx9Xj6m zT(!BI`Yy`tUn34DSEI)3uQ&C6aXEHw?|_?MuLyYmeIb&^Z+g7$a)lAele+k}zns0o zH{e!gh#4{6WqHY&8GduU={VM?bABPtZk{^fz1H5-KkKpP_?+(9yt5R*-v|kAIkWw@ zjXwF!nq})*FYE3#;I=$JGH>Y7j>+A+PhYs^dd%_&oWLViIhNLR$uPWUj+{lOUTIv< z0q(on4>!7gX&7+l>veOBnA|2TL=V;5Z|k>@&6U%4@4jnwM7nXM0`YCof;~DNYdrY; zkTZEIdcGQ(|A$|}d4wA;UzzapnICfbx2yJZ|7SBzn5Vwd{_EkxM$7sAOR9bln?0mn zVIjU;TI!>%$0E1Bto?j_jdR^sT?OZ|F88>`!A8H6Lk9QR^W^-#aYgV=pD*WqQmD=b z|6A!UT)jE4gMUSICNsO9nDbS&rrq3X+XrOZfBM-E;4*%-ZL#%Pl<4_>(T@*XLvIZ> zqYt~-Y3=ZfL6IHq#ZQgN;+LaHF(FoWIG;4&n8|#mME}4Hm!6i`3(m85<->)~zL&NA z5szc9K0MStwm9CU2lYN1vLd_n*TB`)$6s_?oeLe7d%fkiB1aCZ_bSq!!DG|o@Xg>x zt$O_YvtKv8OkUi#df1eqh1-|JIX!>nsEqY`{!+8jXAcLNb9|J(ln_2~j!Ac#R=9m4 zqodl&s*A5I12^IB{ZH3j%-gt?FeFAzinoN6MtklzW5F-of-4u;()!ZK5(D!;1$WW& zw-q_+T=t0>yFACV_Fs0Kiz`!xQXgzJ=V@8hKSSw!ZPOh(?^_n_pza6z=7nF37`f+z zS|zhwG~WVe3U)hrJLmN_&+iWWVbh+aFQ$}(f7VOaCWcK6`)2Bi2XTfqKU6O-gf-u; zM{P$15ANCYVa2d3#XQf03w_ac_{0Y%{Lk!pZ_{$EwZ@zifZGXqW!aun$>sLvLiXYAU zy4JvTvkC`{82dr9^?M3b#?|4}kPT#Z!o)!#5voKR)bLVnVAdUQODMdasHQYfjdrjk3Q@a;*_NeGzORqo?^n=tyHis`HC%ftIL1`+y}qnL@X~#? zN)>Cf2waWt`c0i$^iJTZkH7!9(y-&b8db;N#Je?pc8K?h;I3t|&HTx>pBlJ{vaw_Kd0T=ly2BS53@kf7*P9CF;u}-!%6b zduVQ!udjiNe{agcYE2t=s=jSrwhr!97JXa`H)`3}p7y*xx^b3nS6to7=MAn@TZq$T zj@~RD8q#6z2b1$R9dL8@NpL+DJ$<_RhaZaNxYPR7=5)RVhT;z6#jCj^*N1%A#P;pp z{SDSyL(FxBXz=9B#37vzY&TDfk8j$0T%-Nqt~A~<%eT?J423hfMdtbTR-2ynaQ_q3 zaDM4defy(7{I2$@h9Bhi!aalQ)a6MFsz)T`*thuBv=!I3f_vUFadU=k%Uj>-`aE;z ztPwb)Wmw>y&V4;1t!HbvJ=U$#5Gh|;;zH;srbVl3{;Xcl_onq+|Q8KAJIDQm7@@){(&|Qk{aV*IeMqTt{vL(6J9yK`~xjye{Z;v-u+DmD^{xP zS*2>V>NRTC_x7>+`Ze%x7!VlLsBx3vrp-b^!@`@lh=??mDObLNm&x@1Ek6prawNSw zRT;&r3dXIM2u|Gzk^iXF(a|&k)0*-$qs1FSrTQk5sZt0Qo`gKTtI?tcEox%nL!3`V zEUcAz;X|ky7EpVJQ)+Wsw4g-{iW2*y);7cumSylgh10<<=y7HL0NbkeTXx(xM72s?q|v zO!ceN0##+IPvv@tVB4GWdWVDbro29s*N5`@P&OaR=0iDre0fo^1yIEZT0~-j6rVvOS7kVH%4-EMPy-ANB+NVL#9x zhb)kM4h*Jj!IUkSas(qs5EULo^%6v-1yN~1v4fLZyWS(;}1>Wfgif4L${XqlGohZ?-%w9% zhkBx#Ldjkz*$YLrm_o^DDESvkEi;rFW+)xF(1v7%8citeWhhl$DD7ovGg?sLp;UNi z1TDz>FtQRxCwds2A7PX&jBIQbGzzJya1hf}ujz>5B~ zXoN*gA6f*_f;SrzYEFw5rtsj(zO+C>aOH3;U^P4#RR0jpRvpatv&*JwhE5G>$d zcvD)iYqTHXVQ?!v49>J5H(K~%vjy#C3rcO#oE9yRqXq411np`Boh}hnR}oZA5#)FT zRZ|4*bOfEm5h1i70}*tLBEoSzBB>%GsUjlDN+el{^g(HnRump-h0l>z6ckCvBQmg3 zV_Jk@fqapH$QMavL)Suqw|}m0|97r$`Xkx8_UZW9bT!sGr#`B^&b_{^YX5Fr zGAy=RY>)o27)lhCx=TO3W2K*Eu}#AR+p&#dgOuO}9z)Qg4%QeN6E(56q@?0+-ea5g zVL9><9fWPNw$biIzpAl+0CzcD}*TKX_0f1R7@-K+TEH{FP~VbX5AlAfgI z*V3bv^e83WK2+w9RMN@M;}(1m5YeQiH&D{YEBS3hWd0gR*Zpsyq?@$#;!6G?B|T}d z%ISBx>3nb8Z&%biD(}r^WV~rE2V8!>|3<-OG^4KCH>++ng0mV zvtitu!ZfA)c3S#QC4Vb5{{WePt&-kONpGj6f2E{%QPMBQ%lvbcbn@XKj{ROQ)W4QK z9_e_U!XZxa&(>e&AEe}uSL~a#^cbXDwETmW{Pun_e;DV-3qu5(k}kA#U&a0iCEeav z=C7rs??t*m+sun-(b6j@=?9hci*Yi4QKZxPNa2W*Zqw3pDfwS0<(ss01Jd>OCu*ji zKS_P0{Ri54P4;IY|158`AH;TA`X!{(yJ||Gjr4;^yNW2Z^dn0C1xVM=PkV1^KS@cq zE9vdD^p#5bVkO<0j1;W32G$^sI$2049hm|OT@OrtHOlUvv2;5Ufmhoc=o;>h@pkG%;$fKHN#J$6 z$bukBKB6JXk=&<4>)0AUQGjQ~O-qKyE;QA8U7gbXOa#t8Fk z6g*SGHx!%`2VK{DD>z2M(-piz!TS|_OTlI|DBWfQ1;;3OhJtqhCulyOQ1BfEQ*xrF zN#~lXS9ukGplMEFO@D64CiZB#Q|-iP8a+X`KU(4EE0}ys*2J3>UM*L}$2HAe9BVbN z?%V6-{sO&Cn3zt7!7-aC%(xKaB8;mrF3LENaWTeGj4??8VG!d=j6Y$F7w8B}8RNw{ z!Y;;D7@ucMcm6^=W{el#2-$H{ZWDNsjZm5~UREPm8T0L?=*$=|lM#k7#!F;`nT+LY z&J~O;%-H4#&ot~jvh{In}}wd zk8u~qRT#%GZo;@1{9#se9@VmyR#UUcv_{G;H>csS!G zj7KnzVLY1gD8}O$&jU^Xn)NH%xQ6}E*`H+%OL&o}!5p}V*fiXdv22r{Df}0hQ)Uyg zjcsKtd$laMP}zh$)(sfTV;aR+9*gIUBe{gy?~z{CZ3N@-TFI&BG7-9Oy`iCfq44^7 zmn>;s>U!FE6CR`4dGVdQn5x)R^`C3}nyt=d>E}Kdq}X2zy-gHhdOu@XZQX_6w}3ev(;%aRt`MHlXs~ zGB3|lmA}BeY!752QL{t+s&4Z!Yi4jt=IrGEOvXhR&thDS@pi_I81G;l#W;!aAjaP? zp2~O^W15d>)22@EV!WIAbBy;e{*CcI#&jLgean_Z*24rGKDB+S`&e4jaAqv@ee~7% z1{knu2W;cJH2m!u#vkbN6#Z`IW&6?Ve+Q23dFE5(Df;|5rEfE#QT?d`-j*s)(f4M) z5~oaLT%GZki~|_|%D8DtZhc?ebETfAl&JH?z}v(F)_XC2%(x}v=ZtBg>-#e=>Aj3) zzkP+VR4qk)*~D@d-C->CO))TF6Ki;*BV);rV7#6;W-&g*xLE$wdKk?381tVh{B6cR zFrT47s@|9JDdyWN{3^z0m_MZOISNwVbIg}x%utMCe33U6D!fM_(qCb|GGnQaW_*n| zhAI4Z#@CrY%UIU=b~GcK%qsGk2tVVkij316Xd^prO>6`Z8YHXvR{1lyN#EZQWJ)=~c*14(8V|mijQ_w#OKICjz?(%Wenz+gY{zUbcZeQnI5TCyDMviIJduNODSn143~T{Ug?TbA zCDM}~!HgJ==ndYCr;Th6T-~Mp+KTJUtWXSicU^vkyJv=sZ2w=vciTsn;NS zuF*Am|No}v7hOa5jfD04M#6O8NcUj6Mzyc|M!Q4zSESMJuXH`#QxSgCJ(aGZYZ>9! z?qs!Qp;8Movy`X=Z~(%dbxD{B}~^}-3Pj!(sh&g*RPv&jnngfjy7Ce_zC;@ z^zJJe2Z#m0r+{t9OCh=jVR`);3TzfFxy?@pwgc0-Z`UxL`%8f>;MMb}H24jix0hIp z^97rHz8Ay#0P};yS@4(H&LFn=knId2DF-u_bVvD$_2We5hpz6@hjFaWUX%O*4~_I; zoX|Tj%8M>oybp~T_gxm`#U}gUjdgkE7mE=Je;2$r^GPD^QK~)^J#-7^pNPG`xw^}J zf5JZKHY-8Xn>B?EFCM4nr7P+*=7S8Uo}}_g;5Rbg-!SW`NX=_QdM)O28p>l0aD&Zze1W1wHd`at7i=&^~X=%z*s0R*cE zG5Sf!`)G!rds#oyc<>e41KS_T_DM$dP!I7QYvvg@ZG-9ZDd61AGW&{(;fo;N~97HXpG4K^i9e(zgdjy2eqk z3WE!kH4Yk!c;HkI)4SY%VMMMzlF;}66{!A@)AIx{S8ID!usYeFQ9+S{xoMj4FcLl zbM`HdhRL_mz!vc2Lv0NMav+-thymcuBG$#`g1@83d1KjTZ`Q|hUdllFR)~XHKgH!N z^s>&Uuzn`zox(oM({O72taRB$Mi8vx1K0LiW3`G>uDgMkLT?jOT<9KPBd`US>MB{| z@%aP?{ERpOXbV&O6sJ(98Y`4I8{{Kd*kLFUR_fZd+6AOJ}70jBc;n4`h9Aw|go2-0Zy6 z=l-3(E9;B6nKSGD7g6*@ey1P7`igEXp#L1$E-J8I9-|7Zmt|FSOFb^ZZg%V=1*(UK zh)dW`v|CUX-A=SpZnRUm9?*Zs`tEK~Df;e;zWeX=4_M#VZE%XducGh!JAEE>BxW(h zZCZ+ch@v0zJADn-k91p_q93W~NB&OViuIG+cBSYivEByWE+(;lBCrM6i2a?dVL%R4 zZv_#*Vmq_kuENe<&O1x7Gb^QBt61P>m058v9Co889%&O_L(_P&xf%SAZ1Yz)dsa91 zhivm#w&~_Y{`~5u_W5^Rg`nTun8liOlXJ0*k0~BSL z&&>wu>3os>MuYU!K6gTI5e?)+qh_ZV)`!_nSo(Iba~;?&!r0Cu)`z86>xAw@TrA{6 zbo$BAW0U=%vI>JYiTXr|I*ff8cLpvgyoJDg51WQvfu}O|5$?d-82bw|@CnAjq9m|D zh(er=vh-&V!ndH&`Tw^%;N2_>Z0i{>rn7e&7DDK0Bz-HR^NIfAX1P0N0hQ#G>9*hcYYzPSCLGr}`X3 z$%&d~8|PhY)HYLidN-G>k#Dn;mS;@$xlDaFyn%8PH2Z~pQZey*xvdpm^`Vc#PgU?r z1(WGS&Hmf)!9S^2?Y!$5R^KmGe+y-qg(vqdxNxA~^Wn)1j@;iN5);AKnps&sPMy$7LnEK>Kz!rSkf=t~1>`P|$O0o%n4#m^c1e0mzZ1w7r0N>tMmcsniwuBt_Mw%7xvV*a12#p1L7hnq1 zKiCjM*k&DJhfR4uT!(GS`{6n%{eu;`OF}Q7k?U|jEbo)?u&V{K8H3n^Z8jH~@z^+m zeQVA(<+Ck#Xr%q-il41T0r1k#=1zSkov#zwW+%}KHos<@ol^QGtLQH9iiHFD&<-() z^@GLM6dwjF`UH^=8d=t0r#hkjZ~db1of@V-7f_;JmWuVcI%D?AxjMRieSXgRtCPVS=NMZUw_#kLaev0%jHfX6VZ4~JmGL)>ag&H}iZMEGgkKrsq(sOVMCIZD zA{1kc%0Q^YxH02JjGHn}V%&`JkBmbY|H?R&ah678Q@$4~&6wU^qYfFjVBCsvOUC^f zw_!Y)aWvyajJq&SW*o!#9OGV$A2aUFI2YWtiN1_0F_v$sgBjBZwGiDI4`e)^@esye zGPW`PhVgL5=NOM*{EYEv#<|cj+3-${!rR`fQd%M{5Gt@X&9*Z@MyEA`~aUaIl7}FCP+BRcZ&oqXU0Pb_F)v*N+6luddRthR#mU-F6 zRNjwy*-j{rUbpH!Y8%$fpk&d9F})eWvn}IUjOQ@k&Uh{39gGh!PGWqS@i&a0GTy~F z2i(%f%%~dznSqV=6_K5;;ks}8RoqiGZdp4pW}^0 zg@4ZYBJ=OJPAzvF<15TBQux!1uQC5n;XQGB*u-__n=*dDxKdliCgW$!&toiy{1e)x zYBno)bqC_*JhA8@dmDo>lCRU7csWljgt43_HiogBC$^oj)Vuc~eL5p;6=y8@{fy;2u^S3M23?pw zPizrmssD|!oF~>1ml>O+#TSg_Jh6=me~a<&=ZU%CvSh~W61u<52W$s+hpjTe7GOP? z0SX{iWqoC_7WzQeS61|ubvfT}lRk{~^~4eAyRp6=>xTeaw0jK7MD~jyj%Iy;cnJL* z)(0qhd5-IPy7DYyeYhx4R@a9s`f!qR(Cu$#eFtHIUi#lb@xOyEXMY-D>lo|1ipeSZ zu8O{^lODG+;x_AhinA&Do{Am~M+@W+-QBqLr+tqXCClml#4GxEUC#c{6|xZP$B8)T zW&Ox`HL^bCJpg4Q`{aLh)=v?;QuI^UzSK`4DF@P%|G})EC9;**?aOCssh=gqSnB?F zWxZXrO3~XD`*tTi`Jcf0)nYO9vi?^q`@7mnPyT<(`c2|Vihh%#-{hnx|5vg;Nm%jv zTiQ=j^hr*7s{cK#-zz4k==Uo6y-s@a|2*qYi?h(n`ajKjSwE+p^yL2|)?X53E9&}7 zivE(5p8U^@Lv9u~M0|?=hN8dWq$mH2vi_dfm7>3==d<#$eSX7;6n%b0pWjJe75c%fFKO7CqA#iF zX_P?*@}~ykRMuM!522U!Z)Lr#f2)(;3;M;Z4>nY(tm}gneXx_hF7(@3-^vh|qHm?> zTRG`#Lw}t0T@5Q!^j#HwS0{Zv=znJYNW(qo<+$8P*2{6QkxqK*KOL-}V#w@?zlAw~ z`sXREF9eKvGEREx4@-hKi#diW&`bMs6#H|W^kly->z5dUQ|vEM>@RWBQ~%tI_3I3A zDf)Gae%+U?&ROgz<>*&%9jJ!P~}F^k<6y>+b^Ma7+`hAN{fj zu?*OT_dyg6FviW47814fyWW8&L$hY<+n+)Hu6ObO$#?FTQ4b~_S;pLDU^9AHYX1cW z(s^Bj`|Xk%&W!!9%D5(v@p=PWph>UQ9rcIQyEFlB#yEp(RX6wUte5Xe2eH1d(-?kd zt+8)nr&KQ@T(Gr8X=sbSh*3Z!3-SQormv@`hEbaM}9O*__i&@k!y0b8Jf zd6A%DKn`Sw`jr{r&0>sU7VNCzykpqTb`7iL_C|dkWc^-4=Gt!VH(0Zm^$#?x>R-YB zE7lv0nd`W@=NU}^JeO74%&*wY&vSr>u>Jf_^IBUX?-;gU)3_1#?QEwe+m|+Lvi)TmpAC8nzuJAg zpiZcM4u6P#gX@P_84|ViA6-L9HgIU__&}9mgllu|AjUq7#{n0|6RG7wdiUjw14R(< zF~%Vx4)`hKa4`+oY$JVJu@%^#ae_Dw+y~e!{0(&ejsdmKjSOa}GOzP!3 zL}`Dl?hf}+^bK zCG|zPKSxqZJ;bo4l##wkCN-s;G&p62jWuPB^vyDmRG~-Jry2+?XVVg+eI`_c3A8W=M=^I&6GuBD-J~U%lGu}ww%95J#P8zafXUzm7 zeM?JfCOB!x&IZ;@Hqtl4q-L^{hU^?*%@iYjQ%q{6IBCev1=h?o(zo%XW~P&-E;J8V zv(!l6&Xby@P8zb4emK>`M&o2?3If}KsoyBAVXE`m8m43F2W)|c+DV9pjlfX~#wORT z4eK7@&Ef}RHf!o}sfG+6gExtaBo%hX4H$0(E-Cy3efN)uC`3QM)O!_w;JwfgPxycB zUWK0ZlCkgftoP5{HdF+H`VQ;A@t))q+Ot{saC`m**bdB%ANyv-wSFGfufSWttJm4P z2K0v`DDUT@hCk-T0o#Eoue9^IGPi0uk9${x#sZCM=P~qtZ0Dq?*f8}xZ3_Esn9pDs z5s=E4gT5d0c@1m9j|aAkynOAO18f0yfrf$^k;dPav%aL^VTxXkH%fg;Cw*1u_p!c) zp=_XTzlLJJhLfIpk!!5?Gqi%L1%%(r zF|NsYGUM8eX%U5(h`jnU+5+IOp&_2||60HINB7&Wk6FF#*-h^&-u62b8tZ%8T#mo1 zZ&9B+UY`SyjN|*C_-*@Uv?ViUj#69N4QvOde&c%$({=v>umwC$5phey>bWDY-m*;| zSK2D!C(u({CHzlYMMWUI?V0+Yw)*bxFuZFVgU%Nk$I$DR>NzdX_;0&+QpW-QmETEa z7?t|$zkqQga!qVi_(G#e6T*Bo;Ntkg%c-mB-5WA)F3tjXWE?3j0{7GKRp8OUHqnmr zRvts=a(6!0h%h7OLkwiTuegVEuoJKyaXDtl2Gc zHNki(9$xKYH*0vpJ@r==!JEZhu>g82 z>+iC@G3)ONqn3g6&gB| zy{FTCOMB>#vp&#p75bZ8ZXoMrxq)2nBQ7_P=buYEfll{h-C@UoDG_GT))3khbGd=- z!0zBnYnbYxI7WxR*PcmGDUbdM@te0(O zlG8p;f)ErQD-V<<3Cf92k@`i#vv0C>NW+xNk))&U_YQ-cUDpKVZAa;xuk> zlyt1|GTw%!2W#rFX0V3o_{uu0$L}Vj|6crVLi+Dzq&oZocy#wJiMc*xl21hk+H;LT#Fv1hpM&k*+K1bDj`!ed9$hav2b^kFFbBkd0{ zs{LUu*u2g*ml;Pi*N@9Gwkho_W1G^>GPaq1JnhRewj*sWL zaoFhI!p*%Ruw5Kt`@R~^3{42*!)#x^gFDPVcK~mJK0P!&G)#Tt5XOhu2l;O9un{x| zI=SM7_CA zAZ&GskJRn^@V822JMrOfl}P*6lyA9^Z@4sy_c?C|7tzwqy$Y~hbl|-8G@O|VLLhw= zl;zL*FI=j$(vSNWiv9~OOV_Ug=*apcmmAOzWSdE>AFW}sFZ+Qc_Dzl{R|04z?rD7YCOs+qT2$`!lqUUn6fxTfW?_#c^9uk1P&?wbssJGoe>-Tc>O!r66eK7mh=f0;X*T%nk!Z+3@ z5~dkfn5zj){_HJe5Ec!03{NeKH2S-?>=|*L;=J-(3OyLtKueM#QCpAD>~#1*=B0h7 z@Ttbjt<<^PYuHYpPN&SBu7(SpO%!5&5aXhZlYzBR6c;_4SSB-Isqaf)=4sRk&$*1{@pYX^dfbE}6l5&N zYHBc+V>pzi+tKIY)Inz&!kRLa%t6=mV*V@UK4vV_ZzwnjH*Pjbi!7fLuFvhn%(w;P z0LJYZ_hKyPyv<-7!#tVL%iYR+Gq!pZI6UU81nG4&EgfZ>hQ}zFeAoG-3eJGN)A|3VZ{{asA1M6UzAG)yp{h-F zOzB_g_w?uP*L_yc{XaV{r~5-T|E}@0|Kwb<1hirL{wlR?InFG9GcL!L>o`4AQ?ERm z^})iut(*HgV7mYYzf;3>zi|xM0-o;QE@@c37mWq~D|pPy67jHuO}_u3XZ#Fv2zL|H zG~OzD;rx`rj8!z^`>aV2FO4g1E!*srXrD1xu+Mr?m`NE1Bdj-K$u!^eMT@T?3qK~AR?+3gac`dL{ z&w$4@O#Q}H4U_y=4O8DjfzIpk1im0#SBUl)p8>W5lbDfgu>&ySV+(vQoP`_hlgm31h`LXU8{a_;VV zU>oey_`^-+`#JgG1s@)>4+$by2fYpxlsZgcA7r@+>_djRw2ukAU$U$O-d_)mH^L?b zs@oQbg~6M}ED;0yvfkuxg67qs<0ZedA?s?EpuF;X7r1%U0@=xnSe5O}7b9RteuqSU ze?!`l-`|kmg_zI&NIUb{PclVz{1BV5oz>zX?8xta$lnmj`d`iaE8F>M-e37Gj@9g& zZl@GL54N*KJb|6jz;>~P>rMKzh3$~uDt3yZSkHvU0u8kd>Dv}3->QRO#5NC!iXHW1 zaY#89huG#0F6$8cc3i{Mp5<{l#K%`2mqTp-7MFX7%Y}^VAsp)`T-F6K24%_PazXL` z0+*HFPWyF%%aX_F0^5}SUtpUhp|LK|4SA#Vww-~;17+Q2;PF7& zhh*UKK-q_6ouhA6BucS^m-AnY+u-eVB{U%SVk zF_UD}$$xsxgvLgwTzzbW@SDa)h^Mg;8h;?%;e)r2KhW3(Y2Gw;K|BTZ*+d-OLMURD1# z&dtis&(ZV^9R0YczR`DYbYA_A&D(HM^c6O4NkX(^{Ft{sQh55ljc$_?6E!{6LjrIH zbXX5rk3lId=$gy`qzNwT?7#kZf?n4bf!>DEVhU=zs;Aj`T_3@ExIsZ-lmZ`=M$FwZ5hTgVfaGgyYa>x#*)waWoq7$3VyEO zVvABWkqS;w@D&ADUYx40w}fzE1CTQsA-O0{_!nDi8$ zYPfengUIuBs-~NQlNIbx@b+b?da|YaqvB&LWLbwW{CE%8Mu`aJSEk}H1utPtcRVua zHj}{XK2wU$tC*h4NK^XY@4vZ}OhSb7N?8?Fkq>fgHh{6TnqwXD%UR!yF+;JQ@fzOP ztME4&uV?-x<3o(cY)IY53yhC3|3cxLY$VMO%*QZhC>Aq5#T&a6J{Ml7>fhX`$XM$8 zGCs!}lNJ6Z%wa5f&+mwr-`ogbEWf!ijIo35tYa+o4#w$>v{mp3<&`0svHa%7 zMTP$egS=tKXhZ2a-k9Z2aN&5!cFTf=+{?HEZC|@y;3PkWYK^lq6D45cs z5Ff*41`R&}_Jf9a!cDNQgGiwbqKyE;7(^QZ1gd)*0R%LG6#U;f{{Lsk#NPH!Q@;oJ zU!TAF@4nAe?;+LxArx)cjI)8-FttlFVkX2+%vTn!UESOV1KWlCKF>rA)AQ_S8qNm1 z1lR(N9>`83#5LeCcS3~1&OX*#d2B)2vGRE>?O1ti;WXQ^>Sov+o{TSx;Tw#w1VD? z?F^ZGkb z;^|q8c>P&S*U<9|VS0X{XA_;*pG{ih@n;O$vke*wXBF&sGL;{$V4ojTdCHSW3j}%| zA^Y?^LeCU>SuM`Ud#5@$+0?!^2ESy4$IkD7~!P;1e{B%B$FThx&wae7<`C+kvU0Flm_jkZKyH{+WUm_jm=c zwt%;2^M8mpBjV9lGy+e3qkA_u_ja6D_Kn>&Og1T4MT{tc^+#-{3v;v}I|C4>vz@_W z1nlViYyt>Th^Cm-zKifm=ym>|zKg3VW&Zy^eV06E)A~0q>AX%x6~5`bCZ59E&Sg4h zNkiu>orAjmkH${_((g6U<`dW(=l)0a?WCsZ-4kOez&1@!tHd|pfA>A)!n<$wd9%jP zDVTcACHIblx4pqnqICb&zq3Pse@Cx#m2a)^YF|x%e@EBT-`~+O{rw#s)8E$7aR9pM z1kE4SPFsZ^px|i=R((zjUWUBI>6!XkdiR4Gb_M=f!|8#u{7QXhE$$CX0Na7N!$bjQ zL=10Um-`&l97qDGSX8kb@)Ai!AhO+@vu!=eSd@S*D zes}*XG#2FLXZiaQr-vY`hK(dfpmKBI2D%VlEUUAVpOv8>!umdjc<8ao$E7jW)0s~& z>;=CV*e(*-&PHGhFli~!{stoMW&I38uHN`Y7VBrQ{x=O%y`_Ihd1pA~Z2{f`yjgr{ zh(TUiKVK?7f9a$ThrR~uHyL(8FMZpj_=cASS|HyVP-Oi`!BXo>4LoUTOR!YP}}H(7{@jvjPbB3>m)+) zEh5Dx={*o9vc9cxa*7XaS&t;H=Nwpn&6=*p1t~VWDmJ_R&gO2`_b_fvvDxEyHm|ZK z-gqR%X1roE{&zNAej|T|8E>T69QHe##aJ`e_yQW;e+==9`pmB~Ztdsh-W(Wzn~d|y zIi;((EIFrimD4dQg}hOmcboAB^2+{v8|RgM_%-6g7p8T z@z}TB`@L-aqSO5&!Dn+02F$G#TybKk*%d$!NpHF^-xI_lL6? zR}r~@mufgK@K(lEMFHT0j4i?hd>_~>g800EyWF?*!`g@;i3F@Sp+i*fd*4)7lu!SA z3WO;n%9WscAUk@{`S)SprjhL!%eOvb6#hE}=Xyf=c->5jef^#O?&i*Z>TQ)WkZ;La zPSt-Ed$Rr7tO{f-Gx$DD^^+Lg|Bu0&MNbjaKebPzagy20+r${~n}O}{nmawDnGqKv z?q|(BQ87L>Z&UE+m|rVKfPcVw*K*!WcwK4{Yn|?;OG2L?ycxe{Tnc?9U^_6C)sXeu zo%BV)N3ed6I0C)=`^EBi<-IxYZoUT|#&{2pKg+*syjvKNcRY9-etS-HL1zJ5#2%;j zX!Kjrh2YJ?V7NNK&3z-=G4MUcZr1ZuJ6MwSP#){!tj}i1HPFrdC)Q_U{X^Dg(=VZ1 zZ{wghKBsqZUc!{govSno+!x5J_vdzC4`_%d{7-+5ia_|MKSw*kLzH^HzYVMX#(dY* ze&avcpR04}3!^<3$81px`sx~ttBZEPL5yn)JMaL;bwo1omyGL*i@?Vi*As3(rFVCE zL3X@^1-JrZi)aVjoN;|&2TlN{YXO}*p8(r|=|oEewg9Wo@(sbSVtqSt8~UBBZ^!ym z8m9ZMYZ|6!SPE8*6?ee;9(Z`bHeYI(p5-&XlssuEm=Wh8dVn_zo0vRE|F*pBSLL_s zZBD+?^G-?DefqM6K7ciY$hoQ*drW5u>gN zH$2cV`PL4V62>-%8{&rPHYXcuNI7gyH}pus6^$!X>>M`EcGGR%H(t^(*?bJ#gKcJY zi5aQyZ&nxDk+Ic$&Rg3hXjJOHCxc(he3VPJ(WyN3kvo|m z?9vXr{BHkXE=&9Sm@aw&WXw>McBI||PgHPSjB@C|%MN2Kf0sRwaeMAP=P{PQ%ihg6M(b5m@1@^1 z|NL#wr)oW?<#)mAvC!Yk(4MK!HL6Wrla_h!WM`3g>V3l7Y|@- z**AqYvF`+#Y*$CJT^-5xv5HrlXprr$il_Ok(~*3;;*%--or*7{@V6`ONa62P+zHt1 zpQ{x=%4EAbC)?8?^D$M_v4a)YUlwFL7`5BMNVbEKY*m%q&+^xiEU$cFT5faYk5ag` z@;_3zxiWa=I}o3|0_B=s9h5vK+d;`mp46p{pgCExbyX&B4YJv{Gpyb0+Zi?|*tavR zzM#j?_;+C@33Ec1eDzEt|C8|7CjQ$hSEl^8$p>rvw^ed{8UJnax8o7@-Bo!h0sK0W zy_Ik`>(`N7R{52*zJFQy7m|WBpQp+P7!+;i-VPp)Ny6Bm9_ssAhWXJPDd%BPQ116F%JYB-^1&A@0z$ z;1kuLp9cI2K%d4!bqC-Rld5FRWlOmvrGCX90lysgO{jRAxjH%PUDY*Lh|ksHV?3|c+G;$n*4lcN_*|`Z(D+}SvmZVL zo*xv?Taub9LmdGFZ#-|2Y{v5z@wYnOB0k3RmYfaqeAM?=@w_*wpA9_k70)kA=6l7{ z_}nW#-;kX5%Jx9fs_#Dh|6TDpm|UCkIT-Od7|C`plI>u`^I)zoJ_6Yu6wl)-hTaoo zJ5K9}$#$I95v%WUT1QOInLvTdICgWe?;(j^Mt5%4~T?*`184dHM2Z?g4w7vNWehIqn{t-oxg>|ES+H|F=M zkNIZ~eHQ&v=o0UzP?z2fcor}f?=KzZ`uI`6ZNOvrCO0|k=A_0o$0K#}75M+mc6^Hg zFz=*X3!b(Yvom!EfS(1PJS~={-ATbCu$y((?z`gOL6m+R*MEb*gW~y$Wb&r!n%}D- zAB&x0{4I8h@weD1#vid(j1BnzAH|X2V+T&x@tg^N9f=~z>*8%_<>uRvW7c@) z+we7#CbO%99$vo|YqrYjNUA=&cpI(<%`9q@y|=Qld?xU7+wh5ye@HyhCbu148}1eV zd>gj9%xuGKkNkn;X5g*de7pSx%Kc-Ndrxxn=N4}_E6dwW^5@&?t8?1wZQ|Knarxf{ zznOh^=2{3in>5P~w0(VZWCw1n7y=*jAy`b;>r_^=d=$1HZ?526#2FRMt5v%f|RQit__9^w3zvF8puho>Nf?*vdU8D)*dRxi^F6?^W(a z6;=N?wA)20*XF&8RId5iE>gKB&qYzWudG-JJ~kg-B;U(H)%POV;pUUM2t5?!xk$3{ znRS090sPozuYnBVUDd^amp@}#v=6hc) z8_aBs)v}kCgJu>qoMRgt&TN|(CZ}81V~n4bJdnaKOODW};@IDwtV!Wgaw=e(2Ucs( zz8*aHgFnwKy%=yCV3O}}m~#bx9FLPo;JD)q`>b|61Lpaz2XC*gxd`wqV9rZ#beMM0 zy8yQV&)@qUCV&3OvmbvS1%7#QNz(m!+;>pkOCmm(s2z-td4!G6C6Y7n*$Utb;&WAU zRm#V{KVtG+74f->*<7Bha(w;(_^*r4ElJfEs%yS4dCae3e9W(M5coDfF=z7JBA)z* z^?EGv&1QbKb&<`sE@zjn03VB`u&$yKu-Rto!c?s}?F!)U69025F8)g3 zZ?>rMH(S(fLbF9FUPm%mk?}YC)A*k=kN^GRzprBXR|Efjk^K82`S(TgUlj4*7s zSM)y>{j}(RntKOIU-yNgKc;fUKUUYgN%Y6a5Bzq~ACr5h*#-KmfM0=l!UrN><$1^( z?DJ{Bw}Xabi}3H7ef~An{S~PDIjauOC;4Nie;KNPMPfhh#fmvh5Rm zg5Wm^ezxHE3x1B^n*={s@ZSqQQSc81*9u;SBl7z_e$MfNdGZGL76sP}?i1V~_*}t_ zf?qATS@63A!!d&2^@7b4@ioDC;e+1;f?pu`_nyph?XAyq1h)y_D!5&6zu$Q}9OxZxH+i!5anNFZgu9mAJ^eUtjRWdM&s|_?HRh4GNr372GHIt%A1* z{*Yi=Fo-E8m{v%Vd`B=XKis7~n*2?Fo+0>b;Tr_gs>3@|!6m^Z!MgHz9q%_B6vpd4+ZZQ{6t)y*ss|QX9WeDh4CW6v`*kB5WHXTMS@=``0avUCHQ*5 z=J~oyu-OKSean@Z!Wax^-iTZ53|oA^{?Wd7AD@8_F&kfa$NZR$9CshNF)wp`-tPx$ z2OD2Yp2Bvv@%0SB%URuIwO|`-oq}zwoh|rzqA3gJN{@G(f-wQ&_in*9?mi~i#>*E3 zoBn@Wu<7&v6Wp!5Pkk!oF}+QE%-*kra$4_ z!rL+T#%;0~9M4x@5}&t-=XV6ZRq%fZzFhE8I8?P?Z!&NmNbpU%+rt7slj z%3lfonc&Y0{)Okr@_tu%L$^GgGT3~zRj`%t`~Qo0T2V<-6m0aL7JQu^z8v8X3jS;1 zACK>K?N2^0_|4BEY`^ad{*oRZcYKC_nc%Mozc<2vRPf&me`kb0;RNRWn((Iy7MQ$3 z@YnV5&Io@{@B!hUg2S8p1>qf>;BV>aJrVxPg1;^N4?Z=0fE?OR(jAP95=A z3g0I98o@`_XFP9cAbh*<{~*}%p4UYDPldl&u*D$#q~Ko(|A1hlKdqVcODp+wwqV0o ztR>!JkUmSW;Xft#S)xA>;a9hi-eQoxL$J|*Rj|b%{c(g}-b(uUF-T7p{&Z#jTfw%D zuZ9C}zao2Ly*rKPqjn|-a4+d~fS2RTh_tuwhlwx?xCXi31^j-%zlhF$a5TJ6^s~wG zuVv?3)&Xz#oBk@<72)3i{KrLqXYwHM#{W+7M-s}#J5v1JE}DCj(xT|959tomkk&0fH>$xY(f8=#I+CX^!SbSC2To>Jfu29aFVzognkZDvkyII+C8MOy;qwjL%1_Y_=fHXR98U%DJ&>nPpX*JP7>1iT_Wk zCjX_nX4wnb=06dC+vESFifw)j@NK|TH1l=*q-sgT=R<%`0L}8`=<4IYANU+CB{yHh z(beQ*Jddts-|>gDPt{4zU5TjPdU1petz;{ zTRj7HIa4y6TYc)kW@Gl5NShIUU-enQ{|VsPWSSOUgf8;ZOzsp4b#_Ag* zKHM#RQ20Nqeh~Ou#m5fXeFbn^@@LgcLBk*UybFK#i~et_FaKdCPYdwB5dMzpyMaHl zjq>Anzul>t3>nQ z(&Qk%X(FBvis#+p`QXx6{tqC}H$=aB*|nfQDEigQSog=bv%af&g+f2_e-r+m3jFe< zcUi~JvNojUyGr=dvg?7jIlLr3%-oT@YT4frz>j<`h0L9zzk1o}KM(X*r}U)R1e%wL z=D@Pc|2@zg5KS5Qw&XwaijYq^)!1&q$cowIGIlyhNaf;>>^6kL8gBAFH95iiylGyeyr{wOZ z(DSrUJiC(1!E^Qk?!mjn)6T_piKp@Jiq1@SCo7TnPsP70fjQ%6^SZ>}%IX5vew>$H zioaQvwH+RgApiDA{_T$LE3opEm9J^KSH%f6fWKvdQPQCUkWD5sTWJ~#WG<^xe#59G=!gZ?y? zbwovd)zX@CRIei{sH;}i5qhUQ27DV%eNlgm=Mfc^fcc}$C*bb_@j0R5EbuXzPY@q# zpA*E#+W&;;-S?^ru0Q;BB)t_68VLB}iW^xNergjhY>0?u*;+>UQj{C;ziVsRV)OPx zt!0mgk?~O94g7W1sYh!5kLTg|JMzEH7*L0^E<74>%NMgx;`Qh^v5kM5?+_m*SNM=*|yeP1N>}aYmND-wrj4lxYpZs|K$eIw1I~9u=&9(o)!6W-sr^N---Y3 z}sZ((9EM-wS?R$ZOvb{sWb3-w{T3)scR=my7B8w~FVrqQ5mK!y7?=gXj-bTm$;A zivED;?{}Co{LEp>P<1+GI3Pa9I2_Bc6Er6PzdZSQ#W6>Q_WZecS{wcxJ!(Jd1NXBn zqOYu6k8mE;or4&`Jv{$xqGO^*6XmhT5K)m zo^-LZCI6Gw;zxT;jO~qhoh?F#kN0ox{ITFur12ln7&%S4{W-w1$!VI~|G{C7Q@cBV zn$|2k+kcwI*Y`lv273C4e(EsCY;~96S%97SKP|Th*$DiTK|{aLevGM;0f+dIR&KY} z6f3toDz`f-w_AHaE4N$xtz3&OY31hqOWY6EtK6~Vp0wPtsJ{4iBxtPMv8dd!sNAur zzGGUitz5pH4fP$%)t7TdugbkJS^4Bp-wUI1FO15)Fe>-LsN4&q`d%2-_d>~I^}SH? zP!7(4=i+ad%DpnVJT3RisN5@~a<7cay)r8I%Bb8cRhHHFN|j~hUYWBQx>4?{RPHs& zeQCMZMCD!+m3vK8?ln=l*F@!B6V>;csJ_?a>N}2d-=%WzO8Soq?R-~M?p;y2cSYsi z6_tBe)W3H{{d*U-cfPn(M$ck_8nRi{{?vL>t$ouds5JV-h97zM0XGGuBZe47of*GL9L;7 zzWomEkZBd_EG%^AX8oGJGT_!v^F%<_z}5ZIz>G-rJ(Q zw?%nx%jMmKyeBE|KUUtD=KaT+=^mw^u+Ro@2u|1{xu zExA3y^F99ah2OiR<{3+CY%Bl<-p0b-=xoLXOI8AJV{NZwu(7r`7u$9SG;QMf`X!?& z&(}vhUoW2LfMzy%y<);33;a%RTEf$X#{c!=Y5ZTWvd#s48|d`_I@b3BRDO@j`udXZ zJacKy>%{ZxDhtV?IRXE_MKs@Da>Q{4QPzd_fwjV4L%}Vz~j4wI%i^K zt*T=G{+r5ORRvH#@;M2AzY?G3s&}M(n#Jc>yuhDLnj=2V;`40a+kiJNCJ*=5D}i60 zv{&5@J{D7}J(7Q873*$uOM6wk$GHXgR^{DZb?NViyxXI^!&T&OdAH~C-Ut0lkXeRb3hubwCWp!i%`by>>i(x@FSjrd#|wZo$n z5WS84Pw1SI*|(q2IVH0*KT*xS>f?II{|22GdYZ$>0smZwj|be~FzeIq@Cv~EbtE@c z)2_Dh{t3xuIdri*? z|E}rzV((TS)8|9$^G!ck_+5PPgF*F@uR0CCulk?m7veWnZ=o>w#l9ncQ7`1Nu`N8$Hk}-aGi-MOUY_hrIN#d) zj(zf_*je{|@}*q7pXWyQ$(O?XTo-tA_Z!N4Npeq`*J2%5UW<`pc`uol_Xo;*MN;#; zr8WN!cs2nHp3C|T=6b;&%c32A4DieGje};;o1A|k`atts0M8c9$M7wZK=U!ttP#(T zsV*;YnEo05LS4F*_qOD9$a|J(Zkxw{NHkwgJ_4HaM02-j?0mxA;(w9j$=~X7xBN~f z^W6!3GA7TL6WW~og*yI;_}`!02mbF6pZmq%-pAb^@xOmwdtR-)KTD2Wv9#t>%KNi< z^8a7aR8=&mG*vlY5ZmxuqB*)^J7^Ay&(We;vX%XEw0uoZ0^9~T-cS80@*W2~;x|_O z6nSe!zar(2@6lKM0ccKD-W9obSh&iYY*gOO6*VVkHUneGZx#OTij}KEpWZE=rek+Y z9@DYA<@*{G|GOpI8~0;BpWLl?Z75ppOdpQjC;DE+bjtI4shsQ!+WAu|_h7|4QW}d7 z|4QIz5jURtY3~FrmiwDj?m?RW`jHRo`)=`hO64z8K2MQ9=dZ=*De@N?pQq?<&KJe! zDe{An5&2-NlYCQrwpVtq&f2FQX}=JDs&YT@rejm$Z*4Lq{?-mtmE^}Cd7h5Hr*30^ z{c+{zoF~5BAbQg9UeEIg;72^iAb-TuF5|Bwxu^0u&XqhrSPg%pc%HgsPs7rh?O1aW zD>(8+bS!BGT^nfHfcNc=36sX9HJdge9-X-AW{Ejxp%ew*3;#+21Td#lvk1*%14+?Mb zWIpLIeIxvFEMJB>=MM4t*NV%UmezbzG(QlZe{-08@QHEo{8!DrM*?n3exUjGnGVNm z#2Fwz5%}fFzgHXp&$Y^H=L(GH&n27j{CDv*K0nXR;j189hxi;_dF0x_=P1p4#^)%T z$HX5rDA)KLrEg47Y}S!)D$W$2hRV&YflqzJr#|A-5b>$c@%bxEWG@$=p~|Wk;{Axq z9TXp{b@?Ow zeE|67NxAZ3$Z#{@S-|Xflcy{hKJR$8$vxsz*1GduhvPZ}uy%;{RnYA)jk2F9)Av0nY-?WV=>;mODPS&9HKU+ z4Xy{8Jb-~WdHyL!|4HC)6n$0I=Rj|M)GGOSKM(wDQYBwB$k67?s#f5C^LbXu_xm-_ zw1I}{{85J2;qSZRS*+^c5c;ktp2oi@p1&0TVio)S_g>1fid9+r52f!QI+E8`-2)mc zx0t)T$~ocb$h$nbqUu!}m)5KnAM=5~&|%G2$WPgRiN6<%{?4lXr!TF!ct3UHPRUjj z{hgA{Y^OVO{%yWI9#P(3RPFD=d%D*%?=O^huk!vvd0**ptk2l0C9hZB=U0F6MIrC= z<-4}L&zJA|a?s#Tko?K-aX2U(ZrD-mbjsa`#X1 z`ZM{8^6snN)xEUlpG9wXX>H!vCmDX?c*<{WvQPf=HLu=?Y>jQ^V;e?DbH&op4Ub^ zKU&Qlu<6OQ;$u9o6@Mg&=eO|x3&r#P>X-EdIq#2n-XHP&el_3m8PEG8p7-Z?ehdw< zSv=d99{#N>m#R`>R$K@U5Uj-^@M+m}{?#^h`d%ckUf2k=AUIkog!@HE|?5>FdP zQ{rj-r%dn%9`7B)Har>%be{O!yYw?#f^7FjvfV2_uL8|%a&N@vn@iUtzt#QT zrDSPx-n*3VGA;#u8|W!Ne=KVU9^Rp{&Rn))TX;uvrtaaI{AVs>JDB`uF3V&-Z`pOg z|Fw9Yse8m$?wQM27Juab0SNI~(D0sY2mHx*I($0dZ#di?`I*0bCaO6yK2+Ls%3!j3 z*Th(9^}zVh-qkzTHk`6!W@L0|_2|g>%pN|kT60Rn8a(b8M%sWqA?x(i$ar~Vu)I2O z**Q2^C=O1HO^%F~hE5?x%k+vhD{D_WZA$;Ot}4{lH`O=SHP$z`reITRGPrACN~8rN zEu7T4rnR&1To;!h~Yeunj+3k^W>_H`J`}bQrfV@dn(wsZ7rD=8o+XRbYj32$JGI8^+-*ICT4bwmQ1Hy7m(DE_BcE9(laBVz+Q{kg6{M3ylU3*9S)M%SwFz&kD<9VHrc z5}G;^V4kGt4pE{j3aVzY$niHlGG5$0P#hg8dt;yrPKKxjw6Oh`tez=PVek!(&J2}S zmpL4Fp0X>C9WD(_&rFrdbMfW9<<)~jrQvxAJI80hYGy~8fMLHH1A7(!AE|3@Ts2i1 z+BGnZXU-0VQ`R;{A`F2giYkxnD-|hr0|!5(tv@L*){c?s@*)yPNrkymm&S)i2FB-N zmE#ae(|ae?0L9`=(Uq^Z)&;ArJt-kxY7c>t0HuS(YYlHx53tZTs|TssheixF1G>S8 z&zl(-Qnf)3^+G}u6Jj(}2k1tk!MZt6LtB8xfT1vP0+fRZk`nmZ#*hQrfQ06dAxq#0 zM2h4`j=Dm~0Vd)VvP3CXWpt9HYOGJQSgj>4#fnm_;#R+bp`ocX3oFj%MNLm8pv*(1 z-6;XVB(*~<$Re`Ug6gx*UJZl>8BjXc+kH!J;l6q`n$P^BU0_zzvj6+S&O|!6` zA!TBCIK^8vRq|+zXC*)R|7JEz0u}O|O-) zeEyEnwD0Oot(7o1Ix(0fm|ABESzFbcUQ2#Tmnvz!b+{7FE$t1G)kpOmnH(%eU0!cp zu2BW4;!dx(PL}{k8XTWa`9-Z@DOtbQd%sJ!hRbs@dhe@^LSmM;!F517Gh7}X8I1~U zaP{}RmKf#rF<|;OJ`ts`QJ^+T!6=AQd>j5Bxjw~DjZ939Oz(}Ce~bXt7(}z>NsX#9{@KwGA=?J zNx^JL84Z=ngEVfzMNMDNr35o$J!Y=c_LTE^tugBOokF*$Qg3y z%)rzT2SAIKcg*ymB_PzfnkLGnY3EeCR%Vo%&JvZd_N0}Cf|rkK3~E3*ze0mbZ%uM7 zKx+bRMs>n}(5H~fxy2Nx9?Pv#p+4o>La{iAg&IA`3}KEV^8A4j7+0|KfG?cn?T{5m zhH7*#QezPuFzBc~Lo;Jzp>b95EN42EfZApy445G2*vxckPY|@$RiPHTP%eP$SP@2A zX=-}0FdGgt77ENPIG}xs!>TkxD+`(fq|a`crc(P2SfAO@PpOp#EN3+E#oRoTS#Q8g z`!qwQOER$1IurowEwvti_6eSoW-wcT^_jf^as;CYSQ%}s2@I-W`w;DOc`eqR)Wjh^ z)DSh#EF30yEeou>FN8#UHDO~V!M-8d>)Ajxji|kvFmsX!>(wkkmdxlOmrzkOS7tsi z!Rrb$BFW4LBm~o~4h4iULv&cVK%dhS*NxP`z|7&Kurm@_13^xoWYMu`fo#p^Tw{HT zr9YW*`<-R7C1t?Rge?HEB$f?LtJm}g{Yad8(+zi0vI)&{2c=u##M@9ndjsv3HqkZ^ z&}~5b0!y?lc+xi{*tURpwxF5+(&UW4%s`WnDxQ@-Ii0c;H(*;yQzo){Y$)YMmJJx8093$*A$0_8(G zgu&z;EL$MZ?x|r5leJDZYXjHc+BMiP%Ljqtj14)9jdy=}vNVXbv(6U(=IPxM!;a*xFqZ|&-Dsat7YsDaVq&`5a_%>>qJRhE!U zOiqtXjQi$et<3^!sZ-_J`erOZ@UqN|kAwwQiyN>LGq7YcwDlhFrKzbHZzhx#f$}Fu z%{YXyVXN=JC=3u7X&9m-)5YP@)VbuwR6ZSAHIrIfW>g`2%F<1#a;Y>_oTB+cT@Pl| z7`!p%;=a<2sQ$Nd7)XR+`tZa1yjqys$QbGJUua0ggG9P8Z;!z zA<1;Q5jx#03vR452L0SQRvM=oN~ro;nQ%-Q8`x7+HA7Op%2v`I8rcEgECGmzBMbk) z%*Tv88qAr7T1lbwiAh-XX+piEz-WW<%novf4NZ~(WuwP-%nT2g;JEU%#x)WG&Z>c# z(P@}ogTV{fSa0pH7ZW6GFWQgT*up*yIh!QL@Z?N!3Wix=*tAAM5IqTQBW38E=V-z- zff8|M~6msJFjL_L?%q^E=|EDd45PSRb&dJ z$|spFGHGPIv}XX@3+tt|X3_5+DV<*|?HMfDNC}CifTcZ?cq;&&lkhH1577PUna!}r z*2bPW7qgz{&5UHm{~A+5%=5cuCZRVRn3%Oq{eT6_6kA)cmLJ&(77^OC4`Y0~Xamhg zxTc!5obt-e;{#(53+59h8QYe{Ln%zXKI>rCE3NA<_H6C$#(V>)tEaznV`m@c8a#CO zZtPm$-i?_C59?2F?`vP*kF+{I_H`nmUJ1RMHg|WP)zZL+j?TWWZJix0jhKjb$lzUT zw%=MVwq7b0^3s;A>(_T~*@A*Lw0CuH#q?G{mg%XzRwJ_k*V1!`U0?~DR!wDQ17a@2 zoK|iw)He?Y1yXxW?%IoYFqnK`*J;~@xfXUE7aZ96ruTExpb$tK8kw5jJ2#1&Ii!tF z>|BT`_iRzBZ34YOPAW)C<;f-1p%;+|-5c2*G{`53Y@(^RsR2G-24Z_~oO5$w|e zcFW_OV4b?b<^rpAsu4aDU`4}RkfxzUvBJjdWpizlYzyuQF+nso)HOB25(ujm){IiS zda$^q^Tk^`d-}Ve4{KIBuA{53bA3NLH_-G$UpAqO{dsH8md%~(yEb$|Rk&txc_|JI z4wlMg?`T(P80%@7P;Zpk-__eg?dwo!dOEYOtDnnblxQfHCyGVN<7(*T$)HCw!0Zfl zgdJL1*WKQ8Mmj$9@Y2q{UXBkv#EhxHs>qJffpOX`T-Igw<9}EP&X)#%siU*IYg4hO zx2F@;u!r`|y<7VGdN-fWsu=3UTYFKlfqyJsApvkTh`tX=R2n89RR(VVt%ytA+c366EeuE4Ody+5-0Jb6@9~ zT|FJBO^RvXytxyYLWYUUOe-}xQHEC{^o_O^EH~2y?kGxI`rG@rZh_Qi^z@$DgMuB= z+s!ilp{Mgq6z30H*7vpduRk3s=ZL<}&E4(mJ28$Nd+?ZB2NFymgP)ZVeJy=Q%=GYn5+8Xgv8JTSC-04@k) zuFVgcjazZNw=ND$O%3eD>Ix6s$Rw;9r*i9%`<^mh&4!sXUO=X(&bG4I`hkrQEgbAw z==hSAV@vLifwCcB<=aX-GCm9|jAB4l;t8g)Rai6L$6$FlBTeL^J0g3+%AAQ&R$438 z0ZdIz+@cJ_u~{-xn$|To1j9vIdGnV;Ec>>i(k~C+BSfS9W~K~YF^=b}6j-andx`jmxTi-rfC^KeZ1Y)1ZEf>bR|`Lu>9== z!XPre_SQ)E3>23;4Kv%U`&kF{KKc_|*k-)%mkI5rfL2c!5wPxQTTe{EVhKsGpV0^b z>qE|MWW&Zo3wB}}oVLq1q}dZEZsj1wK6;2YbK9a95S zdy7+Wk*M#&SRI|1oZM@#=`F#v)!y$ranR5`JRCtXj$u>J5^=E~oEi!h!ix-?3kt-v zM^j{u+V-@ZLQ`TlRE3La-CiA;;9?m#yTNM6nA$DYY(k*WZm=3MM{T=TPTUw3fw}Kn z9UIe!eQQ{qz#EGM>&P(^Q~FjFTt~4V44ktONNkQi9fE<@haNb@bUygR7w!|ya(oxb zGb@-qnoVPTT-jFbkR#A7kg%;=YkFhYc)Z#^G+la(bJ&dp@Hrv2EP?{RY)|QhI^vP?`XquEu&E*bOnCF%eXzGZS*{mPBA)3tn!NPUODlMSN zRjqX13@pBpaKHi!cx{tuTRBaN3&!T0or&!$eCCyw$9WLxOgTi)R`8- z69>l`)?>VEvwp{Nhj%-siPJFg%Ww)BMKHN|m|++*7B-aFe3^P`Ei4bvaY1G!aUyI? zunMZFc;cdj0}F%P;rOE25EK=sDuyOTaa<#$G@6!dCTaYI+%mj0Gibt~<$6DHTHLU@2R zwyM@2WVabnFRd;IH_HRCzPD#XcNaWA1!#+K3> zskC7e9M|SRBN*I3@MYnNdx6dly0ftzAVOZdI)U^?0bg$qa9H4Av>E5fOUYeE^rzg(E%QHYfGqnY*xI7q&F~PEG3*kkP=1SYz1aA!ZL`vNX zIo39|+HrE@fLXNMY|Dj{iVNT9n6jFj%!$1{4YQrTt~POh*_t9Hg)yHIOr*|v_pxhfxJ7x7tOnav$F~6AW3*S2j~27 z!VDWcI4GrvO;nD;0x!^b+A61nkuSg|znq7~6fkm{`u@MXYk+*v64(lclY*&#vN#8RqTnxRFi1G*)c>ro||(Q7zFm)lyXdmg$Hnv%^w$L+XPV+iI=aN#zG zEdyi-ez$ZyHV3;B5`@aN&XLe6;OYRnV23noKHpsI>)qM|=XodQO{{O|^MKllDKUHM zpt~Pk9a4R6Z%y=WJscag!hFtYM$hA#Pp+R#Yv-LPjQncWxeK;Ss;JG-ni6KcuJ#^i zUO(P`LU4ax*F|5GKXiBX_rrZk@09s(!m`}#h8Z}823bqPO#Uoi;RH+B!B7tz3}Pm0 z(pUJkK4y_WDbne$+h~QB4Vu*WDwStFCw;0)$}>Bn2PJBkG3n$pJ93X1f$r$w)vOcv zV^(5aC~*glv$6>3d?-II-cIRbJc<%eMmaLEI_ybsBTx3PzpUI6a)*62UWB)7fxvwI z1?MDZZ=8%;g}0aFWlf4y=&s&`=_OeHrDgOgEKY#Ng_mZj9k(*3b>j|eVoHYvnlC!* zb99d6`y{%2iafoDsS!e9%w7U-(gbS_+ z5%N`}d~TqF=R3S`j(MckB+kvGK875}$l_dxM!R(tZH1%-s}+~>q;WY9NkeH5Ne~VTnWJ@KVS-VYr;(XuT8B#VJ-yEscv70F*SrRBZfWE5(h1Me zfR#2RIEOwxkm>>~0{D-IeQwee7?0=-5f7z!b`4b;#$-3j*D0aTQl@HoxW&jTl`2NU z35S>Lfl)}Y`C&n9K11rQn^!VNNGvyfbMD$pi<5b$W`-56#mSpFtea7$e7O?TcTVPp z-xy|dtHU5piw^E;*~rF)-5I|rEv#K@?@E&(5SpjVQxC9b%;eEJX?r!AGY}^%rLJ%? za$v{Cd~u2*S{iujQgv>PLJeRC!%cNM&`w1?$mBY>`f8=qHATMO(NY@={Xq8T^iaCkRR z0bw}peQl?OYw^5pY-g{5;>!i$1}GS|^b}Y7hK}u?(`i05}zx-O2mZDv&}$n2$eri)uCx23LYDnL&3F!OATf`%oQgyqi%16 z4M?7!)vOFfk6&hT%10x5wQ&%XnaXLcg~#D@oN0G%BBxpH-9@w7!8ybk7iKLE;-YBD zHj9|k@`KeGU~1Gtgt<|?%$6HSrE%*`mBqvjCs}5_`g-eTU8oXIEx>rnnOh;vxR1`~ zZiPeH2WLj9s@&v*3MFETpNyAw4)E}B&KQrx%~Zw;(ALL?KMg50pqK4NAXBLdSq3xs z=HT7X3s^VYVVRhzVY##05rIy!Mdx4m8dtPw%`IoJWkSB-dP!{=*wV$B$w_#r0*PgW zr#QtB_By5xGEuEbNz9O@Pe4X}GftLD#5{c}99}K&TCFP%3=b3s8ez(UGu5t{oh82f zSTK>fEI3GxnWi|Vq2EV2yL;2y^BIB3bGJGZV7xd^q?x)YHX zgcNKgEZKNTQ>*ndb=v|{2pC_frb^SOeu~5!ocYUFT4CH8$16_MI1Wpq8)ej0j+Qtq z39JG6O*k(BkJ*HE!_5+5*_TmRl17RTF4$!eo!)E(J@#}+z`cYxED5dy2#qN_4olJq zI$aFpbQy;wY1I9OASGl8(MKA!1TPSl1ofg1R~HslLX${VKmsd{`g>Rs));jPH*lH2x~hRxSHDsYJWL#GXyC)uT++*f z$qoQM-0uY*6N>01b$Vx)39KjnSBC7;E>l>~kOFtDIZ1)HYAQo|v6%F%B>qv!INb+h+h5T|Yi->ET-hoDf?xXU5)G`Z8f@jo? z#ycR?CIG)lSQ2ouPF6j$d&Mk5oebqim!y}4iMRTzA$cn^i$;Pp({bg=U(RGkwu1Ht zxU8B*BS8Y&!4slrBp7(6<|-<_m<(n-R2+ICyP3=c({t4)T!$vwx?kvAG!i6P3urRH z^~|`hJy3}Rh;D9@U(^bgl8q=HQ%zMWcde5dT^H0wAu-D9Iw4ibUHe4dhIlxH#4N7` zE8(orBibiv911gmAyXQ90Hi*OQHyMXW@L-d5%I+BfiEBoZ`OwK z=m9UFj+mjd8KT~cIX7XlA7J7gQVV*+k zMpFc$19)xY&;y_klQW|Oq%#MPtb5Oae>|Fz;?00T9fui!NoYBE1U!TpAb%U;s8t$f zfLIdSCH_=bG`Z))43N?k7kxz!Nmy=yH?@UJ6zH&W0&OY_*?XxUi2t7JcL260Ct|z(p z`tUB^b68@ou@k(QeleG03N-Azi}#MUgS&Gs-WSY3!OoVmbGBPH2YGz*G0dz!<6u&I zw6EP4%d{9L}|S%+HHnyZ1Es!u1y*G8!Jqjc#W<#2J=i;iq9hE?_(Ub+Wg8NB!(_KJ@< zn!1m|rF+Z{J~Ze%4P{}JJVKZ5!QU+fo)HTCsR!AW`bXo^J<4@m;KnkPOI=9s$^Z5) z-9s2x6mD&TFjSOZ4$Qu>W%d*3J>!dvqEg?nG;7rJmC zlIC2vr;28meR)99%n5qnSN>;Tw@1A(QseQv_;q{GVg#~T=xYgjL^Ctoq5pNS+k+!# zS{*rli0k$srHRSQR1baK9=01Wn z!YsPrb$br_!@F!x%EP^CPuj!1Xm7OHg=ZbI*V_>6w4(c?SbRi!_?PTO{xGiC8~tHk zuov-RU9T7A;a#pb(!;)5FY?2^STEv-cdg#Cm`wn`Kz8Lm?xRMt57P8-sUAv))z>T> zx)|nPsu%l(uGCvXxThS>!N-Npy-=?l59d0)GCb_d^p@*kT%~7*!@Ni@(uZ-4-slhi z620gT>k7Rn59CsHt`Ges^Ndv>+@!*FMNGo1`2kFx$E;XMPM`X#YUm^5x72&hV|VBdOa9ejodcc zE$zpy&;QT3J`We6@8Hq7x$E;t@m>1@*XK2mZRZ|cpXZpf-FvvC6o!%bsin+yF2t=c6A;~hpkzBbzX$-Kw9+bysZ&t;-pvS zsVcT;@Zvo9V9m)c&f}RS{RS83!2$EA0l$HuO{Sg+IH zc;o4}JNTkU{sduose`A!bZT5VnnMm8hOzq~bJLrRW0o%6faVAzj^LeftS@?wOoos? zL>W_d$}(6Qft|avSX-Pj(F1KrD1-!_;^DiAkWe2ILVZF)b4b9r&*eZFCfWjJSi%Bj zcxC3WLK&72%0Sc(#50;#3q#MVgQ4fuz|iyLPkHC1PkHBMPkHAhPkHC%W{=DlTiAJ0 z3p-C}Vdu#l_~u0peDe|qzIlNI-@Lp7bF|#_PDsy=&gCT{D7v7$f`TyC_%wHOP+BOp zkoc%brm6mItJU(Dgu4_E=Stc15KLv=6Tr7w2cvJo;${p7vgY9=`&2B@T6>vl@|4CV z5$WGtHXB#S+vX{{zdled&%pnRZ=f<*%LdjS8v(=yog^)fi!z>P`k*U&x@>|Y6HJ*3 zWU9Pa@=e>w2bqUbRUO;v ztHZ)vg(SN*PS)UJ7i9fG63%6rzw(;n>vw$c89aO`0pEnt*LnP+jd&p%-DE15S4Jzk z6Xo7vI!@_SEl8J3cbpjGkRk(Tr@XCG%7~X6H(}H*UNzo`ga^cO+jMD@vkS-TdJZbb zju}+IrAWycHa(-;4Q2=@WceVoDN@?&o@~#d+hVqenK2ev6ZB>v7}wYueqv%rZK^VM zp2+DvK)OFk_%w@!d!gET%=DNlG^I=^-BiZ-;7cZ)*0p=9O@5^~jMdWk?vbg9@!Vx$ zKMkxy|K)+<(yBq4dwyf7zK%l??LN4xID(IP@>Mo2DcK`F&N(&8n@aXLgyUD!2$$lI z_=XFvb~T4byko@V0Vj?pPvQd?(~L&u&*jMh1pb0G>CbjEjFzJ#_85QK>5ds0LevO` zANJ?n_)3!e_WnFhg#4F|7#N-0HGm*)DTjekL?~{lMP$yDB@qpom^-HiCU+s4TUyBA zW+cDW7kmg=9Cd$*9Z9ZeHndVz z0er)LVnp8|z#|Wm;6GTE=^430){0@o&mG4%9qpnf_8zf%hHLb?jmOw1x)l$D5=5Lt zJoJysO|s7qi3&#JLR7q4iCe`cb6E^|AY>s@i_YUT=%|HgLT?uB3qdT|FaG4^!@(Nq zH$IvQEw+iCgEkHFk;XCr$D;4lhr>`Z6nQS(lT0)4 ztM=#5OIDs86Nr{DFrHqM6y;o`t!cRZA2^E&-=azpqTrqS97T*UihNuYv6&Mq#pZFw zi}cVzcr&^|{p`)89jV>P#cXRW<~W~D#n$yP$YXb4c|1mq$D0VQa_L1=2H!x(pJ19l)MIVa*6wV)SGaiSOq&=cd2!?KYYJ!}byz*jN~l!5^!MEb23#8ioTKvAS+rpTm)vBpa%p^L|`i9rwZztFGp zq`NSHrM2{j!%#zfT9-=+Xi6od%t~VuQ+vSdA-#? zMxqpV_UG%fqDhx^%;g1Tioa4~D|FT%YQuC@4xcYb7iFxBL9{q}940zr>L|}ks#ql;w&O`WK-Y%`2 z5Jo~ONJWTP<90_fjkp^KpTrMA2IB0Kh$KetfkCWI2+65(u&%Qlx{m9c&D2J(VHajK z8QKdo33imVo4FZ>XGXK{7pjLCvMH*e)hM^uu>9eOA3hm~crNH&GXl_mGK@Xcjw~b? zKsc|bj?=t~hJo&+V*&$=0m@5ORg9S|Y8k^;phmd0#HbYpiI1_!Z@)~Frb-AIh?Wmi z$@l~xSzcHgM8|l4fsA`XPRiM~*Y;*=dGaBF+9V#Sq8UbUX;BtPfrnbzh0J8p#(+uk zK~$_J7Lbj#<4)Lcb0Vl1(miA#w2&#xVlh()?MO3w7!=k^l|`ZjPBAtXH^tz5bd($} z1V=HX#YV~CASinhA2?u4t2yoKkCQf*lO21fVXyflV-MbpY`kJRNGUNIiXD@~v5M+4 z3*W==9*Fn=%bh*LDU#JCdp0xAk6KymGCWvxe=nVsfiRsfWB_VVcov)Ya{1$a&%`i` zEQk^Iic%D>jLEG}i49L7YE!nk*0{8yLqp{&Y2!CAcMpi=3Vw92mHR{TX)bZr1lGDL zV+doMv4PN(`BF^JXn*510bSeH@DY6|I>^NqWl?N<@kW7&rH5$=t|5!UVx6Q}O1%_} zaI8#LI+ks_S?u$ZS4%m>n;u{J6}SlL4zg3`y5*2X25$*;Ln{m~?9l%U7Z1K<5VTW8 zvNk9&I5rlfj~bIzm2ja+yopPbnCETs4k?@;tn{>@Ljz~jnF}LhL?=?J?&xl+xK~47 z9fL(LS+FK3Fp)LAp)}L`s-dYXTXWFQVOfvd6LVs>@Po$_@LA}qX45Nh$ONkmj%4#I z6~(Szd=dfSdU4@3O-DZ~Js$!F?n|-Bg>orwqz`X+gucow#u{S2vkY_x0`0&;vrDNV z@)}mt91rC~{v1*vQ$k9yIJSf10YUgI0t&gq4}mH$?nE5;8)X&{V$7WgJQsr(yog)| zR(Rn{5o}2nW(QCRb)fw%dP2)zoyD&+s#Z4~um)}{4)c>E50;4X2+9u^cmPPG4S z_ehy@xKu1|#0M(2*{8?CLr*VpbWnL}Pj3gp=tqzI21H%@+_`CU|4R^seDhX*LLg+? zfG_A4d$;xz+mK?ry1P3!ws$)Z7J&e5LuP%1LBs;f<_~J3)`nS41XG8=h#JV{HHB3 z{)f#t>{EhM%Fap2^^TC=^yR#&PyEgy$1W{nuD5ltMPN{goc9SyukC>I*QO-PVxbj~ zN0Tdx;O)0LWmpz^uo;XvmCdfPAqRxC;vnXNS#i!1pIyr`(%fWGkXIQY-@+O5jX{?k z^V#Nr0EAw!z+9^+x&f(Wpc8<=3pY!MjR+dlrCeBpSRe45mnFMI&c^TjRuKWN#F&8` zvIbcsIYyRQ{)hv_IE?K3^o4e@=vR19JetUw#$ysAo7KE!vzCmBx)bTru;Fm%hi zFh3S|A#NhSmW>oz)#5;_5)-XwMXY{&!?HNBLos6p82hEy~_AV@XJujSC(P4x&Lc&9}smj{FF zr~Tx+Ub!IclV<+WShTWzA;xQEUrFbEH7E?COhw(3oB!E2S{0=F5)OJA+CHnbj3KF~ z?yF&i9H+)&i4t>PA{|9l4bvO6IjyP<52l*aIjoN!a2`#`7FZLFiZH|aEXeC>HUMai zZY+*yBKGwYb>;eriD0H4tMi~YwW58fiikY91HKdD>p13j!HnW@QpN_R&V|b8e2$wF*+oLNAWb!&D9Wa_IQGjFCHQ0~3nbD@ zY6D$cgS#1^SP^(t1R5R-Xh^|l#qfG3eZ*@-efo|oY9KK$8100B8J}QJTJXJKKK7eI z$sivJ))+oJYq|z11zc9BS(~d|?2w|tW+^^DhZOt1T5f_v()s*Goqv1H(!!8R6QjcX zI2Aj>GDgLP2@h##+#Jg==Xp|;DNJ`r;komCE}!d|3qGTn$y{of>_X0nsehl;H3BV2 z2O$Qeo%m)5dw#kTNGxJL)7ht=!$j)eCM|k&FrO*w?b?eX^M<2nW~%zvNsI8aCxHAAs>b~T*X@&zJ zL<&e*H}Nt7KINsj1~7yNhAi?Tgz-I&=0=v0Xb(b4l0bDkqJ}TVSUsIGGjI)M>FZrew@@uWeSy&VF-&% zmQh4jE|tzj&|(^)V1nVR|1la<`w6@(`fEysRuvW6&8gBYh-Lszjo4x3wgcKXX~(xv z_~0xRI|hHPYp?Hu?-_6UFrMrUc|(K6b~eiC343cDy-c4&iM9!(_J-O?vpwqc#ANoS zVq&t07s@ziIhgK{-4THle?hi^9R^Pk=N@dG{e26cbZ5vN4oZcKLGN2dtJK)ZP)5-h z7<@+`cn(cK&!8)L_oAT!jRX=(%Q!!AwLsDwVbd+SJQbnBI!`i((met$IG^Hb*})G_ z#6z5>oN1NQoL*(-OcO)SxH&wqbKK1I!PRDMTt;;2>_ZIYLX?8=(pidknS3&^4PpPK zEks)|4!VyI^O6fQzZ@t=}n9mG%t|{q;hI9JhEr5*uE&I zI_=MMq+qOSdqEf^!BZTFnvDmSmp+adUY?~qMa%l9M>O$C4{T9*?knd-^IBSTfYdpO zFynF&hWbYuTr@^$Evay6ySt{wEjI)IjZ_3jeX>mSI6@=T!dwU)wDyD>kKZfNr(4Vy z>{4pWlh%<>u|6s_ZN)S-R{n9kItksODJt`#*#yOl<&6pi_y`3g1~V=U;+YFc42``wAwp*-Chs_iINZhAlKS;z4Gc*xWQ+(XF|q!(OgqVE|AZn4Z8JCz-5G780?Z zHf=tKEhlgm&oGQVb~7V8Z3k?hT0lnD8vmh=C-Z;zZD`n{5N-y5T<~w>34fb~E+(j1yjm!N_+jNQS5(Wf-FRFe8LTw5ySwq?R~XvndYQ z5bt{_JhPu*WR^!1q&(PM&X+HX#{1}q2100ZM+dix)dMKR;M68B3v!4g?xz%c zR=K&CLJ&vl0jz8s;n@&%&sR(e5;XZ zgS+@CNART&rLg8<@P$(pCr0CjW!+f;)}CQBZ0}7OVyy2GCBgaokV zIP*{zC>sv>7u&bIq-T9kcgw0qd<>5td+q9NS=B&TDSWEu)27ZX8(++?8Uya{+SI9! z8Uudu)=qo?7}3-LZ`}g)8bW8lx!TFkxAIV4C=tq7f*-etzuwL3;U`WX_zgmTXz%F5 zzRw@}`!>Tf%!kc=+nA>zJoI&L#Mfn+vc7k7A3h=6qz8T2^$hrVvr@So-LRSN;r@;; zdZ+!NcN@Ohs)r5TO2NnHK!yjV;G?YefX^uMleYGNk16t-w)W5kUpGGfY7bksuFI8* z5megJxp7-@Q~PGPm{F{r+Sjk=6Te&-S_Pw}v<_e1M8(^?@r~P+{$O-`=w0_BKJY`F zArr<)slTs%b8%hY8JqFx+?9I3KkMzYh=C4zUs~VYQS3actG}}YbbL4i&4!199y+#e z+Kh)fJ&+5Z>h-jxzgJHUdV+7iAD;+CYGWn{-MR>%#ZIN@f_mY&FBrIK3%+=3AZt)> z;O4$AG^uD$$LA=?4tkFdkz*>AZtCD>BL)hP;XMmfHuxwEkALS)hom2$m>wD4n;W_u zR!Et_-j-}I`_42J(m9bX=4eu^)#qj~wBUE)4%PBb@6tDzlplJG`E8gdXyKAGp3pKZ zKiZ82$FmP<90Hpf*@5r98KHKlw5S#sy0&3dfoO{`b`@Titg&2pztShn8#>=$C0%h8_f2H*B%wbsa&nLhIh9!CM_hh{p!mD z5ss^{&rJhtFlR<$TbK1ZWEgW86vhbULMya_jSj!Bz}gQUn9dZs7UTb)bA>%A#_G^u|@v&@}xEf%Dm<5;e7J`nRcuxQyx6ZM`@D+Jb8Si|_#ml+$t zK_K%k3{UP!naX}>oX-?3z8D7>2Dny&FFD~m)>zWv$iX+3;I!B?HkPubzSlOU@4O*r z-i(l(G7&J}GxPAIIh9pY+7gY0`azwGP7R6hWb4=TfW9S#RBPywNw|?Xgn_YjcCcJ7 z$uSR%ud#H@W@PSwBQm12Fd$f>)w~#cQS;(-zB)oL9vbV{;M>$;(MJO}TMLg3;LCoL zgebHQXN2KBzTIH~&wtsN~Loh>VH@w_oenp24zKdW!9FQlY`6DSR*4>lfnG z7+aSV<9nW@SpI7nzeWRu9i;MUQ_LfUd4*5fLxeRrU6pn*Ym1>BQJeb(vcYGFx-~&! zjT_f!S5;_bxw#o1C$eU+Mkwwq<8`;%g)bBuTZcnB$1qx{IGhsTD_y|gppVg8%i{e{ zN?;93n^g?ic;qmY68J~FN<$+g$#kGpP7&}K!p1D^(D%nkVSSIt-=4*Nt)(40k_HNQ zv6hBXg!xrVg8|{L)Dk=nR;)Wv@pfd=79X~qc~4=UJCS=%OCzCV_nHod`q5vi3J#_f zWSkMUQ99{>u{%#u1MHPJt>SFG7eV(aYKw0ZT8l9(syLQYjt!_kP+=@e*EJbK4Y1>* zBNQBPg3IP#wJJsdk%LnOFULKjtqV_l7%+q9+VUZg`hr5KF6A=L`;tkz2LeW)@ua5~ z=rGZmO@nOEveFh9J3WYtx&90o6L>%%@%DB8rDxQCV01bvN3&gF!Gh9OOp76zPIYmM z>9Y(}T}LjtDT4r*=J?;j?#>aM1fm6i+Hws>m!q0of*o=M!)~ z-Ot0QYke|?TRvs!!x2vEq2d%591;4Mgja8-T-;Zh3j13hnl$ln?F^0^9%>GGY?S`m zvCiG&VWSpj)Nt@_=NML2jU_0D4_~HaM`}%6AIM7DGd#e_TGj9uAjHGi!#~g!yuIM& zQ|UgEl@2GdcH@>{;}|YttWoTrkikMTp@q?5b}-%+3@WdUT-;aU#u5h6pk@WBwQ0a! zym%d>tDkQKM+VOgHS^ItJUN3e-#r%W{NV*V*SJgBg?Hzu4Wov1>i{0tG&- zKfN8hK^$_z1`Lnb2y|or#RQ#~Itx26JalySb#3!4-44xz_LUb1hm*BF(`mD@6+720 zTTsx3_O9-&eYVY<#>r{SotO;y?h60wU@YcI9&RTZlcfHa2~ntTPW={A)HJ$ycxhON zLBSPOhY(Ed)Ax6thN%g*Y(Cn#Cvnz6+T3X8p312vO10G>q+v=yS}IR2k!wB@xu@A3 z<{+OV=)TX*47gA;H61peJ}b-{z&;yH<0THy*@hu+Q-Rf*P9`eEg5l2DuviHqJMIwC z&Pj~*;?awC&H`MYQBcqso)~*{qMfrmj033^-jIgXm>!XJ-R(VRq@zO*FYWB><>=7E z)}Ae!JJ)w@=z_-61*0!n+8aAlS7^HU;{1m5m4l&1%c7$?ltmM0LvP=vBL8Xcr^jZ^N+GuPWGDR%l~JH&cOKL?VR;-T?o<6iIOv{zr7#6tgSu2wP@!o*%gJa(nBLt zQ67G@b24-72+_`g;t9M*Alf-OxjKO3V$se?<(8pNnbodY6Xwlm^@!sB*y6Fk^&B(& z?AQxtTx@O4;M1E3Dy4@z2itI8he-4+oG6c6v~%+05}1#69@WK8DUl5Qc(Mdb-&Gwl z+&QzLpFM|-J=+s#Y$)70Xy$}F2WDQlbK-D5)0)!5ofBs+7_8PF?i@IbXm3XgcTN=d z>~;|EaKfE42bRBJD!V&^*g4_OiGl=fCHoc%_2HhRr?-fJKss@I= z576@5yKH6OEATSj$ON_v<2dKKdte-w<2~Jcgz091r9#SlxN{)U`;Z&1NF3xd?49O{J-w3xFrz0l!{>C7Ar zHoy-nwz-iWW^i*OR+JQ!h4VHi`~c@6 z16-GqT&K~q{ZDNj4jm%FmqVvMoDkCKx=)$kmpE);es>(P(^-_7%$aiqCA2j&%u!4g~b>SGT(?Y3i@Lq&->_^>?r<^ z2zicvZgf8=IyVk^&J^F^GxRxP{AwiYmNnG^BiT+xWFgOO(AmE8w;A)CqG}2<0el~p zZZR1Ty|iHye9*l;o%But3_cw=rtri~KxYR%)9{56Ar~ADR{^B+33wc?;sbooy*gZl z2Y977wexJ1;O^cY9<2hr1@~`H$H^+f9XMyy-iN!oe88b6E4?4yZ!5W<2hNn(y}7-w z6954g#5cQmluU0| z36=mJ(*e#H>5pvKbBYaZV3ojpZrF2TsT(2ex%H(Q@{x^uj)Jh;!;uK_PFhC?Rbbp4TnHE)!A%-Jx((J0i(W3&&wH8o&~*q=Q#jOMr`RA$1D}(1 z*daiK;6qEtqD4hF0Ycqc=LjhI86lnWL(pJ>Fc$iw5cr&h_m;jDrCn`d%4UF(PQNZUHj?$+Pk54PS-{k4Oho0|+RA13I`FuwW8z^W+lt zOiYz`jSNqt0hE9;Sg>D}o5RWj+M)Ac?J%MpV=ekqKG(!#zL=e(6FUY*%cus)QOF3M z|37=@0$yiT<^4A~m%fmcwzOb@LQ`6xVz22fy&%1}fwT=xdI8bXOVT!wCLtGE7^GD} z5m8b2v??QYWE2$@6%`egQBY7+9O{6Aic%F76=y(EJNo_pYw!KO?@5DG6#c&O>3N=W z&i?PU_TFpX?`w0#uSr->RagYl%THzTy#N)MlBBoHHpI5OwYRTZ`WRIWv~as~G6{rm z;euZqW_Oh_lYrQjQpG?{=c!A7ydgoMbM1+<|7?PZH*>SjY59aX$qg~oCK2|Y*`$@# z4&SpE-jIuR7TOAI{(+3axHNY|h|fr(GI5o$;5P z!NonzcE-==qH&k5UyBh?hazrqRhdEaK&9->i*|LxN@VScK8skol^Z@ zd+|ZZAC#zaZO~h{XGD|(;23oYdo~vET3nC}naCWJg zbJWBOv~t<%RcjiXj83euS=G2?r9q+sB$byeSYZ}K0gLAIlH5XcEY4cBkX4$M9C~U{ z+RM!Xjt-XU7dJ_-8dzrxbv4l6NorCqV69YNU5}=>rbWw_EM7yLSXXgE+eJbW+KFu0 zwS4uem8&=?q+D~dd-tRcfnn?9S5AvJv3BuTDtoQ)C}i&5ahuI$s=a+6yCo|~Y|fXv zICxlEy+eG?vAde^!L$yV7%M<^czt-Nxata*W>xL9Ga z;9N^NXX~b@T9bF@X$8VcJk>V31YG2oHg}psQ_e>u}^n#S+c%yb!jE- ziL-QZp)|UHcxuB^U`c85nnuUrBB6t{&ab3Ga92&dwWW}p(_LI@OT@393!~Ih$3Wzk ztewOC7Y8}Gr!%+MxER#xq#uWK*Q}f~!^vJ-YFcL;Gn~-1oa$9#EM7vp=<7p0*C(B{ zjrH}V_02#hs-PORC1_4`BFaW*gt?82os&{_ti#Tk;e^yZ%sDfhgiT8tD5!I0IO*27 z5?Q}$?Hm?O6a$QwG#+Ms_btdA)D4KUjI?;!>IEz2%uK{r@U$h=h?!|T%&tLpX=G%F zLl+lLJBQ$1MBMd89Jq)$NUOAzTfFoTs<;qc%$6-_UdCR7Z)7QKGhH09Z(NtPM|Xkb z*IDY7X@|uXLfJOciY28$PmsvYE?JUi6woz`npdqZan*M90vGx$7eCK)_L6g5iJax@ zhjVHdUaaMxDR zdS>b@{>J4bP@@{9Idv{67Oc(MxkOmdtn18{EOovNhpNs|3Hh_$dbdzJ>sbnKRo7@8xP-Ry${QR{Zsi%cjklT_$_uvgvf4PHGE> zaS9erXtS^Zz!WF4v(SKIij$U>z*24M6ep}sGB^>@A$ED;Aa- z{J4SZj24%b?uhjiCn)`*Mll+O_&%Oqp9FC>PEc>7fPEL=w47GZu{cScg>g7h*JONg z!mdeT!#0i*b&ZMdd~wpQ$@uGqZP2jE@i>83HlX5lrL*$gIaXX;HzwbmW3$p>U#=TU zO-q`cjW5v+Be1jF6`OT5{6@pn6l+OSo?-c!(5jw3l^`fr>06H?@|r3TvQh> zSiQQQQ3Dn(rs}`}E{-&mBwnd$O=BY+8P+a_<<=#3==A6ld9+AlFVarkjE$>&pT7ug zzlSZFd(Qd3*Ma7{B!(p2Bgo4q1pBU#_qn`P6vP0gq{Mn$3dwt}H-GecA# zZ|q$(R;*#1tl_1*QscXRjVK8)wRYJ;&rLOSVfhgNS;)nm(mGmb{v-*)`5{45BmGve za*;w;24f#MT(k@(Ez(p!Drj21gmJ)BKPb>z_ksrb>SEH=xL_UC)ej7s$m|7+i5B`k zXxSKAmvs{dlYPCn)F~}q(7eDEB0nN;YiW_X_2%VTC&1XSl;ObAh6T$=hbijLyj{cM#FA7Emi5Z2 zDeBV_o0ZK8BaM=?rqN9Oq~IsE8DB}-)Y|(?Imy^%e5R;CAPLviFJ_@4U5Vfb{aO=A zYG%roOIW#ft1eDQ73OWSAgZ44o36dr@!<_ROBi&S;BX%weI3MJ}fvN|#2`6kHhokCgz}2y-b87ulvH6!SbjST&hCs%+RkFv zJJt9Jr|twG7MyM`lI1X|sdBgfu+_GkT_H!U7JL2v3ZM~KOJmy(d!*1EVZ6p3jm=UQ z#qI*B;4l4^xX&x)p_UY^5QmHW#JY^z9aRk6wb~Pe+pibmH>~_O^+%rCfVy$F^2~A4Az; zDhZ?pPkVSIgC(ckrEGWSK%Eu&jzHW$cbR54U|jb0t6io5Z9pLhq)=Y^c1|9UB-Jc| za0z-T>~*E`HGJDpp;l5pjat5DZ+kUR!;5ytLQ7Y^2|xu;wgXY|vay@zyIOma4LmNx zX4MgHX;G@^#gV1sQT@zO39H88Ij;eU+CS|?orrrz%qNDH({juj zcStNfF2(jGJC0?UkVu!!6)Y`D^$eABvqefZ#WIEDc2?TPZFQ9T}gUsQ3=)QYwa7ko+{(7%M7^|CC)%#rp)dW){bzr4qFL1tWJeGL-1t00NA)&=@v zRn8*EAx_3MP+)eZe!!@Sk`2EsR;Fk=iO<2LXLTrF|BT~=e2@o0iG^=KRH@Z~SkR0- zRD{#x9~(FI*Wk)+lU9_pXWJ0=yU+s5lfXTbxeD9Txt#%xl#W;{PML0RMLXFgrJeoo zCH?TF0m~Do9xT&INGospln=hz*^@1^XOcChuD`5v)euVEHC>nfE=7+Q9jUegwWr&A zsUEyQKU~iaJ>FzZi91LLg(sF>N3RBk5sFT!bK1rsL3g!2-36j?6?<8WQJ5&J)y9I3L_m1ph8> zx2(rAyGJ}5=wa^_SU5|@dN$lBm&LXn5mx5{t?l&6N;tS^N?_4SPV-I_di8ds>4ww$ z488VBT3H&Qq(wUGGwB1`9ho7CL z8-`%HBX#UYnc_?>{U{U5wjMo;?cDoAQ`m0Z-s@GBF$D9crm(i6py*kqX}DmcP|IYO z>OEbi!VVTPjuRl|$!^Mw`X_tPaAe7@{71o!HH4PXzE3J`wNDF9Je0c*o&7*^ z)B6*&G*uIZ>t{U>B}<@-c3iHFk!Q4cKK4o{=Z$rkAjht{WT(Ocx8`ehm@VNplyJ*i zJLjcyVR()QZJm={ze0nw@#2kb?SVpCArdEiQ7hlhtG2q61I^oMFCSfy-Q4e@cXZ8| z5}1)@+6sliY8R^RJJGLH#_Wcr33IKTk3s&9&W?`Ot^JrOWo16wQ=KsPapIJsC~et6 z5uink#vsd&{y#;xoSzgnUUys#IfU zS!aZV(D_(X>un7(N!!k29^EumzFY_BJ5LRx-3e^9-^#6Rx|L?dk;6syRuY!I$~AAv zvz(Uq9CUZgR>GOQ8&d*Y0TPovXqgFw+Gb@cwNGESb_Ip8#7^X=AjmyuE71}aD2(hZ zYLeA?VN{420Y0hl_QC+K}K_wh=KftZN24foyK^xnqJb*LVWL3h_$c#i5qH1SxSQBt`M zNI@c7na?&n^8{5$8?@-8AX}YIT^2nM3*Ge0inHzHtPBJt zkl_g(%l@!LuBcFt*PMl{fSIU=hr>z|ri#+JU9BP#XS zxTv*i?$oI1?VZefIpU&b8W-snxHK-XW`v%U4rZxuH~iJ8u$tjvm<(qW9(sTD8nmBP z`<6T?{PhgUI;pZ=3dj6-Y~V$Hng zOX8EUOdqw*SZ*1RGwsqctp3fDWH9N1+S)dd4_njMaMWJ+c5bA#UWoENX*983Newkq zM(lVa!da5jqLHONQ)kZ%+7a#IiQSUW0t~~3PzYpmJAubLzuI-GR{xgYTG=SJEYlEk3ck@-Cz_SniA8B z#?-hXF*env#%ZZ>dTN}J8fT`)S*fuuHO@|qs5mk+@=8G{3F${J7j?S=5pa*2OTgFD z-W@C{!Auy?Si9K`=6KxAr9UxJ%Yl+07A|&}NlB)rBG}0!J8NzkpR{p*i905t$&e#U za{ok>%P?c^-q^x2bINKsush&eBxAQ*bdHcr3x&GpL-XX&PL>H*n+Rtz zb&Z$eCRYPF)9mFmI~OS@=fJKUhl%DG`lrP7{(-sF@}Xps&V`b)r*U?6{XMSh?=dSr zJ{AmXLo8&Mjm5yOGO=(BII@zSO}C`U^?s9ROkq+smt(4UNo$?PA>6U`^)ksWpTR1C z*0fUsT@#OkB!YUu)%G<*?rM*d0$-ljzDrD*z2BbMqfK-RR_0tm)JCdXU9(jP;w^S8 zUC!vHmyw-yDC?ci;z@LAIiar{DzFf2D4A{LEGC{xQsCGPuOznwGKpxaY~DevA#YPyLs0B2-EsT5{}V)4~^LBn8P$ifLV0H+fwC74htlu&7c zJCjM1vX~4ioEaIC0#BcAGFWN1gc*R-$&eCEh7?-Dm}+q)jAn*PYI}dtL>Yk76@FJ< z(|5$IMmS5ipO#byXL)H-kusbE4rsEKChx>%w?!$OIB*X)M8{G z4zm*nK7mBjVF`^4d9#X;xJz!cb)F}-WojO7NO{30he9!j|+R1+Upk z;2w@h89|Y-ILHA{CFnWno(oGmHlkZz%MfAJ*j=kdR$H5J>h&d%okj2=rHNv%eh?C( z`b0rA-Z!yJnHKjf`8Q`%`m#TnuvbuNf=+X3v?7U{5<> z_9nG9^%8>WOK@NZU=oVr87OQmB=#LULq+$i{k0PfE~wpv6IzEYwlOiMXXz!Dd-ucS%*WC7VYyS5~T& z(woZ&KEm$Jb2k&PZL<&&sh*{9SxPay=8{`WPeOBr*y7l85YZK6bJ(+kQ$dL6tAfq-nq&S0caLtMlbm>R54O>3?DCB_RwcU=7x7U7K}iCLy_UY_-LoRZ2)M zmrZ0y9QH{lnN)C;G(V-&Q~6`XeoIe3hrWzk8U$6R&q?0B9YoB3Cq0shV8}bR^Ld%A&wY>PO&G^uO$vQ-kLYA~svJWvN z=4mq}LdX`y-4|6^`)JZoMxl|CwT~y~)S^(ZW$mM>6^D!;KAI>(j(U=oOY9+{Bv;y2 zh!7egyieN-2%-H&?R6CDnyh_nb#gsC@TVU)sagxBtENyl(gD%d{%O?$WSQ*MTsZe|gK`l4+lcR1n zEMm8xjSvf+G{%$xFCZn&Ti{oLv8#g7-NzHcCwav+)AEtuxjq?^XMo!$ImzlKQv(aFN>80rALdJ??N|7-RF-Jr_?K^WXxLhL!sl=J z7!YEqm*I~#(uYd-(%STA9s`2e1`qtJV|IsiEuuDf5Sccur|u9Q1F``DS)l`DZmA;K zoTMGrQw{Fuc)!Ph97#6>bgaCS_ZwNfW|X16MLo3~I(0J%)t&1Pw1FQ3^3wc2c?`&x zhyh;%Qi{?Uq#fd)c??Lr^ca7;$AA=oFVF-O%FN&HF(8Gf4qpEZg+hN!sr~C71CoCl zNa>#ui}zRK#8&sbk5>@qz+d+m5MkIzQ~!(!Ls-<3=jSmX`Rhju+N=!zs~r4I9|Kaj zzAR|Y5yGXRYvt&JGFuXbq^YQl(_8^9)byntG0COLWlJ|_8O22!aazh_ZpCB6dI!)^cs*OhLm79*2#I!a5URr?6XbA=k+xpg^HBruK{5>z-vIRryuY& zAW!0A9f`pB7$up>EaLyy=YSM*YHM19*<8?iD8;ki3qj)4>{kD2Phn5{G}JF#y#U<+ ztIp=eKmbctuU^Hi;1r|!rZz>;^zxl=Ywg(|)1mt3UkFm*8f5B{yDno-nXry~?shF3 z&lo&wVz-@ZAKh;9t;NK{F9aQaAt=mGsg=*$3qh1cEk@fhf^=$XPZ9f`>5!fX^1O%m zMv&(|#7BY>?n8McC@>%LGeN<@p}!N9xHz&psUFmB~VxOe6aNUk-vMWe?>q2gyfFm# znv(d(m2Ca4whq-0lx?me@j5#Xu!rSE2BkL5=r_D^%Y%M)LcWKQlpdKm{BqDg(#t^< z9D5%~|Kzh%G4D2`u<`SJJuM&P`JPo=*o!dTWHd1b*h4%mDNX z&EdC${#U&nq%8F_LUJ#8J4gkOZXxq_kYjX3@mb#vk~7vW+~6m?9pnp(+uPysAo)b! zlRO?Itg!y_$Ajbpt?08n9#mFc=DOt#4b1HIAe`zsp1<+yL4=}oaeaU-jLe=nx2%J3 z!?MkN-Mks%7Qy5oS@8+42T5GNb|_We_Ii-)dsydLB;(^4|1Ct}sdwS}2EvMYjNQ^KI= z^Fhxo5(B=Ile{0Kpu>~_8N#YtvX-i6flPiR2$4JZ{UG_`ivxUN9HLi#{s!*{DKOvW z=#?MJURgd_-exO@%UrjGXF2IIcffQ>`Xasl^H;ndBpLm{44*=R=pCTv{C*H#&GvN` z_fZQ98#=g3sPodS(uv|uXOj+Ila@u&l0o`VASWeU*QfP_WhNOY&|A$0U1k*VsdKk+ zDp{%tq?1dBekP!X*4ujTWLJmXT%L>R-grqW3}r>aP!ed3r(~*%36q4Biqp4AVQ3d9 zU43*K1>hl@SUn*W?RqC?%sE?t@;i&W3IVQF2ByuJ>8i65-nW#Q>gKCN9}SECqA-NU+FF4J{^OuxmNOp3vd34I+CfzxXE-<)_m3VtMkf5#Xveg zSe$45XD$_!t2Q*BiioE0eq|-GWLF1ECJLOL;HZk14Q>%^sw+Y!(ONsVxD))8=romU zgW`rR4ymP@5VXN)Z8yuirg*>|Tn`t!+!g-xrWoA30x0z{sHf@Lh>|IB(gMgfJx3Fq zbB30~98y+cj|X~Qr*5F!&er!84m&H%Up=S0TI6=@%j`mbT;^kP(u3nBp1?_rxkZvG>|D%KniHzs>_D|x8#$WPm&6I0knDgS zr^+w!YA1>Kc5dOAc&4@?scA_T!;)A!)d~_`#U!IU!lhZT;KG!%NFCA)`8Zq3aBPQb zd(KW?Nt1>v@9yTIb1vm7!PazJ^vh*;^u=82E~10xM9}4tLs^Ur1-BoJs1Dh+3G>WWJrn9(P z`r6x_HVkV~Lpo=DGi^U*0z##xNeNJyb=nSj>&>AsJMTC=+|D~!t=&DrovRnxS$5q$ zJM!)>5LP@-*SmQecVxQT>|m7l)3n$nne4g@PqLzzkjjd#tLT1x!(Ui+H(|VX!!kRL zi8}2tNa6JR>CUmVdWCze?Hi@;QkPflo)Tx8gGKE@HvaZ4=Z@^^O{z`Al{jZ>)uYMR zL|V_%1$}n4)-Kk#Ql^l!y`HwGQYhvzMx#jz(DLSxY1~7=5L}|zni_4W{qj7JT#&fnyZ#)Aq5Ae7AZtqs(MB(A?_+p#M|7HsOlqh z!^mc2V#DvAZh!3?!DTjaLKCS=U|D{78(I%@UFNgy)LH1{rxD~lu}s}6U0_K)3j9ID zmf%r{yEQtgMu@DU1r&ix;gf~u+NLA{oN)B7?IZ)LZ>arryi%m#Ro;ZV>-eFD&_S*> zI+%KyYGfcy-9fx?6Ssp_L5f^Sn51W8X_6Ru$Xkd8Z3)xYTVM6JZ``RJ1L-NXqN3I# zu_-GS?HYQxfRWyZCmo^~b*8?DZ1YA=Y}-?r)>c-6%9;9+~vv01tyo6f@#2JSvAG6)KsKKx zRK@npYnD#IiVn}IKc}(XzOkdXt*2+Bm3-_?X#xUZN=On!7Ebw!yZ3CVYMK6QA(WL2 zV@kE-^>f{ikQE&*B%vMc=cqrW%+<_ib=8lusjsbF&3Q-SAc=O;7Wfp(wgk=@6FX_N zy(DpKB9crr|6E9Ox&*1yUPlQ@SkB<$om6^S>HcmR%X`PR3{6gB(?(|b+vk+VOn#`H zPkiv66R7urIje2^2QfHIW^=J1CqA2aiGAvW+3Sv3Yky{E*^jfkTP?g=dY=Tr>y*&X z#k24S>;BwQtk9kM?MpAkd6O&0m^P9$6kD?kCKnBJocib;)987}n7m`NGsl?B@wUFL z2PJ{orT!V8^v2oL&G+t!CHDg82sx{Fai>~t)DziVq%IB5-6)39rUvE?n7cOLGI+m| z0^vk*R3AR0Ct5j@-MTg_Jt6X3ez-V8FrPcn42q7+()3J5IhFfLIJI>y3Hveo!0_HP zlRTaolSv>w1e8|FnuVLfGOy}FxS>o2f$C`CEV_YUO}^(&dQ)fVI1|fmwjo>kb2`hE zlL~5guS`gqIx99rdAmg!gNd1GQk*ojffu)SI9)U9taSw>MeeFdiZ@M7%@?M|z!s`5 zq+s+fJ5Sby5Gpf0gQ_$r8AYJ6nn$FwHYO?8_R21bDD9FI2~Q*>%~Z0^;D-HlHa*kJ zFTjv>oct`i`NHk}x#d@0&|@*T-(45>mpSNAe#wP9baNT*WNx=`=8*NC5LsznN0o4Y zO$?|Q-cDOQpe_baXl>sTu0dp$7AZ2CSFi|Umf9(>{_BjM8MUn?RukPWwHE!{q{iuo za2gp{0aGJeHAD zd+2^)jd8#>Mpw3qMqqwjP5Q91w(j67$}#OwuWAyk?mQIUZVOAp$l%|2khcVvB}iMb zWbWD~HDWFzdi%jFd-`*8{=yS7+?-tTmWqu8>(`!qTmAb}>swMS;B5*#y7Tt;aP|OSi(=WdqEfOO4fKiuuYdx75-p zIEFQoa$!xA5xJJr6jGA%bEDq&p3D-hc4iRI_UC3=24)TmvyN;F!+IXQ6a?f%vx^C; z15o0IYuH>gxO-QcR!d9cZEd;QX4Yg?utU!u2X9eM(YmvBbE&hV-HMEstWnQ4*E~f& z5@aiLCg;0eOqQ+?ia(t8;mxp6IP7gpz{Pnqpi z_fnh`NNMZkn)hqLqNjEW3$^B5BG;w_JGolh5(_6+>n1CzDo;)-PR8S3T9avg zNO7m(j&^(p=e6x+1I3MdsjVFe$wX&DV3S8zsKQjGop&k{zIM&0666!cbNWX_JmOqK z!k4IjXQof1)|C+4+LXC~)YaYT6j3AHb^%t=6ILsSfm8iO?=~w=bnP1xCe4kA9DZqN zG7yJNUdk6t{q!e|yYs})i%iiC6KstjI(be(2kVo5O5yR~pGK5tN`3!XIp?rHUt!uObugL3GiLGLWRTZOXhyw*p z)tp|+CQJy|q|6fB0;D3)!ZMpv)t?Q}Y&G~}v3;qJs-SxS30YaZ;2y8$eQto^mde`? z+8(3iqwdmD$5qH=Y9e3Vnw(ZptS*_xN2)qCLfzL~DM8foja7B+bmD~enH!l|A8oTu z4Yr#O`g+b@Oi)y3%Wt%a2hB!_M_@7yiN@$QY?Phpv{jj7Ghb6Vi4?Ru1Nj!165q7y zJP@NB%TWtj`s`^9D?O&|O}VVQP>H6}EX=Ml=#o!cSNkOywSL>DTH$uf$+$!8?X|&5 z70^PnawO7J8z|aJb8Tu2-by_geo#bGZ>3Yy1v)LI1}isUHwWG-;YlwoTMbrY5N?(P^a8{JT?VX($_H~uIG8#Nh^Jl2N8gR9{_CyhIH1C(E1+Uat1b<-VO^;HGsVema z9t-nTsov4*v?wxqcC|4~MMF(;wtfvLB#_3%)IdDf^b6hDs?D1;B6dcX+nfB1hStW0 z_nZ8LBEdecxb+NE-OCkNB(wAoWN1lTu%RLGLbOU7dnaSG@`g#WIsM#B`Kj1J=xm(Q zT=&&8;+5^hb8PnfKxW7**wUcJg zR1Bv~nKf-{|8$-;X=;raCeCKVIh)ppT^&x1!(}7WA|0+N+4lKxY8+0D=iH|}OJ`ix z@BC#vhuV`yd`9uDlp)I7@3pVb$K%Z8ekSl&8I3+7(07-L@d)gCug=HS{ND!uSjTF= z&cAOY{Ex0H#(OJL21j2!Eb;H$VtkSlAmje7k%7MVCB?Y=Aoov?4)mIr7UTD1=#srM zntWQIzXf><*u55cGr>e-jPF(a-VjI86@2xsiPs6n0UHQWbOPVXNRjCq6h)0im>9!d z+|o8JLsndNCuCIo1+t5(qB0fondZ7L0*3JaQ@Chc<^W7IU=flhj~&r_?1fT!6#6XDx;%@;ARSe zj3_Rw+JRMZy=-z*;VEA5UME!5@A07c(&5g4(9o(CqAl-+mivtyz5D}sTRC<_)fBOv{Q(hLlpL4eWrUGc3&ghaOCmh1 zKzDuD2&1aLj8$>fBO*+due*O^gqmEd&=pRaak-P^@s$pZ&qea$)ecR_y&D(B*ElpK z_gSH<9h&Zv_!^hQbtK3IxI9X*8u7*z=jRs5tLp|4z6#a{g|2rfpZiy#J0~D-bimUzL{3CLx+^pDSwg@{+aznaLB;{x7 zC$>MtVuaGC!U{4rN}i)$L@s;;LtOk|?ntHKhZJw+#6?0MR-vyPn|IlGtGFx2#!-F_ z2Ib_jYVM-S5^zFcdhUgA7iym(6#1aqRhT9=xrr|~rWr>X(_}Fn`6+0H>GCY9dRQTy ztTh*)*JjIT1|W*M(AkG?05t~BE$IeWFFuIf_qyvBGxB;!@a@Luu0){N(g z_ZpMx)iS>R6iHPnhBv4+uTpuee4}~RAmg>>*-_$sllf4kc)i(pzc1r;X1hte*PHD` z*}lbskT;cYHQNW|gH^YxAItU~#_%!OzSE4?DI4BpyjRKi9y7jK{=V0e*{A^B63wAYIENi}>`>qPss zxtOVdK6@q6IO0-l^GhmBlrF3bC#jdLx)I+BV^yZBPQtdhaliTbGk%BW>FQnWP}4h1 z(AsXoJQDMeysWG4A}5P2Cz!<;euvKF$2pT}n3&*In^5%u!YO`anenP7ABY2LH^{GDH{&xCJ`3+fjb8Mr1xRg?zUo!YdWaQGWL*Qm&ZKFRgD_Lff<+H0YfawoeiH z>nkV5ZdX3a6)V=`k`_1Cu-MBYOfV(256p8Z3MSf z=O{;c%FqnO!WiNSBQgXFWT+>MGy>a^yrZZvhI#u@iM_EO?X7FfS_knx{|HYQ=lD4o z%Vv!8>KIQNpSm%>j`j8vVphewFXS{ylp9&0KEHD8lvsBK+B%}#@fA;-&2-X{1En3E zQErq^$hx?ME@++ph;k=-yLoY`le3L(D>`C0G}zL1KK}J}bDN>PZ#$lzT=6=~ip6p1 zVpAfUI2c>;YojcU-2)t?NR%5_p?ptO{#7$2L2g+9+4&ZPpWGo`;BXbG+2&$803)4h2l}Du$Wg8=@mrPTX^*QSSXm zDrIEj5-Y0C-CAYumqxjdxI~Mp?A6jJ_feN*`6?a1jdGuG z2TuUWR%Nz&OxAWn-r9u;~jUW_psws;*o`<)#T z9P;~Un}sth6+Jj*jVoepc>m8CzgD+ZnrQDI0Q<^q7_@QN@bfWIQ;gWolyVNNqbZwzUbv zMKG*%&Mtz%8#hH2tDNPg?TK;6j;LZ}ULqVjL2~dA$EM!xi1?7PMlU#KJ3jozx!aDv z&Zv^3c#V{p$5kYY5fwFgOGQ*Y&9N!mJjLuu~lETMd98ewTgv}9IWrK>omJ|Bm zJUK59EBn@ux){!}hCT}CD8w9RzG$v};s$!Kl`x*Vz8JUjJ?Z6ulX~>i#t#b_QB-pk zrkd;Y^G<%oypNy%#D2_e7*>;!V?K{TD>`Gog5h2aHQ&N8Mq`0$hE-#Jj^T6+HNTN{ zMDi>Lom_>XvafOUczHGvpi$?TIt>4efzQ~zi1cp0V>Cg&)mdIpNW+nM3b%zd_^=ce+vTaHnhC@ZnBZNAFpSJlyH}?)M+F)AdXA z6?LxDRd=Fp#dW%~th-c)qfXbMA{~!9-PzXZ=KAi~HA=ni9P4N2L$q#puECoH>2~Lt zKU%Xrah30O?Uu}3>#dnj2RKGu?-+HxC#&nt_1(H_th(QMu#Q#t z`(7E;{XQUrx?hc@#;E%ptM2z>GN}92QuY{izhl+?7Wj@)_sinsg~+lK!&vpeXYd`X z9(aq0r!<~djGOt6RsVa1tfFY5^}nwsynMx5`8}HL8g1!3U;Xbd3FaTB|8JG@Kng$91;Dr&Gb7 z^Bh->{2X_VjBbu=MmNWmq<^-<4R1;al@8*#Y^%wzgPF6ZiN1piTrss zA^sNvIG(w@L-&AAi0FCFz>7Oz{|Vnw?SN66^s}Cy6Zg-ibIho3*; zc=Wq5l<;8mhcN7t;ZqnskKv@dFpT~NKfjUncQA}#W%{Ha$@*9PoCd1-JqD)J^qVh$ z>%R#;I=>i?J`%sR9v+>jMb6QqfUUsMr(t-N?4xKV{FTvAEb1dHxKG8g-s8Vx!kO&l+`}?VuWUo*$64I?oz)o}Uv^=Sk05gA{uS{U*LO>N&p$ zF*;EjzBTGO56BDkoTpTa-|q*%UHx0dBz~XQ{os!0e?Pcl7~TA^ilZxX@d@!M@o>eu zVpzq{;?ex(jymC}Q;r%=6f1{UR1B}Gno~6wkQ*H3j*_u{cpV9wuYguRoGJR4sDAil z7>eUysH%D~#z7ckXN+Hv@#BbNogW1`JTmo=t$0ttch=(ZJPCL3c-)M_)1xGfLU8g7 z84^_)_t0aoKdo90hZT^85w1ua?K#!Z2uG)w4acW>{`lAG@R>J%U_CC&i$0v14K_UXnn`s1z}$q=zw*Y%YFPp3$dw zbx7~QA-!FCIDRs4NRrTip=l_jiVwq5{b(ZXWj(W6i7|YVlGQ{~BG!;_BMOO(q?&hN zu8*yPnUt%dCX95+d)%aoGpkegDpm7|*zu_!l~j}yQeTwPqcRZci6`Ri)ZubVB`ic! z31f6s#TrO8(+!Q$pFBF*40tiNin1#HwB#PnB^4{m_ung*lp&*CcGbA-vV6+sQpmS) zl1UkQ%He!_{%cpZ{)}=Na-z$SlU)579rD5Ild9ktWys+goFD^SPEaGt zbE3QlI*0a+I|XXxD*kZPk^ELzlQ+OY{D{}q+(~?KM1@Kn+Rsg@m~zt8IVX=Evv%D{ zqt9JenZt`?&C{U=c^XAuHp;&pM9BoVwY39%v70AL#ZZL(j?F#WH}yo5`+B-{GE8U1 zIM24p?gvclZf)7NvDcq(v%4Xaxj)<9$Dx?4mmPhAZMx?gaizIU%7OUkNJ%7mm|B|@f<|3pi~HTE+ltjT=9yH zt!K=b6W8p|z3=i}r%#+UY2Imb&KjK?yzG^4$UPkWAoqo6O>Wq-+_AHB7tGEbGrMJZ zZ|(z^-<|tI^s70!lRx=iGrqKR(#(0YChq2M&cuBaN>&s{4E`5F5J-6hpyL@);7Zoqcz5epqYv+)VH|9nxo0HpH zaZzsC`*JI0=cdiRF?Zndi*iTqnlmT&RP@R2cv9|-yLK(l9r?+4eeQ@K%&Eiv>C1o6 zyF2$##ec`g=Wf0{eo^lFiU)45izkGnp0IAo-1kqMwJui`zvG6b6K*(tPVVAem4is< zW&e<6Rm;1%@5B|ma=&?bJbPW;L@T4O%6+C{bMEeFbMA2p#vAvdLeM9a;6|Xn+{$2mAf-U#2-gP(GP!x{~s$ z%Rfn(y*(|Yk5NdUygZ(*vYETGVs`FTyW$fmn7cy3%>5{uoqH4Iv3K|HDU!b$xJW+W zOXOWJe{|Q~RxDpfQ}wrR^EDy&ZN9Gf<&LhP1+O40Y3_8_FLy+R$4tbK=udngUlv#A z^E#(LkllFrbo(mYS+r|+N5xlG=IQaG!G*lKv{&a}L!bAo?wg^hsnDIqzr_9ZxK|a> z3Aw+-{XX0)-*qSQ&$*}5=DgapS`Jm0O1(UwVTNUkR;^rHs$aQi)r!W3CCy7PHm+&b ztw-sAGM3bpb@cecYsXtS2`V4e^~3cSb?>@`SSoo58XA@?ThLHiyrgN->iWj!RjVO| z@V0bD1Dsz^PN&-$ceagq2%@v2rN@Le-Ak?Acw&-DRS0HN%))<1PcN4#Edm|AQ)ikB zDQNC!ZEZny(w6Sd?Md*PdOLS)_P)3i?4?qVjzya*Y4C0B3Zo}N>){;rW~qI`10PCa zX(!rCI#wMx{0VDuFGB@mXOCxbF_$0qd?9N8kV;8j>QgTAU!H6s*PJ^}B`F%6n=U}9 zm;C57?c#EcV;@8tXM7WXmaJ%OJ~zqx%`FhxI(Q@@VOY6J1;wl{?nF^Cr+1z9dQ0Oj z?-?p4w{>>Qm8C!b=-7AR^l{d@V=FdWddfmxx~8F_v}#SWD|MMn=t{WxYyNt2{k8;bw%n!f!9Ei^0fWz&Wh+;$UgCUj!Zt}`SCp_(fp#%*$>qw1 z+RMW zq0Wg=JKx|$W*@TWz=?gv^Sgp?F>1Unzxuj->e6Ay6-7Gf@SY4`uwR8iXZb3kb1viW zHO{EN_nL9-`}zBnv;8c84?83LCUQlzR&a=RhcwGdKlXa~G^oiwMM$wfRd^o*YM|csA5v5n* zD3N3iyqWl&3TYBwB%RBji{I+ND2gtwRYZ-!>Wdg2{r|?9H|Sq#R5Imoz4sW_M)|BS=Jonl{?kk-5PfB> ze-#6)C*qmHq{u70+xW^8{oiBOjbG&tJ9DW27g*41v9yok)W;WTYT_0mz-Injxjje4{(V@D2QbSeer1A9()4b~5A#J*kxw(uL};uzf+%W|MJjVDzsTOJbZFr#GgkK5 zz^?#Vs3@xS$&{}zLs6MRnuqw??~MG~N0fbhGY(`wj4wgN`k&6%jV>612jj8(o~*ctJL~uzVsV6dS5bK$Yhx2^Cf}W^}m`g1yY64H9o6X z;OJt$aCGTk3uc)@SqtZP`9j{He_xCjz_rG4>eBOWzHn^Q{|#oHRHFGfTE!PXf5@M2 z^5k}lF*d3JQNS>y5lAYnT4TA(h;%hj2|$1?N`%cgmKmdclmTz#ixW$B=eMIVegI0P z6{%3-?{YJqlZJdwU{tBwZPc|XHHnr=n?5i^Q>IRuGL`?sc8Am8Z&41GQns$)tD3Tx z@2!{@@vlPuX1?L0>4>Ho-{32H_-F{djITys8W-JC%BGp4POnoo`k06shR&D@C~1K3=i`apXOZQGXg^c z-%#Bo=bNGL=Kr&NH}LJ?n|z>&9{3acNj;ZrNBu-J3B?8Oe_Jrw8c|m?iKi}FCoNc5 zKe2b?)@ahUjXm37e`KBIhS;4UwY}Av= z@OEzJKuL@*TuieDN#taSWjb zbNJ-FLG`S_SA65)8xLPE-$2*DzO(qcAu>JFEA#OUIM|SLZecf`q5Pl87i;tHz?J#< z0G`*%bN>;qJ}U2QFLjDE=_(X7(&(!^hj3-Dugd%%J>L!RN%LeQc9J=Si_tptBlwq_ zC*XSmKFJgO)4%!^g%S7;z;^)4oj$&bU*L0dB#lN$5BA1-k7O!^Iedb@U06sC@m&Mo zHSk#i@TZUX^wsDl@acTZwS%eG-;|B}NLGDb!8h>fV8-t6SC~poBk~i%eU0Z+eD}h) z7rw^M)V~_+^>H1zOP43VJ}7>2WzNRpj+*-SHZ0^?c^BP3D2^I)(YQ>6Yh=&oM!t%x z_{RNYP&{sH&e}ochdz=|>3lQa;NMg5Jq4fa!zaY!!&n5q1MnSq7QRnp`0|eriu2oY zNm|Iy;NNF5d@+16eD{gLf5fNnoqQ#a;_)bakHR-W1P1rd_&RMGt$%L zS2f?S^0l<{_D}ZZqyKtI>N1%2K@VoJKK9K*v^$e9fu=EHFpF;+2fv?@!GD62C%{?0 z4G$NhcL$~nO>?>|U+$4Y^!?LP#z0d$5zM0gFjtJ;uZF~b0`1s-eAjT<`LhG?X@(fw z$cu*I#b`vvBIMiTeta9yqB(2;|D?4n<2<^Edvc4E0sa$cOE6@dN4M$Jd*&1PG=T2U zC#|UA6Zn*s!7N(M>BVSD#v&MpLCcnd#upW%wm^gyjQY<66CJ26MjPswO=JHfh)Nf= z32Ljd{+)keF^VT)=|920fV2PVAA~tNXV&Tm9CjhAy?5A!pmyD1mn&+&9d@-_?X<%# zE!7@7>{3weuEX{hseN@=v2g9E!)hd5d+D%RUY2@k7aevPs`k%e8cRNE=NvxDu-Y?+ zhZweY3llZeu-Yd_SFX@sCirN>YHwu7`5sj5io+T~(LN;j7{h8OWXMIw8V*0XvYtWo z&^kDdTy$Juwf|gnd_SySJ^kcN!*mv(m;y|>=%jww)CeVZxu_;F%aDu4^us6j!(;p5 zasBWq{qU*%@M%f879k(~`cI)h3piU&MK5K15Wb)vR{tA51JV2Y-`{=z@cQ%jr~gm# z+#7`9U-I1F50A-sD7wb+;WH3_hWr<$SO4%|j)yv-sW2<)kzSt(K;iEJhw@($9c`;5 zq5M}+{%?aG>QhBDB>FNq)Q5^_M6?gQpYqQid3|j37=~Em1j9q4pMf9Egs;Z!arjje z#4j~fQ{M3G@{NT4jIWQ9?-X$4>zm}$81nXSgz$z$^TAp98o={?`=I!5l6(JA{Qsx? z>CdlthL7Ao*YeZfKWRS=ANltMa1H4<0m};7t9!v4GWdS*Ua)GO=nsPL0c)-({3v)o zSS_dUFTqb{=)VQmd~;CzcA9F@3pDX}Jeaya3j7c_xE}@HpP`=ujvh+gPZRbZ$^T;T z4c}uNhMoLh+>g#MlgVm6eldT_kLCgB>wlcmHw-|}Kc3Rt`_X&*;a%Xp8F^j@z6tEg z-_Yo-;H&;CAD`~!c@OwDu+mrZeGFXvR6f>xNceN$`QU{fe-(TM_*Wi32=0A4A2(A_ z#Q!63{L_%W$3{{be9v$2&(jByPzQdSk018#rT6clXY%o#9!nSRp5M9om;74^9*2MY zk-o=9FU640;BDYLGV#3#JpVvG-tGN+1GwhD^YK+4zYlyfSnCAx{}bTqKjq^qJpJq7 zYr&uN^lyWgR}|vwJ^kn4N5E7wMA)4x#OHg=?V9Kj@b4*q;;#ii zbYvmE#M2jm*H;&8{wjJSczh;)F9q)%Qiy*=IHGrf?;24^@<$2?>RwPt@=pqIqm28T zg#Ab5^#kA=;8)Ks|2_%6HG}U0-vvI?)9(Z4M;79Dd;9=+A9$0;-v`$nSBQH(egb?8 zSUtJ?e+E1Oc{Gwy{xOVBK9Wbefu1SlhJnPZw@)0B`nq zAvhXWh+pgRYH(d9{x1{%DTR0v?SS03gYP>n4ew&`GvJBd{ciC1@rC%Eo?q&c!$4*1%+h-J#^7f&A^xMJnzdtC}NKfs%=c5OY<`6H61*CQ6WCV z)8~VG!5XQFzX7~&enAR046g@20I3hfaG=;ARkIaO>7rbX-O8)@(R&bE-6X5$Y^t-|PGxUAn5u{Iu{|~^+!E=0g zPk^sjP>3(~_!;m4aHq%Wxvxc@-5w7EhmXp~ao~OXLwhwelA`M?&PvPI)PDSR{qO?t zLmBrgz>j3`I`E?zycxVdgSUehlb`CRRo`}ipIlLhF9It)uLeJ~vJh+JFRb?9rd26c zdvJROt39|69P0D+xPKhH$Gca1u)DDkZ}eF0!G7>|k8gy(`J96F?+WiD;N4)2Glf47 zeiZyhkM9HD)l`U^JpML#ex`ix2ZxW+``7*OGvMn>g}BwbuQ(!b(~iM^BzVN8LcHG7 zkLgE00lb0mbS_5ecQW|NO!}S*eky}c2S1a+lfVZuxE35f3V&`tycFDWLE65a1CB3D z`-k)U@oy3SQChw(0O!GUv(_G{y%_{nvZ#I74t-yH>VGfzKxZM|3tj2I3;gKM2E}zX zF21h;-*ZtRKHJmZ48E(o5HIuiZQxsbQu@2WxAhj{m7e}laK5h)_jr64ID8cUuYreV zC;PxE_8!sxp$AG8o zEX3z{`D)ZK`;X*%A$Wc!yvf4&SHpl)NSnZMMo4}8P zPw}`LT=?;zSTkACuLREr*LZwAcmw!!k8cF;1<&;OgTj{<;(D;+^GR^;X>l?>x);15 zgC7Jx0sp%^{|~^|{!^NNPk={UR){xHfaKqA!R;CMIR?gE8GHn|C4-L!Z_D73;ND$@ z__wqJ^6zx;(AN~=RX+Tw;0@r=UrF0Q_$d9Cfp5DyZJ$?z9|vpwO#W>GS6@?z=X-fC z?B~84Jmvagyzd#M?@`eX@Vs{v;`@B~F9*jr6yis`f3E}Y|K~!iy(#(scJTUl7UBfzY1>omqNVF;|IXINuRsmSNZui_`Y|i z?dK1`_td8O_c(aN_>})=;F{A@{0ngOq7**~p8vuW|0lTRrb4WfR+8sw@a{<|{TcA1 z8TWqx-#HGtm%(Ge;iK}Q^1tnKg?I^;ir)*N-wOVm$93SY&lloTeflo}@42%OU+3xPfG7N0 zA^w8L8^BM3wZAC;wu47~G3}2o0p9}tsOP^5yx}g!8=n9FfG@kd5WmLL-v!QpsSqFK z>9>MMe7O+6-{a4M@4TlFKj``I1&5E~_wV4VzFLU2H!FD_0Y7tJA#V2kkAWX0eO?Jx zdHN-|;cJC>ji)~iz6tzNj}L(JUr)!!XaR|?1z+LmDDj9!d?R%~4BQT0>**uGcY$B# z@o4b4`wQ{gJU$hCC-}`CPXsrAGnIEb_-1gBZ!S3c_f)=x;0@rHd-wI=N5P?fHG+dXatUkm<-$L-+7-zvoK@wf*ZK1%Oh;74g+HNH`Md=0qw zJB9c|V5R?Cz}HVp>*u?{S7h+5;HxtDGvIL#7n1q1l~-^W-+T%BweXX@mVfty-;}`* zgWsINKL(GQnTG!~_|X}0JkPr?vIP7L{;PkHyu-jXj})xG5Uv5Q2XFWEN#JWT@}2>{ z2l}0!-T>a6p`Q!B>br$l$M@vl7Vuu^H^8s**9pG%d-SiKemVG-@6-N!|I~lXn;zSI zQ~a-ke$%7$H=chFIRC>!{3(y$55Ds;+H2o_-3Gqq$A$O_Pyal4=i`O=8Bf0t-1YOc zy?zk9CnNt4!RvpSj!%CLz5_hl%agQ&NwJNTENk73h@U$|E1tt!J$4~4PN}) zbbkFd@a^DhLwbRi|E>`0*p>3<)8IY7r~UW%E8x9Gd#p-X9C`5uW}tx&Kqz z9{v#=KB^x_FwiF0hec*-dDbv^$}!S{pz+2a=QeJ2)^_WVLH?>EKY^z?4<6*av3;lBYK`kNPm4}e2?oCR)}T#ToC z{(A6k@N$pO2j2shzAtNEz~Q6(*$(dd1pDF0qw(Cu;Py`sif?9KF8nI+h%cn{YrsRl zl+xb@j%F6)>wWy*3%-6I@c4J)Ur;H)QY& z!HY9^BKXloX?$jaCoC?;m-+C{1m6ta;Bh@TUQ&!d>v0qK9`H3DpAT+cnx@A#@D;pXKSV2XAXA#&>%E{ttNk3fz1A zFW{Zv$2`6TeE!N}vL5>h@QB8u^*>7gFM@9c5BK?VFZiyeVyt}!(Z2-_AC;%)iocKh zo0;D-jAA#YI{E|nnQaBzFAy%$u+)rk>p{Z9!Q)uZo$C2d1>Z8H7;p7>Hh3uO?OIx&9vDXd@fvWrb1wR|;GN9hS9<<; z37=PpU+wXS!MA@bA8Vc@{!fGNWW9WYr{530W2#%v6aD+(`6&h4hfQ>6@1HJx4tL* z3Sr!DweX|pI&h;e|BC_R-n{w57md9JcPpoAA;&CtdCi;(1{$2?l_h2gD8-@LT z;V_Q-?*Z?rDB60t!h0Y14$|*S<{x=2dM5r~2j8>45Z~(a_q*VH8{-Kd{?EZXXB2II zBmWM7_mkg~J-zx^`d|E4d!sZt5&Xzi%x}DZ6T#7IX)h=*!)UMPfJdxy^9lKP7Wl5w z=sfWLt&@BFQ-3J`+Q9dd-UMsuxf^^R=@Zi94dVZ&LOjdUZv^k5Jbc}!|E=IB@b4n; z-@k!%enR6H$#V}lKB^cudiM{250nZqe-_^NFzmUv5Z~hQli;C~((+LG0@f!oO2#(hZN2Jn-l_xYaxJn*Oqtao_a3cfy5A1(*CUs;I1=jqpi zC$L`n7LWfGT>ZLy%(9rJ-|gV>%xAP-r1ZWUJPP_uPk#_RpZ4T>ucK{eaxFzW74#{>bAnP=2O+d_1`33DyIA zdpHezM^)PX*Ms+G+Uu8spSh(F?_<0p|2u_QkDlfI+Xd#?McXeH{mtM#vss_=_32;1 z4{de(VWNKmylBLByMcV_r!g3l*@bBv#{7`Qpp-<%C@pgpHpSpKaC-6)VHDw?-uYK zC#U_}r@#|B3$dnc3jaRvwcmE@i^30s+li0XC)J+*0{jr`ufOp8e+2g)Q;fgi@zJAL z->h}}e{w$ty#Kp-8!rlv2Ty4)#G^g`Ebvo|7qnk2`cm+1?03D`<7V(a+Sdghw}G!+ zk@lY#gD*qA^+u~MXSP!7f|Dklu=Oh0H?|vNk8rmD}2Z=rl+&eMt&+5TlYt!*!3Ec9KTTc^z zw{WIEdjojwo_u@{C0_Kmg4^Fi{qg1fX7KHdHzxS-ZU?VN{wj|@4-V%g<^D^eQ{Mi` z(;os)Cw)SG{s?@_vBh|&r#}rIx|sDcAKxP=*i%k&`^oZeGlwd<_H-qm6~mNACbv zA5n~d=EM6S_^KU+_+OzZeZL59Bz?~H_#yBJ+BX-U>gdPd`~K+8M~VNp;76EWh5Q&a zhVqdepMkqpv)<_an+m>VC*yOE&jde#e2*FCf+P4&#@p}m^b)v%@^Mdvldlup%y_2R z(_aOiaEx2OlRWYr2Oy@^;fZzU&e5`Y8;=dcb_sxY^H@t-(0N-5c z*3*T52tI&(4PL(Afvc~{#~<^!`efR>s$#6WS>it)e8q(Yn=cDb1n;B$J$E;QLV+AIjhRz&q*h>V0^h z0xzciwR(Inc>g7w&+&L4cogxu*}~%}6S$rBcCDx9$*5av)Ba^R__Rmz@jE>IIPm&> zF}}Id$#V*LpFcmT@$6La4Vn4;S>Wc(d}lrQCekO!|59)@?MLW8E&xZbbL$_PKkNWc zK;G-HMpVuwk-y+Sm^|n}5kKwaYYkUNUjyIty?lJ4PtR|I8{U$SkM#0BCVoGDmAp@Z zN46B=%RGPeINBTL&mp}=gX{37wh!;c;O5Nut{EI%lghsl{1p9lXm5JK z*G@>=gI9x3|9n2aI_J{!&EUsR;GtCS|Bc{3eJCG)D(~p;12+(V?RTkue+GO9<-f!8 ze+3-IiyBXUAN)|JJ^U#+#J`6A{VCy>6yoVV{>4*hPtIol*y9tx&(MEg>iwS#j+wuO z@aBVeGhT;`JcFa9a*uqc8K$g&pZHcfpKb-WL;swo?*OyPlk}fggI~;f&d^`J1$-yx z4_n~Zc;vm{hD`rnjS@?A+oa>crIJ@0t%sLc3%0(dv|Ii&9y;B5P~7#!|n42zD5&I3P! ze6Bx>q6@&wmvUazmxoKh)w3=7#QxWRx*U8x?L(;VSA*|hzvIVV{u{y9z91bRejMD+ z_;H1&e*wIQ^a|zUKfv>8F9Q8>@J+O*p}qeNI6l7U$1BxQo`kukgZ(S--wVLia|`hw zJ)QubQqTDuFaJF76U5KS%Nx?*E9kHB*7~>e!7uw-KAz{>&ld5M-Wu>+X`u=YN1lvYz`UPyZ?SwlC!4 zU*sMAY4AO)e>wlFqd})r-ZSIFk>GaPt82Xb@!-3tuME4*|Ha@2%EN~}E`fJ$XTIda z?*NaWK0V^;mxF8mkdH@u`WwJcGQSS2u^)Wb#I!#BM)XX1wT-Gwe|5r(ke~5uSkE{e9CVs0{icE2DG#APs|Vji`%LnY zUq?mj!6RwUzUkxF1%BqpV*ERgF9+|WeLv3Q|J&Nx#7L4{bvzENw1PdXkcDJUYl(w} z*rvO>cIc5UYj&FNlAEe*anj{y!)``&avYy3F@KDgQkF=b!rf z|EBy0zx3McZ#uo-_!aOf@vU$B`!7=d9Q`MM<4f{Bv%i;=lYM&=iTrKKZ$ht!{(VFF z4g8(2d-+?GUq^n8KEDwDg!1+;!5d6i=Jy@S-~C16htB_hO*#Gd77yR2{QEy-{=WWy zp!_53f&Bmc^8LS1{v!MPjJ8t#FUtRhJU{jF|50B4(d5tm9KiZ#-g#|2&-eo6Ir09# z^7iMH_u#XH_a9My20wjM--D+q|5nD23(9{7ev{vK$@m+}Tiz%9_dAsT_s@t2`TBmB z@((`$+Ux)9)Nbm?lZhHATfyE?yk;FODH#e*HYv~SPnB->c>Z+l$@D+F4!I;iE)S4A z2$KJRD+LzCb{p3_62_84faI_Y+3$zdidQi{Cev?x_Vn_T7%9Dfr}X64;|CwV_xwqG z^yI5gKhg#tJ|0`MqwTibm&=p++375_^5={`mQ7r5o2z0QHKRf-hC{GSxU@Jw3!3gA zE{EOjHjV$}qxYxbQ^AH#B^fw9Pa|mR1|8wEBOv6FRM#JV^5C6?q(FswC#$eHVRaAX z&%@aTe`crWr=edRPG;x+AXz1(bQW5xh9*3u>T_#7ztei2TF=k(*7Ni8@S-c)>!PdK zrB&7Sd)?94^^_&UY#qv4r>8YbGA}b#eXigyR~SIn?{c z0J);vE8+7(aWQu?5|iztA}RAUm9%Mgsfne1m0e5qWE>INvL79kBiAkoMufx0mYRte zj;V{SrpT7;#?nF6*k+Cmr<$(p2U4dDb^%G(Xhz#@xq?6JxvSP2)CTfibS0~Y%KNY^ zMfhXakSfKW_pG-~1?f)vjEiEi@s-1iMqy1EZjak$U7@0~7fS9_RxNYzQeQHKf%hojJ87A&~zx<)k9u3+=o zLdYsAMv|IuO7h(7ic09uoSW{J2hDyHmt~7OBFA-Se7A=`x1yjM>FMB4`*PR%`>rqr zr%g!IybL5&w@#Ux@UfJ1n&=G?7=O9yO4Nr8B=6Vg!m&V>d(FNs`pp<9k`{d%`eIeS zy$~ta`8F+ouvBfqm%@~=4>c}DWCIU-ZBk(>X>foDw#xURuR%>xZgO%)6F zv%goA{?H`LX2&o+N&3UKTo;Smct{Vo>EWd|jJu-04hIq|ZB`E-Se2;jGU&|*+J){k zMu6UI8uVS<6xBAYlA3Es^d4(WTM*?7ySXx52IRYHmQ%TI>bhJ{O4eY9{CT(x-{`{SJK=H`F3-c|JY4=-xO@;UABM||(8rqBHfHD%oGsc= zOeND+TMwG4b_n*F6}w^yM|(lFxId?Mv%H-bw4FbvcJsWQ7qp!}r*;>4J1=Ovi%_Ml zFnYt1fsFG7v#W<)f;o-VytF@q{i*Daww?uTG7H*d7PQGMXp@g)9Mx|?KvRjpXa{A1E#839)P4jhPPV>m@3n*&=Y1*1>_&0FTH|lHe@PGe+E_U1Mbk+R;vo<0lT|jY`ECP zV2@dyaW$xXpkgW_-{~=K1R9T}y=Z+QJxv&>EX2;Jh}Gu2IA5-oZsXN^RU*#?likF* zsqG6ZAsTh5SM`bc#8^tdqO98?_}vmbjr-2fs57zKG6(k_PD9g{^=aTfhaMZc#ZXJtIxA_5KB#wL&4JMeq*uUp zyh1740~**K=s7(-0H8>CV}Bd2N-^9`y8)Ev{m%kO69}FbCuV9{t>F3Q1(I5a2HQnU zYG3tzL3azkod_%7PjZ#U*Z@>DFgMBf=opo|ZMgMu2F2t0;X43(15mk32yC)yCRxteNt@>UhX9Cr;hsQ!A_uYE8k11;pD6Zed@dCe&CB6f58+VG*_ zIel*{1^Q^|O4!t)7}Ee$Gh&Ahmz%JV2oOdEq!cy$?z>-o_Vm%?I0Inlw>{q}l#{i_ zYv^J1Hczo~TP&V79VzPi-d6<6EjC@=G54qJ=Dt4TDqjaSE;-BAr4Um#!{t|pDP-{% zXdRy)egqX(vUPKNlB{rrcyw_-QYmqXHG)6Z`12aPfq56#dQ(u|&B_XT{itk!=@9K& z-7_r<9z|!SrsmX4ZA9y7$p(EH;`_h((RqE5qD1em=L>jf5uFv^Y8S#YUAdGec6j8ut#(5v_BaP z2UU@)ytqQ|4e1gnEM2t{f*^r`eY>>V#>cle2un8$R z)oZ~cZV+sqVkzC+dj;0O2C*(hPE6*{9{8e7KM`>*Z-~bD$bw)bM&TkPIwpeBaq?Uh z1Ca#0DB=*Z+*w*&_RV;8nd+)eu&QpT4S@dditd)#3&_#A5+m}bdu{t$?if2@5M$)C zMda!|C0FVRrDGnQIIO}-_F~-41U_|?G;mk$htB2C{Xwi0nBD1ixI@^)Vg%^PJ*-Vq zD8o>sR;kO5_jg8=TPr}{3qj`w|F9rsSFVvxOsGZj1$;({Vf4`N@#AvA<#*AdDg@S|7ZBSsH3sD8@~@51 ze9n&zf;8zcSK6{w!rwNOgmVO8u+I|0Kbl*Lo+|1?PH>vlLbv79Ot^U^;wY4HfAdhdrtfn1=ed_+D~wgPG<7-57JFhxAq3GQZeVu2;5O(mbhxoHraxooEb8QGfq>eHKxbWGqjX-?uC zzDWtIoP|noJ6w^ec(@b3&$mN1b%cWGL<BJifrNpok`+P zRlLp{KAm2tA{W7S`(`^*{b&lkGL&4ZnM|W%l_QrX>6tqUO30_GP*-DYcm;ntMwI2` z`Ydgn?r_3?BSVWk5iHWKe0XAcf;eA6ZD)CFtuq$79pl-UfD(pRhn*lmH=-J6SOIb9 zn=yPSlFd2xnd?Ryl7j}Fp~SlE;z_m%M|&Y*|D3uIzJ3)%PXy1Vo(?*)Dl^n~k!2=| z_ti>f(WjVUa-v7J2mUV0b@HVrI5sKB(Pv8}NiyvW+N+g~@gPE#Z;L~Ow8N7opK!h~ ziyC5y;yX=^6IdoUPUNa4^^-*uj5w?X#S{t6pnI&!EDIAB=Luey7zaK6f3TX7KiTc)lkOew-j{5L=&54+W^y4tBg=$6qQZo z0-U3}c2C!-)=@o!-8D|ouFWZaPyP*A$f>h_s<2Bfn`_S`-)6!`9bpFy_H!M+72dE8 zRKx3!bHtTA;saOi*4A{GVr%1I@xxt|(zxUN#-T+JgiknoJ4H+SkBXF8uuJ!F{`2?v zQJ9UU8q6_hLMmgVXfmo9aBCacJvVfA-~-jiAl5Vyq@fh4;*#cPUwg#e%U}E8gUctM z#82LP^z2F0DPnVic}yPAV*y((;k-uxP+>iOZsvE(>7m~$SLfm!?I9j7wo?mm~_=NZTi ziu*}iP7r4Ny_2p}nU9Dc0Tj;7Hw9;2TA#q69YGj{gjbw1?99(N%|1x{F+%3iNxHA; z9mVGIoropm(-9}HPf44RRgP^k9H}gt!7}st$5Vvma2!WOkJrnBpRX;;K81`FjWSWF zdk+@h;f6`@RLhGVSKiKzWM(FkBMi^T{qbX@LO=_WjLt>uZzOPc@3wVyK-FK-JHS1l z<2A2>Kc#<4Wko^h%2 zj`p_WMVQUkr@vkJk?Brf3t^UK#3oJ`4O9*q6$5y!;mqa zs7uoLv9NEh=fq3c-KpR-3+`FH0+iNzY+^J}`!#u2cJkqZm!b#LQHGtT< Date: Thu, 29 Dec 2005 20:12:45 +0000 Subject: [PATCH 004/811] Removed ran1 and gasdev; replaced igray, sort, and indexx. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@34 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- JT65code_all.f | 1 - fsubs.f | 4 +-- g1 | 2 +- g1.bat | 2 +- gasdev.f | 24 --------------- go | 3 +- igray.c | 18 ++++++++++++ igray.f | 18 ------------ indexx.f | 79 -------------------------------------------------- ran1.f | 28 ------------------ sort.f | 74 ---------------------------------------------- wsjt.py | 2 +- 12 files changed, 24 insertions(+), 231 deletions(-) delete mode 100644 gasdev.f create mode 100644 igray.c delete mode 100644 igray.f delete mode 100644 indexx.f delete mode 100644 ran1.f delete mode 100644 sort.f diff --git a/JT65code_all.f b/JT65code_all.f index 203fb8615..3d81c18a4 100644 --- a/JT65code_all.f +++ b/JT65code_all.f @@ -18,4 +18,3 @@ include 'interleave63.f' include 'graycode.f' include 'set.f' - include 'igray.f' diff --git a/fsubs.f b/fsubs.f index 1b9f369be..a716f12e7 100644 --- a/fsubs.f +++ b/fsubs.f @@ -3,6 +3,7 @@ include 'db.f' include 'pctile.f' include 'sort.f' + include 'ssort.f' include 'ps.f' include 'smooth.f' include 'ping.f' @@ -32,7 +33,6 @@ include 'getsnr.f' include 'graycode.f' include 'grid2k.f' - include 'igray.f' include 'interleave63.f' include 'k2grid.f' include 'limit.f' @@ -57,5 +57,3 @@ include 'xfft.f' include 'wsjt65.f' - include 'gasdev.f' - include 'ran1.f' diff --git a/g1 b/g1 index 8f46b5cfb..3f90097b5 100755 --- a/g1 +++ b/g1 @@ -1 +1 @@ -python f2py.py -c --quiet --opt="-O -cpp -DLinux -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --"f77exec=/home/joe/bin/g95" --f90exec="/home/joe/bin/g95" -L//usr/lib/gcc-lib/i386-redhat-linux/3.2.2/ -lpthread -lg2c only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_linux.c wrapkarn.c start_threads.c cutil.c fivehz.f90 +python f2py.py -c --quiet --opt="-O -cpp -DLinux -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --"f77exec=/home/joe/bin/g95" --f90exec="/home/joe/bin/g95" -L//usr/lib/gcc-lib/i386-redhat-linux/3.2.2/ -lpthread -lg2c only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_linux.c igray.c wrapkarn.c start_threads.c cutil.c fivehz.f90 diff --git a/g1.bat b/g1.bat index 9a0d3cfc1..fe5901011 100644 --- a/g1.bat +++ b/g1.bat @@ -1,2 +1,2 @@ cl /c /DWin32 /Fojtaudio.o jtaudio.c -f2py.py -c --quiet --opt="/traceback /fast /fpp /define:Win32" init_rs.o encode_rs.o decode_rs.o jtaudio.o -lwinmm -lpa -llibsamplerate -m Audio --"fcompiler=compaqv" only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f resample.c ptt.c wrapkarn.c fivehz.f90 +f2py.py -c --quiet --opt="/traceback /fast /fpp /define:Win32" init_rs.o encode_rs.o decode_rs.o jtaudio.o -lwinmm -lpa -llibsamplerate -m Audio --"fcompiler=compaqv" only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f resample.c ptt.c igray.c wrapkarn.c fivehz.f90 diff --git a/gasdev.f b/gasdev.f deleted file mode 100644 index 98b45f49e..000000000 --- a/gasdev.f +++ /dev/null @@ -1,24 +0,0 @@ - FUNCTION gasdev(idum) - INTEGER idum - REAL gasdev -CU USES ran1 - INTEGER iset - REAL fac,gset,rsq,v1,v2,ran1 - SAVE iset,gset - DATA iset/0/ - if (iset.eq.0) then -1 v1=2.*ran1(idum)-1. - v2=2.*ran1(idum)-1. - rsq=v1**2+v2**2 - if(rsq.ge.1..or.rsq.eq.0.)goto 1 - fac=sqrt(-2.*log(rsq)/rsq) - gset=v1*fac - gasdev=v2*fac - iset=1 - else - gasdev=gset - iset=0 - endif - return - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/go b/go index 93e19ecf0..108254c62 100755 --- a/go +++ b/go @@ -1,2 +1,3 @@ gcc -c wrapkarn.c -g95 -o JT65code -fno-second-underscore JT65code_all.f wrapkarn.o init_rs.o encode_rs.o decode_rs.o +gcc -c igray.c +g95 -o JT65code -fno-second-underscore JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o diff --git a/igray.c b/igray.c new file mode 100644 index 000000000..4646898b5 --- /dev/null +++ b/igray.c @@ -0,0 +1,18 @@ +int igray_(int *n0, int *idir) +{ + int n; + unsigned long sh; + unsigned long nn; + n=*n0; + + if(*idir>0) return (n ^ (n >> 1)); + + sh = 1; + nn = (n >> sh); + while (nn > 0) { + n ^= nn; + sh <<= 1; + nn = (n >> sh); + } + return (n); +} diff --git a/igray.f b/igray.f deleted file mode 100644 index 4ec06b8f4..000000000 --- a/igray.f +++ /dev/null @@ -1,18 +0,0 @@ - FUNCTION igray(n,is) - INTEGER igray,is,n - INTEGER idiv,ish - if (is.ge.0) then - igray=ieor(n,n/2) - else - ish=-1 - igray=n -1 continue - idiv=ishft(igray,ish) - igray=ieor(igray,idiv) - if(idiv.le.1.or.ish.eq.-16)return - ish=ish+ish - goto 1 - endif - return - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/indexx.f b/indexx.f deleted file mode 100644 index 3bb048d2d..000000000 --- a/indexx.f +++ /dev/null @@ -1,79 +0,0 @@ - SUBROUTINE indexx(n,arr,indx) - INTEGER n,indx(n),M,NSTACK - REAL arr(n) - PARAMETER (M=7,NSTACK=50) - INTEGER i,indxt,ir,itemp,j,jstack,k,l,istack(NSTACK) - REAL a - do 11 j=1,n - indx(j)=j -11 continue - jstack=0 - l=1 - ir=n -1 if(ir-l.lt.M)then - do 13 j=l+1,ir - indxt=indx(j) - a=arr(indxt) - do 12 i=j-1,1,-1 - if(arr(indx(i)).le.a)goto 2 - indx(i+1)=indx(i) -12 continue - i=0 -2 indx(i+1)=indxt -13 continue - if(jstack.eq.0)return - ir=istack(jstack) - l=istack(jstack-1) - jstack=jstack-2 - else - k=(l+ir)/2 - itemp=indx(k) - indx(k)=indx(l+1) - indx(l+1)=itemp - if(arr(indx(l+1)).gt.arr(indx(ir)))then - itemp=indx(l+1) - indx(l+1)=indx(ir) - indx(ir)=itemp - endif - if(arr(indx(l)).gt.arr(indx(ir)))then - itemp=indx(l) - indx(l)=indx(ir) - indx(ir)=itemp - endif - if(arr(indx(l+1)).gt.arr(indx(l)))then - itemp=indx(l+1) - indx(l+1)=indx(l) - indx(l)=itemp - endif - i=l+1 - j=ir - indxt=indx(l) - a=arr(indxt) -3 continue - i=i+1 - if(arr(indx(i)).lt.a)goto 3 -4 continue - j=j-1 - if(arr(indx(j)).gt.a)goto 4 - if(j.lt.i)goto 5 - itemp=indx(i) - indx(i)=indx(j) - indx(j)=itemp - goto 3 -5 indx(l)=indx(j) - indx(j)=indxt - jstack=jstack+2 - if(jstack.gt.NSTACK)pause 'NSTACK too small in indexx' - if(ir-i+1.ge.j-l)then - istack(jstack)=ir - istack(jstack-1)=i - ir=j-1 - else - istack(jstack)=j-1 - istack(jstack-1)=l - l=i - endif - endif - goto 1 - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/ran1.f b/ran1.f deleted file mode 100644 index 420f1d3db..000000000 --- a/ran1.f +++ /dev/null @@ -1,28 +0,0 @@ - FUNCTION ran1(idum) - INTEGER idum,IA,IM,IQ,IR,NTAB,NDIV - REAL ran1,AM,EPS,RNMX - PARAMETER (IA=16807,IM=2147483647,AM=1./IM,IQ=127773,IR=2836, - *NTAB=32,NDIV=1+(IM-1)/NTAB,EPS=1.2e-7,RNMX=1.-EPS) - INTEGER j,k,iv(NTAB),iy - SAVE iv,iy - DATA iv /NTAB*0/, iy /0/ - if (idum.le.0.or.iy.eq.0) then - idum=max(-idum,1) - do 11 j=NTAB+8,1,-1 - k=idum/IQ - idum=IA*(idum-k*IQ)-IR*k - if (idum.lt.0) idum=idum+IM - if (j.le.NTAB) iv(j)=idum -11 continue - iy=iv(1) - endif - k=idum/IQ - idum=IA*(idum-k*IQ)-IR*k - if (idum.lt.0) idum=idum+IM - j=1+iy/NDIV - iy=iv(j) - iv(j)=idum - ran1=min(AM*iy,RNMX) - return - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/sort.f b/sort.f deleted file mode 100644 index 4983239b9..000000000 --- a/sort.f +++ /dev/null @@ -1,74 +0,0 @@ - SUBROUTINE sort(n,arr) - INTEGER n,M,NSTACK - REAL arr(n) - PARAMETER (M=7,NSTACK=50) - INTEGER i,ir,j,jstack,k,l,istack(NSTACK) - REAL a,temp - jstack=0 - l=1 - ir=n -1 if(ir-l.lt.M)then - do 12 j=l+1,ir - a=arr(j) - do 11 i=j-1,1,-1 - if(arr(i).le.a)goto 2 - arr(i+1)=arr(i) -11 continue - i=0 -2 arr(i+1)=a -12 continue - if(jstack.eq.0)return - ir=istack(jstack) - l=istack(jstack-1) - jstack=jstack-2 - else - k=(l+ir)/2 - temp=arr(k) - arr(k)=arr(l+1) - arr(l+1)=temp - if(arr(l+1).gt.arr(ir))then - temp=arr(l+1) - arr(l+1)=arr(ir) - arr(ir)=temp - endif - if(arr(l).gt.arr(ir))then - temp=arr(l) - arr(l)=arr(ir) - arr(ir)=temp - endif - if(arr(l+1).gt.arr(l))then - temp=arr(l+1) - arr(l+1)=arr(l) - arr(l)=temp - endif - i=l+1 - j=ir - a=arr(l) -3 continue - i=i+1 - if(arr(i).lt.a)goto 3 -4 continue - j=j-1 - if(arr(j).gt.a)goto 4 - if(j.lt.i)goto 5 - temp=arr(i) - arr(i)=arr(j) - arr(j)=temp - goto 3 -5 arr(l)=arr(j) - arr(j)=a - jstack=jstack+2 - if(jstack.gt.NSTACK)pause 'NSTACK too small in sort' - if(ir-i+1.ge.j-l)then - istack(jstack)=ir - istack(jstack-1)=i - ir=j-1 - else - istack(jstack)=j-1 - istack(jstack-1)=l - l=i - endif - endif - goto 1 - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/wsjt.py b/wsjt.py index 1872d0db8..444a400ac 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -# ---------------------------------------------------------- WSJT +# ----------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 7f05b657753d6a0a795b59291530380f27051d6b Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 29 Dec 2005 20:31:33 +0000 Subject: [PATCH 005/811] Added indexx.f git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@35 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- indexx.f | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 indexx.f diff --git a/indexx.f b/indexx.f new file mode 100644 index 000000000..464979742 --- /dev/null +++ b/indexx.f @@ -0,0 +1,19 @@ + subroutine indexx(n,arr,indx) + + parameter (NMAX=2000) + integer indx(n) + real arr(n) + real brr(NMAX) + if(n.gt.NMAX) then + print*,'n=',n,' too big in indexx.' + stop + endif + do i=1,n + brr(i)=arr(i) + indx(i)=i + enddo + call ssort(brr,indx,n,2) + + return + end + From 363d225f78a8d10828f8069b3eeba89df3c12e06 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 29 Dec 2005 20:32:28 +0000 Subject: [PATCH 006/811] Added sort.f, ssort.f git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@36 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- sort.f | 4 + ssort.f | 285 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 289 insertions(+) create mode 100644 sort.f create mode 100644 ssort.f diff --git a/sort.f b/sort.f new file mode 100644 index 000000000..7888b0cfd --- /dev/null +++ b/sort.f @@ -0,0 +1,4 @@ + subroutine sort(n,arr) + call ssort(arr,tmp,n,1) + return + end diff --git a/ssort.f b/ssort.f new file mode 100644 index 000000000..11da51f7a --- /dev/null +++ b/ssort.f @@ -0,0 +1,285 @@ + subroutine ssort (x,y,n,kflag) +c***purpose sort an array and optionally make the same interchanges in +c an auxiliary array. the array may be sorted in increasing +c or decreasing order. a slightly modified quicksort +c algorithm is used. +c +c ssort sorts array x and optionally makes the same interchanges in +c array y. the array x may be sorted in increasing order or +c decreasing order. a slightly modified quicksort algorithm is used. +c +c description of parameters +c x - array of values to be sorted +c y - array to be (optionally) carried along +c n - number of values in array x to be sorted +c kflag - control parameter +c = 2 means sort x in increasing order and carry y along. +c = 1 means sort x in increasing order (ignoring y) +c = -1 means sort x in decreasing order (ignoring y) +c = -2 means sort x in decreasing order and carry y along. + + integer kflag, n + real x(*), y(*) + real r, t, tt, tty, ty + integer i, ij, j, k, kk, l, m, nn + integer il(21), iu(21) + + nn = n + if (nn .lt. 1) then + print *, + + 'the number of values to be sorted is not positive.' + return + endif +c + kk = abs(kflag) + if (kk.ne.1 .and. kk.ne.2) then + print *, + + 'the sort control parameter, k, is not 2, 1, -1, or -2.' + return + endif +c +c alter array x to get decreasing order if needed +c + if (kflag .le. -1) then + do 10 i=1,nn + x(i) = -x(i) + 10 continue + endif +c + if (kk .eq. 2) go to 100 +c +c sort x only +c + m = 1 + i = 1 + j = nn + r = 0.375e0 +c + 20 if (i .eq. j) go to 60 + if (r .le. 0.5898437e0) then + r = r+3.90625e-2 + else + r = r-0.21875e0 + endif +c + 30 k = i +c +c select a central element of the array and save it in location t +c + ij = i + int((j-i)*r) + t = x(ij) +c +c if first element of array is greater than t, interchange with t +c + if (x(i) .gt. t) then + x(ij) = x(i) + x(i) = t + t = x(ij) + endif + l = j +c +c if last element of array is less than than t, interchange with t +c + if (x(j) .lt. t) then + x(ij) = x(j) + x(j) = t + t = x(ij) +c +c if first element of array is greater than t, interchange with t +c + if (x(i) .gt. t) then + x(ij) = x(i) + x(i) = t + t = x(ij) + endif + endif +c +c find an element in the second half of the array which is smaller +c than t +c + 40 l = l-1 + if (x(l) .gt. t) go to 40 +c +c find an element in the first half of the array which is greater +c than t +c + 50 k = k+1 + if (x(k) .lt. t) go to 50 +c +c interchange these elements +c + if (k .le. l) then + tt = x(l) + x(l) = x(k) + x(k) = tt + go to 40 + endif +c +c save upper and lower subscripts of the array yet to be sorted +c + if (l-i .gt. j-k) then + il(m) = i + iu(m) = l + i = k + m = m+1 + else + il(m) = k + iu(m) = j + j = l + m = m+1 + endif + go to 70 +c +c begin again on another portion of the unsorted array +c + 60 m = m-1 + if (m .eq. 0) go to 190 + i = il(m) + j = iu(m) +c + 70 if (j-i .ge. 1) go to 30 + if (i .eq. 1) go to 20 + i = i-1 +c + 80 i = i+1 + if (i .eq. j) go to 60 + t = x(i+1) + if (x(i) .le. t) go to 80 + k = i +c + 90 x(k+1) = x(k) + k = k-1 + if (t .lt. x(k)) go to 90 + x(k+1) = t + go to 80 +c +c sort x and carry y along +c + 100 m = 1 + i = 1 + j = nn + r = 0.375e0 +c + 110 if (i .eq. j) go to 150 + if (r .le. 0.5898437e0) then + r = r+3.90625e-2 + else + r = r-0.21875e0 + endif +c + 120 k = i +c +c select a central element of the array and save it in location t +c + ij = i + int((j-i)*r) + t = x(ij) + ty = y(ij) +c +c if first element of array is greater than t, interchange with t +c + if (x(i) .gt. t) then + x(ij) = x(i) + x(i) = t + t = x(ij) + y(ij) = y(i) + y(i) = ty + ty = y(ij) + endif + l = j +c +c if last element of array is less than t, interchange with t +c + if (x(j) .lt. t) then + x(ij) = x(j) + x(j) = t + t = x(ij) + y(ij) = y(j) + y(j) = ty + ty = y(ij) +c +c if first element of array is greater than t, interchange with t +c + if (x(i) .gt. t) then + x(ij) = x(i) + x(i) = t + t = x(ij) + y(ij) = y(i) + y(i) = ty + ty = y(ij) + endif + endif +c +c find an element in the second half of the array which is smaller +c than t +c + 130 l = l-1 + if (x(l) .gt. t) go to 130 +c +c find an element in the first half of the array which is greater +c than t +c + 140 k = k+1 + if (x(k) .lt. t) go to 140 +c +c interchange these elements +c + if (k .le. l) then + tt = x(l) + x(l) = x(k) + x(k) = tt + tty = y(l) + y(l) = y(k) + y(k) = tty + go to 130 + endif +c +c save upper and lower subscripts of the array yet to be sorted +c + if (l-i .gt. j-k) then + il(m) = i + iu(m) = l + i = k + m = m+1 + else + il(m) = k + iu(m) = j + j = l + m = m+1 + endif + go to 160 +c +c begin again on another portion of the unsorted array +c + 150 m = m-1 + if (m .eq. 0) go to 190 + i = il(m) + j = iu(m) +c + 160 if (j-i .ge. 1) go to 120 + if (i .eq. 1) go to 110 + i = i-1 +c + 170 i = i+1 + if (i .eq. j) go to 150 + t = x(i+1) + ty = y(i+1) + if (x(i) .le. t) go to 170 + k = i +c + 180 x(k+1) = x(k) + y(k+1) = y(k) + k = k-1 + if (t .lt. x(k)) go to 180 + x(k+1) = t + y(k+1) = ty + go to 170 +c +c clean up +c + 190 if (kflag .le. -1) then + do 200 i=1,nn + x(i) = -x(i) + 200 continue + endif + return + end From fd0b90ecb96219e3ebd54d9d3bbc9b7693557579 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 29 Dec 2005 21:07:24 +0000 Subject: [PATCH 007/811] Fixed igray.c to compile on Windows; changed go.bat accordingly. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@37 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- go.bat | 3 ++- igray.c | 4 ++++ wsjt.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/go.bat b/go.bat index 48428a3f7..d999ccad2 100644 --- a/go.bat +++ b/go.bat @@ -2,4 +2,5 @@ cl /c /DBIGSYM=1 /Foinit_rs.obj init_rs.c cl /c /DBIGSYM=1 /Foencode_rs.obj encode_rs.c cl /c /DBIGSYM=1 /Ox /Zd /Fodecode_rs.obj decode_rs.c cl /c /DWIN32=1 wrapkarn.c -df /exe:JT65code.exe JT65code_all.f /link wrapkarn.obj init_rs.obj encode_rs.obj decode_rs.obj +cl /c /DWIN32=1 igray.c +df /exe:JT65code.exe JT65code_all.f /link wrapkarn.obj init_rs.obj encode_rs.obj decode_rs.obj igray.obj diff --git a/igray.c b/igray.c index 4646898b5..e46b4f1f7 100644 --- a/igray.c +++ b/igray.c @@ -1,4 +1,8 @@ +#ifdef WIN32 +extern int __stdcall IGRAY(int *n0, int *idir) +#else int igray_(int *n0, int *idir) +#endif { int n; unsigned long sh; diff --git a/wsjt.py b/wsjt.py index 444a400ac..1872d0db8 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -# ----------------------------------------------------------- WSJT +# ---------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From f42500ecd55749f868d30eddbfc6edf2efc625ac Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 29 Dec 2005 21:29:42 +0000 Subject: [PATCH 008/811] Tweaked spacings on Astrodata window. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@38 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- astro.py | 20 ++++++++++---------- wsjt.py | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/astro.py b/astro.py index 17fd67091..086876c6c 100644 --- a/astro.py +++ b/astro.py @@ -23,22 +23,22 @@ def astro2(t): def update(): t1= " Az El\n" t2= "Moon: %11.2f %6.2f\n" % (g.AzMoon,g.ElMoon) - t3= "Moon/DX: %6.2f %7.2f\n" % (g.AzMoonB,g.ElMoonB) + t3= "Moon/DX: %6.2f %7.2f\n" % (g.AzMoonB,g.ElMoonB) t4= "Sun: %11.2f %6.2f\n" % (g.AzSun,g.ElSun) - t4a="Source: %8.2f %6.2f\n\n" % (g.AzAux,g.ElAux) - t5= " Doppler df/dt\n" - t6= "DX: %6d %7.2f\n" % (g.ndop,g.dfdt) + t4a="Source: %8.2f %6.2f\n\n" % (g.AzAux,g.ElAux) + t5= " Doppler df/dt\n" + t6= "DX: %6d %7.2f\n" % (g.ndop,g.dfdt) t7= "Self: %8d %7.2f\n\n" % (g.ndop00,g.dfdt0) - t7a=" RA DEC\n" + t7a=" RA DEC\n" irah=int(g.RAMoon) iram=int(60.0*(g.RAMoon-irah)) - t7b="Moon: %2.2d:%2.2d %6.2f\n" % (irah,iram,g.DecMoon) + t7b="Moon: %2.2d:%2.2d %7.2f\n" % (irah,iram,g.DecMoon) irah=int(g.RaAux) iram=int(60.0*(g.RaAux-irah)) - t7c="Source: %2.2d:%2.2d %6.2f\n\n" % (irah,iram,g.DecAux) - t8= "Freq: %4d Tsky:%6d\n" % (g.nfreq,g.ntsky) - t9= "MNR: %4.1f Dgrd:%5.1f\n" % (g.MaxNR,g.Dgrd) - t10="DPol: %4d SD:%7.2f\n" % (g.poloffset,g.sd) + t7c="Source: %2.2d:%2.2d %7.2f\n\n" % (irah,iram,g.DecAux) + t8= "Freq: %4d Tsky: %6d\n" % (g.nfreq,g.ntsky) + t9= "MNR: %4.1f Dgrd: %5.1f\n" % (g.MaxNR,g.Dgrd) + t10="DPol: %4d SD: %7.2f\n" % (g.poloffset,g.sd) t=t1+t2+t3+t4+t4a+t5+t6+t7+t7a+t7b+t7c+t8+t9+t10 lab1.configure(text=t) g.astro_geom=root.geometry() diff --git a/wsjt.py b/wsjt.py index 1872d0db8..70612a489 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1212,9 +1212,9 @@ def update(): graph2.delete(ALL) g2font='Arial 16' graph2.create_text(75,13,anchor=CENTER,text="Moon",font=g2font) - graph2.create_text(26,37,anchor=W, text="Az: %9.2f" % g.AzMoon,font=g2font) + graph2.create_text(26,37,anchor=W, text="Az: %8.2f" % g.AzMoon,font=g2font) graph2.create_text(26,61,anchor=W, text="El: %8.2f" % g.ElMoon,font=g2font) - graph2.create_text(26,85,anchor=W, text="Dop: %6d" % g.ndop,font=g2font) + graph2.create_text(26,85,anchor=W, text="Dop: %6d" % g.ndop,font=g2font) graph2.create_text(26,109,anchor=W,text="Dgrd:%8.1f" % g.Dgrd,font=g2font) if g.freeze_decode and mode.get()[:4]=='JT65': @@ -2054,7 +2054,7 @@ f.write("Debug " + str(ndebug.get()) + "\n") #f.write("TRPeriod " + str(Audio.gcom1.trperiod) + "\n") mrudir2=mrudir.replace(" ","#") f.write("MRUDir " + mrudir2 + "\n") -if g.astro_geom[:7]=="200x200": g.astro_geom="242x281" + g.astro_geom[7:] +if g.astro_geom[:7]=="200x200": g.astro_geom="268x423" + g.astro_geom[7:] f.write("AstroGeometry " + g.astro_geom + "\n") f.write("CWTRPeriod " + str(ncwtrperiod) + "\n") f.close() From 682145f8e854a6900ba1bc6fa935a5b438a1d90c Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 30 Dec 2005 01:40:23 +0000 Subject: [PATCH 009/811] Fixed sort of zero-length array in wsjt1. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@39 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ssort.f | 3 +-- wsjt.py | 2 +- wsjt1.f | 34 ++++++++++++++++++---------------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ssort.f b/ssort.f index 11da51f7a..e8cfa462b 100644 --- a/ssort.f +++ b/ssort.f @@ -26,8 +26,7 @@ c = -2 means sort x in decreasing order and carry y along. nn = n if (nn .lt. 1) then - print *, - + 'the number of values to be sorted is not positive.' + print *,'n = ',nn,' kflag = ',kflag,' in ssort.' return endif c diff --git a/wsjt.py b/wsjt.py index 70612a489..e95a49d17 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -# ---------------------------------------------------------- WSJT +#---------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/wsjt1.f b/wsjt1.f index 783e4c765..2eb9f8750 100644 --- a/wsjt1.f +++ b/wsjt1.f @@ -264,24 +264,26 @@ C Now the multi-tone decoding + cfile6,ps0) npkept=nline !Number of pings that were kept - call indexx(npkept,tping,indx) !Merge the ST and MT decodes smax=0. stbest=.false. - do i=1,npkept - j=indx(i) - if(pick .and. STFound .and. - + line(j)(29:31).eq.' ') goto 10 - write(lumsg,1050) line(j) !Write to decoded.txt - 1050 format(a79) - if(lcum) write(21,1050) line(j) !Write to decoded.cum - read(line(j),1060) sig,msg3 - 1060 format(16x,f3.0,9x,a3) - if(sig.gt.smax) then - smax=sig - tbest=tping(j) - stbest = (msg3.ne.' ') - endif - 10 enddo + if(npkept.gt.0) then + call indexx(npkept,tping,indx) !Merge the ST and MT decodes + do i=1,npkept + j=indx(i) + if(pick .and. STFound .and. + + line(j)(29:31).eq.' ') goto 10 + write(lumsg,1050) line(j) !Write to decoded.txt + 1050 format(a79) + if(lcum) write(21,1050) line(j) !Write to decoded.cum + read(line(j),1060) sig,msg3 + 1060 format(16x,f3.0,9x,a3) + if(sig.gt.smax) then + smax=sig + tbest=tping(j) + stbest = (msg3.ne.' ') + endif + 10 enddo + endif dt=1.0/11025.0 !Compute spectrum for pink curve if(stbest) then From 88c5bb9a6db542c49226c55acf2fed070b4a0f54 Mon Sep 17 00:00:00 2001 From: J C Dutton Date: Mon, 2 Jan 2006 00:41:10 +0000 Subject: [PATCH 010/811] Summary: Add first attempt at sound capture. Currently display the trace in specjt, but does not seem to decode it. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@40 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- audio_init.f90 | 6 +- g.py | 3 +- g1 | 6 +- start_threads.c | 419 +++++++++++++++++++++++++++++++++++++++++++++++- wrapkarn.c | 14 ++ wsjt.py | 3 +- 6 files changed, 444 insertions(+), 7 deletions(-) diff --git a/audio_init.f90 b/audio_init.f90 index 5be81d28d..2b1915481 100644 --- a/audio_init.f90 +++ b/audio_init.f90 @@ -58,7 +58,11 @@ subroutine audio_init(ndin,ndout) m3=SetThreadPriority(Thread2,THREAD_PRIORITY_BELOW_NORMAL) m4=ResumeThread(Thread2) #else - call start_threads + print*,'Audio INIT called.' + ierr=start_threads(ndevin,ndevout,y1,y2,nmax,iwrite,iwave,nwave, & + 11025,NSPB,TRPeriod,TxOK,ndebug,Transmitting, & + Tsec,ngo,nmode,tbuf,ibuf,ndsec) + #endif return diff --git a/g.py b/g.py index 1037f1f7e..5bffa113e 100644 --- a/g.py +++ b/g.py @@ -16,7 +16,8 @@ def ftnstr(x): #------------------------------------------------------ filetime def filetime(t): - i=t.rfind(".") +# i=t.rfind(".") + i=6 t=t[:i][-6:] t=t[0:2]+":"+t[2:4]+":"+t[4:6] return t diff --git a/g1 b/g1 index 3f90097b5..38bb0e595 100755 --- a/g1 +++ b/g1 @@ -1 +1,5 @@ -python f2py.py -c --quiet --opt="-O -cpp -DLinux -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --"f77exec=/home/joe/bin/g95" --f90exec="/home/joe/bin/g95" -L//usr/lib/gcc-lib/i386-redhat-linux/3.2.2/ -lpthread -lg2c only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_linux.c igray.c wrapkarn.c start_threads.c cutil.c fivehz.f90 +G95=/usr/bin/g95 +COMPILER=//usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/ +python f2py.py -c --quiet --opt="-O -cpp -DLinux -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --f77exec=$G95 --f90exec=$G95 -L$COMPILER -lpthread -lg2c -lasound only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_linux.c igray.c wrapkarn.c start_threads.c cutil.c fivehz.f90 + + diff --git a/start_threads.c b/start_threads.c index fbd145fa2..bdc963441 100644 --- a/start_threads.c +++ b/start_threads.c @@ -1,15 +1,428 @@ #include #include #include +#include +#include + +#if 0 +#define ALSA_LOG +#define ALSA_LOG_BUFFERS +#endif +#define BUFFER_TIME 2000*1000 + + +typedef struct alsa_driver_s { + snd_pcm_t *audio_fd; + int capabilities; + int open_mode; + int has_pause_resume; + int is_paused; + int32_t output_sample_rate, input_sample_rate; + double sample_rate_factor; + uint32_t num_channels; + uint32_t bits_per_sample; + uint32_t bytes_per_frame; + uint32_t bytes_in_buffer; /* number of bytes writen to audio hardware */ + int16_t *app_buffer_y1; + int16_t *app_buffer_y2; + int *app_buffer_offset; + int app_buffer_length; + snd_pcm_uframes_t buffer_size; + snd_pcm_uframes_t period_size; + int32_t mmap; +} alsa_driver_t; + +alsa_driver_t alsa_driver_playback; +alsa_driver_t alsa_driver_capture; +void *alsa_buffers[2]; + +static snd_output_t *jcd_out; + +/* + * open the audio device for writing to + */ +static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_stream_t direction ) { + alsa_driver_t *this = (alsa_driver_t *) this_gen; + char *pcm_device; + snd_pcm_hw_params_t *params; + snd_pcm_sw_params_t *swparams; + snd_pcm_access_mask_t *mask; + snd_pcm_uframes_t period_size_min; + snd_pcm_uframes_t period_size_max; + snd_pcm_uframes_t buffer_size_min; + snd_pcm_uframes_t buffer_size_max; + snd_pcm_format_t format; + uint32_t buffer_time=BUFFER_TIME; + snd_pcm_uframes_t buffer_time_to_size; + int err, dir; + int open_mode=1; /* NONBLOCK */ + /* int open_mode=0; BLOCK */ + int32_t rate=*input_rate; + this->input_sample_rate=*input_rate; + + snd_pcm_hw_params_alloca(¶ms); + snd_pcm_sw_params_alloca(&swparams); + err = snd_output_stdio_attach(&jcd_out, stdout, 0); + + this->num_channels = 2; + pcm_device="default"; +#ifdef ALSA_LOG + printf("audio_alsa_out: Audio Device name = %s\n",pcm_device); + printf("audio_alsa_out: Number of channels = %d\n",this->num_channels); +#endif + + if (this->audio_fd) { + printf("audio_alsa_out:Already open...WHY!"); + snd_pcm_close (this->audio_fd); + this->audio_fd = NULL; + } + + this->bytes_in_buffer = 0; + /* + * open audio device + */ + err=snd_pcm_open(&this->audio_fd, pcm_device, direction, open_mode); + if(err <0 ) { + printf ("audio_alsa_out: snd_pcm_open() of %s failed: %s\n", pcm_device, snd_strerror(err)); + printf ("audio_alsa_out: >>> check if another program already uses PCM <<<\n"); + return 0; + } + /* printf ("audio_alsa_out: snd_pcm_open() opened %s\n", pcm_device); */ + /* We wanted non blocking open but now put it back to normal */ + //snd_pcm_nonblock(this->audio_fd, 0); + snd_pcm_nonblock(this->audio_fd, 1); + /* + * configure audio device + */ + err = snd_pcm_hw_params_any(this->audio_fd, params); + if (err < 0) { + printf ("audio_alsa_out: broken configuration for this PCM: no configurations available: %s\n"), + snd_strerror(err); + goto close; + } + /* set interleaved access */ + if (this->mmap != 0) { + mask = alloca(snd_pcm_access_mask_sizeof()); + snd_pcm_access_mask_none(mask); + snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_INTERLEAVED); + snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_NONINTERLEAVED); + snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_COMPLEX); + err = snd_pcm_hw_params_set_access_mask(this->audio_fd, params, mask); + if (err < 0) { + printf ( "audio_alsa_out: mmap not availiable, falling back to compatiblity mode\n"); + this->mmap=0; + err = snd_pcm_hw_params_set_access(this->audio_fd, params, + SND_PCM_ACCESS_RW_NONINTERLEAVED); + } + } else { + err = snd_pcm_hw_params_set_access(this->audio_fd, params, + SND_PCM_ACCESS_RW_NONINTERLEAVED); + } + + if (err < 0) { + printf ( "audio_alsa_out: access type not available: %s\n", snd_strerror(err)); + goto close; + } + /* set the sample format S16 */ + /* ALSA automatically appends _LE or _BE depending on the CPU */ + format = SND_PCM_FORMAT_S16; + err = snd_pcm_hw_params_set_format(this->audio_fd, params, format ); + if (err < 0) { + printf ( "audio_alsa_out: sample format non available: %s\n", snd_strerror(err)); + goto close; + } + /* set the number of channels */ + err = snd_pcm_hw_params_set_channels(this->audio_fd, params, this->num_channels); + if (err < 0) { + printf ( "audio_alsa_out: Cannot set number of channels to %d (err=%d:%s)\n", + this->num_channels, err, snd_strerror(err)); + goto close; + } +#if SND_LIB_VERSION >= 0x010009 + /* Restrict a configuration space to contain only real hardware rates */ + err = snd_pcm_hw_params_set_rate_resample(this->audio_fd, params, 0); +#endif + /* set the stream rate [Hz] */ + dir=0; + err = snd_pcm_hw_params_set_rate_near(this->audio_fd, params, &rate, &dir); + if (err < 0) { + printf ( "audio_alsa_out: rate not available: %s\n", snd_strerror(err)); + goto close; + } + this->output_sample_rate = (uint32_t)rate; + if (this->input_sample_rate != this->output_sample_rate) { + printf ( "audio_alsa_out: audio rate : %d requested, %d provided by device/sec\n", + this->input_sample_rate, this->output_sample_rate); + } + buffer_time_to_size = ( (uint64_t)buffer_time * rate) / 1000000; + err = snd_pcm_hw_params_get_buffer_size_min(params, &buffer_size_min); + err = snd_pcm_hw_params_get_buffer_size_max(params, &buffer_size_max); + dir=0; + err = snd_pcm_hw_params_get_period_size_min(params, &period_size_min,&dir); + dir=0; + err = snd_pcm_hw_params_get_period_size_max(params, &period_size_max,&dir); +#ifdef ALSA_LOG_BUFFERS + printf("Buffer size range from %lu to %lu\n",buffer_size_min, buffer_size_max); + printf("Period size range from %lu to %lu\n",period_size_min, period_size_max); + printf("Buffer time size %lu\n",buffer_time_to_size); +#endif + this->buffer_size = buffer_time_to_size; + if (buffer_size_max < this->buffer_size) this->buffer_size = buffer_size_max; + if (buffer_size_min > this->buffer_size) this->buffer_size = buffer_size_min; + this->period_size=this->buffer_size/8; + this->buffer_size = this->period_size*8; +#ifdef ALSA_LOG_BUFFERS + printf("To choose buffer_size = %ld\n",this->buffer_size); + printf("To choose period_size = %ld\n",this->period_size); +#endif + +#if 0 + /* Set period to buffer size ratios at 8 periods to 1 buffer */ + dir=-1; + periods=8; + err = snd_pcm_hw_params_set_periods_near(this->audio_fd, params, &periods ,&dir); + if (err < 0) { + xprintf (this->class->xine, XINE_VERBOSITY_DEBUG, + "audio_alsa_out: unable to set any periods: %s\n", snd_strerror(err)); + goto close; + } + /* set the ring-buffer time [us] (large enough for x us|y samples ...) */ + dir=0; + err = snd_pcm_hw_params_set_buffer_time_near(this->audio_fd, params, &buffer_time, &dir); + if (err < 0) { + xprintf (this->class->xine, XINE_VERBOSITY_DEBUG, + "audio_alsa_out: buffer time not available: %s\n", snd_strerror(err)); + goto close; + } +#endif +#if 1 + /* set the period time [us] (interrupt every x us|y samples ...) */ + dir=0; + err = snd_pcm_hw_params_set_period_size_near(this->audio_fd, params, &(this->period_size), &dir); + if (err < 0) { + printf ( "audio_alsa_out: period time not available: %s\n", snd_strerror(err)); + goto close; + } +#endif + dir=0; + err = snd_pcm_hw_params_get_period_size(params, &(this->period_size), &dir); + + dir=0; + err = snd_pcm_hw_params_set_buffer_size_near(this->audio_fd, params, &(this->buffer_size)); + if (err < 0) { + printf ( "audio_alsa_out: buffer time not available: %s\n", snd_strerror(err)); + goto close; + } + err = snd_pcm_hw_params_get_buffer_size(params, &(this->buffer_size)); +#ifdef ALSA_LOG_BUFFERS + printf("was set period_size = %ld\n",this->period_size); + printf("was set buffer_size = %ld\n",this->buffer_size); +#endif + if (2*this->period_size > this->buffer_size) { + printf ( "audio_alsa_out: buffer to small, could not use\n"); + goto close; + } + + /* write the parameters to device */ + err = snd_pcm_hw_params(this->audio_fd, params); + if (err < 0) { + printf ( "audio_alsa_out: pcm hw_params failed: %s\n", snd_strerror(err)); + goto close; + } + /* Check for pause/resume support */ + this->has_pause_resume = ( snd_pcm_hw_params_can_pause (params) + && snd_pcm_hw_params_can_resume (params) ); + printf( "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume); + this->sample_rate_factor = (double) this->output_sample_rate / (double) this->input_sample_rate; + this->bytes_per_frame = snd_pcm_frames_to_bytes (this->audio_fd, 1); + /* + * audio buffer size handling + */ + /* Copy current parameters into swparams */ + err = snd_pcm_sw_params_current(this->audio_fd, swparams); + if (err < 0) { + printf ( "audio_alsa_out: Unable to determine current swparams: %s\n", snd_strerror(err)); + goto close; + } + /* align all transfers to 1 sample */ + err = snd_pcm_sw_params_set_xfer_align(this->audio_fd, swparams, 1); + if (err < 0) { + printf ( "audio_alsa_out: Unable to set transfer alignment: %s\n", snd_strerror(err)); + goto close; + } + /* allow the transfer when at least period_size samples can be processed */ + err = snd_pcm_sw_params_set_avail_min(this->audio_fd, swparams, this->period_size); + if (err < 0) { + printf ( "audio_alsa_out: Unable to set available min: %s\n", snd_strerror(err)); + goto close; + } + if (direction == SND_PCM_STREAM_PLAYBACK) { + /* start the transfer when the buffer contains at least period_size samples */ + err = snd_pcm_sw_params_set_start_threshold(this->audio_fd, swparams, 0); + } else { + err = snd_pcm_sw_params_set_start_threshold(this->audio_fd, swparams, -1); + } + if (err < 0) { + printf ( "audio_alsa_out: Unable to set start threshold: %s\n", snd_strerror(err)); + goto close; + } + + if (direction == SND_PCM_STREAM_PLAYBACK) { + /* never stop the transfer, even on xruns */ + err = snd_pcm_sw_params_set_stop_threshold(this->audio_fd, swparams, 0); + } else { + err = snd_pcm_sw_params_set_stop_threshold(this->audio_fd, swparams, this->buffer_size); + } + if (err < 0) { + printf ( "audio_alsa_out: Unable to set stop threshold: %s\n", snd_strerror(err)); + goto close; + } + + /* Install swparams into current parameters */ + err = snd_pcm_sw_params(this->audio_fd, swparams); + if (err < 0) { + printf ( "audio_alsa_out: Unable to set swparams: %s\n", snd_strerror(err)); + goto close; + } +#ifdef ALSA_LOG + snd_pcm_dump_setup(this->audio_fd, jcd_out); + snd_pcm_sw_params_dump(swparams, jcd_out); +#endif + + return this->output_sample_rate; + +close: + snd_pcm_close (this->audio_fd); + this->audio_fd=NULL; + return 0; +} + +int playback_callback(alsa_driver_t *alsa_driver_playback) { + alsa_driver_t *this = alsa_driver_playback; + printf("playback callback\n"); + //snd_pcm_writen(this->audio_fd, alsa_buffers, this->period_size); +} + +int capture_callback(alsa_driver_t *alsa_driver_capture) { + alsa_driver_t *this = alsa_driver_capture; + int result; +#ifdef ALSA_LOG + printf("capture callback %d samples\n", this->period_size); +#endif + snd_pcm_status_t *pcm_stat; + snd_pcm_status_alloca(&pcm_stat); +#ifdef ALSA_LOG + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); +#endif + alsa_buffers[0]=this->app_buffer_y1 + *(this->app_buffer_offset); + alsa_buffers[1]=this->app_buffer_y2 + *(this->app_buffer_offset); + result = snd_pcm_readn(this->audio_fd, alsa_buffers, this->period_size); + *(this->app_buffer_offset) += this->period_size; + if ( *this->app_buffer_offset >= this->app_buffer_length ) + this->app_buffer_length=0; /* FIXME: implement proper wrapping */ +#ifdef ALSA_LOG + printf("result=%d\n",result); + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); +#endif +} + +int capture_xrun(alsa_driver_t *alsa_driver_capture) { + alsa_driver_t *this = alsa_driver_capture; + snd_pcm_status_t *pcm_stat; + snd_pcm_status_alloca(&pcm_stat); + printf("capture xrun\n"); + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); +} + +void ao_alsa_loop(void *iarg) { + int playback_nfds; + int capture_nfds; + struct pollfd *pfd; + int nfds; + int capture_index; + unsigned short playback_revents; + unsigned short capture_revents; + playback_nfds = snd_pcm_poll_descriptors_count ( + alsa_driver_playback.audio_fd); + capture_nfds = snd_pcm_poll_descriptors_count ( + alsa_driver_capture.audio_fd); + pfd = (struct pollfd *) malloc (sizeof (struct pollfd) * + (playback_nfds + capture_nfds)); + + nfds=0; +#if 0 + snd_pcm_poll_descriptors (alsa_driver_playback.audio_fd, + &pfd[0], + playback_nfds); + nfds += playback_nfds; +#endif + snd_pcm_poll_descriptors (alsa_driver_capture.audio_fd, + &pfd[nfds], + capture_nfds); + capture_index = nfds; + nfds += capture_nfds; + while(1) { + if (poll (pfd, nfds, 100000) < 0) { + printf("poll failed\n"); + return; + } + //snd_pcm_poll_descriptors_revents(alsa_driver_playback.audio_fd, &pfd[0], playback_nfds, &playback_revents); + snd_pcm_poll_descriptors_revents(alsa_driver_capture.audio_fd, &pfd[capture_index], capture_nfds, &capture_revents); + //if ((playback_revents & POLLERR) || ((capture_revents) & POLLERR)) { + if (((capture_revents) & POLLERR)) { + printf("pollerr\n"); + capture_xrun(&alsa_driver_capture); + return; + } +#if 0 + if (playback_revents & POLLOUT) { + playback_callback(&alsa_driver_playback); + } +#endif + if (capture_revents & POLLIN) { + capture_callback(&alsa_driver_capture); + } + } + + return; +} + extern void decode1_(int *iarg); -void start_threads_(void) +int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], + int *nbuflen, int *iwrite, short iwave[], + int *nwave, int *nfsample, int *nsamperbuf, + int *TRPeriod, int *TxOK, int *ndebug, + int *Transmitting, double *Tsec, int *ngo, int *nmode, + double tbuf[], int *ibuf, int *ndsec) { pthread_t thread1,thread2; int iret1,iret2; int iarg1=1,iarg2=2; + //int32_t rate=11025; + int32_t rate=*nfsample; + alsa_driver_capture.app_buffer_y1=y1; + alsa_driver_capture.app_buffer_y2=y2; + alsa_driver_capture.app_buffer_offset=iwrite; + alsa_driver_capture.app_buffer_length=nsamperbuf; - // iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); - iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); + printf("start threads called\n"); + iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); +/* Open audio card. */ + ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); + ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); + +/* + * Start audio io thread + */ + iret2 = pthread_create(&thread2, NULL, ao_alsa_loop, NULL); + snd_pcm_prepare(alsa_driver_capture.audio_fd); + snd_pcm_start(alsa_driver_capture.audio_fd); + + /* snd_pcm_start */ + //iret2 = pthread_create(&thread2,NULL,a2d_,&iarg2); } diff --git a/wrapkarn.c b/wrapkarn.c index 349a5f7c8..636a95521 100644 --- a/wrapkarn.c +++ b/wrapkarn.c @@ -67,3 +67,17 @@ void rs_decode_(int *recd0, int *era0, int *numera0, int *decoded, int *nerr) *nerr=decode_rs_int(rs,recd,era_pos,numera); for(i=0; i<12; i++) decoded[i]=recd[11-i]; } + + +#ifndef WIN32 +void rs_encode__(int *dgen, int *sent) +{ + rs_encode_(dgen, sent); +} + +void rs_decode__(int *recd0, int *era0, int *numera0, int *decoded, int *nerr) +{ + rs_decode_(recd0, era0, numera0, decoded, nerr); +} +#endif + diff --git a/wsjt.py b/wsjt.py index e95a49d17..0179b23af 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1239,7 +1239,8 @@ def update(): msg4.configure(text=t,bg='red') t=g.ftnstr(Audio.gcom2.decodedfile) - i=t.rfind(".") + i=0 +# i=t.rfind(".") t=t[:i] lab3.configure(text=t) if mode.get() != g.mode or first: From 77cf42de424f498e301ff9f3831cfcf5dbe52789 Mon Sep 17 00:00:00 2001 From: J C Dutton Date: Mon, 2 Jan 2006 01:34:45 +0000 Subject: [PATCH 011/811] Summary: Add in timing code. The captured audio is now decoded. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@41 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/start_threads.c b/start_threads.c index bdc963441..c094e3b89 100644 --- a/start_threads.c +++ b/start_threads.c @@ -3,6 +3,7 @@ #include #include #include +#include #if 0 #define ALSA_LOG @@ -27,6 +28,10 @@ typedef struct alsa_driver_s { int16_t *app_buffer_y2; int *app_buffer_offset; int app_buffer_length; + double *Tsec; + double *tbuf; + int *ibuf; + snd_pcm_uframes_t buffer_size; snd_pcm_uframes_t period_size; int32_t mmap; @@ -301,20 +306,31 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { alsa_driver_t *this = alsa_driver_playback; printf("playback callback\n"); //snd_pcm_writen(this->audio_fd, alsa_buffers, this->period_size); + //fivehztx_(); //Call fortran routine } int capture_callback(alsa_driver_t *alsa_driver_capture) { alsa_driver_t *this = alsa_driver_capture; int result; + struct timeval tv; + double stime; + int ib; #ifdef ALSA_LOG printf("capture callback %d samples\n", this->period_size); #endif +#ifdef ALSA_LOG snd_pcm_status_t *pcm_stat; snd_pcm_status_alloca(&pcm_stat); -#ifdef ALSA_LOG snd_pcm_status(this->audio_fd, pcm_stat); snd_pcm_status_dump(pcm_stat, jcd_out); #endif + gettimeofday(&tv, NULL); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000.0); + ib=*(this->ibuf); + this->tbuf[ib++]=stime; + if(ib>=1024) ib=0; + *(this->ibuf)=ib; + alsa_buffers[0]=this->app_buffer_y1 + *(this->app_buffer_offset); alsa_buffers[1]=this->app_buffer_y2 + *(this->app_buffer_offset); result = snd_pcm_readn(this->audio_fd, alsa_buffers, this->period_size); @@ -326,6 +342,7 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { snd_pcm_status(this->audio_fd, pcm_stat); snd_pcm_status_dump(pcm_stat, jcd_out); #endif + fivehz_(); //Call fortran routine } int capture_xrun(alsa_driver_t *alsa_driver_capture) { @@ -407,7 +424,10 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_capture.app_buffer_y1=y1; alsa_driver_capture.app_buffer_y2=y2; alsa_driver_capture.app_buffer_offset=iwrite; - alsa_driver_capture.app_buffer_length=nsamperbuf; + alsa_driver_capture.app_buffer_length=*nsamperbuf; + alsa_driver_capture.Tsec=Tsec; + alsa_driver_capture.tbuf=tbuf; + alsa_driver_capture.ibuf=ibuf; printf("start threads called\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); From ae261d38b78ce2004e516eb1fcebdc6a1404db82 Mon Sep 17 00:00:00 2001 From: J C Dutton Date: Mon, 2 Jan 2006 02:06:19 +0000 Subject: [PATCH 012/811] Summary: Fix wrap around capture buffer. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@42 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/start_threads.c b/start_threads.c index c094e3b89..6b03c7958 100644 --- a/start_threads.c +++ b/start_threads.c @@ -335,8 +335,8 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { alsa_buffers[1]=this->app_buffer_y2 + *(this->app_buffer_offset); result = snd_pcm_readn(this->audio_fd, alsa_buffers, this->period_size); *(this->app_buffer_offset) += this->period_size; - if ( *this->app_buffer_offset >= this->app_buffer_length ) - this->app_buffer_length=0; /* FIXME: implement proper wrapping */ + if ( *(this->app_buffer_offset) >= this->app_buffer_length ) + *(this->app_buffer_offset)=0; /* FIXME: implement proper wrapping */ #ifdef ALSA_LOG printf("result=%d\n",result); snd_pcm_status(this->audio_fd, pcm_stat); @@ -424,7 +424,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_capture.app_buffer_y1=y1; alsa_driver_capture.app_buffer_y2=y2; alsa_driver_capture.app_buffer_offset=iwrite; - alsa_driver_capture.app_buffer_length=*nsamperbuf; + alsa_driver_capture.app_buffer_length=*nbuflen; alsa_driver_capture.Tsec=Tsec; alsa_driver_capture.tbuf=tbuf; alsa_driver_capture.ibuf=ibuf; From 34caaa937e6f0a9bd46e0d4614c97b7c967dcc46 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 3 Jan 2006 16:33:16 +0000 Subject: [PATCH 013/811] Workaround code for James's problem with the Python rfind method; better error message in ssort.f. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@43 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- g.py | 8 +++++++- ssort.f | 3 ++- wsjt.py | 3 +-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/g.py b/g.py index 5bffa113e..0c5f286be 100644 --- a/g.py +++ b/g.py @@ -17,8 +17,14 @@ def ftnstr(x): #------------------------------------------------------ filetime def filetime(t): # i=t.rfind(".") - i=6 + i=rfnd(t,".") t=t[:i][-6:] t=t[0:2]+":"+t[2:4]+":"+t[4:6] return t +#------------------------------------------------------ rfnd +#Temporary workaround to replace t.rfind(c) +def rfnd(t,c): + for i in range(len(t)-1,0,-1): + if t[i:i+1]==c: return i + return -1 diff --git a/ssort.f b/ssort.f index e8cfa462b..9c4cb8f7a 100644 --- a/ssort.f +++ b/ssort.f @@ -26,7 +26,8 @@ c = -2 means sort x in decreasing order and carry y along. nn = n if (nn .lt. 1) then - print *,'n = ',nn,' kflag = ',kflag,' in ssort.' + print*,'ssort: The number of sort elements is not positive.' + print*,'ssort: n = ',nn,' kflag = ',kflag return endif c diff --git a/wsjt.py b/wsjt.py index 0179b23af..a26545e94 100644 --- a/wsjt.py +++ b/wsjt.py @@ -92,7 +92,6 @@ g.freeze_decode=0 g.mode="" g.ndevin=IntVar() g.ndevout=IntVar() - #------------------------------------------------------ showspecjt def showspecjt(): g.showspecjt=1 @@ -1239,8 +1238,8 @@ def update(): msg4.configure(text=t,bg='red') t=g.ftnstr(Audio.gcom2.decodedfile) - i=0 # i=t.rfind(".") + i=g.rfnd(t,".") t=t[:i] lab3.configure(text=t) if mode.get() != g.mode or first: From 3f2e2fd65ff22222776c33db3ab1a3265e2dc0fa Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 4 Jan 2006 20:10:08 +0000 Subject: [PATCH 014/811] Fixed definition of stime and Tsec in start_threads.c. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@44 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 3 ++- wsjt.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/start_threads.c b/start_threads.c index 6b03c7958..b8d3aac9f 100644 --- a/start_threads.c +++ b/start_threads.c @@ -325,7 +325,8 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { snd_pcm_status_dump(pcm_stat, jcd_out); #endif gettimeofday(&tv, NULL); - stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000.0); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0); + *(this->Tsec)=stime; ib=*(this->ibuf); this->tbuf[ib++]=stime; if(ib>=1024) ib=0; diff --git a/wsjt.py b/wsjt.py index a26545e94..fd5721d88 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#---------------------------------------------------------- WSJT +#----------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 821f4c3b1472aca429f220e4c4d76e2cf478a15f Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 4 Jan 2006 21:02:30 +0000 Subject: [PATCH 015/811] Passed ndsec to capture callback, as required. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@45 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 5 ++++- wsjt.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/start_threads.c b/start_threads.c index b8d3aac9f..2b5f41a9b 100644 --- a/start_threads.c +++ b/start_threads.c @@ -31,6 +31,7 @@ typedef struct alsa_driver_s { double *Tsec; double *tbuf; int *ibuf; + int *ndsec; snd_pcm_uframes_t buffer_size; snd_pcm_uframes_t period_size; @@ -325,7 +326,8 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { snd_pcm_status_dump(pcm_stat, jcd_out); #endif gettimeofday(&tv, NULL); - stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + + *(this->ndsec)*0.1; *(this->Tsec)=stime; ib=*(this->ibuf); this->tbuf[ib++]=stime; @@ -429,6 +431,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_capture.Tsec=Tsec; alsa_driver_capture.tbuf=tbuf; alsa_driver_capture.ibuf=ibuf; + alsa_driver_capture.ndsec=ndsec; printf("start threads called\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); diff --git a/wsjt.py b/wsjt.py index fd5721d88..a26545e94 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#----------------------------------------------------------- WSJT +#---------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 445a0f79856a35437279f663808f36d27a951e1e Mon Sep 17 00:00:00 2001 From: J C Dutton Date: Thu, 5 Jan 2006 00:08:26 +0000 Subject: [PATCH 016/811] Summary: Implements audio playback (TX) for ALSA. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@46 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 146 ++++++++++++++++++++++++++++++++++++------------ wsjt.py | 3 +- 2 files changed, 112 insertions(+), 37 deletions(-) diff --git a/start_threads.c b/start_threads.c index 2b5f41a9b..44cbd5ea9 100644 --- a/start_threads.c +++ b/start_threads.c @@ -5,10 +5,14 @@ #include #include -#if 0 +#if 1 #define ALSA_LOG #define ALSA_LOG_BUFFERS #endif +#if 0 +#define ALSA_PLAYBACK_LOG +#define ALSA_CAPTURE_LOG +#endif #define BUFFER_TIME 2000*1000 @@ -31,7 +35,13 @@ typedef struct alsa_driver_s { double *Tsec; double *tbuf; int *ibuf; - int *ndsec; + int *ndsec; + int *tx_ok; + int tx_starting; + int tx_offset; + int *tr_period; + int *nwave; + int *transmitting; snd_pcm_uframes_t buffer_size; snd_pcm_uframes_t period_size; @@ -40,7 +50,8 @@ typedef struct alsa_driver_s { alsa_driver_t alsa_driver_playback; alsa_driver_t alsa_driver_capture; -void *alsa_buffers[2]; +void *alsa_capture_buffers[2]; +void *alsa_playback_buffers[2]; static snd_output_t *jcd_out; @@ -173,9 +184,13 @@ static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_st printf("Buffer time size %lu\n",buffer_time_to_size); #endif this->buffer_size = buffer_time_to_size; - if (buffer_size_max < this->buffer_size) this->buffer_size = buffer_size_max; - if (buffer_size_min > this->buffer_size) this->buffer_size = buffer_size_min; - this->period_size=this->buffer_size/8; + if (buffer_size_max < this->buffer_size) + this->buffer_size = buffer_size_max; + if (buffer_size_min > this->buffer_size) + this->buffer_size = buffer_size_min; + this->period_size = this->buffer_size/8; + if (this->period_size > 2048) + this->period_size = 2048; this->buffer_size = this->period_size*8; #ifdef ALSA_LOG_BUFFERS printf("To choose buffer_size = %ld\n",this->buffer_size); @@ -264,7 +279,7 @@ static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_st } if (direction == SND_PCM_STREAM_PLAYBACK) { /* start the transfer when the buffer contains at least period_size samples */ - err = snd_pcm_sw_params_set_start_threshold(this->audio_fd, swparams, 0); + err = snd_pcm_sw_params_set_start_threshold(this->audio_fd, swparams, this->buffer_size); } else { err = snd_pcm_sw_params_set_start_threshold(this->audio_fd, swparams, -1); } @@ -275,7 +290,7 @@ static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_st if (direction == SND_PCM_STREAM_PLAYBACK) { /* never stop the transfer, even on xruns */ - err = snd_pcm_sw_params_set_stop_threshold(this->audio_fd, swparams, 0); + err = snd_pcm_sw_params_set_stop_threshold(this->audio_fd, swparams, this->buffer_size); } else { err = snd_pcm_sw_params_set_stop_threshold(this->audio_fd, swparams, this->buffer_size); } @@ -303,11 +318,49 @@ close: return 0; } +int16_t zero_buffer[65536]; + int playback_callback(alsa_driver_t *alsa_driver_playback) { alsa_driver_t *this = alsa_driver_playback; - printf("playback callback\n"); - //snd_pcm_writen(this->audio_fd, alsa_buffers, this->period_size); - //fivehztx_(); //Call fortran routine + int result; + struct timeval tv; + double stime; + int nsec; + int n; +// printf("playback callback\n"); + gettimeofday(&tv, NULL); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0); + *(this->Tsec) = stime; + if(!(this->tx_starting) && (*(this->tx_ok)) ) { + int ic; + nsec = (int)stime; + n = nsec / *(this->tr_period); + ic = (int)(stime - *(this->tr_period) * n) * this->output_sample_rate; + ic = ic % *(this->nwave); + this->tx_offset = ic; + } + this->tx_starting = *(this->tx_ok); + *(this->transmitting) = *(this->tx_ok); + + if(*(this->tx_ok)) { + alsa_playback_buffers[0] = this->app_buffer_y1 + this->tx_offset; + alsa_playback_buffers[1] = this->app_buffer_y1 + this->tx_offset; + } else { + alsa_playback_buffers[0] = zero_buffer; + alsa_playback_buffers[1] = zero_buffer; + } + result = snd_pcm_writen(this->audio_fd, alsa_playback_buffers, this->period_size); + this->tx_offset += this->period_size; + if (result != this->period_size) { + printf("playback writei failed. Expected %d samples, sent only %d\n", this->period_size, result); +#ifdef ALSA_PLAYBACK_LOG + snd_pcm_status_t *pcm_stat; + snd_pcm_status_alloca(&pcm_stat); + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); +#endif + } + fivehztx_(); //Call fortran routine } int capture_callback(alsa_driver_t *alsa_driver_capture) { @@ -316,31 +369,32 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { struct timeval tv; double stime; int ib; -#ifdef ALSA_LOG +#ifdef ALSA_CAPTURE_LOG printf("capture callback %d samples\n", this->period_size); #endif -#ifdef ALSA_LOG +#ifdef ALSA_CAPTURE_LOG snd_pcm_status_t *pcm_stat; snd_pcm_status_alloca(&pcm_stat); snd_pcm_status(this->audio_fd, pcm_stat); snd_pcm_status_dump(pcm_stat, jcd_out); #endif gettimeofday(&tv, NULL); - stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + - *(this->ndsec)*0.1; - *(this->Tsec)=stime; + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + + *(this->ndsec) * 0.1; + *(this->Tsec) = stime; ib=*(this->ibuf); - this->tbuf[ib++]=stime; - if(ib>=1024) ib=0; - *(this->ibuf)=ib; + this->tbuf[ib++] = stime; + if(ib>=1024) + ib = 0; + *(this->ibuf) = ib; - alsa_buffers[0]=this->app_buffer_y1 + *(this->app_buffer_offset); - alsa_buffers[1]=this->app_buffer_y2 + *(this->app_buffer_offset); - result = snd_pcm_readn(this->audio_fd, alsa_buffers, this->period_size); + alsa_capture_buffers[0]=this->app_buffer_y1 + *(this->app_buffer_offset); + alsa_capture_buffers[1]=this->app_buffer_y2 + *(this->app_buffer_offset); + result = snd_pcm_readn(this->audio_fd, alsa_capture_buffers, this->period_size); *(this->app_buffer_offset) += this->period_size; if ( *(this->app_buffer_offset) >= this->app_buffer_length ) *(this->app_buffer_offset)=0; /* FIXME: implement proper wrapping */ -#ifdef ALSA_LOG +#ifdef ALSA_CAPTURE_LOG printf("result=%d\n",result); snd_pcm_status(this->audio_fd, pcm_stat); snd_pcm_status_dump(pcm_stat, jcd_out); @@ -348,6 +402,16 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { fivehz_(); //Call fortran routine } +int playback_xrun(alsa_driver_t *alsa_driver_playback) { + alsa_driver_t *this = alsa_driver_playback; + snd_pcm_status_t *pcm_stat; + snd_pcm_status_alloca(&pcm_stat); + printf("playback xrun\n"); + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); + snd_pcm_prepare(this->audio_fd); +} + int capture_xrun(alsa_driver_t *alsa_driver_capture) { alsa_driver_t *this = alsa_driver_capture; snd_pcm_status_t *pcm_stat; @@ -373,12 +437,10 @@ void ao_alsa_loop(void *iarg) { (playback_nfds + capture_nfds)); nfds=0; -#if 0 snd_pcm_poll_descriptors (alsa_driver_playback.audio_fd, &pfd[0], playback_nfds); nfds += playback_nfds; -#endif snd_pcm_poll_descriptors (alsa_driver_capture.audio_fd, &pfd[nfds], capture_nfds); @@ -389,7 +451,7 @@ void ao_alsa_loop(void *iarg) { printf("poll failed\n"); return; } - //snd_pcm_poll_descriptors_revents(alsa_driver_playback.audio_fd, &pfd[0], playback_nfds, &playback_revents); + snd_pcm_poll_descriptors_revents(alsa_driver_playback.audio_fd, &pfd[0], playback_nfds, &playback_revents); snd_pcm_poll_descriptors_revents(alsa_driver_capture.audio_fd, &pfd[capture_index], capture_nfds, &capture_revents); //if ((playback_revents & POLLERR) || ((capture_revents) & POLLERR)) { if (((capture_revents) & POLLERR)) { @@ -397,11 +459,14 @@ void ao_alsa_loop(void *iarg) { capture_xrun(&alsa_driver_capture); return; } -#if 0 + if (((playback_revents) & POLLERR)) { + printf("pollerr\n"); + playback_xrun(&alsa_driver_capture); + return; + } if (playback_revents & POLLOUT) { playback_callback(&alsa_driver_playback); } -#endif if (capture_revents & POLLIN) { capture_callback(&alsa_driver_capture); } @@ -421,16 +486,23 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], { pthread_t thread1,thread2; int iret1,iret2; - int iarg1=1,iarg2=2; + int iarg1 = 1,iarg2 = 2; //int32_t rate=11025; int32_t rate=*nfsample; - alsa_driver_capture.app_buffer_y1=y1; - alsa_driver_capture.app_buffer_y2=y2; - alsa_driver_capture.app_buffer_offset=iwrite; - alsa_driver_capture.app_buffer_length=*nbuflen; - alsa_driver_capture.Tsec=Tsec; - alsa_driver_capture.tbuf=tbuf; - alsa_driver_capture.ibuf=ibuf; + alsa_driver_capture.app_buffer_y1 = y1; + alsa_driver_capture.app_buffer_y2 = y2; + alsa_driver_capture.app_buffer_offset = iwrite; + alsa_driver_capture.app_buffer_length = *nbuflen; + alsa_driver_capture.Tsec = Tsec; + alsa_driver_capture.tbuf = tbuf; + alsa_driver_capture.ibuf = ibuf; + alsa_driver_capture.ndsec = ndsec; + alsa_driver_playback.Tsec = Tsec; + alsa_driver_playback.app_buffer_y1 = iwave; + alsa_driver_playback.tx_ok = TxOK; + alsa_driver_playback.tr_period = TRPeriod; + alsa_driver_playback.nwave = nwave; + alsa_driver_playback.transmitting = Transmitting; alsa_driver_capture.ndsec=ndsec; printf("start threads called\n"); @@ -445,6 +517,8 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], iret2 = pthread_create(&thread2, NULL, ao_alsa_loop, NULL); snd_pcm_prepare(alsa_driver_capture.audio_fd); snd_pcm_start(alsa_driver_capture.audio_fd); + snd_pcm_prepare(alsa_driver_playback.audio_fd); + //snd_pcm_start(alsa_driver_playback.audio_fd); /* snd_pcm_start */ //iret2 = pthread_create(&thread2,NULL,a2d_,&iarg2); diff --git a/wsjt.py b/wsjt.py index a26545e94..d69c1e85e 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1300,7 +1300,8 @@ def update(): nmsg=int(Audio.gcom2.nmsg) t=g.ftnstr(Audio.gcom2.sending) if t[:3]=="CQ ": nsked.set(0) - t="Transmitting: "+t[:nmsg] +# t="Transmitting: "+t[:nmsg] + t="Transmitting: " # t="Txing: "+t[:nmsg] bgcolor='yellow' if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' From e9817a2c168ff1c6e0706ec891fd4c20ab372d84 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 5 Jan 2006 15:33:56 +0000 Subject: [PATCH 017/811] Fixed several problems in playback_callback (start_threads.c). Reverted to display of full Tx message in status bar (wsjt.py). git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@47 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 27 ++++++++++++++++++++++----- wsjt.py | 4 ++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/start_threads.c b/start_threads.c index 44cbd5ea9..9cada4a3e 100644 --- a/start_threads.c +++ b/start_threads.c @@ -41,6 +41,7 @@ typedef struct alsa_driver_s { int tx_offset; int *tr_period; int *nwave; + int *nmode; int *transmitting; snd_pcm_uframes_t buffer_size; @@ -326,13 +327,16 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { struct timeval tv; double stime; int nsec; - int n; + int i,n; + static int ic; + int16_t b0[2048]; + // printf("playback callback\n"); gettimeofday(&tv, NULL); - stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + + *(this->ndsec) * 0.1; *(this->Tsec) = stime; if(!(this->tx_starting) && (*(this->tx_ok)) ) { - int ic; nsec = (int)stime; n = nsec / *(this->tr_period); ic = (int)(stime - *(this->tr_period) * n) * this->output_sample_rate; @@ -341,10 +345,22 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { } this->tx_starting = *(this->tx_ok); *(this->transmitting) = *(this->tx_ok); - if(*(this->tx_ok)) { + /* alsa_playback_buffers[0] = this->app_buffer_y1 + this->tx_offset; alsa_playback_buffers[1] = this->app_buffer_y1 + this->tx_offset; + */ + alsa_playback_buffers[0] = b0; + alsa_playback_buffers[1] = b0; + for(i=0; iperiod_size; i++) { + b0[i]=this->app_buffer_y1[ic]; + ic++; + if(ic >= *this->nwave) { + ic=ic % *this->nwave; + if(*this->nmode == 2) + *this->tx_ok=0; + } + } } else { alsa_playback_buffers[0] = zero_buffer; alsa_playback_buffers[1] = zero_buffer; @@ -502,8 +518,9 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_playback.tx_ok = TxOK; alsa_driver_playback.tr_period = TRPeriod; alsa_driver_playback.nwave = nwave; + alsa_driver_playback.nmode = nmode; alsa_driver_playback.transmitting = Transmitting; - alsa_driver_capture.ndsec=ndsec; + alsa_driver_playback.ndsec = ndsec; printf("start threads called\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); diff --git a/wsjt.py b/wsjt.py index d69c1e85e..e29f59c40 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1300,8 +1300,8 @@ def update(): nmsg=int(Audio.gcom2.nmsg) t=g.ftnstr(Audio.gcom2.sending) if t[:3]=="CQ ": nsked.set(0) -# t="Transmitting: "+t[:nmsg] - t="Transmitting: " + t="Transmitting: "+t[:nmsg] +# t="Transmitting: " # t="Txing: "+t[:nmsg] bgcolor='yellow' if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' From aae9ccb6d5c217d7dcb9cb90a986a561f9856af2 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 5 Jan 2006 19:39:21 +0000 Subject: [PATCH 018/811] Fleshed out ptt_linux.c to control DTR/RTS lines on serial port. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@48 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_linux.c | 53 ++++++++++++++++++++++++++++++++--------------------- wsjt.py | 2 +- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/ptt_linux.c b/ptt_linux.c index a174cb67b..f0f0c3a6f 100644 --- a/ptt_linux.c +++ b/ptt_linux.c @@ -1,41 +1,52 @@ +#include #include +#include +#include +#include int ptt_(int *nport, int *ntx, int *iptt) { - static int open=0; - char s[10]; - // int i3,i4,i5,i6,i9,i00; + static int nopen=0; + int i; + int fd; + char s[11]; - if(*nport==0) { + if(*nport < 0) { *iptt=*ntx; return(0); } - if(*ntx && (!open)) { - sprintf(s,"COM%d",*nport); - // hFile=CreateFile(TEXT(s),GENERIC_WRITE,0,NULL,OPEN_EXISTING, - // FILE_ATTRIBUTE_NORMAL,NULL); - // if(hFile==INVALID_HANDLE_VALUE) { - // printf("PTT: Cannot open COM port %d.\n",*nport); - // return(1); - // } - open=1; + if(*ntx && (!nopen)) { + sprintf(s,"/dev/ttyS%d",*nport); + //open the device + if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { + fprintf(stderr, "device not found"); + return(1); + } + nopen=1; return(0); } - if(*ntx && open) { - // EscapeCommFunction(hFile,3); - // EscapeCommFunction(hFile,5); + //enable privileges for I/O port controls + if(ioperm(0,0x3ff,1) < 0) { + printf("Cannot set privileges for serial I/O\n"); + return(1); + } + + // ioctl(fd, TIOCMGET, &flags); //get line bits for serial port + + if(*ntx && nopen) { + i = TIOCM_RTS + TIOCM_DTR; + ioctl(fd, TIOCMSET, &i); // Set DTR and RTS *iptt=1; } else { - // EscapeCommFunction(hFile,4); - // EscapeCommFunction(hFile,6); - // EscapeCommFunction(hFile,9); - // i00=CloseHandle(hFile); + i=0; + ioctl(fd, TIOCMSET, &i); + close(fd); *iptt=0; - open=0; + nopen=0; } return(0); } diff --git a/wsjt.py b/wsjt.py index e29f59c40..fb3c16301 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#---------------------------------------------------------- WSJT +#----------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From c909fc794e7c20690a4b08395dc708d04b636a15 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 5 Jan 2006 20:38:27 +0000 Subject: [PATCH 019/811] Corrected logic in ptt_linux.c. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@49 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_linux.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/ptt_linux.c b/ptt_linux.c index f0f0c3a6f..d1dab3ed8 100644 --- a/ptt_linux.c +++ b/ptt_linux.c @@ -7,7 +7,7 @@ int ptt_(int *nport, int *ntx, int *iptt) { static int nopen=0; - int i; + int control = TIOCM_RTS | TIOCM_DTR; int fd; char s[11]; @@ -27,23 +27,15 @@ int ptt_(int *nport, int *ntx, int *iptt) return(0); } - //enable privileges for I/O port controls - if(ioperm(0,0x3ff,1) < 0) { - printf("Cannot set privileges for serial I/O\n"); - return(1); - } - - // ioctl(fd, TIOCMGET, &flags); //get line bits for serial port - if(*ntx && nopen) { - i = TIOCM_RTS + TIOCM_DTR; - ioctl(fd, TIOCMSET, &i); // Set DTR and RTS + // printf("Set DTR/RTS %d %d\n",TIOCMBIS,control); + ioctl(fd, TIOCMBIS, &control); // Set DTR and RTS *iptt=1; } else { - i=0; - ioctl(fd, TIOCMSET, &i); + // printf("Clear DTR/RTS %d %d\n",TIOCMBIC,control); + ioctl(fd, TIOCMBIC, &control); close(fd); *iptt=0; nopen=0; From 948327b4aacb2e505bb6db0c390e85359631e65f Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 6 Jan 2006 16:06:57 +0000 Subject: [PATCH 020/811] More tweaking of fonts; fix NMAX in indexx.f; increase latency in jtaudio.c. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@50 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- astro.py | 2 +- indexx.f | 2 +- jtaudio.c | 5 ++--- specjt.py | 2 +- wsjt.py | 27 +++++++++++++-------------- wsjtrc | 7 ++++--- 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/astro.py b/astro.py index 086876c6c..f92fcb8fd 100644 --- a/astro.py +++ b/astro.py @@ -44,7 +44,7 @@ def update(): g.astro_geom=root.geometry() frame.after(1000,update) -lab1=Label(frame,font=('Arial 16'),justify=LEFT,bg="#66FFFF", +lab1=Label(frame,font=('Helvetica 16'),justify=LEFT,bg="#66FFFF", relief=RIDGE,bd=4,anchor=N) lab1.pack(ipadx=4) diff --git a/indexx.f b/indexx.f index 464979742..df2a5330e 100644 --- a/indexx.f +++ b/indexx.f @@ -1,6 +1,6 @@ subroutine indexx(n,arr,indx) - parameter (NMAX=2000) + parameter (NMAX=3000) integer indx(n) real arr(n) real brr(NMAX) diff --git a/jtaudio.c b/jtaudio.c index cd40513f0..741ac1b8d 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -146,7 +146,6 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, // ic = framesPerBuffer*ic; ic = (int)(stime - *data->trperiod*n) * data->nfs; ic = ic % *data->nwave; - // printf("%d\n",ic); } TxOKz=*data->TxOK; @@ -224,7 +223,7 @@ int jtaudio_(int *ndevin, int *ndevout, short y1[], short y2[], inputParameters.device=*ndevin; inputParameters.channelCount=2; inputParameters.sampleFormat=paInt16; - inputParameters.suggestedLatency=0.5; + inputParameters.suggestedLatency=1.0; inputParameters.hostApiSpecificStreamInfo=NULL; err2=Pa_OpenStream( &instream, //address of stream @@ -244,7 +243,7 @@ int jtaudio_(int *ndevin, int *ndevout, short y1[], short y2[], outputParameters.device=*ndevout; outputParameters.channelCount=2; outputParameters.sampleFormat=paInt16; - outputParameters.suggestedLatency=0.5; + outputParameters.suggestedLatency=1.0; outputParameters.hostApiSpecificStreamInfo=NULL; err2a=Pa_OpenStream( &outstream, //address of stream diff --git a/specjt.py b/specjt.py index 5a14c49ed..c2bd63b45 100644 --- a/specjt.py +++ b/specjt.py @@ -414,7 +414,7 @@ sc2.pack(side=LEFT) balloon.bind(sc1,"Brightness", "Brightness") balloon.bind(sc2,"Contrast", "Contrast") balloon.configure(statuscommand=status.helpmessage) -ltime=Label(iframe2,bg='black',fg='yellow',width=8,bd=2,font=('Arial',16)) +ltime=Label(iframe2,bg='black',fg='yellow',width=8,bd=2,font=('Helvetica',16)) ltime.pack(side=LEFT) msg1=Label(iframe2,padx=2,bd=2,text=" ") msg1.pack(side=LEFT) diff --git a/wsjt.py b/wsjt.py index fb3c16301..7409f6ca9 100644 --- a/wsjt.py +++ b/wsjt.py @@ -48,7 +48,6 @@ font1='Helvetica' font2='Helvetica' #font1=('MS', 'Sans', 'Serif') #font2=('MS', 'Sans', 'Serif') -font3='Courier' hiscall="" hisgrid="" isec0=-99 @@ -478,7 +477,7 @@ def ModeFSK441(event=NONE): mode.set("FSK441") cleartext() Audio.gcom1.trperiod=30 - lab2.configure(text='FileID T Width dB Rpt DF') + lab2.configure(text='FileID T Width dB Rpt DF') lab1.configure(text='Time (s)',bg="green") lab4.configure(fg='black') lab5.configure(fg='black') @@ -507,7 +506,7 @@ def ModeFSK441(event=NONE): def ModeJT65(): global slabel,isync,isync65,textheight,itol cleartext() - lab2.configure(text='FileID Sync dB DT DF W') + lab2.configure(text='FileID Sync dB DT DF W') lab4.configure(fg='gray85') lab5.configure(fg='gray85') Audio.gcom1.trperiod=60 @@ -560,7 +559,7 @@ def ModeJT6M(event=NONE): if lauto: toggleauto() cleartext() ModeFSK441() - lab2.configure(text='FileID T Width dB DF') + lab2.configure(text='FileID T Width dB DF') mode.set("JT6M") isync=isync6m lsync.configure(text=slabel+str(isync)) @@ -1209,7 +1208,7 @@ def update(): if mode.get()[:4]=='JT65' or mode.get()[:2]=='CW' : graph2.delete(ALL) - g2font='Arial 16' + g2font='Helvetica 16' graph2.create_text(75,13,anchor=CENTER,text="Moon",font=g2font) graph2.create_text(26,37,anchor=W, text="Az: %8.2f" % g.AzMoon,font=g2font) graph2.create_text(26,61,anchor=W, text="El: %8.2f" % g.ElMoon,font=g2font) @@ -1584,7 +1583,7 @@ iframe2.pack(expand=1, fill=X, padx=4) #-------------------------------------------------------- Decoded text iframe4 = Frame(frame, bd=1, relief=SUNKEN) -text=Text(iframe4, height=6, width =90, font=(font3,9)) +text=Text(iframe4, height=6, width=80) text.bind('',dbl_click_text) text.bind('',dbl_click_text) @@ -1649,7 +1648,7 @@ sb.pack(side=RIGHT, fill=Y) text.configure(yscrollcommand=sb.set) iframe4.pack(expand=1, fill=X, padx=4) iframe4b = Frame(frame, bd=1, relief=SUNKEN) -avetext=Text(iframe4b, height=2, width =90, font=(font3,9)) +avetext=Text(iframe4b, height=2, width=80) #avetext.bind('', lambda e: "break") avetext.bind('',dbl_click_ave) avetext.bind('',dbl_click_ave) @@ -1790,43 +1789,43 @@ auto.grid(column=0,row=5,sticky='EW',padx=4) #txstop.grid(column=0,row=6,sticky='EW',padx=4) ntx=IntVar() -tx1=Entry(f5c,width=28, font=(font2,9)) +tx1=Entry(f5c,width=22, font=(font2,9)) rb1=Radiobutton(f5c,value=1,variable=ntx) b1=Button(f5c, text='Tx1',underline=2,command=btx1,padx=1,pady=1) tx1.grid(column=1,row=0) rb1.grid(column=2,row=0) b1.grid(column=3,row=0) -tx2=Entry(f5c,width=28, font=(font2,9)) -#tx2=Entry(f5c,width=28, font=('helvetica',9)) +tx2=Entry(f5c,width=22, font=(font2,9)) +#tx2=Entry(f5c,width=22, font=('helvetica',9)) rb2=Radiobutton(f5c,value=2,variable=ntx) b2=Button(f5c, text='Tx2',underline=2,command=btx2,padx=1,pady=1) tx2.grid(column=1,row=1) rb2.grid(column=2,row=1) b2.grid(column=3,row=1) -tx3=Entry(f5c,width=28, font=(font2,9)) +tx3=Entry(f5c,width=22, font=(font2,9)) rb3=Radiobutton(f5c,value=3,variable=ntx) b3=Button(f5c, text='Tx3',underline=2,command=btx3,padx=1,pady=1) tx3.grid(column=1,row=2) rb3.grid(column=2,row=2) b3.grid(column=3,row=2) -tx4=Entry(f5c,width=28, font=(font2,9)) +tx4=Entry(f5c,width=22, font=(font2,9)) rb4=Radiobutton(f5c,value=4,variable=ntx) b4=Button(f5c, text='Tx4',underline=2,command=btx4,padx=1,pady=1) tx4.grid(column=1,row=3) rb4.grid(column=2,row=3) b4.grid(column=3,row=3) -tx5=Entry(f5c,width=28, font=(font2,9)) +tx5=Entry(f5c,width=22, font=(font2,9)) rb5=Radiobutton(f5c,value=5,variable=ntx) b5=Button(f5c, text='Tx5',underline=2,command=btx5,padx=1,pady=1) tx5.grid(column=1,row=4) rb5.grid(column=2,row=4) b5.grid(column=3,row=4) -tx6=Entry(f5c,width=28, font=(font2,9)) +tx6=Entry(f5c,width=22, font=(font2,9)) rb6=Radiobutton(f5c,value=6,variable=ntx) b6=Button(f5c, text='Tx6',underline=2,command=btx6,padx=1,pady=1) tx6.grid(column=1,row=5) diff --git a/wsjtrc b/wsjtrc index 8122164ce..878089ec8 100644 --- a/wsjtrc +++ b/wsjtrc @@ -1,7 +1,8 @@ -*font: Arial 8 -*Label*font: Arial 8 +*font: Arial 9 +*Label*font: Arial 9 +*Text*font: "Courier New" 10 *background: gray85 *Text*background: white *Entry*background: white -*foregouund: black +*foreground: black *Listbox*foreground: RoyalBlue From 5d7a297dca6eecd64af3371d8932b1e58e77d574 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 6 Jan 2006 16:45:05 +0000 Subject: [PATCH 021/811] Will I ever be happy with the fonts? git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@51 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 38 +++++++++++++++++--------------------- wsjtrc | 6 +++--- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/wsjt.py b/wsjt.py index 7409f6ca9..51ab328d0 100644 --- a/wsjt.py +++ b/wsjt.py @@ -45,9 +45,6 @@ lauto=0 cmap0="Linrad" fileopened="" font1='Helvetica' -font2='Helvetica' -#font1=('MS', 'Sans', 'Serif') -#font2=('MS', 'Sans', 'Serif') hiscall="" hisgrid="" isec0=-99 @@ -621,10 +618,10 @@ an EME Echo mode for measuring your own echoes from the moon. WSJT is Copyright (c) 2001-2005 by Joseph H. Taylor, Jr., K1JT, and is licensed under the GNU General Public License (GPL). """ - Label(about,text=t,font=(font1,9),justify=LEFT).pack(padx=20) + Label(about,text=t,justify=LEFT).pack(padx=20) t="Revision date: " + \ "$Date$"[7:-1] - Label(about,text=t,font=(font1,9)).pack(padx=20) + Label(about,text=t,justify=LEFT).pack(padx=20) about.focus_set() #------------------------------------------------------ shortcuts @@ -665,7 +662,7 @@ Alt-S Stop Monitoring or Decoding Alt-V Save Last Alt-X Exclude """ - Label(scwid,text=t,font=(font2,9),justify=LEFT).pack(padx=20) + Label(scwid,text=t,justify=LEFT).pack(padx=20) scwid.focus_set() #------------------------------------------------------ mouse_commands @@ -690,7 +687,7 @@ text area Right-double-click also sets Auto ON Sync, Clip, Left/Right click to increase/decrease Tol, ... """ - Label(scwid,text=t,font=(font2,9),justify=LEFT).pack(padx=20) + Label(scwid,text=t,justify=LEFT).pack(padx=20) scwid.focus_set() #------------------------------------------------------ what2send @@ -727,7 +724,7 @@ know this, so it is conventional to send 73 to signify that you are done. (Sending grid locators is conventional in JT65, but numerical signal reports may be substituted.) """ - Label(screenf5,text=t,font=(font1,10),justify=LEFT).pack(padx=20) + Label(screenf5,text=t,justify=LEFT).pack(padx=20) screenf5.focus_set() #------------------------------------------------------ azdist @@ -1699,22 +1696,22 @@ iframe5 = Frame(frame, bd=1, relief=FLAT,height=180) f5a=Frame(iframe5,height=170,bd=2,relief=GROOVE) labToRadio=Label(f5a,text='To radio:', width=9, relief=FLAT) labToRadio.grid(column=0,row=0) -ToRadio=Entry(f5a,width=9,font=(font2,9)) +ToRadio=Entry(f5a,width=9) ToRadio.insert(0,'W8WN') ToRadio.grid(column=1,row=0,pady=3) bLookup=Button(f5a, text='Lookup',underline=0,command=lookup,padx=1,pady=1) bLookup.grid(column=2,row=0,sticky='EW',padx=4) labGrid=Label(f5a,text='Grid:', width=9, relief=FLAT) labGrid.grid(column=0,row=1) -HisGrid=Entry(f5a,width=9,font=(font2,9)) +HisGrid=Entry(f5a,width=9) HisGrid.grid(column=1,row=1,pady=1) bAdd=Button(f5a, text='Add',command=addtodb,padx=1,pady=1) bAdd.grid(column=2,row=1,sticky='EW',padx=4) -labAz=Label(f5a,text='Az 257 El 15',width=11) +labAz=Label(f5a,text='Az 257 El 15',width=11,font=(font1,9)) labAz.grid(column=1,row=2) -labHotAB=Label(f5a,bg='#FFCCFF',text='HotA: 247') +labHotAB=Label(f5a,bg='#FFCCFF',text='HotA: 247',font=(font1,9)) labHotAB.grid(column=0,row=2,sticky='EW',padx=4,pady=3) -labDist=Label(f5a,text='16753 km') +labDist=Label(f5a,text='16753 km',font=(font1,9)) labDist.grid(column=2,row=2) #------------------------------------------------------ Date and Time @@ -1767,7 +1764,7 @@ f5c=Frame(iframe5,bd=2,relief=GROOVE) txfirst=Checkbutton(f5c,text='Tx First',justify=RIGHT,variable=TxFirst) f5c2=Frame(f5c,bd=0) labreport=Label(f5c2,text='Rpt',width=4) -report=Entry(f5c2, width=4, font=(font2,10)) +report=Entry(f5c2, width=4) report.insert(0,'26') labreport.pack(side=RIGHT,expand=1,fill=BOTH) report.pack(side=RIGHT,expand=1,fill=BOTH) @@ -1789,43 +1786,42 @@ auto.grid(column=0,row=5,sticky='EW',padx=4) #txstop.grid(column=0,row=6,sticky='EW',padx=4) ntx=IntVar() -tx1=Entry(f5c,width=22, font=(font2,9)) +tx1=Entry(f5c,width=24) rb1=Radiobutton(f5c,value=1,variable=ntx) b1=Button(f5c, text='Tx1',underline=2,command=btx1,padx=1,pady=1) tx1.grid(column=1,row=0) rb1.grid(column=2,row=0) b1.grid(column=3,row=0) -tx2=Entry(f5c,width=22, font=(font2,9)) -#tx2=Entry(f5c,width=22, font=('helvetica',9)) +tx2=Entry(f5c,width=24) rb2=Radiobutton(f5c,value=2,variable=ntx) b2=Button(f5c, text='Tx2',underline=2,command=btx2,padx=1,pady=1) tx2.grid(column=1,row=1) rb2.grid(column=2,row=1) b2.grid(column=3,row=1) -tx3=Entry(f5c,width=22, font=(font2,9)) +tx3=Entry(f5c,width=24) rb3=Radiobutton(f5c,value=3,variable=ntx) b3=Button(f5c, text='Tx3',underline=2,command=btx3,padx=1,pady=1) tx3.grid(column=1,row=2) rb3.grid(column=2,row=2) b3.grid(column=3,row=2) -tx4=Entry(f5c,width=22, font=(font2,9)) +tx4=Entry(f5c,width=24) rb4=Radiobutton(f5c,value=4,variable=ntx) b4=Button(f5c, text='Tx4',underline=2,command=btx4,padx=1,pady=1) tx4.grid(column=1,row=3) rb4.grid(column=2,row=3) b4.grid(column=3,row=3) -tx5=Entry(f5c,width=22, font=(font2,9)) +tx5=Entry(f5c,width=24) rb5=Radiobutton(f5c,value=5,variable=ntx) b5=Button(f5c, text='Tx5',underline=2,command=btx5,padx=1,pady=1) tx5.grid(column=1,row=4) rb5.grid(column=2,row=4) b5.grid(column=3,row=4) -tx6=Entry(f5c,width=22, font=(font2,9)) +tx6=Entry(f5c,width=24) rb6=Radiobutton(f5c,value=6,variable=ntx) b6=Button(f5c, text='Tx6',underline=2,command=btx6,padx=1,pady=1) tx6.grid(column=1,row=5) diff --git a/wsjtrc b/wsjtrc index 878089ec8..10eb58d93 100644 --- a/wsjtrc +++ b/wsjtrc @@ -1,6 +1,6 @@ -*font: Arial 9 -*Label*font: Arial 9 -*Text*font: "Courier New" 10 +*font: Arial 11 +*Label*font: Arial 11 +*Text*font: "Courier New" 12 *background: gray85 *Text*background: white *Entry*background: white From d5ac2ce57cb6335a02964cd5d61f6621a1731c84 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 6 Jan 2006 16:53:57 +0000 Subject: [PATCH 022/811] Added wsjtrc.win, configuration file for Windows. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@52 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 19 +++++++++++++------ wsjtrc.win | 8 ++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 wsjtrc.win diff --git a/wsjt.py b/wsjt.py index 51ab328d0..7ecd85cf6 100644 --- a/wsjt.py +++ b/wsjt.py @@ -19,15 +19,22 @@ print "WSJT Version " + Version + ", by K1JT" print "Revision date: " + \ "$Date$"[7:-1] print "Run date: " + time.asctime(time.gmtime()) + " UTC" -try: - root.option_readfile('wsjtrc') -except: - pass -root_geom="" #See if we are running in Windows g.Win32=0 -if sys.platform=="win32": g.Win32=1 +if sys.platform=="win32": + g.Win32=1 + try: + root.option_readfile('wsjtrc.win') + except: + pass +else: + try: + root.option_readfile('wsjtrc') + except: + pass +root_geom="" + #------------------------------------------------------ Global variables appdir=os.getcwd() diff --git a/wsjtrc.win b/wsjtrc.win new file mode 100644 index 000000000..878089ec8 --- /dev/null +++ b/wsjtrc.win @@ -0,0 +1,8 @@ +*font: Arial 9 +*Label*font: Arial 9 +*Text*font: "Courier New" 10 +*background: gray85 +*Text*background: white +*Entry*background: white +*foreground: black +*Listbox*foreground: RoyalBlue From 84ed1eb1f65bc1ae6da57ea0da526d34e1dfc9d7 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 6 Jan 2006 21:02:19 +0000 Subject: [PATCH 023/811] Removed redundancy in fsubs.f. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@53 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- fsubs.f | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fsubs.f b/fsubs.f index a716f12e7..3acd9d2de 100644 --- a/fsubs.f +++ b/fsubs.f @@ -18,12 +18,10 @@ include 'encode65.f' include 'extract.f' include 'flat1.f' - -#ifdef Win32 ! include 'four2a.f' !Multi-threading problems with FFTW3 include 'four2.f' -#else - include 'four2.f' + +#ifndef Win32 include 'rfile2.f' #endif From e99746d70c8011175524b5a1d2a7ea30e0a712a5 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 6 Jan 2006 21:04:14 +0000 Subject: [PATCH 024/811] Fixed readout of average messages: needed flush(12) in wsjt65. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@54 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt65.f | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/wsjt65.f b/wsjt65.f index 23f403153..3505b4cbb 100644 --- a/wsjt65.f +++ b/wsjt65.f @@ -25,7 +25,6 @@ C already been done. integer itf(2,9) include 'avecom.h' common/avecom2/f0a - common/tmp3/nsync2,nsnr2,nstest2,line,ave1,ave2 data first/.true./,ns10/0/,ns20/0/ data itf/0,0, 1,0, -1,0, 0,-1, 0,1, 1,-1, 1,1, -1,-1, -1,1/ save @@ -184,7 +183,7 @@ C Write decoded msg unless this is an "Exclude" request: + ns1,ncount1) if(nsave.ge.1) call avemsg65(2,mode65,ndepth,avemsg2,nused2, + ns2,ncount2) - + C Write the average line if(ns1.ge.1 .and. ns1.ne.ns10) then if(ns1.lt.10) write(ave1,1021) cfile6,1,nused1,ns1,avemsg1 @@ -217,16 +216,12 @@ C If Monitor segment #2 is available, write that line also endif write(12,1011) ave1 write(12,1011) ave2 + call flushqqq(12) 800 if(lumsg.ne.6) end file 11 f0a=f0 900 continue -C### test only - nsync2=nsync - nsnr2=nsnr - nstest2=nstest - return end From d07751007a85c81a31c23ef887e70b7967a948c0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 6 Jan 2006 22:03:35 +0000 Subject: [PATCH 025/811] Clear PTT in ftn_init. F10 to show SpecJT screen. Alt-F to toggle Freeze. Erase when changing modes. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@55 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ftn_init.f90 | 1 + wsjt.py | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ftn_init.f90 b/ftn_init.f90 index 3836da408..c2107bbf2 100644 --- a/ftn_init.f90 +++ b/ftn_init.f90 @@ -24,6 +24,7 @@ subroutine ftn_init include 'gcom3.f90' include 'gcom4.f90' + i=ptt(nport,0,iptt) !Clear the PTT line addpfx=' ' do i=80,1,-1 diff --git a/wsjt.py b/wsjt.py index 7ecd85cf6..c6889a15c 100644 --- a/wsjt.py +++ b/wsjt.py @@ -96,7 +96,7 @@ g.mode="" g.ndevin=IntVar() g.ndevout=IntVar() #------------------------------------------------------ showspecjt -def showspecjt(): +def showspecjt(event=NONE): g.showspecjt=1 #------------------------------------------------------ restart @@ -109,6 +109,10 @@ def restart2(): Audio.gcom2.shok=ShOK.get() Audio.gcom2.nrestart=1 +#------------------------------------------------------ toggle_freeze +def toggle_freeze(event=NONE): + nfreeze.set(1-nfreeze.get()) + #------------------------------------------------------ btx (1-6) def btx1(event=NONE): ntx.set(1) @@ -505,6 +509,7 @@ def ModeFSK441(event=NONE): inctol() ntx.set(1) GenStdMsgs() + erase() #------------------------------------------------------ ModeJT65 def ModeJT65(): @@ -533,6 +538,7 @@ def ModeJT65(): inctol() ntx.set(1) GenStdMsgs() + erase() # graph2.pack_forget() #------------------------------------------------------ ModeJT65A @@ -572,6 +578,7 @@ def ModeJT6M(event=NONE): inctol() ntx.set(1) GenStdMsgs() + erase() #------------------------------------------------------ ModeCW @@ -592,6 +599,7 @@ def ModeCW(event=NONE): report.configure(state=NORMAL) ntx.set(1) GenStdMsgs() + erase() #------------------------------------------------------ ModeEcho def ModeEcho(event=NONE): @@ -653,10 +661,12 @@ Shift-F8 Set JT65B mode CTRL-F8 Set JT65C mode Shift-CTRL-F8 Set CW mode F9 Set EME Echo mode +F10 Display waterfall screen Alt-1 to Alt-6 Tx1 to Tx6 Alt-A Toggle Auto On/Off Alt-D Decode Alt-E Erase +Alt-F Toggle Freeze Alt-G Generate Standard Messages Alt-I Include Alt-L Lookup @@ -1607,6 +1617,7 @@ root.bind_all('', ModeJT65C) root.bind_all('', ModeJT6M) root.bind_all('', ModeCW) root.bind_all('', ModeEcho) +root.bind_all('', showspecjt) root.bind_all('',btx1) root.bind_all('',btx2) @@ -1623,6 +1634,8 @@ root.bind_all('',decode) root.bind_all('',decode) root.bind_all('',erase) root.bind_all('',erase) +root.bind_all('',toggle_freeze) +root.bind_all('',toggle_freeze) root.bind_all('',GenStdMsgs) root.bind_all('',GenStdMsgs) root.bind_all('',decode_include) From 8a3e4eb784c9ce683ed498fd0b9ac5a5ed6c6c9b Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 7 Jan 2006 16:48:20 +0000 Subject: [PATCH 026/811] - initial cut at a portable ptt module for all unix and unix like systems It will be refined later on for OSX/Solaris etc. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@56 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_unix.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 ptt_unix.c diff --git a/ptt_unix.c b/ptt_unix.c new file mode 100644 index 000000000..7894d84de --- /dev/null +++ b/ptt_unix.c @@ -0,0 +1,69 @@ +/* + * WSJT is Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, + * and is licensed under the GNU General Public License (GPL). + */ + +#include +#include +#include +#include + +#if (defined(__unix__) || defined(unix)) && !defined(USG) +#include +#endif + +/* First cut, note that this only distinguishes Linux from BSDs, + * it will be done better later on using configure. N.B. that OSX + * will come up as BSD but I think this is also the right serial port + * for OSX. -db + */ +#if defined(BSD) +#define TTYNAME "/dev/ttyd%d" +#else +#include +#define TTYNAME "/dev/ttyS%d" +#endif + +/* Not quite right for size but '%d + 1' should be plenty enough -db */ +#define TTYNAME_SIZE sizeof(TTYNAME)+1 + +int ptt_(int *nport, int *ntx, int *iptt) +{ + static int nopen=0; + int control = TIOCM_RTS | TIOCM_DTR; + int fd; + char s[TTYNAME_SIZE]; + + if(*nport < 0) { + *iptt=*ntx; + return(0); + } + + if(*ntx && (!nopen)) { + snprintf(s, TTYNAME_SIZE, TTYNAME, *nport); + s[TTYNAME_SIZE] = '\0'; + + //open the device + if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { + fprintf(stderr, "device not found"); + return(1); + } + nopen=1; + return(0); + } + + if(*ntx && nopen) { + // printf("Set DTR/RTS %d %d\n",TIOCMBIS,control); + ioctl(fd, TIOCMBIS, &control); // Set DTR and RTS + *iptt=1; + } + + else { + // printf("Clear DTR/RTS %d %d\n",TIOCMBIC,control); + ioctl(fd, TIOCMBIC, &control); + close(fd); + *iptt=0; + nopen=0; + } + return(0); +} From c6e3d2ec9ac84d4edde32080f6294d7a61dbcd84 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 7 Jan 2006 16:51:20 +0000 Subject: [PATCH 027/811] - first cut at a general Makefile for WSJT, it is *not* production quality Still a lot of re-factoring to do with the .o etc. (Reviewed and tested by Joe) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@57 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 12076406b..42f3f154b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,23 @@ -gcc = CC -FC = g77 +# +# This part all goes away when configure is written +# +gcc ?= CC +CC ?= cc +FC ?= f77 +FC ?= g77 FFLAGS = -O -Wall -fbounds-check +OS=FreeBSD +G95=/usr/local/bin/g95 +COMPILER=/usr/local/lib/gcc-lib/i386-unknown-freebsd5.4/4.0.1/ +#OS=Linux +#G95=/usr/bin/g95 +#COMPILER=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/ + +PYTHON ?= python +F2PY = "f2py.py" +# done to about here (when configure is written) + OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \ unpackgrid.o deg2grid.o packdxcc.o chkmsg.o getpfx1.o \ @@ -9,10 +25,31 @@ OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ igray.o init_rs_int.o encode_rs_int.o decode_rs_int.o \ wrapkarn.o +OBJS0= init_rs.o encode_rs.o decode_rs.o +SRCS0= init_rs.c encode_rs.c decode_rs.c + +JT65SRCS = JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o + +#all: JT65code all: JT65code -JT65code: $(OBJS1) - $(FC) -o JT65code $(OBJS1) +#Audio.so + +JT65code_demo: $(OBJS1) + $(FC) -o JT65code_demo $(OBJS1) + +# $(OBJS0) regenerated by Audio.so target for now +JT65code: Audio.so wrapkarn.o igray.o $(JT65SRCS) # $(OBJS0) + $(FC) -o JT65code $(JT65SRCS) + +wrapkarn.o: wrapkarn.c + $(CC) -c wrapkarn.c + +igray.o: igray.c + $(CC) -c igray.c + +$(OBJS0): $(SRCS0) + $(CC) -c -DBIGSYM=1 $(SRCS0) init_rs_int.o: init_rs.c $(CC) -c -DBIGSYM=1 -o init_rs_int.o init_rs.c @@ -23,7 +60,19 @@ encode_rs_int.o: encode_rs.c decode_rs_int.o: decode_rs.c $(CC) -c -DBIGSYM=1 -o decode_rs_int.o decode_rs.c +Audio.so: $(OBJS0) + ${PYTHON} ${F2PY} -c --quiet --opt="-O -cpp -D${OS} \ + -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio \ + --f77exec=${G95} --f90exec=${G95} -L${COMPILER} -lpthread -lg2c \ + only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 \ + : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ + blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ + ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ + i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ + wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f \ + jtaudio.c ptt_unix.c igray.c wrapkarn.c start_threads.c cutil.c \ + fivehz.f90 .PHONY : clean clean: - -rm *.o JT65code + rm -f *.o *.so JT65code JT65code_demo From 2c36b84bb51ce54e036b7809e9db8241f47cb851 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 7 Jan 2006 20:14:23 +0000 Subject: [PATCH 028/811] - Add first rough cut of configure Note that Makefile should go since it should be rebuilt from Makefile.in by configure. - start_threads now has HAVE_ALSA_ALSASOUND_H - ptt_unix now uses configure HAVE_SYS_PARAM_H Initial *non production* commit I am a little rusty with it, sorry. --db git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@58 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile | 28 +- conf.h.in | 48 + configure | 5091 +++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 167 ++ cutil.c | 11 +- g1 | 6 +- go | 2 +- ptt_unix.c | 3 +- start_threads.c | 19 +- 9 files changed, 5348 insertions(+), 27 deletions(-) create mode 100644 conf.h.in create mode 100755 configure create mode 100644 configure.ac diff --git a/Makefile b/Makefile index 42f3f154b..e9ae17e48 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,25 @@ # # This part all goes away when configure is written +# working on it --db # -gcc ?= CC -CC ?= cc +CC ?= gcc FC ?= f77 -FC ?= g77 -FFLAGS = -O -Wall -fbounds-check +FFLAGS = -g -O2 +# +# WSJT specific Fortran flags +FFLAGS += -Wall -fbounds-check OS=FreeBSD + G95=/usr/local/bin/g95 COMPILER=/usr/local/lib/gcc-lib/i386-unknown-freebsd5.4/4.0.1/ #OS=Linux -#G95=/usr/bin/g95 #COMPILER=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/ -PYTHON ?= python -F2PY = "f2py.py" -# done to about here (when configure is written) +PYTHON ?= /usr/local/bin/python +RM ?= /bin/rm +F2PY = /usr/local/bin/f2py +F2PY_PY = "f2py.py" OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \ @@ -30,11 +33,8 @@ SRCS0= init_rs.c encode_rs.c decode_rs.c JT65SRCS = JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o -#all: JT65code all: JT65code -#Audio.so - JT65code_demo: $(OBJS1) $(FC) -o JT65code_demo $(OBJS1) @@ -61,7 +61,7 @@ decode_rs_int.o: decode_rs.c $(CC) -c -DBIGSYM=1 -o decode_rs_int.o decode_rs.c Audio.so: $(OBJS0) - ${PYTHON} ${F2PY} -c --quiet --opt="-O -cpp -D${OS} \ + ${PYTHON} ${F2PY_PY} -c --quiet --opt="-O -cpp -D${OS} \ -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio \ --f77exec=${G95} --f90exec=${G95} -L${COMPILER} -lpthread -lg2c \ only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 \ @@ -70,9 +70,9 @@ Audio.so: $(OBJS0) ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f \ - jtaudio.c ptt_unix.c igray.c wrapkarn.c start_threads.c cutil.c \ + jtaudio.c ptt_bsd.c igray.c wrapkarn.c start_threads.c cutil.c \ fivehz.f90 .PHONY : clean clean: - rm -f *.o *.so JT65code JT65code_demo + ${RM} -f *.o *.so JT65code JT65code_demo diff --git a/conf.h.in b/conf.h.in new file mode 100644 index 000000000..526ea70a8 --- /dev/null +++ b/conf.h.in @@ -0,0 +1,48 @@ +/* setup.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if string.h may be included along with strings.h */ +#undef STRING_WITH_STRINGS + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif + +/* This is needed to use strtok_r on Solaris. */ +#undef __EXTENSIONS__ + + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `long long' if does not define. */ +#undef int64_t + +/* If system does not define sa_family_t, define it here. */ +#undef sa_family_t + +/* If we don't have a real socklen_t, unsigned int is good enough. */ +#undef socklen_t + +/* If system does not define u_int16_t, define a usable substitute. */ +#undef u_int16_t + +/* If system does not define u_int32_t, define to unsigned long int here. */ +#undef u_int32_t + +/* Define to `unsigned long long' if does not define. */ +#undef uint64_t + +#undef HAVE_ALSA_ALSASOUND_H +#undef HAVE_SYS_SOUNDCARD_H +#undef HAVE_AUDIOFILE_H diff --git a/configure b/configure new file mode 100755 index 000000000..ba9d2cc3a --- /dev/null +++ b/configure @@ -0,0 +1,5091 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.53 for wsjt 0.9. +# +# $Id: $ +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Name of the executable. +as_me=`(basename "$0") 2>/dev/null || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + 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=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # 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 before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, 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 + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='wsjt' +PACKAGE_TARNAME='wsjt' +PACKAGE_VERSION='0.9' +PACKAGE_STRING='wsjt 0.9' +PACKAGE_BUGREPORT='' + +ac_default_prefix=/usr/local/ +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -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 ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# 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 + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + 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 + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# 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 wsjt 0.9 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 \`..'] + +_ACEOF + + cat <<_ACEOF +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] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --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] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of wsjt 0.9:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-clobber Don't preserve old binaries on make install + --enable-assert Enable assert(). + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + CPP 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 +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style 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 + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +wsjt configure 0.9 +generated by GNU Autoconf 2.53 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. + +$Id: $ +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by wsjt $as_me 0.9, which was +generated by GNU Autoconf 2.53. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +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` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&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. +# Also quote any args containing shell meta-characters. +ac_configure_args= +ac_sep= +for ac_arg +do + case $ac_arg in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n ) continue ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +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, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf 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 -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >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 explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +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 + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +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 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`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 + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +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_config_headers="$ac_config_headers conf.h" + + + + +OLD_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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +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 + set dummy "$as_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# 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. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&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' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + 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 + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + 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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$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 +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +$ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext 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 + +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_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 f77 xlf cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:2074:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. +ac_save_ext=$ac_ext +ac_ext=F +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_f77_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$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 "$G77" = yes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "$G77" = yes; then + FFLAGS="-O2" + else + FFLAGS= + 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 + + +CFLAGS="$OLD_CFLAGS" + +echo "$as_me:$LINENO: checking uname -s for Cygwin, Solaris or HPUX" >&5 +echo $ECHO_N "checking uname -s for Cygwin, Solaris or HPUX... $ECHO_C" >&6 +case `uname -s` in + CYGWIN*) + echo "$as_me:$LINENO: result: Cygwin" >&5 +echo "${ECHO_T}Cygwin" >&6 + CYGWIN=yes + ;; + SunOS*) + echo "$as_me:$LINENO: result: SunOS or Solaris" >&5 +echo "${ECHO_T}SunOS or Solaris" >&6 + +cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; +esac + +if test "$ac_cv_c_compiler_gnu" = yes; then + echo "$as_me:$LINENO: checking if $CC is Apple GCC" >&5 +echo $ECHO_N "checking if $CC is Apple GCC... $ECHO_C" >&6 + + if expr "`$CC -v 2>&1 | tail -1`" : ".*Apple" >/dev/null; then + AppleGCC=yes + else + AppleGCC=no + fi + + echo "$as_me:$LINENO: result: $AppleGCC" >&5 +echo "${ECHO_T}$AppleGCC" >&6 + + WSJT_CFLAGS="$WSJT_CFLAGS -Wall -O0" +fi + +if test "$ac_cv_prog_cc_g" = yes; then + WSJT_CFLAGS="$WSJT_CFLAGS -g" +fi + +if test ! -z "$CFLAGS"; then + WSJT_CFLAGS="$WSJT_CFLAGS $CFLAGS" +fi + + +echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 +if test "${ac_cv_search_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_strerror=no +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_strerror="none required" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_strerror" = no; then + for ac_lib in cposix; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_strerror="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6 +if test "$ac_cv_search_strerror" != no; then + test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" + +fi + +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include +#include +/* 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; +} +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; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#ifndef __cplusplus +static $ac_kw int static_foo () {return 0; } +$ac_kw int foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_inline=$ac_kw; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 +case $ac_cv_c_inline in + inline | yes) ;; + no) +cat >>confdefs.h <<\_ACEOF +#define inline +_ACEOF + ;; + *) cat >>confdefs.h <<_ACEOF +#define inline $ac_cv_c_inline +_ACEOF + ;; +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 +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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 + echo $ECHO_N "(cached) $ECHO_C" >&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. + # 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 +#line $LINENO "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat 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 non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat 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 +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$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. + # 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 +#line $LINENO "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat 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 non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat 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 + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&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 $ac_cv_c_compiler_gnu = yes; then + echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="${MAKE}"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# 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" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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/* | \ + /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 $as_executable_p "$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 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$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' + +# Extract the first word of "rm", so it can be a program name with args. +set dummy rm; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_RM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $RM in + [\\/]* | ?:[\\/]*) + ac_cv_path_RM="$RM" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +RM=$ac_cv_path_RM + +if test -n "$RM"; then + echo "$as_me:$LINENO: result: $RM" >&5 +echo "${ECHO_T}$RM" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "cp", so it can be a program name with args. +set dummy cp; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $CP in + [\\/]* | ?:[\\/]*) + ac_cv_path_CP="$CP" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +CP=$ac_cv_path_CP + +if test -n "$CP"; then + echo "$as_me:$LINENO: result: $CP" >&5 +echo "${ECHO_T}$CP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "mv", so it can be a program name with args. +set dummy mv; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MV+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MV in + [\\/]* | ?:[\\/]*) + ac_cv_path_MV="$MV" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +MV=$ac_cv_path_MV + +if test -n "$MV"; then + echo "$as_me:$LINENO: result: $MV" >&5 +echo "${ECHO_T}$MV" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "ln", so it can be a program name with args. +set dummy ln; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_LN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $LN in + [\\/]* | ?:[\\/]*) + ac_cv_path_LN="$LN" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +LN=$ac_cv_path_LN + +if test -n "$LN"; then + echo "$as_me:$LINENO: result: $LN" >&5 +echo "${ECHO_T}$LN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "sed", so it can be a program name with args. +set dummy sed; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SED in + [\\/]* | ?:[\\/]*) + ac_cv_path_SED="$SED" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +SED=$ac_cv_path_SED + +if test -n "$SED"; then + echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $AR in + [\\/]* | ?:[\\/]*) + ac_cv_path_AR="$AR" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +AR=$ac_cv_path_AR + +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "ld", so it can be a program name with args. +set dummy ld; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $LD in + [\\/]* | ?:[\\/]*) + ac_cv_path_LD="$LD" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LD="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +LD=$ac_cv_path_LD + +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "test", so it can be a program name with args. +set dummy test; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_TEST+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $TEST in + [\\/]* | ?:[\\/]*) + ac_cv_path_TEST="$TEST" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_TEST="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_TEST" && ac_cv_path_TEST="test" + ;; +esac +fi +TEST=$ac_cv_path_TEST + +if test -n "$TEST"; then + echo "$as_me:$LINENO: result: $TEST" >&5 +echo "${ECHO_T}$TEST" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "python", so it can be a program name with args. +set dummy python; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PYTHON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON + +if test -n "$PYTHON"; then + echo "$as_me:$LINENO: result: $PYTHON" >&5 +echo "${ECHO_T}$PYTHON" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "f2py", so it can be a program name with args. +set dummy f2py; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_F2PY+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $F2PY in + [\\/]* | ?:[\\/]*) + ac_cv_path_F2PY="$F2PY" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_F2PY="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +F2PY=$ac_cv_path_F2PY + +if test -n "$F2PY"; then + echo "$as_me:$LINENO: result: $F2PY" >&5 +echo "${ECHO_T}$F2PY" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "g95", so it can be a program name with args. +set dummy g95; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_G95+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $G95 in + [\\/]* | ?:[\\/]*) + ac_cv_path_G95="$G95" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_G95="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +G95=$ac_cv_path_G95 + +if test -n "$G95"; then + echo "$as_me:$LINENO: result: $G95" >&5 +echo "${ECHO_T}$G95" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err 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 +#line $LINENO "configure" +#include "confdefs.h" +#include + +_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 +#line $LINENO "configure" +#include "confdefs.h" +#include + +_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 +#line $LINENO "configure" +#include "confdefs.h" +#include +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + + + + + + + + +for ac_header in crypt.h inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h link.h sys/soundcard.h linux/soundcard.h alsa/alsasound.h audiofile.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +if test "$libexecdir" = '${exec_prefix}/libexec' && + test "$localstatedir" = '${prefix}/var'; then + libexecdir='${bindir}' + localstatedir='${prefix}' +fi + +echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 +echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6 +if test "${gcc_cv_header_string+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#include + #include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gcc_cv_header_string=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +gcc_cv_header_string=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 +echo "${ECHO_T}$gcc_cv_header_string" >&6 + +if test "$gcc_cv_header_string" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define STRING_WITH_STRINGS 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_bigendian=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianess by grep'ing values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if fgrep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if fgrep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianess +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianess +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + + +if test "${ac_cv_header_stdarg_h+set}" = set; then + echo "$as_me:$LINENO: checking for stdarg.h" >&5 +echo $ECHO_N "checking for stdarg.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdarg_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdarg_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdarg_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking stdarg.h usability" >&5 +echo $ECHO_N "checking stdarg.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking stdarg.h presence" >&5 +echo $ECHO_N "checking stdarg.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: stdarg.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdarg.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdarg.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for stdarg.h" >&5 +echo $ECHO_N "checking for stdarg.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdarg_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdarg_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdarg_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdarg_h" >&6 + +fi +if test $ac_cv_header_stdarg_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: ** stdarg.h could not be found - wsjt will not compile without it **" >&5 +echo "$as_me: error: ** stdarg.h could not be found - wsjt will not compile without it **" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + +# Check whether --enable-clobber or --disable-clobber was given. +if test "${enable_clobber+set}" = set; then + enableval="$enable_clobber" + clobber=$enableval +else + clobber=no +fi; + +if test "$clobber" = yes; then + CLOBBER=yes + +fi + +# Check whether --enable-assert or --disable-assert was given. +if test "${enable_assert+set}" = set; then + enableval="$enable_assert" + assert=$enableval +else + assert=no +fi; + +if test "$assert" = no; then + +cat >>confdefs.h <<\_ACEOF +#define NDEBUG 1 +_ACEOF + +fi + + + +if test "$prefix" = "NONE"; then + +cat >>confdefs.h <<_ACEOF +#define WSJT_PREFIX "$ac_default_prefix" +_ACEOF + + +else + + + prefix=`echo $prefix | sed 's/\/$//'` + +cat >>confdefs.h <<_ACEOF +#define WSJT_PREFIX "$prefix" +_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 overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $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 +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Name of the executable. +as_me=`(basename "$0") 2>/dev/null || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + 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=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # 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 before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, 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 + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by wsjt $as_me 0.9, which was +generated by GNU Autoconf 2.53. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +wsjt config.status 0.9 +configured by $0, generated by GNU Autoconf 2.53, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" + exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "conf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS conf.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +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 +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@F77@,$F77,;t t +s,@FFLAGS@,$FFLAGS,;t t +s,@ac_ct_F77@,$ac_ct_F77,;t t +s,@CPP@,$CPP,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@RM@,$RM,;t t +s,@CP@,$CP,;t t +s,@MV@,$MV,;t t +s,@LN@,$LN,;t t +s,@SED@,$SED,;t t +s,@AR@,$AR,;t t +s,@LD@,$LD,;t t +s,@TEST@,$TEST,;t t +s,@PYTHON@,$PYTHON,;t t +s,@F2PY@,$F2PY,;t t +s,@G95@,$G95,;t t +s,@SNPRINTF_C@,$SNPRINTF_C,;t t +s,@CLOBBER@,$CLOBBER,;t t +s,@WSJT_CFLAGS@,$WSJT_CFLAGS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac +done; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #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. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # egrep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # 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. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac +done; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# 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=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || 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 + + +echo +echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" +echo + +echo "Installing into: $prefix" + +echo diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000..703e27cf0 --- /dev/null +++ b/configure.ac @@ -0,0 +1,167 @@ +dnl $Id$ +dnl Process this file with autoconf to produce a configure script. + + +dnl AC_PREREQ(2.59) + +dnl Sneaky way to get an Id tag into the configure script +AC_COPYRIGHT([$Id$]) + +AC_INIT([wsjt],[0.9]) + +AC_CONFIG_HEADER(conf.h) + +AC_PREFIX_DEFAULT(/usr/local/) + +OLD_CFLAGS="$CFLAGS" +dnl Checks for programs. +AC_PROG_CC +AC_LANG(C) +AC_PROG_F77 + +dnl Make sure autoconf doesn't interfere with cflags -jmallett +CFLAGS="$OLD_CFLAGS" + +AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX]) +case `uname -s` in + CYGWIN*) + AC_MSG_RESULT(Cygwin) + CYGWIN=yes + ;; + SunOS*) + AC_MSG_RESULT(SunOS or Solaris) + AC_DEFINE(__EXTENSIONS__, 1, [This is needed to use strtok_r on Solaris.]) + ;; + *) + AC_MSG_RESULT(no) + ;; +esac + +if test "$ac_cv_c_compiler_gnu" = yes; then + AC_MSG_CHECKING(if $CC is Apple GCC) + + if expr "`$CC -v 2>&1 | tail -1`" : ".*Apple" >/dev/null; then + AppleGCC=yes + else + AppleGCC=no + fi + + AC_MSG_RESULT($AppleGCC) + + WSJT_CFLAGS="$WSJT_CFLAGS -Wall -O0" +fi + +dnl If we support -g, use it! +if test "$ac_cv_prog_cc_g" = yes; then + WSJT_CFLAGS="$WSJT_CFLAGS -g" +fi + +dnl jdc -- If CFLAGS is defined, best use it everywhere... +dnl NOTE: jv says it must be added to the *END*, because things like +dnl "gcc -O9 -O2" will result in -O2 getting preference. How stupid. +if test ! -z "$CFLAGS"; then + WSJT_CFLAGS="$WSJT_CFLAGS $CFLAGS" +fi + +AC_ISC_POSIX +AC_C_INLINE +AC_PROG_GCC_TRADITIONAL +AC_PROG_MAKE_SET +AC_PROG_INSTALL +AC_PATH_PROG(RM, rm) +AC_PATH_PROG(CP, cp) +AC_PATH_PROG(MV, mv) +AC_PATH_PROG(LN, ln) +AC_PATH_PROG(SED, sed) +AC_PATH_PROG(AR, ar) +AC_PATH_PROG(LD, ld) +AC_PATH_PROG(TEST, [test], [test]) +AC_PATH_PROG(PYTHON, python) +AC_PATH_PROG(F2PY, f2py) +AC_PATH_PROG(G95, g95) + +dnl Checks for header files. +AC_HEADER_STDC + +AC_CHECK_HEADERS([crypt.h inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h link.h sys/soundcard.h linux/soundcard.h alsa/alsasound.h audiofile.h]) + +dnl use directory structure of cached as default (hack) +if test "$libexecdir" = '${exec_prefix}/libexec' && + test "$localstatedir" = '${prefix}/var'; then + libexecdir='${bindir}' + localstatedir='${prefix}' +fi + +dnl See whether we can include both string.h and strings.h. +AC_CACHE_CHECK([whether string.h and strings.h may both be included], +gcc_cv_header_string, +[ + AC_COMPILE_IFELSE( + [#include + #include ], + [gcc_cv_header_string=yes], + [gcc_cv_header_string=no]) +]) + +if test "$gcc_cv_header_string" = "yes"; then + AC_DEFINE(STRING_WITH_STRINGS, 1, [Define to 1 if string.h may be included along with strings.h]) +fi + +AC_C_BIGENDIAN + +dnl Check for stdarg.h - if we can't find it, halt configure +AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - wsjt will not compile without it **])]) + +dnl Checks for the existence of strlcat, strlcpy, basename... +dnl This more reliable test only works with gcc though. + + +AC_SUBST(SNPRINTF_C) + +dnl Debug-related options +dnl ===================== + +AC_ARG_ENABLE(clobber, +AC_HELP_STRING([--enable-clobber], [Don't preserve old binaries on make install]), +[clobber=$enableval], [clobber=no]) + +if test "$clobber" = yes; then + AC_SUBST(CLOBBER, yes) +fi + +AC_ARG_ENABLE(assert, +AC_HELP_STRING([--enable-assert],[Enable assert().]), +[assert=$enableval], [assert=no]) + +if test "$assert" = no; then + AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.]) +fi + +AC_SUBST(WSJT_CFLAGS) + +if test "$prefix" = "NONE"; then + AC_DEFINE_UNQUOTED(WSJT_PREFIX, "$ac_default_prefix", [Prefix where wsjt is installed.]) + +else + +dnl Don't get bitten by Cygwin's stupidity if the user specified +dnl a custom prefix with a trailing slash + + prefix=`echo $prefix | sed 's/\/$//'` + AC_DEFINE_UNQUOTED(WSJT_PREFIX, "$prefix", [Prefix where wsjt is installed.]) + +fi + +AC_CONFIG_FILES( \ + Makefile +) + +AC_OUTPUT + +echo +echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" +echo + +echo "Installing into: $prefix" + +echo diff --git a/cutil.c b/cutil.c index e7aaf4456..6130c1355 100644 --- a/cutil.c +++ b/cutil.c @@ -45,11 +45,12 @@ int buf[]; return (times(buf)); } /* ioperm(2) */ -ioperm_(from,num,turn_on) -unsigned long *from,*num,*turn_on; -{ - return (ioperm(*from,*num,*turn_on)); -} +//ioperm_(from,num,turn_on) +//unsigned long *from,*num,*turn_on; +//{ +// return (ioperm(*from,*num,*turn_on)); +// return (i386_get_ioperm(*from,*num,*turn_on)); +//} /* usleep(3) */ usleep_(microsec) diff --git a/g1 b/g1 index 38bb0e595..df7a3b19b 100755 --- a/g1 +++ b/g1 @@ -1,5 +1,5 @@ -G95=/usr/bin/g95 -COMPILER=//usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/ -python f2py.py -c --quiet --opt="-O -cpp -DLinux -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --f77exec=$G95 --f90exec=$G95 -L$COMPILER -lpthread -lg2c -lasound only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_linux.c igray.c wrapkarn.c start_threads.c cutil.c fivehz.f90 +G95=/usr/local/bin/g95 +COMPILER=//usr/local/lib/gcc-lib/i386-unknown-freebsd5.4/4.0.1/ +python f2py.py -c --quiet --opt="-O -cpp -DFreeBSD -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --f77exec=$G95 --f90exec=$G95 -L$COMPILER -lpthread -lg2c only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_bsd.c igray.c wrapkarn.c start_threads.c cutil.c fivehz.f90 diff --git a/go b/go index 108254c62..3a55c607d 100755 --- a/go +++ b/go @@ -1,3 +1,3 @@ gcc -c wrapkarn.c gcc -c igray.c -g95 -o JT65code -fno-second-underscore JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o +f77 -o JT65code -fno-second-underscore JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o diff --git a/ptt_unix.c b/ptt_unix.c index 7894d84de..7a51e896b 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -7,8 +7,9 @@ #include #include #include +#include "conf.h" /* XXX Could use CFLAGS later instead --db */ -#if (defined(__unix__) || defined(unix)) && !defined(USG) +#ifdef HAVE_SYS_PARAM_H #include #endif diff --git a/start_threads.c b/start_threads.c index 9cada4a3e..f6a31ccab 100644 --- a/start_threads.c +++ b/start_threads.c @@ -1,10 +1,21 @@ #include #include #include +#include "conf.h" + +/* XXX Change to + * #if defined(WANT_ALSA) && defined(HAVE_ALSA_ALSASOUND_H) + * when configure is done with options --db + */ +#ifdef HAVE_ALSA_ALSASOUND_H #include +#endif + #include #include +#ifdef HAVE_ALSA_ALSASOUND_H + #if 1 #define ALSA_LOG #define ALSA_LOG_BUFFERS @@ -490,7 +501,7 @@ void ao_alsa_loop(void *iarg) { return; } - +#endif extern void decode1_(int *iarg); int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], @@ -505,6 +516,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int iarg1 = 1,iarg2 = 2; //int32_t rate=11025; int32_t rate=*nfsample; +#ifdef HAVE_ALSA_ALSASOUND_H alsa_driver_capture.app_buffer_y1 = y1; alsa_driver_capture.app_buffer_y2 = y2; alsa_driver_capture.app_buffer_offset = iwrite; @@ -521,9 +533,10 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_playback.nmode = nmode; alsa_driver_playback.transmitting = Transmitting; alsa_driver_playback.ndsec = ndsec; - +#endif printf("start threads called\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); +#ifdef HAVE_ALSA_ALSASOUND_H /* Open audio card. */ ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); @@ -539,5 +552,5 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], /* snd_pcm_start */ //iret2 = pthread_create(&thread2,NULL,a2d_,&iarg2); - +#endif } From 0d0bcdaf5856b750105605763e191e687f55e51b Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 7 Jan 2006 21:24:49 +0000 Subject: [PATCH 029/811] - more cleanups to configure - ptt_linux.c is no longer needed (replaced with generic ptt_unix.c) - Makefile should be created from configure (and Makefile.in) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@59 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile | 78 ---------------------------------------------------- conf.h.in | 3 ++ configure | 25 +++++++++++++++-- configure.ac | 10 +++++++ ptt_linux.c | 44 ----------------------------- 5 files changed, 36 insertions(+), 124 deletions(-) delete mode 100644 Makefile delete mode 100644 ptt_linux.c diff --git a/Makefile b/Makefile deleted file mode 100644 index e9ae17e48..000000000 --- a/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -# -# This part all goes away when configure is written -# working on it --db -# -CC ?= gcc -FC ?= f77 -FFLAGS = -g -O2 -# -# WSJT specific Fortran flags -FFLAGS += -Wall -fbounds-check - -OS=FreeBSD - -G95=/usr/local/bin/g95 -COMPILER=/usr/local/lib/gcc-lib/i386-unknown-freebsd5.4/4.0.1/ -#OS=Linux -#COMPILER=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/ - -PYTHON ?= /usr/local/bin/python -RM ?= /bin/rm -F2PY = /usr/local/bin/f2py -F2PY_PY = "f2py.py" - -OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ - packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \ - unpackgrid.o deg2grid.o packdxcc.o chkmsg.o getpfx1.o \ - getpfx2.o k2grid.o grid2k.o interleave63.o graycode.o set.o \ - igray.o init_rs_int.o encode_rs_int.o decode_rs_int.o \ - wrapkarn.o - -OBJS0= init_rs.o encode_rs.o decode_rs.o -SRCS0= init_rs.c encode_rs.c decode_rs.c - -JT65SRCS = JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o - -all: JT65code - -JT65code_demo: $(OBJS1) - $(FC) -o JT65code_demo $(OBJS1) - -# $(OBJS0) regenerated by Audio.so target for now -JT65code: Audio.so wrapkarn.o igray.o $(JT65SRCS) # $(OBJS0) - $(FC) -o JT65code $(JT65SRCS) - -wrapkarn.o: wrapkarn.c - $(CC) -c wrapkarn.c - -igray.o: igray.c - $(CC) -c igray.c - -$(OBJS0): $(SRCS0) - $(CC) -c -DBIGSYM=1 $(SRCS0) - -init_rs_int.o: init_rs.c - $(CC) -c -DBIGSYM=1 -o init_rs_int.o init_rs.c - -encode_rs_int.o: encode_rs.c - $(CC) -c -DBIGSYM=1 -o encode_rs_int.o encode_rs.c - -decode_rs_int.o: decode_rs.c - $(CC) -c -DBIGSYM=1 -o decode_rs_int.o decode_rs.c - -Audio.so: $(OBJS0) - ${PYTHON} ${F2PY_PY} -c --quiet --opt="-O -cpp -D${OS} \ - -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio \ - --f77exec=${G95} --f90exec=${G95} -L${COMPILER} -lpthread -lg2c \ - only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 \ - : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ - blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ - ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ - i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ - wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f \ - jtaudio.c ptt_bsd.c igray.c wrapkarn.c start_threads.c cutil.c \ - fivehz.f90 -.PHONY : clean -clean: - ${RM} -f *.o *.so JT65code JT65code_demo - diff --git a/conf.h.in b/conf.h.in index 526ea70a8..7d853431a 100644 --- a/conf.h.in +++ b/conf.h.in @@ -43,6 +43,9 @@ /* Define to `unsigned long long' if does not define. */ #undef uint64_t +/* Define if you have /usr/include/sys/param.h */ +#undef HAVE_SYS_PARAM_H + #undef HAVE_ALSA_ALSASOUND_H #undef HAVE_SYS_SOUNDCARD_H #undef HAVE_AUDIOFILE_H diff --git a/configure b/configure index ba9d2cc3a..c3e934883 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: $ +# $Id: configure.ac 58 2006-01-07 20:14:23Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -921,7 +921,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: $ +$Id: configure.ac 58 2006-01-07 20:14:23Z va3db $ _ACEOF exit 0 fi @@ -3306,6 +3306,25 @@ echo "${ECHO_T}no" >&6 fi +echo "$as_me:$LINENO: checking g95 lib path" >&5 +echo $ECHO_N "checking g95 lib path... $ECHO_C" >&6 +G95_LIB_PATH=`${G95} -print-file-name=` +echo "$as_me:$LINENO: result: ${G95_LIB_PATH}" >&5 +echo "${ECHO_T}${G95_LIB_PATH}" >&6 + +cat >>confdefs.h <<_ACEOF +#define G95_LIB_PATH "${G95_LIB_PATH}" +_ACEOF + +G95_LIB_PATH="${G95_LIB_PATH}" + + +echo "$as_me:$LINENO: checking OS" >&5 +echo $ECHO_N "checking OS... $ECHO_C" >&6 +OS=`uname` +OS="${OS}" + + echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then @@ -4634,6 +4653,8 @@ s,@TEST@,$TEST,;t t s,@PYTHON@,$PYTHON,;t t s,@F2PY@,$F2PY,;t t s,@G95@,$G95,;t t +s,@G95_LIB_PATH@,$G95_LIB_PATH,;t t +s,@OS@,$OS,;t t s,@SNPRINTF_C@,$SNPRINTF_C,;t t s,@CLOBBER@,$CLOBBER,;t t s,@WSJT_CFLAGS@,$WSJT_CFLAGS,;t t diff --git a/configure.ac b/configure.ac index 703e27cf0..781aacf93 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,16 @@ AC_PATH_PROG(PYTHON, python) AC_PATH_PROG(F2PY, f2py) AC_PATH_PROG(G95, g95) +AC_MSG_CHECKING([g95 lib path]) +G95_LIB_PATH=`${G95} -print-file-name=` +AC_MSG_RESULT(${G95_LIB_PATH}) +AC_DEFINE_UNQUOTED(G95_LIB_PATH, "${G95_LIB_PATH}", [Path to G95 libs.]) +AC_SUBST(G95_LIB_PATH, "${G95_LIB_PATH}") + +AC_MSG_CHECKING([OS]) +OS=`uname` +AC_SUBST(OS, "${OS}") + dnl Checks for header files. AC_HEADER_STDC diff --git a/ptt_linux.c b/ptt_linux.c deleted file mode 100644 index d1dab3ed8..000000000 --- a/ptt_linux.c +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include -#include -#include -#include - -int ptt_(int *nport, int *ntx, int *iptt) -{ - static int nopen=0; - int control = TIOCM_RTS | TIOCM_DTR; - int fd; - char s[11]; - - if(*nport < 0) { - *iptt=*ntx; - return(0); - } - - if(*ntx && (!nopen)) { - sprintf(s,"/dev/ttyS%d",*nport); - //open the device - if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { - fprintf(stderr, "device not found"); - return(1); - } - nopen=1; - return(0); - } - - if(*ntx && nopen) { - // printf("Set DTR/RTS %d %d\n",TIOCMBIS,control); - ioctl(fd, TIOCMBIS, &control); // Set DTR and RTS - *iptt=1; - } - - else { - // printf("Clear DTR/RTS %d %d\n",TIOCMBIC,control); - ioctl(fd, TIOCMBIC, &control); - close(fd); - *iptt=0; - nopen=0; - } - return(0); -} From de3e8a9c5bb8cc15985aabf2923e07ff6038fbf6 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 7 Jan 2006 22:40:26 +0000 Subject: [PATCH 030/811] - oops sorry about that. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@60 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Makefile.in diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 000000000..1bc5d467e --- /dev/null +++ b/Makefile.in @@ -0,0 +1,72 @@ +# +CC ?= @CC@ +FC ?= @F77@ +FFLAGS = @FFLAGS@ +# +# WSJT specific Fortran flags +FFLAGS += -Wall -fbounds-check + +OS=@OS@ +G95=@G95@ +COMPILER=@G95_LIB_PATH@ + +PYTHON ?= @PYTHON@ +RM ?= @RM@ +F2PY = @F2PY@ +F2PY_PY = "f2py.py" + +OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ + packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \ + unpackgrid.o deg2grid.o packdxcc.o chkmsg.o getpfx1.o \ + getpfx2.o k2grid.o grid2k.o interleave63.o graycode.o set.o \ + igray.o init_rs_int.o encode_rs_int.o decode_rs_int.o \ + wrapkarn.o + +OBJS0= init_rs.o encode_rs.o decode_rs.o +SRCS0= init_rs.c encode_rs.c decode_rs.c + +JT65SRCS = JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o + +all: JT65code + +JT65code_demo: $(OBJS1) + $(FC) -o JT65code_demo $(OBJS1) + +# $(OBJS0) regenerated by Audio.so target for now +JT65code: Audio.so wrapkarn.o igray.o $(JT65SRCS) # $(OBJS0) + $(FC) -o JT65code $(JT65SRCS) + +wrapkarn.o: wrapkarn.c + $(CC) -c wrapkarn.c + +igray.o: igray.c + $(CC) -c igray.c + +$(OBJS0): $(SRCS0) + $(CC) -c -DBIGSYM=1 $(SRCS0) + +init_rs_int.o: init_rs.c + $(CC) -c -DBIGSYM=1 -o init_rs_int.o init_rs.c + +encode_rs_int.o: encode_rs.c + $(CC) -c -DBIGSYM=1 -o encode_rs_int.o encode_rs.c + +decode_rs_int.o: decode_rs.c + $(CC) -c -DBIGSYM=1 -o decode_rs_int.o decode_rs.c + +Audio.so: $(OBJS0) + ${PYTHON} ${F2PY_PY} -c --quiet --opt="-O -cpp -D${OS} \ + -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio \ + --f77exec=${G95} --f90exec=${G95} -L${COMPILER} -lpthread -lg2c \ + only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 \ + : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ + blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ + ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ + i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ + wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f \ + jtaudio.c ptt_unix.c igray.c wrapkarn.c start_threads.c cutil.c \ + fivehz.f90 +.PHONY : clean +clean: + ${RM} -f *.o *.so JT65code JT65code_demo + From cc0bd39e85b54f3a9943eaf6a926abdfd3f8a689 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 8 Jan 2006 01:40:30 +0000 Subject: [PATCH 031/811] - A few more cleanups to configure Note for *now* you will have to expressly state ./configure --enable-alsa or --enable-oss etc. I'll fix it later to pick a default. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@61 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- conf.h.in | 20 +- configure | 1632 ++++++++++++++++++++++++++++++++++++++++++++++- configure.ac | 112 +++- start_threads.c | 17 +- 4 files changed, 1737 insertions(+), 44 deletions(-) diff --git a/conf.h.in b/conf.h.in index 7d853431a..9d9b49d88 100644 --- a/conf.h.in +++ b/conf.h.in @@ -46,6 +46,20 @@ /* Define if you have /usr/include/sys/param.h */ #undef HAVE_SYS_PARAM_H -#undef HAVE_ALSA_ALSASOUND_H -#undef HAVE_SYS_SOUNDCARD_H -#undef HAVE_AUDIOFILE_H +/* Define if you have alsasound.h */ +#undef HAS_ALSASOUND_H + +/* Define if you want to use ALSA */ +#undef USE_ALSA + +/* Define if you have soundcard.h */ +#undef HAS_SOUNDCARD_H + +/* Define if you want to use OSS */ +#undef USE_OSS + +/* Define if you have audiofile.h */ +#undef HAS_AUDIOFILE_H + +/* Define if you want to use LIBAUDIO */ +#undef USE_LIBAUDIO diff --git a/configure b/configure index c3e934883..4005aebbc 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 58 2006-01-07 20:14:23Z va3db $ +# $Id: configure.ac 59 2006-01-07 21:24:49Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -836,6 +836,9 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-clobber Don't preserve old binaries on make install --enable-assert Enable assert(). + --enable-alsa Force ALSA SOUNDCARD usage. + --enable-oss Force OSS SOUND usage. + --enable-libaudio Force LIBAUDIO SOUND usage. Some influential environment variables: CC C compiler command @@ -921,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 58 2006-01-07 20:14:23Z va3db $ +$Id: configure.ac 59 2006-01-07 21:24:49Z va3db $ _ACEOF exit 0 fi @@ -2071,7 +2074,7 @@ fi # Provide some information about the compiler. -echo "$as_me:2074:" \ +echo "$as_me:2077:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -2242,6 +2245,7 @@ if test ! -z "$CFLAGS"; then fi + echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 if test "${ac_cv_search_strerror+set}" = set; then @@ -3533,13 +3537,7 @@ done - - - - - - -for ac_header in crypt.h inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h link.h sys/soundcard.h linux/soundcard.h alsa/alsasound.h audiofile.h +for ac_header in inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -3652,12 +3650,330 @@ fi done - -if test "$libexecdir" = '${exec_prefix}/libexec' && - test "$localstatedir" = '${prefix}/var'; then - libexecdir='${bindir}' - localstatedir='${prefix}' +if test "${ac_cv_header_sys_soundcard_h+set}" = set; then + echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 +echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5 +echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5 +echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 +echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_soundcard_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6 + +fi +if test $ac_cv_header_sys_soundcard_h = yes; then + HAS_SOUNDCARD_H=1 +else + HAS_SOUNDCARD_H=0 +fi + + +if test "${ac_cv_header_alsa_alsasound_h+set}" = set; then + echo "$as_me:$LINENO: checking for alsa/alsasound.h" >&5 +echo $ECHO_N "checking for alsa/alsasound.h... $ECHO_C" >&6 +if test "${ac_cv_header_alsa_alsasound_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_alsa_alsasound_h" >&5 +echo "${ECHO_T}$ac_cv_header_alsa_alsasound_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking alsa/alsasound.h usability" >&5 +echo $ECHO_N "checking alsa/alsasound.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking alsa/alsasound.h presence" >&5 +echo $ECHO_N "checking alsa/alsasound.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: alsa/alsasound.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: alsa/alsasound.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: alsa/alsasound.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: alsa/alsasound.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: alsa/alsasound.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for alsa/alsasound.h" >&5 +echo $ECHO_N "checking for alsa/alsasound.h... $ECHO_C" >&6 +if test "${ac_cv_header_alsa_alsasound_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_alsa_alsasound_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_alsa_alsasound_h" >&5 +echo "${ECHO_T}$ac_cv_header_alsa_alsasound_h" >&6 + +fi +if test $ac_cv_header_alsa_alsasound_h = yes; then + HAS_ALSASOUND_H=1 +else + HAS_ALSASOUND_H=0 +fi + + +if test "${ac_cv_header_audiofile_h+set}" = set; then + echo "$as_me:$LINENO: checking for audiofile.h" >&5 +echo $ECHO_N "checking for audiofile.h... $ECHO_C" >&6 +if test "${ac_cv_header_audiofile_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_audiofile_h" >&5 +echo "${ECHO_T}$ac_cv_header_audiofile_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking audiofile.h usability" >&5 +echo $ECHO_N "checking audiofile.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking audiofile.h presence" >&5 +echo $ECHO_N "checking audiofile.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: audiofile.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: audiofile.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: audiofile.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: audiofile.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: audiofile.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: audiofile.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: audiofile.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: audiofile.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: audiofile.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: audiofile.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for audiofile.h" >&5 +echo $ECHO_N "checking for audiofile.h... $ECHO_C" >&6 +if test "${ac_cv_header_audiofile_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_audiofile_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_audiofile_h" >&5 +echo "${ECHO_T}$ac_cv_header_audiofile_h" >&6 + +fi +if test $ac_cv_header_audiofile_h = yes; then + HAS_AUDIOFILE_H=1 +else + HAS_AUDIOFILE_H=0 +fi + + echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6 @@ -3701,6 +4017,1197 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((int64_t *) 0) + return 0; +if (sizeof (int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_int64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 + +echo "$as_me:$LINENO: checking size of int64_t" >&5 +echo $ECHO_N "checking size of int64_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int64_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo= ac_hi= +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int64_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +long longval () { return (long) (sizeof (int64_t)); } +unsigned long ulongval () { return (long) (sizeof (int64_t)); } +#include +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int64_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int64_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int64_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int64_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int64_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int64_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int64_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT64_T $ac_cv_sizeof_int64_t +_ACEOF + + +echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((long long *) 0) + return 0; +if (sizeof (long long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_long_long=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 + +echo "$as_me:$LINENO: checking size of long long" >&5 +echo $ECHO_N "checking size of long long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo= ac_hi= +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +long longval () { return (long) (sizeof (long long)); } +unsigned long ulongval () { return (long) (sizeof (long long)); } +#include +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + + +if test "$ac_cv_sizeof_int64_t" = 8; then + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 + + echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((int64_t *) 0) + return 0; +if (sizeof (int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_int64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 + +elif test "$ac_cv_sizeof_long_long" = 8; then + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint64_t unsigned long long +_ACEOF + +fi + + echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((int64_t *) 0) + return 0; +if (sizeof (int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_int64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 +if test $ac_cv_type_int64_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define int64_t long long +_ACEOF + +fi + +fi + +echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +if test $ac_cv_type_u_int32_t = yes; then + : +else + + echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + + +cat >>confdefs.h <<\_ACEOF +#define u_int32_t uint32_t +_ACEOF + + +else + + { echo "$as_me:$LINENO: WARNING: system has no u_int32_t or uint32_t, default to unsigned long int" >&5 +echo "$as_me: WARNING: system has no u_int32_t or uint32_t, default to unsigned long int" >&2;} + +cat >>confdefs.h <<\_ACEOF +#define u_int32_t unsigned long int +_ACEOF + + +fi + + +fi + + +echo "$as_me:$LINENO: checking for u_int16_t" >&5 +echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((u_int16_t *) 0) + return 0; +if (sizeof (u_int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int16_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 +if test $ac_cv_type_u_int16_t = yes; then + : +else + + echo "$as_me:$LINENO: checking for uint16_t" >&5 +echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((uint16_t *) 0) + return 0; +if (sizeof (uint16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint16_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint16_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 +if test $ac_cv_type_uint16_t = yes; then + + +cat >>confdefs.h <<\_ACEOF +#define u_int16_t uint16_t +_ACEOF + + +else + + { echo "$as_me:$LINENO: WARNING: system has no u_int16_t or uint16_t, default to unsigned short int" >&5 +echo "$as_me: WARNING: system has no u_int16_t or uint16_t, default to unsigned short int" >&2;} + +cat >>confdefs.h <<\_ACEOF +#define u_int16_t unsigned short int +_ACEOF + + +fi + + +fi + + echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then @@ -4016,10 +5523,6 @@ fi - - - - # Check whether --enable-clobber or --disable-clobber was given. if test "${enable_clobber+set}" = set; then enableval="$enable_clobber" @@ -4073,6 +5576,96 @@ fi ac_config_files="$ac_config_files Makefile" + +# Check whether --enable-alsa or --disable-alsa was given. +if test "${enable_alsa+set}" = set; then + enableval="$enable_alsa" + alsa=$enableval +else + alsa=no +fi; + + +# Check whether --enable-oss or --disable-oss was given. +if test "${enable_oss+set}" = set; then + enableval="$enable_oss" + oss=$enableval +else + oss=no +fi; + + +# Check whether --enable-libaudio or --disable-libaudio was given. +if test "${enable_libaudio+set}" = set; then + enableval="$enable_libaudio" + libaudio=$enableval +else + libaudio=no +fi; + +if test "$alsa" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_ALSA 1 +_ACEOF + +fi + +if test "$oss" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_OSS 1 +_ACEOF + +fi + +if test "$libaudio" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_LIBAUDIO 1 +_ACEOF + +fi + +if test "$alsa" = yes; then + if test $HAS_ALSASOUND_H -eq 0; then + { { echo "$as_me:$LINENO: error: You need alsasound.h to use --enable-alsa" >&5 +echo "$as_me: error: You need alsasound.h to use --enable-alsa" >&2;} + { (exit 1); exit 1; }; } + else + cat >>confdefs.h <<\_ACEOF +#define HAS_ALSASOUND_H 1 +_ACEOF + + fi +fi + +if test "$oss" = yes; then + if test $HAS_SOUNDCARD_H -eq 0; then + { { echo "$as_me:$LINENO: error: You need soundcard.h to use --enable-oss" >&5 +echo "$as_me: error: You need soundcard.h to use --enable-oss" >&2;} + { (exit 1); exit 1; }; } + else + cat >>confdefs.h <<\_ACEOF +#define HAS_SOUNDCARD_H 1 +_ACEOF + + fi +fi + +if test "$libaudio" = yes; then + if test $HAS_AUDIOFILE_H -eq 0; then + { { echo "$as_me:$LINENO: error: You need audiofile.h to use --enable-libaudio" >&5 +echo "$as_me: error: You need audiofile.h to use --enable-libaudio" >&2;} + { (exit 1); exit 1; }; } + else + cat >>confdefs.h <<\_ACEOF +#define HAS_AUDIOFILE_H 1 +_ACEOF + + fi +fi + 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 @@ -4655,7 +6248,6 @@ s,@F2PY@,$F2PY,;t t s,@G95@,$G95,;t t s,@G95_LIB_PATH@,$G95_LIB_PATH,;t t s,@OS@,$OS,;t t -s,@SNPRINTF_C@,$SNPRINTF_C,;t t s,@CLOBBER@,$CLOBBER,;t t s,@WSJT_CFLAGS@,$WSJT_CFLAGS,;t t CEOF diff --git a/configure.ac b/configure.ac index 781aacf93..db05ef98a 100644 --- a/configure.ac +++ b/configure.ac @@ -63,6 +63,7 @@ if test ! -z "$CFLAGS"; then WSJT_CFLAGS="$WSJT_CFLAGS $CFLAGS" fi + AC_ISC_POSIX AC_C_INLINE AC_PROG_GCC_TRADITIONAL @@ -93,14 +94,10 @@ AC_SUBST(OS, "${OS}") dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS([crypt.h inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h link.h sys/soundcard.h linux/soundcard.h alsa/alsasound.h audiofile.h]) - -dnl use directory structure of cached as default (hack) -if test "$libexecdir" = '${exec_prefix}/libexec' && - test "$localstatedir" = '${prefix}/var'; then - libexecdir='${bindir}' - localstatedir='${prefix}' -fi +AC_CHECK_HEADERS([inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h ]) +AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) +AC_CHECK_HEADER([alsa/alsasound.h], [HAS_ALSASOUND_H=1], [HAS_ALSASOUND_H=0]) +AC_CHECK_HEADER([audiofile.h], [HAS_AUDIOFILE_H=1], [HAS_AUDIOFILE_H=0]) dnl See whether we can include both string.h and strings.h. AC_CACHE_CHECK([whether string.h and strings.h may both be included], @@ -117,17 +114,46 @@ if test "$gcc_cv_header_string" = "yes"; then AC_DEFINE(STRING_WITH_STRINGS, 1, [Define to 1 if string.h may be included along with strings.h]) fi +AC_CHECK_SIZEOF(int64_t) +AC_CHECK_SIZEOF(long long) + +if test "$ac_cv_sizeof_int64_t" = 8; then + AC_CHECK_TYPE(uint64_t) + AC_CHECK_TYPE(int64_t) +elif test "$ac_cv_sizeof_long_long" = 8; then + AC_CHECK_TYPE(uint64_t, unsigned long long) + AC_CHECK_TYPE(int64_t, long long) +fi + +AC_CHECK_TYPE([u_int32_t], [], +[ + AC_CHECK_TYPE([uint32_t], + [ + AC_DEFINE(u_int32_t, [uint32_t], [If system does not define u_int32_t, define a reasonable substitute.]) + ], + [ + AC_MSG_WARN([system has no u_int32_t or uint32_t, default to unsigned long int]) + AC_DEFINE(u_int32_t, [unsigned long int], [If system does not define u_int32_t, define to unsigned long int here.]) + ]) +]) + +AC_CHECK_TYPE([u_int16_t], [], +[ + AC_CHECK_TYPE([uint16_t], + [ + AC_DEFINE(u_int16_t, [uint16_t], [If system does not define u_int16_t, define a usable substitute]) + ], + [ + AC_MSG_WARN([system has no u_int16_t or uint16_t, default to unsigned short int]) + AC_DEFINE(u_int16_t, [unsigned short int], [If system does not define u_int16_t, define a usable substitute.]) + ]) +]) + AC_C_BIGENDIAN dnl Check for stdarg.h - if we can't find it, halt configure AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - wsjt will not compile without it **])]) -dnl Checks for the existence of strlcat, strlcpy, basename... -dnl This more reliable test only works with gcc though. - - -AC_SUBST(SNPRINTF_C) - dnl Debug-related options dnl ===================== @@ -166,6 +192,64 @@ AC_CONFIG_FILES( \ Makefile ) +dnl alsa soundsupport +dnl ================= + +AC_ARG_ENABLE(alsa, +AC_HELP_STRING([--enable-alsa],[Force ALSA SOUNDCARD usage.]), +[alsa=$enableval] , [alsa=no]) + +dnl oss soundsupport +dnl ================ + +AC_ARG_ENABLE(oss, +AC_HELP_STRING([--enable-oss],[Force OSS SOUND usage.]), +[oss=$enableval] , [oss=no]) + +dnl libaudio soundsupport +dnl ===================== + +AC_ARG_ENABLE(libaudio, +AC_HELP_STRING([--enable-libaudio],[Force LIBAUDIO SOUND usage.]), +[libaudio=$enableval], [libaudio=no]) + +if test "$alsa" = yes; then + AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) +fi + +if test "$oss" = yes; then + AC_DEFINE(USE_OSS, 1, [Define if you want OSS used.]) +fi + +if test "$libaudio" = yes; then + AC_DEFINE(USE_LIBAUDIO, 1, [Define if you want LIBAUDIO used.]) +fi + +dnl sanity tests. +if test "$alsa" = yes; then + if test $HAS_ALSASOUND_H -eq 0; then + AC_MSG_ERROR([You need alsasound.h to use --enable-alsa]) + else + AC_DEFINE(HAS_ALSASOUND_H, 1, ) + fi +fi + +if test "$oss" = yes; then + if test $HAS_SOUNDCARD_H -eq 0; then + AC_MSG_ERROR([You need soundcard.h to use --enable-oss]) + else + AC_DEFINE(HAS_SOUNDCARD_H, 1, ) + fi +fi + +if test "$libaudio" = yes; then + if test $HAS_AUDIOFILE_H -eq 0; then + AC_MSG_ERROR([You need audiofile.h to use --enable-libaudio]) + else + AC_DEFINE(HAS_AUDIOFILE_H, 1, ) + fi +fi + AC_OUTPUT echo diff --git a/start_threads.c b/start_threads.c index f6a31ccab..4ea21c192 100644 --- a/start_threads.c +++ b/start_threads.c @@ -3,18 +3,21 @@ #include #include "conf.h" -/* XXX Change to - * #if defined(WANT_ALSA) && defined(HAVE_ALSA_ALSASOUND_H) - * when configure is done with options --db +/* + * XXX This should have been caught in the sanity tests in configure --db */ -#ifdef HAVE_ALSA_ALSASOUND_H +#if defined(USE_ALSA) && !defined(HAS_ALSASOUND_H) +#error "You must have alsa support to use alsa" +#endif + +#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H) #include #endif #include #include -#ifdef HAVE_ALSA_ALSASOUND_H +#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H) #if 1 #define ALSA_LOG @@ -516,7 +519,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int iarg1 = 1,iarg2 = 2; //int32_t rate=11025; int32_t rate=*nfsample; -#ifdef HAVE_ALSA_ALSASOUND_H +#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H) alsa_driver_capture.app_buffer_y1 = y1; alsa_driver_capture.app_buffer_y2 = y2; alsa_driver_capture.app_buffer_offset = iwrite; @@ -536,7 +539,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], #endif printf("start threads called\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); -#ifdef HAVE_ALSA_ALSASOUND_H +#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H) /* Open audio card. */ ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); From b3403ec2f9b34e06d3ae07cc6e7542f52292372a Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 8 Jan 2006 03:54:50 +0000 Subject: [PATCH 032/811] - Cleaned up further using Joe's Windows makefile as a basis git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@62 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 83 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 31 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1bc5d467e..62ae59fe7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,3 @@ -# CC ?= @CC@ FC ?= @F77@ FFLAGS = @FFLAGS@ @@ -22,28 +21,44 @@ OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ igray.o init_rs_int.o encode_rs_int.o decode_rs_int.o \ wrapkarn.o -OBJS0= init_rs.o encode_rs.o decode_rs.o -SRCS0= init_rs.c encode_rs.c decode_rs.c +# For Windows +#OBJS2C = init_rs.o encode_rs.o decode_rs.o +OBJS2C = init_rs.o encode_rs.o decode_rs.o +F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 +SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ + blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ + ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ + i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ + wsjtgen.f90 runqqq.f90 fivehz.f90 +SRCS2F77 = wsjt1.f fsubs1.f fsubs.f astro.f astropak.f +# For Windows +#SRCS2C = jtadudio.c resample.c ptt.c igray.c wrapkarn.c +# For unix +SRCS2C = jtaudio.c ptt_unix.c igray.c wrapkarn.c start_threads.c cutil.c -JT65SRCS = JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o +all: wsjt6 +JT65code: $(OBJS1) + $(FC) -o JT65code $(OBJS1) -all: JT65code +wsjt6: Audio.so #wsjt.spec +# ${PYTHON} c:\python23\installer\Build.py wsjt.spec +# ${RM} wsjt6 -JT65code_demo: $(OBJS1) - $(FC) -o JT65code_demo $(OBJS1) +Audio.so: $(OBJS2C) + ${PYTHON} ${F2PY_PY} -c --verbose --opt="-O -cpp -D${OS} \ + -fno-second-underscore" $(OBJS2C) -m Audio \ + --f77exec=${G95} --f90exec=${G95} -L${COMPILER} -lpthread -lg2c \ + only: $(F2PYONLY) \ + : $(SRCS2F90) \ + $(SRCS2F77) \ + ${SRCS2C} -# $(OBJS0) regenerated by Audio.so target for now -JT65code: Audio.so wrapkarn.o igray.o $(JT65SRCS) # $(OBJS0) - $(FC) -o JT65code $(JT65SRCS) +wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py +# ${PYTHON} c:\python23\installer\makespec.py --icon wsjt.ico \ +# --tk --onefile wsjt.py -wrapkarn.o: wrapkarn.c - $(CC) -c wrapkarn.c - -igray.o: igray.c - $(CC) -c igray.c - -$(OBJS0): $(SRCS0) - $(CC) -c -DBIGSYM=1 $(SRCS0) +#jtaudio.o: jtaudio.c +# cl -c jtaudio.c init_rs_int.o: init_rs.c $(CC) -c -DBIGSYM=1 -o init_rs_int.o init_rs.c @@ -54,19 +69,25 @@ encode_rs_int.o: encode_rs.c decode_rs_int.o: decode_rs.c $(CC) -c -DBIGSYM=1 -o decode_rs_int.o decode_rs.c -Audio.so: $(OBJS0) - ${PYTHON} ${F2PY_PY} -c --quiet --opt="-O -cpp -D${OS} \ - -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio \ - --f77exec=${G95} --f90exec=${G95} -L${COMPILER} -lpthread -lg2c \ - only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 \ - : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ - blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ - ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ - i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ - wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f \ - jtaudio.c ptt_unix.c igray.c wrapkarn.c start_threads.c cutil.c \ - fivehz.f90 +init_rs.o: init_rs.c + $(CC) -c -DBIGSYM=1 init_rs.c + +encode_rs.o: encode_rs.c + $(CC) -c -DBIGSYM=1 encode_rs.c + +decode_rs.o: decode_rs.c + $(CC) -c -DBIGSYM=1 decode_rs.c + +wrapkarn.o: wrapkarn.c + $(CC) -c wrapkarn.c + +igray.o: igray.c + $(CC) -c igray.c + +start_threads.o: start_threads.c + $(CC) -c start_threads.c + .PHONY : clean clean: - ${RM} -f *.o *.so JT65code JT65code_demo + ${RM} -f *.o *.so JT65code From ce7b1a958fafd8a3dc1ab8896f0b3efa2cdd54fe Mon Sep 17 00:00:00 2001 From: "Robert W Mc Gwier, Jr" Date: Sun, 8 Jan 2006 04:35:48 +0000 Subject: [PATCH 033/811] adding install-sh git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@63 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- install-sh | 323 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 323 insertions(+) create mode 100755 install-sh diff --git a/install-sh b/install-sh new file mode 100755 index 000000000..4d4a9519e --- /dev/null +++ b/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-05-14.22 + +# 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}" + +chmodcmd="$chmodprog 0755" +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) chmodcmd="$chmodprog $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 + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + 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 + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # 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 + trap '(exit $?); exit' 1 2 13 15 + + # 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 "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 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 "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); 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: From a160f9aca3ab0bcf2f545c7234cc630d40366a5f Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 8 Jan 2006 18:19:01 +0000 Subject: [PATCH 034/811] - A little more work on configure.ac, to at least get portaudio right git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@64 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure.ac | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index db05ef98a..b16499ce1 100644 --- a/configure.ac +++ b/configure.ac @@ -97,7 +97,8 @@ AC_HEADER_STDC AC_CHECK_HEADERS([inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h ]) AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) AC_CHECK_HEADER([alsa/alsasound.h], [HAS_ALSASOUND_H=1], [HAS_ALSASOUND_H=0]) -AC_CHECK_HEADER([audiofile.h], [HAS_AUDIOFILE_H=1], [HAS_AUDIOFILE_H=0]) +dnl XXX non portable portaudio.h check fix later --db +AC_CHECK_HEADER([/usr/local/include/portaudio.h], [HAS_PORTAUDIO_H=1], [HAS_PORTAUDIO_H=0]) dnl See whether we can include both string.h and strings.h. AC_CACHE_CHECK([whether string.h and strings.h may both be included], @@ -206,12 +207,12 @@ AC_ARG_ENABLE(oss, AC_HELP_STRING([--enable-oss],[Force OSS SOUND usage.]), [oss=$enableval] , [oss=no]) -dnl libaudio soundsupport -dnl ===================== +dnl portaudio soundsupport +dnl ====================== -AC_ARG_ENABLE(libaudio, -AC_HELP_STRING([--enable-libaudio],[Force LIBAUDIO SOUND usage.]), -[libaudio=$enableval], [libaudio=no]) +AC_ARG_ENABLE(portaudio, +AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), +[portaudio=$enableval], [portaudio=no]) if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) @@ -221,32 +222,40 @@ if test "$oss" = yes; then AC_DEFINE(USE_OSS, 1, [Define if you want OSS used.]) fi -if test "$libaudio" = yes; then - AC_DEFINE(USE_LIBAUDIO, 1, [Define if you want LIBAUDIO used.]) +if test "$portaudio" = yes; then + AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) +fi + +dnl set conf flags + +if test $HAS_ALSASOUND_H -eq 1; then + AC_DEFINE(HAS_ALSASOUND_H, 1, ) +fi + +if test $HAS_SOUNDCARD_H -eq 1; then + AC_DEFINE(HAS_SOUNDCARD_H, 1, ) +fi + +if test $HAS_PORTAUDIO_H -eq 1; then + AC_DEFINE(HAS_PORTAUDIO_H, 1, ) fi dnl sanity tests. if test "$alsa" = yes; then if test $HAS_ALSASOUND_H -eq 0; then AC_MSG_ERROR([You need alsasound.h to use --enable-alsa]) - else - AC_DEFINE(HAS_ALSASOUND_H, 1, ) fi fi if test "$oss" = yes; then if test $HAS_SOUNDCARD_H -eq 0; then AC_MSG_ERROR([You need soundcard.h to use --enable-oss]) - else - AC_DEFINE(HAS_SOUNDCARD_H, 1, ) fi fi -if test "$libaudio" = yes; then - if test $HAS_AUDIOFILE_H -eq 0; then - AC_MSG_ERROR([You need audiofile.h to use --enable-libaudio]) - else - AC_DEFINE(HAS_AUDIOFILE_H, 1, ) +if test "$portaudio" = yes; then + if test $HAS_PORTAUDIO_H -eq 0; then + AC_MSG_ERROR([You need portaudio.h to use --enable-portaudio]) fi fi From e1ace45403bf9c3bbcf98c640f872e9e19a3e2cd Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 9 Jan 2006 15:06:21 +0000 Subject: [PATCH 035/811] Changed WIN32 to Win32 in wrapkarn.c and igray.c. Corresponding change in go.bat. Added Makefiile.win. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@65 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.win | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ go.bat | 4 +-- igray.c | 2 +- wrapkarn.c | 6 ++-- 4 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 Makefile.win diff --git a/Makefile.win b/Makefile.win new file mode 100644 index 000000000..dc4bf78de --- /dev/null +++ b/Makefile.win @@ -0,0 +1,83 @@ +#Makefile for Windows +!include #Some definitions for Compaq Visual Fortran +gcc = cl +FC = df +#FFLAGS = /traceback /check:all +FFLAGS = /traceback /fast + +all: JT65code.exe WSJT6.EXE + +OBJS1 = JT65code.obj nchar.obj grid2deg.obj packmsg.obj packtext.obj \ + packcall.obj packgrid.obj unpackmsg.obj unpacktext.obj \ + unpackcall.obj unpackgrid.obj deg2grid.obj packdxcc.obj \ + chkmsg.obj getpfx1.obj getpfx2.obj k2grid.obj grid2k.obj \ + interleave63.obj graycode.obj set.obj igray.obj \ + init_rs.obj encode_rs.obj decode_rs.obj \ + wrapkarn.obj + +JT65code.exe: $(OBJS1) + $(FC) /exe:JT65code.exe $(OBJS1) + + +OBJS2C = init_rs.o encode_rs.o decode_rs.o jtaudio.o +F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 +SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ + blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ + ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ + i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ + wsjtgen.f90 runqqq.f90 fivehz.f90 +SRCS2F77 = wsjt1.f fsubs1.f fsubs.f astro.f astropak.f +SRCS2C = resample.c ptt.c igray.c wrapkarn.c + +WSJT6.EXE: Audio.pyd wsjt.spec + python c:\python23\installer\Build.py wsjt.spec + -del WSJT6.EXE + REN wsjt.exe WSJT6.EXE + +Audio.pyd: $(OBJS2C) + python f2py.py -c \ + --quiet --"fcompiler=compaqv" \ + --opt="/traceback /fast /fpp /define:Win32" \ + $(OBJS2C) \ + -lwinmm -lpa -llibsamplerate \ + -m Audio \ + only: $(F2PYONLY) : \ + $(SRCS2F90) $(SRCS2F77) $(SRCS2C) + +wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py + python c:\python23\installer\makespec.py --icon wsjt.ico \ + --tk --onefile wsjt.py + +jtaudio.o: jtaudio.c + cl /c /DWin32 /Fojtaudio.o jtaudio.c + +init_rs.obj: init_rs.c + $(CC) /c /DBIGSYM=1 init_rs.c + +init_rs.o: init_rs.obj + $(CC) /c /DBIGSYM=1 /Foinit_rs.o init_rs.c + +encode_rs.obj: encode_rs.c + $(CC) /c /DBIGSYM=1 encode_rs.c + +encode_rs.o: encode_rs.c + $(CC) /c /DBIGSYM=1 /Foencode_rs.o encode_rs.c + +decode_rs.obj: decode_rs.c + $(CC) /c /DBIGSYM=1 decode_rs.c + +decode_rs.o: decode_rs.c + $(CC) /c /DBIGSYM=1 /Ox /Zd /Fodecode_rs.o decode_rs.c + +wrapkarn.obj: wrapkarn.c + $(CC) /c /DWin32=1 wrapkarn.c + +igray.obj: igray.c + $(CC) /c /DWin32=1 igray.c + +.PHONY : clean + +clean: + -del *.o *.obj JT65code.exe Audio.pyd + + diff --git a/go.bat b/go.bat index d999ccad2..cc2ed0f6e 100644 --- a/go.bat +++ b/go.bat @@ -1,6 +1,6 @@ cl /c /DBIGSYM=1 /Foinit_rs.obj init_rs.c cl /c /DBIGSYM=1 /Foencode_rs.obj encode_rs.c cl /c /DBIGSYM=1 /Ox /Zd /Fodecode_rs.obj decode_rs.c -cl /c /DWIN32=1 wrapkarn.c -cl /c /DWIN32=1 igray.c +cl /c /DWin32=1 wrapkarn.c +cl /c /DWin32=1 igray.c df /exe:JT65code.exe JT65code_all.f /link wrapkarn.obj init_rs.obj encode_rs.obj decode_rs.obj igray.obj diff --git a/igray.c b/igray.c index e46b4f1f7..c59a4c9f0 100644 --- a/igray.c +++ b/igray.c @@ -1,4 +1,4 @@ -#ifdef WIN32 +#ifdef Win32 extern int __stdcall IGRAY(int *n0, int *idir) #else int igray_(int *n0, int *idir) diff --git a/wrapkarn.c b/wrapkarn.c index 636a95521..f093e020e 100644 --- a/wrapkarn.c +++ b/wrapkarn.c @@ -8,7 +8,7 @@ void *rs; static int first=1; -#ifdef WIN32 +#ifdef Win32 void __stdcall RS_ENCODE(int *dgen, int *sent) #else void rs_encode_(int *dgen, int *sent) @@ -38,7 +38,7 @@ void rs_encode_(int *dgen, int *sent) for (i = 0; i < 12; i++) sent[i+51] = dat1[11-i]; } -#ifdef WIN32 +#ifdef Win32 void __stdcall RS_DECODE(int *recd0, int *era0, int *numera0, int *decoded, int *nerr) #else void rs_decode_(int *recd0, int *era0, int *numera0, int *decoded, int *nerr) @@ -69,7 +69,7 @@ void rs_decode_(int *recd0, int *era0, int *numera0, int *decoded, int *nerr) } -#ifndef WIN32 +#ifndef Win32 void rs_encode__(int *dgen, int *sent) { rs_encode_(dgen, sent); From e61b287980826fdec14efbe0f926387e254ca846 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 9 Jan 2006 15:08:01 +0000 Subject: [PATCH 036/811] Added dfinc.mak (include file for Makefile.win). git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@66 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- DFINC.MAK | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 DFINC.MAK diff --git a/DFINC.MAK b/DFINC.MAK new file mode 100644 index 000000000..08c8f9b16 --- /dev/null +++ b/DFINC.MAK @@ -0,0 +1,87 @@ +#+ +# DFINC.MAK - Visual Fortran application master NMAKE definitions file +# +# This software DFINC.MAK is part of the Visual Fortran kit. +# +# This file should be included at the top of all MAKEFILEs as follows: +# !include +# +# NMAKE Options: +# +# Use the table below to determine the additional options for NMAKE +# Application Information Type Invoke NMAKE +# ---------------------------- ------------ +# For Debugging Info nmake debug=1 +# For linker map nmake linkmap=1 +# For linking with the DLLs nmake linkdll=1 +#- + +# Set the defaults for all the MSVCxx versions + +crtimplib=msvcrt.lib + +!IFNDEF link +link = link +!ENDIF +!IFNDEF libr +libr = lib +!ENDIF + +# Define the compiler verbs. +FOR = df + +# Macros for the compiler +!IFDEF DEBUG +df_debug = /debug:full +lnk_debug = /debug:full /debugtype:both +!ELSE +df_debug = +lnk_debug = /debug:none +!ENDIF + +!IFDEF LINKDLL +df_dll = /call_dll +dflibs = dfordll.lib $(crtimplib) kernel32.lib +!ELSE +df_dll = +dflibs = dfor.lib libc.lib kernel32.lib +!ENDIF + +fflags = $(df_debug) $(df_dll) + +# Macros for the FPP Preprocesor +fppflags = +fpp = $(FOR) $(fflags) /fpp="$(fppflags)" + +# Macros for the linker. +!IFDEF LINKMAP +lflags = /map:$(*B).map $(lflags) +!ELSE +lflags = $(lflags) +!ENDIF + +# SUFFIXES list +.SUFFIXES: .exe .obj .asm .c .bas .cbl .fpp .for .f90 .pas .res .rc + +# Define the inference rules +.obj.exe: + $(FOR) $(df_dll) $(df_debug) /link $(lflags) $(lnk_debug) $*.obj + +.for.exe: + $(FOR) $(fflags) $*.for /link $(lflags) + +.f90.exe: + $(FOR) $(fflags) $*.f90 /link $(lflags) + +.fpp.exe: + $(fpp) $*.fpp /link $(lflags) + +.for.obj: + $(FOR) $(df_debug) $*.for /nolink /object:$@ + +.f90.obj: + $(FOR) $(df_debug) $*.f90 /nolink /object:$@ + +.fpp.obj: + $(FOR) $(df_debug) /nolink /object:$@ /fpp:"$(fppflags)" $*.fpp + From 2cfd513bd7ee1d62c22e45e4f428bd694f68ab50 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 9 Jan 2006 15:42:44 +0000 Subject: [PATCH 037/811] Implemented Freeze/Tolerance/MouseDF features for JT6M. Removed superfluous "#ifdef Win32" in jtaudio.c. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@67 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.win | 21 +++++++++++++++++---- Makefile_0.Win | 31 ------------------------------- jtaudio.c | 4 ---- syncf0.f | 13 +++++++++---- syncf1.f | 19 ++++++++++++------- wsjt.py | 11 +++++++++++ wsjt1.f | 8 +++++--- wsjtrc.win | 6 +++--- 8 files changed, 57 insertions(+), 56 deletions(-) delete mode 100644 Makefile_0.Win diff --git a/Makefile.win b/Makefile.win index dc4bf78de..2a7a7cdd1 100644 --- a/Makefile.win +++ b/Makefile.win @@ -26,15 +26,28 @@ SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ wsjtgen.f90 runqqq.f90 fivehz.f90 -SRCS2F77 = wsjt1.f fsubs1.f fsubs.f astro.f astropak.f -SRCS2C = resample.c ptt.c igray.c wrapkarn.c +SRCS2F77 = wsjt1.f avesp2.f bzap.f spec441.f spec2d.f mtdecode.f \ + stdecode.f indexx.f s2shape.f flat2.f gen65.f chkmsg.f gen6m.f \ + gentone.f syncf0.f syncf1.f synct.f decode6m.f avemsg6m.f \ + set.f flatten.f db.f pctile.f sort.f ssort.f ps.f smooth.f ping.f \ + longx.f peakup.f sync.f detect.f avemsg65.f decode65.f demod64a.f \ + encode65.f extract.f flat1.f four2.f gencw.f getpfx1.f \ + getpfx2.f getsnr.f graycode.f grid2k.f interleave63.f k2grid.f \ + limit.f lpf1.f deep65.f morse.f nchar.f packcall.f packgrid.f \ + packmsg.f packtext.f setup65.f short65.f slope.f spec2d65.f \ + sync65.f unpackcall.f unpackgrid.f unpackmsg.f unpacktext.f \ + xcor.f xfft.f wsjt65.f astro.f azdist.f coord.f dcoord.f \ + deg2grid.f dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f \ + moon2.f MoonDop.f sun.f toxyz.f + +SRCS2C = resample.c ptt.c igray.c wrapkarn.c WSJT6.EXE: Audio.pyd wsjt.spec python c:\python23\installer\Build.py wsjt.spec -del WSJT6.EXE REN wsjt.exe WSJT6.EXE -Audio.pyd: $(OBJS2C) +Audio.pyd: $(OBJS2C) $(SRCS2F90) $(SRCS2F77) $(SRCS2C) python f2py.py -c \ --quiet --"fcompiler=compaqv" \ --opt="/traceback /fast /fpp /define:Win32" \ @@ -78,6 +91,6 @@ igray.obj: igray.c .PHONY : clean clean: - -del *.o *.obj JT65code.exe Audio.pyd + -del *.o *.obj JT65code.exe wsjt6.exe Audio.pyd diff --git a/Makefile_0.Win b/Makefile_0.Win deleted file mode 100644 index cc5e1fd67..000000000 --- a/Makefile_0.Win +++ /dev/null @@ -1,31 +0,0 @@ -#Makefile for WSJT -!include - -OBJS1 = pa_lib.o pa_win_mme.o jtaudio.o ... - -# Much more to be done, if this is to work! - -all: xcomdat.dll specjt2.dll tstsp.exe a2d.exe - -xcomdat.dll xcomdat.lib: xcomdat.f xcom.f - $(FOR) $(fflags) xcomdat.f /dll /link /section:.data,RWS - -specjt2.dll: specjt2.f xcom.f - $(FOR) $(fflags) specjt2.f /dll xcomdat.lib - -tstsp.exe: tstsp.f xcomdat.lib - $(FOR) $(fflags) tstsp.f xcomdat.lib specjt2.lib - -a2d.exe: a2d.f jtaudio.obj xcomdat.lib - $(FOR) $(fflags) /traceback /check:all a2d.f $(OBJS3) \ - /link winmm.lib xcomdat.lib - -clean: - -del xcomdat.dll - -del xcomdat.lib - -del xcomdat.exp - -del specjt2.dll - -del specjt2.lib - -del specjt2.exp - -del tstsp.exe - -del a2d.exe diff --git a/jtaudio.c b/jtaudio.c index 741ac1b8d..b39b7ea5c 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -37,11 +37,7 @@ typedef struct _SYSTEMTIME short Millisecond; } SYSTEMTIME; -#ifdef Win32 extern void __stdcall GetSystemTime(SYSTEMTIME *st); -#else -extern void GetSystemTime(SYSTEMTIME *st); -#endif // Input callback routine: static int SoundIn( void *inputBuffer, void *outputBuffer, diff --git a/syncf0.f b/syncf0.f index a55a47239..71207d331 100644 --- a/syncf0.f +++ b/syncf0.f @@ -1,4 +1,4 @@ - subroutine syncf0(data,jz,NTol,jstart,f0,smax) + subroutine syncf0(data,jz,NFreeze,NTol,jstart,f0,smax) C Does 512-pt FFTs of data with 256-pt step size. C Finds sync tone and determines aproximate values for jstart and f0. @@ -14,12 +14,17 @@ C Finds sync tone and determines aproximate values for jstart and f0. call zero(s2,6*128) !Clear average df=11025./512. - ia=(1076-NTol)/df - ib=(1076+Ntol)/df - nblk=jz/256 - 6 + + ia=(f0-400)/df + ib=(f0+400)/df + 0.999 + if(NFreeze.eq.1) then + ia=(f0-NTol)/df + ib=(f0+Ntol)/df + 0.999 + endif C Most of the time in this routine is in this loop. + nblk=jz/256 - 6 do n=1,nblk !Accumulate avg spectrum for j=256*(n-1)+1 !512-pt blocks, stepping by 256 call move(data(j),x,512) diff --git a/syncf1.f b/syncf1.f index 911af70d2..819c871da 100644 --- a/syncf1.f +++ b/syncf1.f @@ -1,4 +1,4 @@ - subroutine syncf1(data,jz,jstart,f0,NFreeze,smax,red) + subroutine syncf1(data,jz,jstart,f0,NFreeze,DFTolerance,smax,red) C Does 16k FFTs of data with stepsize 15360, using only "sync on" intervals. C Returns a refined value of f0, the sync-tone frequency. @@ -8,6 +8,7 @@ C Returns a refined value of f0, the sync-tone frequency. parameter (NQ=NFFT/4) parameter (NB3=3*512) real data(jz) !Raw data + integer DFTolerance real x(NFFT) real red(512) real s(NQ) !Ref spectrum for flattening and birdie-zapping @@ -41,6 +42,7 @@ C Accumulate a high-resolution average spectrum do i=1,NQ !Normalize s(i)=fac*s(i) enddo + call smooth(s,NQ) C NB: could also compute a "blue" spectrum, using the sync-off intervals. n8=NQ/8 @@ -52,14 +54,17 @@ C NB: could also compute a "blue" spectrum, using the sync-off intervals. red(i)=10.0*red(i)/(8.0*nz) enddo + + dftol=min(DFTolerance,25) + if(nfreeze.eq.1) dftol=DFTolerance C Find improved value for f0 smax=0. - ia=(f0-25.)/df - ib=(f0+25.)/df - if(NFreeze.eq.1) then - ia=(f0-5.)/df - ib=(f0+5.)/df - endif + ia=(f0-dftol)/df + ib=(f0+dftol)/df + 0.999 +! if(NFreeze.eq.1) then +! ia=(f0-5.)/df +! ib=(f0+5.)/df +! endif do i=ia,ib if(s(i).gt.smax) then smax=s(i) diff --git a/wsjt.py b/wsjt.py index c6889a15c..2eec00775 100644 --- a/wsjt.py +++ b/wsjt.py @@ -574,6 +574,7 @@ def ModeJT6M(event=NONE): isync=isync6m lsync.configure(text=slabel+str(isync)) shmsg.configure(state=DISABLED) + cbfreeze.configure(state=NORMAL) itol=5 inctol() ntx.set(1) @@ -973,6 +974,14 @@ def mouse_up_g1(event): # print event.x pass +#------------------------------------------------------ right_arrow +def right_arrow(event=NONE): + Audio.gcom2.mousedf=Audio.gcom2.mousedf+10 + +#------------------------------------------------------ left_arrow +def left_arrow(event=NONE): + Audio.gcom2.mousedf=Audio.gcom2.mousedf-10 + #------------------------------------------------------ GenStdMsgs def GenStdMsgs(event=NONE): t=ToRadio.get().upper().strip() @@ -1658,6 +1667,8 @@ root.bind_all('',decode_exclude) root.bind_all('',decode_exclude) root.bind_all('',lookup_gen) root.bind_all('',lookup_gen) +root.bind_all('',left_arrow) +root.bind_all('',right_arrow) text.pack(side=LEFT, fill=X, padx=1) sb = Scrollbar(iframe4, orient=VERTICAL, command=text.yview) diff --git a/wsjt1.f b/wsjt1.f index 2eb9f8750..c0e87f70d 100644 --- a/wsjt1.f +++ b/wsjt1.f @@ -197,10 +197,12 @@ ! For waterfall plot call spec2d(dat,jz,nstep,s2,nchan,nz,psavg,sigma) if(jz/11025.0.lt.3.9) go to 900 - call syncf0(dat,jz,DFTolerance,jstart,f0,smax) - if(NFreeze.eq.1) f0=1076.66 + + f0=1076.66 + if(NFreeze.eq.1) f0=1076.66+mousedf + call syncf0(dat,jz,NFreeze,DFTolerance,jstart,f0,smax) call synct(dat,jz,jstart,f0,smax) - call syncf1(dat,jz,jstart,f0,NFreeze,smax,red) + call syncf1(dat,jz,jstart,f0,NFreeze,DFTolerance,smax,red) f0a=f0 do i=1,512 diff --git a/wsjtrc.win b/wsjtrc.win index 878089ec8..045f70637 100644 --- a/wsjtrc.win +++ b/wsjtrc.win @@ -1,6 +1,6 @@ -*font: Arial 9 -*Label*font: Arial 9 -*Text*font: "Courier New" 10 +*font: Arial 8 +*Label*font: Arial 8 +*Text*font: "Courier New" 9 *background: gray85 *Text*background: white *Entry*background: white From 1f1abc09d3d64822dcaae79f6ac4d5af890e7439 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 9 Jan 2006 19:18:03 +0000 Subject: [PATCH 038/811] - cleaned up a few more stupids on configure system - cleaned up Makefile to use LDFLAGS and CPPFLAGS - look for asoundlib.h properly git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@69 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 33 ++++-- conf.h.in | 8 +- configure | 319 ++++++++++++++++++++++++++++++++++++--------------- configure.ac | 26 +++-- 4 files changed, 270 insertions(+), 116 deletions(-) diff --git a/Makefile.in b/Makefile.in index 62ae59fe7..7856dcb40 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,8 @@ CC ?= @CC@ FC ?= @F77@ -FFLAGS = @FFLAGS@ +FFLAGS = @FFLAGS@ +LDFLAGS = @LDFLAGS@ +CPPFLAGS = @CPPFLAGS@ # # WSJT specific Fortran flags FFLAGS += -Wall -fbounds-check @@ -9,6 +11,9 @@ OS=@OS@ G95=@G95@ COMPILER=@G95_LIB_PATH@ +LDFLAGS += -L${COMPILER} +LIBS = -lpthread -lg2c + PYTHON ?= @PYTHON@ RM ?= @RM@ F2PY = @F2PY@ @@ -21,8 +26,6 @@ OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ igray.o init_rs_int.o encode_rs_int.o decode_rs_int.o \ wrapkarn.o -# For Windows -#OBJS2C = init_rs.o encode_rs.o decode_rs.o OBJS2C = init_rs.o encode_rs.o decode_rs.o F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ @@ -31,10 +34,18 @@ SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ wsjtgen.f90 runqqq.f90 fivehz.f90 SRCS2F77 = wsjt1.f fsubs1.f fsubs.f astro.f astropak.f -# For Windows -#SRCS2C = jtadudio.c resample.c ptt.c igray.c wrapkarn.c -# For unix -SRCS2C = jtaudio.c ptt_unix.c igray.c wrapkarn.c start_threads.c cutil.c +# +# ok, so far for Windows @AUDIO@ will be jtaudio.c since it uses portaudio +# for *nix @AUDIO@ will also be jtaudio.c for portaudio +# for *nix @AUDIO@ will be start_threads.c for alsa +# for *nix @AUDIO@ will be ?? for oss +# +# ptt_unix.c vs. ptt.c I'll sort out later. +# ditto for cutil.c (only used on *nix) +# --db +# +SRCS2C = ptt_unix.c igray.c wrapkarn.c cutil.c +SRCS2C += @AUDIO@ all: wsjt6 JT65code: $(OBJS1) @@ -47,7 +58,7 @@ wsjt6: Audio.so #wsjt.spec Audio.so: $(OBJS2C) ${PYTHON} ${F2PY_PY} -c --verbose --opt="-O -cpp -D${OS} \ -fno-second-underscore" $(OBJS2C) -m Audio \ - --f77exec=${G95} --f90exec=${G95} -L${COMPILER} -lpthread -lg2c \ + --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} ${LIBS} \ only: $(F2PYONLY) \ : $(SRCS2F90) \ $(SRCS2F77) \ @@ -57,8 +68,8 @@ wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py # ${PYTHON} c:\python23\installer\makespec.py --icon wsjt.ico \ # --tk --onefile wsjt.py -#jtaudio.o: jtaudio.c -# cl -c jtaudio.c +jtaudio.o: jtaudio.c + $(CC) -c $(CPPFLAGS) jtaudio.c init_rs_int.o: init_rs.c $(CC) -c -DBIGSYM=1 -o init_rs_int.o init_rs.c @@ -89,5 +100,5 @@ start_threads.o: start_threads.c .PHONY : clean clean: - ${RM} -f *.o *.so JT65code + ${RM} -f *.o *.so JT65code wsjt6 diff --git a/conf.h.in b/conf.h.in index 9d9b49d88..d3541dcef 100644 --- a/conf.h.in +++ b/conf.h.in @@ -58,8 +58,8 @@ /* Define if you want to use OSS */ #undef USE_OSS -/* Define if you have audiofile.h */ -#undef HAS_AUDIOFILE_H +/* Define if you have portaudio.h */ +#undef HAS_PORTAUDIO_H -/* Define if you want to use LIBAUDIO */ -#undef USE_LIBAUDIO +/* Define if you want to use PORTAUDIO */ +#undef USE_PORTAUDIO diff --git a/configure b/configure index 4005aebbc..04ae9ea10 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 59 2006-01-07 21:24:49Z va3db $ +# $Id: configure.ac 64 2006-01-08 18:19:01Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -838,7 +838,7 @@ Optional Features: --enable-assert Enable assert(). --enable-alsa Force ALSA SOUNDCARD usage. --enable-oss Force OSS SOUND usage. - --enable-libaudio Force LIBAUDIO SOUND usage. + --enable-portaudio Force PORTAUDIO SOUND usage. Some influential environment variables: CC C compiler command @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 59 2006-01-07 21:24:49Z va3db $ +$Id: configure.ac 64 2006-01-08 18:19:01Z va3db $ _ACEOF exit 0 fi @@ -2197,6 +2197,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$OLD_CFLAGS" +CPPFLAGS="-I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" +LDFLAGS="-L/usr/local/lib ${LDFLAGS}" + echo "$as_me:$LINENO: checking uname -s for Cygwin, Solaris or HPUX" >&5 echo $ECHO_N "checking uname -s for Cygwin, Solaris or HPUX... $ECHO_C" >&6 case `uname -s` in @@ -3758,23 +3761,23 @@ else fi -if test "${ac_cv_header_alsa_alsasound_h+set}" = set; then - echo "$as_me:$LINENO: checking for alsa/alsasound.h" >&5 -echo $ECHO_N "checking for alsa/alsasound.h... $ECHO_C" >&6 -if test "${ac_cv_header_alsa_alsasound_h+set}" = set; then +if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5 +echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_alsa_alsasound_h" >&5 -echo "${ECHO_T}$ac_cv_header_alsa_alsasound_h" >&6 +echo "$as_me:$LINENO: result: $ac_cv_header_alsa_asoundlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_alsa_asoundlib_h" >&6 else # Is the header compilable? -echo "$as_me:$LINENO: checking alsa/alsasound.h usability" >&5 -echo $ECHO_N "checking alsa/alsasound.h usability... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking alsa/asoundlib.h usability" >&5 +echo $ECHO_N "checking alsa/asoundlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default -#include +#include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -3799,12 +3802,12 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -echo "$as_me:$LINENO: checking alsa/alsasound.h presence" >&5 -echo $ECHO_N "checking alsa/alsasound.h presence... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking alsa/asoundlib.h presence" >&5 +echo $ECHO_N "checking alsa/asoundlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" -#include +#include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -3836,53 +3839,53 @@ echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) - { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: alsa/alsasound.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: alsa/alsasound.h: proceeding with the preprocessor's result" >&2;};; + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;};; no:yes ) - { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: alsa/alsasound.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: alsa/alsasound.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/alsasound.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: alsa/alsasound.h: proceeding with the preprocessor's result" >&2;};; + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;};; esac -echo "$as_me:$LINENO: checking for alsa/alsasound.h" >&5 -echo $ECHO_N "checking for alsa/alsasound.h... $ECHO_C" >&6 -if test "${ac_cv_header_alsa_alsasound_h+set}" = set; then +echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5 +echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_alsa_alsasound_h=$ac_header_preproc + ac_cv_header_alsa_asoundlib_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_alsa_alsasound_h" >&5 -echo "${ECHO_T}$ac_cv_header_alsa_alsasound_h" >&6 +echo "$as_me:$LINENO: result: $ac_cv_header_alsa_asoundlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_alsa_asoundlib_h" >&6 fi -if test $ac_cv_header_alsa_alsasound_h = yes; then - HAS_ALSASOUND_H=1 +if test $ac_cv_header_alsa_asoundlib_h = yes; then + HAS_ASOUNDLIB_H=1 else - HAS_ALSASOUND_H=0 + HAS_ASOUNDLIB_H=0 fi -if test "${ac_cv_header_audiofile_h+set}" = set; then - echo "$as_me:$LINENO: checking for audiofile.h" >&5 -echo $ECHO_N "checking for audiofile.h... $ECHO_C" >&6 -if test "${ac_cv_header_audiofile_h+set}" = set; then +if test "${ac_cv_header_sys_asoundlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for sys/asoundlib.h" >&5 +echo $ECHO_N "checking for sys/asoundlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_asoundlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_audiofile_h" >&5 -echo "${ECHO_T}$ac_cv_header_audiofile_h" >&6 +echo "$as_me:$LINENO: result: $ac_cv_header_sys_asoundlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_asoundlib_h" >&6 else # Is the header compilable? -echo "$as_me:$LINENO: checking audiofile.h usability" >&5 -echo $ECHO_N "checking audiofile.h usability... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking sys/asoundlib.h usability" >&5 +echo $ECHO_N "checking sys/asoundlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default -#include +#include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -3907,12 +3910,12 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -echo "$as_me:$LINENO: checking audiofile.h presence" >&5 -echo $ECHO_N "checking audiofile.h presence... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking sys/asoundlib.h presence" >&5 +echo $ECHO_N "checking sys/asoundlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" -#include +#include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -3944,33 +3947,141 @@ echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) - { echo "$as_me:$LINENO: WARNING: audiofile.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: audiofile.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: audiofile.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: audiofile.h: proceeding with the preprocessor's result" >&2;};; + { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/asoundlib.h: proceeding with the preprocessor's result" >&2;};; no:yes ) - { echo "$as_me:$LINENO: WARNING: audiofile.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: audiofile.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: audiofile.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: audiofile.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: audiofile.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: audiofile.h: proceeding with the preprocessor's result" >&2;};; + { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/asoundlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/asoundlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/asoundlib.h: proceeding with the preprocessor's result" >&2;};; esac -echo "$as_me:$LINENO: checking for audiofile.h" >&5 -echo $ECHO_N "checking for audiofile.h... $ECHO_C" >&6 -if test "${ac_cv_header_audiofile_h+set}" = set; then +echo "$as_me:$LINENO: checking for sys/asoundlib.h" >&5 +echo $ECHO_N "checking for sys/asoundlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_asoundlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_audiofile_h=$ac_header_preproc + ac_cv_header_sys_asoundlib_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_audiofile_h" >&5 -echo "${ECHO_T}$ac_cv_header_audiofile_h" >&6 +echo "$as_me:$LINENO: result: $ac_cv_header_sys_asoundlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_asoundlib_h" >&6 fi -if test $ac_cv_header_audiofile_h = yes; then - HAS_AUDIOFILE_H=1 +if test $ac_cv_header_sys_asoundlib_h = yes; then + HAS_ASOUNDLIB_H=1 else - HAS_AUDIOFILE_H=0 + HAS_ASOUNDLIB_H=0 +fi + + +if test "${ac_cv_header_portaudio_h+set}" = set; then + echo "$as_me:$LINENO: checking for portaudio.h" >&5 +echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 +if test "${ac_cv_header_portaudio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_portaudio_h" >&5 +echo "${ECHO_T}$ac_cv_header_portaudio_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking portaudio.h usability" >&5 +echo $ECHO_N "checking portaudio.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking portaudio.h presence" >&5 +echo $ECHO_N "checking portaudio.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: portaudio.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: portaudio.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: portaudio.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for portaudio.h" >&5 +echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 +if test "${ac_cv_header_portaudio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_portaudio_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_portaudio_h" >&5 +echo "${ECHO_T}$ac_cv_header_portaudio_h" >&6 + +fi +if test $ac_cv_header_portaudio_h = yes; then + HAS_PORTAUDIO_H=1 +else + HAS_PORTAUDIO_H=0 fi @@ -5595,12 +5706,12 @@ else fi; -# Check whether --enable-libaudio or --disable-libaudio was given. -if test "${enable_libaudio+set}" = set; then - enableval="$enable_libaudio" - libaudio=$enableval +# Check whether --enable-portaudio or --disable-portaudio was given. +if test "${enable_portaudio+set}" = set; then + enableval="$enable_portaudio" + portaudio=$enableval else - libaudio=no + portaudio=no fi; if test "$alsa" = yes; then @@ -5609,6 +5720,9 @@ cat >>confdefs.h <<\_ACEOF #define USE_ALSA 1 _ACEOF + AUDIO="start_threads.c" + + LDFLAGS="-Lpthreads ${LDFLAGS}" fi if test "$oss" = yes; then @@ -5617,26 +5731,47 @@ cat >>confdefs.h <<\_ACEOF #define USE_OSS 1 _ACEOF + AUDIO="jtaudio.c" + fi -if test "$libaudio" = yes; then +if test "$portaudio" = yes; then cat >>confdefs.h <<\_ACEOF -#define USE_LIBAUDIO 1 +#define USE_PORTAUDIO 1 +_ACEOF + + AUDIO="jtaudio.c" + +fi + + +if test $HAS_ASOUNDLIB_H -eq 1; then + cat >>confdefs.h <<\_ACEOF +#define HAS_ASOUNDLIB_H 1 +_ACEOF + +fi + +if test $HAS_SOUNDCARD_H -eq 1; then + cat >>confdefs.h <<\_ACEOF +#define HAS_SOUNDCARD_H 1 +_ACEOF + +fi + +if test $HAS_PORTAUDIO_H -eq 1; then + cat >>confdefs.h <<\_ACEOF +#define HAS_PORTAUDIO_H 1 _ACEOF fi if test "$alsa" = yes; then - if test $HAS_ALSASOUND_H -eq 0; then - { { echo "$as_me:$LINENO: error: You need alsasound.h to use --enable-alsa" >&5 -echo "$as_me: error: You need alsasound.h to use --enable-alsa" >&2;} + if test $HAS_ASOUNDLIB_H -eq 0; then + { { echo "$as_me:$LINENO: error: You need asoundlib.h to use --enable-alsa" >&5 +echo "$as_me: error: You need asoundlib.h to use --enable-alsa" >&2;} { (exit 1); exit 1; }; } - else - cat >>confdefs.h <<\_ACEOF -#define HAS_ALSASOUND_H 1 -_ACEOF - fi fi @@ -5645,27 +5780,22 @@ if test "$oss" = yes; then { { echo "$as_me:$LINENO: error: You need soundcard.h to use --enable-oss" >&5 echo "$as_me: error: You need soundcard.h to use --enable-oss" >&2;} { (exit 1); exit 1; }; } - else - cat >>confdefs.h <<\_ACEOF -#define HAS_SOUNDCARD_H 1 -_ACEOF - fi fi -if test "$libaudio" = yes; then - if test $HAS_AUDIOFILE_H -eq 0; then - { { echo "$as_me:$LINENO: error: You need audiofile.h to use --enable-libaudio" >&5 -echo "$as_me: error: You need audiofile.h to use --enable-libaudio" >&2;} +if test "$portaudio" = yes; then + if test $HAS_PORTAUDIO_H -eq 0; then + { { echo "$as_me:$LINENO: error: You need portaudio.h to use --enable-portaudio" >&5 +echo "$as_me: error: You need portaudio.h to use --enable-portaudio" >&2;} { (exit 1); exit 1; }; } - else - cat >>confdefs.h <<\_ACEOF -#define HAS_AUDIOFILE_H 1 -_ACEOF - fi fi +CPPFLAGS="${CPPFLAGS}" + +LDFLAGS="${LDFLAGS}" + + 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 @@ -6250,6 +6380,7 @@ s,@G95_LIB_PATH@,$G95_LIB_PATH,;t t s,@OS@,$OS,;t t s,@CLOBBER@,$CLOBBER,;t t s,@WSJT_CFLAGS@,$WSJT_CFLAGS,;t t +s,@AUDIO@,$AUDIO,;t t CEOF _ACEOF diff --git a/configure.ac b/configure.ac index b16499ce1..090b40600 100644 --- a/configure.ac +++ b/configure.ac @@ -22,6 +22,10 @@ AC_PROG_F77 dnl Make sure autoconf doesn't interfere with cflags -jmallett CFLAGS="$OLD_CFLAGS" +dnl Lets guess at some likely places for extra libs/includes XXX -db +CPPFLAGS="-I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" +LDFLAGS="-L/usr/local/lib ${LDFLAGS}" + AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX]) case `uname -s` in CYGWIN*) @@ -96,9 +100,9 @@ AC_HEADER_STDC AC_CHECK_HEADERS([inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h ]) AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) -AC_CHECK_HEADER([alsa/alsasound.h], [HAS_ALSASOUND_H=1], [HAS_ALSASOUND_H=0]) -dnl XXX non portable portaudio.h check fix later --db -AC_CHECK_HEADER([/usr/local/include/portaudio.h], [HAS_PORTAUDIO_H=1], [HAS_PORTAUDIO_H=0]) +AC_CHECK_HEADER([alsa/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) +AC_CHECK_HEADER([sys/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) +AC_CHECK_HEADER([portaudio.h], [HAS_PORTAUDIO_H=1], [HAS_PORTAUDIO_H=0]) dnl See whether we can include both string.h and strings.h. AC_CACHE_CHECK([whether string.h and strings.h may both be included], @@ -216,20 +220,24 @@ AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) + AC_SUBST(AUDIO, "start_threads.c") + LDFLAGS="-Lpthreads ${LDFLAGS}" fi if test "$oss" = yes; then AC_DEFINE(USE_OSS, 1, [Define if you want OSS used.]) + AC_SUBST(AUDIO, "jtaudio.c") fi if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) + AC_SUBST(AUDIO, "jtaudio.c") fi dnl set conf flags -if test $HAS_ALSASOUND_H -eq 1; then - AC_DEFINE(HAS_ALSASOUND_H, 1, ) +if test $HAS_ASOUNDLIB_H -eq 1; then + AC_DEFINE(HAS_ASOUNDLIB_H, 1, ) fi if test $HAS_SOUNDCARD_H -eq 1; then @@ -242,8 +250,8 @@ fi dnl sanity tests. if test "$alsa" = yes; then - if test $HAS_ALSASOUND_H -eq 0; then - AC_MSG_ERROR([You need alsasound.h to use --enable-alsa]) + if test $HAS_ASOUNDLIB_H -eq 0; then + AC_MSG_ERROR([You need asoundlib.h to use --enable-alsa]) fi fi @@ -259,6 +267,10 @@ if test "$portaudio" = yes; then fi fi +dnl +AC_SUBST(CPPFLAGS, "${CPPFLAGS}") +AC_SUBST(LDFLAGS, "${LDFLAGS}") + AC_OUTPUT echo From 8a708402af6119e070a3e52a17d2af020bb959ec Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 9 Jan 2006 21:30:35 +0000 Subject: [PATCH 039/811] - check correct HAS_ASOUNDLIB_H flag in start_threads.c - look for alsa/asoundlib.h and set HAS_ASOUNDLIB_H if present - also rework Makefile to pass proper flags This should be it for alsa and portaudio. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@70 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 4 +- conf.h.in | 4 +- configure | 114 ++---------------------------------------------- configure.ac | 3 +- jtaudio.c | 25 +++++++++-- start_threads.c | 10 ++--- 6 files changed, 34 insertions(+), 126 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7856dcb40..a4e405a52 100644 --- a/Makefile.in +++ b/Makefile.in @@ -12,7 +12,7 @@ G95=@G95@ COMPILER=@G95_LIB_PATH@ LDFLAGS += -L${COMPILER} -LIBS = -lpthread -lg2c +LDFLAGS += -lpthread -lg2c PYTHON ?= @PYTHON@ RM ?= @RM@ @@ -58,7 +58,7 @@ wsjt6: Audio.so #wsjt.spec Audio.so: $(OBJS2C) ${PYTHON} ${F2PY_PY} -c --verbose --opt="-O -cpp -D${OS} \ -fno-second-underscore" $(OBJS2C) -m Audio \ - --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} ${LIBS} \ + --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ only: $(F2PYONLY) \ : $(SRCS2F90) \ $(SRCS2F77) \ diff --git a/conf.h.in b/conf.h.in index d3541dcef..eaf2b7947 100644 --- a/conf.h.in +++ b/conf.h.in @@ -46,8 +46,8 @@ /* Define if you have /usr/include/sys/param.h */ #undef HAVE_SYS_PARAM_H -/* Define if you have alsasound.h */ -#undef HAS_ALSASOUND_H +/* Define if you have asoundlib.h */ +#undef HAS_ASOUNDLIB_H /* Define if you want to use ALSA */ #undef USE_ALSA diff --git a/configure b/configure index 04ae9ea10..4cdee79c4 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 64 2006-01-08 18:19:01Z va3db $ +# $Id: configure.ac 69 2006-01-09 19:18:03Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 64 2006-01-08 18:19:01Z va3db $ +$Id: configure.ac 69 2006-01-09 19:18:03Z va3db $ _ACEOF exit 0 fi @@ -3869,114 +3869,6 @@ else fi -if test "${ac_cv_header_sys_asoundlib_h+set}" = set; then - echo "$as_me:$LINENO: checking for sys/asoundlib.h" >&5 -echo $ECHO_N "checking for sys/asoundlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_asoundlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_asoundlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_asoundlib_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking sys/asoundlib.h usability" >&5 -echo $ECHO_N "checking sys/asoundlib.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking sys/asoundlib.h presence" >&5 -echo $ECHO_N "checking sys/asoundlib.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/asoundlib.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/asoundlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/asoundlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/asoundlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/asoundlib.h: proceeding with the preprocessor's result" >&2;};; -esac -echo "$as_me:$LINENO: checking for sys/asoundlib.h" >&5 -echo $ECHO_N "checking for sys/asoundlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_asoundlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_sys_asoundlib_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_asoundlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_asoundlib_h" >&6 - -fi -if test $ac_cv_header_sys_asoundlib_h = yes; then - HAS_ASOUNDLIB_H=1 -else - HAS_ASOUNDLIB_H=0 -fi - - if test "${ac_cv_header_portaudio_h+set}" = set; then echo "$as_me:$LINENO: checking for portaudio.h" >&5 echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 @@ -5722,7 +5614,7 @@ _ACEOF AUDIO="start_threads.c" - LDFLAGS="-Lpthreads ${LDFLAGS}" + LDFLAGS="${LDFLAGS} -lpthreads -lasound" fi if test "$oss" = yes; then diff --git a/configure.ac b/configure.ac index 090b40600..3964b1b6d 100644 --- a/configure.ac +++ b/configure.ac @@ -101,7 +101,6 @@ AC_HEADER_STDC AC_CHECK_HEADERS([inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h ]) AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) AC_CHECK_HEADER([alsa/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) -AC_CHECK_HEADER([sys/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) AC_CHECK_HEADER([portaudio.h], [HAS_PORTAUDIO_H=1], [HAS_PORTAUDIO_H=0]) dnl See whether we can include both string.h and strings.h. @@ -221,7 +220,7 @@ AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) AC_SUBST(AUDIO, "start_threads.c") - LDFLAGS="-Lpthreads ${LDFLAGS}" + LDFLAGS="${LDFLAGS} -lpthreads -lasound" fi if test "$oss" = yes; then diff --git a/jtaudio.c b/jtaudio.c index b39b7ea5c..fbd4dbeb6 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -1,7 +1,5 @@ -#ifdef Win32 - #include -#include "portaudio.h" +#include // Definition of structure pointing to the audio data typedef struct @@ -37,7 +35,27 @@ typedef struct _SYSTEMTIME short Millisecond; } SYSTEMTIME; +#ifdef Win32 extern void __stdcall GetSystemTime(SYSTEMTIME *st); +#else +#include +#include + +void GetSystemTime(SYSTEMTIME *st){ + struct timeval tmptimeofday; + struct tm tmptmtime; + gettimeofday(&tmptimeofday,NULL); + gmtime_r(&tmptimeofday.tv_sec,&tmptmtime); + st->Year = (short)tmptmtime.tm_year; + st->Month = (short)tmptmtime.tm_year; + st->DayOfWeek = (short)tmptmtime.tm_wday; + st->Day = (short)tmptmtime.tm_mday; + st->Hour = (short)tmptmtime.tm_hour; + st->Minute = (short)tmptmtime.tm_min; + st->Second = (short)tmptmtime.tm_sec; + st->Millisecond = (short)(tmptimeofday.tv_usec/1000); +} +#endif // Input callback routine: static int SoundIn( void *inputBuffer, void *outputBuffer, @@ -346,4 +364,3 @@ int padevsub_(int *numdev, int *ndefin, int *ndefout, return err; } -#endif diff --git a/start_threads.c b/start_threads.c index 4ea21c192..7fb488e69 100644 --- a/start_threads.c +++ b/start_threads.c @@ -6,18 +6,18 @@ /* * XXX This should have been caught in the sanity tests in configure --db */ -#if defined(USE_ALSA) && !defined(HAS_ALSASOUND_H) +#if defined(USE_ALSA) && !defined(HAS_ASOUNDLIB_H) #error "You must have alsa support to use alsa" #endif -#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H) +#if defined(USE_ALSA) && defined(HAS_ASOUNDLIB_H) #include #endif #include #include -#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H) +#if defined(USE_ALSA) && defined(HAS_ASOUNDLIB_H) #if 1 #define ALSA_LOG @@ -519,7 +519,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int iarg1 = 1,iarg2 = 2; //int32_t rate=11025; int32_t rate=*nfsample; -#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H) +#if defined(USE_ALSA) && defined(HAS_ASOUNDLIB_H) alsa_driver_capture.app_buffer_y1 = y1; alsa_driver_capture.app_buffer_y2 = y2; alsa_driver_capture.app_buffer_offset = iwrite; @@ -539,7 +539,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], #endif printf("start threads called\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); -#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H) +#if defined(USE_ALSA) && defined(HAS_ASOUNDLIB_H) /* Open audio card. */ ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); From f95e01d28f188c6b584fa332a5eb4062014d52bb Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 9 Jan 2006 21:35:25 +0000 Subject: [PATCH 040/811] - forgot to add -lportaudio git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@71 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 5 +++-- configure.ac | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 4cdee79c4..e6392354d 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 69 2006-01-09 19:18:03Z va3db $ +# $Id: configure.ac 70 2006-01-09 21:30:35Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 69 2006-01-09 19:18:03Z va3db $ +$Id: configure.ac 70 2006-01-09 21:30:35Z va3db $ _ACEOF exit 0 fi @@ -5635,6 +5635,7 @@ _ACEOF AUDIO="jtaudio.c" + LDFLAGS="${LDFLAGS} -lpthreads -lportaudio" fi diff --git a/configure.ac b/configure.ac index 3964b1b6d..e513ce912 100644 --- a/configure.ac +++ b/configure.ac @@ -231,6 +231,7 @@ fi if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "jtaudio.c") + LDFLAGS="${LDFLAGS} -lpthreads -lportaudio" fi dnl set conf flags From f504e95c0338865afcbf389940a6c67009805060 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Tue, 10 Jan 2006 02:43:23 +0000 Subject: [PATCH 041/811] - ok, this should enable Bobs portaudio fixes and ALSA depending on --enable options. This will have to be cleaned up a lot more to minimise #ifdef's a2d_() is needed for portaudio which is needed by both windows and *nix but only a small piece of start_threads.c is needed for portaudio the ALSA part is #ifdef'd out when USE_PORTAUDIO is enabled. audio_init.f90 and a2d.f90 now have #ifdef's on USE_PORTAUDIO instead of Win32. Lots to do still. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@73 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 14 ++++++++++---- a2d.f90 | 3 ++- audio_init.f90 | 4 +++- configure | 27 ++++++++++++++------------- configure.ac | 23 +++++++++++++---------- start_threads.c | 23 ++++++++++------------- 6 files changed, 52 insertions(+), 42 deletions(-) diff --git a/Makefile.in b/Makefile.in index a4e405a52..d20f43885 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3,6 +3,7 @@ FC ?= @F77@ FFLAGS = @FFLAGS@ LDFLAGS = @LDFLAGS@ CPPFLAGS = @CPPFLAGS@ +CFLAGS = @CFLAGS@ # # WSJT specific Fortran flags FFLAGS += -Wall -fbounds-check @@ -12,7 +13,7 @@ G95=@G95@ COMPILER=@G95_LIB_PATH@ LDFLAGS += -L${COMPILER} -LDFLAGS += -lpthread -lg2c +LDFLAGS += -lg2c PYTHON ?= @PYTHON@ RM ?= @RM@ @@ -35,14 +36,19 @@ SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ wsjtgen.f90 runqqq.f90 fivehz.f90 SRCS2F77 = wsjt1.f fsubs1.f fsubs.f astro.f astropak.f # -# ok, so far for Windows @AUDIO@ will be jtaudio.c since it uses portaudio -# for *nix @AUDIO@ will also be jtaudio.c for portaudio +# ok, so far for now +# Windows @AUDIO@ will be jtaudio.c since it uses portaudio +# for *nix @AUDIO@ will also be jtaudio.c and start_threads.c +# for portaudio # for *nix @AUDIO@ will be start_threads.c for alsa # for *nix @AUDIO@ will be ?? for oss # # ptt_unix.c vs. ptt.c I'll sort out later. # ditto for cutil.c (only used on *nix) # --db +# jtaudio.c/start_threads.c mess will have to be sorted out later +# to minimise #ifdef's +# --db # SRCS2C = ptt_unix.c igray.c wrapkarn.c cutil.c SRCS2C += @AUDIO@ @@ -56,7 +62,7 @@ wsjt6: Audio.so #wsjt.spec # ${RM} wsjt6 Audio.so: $(OBJS2C) - ${PYTHON} ${F2PY_PY} -c --verbose --opt="-O -cpp -D${OS} \ + ${PYTHON} ${F2PY_PY} -c --verbose --opt="-O -cpp -D${CFLAGS} \ -fno-second-underscore" $(OBJS2C) -m Audio \ --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ only: $(F2PYONLY) \ diff --git a/a2d.f90 b/a2d.f90 index 8ee572251..71809c42e 100644 --- a/a2d.f90 +++ b/a2d.f90 @@ -1,7 +1,8 @@ !---------------------------------------------------- a2d subroutine a2d(iarg) -#ifdef Win32 +#if 1 +!--- # ifdef USE_PORTAUDIO ! Start the PortAudio streams for audio input and output. integer nchin(0:20),nchout(0:20) include 'gcom1.f90' diff --git a/audio_init.f90 b/audio_init.f90 index 2b1915481..1cbe3207c 100644 --- a/audio_init.f90 +++ b/audio_init.f90 @@ -5,8 +5,10 @@ subroutine audio_init(ndin,ndout) #ifdef Win32 use dfmt integer Thread1,Thread2 - external a2d,decode1 #endif +#ifdef USE_PORTAUDIO + external a2d,decode1 +#endif integer*2 a(225000) !Pixel values for 750 x 300 array integer brightness,contrast diff --git a/configure b/configure index e6392354d..8e24295c4 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 70 2006-01-09 21:30:35Z va3db $ +# $Id: configure.ac 71 2006-01-09 21:35:25Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 70 2006-01-09 21:30:35Z va3db $ +$Id: configure.ac 71 2006-01-09 21:35:25Z va3db $ _ACEOF exit 0 fi @@ -2198,7 +2198,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$OLD_CFLAGS" CPPFLAGS="-I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" -LDFLAGS="-L/usr/local/lib ${LDFLAGS}" +LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" echo "$as_me:$LINENO: checking uname -s for Cygwin, Solaris or HPUX" >&5 echo $ECHO_N "checking uname -s for Cygwin, Solaris or HPUX... $ECHO_C" >&6 @@ -2236,15 +2236,15 @@ echo $ECHO_N "checking if $CC is Apple GCC... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $AppleGCC" >&5 echo "${ECHO_T}$AppleGCC" >&6 - WSJT_CFLAGS="$WSJT_CFLAGS -Wall -O0" + CFLAGS="$CFLAGS -Wall -O0" fi if test "$ac_cv_prog_cc_g" = yes; then - WSJT_CFLAGS="$WSJT_CFLAGS -g" + CFLAGS="$CFLAGS -g" fi if test ! -z "$CFLAGS"; then - WSJT_CFLAGS="$WSJT_CFLAGS $CFLAGS" + CFLAGS="$CFLAGS $CFLAGS" fi @@ -5556,11 +5556,10 @@ _ACEOF fi - if test "$prefix" = "NONE"; then cat >>confdefs.h <<_ACEOF -#define WSJT_PREFIX "$ac_default_prefix" +#define PREFIX "$ac_default_prefix" _ACEOF @@ -5570,7 +5569,7 @@ else prefix=`echo $prefix | sed 's/\/$//'` cat >>confdefs.h <<_ACEOF -#define WSJT_PREFIX "$prefix" +#define PREFIX "$prefix" _ACEOF @@ -5614,7 +5613,7 @@ _ACEOF AUDIO="start_threads.c" - LDFLAGS="${LDFLAGS} -lpthreads -lasound" + LDFLAGS="${LDFLAGS} -lpthread -lasound" fi if test "$oss" = yes; then @@ -5633,9 +5632,11 @@ cat >>confdefs.h <<\_ACEOF #define USE_PORTAUDIO 1 _ACEOF - AUDIO="jtaudio.c" + AUDIO="jtaudio.c start_threads.c" - LDFLAGS="${LDFLAGS} -lpthreads -lportaudio" + LDFLAGS="${LDFLAGS} -lportaudio" + CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" + CPPFLAGS="${CPPFLAGS} -DUSE_PORTAUDIO" fi @@ -5689,6 +5690,7 @@ CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" + 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 @@ -6272,7 +6274,6 @@ s,@G95@,$G95,;t t s,@G95_LIB_PATH@,$G95_LIB_PATH,;t t s,@OS@,$OS,;t t s,@CLOBBER@,$CLOBBER,;t t -s,@WSJT_CFLAGS@,$WSJT_CFLAGS,;t t s,@AUDIO@,$AUDIO,;t t CEOF diff --git a/configure.ac b/configure.ac index e513ce912..568570029 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ CFLAGS="$OLD_CFLAGS" dnl Lets guess at some likely places for extra libs/includes XXX -db CPPFLAGS="-I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" -LDFLAGS="-L/usr/local/lib ${LDFLAGS}" +LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX]) case `uname -s` in @@ -52,19 +52,19 @@ if test "$ac_cv_c_compiler_gnu" = yes; then AC_MSG_RESULT($AppleGCC) - WSJT_CFLAGS="$WSJT_CFLAGS -Wall -O0" + CFLAGS="$CFLAGS -Wall -O0" fi dnl If we support -g, use it! if test "$ac_cv_prog_cc_g" = yes; then - WSJT_CFLAGS="$WSJT_CFLAGS -g" + CFLAGS="$CFLAGS -g" fi dnl jdc -- If CFLAGS is defined, best use it everywhere... dnl NOTE: jv says it must be added to the *END*, because things like dnl "gcc -O9 -O2" will result in -O2 getting preference. How stupid. if test ! -z "$CFLAGS"; then - WSJT_CFLAGS="$WSJT_CFLAGS $CFLAGS" + CFLAGS="$CFLAGS $CFLAGS" fi @@ -177,10 +177,9 @@ if test "$assert" = no; then AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.]) fi -AC_SUBST(WSJT_CFLAGS) if test "$prefix" = "NONE"; then - AC_DEFINE_UNQUOTED(WSJT_PREFIX, "$ac_default_prefix", [Prefix where wsjt is installed.]) + AC_DEFINE_UNQUOTED(PREFIX, "$ac_default_prefix", [Prefix where wsjt is installed.]) else @@ -188,7 +187,7 @@ dnl Don't get bitten by Cygwin's stupidity if the user specified dnl a custom prefix with a trailing slash prefix=`echo $prefix | sed 's/\/$//'` - AC_DEFINE_UNQUOTED(WSJT_PREFIX, "$prefix", [Prefix where wsjt is installed.]) + AC_DEFINE_UNQUOTED(PREFIX, "$prefix", [Prefix where wsjt is installed.]) fi @@ -220,7 +219,7 @@ AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) AC_SUBST(AUDIO, "start_threads.c") - LDFLAGS="${LDFLAGS} -lpthreads -lasound" + LDFLAGS="${LDFLAGS} -lpthread -lasound" fi if test "$oss" = yes; then @@ -228,10 +227,13 @@ if test "$oss" = yes; then AC_SUBST(AUDIO, "jtaudio.c") fi +dnl XXX if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) - AC_SUBST(AUDIO, "jtaudio.c") - LDFLAGS="${LDFLAGS} -lpthreads -lportaudio" + AC_SUBST(AUDIO, "jtaudio.c start_threads.c") + LDFLAGS="${LDFLAGS} -lportaudio" + CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" + CPPFLAGS="${CPPFLAGS} -DUSE_PORTAUDIO" fi dnl set conf flags @@ -270,6 +272,7 @@ fi dnl AC_SUBST(CPPFLAGS, "${CPPFLAGS}") AC_SUBST(LDFLAGS, "${LDFLAGS}") +AC_SUBST(CFLAGS) AC_OUTPUT diff --git a/start_threads.c b/start_threads.c index 7fb488e69..85d2d1cd3 100644 --- a/start_threads.c +++ b/start_threads.c @@ -3,21 +3,18 @@ #include #include "conf.h" -/* - * XXX This should have been caught in the sanity tests in configure --db - */ -#if defined(USE_ALSA) && !defined(HAS_ASOUNDLIB_H) -#error "You must have alsa support to use alsa" -#endif - -#if defined(USE_ALSA) && defined(HAS_ASOUNDLIB_H) +#ifdef USE_ALSA #include #endif #include #include -#if defined(USE_ALSA) && defined(HAS_ASOUNDLIB_H) +#ifdef USE_PORTAUDIO +extern a2d_(); +#endif + +#ifdef USE_ALSA #if 1 #define ALSA_LOG @@ -519,7 +516,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int iarg1 = 1,iarg2 = 2; //int32_t rate=11025; int32_t rate=*nfsample; -#if defined(USE_ALSA) && defined(HAS_ASOUNDLIB_H) +#ifdef USE_ALSA alsa_driver_capture.app_buffer_y1 = y1; alsa_driver_capture.app_buffer_y2 = y2; alsa_driver_capture.app_buffer_offset = iwrite; @@ -539,7 +536,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], #endif printf("start threads called\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); -#if defined(USE_ALSA) && defined(HAS_ASOUNDLIB_H) +#ifdef USE_ALSA /* Open audio card. */ ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); @@ -552,8 +549,8 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], snd_pcm_start(alsa_driver_capture.audio_fd); snd_pcm_prepare(alsa_driver_playback.audio_fd); //snd_pcm_start(alsa_driver_playback.audio_fd); - +#else /* snd_pcm_start */ - //iret2 = pthread_create(&thread2,NULL,a2d_,&iarg2); + iret2 = pthread_create(&thread2,NULL,a2d_,&iarg2); #endif } From 1a7eba842120ff5c865c4a90a64751bf7ec1c61c Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Tue, 10 Jan 2006 04:30:03 +0000 Subject: [PATCH 042/811] - clean up start_threads.c using bob's start_threads.c as template - always define -pthread - make sure right libs are passed along git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@74 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 6 +++--- configure.ac | 2 +- start_threads.c | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 8e24295c4..ba1037222 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 71 2006-01-09 21:35:25Z va3db $ +# $Id: configure.ac 73 2006-01-10 02:43:23Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 71 2006-01-09 21:35:25Z va3db $ +$Id: configure.ac 73 2006-01-10 02:43:23Z va3db $ _ACEOF exit 0 fi @@ -5613,7 +5613,7 @@ _ACEOF AUDIO="start_threads.c" - LDFLAGS="${LDFLAGS} -lpthread -lasound" + LDFLAGS="${LDFLAGS} -lasound" fi if test "$oss" = yes; then diff --git a/configure.ac b/configure.ac index 568570029..6cfe929b6 100644 --- a/configure.ac +++ b/configure.ac @@ -219,7 +219,7 @@ AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) AC_SUBST(AUDIO, "start_threads.c") - LDFLAGS="${LDFLAGS} -lpthread -lasound" + LDFLAGS="${LDFLAGS} -lasound" fi if test "$oss" = yes; then diff --git a/start_threads.c b/start_threads.c index 85d2d1cd3..475935bca 100644 --- a/start_threads.c +++ b/start_threads.c @@ -11,7 +11,8 @@ #include #ifdef USE_PORTAUDIO -extern a2d_(); +extern void decode1_(int *iarg); +extern void a2d_(int *iarg); #endif #ifdef USE_ALSA @@ -551,6 +552,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], //snd_pcm_start(alsa_driver_playback.audio_fd); #else /* snd_pcm_start */ - iret2 = pthread_create(&thread2,NULL,a2d_,&iarg2); + iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); + iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); #endif } From 7ce8878e3a894badf3fe79f432e04c06a279da6e Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Tue, 10 Jan 2006 05:00:34 +0000 Subject: [PATCH 043/811] - I forgot -lsamplerate git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@75 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 6 +++--- configure.ac | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index ba1037222..e817c5614 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 73 2006-01-10 02:43:23Z va3db $ +# $Id: configure.ac 74 2006-01-10 04:30:03Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 73 2006-01-10 02:43:23Z va3db $ +$Id: configure.ac 74 2006-01-10 04:30:03Z va3db $ _ACEOF exit 0 fi @@ -5634,7 +5634,7 @@ _ACEOF AUDIO="jtaudio.c start_threads.c" - LDFLAGS="${LDFLAGS} -lportaudio" + LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" CPPFLAGS="${CPPFLAGS} -DUSE_PORTAUDIO" fi diff --git a/configure.ac b/configure.ac index 6cfe929b6..fec6be215 100644 --- a/configure.ac +++ b/configure.ac @@ -231,7 +231,7 @@ dnl XXX if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "jtaudio.c start_threads.c") - LDFLAGS="${LDFLAGS} -lportaudio" + LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" CPPFLAGS="${CPPFLAGS} -DUSE_PORTAUDIO" fi From 2cf6ea1f894655e42fb9a086103406c5d3d51291 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Tue, 10 Jan 2006 16:36:04 +0000 Subject: [PATCH 044/811] - Added samplerate.h check - Try to guess at a default between portaudio and alsa for now - changed "samplerate.h" to in resample.c git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@76 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++- configure.ac | 25 +++++++++ resample.c | 2 +- 3 files changed, 165 insertions(+), 3 deletions(-) diff --git a/configure b/configure index e817c5614..af01816fc 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 74 2006-01-10 04:30:03Z va3db $ +# $Id: configure.ac 75 2006-01-10 05:00:34Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 74 2006-01-10 04:30:03Z va3db $ +$Id: configure.ac 75 2006-01-10 05:00:34Z va3db $ _ACEOF exit 0 fi @@ -3977,6 +3977,114 @@ else fi +if test "${ac_cv_header_samplerate_h+set}" = set; then + echo "$as_me:$LINENO: checking for samplerate.h" >&5 +echo $ECHO_N "checking for samplerate.h... $ECHO_C" >&6 +if test "${ac_cv_header_samplerate_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_samplerate_h" >&5 +echo "${ECHO_T}$ac_cv_header_samplerate_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking samplerate.h usability" >&5 +echo $ECHO_N "checking samplerate.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking samplerate.h presence" >&5 +echo $ECHO_N "checking samplerate.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: samplerate.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: samplerate.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: samplerate.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: samplerate.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: samplerate.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for samplerate.h" >&5 +echo $ECHO_N "checking for samplerate.h... $ECHO_C" >&6 +if test "${ac_cv_header_samplerate_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_samplerate_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_samplerate_h" >&5 +echo "${ECHO_T}$ac_cv_header_samplerate_h" >&6 + +fi +if test $ac_cv_header_samplerate_h = yes; then + HAS_SAMPLERATE_H=1 +else + HAS_SAMPLERATE_H=0 +fi + + echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6 @@ -5661,6 +5769,27 @@ _ACEOF fi +if test $HAS_SAMPLERATE_H -eq 1; then + cat >>confdefs.h <<\_ACEOF +#define HAS_SAMPLERATE_H 1 +_ACEOF + +fi + + +if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then + if test $HAS_PORTAUDIO_H -eq 1; then + set portaudio = yes; + echo "$as_me:$LINENO: result: Using portaudio" >&5 +echo "${ECHO_T}Using portaudio" >&6 + elif test $HAS_ASOUNDLIB_H -eq 1; then + set alsa = yes; + echo "$as_me:$LINENO: result: Using alsa" >&5 +echo "${ECHO_T}Using alsa" >&6 + fi +fi + + if test "$alsa" = yes; then if test $HAS_ASOUNDLIB_H -eq 0; then { { echo "$as_me:$LINENO: error: You need asoundlib.h to use --enable-alsa" >&5 @@ -5681,16 +5810,24 @@ if test "$portaudio" = yes; then if test $HAS_PORTAUDIO_H -eq 0; then { { echo "$as_me:$LINENO: error: You need portaudio.h to use --enable-portaudio" >&5 echo "$as_me: error: You need portaudio.h to use --enable-portaudio" >&2;} + { (exit 1); exit 1; }; } + fi + if test $HAS_SAMPLERATE_H -eq 0; then + { { echo "$as_me:$LINENO: error: You need samplerate.h to use --enable-portaudio" >&5 +echo "$as_me: error: You need samplerate.h to use --enable-portaudio" >&2;} { (exit 1); exit 1; }; } fi fi + CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" + + 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 diff --git a/configure.ac b/configure.ac index fec6be215..182626409 100644 --- a/configure.ac +++ b/configure.ac @@ -102,6 +102,7 @@ AC_CHECK_HEADERS([inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/sys AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) AC_CHECK_HEADER([alsa/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) AC_CHECK_HEADER([portaudio.h], [HAS_PORTAUDIO_H=1], [HAS_PORTAUDIO_H=0]) +AC_CHECK_HEADER([samplerate.h], [HAS_SAMPLERATE_H=1], [HAS_SAMPLERATE_H=0]) dnl See whether we can include both string.h and strings.h. AC_CACHE_CHECK([whether string.h and strings.h may both be included], @@ -250,7 +251,24 @@ if test $HAS_PORTAUDIO_H -eq 1; then AC_DEFINE(HAS_PORTAUDIO_H, 1, ) fi +if test $HAS_SAMPLERATE_H -eq 1; then + AC_DEFINE(HAS_SAMPLERATE_H, 1, ) +fi + +dnl set defaults + +if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then + if test $HAS_PORTAUDIO_H -eq 1; then + set portaudio = yes; + AC_MSG_RESULT([Using portaudio]) + elif test $HAS_ASOUNDLIB_H -eq 1; then + set alsa = yes; + AC_MSG_RESULT([Using alsa]) + fi +fi + dnl sanity tests. + if test "$alsa" = yes; then if test $HAS_ASOUNDLIB_H -eq 0; then AC_MSG_ERROR([You need asoundlib.h to use --enable-alsa]) @@ -267,14 +285,21 @@ if test "$portaudio" = yes; then if test $HAS_PORTAUDIO_H -eq 0; then AC_MSG_ERROR([You need portaudio.h to use --enable-portaudio]) fi + if test $HAS_SAMPLERATE_H -eq 0; then + AC_MSG_ERROR([You need samplerate.h to use --enable-portaudio]) + fi fi + dnl AC_SUBST(CPPFLAGS, "${CPPFLAGS}") AC_SUBST(LDFLAGS, "${LDFLAGS}") AC_SUBST(CFLAGS) + + AC_OUTPUT +dnl do summary echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" diff --git a/resample.c b/resample.c index b1feb83ee..f45d1eb2f 100644 --- a/resample.c +++ b/resample.c @@ -1,5 +1,5 @@ #include -#include "samplerate.h" +#include int resample_( float din[], float dout[], double *samfac, int *jz) { From 05989ec612f583c45c5d3b53138b71f5fca6f888 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 10 Jan 2006 20:32:53 +0000 Subject: [PATCH 045/811] Tweaked fivehztx.f90 to give correct fsample with the alsa callback. Removed the divide-by-2 of input samples in portaudio callback. Re-activated #ifdef USE_PORTAUDIO in a2d.f90. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@80 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- a2d.f90 | 4 ++-- fivehz.f90 | 6 +++--- jtaudio.c | 4 ++-- wsjt.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/a2d.f90 b/a2d.f90 index 71809c42e..7dc05af9f 100644 --- a/a2d.f90 +++ b/a2d.f90 @@ -1,8 +1,8 @@ !---------------------------------------------------- a2d subroutine a2d(iarg) -#if 1 -!--- # ifdef USE_PORTAUDIO +!#if 1 +# ifdef USE_PORTAUDIO ! Start the PortAudio streams for audio input and output. integer nchin(0:20),nchout(0:20) include 'gcom1.f90' diff --git a/fivehz.f90 b/fivehz.f90 index 02443cb4e..9de6a2dd0 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -190,7 +190,6 @@ subroutine fivehztx if(first) then first=.false. ncall=-1 - tt0=tt fsample=11025.d0 nsec0=-999 u=0.05d0 @@ -198,8 +197,9 @@ subroutine fivehztx endif ncall=ncall+1 - if(ncall.gt.0) then - fs=ncall*2048.d0/(tt-tt0) + if(ncall.eq.8) tt0=tt + if(ncall.gt.8) then + fs=(ncall-8)*2048.d0/(tt-tt0) fsample=u*fs + (1.d0-u)*fsample mfsample2=nint(10.d0*fsample) endif diff --git a/jtaudio.c b/jtaudio.c index fbd4dbeb6..c1a78b9ac 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -113,8 +113,8 @@ static int SoundIn( void *inputBuffer, void *outputBuffer, *data->ibuf=ib; data->tbuf[ib-1]=stime; for(i=0; iy1[ia] = (*in++)>>1; //NB: divide by 2! - data->y2[ia] = (*in++)>>1; + data->y1[ia] = (*in++); + data->y2[ia] = (*in++); ia++; } } diff --git a/wsjt.py b/wsjt.py index 2eec00775..f1d4c2c6d 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#----------------------------------------------------------- WSJT +#------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw From d373a39dfbdceef4b5bab74f590b67673b3e2838 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 10 Jan 2006 21:24:49 +0000 Subject: [PATCH 046/811] Fixed thread creation for portaudio in start_threads.c. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@81 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 8 +++++--- wsjt.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/start_threads.c b/start_threads.c index 475935bca..678bdec89 100644 --- a/start_threads.c +++ b/start_threads.c @@ -535,10 +535,11 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_playback.transmitting = Transmitting; alsa_driver_playback.ndsec = ndsec; #endif - printf("start threads called\n"); + printf("start_threads creating thread for decode1\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); #ifdef USE_ALSA /* Open audio card. */ + printf("Starting alsa routines\n"); ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); @@ -552,7 +553,8 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], //snd_pcm_start(alsa_driver_playback.audio_fd); #else /* snd_pcm_start */ - iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); - iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); + printf("start_threads creating thread for a2d\n"); + iret1 = pthread_create(&thread2,NULL,a2d_,&iarg1); + // iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); #endif } diff --git a/wsjt.py b/wsjt.py index f1d4c2c6d..2eec00775 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------ WSJT +#----------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From cfc66c91ef935af2e0ee80c95fc01e40663cb471 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Tue, 10 Jan 2006 21:35:37 +0000 Subject: [PATCH 047/811] - cleaned up the configure a bit more, it will now pick a default audio method if none given. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@82 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 4 ++-- configure | 44 +++++++++++++++++++++++++++++--------------- configure.ac | 44 ++++++++++++++++++++++++++++++++------------ 3 files changed, 63 insertions(+), 29 deletions(-) diff --git a/Makefile.in b/Makefile.in index d20f43885..898aafb54 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,7 @@ wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py # --tk --onefile wsjt.py jtaudio.o: jtaudio.c - $(CC) -c $(CPPFLAGS) jtaudio.c + $(CC) -c $(CLAGS) jtaudio.c init_rs_int.o: init_rs.c $(CC) -c -DBIGSYM=1 -o init_rs_int.o init_rs.c @@ -102,7 +102,7 @@ igray.o: igray.c $(CC) -c igray.c start_threads.o: start_threads.c - $(CC) -c start_threads.c + $(CC) -c $(CFLAGS) start_threads.c .PHONY : clean clean: diff --git a/configure b/configure index af01816fc..3f2247535 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 75 2006-01-10 05:00:34Z va3db $ +# $Id: configure.ac 76 2006-01-10 16:36:04Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 75 2006-01-10 05:00:34Z va3db $ +$Id: configure.ac 76 2006-01-10 16:36:04Z va3db $ _ACEOF exit 0 fi @@ -5713,6 +5713,16 @@ else portaudio=no fi; + + +if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then + if test $HAS_PORTAUDIO_H -eq 1; then + portaudio=yes; + elif test $HAS_ASOUNDLIB_H -eq 1; then + alsa=yes; + fi +fi + if test "$alsa" = yes; then cat >>confdefs.h <<\_ACEOF @@ -5722,6 +5732,8 @@ _ACEOF AUDIO="start_threads.c" LDFLAGS="${LDFLAGS} -lasound" + CFLAGS="${CFLAGS} -DUSE_ALSA" + CPPFLAGS="${CPPFLAGS} -DUSE_ALSA" fi if test "$oss" = yes; then @@ -5777,19 +5789,6 @@ _ACEOF fi -if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then - if test $HAS_PORTAUDIO_H -eq 1; then - set portaudio = yes; - echo "$as_me:$LINENO: result: Using portaudio" >&5 -echo "${ECHO_T}Using portaudio" >&6 - elif test $HAS_ASOUNDLIB_H -eq 1; then - set alsa = yes; - echo "$as_me:$LINENO: result: Using alsa" >&5 -echo "${ECHO_T}Using alsa" >&6 - fi -fi - - if test "$alsa" = yes; then if test $HAS_ASOUNDLIB_H -eq 0; then { { echo "$as_me:$LINENO: error: You need asoundlib.h to use --enable-alsa" >&5 @@ -6857,6 +6856,21 @@ if test "$no_create" != yes; then fi +echo +echo + +if test $portaudio == "yes"; then + echo "Using portaudio"; +fi + +if test $alsa == "yes"; then + echo "Using alsa"; +fi + +if test $oss == "yes"; then + echo "Using oss"; +fi + echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/configure.ac b/configure.ac index 182626409..2876e5a69 100644 --- a/configure.ac +++ b/configure.ac @@ -217,10 +217,26 @@ AC_ARG_ENABLE(portaudio, AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), [portaudio=$enableval], [portaudio=no]) +dnl now set conf.h,, CPPFLAGS and CFLAGS flags as needed +dnl ==================================================== + +dnl set defaults +dnl ============ + +if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then + if test $HAS_PORTAUDIO_H -eq 1; then + [portaudio=yes]; + elif test $HAS_ASOUNDLIB_H -eq 1; then + [alsa=yes]; + fi +fi + if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) AC_SUBST(AUDIO, "start_threads.c") LDFLAGS="${LDFLAGS} -lasound" + CFLAGS="${CFLAGS} -DUSE_ALSA" + CPPFLAGS="${CPPFLAGS} -DUSE_ALSA" fi if test "$oss" = yes; then @@ -255,19 +271,8 @@ if test $HAS_SAMPLERATE_H -eq 1; then AC_DEFINE(HAS_SAMPLERATE_H, 1, ) fi -dnl set defaults - -if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then - if test $HAS_PORTAUDIO_H -eq 1; then - set portaudio = yes; - AC_MSG_RESULT([Using portaudio]) - elif test $HAS_ASOUNDLIB_H -eq 1; then - set alsa = yes; - AC_MSG_RESULT([Using alsa]) - fi -fi - dnl sanity tests. +dnl ============= if test "$alsa" = yes; then if test $HAS_ASOUNDLIB_H -eq 0; then @@ -301,6 +306,21 @@ AC_SUBST(CFLAGS) AC_OUTPUT dnl do summary +echo +echo + +if test $portaudio == "yes"; then + echo "Using portaudio"; +fi + +if test $alsa == "yes"; then + echo "Using alsa"; +fi + +if test $oss == "yes"; then + echo "Using oss"; +fi + echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo From afeb1cf2cfa8c8dded6cadcdb99dc85bd5bcd4ad Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 11 Jan 2006 02:57:23 +0000 Subject: [PATCH 048/811] - reconcile start_threads.c to agree with Bob's version in branch portaudio Notice that I have an explicit #ifdef USE_PORTAUDIO for later use. The alsa code was swapping around the original iret1 iret2 and thread1 thread2 also making it confusing. This should 100% agree with what Bob had now for USE_PORTAUDIO. This code should be re-factored if we are keeping alsa, start_threads.c should have no audio code in it. Something like jtaudio_portaudio.c jtaudio_alsa.c jtaudio_oss.c would be what I would do, with the file to compile chosen at configure time. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@83 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/start_threads.c b/start_threads.c index 678bdec89..bab0244bd 100644 --- a/start_threads.c +++ b/start_threads.c @@ -515,9 +515,9 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], pthread_t thread1,thread2; int iret1,iret2; int iarg1 = 1,iarg2 = 2; +#ifdef USE_ALSA //int32_t rate=11025; int32_t rate=*nfsample; -#ifdef USE_ALSA alsa_driver_capture.app_buffer_y1 = y1; alsa_driver_capture.app_buffer_y2 = y2; alsa_driver_capture.app_buffer_offset = iwrite; @@ -534,10 +534,8 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_playback.nmode = nmode; alsa_driver_playback.transmitting = Transmitting; alsa_driver_playback.ndsec = ndsec; -#endif printf("start_threads creating thread for decode1\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); -#ifdef USE_ALSA /* Open audio card. */ printf("Starting alsa routines\n"); ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); @@ -551,10 +549,12 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], snd_pcm_start(alsa_driver_capture.audio_fd); snd_pcm_prepare(alsa_driver_playback.audio_fd); //snd_pcm_start(alsa_driver_playback.audio_fd); -#else +#endif +#ifdef USE_PORTAUDIO /* snd_pcm_start */ printf("start_threads creating thread for a2d\n"); - iret1 = pthread_create(&thread2,NULL,a2d_,&iarg1); - // iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); + iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); + printf("start_threads creating thread for decode1_\n"); + iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); #endif } From 624bcc3cbd4aa7818e3af0aec79b946821c6e8ad Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 11 Jan 2006 17:06:25 +0000 Subject: [PATCH 049/811] 1. Turned off debugging messages in start_threads.c, audio_init.f90. 2. Tweaked code that measures sampling rates (in fivehz and fivehztx) so that it works well with both PortAudio and bare ALSA. 3. Added a "Using PortAudio" message to a2d.f90. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@84 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- a2d.f90 | 2 ++ audio_init.f90 | 2 +- fivehz.f90 | 17 +++++++++-------- jtaudio.c | 2 +- start_threads.c | 12 ++++++------ 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/a2d.f90 b/a2d.f90 index 7dc05af9f..4bdfe632b 100644 --- a/a2d.f90 +++ b/a2d.f90 @@ -11,6 +11,8 @@ subroutine a2d(iarg) ! This call does not normally return, as the background portion of ! JTaudio goes into a test-and-sleep loop. + write(*,1000) +1000 format('Using PortAudio.') idevin=ndevin idevout=ndevout call padevsub(numdevs,ndefin,ndefout,nchin,nchout) diff --git a/audio_init.f90 b/audio_init.f90 index 1cbe3207c..e4fd80935 100644 --- a/audio_init.f90 +++ b/audio_init.f90 @@ -60,7 +60,7 @@ subroutine audio_init(ndin,ndout) m3=SetThreadPriority(Thread2,THREAD_PRIORITY_BELOW_NORMAL) m4=ResumeThread(Thread2) #else - print*,'Audio INIT called.' +! print*,'Audio INIT called.' ierr=start_threads(ndevin,ndevout,y1,y2,nmax,iwrite,iwave,nwave, & 11025,NSPB,TRPeriod,TxOK,ndebug,Transmitting, & Tsec,ngo,nmode,tbuf,ibuf,ndsec) diff --git a/fivehz.f90 b/fivehz.f90 index 9de6a2dd0..7fa92a8b1 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -40,7 +40,7 @@ subroutine fivehz ibuf00=-99 ncall=-1 tt0=tt - u=0.05d0 + u=0.1d0 fsample=11025.d0 maxms=0 mfsample=110250 @@ -51,8 +51,9 @@ subroutine fivehz ! Measure average sampling frequency over a recent interval ncall=ncall+1 - if(ncall.gt.0) then - fs=ncall*2048.d0/(tt-tt0) + if(ncall.eq.9) tt0=tt + if(ncall.ge.10 .and. mod(ncall,2).eq.1) then + fs=(ncall-9)*2048.d0/(tt-tt0) fsample=u*fs + (1.d0-u)*fsample mfsample=nint(10.d0*fsample) endif @@ -192,17 +193,17 @@ subroutine fivehztx ncall=-1 fsample=11025.d0 nsec0=-999 - u=0.05d0 + u=0.1d0 mfsample2=110250 + tt0=tt endif ncall=ncall+1 - if(ncall.eq.8) tt0=tt - if(ncall.gt.8) then - fs=(ncall-8)*2048.d0/(tt-tt0) + if(ncall.eq.9) tt0=tt + if(ncall.ge.10 .and. mod(ncall,2).eq.1) then + fs=(ncall-9)*2048.d0/(tt-tt0) fsample=u*fs + (1.d0-u)*fsample mfsample2=nint(10.d0*fsample) endif - return end subroutine fivehztx diff --git a/jtaudio.c b/jtaudio.c index c1a78b9ac..0df7a9808 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -341,7 +341,7 @@ int padevsub_(int *numdev, int *ndefin, int *ndefout, } - printf("\n Audio Input Output Device Name\n"); + printf("\nAudio Input Output Device Name\n"); printf("Device Channels Channels\n"); printf("------------------------------------------------------------------\n"); diff --git a/start_threads.c b/start_threads.c index bab0244bd..643fd9811 100644 --- a/start_threads.c +++ b/start_threads.c @@ -17,7 +17,7 @@ extern void a2d_(int *iarg); #ifdef USE_ALSA -#if 1 +#if 0 #define ALSA_LOG #define ALSA_LOG_BUFFERS #endif @@ -266,7 +266,7 @@ static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_st /* Check for pause/resume support */ this->has_pause_resume = ( snd_pcm_hw_params_can_pause (params) && snd_pcm_hw_params_can_resume (params) ); - printf( "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume); + // printf( "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume); this->sample_rate_factor = (double) this->output_sample_rate / (double) this->input_sample_rate; this->bytes_per_frame = snd_pcm_frames_to_bytes (this->audio_fd, 1); /* @@ -534,10 +534,10 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_playback.nmode = nmode; alsa_driver_playback.transmitting = Transmitting; alsa_driver_playback.ndsec = ndsec; - printf("start_threads creating thread for decode1\n"); + // printf("start_threads: creating thread for decode1\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); /* Open audio card. */ - printf("Starting alsa routines\n"); + printf("Starting alsa routines.\n"); ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); @@ -552,9 +552,9 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], #endif #ifdef USE_PORTAUDIO /* snd_pcm_start */ - printf("start_threads creating thread for a2d\n"); + // printf("start_threads: creating thread for a2d\n"); iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); - printf("start_threads creating thread for decode1_\n"); + // printf("start_threads: creating thread for decode1_\n"); iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); #endif } From 44600fef28dfdb38feeb2dbb9e49b52154abea97 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 11 Jan 2006 19:04:51 +0000 Subject: [PATCH 050/811] Merged changes to wsjt.py, specjt.py from tags/release-5.9.2. Added README_592.TXT and WSJT592.iss. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@85 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- README_592.TXT | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ WSJT592.iss | 24 +++++++++++++++ specjt.py | 34 +++++++++++++-------- wsjt.py | 45 ++++++++++++++++++++-------- 4 files changed, 159 insertions(+), 25 deletions(-) create mode 100755 README_592.TXT create mode 100755 WSJT592.iss diff --git a/README_592.TXT b/README_592.TXT new file mode 100755 index 000000000..3f1ca9d8a --- /dev/null +++ b/README_592.TXT @@ -0,0 +1,81 @@ +Changes in WSJT 5.9.2: January 10, 2006 +--------------------------------------- + +Enhancements +------------ + +1. Thread priorities have been adjusted for smoother operation. One + result is that there will be fewer audio glitches caused by the + Windows O/S paying attention to other programs. + +2. The JT65 decoder has improved immunity to "garbage data," and + it exhibits better performance on strong signals. + +3. The FSK441 decoder produces less on-screen gibberish when you do + mouse-picked decodes. + +4. The JT6M decoder now makes better use of Freeze and Tol. You can + set the value of "Freeze DF" by using the Right/Left arrow keys. + +5. On-screen font sizes can be set by using Windows Notepad to edit + the file wsjtrc.win. If your screen has resolution greater than + 1024 x 768, or if you have old eyes (like mine), you may want to + increase the sizes from 8 and 9 (first three lines of the file) to + 9 and 10, say. + +6. Dividing lines are now provided on the waterfall display between + spectra corresponding to wave files read from disk. + +7. The PTT line is explicitly set low on program startup. + +8. The F10 key brings up the SpecJT screen (if it was hidden) and + toggles focus between the WSJT and SpecJT screens. + +9. Use the Alt-F keyboard shortcut to toggle "Freeze", and Alt-Z to + toggle "Zap". + +10. "Accelerated decoding" HAS BEEN removed from the Setup menu. + In effect, it is now always ON. + + +Bug Fixes: +---------- +1. The use of non-threadsafe code for FFTs caused occasional and + unpredictable program crashes. Fixed. + +2. A bug in the JT65 decoder could (rarely) cause large errors in the + reported level of strong signals. Fixed. + +3. The program could be made to crash by trying to read a very short + wave file. Fixed. + + +Information for Programmers +--------------------------- + +WSJT is no longer a one-person effort. It has become a full-fledged +Open Source project, with an active working group making contributions +to future development. Source code is now stored in a public +repository under control of the Subversion (SVN) version control +system. You can learn more at +http://developer.berlios.de/projects/wsjt/. + +The first significant result of the group effort has been to create +versions of WSJT that run under the Linux and FreeBSD operating +systems. If you are interested in testing and using WSJT on your own +Linux or FreeBSD system, we'd like to hear from you. + +If you feel that you can usefully contribute to the future development +of WSJT on any platform, we would also like to hear from you! + +The present WSJT working group consists of: + + Diane Bruce, VA3DB + James Courtier-Dutton + Bob McGwier, N4HY + Jonathan Naylor, ON/G4KLX + Stewart Nelson, KK7A + Joe Taylor, K1JT + Kaj Wiik, OH6EH + + diff --git a/WSJT592.iss b/WSJT592.iss new file mode 100755 index 000000000..feaa5c481 --- /dev/null +++ b/WSJT592.iss @@ -0,0 +1,24 @@ +[Setup] +AppName=WSJT +AppVerName=WSJT Version 5.9.2 r77 +AppCopyright=Copyright (C) 2001-2005 by Joe Taylor, K1JT +DefaultDirName={pf}\WSJT6 +DefaultGroupName=WSJT6 + +[Files] +Source: "c:\k1jt\svn\wsjt\release-5.9.2\WSJT6.EXE"; DestDir: "{app}" +Source: "c:\k1jt\svn\wsjt\release-5.9.2\README_592.TXT"; DestDir: "{app}" +Source: "c:\k1jt\svn\wsjt\release-5.9.2\CALL3.TXT"; DestDir: "{app}"; Flags: onlyifdoesntexist +Source: "c:\k1jt\svn\wsjt\release-5.9.2\wsjt.ico"; DestDir: "{app}"; Flags: onlyifdoesntexist +Source: "c:\k1jt\svn\wsjt\release-5.9.2\TSKY.DAT"; DestDir: "{app}"; Flags: onlyifdoesntexist +Source: "c:\k1jt\svn\wsjt\release-5.9.2\libsamplerate.dll"; DestDir: "{app}"; Flags: onlyifdoesntexist +Source: "c:\k1jt\svn\wsjt\release-5.9.2\kvasd.exe"; DestDir: "{app}"; +Source: "c:\k1jt\svn\wsjt\release-5.9.2\wsjtrc.win"; DestDir: "{app}"; +Source: "c:\k1jt\svn\wsjt\release-5.9.2\Tutorial_592.txt"; DestDir: "{app}"; +Source: "c:\k1jt\python\wsjt\rxwav\samples\W8WN_010809_110400.WAV"; DestDir: "{app}\RxWav\Samples\"; Flags: onlyifdoesntexist + +[Icons] +Name: "{group}\WSJT6"; Filename: "{app}\WSJT6.EXE"; WorkingDir: {app} +Name: "{userdesktop}\WSJT6"; Filename: "{app}\WSJT6.EXE"; WorkingDir: {app} + + diff --git a/specjt.py b/specjt.py index c2bd63b45..4f2d04824 100644 --- a/specjt.py +++ b/specjt.py @@ -19,8 +19,10 @@ from palettes import colormapblue, colormapgray0, colormapHot, \ def hidespecjt(): root.withdraw() + g.showspecjt=0 def showspecjt(): root.deiconify() + g.showspecjt=2 if(__name__=="__main__"): root = Tk() @@ -153,17 +155,18 @@ def df_mark(): if g.mode[4:5]=='C': fstep=4*fstep # Mark sync tone and top JT65 tone (green) and shorthand tones (red) - color='green' - x1=(Audio.gcom2.mousedf + 6.6*fstep)/df + 288.7 - c.create_line(x1-0.5,25,x1-0.5,12,fill=color) - c.create_line(x1+0.5,25,x1+0.5,12,fill=color) - for i in range(5): - x1=(Audio.gcom2.mousedf+i*fstep)/df + 288.7 - j=12 - if i>0: j=15 - if i!=1: c.create_line(x1-0.5,25,x1-0.5,j,fill=color) - if i!=1: c.create_line(x1+0.5,25,x1+0.5,j,fill=color) - color='red' + if g.mode[:4]=="JT65": + color='green' + x1=(Audio.gcom2.mousedf + 6.6*fstep)/df + 288.7 + c.create_line(x1-0.5,25,x1-0.5,12,fill=color) + c.create_line(x1+0.5,25,x1+0.5,12,fill=color) + for i in range(5): + x1=(Audio.gcom2.mousedf+i*fstep)/df + 288.7 + j=12 + if i>0: j=15 + if i!=1: c.create_line(x1-0.5,25,x1-0.5,j,fill=color) + if i!=1: c.create_line(x1+0.5,25,x1+0.5,j,fill=color) + color='red' #---------------------------------------------------- decode_request def decode_request(event): @@ -202,9 +205,8 @@ def update(): if isec==0: nscroll=0 if isec==59: newMinute=1 - if g.showspecjt: + if g.showspecjt==1: showspecjt() - g.showspecjt=0 nspeed=nspeed0.get() #Waterfall update rate if (nspeed<6 and nspeed00>=6) or (nspeed>=6 and nspeed00<6): draw_axis() @@ -279,6 +281,9 @@ def update(): nfreeze0=int(Audio.gcom2.nfreeze) if g.mode!=mode0: + if g.mode[:4]=="JT65" and nspeed0.get()>5: nspeed0.set(3) + if g.mode=="FSK441" and nspeed0.get()<6: nspeed0.set(6) + if g.mode=="JT6M" and nspeed0.get()<6: nspeed0.set(6) draw_axis() mode0=g.mode @@ -289,6 +294,8 @@ def update(): if newdat: Audio.gcom2.ndiskdat=0 Audio.gcom2.nlines=0 Audio.gcom2.nflat=nflat.get() + if g.focus==2: + root.focus_set() ltime.after(200,update) #Reset the timer #-------------------------------------------------------- draw_axis @@ -484,6 +491,7 @@ Audio.audio_init(ndevin,ndevout) #Start the audio stream ltime.after(200,update) root.deiconify() +g.showspecjt=2 if g.Win32: root.iconbitmap("wsjt.ico") root.title(' SpecJT by K1JT') if(__name__=="__main__"): diff --git a/wsjt.py b/wsjt.py index 2eec00775..58dd56901 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#----------------------------------------------------------- WSJT +#------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw @@ -95,9 +95,18 @@ g.freeze_decode=0 g.mode="" g.ndevin=IntVar() g.ndevout=IntVar() +g.focus=0 #------------------------------------------------------ showspecjt def showspecjt(event=NONE): - g.showspecjt=1 + if g.showspecjt>0: + if g.focus>=1: + root.focus_set() + g.focus=0 + else: + g.focus=2 + else: + g.focus=2 + g.showspecjt=1 #------------------------------------------------------ restart def restart(): @@ -113,6 +122,10 @@ def restart2(): def toggle_freeze(event=NONE): nfreeze.set(1-nfreeze.get()) +#------------------------------------------------------ toggle_zap +def toggle_zap(event=NONE): + nzap.set(1-nzap.get()) + #------------------------------------------------------ btx (1-6) def btx1(event=NONE): ntx.set(1) @@ -668,10 +681,10 @@ Alt-A Toggle Auto On/Off Alt-D Decode Alt-E Erase Alt-F Toggle Freeze -Alt-G Generate Standard Messages +Alt-G Generate Standard Messages Alt-I Include -Alt-L Lookup -CTRL-L Lookup, then Generate Standard Messages +Alt-L Lookup +CTRL-L Lookup, then Generate Standard Messages Alt-M Monitor Alt-O Tx Stop Alt-P Play @@ -679,6 +692,8 @@ Alt-Q Log QSO Alt-S Stop Monitoring or Decoding Alt-V Save Last Alt-X Exclude +Alt-Z Toggle Zap +Right/Left Arrow Increase/decrease Freeze DF """ Label(scwid,text=t,justify=LEFT).pack(padx=20) scwid.focus_set() @@ -692,15 +707,15 @@ def mouse_commands(event=NONE): Click on Action -------------------------------------------------------- Waterfall FSK441/JT6M: click to decode ping - JT65: Click to set DF for Freeze + JT65: Click to set DF for Freeze Double-click to Freeze and Decode Main screen, FSK441/JT6M: click to decode ping graphics area JT65: Click to set DF for Freeze - Double-click to Freeze and Decode + Double-click to Freeze and Decode Main screen, Double-click puts callsign in Tx messages -text area Right-double-click also sets Auto ON +text area Right-double-click also sets Auto ON Sync, Clip, Left/Right click to increase/decrease Tol, ... @@ -976,11 +991,15 @@ def mouse_up_g1(event): #------------------------------------------------------ right_arrow def right_arrow(event=NONE): - Audio.gcom2.mousedf=Audio.gcom2.mousedf+10 + n=5*int(Audio.gcom2.mousedf/5) + 5 + if n==Audio.gcom2.mousedf: n=n+5 + Audio.gcom2.mousedf=n #------------------------------------------------------ left_arrow def left_arrow(event=NONE): - Audio.gcom2.mousedf=Audio.gcom2.mousedf-10 + n=5*int(Audio.gcom2.mousedf/5) + if n==Audio.gcom2.mousedf: n=n-5 + Audio.gcom2.mousedf=n #------------------------------------------------------ GenStdMsgs def GenStdMsgs(event=NONE): @@ -1665,6 +1684,8 @@ root.bind_all('',savelast) root.bind_all('',savelast) root.bind_all('',decode_exclude) root.bind_all('',decode_exclude) +root.bind_all('',toggle_zap) +root.bind_all('',toggle_zap) root.bind_all('',lookup_gen) root.bind_all('',lookup_gen) root.bind_all('',left_arrow) @@ -1759,11 +1780,11 @@ lsync.grid(column=0,row=0,padx=2,pady=1,sticky='EW') Widget.bind(lsync,'',incsync) Widget.bind(lsync,'',decsync) nzap=IntVar() -cbzap=Checkbutton(f5b,text='Zap',variable=nzap) +cbzap=Checkbutton(f5b,text='Zap',underline=0,variable=nzap) cbzap.grid(column=1,row=0,padx=2,pady=1,sticky='W') cbnb=Checkbutton(f5b,text='NB',variable=nblank) cbnb.grid(column=1,row=1,padx=2,pady=1,sticky='W') -cbfreeze=Checkbutton(f5b,text='Freeze',variable=nfreeze) +cbfreeze=Checkbutton(f5b,text='Freeze',underline=0,variable=nfreeze) cbfreeze.grid(column=1,row=2,padx=2,sticky='W') cbafc=Checkbutton(f5b,text='AFC',variable=nafc) cbafc.grid(column=1,row=3,padx=2,pady=1,sticky='W') From d7c23a875a57847e34c88e1aaeaa5c1a20013999 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 11 Jan 2006 20:16:13 +0000 Subject: [PATCH 051/811] - Cleaned up Makefile to use F2PY instead of calling Python fixed some dependancies to force recompile if a file is changed. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@86 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 898aafb54..212c9fe80 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,10 +15,9 @@ COMPILER=@G95_LIB_PATH@ LDFLAGS += -L${COMPILER} LDFLAGS += -lg2c -PYTHON ?= @PYTHON@ RM ?= @RM@ +PYTHON ?= @PYTHON@ F2PY = @F2PY@ -F2PY_PY = "f2py.py" OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \ @@ -61,8 +60,8 @@ wsjt6: Audio.so #wsjt.spec # ${PYTHON} c:\python23\installer\Build.py wsjt.spec # ${RM} wsjt6 -Audio.so: $(OBJS2C) - ${PYTHON} ${F2PY_PY} -c --verbose --opt="-O -cpp -D${CFLAGS} \ +Audio.so: $(OBJS2C) $(SRCS2F90) $(SRCS2F77) $(SRCS2C) + ${F2PY} -c --verbose --opt="-O -cpp -D${CFLAGS} \ -fno-second-underscore" $(OBJS2C) -m Audio \ --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ only: $(F2PYONLY) \ From d462134d7ef04159776266f78bc1c16cddc4e8f0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 11 Jan 2006 20:17:51 +0000 Subject: [PATCH 052/811] Tweaked ibuf0 in fivehz.f90 to give DT=0 with local SimJT. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@88 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- fivehz.f90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fivehz.f90 b/fivehz.f90 index 7fa92a8b1..32130fdae 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -91,6 +91,8 @@ subroutine fivehz if(ntr.ne.ntr0) then ibuf0=ibuf !Start of new sequence, save ibuf + ibuf0=ibuf0-3 !Tweak the Rx start time + if(ibuf0.lt.1) ibuf0=ibuf0+1024 ! if(mode(1:4).ne.'JT65') then ! ibuf0=ibuf0+3 !So we don't copy our own Tx ! if(ibuf0.gt.1024) ibuf0=ibuf0-1024 From c0e156d98c4085e8043e82add490fb110dab7cb3 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Thu, 12 Jan 2006 05:13:07 +0000 Subject: [PATCH 053/811] - Ok, added some rules to build .c, .f and .f90 objects Next step will be to break up the huge f2py git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@89 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/Makefile.in b/Makefile.in index 212c9fe80..327dce73a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,16 +1,17 @@ CC ?= @CC@ -FC ?= @F77@ FFLAGS = @FFLAGS@ LDFLAGS = @LDFLAGS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ + # # WSJT specific Fortran flags -FFLAGS += -Wall -fbounds-check +FFLAGS += -cpp -Wall -fbounds-check -fno-second-underscore OS=@OS@ G95=@G95@ COMPILER=@G95_LIB_PATH@ +FC=@G95@ LDFLAGS += -L${COMPILER} LDFLAGS += -lg2c @@ -26,14 +27,17 @@ OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ igray.o init_rs_int.o encode_rs_int.o decode_rs_int.o \ wrapkarn.o -OBJS2C = init_rs.o encode_rs.o decode_rs.o +OBJS2C = init_rs.o encode_rs.o decode_rs.o F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ wsjtgen.f90 runqqq.f90 fivehz.f90 +OBJS2F290 = ${SRCS2F90:.f90=.o} + SRCS2F77 = wsjt1.f fsubs1.f fsubs.f astro.f astropak.f +OBJS2F77 = ${SRCS2F77:.f=.o} # # ok, so far for now # Windows @AUDIO@ will be jtaudio.c since it uses portaudio @@ -60,7 +64,9 @@ wsjt6: Audio.so #wsjt.spec # ${PYTHON} c:\python23\installer\Build.py wsjt.spec # ${RM} wsjt6 -Audio.so: $(OBJS2C) $(SRCS2F90) $(SRCS2F77) $(SRCS2C) +# +# +Audio.so: $(OBJS2C) $(OBJS2F90) $(OBJS2F77) ${F2PY} -c --verbose --opt="-O -cpp -D${CFLAGS} \ -fno-second-underscore" $(OBJS2C) -m Audio \ --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ @@ -73,9 +79,10 @@ wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py # ${PYTHON} c:\python23\installer\makespec.py --icon wsjt.ico \ # --tk --onefile wsjt.py -jtaudio.o: jtaudio.c - $(CC) -c $(CLAGS) jtaudio.c - +# +# compiles which are "non standard" +# and should not be compiled by the default .c to .o rule +# init_rs_int.o: init_rs.c $(CC) -c -DBIGSYM=1 -o init_rs_int.o init_rs.c @@ -94,16 +101,17 @@ encode_rs.o: encode_rs.c decode_rs.o: decode_rs.c $(CC) -c -DBIGSYM=1 decode_rs.c -wrapkarn.o: wrapkarn.c - $(CC) -c wrapkarn.c +# The default rules +.c.o: + ${CC} ${CPPFLAGS} ${CFLAGS} -c -o ${<:.c=.o} $< -igray.o: igray.c - $(CC) -c igray.c +.f.o: + ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f=.o} $< -start_threads.o: start_threads.c - $(CC) -c $(CFLAGS) start_threads.c +.f90.o: + ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f90=.o} $< .PHONY : clean clean: - ${RM} -f *.o *.so JT65code wsjt6 + ${RM} -f *.o *.so *~ JT65code wsjt6 From 60889230ed9d1964783f327f2f98daf6a2858385 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 12 Jan 2006 22:10:21 +0000 Subject: [PATCH 054/811] Added Makefile.in.joe (temporary, for information). Fixed array bounds for ccfblue in wsjt65.f, sync65.f, xcor.f. Edited README_592.TXT git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@90 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in.joe | 126 ++++++++++++++++++++++++++++++++++++++++++++++++ README_592.TXT | 25 +++++----- sync65.f | 2 +- wsjt65.f | 2 +- xcor.f | 2 +- 5 files changed, 141 insertions(+), 16 deletions(-) create mode 100644 Makefile.in.joe diff --git a/Makefile.in.joe b/Makefile.in.joe new file mode 100644 index 000000000..b67622399 --- /dev/null +++ b/Makefile.in.joe @@ -0,0 +1,126 @@ +CC ?= @CC@ +FFLAGS = @FFLAGS@ +LDFLAGS = @LDFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CFLAGS = @CFLAGS@ +CFLAGS += -DBIGSYM + +# WSJT specific Fortran flags +#FFLAGS += -Wall -fbounds-check -cpp -fno-second-underscore +FFLAGS = -O2 -cpp -w -fno-second-underscore + +OS=@OS@ +G95=@G95@ +COMPILER=@G95_LIB_PATH@ +FC=@G95@ + +LDFLAGS += -L${COMPILER} +LDFLAGS += -lg2c + +PYTHON ?= @PYTHON@ +RM ?= @RM@ +F2PY = @F2PY@ +F2PY_PY = "f2py.py" + +%.o : %.f90 + $(FC) -c $(FFLAGS) $< -o $@ + +OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ + packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \ + unpackgrid.o deg2grid.o packdxcc.o chkmsg.o getpfx1.o \ + getpfx2.o k2grid.o grid2k.o interleave63.o graycode.o set.o \ + igray.o init_rs.o encode_rs.o decode_rs.o \ + wrapkarn.o + +F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 + +SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ + blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ + ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ + i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ + wsjtgen.f90 runqqq.f90 fivehz.f90 + +OBJS2F90 = a2d.o abc441.o astro0.o audio_init.o azdist0.o \ + blanker.o decode1.o decode2.o decode3.o ftn_init.o \ + ftn_quit.o get_fname.o getfile.o horizspec.o hscroll.o \ + i1tor4.o pix2d.o pix2d65.o rfile.o savedata.o spec.o \ + wsjtgen.o runqqq.o fivehz.o + +SRCS2F77 = wsjt1.f astro.f astropak.f \ + avesp2.f bzap.f spec441.f spec2d.f mtdecode.f stdecode.f \ + indexx.f s2shape.f flat2.f gen65.f chkmsg.f gen6m.f gentone.f \ + syncf0.f syncf1.f synct.f decode6m.f avemsg6m.f \ + set.f flatten.f db.f pctile.f sort.f ssort.f ps.f smooth.f \ + ping.f longx.f peakup.f sync.f detect.f avemsg65.f decode65.f \ + demod64a.f encode65.f extract.f flat1.f four2.f rfile2.f \ + gencw.f getpfx1.f getpfx2.f getsnr.f graycode.f grid2k.f \ + interleave63.f k2grid.f limit.f lpf1.f deep65.f morse.f \ + nchar.f packcall.f packgrid.f packmsg.f packtext.f setup65.f \ + short65.f slope.f spec2d65.f sync65.f unpackcall.f \ + unpackgrid.f unpackmsg.f unpacktext.f xcor.f xfft.f wsjt65.f + +OBJS2F77 = wsjt1.o astro.o astropak.o \ + avesp2.o bzap.o spec441.o spec2d.o mtdecode.o stdecode.o \ + indexx.o s2shape.o flat2.o gen65.o chkmsg.o gen6m.o gentone.o \ + syncf0.o syncf1.o synct.o decode6m.o avemsg6m.o \ + set.o flatten.o db.o pctile.o sort.o ssort.o ps.o smooth.o \ + ping.o longx.o peakup.o sync.o detect.o avemsg65.o decode65.o \ + demod64a.o encode65.o extract.o flat1.o four2.o rfile2.o \ + gencw.o getpfx1.o getpfx2.o getsnr.o graycode.o grid2k.o \ + interleave63.o k2grid.o limit.o lpf1.o deep65.o morse.o \ + nchar.o packcall.o packgrid.o packmsg.o packtext.o setup65.o \ + short65.o slope.o spec2d65.o sync65.o unpackcall.o \ + unpackgrid.o unpackmsg.o unpacktext.o xcor.o xfft.o wsjt65.o + +#OBJS2F90 = a2d.o abc441.o astro0.o audio_init.o azdist0.o \ +# blanker.o decode1.o decode2.o decode3.o ftn_init.o \ +# ftn_quit.o get_fname.o getfile.o horizspec.o hscroll.o \ +# i1tor4.o pix2d.o pix2d65.o rfile.o savedata.o spec.o \ +# wsjtgen.o runqqq.o fivehz.o + +# +# ok, so far for now +# Windows @AUDIO@ will be jtaudio.c since it uses portaudio +# for *nix @AUDIO@ will also be jtaudio.c and start_threads.c +# for portaudio +# for *nix @AUDIO@ will be start_threads.c for alsa +# for *nix @AUDIO@ will be ?? for oss +# +# ptt_unix.c vs. ptt.c I'll sort out later. +# ditto for cutil.c (only used on *nix) +# --db +# jtaudio.c/start_threads.c mess will have to be sorted out later +# to minimise #ifdef's +# --db +# +OBJS2C = init_rs.o encode_rs.o decode_rs.o +SRCS3C = ptt_unix.c igray.c wrapkarn.c cutil.c +SRCS3C += @AUDIO@ + +all: JT65code wsjt6 + +JT65code: $(OBJS1) + $(FC) -o JT65code $(OBJS1) + +wsjt6: Audio.so #wsjt.spec +# ${PYTHON} c:\python23\installer\Build.py wsjt.spec +# ${RM} wsjt6 + +Audio.so: $(OBJS2C) $(OBJS2F77) $(SRCS2F90) ${SRCS3C} + ${PYTHON} ${F2PY_PY} -c --quiet --opt="-O -cpp -D${CFLAGS} \ + -fno-second-underscore" $(OBJS2C) $(OBJS2F77) -m Audio \ + --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ + only: $(F2PYONLY) : \ + $(SRCS2F90) \ + ${SRCS3C} + +wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py +# ${PYTHON} c:\python23\installer\makespec.py --icon wsjt.ico \ +# --tk --onefile wsjt.py + +four2.o: four2.f + $(FC) -c -O2 four2.f + +.PHONY : clean +clean: + ${RM} -f *.o *.so JT65code wsjt6 diff --git a/README_592.TXT b/README_592.TXT index 3f1ca9d8a..ee9577e34 100755 --- a/README_592.TXT +++ b/README_592.TXT @@ -17,11 +17,11 @@ Enhancements 4. The JT6M decoder now makes better use of Freeze and Tol. You can set the value of "Freeze DF" by using the Right/Left arrow keys. -5. On-screen font sizes can be set by using Windows Notepad to edit - the file wsjtrc.win. If your screen has resolution greater than - 1024 x 768, or if you have old eyes (like mine), you may want to - increase the sizes from 8 and 9 (first three lines of the file) to - 9 and 10, say. +5. On-screen font sizes can be set by using Windows Notepad (or + another text editor) to edit the file wsjtrc.win. If your screen + has resolution greater than 1024 x 768, or if you have old eyes + like mine, you may want to increase the sizes from 8 and 9 (first + three lines of the file) to 9 and 10, say. 6. Dividing lines are now provided on the waterfall display between spectra corresponding to wave files read from disk. @@ -29,13 +29,13 @@ Enhancements 7. The PTT line is explicitly set low on program startup. 8. The F10 key brings up the SpecJT screen (if it was hidden) and - toggles focus between the WSJT and SpecJT screens. + toggles foreground and focus between the WSJT and SpecJT screens. -9. Use the Alt-F keyboard shortcut to toggle "Freeze", and Alt-Z to - toggle "Zap". +9. You can use the Alt-F keyboard shortcut to toggle "Freeze", and + Alt-Z to toggle "Zap". -10. "Accelerated decoding" HAS BEEN removed from the Setup menu. - In effect, it is now always ON. +10. "Accelerated decoding" has been removed from the Setup menu. In + effect, it is now always ON. Bug Fixes: @@ -56,8 +56,8 @@ Information for Programmers WSJT is no longer a one-person effort. It has become a full-fledged Open Source project, with an active working group making contributions to future development. Source code is now stored in a public -repository under control of the Subversion (SVN) version control -system. You can learn more at +repository under control of a version control system called +Subversion, or SVN. You can learn more at http://developer.berlios.de/projects/wsjt/. The first significant result of the group effort has been to create @@ -73,7 +73,6 @@ The present WSJT working group consists of: Diane Bruce, VA3DB James Courtier-Dutton Bob McGwier, N4HY - Jonathan Naylor, ON/G4KLX Stewart Nelson, KK7A Joe Taylor, K1JT Kaj Wiik, OH6EH diff --git a/sync65.f b/sync65.f index 6fb2f08b6..b122af494 100644 --- a/sync65.f +++ b/sync65.f @@ -12,7 +12,7 @@ C NB: at this stage, submodes ABC are processed in the same way. real dat(jz) real psavg(NHMAX) !Average spectrum of whole record real s2(NHMAX,NSMAX) !2d spectrum, stepped by half-symbols - real ccfblue(-5:28) !CCF with pseudorandom sequence + real ccfblue(-5:540) !CCF with pseudorandom sequence real ccfred(-224:224) !Peak of ccfblue, as function of freq real tmp(450) integer itry(100) diff --git a/wsjt65.f b/wsjt65.f index 3505b4cbb..cbd34f559 100644 --- a/wsjt65.f +++ b/wsjt65.f @@ -19,7 +19,7 @@ C already been done. character*12 mycall character*12 hiscall character*6 hisgrid - real ccfblue(-5:28),ccfred(-224:224) + real ccfblue(-5:540),ccfred(-224:224) real ftrack(126) logical lmid integer itf(2,9) diff --git a/xcor.f b/xcor.f index 8742f8285..b33b391ac 100644 --- a/xcor.f +++ b/xcor.f @@ -10,7 +10,7 @@ C the "OOO" message. parameter (NSMAX=320) !Max number of half-symbol steps real s2(NHMAX,NSMAX) !2d spectrum, stepped by half-symbols real a(NSMAX),a2(NSMAX) - real ccf(-5:28) + real ccf(-5:540) include 'prcom.h' common/clipcom/ nclip data lagmin/0/ !Silence g77 warning From 22c1dc6c795208b7359575982d976d119fd47d6b Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Fri, 13 Jan 2006 01:50:01 +0000 Subject: [PATCH 055/811] - Ok, mix and match Makefile.in.joe into Makefile.in git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@91 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 87 +++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/Makefile.in b/Makefile.in index 327dce73a..d8cbd2e77 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3,10 +3,21 @@ FFLAGS = @FFLAGS@ LDFLAGS = @LDFLAGS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ +# WSJT specific C flags +CFLAGS += -DBIGSYM=1 -# # WSJT specific Fortran flags -FFLAGS += -cpp -Wall -fbounds-check -fno-second-underscore +#FFLAGS += -cpp -Wall -fbounds-check -fno-second-underscore +FFLAGS += -cpp -fno-second-underscore +# The default rules +.c.o: + ${CC} ${CPPFLAGS} ${CFLAGS} -c -o ${<:.c=.o} $< + +.f.o: + ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f=.o} $< + +.f90.o: + ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f90=.o} $< OS=@OS@ G95=@G95@ @@ -16,10 +27,11 @@ FC=@G95@ LDFLAGS += -L${COMPILER} LDFLAGS += -lg2c -RM ?= @RM@ PYTHON ?= @PYTHON@ +RM ?= @RM@ F2PY = @F2PY@ + OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \ unpackgrid.o deg2grid.o packdxcc.o chkmsg.o getpfx1.o \ @@ -27,18 +39,32 @@ OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ igray.o init_rs_int.o encode_rs_int.o decode_rs_int.o \ wrapkarn.o -OBJS2C = init_rs.o encode_rs.o decode_rs.o F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 + SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ wsjtgen.f90 runqqq.f90 fivehz.f90 -OBJS2F290 = ${SRCS2F90:.f90=.o} +OBJS2F90 = ${SRCS2F90:.f90=.o} + +SRCS2F77 = wsjt1.f astro.f astropak.f \ + avesp2.f bzap.f spec441.f spec2d.f mtdecode.f stdecode.f \ + indexx.f s2shape.f flat2.f gen65.f chkmsg.f gen6m.f gentone.f \ + syncf0.f syncf1.f synct.f decode6m.f avemsg6m.f \ + set.f flatten.f db.f pctile.f sort.f ssort.f ps.f smooth.f \ + ping.f longx.f peakup.f sync.f detect.f avemsg65.f decode65.f \ + demod64a.f encode65.f extract.f flat1.f four2.f rfile2.f \ + gencw.f getpfx1.f getpfx2.f getsnr.f graycode.f grid2k.f \ + interleave63.f k2grid.f limit.f lpf1.f deep65.f morse.f \ + nchar.f packcall.f packgrid.f packmsg.f packtext.f setup65.f \ + short65.f slope.f spec2d65.f sync65.f unpackcall.f \ + unpackgrid.f unpackmsg.f unpacktext.f xcor.f xfft.f wsjt65.f +OBJS2F77 = ${SRCS2F77:.f=.o} + +SRCS2C = init_rs.c encode_rs.c decode_rs.c +OBJS2C = ${SRCS2C:.c=.o} -SRCS2F77 = wsjt1.f fsubs1.f fsubs.f astro.f astropak.f -OBJS2F77 = ${SRCS2F77:.f=.o} -# # ok, so far for now # Windows @AUDIO@ will be jtaudio.c since it uses portaudio # for *nix @AUDIO@ will also be jtaudio.c and start_threads.c @@ -53,8 +79,9 @@ OBJS2F77 = ${SRCS2F77:.f=.o} # to minimise #ifdef's # --db # -SRCS2C = ptt_unix.c igray.c wrapkarn.c cutil.c -SRCS2C += @AUDIO@ +SRCS3C = ptt_unix.c igray.c wrapkarn.c cutil.c +SRCS3C += @AUDIO@ +OBJS3C = ${SRCS3C:.c=.o} all: wsjt6 JT65code: $(OBJS1) @@ -66,50 +93,18 @@ wsjt6: Audio.so #wsjt.spec # # -Audio.so: $(OBJS2C) $(OBJS2F90) $(OBJS2F77) - ${F2PY} -c --verbose --opt="-O -cpp -D${CFLAGS} \ - -fno-second-underscore" $(OBJS2C) -m Audio \ +Audio.so: $(OBJS2C) $(OBJS3C) $(OBJS2F77) $(SRCS2F90) + ${F2PY} -c --quiet --opt="-O -cpp -D${CFLAGS} \ + -fno-second-underscore" $(OBJS2C) $(OBJS2F77) -m Audio \ --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ only: $(F2PYONLY) \ : $(SRCS2F90) \ - $(SRCS2F77) \ - ${SRCS2C} + ${SRCS3C} wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py # ${PYTHON} c:\python23\installer\makespec.py --icon wsjt.ico \ # --tk --onefile wsjt.py -# -# compiles which are "non standard" -# and should not be compiled by the default .c to .o rule -# -init_rs_int.o: init_rs.c - $(CC) -c -DBIGSYM=1 -o init_rs_int.o init_rs.c - -encode_rs_int.o: encode_rs.c - $(CC) -c -DBIGSYM=1 -o encode_rs_int.o encode_rs.c - -decode_rs_int.o: decode_rs.c - $(CC) -c -DBIGSYM=1 -o decode_rs_int.o decode_rs.c - -init_rs.o: init_rs.c - $(CC) -c -DBIGSYM=1 init_rs.c - -encode_rs.o: encode_rs.c - $(CC) -c -DBIGSYM=1 encode_rs.c - -decode_rs.o: decode_rs.c - $(CC) -c -DBIGSYM=1 decode_rs.c - -# The default rules -.c.o: - ${CC} ${CPPFLAGS} ${CFLAGS} -c -o ${<:.c=.o} $< - -.f.o: - ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f=.o} $< - -.f90.o: - ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f90=.o} $< .PHONY : clean clean: From 66f86c3d659bc34dc8ebdf23406d0b394256d6df Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Fri, 13 Jan 2006 06:37:11 +0000 Subject: [PATCH 056/811] - in ftnstr() the argument coming in is not a python string but an array (from fortran), it should be converted to string before using it as one. This fixes the odd zeros() problem. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@92 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- g.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/g.py b/g.py index 0c5f286be..565ef7b07 100644 --- a/g.py +++ b/g.py @@ -10,8 +10,9 @@ showspecjt=0 #------------------------------------------------------ ftnstr def ftnstr(x): y="" - for i in range(len(x)): - y=y+x[i] + xs=x.tostring() + for i in range(len(xs)): + y=y+xs[i] return y #------------------------------------------------------ filetime From b483328e639ba6023069418e1c0230531c54a992 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Fri, 13 Jan 2006 06:39:29 +0000 Subject: [PATCH 057/811] - will need module array to deal with array tostring conversions - left in the types import as well for possible debugging. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@93 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wsjt.py b/wsjt.py index 58dd56901..02371599a 100644 --- a/wsjt.py +++ b/wsjt.py @@ -11,6 +11,8 @@ import dircache import Image,ImageTk #, ImageDraw from palettes import colormapblue, colormapgray0, colormapHot, \ colormapAFMHot, colormapgray1, colormapLinrad, Colormap2Palette +from types import * +import array root = Tk() Version="5.9.2 r" + "$Rev$"[6:-1] From c36054139acd3f7817e48080c4f6487df47d0f87 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 13 Jan 2006 07:11:57 +0000 Subject: [PATCH 058/811] Tweaked Makefile.win to compile properly in Win32 with recent #ifdef changes to audio_init.f90 git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@94 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.win b/Makefile.win index 2a7a7cdd1..dc503145c 100644 --- a/Makefile.win +++ b/Makefile.win @@ -50,7 +50,7 @@ WSJT6.EXE: Audio.pyd wsjt.spec Audio.pyd: $(OBJS2C) $(SRCS2F90) $(SRCS2F77) $(SRCS2C) python f2py.py -c \ --quiet --"fcompiler=compaqv" \ - --opt="/traceback /fast /fpp /define:Win32" \ + --opt="/traceback /fast /fpp /define:Win32 /define:USE_PORTAUDIO" \ $(OBJS2C) \ -lwinmm -lpa -llibsamplerate \ -m Audio \ From 076a01eba584cff5f793372f34b7f8e894503dde Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 13 Jan 2006 21:00:47 +0000 Subject: [PATCH 059/811] Added a simulation mode in which a specified SNR is generated. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@95 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- fivehz.f90 | 18 ++++++++++++++++++ gcom1.f90 | 3 ++- jtaudio.c | 8 ++++++-- wsjt.py | 21 ++++++++++++++++++--- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/fivehz.f90 b/fivehz.f90 index 32130fdae..df9950f62 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -209,3 +209,21 @@ subroutine fivehztx endif return end subroutine fivehztx + +subroutine addnoise(n) + integer*2 n + real r(12) + include 'gcom1.f90' + + if(txsnrdb.gt.90.0) return + snr=10.0**(0.05*(txsnrdb-1)) + call random_number(r) + x=sum(r)-6.0 + i=3000.0*x + n*snr*3000.0/32768.0 + if(i>32767) i=32767; + if(i<-32767) i=-32767; + n=i + + return +end subroutine addnoise + diff --git a/gcom1.f90 b/gcom1.f90 index 0ffc26b0c..e9515b5bd 100644 --- a/gcom1.f90 +++ b/gcom1.f90 @@ -11,6 +11,7 @@ real*8 rxdelay !Delay between PTT=1 and Tx audio SoundIn real*8 txdelay !Delay from end of Tx Audio and PTT=0 SoundOut real*8 samfacin !(Input sample rate)/11025 GUI real*8 samfacout !(Output sample rate)/11025 GUI +real*8 txsnrdb !SNR for simulations GUI integer*2 y1 !Ring buffer for audio channel 0 SoundIn integer*2 y2 !Ring buffer for audio channel 1 SoundIn integer nmax !Actual length of Rx ring buffers GUI @@ -41,7 +42,7 @@ integer mfsample2 !Measured sample rate, output SoundOut integer ns0 !Time at last ALL.TXT date entry Decoder common/gcom1/Tbuf(1024),ntrbuf(1024),Tsec,rxdelay,txdelay, & - samfacin,samfacout,y1(NRXMAX),y2(NRXMAX), & + samfacin,samfacout,txsnrdb,y1(NRXMAX),y2(NRXMAX), & nmax,iwrite,iread,iwave(NTXMAX),nwave,TxOK,Receiving,Transmitting, & TxFirst,TRPeriod,ibuf,ibuf0,ave,rms,ngo,level,mute,newdat,ndsec, & ndevin,ndevout,nx,mfsample,mfsample2,ns0 diff --git a/jtaudio.c b/jtaudio.c index 0df7a9808..1d17b4036 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -137,6 +137,7 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, short *in = (short*)inputBuffer; short *wptr = (short*)outputBuffer; unsigned int i,n; + static short n2; static int n0; static int ia=0; static int ib=0; @@ -167,6 +168,7 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, for(i=0 ; iTxOK) { + addnoise_(&data->iwave[ic]); *wptr++ = data->iwave[ic]; //left *wptr++ = data->iwave[ic]; //right ic++; @@ -177,8 +179,10 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, } } else { - *wptr++ = 0; //left - *wptr++ = 0; //right + n2=0; + addnoise_(&n2); + *wptr++ = n2; //left + *wptr++ = n2; //right } } fivehztx_(); //Call fortran routine diff --git a/wsjt.py b/wsjt.py index 02371599a..8eed72d75 100644 --- a/wsjt.py +++ b/wsjt.py @@ -86,6 +86,7 @@ setseq=IntVar() ShOK=IntVar() slabel="Sync " textheight=7 +txsnrdb=99. TxFirst=IntVar() green=zeros(500,'f') im=Image.new('P',(500,120)) @@ -892,6 +893,9 @@ def clear_avg(event=NONE): avetext.configure(state=NORMAL) avetext.delete('1.0',END) avetext.configure(state=DISABLED) + f=open(appdir+'/decoded.ave',mode='w') + f.truncate(0) #Delete contents of decoded.ave + f.close() Audio.gcom2.nclearave=1 #------------------------------------------------------ defaults @@ -1225,7 +1229,7 @@ def plot_yellow(): def update(): global root_geom,isec0,naz,nel,ndmiles,ndkm,nhotaz,nhotabetter,nopen, \ im,pim,cmap0,isync,isync441,isync6m,isync65,isync_save,idsec, \ - first,itol + first,itol,txsnrdb utc=time.gmtime(time.time()+0.1*idsec) isec=utc[5] @@ -1335,6 +1339,16 @@ def update(): tx4.configure(bg='white') tx5.configure(bg='white') tx6.configure(bg='white') + if tx6.get()[:1]=='#': + try: + txsnrdb=float(tx6.get()[1:]) + if txsnrdb>-99.0 and txsnrdb<10.0: + Audio.gcom1.txsnrdb=txsnrdb + tx6.configure(bg='orange') + except: + txsnrdb=99.0 + else: + txsnrdb=99.0 if Audio.gcom2.monitoring and not Audio.gcom1.transmitting: bmonitor.configure(bg='green') else: @@ -1347,8 +1361,9 @@ def update(): # t="Transmitting: " # t="Txing: "+t[:nmsg] bgcolor='yellow' - if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' - if Audio.gcom2.sendingsh==-1: bgcolor='red' + if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' #Shorthand + if Audio.gcom2.sendingsh==-1: bgcolor='red' #Plain Text + if txsnrdb<90.0: bgcolor='orange' #Simulation mode if Audio.gcom2.ntxnow==1: tx1.configure(bg=bgcolor) elif Audio.gcom2.ntxnow==2: tx2.configure(bg=bgcolor) elif Audio.gcom2.ntxnow==3: tx3.configure(bg=bgcolor) From ef47c8ba041ef2eb121b39fd74aa8d72da3e03c0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 13 Jan 2006 22:29:18 +0000 Subject: [PATCH 060/811] I mistakenly left the simulator producing noise during the Rx sequence. Fixed. Adjusted Rx start time by one buffer. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@96 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- fivehz.f90 | 2 +- jtaudio.c | 7 ++----- wsjt.py | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/fivehz.f90 b/fivehz.f90 index df9950f62..5cda28acc 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -91,7 +91,7 @@ subroutine fivehz if(ntr.ne.ntr0) then ibuf0=ibuf !Start of new sequence, save ibuf - ibuf0=ibuf0-3 !Tweak the Rx start time + ibuf0=ibuf0-2 !Tweak the Rx start time if(ibuf0.lt.1) ibuf0=ibuf0+1024 ! if(mode(1:4).ne.'JT65') then ! ibuf0=ibuf0+3 !So we don't copy our own Tx diff --git a/jtaudio.c b/jtaudio.c index 1d17b4036..ac489396e 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -137,7 +137,6 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, short *in = (short*)inputBuffer; short *wptr = (short*)outputBuffer; unsigned int i,n; - static short n2; static int n0; static int ia=0; static int ib=0; @@ -179,10 +178,8 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, } } else { - n2=0; - addnoise_(&n2); - *wptr++ = n2; //left - *wptr++ = n2; //right + *wptr++ = 0; //left + *wptr++ = 0; //right } } fivehztx_(); //Call fortran routine diff --git a/wsjt.py b/wsjt.py index 8eed72d75..0b2f5c9bb 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------ WSJT +#------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From bb1c453ed32510d54f3d90298e9a9f28ed61ae4b Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 14 Jan 2006 01:46:20 +0000 Subject: [PATCH 061/811] 1. Corrected simulator so that noise and signal levels are correct in FSK441 and JT6M, as well as JT65. (Still no generated pings, however.) 2. Updated README_592.TXT in preparation for open release of version 5.9.2. Updated READ git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@97 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- README_592.TXT | 40 +++++++++++++++++++++++++--------------- fivehz.f90 | 13 ++++++++++--- jtaudio.c | 8 +++++--- wsjt.py | 3 ++- 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/README_592.TXT b/README_592.TXT index ee9577e34..41d5cf45d 100755 --- a/README_592.TXT +++ b/README_592.TXT @@ -8,7 +8,7 @@ Enhancements result is that there will be fewer audio glitches caused by the Windows O/S paying attention to other programs. -2. The JT65 decoder has improved immunity to "garbage data," and +2. The JT65 decoder now has improved immunity to "garbage data," and it exhibits better performance on strong signals. 3. The FSK441 decoder produces less on-screen gibberish when you do @@ -20,21 +20,31 @@ Enhancements 5. On-screen font sizes can be set by using Windows Notepad (or another text editor) to edit the file wsjtrc.win. If your screen has resolution greater than 1024 x 768, or if you have old eyes - like mine, you may want to increase the sizes from 8 and 9 (first - three lines of the file) to 9 and 10, say. + like mine, you may want to increase the sizes from 8 and 9 points + (first three lines of the file) to, say, 9 and 10 points. -6. Dividing lines are now provided on the waterfall display between +6. A simulator mode is now built into WSJT. It is presently most + useful in JT65 mode. By entering, say, "#-22" in the text box for + Tx6, you signify that the program should generate its Tx audio + files with the signal embedded in white gaussian noise, 22 dB + below the noise power in a 2.5 kHz bandwidth. You can direct this + signal into a second computer running WSJT, for eaxmple to test + the decoder or to practice operating in JT65 mode. You can even + have the two computers "work each other", although changing + messages of course requires operator action. + +7. Dividing lines are now provided on the waterfall display between spectra corresponding to wave files read from disk. -7. The PTT line is explicitly set low on program startup. +8. The PTT line is explicitly set low on program startup. -8. The F10 key brings up the SpecJT screen (if it was hidden) and +9. The F10 key brings up the SpecJT screen (if it was hidden) and toggles foreground and focus between the WSJT and SpecJT screens. -9. You can use the Alt-F keyboard shortcut to toggle "Freeze", and +10. You can use the Alt-F keyboard shortcut to toggle "Freeze", and Alt-Z to toggle "Zap". -10. "Accelerated decoding" has been removed from the Setup menu. In +11. "Accelerated decoding" has been removed from the Setup menu. In effect, it is now always ON. @@ -53,12 +63,12 @@ Bug Fixes: Information for Programmers --------------------------- -WSJT is no longer a one-person effort. It has become a full-fledged -Open Source project, with an active working group making contributions -to future development. Source code is now stored in a public -repository under control of a version control system called -Subversion, or SVN. You can learn more at -http://developer.berlios.de/projects/wsjt/. +WSJT is no longer a one-person effort and no longer runs only in +Microsoft Windows. It has become a full-fledged Open Source project, +with an active working group making contributions to future +development. Source code is now stored in a public repository under +control of a version control system called Subversion, or SVN. You +can learn more at http://developer.berlios.de/projects/wsjt/. The first significant result of the group effort has been to create versions of WSJT that run under the Linux and FreeBSD operating @@ -73,7 +83,7 @@ The present WSJT working group consists of: Diane Bruce, VA3DB James Courtier-Dutton Bob McGwier, N4HY - Stewart Nelson, KK7A + Stewart Nelson, KK7KA Joe Taylor, K1JT Kaj Wiik, OH6EH diff --git a/fivehz.f90 b/fivehz.f90 index 5cda28acc..f3f795a39 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -213,13 +213,20 @@ end subroutine fivehztx subroutine addnoise(n) integer*2 n real r(12) + real*8 txsnrdb0 include 'gcom1.f90' + save txsnrdb0 - if(txsnrdb.gt.90.0) return - snr=10.0**(0.05*(txsnrdb-1)) + if(txsnrdb.gt.40.0) return + if(txsnrdb.ne.txsnrdb0) then + snr=10.0**(0.05*(txsnrdb-1)) + fac=3000.0 + if(snr.gt.1.0) fac=3000.0/snr + txsnrdb0=txsnrdb + endif call random_number(r) x=sum(r)-6.0 - i=3000.0*x + n*snr*3000.0/32768.0 + i=fac*(x + n*snr/32768.0) if(i>32767) i=32767; if(i<-32767) i=-32767; n=i diff --git a/jtaudio.c b/jtaudio.c index ac489396e..db8b1f6c8 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -137,6 +137,7 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, short *in = (short*)inputBuffer; short *wptr = (short*)outputBuffer; unsigned int i,n; + static short int n2; static int n0; static int ia=0; static int ib=0; @@ -167,9 +168,10 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, for(i=0 ; iTxOK) { - addnoise_(&data->iwave[ic]); - *wptr++ = data->iwave[ic]; //left - *wptr++ = data->iwave[ic]; //right + n2=data->iwave[ic]; + addnoise_(&n2); + *wptr++ = n2; //left + *wptr++ = n2; //right ic++; if(ic>=*data->nwave) { ic = ic % *data->nwave; //Wrap buffer pointer if necessary diff --git a/wsjt.py b/wsjt.py index 0b2f5c9bb..4fd987e84 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1342,13 +1342,14 @@ def update(): if tx6.get()[:1]=='#': try: txsnrdb=float(tx6.get()[1:]) - if txsnrdb>-99.0 and txsnrdb<10.0: + if txsnrdb>-99.0 and txsnrdb<40.0: Audio.gcom1.txsnrdb=txsnrdb tx6.configure(bg='orange') except: txsnrdb=99.0 else: txsnrdb=99.0 + Audio.gcom1.txsnrdb=txsnrdb if Audio.gcom2.monitoring and not Audio.gcom1.transmitting: bmonitor.configure(bg='green') else: From 3ce9963f38406ee6352f456cb456b08ed200d8c6 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 14 Jan 2006 14:59:30 +0000 Subject: [PATCH 062/811] git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@98 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- four2.f | 6 +++--- pix2d.f90 | 2 ++ wsjt.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/four2.f b/four2.f index 54a7e1422..0a2e78c25 100755 --- a/four2.f +++ b/four2.f @@ -36,7 +36,7 @@ C the naive NTOT**2. Furthermore, less error is built up. C Written by Norman Brenner of MIT Lincoln Laboratory, January 1969. C See IEEE Audio Transactions (June 1967), Special issue on FFT. - DIMENSION DATA(1), N(1) + DIMENSION DATA(1048576), N(1) NTOT=1 DO 10 IDIM=1,NDIM 10 NTOT=NTOT*N(IDIM) @@ -78,7 +78,7 @@ C EXCHANGE DATA(J1,J4REV,J5) WITH DATA(J1,J4,J5) FOR ALL J1 FROM 1 C TO NPREV, ALL J4 FROM 1 TO N (WHICH MUST BE A POWER OF TWO), AND C ALL J5 FROM 1 TO NREM. J4REV-1 IS THE BIT REVERSAL OF J4-1. E.G. C SUPPOSE N = 32. THEN FOR J4-1 = 10011, J4REV-1 = 11001, ETC. - DIMENSION DATA(1) + DIMENSION DATA(1048576) IP0=2 IP1=IP0*NPREV IP4=IP1*N @@ -135,7 +135,7 @@ C IT IS NOT NECESSARY TO REWRITE THIS SUBROUTINE INTO COMPLEX C NOTATION SO LONG AS THE FORTRAN COMPILER USED STORES REAL AND C IMAGINARY PARTS IN ADJACENT STORAGE LOCATIONS. IT MUST ALSO C STORE ARRAYS WITH THE FIRST SUBSCRIPT INCREASING FASTEST. - DIMENSION DATA(1) + DIMENSION DATA(1048576) real*8 twopi,wstpr,wstpi,wr,wi,w2r,w2i,w3r,w3i,wtempr diff --git a/pix2d.f90 b/pix2d.f90 index f9fd05447..e723416b9 100644 --- a/pix2d.f90 +++ b/pix2d.f90 @@ -6,6 +6,8 @@ subroutine pix2d(d2,jz,mousebutton,s2,nchan,nz,b) integer*2 d2(jz) !Raw input data real s2(nchan,nz) !2-d spectrum integer*2 b(60000) !Pixels corresponding to 2-d spectrum + data nx0/0/ + save tbest=s2(2,1) s2(1,1)=s2(3,1) diff --git a/wsjt.py b/wsjt.py index 4fd987e84..89c940248 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------- WSJT +#-------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 1f1e1a965ffc5ec205c0c1fce9cfbf9b4b26714b Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 14 Jan 2006 15:15:55 +0000 Subject: [PATCH 063/811] - Adds for documentation purposes the fortran options for debug i.e. traceback would be very nice. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@99 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index d8cbd2e77..3d21cf93d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -7,7 +7,7 @@ CFLAGS = @CFLAGS@ CFLAGS += -DBIGSYM=1 # WSJT specific Fortran flags -#FFLAGS += -cpp -Wall -fbounds-check -fno-second-underscore +#FFLAGS += -cpp -Wall -fbounds-check -ftrace=full -fno-second-underscore FFLAGS += -cpp -fno-second-underscore # The default rules .c.o: From 36fcb937e385cfd452c901d62d338a395d3ae2a5 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 14 Jan 2006 15:47:35 +0000 Subject: [PATCH 064/811] - change from start_threads.c to start_alsa.c start_portaudio.c etc. - split start_threads.c into start_alsa.c and start_portaudio.c - make configure/Makefile add start_alsa or start_portaudio as needed instead of start_threads Untested on ALSA, works fine with PORTAUDIO git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@100 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 6 +- configure | 12 +- configure.ac | 9 +- start_alsa.c | 540 ++++++++++++++++++++++++++++++++++++++++++++++ start_portaudio.c | 27 +++ 5 files changed, 583 insertions(+), 11 deletions(-) create mode 100644 start_alsa.c create mode 100644 start_portaudio.c diff --git a/Makefile.in b/Makefile.in index 3d21cf93d..9716d9381 100644 --- a/Makefile.in +++ b/Makefile.in @@ -67,10 +67,10 @@ OBJS2C = ${SRCS2C:.c=.o} # ok, so far for now # Windows @AUDIO@ will be jtaudio.c since it uses portaudio -# for *nix @AUDIO@ will also be jtaudio.c and start_threads.c +# for *nix @AUDIO@ will also be jtaudio.c and start_portaudio.c # for portaudio -# for *nix @AUDIO@ will be start_threads.c for alsa -# for *nix @AUDIO@ will be ?? for oss +# for *nix @AUDIO@ will be start_alsa.c for alsa +# for *nix @AUDIO@ will be start_oss.c for oss # # ptt_unix.c vs. ptt.c I'll sort out later. # ditto for cutil.c (only used on *nix) diff --git a/configure b/configure index 3f2247535..25839794d 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 76 2006-01-10 16:36:04Z va3db $ +# $Id: configure.ac 82 2006-01-10 21:35:37Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 76 2006-01-10 16:36:04Z va3db $ +$Id: configure.ac 82 2006-01-10 21:35:37Z va3db $ _ACEOF exit 0 fi @@ -5729,7 +5729,7 @@ cat >>confdefs.h <<\_ACEOF #define USE_ALSA 1 _ACEOF - AUDIO="start_threads.c" + AUDIO="start_alsa.c" LDFLAGS="${LDFLAGS} -lasound" CFLAGS="${CFLAGS} -DUSE_ALSA" @@ -5742,8 +5742,10 @@ cat >>confdefs.h <<\_ACEOF #define USE_OSS 1 _ACEOF - AUDIO="jtaudio.c" + AUDIO="jtaudio.c start_oss.c" + CFLAGS="${CFLAGS} -DUSE_OSS" + CPPFLAGS="${CPPFLAGS} -DUSE_OSS" fi if test "$portaudio" = yes; then @@ -5752,7 +5754,7 @@ cat >>confdefs.h <<\_ACEOF #define USE_PORTAUDIO 1 _ACEOF - AUDIO="jtaudio.c start_threads.c" + AUDIO="jtaudio.c start_portaudio.c" LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" diff --git a/configure.ac b/configure.ac index 2876e5a69..b4a273793 100644 --- a/configure.ac +++ b/configure.ac @@ -233,21 +233,24 @@ fi if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) - AC_SUBST(AUDIO, "start_threads.c") + AC_SUBST(AUDIO, "start_alsa.c") LDFLAGS="${LDFLAGS} -lasound" CFLAGS="${CFLAGS} -DUSE_ALSA" CPPFLAGS="${CPPFLAGS} -DUSE_ALSA" fi +dnl still not sure what OSS will require, but heres a first guess -db if test "$oss" = yes; then AC_DEFINE(USE_OSS, 1, [Define if you want OSS used.]) - AC_SUBST(AUDIO, "jtaudio.c") + AC_SUBST(AUDIO, "jtaudio.c start_oss.c") + CFLAGS="${CFLAGS} -DUSE_OSS" + CPPFLAGS="${CPPFLAGS} -DUSE_OSS" fi dnl XXX if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) - AC_SUBST(AUDIO, "jtaudio.c start_threads.c") + AC_SUBST(AUDIO, "jtaudio.c start_portaudio.c") LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" CPPFLAGS="${CPPFLAGS} -DUSE_PORTAUDIO" diff --git a/start_alsa.c b/start_alsa.c new file mode 100644 index 000000000..c067c79ba --- /dev/null +++ b/start_alsa.c @@ -0,0 +1,540 @@ +#include +#include +#include +#include +#include +#include +#include "conf.h" + +#if 0 +#define ALSA_LOG +#define ALSA_LOG_BUFFERS +#endif +#if 0 +#define ALSA_PLAYBACK_LOG +#define ALSA_CAPTURE_LOG +#endif +#define BUFFER_TIME 2000*1000 + + +typedef struct alsa_driver_s { + snd_pcm_t *audio_fd; + int capabilities; + int open_mode; + int has_pause_resume; + int is_paused; + int32_t output_sample_rate, input_sample_rate; + double sample_rate_factor; + uint32_t num_channels; + uint32_t bits_per_sample; + uint32_t bytes_per_frame; + uint32_t bytes_in_buffer; /* number of bytes writen to audio hardware */ + int16_t *app_buffer_y1; + int16_t *app_buffer_y2; + int *app_buffer_offset; + int app_buffer_length; + double *Tsec; + double *tbuf; + int *ibuf; + int *ndsec; + int *tx_ok; + int tx_starting; + int tx_offset; + int *tr_period; + int *nwave; + int *nmode; + int *transmitting; + + snd_pcm_uframes_t buffer_size; + snd_pcm_uframes_t period_size; + int32_t mmap; +} alsa_driver_t; + +alsa_driver_t alsa_driver_playback; +alsa_driver_t alsa_driver_capture; +void *alsa_capture_buffers[2]; +void *alsa_playback_buffers[2]; + +static snd_output_t *jcd_out; + +/* + * open the audio device for writing to + */ +static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_stream_t direction ) { + alsa_driver_t *this = (alsa_driver_t *) this_gen; + char *pcm_device; + snd_pcm_hw_params_t *params; + snd_pcm_sw_params_t *swparams; + snd_pcm_access_mask_t *mask; + snd_pcm_uframes_t period_size_min; + snd_pcm_uframes_t period_size_max; + snd_pcm_uframes_t buffer_size_min; + snd_pcm_uframes_t buffer_size_max; + snd_pcm_format_t format; + uint32_t buffer_time=BUFFER_TIME; + snd_pcm_uframes_t buffer_time_to_size; + int err, dir; + int open_mode=1; /* NONBLOCK */ + /* int open_mode=0; BLOCK */ + int32_t rate=*input_rate; + this->input_sample_rate=*input_rate; + + snd_pcm_hw_params_alloca(¶ms); + snd_pcm_sw_params_alloca(&swparams); + err = snd_output_stdio_attach(&jcd_out, stdout, 0); + + this->num_channels = 2; + pcm_device="default"; +#ifdef ALSA_LOG + printf("audio_alsa_out: Audio Device name = %s\n",pcm_device); + printf("audio_alsa_out: Number of channels = %d\n",this->num_channels); +#endif + + if (this->audio_fd) { + printf("audio_alsa_out:Already open...WHY!"); + snd_pcm_close (this->audio_fd); + this->audio_fd = NULL; + } + + this->bytes_in_buffer = 0; + /* + * open audio device + */ + err=snd_pcm_open(&this->audio_fd, pcm_device, direction, open_mode); + if(err <0 ) { + printf ("audio_alsa_out: snd_pcm_open() of %s failed: %s\n", pcm_device, snd_strerror(err)); + printf ("audio_alsa_out: >>> check if another program already uses PCM <<<\n"); + return 0; + } + /* printf ("audio_alsa_out: snd_pcm_open() opened %s\n", pcm_device); */ + /* We wanted non blocking open but now put it back to normal */ + //snd_pcm_nonblock(this->audio_fd, 0); + snd_pcm_nonblock(this->audio_fd, 1); + /* + * configure audio device + */ + err = snd_pcm_hw_params_any(this->audio_fd, params); + if (err < 0) { + printf ("audio_alsa_out: broken configuration for this PCM: no configurations available: %s\n"), + snd_strerror(err); + goto close; + } + /* set interleaved access */ + if (this->mmap != 0) { + mask = alloca(snd_pcm_access_mask_sizeof()); + snd_pcm_access_mask_none(mask); + snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_INTERLEAVED); + snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_NONINTERLEAVED); + snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_COMPLEX); + err = snd_pcm_hw_params_set_access_mask(this->audio_fd, params, mask); + if (err < 0) { + printf ( "audio_alsa_out: mmap not availiable, falling back to compatiblity mode\n"); + this->mmap=0; + err = snd_pcm_hw_params_set_access(this->audio_fd, params, + SND_PCM_ACCESS_RW_NONINTERLEAVED); + } + } else { + err = snd_pcm_hw_params_set_access(this->audio_fd, params, + SND_PCM_ACCESS_RW_NONINTERLEAVED); + } + + if (err < 0) { + printf ( "audio_alsa_out: access type not available: %s\n", snd_strerror(err)); + goto close; + } + /* set the sample format S16 */ + /* ALSA automatically appends _LE or _BE depending on the CPU */ + format = SND_PCM_FORMAT_S16; + err = snd_pcm_hw_params_set_format(this->audio_fd, params, format ); + if (err < 0) { + printf ( "audio_alsa_out: sample format non available: %s\n", snd_strerror(err)); + goto close; + } + /* set the number of channels */ + err = snd_pcm_hw_params_set_channels(this->audio_fd, params, this->num_channels); + if (err < 0) { + printf ( "audio_alsa_out: Cannot set number of channels to %d (err=%d:%s)\n", + this->num_channels, err, snd_strerror(err)); + goto close; + } +#if SND_LIB_VERSION >= 0x010009 + /* Restrict a configuration space to contain only real hardware rates */ + err = snd_pcm_hw_params_set_rate_resample(this->audio_fd, params, 0); +#endif + /* set the stream rate [Hz] */ + dir=0; + err = snd_pcm_hw_params_set_rate_near(this->audio_fd, params, &rate, &dir); + if (err < 0) { + printf ( "audio_alsa_out: rate not available: %s\n", snd_strerror(err)); + goto close; + } + this->output_sample_rate = (uint32_t)rate; + if (this->input_sample_rate != this->output_sample_rate) { + printf ( "audio_alsa_out: audio rate : %d requested, %d provided by device/sec\n", + this->input_sample_rate, this->output_sample_rate); + } + buffer_time_to_size = ( (uint64_t)buffer_time * rate) / 1000000; + err = snd_pcm_hw_params_get_buffer_size_min(params, &buffer_size_min); + err = snd_pcm_hw_params_get_buffer_size_max(params, &buffer_size_max); + dir=0; + err = snd_pcm_hw_params_get_period_size_min(params, &period_size_min,&dir); + dir=0; + err = snd_pcm_hw_params_get_period_size_max(params, &period_size_max,&dir); +#ifdef ALSA_LOG_BUFFERS + printf("Buffer size range from %lu to %lu\n",buffer_size_min, buffer_size_max); + printf("Period size range from %lu to %lu\n",period_size_min, period_size_max); + printf("Buffer time size %lu\n",buffer_time_to_size); +#endif + this->buffer_size = buffer_time_to_size; + if (buffer_size_max < this->buffer_size) + this->buffer_size = buffer_size_max; + if (buffer_size_min > this->buffer_size) + this->buffer_size = buffer_size_min; + this->period_size = this->buffer_size/8; + if (this->period_size > 2048) + this->period_size = 2048; + this->buffer_size = this->period_size*8; +#ifdef ALSA_LOG_BUFFERS + printf("To choose buffer_size = %ld\n",this->buffer_size); + printf("To choose period_size = %ld\n",this->period_size); +#endif + +#if 0 + /* Set period to buffer size ratios at 8 periods to 1 buffer */ + dir=-1; + periods=8; + err = snd_pcm_hw_params_set_periods_near(this->audio_fd, params, &periods ,&dir); + if (err < 0) { + xprintf (this->class->xine, XINE_VERBOSITY_DEBUG, + "audio_alsa_out: unable to set any periods: %s\n", snd_strerror(err)); + goto close; + } + /* set the ring-buffer time [us] (large enough for x us|y samples ...) */ + dir=0; + err = snd_pcm_hw_params_set_buffer_time_near(this->audio_fd, params, &buffer_time, &dir); + if (err < 0) { + xprintf (this->class->xine, XINE_VERBOSITY_DEBUG, + "audio_alsa_out: buffer time not available: %s\n", snd_strerror(err)); + goto close; + } +#endif +#if 1 + /* set the period time [us] (interrupt every x us|y samples ...) */ + dir=0; + err = snd_pcm_hw_params_set_period_size_near(this->audio_fd, params, &(this->period_size), &dir); + if (err < 0) { + printf ( "audio_alsa_out: period time not available: %s\n", snd_strerror(err)); + goto close; + } +#endif + dir=0; + err = snd_pcm_hw_params_get_period_size(params, &(this->period_size), &dir); + + dir=0; + err = snd_pcm_hw_params_set_buffer_size_near(this->audio_fd, params, &(this->buffer_size)); + if (err < 0) { + printf ( "audio_alsa_out: buffer time not available: %s\n", snd_strerror(err)); + goto close; + } + err = snd_pcm_hw_params_get_buffer_size(params, &(this->buffer_size)); +#ifdef ALSA_LOG_BUFFERS + printf("was set period_size = %ld\n",this->period_size); + printf("was set buffer_size = %ld\n",this->buffer_size); +#endif + if (2*this->period_size > this->buffer_size) { + printf ( "audio_alsa_out: buffer to small, could not use\n"); + goto close; + } + + /* write the parameters to device */ + err = snd_pcm_hw_params(this->audio_fd, params); + if (err < 0) { + printf ( "audio_alsa_out: pcm hw_params failed: %s\n", snd_strerror(err)); + goto close; + } + /* Check for pause/resume support */ + this->has_pause_resume = ( snd_pcm_hw_params_can_pause (params) + && snd_pcm_hw_params_can_resume (params) ); + // printf( "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume); + this->sample_rate_factor = (double) this->output_sample_rate / (double) this->input_sample_rate; + this->bytes_per_frame = snd_pcm_frames_to_bytes (this->audio_fd, 1); + /* + * audio buffer size handling + */ + /* Copy current parameters into swparams */ + err = snd_pcm_sw_params_current(this->audio_fd, swparams); + if (err < 0) { + printf ( "audio_alsa_out: Unable to determine current swparams: %s\n", snd_strerror(err)); + goto close; + } + /* align all transfers to 1 sample */ + err = snd_pcm_sw_params_set_xfer_align(this->audio_fd, swparams, 1); + if (err < 0) { + printf ( "audio_alsa_out: Unable to set transfer alignment: %s\n", snd_strerror(err)); + goto close; + } + /* allow the transfer when at least period_size samples can be processed */ + err = snd_pcm_sw_params_set_avail_min(this->audio_fd, swparams, this->period_size); + if (err < 0) { + printf ( "audio_alsa_out: Unable to set available min: %s\n", snd_strerror(err)); + goto close; + } + if (direction == SND_PCM_STREAM_PLAYBACK) { + /* start the transfer when the buffer contains at least period_size samples */ + err = snd_pcm_sw_params_set_start_threshold(this->audio_fd, swparams, this->buffer_size); + } else { + err = snd_pcm_sw_params_set_start_threshold(this->audio_fd, swparams, -1); + } + if (err < 0) { + printf ( "audio_alsa_out: Unable to set start threshold: %s\n", snd_strerror(err)); + goto close; + } + + if (direction == SND_PCM_STREAM_PLAYBACK) { + /* never stop the transfer, even on xruns */ + err = snd_pcm_sw_params_set_stop_threshold(this->audio_fd, swparams, this->buffer_size); + } else { + err = snd_pcm_sw_params_set_stop_threshold(this->audio_fd, swparams, this->buffer_size); + } + if (err < 0) { + printf ( "audio_alsa_out: Unable to set stop threshold: %s\n", snd_strerror(err)); + goto close; + } + + /* Install swparams into current parameters */ + err = snd_pcm_sw_params(this->audio_fd, swparams); + if (err < 0) { + printf ( "audio_alsa_out: Unable to set swparams: %s\n", snd_strerror(err)); + goto close; + } +#ifdef ALSA_LOG + snd_pcm_dump_setup(this->audio_fd, jcd_out); + snd_pcm_sw_params_dump(swparams, jcd_out); +#endif + + return this->output_sample_rate; + +close: + snd_pcm_close (this->audio_fd); + this->audio_fd=NULL; + return 0; +} + +int16_t zero_buffer[65536]; + +int playback_callback(alsa_driver_t *alsa_driver_playback) { + alsa_driver_t *this = alsa_driver_playback; + int result; + struct timeval tv; + double stime; + int nsec; + int i,n; + static int ic; + int16_t b0[2048]; + +// printf("playback callback\n"); + gettimeofday(&tv, NULL); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + + *(this->ndsec) * 0.1; + *(this->Tsec) = stime; + if(!(this->tx_starting) && (*(this->tx_ok)) ) { + nsec = (int)stime; + n = nsec / *(this->tr_period); + ic = (int)(stime - *(this->tr_period) * n) * this->output_sample_rate; + ic = ic % *(this->nwave); + this->tx_offset = ic; + } + this->tx_starting = *(this->tx_ok); + *(this->transmitting) = *(this->tx_ok); + if(*(this->tx_ok)) { + /* + alsa_playback_buffers[0] = this->app_buffer_y1 + this->tx_offset; + alsa_playback_buffers[1] = this->app_buffer_y1 + this->tx_offset; + */ + alsa_playback_buffers[0] = b0; + alsa_playback_buffers[1] = b0; + for(i=0; iperiod_size; i++) { + b0[i]=this->app_buffer_y1[ic]; + ic++; + if(ic >= *this->nwave) { + ic=ic % *this->nwave; + if(*this->nmode == 2) + *this->tx_ok=0; + } + } + } else { + alsa_playback_buffers[0] = zero_buffer; + alsa_playback_buffers[1] = zero_buffer; + } + result = snd_pcm_writen(this->audio_fd, alsa_playback_buffers, this->period_size); + this->tx_offset += this->period_size; + if (result != this->period_size) { + printf("playback writei failed. Expected %d samples, sent only %d\n", this->period_size, result); +#ifdef ALSA_PLAYBACK_LOG + snd_pcm_status_t *pcm_stat; + snd_pcm_status_alloca(&pcm_stat); + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); +#endif + } + fivehztx_(); //Call fortran routine +} + +int capture_callback(alsa_driver_t *alsa_driver_capture) { + alsa_driver_t *this = alsa_driver_capture; + int result; + struct timeval tv; + double stime; + int ib; +#ifdef ALSA_CAPTURE_LOG + printf("capture callback %d samples\n", this->period_size); +#endif +#ifdef ALSA_CAPTURE_LOG + snd_pcm_status_t *pcm_stat; + snd_pcm_status_alloca(&pcm_stat); + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); +#endif + gettimeofday(&tv, NULL); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + + *(this->ndsec) * 0.1; + *(this->Tsec) = stime; + ib=*(this->ibuf); + this->tbuf[ib++] = stime; + if(ib>=1024) + ib = 0; + *(this->ibuf) = ib; + + alsa_capture_buffers[0]=this->app_buffer_y1 + *(this->app_buffer_offset); + alsa_capture_buffers[1]=this->app_buffer_y2 + *(this->app_buffer_offset); + result = snd_pcm_readn(this->audio_fd, alsa_capture_buffers, this->period_size); + *(this->app_buffer_offset) += this->period_size; + if ( *(this->app_buffer_offset) >= this->app_buffer_length ) + *(this->app_buffer_offset)=0; /* FIXME: implement proper wrapping */ +#ifdef ALSA_CAPTURE_LOG + printf("result=%d\n",result); + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); +#endif + fivehz_(); //Call fortran routine +} + +int playback_xrun(alsa_driver_t *alsa_driver_playback) { + alsa_driver_t *this = alsa_driver_playback; + snd_pcm_status_t *pcm_stat; + snd_pcm_status_alloca(&pcm_stat); + printf("playback xrun\n"); + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); + snd_pcm_prepare(this->audio_fd); +} + +int capture_xrun(alsa_driver_t *alsa_driver_capture) { + alsa_driver_t *this = alsa_driver_capture; + snd_pcm_status_t *pcm_stat; + snd_pcm_status_alloca(&pcm_stat); + printf("capture xrun\n"); + snd_pcm_status(this->audio_fd, pcm_stat); + snd_pcm_status_dump(pcm_stat, jcd_out); +} + +void ao_alsa_loop(void *iarg) { + int playback_nfds; + int capture_nfds; + struct pollfd *pfd; + int nfds; + int capture_index; + unsigned short playback_revents; + unsigned short capture_revents; + playback_nfds = snd_pcm_poll_descriptors_count ( + alsa_driver_playback.audio_fd); + capture_nfds = snd_pcm_poll_descriptors_count ( + alsa_driver_capture.audio_fd); + pfd = (struct pollfd *) malloc (sizeof (struct pollfd) * + (playback_nfds + capture_nfds)); + + nfds=0; + snd_pcm_poll_descriptors (alsa_driver_playback.audio_fd, + &pfd[0], + playback_nfds); + nfds += playback_nfds; + snd_pcm_poll_descriptors (alsa_driver_capture.audio_fd, + &pfd[nfds], + capture_nfds); + capture_index = nfds; + nfds += capture_nfds; + while(1) { + if (poll (pfd, nfds, 100000) < 0) { + printf("poll failed\n"); + return; + } + snd_pcm_poll_descriptors_revents(alsa_driver_playback.audio_fd, &pfd[0], playback_nfds, &playback_revents); + snd_pcm_poll_descriptors_revents(alsa_driver_capture.audio_fd, &pfd[capture_index], capture_nfds, &capture_revents); + //if ((playback_revents & POLLERR) || ((capture_revents) & POLLERR)) { + if (((capture_revents) & POLLERR)) { + printf("pollerr\n"); + capture_xrun(&alsa_driver_capture); + return; + } + if (((playback_revents) & POLLERR)) { + printf("pollerr\n"); + playback_xrun(&alsa_driver_capture); + return; + } + if (playback_revents & POLLOUT) { + playback_callback(&alsa_driver_playback); + } + if (capture_revents & POLLIN) { + capture_callback(&alsa_driver_capture); + } + } + + return; +} + +extern void decode1_(int *iarg); + +int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], + int *nbuflen, int *iwrite, short iwave[], + int *nwave, int *nfsample, int *nsamperbuf, + int *TRPeriod, int *TxOK, int *ndebug, + int *Transmitting, double *Tsec, int *ngo, int *nmode, + double tbuf[], int *ibuf, int *ndsec) +{ + pthread_t thread1,thread2; + int iret1,iret2; + int iarg1 = 1,iarg2 = 2; + //int32_t rate=11025; + int32_t rate=*nfsample; + alsa_driver_capture.app_buffer_y1 = y1; + alsa_driver_capture.app_buffer_y2 = y2; + alsa_driver_capture.app_buffer_offset = iwrite; + alsa_driver_capture.app_buffer_length = *nbuflen; + alsa_driver_capture.Tsec = Tsec; + alsa_driver_capture.tbuf = tbuf; + alsa_driver_capture.ibuf = ibuf; + alsa_driver_capture.ndsec = ndsec; + alsa_driver_playback.Tsec = Tsec; + alsa_driver_playback.app_buffer_y1 = iwave; + alsa_driver_playback.tx_ok = TxOK; + alsa_driver_playback.tr_period = TRPeriod; + alsa_driver_playback.nwave = nwave; + alsa_driver_playback.nmode = nmode; + alsa_driver_playback.transmitting = Transmitting; + alsa_driver_playback.ndsec = ndsec; + // printf("start_threads: creating thread for decode1\n"); + iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); +/* Open audio card. */ + printf("Starting alsa routines.\n"); + ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); + ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); + +/* + * Start audio io thread + */ + iret2 = pthread_create(&thread2, NULL, ao_alsa_loop, NULL); + snd_pcm_prepare(alsa_driver_capture.audio_fd); + snd_pcm_start(alsa_driver_capture.audio_fd); + snd_pcm_prepare(alsa_driver_playback.audio_fd); + //snd_pcm_start(alsa_driver_playback.audio_fd); +} diff --git a/start_portaudio.c b/start_portaudio.c new file mode 100644 index 000000000..5a845a222 --- /dev/null +++ b/start_portaudio.c @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#include +#include "conf.h" + +extern void decode1_(int *iarg); +extern void a2d_(int *iarg); + +int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], + int *nbuflen, int *iwrite, short iwave[], + int *nwave, int *nfsample, int *nsamperbuf, + int *TRPeriod, int *TxOK, int *ndebug, + int *Transmitting, double *Tsec, int *ngo, int *nmode, + double tbuf[], int *ibuf, int *ndsec) +{ + pthread_t thread1,thread2; + int iret1,iret2; + int iarg1 = 1,iarg2 = 2; + + /* snd_pcm_start */ + // printf("start_threads: creating thread for a2d\n"); + iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); + // printf("start_threads: creating thread for decode1_\n"); + iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); +} From 0ce6252dba5b506fb54427e4bbbc228710953984 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 14 Jan 2006 15:53:01 +0000 Subject: [PATCH 065/811] - No need to wrap this with an #ifdef PORTAUDIO git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@101 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- audio_init.f90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/audio_init.f90 b/audio_init.f90 index e4fd80935..74afbde86 100644 --- a/audio_init.f90 +++ b/audio_init.f90 @@ -5,8 +5,6 @@ subroutine audio_init(ndin,ndout) #ifdef Win32 use dfmt integer Thread1,Thread2 -#endif -#ifdef USE_PORTAUDIO external a2d,decode1 #endif From 0cce7ee1b9772639d7d7ac21cee3597abae951de Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 14 Jan 2006 16:15:50 +0000 Subject: [PATCH 066/811] - Add AUDIOSRCS in Makefile.in, which will be filled in with the appropriate source files needed for the audio system chosen. Note in particular a2d.f90 no longer needs to be wrapped with a #ifdef PORTAUDIO since it is now only compiled and linked when needed. Tested on portaudio here, but untested on alsa. Please test that I have not screwed it up on alsa or windows. ;-) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@102 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 16 +++++++++------- a2d.f90 | 3 --- configure | 6 +++--- configure.ac | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9716d9381..9ef817a96 100644 --- a/Makefile.in +++ b/Makefile.in @@ -41,7 +41,7 @@ OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 -SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ +SRCS2F90 = abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ @@ -66,9 +66,9 @@ SRCS2C = init_rs.c encode_rs.c decode_rs.c OBJS2C = ${SRCS2C:.c=.o} # ok, so far for now -# Windows @AUDIO@ will be jtaudio.c since it uses portaudio -# for *nix @AUDIO@ will also be jtaudio.c and start_portaudio.c -# for portaudio +# Windows @AUDIO@ will be a2d.f90 jtaudio.c since it uses portaudio +# for *nix @AUDIO@ will also be a2d.f90, jtaudio.c +# and start_portaudio.c for systems using portaudio # for *nix @AUDIO@ will be start_alsa.c for alsa # for *nix @AUDIO@ will be start_oss.c for oss # @@ -78,10 +78,12 @@ OBJS2C = ${SRCS2C:.c=.o} # jtaudio.c/start_threads.c mess will have to be sorted out later # to minimise #ifdef's # --db +# and mostly sorted +# --db # SRCS3C = ptt_unix.c igray.c wrapkarn.c cutil.c -SRCS3C += @AUDIO@ OBJS3C = ${SRCS3C:.c=.o} +AUDIOSRCS = @AUDIO@ all: wsjt6 JT65code: $(OBJS1) @@ -93,13 +95,13 @@ wsjt6: Audio.so #wsjt.spec # # -Audio.so: $(OBJS2C) $(OBJS3C) $(OBJS2F77) $(SRCS2F90) +Audio.so: $(OBJS2C) $(OBJS3C) $(OBJS2F77) $(SRCS2F90) $(AUDIOSRCS) ${F2PY} -c --quiet --opt="-O -cpp -D${CFLAGS} \ -fno-second-underscore" $(OBJS2C) $(OBJS2F77) -m Audio \ --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ only: $(F2PYONLY) \ : $(SRCS2F90) \ - ${SRCS3C} + ${SRCS3C} ${AUDIOSRCS} wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py # ${PYTHON} c:\python23\installer\makespec.py --icon wsjt.ico \ diff --git a/a2d.f90 b/a2d.f90 index 4bdfe632b..5cbef8d5f 100644 --- a/a2d.f90 +++ b/a2d.f90 @@ -1,8 +1,6 @@ !---------------------------------------------------- a2d subroutine a2d(iarg) -!#if 1 -# ifdef USE_PORTAUDIO ! Start the PortAudio streams for audio input and output. integer nchin(0:20),nchout(0:20) include 'gcom1.f90' @@ -36,6 +34,5 @@ subroutine a2d(iarg) write(*,1006) 1006 format('Audio streams terminated normally.') endif -#endif return end subroutine a2d diff --git a/configure b/configure index 25839794d..e51b3ed3c 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 82 2006-01-10 21:35:37Z va3db $ +# $Id: configure.ac 100 2006-01-14 15:47:35Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 82 2006-01-10 21:35:37Z va3db $ +$Id: configure.ac 100 2006-01-14 15:47:35Z va3db $ _ACEOF exit 0 fi @@ -5754,7 +5754,7 @@ cat >>confdefs.h <<\_ACEOF #define USE_PORTAUDIO 1 _ACEOF - AUDIO="jtaudio.c start_portaudio.c" + AUDIO="a2d.f90 jtaudio.c start_portaudio.c" LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" diff --git a/configure.ac b/configure.ac index b4a273793..de42081b6 100644 --- a/configure.ac +++ b/configure.ac @@ -250,7 +250,7 @@ fi dnl XXX if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) - AC_SUBST(AUDIO, "jtaudio.c start_portaudio.c") + AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c") LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" CPPFLAGS="${CPPFLAGS} -DUSE_PORTAUDIO" From 4ff076440812d1f4dda566c9a6ee31a9732d8d02 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 14 Jan 2006 16:39:39 +0000 Subject: [PATCH 067/811] Put parameter(NMAX=2048*1024) statements into four2.f git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@103 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- four2.f | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/four2.f b/four2.f index 0a2e78c25..b3f4aeaa9 100755 --- a/four2.f +++ b/four2.f @@ -36,7 +36,8 @@ C the naive NTOT**2. Furthermore, less error is built up. C Written by Norman Brenner of MIT Lincoln Laboratory, January 1969. C See IEEE Audio Transactions (June 1967), Special issue on FFT. - DIMENSION DATA(1048576), N(1) + parameter(NMAX=2048*1024) + DIMENSION DATA(NMAX), N(1) NTOT=1 DO 10 IDIM=1,NDIM 10 NTOT=NTOT*N(IDIM) @@ -78,7 +79,8 @@ C EXCHANGE DATA(J1,J4REV,J5) WITH DATA(J1,J4,J5) FOR ALL J1 FROM 1 C TO NPREV, ALL J4 FROM 1 TO N (WHICH MUST BE A POWER OF TWO), AND C ALL J5 FROM 1 TO NREM. J4REV-1 IS THE BIT REVERSAL OF J4-1. E.G. C SUPPOSE N = 32. THEN FOR J4-1 = 10011, J4REV-1 = 11001, ETC. - DIMENSION DATA(1048576) + parameter(NMAX=2048*1024) + DIMENSION DATA(NMAX) IP0=2 IP1=IP0*NPREV IP4=IP1*N @@ -135,7 +137,8 @@ C IT IS NOT NECESSARY TO REWRITE THIS SUBROUTINE INTO COMPLEX C NOTATION SO LONG AS THE FORTRAN COMPILER USED STORES REAL AND C IMAGINARY PARTS IN ADJACENT STORAGE LOCATIONS. IT MUST ALSO C STORE ARRAYS WITH THE FIRST SUBSCRIPT INCREASING FASTEST. - DIMENSION DATA(1048576) + parameter(NMAX=2048*1024) + DIMENSION DATA(NMAX) real*8 twopi,wstpr,wstpi,wr,wi,w2r,w2i,w3r,w3i,wtempr @@ -255,7 +258,8 @@ C DATA(I1,I2) = (DATA(I1,I2)-TEMP)*(1-IFORM) C 10 DATA(I1CNJ,I2) = (DATA(I1CNJ,I2)+CONJ(TEMP))*(1-IFORM) C IF I1=I1CNJ, THE CALCULATION FOR THAT VALUE COLLAPSES INTO C A SIMPLE CONJUGATION OF DATA(I1,I2). - DIMENSION DATA(2) + parameter(NMAX=2048*1024) + DIMENSION DATA(NMAX) TWOPI=6.283185307*FLOAT(ISIGN) IP0=2 IP1=IP0*(N/2) From 3b7727ecc3077ab2189080286814d1dfe89d5f5e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 14 Jan 2006 18:38:15 +0000 Subject: [PATCH 068/811] 1. Fixed some problems with all-zero data. 2. Removed the two-buffer offset in fivehz.f90, it did not work right. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@104 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- decode3.f90 | 1 + fivehz.f90 | 4 ---- longx.f | 2 +- mtdecode.f | 1 - spec2d.f | 6 +++++- wsjt.py | 2 +- wsjt1.f | 6 +++++- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/decode3.f90 b/decode3.f90 index ceb2f7c04..337dda67a 100644 --- a/decode3.f90 +++ b/decode3.f90 @@ -59,6 +59,7 @@ subroutine decode3(d2,jz,istart,filename) ps0,npkept,lumsg,basevb,rmspower,nslim2,psavg,ccf,Nseg, & MouseDF,NAgain,LDecoded,nspecial,ndf,ss1,ss2) close(23) + if(basevb.le.-98.0) go to 999 ! See whether this file should be saved or erased from disk if(nsave.eq.1 .and. ldecoded) filetokilla='' diff --git a/fivehz.f90 b/fivehz.f90 index f3f795a39..3d04666c2 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -84,15 +84,11 @@ subroutine fivehz endif ibuf000=ibuf iwrite000=iwrite - nsec=Tsec - ntr=mod(nsec/trperiod,2) !ntr=0 in 1st sequence, 1 in 2nd if(ntr.ne.ntr0) then ibuf0=ibuf !Start of new sequence, save ibuf - ibuf0=ibuf0-2 !Tweak the Rx start time - if(ibuf0.lt.1) ibuf0=ibuf0+1024 ! if(mode(1:4).ne.'JT65') then ! ibuf0=ibuf0+3 !So we don't copy our own Tx ! if(ibuf0.gt.1024) ibuf0=ibuf0-1024 diff --git a/longx.f b/longx.f index c0e4c069e..844f814af 100644 --- a/longx.f +++ b/longx.f @@ -124,5 +124,5 @@ C Finally, decode the message. if(nc.le.47) msg(i:i)=c(nc+1:nc+1) enddo - 20 return + return end diff --git a/mtdecode.f b/mtdecode.f index 948d97a85..338d1aae6 100644 --- a/mtdecode.f +++ b/mtdecode.f @@ -21,7 +21,6 @@ C Decode Multi-Tone FSK441 mesages. character*90 line common/ccom/nline,tping(100),line(100) -! slim=10.0*log10(10.0**(0.1*MinSigdB)+1.0) slim=MinSigdB wmin=0.001*MinWidth * (19.95/20.0) nf1=-DFTolerance diff --git a/spec2d.f b/spec2d.f index 06635c558..c0df82ac5 100644 --- a/spec2d.f +++ b/spec2d.f @@ -44,6 +44,10 @@ C Accumulate average spectrum for the whole file. psavg0(i) = psavg0(i)+ real(c(i))**2 + imag(c(i))**2 enddo enddo + if(sum.eq.0.0) then + sigma=-999. + go to 999 + endif C Normalize and save a copy of psavg0 for plotting. Roll off the C spectrum at 300 and 3000 Hz. @@ -120,5 +124,5 @@ C Find average of active spectral region, over the whole file. enddo sigma=sum/(44*nz) - return + 999 return end diff --git a/wsjt.py b/wsjt.py index 89c940248..4fd987e84 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#-------------------------------------------------------------- WSJT +#------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/wsjt1.f b/wsjt1.f index c0e87f70d..9f8d6e210 100644 --- a/wsjt1.f +++ b/wsjt1.f @@ -125,6 +125,7 @@ enddo avesq=sq/jz basevb=dB(avesq) - 44 !Base power level to send back to GUI + if(avesq.eq.0) go to 900 nz=600 nstep=jz/nz @@ -196,7 +197,8 @@ enddo ! For waterfall plot call spec2d(dat,jz,nstep,s2,nchan,nz,psavg,sigma) - if(jz/11025.0.lt.3.9) go to 900 + if(sigma.lt.0.0) basevb=-99.0 + if(jz/11025.0.lt.3.9 .or. sigma.lt.0.0) go to 900 f0=1076.66 if(NFreeze.eq.1) f0=1076.66+mousedf @@ -249,6 +251,8 @@ dtbuf=nstep/11025.0 stlim=nslim2 !Single-tone threshold call spec2d(dat,jz,nstep,s2,nchan,nz,psavg,sigma) + if(sigma.lt.0.0) basevb=-99.0 + if(sigma.lt.0.0) go to 900 nline0=nline STfound=.false. npkept=0 From 8da1823640fd11e5de09a716411a407961229501 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 14 Jan 2006 19:44:53 +0000 Subject: [PATCH 069/811] Corrected the zero-data test in spec2d.f. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@105 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- spec2d.f | 8 ++++---- wsjt.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec2d.f b/spec2d.f index c0df82ac5..47611ccfd 100644 --- a/spec2d.f +++ b/spec2d.f @@ -44,10 +44,6 @@ C Accumulate average spectrum for the whole file. psavg0(i) = psavg0(i)+ real(c(i))**2 + imag(c(i))**2 enddo enddo - if(sum.eq.0.0) then - sigma=-999. - go to 999 - endif C Normalize and save a copy of psavg0 for plotting. Roll off the C spectrum at 300 and 3000 Hz. @@ -77,6 +73,10 @@ C Compute an average spectrum from the weakest 25% of time slices. do i=6,59 sum=sum+ps2(i) enddo + if(sum.eq.0.0) then + sigma=-999. + go to 999 + endif C Compute a smoothed spectrum without local peaks, and find its max. smaxx=0. diff --git a/wsjt.py b/wsjt.py index 4fd987e84..89c940248 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------- WSJT +#-------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From d3b6083b50b93dd31cdc80b41da38bc4b17f3738 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 15 Jan 2006 00:44:19 +0000 Subject: [PATCH 070/811] Adjusted tx2 to allow for latency. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@106 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- fivehz.f90 | 14 +++++++------- wsjt.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fivehz.f90 b/fivehz.f90 index 3d04666c2..99954c5b0 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -31,7 +31,7 @@ subroutine fivehz if(first) then rxdelay=0.2 txdelay=0.2 - tlatency=3*2048/11025.0 + tlatency=1.0 first=.false. iptt=0 ntr0=-99 @@ -63,7 +63,7 @@ subroutine fivehz tx2=trperiod-(tlatency+txdelay) !Time to turn TX off if(mode(1:4).eq.'JT65') then if(nwave.lt.126*4096) nwave=126*4096 - tx2=nwave/11025.0 + tx2=nwave/11025.0 + tlatency endif if(TxFirst.eq.0) then @@ -126,7 +126,7 @@ subroutine fivehz if(nc1.eq.0) TxOK=1 ! We are transmitting ! If TxOK was just lowered, start a countdown for lowering PTT: - nc0a=txdelay/0.18576 + nc0a=(tlatency+txdelay)/0.18576 if(nc0a.lt.4) nc0a=4 if(TxOK.eq.0 .and. TxOKz.eq.1 .and. iptt.eq.1) nc0=-nc0a if(nc0.le.0) nc0=nc0+1 @@ -150,13 +150,13 @@ subroutine fivehz ! t60=mod(tsec,60.d0) ! if(iptt.ne.iptt0) then ! if(iptt.eq.1) tstart=tsec -! if(iptt.eq.0) write(*,1101) tsec-tstop,t60 -!1101 format('Delay from TxOFF to PTT was',f6.2,' s at t=',f6.2) +! if(iptt.eq.0) write(*,1101) tsec-tstop,t60,t,tx1,tx2 +!1101 format('Delay1:',2f7.2,3f10.1) ! endif ! if(TxOK.ne.TxOKz) then ! if(TxOK.eq.0) tstop=tsec -! if(TxOK.eq.1) write(*,1102) tsec-tstart,t60 -!1102 format('Delay from PTT to TxON was ',f6.2,' s at t=',f6.2) +! if(TxOK.eq.1) write(*,1102) tsec-tstart,t60,t,tx1,tx2 +!1102 format('Delay2:',2f7.2,3f10.1) ! endif ! endif diff --git a/wsjt.py b/wsjt.py index 89c940248..be89d3f64 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#-------------------------------------------------------------- WSJT +#--------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 17c69c2bd84162380e5f155d8e92b44046035dff Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 15 Jan 2006 20:00:56 +0000 Subject: [PATCH 071/811] - Initial cut at OSS support transmit not tested, I don't even know how to get the portaudio version to transmit. ;-) Works on receive just fine though. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@107 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 283 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 start_oss.c diff --git a/start_oss.c b/start_oss.c new file mode 100644 index 000000000..12d09786f --- /dev/null +++ b/start_oss.c @@ -0,0 +1,283 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "conf.h" + +#define AUDIOBUFSIZE 4096 +#define FRAMESPERBUFFER 1024 +#define TIMEOUT 1000L /* select time out for audio device */ + +char rcv_buf[AUDIOBUFSIZE]; /* XXX grab one from upper app later --db */ +char tx_buf[AUDIOBUFSIZE]; /* XXX grab one from upper app later --db */ + +#define DSP "/dev/dsp0.0" +#define MAXDSPNAME sizeof(DSP)+1 /* quick hack --db */ +char dsp_in[MAXDSPNAME]; /* Both of these must be same length */ +char dsp_out[MAXDSPNAME]; + +extern void decode1_(int *iarg); +void oss_loop(int *iarg); + +/* + * local state data referencing some gcom common fortran variables as well + */ +struct audio_data { + int fd_in; /* Audio fd in; used only locally in this function */ + int fd_out; /* Audio fd out; used only locally in this function */ + double *Tsec; /* Present time SoundIn,SoundOut */ + double *tbuf; /* Tsec at time of input callback SoundIn */ + int *iwrite; /* Write pointer to Rx ring buffer SoundIn */ + int *ibuf; /* Most recent input buffer# SoundIn */ + int *TxOK; /* OK to transmit? SoundIn */ + int *ndebug; /* Write debugging info? GUI */ + int *ndsec; /* Dsec in units of 0.1 s GUI */ + int *Transmitting; /* Actually transmitting? SoundOut */ + int *nwave; /* Number of samples in iwave SoundIn */ + int *nmode; /* Which WSJT mode? GUI */ + int *trperiod; /* Tx or Rx period in seconds GUI */ + int nbuflen; + int nfs; + int16_t *y1; /* Ring buffer for audio channel 0 SoundIn */ + int16_t *y2; /* Ring buffer for audio channel 1 SoundIn */ + short *iwave; +}data; + +/* + * start_threads() + * inputs - ndevin device number for input + * - ndevout device number for output + * - y1 short int array for channel 0 + * - y2 short int array for channel 1 + * - nmax + * - iwrite + * - iwave + * - nwave + * - rate + * - NSPB + * - TRPeriod + * - TxOK + * - ndebug debug output or not? + * - Transmitting + * - Tsec + * - ngo + * - nmode + * - tbuf + * - ibuf + * - ndsec + * output - ? + * side effects - Called from audio_init.f90 to start audio decode and + * OSS thread. + */ + +int +start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], + int *nbuflen, int *iwrite, short iwave[], + int *nwave, int *nfsample, int *nsamperbuf, + int *TRPeriod, int *TxOK, int *ndebug, + int *Transmitting, double *Tsec, int *ngo, int *nmode, + double tbuf[], int *ibuf, int *ndsec) +{ + pthread_t thread1,thread2; + int iret1,iret2; + int iarg1 = 1,iarg2 = 2; + int32_t rate=*nfsample; + int samplesize; + int format; + int channels; + double dnfs; + + /* XXX OSS device is decoded from ndevin and ndevout + * This is not strictly speaking the way to do it and is + * probably specific to FreeBSD for now. + * i.e. the .0 addition is a vchan; I'll add configure magic later. --db + */ + snprintf(dsp_in, MAXDSPNAME, + "/dev/dsp%d.0", *ndevin); + dsp_in[MAXDSPNAME] = '\0'; + + data.fd_in = open (dsp_in, O_RDWR, 0); + + if (data.fd_in < 0) { + fprintf(stderr, "Cannot open %s for input.\n", dsp_in); + exit(-1); + } + + if (*ndevin == *ndevout) { + data.fd_out = data.fd_in; + strncpy(dsp_out, dsp_in, sizeof(dsp_out)); + dsp_out[sizeof(dsp_out)] = '\0'; + + if (ioctl(data.fd_in, SNDCTL_DSP_SETDUPLEX, 0) < 0) { + fprintf(stderr, "Cannot use %s for full duplex.\n", dsp_in); + exit(-1); + } + } + + data.Tsec = Tsec; + data.tbuf = tbuf; + data.iwrite = iwrite; + data.ibuf = ibuf; + data.TxOK = TxOK; + data.ndebug = ndebug; + data.ndsec = ndsec; + data.Transmitting = Transmitting; + data.y1 = y1; + data.y2 = y2; + data.nbuflen = *nbuflen; + data.nmode = nmode; + data.nwave = nwave; + data.iwave = iwave; + data.nfs = *nfsample; + data.trperiod = TRPeriod; + + dnfs=(double)*nfsample; + + channels = 2; + if (ioctl (data.fd_in, SNDCTL_DSP_CHANNELS, &channels) == -1) { + fprintf (stderr, "Unable to set 2 channels for input.\n"); + exit (-1); + } + + if (channels != 2) { + fprintf (stderr, "Unable to set 2 channels.\n"); + exit (-1); + } + + format = AFMT_S16_NE; + if (ioctl (data.fd_in, SNDCTL_DSP_SETFMT, &format) == -1) { + fprintf (stderr, "Unable to set format for input.\n"); + exit (-1); + } + + if (ioctl (data.fd_in, SNDCTL_DSP_SPEED, &rate) == -1) { + fprintf (stderr, "Unable to set rate for input\n"); + exit (-1); + } + + printf("Audio OSS streams running normally.\n"); + printf("******************************************************************\n"); + printf("Opened %s for input.\n", dsp_in); + printf("Opened %s for output.\n", dsp_out); + printf("Rate set = %d\n", rate); + + // printf("start_threads: creating thread for oss_loop\n"); + iret1 = pthread_create(&thread1,NULL,oss_loop,&iarg1); + printf("start_threads: creating thread for decode1_\n"); + // iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); +} + +/* + * oss_loop + * + * inputs - int pointer NOT USED + * output - none + * side effects - + */ + +void +oss_loop(int *iarg) +{ + fd_set readfds, writefds; + int nfds = 0; + struct timeval timeout = {0, 0}; + struct timeval tv; + int nread; + unsigned int i; + static int n=0; + static int n2=0; + static int ia=0; + static int ib=0; + static int ic=0; + static int16_t *in; + static int16_t *wptr; + static int TxOKz=0; + static int ncall=0; + static int nsec=0; + static double stime; + + for (;;) { + FD_ZERO(&readfds ); + FD_ZERO(&writefds ); + FD_SET(data.fd_in, &readfds); + FD_SET(data.fd_out, &writefds); + + timeout.tv_usec = TIMEOUT; + if (select(FD_SETSIZE, &readfds, &writefds, NULL, &timeout) > 0) { + if (FD_ISSET(data.fd_in, &readfds)) { + nread = read (data.fd_in, rcv_buf, AUDIOBUFSIZE); + if (nread <= 0) { + fprintf(stderr, "Read error %d\n", nread); + exit(-1); + } + if (nread == AUDIOBUFSIZE) { + /* Get System time */ + gettimeofday(&tv, NULL); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + + *(data.ndsec) * 0.1; + *(data.Tsec) = stime; + + ncall++; + + /* increment buffer pointers only if data available */ + ia=*(data.iwrite); + ib=*(data.ibuf); + data.tbuf[ib++] = stime; + if(ib>=FRAMESPERBUFFER) + ib=0; + *(data.ibuf)=ib; + in = rcv_buf; // XXX + for(i=0; i= data.nbuflen) + ia=0; //Wrap buffer pointer if necessary + *(data.iwrite) = ia; /* Save buffer pointer */ + fivehz_(); /* Call fortran routine */ + } + } + if (FD_ISSET(data.fd_in, &writefds)) { + /* Get System time */ + gettimeofday(&tv, NULL); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + + *(data.ndsec) * 0.1; + *(data.Tsec) = stime; + if(*(data.TxOK) && (!TxOKz)) { + n=nsec/(*(data.trperiod)); + ic = (int)(stime - *(data.trperiod)*n) * data.nfs; + ic = ic % *(data.nwave); + } + TxOKz = *(data.TxOK); + *(data.Transmitting) = *(data.TxOK); + wptr = tx_buf; /* XXX */ + for(i=0 ; i= *(data.nwave)) { + ic = ic % *(data.nwave); /* Wrap buffer pointer if necessary */ + if(*(data.nmode) == 2) + *(data.TxOK) = 0; + } + } + else { + *wptr++ = 0; /* left */ + *wptr++ = 0; /* right */ + } + } + write(data.fd_out, tx_buf, AUDIOBUFSIZE); + fivehztx_(); /* Call fortran routine */ + } + } + } +} From 5297378423d3f78444ffb0e89283b58fe03953c4 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 15 Jan 2006 21:43:30 +0000 Subject: [PATCH 072/811] - Commented out the wrong line! - cleaned up compiler warnings (added a few casts) - transmit appears to work git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@108 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/start_oss.c b/start_oss.c index 12d09786f..cebcf8ecd 100644 --- a/start_oss.c +++ b/start_oss.c @@ -166,9 +166,11 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], printf("Rate set = %d\n", rate); // printf("start_threads: creating thread for oss_loop\n"); - iret1 = pthread_create(&thread1,NULL,oss_loop,&iarg1); - printf("start_threads: creating thread for decode1_\n"); - // iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); + iret1 = pthread_create(&thread1, NULL, + (void *(*)(void *))oss_loop, &iarg1); + // printf("start_threads: creating thread for decode1_\n"); + iret2 = pthread_create(&thread2, NULL, + (void *(*)(void *))decode1_,&iarg2); } /* @@ -229,8 +231,8 @@ oss_loop(int *iarg) data.tbuf[ib++] = stime; if(ib>=FRAMESPERBUFFER) ib=0; - *(data.ibuf)=ib; - in = rcv_buf; // XXX + *(data.ibuf) = ib; + in = (int16_t *)rcv_buf; // XXX for(i=0; i Date: Sun, 15 Jan 2006 22:17:12 +0000 Subject: [PATCH 073/811] - Clean up zero of null sound buffer for write and clean up logic git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@109 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/start_oss.c b/start_oss.c index cebcf8ecd..dd067ce2e 100644 --- a/start_oss.c +++ b/start_oss.c @@ -7,6 +7,7 @@ #include #include #include "conf.h" +#include #define AUDIOBUFSIZE 4096 #define FRAMESPERBUFFER 1024 @@ -251,16 +252,18 @@ oss_loop(int *iarg) stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + *(data.ndsec) * 0.1; *(data.Tsec) = stime; + if(*(data.TxOK) && (!TxOKz)) { n=nsec/(*(data.trperiod)); ic = (int)(stime - *(data.trperiod)*n) * data.nfs; ic = ic % *(data.nwave); } + TxOKz = *(data.TxOK); *(data.Transmitting) = *(data.TxOK); wptr = (int16_t *)tx_buf; /* XXX */ - for(i=0 ; i Date: Sun, 15 Jan 2006 23:32:39 +0000 Subject: [PATCH 074/811] - fixed ptt_unix.c to work with the non blocking ttyd0 for now (on freebsd) it was causing my grief with tx testing of OSS - fixed configure to fill in just start_oss.c for AUDIO git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@110 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 6 +++--- configure.ac | 4 +--- ptt_unix.c | 14 +++++++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/configure b/configure index e51b3ed3c..fca685a85 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 100 2006-01-14 15:47:35Z va3db $ +# $Id: configure.ac 102 2006-01-14 16:15:50Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 100 2006-01-14 15:47:35Z va3db $ +$Id: configure.ac 102 2006-01-14 16:15:50Z va3db $ _ACEOF exit 0 fi @@ -5742,7 +5742,7 @@ cat >>confdefs.h <<\_ACEOF #define USE_OSS 1 _ACEOF - AUDIO="jtaudio.c start_oss.c" + AUDIO="start_oss.c" CFLAGS="${CFLAGS} -DUSE_OSS" CPPFLAGS="${CPPFLAGS} -DUSE_OSS" diff --git a/configure.ac b/configure.ac index de42081b6..ef373ce45 100644 --- a/configure.ac +++ b/configure.ac @@ -239,15 +239,13 @@ if test "$alsa" = yes; then CPPFLAGS="${CPPFLAGS} -DUSE_ALSA" fi -dnl still not sure what OSS will require, but heres a first guess -db if test "$oss" = yes; then AC_DEFINE(USE_OSS, 1, [Define if you want OSS used.]) - AC_SUBST(AUDIO, "jtaudio.c start_oss.c") + AC_SUBST(AUDIO, "start_oss.c") CFLAGS="${CFLAGS} -DUSE_OSS" CPPFLAGS="${CPPFLAGS} -DUSE_OSS" fi -dnl XXX if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c") diff --git a/ptt_unix.c b/ptt_unix.c index 7a51e896b..98d6936ee 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -19,7 +19,7 @@ * for OSX. -db */ #if defined(BSD) -#define TTYNAME "/dev/ttyd%d" +#define TTYNAME "/dev/cuad%d" /* Use non blocking form */ #else #include #define TTYNAME "/dev/ttyS%d" @@ -28,7 +28,8 @@ /* Not quite right for size but '%d + 1' should be plenty enough -db */ #define TTYNAME_SIZE sizeof(TTYNAME)+1 -int ptt_(int *nport, int *ntx, int *iptt) +int +ptt_(int *nport, int *ntx, int *iptt) { static int nopen=0; int control = TIOCM_RTS | TIOCM_DTR; @@ -41,26 +42,25 @@ int ptt_(int *nport, int *ntx, int *iptt) } if(*ntx && (!nopen)) { - snprintf(s, TTYNAME_SIZE, TTYNAME, *nport); + snprintf(s, TTYNAME_SIZE, TTYNAME, (*nport) - 1); /* Comport 1 == dev 0 */ s[TTYNAME_SIZE] = '\0'; - //open the device + /* open the device */ if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { - fprintf(stderr, "device not found"); + fprintf(stderr, "Can't open %s.", s); return(1); } + nopen=1; return(0); } if(*ntx && nopen) { - // printf("Set DTR/RTS %d %d\n",TIOCMBIS,control); ioctl(fd, TIOCMBIS, &control); // Set DTR and RTS *iptt=1; } else { - // printf("Clear DTR/RTS %d %d\n",TIOCMBIC,control); ioctl(fd, TIOCMBIC, &control); close(fd); *iptt=0; From e51c55ad9827fa734661da68159a5795f55904c7 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 16 Jan 2006 02:02:46 +0000 Subject: [PATCH 075/811] - change the if logic a bit to match start_oss.c and use memset(). git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@111 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- jtaudio.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/jtaudio.c b/jtaudio.c index db8b1f6c8..cc2a53a36 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -166,8 +166,8 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, TxOKz=*data->TxOK; *data->Transmitting=*data->TxOK; - for(i=0 ; iTxOK) { + if(*data->TxOK) { + for(i=0 ; iiwave[ic]; addnoise_(&n2); *wptr++ = n2; //left @@ -179,10 +179,8 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, *data->TxOK=0; } } - else { - *wptr++ = 0; //left - *wptr++ = 0; //right - } + } else { + memset((void*)outputBuffer, 0, 2*sizeof(int16_t)*framesPerBuffer); } fivehztx_(); //Call fortran routine return 0; From ef6b6fcefc9be9ac744744d2b1e5e438cc4d6121 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 16 Jan 2006 02:03:57 +0000 Subject: [PATCH 076/811] - This file should no longer be used git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@112 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 560 ------------------------------------------------ 1 file changed, 560 deletions(-) delete mode 100644 start_threads.c diff --git a/start_threads.c b/start_threads.c deleted file mode 100644 index 643fd9811..000000000 --- a/start_threads.c +++ /dev/null @@ -1,560 +0,0 @@ -#include -#include -#include -#include "conf.h" - -#ifdef USE_ALSA -#include -#endif - -#include -#include - -#ifdef USE_PORTAUDIO -extern void decode1_(int *iarg); -extern void a2d_(int *iarg); -#endif - -#ifdef USE_ALSA - -#if 0 -#define ALSA_LOG -#define ALSA_LOG_BUFFERS -#endif -#if 0 -#define ALSA_PLAYBACK_LOG -#define ALSA_CAPTURE_LOG -#endif -#define BUFFER_TIME 2000*1000 - - -typedef struct alsa_driver_s { - snd_pcm_t *audio_fd; - int capabilities; - int open_mode; - int has_pause_resume; - int is_paused; - int32_t output_sample_rate, input_sample_rate; - double sample_rate_factor; - uint32_t num_channels; - uint32_t bits_per_sample; - uint32_t bytes_per_frame; - uint32_t bytes_in_buffer; /* number of bytes writen to audio hardware */ - int16_t *app_buffer_y1; - int16_t *app_buffer_y2; - int *app_buffer_offset; - int app_buffer_length; - double *Tsec; - double *tbuf; - int *ibuf; - int *ndsec; - int *tx_ok; - int tx_starting; - int tx_offset; - int *tr_period; - int *nwave; - int *nmode; - int *transmitting; - - snd_pcm_uframes_t buffer_size; - snd_pcm_uframes_t period_size; - int32_t mmap; -} alsa_driver_t; - -alsa_driver_t alsa_driver_playback; -alsa_driver_t alsa_driver_capture; -void *alsa_capture_buffers[2]; -void *alsa_playback_buffers[2]; - -static snd_output_t *jcd_out; - -/* - * open the audio device for writing to - */ -static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_stream_t direction ) { - alsa_driver_t *this = (alsa_driver_t *) this_gen; - char *pcm_device; - snd_pcm_hw_params_t *params; - snd_pcm_sw_params_t *swparams; - snd_pcm_access_mask_t *mask; - snd_pcm_uframes_t period_size_min; - snd_pcm_uframes_t period_size_max; - snd_pcm_uframes_t buffer_size_min; - snd_pcm_uframes_t buffer_size_max; - snd_pcm_format_t format; - uint32_t buffer_time=BUFFER_TIME; - snd_pcm_uframes_t buffer_time_to_size; - int err, dir; - int open_mode=1; /* NONBLOCK */ - /* int open_mode=0; BLOCK */ - int32_t rate=*input_rate; - this->input_sample_rate=*input_rate; - - snd_pcm_hw_params_alloca(¶ms); - snd_pcm_sw_params_alloca(&swparams); - err = snd_output_stdio_attach(&jcd_out, stdout, 0); - - this->num_channels = 2; - pcm_device="default"; -#ifdef ALSA_LOG - printf("audio_alsa_out: Audio Device name = %s\n",pcm_device); - printf("audio_alsa_out: Number of channels = %d\n",this->num_channels); -#endif - - if (this->audio_fd) { - printf("audio_alsa_out:Already open...WHY!"); - snd_pcm_close (this->audio_fd); - this->audio_fd = NULL; - } - - this->bytes_in_buffer = 0; - /* - * open audio device - */ - err=snd_pcm_open(&this->audio_fd, pcm_device, direction, open_mode); - if(err <0 ) { - printf ("audio_alsa_out: snd_pcm_open() of %s failed: %s\n", pcm_device, snd_strerror(err)); - printf ("audio_alsa_out: >>> check if another program already uses PCM <<<\n"); - return 0; - } - /* printf ("audio_alsa_out: snd_pcm_open() opened %s\n", pcm_device); */ - /* We wanted non blocking open but now put it back to normal */ - //snd_pcm_nonblock(this->audio_fd, 0); - snd_pcm_nonblock(this->audio_fd, 1); - /* - * configure audio device - */ - err = snd_pcm_hw_params_any(this->audio_fd, params); - if (err < 0) { - printf ("audio_alsa_out: broken configuration for this PCM: no configurations available: %s\n"), - snd_strerror(err); - goto close; - } - /* set interleaved access */ - if (this->mmap != 0) { - mask = alloca(snd_pcm_access_mask_sizeof()); - snd_pcm_access_mask_none(mask); - snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_INTERLEAVED); - snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_NONINTERLEAVED); - snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_COMPLEX); - err = snd_pcm_hw_params_set_access_mask(this->audio_fd, params, mask); - if (err < 0) { - printf ( "audio_alsa_out: mmap not availiable, falling back to compatiblity mode\n"); - this->mmap=0; - err = snd_pcm_hw_params_set_access(this->audio_fd, params, - SND_PCM_ACCESS_RW_NONINTERLEAVED); - } - } else { - err = snd_pcm_hw_params_set_access(this->audio_fd, params, - SND_PCM_ACCESS_RW_NONINTERLEAVED); - } - - if (err < 0) { - printf ( "audio_alsa_out: access type not available: %s\n", snd_strerror(err)); - goto close; - } - /* set the sample format S16 */ - /* ALSA automatically appends _LE or _BE depending on the CPU */ - format = SND_PCM_FORMAT_S16; - err = snd_pcm_hw_params_set_format(this->audio_fd, params, format ); - if (err < 0) { - printf ( "audio_alsa_out: sample format non available: %s\n", snd_strerror(err)); - goto close; - } - /* set the number of channels */ - err = snd_pcm_hw_params_set_channels(this->audio_fd, params, this->num_channels); - if (err < 0) { - printf ( "audio_alsa_out: Cannot set number of channels to %d (err=%d:%s)\n", - this->num_channels, err, snd_strerror(err)); - goto close; - } -#if SND_LIB_VERSION >= 0x010009 - /* Restrict a configuration space to contain only real hardware rates */ - err = snd_pcm_hw_params_set_rate_resample(this->audio_fd, params, 0); -#endif - /* set the stream rate [Hz] */ - dir=0; - err = snd_pcm_hw_params_set_rate_near(this->audio_fd, params, &rate, &dir); - if (err < 0) { - printf ( "audio_alsa_out: rate not available: %s\n", snd_strerror(err)); - goto close; - } - this->output_sample_rate = (uint32_t)rate; - if (this->input_sample_rate != this->output_sample_rate) { - printf ( "audio_alsa_out: audio rate : %d requested, %d provided by device/sec\n", - this->input_sample_rate, this->output_sample_rate); - } - buffer_time_to_size = ( (uint64_t)buffer_time * rate) / 1000000; - err = snd_pcm_hw_params_get_buffer_size_min(params, &buffer_size_min); - err = snd_pcm_hw_params_get_buffer_size_max(params, &buffer_size_max); - dir=0; - err = snd_pcm_hw_params_get_period_size_min(params, &period_size_min,&dir); - dir=0; - err = snd_pcm_hw_params_get_period_size_max(params, &period_size_max,&dir); -#ifdef ALSA_LOG_BUFFERS - printf("Buffer size range from %lu to %lu\n",buffer_size_min, buffer_size_max); - printf("Period size range from %lu to %lu\n",period_size_min, period_size_max); - printf("Buffer time size %lu\n",buffer_time_to_size); -#endif - this->buffer_size = buffer_time_to_size; - if (buffer_size_max < this->buffer_size) - this->buffer_size = buffer_size_max; - if (buffer_size_min > this->buffer_size) - this->buffer_size = buffer_size_min; - this->period_size = this->buffer_size/8; - if (this->period_size > 2048) - this->period_size = 2048; - this->buffer_size = this->period_size*8; -#ifdef ALSA_LOG_BUFFERS - printf("To choose buffer_size = %ld\n",this->buffer_size); - printf("To choose period_size = %ld\n",this->period_size); -#endif - -#if 0 - /* Set period to buffer size ratios at 8 periods to 1 buffer */ - dir=-1; - periods=8; - err = snd_pcm_hw_params_set_periods_near(this->audio_fd, params, &periods ,&dir); - if (err < 0) { - xprintf (this->class->xine, XINE_VERBOSITY_DEBUG, - "audio_alsa_out: unable to set any periods: %s\n", snd_strerror(err)); - goto close; - } - /* set the ring-buffer time [us] (large enough for x us|y samples ...) */ - dir=0; - err = snd_pcm_hw_params_set_buffer_time_near(this->audio_fd, params, &buffer_time, &dir); - if (err < 0) { - xprintf (this->class->xine, XINE_VERBOSITY_DEBUG, - "audio_alsa_out: buffer time not available: %s\n", snd_strerror(err)); - goto close; - } -#endif -#if 1 - /* set the period time [us] (interrupt every x us|y samples ...) */ - dir=0; - err = snd_pcm_hw_params_set_period_size_near(this->audio_fd, params, &(this->period_size), &dir); - if (err < 0) { - printf ( "audio_alsa_out: period time not available: %s\n", snd_strerror(err)); - goto close; - } -#endif - dir=0; - err = snd_pcm_hw_params_get_period_size(params, &(this->period_size), &dir); - - dir=0; - err = snd_pcm_hw_params_set_buffer_size_near(this->audio_fd, params, &(this->buffer_size)); - if (err < 0) { - printf ( "audio_alsa_out: buffer time not available: %s\n", snd_strerror(err)); - goto close; - } - err = snd_pcm_hw_params_get_buffer_size(params, &(this->buffer_size)); -#ifdef ALSA_LOG_BUFFERS - printf("was set period_size = %ld\n",this->period_size); - printf("was set buffer_size = %ld\n",this->buffer_size); -#endif - if (2*this->period_size > this->buffer_size) { - printf ( "audio_alsa_out: buffer to small, could not use\n"); - goto close; - } - - /* write the parameters to device */ - err = snd_pcm_hw_params(this->audio_fd, params); - if (err < 0) { - printf ( "audio_alsa_out: pcm hw_params failed: %s\n", snd_strerror(err)); - goto close; - } - /* Check for pause/resume support */ - this->has_pause_resume = ( snd_pcm_hw_params_can_pause (params) - && snd_pcm_hw_params_can_resume (params) ); - // printf( "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume); - this->sample_rate_factor = (double) this->output_sample_rate / (double) this->input_sample_rate; - this->bytes_per_frame = snd_pcm_frames_to_bytes (this->audio_fd, 1); - /* - * audio buffer size handling - */ - /* Copy current parameters into swparams */ - err = snd_pcm_sw_params_current(this->audio_fd, swparams); - if (err < 0) { - printf ( "audio_alsa_out: Unable to determine current swparams: %s\n", snd_strerror(err)); - goto close; - } - /* align all transfers to 1 sample */ - err = snd_pcm_sw_params_set_xfer_align(this->audio_fd, swparams, 1); - if (err < 0) { - printf ( "audio_alsa_out: Unable to set transfer alignment: %s\n", snd_strerror(err)); - goto close; - } - /* allow the transfer when at least period_size samples can be processed */ - err = snd_pcm_sw_params_set_avail_min(this->audio_fd, swparams, this->period_size); - if (err < 0) { - printf ( "audio_alsa_out: Unable to set available min: %s\n", snd_strerror(err)); - goto close; - } - if (direction == SND_PCM_STREAM_PLAYBACK) { - /* start the transfer when the buffer contains at least period_size samples */ - err = snd_pcm_sw_params_set_start_threshold(this->audio_fd, swparams, this->buffer_size); - } else { - err = snd_pcm_sw_params_set_start_threshold(this->audio_fd, swparams, -1); - } - if (err < 0) { - printf ( "audio_alsa_out: Unable to set start threshold: %s\n", snd_strerror(err)); - goto close; - } - - if (direction == SND_PCM_STREAM_PLAYBACK) { - /* never stop the transfer, even on xruns */ - err = snd_pcm_sw_params_set_stop_threshold(this->audio_fd, swparams, this->buffer_size); - } else { - err = snd_pcm_sw_params_set_stop_threshold(this->audio_fd, swparams, this->buffer_size); - } - if (err < 0) { - printf ( "audio_alsa_out: Unable to set stop threshold: %s\n", snd_strerror(err)); - goto close; - } - - /* Install swparams into current parameters */ - err = snd_pcm_sw_params(this->audio_fd, swparams); - if (err < 0) { - printf ( "audio_alsa_out: Unable to set swparams: %s\n", snd_strerror(err)); - goto close; - } -#ifdef ALSA_LOG - snd_pcm_dump_setup(this->audio_fd, jcd_out); - snd_pcm_sw_params_dump(swparams, jcd_out); -#endif - - return this->output_sample_rate; - -close: - snd_pcm_close (this->audio_fd); - this->audio_fd=NULL; - return 0; -} - -int16_t zero_buffer[65536]; - -int playback_callback(alsa_driver_t *alsa_driver_playback) { - alsa_driver_t *this = alsa_driver_playback; - int result; - struct timeval tv; - double stime; - int nsec; - int i,n; - static int ic; - int16_t b0[2048]; - -// printf("playback callback\n"); - gettimeofday(&tv, NULL); - stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + - *(this->ndsec) * 0.1; - *(this->Tsec) = stime; - if(!(this->tx_starting) && (*(this->tx_ok)) ) { - nsec = (int)stime; - n = nsec / *(this->tr_period); - ic = (int)(stime - *(this->tr_period) * n) * this->output_sample_rate; - ic = ic % *(this->nwave); - this->tx_offset = ic; - } - this->tx_starting = *(this->tx_ok); - *(this->transmitting) = *(this->tx_ok); - if(*(this->tx_ok)) { - /* - alsa_playback_buffers[0] = this->app_buffer_y1 + this->tx_offset; - alsa_playback_buffers[1] = this->app_buffer_y1 + this->tx_offset; - */ - alsa_playback_buffers[0] = b0; - alsa_playback_buffers[1] = b0; - for(i=0; iperiod_size; i++) { - b0[i]=this->app_buffer_y1[ic]; - ic++; - if(ic >= *this->nwave) { - ic=ic % *this->nwave; - if(*this->nmode == 2) - *this->tx_ok=0; - } - } - } else { - alsa_playback_buffers[0] = zero_buffer; - alsa_playback_buffers[1] = zero_buffer; - } - result = snd_pcm_writen(this->audio_fd, alsa_playback_buffers, this->period_size); - this->tx_offset += this->period_size; - if (result != this->period_size) { - printf("playback writei failed. Expected %d samples, sent only %d\n", this->period_size, result); -#ifdef ALSA_PLAYBACK_LOG - snd_pcm_status_t *pcm_stat; - snd_pcm_status_alloca(&pcm_stat); - snd_pcm_status(this->audio_fd, pcm_stat); - snd_pcm_status_dump(pcm_stat, jcd_out); -#endif - } - fivehztx_(); //Call fortran routine -} - -int capture_callback(alsa_driver_t *alsa_driver_capture) { - alsa_driver_t *this = alsa_driver_capture; - int result; - struct timeval tv; - double stime; - int ib; -#ifdef ALSA_CAPTURE_LOG - printf("capture callback %d samples\n", this->period_size); -#endif -#ifdef ALSA_CAPTURE_LOG - snd_pcm_status_t *pcm_stat; - snd_pcm_status_alloca(&pcm_stat); - snd_pcm_status(this->audio_fd, pcm_stat); - snd_pcm_status_dump(pcm_stat, jcd_out); -#endif - gettimeofday(&tv, NULL); - stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + - *(this->ndsec) * 0.1; - *(this->Tsec) = stime; - ib=*(this->ibuf); - this->tbuf[ib++] = stime; - if(ib>=1024) - ib = 0; - *(this->ibuf) = ib; - - alsa_capture_buffers[0]=this->app_buffer_y1 + *(this->app_buffer_offset); - alsa_capture_buffers[1]=this->app_buffer_y2 + *(this->app_buffer_offset); - result = snd_pcm_readn(this->audio_fd, alsa_capture_buffers, this->period_size); - *(this->app_buffer_offset) += this->period_size; - if ( *(this->app_buffer_offset) >= this->app_buffer_length ) - *(this->app_buffer_offset)=0; /* FIXME: implement proper wrapping */ -#ifdef ALSA_CAPTURE_LOG - printf("result=%d\n",result); - snd_pcm_status(this->audio_fd, pcm_stat); - snd_pcm_status_dump(pcm_stat, jcd_out); -#endif - fivehz_(); //Call fortran routine -} - -int playback_xrun(alsa_driver_t *alsa_driver_playback) { - alsa_driver_t *this = alsa_driver_playback; - snd_pcm_status_t *pcm_stat; - snd_pcm_status_alloca(&pcm_stat); - printf("playback xrun\n"); - snd_pcm_status(this->audio_fd, pcm_stat); - snd_pcm_status_dump(pcm_stat, jcd_out); - snd_pcm_prepare(this->audio_fd); -} - -int capture_xrun(alsa_driver_t *alsa_driver_capture) { - alsa_driver_t *this = alsa_driver_capture; - snd_pcm_status_t *pcm_stat; - snd_pcm_status_alloca(&pcm_stat); - printf("capture xrun\n"); - snd_pcm_status(this->audio_fd, pcm_stat); - snd_pcm_status_dump(pcm_stat, jcd_out); -} - -void ao_alsa_loop(void *iarg) { - int playback_nfds; - int capture_nfds; - struct pollfd *pfd; - int nfds; - int capture_index; - unsigned short playback_revents; - unsigned short capture_revents; - playback_nfds = snd_pcm_poll_descriptors_count ( - alsa_driver_playback.audio_fd); - capture_nfds = snd_pcm_poll_descriptors_count ( - alsa_driver_capture.audio_fd); - pfd = (struct pollfd *) malloc (sizeof (struct pollfd) * - (playback_nfds + capture_nfds)); - - nfds=0; - snd_pcm_poll_descriptors (alsa_driver_playback.audio_fd, - &pfd[0], - playback_nfds); - nfds += playback_nfds; - snd_pcm_poll_descriptors (alsa_driver_capture.audio_fd, - &pfd[nfds], - capture_nfds); - capture_index = nfds; - nfds += capture_nfds; - while(1) { - if (poll (pfd, nfds, 100000) < 0) { - printf("poll failed\n"); - return; - } - snd_pcm_poll_descriptors_revents(alsa_driver_playback.audio_fd, &pfd[0], playback_nfds, &playback_revents); - snd_pcm_poll_descriptors_revents(alsa_driver_capture.audio_fd, &pfd[capture_index], capture_nfds, &capture_revents); - //if ((playback_revents & POLLERR) || ((capture_revents) & POLLERR)) { - if (((capture_revents) & POLLERR)) { - printf("pollerr\n"); - capture_xrun(&alsa_driver_capture); - return; - } - if (((playback_revents) & POLLERR)) { - printf("pollerr\n"); - playback_xrun(&alsa_driver_capture); - return; - } - if (playback_revents & POLLOUT) { - playback_callback(&alsa_driver_playback); - } - if (capture_revents & POLLIN) { - capture_callback(&alsa_driver_capture); - } - } - - return; -} -#endif - -extern void decode1_(int *iarg); -int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], - int *nbuflen, int *iwrite, short iwave[], - int *nwave, int *nfsample, int *nsamperbuf, - int *TRPeriod, int *TxOK, int *ndebug, - int *Transmitting, double *Tsec, int *ngo, int *nmode, - double tbuf[], int *ibuf, int *ndsec) -{ - pthread_t thread1,thread2; - int iret1,iret2; - int iarg1 = 1,iarg2 = 2; -#ifdef USE_ALSA - //int32_t rate=11025; - int32_t rate=*nfsample; - alsa_driver_capture.app_buffer_y1 = y1; - alsa_driver_capture.app_buffer_y2 = y2; - alsa_driver_capture.app_buffer_offset = iwrite; - alsa_driver_capture.app_buffer_length = *nbuflen; - alsa_driver_capture.Tsec = Tsec; - alsa_driver_capture.tbuf = tbuf; - alsa_driver_capture.ibuf = ibuf; - alsa_driver_capture.ndsec = ndsec; - alsa_driver_playback.Tsec = Tsec; - alsa_driver_playback.app_buffer_y1 = iwave; - alsa_driver_playback.tx_ok = TxOK; - alsa_driver_playback.tr_period = TRPeriod; - alsa_driver_playback.nwave = nwave; - alsa_driver_playback.nmode = nmode; - alsa_driver_playback.transmitting = Transmitting; - alsa_driver_playback.ndsec = ndsec; - // printf("start_threads: creating thread for decode1\n"); - iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); -/* Open audio card. */ - printf("Starting alsa routines.\n"); - ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); - ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); - -/* - * Start audio io thread - */ - iret2 = pthread_create(&thread2, NULL, ao_alsa_loop, NULL); - snd_pcm_prepare(alsa_driver_capture.audio_fd); - snd_pcm_start(alsa_driver_capture.audio_fd); - snd_pcm_prepare(alsa_driver_playback.audio_fd); - //snd_pcm_start(alsa_driver_playback.audio_fd); -#endif -#ifdef USE_PORTAUDIO - /* snd_pcm_start */ - // printf("start_threads: creating thread for a2d\n"); - iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); - // printf("start_threads: creating thread for decode1_\n"); - iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); -#endif -} From 4b889cdf57853a94a9a9bbdc927f37658f43f105 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 16 Jan 2006 02:07:25 +0000 Subject: [PATCH 077/811] - remove conf.h hence remove conf.h.in as well, and modify all files previously using conf.h - pass defs found into the Makefile instead - add parallel port enable to configure --enable-parallel vs. --enable-serial - use code (partially contributed by yours truly anyway) from cwdaemon to add parallel port support for *nix. I've not tested parallel port operation, it should match what cwdaemon does, which is convenient. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@113 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 7 +- conf.h.in | 65 ------- configure | 418 ++++++++++++++++++---------------------------- configure.ac | 56 +++++-- ptt_unix.c | 333 ++++++++++++++++++++++++++++++++++-- start_alsa.c | 1 - start_oss.c | 1 - start_portaudio.c | 1 - 8 files changed, 534 insertions(+), 348 deletions(-) delete mode 100644 conf.h.in diff --git a/Makefile.in b/Makefile.in index 9ef817a96..c9d69b5c7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -5,10 +5,13 @@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ # WSJT specific C flags CFLAGS += -DBIGSYM=1 +DEFS = @DEFS@ +CFLAGS += ${DEFS} +CPPFLAGS += ${DEFS} # WSJT specific Fortran flags -#FFLAGS += -cpp -Wall -fbounds-check -ftrace=full -fno-second-underscore -FFLAGS += -cpp -fno-second-underscore +FFLAGS += -cpp -Wall -fbounds-check -ftrace=full -fno-second-underscore +#FFLAGS += -cpp -fno-second-underscore # The default rules .c.o: ${CC} ${CPPFLAGS} ${CFLAGS} -c -o ${<:.c=.o} $< diff --git a/conf.h.in b/conf.h.in deleted file mode 100644 index eaf2b7947..000000000 --- a/conf.h.in +++ /dev/null @@ -1,65 +0,0 @@ -/* setup.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if string.h may be included along with strings.h */ -#undef STRING_WITH_STRINGS - -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif - -/* This is needed to use strtok_r on Solaris. */ -#undef __EXTENSIONS__ - - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to `long long' if does not define. */ -#undef int64_t - -/* If system does not define sa_family_t, define it here. */ -#undef sa_family_t - -/* If we don't have a real socklen_t, unsigned int is good enough. */ -#undef socklen_t - -/* If system does not define u_int16_t, define a usable substitute. */ -#undef u_int16_t - -/* If system does not define u_int32_t, define to unsigned long int here. */ -#undef u_int32_t - -/* Define to `unsigned long long' if does not define. */ -#undef uint64_t - -/* Define if you have /usr/include/sys/param.h */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have asoundlib.h */ -#undef HAS_ASOUNDLIB_H - -/* Define if you want to use ALSA */ -#undef USE_ALSA - -/* Define if you have soundcard.h */ -#undef HAS_SOUNDCARD_H - -/* Define if you want to use OSS */ -#undef USE_OSS - -/* Define if you have portaudio.h */ -#undef HAS_PORTAUDIO_H - -/* Define if you want to use PORTAUDIO */ -#undef USE_PORTAUDIO diff --git a/configure b/configure index fca685a85..b3f32868f 100755 --- a/configure +++ b/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.53 for wsjt 0.9. +# Generated by GNU Autoconf 2.53 for wsjt 5.9.2. # -# $Id: configure.ac 102 2006-01-14 16:15:50Z va3db $ +# $Id: configure.ac 110 2006-01-15 23:32:39Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -256,8 +256,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='wsjt' PACKAGE_TARNAME='wsjt' -PACKAGE_VERSION='0.9' -PACKAGE_STRING='wsjt 0.9' +PACKAGE_VERSION='5.9.2' +PACKAGE_STRING='wsjt 5.9.2' PACKAGE_BUGREPORT='' ac_default_prefix=/usr/local/ @@ -770,7 +770,7 @@ 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 wsjt 0.9 to adapt to many kinds of systems. +\`configure' configures wsjt 5.9.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -827,7 +827,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of wsjt 0.9:";; + short | recursive ) echo "Configuration of wsjt 5.9.2:";; esac cat <<\_ACEOF @@ -839,6 +839,8 @@ Optional Features: --enable-alsa Force ALSA SOUNDCARD usage. --enable-oss Force OSS SOUND usage. --enable-portaudio Force PORTAUDIO SOUND usage. + --enable-parallel Force PARALLEL port usage for ptt. + --enable-serial Force SERIAL port usage for ptt. Some influential environment variables: CC C compiler command @@ -916,7 +918,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -wsjt configure 0.9 +wsjt configure 5.9.2 generated by GNU Autoconf 2.53 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @@ -924,7 +926,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 102 2006-01-14 16:15:50Z va3db $ +$Id: configure.ac 110 2006-01-15 23:32:39Z va3db $ _ACEOF exit 0 fi @@ -933,7 +935,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by wsjt $as_me 0.9, which was +It was created by wsjt $as_me 5.9.2, which was generated by GNU Autoconf 2.53. Invocation command line was $ $0 $@ @@ -1210,9 +1212,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_config_headers="$ac_config_headers conf.h" @@ -2074,7 +2073,7 @@ fi # Provide some information about the compiler. -echo "$as_me:2077:" \ +echo "$as_me:2076:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -3332,6 +3331,7 @@ OS=`uname` OS="${OS}" + echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then @@ -3540,7 +3540,17 @@ done -for ac_header in inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h + + + + + + + + +for ac_header in inttypes.h stdint.h sys/resource.h sys/param.h errno.h \ +sys/syslog.h stddef.h libgen.h sys/wait.h wait.h stdio.h termios.h \ +sys/resource.h linux/ppdev.h dev/ppbus/ppi.h sys/stat.h fcntl.h sys/ioctl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -3653,6 +3663,65 @@ fi done + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_time=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + + if test "${ac_cv_header_sys_soundcard_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 @@ -5713,7 +5782,43 @@ else portaudio=no fi; +# Check whether --enable-parallel or --disable-parallel was given. +if test "${enable_parallel+set}" = set; then + enableval="$enable_parallel" + parallel=$enableval +else + parallel=no +fi; +# Check whether --enable-serial or --disable-serial was given. +if test "${enable_serial+set}" = set; then + enableval="$enable_serial" + serial=$enableval +else + serial=no +fi; + + + +if test "$serial" != yes -a "$parallel" != yes; then + serial=yes; +fi + +if test "$serial" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_SERIAL 1 +_ACEOF + +fi + +if test "$parallel" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_PARALLEL 1 +_ACEOF + +fi if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then @@ -5732,8 +5837,6 @@ _ACEOF AUDIO="start_alsa.c" LDFLAGS="${LDFLAGS} -lasound" - CFLAGS="${CFLAGS} -DUSE_ALSA" - CPPFLAGS="${CPPFLAGS} -DUSE_ALSA" fi if test "$oss" = yes; then @@ -5744,8 +5847,6 @@ _ACEOF AUDIO="start_oss.c" - CFLAGS="${CFLAGS} -DUSE_OSS" - CPPFLAGS="${CPPFLAGS} -DUSE_OSS" fi if test "$portaudio" = yes; then @@ -5757,8 +5858,6 @@ _ACEOF AUDIO="a2d.f90 jtaudio.c start_portaudio.c" LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" - CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" - CPPFLAGS="${CPPFLAGS} -DUSE_PORTAUDIO" fi @@ -5827,8 +5926,7 @@ LDFLAGS="${LDFLAGS}" - - +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 @@ -5903,7 +6001,38 @@ s/^[^=]*=[ ]*$//; }' fi -DEFS=-DHAVE_CONFIG_H +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + : ${CONFIG_STATUS=./config.status} @@ -6154,7 +6283,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by wsjt $as_me 0.9, which was +This file was extended by wsjt $as_me 5.9.2, which was generated by GNU Autoconf 2.53. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6199,21 +6328,16 @@ Usage: $0 [OPTIONS] [FILE]... --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 - Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -wsjt config.status 0.9 +wsjt config.status 5.9.2 configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -6301,7 +6425,7 @@ do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "conf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS conf.h" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; @@ -6314,7 +6438,6 @@ done # 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 fi # Create a temporary directory, and hook for its removal unless debugging. @@ -6613,223 +6736,6 @@ s,@INSTALL@,$ac_INSTALL,;t t done _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #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. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null -do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines -echo ' fi # egrep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - -cat >>$CONFIG_STATUS <<\_ACEOF - # 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. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in - if test x"$ac_file" != x-; then - if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } - - rm -f $ac_file - mv $tmp/config.h $ac_file - fi - else - cat $tmp/config.h - rm -f $tmp/config.h - fi -done -_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -6862,15 +6768,23 @@ echo echo if test $portaudio == "yes"; then - echo "Using portaudio"; + echo "Using portaudio."; fi if test $alsa == "yes"; then - echo "Using alsa"; + echo "Using alsa."; fi if test $oss == "yes"; then - echo "Using oss"; + echo "Using oss."; +fi + +if test $serial == "yes"; then + echo "Using serial port for ptt."; +fi + +if test $parallel == "yes"; then + echo "Using parallel port for ptt."; fi echo diff --git a/configure.ac b/configure.ac index ef373ce45..e33114e20 100644 --- a/configure.ac +++ b/configure.ac @@ -7,9 +7,7 @@ dnl AC_PREREQ(2.59) dnl Sneaky way to get an Id tag into the configure script AC_COPYRIGHT([$Id$]) -AC_INIT([wsjt],[0.9]) - -AC_CONFIG_HEADER(conf.h) +AC_INIT([wsjt],[5.9.2]) AC_PREFIX_DEFAULT(/usr/local/) @@ -96,9 +94,15 @@ OS=`uname` AC_SUBST(OS, "${OS}") dnl Checks for header files. + AC_HEADER_STDC -AC_CHECK_HEADERS([inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h ]) +AC_CHECK_HEADERS([inttypes.h stdint.h sys/resource.h sys/param.h errno.h \ +sys/syslog.h stddef.h libgen.h sys/wait.h wait.h stdio.h termios.h \ +sys/resource.h linux/ppdev.h dev/ppbus/ppi.h sys/stat.h fcntl.h sys/ioctl.h ]) + +AC_HEADER_TIME + AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) AC_CHECK_HEADER([alsa/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) AC_CHECK_HEADER([portaudio.h], [HAS_PORTAUDIO_H=1], [HAS_PORTAUDIO_H=0]) @@ -217,12 +221,32 @@ AC_ARG_ENABLE(portaudio, AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), [portaudio=$enableval], [portaudio=no]) +AC_ARG_ENABLE(parallel, +AC_HELP_STRING([--enable-parallel],[Force PARALLEL port usage for ptt.]), +[parallel=$enableval], [parallel=no]) + +AC_ARG_ENABLE(serial, +AC_HELP_STRING([--enable-serial],[Force SERIAL port usage for ptt.]), +[serial=$enableval], [serial=no]) + dnl now set conf.h,, CPPFLAGS and CFLAGS flags as needed dnl ==================================================== dnl set defaults dnl ============ +if test "$serial" != yes -a "$parallel" != yes; then + [serial=yes]; +fi + +if test "$serial" = yes; then + AC_DEFINE(USE_SERIAL, 1, [Define if you want Serial port used.]) +fi + +if test "$parallel" = yes; then + AC_DEFINE(USE_PARALLEL, 1, [Define if you want Serial port used.]) +fi + if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then [portaudio=yes]; @@ -235,23 +259,17 @@ if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) AC_SUBST(AUDIO, "start_alsa.c") LDFLAGS="${LDFLAGS} -lasound" - CFLAGS="${CFLAGS} -DUSE_ALSA" - CPPFLAGS="${CPPFLAGS} -DUSE_ALSA" fi if test "$oss" = yes; then AC_DEFINE(USE_OSS, 1, [Define if you want OSS used.]) AC_SUBST(AUDIO, "start_oss.c") - CFLAGS="${CFLAGS} -DUSE_OSS" - CPPFLAGS="${CPPFLAGS} -DUSE_OSS" fi if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c") LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" - CFLAGS="${CFLAGS} -DUSE_PORTAUDIO" - CPPFLAGS="${CPPFLAGS} -DUSE_PORTAUDIO" fi dnl set conf flags @@ -302,24 +320,30 @@ AC_SUBST(CPPFLAGS, "${CPPFLAGS}") AC_SUBST(LDFLAGS, "${LDFLAGS}") AC_SUBST(CFLAGS) - - -AC_OUTPUT +AC_OUTPUT([Makefile]) dnl do summary echo echo if test $portaudio == "yes"; then - echo "Using portaudio"; + echo "Using portaudio."; fi if test $alsa == "yes"; then - echo "Using alsa"; + echo "Using alsa."; fi if test $oss == "yes"; then - echo "Using oss"; + echo "Using oss."; +fi + +if test $serial == "yes"; then + echo "Using serial port for ptt."; +fi + +if test $parallel == "yes"; then + echo "Using parallel port for ptt."; fi echo diff --git a/ptt_unix.c b/ptt_unix.c index 98d6936ee..4dd336a3c 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -1,17 +1,58 @@ /* * WSJT is Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, * and is licensed under the GNU General Public License (GPL). + * + * Code used from cwdaemon for parallel port ptt only. + * + * cwdaemon - morse sounding daemon for the parallel or serial port + * Copyright (C) 2002 -2005 Joop Stakenborg + * and many authors, see the AUTHORS file. + * + * 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 Library 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. */ - -#include -#include -#include -#include -#include "conf.h" /* XXX Could use CFLAGS later instead --db */ - -#ifdef HAVE_SYS_PARAM_H -#include +# if HAVE_STDIO_H +# include #endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif +#if HAVE_SYS_IOCTL_H +# include +#endif +#if HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_SYS_STAT_H +# include +#endif +#if (defined(__unix__) || defined(unix)) && !defined(USG) +# include +#endif + +int fd; /* Used for both serial and parallel */ + +#ifdef USE_SERIAL /* First cut, note that this only distinguishes Linux from BSDs, * it will be done better later on using configure. N.B. that OSX @@ -33,7 +74,7 @@ ptt_(int *nport, int *ntx, int *iptt) { static int nopen=0; int control = TIOCM_RTS | TIOCM_DTR; - int fd; + char s[TTYNAME_SIZE]; if(*nport < 0) { @@ -68,3 +109,275 @@ ptt_(int *nport, int *ntx, int *iptt) } return(0); } +#endif + +#ifdef USE_PARALLEL + +#ifdef HAVE_LINUX_PPDEV_H +# include +# include +#endif +#ifdef HAVE_DEV_PPBUS_PPI_H +# include +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#if (defined(__unix__) || defined(unix)) && !defined(USG) +# include +#endif + +/* parport functions */ + +int lp_reset (int fd); +int lp_ptt (int fd, int onoff); + +/* + * dev_is_parport(name): check to see whether 'name' is a parallel + * port type character device. Returns non-zero if the device is + * capable of use for a parallel port based keyer, and zero if it + * is not. Unfortunately, this is platform specific. + */ + +#if defined(HAVE_LINUX_PPDEV_H) /* Linux (ppdev) */ + +int +dev_is_parport(const char *fname) +{ + char nm[MAXPATHLEN]; + struct stat st; + int fd, m; + + m = snprintf(nm, sizeof(nm), "/dev/%s", fname); + if (m >= sizeof(nm)) + return (-1); + if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) + return (-1); + if (fstat(fd, &st) == -1) + goto out; + if ((st.st_mode & S_IFMT) != S_IFCHR) + goto out; + if (ioctl(fd, PPGETMODE, &m) == -1) + goto out; + return (fd); +out: + close(fd); + return (-1); +} + +#elif defined(HAVE_DEV_PPBUS_PPI_H) /* FreeBSD (ppbus/ppi) */ + +int +dev_is_parport(const char *fname) +{ + char nm[MAXPATHLEN]; + struct stat st; + unsigned char c; + int fd, m; + + m = snprintf(nm, sizeof(nm), "/dev/%s", fname); + if (m >= sizeof(nm)) + return (-1); + if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) + return (-1); + if (fstat(fd, &st) == -1) + goto out; + if ((st.st_mode & S_IFMT) != S_IFCHR) + goto out; + if (ioctl(fd, PPISSTATUS, &c) == -1) + goto out; + return (fd); +out: + close(fd); + return (-1); +} + +#else /* Fallback (nothing) */ + +int +dev_is_parport(const char *fname) +{ + return (-1); +} + +#endif +/* Linux wrapper around PPFCONTROL */ +#ifdef HAVE_LINUX_PPDEV_H +static void +parport_control (int fd, unsigned char controlbits, int values) +{ + struct ppdev_frob_struct frob; + frob.mask = controlbits; + frob.val = values; + + if (ioctl (fd, PPFCONTROL, &frob) == -1) + { + fprintf(stderr, "Parallel port PPFCONTROL"); + exit (1); + } +} +#endif + +/* FreeBSD wrapper around PPISCTRL */ +#ifdef HAVE_DEV_PPBUS_PPI_H +static void +parport_control (int fd, unsigned char controlbits, int values) +{ + unsigned char val; + + if (ioctl (fd, PPIGCTRL, &val) == -1) + { + fprintf(stderr, "Parallel port PPIGCTRL"); + exit (1); + } + + val &= ~controlbits; + val |= values; + + if (ioctl (fd, PPISCTRL, &val) == -1) + { + fprintf(stderr, "Parallel port PPISCTRL"); + exit (1); + } +} +#endif + +/* open port and setup ppdev */ +int +lp_init (int fd) +{ +#ifdef HAVE_LINUX_PPDEV_H + int mode; +#endif + +#ifdef HAVE_LINUX_PPDEV_H + mode = PARPORT_MODE_PCSPP; + + if (ioctl (fd, PPSETMODE, &mode) == -1) + { + fprintf(stderr, "Setting parallel port mode"); + close (fd); + exit (1); + } + + if (ioctl (fd, PPEXCL, NULL) == -1) + { + fprintf(stderr, "Parallel port %s is already in use", dev->desc); + close (fd); + exit (1); + } + if (ioctl (fd, PPCLAIM, NULL) == -1) + { + fprintf(stderr, "Claiming parallel port %s", dev->desc); + debug ("HINT: did you unload the lp kernel module?"); + debug ("HINT: perhaps there is another cwdaemon running?"); + close (fd); + exit (1); + } + + /* Enable CW & PTT - /STROBE bit (pin 1) */ + parport_control (fd, PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE); +#endif +#ifdef HAVE_DEV_PPBUS_PPI_H + parport_control (fd, STROBE, STROBE); +#endif + lp_reset (fd); + return 0; +} + +/* release ppdev and close port */ +int +lp_free (int fd) +{ +#ifdef HAVE_LINUX_PPDEV_H + lp_reset (fd); + + /* Disable CW & PTT - /STROBE bit (pin 1) */ + parport_control (fd, PARPORT_CONTROL_STROBE, 0); + + ioctl (fd, PPRELEASE); +#endif +#ifdef HAVE_DEV_PPBUS_PPI_H + /* Disable CW & PTT - /STROBE bit (pin 1) */ + parport_control (fd, STROBE, 0); +#endif + close (fd); + return 0; +} + +/* set to a known state */ +int +lp_reset (int fd) +{ +#if defined (HAVE_LINUX_PPDEV_H) || defined (HAVE_DEV_PPBUS_PPI_H) + lp_ptt (fd, 0); +#endif + return 0; +} + +/* SSB PTT keying - /INIT bit (pin 16) (inverted) */ +int +lp_ptt (int fd, int onoff) +{ +#ifdef HAVE_LINUX_PPDEV_H + if (onoff == 1) + parport_control (fd, PARPORT_CONTROL_INIT, + PARPORT_CONTROL_INIT); + else + parport_control (fd, PARPORT_CONTROL_INIT, 0); +#endif +#ifdef HAVE_DEV_PPBUS_PPI_H + if (onoff == 1) + parport_control (fd, nINIT, + nINIT); + else + parport_control (fd, nINIT, 0); +#endif + return 0; +} + +/* XXX I am totally unsure of this, LPNAME should come from + * the WSJT.INI instead but for now this should work -- db + */ +#ifdef BSD +#define LPNAME "/dev/lpt%d" +#else +#define LPNAME "/dev/lp%d" +#endif +#define LPNAME_SIZE (sizeof(LPNAME)) + +int +ptt_(int *nport, int *ntx, int *iptt) +{ + static int nopen=0; + int fd; + char s[LPNAME_SIZE]; + + if(*nport < 0) { + *iptt=*ntx; + return(0); + } + + if(*ntx && (!nopen)) { + snprintf(s, LPNAME_SIZE, LPNAME, (*nport) - 1); /* Comport 1 == dev 0 */ + s[LPNAME_SIZE] = '\0'; + + if ((fd = dev_is_parport(s)) < 0) { + fprintf(stderr, "Can't use %s.", s); + return(1); + } + + if(*ntx && nopen) { + lp_ptt(fd, 1); + *iptt=1; + } else { + lp_ptt(fd, 0); + close(fd); + *iptt=0; + nopen=0; + } + } + return(0); +} +#endif diff --git a/start_alsa.c b/start_alsa.c index c067c79ba..83fb734d0 100644 --- a/start_alsa.c +++ b/start_alsa.c @@ -4,7 +4,6 @@ #include #include #include -#include "conf.h" #if 0 #define ALSA_LOG diff --git a/start_oss.c b/start_oss.c index dd067ce2e..282e16a44 100644 --- a/start_oss.c +++ b/start_oss.c @@ -6,7 +6,6 @@ #include #include #include -#include "conf.h" #include #define AUDIOBUFSIZE 4096 diff --git a/start_portaudio.c b/start_portaudio.c index 5a845a222..1904e526f 100644 --- a/start_portaudio.c +++ b/start_portaudio.c @@ -3,7 +3,6 @@ #include #include #include -#include "conf.h" extern void decode1_(int *iarg); extern void a2d_(int *iarg); From 8d67e55e7b1d6d7bc39e8e543be4f40d3c1ca1ab Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 16 Jan 2006 16:39:11 +0000 Subject: [PATCH 078/811] A few tweaks to make it compile and run in Linux/ALSA, Linux PortAudio, and Windows. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@114 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- README_592.TXT | 21 +- audio_init.f90 | 145 +++++----- fivehz.f90 | 2 +- four2.f | 700 ++++++++++++++++++++++++------------------------- jtaudio.c | 9 +- ptt_unix.c | 2 +- start_alsa.c | 18 +- wsjt.py | 9 +- 8 files changed, 464 insertions(+), 442 deletions(-) diff --git a/README_592.TXT b/README_592.TXT index 41d5cf45d..dd4204199 100755 --- a/README_592.TXT +++ b/README_592.TXT @@ -4,31 +4,31 @@ Changes in WSJT 5.9.2: January 10, 2006 Enhancements ------------ -1. Thread priorities have been adjusted for smoother operation. One - result is that there will be fewer audio glitches caused by the - Windows O/S paying attention to other programs. +1. Thread priorities have been adjusted for smoother operation. -2. The JT65 decoder now has improved immunity to "garbage data," and - it exhibits better performance on strong signals. +2. The JT65 decoder now has improved immunity to garbage data + (birdies, QRM, etc.) and it exhibits better performance on + strong signals. -3. The FSK441 decoder produces less on-screen gibberish when you do - mouse-picked decodes. +3. The FSK441 decoder produces less on-screen gibberish when you + request mouse-picked decodes. 4. The JT6M decoder now makes better use of Freeze and Tol. You can set the value of "Freeze DF" by using the Right/Left arrow keys. + (This feature is also useful in JT65 mode.) 5. On-screen font sizes can be set by using Windows Notepad (or another text editor) to edit the file wsjtrc.win. If your screen has resolution greater than 1024 x 768, or if you have old eyes - like mine, you may want to increase the sizes from 8 and 9 points - (first three lines of the file) to, say, 9 and 10 points. + like mine, you may want to increase the font sizes from 8 and 9 + points (first three lines of the file) to, say, 9 and 10 points. 6. A simulator mode is now built into WSJT. It is presently most useful in JT65 mode. By entering, say, "#-22" in the text box for Tx6, you signify that the program should generate its Tx audio files with the signal embedded in white gaussian noise, 22 dB below the noise power in a 2.5 kHz bandwidth. You can direct this - signal into a second computer running WSJT, for eaxmple to test + signal into a second computer running WSJT, for example to test the decoder or to practice operating in JT65 mode. You can even have the two computers "work each other", although changing messages of course requires operator action. @@ -83,6 +83,7 @@ The present WSJT working group consists of: Diane Bruce, VA3DB James Courtier-Dutton Bob McGwier, N4HY + Jonathan Naylor, ON/G4KLX Stewart Nelson, KK7KA Joe Taylor, K1JT Kaj Wiik, OH6EH diff --git a/audio_init.f90 b/audio_init.f90 index 74afbde86..bc288cfcf 100644 --- a/audio_init.f90 +++ b/audio_init.f90 @@ -1,69 +1,78 @@ - -!------------------------------------------------ audio_init -subroutine audio_init(ndin,ndout) - -#ifdef Win32 - use dfmt - integer Thread1,Thread2 - external a2d,decode1 +!------------------------------------------------ audio_init +subroutine audio_init(ndin,ndout) + +#ifdef Win32 + use dfmt + integer Thread1,Thread2 + external a2d,decode1 #endif - - integer*2 a(225000) !Pixel values for 750 x 300 array - integer brightness,contrast - include 'gcom1.f90' - - ndevin=ndin - ndevout=ndout - TxOK=0 - Transmitting=0 - nfsample=11025 - nspb=1024 - nbufs=2048 - nmax=nbufs*nspb - nwave=60*nfsample - ngo=1 - brightness=0 - contrast=0 - nsec=1 - df=11025.0/4096 - f0=800.0 - do i=1,nwave - iwave(i)=nint(32767.0*sin(6.283185307*i*f0/nfsample)) - enddo - -#ifdef Win32 -! Priority classes (for processes): -! IDLE_PRIORITY_CLASS 64 -! NORMAL_PRIORITY_CLASS 32 -! HIGH_PRIORITY_CLASS 128 - -! Priority definitions (for threads): -! THREAD_PRIORITY_IDLE -15 -! THREAD_PRIORITY_LOWEST -2 -! THREAD_PRIORITY_BELOW_NORMAL -1 -! THREAD_PRIORITY_NORMAL 0 -! THREAD_PRIORITY_ABOVE_NORMAL 1 -! THREAD_PRIORITY_HIGHEST 2 -! THREAD_PRIORITY_TIME_CRITICAL 15 - - m0=SetPriorityClass(GetCurrentProcess(),NORMAL_PRIORITY_CLASS) - -! Start a thread for doing A/D and D/A with sound card. - Thread1=CreateThread(0,0,a2d,0,CREATE_SUSPENDED,id) - m1=SetThreadPriority(Thread1,THREAD_PRIORITY_ABOVE_NORMAL) - m2=ResumeThread(Thread1) - -! Start a thread for background decoding. - Thread2=CreateThread(0,0,decode1,0,CREATE_SUSPENDED,id) - m3=SetThreadPriority(Thread2,THREAD_PRIORITY_BELOW_NORMAL) - m4=ResumeThread(Thread2) -#else -! print*,'Audio INIT called.' - ierr=start_threads(ndevin,ndevout,y1,y2,nmax,iwrite,iwave,nwave, & - 11025,NSPB,TRPeriod,TxOK,ndebug,Transmitting, & - Tsec,ngo,nmode,tbuf,ibuf,ndsec) - -#endif - - return -end subroutine audio_init + + integer*2 a(225000) !Pixel values for 750 x 300 array + integer brightness,contrast + include 'gcom1.f90' + include 'gcom2.f90' + + nmode=1 + if(mode(1:4).eq.'JT65') then + nmode=2 + if(mode(5:5).eq.'A') mode65=1 + if(mode(5:5).eq.'B') mode65=2 + if(mode(5:5).eq.'C') mode65=4 + endif + if(mode.eq.'Echo') nmode=3 + if(mode.eq.'JT6M') nmode=4 + ndevin=ndin + ndevout=ndout + TxOK=0 + Transmitting=0 + nfsample=11025 + nspb=1024 + nbufs=2048 + nmax=nbufs*nspb + nwave=60*nfsample + ngo=1 + brightness=0 + contrast=0 + nsec=1 + df=11025.0/4096 + f0=800.0 + do i=1,nwave + iwave(i)=nint(32767.0*sin(6.283185307*i*f0/nfsample)) + enddo + +#ifdef Win32 +! Priority classes (for processes): +! IDLE_PRIORITY_CLASS 64 +! NORMAL_PRIORITY_CLASS 32 +! HIGH_PRIORITY_CLASS 128 + +! Priority definitions (for threads): +! THREAD_PRIORITY_IDLE -15 +! THREAD_PRIORITY_LOWEST -2 +! THREAD_PRIORITY_BELOW_NORMAL -1 +! THREAD_PRIORITY_NORMAL 0 +! THREAD_PRIORITY_ABOVE_NORMAL 1 +! THREAD_PRIORITY_HIGHEST 2 +! THREAD_PRIORITY_TIME_CRITICAL 15 + + m0=SetPriorityClass(GetCurrentProcess(),NORMAL_PRIORITY_CLASS) + +! Start a thread for doing A/D and D/A with sound card. + Thread1=CreateThread(0,0,a2d,0,CREATE_SUSPENDED,id) + m1=SetThreadPriority(Thread1,THREAD_PRIORITY_ABOVE_NORMAL) + m2=ResumeThread(Thread1) + +! Start a thread for background decoding. + Thread2=CreateThread(0,0,decode1,0,CREATE_SUSPENDED,id) + m3=SetThreadPriority(Thread2,THREAD_PRIORITY_BELOW_NORMAL) + m4=ResumeThread(Thread2) +#else +! print*,'Audio INIT called.' + ierr=start_threads(ndevin,ndevout,y1,y2,nmax,iwrite,iwave,nwave, & + 11025,NSPB,TRPeriod,TxOK,ndebug,Transmitting, & + Tsec,ngo,nmode,tbuf,ibuf,ndsec) + +#endif + + return +end subroutine audio_init diff --git a/fivehz.f90 b/fivehz.f90 index 99954c5b0..8bcd53857 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -211,7 +211,7 @@ subroutine addnoise(n) real r(12) real*8 txsnrdb0 include 'gcom1.f90' - save txsnrdb0 + save if(txsnrdb.gt.40.0) return if(txsnrdb.ne.txsnrdb0) then diff --git a/four2.f b/four2.f index b3f4aeaa9..c6bc9441a 100755 --- a/four2.f +++ b/four2.f @@ -1,350 +1,350 @@ - SUBROUTINE FOUR2a (DATA,N,NDIM,ISIGN,IFORM) - -C Cooley-Tukey fast Fourier transform in USASI basic Fortran. -C multi-dimensional transform, each dimension a power of two, -C complex or real data. - -C TRANSFORM(K1,K2,...) = SUM(DATA(J1,J2,...)*EXP(ISIGN*2*PI*SQRT(-1) -C *((J1-1)*(K1-1)/N(1)+(J2-1)*(K2-1)/N(2)+...))), summed for all -C J1 and K1 from 1 to N(1), J2 and K2 from 1 TO N(2), -C etc, for all NDIM subscripts. NDIM must be positive and -C each N(IDIM) must be a power of two. ISIGN is +1 or -1. -C Let NTOT = N(1)*N(2)*...*N(NDIM). Then a -1 transform -C followed by a +1 one (or vice versa) returns NTOT -C times the original data. - -C IFORM = 1, 0 or -1, as data is -C complex, real, or the first half of a complex array. Transform -C values are returned in array DATA. They are complex, real, or -C the first half of a complex array, as IFORM = 1, -1 or 0. - -C The transform of a real array (IFORM = 0) dimensioned N(1) by N(2) -C by ... will be returned in the same array, now considered to -C be complex of dimensions N(1)/2+1 by N(2) by .... Note that if -C IFORM = 0 or -1, N(1) must be even, and enough room must be -C reserved. The missing values may be obtained by complex conjuga- -C tion. - -C The reverse transformation of a half complex array dimensioned -C N(1)/2+1 by N(2) by ..., is accomplished by setting IFORM -C to -1. In the N array, N(1) must be the true N(1), not N(1)/2+1. -C The transform will be real and returned to the input array. - -C Running time is proportional to NTOT*LOG2(NTOT), rather than -C the naive NTOT**2. Furthermore, less error is built up. - -C Written by Norman Brenner of MIT Lincoln Laboratory, January 1969. -C See IEEE Audio Transactions (June 1967), Special issue on FFT. - - parameter(NMAX=2048*1024) - DIMENSION DATA(NMAX), N(1) - NTOT=1 - DO 10 IDIM=1,NDIM - 10 NTOT=NTOT*N(IDIM) - IF (IFORM) 70,20,20 - 20 NREM=NTOT - DO 60 IDIM=1,NDIM - NREM=NREM/N(IDIM) - NPREV=NTOT/(N(IDIM)*NREM) - NCURR=N(IDIM) - IF (IDIM-1+IFORM) 30,30,40 - 30 NCURR=NCURR/2 - 40 CALL BITRV (DATA,NPREV,NCURR,NREM) - CALL COOL2 (DATA,NPREV,NCURR,NREM,ISIGN) - IF (IDIM-1+IFORM) 50,50,60 - 50 CALL FIXRL (DATA,N(1),NREM,ISIGN,IFORM) - NTOT=(NTOT/N(1))*(N(1)/2+1) - 60 CONTINUE - RETURN - 70 NTOT=(NTOT/N(1))*(N(1)/2+1) - NREM=1 - DO 100 JDIM=1,NDIM - IDIM=NDIM+1-JDIM - NCURR=N(IDIM) - IF (IDIM-1) 80,80,90 - 80 NCURR=NCURR/2 - CALL FIXRL (DATA,N(1),NREM,ISIGN,IFORM) - NTOT=NTOT/(N(1)/2+1)*N(1) - 90 NPREV=NTOT/(N(IDIM)*NREM) - CALL BITRV (DATA,NPREV,NCURR,NREM) - CALL COOL2 (DATA,NPREV,NCURR,NREM,ISIGN) - 100 NREM=NREM*N(IDIM) - RETURN - END - SUBROUTINE BITRV (DATA,NPREV,N,NREM) -C SHUFFLE THE DATA BY BIT REVERSAL. -C DIMENSION DATA(NPREV,N,NREM) -C COMPLEX DATA -C EXCHANGE DATA(J1,J4REV,J5) WITH DATA(J1,J4,J5) FOR ALL J1 FROM 1 -C TO NPREV, ALL J4 FROM 1 TO N (WHICH MUST BE A POWER OF TWO), AND -C ALL J5 FROM 1 TO NREM. J4REV-1 IS THE BIT REVERSAL OF J4-1. E.G. -C SUPPOSE N = 32. THEN FOR J4-1 = 10011, J4REV-1 = 11001, ETC. - parameter(NMAX=2048*1024) - DIMENSION DATA(NMAX) - IP0=2 - IP1=IP0*NPREV - IP4=IP1*N - IP5=IP4*NREM - I4REV=1 -C I4REV = 1+(J4REV-1)*IP1 - DO 60 I4=1,IP4,IP1 -C I4 = 1+(J4-1)*IP1 - IF (I4-I4REV) 10,30,30 - 10 I1MAX=I4+IP1-IP0 - DO 20 I1=I4,I1MAX,IP0 -C I1 = 1+(J1-1)*IP0+(J4-1)*IP1 - DO 20 I5=I1,IP5,IP4 -C I5 = 1+(J1-1)*IP0+(J4-1)*IP1+(J5-1)*IP4 - I5REV=I4REV+I5-I4 -C I5REV = 1+(J1-1)*IP0+(J4REV-1)*IP1+(J5-1)*IP4 - TEMPR=DATA(I5) - TEMPI=DATA(I5+1) - DATA(I5)=DATA(I5REV) - DATA(I5+1)=DATA(I5REV+1) - DATA(I5REV)=TEMPR - 20 DATA(I5REV+1)=TEMPI -C ADD ONE WITH DOWNWARD CARRY TO THE HIGH ORDER BIT OF J4REV-1. - 30 IP2=IP4/2 - 40 IF (I4REV-IP2) 60,60,50 - 50 I4REV=I4REV-IP2 - IP2=IP2/2 - IF (IP2-IP1) 60,40,40 - 60 I4REV=I4REV+IP2 - RETURN - END - SUBROUTINE COOL2 (DATA,NPREV,N,NREM,ISIGN) -C DISCRETE FOURIER TRANSFORM OF LENGTH N. IN-PLACE COOLEY-TUKEY -C ALGORITHM, BIT-REVERSED TO NORMAL ORDER, SANDE-TUKEY PHASE SHIFTS. -C DIMENSION DATA(NPREV,N,NREM) -C COMPLEX DATA -C DATA(J1,K4,J5) = SUM(DATA(J1,J4,J5)*EXP(ISIGN*2*PI*I*(J4-1)* -C (K4-1)/N)), SUMMED OVER J4 = 1 TO N FOR ALL J1 FROM 1 TO NPREV, -C K4 FROM 1 TO N AND J5 FROM 1 TO NREM. N MUST BE A POWER OF TWO. -C METHOD--LET IPREV TAKE THE VALUES 1, 2 OR 4, 4 OR 8, ..., N/16, -C N/4, N. THE CHOICE BETWEEN 2 OR 4, ETC., DEPENDS ON WHETHER N IS -C A POWER OF FOUR. DEFINE IFACT = 2 OR 4, THE NEXT FACTOR THAT -C IPREV MUST TAKE, AND IREM = N/(IFACT*IPREV). THEN-- -C DIMENSION DATA(NPREV,IPREV,IFACT,IREM,NREM) -C COMPLEX DATA -C DATA(J1,J2,K3,J4,J5) = SUM(DATA(J1,J2,J3,J4,J5)*EXP(ISIGN*2*PI*I* -C (K3-1)*((J3-1)/IFACT+(J2-1)/(IFACT*IPREV)))), SUMMED OVER J3 = 1 -C TO IFACT FOR ALL J1 FROM 1 TO NPREV, J2 FROM 1 TO IPREV, K3 FROM -C 1 TO IFACT, J4 FROM 1 TO IREM AND J5 FROM 1 TO NREM. THIS IS -C A PHASE-SHIFTED DISCRETE FOURIER TRANSFORM OF LENGTH IFACT. -C FACTORING N BY FOURS SAVES ABOUT TWENTY FIVE PERCENT OVER FACTOR- -C ING BY TWOS. DATA MUST BE BIT-REVERSED INITIALLY. -C IT IS NOT NECESSARY TO REWRITE THIS SUBROUTINE INTO COMPLEX -C NOTATION SO LONG AS THE FORTRAN COMPILER USED STORES REAL AND -C IMAGINARY PARTS IN ADJACENT STORAGE LOCATIONS. IT MUST ALSO -C STORE ARRAYS WITH THE FIRST SUBSCRIPT INCREASING FASTEST. - parameter(NMAX=2048*1024) - DIMENSION DATA(NMAX) - - real*8 twopi,wstpr,wstpi,wr,wi,w2r,w2i,w3r,w3i,wtempr - - TWOPI=6.2831853072*FLOAT(ISIGN) - IP0=2 - IP1=IP0*NPREV - IP4=IP1*N - IP5=IP4*NREM - IP2=IP1 -C IP2=IP1*IPROD - NPART=N - 10 IF (NPART-2) 60,30,20 - 20 NPART=NPART/4 - GO TO 10 -C DO A FOURIER TRANSFORM OF LENGTH TWO - 30 IF (IP2-IP4) 40,160,160 - 40 IP3=IP2*2 -C IP3=IP2*IFACT - DO 50 I1=1,IP1,IP0 -C I1 = 1+(J1-1)*IP0 - DO 50 I5=I1,IP5,IP3 -C I5 = 1+(J1-1)*IP0+(J4-1)*IP3+(J5-1)*IP4 - I3A=I5 - I3B=I3A+IP2 -C I3 = 1+(J1-1)*IP0+(J2-1)*IP1+(J3-1)*IP2+(J4-1)*IP3+(J5-1)*IP4 - TEMPR=DATA(I3B) - TEMPI=DATA(I3B+1) - DATA(I3B)=DATA(I3A)-TEMPR - DATA(I3B+1)=DATA(I3A+1)-TEMPI - DATA(I3A)=DATA(I3A)+TEMPR - 50 DATA(I3A+1)=DATA(I3A+1)+TEMPI - IP2=IP3 -C DO A FOURIER TRANSFORM OF LENGTH FOUR (FROM BIT REVERSED ORDER) - 60 IF (IP2-IP4) 70,160,160 - 70 IP3=IP2*4 -C IP3=IP2*IFACT -C COMPUTE TWOPI THRU WR AND WI IN DOUBLE PRECISION, IF AVAILABLE. - THETA=TWOPI/FLOAT(IP3/IP1) - SINTH=SIN(THETA/2) - WSTPR=-2*SINTH*SINTH - WSTPI=SIN(THETA) - WR=1. - WI=0. - DO 150 I2=1,IP2,IP1 -C I2 = 1+(J2-1)*IP1 - IF (I2-1) 90,90,80 - 80 W2R=WR*WR-WI*WI - W2I=2*WR*WI - W3R=W2R*WR-W2I*WI - W3I=W2R*WI+W2I*WR - 90 I1MAX=I2+IP1-IP0 - DO 140 I1=I2,I1MAX,IP0 -C I1 = 1+(J1-1)*IP0+(J2-1)*IP1 - DO 140 I5=I1,IP5,IP3 -C I5 = 1+(J1-1)*IP0+(J2-1)*IP1+(J4-1)*IP3+(J5-1)*IP4 - I3A=I5 - I3B=I3A+IP2 - I3C=I3B+IP2 - I3D=I3C+IP2 -C I3 = 1+(J1-1)*IP0+(J2-1)*IP1+(J3-1)*IP2+(J4-1)*IP3+(J5-1)*IP4 - IF (I2-1) 110,110,100 -C APPLY THE PHASE SHIFT FACTORS - 100 TEMPR=DATA(I3B) - DATA(I3B)=W2R*DATA(I3B)-W2I*DATA(I3B+1) - DATA(I3B+1)=W2R*DATA(I3B+1)+W2I*TEMPR - TEMPR=DATA(I3C) - DATA(I3C)=WR*DATA(I3C)-WI*DATA(I3C+1) - DATA(I3C+1)=WR*DATA(I3C+1)+WI*TEMPR - TEMPR=DATA(I3D) - DATA(I3D)=W3R*DATA(I3D)-W3I*DATA(I3D+1) - DATA(I3D+1)=W3R*DATA(I3D+1)+W3I*TEMPR - 110 T0R=DATA(I3A)+DATA(I3B) - T0I=DATA(I3A+1)+DATA(I3B+1) - T1R=DATA(I3A)-DATA(I3B) - T1I=DATA(I3A+1)-DATA(I3B+1) - T2R=DATA(I3C)+DATA(I3D) - T2I=DATA(I3C+1)+DATA(I3D+1) - T3R=DATA(I3C)-DATA(I3D) - T3I=DATA(I3C+1)-DATA(I3D+1) - DATA(I3A)=T0R+T2R - DATA(I3A+1)=T0I+T2I - DATA(I3C)=T0R-T2R - DATA(I3C+1)=T0I-T2I - IF (ISIGN) 120,120,130 - 120 T3R=-T3R - T3I=-T3I - 130 DATA(I3B)=T1R-T3I - DATA(I3B+1)=T1I+T3R - DATA(I3D)=T1R+T3I - 140 DATA(I3D+1)=T1I-T3R - WTEMPR=WR - WR=WSTPR*WTEMPR-WSTPI*WI+WTEMPR - 150 WI=WSTPR*WI+WSTPI*WTEMPR+WI - IP2=IP3 - GO TO 60 - 160 RETURN - END - SUBROUTINE FIXRL (DATA,N,NREM,ISIGN,IFORM) -C FOR IFORM = 0, CONVERT THE TRANSFORM OF A DOUBLED-UP REAL ARRAY, -C CONSIDERED COMPLEX, INTO ITS TRUE TRANSFORM. SUPPLY ONLY THE -C FIRST HALF OF THE COMPLEX TRANSFORM, AS THE SECOND HALF HAS -C CONJUGATE SYMMETRY. FOR IFORM = -1, CONVERT THE FIRST HALF -C OF THE TRUE TRANSFORM INTO THE TRANSFORM OF A DOUBLED-UP REAL -C ARRAY. N MUST BE EVEN. -C USING COMPLEX NOTATION AND SUBSCRIPTS STARTING AT ZERO, THE -C TRANSFORMATION IS-- -C DIMENSION DATA(N,NREM) -C ZSTP = EXP(ISIGN*2*PI*I/N) -C DO 10 I2=0,NREM-1 -C DATA(0,I2) = CONJ(DATA(0,I2))*(1+I) -C DO 10 I1=1,N/4 -C Z = (1+(2*IFORM+1)*I*ZSTP**I1)/2 -C I1CNJ = N/2-I1 -C DIF = DATA(I1,I2)-CONJ(DATA(I1CNJ,I2)) -C TEMP = Z*DIF -C DATA(I1,I2) = (DATA(I1,I2)-TEMP)*(1-IFORM) -C 10 DATA(I1CNJ,I2) = (DATA(I1CNJ,I2)+CONJ(TEMP))*(1-IFORM) -C IF I1=I1CNJ, THE CALCULATION FOR THAT VALUE COLLAPSES INTO -C A SIMPLE CONJUGATION OF DATA(I1,I2). - parameter(NMAX=2048*1024) - DIMENSION DATA(NMAX) - TWOPI=6.283185307*FLOAT(ISIGN) - IP0=2 - IP1=IP0*(N/2) - IP2=IP1*NREM - IF (IFORM) 10,70,70 -C PACK THE REAL INPUT VALUES (TWO PER COLUMN) - 10 J1=IP1+1 - DATA(2)=DATA(J1) - IF (NREM-1) 70,70,20 - 20 J1=J1+IP0 - I2MIN=IP1+1 - DO 60 I2=I2MIN,IP2,IP1 - DATA(I2)=DATA(J1) - J1=J1+IP0 - IF (N-2) 50,50,30 - 30 I1MIN=I2+IP0 - I1MAX=I2+IP1-IP0 - DO 40 I1=I1MIN,I1MAX,IP0 - DATA(I1)=DATA(J1) - DATA(I1+1)=DATA(J1+1) - 40 J1=J1+IP0 - 50 DATA(I2+1)=DATA(J1) - 60 J1=J1+IP0 - 70 DO 80 I2=1,IP2,IP1 - TEMPR=DATA(I2) - DATA(I2)=DATA(I2)+DATA(I2+1) - 80 DATA(I2+1)=TEMPR-DATA(I2+1) - IF (N-2) 200,200,90 - 90 THETA=TWOPI/FLOAT(N) - SINTH=SIN(THETA/2.) - ZSTPR=-2.*SINTH*SINTH - ZSTPI=SIN(THETA) - ZR=(1.-ZSTPI)/2. - ZI=(1.+ZSTPR)/2. - IF (IFORM) 100,110,110 - 100 ZR=1.-ZR - ZI=-ZI - 110 I1MIN=IP0+1 - I1MAX=IP0*(N/4)+1 - DO 190 I1=I1MIN,I1MAX,IP0 - DO 180 I2=I1,IP2,IP1 - I2CNJ=IP0*(N/2+1)-2*I1+I2 - IF (I2-I2CNJ) 150,120,120 - 120 IF (ISIGN*(2*IFORM+1)) 130,140,140 - 130 DATA(I2+1)=-DATA(I2+1) - 140 IF (IFORM) 170,180,180 - 150 DIFR=DATA(I2)-DATA(I2CNJ) - DIFI=DATA(I2+1)+DATA(I2CNJ+1) - TEMPR=DIFR*ZR-DIFI*ZI - TEMPI=DIFR*ZI+DIFI*ZR - DATA(I2)=DATA(I2)-TEMPR - DATA(I2+1)=DATA(I2+1)-TEMPI - DATA(I2CNJ)=DATA(I2CNJ)+TEMPR - DATA(I2CNJ+1)=DATA(I2CNJ+1)-TEMPI - IF (IFORM) 160,180,180 - 160 DATA(I2CNJ)=DATA(I2CNJ)+DATA(I2CNJ) - DATA(I2CNJ+1)=DATA(I2CNJ+1)+DATA(I2CNJ+1) - 170 DATA(I2)=DATA(I2)+DATA(I2) - DATA(I2+1)=DATA(I2+1)+DATA(I2+1) - 180 CONTINUE - TEMPR=ZR-.5 - ZR=ZSTPR*TEMPR-ZSTPI*ZI+ZR - 190 ZI=ZSTPR*ZI+ZSTPI*TEMPR+ZI -C RECURSION SAVES TIME, AT A SLIGHT LOSS IN ACCURACY. IF AVAILABLE, -C USE DOUBLE PRECISION TO COMPUTE ZR AND ZI. - 200 IF (IFORM) 270,210,210 -C UNPACK THE REAL TRANSFORM VALUES (TWO PER COLUMN) - 210 I2=IP2+1 - I1=I2 - J1=IP0*(N/2+1)*NREM+1 - GO TO 250 - 220 DATA(J1)=DATA(I1) - DATA(J1+1)=DATA(I1+1) - I1=I1-IP0 - J1=J1-IP0 - 230 IF (I2-I1) 220,240,240 - 240 DATA(J1)=DATA(I1) - DATA(J1+1)=0. - 250 I2=I2-IP1 - J1=J1-IP0 - DATA(J1)=DATA(I2+1) - DATA(J1+1)=0. - I1=I1-IP0 - J1=J1-IP0 - IF (I2-1) 260,260,230 - 260 DATA(2)=0. - 270 RETURN - END + SUBROUTINE FOUR2a (DATA,N,NDIM,ISIGN,IFORM) + +C Cooley-Tukey fast Fourier transform in USASI basic Fortran. +C multi-dimensional transform, each dimension a power of two, +C complex or real data. + +C TRANSFORM(K1,K2,...) = SUM(DATA(J1,J2,...)*EXP(ISIGN*2*PI*SQRT(-1) +C *((J1-1)*(K1-1)/N(1)+(J2-1)*(K2-1)/N(2)+...))), summed for all +C J1 and K1 from 1 to N(1), J2 and K2 from 1 TO N(2), +C etc, for all NDIM subscripts. NDIM must be positive and +C each N(IDIM) must be a power of two. ISIGN is +1 or -1. +C Let NTOT = N(1)*N(2)*...*N(NDIM). Then a -1 transform +C followed by a +1 one (or vice versa) returns NTOT +C times the original data. + +C IFORM = 1, 0 or -1, as data is +C complex, real, or the first half of a complex array. Transform +C values are returned in array DATA. They are complex, real, or +C the first half of a complex array, as IFORM = 1, -1 or 0. + +C The transform of a real array (IFORM = 0) dimensioned N(1) by N(2) +C by ... will be returned in the same array, now considered to +C be complex of dimensions N(1)/2+1 by N(2) by .... Note that if +C IFORM = 0 or -1, N(1) must be even, and enough room must be +C reserved. The missing values may be obtained by complex conjuga- +C tion. + +C The reverse transformation of a half complex array dimensioned +C N(1)/2+1 by N(2) by ..., is accomplished by setting IFORM +C to -1. In the N array, N(1) must be the true N(1), not N(1)/2+1. +C The transform will be real and returned to the input array. + +C Running time is proportional to NTOT*LOG2(NTOT), rather than +C the naive NTOT**2. Furthermore, less error is built up. + +C Written by Norman Brenner of MIT Lincoln Laboratory, January 1969. +C See IEEE Audio Transactions (June 1967), Special issue on FFT. + + parameter(NMAX=2048*1024) + DIMENSION DATA(NMAX), N(1) + NTOT=1 + DO 10 IDIM=1,NDIM + 10 NTOT=NTOT*N(IDIM) + IF (IFORM) 70,20,20 + 20 NREM=NTOT + DO 60 IDIM=1,NDIM + NREM=NREM/N(IDIM) + NPREV=NTOT/(N(IDIM)*NREM) + NCURR=N(IDIM) + IF (IDIM-1+IFORM) 30,30,40 + 30 NCURR=NCURR/2 + 40 CALL BITRV (DATA,NPREV,NCURR,NREM) + CALL COOL2 (DATA,NPREV,NCURR,NREM,ISIGN) + IF (IDIM-1+IFORM) 50,50,60 + 50 CALL FIXRL (DATA,N(1),NREM,ISIGN,IFORM) + NTOT=(NTOT/N(1))*(N(1)/2+1) + 60 CONTINUE + RETURN + 70 NTOT=(NTOT/N(1))*(N(1)/2+1) + NREM=1 + DO 100 JDIM=1,NDIM + IDIM=NDIM+1-JDIM + NCURR=N(IDIM) + IF (IDIM-1) 80,80,90 + 80 NCURR=NCURR/2 + CALL FIXRL (DATA,N(1),NREM,ISIGN,IFORM) + NTOT=NTOT/(N(1)/2+1)*N(1) + 90 NPREV=NTOT/(N(IDIM)*NREM) + CALL BITRV (DATA,NPREV,NCURR,NREM) + CALL COOL2 (DATA,NPREV,NCURR,NREM,ISIGN) + 100 NREM=NREM*N(IDIM) + RETURN + END + SUBROUTINE BITRV (DATA,NPREV,N,NREM) +C SHUFFLE THE DATA BY BIT REVERSAL. +C DIMENSION DATA(NPREV,N,NREM) +C COMPLEX DATA +C EXCHANGE DATA(J1,J4REV,J5) WITH DATA(J1,J4,J5) FOR ALL J1 FROM 1 +C TO NPREV, ALL J4 FROM 1 TO N (WHICH MUST BE A POWER OF TWO), AND +C ALL J5 FROM 1 TO NREM. J4REV-1 IS THE BIT REVERSAL OF J4-1. E.G. +C SUPPOSE N = 32. THEN FOR J4-1 = 10011, J4REV-1 = 11001, ETC. + parameter(NMAX=2048*1024) + DIMENSION DATA(NMAX) + IP0=2 + IP1=IP0*NPREV + IP4=IP1*N + IP5=IP4*NREM + I4REV=1 +C I4REV = 1+(J4REV-1)*IP1 + DO 60 I4=1,IP4,IP1 +C I4 = 1+(J4-1)*IP1 + IF (I4-I4REV) 10,30,30 + 10 I1MAX=I4+IP1-IP0 + DO 20 I1=I4,I1MAX,IP0 +C I1 = 1+(J1-1)*IP0+(J4-1)*IP1 + DO 20 I5=I1,IP5,IP4 +C I5 = 1+(J1-1)*IP0+(J4-1)*IP1+(J5-1)*IP4 + I5REV=I4REV+I5-I4 +C I5REV = 1+(J1-1)*IP0+(J4REV-1)*IP1+(J5-1)*IP4 + TEMPR=DATA(I5) + TEMPI=DATA(I5+1) + DATA(I5)=DATA(I5REV) + DATA(I5+1)=DATA(I5REV+1) + DATA(I5REV)=TEMPR + 20 DATA(I5REV+1)=TEMPI +C ADD ONE WITH DOWNWARD CARRY TO THE HIGH ORDER BIT OF J4REV-1. + 30 IP2=IP4/2 + 40 IF (I4REV-IP2) 60,60,50 + 50 I4REV=I4REV-IP2 + IP2=IP2/2 + IF (IP2-IP1) 60,40,40 + 60 I4REV=I4REV+IP2 + RETURN + END + SUBROUTINE COOL2 (DATA,NPREV,N,NREM,ISIGN) +C DISCRETE FOURIER TRANSFORM OF LENGTH N. IN-PLACE COOLEY-TUKEY +C ALGORITHM, BIT-REVERSED TO NORMAL ORDER, SANDE-TUKEY PHASE SHIFTS. +C DIMENSION DATA(NPREV,N,NREM) +C COMPLEX DATA +C DATA(J1,K4,J5) = SUM(DATA(J1,J4,J5)*EXP(ISIGN*2*PI*I*(J4-1)* +C (K4-1)/N)), SUMMED OVER J4 = 1 TO N FOR ALL J1 FROM 1 TO NPREV, +C K4 FROM 1 TO N AND J5 FROM 1 TO NREM. N MUST BE A POWER OF TWO. +C METHOD--LET IPREV TAKE THE VALUES 1, 2 OR 4, 4 OR 8, ..., N/16, +C N/4, N. THE CHOICE BETWEEN 2 OR 4, ETC., DEPENDS ON WHETHER N IS +C A POWER OF FOUR. DEFINE IFACT = 2 OR 4, THE NEXT FACTOR THAT +C IPREV MUST TAKE, AND IREM = N/(IFACT*IPREV). THEN-- +C DIMENSION DATA(NPREV,IPREV,IFACT,IREM,NREM) +C COMPLEX DATA +C DATA(J1,J2,K3,J4,J5) = SUM(DATA(J1,J2,J3,J4,J5)*EXP(ISIGN*2*PI*I* +C (K3-1)*((J3-1)/IFACT+(J2-1)/(IFACT*IPREV)))), SUMMED OVER J3 = 1 +C TO IFACT FOR ALL J1 FROM 1 TO NPREV, J2 FROM 1 TO IPREV, K3 FROM +C 1 TO IFACT, J4 FROM 1 TO IREM AND J5 FROM 1 TO NREM. THIS IS +C A PHASE-SHIFTED DISCRETE FOURIER TRANSFORM OF LENGTH IFACT. +C FACTORING N BY FOURS SAVES ABOUT TWENTY FIVE PERCENT OVER FACTOR- +C ING BY TWOS. DATA MUST BE BIT-REVERSED INITIALLY. +C IT IS NOT NECESSARY TO REWRITE THIS SUBROUTINE INTO COMPLEX +C NOTATION SO LONG AS THE FORTRAN COMPILER USED STORES REAL AND +C IMAGINARY PARTS IN ADJACENT STORAGE LOCATIONS. IT MUST ALSO +C STORE ARRAYS WITH THE FIRST SUBSCRIPT INCREASING FASTEST. + parameter(NMAX=2048*1024) + DIMENSION DATA(NMAX) + + real*8 twopi,wstpr,wstpi,wr,wi,w2r,w2i,w3r,w3i,wtempr + + TWOPI=6.2831853072*FLOAT(ISIGN) + IP0=2 + IP1=IP0*NPREV + IP4=IP1*N + IP5=IP4*NREM + IP2=IP1 +C IP2=IP1*IPROD + NPART=N + 10 IF (NPART-2) 60,30,20 + 20 NPART=NPART/4 + GO TO 10 +C DO A FOURIER TRANSFORM OF LENGTH TWO + 30 IF (IP2-IP4) 40,160,160 + 40 IP3=IP2*2 +C IP3=IP2*IFACT + DO 50 I1=1,IP1,IP0 +C I1 = 1+(J1-1)*IP0 + DO 50 I5=I1,IP5,IP3 +C I5 = 1+(J1-1)*IP0+(J4-1)*IP3+(J5-1)*IP4 + I3A=I5 + I3B=I3A+IP2 +C I3 = 1+(J1-1)*IP0+(J2-1)*IP1+(J3-1)*IP2+(J4-1)*IP3+(J5-1)*IP4 + TEMPR=DATA(I3B) + TEMPI=DATA(I3B+1) + DATA(I3B)=DATA(I3A)-TEMPR + DATA(I3B+1)=DATA(I3A+1)-TEMPI + DATA(I3A)=DATA(I3A)+TEMPR + 50 DATA(I3A+1)=DATA(I3A+1)+TEMPI + IP2=IP3 +C DO A FOURIER TRANSFORM OF LENGTH FOUR (FROM BIT REVERSED ORDER) + 60 IF (IP2-IP4) 70,160,160 + 70 IP3=IP2*4 +C IP3=IP2*IFACT +C COMPUTE TWOPI THRU WR AND WI IN DOUBLE PRECISION, IF AVAILABLE. + THETA=TWOPI/FLOAT(IP3/IP1) + SINTH=SIN(THETA/2) + WSTPR=-2*SINTH*SINTH + WSTPI=SIN(THETA) + WR=1. + WI=0. + DO 150 I2=1,IP2,IP1 +C I2 = 1+(J2-1)*IP1 + IF (I2-1) 90,90,80 + 80 W2R=WR*WR-WI*WI + W2I=2*WR*WI + W3R=W2R*WR-W2I*WI + W3I=W2R*WI+W2I*WR + 90 I1MAX=I2+IP1-IP0 + DO 140 I1=I2,I1MAX,IP0 +C I1 = 1+(J1-1)*IP0+(J2-1)*IP1 + DO 140 I5=I1,IP5,IP3 +C I5 = 1+(J1-1)*IP0+(J2-1)*IP1+(J4-1)*IP3+(J5-1)*IP4 + I3A=I5 + I3B=I3A+IP2 + I3C=I3B+IP2 + I3D=I3C+IP2 +C I3 = 1+(J1-1)*IP0+(J2-1)*IP1+(J3-1)*IP2+(J4-1)*IP3+(J5-1)*IP4 + IF (I2-1) 110,110,100 +C APPLY THE PHASE SHIFT FACTORS + 100 TEMPR=DATA(I3B) + DATA(I3B)=W2R*DATA(I3B)-W2I*DATA(I3B+1) + DATA(I3B+1)=W2R*DATA(I3B+1)+W2I*TEMPR + TEMPR=DATA(I3C) + DATA(I3C)=WR*DATA(I3C)-WI*DATA(I3C+1) + DATA(I3C+1)=WR*DATA(I3C+1)+WI*TEMPR + TEMPR=DATA(I3D) + DATA(I3D)=W3R*DATA(I3D)-W3I*DATA(I3D+1) + DATA(I3D+1)=W3R*DATA(I3D+1)+W3I*TEMPR + 110 T0R=DATA(I3A)+DATA(I3B) + T0I=DATA(I3A+1)+DATA(I3B+1) + T1R=DATA(I3A)-DATA(I3B) + T1I=DATA(I3A+1)-DATA(I3B+1) + T2R=DATA(I3C)+DATA(I3D) + T2I=DATA(I3C+1)+DATA(I3D+1) + T3R=DATA(I3C)-DATA(I3D) + T3I=DATA(I3C+1)-DATA(I3D+1) + DATA(I3A)=T0R+T2R + DATA(I3A+1)=T0I+T2I + DATA(I3C)=T0R-T2R + DATA(I3C+1)=T0I-T2I + IF (ISIGN) 120,120,130 + 120 T3R=-T3R + T3I=-T3I + 130 DATA(I3B)=T1R-T3I + DATA(I3B+1)=T1I+T3R + DATA(I3D)=T1R+T3I + 140 DATA(I3D+1)=T1I-T3R + WTEMPR=WR + WR=WSTPR*WTEMPR-WSTPI*WI+WTEMPR + 150 WI=WSTPR*WI+WSTPI*WTEMPR+WI + IP2=IP3 + GO TO 60 + 160 RETURN + END + SUBROUTINE FIXRL (DATA,N,NREM,ISIGN,IFORM) +C FOR IFORM = 0, CONVERT THE TRANSFORM OF A DOUBLED-UP REAL ARRAY, +C CONSIDERED COMPLEX, INTO ITS TRUE TRANSFORM. SUPPLY ONLY THE +C FIRST HALF OF THE COMPLEX TRANSFORM, AS THE SECOND HALF HAS +C CONJUGATE SYMMETRY. FOR IFORM = -1, CONVERT THE FIRST HALF +C OF THE TRUE TRANSFORM INTO THE TRANSFORM OF A DOUBLED-UP REAL +C ARRAY. N MUST BE EVEN. +C USING COMPLEX NOTATION AND SUBSCRIPTS STARTING AT ZERO, THE +C TRANSFORMATION IS-- +C DIMENSION DATA(N,NREM) +C ZSTP = EXP(ISIGN*2*PI*I/N) +C DO 10 I2=0,NREM-1 +C DATA(0,I2) = CONJ(DATA(0,I2))*(1+I) +C DO 10 I1=1,N/4 +C Z = (1+(2*IFORM+1)*I*ZSTP**I1)/2 +C I1CNJ = N/2-I1 +C DIF = DATA(I1,I2)-CONJ(DATA(I1CNJ,I2)) +C TEMP = Z*DIF +C DATA(I1,I2) = (DATA(I1,I2)-TEMP)*(1-IFORM) +C 10 DATA(I1CNJ,I2) = (DATA(I1CNJ,I2)+CONJ(TEMP))*(1-IFORM) +C IF I1=I1CNJ, THE CALCULATION FOR THAT VALUE COLLAPSES INTO +C A SIMPLE CONJUGATION OF DATA(I1,I2). + parameter(NMAX=2048*1024) + DIMENSION DATA(NMAX) + TWOPI=6.283185307*FLOAT(ISIGN) + IP0=2 + IP1=IP0*(N/2) + IP2=IP1*NREM + IF (IFORM) 10,70,70 +C PACK THE REAL INPUT VALUES (TWO PER COLUMN) + 10 J1=IP1+1 + DATA(2)=DATA(J1) + IF (NREM-1) 70,70,20 + 20 J1=J1+IP0 + I2MIN=IP1+1 + DO 60 I2=I2MIN,IP2,IP1 + DATA(I2)=DATA(J1) + J1=J1+IP0 + IF (N-2) 50,50,30 + 30 I1MIN=I2+IP0 + I1MAX=I2+IP1-IP0 + DO 40 I1=I1MIN,I1MAX,IP0 + DATA(I1)=DATA(J1) + DATA(I1+1)=DATA(J1+1) + 40 J1=J1+IP0 + 50 DATA(I2+1)=DATA(J1) + 60 J1=J1+IP0 + 70 DO 80 I2=1,IP2,IP1 + TEMPR=DATA(I2) + DATA(I2)=DATA(I2)+DATA(I2+1) + 80 DATA(I2+1)=TEMPR-DATA(I2+1) + IF (N-2) 200,200,90 + 90 THETA=TWOPI/FLOAT(N) + SINTH=SIN(THETA/2.) + ZSTPR=-2.*SINTH*SINTH + ZSTPI=SIN(THETA) + ZR=(1.-ZSTPI)/2. + ZI=(1.+ZSTPR)/2. + IF (IFORM) 100,110,110 + 100 ZR=1.-ZR + ZI=-ZI + 110 I1MIN=IP0+1 + I1MAX=IP0*(N/4)+1 + DO 190 I1=I1MIN,I1MAX,IP0 + DO 180 I2=I1,IP2,IP1 + I2CNJ=IP0*(N/2+1)-2*I1+I2 + IF (I2-I2CNJ) 150,120,120 + 120 IF (ISIGN*(2*IFORM+1)) 130,140,140 + 130 DATA(I2+1)=-DATA(I2+1) + 140 IF (IFORM) 170,180,180 + 150 DIFR=DATA(I2)-DATA(I2CNJ) + DIFI=DATA(I2+1)+DATA(I2CNJ+1) + TEMPR=DIFR*ZR-DIFI*ZI + TEMPI=DIFR*ZI+DIFI*ZR + DATA(I2)=DATA(I2)-TEMPR + DATA(I2+1)=DATA(I2+1)-TEMPI + DATA(I2CNJ)=DATA(I2CNJ)+TEMPR + DATA(I2CNJ+1)=DATA(I2CNJ+1)-TEMPI + IF (IFORM) 160,180,180 + 160 DATA(I2CNJ)=DATA(I2CNJ)+DATA(I2CNJ) + DATA(I2CNJ+1)=DATA(I2CNJ+1)+DATA(I2CNJ+1) + 170 DATA(I2)=DATA(I2)+DATA(I2) + DATA(I2+1)=DATA(I2+1)+DATA(I2+1) + 180 CONTINUE + TEMPR=ZR-.5 + ZR=ZSTPR*TEMPR-ZSTPI*ZI+ZR + 190 ZI=ZSTPR*ZI+ZSTPI*TEMPR+ZI +C RECURSION SAVES TIME, AT A SLIGHT LOSS IN ACCURACY. IF AVAILABLE, +C USE DOUBLE PRECISION TO COMPUTE ZR AND ZI. + 200 IF (IFORM) 270,210,210 +C UNPACK THE REAL TRANSFORM VALUES (TWO PER COLUMN) + 210 I2=IP2+1 + I1=I2 + J1=IP0*(N/2+1)*NREM+1 + GO TO 250 + 220 DATA(J1)=DATA(I1) + DATA(J1+1)=DATA(I1+1) + I1=I1-IP0 + J1=J1-IP0 + 230 IF (I2-I1) 220,240,240 + 240 DATA(J1)=DATA(I1) + DATA(J1+1)=0. + 250 I2=I2-IP1 + J1=J1-IP0 + DATA(J1)=DATA(I2+1) + DATA(J1+1)=0. + I1=I1-IP0 + J1=J1-IP0 + IF (I2-1) 260,260,230 + 260 DATA(2)=0. + 270 RETURN + END diff --git a/jtaudio.c b/jtaudio.c index cc2a53a36..832c8392c 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -174,13 +174,16 @@ static int SoundOut( void *inputBuffer, void *outputBuffer, *wptr++ = n2; //right ic++; if(ic>=*data->nwave) { - ic = ic % *data->nwave; //Wrap buffer pointer if necessary - if(*data->nmode==2) + if(*data->nmode==2) { *data->TxOK=0; + ic--; + } + else + ic = ic % *data->nwave; //Wrap buffer pointer if necessary } } } else { - memset((void*)outputBuffer, 0, 2*sizeof(int16_t)*framesPerBuffer); + memset((void*)outputBuffer, 0, 2*sizeof(short)*framesPerBuffer); } fivehztx_(); //Call fortran routine return 0; diff --git a/ptt_unix.c b/ptt_unix.c index 4dd336a3c..13af97dce 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -88,7 +88,7 @@ ptt_(int *nport, int *ntx, int *iptt) /* open the device */ if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { - fprintf(stderr, "Can't open %s.", s); + fprintf(stderr, "Can't open %s.\n", s); return(1); } diff --git a/start_alsa.c b/start_alsa.c index 83fb734d0..824ef477b 100644 --- a/start_alsa.c +++ b/start_alsa.c @@ -329,6 +329,7 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { int nsec; int i,n; static int ic; + static short int n2; int16_t b0[2048]; // printf("playback callback\n"); @@ -353,12 +354,17 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { alsa_playback_buffers[0] = b0; alsa_playback_buffers[1] = b0; for(i=0; iperiod_size; i++) { - b0[i]=this->app_buffer_y1[ic]; + n2=this->app_buffer_y1[ic]; + addnoise_(&n2); + b0[i]=n2; ic++; - if(ic >= *this->nwave) { - ic=ic % *this->nwave; - if(*this->nmode == 2) + if(ic>=*this->nwave) { + if(*this->nmode==2) { *this->tx_ok=0; + ic--; + } + else + ic = ic % *this->nwave; //Wrap buffer pointer } } } else { @@ -368,7 +374,7 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { result = snd_pcm_writen(this->audio_fd, alsa_playback_buffers, this->period_size); this->tx_offset += this->period_size; if (result != this->period_size) { - printf("playback writei failed. Expected %d samples, sent only %d\n", this->period_size, result); + printf("Playback write failed. Expected %d samples, sent only %d\n", this->period_size, result); #ifdef ALSA_PLAYBACK_LOG snd_pcm_status_t *pcm_stat; snd_pcm_status_alloca(&pcm_stat); @@ -524,7 +530,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], // printf("start_threads: creating thread for decode1\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); /* Open audio card. */ - printf("Starting alsa routines.\n"); + printf("Using ALSA sound.\n"); ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); diff --git a/wsjt.py b/wsjt.py index be89d3f64..ba8168224 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#--------------------------------------------------------------- WSJT +#-------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw @@ -647,8 +647,11 @@ on 50 MHz; JT65, an extremely sensitive mode for troposcatter and EME; CW at 15 WPM with messages structured for EME; and an EME Echo mode for measuring your own echoes from the moon. -WSJT is Copyright (c) 2001-2005 by Joseph H. Taylor, Jr., K1JT, -and is licensed under the GNU General Public License (GPL). +WSJT is Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, +with contributions from additional authors. It is Open Source +software, licensed under the GNU General Public License (GPL). +Source code and programming information may be found at +http://developer.berlios.de/projects/wsjt/. """ Label(about,text=t,justify=LEFT).pack(padx=20) t="Revision date: " + \ From 59a8103b8deac90a7fdba2165fc035281d7a19f4 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 16 Jan 2006 17:55:05 +0000 Subject: [PATCH 079/811] Changed runqqq so that *nix execution of KVASD uses "./KVASD". Updated README_592.TXT in preparation for Windows release. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@115 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- README_592.TXT | 81 +++++++++++++++++++++++++++++--------------------- runqqq.f90 | 2 +- wsjt.py | 2 +- 3 files changed, 49 insertions(+), 36 deletions(-) diff --git a/README_592.TXT b/README_592.TXT index dd4204199..f942f2316 100755 --- a/README_592.TXT +++ b/README_592.TXT @@ -1,4 +1,4 @@ -Changes in WSJT 5.9.2: January 10, 2006 +Changes in WSJT 5.9.2: January 16, 2006 --------------------------------------- Enhancements @@ -6,32 +6,33 @@ Enhancements 1. Thread priorities have been adjusted for smoother operation. -2. The JT65 decoder now has improved immunity to garbage data - (birdies, QRM, etc.) and it exhibits better performance on - strong signals. +2. The JT65 decoder has been giver improved immunity to garbage data + (birdies, QRM, etc). It exhibits better performance on strong + signals and provides more accurate estimates of their S/N. -3. The FSK441 decoder produces less on-screen gibberish when you - request mouse-picked decodes. +3. The FSK441 decoder produces less on-screen gibberish when + processing mouse-picked decodes. 4. The JT6M decoder now makes better use of Freeze and Tol. You can set the value of "Freeze DF" by using the Right/Left arrow keys. (This feature is also useful in JT65 mode.) -5. On-screen font sizes can be set by using Windows Notepad (or - another text editor) to edit the file wsjtrc.win. If your screen - has resolution greater than 1024 x 768, or if you have old eyes - like mine, you may want to increase the font sizes from 8 and 9 - points (first three lines of the file) to, say, 9 and 10 points. +5. On-screen font sizes can be set by using Windows Notepad to edit + the file wsjtrc.win. If your screen has resolution greater than + 1024 x 768, or if you have old eyes like mine, you may want to + increase the font sizes from 8 and 9 points (first three lines of + the file) to, say, 9 and 10 points. -6. A simulator mode is now built into WSJT. It is presently most - useful in JT65 mode. By entering, say, "#-22" in the text box for - Tx6, you signify that the program should generate its Tx audio - files with the signal embedded in white gaussian noise, 22 dB - below the noise power in a 2.5 kHz bandwidth. You can direct this - signal into a second computer running WSJT, for example to test - the decoder or to practice operating in JT65 mode. You can even - have the two computers "work each other", although changing - messages of course requires operator action. +6. A simulator mode is now built into WSJT for testing purposes. It + is presently most useful in JT65 mode. By entering, say, "#-22" + in the text box for Tx6, you signify that the program should + generate its Tx audio files with the signal embedded in white + gaussian noise, 22 dB below the noise power in a 2.5 kHz + bandwidth. You can direct this signal into a second computer + running WSJT, for example to test the decoder or to practice + operating in JT65 mode. You can even have the two computers "work + each other" in a simulated QSO, although changing messages of + course requires operator action. 7. Dividing lines are now provided on the waterfall display between spectra corresponding to wave files read from disk. @@ -39,18 +40,24 @@ Enhancements 8. The PTT line is explicitly set low on program startup. 9. The F10 key brings up the SpecJT screen (if it was hidden) and - toggles foreground and focus between the WSJT and SpecJT screens. + toggles foreground and focus status between the WSJT and SpecJT + screens. -10. You can use the Alt-F keyboard shortcut to toggle "Freeze", and - Alt-Z to toggle "Zap". +10. You can use the Alt-F and Alt-Z keyboard shortcut to toggle + "Freeze" and "Zap" on and off. 11. "Accelerated decoding" has been removed from the Setup menu. In - effect, it is now always ON. + effect, this option is now always ON. +12. Text windows are now cleared when switching between modes. + +13. Linux and FreeBSD versions (see below) offer PTT control via + parallel port, as well as serial port. They offer sound support + via ALSA and OSS. Bug Fixes: ---------- -1. The use of non-threadsafe code for FFTs caused occasional and +1. The use of non-threadsafe code for FFTs could cause occasional and unpredictable program crashes. Fixed. 2. A bug in the JT65 decoder could (rarely) cause large errors in the @@ -60,23 +67,29 @@ Bug Fixes: wave file. Fixed. -Information for Programmers ---------------------------- +For Curious Users, and Especially for Programmers +------------------------------------------------- -WSJT is no longer a one-person effort and no longer runs only in -Microsoft Windows. It has become a full-fledged Open Source project, -with an active working group making contributions to future +WSJT is no longer a one-person effort, and the program no longer runs +only under Microsoft Windows. WSJT is now a full-fledged Open Source +project, with an active working group making contributions to future development. Source code is now stored in a public repository under -control of a version control system called Subversion, or SVN. You +control of a version control system called "Subversion", or SVN. You can learn more at http://developer.berlios.de/projects/wsjt/. The first significant result of the group effort has been to create versions of WSJT that run under the Linux and FreeBSD operating -systems. If you are interested in testing and using WSJT on your own -Linux or FreeBSD system, we'd like to hear from you. +systems. Porting WSJT to the Macintosh platform should be +straightforward, as well, although the development team does not +yet include anyone with Macintosh hardware. + +If you are interested in testing and using WSJT on your own Linux or +FreeBSD system, we'd like to hear from you. If you feel that you can usefully contribute to the future development -of WSJT on any platform, we would also like to hear from you! +of WSJT on any platform, we would also like to hear from you! We +could use help with documentation and website maintenance, as well as +actual programming. The present WSJT working group consists of: diff --git a/runqqq.f90 b/runqqq.f90 index 15f887bd2..e915fc47f 100644 --- a/runqqq.f90 +++ b/runqqq.f90 @@ -10,7 +10,7 @@ subroutine runqqq(fname,cmnd,iret) #ifdef Win32 iret=runqq(fname,cmnd) #else - iret=system('KVASD -q >& /dev/null') + iret=system('./KVASD -q >& /dev/null') #endif return diff --git a/wsjt.py b/wsjt.py index ba8168224..a964b7713 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#-------------------------------------------------------------- WSJT +#--------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From f81ad6aacfad259d02e648993ee8b904e18ad2a9 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 18 Jan 2006 17:02:34 +0000 Subject: [PATCH 080/811] 1. Trapped specjt error about "images do not match". 2. Fixed grid2deg to be case-insensitive for grid locator. 3. Bumped Revision number to 5.9.3. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@116 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- README_592.TXT | 3 +-- grid2deg.f | 18 +++++++++++++++--- specjt.py | 5 ++++- wsjt.py | 6 +++--- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/README_592.TXT b/README_592.TXT index f942f2316..00b1532cc 100755 --- a/README_592.TXT +++ b/README_592.TXT @@ -80,8 +80,7 @@ can learn more at http://developer.berlios.de/projects/wsjt/. The first significant result of the group effort has been to create versions of WSJT that run under the Linux and FreeBSD operating systems. Porting WSJT to the Macintosh platform should be -straightforward, as well, although the development team does not -yet include anyone with Macintosh hardware. +straightforward, as well, but has not yet been attempted. If you are interested in testing and using WSJT on your own Linux or FreeBSD system, we'd like to hear from you. diff --git a/grid2deg.f b/grid2deg.f index 9607692d7..4864af3c8 100644 --- a/grid2deg.f +++ b/grid2deg.f @@ -1,12 +1,24 @@ - subroutine grid2deg(grid,dlong,dlat) + subroutine grid2deg(grid0,dlong,dlat) C Converts Maidenhead grid locator to degrees of West longitude C and North latitude. - character*6 grid + character*6 grid0,grid character*1 g1,g2,g3,g4,g5,g6 - if(grid(5:5).eq.' ') grid(5:6)='mm' + grid=grid0 + i=ichar(grid(5:5)) + if(grid(5:5).eq.' ' .or. i.le.64 .or. i.ge.128) grid(5:6)='mm' + + if(grid(1:1).ge.'a' .and. grid(1:1).le.'z') grid(1:1)= + + char(ichar(grid(1:1))+ichar('A')-ichar('a')) + if(grid(2:2).ge.'a' .and. grid(2:2).le.'z') grid(2:2)= + + char(ichar(grid(2:2))+ichar('A')-ichar('a')) + if(grid(5:5).ge.'A' .and. grid(5:5).le.'Z') grid(5:5)= + + char(ichar(grid(5:5))-ichar('A')+ichar('a')) + if(grid(6:6).ge.'A' .and. grid(6:6).le.'Z') grid(6:6)= + + char(ichar(grid(6:6))-ichar('A')+ichar('a')) + g1=grid(1:1) g2=grid(2:2) g3=grid(3:3) diff --git a/specjt.py b/specjt.py index 4f2d04824..ed10e513b 100644 --- a/specjt.py +++ b/specjt.py @@ -228,7 +228,10 @@ def update(): n=Audio.gcom2.nlines box=(0,0,750,300-n) #Define region region=im.crop(box) #Get all but last line(s) - im.paste(region,(0,n)) #Move waterfall down + try: + im.paste(region,(0,n)) #Move waterfall down + except: + print "Images did not match, continuing anyway." for i in range(n): line0.putdata(a[750*i:750*(i+1)]) #One row of pixels to line0 im.paste(line0,(0,i)) #Paste in new top line diff --git a/wsjt.py b/wsjt.py index a964b7713..f1fc4534c 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#--------------------------------------------------------------- WSJT +#---------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw @@ -15,7 +15,7 @@ from types import * import array root = Tk() -Version="5.9.2 r" + "$Rev$"[6:-1] +Version="5.9.3 r" + "$Rev$"[6:-1] print "******************************************************************" print "WSJT Version " + Version + ", by K1JT" print "Revision date: " + \ @@ -1253,7 +1253,7 @@ def update(): g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \ g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \ g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \ - utchours,nfreq.get(),options.MyGrid.get(), \ + utchours,nfreq.get(),options.MyGrid.get().upper(), \ options.auxra.get()+' '[:9], \ options.auxdec.get()+' '[:9]) From c0fb435c6a312c74a75d58260044ea1e9b1f1283 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 25 Jan 2006 18:44:12 +0000 Subject: [PATCH 081/811] 1. New help screen lists available Add-on DXCC prefixes. 2. Initialization of PTT to OFF is fixed. 3. WSJT_Source_Code.tst updated. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@117 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.win | 2 +- WSJT_Source_Code.txt | 49 +++++++++++++++++++++++++++++--------------- ftn_init.f90 | 3 ++- pfxdump.f | 13 ++++++++++++ wsjt.py | 18 +++++++++++++++- 5 files changed, 66 insertions(+), 19 deletions(-) create mode 100644 pfxdump.f diff --git a/Makefile.win b/Makefile.win index dc503145c..0206ddac0 100644 --- a/Makefile.win +++ b/Makefile.win @@ -38,7 +38,7 @@ SRCS2F77 = wsjt1.f avesp2.f bzap.f spec441.f spec2d.f mtdecode.f \ sync65.f unpackcall.f unpackgrid.f unpackmsg.f unpacktext.f \ xcor.f xfft.f wsjt65.f astro.f azdist.f coord.f dcoord.f \ deg2grid.f dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f \ - moon2.f MoonDop.f sun.f toxyz.f + moon2.f MoonDop.f sun.f toxyz.f pfxdump.f SRCS2C = resample.c ptt.c igray.c wrapkarn.c diff --git a/WSJT_Source_Code.txt b/WSJT_Source_Code.txt index 094563c92..dd6db58b0 100755 --- a/WSJT_Source_Code.txt +++ b/WSJT_Source_Code.txt @@ -1,5 +1,8 @@ -1 Introduction + WSJT DEVELOPMENT OVERVIEW + ------------------------- +1 Introduction +---------------------------------------------------------------------- WSJT is a computer program designed to facilitate Amateur Radio communication under extreme weak-signal conditions. Three very different coding and modulation methods are provided: one for @@ -9,7 +12,7 @@ for the very challenging EME (Earth-Moon-Earth) path. 2 Program Overview - +---------------------------------------------------------------------- WSJT's user interface is written in Python. The major Python source-code files include: @@ -50,7 +53,7 @@ weak-signal communication. 3 Some Functional Details - +---------------------------------------------------------------------- WSJT execution starts at the top of Python file wsjt.py. The other Python modules are loaded and executed as needed. Fortran routines are called to start a high-priority thread to handle @@ -63,7 +66,7 @@ alternating transmission and reception intervals. 4 Other Open-Source Software used in WSJT - +---------------------------------------------------------------------- WSJT 5.9 uses the following open source libraries: 1. FFTW, by Matteo Frigo and Steven Johnson, for computing Fourier @@ -79,18 +82,18 @@ WSJT 5.9 uses the following open source libraries: 5 Platform-Dependent Notes - +---------------------------------------------------------------------- The Python code should run on any supported Python platform. Most of -the remaining code can be recompiled for Linux or OS/X, instead of -Windows. Platform-dependent versions of FFTW, PortAudio, and -libsamplerate need to be installed. +the remaining code can be compiled for Linux, FreeBSD, unix, or OS/X, +as well as Windows. Platform-dependent versions of FFTW, PortAudio, +and libsamplerate may need to be installed. Methods are provided for creating additional threads and setting their -runtime priorities in both Windows and Linux. +runtime priorities in Windows, Linux, and FreeBSD. 6 Partial List of Functions and Subroutines, and their purposes - +---------------------------------------------------------------------- Routines for audio startup, decoding, display computations blanker.f90 Noise blanker fivehz.f90 Called by PortAudio callback @@ -161,7 +164,7 @@ runtime priorities in both Windows and Linux. FFTs: fftw3.f Fortran definitions for FFTW four2a.f Wrapper to make FFTW look like four2 - four2.f FFT in Fortran + four2.f FFT in Fortran (a;ternative to using FFTW) ps.f Compute power spectrum xfft.f Real to complex FFT wrapper @@ -230,7 +233,7 @@ runtime priorities in both Windows and Linux. 7 Compiling Instructions - +---------------------------------------------------------------------- Scripts are provided for compiling WSJT in both Windows and Linux. They are presently set up to use Compaq Visual Fortran (v6.6) and Microsoft C (v6.0) in Windows, and g95 and gcc in Linux. My @@ -256,11 +259,25 @@ These steps produce a distributable file WSJT6.EXE (Windows) or wsjt6 end user does not need to install Python or any of its other extensions, or the compilers. +A configuration script and Makefile facility is also provided. +Assuming that all of the pre-requisites are properly installed, WSJT +can now be compiled in Windows as follows: -8 Present status (December 28, 2005) + C> copy Makefile.win Makefile + C> nmake -WSJT version 5-9-2 r25 is fully functional in Windows. The Linux version -can be used to decode recorded files, but real-time audio I/O has not -yet been implemented. +In Linux or FreeBSD, do the following: + + $ ./configure --enable-portaudio (or --enable-alsa) + $ make + + +8 Present status (January 17, 2006) +---------------------------------------------------------------------- + +WSJT version 5.9.2 (built from SVN revision 115) has been released for +Windows. It is is fully functional in Linux and BSD, as well, but +presently need to be compiled locally. In due course we plan to +provide distributions for standard *nix distributions. diff --git a/ftn_init.f90 b/ftn_init.f90 index c2107bbf2..b98252410 100644 --- a/ftn_init.f90 +++ b/ftn_init.f90 @@ -18,7 +18,7 @@ !------------------------------------------------ ftn_init subroutine ftn_init - character*1 cjunk + character*1 cjunk,fname*80 include 'gcom1.f90' include 'gcom2.f90' include 'gcom3.f90' @@ -32,6 +32,7 @@ subroutine ftn_init enddo 1 iz=i lenappdir=iz + call pfxdump(appdir(:iz)//'/prefixes.txt') #ifdef Win32 open(11,file=appdir(:iz)//'/decoded.txt',status='unknown', & diff --git a/pfxdump.f b/pfxdump.f new file mode 100644 index 000000000..dc7dbf00f --- /dev/null +++ b/pfxdump.f @@ -0,0 +1,13 @@ + subroutine pfxdump(fname) + character*(*) fname + include 'pfx.f' + + open(11,file=fname,status='unknown') + write(11,1001) pfx + 1001 format('Supported Add-on Prefixes:'/90('_')/(15(a5,1x))) + write(11,1002) sfx + 1002 format(/'Supported Suffixes:'/44('_')/(11('/',a1,2x))) + close(11) + + return + end diff --git a/wsjt.py b/wsjt.py index f1fc4534c..c49949489 100644 --- a/wsjt.py +++ b/wsjt.py @@ -766,6 +766,19 @@ reports may be substituted.) Label(screenf5,text=t,justify=LEFT).pack(padx=20) screenf5.focus_set() +#------------------------------------------------------ prefixes +def prefixes(event=NONE): + pfx=Toplevel(root) + pfx.geometry(msgpos()) + if g.Win32: pfx.iconbitmap("wsjt.ico") + f=open(appdir+'/prefixes.txt','r') + s=f.readlines() + t="" + for i in range(len(s)): + t=t+s[i] + Label(pfx,text=t,justify=LEFT).pack(padx=20) + pfx.focus_set() + #------------------------------------------------------ azdist def azdist(): if len(HisGrid.get().strip())<4: @@ -1607,6 +1620,7 @@ helpbutton['menu'] = helpmenu helpmenu.add('command', label = 'Keyboard shortcuts', command = shortcuts) helpmenu.add('command', label = 'Special mouse commands', command = mouse_commands) helpmenu.add('command', label = 'What message to send?', command = what2send) +helpmenu.add('command', label = 'Add-on prefix list', command = prefixes) helpmenu.add('command', label = 'About WSJT', command = about) #------------------------------------------------------ Graphics areas @@ -1978,7 +1992,9 @@ try: # elif key == 'RxDelay': options.RxDelay.set(value) # elif key == 'TxDelay': options.TxDelay.set(value) elif key == 'IDinterval': options.IDinterval.set(value) - elif key == 'ComPort': options.ComPort.set(value) + elif key == 'ComPort': + options.ComPort.set(value) + Audio.gcom2.nport=int(options.ComPort.get()) elif key == 'Mileskm': options.mileskm.set(value) elif key == 'MsgStyle': options.ireport.set(value) elif key == 'Region': options.iregion.set(value) From cdf1d6c05a5f5a654d0fcf3704376b97f62e02af Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 25 Jan 2006 18:51:57 +0000 Subject: [PATCH 082/811] Updated Makefile.in. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@118 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 4 +++- wsjt.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index c9d69b5c7..c270661f3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -51,7 +51,9 @@ SRCS2F90 = abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ wsjtgen.f90 runqqq.f90 fivehz.f90 OBJS2F90 = ${SRCS2F90:.f90=.o} -SRCS2F77 = wsjt1.f astro.f astropak.f \ +SRCS2F77 = wsjt1.f astro.f azdist.f coord.f dcoord.f deg2grid.f \ + dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f moon2.f \ + MoonDop.f sun.f toxyz.f pfxdump.f \ avesp2.f bzap.f spec441.f spec2d.f mtdecode.f stdecode.f \ indexx.f s2shape.f flat2.f gen65.f chkmsg.f gen6m.f gentone.f \ syncf0.f syncf1.f synct.f decode6m.f avemsg6m.f \ diff --git a/wsjt.py b/wsjt.py index c49949489..defeeea33 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#---------------------------------------------------------------- WSJT +#--------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 88d42d608cbcd171baf057bcedfdd156fb9a23d8 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 25 Jan 2006 21:09:04 +0000 Subject: [PATCH 083/811] 1. Replaced README.TXT and README_592.TXT with UpdateHistory.txt. 2. Improved the listing of add-on DXCC prefixes. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@119 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- README.TXT | 150 --- README_592.TXT | 103 -- UpdateHistory.txt | 2460 +++++++++++++++++++++++++++++++++++++++++++++ pfxdump.f | 8 +- wsjt.py | 26 +- 5 files changed, 2486 insertions(+), 261 deletions(-) delete mode 100644 README.TXT delete mode 100755 README_592.TXT create mode 100644 UpdateHistory.txt diff --git a/README.TXT b/README.TXT deleted file mode 100644 index e84222669..000000000 --- a/README.TXT +++ /dev/null @@ -1,150 +0,0 @@ -Changes in WSJT 5.9.0 -- November 15, 2005 ------------------------------------------- - -1. JT65 decoding has been made faster and significantly improved in - other ways. Three new options appear on the Decode->JT65 menu: - "Fast", "Normal", and "Exhaustive". The program is most sensitive - if you choose "Exhaustive". Choosing "Normal" will make decoding - slightly less sensitive, but the loss is not great, and decoding - can be twice as fast. The "Fast" setting is faster still, but can - be less sensitive by 2 dB or more in some cases. If you have a 1.5 - GHz or faster computer, use "Exhaustive". With a slower computer - you may want to experiment with the other settings. - -2. In JT65 mode, double-clicking on the waterfall (SpecJT window) or - on the red curve (main window) will set "Freeze DF" at the selected - frequency, turn Freeze ON, and invoke the decoder. Using this - feature, you can quickly decode a transmission at several different - values of DF. I find this feature to be *extremely* useful. - -3. The range of DT values searched to establish synchronization has - been doubled, now extending from -2 to +10 seconds. The reported - values of DT are more accurate, as well. You should normally - expect EME signals to have DT in the range 2 to 3 seconds, but the - program will now synchronize properly even if DT is well outside - this range. - -4. WSJT now offers the ability to correct for errors in soundcard - input and output sampling rates. Numbers displayed in the first - panel of the status bar (at lower left of the main screen) give the - ratio of actual sample rates for input and output to the correct - value, 11025 Hz. The numbers should stabilize about one minute - after program startup. If they fall in a "safe" range between - about 0.9990 and 1.0010, you have a good sound card (at least in - respect to sampling frequency). You can then leave the entry - fields "Rate In" and "Rate Out" on the "Setup -> Options" page at - their default values, 1.0. - - If your soundcard gives one or both numbers well outside the safe - range, you should enter the displayed errant numbers as "Rate In" - and/or "Rate Out" on the Setup->Options page. This needs to be - done only once; subsequent changes in the last decimal place of the - displayed values are not very significant, and can be safely - ignored. - - The result of this procedure is that your Tx signal will be - "trimmed" so that your tone spacings in time and frequency are - correct. In addition, your digitized Rx signals will be adjusted - so that the software can properly interpret them. - - This is an important procedure. Some recent sound cards produce - sampling error factors as low as 0.9932 or as high as 1.0068. If - uncorrected, such results can degrade your S/N in WSJT modes by 2 - dB or more. - - If one of the measured sample rates differs from the corresponding - value specified for "Rate In" or "Rate Out" by more than 0.1%, a - red warning label will appear just below the graphical area on the - main screen. - -5. Graphical display of information obtained during JT65 decoding has - been enhanced. As before, a red line illustrates the maximum - correlation between the pseudo-random sync tone pattern and the - received signal at each value of frequency offset, DF. A blue line - shows the correlation at the best DF, plotted as a function of time - offset, DT. If a shorthand message is detected, two new lines - colored magenta and orange replace the red and blue lines. The new - lines illustrate phase-resolved spectra measured in each of the two - phases of the shorthand square-wave pattern. A properly detected - shorthand message will show a peak in the magenta curve, followed - at a specified distance by a peak in the orange curve. The correct - locations of the two peaks are marked by small yellow ticks. - Unlike the alternating shorthand message tones, birdies will appear - approximately equally in the magenta and orange curves. - -6. For the convenience of temporary DXpeditions, a new JT65 feature - permits use of add-on DXCC prefixes that are not in the published - list of supported prefixes. Both stations in a QSO must enter the - required prefix (for example, PJ8 or FS) in a box on the - Setup->Options page. The effect will be to temporarily add the - entry to the table of supported prefixes. - -7. The Setup->Options page has new entry fields labeled "Source RA" - and "Source DEC". You can enter the current right ascension and - declination of a radio source to be used for system calibration, or - perhaps a pulsar or a deep space probe that you wish to detect. - The program will display (on the Astronomical Data screen) the - current Azimuth and Elevation of the specified object at your - station. The source Azimuth and Elevation are also written every - second to the file azel.dat, in case you have automated tracking - capabilities that depend on this information. - -8. To facilitate the coming release of the full source code of WSJT - under the General Public License, the proprietary soft-decision - Reed Solomon decoder has been removed from WSJT proper and made - into a separate executable module. This change is invisible to the - user, and the full benefit of the soft-decision decoder is still - available. An open source hard-decision decoder is also provided; - it's what you get when you select the "Fast" JT65 decoding option. - -9. In WSJT 5.8.6, if the value of "Freeze DF" (as displayed in the - Status Bar) differs from the sync tone frequency by more than - "Tol", shorthand decoding was suppressed even if Freeze was not - checked. This is a bug, and it has been fixed. - -10. Earlier versions of WSJT also had a bug that could cause the "Zap" - function to notch out a valid sync tone. Fixed. - -11. The Help screens called up by F1 and Shift-F1 have been updated. - Be sure to read these screens: they contain many operational - conveniences that you may not have discovered! - -12. At scrolling speed 5, the time labels and "minute separator" lines - were displayed erratically and the CPU load was excessive. Fixed. - -13. Signal strength measurements above -20 dB were formerly compressed - and significantly underestimated. This has been fixed. - -14. Decodings of the average of many properly synchronized transmissions - would sometimes go from "good" to "bad" after approximately 8-12 - transmissions. This was a bug, and it has been fixed. - -15. Several bugs in the FSK441 decoder have been fixed. Both automatic - decoding and mouse-picked decoding have been improved. - -16. Changing WSJT modes now sets Auto to OFF, Tol to 400, and the Tx - message number to 1. - -17. The generated audio tones for CW ID in FSK441 and JT6M modes have - been moved down to 440 Hz, to avoid possible confusion with the - other tones used in these modes. - -18. Readout of "Rx noise" on the main screen is now highlighted in red - if the level is outside the range -10 to +10 dB. - -19. The Monitor button is no longer highlighted in green while you are - transmitting. - -20. No attempt is made to decode if the Rx level is very low -- for - example, if your receiver is turned off. - -21. If the Grid box does not contain a valid locator, readouts of - azimuth and distance are suppressed. - -22. Keying of the audio tone to produce Morse code has been "softened" - to suppress key clicks. - -23. Your transmitted messages recorded in the file ALL.TXT are now - identified as to mode, and shorthand transmissions are noted. - -23. A number of other very minor bugs have been fixed. diff --git a/README_592.TXT b/README_592.TXT deleted file mode 100755 index 00b1532cc..000000000 --- a/README_592.TXT +++ /dev/null @@ -1,103 +0,0 @@ -Changes in WSJT 5.9.2: January 16, 2006 ---------------------------------------- - -Enhancements ------------- - -1. Thread priorities have been adjusted for smoother operation. - -2. The JT65 decoder has been giver improved immunity to garbage data - (birdies, QRM, etc). It exhibits better performance on strong - signals and provides more accurate estimates of their S/N. - -3. The FSK441 decoder produces less on-screen gibberish when - processing mouse-picked decodes. - -4. The JT6M decoder now makes better use of Freeze and Tol. You can - set the value of "Freeze DF" by using the Right/Left arrow keys. - (This feature is also useful in JT65 mode.) - -5. On-screen font sizes can be set by using Windows Notepad to edit - the file wsjtrc.win. If your screen has resolution greater than - 1024 x 768, or if you have old eyes like mine, you may want to - increase the font sizes from 8 and 9 points (first three lines of - the file) to, say, 9 and 10 points. - -6. A simulator mode is now built into WSJT for testing purposes. It - is presently most useful in JT65 mode. By entering, say, "#-22" - in the text box for Tx6, you signify that the program should - generate its Tx audio files with the signal embedded in white - gaussian noise, 22 dB below the noise power in a 2.5 kHz - bandwidth. You can direct this signal into a second computer - running WSJT, for example to test the decoder or to practice - operating in JT65 mode. You can even have the two computers "work - each other" in a simulated QSO, although changing messages of - course requires operator action. - -7. Dividing lines are now provided on the waterfall display between - spectra corresponding to wave files read from disk. - -8. The PTT line is explicitly set low on program startup. - -9. The F10 key brings up the SpecJT screen (if it was hidden) and - toggles foreground and focus status between the WSJT and SpecJT - screens. - -10. You can use the Alt-F and Alt-Z keyboard shortcut to toggle - "Freeze" and "Zap" on and off. - -11. "Accelerated decoding" has been removed from the Setup menu. In - effect, this option is now always ON. - -12. Text windows are now cleared when switching between modes. - -13. Linux and FreeBSD versions (see below) offer PTT control via - parallel port, as well as serial port. They offer sound support - via ALSA and OSS. - -Bug Fixes: ----------- -1. The use of non-threadsafe code for FFTs could cause occasional and - unpredictable program crashes. Fixed. - -2. A bug in the JT65 decoder could (rarely) cause large errors in the - reported level of strong signals. Fixed. - -3. The program could be made to crash by trying to read a very short - wave file. Fixed. - - -For Curious Users, and Especially for Programmers -------------------------------------------------- - -WSJT is no longer a one-person effort, and the program no longer runs -only under Microsoft Windows. WSJT is now a full-fledged Open Source -project, with an active working group making contributions to future -development. Source code is now stored in a public repository under -control of a version control system called "Subversion", or SVN. You -can learn more at http://developer.berlios.de/projects/wsjt/. - -The first significant result of the group effort has been to create -versions of WSJT that run under the Linux and FreeBSD operating -systems. Porting WSJT to the Macintosh platform should be -straightforward, as well, but has not yet been attempted. - -If you are interested in testing and using WSJT on your own Linux or -FreeBSD system, we'd like to hear from you. - -If you feel that you can usefully contribute to the future development -of WSJT on any platform, we would also like to hear from you! We -could use help with documentation and website maintenance, as well as -actual programming. - -The present WSJT working group consists of: - - Diane Bruce, VA3DB - James Courtier-Dutton - Bob McGwier, N4HY - Jonathan Naylor, ON/G4KLX - Stewart Nelson, KK7KA - Joe Taylor, K1JT - Kaj Wiik, OH6EH - - diff --git a/UpdateHistory.txt b/UpdateHistory.txt new file mode 100644 index 000000000..1e128fda8 --- /dev/null +++ b/UpdateHistory.txt @@ -0,0 +1,2460 @@ +Changes in WSJT 5.9.3: January 26, 2006 +--------------------------------------- +This is a minor maintenance release. + +1. New Help screen provides a list of available suffixes and add-on + DXCC prefixes. + +2. The occasional error message about "images do not match" has been + trapped and should no longer occur. + +3. Code that required one's own grid locator to be entered with first + two letters in upper case, last two in lower case, has been made + case insensitive (as it should have been). + +4. Initialization of the PTT line to the "OFF" state has been fixed. + + +Changes in WSJT 5.9.2: January 16, 2006 +--------------------------------------- + +Enhancements +------------ + +1. Thread priorities have been adjusted for smoother operation. + +2. The JT65 decoder has been given improved immunity to garbage data + (birdies, QRM, etc). It exhibits better performance on strong + signals and provides more accurate estimates of their S/N. + +3. The FSK441 decoder produces less on-screen gibberish when + processing mouse-picked decodes. + +4. The JT6M decoder now makes better use of Freeze and Tol. You can + set the value of "Freeze DF" by using the Right/Left arrow keys. + (This feature is also useful in JT65 mode.) + +5. On-screen font sizes can be set by using Windows Notepad to edit + the file wsjtrc.win. If your screen has resolution greater than + 1024 x 768, or if you have old eyes like mine, you may want to + increase the font sizes from 8 and 9 points (first three lines of + the file) to, say, 9 and 10 points. + +6. A simulator mode is now built into WSJT for testing purposes. It + is presently most useful in JT65 mode. By entering, say, "#-22" + in the text box for Tx6, you signify that the program should + generate its Tx audio files with the signal embedded in white + gaussian noise, 22 dB below the noise power in a 2.5 kHz + bandwidth. You can direct this signal into a second computer + running WSJT, for example to test the decoder or to practice + operating in JT65 mode. You can even have the two computers "work + each other" in a simulated QSO, although changing messages of + course requires operator action. + +7. Dividing lines are now provided on the waterfall display between + spectra corresponding to wave files read from disk. + +8. The PTT line is explicitly set low on program startup. + +9. The F10 key brings up the SpecJT screen (if it was hidden) and + toggles foreground and focus status between the WSJT and SpecJT + screens. + +10. You can use the Alt-F and Alt-Z keyboard shortcuts to toggle + "Freeze" and "Zap" on and off. + +11. "Accelerated decoding" has been removed from the Setup menu. In + effect, this option is now always ON. + +12. Text windows are now cleared when switching between modes. + +13. Linux and FreeBSD versions (see below) offer PTT control via + parallel port, as well as serial port. They offer sound support + via ALSA and OSS. + + +Bug Fixes: +---------- +1. The use of non-threadsafe code for FFTs could cause occasional and + unpredictable program crashes. Fixed. + +2. A bug in the JT65 decoder could (rarely) cause large errors in the + reported level of strong signals. Fixed. + +3. The program could be made to crash by trying to read a very short + wave file. Fixed. + +4. "Save None" now works as it should. + + +Please note: +------------ +When entering your grid locator on the Setup->Options page, use upper +case for the first two letters and lower case for the last two. For +example, for K1JT the locator is FN20qi. + + +For Curious Users, and Especially for Programmers +------------------------------------------------- + +WSJT is no longer a one-person effort, and the program no longer runs +only under Microsoft Windows. WSJT is now a full-fledged Open Source +project, with an active working group making contributions to future +development. Source code is now stored in a public repository under +control of a version control system called "Subversion," or SVN. You +can learn more at http://developer.berlios.de/projects/wsjt/. + +The first significant result of the group effort has been to create +versions of WSJT that run under the Linux and FreeBSD operating +systems. Porting WSJT to the Macintosh platform should be +straightforward, but has not yet been done. + +If you are interested in testing and using WSJT on your own Linux or +FreeBSD system, we'd like to hear from you. Please note that the +present Linux and FreeBSD versions are intended mainly for +programmers. You need to know your way around these operating +systems to be able to install them. + +If you feel that you can usefully contribute to the future development +of WSJT on any platform, we would also like to hear from you! We +could use help with documentation and website maintenance, as well as +actual programming. + +The present WSJT working group consists of: + + Diane Bruce, VA3DB + James Courtier-Dutton + Bob McGwier, N4HY + Jonathan Naylor, ON/G4KLX + Stewart Nelson, KK7KA + Joe Taylor, K1JT + Kaj Wiik, OH6EH + + +Changes in WSJT 5.9.0: November 16, 2005 +------------------------------------------ + +1. JT65 decoding has been made faster and significantly improved in + other ways. Three new options appear on the Decode->JT65 menu: + "Fast", "Normal", and "Exhaustive". The program is most sensitive + if you choose "Exhaustive". Choosing "Normal" will make decoding + slightly less sensitive, but the loss is not great, and decoding + can be twice as fast. The "Fast" setting is faster still, but can + be less sensitive by 2 dB or more in some cases. If you have a 1.5 + GHz or faster computer, use "Exhaustive". With a slower computer + you may want to experiment with the other settings. + +2. In JT65 mode, double-clicking on the waterfall (SpecJT window) or + on the red curve (main window) sets "Freeze DF" to the selected + frequency, turns Freeze ON, sets Tol to 50 Hz, and invokes the + decoder. Using this feature, you can quickly decode a transmission + at several different values of DF. I find this feature to be + *extremely* useful. + +3. The range of DT values searched to establish synchronization has + been doubled, now extending from -2 to +10 seconds. The reported + values of DT are more accurate, as well. You should normally + expect EME signals to have DT in the range 2 to 3 seconds, but the + program will now synchronize properly even if DT is well outside + this range. + +4. WSJT now offers the ability to correct for errors in soundcard + input and output sampling rates. Numbers displayed in the first + panel of the status bar (at lower left of the main screen) give the + ratio of actual sample rates for input and output to the correct + value, 11025 Hz. The numbers should stabilize within about one + minute after program startup. If they fall in a "safe" range + between about 0.9990 and 1.0010, you have a good sound card (at + least in respect to sampling frequency). You can then leave the + entry fields "Rate In" and "Rate Out" on the "Setup -> Options" + page at their default values, 1.0. + + If your soundcard gives one or both numbers well outside the safe + range, you should enter the displayed errant numbers as "Rate In" + and/or "Rate Out" on the Setup->Options page. This needs to be + done only once; subsequent changes in the last decimal place of the + displayed values are not very significant, and can be safely + ignored. + + The result of this procedure is that your Tx signal will be + "trimmed" so that your tone spacings in time and frequency are more + nearly correct. In addition, your digitized Rx signals will be + adjusted so that the software can properly interpret them. + + This trimming is an important procedure. Some recent sound cards + produce sampling error factors as low as 0.9932 or as high as + 1.0068. If uncorrected, such results can degrade your S/N in WSJT + modes by 2 dB or more. + + If one of the measured sample rates differs from the corresponding + value specified for "Rate In" or "Rate Out" by more than 0.1%, a + red warning label will appear just below the graphical area on the + main screen. + +5. The graphical display of information obtained during JT65 decoding + has been enhanced. As before, a red line illustrates the maximum + correlation between the pseudo-random sync tone pattern and the + received signal at each value of frequency offset, DF. A blue line + shows the correlation at the best DF, plotted as a function of time + offset, DT. If a shorthand message is detected, two new lines + colored magenta and orange replace the red and blue lines. The new + lines illustrate phase-resolved spectra measured in each of the two + phases of the shorthand square-wave pattern. A properly detected + shorthand message will show a peak in the magenta curve, followed + at a specified distance by a peak in the orange curve. The correct + locations of the two peaks are marked by small yellow ticks. + Unlike the alternating shorthand message tones, birdies will appear + with approximately equal amplitudes in the magenta and orange + curves. + +6. For the convenience of temporary DXpeditions, a new JT65 feature + permits use of add-on DXCC prefixes that are not in the published + list of supported prefixes. Both stations in a QSO must enter the + required prefix (for example, PJ8 or FS) in a box on the + Setup->Options page. The effect will be to temporarily add the + entry to the table of supported prefixes. + +7. The Setup->Options page has new entry fields labeled "Source RA" + and "Source DEC". You can enter the current right ascension and + declination of a radio source to be used for system calibration, or + perhaps a pulsar or a deep space probe that you wish to detect. + The program will display (on the Astronomical Data screen) the + current Azimuth and Elevation of the specified object at your + station. The source Azimuth and Elevation are also written every + second to the file azel.dat, in case you have automated tracking + capabilities that depend on this information. + +8. For contest-style operations, the Setup->Options menu has an item + labeled "F4 sets Tx6". If this item is checked, when you hit F4 to + clear the To Radio box the program will turn Freeze OFF and set + the Tx message number to 6. + +9. To facilitate the coming release of the full source code of WSJT + under the GNU General Public License, the proprietary soft-decision + Reed Solomon decoder has been removed from WSJT proper and made + into a separate executable module, KVASD.EXE. This change is + transparent to the user, and the full benefit of the soft-decision + decoder is still available. An open source hard-decision decoder + is also provided; it's what you get when you select the "Fast" JT65 + decoding option. + +10. In WSJT 5.8.6, if the value of "Freeze DF" (as displayed in the + Status Bar) differs from the sync tone frequency by more than + "Tol", shorthand decoding was suppressed even if Freeze was not + checked. This is a bug, and it has been fixed. + +11. Earlier versions of WSJT had a bug that could cause the "Zap" + function to notch out a valid sync tone. Fixed. + +12. The Help screens called up by F1 and Shift-F1 have been updated. + Be sure to read these screens: they contain many operational + conveniences that you may not have discovered! + +13. At scrolling speed 5, the time labels and "minute separator" lines + were displayed erratically and the CPU load was excessive. Fixed. + +14. Signal strength measurements above -20 dB were formerly compressed + and significantly underestimated. This has been fixed. + +15. Decodings of the average of many properly synchronized transmissions + would sometimes go from "good" to "bad" after approximately 8-12 + transmissions. This was a bug, and it has been fixed. + +16. Several bugs in the FSK441 decoder have been fixed. Both + automatic decoding and mouse-picked decoding have been improved. + +17. Changing WSJT modes now sets Auto to OFF, Tol to 400, and the Tx + message number to 1. + +18. The generated audio for CW ID in FSK441 and JT6M modes has been + moved to 440 Hz, to avoid possible confusion with the other tones + used in these modes. + +19. Readout of "Rx noise" on the main screen is now highlighted in red + if the level is outside the range -10 to +10 dB. + +20. The Monitor button is no longer highlighted in green while you are + transmitting. + +21. No attempt is made to decode if the Rx level is very low -- for + example, if your receiver is turned off. + +22. If the Grid box does not contain a valid locator, readouts of + azimuth and distance are suppressed. + +23. Keying of the audio tone to produce Morse code has been softened + to suppress key clicks. + +24. Transmitted messages recorded in the file ALL.TXT are now + identified as to mode, and shorthand transmissions are noted as + such. + +25. A number of other very minor bugs have been fixed. + + +Changes in WSJT 5.8.6 +--------------------- + +1. Audio input and output has been modified in a way that accommodates + certain soundcards (e.g., SB Live!) that did not work correctly + with WSJT 5.8.3. + +2. New item on Setup->Options menu to select whether GenStdMsgs forces + Tx message number to 1. + +3. Status of all selectable items on Setup->Options menu is preserved + on program restart. + +4. If a CQ is transmitted in JT65 mode, the Sked box is automatically + unckecked. + +5. In v5.8.3, entering the same callsign and locator information in + MyCall and ToRadio/Grid could cause the program to freeze. Fixed. + +6. If MyCall includes an extra prefix, as in 4X/ZL1RS, the standard JT65 + messages should not include a grid locator. Fixed. + +7. The "ms" parameter has been removed from the Soundcard status + readout at bottom left. Separate sample-rate factors are now + displayed for audio input and output, but only if "Enable + diagnostics" is checked on the Setup menu. + +8. The SpecJT screen may now be made invisible by clicking on "X" in + the upper right corner. To restore it to visible status, click on + View->SpecJT on the main screen. + +9. Decoded text lines in JT6M mode were sometimes too long, causing + end-of-line wrap-around. Fixed. + +10. Some diagnostic messages printed to console window have been + removed. + +11. The values of S, Sync, Clip, Zap and NB are now preserved when the + program is terminated and restarted. + +12. Version 5.8.3 was unable to read back its own recorded wave files. + Fixed. + +13. A programming error in the JT65 shorthand message decoder has been + fixed. Under certain conditions, this error could cause false + decodes of shorthand messages. + +14. The logic of file saving commands Save Last, Save decoded, etc., + has been corrected. + +15. Wave files read from disk will now produce spectral plots on the + waterfall display if Monitor is OFF. + +16. The CW ID feature has been implemented. + +17. The mapping of signal levels to pixel colors and its dependence + on settings of Brightness and Contrast controls has been changed + so as to improve sensitivity to very weak signals. + +18. In v5.8.3, changing Dsec would create erroneous results for the + displayed soundcard sample rate factor. Fixed. + +19. Running in JT65 mode with Dsec>0 caused transmission errors + (including a gap in transmitted tones at t = 38-41 s), and the + resulting transmission was unreadable. Fixed. + +20. Undesired resizing of main screen could occur when a long FSK441 + message was transmitted. Fixed. + +21. The "yellow line" displayed in the graphical area in JT6M mode + was computed incorrectly in version 5.8.3. Fixed. + +22. When running at speeds 1-5, the waterfall spectrum may optionally + be "flattened" to remove rolloff at edges. To enable this + feature, check "Flatten spectra" on the SpecJT Options menu. + +COMMENTS ON SOUND CARDS +----------------------- + +In general, "high end" sound cards offer no advantages when used with +WSJT. Motherboard AC-97 compliant sound systems are cheap and work +well. If you do need to buy a sound card for use with WSJT, my advice +is to get a simple one. You do NOT need 8-channel surround-sound, +wavetable synthesis, special effects, etc. Those features are for +games and listening to music, and they will be wasted on WSJT. + +Likewise, you do not need 24-bit A/D and D/A conversions. +Specifications having to do with signal/noise ratio are quite +irrelevant to use with WSJT, as you should never be operating in a +regime where A/D quantizing noise (or any other noise generated in the +sound card) contributes significantly to the system S/N. + +If you have a choice, get a card that offers a *native* sampling rate +of 44100 or 11025 Hz, or both. (Unfortunately, it is often very +difficult to tell from the manufacturer's literature whether this +capability is present or not.) If native sampling at 11025 Hz is +available -- or if the manufacturer has at least provided a +well-designed resampling capability -- the soundcard sample-rate +factors (displayed by WSJT in the bottom left corner, if +"Setup->Enable diagnostics" is checked) should both be very close to +1.0000. + + +Changes in WSJT 5.8.3 +--------------------- + +1. The Dsec parameter was not working properly in v5.8.1. Fixed. + +2. CPU load at high waterfall speeds has been substantially reduced. + +3. Saving cumulative file of decoded text is no longer optional. The + file name has been changed to ALL.TXT, to reflect use of this file + for transmitted as well as decoded text. + +4. Logic for green bar illustrating region searched for sync tones has + been corrected. + +5. Bug producing index error in "plot_yellow" is fixed. + +6. Bug causing crash in CW mode if TRPeriod > 60 s is fixed. + +7. Tabular listing of Audio devices has been clarified. + +8. Name at top of waterfall screen has been changed to "SpecJT" so + that its icon can be distinguished from that of main screen. + +9. VOX control of T/R sequencing is now permitted by setting the COM + port to 0. + +10. Exit from program with the "To Radio" box empty caused error + message and substitution of default parameters on restart. Fixed. + +11. Default FSK441 message #5 for EU has been changed to "73 MyCall" + (which I am told conforms with standard EU practice). + +12. Lower case letters are now acceptable in entries on Setup->Options + screen, and will be translated appropriately to upper case in + transmitted messages. + +13. The file AZEL.DAT has been moved to the WSJT6 installation + directory. + +14. The "Sh Msg" box was always checked when entering FSK441 mode. It + now remembers its state if you had unchecked it. + +15. Keyboard shortcuts have been implemented for most on-screen + controls. Use F1 to see a full listing. + +16. "Gen Std Msgs" now sets the Tx message to #1 in all WSJT modes. + +17. Self-echo doppler value has been replaced by "Dgrd" in the + astronomical data displayed on the main screen. + +18. The audio stream has been trimmed by 0.5 s at the start of FSK441 + and JT6M Rx sequences, to prevent possibly copying one's own Tx + signal. (Is this enough?) + +19. Two header parameters in wave files recorded by WSJT have been + corrected so that the files can be read correctly by Windows Sound + Recorder. + +20. Four-digit grid locators no longer produce incorrect azimuth + headings. + +21. Logic error in the waterfall's horizontal scrolling mode fixed. + +23. The active Tx message box is now highlighted during a + transmission, as in WSJT 4.x. + +24. Green ticks marking range of JT65 tone frequencies and red ticks + marking shorthand tones may optionally be displayed only if Freeze + is checked. (Select on waterfall screen's Options menu.) + +25. "Tool-tip" readout of full entry in CALL3.TXT is now provided + after Lookup, if mouse pointer hovers over the ToRadio box. + +26. Parameter RDsec was removed from the screen, as it is not + implemented. + +27. Some additional diagnostic information is now displayed. A + parameter "ms" following the "Soundcard x.xxxx" readout is a + measure of the maximum time between successive servicing of the + audio callback routine. The nominal value is about 186 ms, but + somewhat larger values are normal owing to granularity of the + Windows system clock. Values larger than 330 ms cause a warning + message to appear in the console window. Large values of this + parameter may be related to audio input problems (see below). + +28. The latest version of DL8EBW's CALL3.TXT database is included with + the distribution. It will be installed only if there is no file + named CALL3.TXT already in your WSJT6 installation directory. + + +KNOWN PROBLEMS +-------------- + +1. Some fraction of WSJT 5.8.1 users -- perhaps 5-10%, it is hard for + me to judge -- have had problems with erratic audio input. I am + having difficulty tracing the problem because I have not been able + to reproduce it on any computer to which I have access. Typical + symptoms are that after startup WSJT 5.8.1 runs normally in Monitor + mode for a minute or so, but then the reported audio level jumps to + a much higher value and perhaps fluctuates wildly. + + Two users have switched todifferent sound cards and made the + problem go away. Several others have discovered that if they first + start WSJT4 and leave it running (in Monitor mode, I believe), and + then start WSJT 5.8.1, the new program behaves properly. One user + corrected the problem by turning off an "AGC" feature on his sound + card. Apparently most of the newer SoundBlaster cards have this + AGC feature, and it is turned ON by default. I am told that it can + be turned OFF by using the supplied utility CTMIX32.EXE. + + I do not yet understand the cause of the erratic audio problem. It + is possible that it has been fixed in v5.8.3, as several minor + changes have been made to the audio input routines; but I think + this is unlikely. + + If you had this problem at your station and have now solved it, + please let me know what you did! If you still have problems when + running version 5.8.3, let me know about that as well. + +2. I do not yet have a good definition of the "minimum computer" + required to run WSJT6. Several people have told me that they are + using the program successfully on 300-500 MHz machines. Those with + computers slower than about 600 MHz will do best to avoid the + higher waterfall speeds and not run many other programs while using + WSJT. + + +Beta Release 5.8.1 +------------------ + +Beta release 5.8.1 is an entirely new program, dsesigned to preserve +the features and the "look and feel" of version 4.9.8, but also to add +many new features and do so in a way that will make for easier for +program maintenance and future development. After a period of beta +testing, the program will become known as WSJT 6.0. I will refer to +it here as WSJT6. + +Many features of WSJT6 will be familiar to present users of WSJT4.x. +However, the user interface and other real-time portions of the +program have been entirely re-written, so you may find a few things +that look different or work differently than before. + +WSJT6 is a multi-threaded program. This architecture permits much +better timing control and much better sharing of the CPU among the +program's many tasks. A real-time waterfall is provided, optimized +for each of the WSJT modes. You can measure and set the Rx gain in +real time. You can decode FSK441 pings immediately after hearing +them. + +The decoders for JT65 and JT6M are essentially the same as those in +recent versions of the program. (I have many plans for enhancements +to the decoders, but these must wait for future updates.) The FSK441 +decoder has intentionally reverted back to approximately version +3.8.1, because it has been shown that recent versions did not perform +quite as well. + +WSJT 5.8 is a stable release. Extensive tests by a small group of +early beta testers have already shown that it works well. However, it +contains many thousands of lines of new code, and most likely that +code has some bugs. Nevertheless, I think you will find many +operational advantages to using it. Over the past 2.5 months, all of +my own MS and EME QSOs have been made with the new version. + +If you decide to participate in the beta testing period, please accept +the responsibility of reporting any bugs that you find, as well as +telling me of features you would still like to see. I would +appreciate hearing about new features that you like, as well. + + +PRELIMINARY INSTRUCTIONS AND COMMENTS +------------------------------------- + +1. I suggest installing WSJT6 to a new directory such as C:\Program + Files\WSJT6. After installation you will probably want to copy + your version of the callsign database, CALL3.TXT, into the new + WSJT6 directory, replacing the one that is supplied. + +2. When you start the program you should get three windows on your + screen. One has a black background and I will call it the "console + window"; it is mainly used for debugging messages. You can + minimize it and generally ignore it. You should, however, look + there for messages if the program crashes (see also items 9 and + 11, below). The other two windows are a Spectran-like waterfall + and the more-or-less familiar WSJT window. It is no longer + necessary or desirable to run Spectran simultaneously with WSJT. + +3. FSK441, JT65, and JT6M are all present and functional. I have made + many QSOs with FSK441 and JT65, so I know they are working well. + JT6M has been tested somewhat less, but I have seen no problems as + yet. EME Echo mode and the CWID feature are not yet implemented. + +4. To start the real-time spectral display, click Monitor. Normally + you can leave Monitor on all the time. + +5. There are two ways to set the Rx Audio gain. You can call up the + Windows mixer as before, using the "Rx Volume Control" item on the + Options menu. There is also a digital gain control near the + bottom right of the waterfall screen. You should aim for around 0 + dB, as before -- but with 16-bit audio sampling it is no longer + very critical. Use the "S-meter" at the lower right of the + waterfall display, or the familiar box labeled "Rx noise" at + bottom center of the main screen. + +6. You should be able to make FSK441, JT65, and JT6M QSOs more or + less as usual. In FSK441 and JT6M you will want to run the + spectral display at speed "H1" or "H2" (speed is selected at the + top of the waterfall screen). (The "H" means horizontal + scrolling.) Scrolling speeds "5" and "H2" use a lot of CPU time, + so you may want to avoid them unless your computer is pretty fast. + I generally use speed "1" or "2" for JT65 and "H1" for FSK441 and + JT6M. + +7. When running FSK441 in the horizontal scrolling mode, the spectral + display shows current data in the top half and the previous Rx + sequence in the bottom half. The most recently decoded sequence + is shown also on the main screen, as in version 4.x. + +8. You can decode FSK441 pings right away by clicking on any of the + 2-dimensional spectral displays, or the accompanying green lines. + You can click on the top half, the bottom half, or in the main + screen's graphical area. + +9. If you have more than one sound card, you can select the desired + one. Look at the startup messages in the console window. You + should see a list of the available Audio devices and information + about which one has been selected. If you wish to change the + selection, enter the desired device numbers on the Setup->Options + screen, then terminate and restart the program. + +10. If your display has resolution 1024 x 768 or less, you may prefer + to resize the waterfall window so that only its top portion + remains visible. The two main WSJT windows may then be kept + visible without overlapping. + +11. Some program crashes can kill the console window so that you can't + read the error messages. If this happens, and if the crash is + repeatable, open a Windows Command-Prompt window; CD to your WSJT6 + installation directory, and start the program from there by typing + "WSJT6". With this startup procedure, any subsequent post-mortems + will remain visible. Please report any such messages to me! + +12. You may find decoding to be slightly slower than with v4.9.x. I + have not yet spent any time optimizing the new code for speed; it + will get faster when I turn attention to that task. If you have + an older computer you may wish to check the menu item + "Setup->Accelerated decoding", which will suspend updating the + waterfall during the decoding process. + +13. Be sure to look at the screens called up by function keys F1 and + Shift-F1. These screens are also available from the Help menu. + They list some useful keyboard and mouse commands that you might + otherwise overlook. + +14. Be sure to explore all the menus and on-screen controls, and try + out the commands listed on the help screens. Until I can find + time to write a new manual, this is the best way to learn about + some of the new features. + +15. In JT65 mode, a horizontal green line on the frequency scale shows + the range of frequencies that will be searched for a sync tone. + You can set the "Freeze DF" value by clicking on the main screen's + red curve (as in WSJT 4.x) or by clicking on the waterfall with + the shift key held down. If "Freeze" is checked, vertical green + ticks will mark the selected sync-tone frequency and the + corresponding frequency of the highest data tone. Red tick marks + denote the frequencies of the RO, RRR, and 73 shorthand messages. + +16. WSJT6 can read and process WAV files produced by earlier versions. + The converse is not true, however, because earlier versions of + WSJT are not equipped to read the 16-bit data files produced by + WSJT6. + +17. When you click "Log QSO," a line with date, time, HisCall, + HisGrid, frequency, and mode is added to the file WSJT.LOG in the + installation directory. + +18. Every second, a short file named "c:\azel.dat" is updated with + time, moon and sun coordinates, frequency, doppler, and doppler + rate information. This file could be used by other software to + make your antenna track or your radio follow doppler changes. + +19. In the lower left corner of the main screen you will see a message + of the form "Soundcard: x.xxxx", where x.xxxx is a number close to + 1.0000. This number is the ratio of the soundcard's measured + sampling frequency to the nominal value, 11025 Hz. The displayed + value should stabilize after the program has been running for a + minute or so. If you see values less than about 0.9990 or greater + than 1.0010, please let me know about it and tell me what kind of + computer and sound card you are using. + +20. Callsigns for Swaziland (prefix 3DA0) can now be used in standard + JT65 messages, and they will provide the full "deep search" + sensitivity. + +21. The box labeled "NB" enables a software noise blanker. If your + receiver already has a good noise blanker, this may be of little + use; if it does not, you may find this one better than nothing. + It can be helpful when short, impulsive noise spikes are present. + +22. The "QRN" parameter of older WSJT versions has been combined with + the "Clip" parameter. In FSK441 mode, Clip=0 corresponds to the + old QRN=5. If you want more FSK441 immunity to summertime QRN, + increase Clip above 0 just as you would have increased QRN above + 5. + +23. The "B" and "C" submodes of FSK441 have not been implemented. As + far as I could tell, they were little used. + + +Let me call your attention to the online WSJT Forums hosted by DK5YA +at www.vhfdx.de/cgi-bin/yabb/YaBB.pl. If you provide information and +post questions about WSJT 5.8 there, it will help others as well as +yourself -- and may help to reduce the load on my email inbox. + +I do, of course, want to hear from you directly if you have found a +problem with the new program version or suggestions for its +improvement. + + +Changes in Version 4.9.8 +------------------------ + +Version 4.9.8 is a minor maintenance release. The changes are: + +1. Bug in JT65 decoder could (rarely) cause a correct decoding by the + Reed-Solomon decoder to be "overruled" by an incorrect decoding + from the Deep Search decoder. Fixed. + +2. Bug in JT65 Reed-Solomon decoder could cause program to crash under + certain rare conditions. Fixed. + +3. The standard "CQ" message generated for a callsign having an extra + prefix or suffix should not include a grid locator. Fixed. + +4. Automatically generated CW messages for stations with callsigns longer + than 4 characters were improperly truncated. Fixed. + +5. Bug in JT65 decoder could occasionally cause one or two extra + letters to be appended to a correctly decoded callsign. Fixed. + +6. Grid locator entered in "Report" box in FSK441 mode (as used by + some in North American meteor scatter contest) would cause a crash + on program restart. Fixed. + + +Changes in Version 4.9.7 +------------------------ + +1. The only change in version 4.9.7 is to add KC4 to the list of supported + DXCC prefixes. + + +Changes in Version 4.9.6 +------------------------ + +1. WSJT 4.9.5 fails to decode some files that have relatively high S/N + and good Sync level. This is a bug, and has been fixed. For this + reason alone, you should definitely upgrade to Version 4.9.6. + +2. New optional message formats are provided for conveying and + responding to signal reports. + + It has been permissible for some time to send, for example, + + VK7MO K1JT -24 + K1JT VK7MO R-27 + + (The number after the minus sign must have two digits and must be in + the range -01 to -30.) + + I plan to implement a quick way of copying the measured strength + of a decoded transmission into TX message #2, when desired. This + is not yet done in v4.9.6, however. You must edit the TX messages + by hand if you use these formats. + + Enhancements in version 4.9.6 now allow you to send messages like + the ones listed below. Both stations will need to be running + v4.9.6 in order for these to work: + + VK7MO K1JT RO + VK7MO K1JT RRR + VK7MO K1JT 73 + +3. Decoding by the deep search algorithm has been extended so as to + include messages of the types discussed in item 2. + + +Changes in Version 4.9.5 +------------------------ + +1. Full support for long callsigns like ZA/PA2CHR and G4ABC/P is now + provided. When using such a callsign prefix or suffix, do not + include a grid locator in your transmitted message. Note that + 4.9.5 and 4.9.2 do not handle prefixes in the same way; they are + not compatible. To get the benefit of the expanded capability, + both stations (TX and RX) must use 4.9.5. The correct message + format is "K1JT V5/ZS5Y" or "V5/ZS5Y K1JT". The extended callsign + must be present in CALL3.TXT or in "To Radio" for the deep-search + decoder to be effective. + +2. If you double-click on a callsign in the decoded text window, and if + the word preceding the callsign is "CQ", then TX message #1 will be + selected after the messages are updated. Otherwise, TX message #2 + will be selected. + +3. So that you will be aware of what is happening, the background + color in the TX message box turns red whenever a message you have + entered is "non-standard" and will be sent as 13 characters of + plain text. + +4. Items related to decoding have been removed from the Setup | + Options screen and replaced by a new menu labeled Decoding. Here + you may now select "No shorthands" for FSK441 and several options + for JT65 decoding. + +5. In case you are upgrading directly from v4.9.0 or earlier to v4.9.5, + a callsign database file has been included as CALL3A.TXT. If you do + not already have a file CALL3.TXT, you should rename the supplied + file to CALL3.TXT. Otherwise, you will probably want to ignore + the supplied file, since you will have made additions to your own + copy. + +6. The frequency of program crashes (for example, after a long period + of monitoring) is much reduced, possibly to zero. + +Please, if you encounter a received wave file that reproducibly causes +WSJT to crash, send it to me. + + +Changes in Version 4.9.2 +------------------------ + +1. In CW mode you can now set the desired T/R period by using the text + box provided. This feature did not work properly in v4.9.1. + +2. Under some conditions using the "Add" button to edit information in + the file CALL3.TXT would cause a program crash with the message + "Run-time Error #53". Fixed. + +3. Using the double-mouse-click on a callsign in the decoded text + window will now set the active Tx Message to Tx2. I believe this + will be most commonly what is desired, and will be an added + convenience for random JT65 operation. + +4. The "Sked" box remained visible on the EME Echo screen, covering + part of the RIT box. Fixed. + +5. The program generates two numbers to characterize its level of + confidence in decoded messages. In version 4.9.1, these numbers + appeared at the end of each decoded text line. They are not + displayed in version 4.9.2, but in the next version I will + probably display them if you have checked the "Aggressive decoding" + box. The first number is 0 or 1 according to whether the + soft-decision Reed Solomon decoder has failed or succeeded. The + second number represents a confidence level on a 0-10 scale for + messages decoded using the "deep search" algorithm. Anything under + 3 is questionable; messages rated 6 and above are unlikely to be + wrong, unless you are processing "garbage" data containing strong + birdies, QRN, etc. In that case, you are on your own. + + +6. A bug was introduced when implementing the "Aggressive decoding" + check box. This bug caused a stray "OOO" flag to be sometimes + displayed even when no signal was present and synchronization had + not been achieved. Fixed. + + +Changes in Version 4.9.1 +------------------------ + +1. A programming error in version 4.9.0 prevented the "deep search" +portion of the JT65 decoder from detecting some messages that include +the "OOO" signal report. The bug has been fixed, and consequently the +extra 4 dB of sensitivity will become available for those messages. + +2. The callsign database, a file named CALL2.TXT in version 4.9.0, has +been converted to a comma-delimited format and is now named CALL3.TXT. +As has been true in the past, you should maintain your own copy of +this file according to your own needs. New calls may be added to the +file using the "Add" button of WSJT, and you can edit the file +directly with the Windows NotePad program. I apologize for the fact +that if you have already edited CALL2.TXT extensively, you will need +to do so again. The good news is that the programs WSJT, MoonSked (by +GM4JJJ) and Tracker (by W7GJ) will now use the same database file, +CALL3.TXT. + +3. Two new JT65 check boxes have been made available to the user: one +labeled "Sked", located on the main screen, and one labeled "Aggressive +decoding" on the Setup | Options screen. Check "Sked" to signify that +you are trying to work a known station; the deep search decoder will +then look only for your own call and the one displayed in the "To +Radio" box. Check "Aggressive search" if you want to see all messages +found by the deep-search decoder, even if the confidence level is +moderately low. Leave this box unchecked if you prefer to see only +decoded messages that have been assigned a relatively high confidence. + +4. The duration of T/R sequences in CW mode defaults to 60 s if the +Band is 50 MHz, 150 s if 432 MHz, and 120 s otherwise. However, an +on-screen box now allows you to override the defaults and set any +desired T/R period (in seconds). + + +Changes in Version 4.9.0 +------------------------ + +On the outside WSJT version 4.9.0 looks nearly the same as its recent +predecessors. A "CW" entry now appears on the Mode menu. This is +presently a "transmit only" mode: it sends standard EME-style messages +at 15 WPM, by keying an 800 Hz audio tone, and it takes care of the +timing and T/R switching for you. Receiving is left up to you, the +operator. For me, this combination makes CW EME QSOs relaxing and +enjoyable. Presently the program uses 2.5 minute sequences if you are +on 432 MHz, 2 minutes on 144 MHz, and 1 minute on 50 MHz. (If you +want to run with 1-minute sequences on 144, set the band indicator to +50 MHz.) + +Double-clicking on a callsign in either one of the decoded text +windows will cause that callsign to be copied into the "To Radio" box. +The call will then be looked up in the database and will be inserted +appropriately into the transmit message boxes Tx1 and Tx2. This +feature is designed to facilitate random JT65 operation by making it +easy to call a station you have just copied calling CQ, or responding +to your CQ. + +The most significant program enhancements are those made to the JT65 +decoder. It has been transformed into a multi-layered procedure that +takes better advantage of the structured nature of JT65 messages and +the substantial computing capability that most WSJT users have in +their hamshacks. + +In version 4.9.0, if the initial JT65 decoding effort fails then +deeper searches are attempted using an entirely different approach. +The result is a net gain of about 4 dB over a wide range of +circumstances. My JT65 digital simulator, which has accurately +predicted the performance of previous versions of the software, +correctly decodes about 50% of simulated Rx files with the v4.7.0 +decoder at a signal level of -24 dB. With the v4.9.0 decoder, it +correctly decodes more than half of the simulated data files at -28 +dB. This very substantial improvement means that JT65's +message-averaging facility will be needed much less frequently than +with earlier versions of WSJT. Most of the time, if the transmission +synchronizes properly, it will also decode properly. + + +You will get better performance from the new JT65 decoder if you +understand a few things about how it works. The following is a very +brief description; more complete technical details will be forthcoming +when I find time to write it all down. + +JT65 is capable of transmitting and receiving 2^72 (about 5 x 10^21) +distinct user messages. Instead of sending the minimum number of 72 +information bits needed to to convey any one of those distinct +messages, the program actually sends 63 six-bit "symbols" for a total +of 378 bits in each transmission. The 302 extra bits comprise the +powerful forward error correction (FEC) capability of the JT65 mode, +allowing the system to function reliably with signals far below the +audible threshold. + +One of the first tasks of the JT65 decoder is to measure the signal +level at each of the 64 data-tone frequencies during each of the 63 +data intervals in a transmission. The program must then decide which +one of the possible 2^72 messages was most likely the one sent. This +procedure is necessarily probabilistic in nature. The best decoder +will go as far down into the noise as possible, but it must also know +when to give up so that it produces few false decodes. + +The total of 2^72 distinct messages is far too many to permit each one +to be tested individually against the received signal. However, an +important characteristic of the Reed-Solomon FEC code used in JT65 is +that well-defined mathematical algorithms can be used to direct the +decoder toward the most likely candidate messages, based on the +available signal information. A mathematical inversion of the code is +made possible by the organization of the redundant information +contained in the 306 extra bits. + +The new JT65 decoder goes far beyond the capabilities of normal +Reed-Solomon decoders. If the standard decoding procedure fails to +produce a high-confidence solution, the program proceeds to search +explicitly for each one of a number of messages that it considers +likely or plausible on other grounds. + +Nearly 2^28 (over 250 million) different callsigns can be accommodated +in each of the two callsign fields of a JT65 message. Once again, +this is far too many to permit an exhaustive search for them all. +Consequently, the "deep search decoder" takes the callsigns listed in +the file CALL2.TXT (located in the user's WSJT directory) as being the +most likely alternatives in the message's second field. A correlation +algorithm is then applied to find out if one of these calls and its +associated grid locator are present, combined with either "CQ" or the +receiving station's callsign in the first field. High-confidence +matching of this kind can be accomplished down to about -28 dB on the +WSJT scale, in a single transmission, with a very low error rate. + +The bottom line is that for any arbitrary callsign the new JT65 +decoder performs at least as well as the one in WSJT version 4.7.0. +Message averaging works just as it did before, and if you are +listening in to a "third party" QSO between two other stations, the +sensitivity will be the same as in version 4.7.0. However, if a +station that is listed in the file CALL2.TXT is calling CQ or is +calling you, your sensitivity will be about 4 dB better on average. + +Please note that the decoder is given no information whatsoever about +what station you may be trying to work. Its heart is "as pure as the +driven snow," even if you are working a sked. However, the decoder +does presume that the callsign of the transmitting station is more +likely to be one listed in CALL2.TXT than some other callsign +constructed at random. + +The program always attempts to decode a purely arbitrary message +first. Failing that, it will look more deeply in the noise for the +presence of a message that includes the callsign of a station listed +in the database file. + +It is no accident that the algorithm just described bears close +resemblance to the thought processes (conscious and otherwise) that we +use to copy very weak CW by ear. Familiar combinations like CQ and +one's own callsign are always easier to dig out of the noise than +random combinations of characters. Callsigns that we have seen or +heard before are more easily recognized than arbitrary calls generated +at random. The new JT65 decoder behaves similarly, except that it +is kept fully in the dark about who you are trying to work. + +All decoders make mistakes, and this one is no exception. Just like a +human copying CW, the JT65 decoder has a "grey area" in which it finds +a solution but may have only moderate confidence in it. In such cases +the decoder appends a "?" to the decoded text, and the operator must +make the final decision as to whether the decoding is correct. Be +aware that because of the mathematical message structure, incorrect +decodings will not just differ from the correct one in a few +characters; more likely, they will exhibit a whole incorrect callsign. +As you gain experience in recognizing the graphical and numerical +indications of proper message synchronization and the effects of +"birdies" and other interference, you will become adept at making +these decisions when necessary. With added on-the-air experience I will +probably be able top reduce the decoder's error rate, as well. + +A final note: the file CALL2.TXT replaces the file CALLSIGN.TXT used +by earlier versions of WSJT. The format has been changed to permit +extended callsigns such as those sometimes used by DXpeditions, for +example ZA/PA2CHR. The name of the database file has been changed so +as not to "break" an earlier version of WSJT that you may wish to keep +available. Full support for extended callsigns (i.e., calls with an +extra prefix or suffix) is planned for a future version of WSJT. + + +Changes in Version 4.7.0 +------------------------ + +1. New feature: WSJT can now be used simultaneously with Spectran on +the same computer. You can start Spectran by selecting "Use Spectran +for input" on the Setup menu. This feature also allows the user to +select the sound card to be used for input. + +2. Bug fix: in some circumstances, switching from a JT65 long-format +message to a shorthand message did not work properly. Fixed. + +3. Bug fix: for operators in the southern hemisphere and longitudes +more than 90 degrees east or west, the wrong "Hot spot" was sometimes +identified as the best direction for sporadic meteors. Fixed. + + +Changes in Version 4.6.1 +------------------------ + +1. Bug fix: I mistakenly shifted the RX data by 2 seconds, rather +than the intended 1 s, when changing the DT range. Therefore in +v4.6.0 the actual DT range is not -1 to +5 s as stated, but rather 0 +to +6 s; moreover, the displayed values of DT are too small by 1.0 s. +This has been fixed. + +2. New feature: thanks to Akira, JM1SZY, I learned that occasionally a +file (or an average of several files) will decode better with the AFC +feature turned off. Consequently I have added a checkbox that must be +ticked to activate AFC in the JT65 modes. If you can trust the +frequency stability of the signal you are receiving, and especially if +you are trying to receive a signal at -27 dB or weaker, leaving this +box unchecked may yield a slight improvement in decoding. In most +cases, especially at 144 MHz and above, I recommend leaving the AFC +turned ON. + +3. Thanks to Chris, GW4DGU, for pointing out that the Gx series of +prefixes is no longer legal for reciprocal license operating in the +countries of the UK. The valid prefix series for such operation is +now the M-series, i.e., M MD MI MJ MM MU MW. I have changed the +prefix table accordingly. + +Version 4.6 +----------- + +This is the first full release of WSJT since version 3.0. New users +can install Version 4.6 directly, without upgrading from a previous +installation. Of course, you can also upgrade from an earlier version +in the usual way. All download files can be found on the WSJT home +page, http://pulsar.princeton.edu/~joe/K1JT. + +The new release includes an entirely new "WSJT 4.6 User's Guide." +This document is about one third the length of the former "User's +Guide and Reference Manual," but contains nearly everything you need +to know to use the program. A copy of the new Guide is included in +the version 4.6 distribution files. You can also download it directly +from http://pulsar.princeton.edu/~joe/K1JT/WSJT_User_460.pdf. Even if +you are an experienced WSJT user, you should definitely print and read +this document. + +New features in WSJT Version 4.6 include the following: + +1. Improved automatic frequency control in JT65 modes. If you have +lost JT65 QSOs because of unstable oscillators, this is for you. + +2. The acceptable range for DT in JT65 mode is now -1 to +5 s. This +range is a better fit for EME communication than the former -2 to +4 +s. It will allow for somewhat greater clock errors before +inter-station synchronization fails on an EME path. + +Note to experienced users: this means that the plotting scale for the +"blue curve" now runs from -1 to +5 s. EME signals should normally +produce a blue peak near the center of the plot area. + +3. When the blue window displaying moon coordinates has been toggled +to display coordinates for the DX station as well as the home station, +it now displays MaxNR in place of SD. MaxNR is the maximum path +non-reciprocity in dB. This effect arises from the combination of +spatial polarization shift plus Faraday rotation; it is what causes +"one way propagation" between stations that use fixed linear +polarization. + +4. A facility for generating the file ID.WAV for station identification +is now built into WSJT. + +5. The "Save Decoded" menu item now saves files with decoded shorthand +messages as well as normal messages. + +6. JT65 has a new shorthand message "ATT" (for "Attention!"). It is +intended as an aid to help two stations find each other by determining +the correct DF. + +7. Visual aids for evaluating JT65 shorthand messages "by eye" are +provided if you click on the sync-tone frequency in the Big Spectrum +display. + +8. For DXpeditions: a country prefix preceded by "/" may be +substituted for the grid locator in a type 1 JT65 message. + +9. Alternatively, a signal report of the form "-NN" or "R-NN" may be +substituted for the grid locator in a type 1 JT65 message. For +example, -24 might indicate that signals were being received at -24 +dB. The minus sign is required, and NN must lie between 01 and 30. + +10. The receiver noise level reported by Measure mode (the level of the +"green line") has been increased by 2 dB to be consistent with levels +reported by the other operating modes. + + +Changes in Version 4.5.1 +------------------------ + +Bug fixes: + +1. JT6M did not transmit properly in version 4.5.0 because the program +failed to switch its wavefile generator into JT6M mode. Fixed. + +2. WSJT consumed a large fraction of CPU time in JT65 mode, even when +the program was supposedly doing nothing. Fixed. + +3. Monitoring for long periods in JT65 mode would occasionally produce +a Fortran "output conversion error". Fixed. + +4. Clicking the "Add" button with nothing in the Grid box would cause +a program crash. Fixed. + + +Enhancements: + +1. In the FSK441 modes, messages longer than 3 nonblank characters and +starting with R26, R27, RRR, or 73 are no longer transmitted as +shorthand messages. + +2. Onscreen labels now indicate active status of the "Save Decoded", +"Save All", and "Save text in File DECODED.CUM" features. + +3. Small improvements have been made in the decoding of shorthand +messages in modes FSK441B and C. + +4. Alphabetic characters in message templates (on the Setup | Options +screen) are now case-insensitive. + + +Principal New Features in WSJT Version 4.5 +------------------------------------------ + +1. The JT65 modes employ an entirely new decoding algorithm that uses +"soft decisions" to recover the transmitted message. The message +format and Reed-Solomon encoding are unchanged, so the JT65A, B, and C +modes are fully compatible with earlier versions. However, the new +decoder is more sensitive by slightly more than 1 dB. It is based on +software licensed from CodeVector Technologies, LLC, and protected +under United States Patent 6,634,007. As usual, however, I am making +WSJT freely available for amateur radio use. + +Changes to the JT65 modes are "under the hood," and except for the +improved performance you will find them mostly invisible. The new +decoder can be somewhat slower than the one in v4.3.4, depending on +details of the received data. + + +2. Like JT65, FSK441 now provides three submodes. FSK441A is +identical to the "classical" FSK441. The two new modes, FSK441B and +FSK441C, use the same 4-tone frequency shift keying at 441 baud. +However, they use forward error correction (FEC) on a +character-by-character basis, to improve message reliability. They +also provide shorthand messages which are more robust than the +single-tone messages of traditional FSK441. Cross-mode communication +will not work: a transmission in FSK441B must be received in FSK441B, +etc. + +FEC information in FSK441B and FSK441C is conveyed by sending +additional channel symbols (tones) for each character, using special +codes designed to optimize the error rate and sensitivity with very +short pings. The additional symbols are redundant when the S/N is +high, but they allow recovery from transmission errors when the S/N is +low. + +FSK441A, which provides no redundancy, transmits 3 symbols per +character. Modes B and C use 4 and 7 symbols per character, +respectively. The raw throughput of user information is summarized +in the following table: + + FSK441A FSK441B FSK441C +---------------------------------------------------------------- +Sequential tones per character 3 4 7 +User data rate, characters/second 147 110 63 +Time for a 12-character message, ms 82 109 190 + + +The shorthand messages in FSK441B and FSK441C use alternating tones at +two specific frequencies, as follows: + +Shorthand Low tone High tone + message (Hz) (Hz) +------------------------------ + R26 861 1206 + R27 861 1550 + RRR 861 1895 + 73 861 2239 + +Tests with my digital simulator show that shorthand messages in +FSK441B and FSK441C are several dB more sensitive than the ST messages +of FSK441A. At the same time they give a far lower rate of false +positives. + +With multi-tone messages the sensitivities of the three submodes are +nearly the same, but they have different trade-offs. Mode A is 25 +percent faster than mode B, but mode B is more accurate and will +produce much less on-screen "gibberish". Mode C is about half the +speed of mode A but has still stronger FEC code. Parameters of the B +and C modes were selected in the expectation that FSK441B might become +the mode of choice for meteor scatter work on 144 MHz (and possibly +also 222 MHz), while FSK441C will likely prove best at 50 MHz where +the pings are longer. These suppositions need to be tested, of +course. + +Experienced WSJT users should have no difficulty making the new modes +work. Just select the desired mode from the Mode menu (or use the +appropriate hot-key combination), and away you go. + + +Other Changes in Version 4.5.0 +------------------------------ + +1. Bug fix: In JT65 mode, if you sent 73s and then started a QSO with +a new station, the program would sometimes continue sending the 73 +message even though TX message #1 had been checked. This has been +fixed. + +2. Performance enhancement: Shorthand messages in JT65 were sometimes +suppressed because of an apparent low-value Sync detection that +produced no decoded message. This has been fixed; there is no longer +any need to set your Sync threshold to a higher value when you are +expecting to receive a shorthand message. + +3. The JT65 "Filter" function has been removed. It was confusing to +some, and anyway was generally deemed of little value. The new +decoder provides a much better solution. + +4. The "suggested report" has been deleted from FSK441 decoded text +lines. It is replaced by S/N, the measured signal-to-noise ratio in +dB. Note that the familiar "dB" measurement of (S+N)/N is still +available, as well. + +5. Finer adjustment intervals are provided for "S", the FSK441 ping +detection limit. As in earlier version, these numbers refer to +(S+N)/N. In contrast, the "Single Tone" or "Shorthand" detection +limits refer to S/N, a more useful parameter at very low signal +levels. (See below for more details on signal to noise ratios, if +interested.) + +6. A button labeled "Add" just below the grid locator box will cause +the displayed callsign and grid to be entered into the CALLSIGN.TXT +database. + +7. A date and time stamp is now added to the DECODED.CUM file at +program startup or when you first enable writing to this file. + + +Request to Users +---------------- + +As usual, I will appreciate hearing from users about the new features +in WSJT. Let me know, of course, if you find bugs or other problems +in the program. In particular, let me know of your experiences with +FSK441B and FSK441C. Remember, my guess is that FSK441B should work very +well on 2 meters, while FSK441C may work best on 6 meters. After +you have gained some experience with FSK441C on 6 meters, I would be +interested to know whether you think JT6M should be retired. In North +America, at least, I do not think it is being used very much. + + +Why use both S/N and (S+N)/N ? +------------------------------ + +WSJT has traditionally measured the level of FSK441 signals as the +ratio (signal plus noise)/(noise) = (S+N/N), in dB. This quantity is +approximately what S-meters try to measure; it has the advantage that +it goes to zero when there is no signal, while at high signal levels +it increases as you would expect, in proportion to signal strength. + +At low signal levels, however, the numbers for (S+N)/N in dB behave in +a way that may be counter-intuitive. When WSJT reports that a meteor +ping had strength 3 dB, it means that signal plus noise was 3 dB +higher than noise alone. That means that signal and noise were equal +in power, so the corresponding value of S/N must be 0 dB. If the same +signal had been transmitted with half the power, it would have had S/N += -3 dB, and (S+N)/N would have been 10*log(0.5+1.0) = 1.76 dB. Yes, +cutting the TX power in half would only reduce the ping level from +3.0 dB to 1.76 dB! That's why, for many purposes, S/N is a more +useful number -- and why I am now listing both numbers in FSK441 +decoded text lines. + +The table below will allow you to convert easily between S/N and +(S+N)/N, both as numerical ratios and as dB. + + S/N S/N (S+N)/N (S+N)/N + (dB) (dB) +---------------------------------------- + 10.0 10.000 11.000 10.41 + 9.0 7.943 8.943 9.51 + 8.0 6.310 7.310 8.64 + 7.0 5.012 6.012 7.79 + 6.0 3.981 4.981 6.97 + 5.0 3.162 4.162 6.19 + 4.0 2.512 3.512 5.46 + 3.0 1.995 2.995 4.76 + 2.0 1.585 2.585 4.12 + 1.0 1.259 2.259 3.54 + 0.0 1.000 2.000 3.01 + -1.0 0.794 1.794 2.54 + -2.0 0.631 1.631 2.12 + -3.0 0.501 1.501 1.76 + -4.0 0.398 1.398 1.46 + -5.0 0.316 1.316 1.19 + -6.0 0.251 1.251 0.97 + -7.0 0.200 1.200 0.79 + -8.0 0.158 1.158 0.64 + -9.0 0.126 1.126 0.51 + -10.0 0.100 1.100 0.41 + + +Beta Release 4.3.4 +------------------ + +Beta Release 4.3.4 of WSJT is now available for free download at the +WSJT home page, http://pulsar.princeton.edu/~joe/K1JT. The principal +change from version 4.2.1 is to offer three JT65 submodes. The +submodes differ in tone spacing and total bandwidth as follows: + + Mode Spacing Total BW + ------------------------- + JT65A 2.7 Hz 177.6 Hz + JT65B 5.4 355.3 + JT65C 10.8 710.6 + +Note that JT65A is identical to the original JT65. If you want to +work people who have not yet upgraded to v4.3.4, be sure to select +mode JT65A. Otherwise, be sure to use the same mode that your QSO +partner is using. Cross-mode contacts will not work. + +JT65B should be nearly as sensitive as JT65A, and it will be twice as +forgiving of frequency instabilities. On balance, with existing +"stock" radios, JT65B will probably be better than JT65A. JT65C is +less sensitive by a small amount, perhaps 1 dB, but will be even more +lenient on stability issues. By all means experiment with the +different submodes, and be sure to let me know your conclusions about +them! + +I am presently inclined to recommend that JT65B should become the +"standard" JT65 mode. If this tentative conclusion holds up, future +versions of the program may no longer support the A and C modes. + +Other changes from version 4.2.1 include the following: + +1. Further improvements have been made to the JT65 decoding + algorithm. These improvements apply to all three submodes. Some + wave files that would not decode with v4.2.1 now decode properly, + especially in averages over several minutes. + +2. The frequency width W of the sync tone (the "red spike") is now + measured and displayed in Hz after DF in the main text box. In any + of the three JT65 modes, W should be no more than 2-4 Hz under good + conditions. Uncorrected frequency drifts, excessive oscillator + phase noise, and certain propagation effects can make the width + larger. Anything over about about 4 Hz will impair copy in JT65A. + Similarly, widths greater than about 7 and 15 Hz will begin to + impair copy in JT65B and C, respectively. + +3. The utility program CWID.EXE now accepts lower case letters on the + command line. It also permits you to specify the audio frequency + of the tone in the wave file. You may wish to place the tone at + 600 Hz or lower so that it lies well below the tones generated by + any of the WSJT operating modes. + +4. The "Clip" function has been improved in several ways. The yellow + and magenta curves in the Big Spectrum display no longer disappear + when Clip > 0. Setting Clip = 3 does hard clipping, as before, but + it also blanks out any data regions with average power well above + the "baseline" of the green curve. Experimenting with different + values of Clip may help you to recover good copy from noisy data. + +5. I believe that the text window displays in Monitor mode, and when + you are using the Include/Exclude buttons, now function correctly. + +6. Minor bug fixes: the program no longer crashes in EME Echo mode if + you select "EME Calc | Load | Cancel". The correct "S" value is + listed on the status bar in JT6M mode. + +7. The program's "Fit and finish" is improved in several not very + important ways. + + +WSJT Version 4.2.1 +------------------ + +Version 4.2.1 contains a number of enhancements and bug fixes, mostly +related to the new JT65 mode. Changes from version 4.1.1 include the +following: + + 1.1 Message averaging now works correctly + 1.2 Many small improvements to the decoding algorithm + 1.3 Decoding speed improved by 50% + 1.4 JT65 monitor mode is properly implemented + 1.5 TX message can be changed up to t=59 s of preceding RX period + 1.6 Switch to a shorthand TX message at any time + 1.7 Freeze works properly for shorthand messages + 1.8 Decodes with failed FEC (forward error correction) are + optionally displayable + 1.9 "Garbage filter" provided so that questionable decodes appear + only if they contain some recognizable text + 1.10 Automatic station ID, as in FSK441 and JT6M modes + 1.11 Companion program to generate a CW ID.WAV file is included + 1.12 The birdie zapper now works in JT65 mode + 1.13 "Clip" function has been reactivated + 1.14 F5 help screen updated to reflect JT65 practices + 1.15 "OOO" message handled more transparently + 1.16 Optional display of Moon Az/El at DX station, replacing Sun + Az/El + 1.17 Right/Left audio out now works properly + 1.18 DT displayed as blank rather than 0.0 for shorthand + messages + 1.19 No program crash if ToRadio or Grid left empty + 1.20 No program crash if attempting to decode 60 s file in JT6M + 1.21 All other reported problems causing crash have been fixed + + ++-------------------------------------------------------------+ +| Quick Start Guide to Using WSJT version 4 and the JT65 Mode | ++-------------------------------------------------------------+ + +Version 4 of WSJT marks a significant departure in the program's +evolution. The list of features is no longer a full superset of +those available in all previous versions. In particular, the +JT44 mode is gone; it is replaced by a new mode called JT65 that +I hope will be a significant improvement for making QSOs via EME +and extremely weak tropospheric paths. + +The procedure for upgrading to version 4 is identical to previous +upgrades, with one exception: the setup procedure will install a +new program in your existing WSJT directory, but will keep the +old version alive as well. The two versions of the program can +coexist peacefully. During a testing period you will probably +want the older version and JT44 to be available as well. + + +What is different about JT65, compared to JT44? Here's a short +list: + +1. T/R period 60 s; actual TX audio duration 46.8 s. (Yes, this +will put somewhat more stress on your PA. If its cooling is +marginal, take appropriate action.) + +2. Modulation uses 64 data tones plus a sync tone. + +3. Tones are spaced by 2.7 Hz in frequency and 0.372 s in time. +The total occupied bandwidth of a JT65 signal is about 180 Hz. + +4. Transmissions consist of 63 data tones or "symbols," each +carrying 6 bits of information. In addition there are 63 sync +symbols for establishing time and frequency synchronization. + +5. Software AFC (automatic frequency control) can follow drift +rates up to about +/-10 Hz/minute. + +6. User messages are tightly "source coded" into 72 bits. + +7. Strong FEC (forward error correction) coding is used to +mitigate transmission errors. + +8. User-level message formats are designed to permit maximum +possible efficiency in EME or similar QSOs. A valid message must +be be one of three possible types: + + 1. "Call1 Call2 Grid" or "Call1 Call2 Grid OOO" + 2. "RO", "RRR", or "73" (so-called shorthand messages) + 3. "any text you want" (up to 13 characters selected + from a 42-character alphabet) + +Instead of a callsign, the first field of a message type 1 may +contain "CQ" or "QRZ". Other such "special tokens" may be added +later. The available alphabet of characters for message type 3 +is: + 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ +-./? + +9. Instead of JT44's very effective intra-message averaging of +the even, odd, and "last N" characters of a message, JT65 offers +even more powerful special shorthand messages for RO, RRR, and +73. These have much higher sensitivity than the other message +types. They work reliably down to about -30 dB. If you +succeed in exchanging callsigns and "OOO" by means of type 1 +messages, you should certainly be able to complete the QSO. + +10. Message averaging over subsequent transmissions works as it +did in JT44, with one exception. The "OOO" signal report +typically used for EME can be appended to message #1 and the +message will continue averaging without any need to start over. +The presence or absence of "OOO" will be detected if sync is +achieved, whether or not full decoding has been successful. + +11. Receiving FEC-decoded transmissions takes some getting used +to. You will find *much* less gibberish on your screen in JT65 +than in JT44. The FEC algorithm has a good idea whether it has +succeeded or not, and the program will suppress output unless it +is "pretty sure" that it has got the message right. You will +discover that when the FEC procedure fails and the program has +not realized it, text is occasionally produced looks like +plausible (but quite wrong) callsigns or grid locators. You must +mentally reject such garbage messages, when they occur. In the +small amount of on-the-air testing that JT65 has enjoyed so far, +my experience is that that only a few percent of decoded messages +are displayed incorrectly. Most of the time, received text is +either "letter perfect" or is left blank. + +12. You may optionally have the program display text for instances +when the decoder in uncertain of its results. Doing so makes use of +an "expected message", and you can specify a minimum number of +characters thst must match before uncertain text is displayed. By +default the expected message is "MyCall HisCall HisGrid" where MyCall +is your own callsign, HisCall is the one entered in the onscreen "To +Radio" box, and HisGrid is the first four characters of the grid +locator in the "Grid" box. + +13. At least one design choice used to define the JT65 algorithm is +still subject to change. If the 2.7 Hz tone spacing turns out to be +problematic because of propagation anomalies or inadequate oscillator +stabilities, the spacing could be increased. There are significant +advantages to the smaller spacing, however, so I am sticking with it +for now. + +Beta Release 4.1.1 +------------------ + ++-------------------------------------------------------------+ +| Quick Start Guide to Using WSJT version 4 and the JT65 Mode | ++-------------------------------------------------------------+ + +Version 4 of WSJT marks a significant departure in the program's +evolution. The list of features is no longer a full superset of +those available in all previous versions. In particular, the +JT44 mode is gone; it is replaced by a new mode called JT65 that +I hope will be a significant improvement for making QSOs via EME +and extremely weak tropospheric paths. + +The procedure for upgrading to version 4 is identical to previous +upgrades, with one exception: the setup procedure will install a +new program in your existing WSJT directory, but will keep the +old version alive as well. The two versions of the program can +coexist peacefully. During a testing period you will probably +want the older version and JT44 to be available as well. + + +What is different about JT65, compared to JT44? Here's a short +list: + +1. T/R period 60 s; actual TX audio duration 46.8 s. (Yes, this +will put somewhat more stress on your PA. If its cooling is +marginal, take appropriate action.) + +2. Modulation uses 64 data tones plus a sync tone. + +3. Tones are spaced by 2.7 Hz in frequency and 0.372 s in time. +The total occupied bandwidth of a JT65 signal is about 180 Hz. + +4. Transmissions consist of 63 data tones or "symbols," each +carrying 6 bits of information. In addition there are 63 sync +symbols for establishing time and frequency synchronization. + +5. Software AFC (automatic frequency control) can follow drift +rates up to about +/-10 Hz/minute. + +6. User messages are tightly "source coded" into 72 bits. + +7. Strong FEC (forward error correction) coding is used to +mitigate transmission errors. + +8. User-level mesage formats are designed to permit maximum +possible efficiency in EME or similar QSOs. A valid message must +be be one of three possible types: + + 1. "Call1 Call2 Grid" or "Call1 Call2 Grid OOO" + + 2. "RO", "RRR", or "73" (so-called shorthand messages) + + 3. "any text you want" (up to 13 characters selected + from a 42-character alphabet) + +Instead of a callsign, the first field of a message type 1 may +contain "CQ" or "QRZ". Other such "special tokens" may be added +later. The available alphabet of characters for message type 3 +is: + 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ +-./? + +9. Instead of JT44's very effective intra-message averaging of +the even, odd, and "last N" characters of a message, JT65 offers +even more powerful special shorthand messages for RO, RRR, and +73. These have much higher sensitivity than the other message +types. They work reliably down to -30 dB and below. If you +succeed in exchanging callsigns and "OOO" by means of type 1 +messages, you should certainly be able to complete the QSO. + +10. Message averaging over subsequent transmissions is intended +to work as it did in JT44, with one exception. The "OOO" signal +report typically used for EME can be appended to message #1 and +the message will continue averaging without any need to start +over. The presence or absence of "OOO" will be detected if sync +is achieved, whether or not full decoding has been successful. +[Note: message averaging is only partially functional in the +first beta release of the JT65 mode. I will need some experience +with the mode in order to optimize the code here.] + +11. Receiving FEC-decoded transmissions takes some getting used +to. You will find *much* less gibberish on your screen in JT65 +than in JT44. The FEC algorithm has a good idea whether it has +succeeded or not, and the program will suppress output unless it +is "pretty sure" that it has got the message right. You will +discover that when the FEC procedure fails and the program has +not realized it, text is occasionally produced looks like +plausible (but quite wrong) callsigns or grid locators. You must +mentally reject such garbage messages, when they occur. In the +small amount of on-the-air testing that JT65 has enjoyed so far, +my experience is that that only a few percent of decoded messages +are displayed incorrectly. Most of the time, received text is +either "letter perfect" or is left blank. + +12. The program makes use of what it calls the "expected +message". By default this message is "MyCall HisCall HisGrid" +where MyCall is your own callsign, HisCall is the one entered in +the onscreen "To Radio" box, and HisGrid is the first four +characters of the grid locator in the "Grid" box. The AFC +algorithm, in particular, can work more effectively when the +actual message received matches the expected message. + +13. Several design choices used in defining the JT65 algorithm +are still subject to change. If the 2.7 Hz tone spacing turns +out to be problematic because of propagation anomalies or +inadequate oscillator stabilities, the spacing could be +increased. About 1 dB of additional S/N could be obtained by +omitting the "Grid" field of the standard message format. This +would also reduce the maximum "plain text" message length from 13 +characters to 10. + +14. Please note that the "Clip" and "ST" are not functional in +WSJT v4.1.1. Their settings do not affect program operation. + + +Beta Release 3.8.1 +------------------ +This release contains the following new features: + +1. An optional large spectral display. Its axes are reversed with +respect to those of the FSK441 and JT6M waterfall displays; in the new +plot, frequency runs from left to right and time from top to bottom. + +2. A new birdie zapper that is especially effective in the FSK441 and +JT6M modes. You can watch what it is doing by observing the waterfall +displays before and after the "Zap" box is checked. Click "Decode" to +refresh the displays after checking or uncheking "Zap". + +3. Message decoding in FSK441 mode has been improved in several ways. +DF is more accurately determined. Better synchronization is achieved +with the precise timing of 25-sample tone bursts comprising each +message symbol. Folding of messages is no longer attempted. (It +seems that whenever a ping is long enough to make folding effective, +it's also strong enough to make folding unnecessary.) As in previous +versions, the left mouse button allows decoding of single-tone +messages while the right button suppresses them. + +4. It is now permissible to click "Gen Std Msgs" while transmitting in +FSK441 or JT6M mode. When this button is clicked, the Tx message +number will reset to #1 if and only if the callsign in "To Radio" has +changed. + +5. Message formatting templates for FSK441 and JT6M may now include +the special codes %G and %L to insert your 4-digit grid or full +6-digit locator, respectively, in the message. + +6. "Reset Defaults" now resets the QRN level to 5, as it should. + +7. The decoding parameters in use are no longer listed in the Status +Bar at lower right. This listing had become redundant. + +8. In Monitor mode, the name assigned to the Rx wave file begins with +"Mon_" instead of the "To Radio" callsign. + +9. In FSK441 mode, all messages with more than 3 non-blank characters +are transmitted in multi-tone mode. + +Beta Version 3.6.4 +------------------ + +The previous version had the threshold set very low for all mouse-picked +decoding attempts in JT6M mode. This was useful to me for testing, but +produced excessive gibberish. Version 3.6.4 has a reasonable threshold and +produces much cleaner output. In addition, the message averaging algorithm +has been improved. I find that I seldom need to use either "Freeze" or +"FixAve" now. These buttons are still present in version 3.6.4, but unless +I hear that people are finding them useful I may remove them soon. + +An option has been added to the Setup menu so that you can determine +whether you want the "Tx Stop" button to kick you out of Auto Mode, or +not. The default is not to do so. + +***IMPORTANT*** + +If you can make WSJT v3.6.4 crash in normal operation, please let me know +(and tell me how). Also let me know if you find anything that does not +work as intended. I believe the present code behaves well and is nearly +ready to be upgraded from "Beta" status to a full release. + +WSJT Beta Version 3.6.3 +----------------------- +Version 3.6.3 has a number of small improvements, many of them not +immediately visible. Several bugs have been exterminated. The JT6M +decoder works better and is more sensitive. JT6M now has a "FixAve" +checkbox; when this is checked, average messages will be sought only +at the lengths of the automatically generated messages. + + +WSJT Beta Version 3.6.2 +----------------------- +Version 3.6.2 corrects a problem that on a few machines caused a +fatal error that could only be corrected by deleting the initialization +file, WSJT361.INI. + + +WSJT Beta Version 3.6.1 +----------------------- +Version 3.6.1 corrects a problem that caused an immediate termination +on program startup on some users' machines (typically older ones). If +you need this upgrade, you need it bad! + +It also fixes a minor bug that could cause a divide-by-zero error if +you clicked on the plot area when no data was available to analyze. + + +WSJT Beta Version 3.6.0 +----------------------- + +The JT6M mode is only a week old, but many hundreds of QSOs have been +made with it all over the world. This mode is expressly designed for +meteor scatter on 6 meters, but it may be useful with some other +propagation modes as well. It has characteristics that place it about +midway between FSK441 and JT44 in both speed and sensitivity. A +second beta release of WSJT with JT6M, Version 3.6.0, is now available +for downloading at + + http://pulsar.princeton.edu/~joe/K1JT/UPD360.EXE + +The download file is about 0.75 MB in length. + + +Comparison of Versions 3.6.0 and 3.5.1 +-------------------------------------- + +1. Version 3.6.0 has a better and faster decoder for JT6M. Further +improvements in this area are still to come. + +2. Several bugs that could cause crashes in V3.5.1 have been fixed. +Version 3.6.0 appears to be quite stable (at least on my own +computers). + +3. Some buttons have been moved from their familiar positions. + +4. Gadgets that Microsoft calls "Up-Down Controls" have replaced the ++/- buttons used for various decoding parameters. + +5. You can now drag the mouse pointer across any portion of the large +plot area to cause decoding of that portion of a recorded file. This +works in both FSK441 and JT6M mode. The area you selected is marked +when the plot is refreshed. + +6. A yellow curve now appears above the green curve in JT6M mode. The +yellow line represents measured power received at the sync-tone +frequency and in the sync-tone intervals. + + +I haven't yet written up any detailed instructions for the JT6M mode. +However, if you are an experienced WSJT user you probably won't need +any. Here are a few things it will be helpful to know about JT6M. + +1. Like JT44, JT6M uses 44-tone FSK with a "sync tone" and 43 possible +data tones -- one for each character in the supported alphanumeric +set. The sync tone is at 1076.66 Hz, and the 43 other possible tones +are spaced at 21.53 HZ intervals up to 2002.59 Hz. The tones are +keyed at a rate of 21.53 baud, so each one lasts for 1/21.53 = 0.04644 +seconds. The sync tone is ON during every 3rd transmission interval; +tones representing two data characters follow each sync tone. The +transmission rate of user data is therefore (2/3)*21.53 = 14.4 +characters per second. The transmitted signal sounds a bit like +piccolo music. + +2. Basic operation is very similar to FSK441. Just select JT6M from +the WSJT "Mode" menu (or use "Shift-F7") and then proceed as usual. + +3. The green line and waterfall display have their usual meanings. + +4. The program attempts to decode both single pings and an "average +message". The average is the last line displayed during each decoding +attempt, and is flagged with an asterisk as in FSK441. The number to +the right of the asterisk is the inferred message length (for example, +the number should be 10 for the message "W8WN K1JT "). If the program +finds the wrong length, the average will be garbled or meaningless. +All message lengths should be even numbers, because odd-length +messages are padded with an extra space at transmission time in order +to make them even. + +5. Clicking with the left mouse button decodes a 4-second block of +data near the mouse pointer. The right button uses a longer segment +of 10 seconds. Drag the mouse with the button down to select any +desired region. Experiment for best decoding as necessary. + +6. As soon as you see some properly decoded text, set the DF box to +the measured DF and check the "Freeze" box. Alternatively, you can +set the Tolerance to a low value (say 25 Hz) after the desired signal +has been identified. Use RIT, if necessary, to bring subsequently +measured DF's down to a small value. + +7. Default settings for the decoder are S > -12 dB, Tol=400 Hz, DF=0 +Hz. + +8. JT6M can work with signals that are up to 13 dB weaker than those +required for FSK441. In the brief on-the-air tests I've made with +W8WN, we have both found that mouse-clicking on the smooth green line, +even where nothing was heard and nothing can be seen, sometimes causes +both callsigns to pop up out of the noise! + + +Version 3.0 +----------- + +A new major release of WSJT, Version 3.0, is now available for free +download. Instructions for upgrading and for complete installations +can be found at http://pulsar.princeton.edu/~joe/K1JT. + +What's new in Version 3.0? +-------------------------- + +1. The "User's Guide and Reference Manual" has grown to 51 well + illustrated pages. The new manual includes four major new + sections which together cover: + + a) the EME Echo mode, including the "Measure" sub-mode and the + "EME Calc" utility for estimating the strength of your echoes + from the moon; + b) the nature of the various astronomical calculations done within + WSJT, and a summary of their accuracies; + c) several pages describing availability of Fortran source code for + the DSP algorithms in WSJT, as well as a suite of test programs + for generating simulated data and testing the FSK441 and JT44 + encoding and decoding algorithms; + d) a short essay on possible future developments for WSJT. + +2. The astronomical calculations in WSJT have been overhauled and thoroughly + checked. In practice the differences from V2.9 will seem minor, but as + described in the new manual's Appendix B, the accuracies of + computed positions for the sun and moon, and for the EME Doppler + shift, are now well documented. Computed positions are accurate to + within about 0.04 degrees, and Doppler is better than 1 Hz at 144 + MHz. Exactly what is meant by the displayed data is now described + in the manual, as well. + +3. A new feature has been added on the Help menu. It pops up a screen + summarizing the standard message exchanges used for minimal QSOs + using FSK441 and JT44. No more excuses for not being sure about which + message you should send next! + +4. The Measure mode can now be left running indefinitely, with its output + written to a file. A few individuals have been wanting to use the + program for radio astronomy purposes, and the new version provides a + minimal facility for doing this. + +5. The display screen for the EME Calc utility has been cleaned and + tightened up. + +6. A few other small niceties, all minor in scope. + + +Version 2.9.0 +------------- + +I am pleased to announce the availability of an upgrade to WSJT +Version 2.9. The upgrade provides most of the features of the +soon-to-be-released Version 3.0; I am releasing it now as Version 2.9 +because many users have asked for early access to its new +capabilities. A full release of Version 3.0 must await some updating +of the Users Guide and Reference Manual. Probably a few additional +features will be added by then, as well. Please be patient! + +Version 2.9 is available only as an upgrade. As usual, it can be +downloaded from the WSJT web site, +http://pulsar.princeton.edu/~joe/K1JT, or from the European mirror +site http://www.dk5ya.de. New features of the program include the +following: + +1. EME Echo mode now works on certain computers (generally older, +slower ones) that previously refused to run Echo mode properly. The +new version runs fine under Windows 95 on my ancient 100 MHz Pentium +with 32 MB of RAM. + +2. A new feature known as "Measure" can be selected from the main +screen in EME Echo mode. Click the Measure button and your system +will record the received audio for one second, compute the level of +the noise and display the result in units of dB relative to the +nominal WSJT "0 dB" level. The program will repeat this measurement +cycle every 2 seconds and plot the results as a green line in the +graphical screen area. You can use this mode to measure Sun noise, +antenna temperature, ground noise, preamp gain, and a host of other +useful quantities, relative to a chosen reference level. + +3. A pop-up utility labeled "EME Calc" can be selected from the EME +Echo screen. It provides an easy way to predict whether you should be +able to detect your own echoes from the moon, as well as your ability +to work another station by EME. Boxes are provided to enter your TX +power, TX feedline loss, RX noise figure, RX feedline loss, antenna +gain, ground gain, ground noise, and sky temperature. Similar +quantities can be entered for a second station, and you must also +specify the operating frequency. When you click "Compute," the +program will calculate the maximum expected echo strengths for the +"Home Station" and the "DX Station" individually, as well as the +maximum expected signal strength of each station at the other +location. The program also estimates the averaging time that would be +required to detect echoes at the predicted signal level. + +Signal strengths are quoted relative to the WSJT standard, the noise +power in a 2500 Hz bandwidth. If the computed result for your echo +exceeds about -38 dB, you have a chance of being able to detect your +echoes using WSJT. In comparison, echoes are detectable by the human +ear only if they exceed about -14 dB on the same scale, or +equivalently +3 dB in a 50 Hz bandwidth. Note that the estimated +signal strengths are supposed to be the maximum values expected for +the specified conditions. There are many reasons (Faraday rotation, +ionospheric scintillation, libration fading, ...) why the actual +signal strength may be different, and deviations are much more likely +to be downward than upward. The predicted echo strength for my +present 144 MHz station at a reasonably good time of the month is +around -25 dB. My experience has been that the predictions are fairly +good if enough time is spent to be sure of catching a Faraday rotation +peak. + + +A number of smaller enhancements have been made in the EME Echo mode +of WSJT. These include the following: + +4. The program is much better behaved when operating at higher +frequencies, in particular 1296 MHz and above. If you fail to enter +an RIT setting or specify one that would make the return echo fall +outside the audio frequency range 900 - 2100 Hz, the program will +suggest a better RIT value for you to use. + +5. The amount of programmed frequency spread of your transmitted +signal (the "Dither" magnitude) can be set to any value in the range 0 +to 500 Hz. It defaults to 50 Hz. + +6. Instead of accumulating average echo parameters indefinitely, you +can set a parameter "Tavg" that specifies a time constant for +averaging. The default value is 5 minutes; at this setting the +average echo spectrum will build up as before for the first 5 minutes, +but thereafter it will track the signal characteristics over the most +recent 5 minutes. In other words, the average gradually "forgets" the +signals received more than Tavg minutes ago. Setting Tavg to a large +number, say 999 minutes, will closely approximate the program's +previous behavior. If you can detect your EME echoes easily and want +to see how they vary with time, you might set Tavg to 1 minute, start +a "Measure" sequence, and take down the signal level readings at one +minute intervals. + +7. Information sent to the main text window every 6 seconds now +accumulates, with the text window scrolling as necessary. The output +is also (optionally) written to file DECODED.CUM so that you can study +the data later. + + +Other miscellaneous improvements and bug fixes include the following: + +8. In JT44 mode, if the "Grid" box is left empty then no EME Doppler +shift will be displayed. + +9. The minimum "Dsec" increment has been reduced from 1 second to 0.5 +second. This will permit more precise on-the-fly correction of the +Windows clock for use by WSJT, should that be necessary. + +10. JT44 messages are always exactly 22 characters in length, and any +additional characters are ignored. To make this behavior more +obvious, any excess characters are now visibly removed from the screen +when transmission of a message begins. + +11. In Version 2.3.0, hitting the F4 key while in echo mode would +cause the program to crash. Fixed. + +12. Switching between modes could cause the Auto Period button to be +stuck in the disabled or "grayed out" state. Fixed. + +13. The last character in a manually edited FSK441 message was not +sent if the default trailing blank and "<" character were erased. +Fixed. + + +Version 2.3.0 +------------- + +This release of WSJT is the first to include the EME Echo mode. This +mode allows you to detect and measure your own lunar echoes, even if +they are far too weak to hear. The mode can be highly useful for +evaluating your station performance, even if you prefer to use CW +rather than JT44 for your EME QSOs. + +If you are a present user of WSJT with no interest in detecting and +measuring your EME echoes, you will find no significant advantages to +upgrading to WSJT Version 2.3.0. With the exception of a minor bug +fix, the FSK441 and JT44 modes are essentially unchanged. + +You can download the upgrade from the WSJT home page, +http://pulsar.princeton.edu/~joe/K1JT, and soon also from the European +mirror site http://www.vhfdx.de/wsjt. To upgrade an existing WSJT +installation of Version 1.9.4 or later you should download and execute +the file UPD230.EXE, which will replace your existing files WSJT.EXE +and WSJT1.DLL with new files of the same name. + +I have not yet produced a new full distribution of the latest version. +Doing this will require extensions to the User's Guide and Reference +Manual, and will probably be accompanied by further improvements to +the program. If you wish to do a full installation of Version 2.3.0 +from scratch you should download the installation file WSJT222.EXE, +run it to install Version 2.2.2, and then upgrade to Version 2.3.0 as +described above. + +Minor Bug Fix: In WSJT Version 2.2.2 and earlier, if you dismissed the +"Setup | Options" page by clicking on the "X" in the upper right +corner of the form, instead of by clicking the "Done" button, the home +station callsign ("My Call") would revert to its default value "K1JT". +(Contrary to popular opinion, this was not an subtle ploy designed to +increase my own VUCC totals; it was simply a coding mistake.) The bug +has now been fixed. + +EME Echo mode is presently a plain, no-frills implementation. You can +activate it from the Mode menu or by striking function key F9. Most +of the familiar WSJT buttons will then disappear from the screen, +leaving just a few that are essential for controlling the Echo mode. +If your station is already operational in the FSK441 and JT44 modes +and you have provided the proper signal levels, all you need to do for +an echo test is to start WSJT Version 2.3.0, hit F9 to switch to EME +Echo mode, aim your antenna at the moon, pick a clear frequency, and +toggle Auto Period On. The program will then start cycling through +the following loop: + +1. Transmit a fixed tone for 2.0 s +2. Wait about 0.5 s for the start of your echo +3. Record the received signal for 2.0 s +4. Analyze and plot the results +5. Repeat from step 1 + +The loop cycle time is 6 seconds, so the transmitter duty cycle is +only 2/6 or 33%. Your transmitter will think it is loafing. At the +start of each transmission the frequency of the transmitted tone is +randomly dithered by an offset up to +/- 100 Hz around a nominal value +of 1500 Hz. The programmed offset is removed from the computed +spectrum of each recording before it is added into the accumulating +average. This procedure helps to minimize the effect of birdies in +the receiver passband: in the average spectrum a fixed-frequency +birdie will be smeared out over a 200 Hz range, while the desired +signal remains sharply defined. + +Two curves are plotted in WSJT's main plot area during each pass +through the Tx/Rx loop. Each represents the spectrum of received +power over a 400 Hz range centered on the expected echo. The curve in +gray is a reference spectrum that you can use to be sure you have +chosen a reasonably birdie-free passband. It is aligned so as to +remove the EME doppler shift computed at the start of your run. The +alignment will not be subsequently adjusted for changes in doppler +shift or for the random dithering of the transmitted frequency. +Stable birdies will therefore stay fixed in the blue spectrum, making +them easy to recognize and evade if necessary. The red curve displays +the desired EME echo signal. Spectra computed for each 2-second +receive period are shifted to correct for changing doppler shift and +for the programmed frequency dithering, and are then averaged. The +EME echo should appear as a narrow spike near the middle of the red +curve, close to DF = 0. + +In addition to the graphical display, a line is presented in the WSJT +text window in the following form: + + N: 16 Sig: -26.3 dB DF: -1.3 Hz Width: 0.7 Hz Q: 9 + +This information gives the number N of Tx/Rx cycles that have been +averaged, the mean signal strength in dB, the measured frequency +offset of the detected echo from the expected frequency, the spectral +width of the echo, and a relative quality indicator for the detection +on a 0 - 10 scale. Signal strength is measured in the same units as +used in the FSK441 and JT44 modes, i.e., in dB relative to the +received noise power in a 2500 Hz bandwidth. Low values of Q +represent dubious detections, in which case the values of signal +strength, DF, and width may be meaningless. + +A note about doppler calculations will be helpful here. Most computer +programs in amateur EME stations use approximate formulae to compute +the position and distance of the moon and the expected doppler shifts +of echos. WSJT is no exception, and I cannot presently quote a firm +figure on the accuracy of its doppler calculations or describe how +their errors depend on lunar coordinates or the accuracy of your +station location. EME Echo mode uses a calculated doppler shift to +align received spectra so that the echo should appear at DF = 0. I +have found that on 2 meters the return signals generally fall within +10 Hz of DF = 0. Further improvements in accuracy of the doppler +routine will be forthcoming. + +If you can hear your own EME echoes you should see a spike in the red +curve within a few seconds after toggling Auto Period On. If your +echoes are 10-15 dB below the audible threshold you should see a +significant spike on the red curve within a few minutes. To give you +a better example of what to expect, consider the parameters of my +station. On 2 meters I run up to 400 Watts to a 17.6 dBd antenna (4 x +9 el yagis) aimed at the horizon. I have never heard my own CW echoes +with this system. However, when the moon is in my elevation window at +0 - 10 degrees I can easily detect my echoes at any time of the month +using WSJT in its EME Echo mode. Indeed, I can turn off the PA and +use my FT-847 barefoot, delivering 35 W to the antenna, and still +detect my echoes rather easily, even with the moon in a "bad" part of +the sky and the path degradation as large as -8 dB. I seem to be able +to detect my echoes reliably down to relative signal levels around -36 +dB. + +The spectral analysis done in EME Echo mode provides a frequency +resolution of 0.67 Hz. If your transmitter or receiver has short-term +frequency stability much worse than this value, so that something +drifts or wobbles by more than about 1 Hz in 2 seconds, your echo +sensitivity will be degraded. Most modern radios have no difficulty +in meeting this standard on the 6 and 2 meter bands, but the higher +UHF and microwave bands will be more problematic. I don't have enough +experience to know what the spectral width of an echo on the 432 MHz +or 1296 MHz band should be after averaging for a few minutes. I have +been measuring widths of 2 Hz or less on 2 meters. + +By default WSJT will assume that your receiver and transmitter are +tuned to the same frequency. An on-screen box labeled "RIT (Hz)" is +provided so that you can inform the program of any offset receiver +tuning, for example to accommodate a large doppler shift. Suppose you +are running a test on 70 cm and the predicted doppler shift at the +start of the run is -1087 Hz. That would cause echoes from the 1400 - +1600 Hz transmitted audio tone to come back as low as 313 Hz, probably +well below the low-frequency cutoff in your receiver's passband. Use +your transceiver's RIT control to offset the receiver tuning by some +round number within a few hundred Hz of the predicted value -- say +-1000 Hz in this example -- and enter this offset in the RIT box +before starting the echo measurement. The program will accommodate +subsequent changes in the doppler shift up to 800 Hz or so, if +necessary, without any further adjustments. Your echo should appear +at the center of the red curve, as usual. You won't need to use +the RIT feature on 6 or 2 meters, where doppler shifts are much +smaller and echoes always fall well within the receiver's SSB +passband. + +Please note that I have so far tested the EME Echo mode only on 2 +meters. You will discover that the software implementation is not yet +highly polished; a number of improvements are already in the works, +but I want to gain the advantage of feedback from other users before I +go too much further. If you use the EME Echo mode -- especially on +bands other than 2 meters -- please send me your comments, +experiences, and suggestions! I am anxious to know how well it works +for you. + + +Version 2.2.2 +------------- + +This is a minor maintenance release. As usual, you can download it +from the WSJT web page, http://pulsar.princeton.edu/~joe/K1JT. In +addition to a short update file, UPD222.EXE, a full distribution of +WSJT Version 2.2.2 is available as WSJT222.EXE. + +I had thought that Version 2.2.1 had already fixed a sometimes +baffling bug appearing in earlier versions: if WSJT was terminated +when in its "minimized" state, it could get "stuck" on your Windows +taskbar and refuse to return to a full size display. + +It's not always easy for me to test program revisions on all available +versions of Windows, and it seems that the V2.2.1 fix did not solve +the problem on at least some versions of Windows 98. This time, with +V2.2.2, I believe it's *really* fixed! + +If WSJT is stuck in the minimized state you should fix it as follows, +and then upgrade to Version 2.2.2: + + A) Start WSJT. It should appear in minimized form on the taskbar at + the bottom of your screen. + + B) Right-click on the WSJT taskbar label and select "Move". + + C) Press the "left arrow" and/or "up arrow" keys a few times and + then move the mouse. You should start to see a "dotted frame" + indicating the location of the WSJT screen. + + D) Click the left mouse button, and you should be back in business. + +Then you should download and install UPD222.EXE and upgrade your +system to Version 2.2.2. + + +Version 2.2.1 +------------- + +This is a minor maintenance release. You can download it from the +WSJT web page, http://pulsar.princeton.edu/~joe/K1JT. In addition to +the short update file, a new full distribution of WSJT Version 2.2.1 +is available, as well as a new version of the manual addressing the +new program features. + +As always, I will be pleased to receive comments and suggestions at +email address k1jt@arrl.net. Please note, however, that I will be on +vacation and not reading email from July 7 through 21. + +Version 2.2.1 fixes the following minor bugs in Version 2.2.0: + +1. When first started without a valid INI file, the v2.2.0 would fail +to "Generate Std Messages" when asked to do so. Once you have +switched modes, say from FSK441 to JT44, the program worked correctly. + +2. Local hour angles greater than 180 degrees are now displayed as +negative angles. + +3. If you did not check the menu item "File | Save text in File +DECODED.CUM", the v2.2.0 would create an unwanted file named "fort.21" +and write all decoded JT44 text there. + +4. If WSJT was terminated when in the "minimized" state, it could get +"stuck" on your Windows taskbar. If you are stuck in this mode you +should fix it as follows, and then upgrade to Version 2.2.1: + + A) Start WSJT. It should appear in minimized form on the taskbar at + the bottom of your screen. + + B) Right-click on the WSJT taskbar label and select "Move". + + C) Press the "left arrow" and/or "up arrow" keys a few times and + then move the mouse. You should start to see a "dotted frame" + indicating the location of the WSJT screen. + + D) Click the left mouse button, and you should be back in business. + + +Version 2.2.0 +------------- + +WSJT Version 2.2.0 provides several significant enhancements, a number +of smaller improvements, and four minor bug fixes. + +To upgrade to v2.2.0 you should download the self-extracting zip file +UPD220.EXE and execute it to extract its contents, directing the +resulting files to your WSJT installation folder. + +The new version includes the following changes: + +1. The JT44 mode now has an adjustable parameter called "Clip." It +can be controlled with +/- buttons just below analogous ones for the +"Sync" parameter. The value of Clip defaults to 0, where it has no +effect. By increasing Clip to 1, 2, or 3 you can introduce "soft," +"moderate," or "hard" clipping of any sudden increases in signal +strength that might ruin the decoding of an otherwise usable signal. +I have found that setting Clip to 2 or 3 permits me to use JT44 in the +presence of summertime QRN that renders v2.0.1 useless. Clipping also +helps to accommodate occasional meteor pings in a JT44 QSO, recovering +the program's ability to synchronize on a weak residual signal. You +can leave the clipping turned on; note, however, that using hard +clipping on a signal that does not require it can cost you about 1 dB +in message S/N. I recommend generally leaving Clip set to 0 and +increasing it only when necessary. + +2. JT44 mode has a new checkbox labeled "Zap Birdies." It does just +what you would hope such a command would do -- and it can turn a +totally spoiled signal into good copy! (In the upgrade file I've +included an example wave file recorded via EME from W7FG, in the +presence of a strong birdie at my station. To become a believer, try +decoding this file both with and without "Zap Birdies" checked. He +was sending me the message "K1JT W7FG EM26 ".) + +The Zap algorithm works best with birdies that are steady in both +amplitude and frequency. A sure indicator that you have a birdie +problem is a persistent extra spike (or spikes) in the red-line plot, +in addition to the one corresponding to the JT44 sync tone. If the +birdie is higher in frequency than the sync tone by 20 to 465 Hz, you +will probably see a number of identical garbage characters in the line +of decoded text. If this happens, check the "Zap Birdies" box and hit +"Decode Again", and your copy should improve. It will work best if +you have already identified the correct value of DF and checked the +"Freeze" box to lock onto the Sync tone. + +Do not expect miracles! Keeping birdies out of your receiver or +QSYing to avoid them will always work better than trying to deal with +them in software. Nevertheless, this birdie-killer can make the +difference between a successful QSO and one that fails miserably. + +3. The JT44 mode has a second new checkbox labeled "Fold Msg." For +messages having identical content in the first and second half, this +feature can yield a signal-to-noise improvement of 1.5 dB. The JT44 +default message formats have been modified slightly to maximize the +opportunities for useful message folding. For example, if K1AA is +working G2ZZ, the first EME-style message will now be generated as +"G2ZZ K1AA G2ZZ K1AA ". (Notice the two spaces in the middle of the +message and at the end.) If the "Fold Msg" box is checked, the +message will be decoded simply as "G2ZZ K1AA ". Try decoding a +marginal signal both with and without the "Fold Msg" box checked. QSB +conditions might make one or the other preferable at a particular time. + +4. In WSJT versions 2.0.0 and 2.0.1 the JT44 decode algorithm produces +a single-character average of the last four character positions in a +message. In Version 2.2.0 the averaging limit has been changed to +equal the number of "O" characters (for EME messages) or "R" +characters (for non-EME messages) at the trailing end of default TX +message #2. For example, if clicking "Generate Std Texts" produces +"G2ZZ K1AA OOOOOOOOOOOO" for message #2, the program will produce a +single-character average based on the last 12 received character +positions. This choice gives you the best possible chance of properly +decoding an "O" or "R" report in message #2, and it also gives you a +good chance at snagging the "RRRRRRRRRRRRRRRRRRRRRR" message under +very marginal conditions. For steady signals the procedure can yield +a 5.4 dB S/N advantage over single characters and a 2.4 dB advantage +over the four-character average. + +5. WSJT now remembers whether you were using FSK441 or JT44 mode when +you last exited the program. On startup it restores the most recently +used mode, including values of W, S, and Sync, as appropriate. + +6. All decoded text in JT44 mode is now written to the cumulative file +DECODED.CUM. In previous versions of WSJT, text was saved only in +FSK441 mode. + +7. The default Sync setting in JT44 mode is now 1 rather than 2. +I believe nearly everybody runs with Sync = 1. + +8. WSJT v2.2.0 is more complete and more consistent about saving +information about the starting directory and the form size of the +"File | Open" dialog box. + +9. The displayed azimuths for "Hot A" and "Hot B" (direction headings +to use for optimal sporadic meteor reflections) now wrap correctly at +0 and 360 degrees. You will no longer see, for example, values like +368 or -8 degrees if you are working someone to your north. + +10. In JT44 mode the program now displays the local hour angle of the +Moon, in degrees. You will appreciate this if you have a polar +mounted EME array. + +11. The UTC Offset may now be specified as a floating-point number -- +that is, with significant digits after a decimal point. + +12. The count of available records displayed in the average message +window behaved illogically when "Decode Again" and "Include" were used. +This has been fixed. + +13. There was a bug in the JT44 display routine that caused error +messages to appear when the moon's right ascension was very close to +00:00. The error could appear at most once a month, and it would +persist for an hour or so. The bug has been fixed. + +14. There was an apparent logical inconsistency in program behavior if +"Exclude" was clicked after "Clear Avg" had been executed. This has +been fixed. + +15. In V2.0.1 if you hit F8 more than once and then hit F7, the +"Width" parameter in FSK441 mode would be set to 200 ms. This has +been fixed. + + +Version 2.0.1 +------------- +This is a minor maintenance release. Principal changes from Version +2.0 include the following: + +1. The installation scripts for both the full installation and the + upgrade to v2.0.1 are more robust and much easier to use. + +2. The decoding parameters for FSK441 mode are saved correctly after + you have used JT44 mode. + +3. The controls for "Decode Again", "Include", and "Exclude" are now + fully available during the Tx period. + +4. Certain colors (e.g., the backgrounds of a few labels) now display + better on older machines. + +5. The background colors behind certain Tx messages in JT44 mode + have been corrected. + +6. The manual has been updated to conform with the new installation + scripts, and a number of other small changes (mostly correcting + typos) have been made. + +7. The Tab key now moves the focus between various on-screen controls + and text boxes in a rational way. + +Version 2.0 +----------- + +A major new release of WSJT, Version 2.0 is now available for free +download. Instructions for upgrading and for new installations can be +found at http://pulsar.princeton.edu/~joe/K1JT. + +What's new in Version 2.0 ? +-------------------------- + +The JT44 mode for extreme weak signal work was first introduced in +beta release 1.8.0. This mode has now matured, the program is stable, +and tons of EME QSOs (among others) are being made with it. New +features and fixes in Version 2.0 include the following: + +1. Full monitor mode with separate averaging of 1st and 2nd sequences. + +2. Mouse-selected value of DF for decoding when "Freeze" is checked. + +3. Program is much faster at certain critical points, and now runs + reliably on a 75 MHz Pentium with 24 MB of RAM. + +4. The dreaded "always starts minimized" bug has been fixed. + +5. Certain dates (such as "2002 VIII 21" now display properly in + machines configured for European format. + +7. A number of other small niceties. diff --git a/pfxdump.f b/pfxdump.f index dc7dbf00f..17ae83c67 100644 --- a/pfxdump.f +++ b/pfxdump.f @@ -3,10 +3,10 @@ include 'pfx.f' open(11,file=fname,status='unknown') - write(11,1001) pfx - 1001 format('Supported Add-on Prefixes:'/90('_')/(15(a5,1x))) - write(11,1002) sfx - 1002 format(/'Supported Suffixes:'/44('_')/(11('/',a1,2x))) + write(11,1001) sfx + 1001 format('Supported Suffixes:'/(11('/',a1,2x))) + write(11,1002) pfx + 1002 format(/'Supported Add-On DXCC Prefixes:'/(15(a5,1x))) close(11) return diff --git a/wsjt.py b/wsjt.py index defeeea33..655425805 100644 --- a/wsjt.py +++ b/wsjt.py @@ -773,10 +773,27 @@ def prefixes(event=NONE): if g.Win32: pfx.iconbitmap("wsjt.ico") f=open(appdir+'/prefixes.txt','r') s=f.readlines() + t2="" + for i in range(4): + t2=t2+s[i] t="" - for i in range(len(s)): - t=t+s[i] - Label(pfx,text=t,justify=LEFT).pack(padx=20) + for i in range(len(s)-4): + t=t+s[i+4] + t=t.split() + t.sort() + t1="" + n=0 + for i in range(len(t)): + t1=t1+t[i]+" " + n=n+len(t[i])+2 + if n>60: + t1=t1+"\n" + n=0 + t1=t1+"\n" + if options.addpfx.get().lstrip(): + t1=t1+"\nOptional prefix: "+(options.addpfx.get().lstrip()+' ')[:4] + t2=t2+"\n"+t1 + Label(pfx,text=t2,justify=LEFT).pack(padx=20) pfx.focus_set() #------------------------------------------------------ azdist @@ -1620,7 +1637,8 @@ helpbutton['menu'] = helpmenu helpmenu.add('command', label = 'Keyboard shortcuts', command = shortcuts) helpmenu.add('command', label = 'Special mouse commands', command = mouse_commands) helpmenu.add('command', label = 'What message to send?', command = what2send) -helpmenu.add('command', label = 'Add-on prefix list', command = prefixes) +helpmenu.add('command', label = 'Available suffixes and add-on prefixes', \ + command = prefixes) helpmenu.add('command', label = 'About WSJT', command = about) #------------------------------------------------------ Graphics areas From e4d62536d7e18d7494dba39ef0ac66c2e438aa8b Mon Sep 17 00:00:00 2001 From: J C Dutton Date: Sat, 28 Jan 2006 14:58:55 +0000 Subject: [PATCH 084/811] Summary: Improve accuracy of capture timestamps. The time stamps should be accurate to within about +-1ms now. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@120 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_alsa.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/start_alsa.c b/start_alsa.c index 824ef477b..4174a26a9 100644 --- a/start_alsa.c +++ b/start_alsa.c @@ -391,6 +391,7 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { struct timeval tv; double stime; int ib; + snd_pcm_sframes_t delay; #ifdef ALSA_CAPTURE_LOG printf("capture callback %d samples\n", this->period_size); #endif @@ -400,12 +401,16 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { snd_pcm_status(this->audio_fd, pcm_stat); snd_pcm_status_dump(pcm_stat, jcd_out); #endif + snd_pcm_delay(this->audio_fd, &delay); gettimeofday(&tv, NULL); stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + *(this->ndsec) * 0.1; + stime = stime - ((double)delay / (double)(this->output_sample_rate)); *(this->Tsec) = stime; ib=*(this->ibuf); - this->tbuf[ib++] = stime; + this->tbuf[ib] = stime; + //printf("CAP:TIME, %d, %lf, %ld, %ld, %d\n",ib, stime, delay, this->output_sample_rate, *this->ndsec); + ib++; if(ib>=1024) ib = 0; *(this->ibuf) = ib; From 45a1950e3a706a2f42703bf70556c07b8b19ccb3 Mon Sep 17 00:00:00 2001 From: J C Dutton Date: Sat, 28 Jan 2006 15:08:27 +0000 Subject: [PATCH 085/811] Summary: Provides more accurate playback timing. timestamp should be accurate to +-1ms now. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@121 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_alsa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/start_alsa.c b/start_alsa.c index 4174a26a9..97529a5f5 100644 --- a/start_alsa.c +++ b/start_alsa.c @@ -329,14 +329,18 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { int nsec; int i,n; static int ic; + snd_pcm_sframes_t delay; static short int n2; int16_t b0[2048]; // printf("playback callback\n"); + snd_pcm_delay(this->audio_fd, &delay); gettimeofday(&tv, NULL); stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + *(this->ndsec) * 0.1; + stime = stime + ((double)delay / (double)(this->output_sample_rate)); *(this->Tsec) = stime; + //printf("PLAY:TIME, %lf, %ld, %ld, %d\n", stime, delay, this->output_sample_rate, *this->ndsec); if(!(this->tx_starting) && (*(this->tx_ok)) ) { nsec = (int)stime; n = nsec / *(this->tr_period); From 54b6100378c3cbfc57e6a08fcf2d9d3abcd2d1b3 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 30 Jan 2006 16:06:57 +0000 Subject: [PATCH 086/811] - I noticed I got the c vs. fortran indexing wrong after explaining it ;-) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@122 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/start_oss.c b/start_oss.c index 282e16a44..67829c0e2 100644 --- a/start_oss.c +++ b/start_oss.c @@ -228,11 +228,11 @@ oss_loop(int *iarg) /* increment buffer pointers only if data available */ ia=*(data.iwrite); ib=*(data.ibuf); - data.tbuf[ib++] = stime; - if(ib>=FRAMESPERBUFFER) - ib=0; + data.tbuf[ib-1] = stime; /* convert to c index to store */ + if(ib>FRAMESPERBUFFER) + ib=1; *(data.ibuf) = ib; - in = (int16_t *)rcv_buf; // XXX + in = (int16_t *)rcv_buf; /* XXX */ for(i=0; i Date: Mon, 30 Jan 2006 16:08:30 +0000 Subject: [PATCH 087/811] - oops forgot to increment ib git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@123 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 1 + 1 file changed, 1 insertion(+) diff --git a/start_oss.c b/start_oss.c index 67829c0e2..92fa25b29 100644 --- a/start_oss.c +++ b/start_oss.c @@ -229,6 +229,7 @@ oss_loop(int *iarg) ia=*(data.iwrite); ib=*(data.ibuf); data.tbuf[ib-1] = stime; /* convert to c index to store */ + ib++ if(ib>FRAMESPERBUFFER) ib=1; *(data.ibuf) = ib; From 96821117a34fcfa8dae0fa0f92d2b2218d4127a1 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 5 Feb 2006 16:09:33 +0000 Subject: [PATCH 088/811] Fixed logic for toggling focus between windows after SpecJT is restarted. Enlarged Doppler field width in azel.dat. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@124 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- astro0.f90 | 2 +- specjt.py | 1 + wsjt.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/astro0.f90 b/astro0.f90 index ca816022a..8d7d39d14 100644 --- a/astro0.f90 +++ b/astro0.f90 @@ -110,7 +110,7 @@ subroutine astro0(nyear,month,nday,uth8,nfreq,grid,cauxra,cauxdec, & 1010 format(i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Moon'/ & i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Sun'/ & i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Source'/ & - i4,',',f6.1,',',f6.2,',',f6.1,',',f6.2,',Doppler') + i4,',',f7.1,',',f7.2,',',f7.1,',',f7.2,',Doppler') rewind 14 isec0=isec endif diff --git a/specjt.py b/specjt.py index ed10e513b..c59ecf86d 100644 --- a/specjt.py +++ b/specjt.py @@ -23,6 +23,7 @@ def hidespecjt(): def showspecjt(): root.deiconify() g.showspecjt=2 + g.focus=1 if(__name__=="__main__"): root = Tk() diff --git a/wsjt.py b/wsjt.py index 655425805..9f775422c 100644 --- a/wsjt.py +++ b/wsjt.py @@ -108,8 +108,8 @@ def showspecjt(event=NONE): else: g.focus=2 else: - g.focus=2 g.showspecjt=1 + g.focus=2 #------------------------------------------------------ restart def restart(): @@ -681,7 +681,7 @@ Shift-F8 Set JT65B mode CTRL-F8 Set JT65C mode Shift-CTRL-F8 Set CW mode F9 Set EME Echo mode -F10 Display waterfall screen +F10 Toggle focus between WSJT screens Alt-1 to Alt-6 Tx1 to Tx6 Alt-A Toggle Auto On/Off Alt-D Decode From 7360bd291d59ded71adf64d0eac326f10edc294d Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 5 Feb 2006 16:13:27 +0000 Subject: [PATCH 089/811] Removed the "delay" additions to "stime"; kept "delay" for potential future use. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@125 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_alsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start_alsa.c b/start_alsa.c index 97529a5f5..af62504e8 100644 --- a/start_alsa.c +++ b/start_alsa.c @@ -338,7 +338,7 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { gettimeofday(&tv, NULL); stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + *(this->ndsec) * 0.1; - stime = stime + ((double)delay / (double)(this->output_sample_rate)); + // stime = stime + ((double)delay / (double)(this->output_sample_rate)); *(this->Tsec) = stime; //printf("PLAY:TIME, %lf, %ld, %ld, %d\n", stime, delay, this->output_sample_rate, *this->ndsec); if(!(this->tx_starting) && (*(this->tx_ok)) ) { @@ -409,7 +409,7 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { gettimeofday(&tv, NULL); stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + *(this->ndsec) * 0.1; - stime = stime - ((double)delay / (double)(this->output_sample_rate)); + // stime = stime - ((double)delay / (double)(this->output_sample_rate)); *(this->Tsec) = stime; ib=*(this->ibuf); this->tbuf[ib] = stime; From 6a1b1979405ccc57e10acfd587df99df06f45ed4 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 5 Feb 2006 16:45:39 +0000 Subject: [PATCH 090/811] Added one more column to Doppler fields in azel.dat. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@126 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- astro0.f90 | 2 +- wsjt.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/astro0.f90 b/astro0.f90 index 8d7d39d14..a529331b6 100644 --- a/astro0.f90 +++ b/astro0.f90 @@ -110,7 +110,7 @@ subroutine astro0(nyear,month,nday,uth8,nfreq,grid,cauxra,cauxdec, & 1010 format(i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Moon'/ & i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Sun'/ & i2.2,':',i2.2,':',i2.2,',',f5.1,',',f5.1,',Source'/ & - i4,',',f7.1,',',f7.2,',',f7.1,',',f7.2,',Doppler') + i4,',',f8.1,',',f8.2,',',f8.1,',',f8.2,',Doppler') rewind 14 isec0=isec endif diff --git a/wsjt.py b/wsjt.py index 9f775422c..fd1b8ee13 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#--------------------------------------------------------------- WSJT +#---------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 2ff7ea75161065b93fdb39ff15f66c539c712d36 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 20 Feb 2006 20:46:33 +0000 Subject: [PATCH 091/811] - Check for missing f2py git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@127 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 14 ++++++++++---- configure.ac | 7 ++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/configure b/configure index b3f32868f..41f532230 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 5.9.2. # -# $Id: configure.ac 110 2006-01-15 23:32:39Z va3db $ +# $Id: configure.ac 113 2006-01-16 02:07:25Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -926,7 +926,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 110 2006-01-15 23:32:39Z va3db $ +$Id: configure.ac 113 2006-01-16 02:07:25Z va3db $ _ACEOF exit 0 fi @@ -5919,6 +5919,11 @@ echo "$as_me: error: You need samplerate.h to use --enable-portaudio" >&2;} fi fi +if test "$F2PY" = ""; then + { { echo "$as_me:$LINENO: error: You are missing f2py" >&5 +echo "$as_me: error: You are missing f2py" >&2;} + { (exit 1); exit 1; }; } +fi CPPFLAGS="${CPPFLAGS}" @@ -5926,7 +5931,6 @@ LDFLAGS="${LDFLAGS}" -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 @@ -6425,7 +6429,6 @@ do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; @@ -6763,6 +6766,9 @@ if test "$no_create" != yes; then $ac_cs_success || { (exit 1); exit 1; } fi +ac_config_files="$ac_config_files Makefile" + + echo echo diff --git a/configure.ac b/configure.ac index e33114e20..b072e4cb3 100644 --- a/configure.ac +++ b/configure.ac @@ -314,13 +314,18 @@ if test "$portaudio" = yes; then fi fi +if test "$F2PY" = ""; then + AC_MSG_ERROR([You are missing f2py]) +fi dnl AC_SUBST(CPPFLAGS, "${CPPFLAGS}") AC_SUBST(LDFLAGS, "${LDFLAGS}") AC_SUBST(CFLAGS) -AC_OUTPUT([Makefile]) +AC_OUTPUT +AC_CONFIG_FILES(Makefile) + dnl do summary echo From 2afb8ca51453ce988de2ea20606a6f342245734e Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 20 Feb 2006 20:47:12 +0000 Subject: [PATCH 092/811] - Use correct filenames for lp ports git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@128 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ptt_unix.c b/ptt_unix.c index 13af97dce..9a3faf158 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -341,9 +341,9 @@ lp_ptt (int fd, int onoff) * the WSJT.INI instead but for now this should work -- db */ #ifdef BSD -#define LPNAME "/dev/lpt%d" +#define LPNAME "lpt%d" #else -#define LPNAME "/dev/lp%d" +#define LPNAME "lp%d" #endif #define LPNAME_SIZE (sizeof(LPNAME)) From b12462613865ee578a924fae15fc20c3a593e342 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 21 Mar 2006 15:08:20 +0000 Subject: [PATCH 093/811] For data read from disk, ndecoding is set to 4 only after spec completes. This seems to fix program crashes on CPUs with hyperthreading enabled. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@129 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- audio_init.f90 | 4 ++-- getfile.f90 | 2 -- spec.f90 | 1 + wsjt.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/audio_init.f90 b/audio_init.f90 index bc288cfcf..ff6cd46b0 100644 --- a/audio_init.f90 +++ b/audio_init.f90 @@ -58,12 +58,12 @@ subroutine audio_init(ndin,ndout) m0=SetPriorityClass(GetCurrentProcess(),NORMAL_PRIORITY_CLASS) ! Start a thread for doing A/D and D/A with sound card. - Thread1=CreateThread(0,0,a2d,0,CREATE_SUSPENDED,id) + Thread1=CreateThread(0,0,a2d,0,CREATE_SUSPENDED,id1) m1=SetThreadPriority(Thread1,THREAD_PRIORITY_ABOVE_NORMAL) m2=ResumeThread(Thread1) ! Start a thread for background decoding. - Thread2=CreateThread(0,0,decode1,0,CREATE_SUSPENDED,id) + Thread2=CreateThread(0,0,decode1,0,CREATE_SUSPENDED,id2) m3=SetThreadPriority(Thread2,THREAD_PRIORITY_BELOW_NORMAL) m4=ResumeThread(Thread2) #else diff --git a/getfile.f90 b/getfile.f90 index 3f7578faa..26a1b0e93 100644 --- a/getfile.f90 +++ b/getfile.f90 @@ -83,8 +83,6 @@ subroutine getfile(fname,len) endif mousebutton=0 - ndecoding=4 - go to 999 998 ierr=1001 diff --git a/spec.f90 b/spec.f90 index cd07c1e84..0b24027e5 100644 --- a/spec.f90 +++ b/spec.f90 @@ -205,5 +205,6 @@ subroutine spec(brightness,contrast,logmap,ngain,nspeed,a) enddo 900 continue + if(ndiskdat.eq.1) ndecoding=4 return end subroutine spec diff --git a/wsjt.py b/wsjt.py index fd1b8ee13..9f44e186c 100644 --- a/wsjt.py +++ b/wsjt.py @@ -15,7 +15,7 @@ from types import * import array root = Tk() -Version="5.9.3 r" + "$Rev$"[6:-1] +Version="5.9.4 r" + "$Rev$"[6:-1] print "******************************************************************" print "WSJT Version " + Version + ", by K1JT" print "Revision date: " + \ From 74c44596fdfbaaddf194059522c74fca49ba34d3 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 22 Mar 2006 13:51:17 +0000 Subject: [PATCH 094/811] Add xfft2: quick kludge to avoid re-entrancy problem, since xfft is called by spec in the GUI thread. Don't use "zero" in spec. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@130 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.win | 2 +- horizspec.f90 | 2 +- spec.f90 | 10 ++- wsjt.py | 2 +- xfft2.f | 184 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 194 insertions(+), 6 deletions(-) create mode 100644 xfft2.f diff --git a/Makefile.win b/Makefile.win index 0206ddac0..980ac0286 100644 --- a/Makefile.win +++ b/Makefile.win @@ -36,7 +36,7 @@ SRCS2F77 = wsjt1.f avesp2.f bzap.f spec441.f spec2d.f mtdecode.f \ limit.f lpf1.f deep65.f morse.f nchar.f packcall.f packgrid.f \ packmsg.f packtext.f setup65.f short65.f slope.f spec2d65.f \ sync65.f unpackcall.f unpackgrid.f unpackmsg.f unpacktext.f \ - xcor.f xfft.f wsjt65.f astro.f azdist.f coord.f dcoord.f \ + xcor.f xfft.f xfft2.f wsjt65.f astro.f azdist.f coord.f dcoord.f \ deg2grid.f dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f \ moon2.f MoonDop.f sun.f toxyz.f pfxdump.f diff --git a/horizspec.f90 b/horizspec.f90 index e551f2a18..0ff302411 100644 --- a/horizspec.f90 +++ b/horizspec.f90 @@ -36,7 +36,7 @@ subroutine horizspec(x,brightness,contrast,a) do i=1,nfft y(i)=1.4*x(i+i0) enddo - call xfft(y,nfft) + call xfft2(y,nfft) nq=nfft/4 do i=1,nq ss(i)=real(c(i))**2 + imag(c(i))**2 diff --git a/spec.f90 b/spec.f90 index 0b24027e5..65e7a7e60 100644 --- a/spec.f90 +++ b/spec.f90 @@ -36,7 +36,9 @@ subroutine spec(brightness,contrast,logmap,ngain,nspeed,a) save if(first) then - call zero(ss,nq) + do i=1,nq + ss(i)=0. + enddo istep=2205 nfft=4096 nq=nfft/4 @@ -136,7 +138,7 @@ subroutine spec(brightness,contrast,logmap,ngain,nspeed,a) go to 900 endif - call xfft(x,nfft) + call xfft2(x,nfft) do i=1,nq !Accumulate power spectrum ss(i)=ss(i) + real(c(i))**2 + imag(c(i))**2 @@ -167,7 +169,9 @@ subroutine spec(brightness,contrast,logmap,ngain,nspeed,a) enddo nsum=0 newdat=1 !Flag for new spectrum available - call zero(ss,nq) !Zero the accumulating array + do i=1,nq !Zero the accumulating array + ss(i)=0. + enddo if(jz.lt.300) jz=jz+1 endif diff --git a/wsjt.py b/wsjt.py index 9f44e186c..7d2eb317d 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#---------------------------------------------------------------- WSJT +#----------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/xfft2.f b/xfft2.f new file mode 100644 index 000000000..0eae674a5 --- /dev/null +++ b/xfft2.f @@ -0,0 +1,184 @@ + SUBROUTINE xfft2(DATA,NB) +c +c the cooley-tukey fast fourier transform in usasi basic fortran +c +C .. Scalar Arguments .. + INTEGER NB +C .. +C .. Array Arguments .. + REAL DATA(NB+2) +C .. +C .. Local Scalars .. + REAL DIFI,DIFR,RTHLF,SUMI,SUMR,T2I,T2R,T3I,T3R,T4I, + + T4R,TEMPI,TEMPR,THETA,TWOPI,U1I,U1R,U2I,U2R,U3I,U3R, + + U4I,U4R,W2I,W2R,W3I,W3R,WI,WR,WSTPI,WSTPR + INTEGER I,I2,IPAR,J,K1,K2,K3,K4,KDIF,KMIN, + + KSTEP,L,LMAX,M,MMAX,NH +C .. +C .. Intrinsic Functions .. + INTRINSIC COS,MAX0,REAL,SIN +C .. +C .. Data statements .. + DATA TWOPI/6.2831853071796/,RTHLF/0.70710678118655/ +c +c 1. real transform for the 1st dimension, n even. method-- +c transform a complex array of length n/2 whose real parts +c are the even numbered real values and whose imaginary parts +c are the odd numbered real values. separate and supply +c the second half by conjugate symmetry. +c + + NH = NB/2 +c +c shuffle data by bit reversal, since n=2**k. +c + J = 1 + DO 131 I2 = 1,NB,2 + IF (J-I2) 124,127,127 + 124 TEMPR = DATA(I2) + TEMPI = DATA(I2+1) + DATA(I2) = DATA(J) + DATA(I2+1) = DATA(J+1) + DATA(J) = TEMPR + DATA(J+1) = TEMPI + 127 M = NH + 128 IF (J-M) 130,130,129 + 129 J = J - M + M = M/2 + IF (M-2) 130,128,128 + 130 J = J + M + 131 CONTINUE + +c +c main loop for factors of two. perform fourier transforms of +c length four, with one of length two if needed. the twiddle factor +c w=exp(-2*pi*sqrt(-1)*m/(4*mmax)). check for w=-sqrt(-1) +c and repeat for w=w*(1-sqrt(-1))/sqrt(2). +c + IF (NB-2) 174,174,143 + 143 IPAR = NH + 144 IF (IPAR-2) 149,146,145 + 145 IPAR = IPAR/4 + GO TO 144 + + 146 DO 147 K1 = 1,NB,4 + K2 = K1 + 2 + TEMPR = DATA(K2) + TEMPI = DATA(K2+1) + DATA(K2) = DATA(K1) - TEMPR + DATA(K2+1) = DATA(K1+1) - TEMPI + DATA(K1) = DATA(K1) + TEMPR + DATA(K1+1) = DATA(K1+1) + TEMPI + 147 CONTINUE + 149 MMAX = 2 + 150 IF (MMAX-NH) 151,174,174 + 151 LMAX = MAX0(4,MMAX/2) + DO 173 L = 2,LMAX,4 + M = L + IF (MMAX-2) 156,156,152 + 152 THETA = -TWOPI*REAL(L)/REAL(4*MMAX) + WR = COS(THETA) + WI = SIN(THETA) + 155 W2R = WR*WR - WI*WI + W2I = 2.*WR*WI + W3R = W2R*WR - W2I*WI + W3I = W2R*WI + W2I*WR + 156 KMIN = 1 + IPAR*M + IF (MMAX-2) 157,157,158 + 157 KMIN = 1 + 158 KDIF = IPAR*MMAX + 159 KSTEP = 4*KDIF + IF (KSTEP-NB) 160,160,169 + 160 DO 168 K1 = KMIN,NB,KSTEP + K2 = K1 + KDIF + K3 = K2 + KDIF + K4 = K3 + KDIF + IF (MMAX-2) 161,161,164 + 161 U1R = DATA(K1) + DATA(K2) + U1I = DATA(K1+1) + DATA(K2+1) + U2R = DATA(K3) + DATA(K4) + U2I = DATA(K3+1) + DATA(K4+1) + U3R = DATA(K1) - DATA(K2) + U3I = DATA(K1+1) - DATA(K2+1) + U4R = DATA(K3+1) - DATA(K4+1) + U4I = DATA(K4) - DATA(K3) + GO TO 167 + + 164 T2R = W2R*DATA(K2) - W2I*DATA(K2+1) + T2I = W2R*DATA(K2+1) + W2I*DATA(K2) + T3R = WR*DATA(K3) - WI*DATA(K3+1) + T3I = WR*DATA(K3+1) + WI*DATA(K3) + T4R = W3R*DATA(K4) - W3I*DATA(K4+1) + T4I = W3R*DATA(K4+1) + W3I*DATA(K4) + U1R = DATA(K1) + T2R + U1I = DATA(K1+1) + T2I + U2R = T3R + T4R + U2I = T3I + T4I + U3R = DATA(K1) - T2R + U3I = DATA(K1+1) - T2I + U4R = T3I - T4I + U4I = T4R - T3R + + 167 DATA(K1) = U1R + U2R + DATA(K1+1) = U1I + U2I + DATA(K2) = U3R + U4R + DATA(K2+1) = U3I + U4I + DATA(K3) = U1R - U2R + DATA(K3+1) = U1I - U2I + DATA(K4) = U3R - U4R + DATA(K4+1) = U3I - U4I + 168 CONTINUE + KDIF = KSTEP + KMIN = 4*KMIN - 3 + GO TO 159 + + 169 M = M + LMAX + IF (M-MMAX) 170,170,173 + 170 TEMPR = WR + WR = (WR+WI)*RTHLF + WI = (WI-TEMPR)*RTHLF + GO TO 155 + + 173 CONTINUE + IPAR = 3 - IPAR + MMAX = MMAX + MMAX + GO TO 150 +c +c complete a real transform in the 1st dimension, n even, by con- +c jugate symmetries. +c + 174 THETA = -TWOPI/REAL(NB) + WSTPR = COS(THETA) + WSTPI = SIN(THETA) + WR = WSTPR + WI = WSTPI + I = 3 + J = NB - 1 + GO TO 207 + + 205 SUMR = (DATA(I)+DATA(J))/2. + SUMI = (DATA(I+1)+DATA(J+1))/2. + DIFR = (DATA(I)-DATA(J))/2. + DIFI = (DATA(I+1)-DATA(J+1))/2. + TEMPR = WR*SUMI + WI*DIFR + TEMPI = WI*SUMI - WR*DIFR + DATA(I) = SUMR + TEMPR + DATA(I+1) = DIFI + TEMPI + DATA(J) = SUMR - TEMPR + DATA(J+1) = -DIFI + TEMPI + I = I + 2 + J = J - 2 + TEMPR = WR + WR = WR*WSTPR - WI*WSTPI + WI = TEMPR*WSTPI + WI*WSTPR + 207 IF (I-J) 205,208,211 + 208 DATA(I+1) = -DATA(I+1) + + 211 DATA(NB+1) = DATA(1) - DATA(2) + DATA(NB+2) = 0. + + DATA(1) = DATA(1) + DATA(2) + DATA(2) = 0. + + RETURN + END From 050556bbec997e2bc77a46cdc5e883e07503f5ed Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 23 Mar 2006 17:31:05 +0000 Subject: [PATCH 095/811] Remove unused code from deep65.f, demod64a.f. Add test for bad data to demod64a.f, extract.f, wsjt65.f. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@131 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- deep65.f | 26 -------------------------- demod64a.f | 13 +++++++++---- extract.f | 8 +++++++- wsjt.py | 2 +- wsjt65.f | 4 ++++ 5 files changed, 21 insertions(+), 32 deletions(-) diff --git a/deep65.f b/deep65.f index e910c751e..0ef46fcc8 100644 --- a/deep65.f +++ b/deep65.f @@ -12,7 +12,6 @@ character*4 rpt(MAXRPT) logical first integer ncode(63,2*MAXCALLS) - common/tmp8/ p(64,63) data neme0/-99/ data rpt/'-01','-02','-03','-04','-05', @@ -101,26 +100,18 @@ p1=-1.e30 ip1=0 - p2=-1.e30 - ip2=0 do k=1,ntot C If sync=OOO, no CQ messages if(flip.lt.0.0 .and. testmsg(k)(1:3).eq.'CQ ') go to 30 sum=0. - sum2=0. do j=1,63 i=ncode(j,k)+1 sum=sum + s3(i,j) - sum2=sum2 + p(i,j) enddo if(sum.gt.p1) then p1=sum ip1=k endif - if(sum2.gt.p2) then - p2=sum2 - ip2=k - endif 30 enddo p1=p1/sum0 @@ -136,23 +127,6 @@ C If sync=OOO, no CQ messages decoded=testmsg(ip1) endif decoded(22:22)=c - deepmsg=decoded - - q2=0.27*p2 + 81.3 -! if(mode65.eq.1) qual=100.0*(p1-0.33) -! if(mode65.eq.4) qual=100.0*(p1-0.50) - if(q2.lt.0.) q2=0. - if(q2.gt.10.) q2=10. - decoded=' ' - c=' ' - if(q2.gt.0.0) then - if(q2.lt.4.0) c='?' - decoded=testmsg(ip2) - endif - decoded(22:22)=c - -! qual=q2 - decoded=deepmsg return end diff --git a/demod64a.f b/demod64a.f index 3a64b2374..700ef7b85 100644 --- a/demod64a.f +++ b/demod64a.f @@ -1,5 +1,5 @@ subroutine demod64a(signal,nadd,mrsym,mrprob, - + mr2sym,mr2prob) + + mr2sym,mr2prob,ntest,nlow) C Demodulate the 64-bin spectra for each of 63 symbols in a frame. @@ -14,8 +14,6 @@ C mr2prob probability that mr2sym was the transmitted value real*4 signal(64,63) real*8 fs(64) integer mrsym(63),mrprob(63),mr2sym(63),mr2prob(63) - real*4 p - common/tmp8/ p(64,63) afac=1.1 * float(nadd)**0.64 scale=255.999 @@ -49,7 +47,6 @@ C Compute probabilities for most reliable symbol values s2=signal(i,j) i2=i !Second most reliable endif - p(i,j)=log(fs(i)/fsum) enddo p1=fs(i1)/fsum !Normalized probabilities p2=fs(i2)/fsum @@ -59,5 +56,13 @@ C Compute probabilities for most reliable symbol values mr2prob(j)=scale*p2 enddo + sum=0. + nlow=0 + do j=1,63 + sum=sum+mrprob(j) + if(mrprob(j).le.5) nlow=nlow+1 + enddo + ntest=sum/63 + return end diff --git a/extract.f b/extract.f index 1dcc78129..ca9db6917 100644 --- a/extract.f +++ b/extract.f @@ -9,7 +9,13 @@ data first/.true./,nsec1/0/ save - call demod64a(s3,nadd,mrsym,mrprob,mr2sym,mr2prob) + call demod64a(s3,nadd,mrsym,mrprob,mr2sym,mr2prob,ntest,nlow) + + if(ntest.lt.50 .or. nlow.gt.20) then + ncount=-999 !Flag bad data + go to 900 + endif + call graycode(mrsym,63,-1) call interleave63(mrsym,-1) call interleave63(mrprob,-1) diff --git a/wsjt.py b/wsjt.py index 7d2eb317d..9f44e186c 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#----------------------------------------------------------------- WSJT +#---------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/wsjt65.f b/wsjt65.f index cbd34f559..280cb9218 100644 --- a/wsjt65.f +++ b/wsjt65.f @@ -126,6 +126,10 @@ C result from the Reed-Solomon decoder. call decode65(dat,npts,dtxx,dfxx,flip,ndepth,neme,nsked, + mycall,hiscall,hisgrid,mode65,lmid,ftrack,decoded, + ncount,deepmsg,qual) + if(ncount.eq.-999) then + qbest=0 !Bad data + go to 200 + endif if(qual.gt.qbest) then qbest=qual dtbest=dtxx From c7d68d0d48a87ec30135a45edd6085a0aee0fc40 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 24 Mar 2006 19:12:51 +0000 Subject: [PATCH 096/811] Small tweak to deep search algorithm. Don't compute waterfall spectrum while decoding. Force upper case for decoded test. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@132 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- deep65.f | 26 ++++++++++++++++---------- demod64a.f | 3 +++ ftn_init.f90 | 2 +- specjt.py | 6 ++++-- wsjt65.f | 8 ++++++-- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/deep65.f b/deep65.f index 0ef46fcc8..8f7a49a5e 100644 --- a/deep65.f +++ b/deep65.f @@ -12,6 +12,7 @@ character*4 rpt(MAXRPT) logical first integer ncode(63,2*MAXCALLS) + common/tmp9/ mrs(63),mrs2(63) data neme0/-99/ data rpt/'-01','-02','-03','-04','-05', @@ -89,13 +90,9 @@ 20 ntot=k neme0=neme - sum0=0. + ref0=0. do j=1,63 - smax=-1.e30 - do i=1,64 - smax=max(smax,s3(i,j)) - enddo - sum0=sum0+smax + ref0=ref0 + s3(mrs(j),j) enddo p1=-1.e30 @@ -104,20 +101,29 @@ C If sync=OOO, no CQ messages if(flip.lt.0.0 .and. testmsg(k)(1:3).eq.'CQ ') go to 30 sum=0. + ref=ref0 + nhard=0 do j=1,63 i=ncode(j,k)+1 sum=sum + s3(i,j) + if(i.eq.mrs(j)) then + ref=ref - s3(i,j) + s3(mrs2(j),j) + nhard=nhard+1 + endif enddo + sum=sum/ref if(sum.gt.p1) then p1=sum ip1=k + ref1=ref + nhard1=nhard endif 30 enddo - p1=p1/sum0 - qual=100.0*(p1-0.40) - if(mode65.eq.1) qual=100.0*(p1-0.33) - if(mode65.eq.4) qual=100.0*(p1-0.50) + qual=100.0*(p1-0.405) + print*,nhard1,ref1/ref0,qual,100.0*(p1*(ref1/ref0)-0.40) + if(mode65.eq.1) qual=100.0*(p1-0.335) + if(mode65.eq.4) qual=100.0*(p1-0.505) if(qual.lt.0.) qual=0. if(qual.gt.10.) qual=10. decoded=' ' diff --git a/demod64a.f b/demod64a.f index 700ef7b85..fc024f862 100644 --- a/demod64a.f +++ b/demod64a.f @@ -14,6 +14,7 @@ C mr2prob probability that mr2sym was the transmitted value real*4 signal(64,63) real*8 fs(64) integer mrsym(63),mrprob(63),mr2sym(63),mr2prob(63) + common/tmp9/ mrs(63),mrs2(63) afac=1.1 * float(nadd)**0.64 scale=255.999 @@ -54,6 +55,8 @@ C Compute probabilities for most reliable symbol values mr2sym(j)=i2-1 mrprob(j)=scale*p1 mr2prob(j)=scale*p2 + mrs(j)=i1 + mrs2(j)=i2 enddo sum=0. diff --git a/ftn_init.f90 b/ftn_init.f90 index b98252410..61b7948d0 100644 --- a/ftn_init.f90 +++ b/ftn_init.f90 @@ -18,7 +18,7 @@ !------------------------------------------------ ftn_init subroutine ftn_init - character*1 cjunk,fname*80 + character*1 cjunk include 'gcom1.f90' include 'gcom2.f90' include 'gcom3.f90' diff --git a/specjt.py b/specjt.py index c59ecf86d..013681974 100644 --- a/specjt.py +++ b/specjt.py @@ -217,7 +217,10 @@ def update(): contrast=sc2.get() logm=logmap.get() g0=sc3.get() - if Audio.gcom2.monitoring or Audio.gcom2.ndiskdat: + +# Don't calculate spectra for waterfall while decoding + if Audio.gcom2.ndecoding==0 and \ + (Audio.gcom2.monitoring or Audio.gcom2.ndiskdat): Audio.spec(brightness,contrast,logm,g0,nspeed,a) #Call Fortran routine spec newdat=Audio.gcom1.newdat #True if new data available else: @@ -253,7 +256,6 @@ def update(): if minsep.get(): draw.line((0,0,749,0),fill=128) #Draw the minute separator -# Don't update waterfall while decoding pim=ImageTk.PhotoImage(im) #Convert Image to PhotoImage graph1.delete(ALL) #For some reason, top two lines are invisible, so we move down 2 diff --git a/wsjt65.f b/wsjt65.f index 280cb9218..4fcdf4677 100644 --- a/wsjt65.f +++ b/wsjt65.f @@ -15,7 +15,7 @@ C already been done. character decoded*22,cfile6*6,special*5,cooo*3 character*22 avemsg1,avemsg2,deepmsg,deepbest character*67 line,ave1,ave2 - character*1 csync + character*1 csync,c1 character*12 mycall character*12 hiscall character*6 hisgrid @@ -160,6 +160,10 @@ C result from the Reed-Solomon decoder. if(flip.lt.0.0 .and. (kvqual.eq.1 .or. nqual.ge.nq2)) cooo='OOO' if(kvqual.eq.0.and.nqual.ge.nq1.and.nqual.lt.nq2) cooo(2:3)=' ?' if(decoded.eq.' ') cooo=' ' + do i=1,22 + c1=decoded(i:i) + if(c1.ge.'a' .and. c1.le.'z') decoded(i:i)=char(ichar(c1)-32) + enddo write(line,1010) cfile6,nsync,nsnr,dtx-1.0,ndf, + nint(width),csync,special,decoded(1:18),cooo,kvqual,nqual,itry 1010 format(a6,i3,i5,f5.1,i5,i3,1x,a1,1x,a5,a18,1x,a3,i5,i3,i2) @@ -175,7 +179,7 @@ C Blank DT if shorthand message (### wrong logic? ###) endif C Blank the end-of-line numbers - if(naggressive.eq.0) line(58:67)=' ' + if(naggressive.eq.0 .and. ndiag.eq.0) line(58:67)=' ' if(ndiag.eq.0) line(66:67)=' ' if(lcum) write(21,1011) line From 5c513598e16baa3c68422854ce6092ffccbda47d Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 24 Mar 2006 19:15:09 +0000 Subject: [PATCH 097/811] UPdate rev number git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@133 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsjt.py b/wsjt.py index 9f44e186c..7d2eb317d 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#---------------------------------------------------------------- WSJT +#----------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 6bcfe14ec21992b3f845dafee63189a9ff5e7fa0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 24 Mar 2006 19:45:29 +0000 Subject: [PATCH 098/811] Removed diagnostic print statement. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@134 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- deep65.f | 1 - wsjt.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/deep65.f b/deep65.f index 8f7a49a5e..1ac1e36c7 100644 --- a/deep65.f +++ b/deep65.f @@ -121,7 +121,6 @@ C If sync=OOO, no CQ messages 30 enddo qual=100.0*(p1-0.405) - print*,nhard1,ref1/ref0,qual,100.0*(p1*(ref1/ref0)-0.40) if(mode65.eq.1) qual=100.0*(p1-0.335) if(mode65.eq.4) qual=100.0*(p1-0.505) if(qual.lt.0.) qual=0. diff --git a/wsjt.py b/wsjt.py index 7d2eb317d..9f44e186c 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#----------------------------------------------------------------- WSJT +#---------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 4dc8d03f8a89b0faf70dfd312d08f06747184a1d Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 24 Mar 2006 21:13:27 +0000 Subject: [PATCH 099/811] Fixed so that files can be read while Monitoring or Auto is on. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@135 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- getfile.f90 | 9 +-------- spec.f90 | 1 - wsjt.py | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/getfile.f90 b/getfile.f90 index 26a1b0e93..304fd584b 100644 --- a/getfile.f90 +++ b/getfile.f90 @@ -41,7 +41,6 @@ subroutine getfile(fname,len) #ifdef Win32 open(10,file=fname,form='binary',status='old',err=998) read(10,end=998) hdr - #else call rfile2(fname,hdr,44+2*NDMAX,nr) #endif @@ -75,13 +74,7 @@ subroutine getfile(fname,len) #endif endif - if(monitoring.eq.0) then -! In this case, spec should read data from d2c -! jzc=jzc/2048 -! jzc=jzc*2048 - ndiskdat=1 - endif - + ndiskdat=1 mousebutton=0 go to 999 diff --git a/spec.f90 b/spec.f90 index 65e7a7e60..423eee16e 100644 --- a/spec.f90 +++ b/spec.f90 @@ -199,7 +199,6 @@ subroutine spec(brightness,contrast,logmap,ngain,nspeed,a) nspeed0=nspeed endif -! print*,brightness,contrast,logmap,gain,gamma,offset do i=1,iz n=0 if(a0(i).gt.0.0 .and. logmap.eq.1) n=gain*log10(0.001*a0(i)) + offset + 20 diff --git a/wsjt.py b/wsjt.py index 9f44e186c..c94360e8b 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#---------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw From a39f662b4d3a30fbbc5464883e2beaf52d6b6215 Mon Sep 17 00:00:00 2001 From: J C Dutton Date: Wed, 5 Apr 2006 20:07:32 +0000 Subject: [PATCH 100/811] Summary: Merge in linux branch svn+ssh://svn.berlios.de/svnroot/repos/wsjt/WSJT/branches/linux merged into svn+ssh://svn.berlios.de/svnroot/repos/wsjt/trunk git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@155 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 25 +- Makefile.linux.g95 | 121 ++ Makefile.linux.gfortran | 120 ++ abc441.f90 => abc441.F90 | 0 astro.f => astro.F | 0 astro0.f90 => astro0.F90 | 0 audio_init.f90 => audio_init.F90 | 0 bzap.f | 2 +- configure | 2883 +++++++++++++++++++----------- configure.ac | 4 +- cutil.c | 57 +- decode1.f90 => decode1.F90 | 0 decode3.f90 => decode3.F90 | 0 decode6m.f | 2 +- deep65.f => deep65.F | 10 +- detect.f | 4 +- fivehz.f90 => fivehz.F90 | 0 fivehz.h | 5 + ftn_init.f90 => ftn_init.F90 | 0 gcom1.f90 | 4 +- get_fname.f90 => get_fname.F90 | 0 getfile.f90 => getfile.F90 | 2 +- horizspec.f90 | 2 +- ps.f | 2 +- ptt_unix.c | 8 +- runqqq.f90 => runqqq.F90 | 0 savedata.f90 => savedata.F90 | 0 setup65.f | 16 +- spec.f90 | 2 +- spec2d.f | 4 +- spec2d65.f | 2 +- spec441.f | 2 +- ssort.f | 2 +- start_alsa.c | 40 +- sync.f | 10 +- syncf0.f | 2 +- syncf1.f | 2 +- synct.f | 2 +- wsjt.py | 17 +- wsjt1.f => wsjt1.F | 0 wsjtgen.f90 => wsjtgen.F90 | 9 +- 41 files changed, 2234 insertions(+), 1127 deletions(-) create mode 100644 Makefile.linux.g95 create mode 100644 Makefile.linux.gfortran rename abc441.f90 => abc441.F90 (100%) rename astro.f => astro.F (100%) rename astro0.f90 => astro0.F90 (100%) rename audio_init.f90 => audio_init.F90 (100%) rename decode1.f90 => decode1.F90 (100%) rename decode3.f90 => decode3.F90 (100%) rename deep65.f => deep65.F (92%) rename fivehz.f90 => fivehz.F90 (100%) create mode 100644 fivehz.h rename ftn_init.f90 => ftn_init.F90 (100%) rename get_fname.f90 => get_fname.F90 (100%) rename getfile.f90 => getfile.F90 (92%) rename runqqq.f90 => runqqq.F90 (100%) rename savedata.f90 => savedata.F90 (100%) rename wsjt1.f => wsjt1.F (100%) rename wsjtgen.f90 => wsjtgen.F90 (96%) diff --git a/Makefile.in b/Makefile.in index c270661f3..88443a8ec 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,13 +4,14 @@ LDFLAGS = @LDFLAGS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ # WSJT specific C flags -CFLAGS += -DBIGSYM=1 +CFLAGS += -DBIGSYM=1 -fPIC DEFS = @DEFS@ CFLAGS += ${DEFS} -CPPFLAGS += ${DEFS} +CPPFLAGS += ${DEFS} -I. # WSJT specific Fortran flags -FFLAGS += -cpp -Wall -fbounds-check -ftrace=full -fno-second-underscore +FFLAGS += -Wall -fbounds-check -fno-second-underscore -ffixed-line-length-none -fPIC +#FFLAGS += -Wall -fbounds-check -fno-second-underscore -fPIC #FFLAGS += -cpp -fno-second-underscore # The default rules .c.o: @@ -19,8 +20,8 @@ FFLAGS += -cpp -Wall -fbounds-check -ftrace=full -fno-second-underscore .f.o: ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f=.o} $< -.f90.o: - ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f90=.o} $< +.F90.o: + ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.F90=.o} $< OS=@OS@ G95=@G95@ @@ -44,11 +45,11 @@ OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 -SRCS2F90 = abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ - blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 \ - ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ - i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ - wsjtgen.f90 runqqq.f90 fivehz.f90 +SRCS2F90 = abc441.F90 astro0.F90 audio_init.F90 azdist0.f90 \ + blanker.f90 decode1.F90 decode2.f90 decode3.F90 ftn_init.F90 \ + ftn_quit.f90 get_fname.F90 getfile.F90 horizspec.f90 hscroll.f90 \ + i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.F90 spec.f90 \ + wsjtgen.F90 runqqq.F90 fivehz.F90 OBJS2F90 = ${SRCS2F90:.f90=.o} SRCS2F77 = wsjt1.f astro.f azdist.f coord.f dcoord.f deg2grid.f \ @@ -64,7 +65,7 @@ SRCS2F77 = wsjt1.f astro.f azdist.f coord.f dcoord.f deg2grid.f \ interleave63.f k2grid.f limit.f lpf1.f deep65.f morse.f \ nchar.f packcall.f packgrid.f packmsg.f packtext.f setup65.f \ short65.f slope.f spec2d65.f sync65.f unpackcall.f \ - unpackgrid.f unpackmsg.f unpacktext.f xcor.f xfft.f wsjt65.f + unpackgrid.f unpackmsg.f unpacktext.f xcor.f xfft.f xfft2.f wsjt65.f OBJS2F77 = ${SRCS2F77:.f=.o} SRCS2C = init_rs.c encode_rs.c decode_rs.c @@ -101,7 +102,7 @@ wsjt6: Audio.so #wsjt.spec # # Audio.so: $(OBJS2C) $(OBJS3C) $(OBJS2F77) $(SRCS2F90) $(AUDIOSRCS) - ${F2PY} -c --quiet --opt="-O -cpp -D${CFLAGS} \ + ${F2PY} -c --quiet --opt="-O ${CFLAGS} \ -fno-second-underscore" $(OBJS2C) $(OBJS2F77) -m Audio \ --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ only: $(F2PYONLY) \ diff --git a/Makefile.linux.g95 b/Makefile.linux.g95 new file mode 100644 index 000000000..256ef3356 --- /dev/null +++ b/Makefile.linux.g95 @@ -0,0 +1,121 @@ +CC ?= gcc +FFLAGS = -g -O2 +LDFLAGS = -L/usr/local/lib -lpthread -lasound +CPPFLAGS = -I/usr/local/include -I/usr/include/alsa +CFLAGS = -Wall -O0 -g -Wall -O0 -g +# WSJT specific C flags +CFLAGS += -DBIGSYM=1 +DEFS = -DPACKAGE_NAME=\"wsjt\" -DPACKAGE_TARNAME=\"wsjt\" -DPACKAGE_VERSION=\"5.9.2\" -DPACKAGE_STRING=\"wsjt\ 5.9.2\" -DPACKAGE_BUGREPORT=\"\" -DG95_LIB_PATH=\"/u/g95/g95-install/bin/../lib/gcc-lib/i686-pc-linux-gnu/4.0.1//\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_ERRNO_H=1 -DHAVE_SYS_SYSLOG_H=1 -DHAVE_STDDEF_H=1 -DHAVE_LIBGEN_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_WAIT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_LINUX_PPDEV_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_IOCTL_H=1 -DTIME_WITH_SYS_TIME=1 -DSTRING_WITH_STRINGS=1 -DSIZEOF_INT64_T=8 -DSIZEOF_LONG_LONG=8 -DNDEBUG=1 -DPREFIX=\"/usr/local/\" -DUSE_SERIAL=1 -DUSE_ALSA=1 -DHAS_ASOUNDLIB_H=1 -DHAS_SOUNDCARD_H=1 -DHAS_SAMPLERATE_H=1 +CFLAGS += ${DEFS} +CPPFLAGS += ${DEFS} + +# WSJT specific Fortran flags +#FFLAGS += -Wall -fbounds-check -fno-second-underscore -ffixed-line-length-none +FFLAGS += -Wall -fbounds-check -fno-second-underscore +#FFLAGS += -cpp -fno-second-underscore +# The default rules +.c.o: + ${CC} ${CPPFLAGS} ${CFLAGS} -c -o ${<:.c=.o} $< + +.f.o: + ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f=.o} $< + +.F90.o: + ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.F90=.o} $< + +OS=Linux +G95=/usr/X11R6/bin/g95 +COMPILER=/usr/lib/gcc/i686-pc-linux-gnu/3.4.6// +#COMPILER=/u/g95/g95-install/bin/../lib/gcc-lib/i686-pc-linux-gnu/4.0.1// +FC=/usr/X11R6/bin/g95 + +LDFLAGS += -L${COMPILER} +LDFLAGS += -lg2c + +PYTHON ?= /usr/X11R6/bin/python +RM ?= /usr/X11R6/bin/rm +F2PY = /usr/X11R6/bin/f2py + + +OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ + packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \ + unpackgrid.o deg2grid.o packdxcc.o chkmsg.o getpfx1.o \ + getpfx2.o k2grid.o grid2k.o interleave63.o graycode.o set.o \ + igray.o init_rs_int.o encode_rs_int.o decode_rs_int.o \ + wrapkarn.o + +F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 + +SRCS2F90 = abc441.F90 astro0.F90 audio_init.F90 azdist0.f90 \ + blanker.f90 decode1.F90 decode2.f90 decode3.F90 ftn_init.F90 \ + ftn_quit.f90 get_fname.F90 getfile.F90 horizspec.f90 hscroll.f90 \ + i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.F90 spec.f90 \ + wsjtgen.F90 runqqq.F90 fivehz.F90 +OBJS2F90 = ${SRCS2F90:.f90=.o} + +SRCS2F77 = wsjt1.f astro.f azdist.f coord.f dcoord.f deg2grid.f \ + dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f moon2.f \ + MoonDop.f sun.f toxyz.f pfxdump.f \ + avesp2.f bzap.f spec441.f spec2d.f mtdecode.f stdecode.f \ + indexx.f s2shape.f flat2.f gen65.f chkmsg.f gen6m.f gentone.f \ + syncf0.f syncf1.f synct.f decode6m.f avemsg6m.f \ + set.f flatten.f db.f pctile.f sort.f ssort.f ps.f smooth.f \ + ping.f longx.f peakup.f sync.f detect.f avemsg65.f decode65.f \ + demod64a.f encode65.f extract.f flat1.f four2.f rfile2.f \ + gencw.f getpfx1.f getpfx2.f getsnr.f graycode.f grid2k.f \ + interleave63.f k2grid.f limit.f lpf1.f deep65.f morse.f \ + nchar.f packcall.f packgrid.f packmsg.f packtext.f setup65.f \ + short65.f slope.f spec2d65.f sync65.f unpackcall.f \ + unpackgrid.f unpackmsg.f unpacktext.f xcor.f xfft.f xfft2.f wsjt65.f +OBJS2F77 = ${SRCS2F77:.f=.o} + +SRCS2C = init_rs.c encode_rs.c decode_rs.c +OBJS2C = ${SRCS2C:.c=.o} + +# ok, so far for now +# Windows start_alsa.c will be a2d.f90 jtaudio.c since it uses portaudio +# for *nix start_alsa.c will also be a2d.f90, jtaudio.c +# and start_portaudio.c for systems using portaudio +# for *nix start_alsa.c will be start_alsa.c for alsa +# for *nix start_alsa.c will be start_oss.c for oss +# +# ptt_unix.c vs. ptt.c I'll sort out later. +# ditto for cutil.c (only used on *nix) +# --db +# jtaudio.c/start_threads.c mess will have to be sorted out later +# to minimise #ifdef's +# --db +# and mostly sorted +# --db +# +SRCS3C = ptt_unix.c igray.c wrapkarn.c cutil.c +OBJS3C = ${SRCS3C:.c=.o} +AUDIOSRCS = start_alsa.c + +all: wsjt6 +JT65code: $(OBJS1) + $(FC) -o JT65code $(OBJS1) + +wsjt6: Audio.so #wsjt.spec +# ${PYTHON} c:\python23\installer\Build.py wsjt.spec +# ${RM} wsjt6 + +# +# +Audio.so: $(OBJS2C) $(OBJS3C) $(OBJS2F77) $(SRCS2F90) $(AUDIOSRCS) + ${F2PY} -c --quiet --opt="-O -D${CFLAGS} \ + -fno-second-underscore" $(OBJS2C) $(OBJS2F77) -m Audio \ + --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ + only: $(F2PYONLY) \ + : $(SRCS2F90) \ + ${SRCS3C} ${AUDIOSRCS} + +wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py +# ${PYTHON} c:\python23\installer\makespec.py --icon wsjt.ico \ +# --tk --onefile wsjt.py + + +.PHONY : clean +clean: + ${RM} -f *.o *.so *~ JT65code wsjt6 + diff --git a/Makefile.linux.gfortran b/Makefile.linux.gfortran new file mode 100644 index 000000000..bd9608559 --- /dev/null +++ b/Makefile.linux.gfortran @@ -0,0 +1,120 @@ +CC ?= gcc +FFLAGS = -g -O2 -fPIC +LDFLAGS = -L/usr/local/lib -lpthread -lasound +CPPFLAGS = -I/usr/local/include -I/usr/include/alsa -I. +CFLAGS = -Wall -O0 -g -Wall -O0 -g -fPIC +# WSJT specific C flags +CFLAGS += -DBIGSYM=1 +DEFS = -DPACKAGE_NAME=\"wsjt\" -DPACKAGE_TARNAME=\"wsjt\" -DPACKAGE_VERSION=\"5.9.2\" -DPACKAGE_STRING=\"wsjt\ 5.9.2\" -DPACKAGE_BUGREPORT=\"\" -DG95_LIB_PATH=\"/usr/lib/gcc/x86_64-linux-gnu/4.0.3/\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_ERRNO_H=1 -DHAVE_SYS_SYSLOG_H=1 -DHAVE_STDDEF_H=1 -DHAVE_LIBGEN_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_WAIT_H=1 -DHAVE_STDIO_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_LINUX_PPDEV_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_IOCTL_H=1 -DTIME_WITH_SYS_TIME=1 -DSTRING_WITH_STRINGS=1 -DSIZEOF_INT64_T=8 -DSIZEOF_LONG_LONG=8 -DNDEBUG=1 -DPREFIX=\"/usr/local/\" -DUSE_SERIAL=1 -DUSE_ALSA=1 -DHAS_ASOUNDLIB_H=1 -DHAS_SOUNDCARD_H=1 +CFLAGS += ${DEFS} +CPPFLAGS += ${DEFS} + +# WSJT specific Fortran flags +FFLAGS += -Wall -fbounds-check -fno-second-underscore -ffixed-line-length-none +#FFLAGS += -Wall -fbounds-check -fno-second-underscore +#FFLAGS += -cpp -fno-second-underscore +# The default rules +.c.o: + ${CC} ${CPPFLAGS} ${CFLAGS} -c -o ${<:.c=.o} $< + +.f.o: + ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f=.o} $< + +.F90.o: + ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.F90=.o} $< + +OS=Linux +G95=/usr/bin/g95 +COMPILER=/usr/lib/gcc/x86_64-linux-gnu/4.0.3/ +FC=/usr/bin/g95 + +LDFLAGS += -L${COMPILER} +LDFLAGS += -lg2c + +PYTHON ?= /usr/bin/python +RM ?= /bin/rm +F2PY = /usr/bin/f2py + + +OBJS1 = JT65code.o nchar.o grid2deg.o packmsg.o packtext.o \ + packcall.o packgrid.o unpackmsg.o unpacktext.o unpackcall.o \ + unpackgrid.o deg2grid.o packdxcc.o chkmsg.o getpfx1.o \ + getpfx2.o k2grid.o grid2k.o interleave63.o graycode.o set.o \ + igray.o init_rs_int.o encode_rs_int.o decode_rs_int.o \ + wrapkarn.o + +F2PYONLY = ftn_init ftn_quit audio_init spec getfile azdist0 astro0 + +SRCS2F90 = abc441.F90 astro0.F90 audio_init.F90 azdist0.f90 \ + blanker.f90 decode1.F90 decode2.f90 decode3.F90 ftn_init.F90 \ + ftn_quit.f90 get_fname.F90 getfile.F90 horizspec.f90 hscroll.f90 \ + i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.F90 spec.f90 \ + wsjtgen.F90 runqqq.F90 fivehz.F90 +OBJS2F90 = ${SRCS2F90:.f90=.o} + +SRCS2F77 = wsjt1.f astro.f azdist.f coord.f dcoord.f deg2grid.f \ + dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f moon2.f \ + MoonDop.f sun.f toxyz.f pfxdump.f \ + avesp2.f bzap.f spec441.f spec2d.f mtdecode.f stdecode.f \ + indexx.f s2shape.f flat2.f gen65.f chkmsg.f gen6m.f gentone.f \ + syncf0.f syncf1.f synct.f decode6m.f avemsg6m.f \ + set.f flatten.f db.f pctile.f sort.f ssort.f ps.f smooth.f \ + ping.f longx.f peakup.f sync.f detect.f avemsg65.f decode65.f \ + demod64a.f encode65.f extract.f flat1.f four2.f rfile2.f \ + gencw.f getpfx1.f getpfx2.f getsnr.f graycode.f grid2k.f \ + interleave63.f k2grid.f limit.f lpf1.f deep65.f morse.f \ + nchar.f packcall.f packgrid.f packmsg.f packtext.f setup65.f \ + short65.f slope.f spec2d65.f sync65.f unpackcall.f \ + unpackgrid.f unpackmsg.f unpacktext.f xcor.f xfft.f xfft2.f wsjt65.f +OBJS2F77 = ${SRCS2F77:.f=.o} + +SRCS2C = init_rs.c encode_rs.c decode_rs.c +OBJS2C = ${SRCS2C:.c=.o} + +# ok, so far for now +# Windows start_alsa.c will be a2d.f90 jtaudio.c since it uses portaudio +# for *nix start_alsa.c will also be a2d.f90, jtaudio.c +# and start_portaudio.c for systems using portaudio +# for *nix start_alsa.c will be start_alsa.c for alsa +# for *nix start_alsa.c will be start_oss.c for oss +# +# ptt_unix.c vs. ptt.c I'll sort out later. +# ditto for cutil.c (only used on *nix) +# --db +# jtaudio.c/start_threads.c mess will have to be sorted out later +# to minimise #ifdef's +# --db +# and mostly sorted +# --db +# +SRCS3C = ptt_unix.c igray.c wrapkarn.c cutil.c +OBJS3C = ${SRCS3C:.c=.o} +AUDIOSRCS = start_alsa.c + +all: wsjt6 +JT65code: $(OBJS1) + $(FC) -o JT65code $(OBJS1) + +wsjt6: Audio.so #wsjt.spec +# ${PYTHON} c:\python23\installer\Build.py wsjt.spec +# ${RM} wsjt6 + +# +# +Audio.so: $(OBJS2C) $(OBJS3C) $(OBJS2F77) $(SRCS2F90) $(AUDIOSRCS) + ${F2PY} -c --opt="-O ${CFLAGS} -fPIC \ + -fno-second-underscore" $(OBJS2C) $(OBJS2F77) -m Audio \ + --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ + only: $(F2PYONLY) \ + : $(SRCS2F90) \ + ${SRCS3C} ${AUDIOSRCS} + +wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py +# ${PYTHON} c:\python23\installer\makespec.py --icon wsjt.ico \ +# --tk --onefile wsjt.py + + +.PHONY : clean +clean: + ${RM} -f *.o *.so *~ JT65code wsjt6 + diff --git a/abc441.f90 b/abc441.F90 similarity index 100% rename from abc441.f90 rename to abc441.F90 diff --git a/astro.f b/astro.F similarity index 100% rename from astro.f rename to astro.F diff --git a/astro0.f90 b/astro0.F90 similarity index 100% rename from astro0.f90 rename to astro0.F90 diff --git a/audio_init.f90 b/audio_init.F90 similarity index 100% rename from audio_init.f90 rename to audio_init.F90 diff --git a/bzap.f b/bzap.f index aa26fea5e..294570f80 100644 --- a/bzap.f +++ b/bzap.f @@ -32,7 +32,7 @@ C This is a kludge: ib=(fzap(izap)+tol)/df smax=0. do i=ia+1,ib+1 - s=real(c(i))**2 + imag(c(i))**2 + s=real(c(i))**2 + aimag(c(i))**2 if(s.gt.smax) then smax=s ipk=i diff --git a/configure b/configure index 41f532230..7c3eb9082 100755 --- a/configure +++ b/configure @@ -1,21 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.53 for wsjt 5.9.2. +# Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 113 2006-01-16 02:07:25Z va3db $ +# $Id: configure.ac 127 2006-02-20 20:46:33Z va3db $ # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -24,46 +15,57 @@ fi if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# NLS nuisances. # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -74,6 +76,7 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -84,15 +87,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -140,6 +143,8 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -212,13 +217,20 @@ else fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -228,7 +240,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$as_unset CDPATH # Name of the host. @@ -242,6 +254,7 @@ exec 6>&1 # Initializations. # ac_default_prefix=/usr/local +ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= @@ -298,6 +311,8 @@ ac_includes_default="\ # include #endif" +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT F77 FFLAGS ac_ct_F77 CPP EGREP SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RM CP MV LN SED AR LD TEST PYTHON F2PY G95 G95_LIB_PATH OS CLOBBER AUDIO LIBOBJS LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. ac_init_help= @@ -655,7 +670,7 @@ done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -695,10 +710,10 @@ if test -z "$srcdir"; then # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -721,6 +736,9 @@ if test ! -r $srcdir/$ac_unique_file; then { (exit 1); exit 1; }; } fi fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias @@ -795,9 +813,9 @@ _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -889,12 +907,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. @@ -905,13 +956,13 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -919,14 +970,13 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF wsjt configure 5.9.2 -generated by GNU Autoconf 2.53 +generated by GNU Autoconf 2.59 -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 113 2006-01-16 02:07:25Z va3db $ +$Id: configure.ac 127 2006-02-20 20:46:33Z va3db $ _ACEOF exit 0 fi @@ -936,7 +986,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by wsjt $as_me 5.9.2, which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -988,27 +1038,54 @@ _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_sep= -for ac_arg +ac_must_keep_next=false +for ac_pass in 1 2 do - case $ac_arg in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n ) continue ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - esac - # Get rid of the leading space. + 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=`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_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + 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 @@ -1019,6 +1096,7 @@ trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo + cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## @@ -1031,16 +1109,45 @@ _ASBOX case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## @@ -1048,14 +1155,14 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && + rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1135,7 +1242,7 @@ fi # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" @@ -1152,13 +1259,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -1214,6 +1321,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + OLD_CFLAGS="$CFLAGS" @@ -1421,9 +1529,7 @@ if test $ac_prog_rejected = yes; then # 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 - set dummy "$as_dir/$ac_word" ${1+"$@"} - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi @@ -1528,8 +1634,10 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +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. @@ -1553,15 +1661,12 @@ ac_compiler=`set X $ac_compile; echo $2` (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1571,12 +1676,12 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe" +ac_clean_files="$ac_clean_files a.out 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. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 @@ -1590,26 +1695,39 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= -for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; - a.out ) # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool --akim. - export ac_cv_exeext - break;; - * ) break;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; esac done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 -echo "$as_me: error: C compiler cannot create executables" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi @@ -1636,9 +1754,11 @@ if test "$cross_compiling" != yes; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&5 +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&2;} +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi @@ -1646,7 +1766,7 @@ fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. @@ -1666,18 +1786,21 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 # 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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + export ac_cv_exeext + break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +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 @@ -1694,15 +1817,12 @@ if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1719,16 +1839,19 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -1744,15 +1867,12 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1766,11 +1886,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1779,10 +1908,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -1798,15 +1928,12 @@ if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1817,11 +1944,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1830,10 +1966,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_cc_g=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 @@ -1852,6 +1989,120 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=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 +#include +#include +#include +/* 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 -std1 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 -std1. */ +int osf4_cc_array ['\x00' == 0 ? 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 +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide @@ -1863,19 +2114,27 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ - ''\ - '#include ' \ + '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ @@ -1883,16 +2142,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif +#include int main () { @@ -1903,11 +2159,20 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1916,20 +2181,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + continue fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1940,11 +2203,20 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1953,9 +2225,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then @@ -1966,9 +2239,10 @@ fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1986,7 +2260,7 @@ 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 f77 xlf cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran 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 @@ -2028,7 +2302,7 @@ fi fi if test -z "$F77"; then ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -2073,7 +2347,7 @@ fi # Provide some information about the compiler. -echo "$as_me:2076:" \ +echo "$as_me:2350:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -2091,9 +2365,10 @@ ac_compiler=`set X $ac_compile; echo $2` ac_status=$? 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. +# input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 @@ -2111,11 +2386,20 @@ else _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2124,17 +2408,17 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext -G77=`test $ac_compiler_gnu = yes && echo yes` ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= @@ -2151,11 +2435,20 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2164,10 +2457,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_f77_g=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 @@ -2175,18 +2469,20 @@ echo "${ECHO_T}$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 "$G77" = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else - if test "$G77" = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi + +G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2256,8 +2552,11 @@ else ac_func_search_save_LIBS=$LIBS ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -2266,12 +2565,6 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2282,11 +2575,20 @@ strerror (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2295,15 +2597,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_search_strerror="none required" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_strerror" = no; then for ac_lib in cposix; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -2312,12 +2619,6 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2328,11 +2629,20 @@ strerror (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2342,9 +2652,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS @@ -2356,103 +2668,6 @@ if test "$ac_cv_search_strerror" != no; then fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include -#include -#include -#include -/* 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; -} -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; -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then @@ -2461,21 +2676,34 @@ else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifndef __cplusplus -static $ac_kw int static_foo () {return 0; } -$ac_kw int foo () {return 0; } +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2484,25 +2712,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 + + case $ac_cv_c_inline in inline | yes) ;; - no) -cat >>confdefs.h <<\_ACEOF -#define inline + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif _ACEOF - ;; - *) cat >>confdefs.h <<_ACEOF -#define inline $ac_cv_c_inline -_ACEOF - ;; + ;; esac ac_ext=c @@ -2528,24 +2761,34 @@ 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 to if __STDC__ is defined, since + # 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 -#line $LINENO "configure" -#include "confdefs.h" -#include - Syntax error +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2556,7 +2799,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -2565,20 +2809,24 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2590,7 +2838,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -2619,24 +2868,34 @@ 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 to if __STDC__ is defined, since + # 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 -#line $LINENO "configure" -#include "confdefs.h" -#include - Syntax error +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2647,7 +2906,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -2656,20 +2916,24 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2681,7 +2945,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -2694,8 +2959,10 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -2706,6 +2973,21 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 @@ -2714,13 +2996,16 @@ if test "${ac_cv_prog_gcc_traditional+set}" = set; then else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no @@ -2730,13 +3015,16 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* @@ -2750,15 +3038,15 @@ echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 fi fi -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' + @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` @@ -2815,6 +3103,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 @@ -2831,6 +3120,7 @@ do 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. @@ -2838,20 +3128,20 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$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 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if $as_executable_p "$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 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; @@ -3272,8 +3562,8 @@ else echo "${ECHO_T}no" >&6 fi -# Extract the first word of "g95", so it can be a program name with args. -set dummy g95; ac_word=$2 +# Extract the first word of "gfortran", so it can be a program name with args. +set dummy gfortran; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_G95+set}" = set; then @@ -3338,49 +3628,67 @@ if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include #include +int +main () +{ + + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f 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 -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3392,13 +3700,16 @@ 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 -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3413,16 +3724,20 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #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 ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -3433,7 +3748,7 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) + || toupper (i) != TOUPPER (i)) exit(2); exit (0); } @@ -3453,11 +3768,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3483,7 +3799,7 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -3492,19 +3808,31 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3513,10 +3841,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -3566,18 +3895,30 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3586,10 +3927,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3597,20 +3939,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3621,7 +3967,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3629,26 +3976,43 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -3670,18 +4034,15 @@ if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -3693,11 +4054,20 @@ return 0; _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3706,10 +4076,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_time=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 @@ -3735,18 +4106,30 @@ else echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5 echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3755,10 +4138,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3766,20 +4150,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5 echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3790,7 +4178,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3798,19 +4187,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/soundcard.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 @@ -3843,18 +4249,30 @@ else echo "$as_me:$LINENO: checking alsa/asoundlib.h usability" >&5 echo $ECHO_N "checking alsa/asoundlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3863,10 +4281,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3874,20 +4293,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking alsa/asoundlib.h presence" >&5 echo $ECHO_N "checking alsa/asoundlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3898,7 +4321,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3906,19 +4330,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5 echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6 @@ -3951,18 +4392,30 @@ else echo "$as_me:$LINENO: checking portaudio.h usability" >&5 echo $ECHO_N "checking portaudio.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3971,10 +4424,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3982,20 +4436,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking portaudio.h presence" >&5 echo $ECHO_N "checking portaudio.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4006,7 +4464,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4014,19 +4473,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: portaudio.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: portaudio.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: portaudio.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: portaudio.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: portaudio.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: portaudio.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: portaudio.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: portaudio.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for portaudio.h" >&5 echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 @@ -4059,18 +4535,30 @@ else echo "$as_me:$LINENO: checking samplerate.h usability" >&5 echo $ECHO_N "checking samplerate.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4079,10 +4567,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4090,20 +4579,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking samplerate.h presence" >&5 echo $ECHO_N "checking samplerate.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4114,7 +4607,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4122,19 +4616,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: samplerate.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: samplerate.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: samplerate.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: samplerate.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: samplerate.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: samplerate.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: samplerate.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: samplerate.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: samplerate.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: samplerate.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: samplerate.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for samplerate.h" >&5 echo $ECHO_N "checking for samplerate.h... $ECHO_C" >&6 @@ -4167,11 +4678,20 @@ else _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4180,10 +4700,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 gcc_cv_header_string=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gcc_cv_header_string=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 @@ -4203,15 +4724,12 @@ if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4225,11 +4743,20 @@ if (sizeof (int64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4238,10 +4765,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_int64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_int64_t" >&6 @@ -4259,15 +4787,12 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4280,11 +4805,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4293,15 +4827,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4314,11 +4845,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4327,29 +4867,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4362,11 +4901,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4375,15 +4923,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4396,11 +4941,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4409,37 +4963,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4452,11 +5005,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4465,37 +5027,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int64_t=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77" >&5 -echo "$as_me: error: cannot compute sizeof (int64_t), 77" >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 -echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (int64_t)); } unsigned long ulongval () { return (long) (sizeof (int64_t)); } #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4538,13 +5100,16 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77" >&5 -echo "$as_me: error: cannot compute sizeof (int64_t), 77" >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -4565,15 +5130,12 @@ if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4587,11 +5149,20 @@ if (sizeof (long long)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4600,10 +5171,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_long_long=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6 @@ -4621,15 +5193,12 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4642,11 +5211,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4655,15 +5233,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4676,11 +5251,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4689,29 +5273,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4724,11 +5307,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4737,15 +5329,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4758,11 +5347,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4771,37 +5369,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4814,11 +5411,20 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4827,37 +5433,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77" >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77" >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 -echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long long)); } unsigned long ulongval () { return (long) (sizeof (long long)); } #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4900,13 +5506,16 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77" >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77" >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -4929,15 +5538,12 @@ if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4951,11 +5557,20 @@ if (sizeof (uint64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4964,10 +5579,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_uint64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 @@ -4978,15 +5594,12 @@ if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5000,11 +5613,20 @@ if (sizeof (int64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5013,10 +5635,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_int64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_int64_t" >&6 @@ -5028,15 +5651,12 @@ if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5050,11 +5670,20 @@ if (sizeof (uint64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5063,10 +5692,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_uint64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 @@ -5086,15 +5716,12 @@ if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5108,11 +5735,20 @@ if (sizeof (int64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5121,10 +5757,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_int64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_int64_t" >&6 @@ -5146,15 +5783,12 @@ if test "${ac_cv_type_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5168,11 +5802,20 @@ if (sizeof (u_int32_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5181,10 +5824,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_u_int32_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_u_int32_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 @@ -5198,15 +5842,12 @@ if test "${ac_cv_type_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5220,11 +5861,20 @@ if (sizeof (uint32_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5233,10 +5883,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint32_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_uint32_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 @@ -5270,15 +5921,12 @@ if test "${ac_cv_type_u_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5292,11 +5940,20 @@ if (sizeof (u_int16_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5305,10 +5962,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_u_int16_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_u_int16_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 @@ -5322,15 +5980,12 @@ if test "${ac_cv_type_uint16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5344,11 +5999,20 @@ if (sizeof (uint16_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5357,10 +6021,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint16_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_uint16_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 @@ -5395,17 +6060,14 @@ if test "${ac_cv_c_bigendian+set}" = set; then else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5419,11 +6081,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5431,17 +6102,14 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5455,11 +6123,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5468,32 +6145,31 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_bigendian=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # It does not; compile a test program. if test "$cross_compiling" = yes; then - # try to guess the endianess by grep'ing values into an object file + # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5504,20 +6180,29 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - if fgrep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi -if fgrep LiTTleEnDian conftest.$ac_objext >/dev/null ; then +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -5527,13 +6212,17 @@ if fgrep LiTTleEnDian conftest.$ac_objext >/dev/null ; then fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int main () { @@ -5562,14 +6251,15 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 @@ -5583,9 +6273,9 @@ _ACEOF no) ;; *) - { { echo "$as_me:$LINENO: error: unknown endianess + { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianess +echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -5604,18 +6294,30 @@ else echo "$as_me:$LINENO: checking stdarg.h usability" >&5 echo $ECHO_N "checking stdarg.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5624,10 +6326,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -5635,20 +6338,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking stdarg.h presence" >&5 echo $ECHO_N "checking stdarg.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -5659,7 +6366,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -5667,19 +6375,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdarg.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdarg.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdarg.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stdarg.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stdarg.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdarg.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdarg.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdarg.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdarg.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for stdarg.h" >&5 echo $ECHO_N "checking for stdarg.h... $ECHO_C" >&6 @@ -5752,7 +6477,7 @@ _ACEOF fi -ac_config_files="$ac_config_files Makefile" + ac_config_files="$ac_config_files Makefile" @@ -5941,7 +6666,7 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overriden when +# `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. @@ -5959,13 +6684,13 @@ _ACEOF # `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" + "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 \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -5976,7 +6701,7 @@ _ACEOF t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if cmp -s $cache_file confcache; then :; else +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file @@ -5995,13 +6720,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # 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[ ]*=/{ + ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; +s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; -s/^[^=]*=[ ]*$//; +s/^[^=]*=[ ]*$//; }' fi @@ -6015,13 +6740,13 @@ fi cat >confdef2opt.sed <<\_ACEOF t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g @@ -6038,6 +6763,21 @@ DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed +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_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -6052,11 +6792,12 @@ cat >$CONFIG_STATUS <<_ACEOF # 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 - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -6065,46 +6806,57 @@ cat >>$CONFIG_STATUS <<\_ACEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# NLS nuisances. # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -6115,6 +6867,7 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -6125,15 +6878,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -6182,6 +6935,8 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -6255,13 +7010,20 @@ else fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -6271,7 +7033,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$as_unset CDPATH exec 6>&1 @@ -6288,7 +7050,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by wsjt $as_me 5.9.2, which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6328,10 +7090,11 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files @@ -6342,11 +7105,10 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ wsjt config.status 5.9.2 -configured by $0, generated by GNU Autoconf 2.53, +configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir @@ -6363,25 +7125,25 @@ do --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift ;; - -*);; *) # This is not an option, so the user has probably given explicit # arguments. + ac_option=$1 ac_need_defaults=false;; esac - case $1 in + case $ac_option in # Handling of the options. _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" - exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; -_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) @@ -6396,13 +7158,16 @@ Try \`$0 --help' for more information." >&2;} --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 @@ -6417,6 +7182,20 @@ Try \`$0 --help' for more information." >&2;} 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 +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + _ACEOF @@ -6443,6 +7222,9 @@ if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { @@ -6451,17 +7233,17 @@ $debug || } # Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} + { - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=$TMPDIR/cs$$-$RANDOM + tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } @@ -6520,6 +7302,7 @@ s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t @@ -6539,6 +7322,8 @@ s,@G95_LIB_PATH@,$G95_LIB_PATH,;t t s,@OS@,$OS,;t t s,@CLOBBER@,$CLOBBER,;t t s,@AUDIO@,$AUDIO,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF @@ -6568,9 +7353,9 @@ _ACEOF (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end @@ -6588,46 +7373,51 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. @@ -6654,12 +7444,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac case $INSTALL in @@ -6667,11 +7490,6 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -6681,7 +7499,7 @@ echo "$as_me: creating $ac_file" >&6;} configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. @@ -6690,26 +7508,32 @@ echo "$as_me: creating $ac_file" >&6;} case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo $f;; + echo "$f";; *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub @@ -6758,16 +7582,17 @@ ac_clean_files=$ac_clean_files_save # 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_cs_success=false + $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 -ac_config_files="$ac_config_files Makefile" - echo diff --git a/configure.ac b/configure.ac index b072e4cb3..cb30a3399 100644 --- a/configure.ac +++ b/configure.ac @@ -81,7 +81,7 @@ AC_PATH_PROG(LD, ld) AC_PATH_PROG(TEST, [test], [test]) AC_PATH_PROG(PYTHON, python) AC_PATH_PROG(F2PY, f2py) -AC_PATH_PROG(G95, g95) +AC_PATH_PROG(G95, gfortran) AC_MSG_CHECKING([g95 lib path]) G95_LIB_PATH=`${G95} -print-file-name=` @@ -324,7 +324,7 @@ AC_SUBST(LDFLAGS, "${LDFLAGS}") AC_SUBST(CFLAGS) AC_OUTPUT -AC_CONFIG_FILES(Makefile) +dnl AC_CONFIG_FILES(Makefile) dnl do summary diff --git a/cutil.c b/cutil.c index 6130c1355..c0de1afb7 100644 --- a/cutil.c +++ b/cutil.c @@ -1,46 +1,45 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* FORTRAN: fd = close(filedes) */ -close_(filedes) -int *filedes; +int close_(int *filedes) { return(close(*filedes)); } /* FORTRAN: fd = open(filnam,mode) */ -open_(filnam,mode) -char filnam[]; -int *mode; +int open_(char filnam[], int *mode) { return(open(filnam,*mode)); } /* FORTRAN: fd = creat(filnam,mode) */ -creat_(filnam,mode) -char filnam[]; -int *mode; +int creat_(char filnam[],int *mode) { return(creat(filnam,*mode)); } /* FORTRAN: nread = read(fd,buf,n) */ -read_(fd,buf,n) -int *fd,*n; -char buf[]; +int read_(int *fd, char buf[], int *n) { return(read(*fd,buf,*n)); } /* FORTRAN: nwrt = write(fd,buf,n) */ -write_(fd,buf,n) -int *fd,*n; -char buf[]; +int write_(int *fd, char buf[], int *n) { return(write(*fd,buf,*n)); } /* FORTRAN: ns = lseek(fd,offset,origin) */ -lseek_(fd,offset,origin) -int *fd,*offset,*origin; +int lseek_(int *fd,int *offset, int *origin) { return(lseek(*fd,*offset,*origin)); } /* times(2) */ -times_(buf) -int buf[]; +int times_(struct tms *buf) { return (times(buf)); } @@ -53,34 +52,32 @@ int buf[]; //} /* usleep(3) */ -usleep_(microsec) -unsigned long *microsec; +int usleep_(unsigned long *microsec) { return (usleep(*microsec)); } /* returns random numbers between 0 and 32767 to FORTRAN program */ -iran_(arg) -int *arg; +int iran_(int *arg) { return (rand()); } -exit_(n) -int *n; +int exit_(int *n) { printf("\n\n"); exit(*n); } -#include -time_t time_() + +time_t time_(void) { return time(0); } /* hrtime() */ -double hrtime_() +double hrtime_(void) { - int tv[2],tz[2]; - gettimeofday(tv,tz); - return(tv[0]+1.e-6*tv[1]); + struct timeval tv; + struct timezone tz; + gettimeofday(&tv,&tz); + return(tv.tv_sec+1.e-6*tv.tv_usec); } diff --git a/decode1.f90 b/decode1.F90 similarity index 100% rename from decode1.f90 rename to decode1.F90 diff --git a/decode3.f90 b/decode3.F90 similarity index 100% rename from decode3.f90 rename to decode3.F90 diff --git a/decode6m.f b/decode6m.f index b860b5fdb..b41e4ed9d 100644 --- a/decode6m.f +++ b/decode6m.f @@ -24,7 +24,7 @@ c real s2(128,646) data pua/'0123456789., /#?$ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ data offset/20.6/ - ps(zz)=real(zz)**2 + imag(zz)**2 !Power spectrum function + ps(zz)=real(zz)**2 + aimag(zz)**2 !Power spectrum function C Convert data to baseband (complex result) using quadrature LO. twopi=8*atan(1.d0) diff --git a/deep65.f b/deep65.F similarity index 92% rename from deep65.f rename to deep65.F index 1ac1e36c7..8a084297b 100644 --- a/deep65.f +++ b/deep65.F @@ -8,7 +8,7 @@ character*22 decoded,deepmsg character*22 testmsg(2*MAXCALLS + 2 + MAXRPT) character*15 callgrid(MAXCALLS) - character*80 line + character*180 line character*4 rpt(MAXRPT) logical first integer ncode(63,2*MAXCALLS) @@ -42,8 +42,12 @@ if(ichar(grid(3:3)).eq.0) grid(3:3)=' ' if(ichar(grid(4:4)).eq.0) grid(4:4)=' ' else - read(23,1002,end=20) line - 1002 format(a80) +C read(23,'A80',END=20) line !FIXME: Segfault happened here. + read(23,1002,end=20) line !FIXME: Segfault happened here. + 1002 format (A80) +C Probably due to line only being 80 chars long, and the read not +C limiting the read. +C 1002 format(A80) if(line(1:2).eq.'//') go to 10 i1=index(line,',') if(i1.lt.4) go to 10 diff --git a/detect.f b/detect.f index 6bc10af47..82acbab42 100644 --- a/detect.f +++ b/detect.f @@ -19,10 +19,10 @@ C Compute powers at the tone frequencies using 1-sample steps. csum=csum+c(i) enddo - y(1)=real(csum)**2 + imag(csum)**2 + y(1)=real(csum)**2 + aimag(csum)**2 do i=2,npts-(NSPD-1) csum=csum-c(i-1)+c(i+NSPD-1) - y(i)=real(csum)**2 + imag(csum)**2 + y(i)=real(csum)**2 + aimag(csum)**2 enddo return diff --git a/fivehz.f90 b/fivehz.F90 similarity index 100% rename from fivehz.f90 rename to fivehz.F90 diff --git a/fivehz.h b/fivehz.h new file mode 100644 index 000000000..9a9717e17 --- /dev/null +++ b/fivehz.h @@ -0,0 +1,5 @@ +#include + +void addnoise_(int16_t *n2); +void fivehztx_(void); +void fivehz_(void); diff --git a/ftn_init.f90 b/ftn_init.F90 similarity index 100% rename from ftn_init.f90 rename to ftn_init.F90 diff --git a/gcom1.f90 b/gcom1.f90 index e9515b5bd..abbb013f4 100644 --- a/gcom1.f90 +++ b/gcom1.f90 @@ -2,8 +2,8 @@ !--------------------------------------------------------------------------- integer NRXMAX !Max length of Rx ring buffers integer NTXMAX !Max length of Tx waveform in samples -parameter(NRXMAX=2048*1024) -parameter(NTXMAX=150*11025) +parameter(NRXMAX=2097152) ! =2048*1024 +parameter(NTXMAX=1653750) ! =150*11025 real*8 tbuf !Tsec at time of input callback SoundIn integer ntrbuf !(obsolete?) real*8 Tsec !Present time SoundIn,SoundOut diff --git a/get_fname.f90 b/get_fname.F90 similarity index 100% rename from get_fname.f90 rename to get_fname.F90 diff --git a/getfile.f90 b/getfile.F90 similarity index 92% rename from getfile.f90 rename to getfile.F90 index 304fd584b..cf34c1cf5 100644 --- a/getfile.f90 +++ b/getfile.F90 @@ -6,7 +6,7 @@ subroutine getfile(fname,len) use dflib #endif - parameter (NDMAX=60*11025) + parameter (NDMAX=661500) ! =60*11025 character*(*) fname include 'gcom1.f90' include 'gcom2.f90' diff --git a/horizspec.f90 b/horizspec.f90 index 0ff302411..809192ee8 100644 --- a/horizspec.f90 +++ b/horizspec.f90 @@ -39,7 +39,7 @@ subroutine horizspec(x,brightness,contrast,a) call xfft2(y,nfft) nq=nfft/4 do i=1,nq - ss(i)=real(c(i))**2 + imag(c(i))**2 + ss(i)=real(c(i))**2 + aimag(c(i))**2 enddo p=0. diff --git a/ps.f b/ps.f index 5866849a8..ff54ce245 100644 --- a/ps.f +++ b/ps.f @@ -16,7 +16,7 @@ call xfft(x,nfft) fac=1.0/nfft do i=1,nh - s(i)=fac*(real(c(i))**2 + imag(c(i))**2) + s(i)=fac*(real(c(i))**2 + aimag(c(i))**2) enddo return diff --git a/ptt_unix.c b/ptt_unix.c index 9a3faf158..f34963eea 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -63,15 +63,18 @@ int fd; /* Used for both serial and parallel */ #define TTYNAME "/dev/cuad%d" /* Use non blocking form */ #else #include -#define TTYNAME "/dev/ttyS%d" +#define TTYNAME "/dev/ttyUSB%d" #endif /* Not quite right for size but '%d + 1' should be plenty enough -db */ -#define TTYNAME_SIZE sizeof(TTYNAME)+1 +/* As TTYNAME is a string, just at 20 chars do udevd is happier. */ +/* E.g. USB serial ports appear as /dev/ttyUSB0 */ +#define TTYNAME_SIZE sizeof(TTYNAME)+20 int ptt_(int *nport, int *ntx, int *iptt) { + /* Fixme, nport should be a sting and not a number */ static int nopen=0; int control = TIOCM_RTS | TIOCM_DTR; @@ -87,6 +90,7 @@ ptt_(int *nport, int *ntx, int *iptt) s[TTYNAME_SIZE] = '\0'; /* open the device */ + printf("Opening %s\n", s); if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { fprintf(stderr, "Can't open %s.\n", s); return(1); diff --git a/runqqq.f90 b/runqqq.F90 similarity index 100% rename from runqqq.f90 rename to runqqq.F90 diff --git a/savedata.f90 b/savedata.F90 similarity index 100% rename from savedata.f90 rename to savedata.F90 diff --git a/setup65.f b/setup65.f index bfc10e8f7..1f2860802 100644 --- a/setup65.f +++ b/setup65.f @@ -52,13 +52,17 @@ C Determine the reference symbols for each data symbol. m=mdat(k) mref(k,1)=mr1 do n=1,10 !Get ref symbol before data - if((m-n.gt.0) .and. pr(m-n).gt.0.0) go to 10 + if((m-n).gt.0) then + if (pr(m-n).gt.0.0) go to 10 + endif enddo go to 12 10 mref(k,1)=m-n 12 mref(k,2)=mr2 do n=1,10 !Get ref symbol after data - if((m+n).le.nsym .and. pr(m+n).gt.0.0) go to 20 + if((m+n).le.nsym) then + if (pr(m+n).gt.0.0) go to 20 + endif enddo go to 22 20 mref(k,2)=m+n @@ -82,13 +86,17 @@ C Now do it all again, using opposite logic on pr(i) m=mdat2(k) mref2(k,1)=mr1 do n=1,10 - if((m-n.gt.0) .and. pr(m-n).lt.0.0) go to 110 + if((m-n).gt.0) then + if (pr(m-n).lt.0.0) go to 110 + endif enddo go to 112 110 mref2(k,1)=m-n 112 mref2(k,2)=mr2 do n=1,10 - if((m+n).le.nsym .and. pr(m+n).lt.0.0) go to 120 + if((m+n).le.nsym) then + if (pr(m+n).lt.0.0) go to 120 + endif enddo go to 122 120 mref2(k,2)=m+n diff --git a/spec.f90 b/spec.f90 index 423eee16e..89e2833af 100644 --- a/spec.f90 +++ b/spec.f90 @@ -141,7 +141,7 @@ subroutine spec(brightness,contrast,logmap,ngain,nspeed,a) call xfft2(x,nfft) do i=1,nq !Accumulate power spectrum - ss(i)=ss(i) + real(c(i))**2 + imag(c(i))**2 + ss(i)=ss(i) + real(c(i))**2 + aimag(c(i))**2 enddo nsum=nsum+1 diff --git a/spec2d.f b/spec2d.f index 47611ccfd..336bcae5d 100644 --- a/spec2d.f +++ b/spec2d.f @@ -34,14 +34,14 @@ C bins are shifted down 5 bins from their natural positions. sum=0. do i=1,NQ - s2(i,n)=real(c(5+i))**2 + imag(c(5+i))**2 + s2(i,n)=real(c(5+i))**2 + aimag(c(5+i))**2 sum=sum+s2(i,n) enddo s(n)=sum/NQ C Accumulate average spectrum for the whole file. do i=1,nh - psavg0(i) = psavg0(i)+ real(c(i))**2 + imag(c(i))**2 + psavg0(i) = psavg0(i)+ real(c(i))**2 + aimag(c(i))**2 enddo enddo diff --git a/spec2d65.f b/spec2d65.f index cc1417149..7ca972843 100644 --- a/spec2d65.f +++ b/spec2d65.f @@ -43,7 +43,7 @@ C Mix sync tone down to f=5*df (==> bin 6 of array cx, after FFT) call four2a(cx,nfft,1,-1,1) do i=1,77 - s(i)=s(i) + real(cx(i))**2 + imag(cx(i))**2 + s(i)=s(i) + real(cx(i))**2 + aimag(cx(i))**2 enddo else diff --git a/spec441.f b/spec441.f index 08c2de568..11fa9f2e1 100644 --- a/spec441.f +++ b/spec441.f @@ -18,7 +18,7 @@ C Returns spectral array and frequency of peak value. call move(dat(j),x,NFFT) call xfft(x,NFFT) do i=1,NH - s(i)=s(i)+real(c(i))**2 + imag(c(i))**2 + s(i)=s(i)+real(c(i))**2 + aimag(c(i))**2 enddo enddo diff --git a/ssort.f b/ssort.f index 9c4cb8f7a..972001e13 100644 --- a/ssort.f +++ b/ssort.f @@ -19,7 +19,7 @@ c = -1 means sort x in decreasing order (ignoring y) c = -2 means sort x in decreasing order and carry y along. integer kflag, n - real x(*), y(*) + real x(n), y(n) real r, t, tt, tty, ty integer i, ij, j, k, kk, l, m, nn integer il(21), iu(21) diff --git a/start_alsa.c b/start_alsa.c index af62504e8..f15ac30bc 100644 --- a/start_alsa.c +++ b/start_alsa.c @@ -4,9 +4,13 @@ #include #include #include +#include +#include "fivehz.h" -#if 0 +#if 1 #define ALSA_LOG +#endif +#if 0 #define ALSA_LOG_BUFFERS #endif #if 0 @@ -22,7 +26,7 @@ typedef struct alsa_driver_s { int open_mode; int has_pause_resume; int is_paused; - int32_t output_sample_rate, input_sample_rate; + uint32_t output_sample_rate, input_sample_rate; double sample_rate_factor; uint32_t num_channels; uint32_t bits_per_sample; @@ -75,7 +79,7 @@ static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_st int err, dir; int open_mode=1; /* NONBLOCK */ /* int open_mode=0; BLOCK */ - int32_t rate=*input_rate; + uint32_t rate=*input_rate; this->input_sample_rate=*input_rate; snd_pcm_hw_params_alloca(¶ms); @@ -83,7 +87,12 @@ static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_st err = snd_output_stdio_attach(&jcd_out, stdout, 0); this->num_channels = 2; - pcm_device="default"; + if (direction == SND_PCM_STREAM_PLAYBACK) { + pcm_device="plug:front"; + } else { + pcm_device="default"; + } + #ifdef ALSA_LOG printf("audio_alsa_out: Audio Device name = %s\n",pcm_device); printf("audio_alsa_out: Number of channels = %d\n",this->num_channels); @@ -114,8 +123,8 @@ static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_st */ err = snd_pcm_hw_params_any(this->audio_fd, params); if (err < 0) { - printf ("audio_alsa_out: broken configuration for this PCM: no configurations available: %s\n"), - snd_strerror(err); + printf ("audio_alsa_out: broken configuration for this PCM: no configurations available: %s\n", + snd_strerror(err)); goto close; } /* set interleaved access */ @@ -378,7 +387,7 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { result = snd_pcm_writen(this->audio_fd, alsa_playback_buffers, this->period_size); this->tx_offset += this->period_size; if (result != this->period_size) { - printf("Playback write failed. Expected %d samples, sent only %d\n", this->period_size, result); + printf("Playback write failed. Expected %lu samples, sent only %d\n", this->period_size, result); #ifdef ALSA_PLAYBACK_LOG snd_pcm_status_t *pcm_stat; snd_pcm_status_alloca(&pcm_stat); @@ -387,6 +396,7 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) { #endif } fivehztx_(); //Call fortran routine + return result; } int capture_callback(alsa_driver_t *alsa_driver_capture) { @@ -431,6 +441,7 @@ int capture_callback(alsa_driver_t *alsa_driver_capture) { snd_pcm_status_dump(pcm_stat, jcd_out); #endif fivehz_(); //Call fortran routine + return result; } int playback_xrun(alsa_driver_t *alsa_driver_playback) { @@ -441,6 +452,7 @@ int playback_xrun(alsa_driver_t *alsa_driver_playback) { snd_pcm_status(this->audio_fd, pcm_stat); snd_pcm_status_dump(pcm_stat, jcd_out); snd_pcm_prepare(this->audio_fd); + return 0; } int capture_xrun(alsa_driver_t *alsa_driver_capture) { @@ -450,6 +462,7 @@ int capture_xrun(alsa_driver_t *alsa_driver_capture) { printf("capture xrun\n"); snd_pcm_status(this->audio_fd, pcm_stat); snd_pcm_status_dump(pcm_stat, jcd_out); + return 0; } void ao_alsa_loop(void *iarg) { @@ -478,9 +491,9 @@ void ao_alsa_loop(void *iarg) { capture_index = nfds; nfds += capture_nfds; while(1) { - if (poll (pfd, nfds, 100000) < 0) { + if (poll (pfd, nfds, 200000) < 0) { printf("poll failed\n"); - return; + continue; } snd_pcm_poll_descriptors_revents(alsa_driver_playback.audio_fd, &pfd[0], playback_nfds, &playback_revents); snd_pcm_poll_descriptors_revents(alsa_driver_capture.audio_fd, &pfd[capture_index], capture_nfds, &capture_revents); @@ -506,7 +519,7 @@ void ao_alsa_loop(void *iarg) { return; } -extern void decode1_(int *iarg); +void decode1_(void *iarg); int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int *nbuflen, int *iwrite, short iwave[], @@ -517,7 +530,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], { pthread_t thread1,thread2; int iret1,iret2; - int iarg1 = 1,iarg2 = 2; + int iarg1 = 1; //int32_t rate=11025; int32_t rate=*nfsample; alsa_driver_capture.app_buffer_y1 = y1; @@ -537,7 +550,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_playback.transmitting = Transmitting; alsa_driver_playback.ndsec = ndsec; // printf("start_threads: creating thread for decode1\n"); - iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); + iret1 = pthread_create(&thread1,NULL,(void*)&decode1_,&iarg1); /* Open audio card. */ printf("Using ALSA sound.\n"); ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); @@ -546,9 +559,10 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], /* * Start audio io thread */ - iret2 = pthread_create(&thread2, NULL, ao_alsa_loop, NULL); + iret2 = pthread_create(&thread2, NULL, (void *)&ao_alsa_loop, NULL); snd_pcm_prepare(alsa_driver_capture.audio_fd); snd_pcm_start(alsa_driver_capture.audio_fd); snd_pcm_prepare(alsa_driver_playback.audio_fd); //snd_pcm_start(alsa_driver_playback.audio_fd); + return 0; } diff --git a/sync.f b/sync.f index d8b317c1f..edb438829 100644 --- a/sync.f +++ b/sync.f @@ -2,13 +2,15 @@ C Input data are in the y# arrays: detected sigs in four tone-channels, C before decimation by NSPD. - + parameter (NSPD=25) real y1(npts) real y2(npts) real y3(npts) real y4(npts) real zf(NSPD) + real tmp1 + real tmp2 complex csum integer nsum(NSPD) real z(65538) !Ready for FSK110 @@ -51,7 +53,7 @@ C Now find the apparent baud rate. ia=391.0/df !Was 341/df ib=491.0/df !Was 541/df do i=ia,ib - z(i)=real(cz(i))**2 + imag(cz(i))**2 + z(i)=real(cz(i))**2 + aimag(cz(i))**2 if(z(i).gt.zmax) then zmax=z(i) baud=df*i @@ -64,7 +66,9 @@ C Find phase of signal at 441 Hz. pha=j*twopi/NSPD csum=csum+zf(j)*cmplx(cos(pha),-sin(pha)) enddo - pha=-atan2(imag(csum),real(csum)) + tmp1=aimag(csum) + tmp2=real(csum) + pha=-atan2(tmp1,tmp2) jpk=nint(NSPD*pha/twopi) if(jpk.lt.1) jpk=jpk+NSPD diff --git a/syncf0.f b/syncf0.f index 71207d331..0ac308db4 100644 --- a/syncf0.f +++ b/syncf0.f @@ -10,7 +10,7 @@ C Finds sync tone and determines aproximate values for jstart and f0. complex z equivalence (x,cx) - ps(z)=real(z)**2 + imag(z)**2 !Power spectrum function + ps(z)=real(z)**2 + aimag(z)**2 !Power spectrum function call zero(s2,6*128) !Clear average df=11025./512. diff --git a/syncf1.f b/syncf1.f index 819c871da..11a909643 100644 --- a/syncf1.f +++ b/syncf1.f @@ -17,7 +17,7 @@ C Returns a refined value of f0, the sync-tone frequency. complex z equivalence (x,c) - ps(z)=real(z)**2 + imag(z)**2 !Power spectrum ASF + ps(z)=real(z)**2 + aimag(z)**2 !Power spectrum ASF C Accumulate a high-resolution average spectrum df=11025.0/NFFT diff --git a/synct.f b/synct.f index 90ab90ab0..541e87bc4 100644 --- a/synct.f +++ b/synct.f @@ -10,7 +10,7 @@ C Gets a refined value of jstart. complex c,c1,zz common/hcom/c(NMAX) - ps(zz)=real(zz)**2 + imag(zz)**2 !Power spectrum function + ps(zz)=real(zz)**2 + aimag(zz)**2 !Power spectrum function C Convert data to baseband (complex result) using quadrature LO. twopi=8*atan(1.d0) diff --git a/wsjt.py b/wsjt.py index c94360e8b..1baed18e8 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw @@ -1279,13 +1279,14 @@ def update(): azdist() g.nfreq=nfreq.get() - g.AzSun,g.ElSun,g.AzMoon,g.ElMoon,g.AzMoonB,g.ElMoonB,g.ntsky, \ - g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \ - g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \ - g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \ - utchours,nfreq.get(),options.MyGrid.get().upper(), \ - options.auxra.get()+' '[:9], \ - options.auxdec.get()+' '[:9]) + if Audio.gcom2.ndecoding==0: + g.AzSun,g.ElSun,g.AzMoon,g.ElMoon,g.AzMoonB,g.ElMoonB,g.ntsky, \ + g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \ + g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \ + g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \ + utchours,nfreq.get(),options.MyGrid.get().upper(), \ + options.auxra.get()+' '[:9], \ + options.auxdec.get()+' '[:9]) if mode.get()[:4]=='JT65' or mode.get()[:2]=='CW' : graph2.delete(ALL) diff --git a/wsjt1.f b/wsjt1.F similarity index 100% rename from wsjt1.f rename to wsjt1.F diff --git a/wsjtgen.f90 b/wsjtgen.F90 similarity index 96% rename from wsjtgen.f90 rename to wsjtgen.F90 index 70437213c..e2e695489 100644 --- a/wsjtgen.f90 +++ b/wsjtgen.F90 @@ -12,7 +12,7 @@ subroutine wsjtgen parameter (NMSGMAX=28) !Max characters per message parameter (NSPD=25) !Samples per dit parameter (NDPC=3) !Dits per character - parameter (NWMAX=60*11025) !Max length of waveform + parameter (NWMAX=661500) !Max length of waveform = 60*11025 parameter (NTONES=4) !Number of FSK tones integer itone(84) @@ -74,10 +74,13 @@ subroutine wsjtgen go to 999 14 read(18) hdr if(ndata.gt.NTxMax) ndata=NTxMax - nwave=ndata - call rfile(18,iwave,2*nwave,ierr) + call rfile(18,iwave,ndata,ierr) close(18) if(ierr.ne.0) print*,'Error reading test file ',msg(2:) + nwave=ndata/2 + do i=nwave,NTXMAX + iwave(i)=0 + enddo endif go to 999 endif From 0fd52833aa95d51aa180cb5768049a250cb82c57 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 10 Apr 2006 20:43:44 +0000 Subject: [PATCH 101/811] fivehz.F90: increased txdelay and fixed a T/R timing bug. deep65.f: detect logical end of data in CALL3.TXT astro.f: remove refraction adjustments from sun/moon elevation MoonDop.f: fixed 100 s offset in epoch of moon Az/El wsjt.py: Increased text height for CW mode git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@156 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- MoonDop.f | 4 ++-- astro.F | 20 ++++++++++---------- deep65.F | 7 ++----- fivehz.F90 | 37 +++++++++++++++++++++---------------- wsjt.py | 2 +- wsjtrc.win | 6 +++--- 6 files changed, 39 insertions(+), 37 deletions(-) diff --git a/MoonDop.f b/MoonDop.f index bef0f73f7..49ae97bad 100644 --- a/MoonDop.f +++ b/MoonDop.f @@ -43,11 +43,11 @@ C NB: geodetic latitude used here, but geocentric latitude used when C determining Earth-rotation contribution to Doppler. call moon2(nyear,month,nDay,UT-dt/3600.d0,dlong1*rad,dlat*rad, - + RA,Dec,topRA,topDec,LST,HA,Az,El,dist) + + RA,Dec,topRA,topDec,LST,HA,Az0,El0,dist) call toxyz(RA/rad,Dec/rad,dist,rme0) !Convert to rectangular coords call moon2(nyear,month,nDay,UT,dlong1*rad,dlat*rad, - + RA,Dec,topRA,topDec,LST,HA,Az0,El0,dist) + + RA,Dec,topRA,topDec,LST,HA,Az,El,dist) call toxyz(RA/rad,Dec/rad,dist,rme) !Convert to rectangular coords phi=LST*twopi/24.d0 diff --git a/astro.F b/astro.F index 992582658..a6b2ebc61 100644 --- a/astro.F +++ b/astro.F @@ -52,11 +52,11 @@ C NB: may want to smooth the Tsky map to 10 degrees or so. call sun(nyear,month,nday,uth,lon,lat,RASun,DecSun,LST, + AzSun,ElSun,mjd) - If(NStation.eq.1 .and. ElSun.gt.-2.0) then - arg=ElSun + 8.6/(ElSun+4.4) - refraction=0.0167/tan(arg/rad) !Refraction in degrees - ElSun=ElSun+refraction - endif +! If(NStation.eq.1 .and. ElSun.gt.-2.0) then +! arg=ElSun + 8.6/(ElSun+4.4) +! refraction=0.0167/tan(arg/rad) !Refraction in degrees +! ElSun=ElSun+refraction +! endif mjd2=mjd freq=nfreq*1.e6 @@ -71,11 +71,11 @@ C Compute spatial polarization offset if(NStation.eq.1) poloffset1=rad*atan2(yy,xx) if(NStation.eq.2) poloffset2=rad*atan2(yy,xx) - If(NStation.eq.1 .and. ElMoon.gt.-2.0) then - arg=ElMoon + 8.6/(ElMoon+4.4) - refraction=0.0167/tan(arg/rad) !Refraction in degrees - ElMoon=ElMoon+refraction - endif +! If(NStation.eq.1 .and. ElMoon.gt.-2.0) then +! arg=ElMoon + 8.6/(ElMoon+4.4) +! refraction=0.0167/tan(arg/rad) !Refraction in degrees +! ElMoon=ElMoon+refraction +! endif techo=2.0 * dist/2.99792458e5 !Echo delay time doppler=-freq*vr/2.99792458e5 !One-way Doppler diff --git a/deep65.F b/deep65.F index 8a084297b..9a6c63676 100644 --- a/deep65.F +++ b/deep65.F @@ -42,12 +42,9 @@ if(ichar(grid(3:3)).eq.0) grid(3:3)=' ' if(ichar(grid(4:4)).eq.0) grid(4:4)=' ' else -C read(23,'A80',END=20) line !FIXME: Segfault happened here. - read(23,1002,end=20) line !FIXME: Segfault happened here. + read(23,1002,end=20) line 1002 format (A80) -C Probably due to line only being 80 chars long, and the read not -C limiting the read. -C 1002 format(A80) + if(line(1:4).eq.'ZZZZ') go to 20 if(line(1:2).eq.'//') go to 10 i1=index(line,',') if(i1.lt.4) go to 10 diff --git a/fivehz.F90 b/fivehz.F90 index 8bcd53857..53ba447e1 100644 --- a/fivehz.F90 +++ b/fivehz.F90 @@ -30,7 +30,7 @@ subroutine fivehz if(first) then rxdelay=0.2 - txdelay=0.2 + txdelay=0.4 tlatency=1.0 first=.false. iptt=0 @@ -63,7 +63,8 @@ subroutine fivehz tx2=trperiod-(tlatency+txdelay) !Time to turn TX off if(mode(1:4).eq.'JT65') then if(nwave.lt.126*4096) nwave=126*4096 - tx2=nwave/11025.0 + tlatency + tx2=txdelay + nwave/11025.0 + if(tx2.gt.(trperiod-2.0)) tx2=trperiod-tlatency-1.0 endif if(TxFirst.eq.0) then @@ -120,15 +121,14 @@ subroutine fivehz ! If PTT was just raised, start a countdown for raising TxOK: nc1a=txdelay/0.18576 if(nc1a.lt.2) nc1a=2 - if(mode(1:4).eq.'JT65') nc1a=2 !No extra delay for JT65 - if(iptt.eq.1 .and. iptt0.eq.0) nc1=-nc1a + if(iptt.eq.1 .and. iptt0.eq.0) nc1=-nc1a-1 if(nc1.le.0) nc1=nc1+1 if(nc1.eq.0) TxOK=1 ! We are transmitting ! If TxOK was just lowered, start a countdown for lowering PTT: nc0a=(tlatency+txdelay)/0.18576 - if(nc0a.lt.4) nc0a=4 - if(TxOK.eq.0 .and. TxOKz.eq.1 .and. iptt.eq.1) nc0=-nc0a + if(nc0a.lt.5) nc0a=5 + if(TxOK.eq.0 .and. TxOKz.eq.1 .and. iptt.eq.1) nc0=-nc0a-1 if(nc0.le.0) nc0=nc0+1 if(nc0.eq.0) i3=ptt(nport,0,iptt) @@ -146,18 +146,23 @@ subroutine fivehz ibuf00=ibuf0 endif -! if(ndebug.ne.0) then -! t60=mod(tsec,60.d0) -! if(iptt.ne.iptt0) then -! if(iptt.eq.1) tstart=tsec -! if(iptt.eq.0) write(*,1101) tsec-tstop,t60,t,tx1,tx2 -!1101 format('Delay1:',2f7.2,3f10.1) +! Diagnostic timing information: +! t60=mod(tsec,60.d0) +! t120=mod(tsec,120.d0) +! if(TxOK.ne.TxOKz) then +! if(TxOK.eq.1) write(*,1101) 'D2:',t120,t +!1101 format(a3,2f8.1,i8) +! if(TxOK.eq.0) then +! tstop=tsec +! write(*,1101) 'D3:',t120,t,nc0a ! endif -! if(TxOK.ne.TxOKz) then -! if(TxOK.eq.0) tstop=tsec -! if(TxOK.eq.1) write(*,1102) tsec-tstart,t60,t,tx1,tx2 -!1102 format('Delay2:',2f7.2,3f10.1) +! endif +! if(iptt.ne.iptt0) then +! if(iptt.eq.1) then +! tstart=tsec +! write(*,1101) 'D1:',t120,t,nc1a ! endif +! if(iptt.eq.0) write(*,1101) 'D4:',t120,t ! endif iptt0=iptt diff --git a/wsjt.py b/wsjt.py index 1baed18e8..8660cc5a9 100644 --- a/wsjt.py +++ b/wsjt.py @@ -606,7 +606,7 @@ def ModeCW(event=NONE): mode.set("CW") Audio.gcom1.trperiod=ncwtrperiod iframe4b.pack_forget() - text.configure(height=1) + text.configure(height=9) bclravg.configure(state=DISABLED) binclude.configure(state=DISABLED) bexclude.configure(state=DISABLED) diff --git a/wsjtrc.win b/wsjtrc.win index 045f70637..878089ec8 100644 --- a/wsjtrc.win +++ b/wsjtrc.win @@ -1,6 +1,6 @@ -*font: Arial 8 -*Label*font: Arial 8 -*Text*font: "Courier New" 9 +*font: Arial 9 +*Label*font: Arial 9 +*Text*font: "Courier New" 10 *background: gray85 *Text*background: white *Entry*background: white From 9506e46c52a90b523c1c746e7c19d4100a217fd7 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 10 Apr 2006 20:59:36 +0000 Subject: [PATCH 102/811] Corrected disgnostic prints in fivehz.F90. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@157 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- fivehz.F90 | 11 +++++------ wsjt.py | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fivehz.F90 b/fivehz.F90 index 53ba447e1..06834f88a 100644 --- a/fivehz.F90 +++ b/fivehz.F90 @@ -148,21 +148,20 @@ subroutine fivehz ! Diagnostic timing information: ! t60=mod(tsec,60.d0) -! t120=mod(tsec,120.d0) ! if(TxOK.ne.TxOKz) then -! if(TxOK.eq.1) write(*,1101) 'D2:',t120,t -!1101 format(a3,2f8.1,i8) +! if(TxOK.eq.1) write(*,1101) 'D2:',t +!1101 format(a3,f8.1,i8) ! if(TxOK.eq.0) then ! tstop=tsec -! write(*,1101) 'D3:',t120,t,nc0a +! write(*,1101) 'D3:',t,nc0a ! endif ! endif ! if(iptt.ne.iptt0) then ! if(iptt.eq.1) then ! tstart=tsec -! write(*,1101) 'D1:',t120,t,nc1a +! write(*,1101) 'D1:',t,nc1a ! endif -! if(iptt.eq.0) write(*,1101) 'D4:',t120,t +! if(iptt.eq.0) write(*,1101) 'D4:',t ! endif iptt0=iptt diff --git a/wsjt.py b/wsjt.py index 8660cc5a9..55ca484d5 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw From 4dc7caf73c3f418c408fe06c0187054cbf1eb687 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 10 Apr 2006 23:42:13 +0000 Subject: [PATCH 103/811] Fixed logic for transmission of test files in wsjtgen.F90. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@158 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjtgen.F90 | 35 +++++++++++++++++------------------ wsjtrc.win | 6 +++--- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/wsjtgen.F90 b/wsjtgen.F90 index e2e695489..1ee6de1d9 100644 --- a/wsjtgen.F90 +++ b/wsjtgen.F90 @@ -60,30 +60,29 @@ subroutine wsjtgen if(msg(1:1).eq.'@') then if(msg(2:2).eq.'/' .or. ichar(msg(2:2)).eq.92) then - if(msg(2:).ne.testfile) then - testfile=msg(2:) - + txmsg=msg + testfile=msg(2:) #ifdef Win32 - open(18,file=testfile,form='binary',status='old',err=12) + open(18,file=testfile,form='binary',status='old',err=12) #else - open(18,file=testfile,form='unformatted',status='old',err=12) + open(18,file=testfile,form='unformatted',status='old',err=12) #endif - go to 14 -12 print*,'Cannot open test file ',msg(2:) - go to 999 -14 read(18) hdr - if(ndata.gt.NTxMax) ndata=NTxMax - call rfile(18,iwave,ndata,ierr) - close(18) - if(ierr.ne.0) print*,'Error reading test file ',msg(2:) - nwave=ndata/2 - do i=nwave,NTXMAX - iwave(i)=0 - enddo - endif + go to 14 +12 print*,'Cannot open test file ',msg(2:) + go to 999 +14 read(18) hdr + if(ndata.gt.NTxMax) ndata=NTxMax + call rfile(18,iwave,ndata,ierr) + close(18) + if(ierr.ne.0) print*,'Error reading test file ',msg(2:) + nwave=ndata/2 + do i=nwave,NTXMAX + iwave(i)=0 + enddo go to 999 endif + ! Transmit a fixed tone at specified frequency freq=1000.0 diff --git a/wsjtrc.win b/wsjtrc.win index 878089ec8..045f70637 100644 --- a/wsjtrc.win +++ b/wsjtrc.win @@ -1,6 +1,6 @@ -*font: Arial 9 -*Label*font: Arial 9 -*Text*font: "Courier New" 10 +*font: Arial 8 +*Label*font: Arial 8 +*Text*font: "Courier New" 9 *background: gray85 *Text*background: white *Entry*background: white From 8a623f6cab2d1935703ffd18e12f24a15a3809d1 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 11 Apr 2006 14:01:58 +0000 Subject: [PATCH 104/811] Corrected switch-overs between normal transmissions and test files. Highlight test-file transmissions in pink. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@159 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 5 +++-- wsjtgen.F90 | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wsjt.py b/wsjt.py index 55ca484d5..af5d98472 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw @@ -1396,8 +1396,9 @@ def update(): # t="Transmitting: " # t="Txing: "+t[:nmsg] bgcolor='yellow' - if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' #Shorthand + if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' #Shorthand (lt blue) if Audio.gcom2.sendingsh==-1: bgcolor='red' #Plain Text + if Audio.gcom2.sendingsh==2: bgcolor='pink' #Test file if txsnrdb<90.0: bgcolor='orange' #Simulation mode if Audio.gcom2.ntxnow==1: tx1.configure(bg=bgcolor) elif Audio.gcom2.ntxnow==2: tx2.configure(bg=bgcolor) diff --git a/wsjtgen.F90 b/wsjtgen.F90 index 1ee6de1d9..1ce2bca99 100644 --- a/wsjtgen.F90 +++ b/wsjtgen.F90 @@ -80,6 +80,8 @@ subroutine wsjtgen do i=nwave,NTXMAX iwave(i)=0 enddo + sending=txmsg + sendingsh=2 go to 999 endif From 5e6057ab4a1584f31f8be7ad5b2e76df80fc6021 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Thu, 13 Apr 2006 04:48:28 +0000 Subject: [PATCH 105/811] - missing ; git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@160 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_oss.c b/start_oss.c index 92fa25b29..a894070e8 100644 --- a/start_oss.c +++ b/start_oss.c @@ -229,7 +229,7 @@ oss_loop(int *iarg) ia=*(data.iwrite); ib=*(data.ibuf); data.tbuf[ib-1] = stime; /* convert to c index to store */ - ib++ + ib++; if(ib>FRAMESPERBUFFER) ib=1; *(data.ibuf) = ib; From f23845bac2211b986b07d0c2556f9580e1e28ce3 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Thu, 13 Apr 2006 04:50:00 +0000 Subject: [PATCH 106/811] - add --enable-g95 and --enable-gfortran hooks - add start of --enable-jack support git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@161 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 11 +- configure | 3066 ++++++++++++++++++++------------------------------ configure.ac | 82 +- 3 files changed, 1288 insertions(+), 1871 deletions(-) diff --git a/Makefile.in b/Makefile.in index 88443a8ec..6e972d920 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,15 +18,14 @@ FFLAGS += -Wall -fbounds-check -fno-second-underscore -ffixed-line-length-none - ${CC} ${CPPFLAGS} ${CFLAGS} -c -o ${<:.c=.o} $< .f.o: - ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f=.o} $< + ${FC} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.f=.o} $< .F90.o: - ${G95} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.F90=.o} $< + ${FC} ${CPPFLAGS} ${FFLAGS} -c -o ${<:.F90=.o} $< OS=@OS@ -G95=@G95@ -COMPILER=@G95_LIB_PATH@ -FC=@G95@ +FC=@FC@ +COMPILER += @FC_LIB_PATH@ LDFLAGS += -L${COMPILER} LDFLAGS += -lg2c @@ -104,7 +103,7 @@ wsjt6: Audio.so #wsjt.spec Audio.so: $(OBJS2C) $(OBJS3C) $(OBJS2F77) $(SRCS2F90) $(AUDIOSRCS) ${F2PY} -c --quiet --opt="-O ${CFLAGS} \ -fno-second-underscore" $(OBJS2C) $(OBJS2F77) -m Audio \ - --f77exec=${G95} --f90exec=${G95} ${CPPFLAGS} ${LDFLAGS} \ + --f77exec=${FC} --f90exec=${FC} ${CPPFLAGS} ${LDFLAGS} \ only: $(F2PYONLY) \ : $(SRCS2F90) \ ${SRCS3C} ${AUDIOSRCS} diff --git a/configure b/configure index 7c3eb9082..7d8a64e85 100755 --- a/configure +++ b/configure @@ -1,12 +1,21 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for wsjt 5.9.2. +# Generated by GNU Autoconf 2.53 for wsjt 5.9.2. # -# $Id: configure.ac 127 2006-02-20 20:46:33Z va3db $ +# $Id: configure.ac 155 2006-04-05 20:07:32Z jcdutton $ # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + + ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -15,57 +24,46 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi -DUALCASE=1; export DUALCASE # for MKS sh +# NLS nuisances. # Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; 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 +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -76,7 +74,6 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -87,15 +84,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conf$$.sh + rm -f conftest.sh fi @@ -143,8 +140,6 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -217,20 +212,13 @@ else fi rm -f conf$$ conf$$.exe conf$$.file -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - as_executable_p="test -f" # 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'" +as_tr_cpp="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'" +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS @@ -240,7 +228,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } # Name of the host. @@ -254,7 +242,6 @@ exec 6>&1 # Initializations. # ac_default_prefix=/usr/local -ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= @@ -311,8 +298,6 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT F77 FFLAGS ac_ct_F77 CPP EGREP SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RM CP MV LN SED AR LD TEST PYTHON F2PY G95 G95_LIB_PATH OS CLOBBER AUDIO LIBOBJS LTLIBOBJS' -ac_subst_files='' # Initialize some variables set by options. ac_init_help= @@ -670,7 +655,7 @@ done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -710,10 +695,10 @@ if test -z "$srcdir"; then # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -736,9 +721,6 @@ if test ! -r $srcdir/$ac_unique_file; then { (exit 1); exit 1; }; } fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias @@ -813,9 +795,9 @@ _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -857,8 +839,11 @@ Optional Features: --enable-alsa Force ALSA SOUNDCARD usage. --enable-oss Force OSS SOUND usage. --enable-portaudio Force PORTAUDIO SOUND usage. + --enable-jack Force JACK usage. --enable-parallel Force PARALLEL port usage for ptt. --enable-serial Force SERIAL port usage for ptt. + --enable-g95 Use G95 compiler if available. + --enable-gfortran Use gfortran compiler if available. Some influential environment variables: CC C compiler command @@ -907,45 +892,12 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. @@ -956,13 +908,13 @@ esac echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd "$ac_popdir" + cd $ac_popdir done fi @@ -970,13 +922,14 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF wsjt configure 5.9.2 -generated by GNU Autoconf 2.59 +generated by GNU Autoconf 2.53 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 127 2006-02-20 20:46:33Z va3db $ +$Id: configure.ac 155 2006-04-05 20:07:32Z jcdutton $ _ACEOF exit 0 fi @@ -986,7 +939,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by wsjt $as_me 5.9.2, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.53. Invocation command line was $ $0 $@ @@ -1038,54 +991,27 @@ _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_sep= -ac_must_keep_next=false -for ac_pass in 1 2 +for ac_arg 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=`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_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done + case $ac_arg in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n ) continue ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + esac + # Get rid of the leading space. 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 @@ -1096,7 +1022,6 @@ trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo - cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## @@ -1109,45 +1034,16 @@ _ASBOX case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## @@ -1155,14 +1051,14 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + sed "/^$/d" confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && + rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1242,7 +1138,7 @@ fi # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" @@ -1259,13 +1155,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -1321,7 +1217,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - OLD_CFLAGS="$CFLAGS" @@ -1529,7 +1424,9 @@ if test $ac_prog_rejected = yes; then # 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+' '}$@" + set dummy "$as_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" fi fi fi @@ -1634,10 +1531,8 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. @@ -1661,12 +1556,15 @@ ac_compiler=`set X $ac_compile; echo $2` (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. */ +#line $LINENO "configure" +#include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -1676,12 +1574,12 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.exe" # 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. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 @@ -1695,39 +1593,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue +for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; esac done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi @@ -1754,11 +1639,9 @@ if test "$cross_compiling" != yes; then cross_compiling=yes else { { 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 +If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} +If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi @@ -1766,7 +1649,7 @@ fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. @@ -1786,21 +1669,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 # 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 +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + export ac_cv_exeext + break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi @@ -1817,12 +1697,15 @@ if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -1839,19 +1722,16 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} { (exit 1); exit 1; }; } fi @@ -1867,12 +1747,15 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -1886,20 +1769,11 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1908,11 +1782,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -1928,12 +1801,15 @@ if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -1944,20 +1820,11 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1966,11 +1833,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 @@ -1989,120 +1855,6 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=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 -#include -#include -#include -/* 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 -std1 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 -std1. */ -int osf4_cc_array ['\x00' == 0 ? 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 -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide @@ -2114,27 +1866,19 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ - '' \ + ''\ + '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ @@ -2142,13 +1886,16 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration +#line $LINENO "configure" +#include "confdefs.h" #include +$ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2159,20 +1906,11 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2181,18 +1919,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 continue fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2203,20 +1943,11 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2225,10 +1956,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then @@ -2239,10 +1969,9 @@ fi else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2260,7 +1989,7 @@ 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 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + for ac_prog in g77 f77 xlf cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc 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 @@ -2302,7 +2031,7 @@ fi fi if test -z "$F77"; then ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + for ac_prog in g77 f77 xlf cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -2347,7 +2076,7 @@ fi # Provide some information about the compiler. -echo "$as_me:2350:" \ +echo "$as_me:2079:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -2365,10 +2094,9 @@ ac_compiler=`set X $ac_compile; echo $2` ac_status=$? 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.) +# input file. ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 @@ -2386,20 +2114,11 @@ else _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2408,17 +2127,17 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext +G77=`test $ac_compiler_gnu = yes && echo yes` ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= @@ -2435,20 +2154,11 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2457,11 +2167,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 @@ -2469,20 +2178,18 @@ echo "${ECHO_T}$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 + if test "$G77" = yes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then + if test "$G77" = yes; then FFLAGS="-O2" else FFLAGS= fi fi - -G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2552,11 +2259,8 @@ else ac_func_search_save_LIBS=$LIBS ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -2565,6 +2269,12 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2575,20 +2285,11 @@ strerror (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2597,20 +2298,15 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_search_strerror="none required" else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_strerror" = no; then for ac_lib in cposix; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -2619,6 +2315,12 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2629,20 +2331,11 @@ strerror (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2652,11 +2345,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS @@ -2668,6 +2359,103 @@ if test "$ac_cv_search_strerror" != no; then fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include +#include +/* 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; +} +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; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then @@ -2676,34 +2464,21 @@ else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } +static $ac_kw int static_foo () {return 0; } +$ac_kw int foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2712,30 +2487,25 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 - - case $ac_cv_c_inline in inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif + no) +cat >>confdefs.h <<\_ACEOF +#define inline _ACEOF - ;; + ;; + *) cat >>confdefs.h <<_ACEOF +#define inline $ac_cv_c_inline +_ACEOF + ;; esac ac_ext=c @@ -2761,34 +2531,24 @@ 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 to if __STDC__ is defined, since - # 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 -#else -# include -#endif - Syntax error +#line $LINENO "configure" +#include "confdefs.h" +#include + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2799,8 +2559,7 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi @@ -2809,24 +2568,20 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent 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. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2838,8 +2593,7 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break @@ -2868,34 +2622,24 @@ 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 to if __STDC__ is defined, since - # 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 -#else -# include -#endif - Syntax error +#line $LINENO "configure" +#include "confdefs.h" +#include + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2906,8 +2650,7 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi @@ -2916,24 +2659,20 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent 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. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2945,8 +2684,7 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break @@ -2959,10 +2697,8 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -2973,21 +2709,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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 -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 @@ -2996,16 +2717,13 @@ if test "${ac_cv_prog_gcc_traditional+set}" = set; then else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then + egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no @@ -3015,16 +2733,13 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then + egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* @@ -3038,15 +2753,15 @@ echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 fi fi -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="$(MAKE)"' + @echo 'ac_maketemp="${MAKE}"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` @@ -3103,7 +2818,6 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 @@ -3120,7 +2834,6 @@ do 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. @@ -3128,20 +2841,20 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$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 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if $as_executable_p "$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 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; @@ -3562,8 +3275,8 @@ else echo "${ECHO_T}no" >&6 fi -# Extract the first word of "gfortran", so it can be a program name with args. -set dummy gfortran; ac_word=$2 +# Extract the first word of "g95", so it can be a program name with args. +set dummy g95; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_G95+set}" = set; then @@ -3601,20 +3314,94 @@ else echo "${ECHO_T}no" >&6 fi - echo "$as_me:$LINENO: checking g95 lib path" >&5 echo $ECHO_N "checking g95 lib path... $ECHO_C" >&6 G95_LIB_PATH=`${G95} -print-file-name=` echo "$as_me:$LINENO: result: ${G95_LIB_PATH}" >&5 echo "${ECHO_T}${G95_LIB_PATH}" >&6 +# Extract the first word of "gfortran", so it can be a program name with args. +set dummy gfortran; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GFORTRAN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GFORTRAN in + [\\/]* | ?:[\\/]*) + ac_cv_path_GFORTRAN="$GFORTRAN" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GFORTRAN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -cat >>confdefs.h <<_ACEOF -#define G95_LIB_PATH "${G95_LIB_PATH}" -_ACEOF + ;; +esac +fi +GFORTRAN=$ac_cv_path_GFORTRAN -G95_LIB_PATH="${G95_LIB_PATH}" +if test -n "$GFORTRAN"; then + echo "$as_me:$LINENO: result: $GFORTRAN" >&5 +echo "${ECHO_T}$GFORTRAN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +# Extract the first word of "gfortran41", so it can be a program name with args. +set dummy gfortran41; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GFORTRAN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GFORTRAN in + [\\/]* | ?:[\\/]*) + ac_cv_path_GFORTRAN="$GFORTRAN" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GFORTRAN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; +esac +fi +GFORTRAN=$ac_cv_path_GFORTRAN + +if test -n "$GFORTRAN"; then + echo "$as_me:$LINENO: result: $GFORTRAN" >&5 +echo "${ECHO_T}$GFORTRAN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +echo "$as_me:$LINENO: checking gfortran lib path" >&5 +echo $ECHO_N "checking gfortran lib path... $ECHO_C" >&6 +GFORTRAN_LIB_PATH=`${GFORTRAN} -print-file-name=` +echo "$as_me:$LINENO: result: ${GFORTRAN_LIB_PATH}" >&5 +echo "${ECHO_T}${GFORTRAN_LIB_PATH}" >&6 echo "$as_me:$LINENO: checking OS" >&5 echo $ECHO_N "checking OS... $ECHO_C" >&6 OS=`uname` @@ -3628,67 +3415,49 @@ if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include #include #include #include -int -main () -{ - - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err 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. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then + egrep "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3700,16 +3469,13 @@ 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. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then + egrep "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3724,20 +3490,16 @@ if test $ac_cv_header_stdc = 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. */ +#line $LINENO "configure" +#include "confdefs.h" #include #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 ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -3748,7 +3510,7 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) + || toupper (i) != TOUPPER (i)) exit(2); exit (0); } @@ -3768,12 +3530,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3799,7 +3560,7 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -3808,31 +3569,19 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3841,11 +3590,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -3895,30 +3643,18 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3927,11 +3663,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3939,24 +3674,20 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3967,8 +3698,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3976,43 +3706,26 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) +case $ac_header_compiler:$ac_header_preproc in + yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------- ## -## Report this to the wsjt lists. ## -## ------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -4034,15 +3747,18 @@ if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include #include #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4054,20 +3770,11 @@ return 0; _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4076,11 +3783,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_header_time=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 @@ -4106,30 +3812,18 @@ else echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5 echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4138,11 +3832,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4150,24 +3843,20 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5 echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4178,8 +3867,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4187,36 +3875,19 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) +case $ac_header_compiler:$ac_header_preproc in + yes:no ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/soundcard.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------- ## -## Report this to the wsjt lists. ## -## ------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 @@ -4249,30 +3920,18 @@ else echo "$as_me:$LINENO: checking alsa/asoundlib.h usability" >&5 echo $ECHO_N "checking alsa/asoundlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4281,11 +3940,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4293,24 +3951,20 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking alsa/asoundlib.h presence" >&5 echo $ECHO_N "checking alsa/asoundlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4321,8 +3975,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4330,36 +3983,19 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) +case $ac_header_compiler:$ac_header_preproc in + yes:no ) { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------- ## -## Report this to the wsjt lists. ## -## ------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5 echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6 @@ -4392,30 +4028,18 @@ else echo "$as_me:$LINENO: checking portaudio.h usability" >&5 echo $ECHO_N "checking portaudio.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4424,11 +4048,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4436,24 +4059,20 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking portaudio.h presence" >&5 echo $ECHO_N "checking portaudio.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4464,8 +4083,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4473,36 +4091,19 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) +case $ac_header_compiler:$ac_header_preproc in + yes:no ) { echo "$as_me:$LINENO: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: portaudio.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) + { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) { echo "$as_me:$LINENO: WARNING: portaudio.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: portaudio.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: portaudio.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: portaudio.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: portaudio.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: portaudio.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: portaudio.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------- ## -## Report this to the wsjt lists. ## -## ------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for portaudio.h" >&5 echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 @@ -4535,30 +4136,18 @@ else echo "$as_me:$LINENO: checking samplerate.h usability" >&5 echo $ECHO_N "checking samplerate.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4567,11 +4156,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4579,24 +4167,20 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking samplerate.h presence" >&5 echo $ECHO_N "checking samplerate.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4607,8 +4191,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4616,36 +4199,19 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) +case $ac_header_compiler:$ac_header_preproc in + yes:no ) { echo "$as_me:$LINENO: WARNING: samplerate.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: samplerate.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: samplerate.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) + { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) { echo "$as_me:$LINENO: WARNING: samplerate.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: samplerate.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: samplerate.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: samplerate.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: samplerate.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: samplerate.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: samplerate.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: samplerate.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: samplerate.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: samplerate.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: samplerate.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------- ## -## Report this to the wsjt lists. ## -## ------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for samplerate.h" >&5 echo $ECHO_N "checking for samplerate.h... $ECHO_C" >&6 @@ -4678,20 +4244,11 @@ else _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4700,11 +4257,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 gcc_cv_header_string=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 gcc_cv_header_string=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 @@ -4724,12 +4280,15 @@ if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4743,20 +4302,11 @@ if (sizeof (int64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4765,11 +4315,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_int64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_int64_t" >&6 @@ -4787,12 +4336,15 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4805,20 +4357,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4827,12 +4370,15 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4845,20 +4391,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4867,28 +4404,29 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4901,20 +4439,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4923,12 +4452,15 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4941,20 +4473,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4963,36 +4486,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5005,20 +4529,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5027,37 +4542,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int64_t=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int64_t), 77 -See \`config.log' for more details." >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77" >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default long longval () { return (long) (sizeof (int64_t)); } unsigned long ulongval () { return (long) (sizeof (int64_t)); } #include #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5100,16 +4615,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int64_t), 77 -See \`config.log' for more details." >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77" >&2;} { (exit 1); exit 1; }; } fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -5130,12 +4642,15 @@ if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5149,20 +4664,11 @@ if (sizeof (long long)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5171,11 +4677,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6 @@ -5193,12 +4698,15 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5211,20 +4719,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5233,12 +4732,15 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5251,20 +4753,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5273,28 +4766,29 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5307,20 +4801,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5329,12 +4814,15 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5347,20 +4835,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5369,36 +4848,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5411,20 +4891,11 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5433,37 +4904,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77 -See \`config.log' for more details." >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77" >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default long longval () { return (long) (sizeof (long long)); } unsigned long ulongval () { return (long) (sizeof (long long)); } #include #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5506,16 +4977,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77 -See \`config.log' for more details." >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77" >&2;} { (exit 1); exit 1; }; } fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -5538,12 +5006,15 @@ if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5557,20 +5028,11 @@ if (sizeof (uint64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5579,11 +5041,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_uint64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 @@ -5594,12 +5055,15 @@ if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5613,20 +5077,11 @@ if (sizeof (int64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5635,11 +5090,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_int64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_int64_t" >&6 @@ -5651,12 +5105,15 @@ if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5670,20 +5127,11 @@ if (sizeof (uint64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5692,11 +5140,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_uint64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 @@ -5716,12 +5163,15 @@ if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5735,20 +5185,11 @@ if (sizeof (int64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5757,11 +5198,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_int64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_int64_t" >&6 @@ -5783,12 +5223,15 @@ if test "${ac_cv_type_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5802,20 +5245,11 @@ if (sizeof (u_int32_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5824,11 +5258,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_u_int32_t=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_u_int32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 @@ -5842,12 +5275,15 @@ if test "${ac_cv_type_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5861,20 +5297,11 @@ if (sizeof (uint32_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5883,11 +5310,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint32_t=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_uint32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 @@ -5921,12 +5347,15 @@ if test "${ac_cv_type_u_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5940,20 +5369,11 @@ if (sizeof (u_int16_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5962,11 +5382,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_u_int16_t=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_u_int16_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 @@ -5980,12 +5399,15 @@ if test "${ac_cv_type_uint16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5999,20 +5421,11 @@ if (sizeof (uint16_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6021,11 +5434,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint16_t=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_uint16_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 @@ -6060,14 +5472,17 @@ if test "${ac_cv_c_bigendian+set}" = set; then else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -6081,20 +5496,11 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6102,14 +5508,17 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -6123,20 +5532,11 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6145,31 +5545,32 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file + # try to guess the endianess by grep'ing values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -6180,29 +5581,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + if fgrep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then +if fgrep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -6212,17 +5604,13 @@ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then fi else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" int main () { @@ -6251,15 +5639,14 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 @@ -6273,9 +5660,9 @@ _ACEOF no) ;; *) - { { echo "$as_me:$LINENO: error: unknown endianness + { { echo "$as_me:$LINENO: error: unknown endianess presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness +echo "$as_me: error: unknown endianess presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -6294,30 +5681,18 @@ else echo "$as_me:$LINENO: checking stdarg.h usability" >&5 echo $ECHO_N "checking stdarg.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + (eval $ac_compile) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6326,11 +5701,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -6338,24 +5712,20 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking stdarg.h presence" >&5 echo $ECHO_N "checking stdarg.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#line $LINENO "configure" +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err + egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -6366,8 +5736,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -6375,36 +5744,19 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) +case $ac_header_compiler:$ac_header_preproc in + yes:no ) { echo "$as_me:$LINENO: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: stdarg.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) { echo "$as_me:$LINENO: WARNING: stdarg.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdarg.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stdarg.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stdarg.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: stdarg.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: stdarg.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: stdarg.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: stdarg.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdarg.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: stdarg.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: stdarg.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------- ## -## Report this to the wsjt lists. ## -## ------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for stdarg.h" >&5 echo $ECHO_N "checking for stdarg.h... $ECHO_C" >&6 @@ -6477,7 +5829,7 @@ _ACEOF fi - ac_config_files="$ac_config_files Makefile" +ac_config_files="$ac_config_files Makefile" @@ -6507,6 +5859,16 @@ else portaudio=no fi; + +# Check whether --enable-jack or --disable-jack was given. +if test "${enable_jack+set}" = set; then + enableval="$enable_jack" + jack=$enableval +else + jack=no +fi; + + # Check whether --enable-parallel or --disable-parallel was given. if test "${enable_parallel+set}" = set; then enableval="$enable_parallel" @@ -6524,6 +5886,67 @@ else fi; +# Check whether --enable-g95 or --disable-g95 was given. +if test "${enable_g95+set}" = set; then + enableval="$enable_g95" + g95=$enableval +else + g95=no +fi; + +# Check whether --enable-gfortran or --disable-gfortran was given. +if test "${enable_gfortran+set}" = set; then + enableval="$enable_gfortran" + gfortran=$enableval +else + gfortran=no +fi; + + +if test "$g95" = yes; then + FC_LIB_PATH=${G95_LIB_PATH} + FC=${G95} + gfortran=no +elif test "$gfortran" = yes; then + FC_LIB_PATH=${GFORTRAN_LIB_PATH} + FC=${GFORTRAN} + g95=no +fi + +if test -z $FC ; then + if test ! -z $GFORTRAN ; then + FC_LIB_PATH=${GFORTRAN_LIB_PATH} + FC=${GFORTRAN} + gfortran=yes + elif test ! -z $G95 ; then + FC_LIB_PATH=${G95_LIB_PATH} + FC=${G95} + g95=yes + fi +fi + +if test -z $FC ; then + { { echo "$as_me:$LINENO: error: You need g95 or gfortran" >&5 +echo "$as_me: error: You need g95 or gfortran" >&2;} + { (exit 1); exit 1; }; } +fi + + + +cat >>confdefs.h <<_ACEOF +#define FC_LIB_PATH "${FC_LIB_PATH}" +_ACEOF + +FC_LIB_PATH="${FC_LIB_PATH}" + + +cat >>confdefs.h <<_ACEOF +#define FC "${FC}" +_ACEOF + +FC="${FC}" + + if test "$serial" != yes -a "$parallel" != yes; then serial=yes; @@ -6585,6 +6008,17 @@ _ACEOF LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" fi +if test "$jack" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_JACK 1 +_ACEOF + + AUDIO="a2d.f90 jtaudio.c start_jack.c" + + LDFLAGS="${LDFLAGS} -ljack -lsamplerate" +fi + if test $HAS_ASOUNDLIB_H -eq 1; then cat >>confdefs.h <<\_ACEOF @@ -6666,7 +6100,7 @@ cat >confcache <<\_ACEOF # 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 +# `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. @@ -6684,13 +6118,13 @@ _ACEOF # `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" + "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 \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -6701,7 +6135,7 @@ _ACEOF t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else +if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file @@ -6720,13 +6154,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # 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[ ]*=/{ + ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; +s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; -s/^[^=]*=[ ]*$//; +s/^[^=]*=[ ]*$//; }' fi @@ -6740,13 +6174,13 @@ fi cat >confdef2opt.sed <<\_ACEOF t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g @@ -6763,21 +6197,6 @@ DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed -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_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -6792,12 +6211,11 @@ cat >$CONFIG_STATUS <<_ACEOF # 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 + ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -6806,57 +6224,46 @@ cat >>$CONFIG_STATUS <<\_ACEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi -DUALCASE=1; export DUALCASE # for MKS sh +# NLS nuisances. # Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; 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 +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -6867,7 +6274,6 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -6878,15 +6284,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conf$$.sh + rm -f conftest.sh fi @@ -6935,8 +6341,6 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -7010,20 +6414,13 @@ else fi rm -f conf$$ conf$$.exe conf$$.file -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - as_executable_p="test -f" # 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'" +as_tr_cpp="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'" +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS @@ -7033,7 +6430,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } exec 6>&1 @@ -7050,7 +6447,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by wsjt $as_me 5.9.2, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.53. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7090,11 +6487,10 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit - -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files @@ -7105,10 +6501,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ wsjt config.status 5.9.2 -configured by $0, generated by GNU Autoconf 2.59, +configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir @@ -7125,25 +6522,25 @@ do --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift ;; + -*);; *) # This is not an option, so the user has probably given explicit # arguments. - ac_option=$1 ac_need_defaults=false;; esac - case $ac_option in + case $1 in # Handling of the options. _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; + echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" + exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) @@ -7158,16 +6555,13 @@ Try \`$0 --help' for more information." >&2;} --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + shift + CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 @@ -7182,20 +6576,6 @@ Try \`$0 --help' for more information." >&2;} 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 -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - _ACEOF @@ -7222,9 +6602,6 @@ if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { @@ -7233,17 +6610,17 @@ $debug || } # Create a (secure) tmp directory for tmp files. - +: ${TMPDIR=/tmp} { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM + tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in ." >&2 + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } @@ -7302,7 +6679,6 @@ s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t @@ -7318,12 +6694,12 @@ s,@TEST@,$TEST,;t t s,@PYTHON@,$PYTHON,;t t s,@F2PY@,$F2PY,;t t s,@G95@,$G95,;t t -s,@G95_LIB_PATH@,$G95_LIB_PATH,;t t +s,@GFORTRAN@,$GFORTRAN,;t t s,@OS@,$OS,;t t s,@CLOBBER@,$CLOBBER,;t t +s,@FC_LIB_PATH@,$FC_LIB_PATH,;t t +s,@FC@,$FC,;t t s,@AUDIO@,$AUDIO,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF @@ -7353,9 +6729,9 @@ _ACEOF (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end @@ -7373,51 +6749,46 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac +done; } ac_builddir=. @@ -7444,45 +6815,12 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in @@ -7490,6 +6828,11 @@ esac *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -7499,7 +6842,7 @@ esac configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. @@ -7508,32 +6851,26 @@ esac case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo "$f";; + echo $f;; *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub @@ -7582,11 +6919,8 @@ ac_clean_files=$ac_clean_files_save # 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 + $SHELL $CONFIG_STATUS || 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. @@ -7598,6 +6932,14 @@ fi echo echo +if test $g95 == "yes"; then + echo "Using g95 as fortran compiler."; +fi + +if test $gfortran == "yes"; then + echo "Using gfortran as fortran compiler."; +fi + if test $portaudio == "yes"; then echo "Using portaudio."; fi @@ -7610,6 +6952,10 @@ if test $oss == "yes"; then echo "Using oss."; fi +if test $jack == "yes"; then + echo "Using jack."; +fi + if test $serial == "yes"; then echo "Using serial port for ptt."; fi diff --git a/configure.ac b/configure.ac index cb30a3399..1444afce5 100644 --- a/configure.ac +++ b/configure.ac @@ -81,14 +81,15 @@ AC_PATH_PROG(LD, ld) AC_PATH_PROG(TEST, [test], [test]) AC_PATH_PROG(PYTHON, python) AC_PATH_PROG(F2PY, f2py) -AC_PATH_PROG(G95, gfortran) - +AC_PATH_PROG(G95, g95) AC_MSG_CHECKING([g95 lib path]) G95_LIB_PATH=`${G95} -print-file-name=` AC_MSG_RESULT(${G95_LIB_PATH}) -AC_DEFINE_UNQUOTED(G95_LIB_PATH, "${G95_LIB_PATH}", [Path to G95 libs.]) -AC_SUBST(G95_LIB_PATH, "${G95_LIB_PATH}") - +AC_PATH_PROG(GFORTRAN, gfortran) +AC_PATH_PROG(GFORTRAN, gfortran41) +AC_MSG_CHECKING([gfortran lib path]) +GFORTRAN_LIB_PATH=`${GFORTRAN} -print-file-name=` +AC_MSG_RESULT(${GFORTRAN_LIB_PATH}) AC_MSG_CHECKING([OS]) OS=`uname` AC_SUBST(OS, "${OS}") @@ -221,6 +222,16 @@ AC_ARG_ENABLE(portaudio, AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), [portaudio=$enableval], [portaudio=no]) +dnl jack soundsupport +dnl ================= + +AC_ARG_ENABLE(jack, +AC_HELP_STRING([--enable-jack],[Force JACK usage.]), +[jack=$enableval] , [jack=no]) + +dnl serial or parallel support (temporary until python changes) +dnl =========================================================== + AC_ARG_ENABLE(parallel, AC_HELP_STRING([--enable-parallel],[Force PARALLEL port usage for ptt.]), [parallel=$enableval], [parallel=no]) @@ -229,9 +240,52 @@ AC_ARG_ENABLE(serial, AC_HELP_STRING([--enable-serial],[Force SERIAL port usage for ptt.]), [serial=$enableval], [serial=no]) +dnl pick gfortran or g95 +dnl ==================== + +AC_ARG_ENABLE(g95, +AC_HELP_STRING([--enable-g95],[Use G95 compiler if available.]), +[g95=$enableval], [g95=no]) + +AC_ARG_ENABLE(gfortran, +AC_HELP_STRING([--enable-gfortran],[Use gfortran compiler if available.]), +[gfortran=$enableval], [gfortran=no]) + dnl now set conf.h,, CPPFLAGS and CFLAGS flags as needed dnl ==================================================== +if test "$g95" = yes; then + FC_LIB_PATH=${G95_LIB_PATH} + FC=${G95} + gfortran=no +elif test "$gfortran" = yes; then + FC_LIB_PATH=${GFORTRAN_LIB_PATH} + FC=${GFORTRAN} + g95=no +fi + +if test -z $FC ; then + if test ! -z $GFORTRAN ; then + FC_LIB_PATH=${GFORTRAN_LIB_PATH} + FC=${GFORTRAN} + gfortran=yes + elif test ! -z $G95 ; then + FC_LIB_PATH=${G95_LIB_PATH} + FC=${G95} + g95=yes + fi +fi + +if test -z $FC ; then + AC_MSG_ERROR([You need g95 or gfortran]) +fi + + +AC_DEFINE_UNQUOTED(FC_LIB_PATH, "${FC_LIB_PATH}", [Path to fortran libs.]) +AC_SUBST(FC_LIB_PATH, "${FC_LIB_PATH}") +AC_DEFINE_UNQUOTED(FC, "${FC}", [Fortran compiler.]) +AC_SUBST(FC, "${FC}") + dnl set defaults dnl ============ @@ -272,6 +326,12 @@ if test "$portaudio" = yes; then LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" fi +if test "$jack" = yes; then + AC_DEFINE(USE_JACK, 1, [Define if you want JACK used.]) + AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_jack.c") + LDFLAGS="${LDFLAGS} -ljack -lsamplerate" +fi + dnl set conf flags if test $HAS_ASOUNDLIB_H -eq 1; then @@ -331,6 +391,14 @@ dnl do summary echo echo +if test $g95 == "yes"; then + echo "Using g95 as fortran compiler."; +fi + +if test $gfortran == "yes"; then + echo "Using gfortran as fortran compiler."; +fi + if test $portaudio == "yes"; then echo "Using portaudio."; fi @@ -343,6 +411,10 @@ if test $oss == "yes"; then echo "Using oss."; fi +if test $jack == "yes"; then + echo "Using jack."; +fi + if test $serial == "yes"; then echo "Using serial port for ptt."; fi From a5cb8fb7a7540ce011ed14ed9b269283f07da645 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Thu, 13 Apr 2006 15:13:25 +0000 Subject: [PATCH 107/811] - Add more support in configure for jack git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@162 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++- configure.ac | 16 +++++++ 2 files changed, 141 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 7d8a64e85..ad579685c 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 5.9.2. # -# $Id: configure.ac 155 2006-04-05 20:07:32Z jcdutton $ +# $Id: configure.ac 161 2006-04-13 04:50:00Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -929,7 +929,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 155 2006-04-05 20:07:32Z jcdutton $ +$Id: configure.ac 161 2006-04-13 04:50:00Z va3db $ _ACEOF exit 0 fi @@ -4015,6 +4015,114 @@ else fi +if test "${ac_cv_header_jack_jack_h+set}" = set; then + echo "$as_me:$LINENO: checking for jack/jack.h" >&5 +echo $ECHO_N "checking for jack/jack.h... $ECHO_C" >&6 +if test "${ac_cv_header_jack_jack_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jack_jack_h" >&5 +echo "${ECHO_T}$ac_cv_header_jack_jack_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking jack/jack.h usability" >&5 +echo $ECHO_N "checking jack/jack.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking jack/jack.h presence" >&5 +echo $ECHO_N "checking jack/jack.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: jack/jack.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: jack/jack.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: jack/jack.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: jack/jack.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: jack/jack.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for jack/jack.h" >&5 +echo $ECHO_N "checking for jack/jack.h... $ECHO_C" >&6 +if test "${ac_cv_header_jack_jack_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_jack_jack_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jack_jack_h" >&5 +echo "${ECHO_T}$ac_cv_header_jack_jack_h" >&6 + +fi +if test $ac_cv_header_jack_jack_h = yes; then + HAS_JACK_H=1 +else + HAS_JACK_H=0 +fi + + if test "${ac_cv_header_portaudio_h+set}" = set; then echo "$as_me:$LINENO: checking for portaudio.h" >&5 echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 @@ -6034,6 +6142,13 @@ _ACEOF fi +if test $HAS_JACK_H -eq 1; then + cat >>confdefs.h <<\_ACEOF +#define HAS_JACK_H 1 +_ACEOF + +fi + if test $HAS_PORTAUDIO_H -eq 1; then cat >>confdefs.h <<\_ACEOF #define HAS_PORTAUDIO_H 1 @@ -6065,6 +6180,14 @@ echo "$as_me: error: You need soundcard.h to use --enable-oss" >&2;} fi fi +if test "$jack" = yes; then + if test $HAS_JACK_H -eq 0; then + { { echo "$as_me:$LINENO: error: You need jack.h to use --enable-jack" >&5 +echo "$as_me: error: You need jack.h to use --enable-jack" >&2;} + { (exit 1); exit 1; }; } + fi +fi + if test "$portaudio" = yes; then if test $HAS_PORTAUDIO_H -eq 0; then { { echo "$as_me:$LINENO: error: You need portaudio.h to use --enable-portaudio" >&5 diff --git a/configure.ac b/configure.ac index 1444afce5..b024d1822 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,10 @@ AC_MSG_CHECKING([g95 lib path]) G95_LIB_PATH=`${G95} -print-file-name=` AC_MSG_RESULT(${G95_LIB_PATH}) AC_PATH_PROG(GFORTRAN, gfortran) +dnl +dnl FreeBSD currently installs gfortran as gfortran41, considered experimental +dnl See http://gcc.gnu.org/fortran/ +dnl AC_PATH_PROG(GFORTRAN, gfortran41) AC_MSG_CHECKING([gfortran lib path]) GFORTRAN_LIB_PATH=`${GFORTRAN} -print-file-name=` @@ -106,6 +110,7 @@ AC_HEADER_TIME AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) AC_CHECK_HEADER([alsa/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) +AC_CHECK_HEADER([jack/jack.h], [HAS_JACK_H=1], [HAS_JACK_H=0]) AC_CHECK_HEADER([portaudio.h], [HAS_PORTAUDIO_H=1], [HAS_PORTAUDIO_H=0]) AC_CHECK_HEADER([samplerate.h], [HAS_SAMPLERATE_H=1], [HAS_SAMPLERATE_H=0]) @@ -333,6 +338,7 @@ if test "$jack" = yes; then fi dnl set conf flags +dnl ============== if test $HAS_ASOUNDLIB_H -eq 1; then AC_DEFINE(HAS_ASOUNDLIB_H, 1, ) @@ -342,6 +348,10 @@ if test $HAS_SOUNDCARD_H -eq 1; then AC_DEFINE(HAS_SOUNDCARD_H, 1, ) fi +if test $HAS_JACK_H -eq 1; then + AC_DEFINE(HAS_JACK_H, 1, ) +fi + if test $HAS_PORTAUDIO_H -eq 1; then AC_DEFINE(HAS_PORTAUDIO_H, 1, ) fi @@ -365,6 +375,12 @@ if test "$oss" = yes; then fi fi +if test "$jack" = yes; then + if test $HAS_JACK_H -eq 0; then + AC_MSG_ERROR([You need jack.h to use --enable-jack]) + fi +fi + if test "$portaudio" = yes; then if test $HAS_PORTAUDIO_H -eq 0; then AC_MSG_ERROR([You need portaudio.h to use --enable-portaudio]) From 92976e89f6b84797ea6da0ecfc937f70aeb63551 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 15 Apr 2006 05:39:08 +0000 Subject: [PATCH 108/811] - Initial changes to add string names of audio devices/PTT ports git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@164 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- audio_init.F90 | 2 +- gcom1.f90 | 3 ++- gcom2.f90 | 3 ++- options.py | 11 +++++++---- specjt.py | 17 +++++++++++++---- start_oss.c | 50 +++++++++++++++++++++++++++----------------------- wsjt.py | 40 ++++++++++++++++++++++++++++++---------- 7 files changed, 82 insertions(+), 44 deletions(-) diff --git a/audio_init.F90 b/audio_init.F90 index ff6cd46b0..92bbb7c1e 100644 --- a/audio_init.F90 +++ b/audio_init.F90 @@ -70,7 +70,7 @@ subroutine audio_init(ndin,ndout) ! print*,'Audio INIT called.' ierr=start_threads(ndevin,ndevout,y1,y2,nmax,iwrite,iwave,nwave, & 11025,NSPB,TRPeriod,TxOK,ndebug,Transmitting, & - Tsec,ngo,nmode,tbuf,ibuf,ndsec) + Tsec,ngo,nmode,tbuf,ibuf,ndsec,PttPort,devin_name,devout_name) #endif diff --git a/gcom1.f90 b/gcom1.f90 index abbb013f4..192e7658c 100644 --- a/gcom1.f90 +++ b/gcom1.f90 @@ -40,12 +40,13 @@ integer nx !x coordinate for waterfall pixmap GUI integer mfsample !Measured sample rate, input SoundIn integer mfsample2 !Measured sample rate, output SoundOut integer ns0 !Time at last ALL.TXT date entry Decoder +character*12 devin_name,devout_name ! GUI common/gcom1/Tbuf(1024),ntrbuf(1024),Tsec,rxdelay,txdelay, & samfacin,samfacout,txsnrdb,y1(NRXMAX),y2(NRXMAX), & nmax,iwrite,iread,iwave(NTXMAX),nwave,TxOK,Receiving,Transmitting, & TxFirst,TRPeriod,ibuf,ibuf0,ave,rms,ngo,level,mute,newdat,ndsec, & - ndevin,ndevout,nx,mfsample,mfsample2,ns0 + ndevin,ndevout,nx,mfsample,mfsample2,ns0,devin_name,devout_name !### volatile /gcom1/ diff --git a/gcom2.f90 b/gcom2.f90 index 109858b64..bb91f4c53 100644 --- a/gcom2.f90 +++ b/gcom2.f90 @@ -79,6 +79,7 @@ character*24 decodedfile character*80 AppDir !WSJT installation directory GUI character*80 filetokilla !Filenames (full path) Decoder character*80 filetokillb +character*12 pttport common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & green(500),ngreen,dgain,iter,ndecoding,ndecoding0,mousebutton, & @@ -90,6 +91,6 @@ common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & idinterval,msmax,lenappdir,ndiskdat,nlines,nflat,ntxreq,ntxnow, & ndepth,nspecial,ndf,ss1(-224:224),ss2(-224:224), & mycall,hiscall,hisgrid,txmsg,sending,mode,fname0,fnamea, & - fnameb,decodedfile,AppDir,filetokilla,filetokillb,utcdate + fnameb,decodedfile,AppDir,filetokilla,filetokillb,utcdate,pttport !### volatile /gcom2/ diff --git a/options.py b/options.py index df7b361d6..b57025ea3 100644 --- a/options.py +++ b/options.py @@ -25,8 +25,11 @@ MyGrid=StringVar() #TxDelay=StringVar() IDinterval=IntVar() ComPort=IntVar() +PttPort=StringVar() ndevin=IntVar() ndevout=IntVar() +DevinName=StringVar() +DevoutName=StringVar() samfacin=DoubleVar() samfacout=DoubleVar() Template1=StringVar() @@ -106,12 +109,12 @@ mygrid=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Grid Locator:', ## value='0.2',entry_textvariable=TxDelay) idinterval=Pmw.EntryField(g1.interior(),labelpos=W,label_text='ID Interval (m):', value=10,entry_textvariable=IDinterval,entry_width=12) -comport=Pmw.EntryField(g1.interior(),labelpos=W,label_text='COM Port:', - value=1,entry_textvariable=ComPort,entry_width=12) +comport=Pmw.EntryField(g1.interior(),labelpos=W,label_text='PTT Port:', + value='1',entry_textvariable=PttPort,entry_width=12) audioin=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio In:', - value=0,entry_textvariable=ndevin,entry_width=12) + value='0',entry_textvariable=DevinName,entry_width=12) audioout=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio Out:', - value=0,entry_textvariable=ndevout,entry_width=12) + value='0',entry_textvariable=DevoutName,entry_width=12) ratein=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Rate In:', value=1.0000,entry_textvariable=samfacin,entry_width=12) rateout=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Rate Out:', diff --git a/specjt.py b/specjt.py index 013681974..a204f2084 100644 --- a/specjt.py +++ b/specjt.py @@ -489,10 +489,19 @@ if g.cmap == "AFMHot": #---------------------------------------------- Display GUI and start mainloop draw_axis() -Audio.gcom1.ndevin=g.ndevin.get() -Audio.gcom1.ndevout=g.ndevout.get() -ndevin=g.ndevin.get() -ndevout=g.ndevout.get() +try: + ndevin=g.ndevin.get() +except: + ndevin=0 +Audio.gcom1.ndevin=ndevin + +try: + ndevout=g.ndevout.get() +except: + ndevout=0 +Audio.gcom1.ndevout=ndevout + # Only valid for windows + # for now Audio.audio_init(ndevin,ndevout) #Start the audio stream ltime.after(200,update) diff --git a/start_oss.c b/start_oss.c index a894070e8..fb224f138 100644 --- a/start_oss.c +++ b/start_oss.c @@ -80,7 +80,8 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int *nwave, int *nfsample, int *nsamperbuf, int *TRPeriod, int *TxOK, int *ndebug, int *Transmitting, double *Tsec, int *ngo, int *nmode, - double tbuf[], int *ibuf, int *ndsec) + double tbuf[], int *ibuf, int *ndsec, + char *PttPort, char *devin_name, char *devout_name) { pthread_t thread1,thread2; int iret1,iret2; @@ -90,32 +91,35 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int format; int channels; double dnfs; + int i; + char *p; + + p = strchr(devin_name, ' '); + if(p != NULL) + *p = '\0'; + + p = strchr(devin_name, '/'); + if(p != NULL) + snprintf(dsp_in, MAXDSPNAME, "%s", devin_name); /* assume /dev/... */ + else + snprintf(dsp_in, MAXDSPNAME, "/dev/%s", devin_name); - /* XXX OSS device is decoded from ndevin and ndevout - * This is not strictly speaking the way to do it and is - * probably specific to FreeBSD for now. - * i.e. the .0 addition is a vchan; I'll add configure magic later. --db - */ - snprintf(dsp_in, MAXDSPNAME, - "/dev/dsp%d.0", *ndevin); dsp_in[MAXDSPNAME] = '\0'; data.fd_in = open (dsp_in, O_RDWR, 0); if (data.fd_in < 0) { fprintf(stderr, "Cannot open %s for input.\n", dsp_in); - exit(-1); + return(-1); } - if (*ndevin == *ndevout) { - data.fd_out = data.fd_in; - strncpy(dsp_out, dsp_in, sizeof(dsp_out)); - dsp_out[sizeof(dsp_out)] = '\0'; + data.fd_out = data.fd_in; + strncpy(dsp_out, dsp_in, sizeof(dsp_out)); + dsp_out[sizeof(dsp_out)] = '\0'; - if (ioctl(data.fd_in, SNDCTL_DSP_SETDUPLEX, 0) < 0) { - fprintf(stderr, "Cannot use %s for full duplex.\n", dsp_in); - exit(-1); - } + if (ioctl(data.fd_in, SNDCTL_DSP_SETDUPLEX, 0) < 0) { + fprintf(stderr, "Cannot use %s for full duplex.\n", dsp_in); + return(-1); } data.Tsec = Tsec; @@ -140,23 +144,23 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], channels = 2; if (ioctl (data.fd_in, SNDCTL_DSP_CHANNELS, &channels) == -1) { fprintf (stderr, "Unable to set 2 channels for input.\n"); - exit (-1); + return (-1); } if (channels != 2) { fprintf (stderr, "Unable to set 2 channels.\n"); - exit (-1); + return (-1); } format = AFMT_S16_NE; if (ioctl (data.fd_in, SNDCTL_DSP_SETFMT, &format) == -1) { fprintf (stderr, "Unable to set format for input.\n"); - exit (-1); + return (-1); } if (ioctl (data.fd_in, SNDCTL_DSP_SPEED, &rate) == -1) { fprintf (stderr, "Unable to set rate for input\n"); - exit (-1); + return (-1); } printf("Audio OSS streams running normally.\n"); @@ -214,7 +218,7 @@ oss_loop(int *iarg) nread = read (data.fd_in, rcv_buf, AUDIOBUFSIZE); if (nread <= 0) { fprintf(stderr, "Read error %d\n", nread); - exit(-1); + return (-1); } if (nread == AUDIOBUFSIZE) { /* Get System time */ @@ -281,7 +285,7 @@ oss_loop(int *iarg) if (write(data.fd_out, tx_buf, AUDIOBUFSIZE) < 0) { fprintf(stderr, "Can't write to soundcard.\n"); - exit(-1); + return (-1); } fivehztx_(); /* Call fortran routine */ } diff --git a/wsjt.py b/wsjt.py index af5d98472..1d495ea5e 100644 --- a/wsjt.py +++ b/wsjt.py @@ -98,6 +98,8 @@ g.freeze_decode=0 g.mode="" g.ndevin=IntVar() g.ndevout=IntVar() +g.DevinName=StringVar() +g.DevoutName=StringVar() g.focus=0 #------------------------------------------------------ showspecjt def showspecjt(event=NONE): @@ -1512,7 +1514,7 @@ def update(): Audio.gcom2.nslim2=isync-4 if nosh441.get()==1 and mode.get()=='FSK441': Audio.gcom2.nslim2=99 try: - Audio.gcom2.nport=int(options.ComPort.get()) + Audio.gcom2.nport=options.ComPort.get() except: Audio.gcom2.nport=0 @@ -2013,17 +2015,35 @@ try: # elif key == 'TxDelay': options.TxDelay.set(value) elif key == 'IDinterval': options.IDinterval.set(value) elif key == 'ComPort': - options.ComPort.set(value) - Audio.gcom2.nport=int(options.ComPort.get()) + try: + options.ComPort.set(value) + Audio.gcom2.nport=options.ComPort.get() + except: + options.ComPort.set(0) + Audio.gcom2.nport=0 + + Audio.gcom2.PttPort=options.ComPort.get() + elif key == 'Mileskm': options.mileskm.set(value) elif key == 'MsgStyle': options.ireport.set(value) elif key == 'Region': options.iregion.set(value) elif key == 'AudioIn': - g.ndevin.set(value) - options.ndevin.set(value) + try: + g.ndevin.set(value) + except: + g.ndevin.set(0) + g.DevinName.set(value) + options.DevinName.set(value) + Audio.gcom1.devin_name=(options.DevinName.get()+' ')[:12] elif key == 'AudioOut': - g.ndevout.set(value) - options.ndevout.set(value) + try: + g.ndevout.set(value) + Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12] + except: + g.ndevout.set(0) + g.DevoutName.set(value) + options.DevoutName.set(value) + Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12] elif key == 'SamFacIn': options.samfacin.set(value) elif key == 'SamFacOut': options.samfacout.set(value) elif key == 'Template1': options.Template1.set(value.replace("_"," ")) @@ -2113,12 +2133,12 @@ f.write("HisGrid " + t + "\n") #f.write("RxDelay " + str(options.RxDelay.get()) + "\n") #f.write("TxDelay " + str(options.TxDelay.get()) + "\n") f.write("IDinterval " + str(options.IDinterval.get()) + "\n") -f.write("ComPort " + str(options.ComPort.get()) + "\n") +f.write("ComPort " + options.PttPort.get() + "\n") f.write("Mileskm " + str(options.mileskm.get()) + "\n") f.write("MsgStyle " + str(options.ireport.get()) + "\n") f.write("Region " + str(options.iregion.get()) + "\n") -f.write("AudioIn " + str(options.ndevin.get()) + "\n") -f.write("AudioOut " + str(options.ndevout.get()) + "\n") +f.write("AudioIn " + options.DevinName.get() + "\n") +f.write("AudioOut " + options.DevoutName.get() + "\n") f.write("SamFacIn " + str(options.samfacin.get()) + "\n") f.write("SamFacOut " + str(options.samfacout.get()) + "\n") if options.Template6.get()=="": options.Template6.set("_") From e1a1df06a1144566d39a481d33bf0f86c2a7c018 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 16 Apr 2006 19:52:47 +0000 Subject: [PATCH 109/811] - do not return a value from a void function git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@165 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start_oss.c b/start_oss.c index fb224f138..dc85524af 100644 --- a/start_oss.c +++ b/start_oss.c @@ -218,7 +218,7 @@ oss_loop(int *iarg) nread = read (data.fd_in, rcv_buf, AUDIOBUFSIZE); if (nread <= 0) { fprintf(stderr, "Read error %d\n", nread); - return (-1); + return; } if (nread == AUDIOBUFSIZE) { /* Get System time */ @@ -285,7 +285,7 @@ oss_loop(int *iarg) if (write(data.fd_out, tx_buf, AUDIOBUFSIZE) < 0) { fprintf(stderr, "Can't write to soundcard.\n"); - return (-1); + return; } fivehztx_(); /* Call fortran routine */ } From 80161a32852053e9e408732b5c703f37d55c38eb Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 16 Apr 2006 22:04:31 +0000 Subject: [PATCH 110/811] - This adds run time parallel vs. serial PTT detection and use - Also adds the ability to read a serial or paralle port name from WSJT.INI - Also removes serial vs. parallel hooks in configure git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@166 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 53 +---------- configure.ac | 31 ------- fivehz.F90 | 6 +- ftn_init.F90 | 207 ++++++++++++++++++++--------------------- options.py | 2 +- ptt.c | 2 +- ptt_unix.c | 254 ++++++++++++++++++++++++++------------------------- wsjt.py | 8 +- 8 files changed, 250 insertions(+), 313 deletions(-) diff --git a/configure b/configure index ad579685c..76c0ec9e4 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 5.9.2. # -# $Id: configure.ac 161 2006-04-13 04:50:00Z va3db $ +# $Id: configure.ac 162 2006-04-13 15:13:25Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -840,8 +840,6 @@ Optional Features: --enable-oss Force OSS SOUND usage. --enable-portaudio Force PORTAUDIO SOUND usage. --enable-jack Force JACK usage. - --enable-parallel Force PARALLEL port usage for ptt. - --enable-serial Force SERIAL port usage for ptt. --enable-g95 Use G95 compiler if available. --enable-gfortran Use gfortran compiler if available. @@ -929,7 +927,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 161 2006-04-13 04:50:00Z va3db $ +$Id: configure.ac 162 2006-04-13 15:13:25Z va3db $ _ACEOF exit 0 fi @@ -2076,7 +2074,7 @@ fi # Provide some information about the compiler. -echo "$as_me:2079:" \ +echo "$as_me:2077:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -5977,23 +5975,6 @@ else fi; -# Check whether --enable-parallel or --disable-parallel was given. -if test "${enable_parallel+set}" = set; then - enableval="$enable_parallel" - parallel=$enableval -else - parallel=no -fi; - -# Check whether --enable-serial or --disable-serial was given. -if test "${enable_serial+set}" = set; then - enableval="$enable_serial" - serial=$enableval -else - serial=no -fi; - - # Check whether --enable-g95 or --disable-g95 was given. if test "${enable_g95+set}" = set; then enableval="$enable_g95" @@ -6056,26 +6037,6 @@ FC="${FC}" -if test "$serial" != yes -a "$parallel" != yes; then - serial=yes; -fi - -if test "$serial" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_SERIAL 1 -_ACEOF - -fi - -if test "$parallel" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_PARALLEL 1 -_ACEOF - -fi - if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then portaudio=yes; @@ -7079,14 +7040,6 @@ if test $jack == "yes"; then echo "Using jack."; fi -if test $serial == "yes"; then - echo "Using serial port for ptt."; -fi - -if test $parallel == "yes"; then - echo "Using parallel port for ptt."; -fi - echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/configure.ac b/configure.ac index b024d1822..84dcb1a29 100644 --- a/configure.ac +++ b/configure.ac @@ -234,17 +234,6 @@ AC_ARG_ENABLE(jack, AC_HELP_STRING([--enable-jack],[Force JACK usage.]), [jack=$enableval] , [jack=no]) -dnl serial or parallel support (temporary until python changes) -dnl =========================================================== - -AC_ARG_ENABLE(parallel, -AC_HELP_STRING([--enable-parallel],[Force PARALLEL port usage for ptt.]), -[parallel=$enableval], [parallel=no]) - -AC_ARG_ENABLE(serial, -AC_HELP_STRING([--enable-serial],[Force SERIAL port usage for ptt.]), -[serial=$enableval], [serial=no]) - dnl pick gfortran or g95 dnl ==================== @@ -294,18 +283,6 @@ AC_SUBST(FC, "${FC}") dnl set defaults dnl ============ -if test "$serial" != yes -a "$parallel" != yes; then - [serial=yes]; -fi - -if test "$serial" = yes; then - AC_DEFINE(USE_SERIAL, 1, [Define if you want Serial port used.]) -fi - -if test "$parallel" = yes; then - AC_DEFINE(USE_PARALLEL, 1, [Define if you want Serial port used.]) -fi - if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then [portaudio=yes]; @@ -431,14 +408,6 @@ if test $jack == "yes"; then echo "Using jack."; fi -if test $serial == "yes"; then - echo "Using serial port for ptt."; -fi - -if test $parallel == "yes"; then - echo "Using parallel port for ptt."; -fi - echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/fivehz.F90 b/fivehz.F90 index 06834f88a..a5cd40ba9 100644 --- a/fivehz.F90 +++ b/fivehz.F90 @@ -104,11 +104,11 @@ subroutine fivehz ! Switch PTT line and TxOK appropriately if(lauto.eq.1) then if(txtime .and. iptt.eq.0 .and. & - mute.eq.0) i1=ptt(nport,1,iptt) !Raise PTT + mute.eq.0) i1=ptt(nport,pttport,1,iptt) !Raise PTT if(.not.txtime .or. mute.eq.1) TxOK=0 !Lower TxOK else if(mantx.eq.1 .and. iptt.eq.0 .and. & - mute.eq.0) i2=ptt(nport,1,iptt) !Raise PTT + mute.eq.0) i2=ptt(nport,pttport,1,iptt) !Raise PTT if(mantx.eq.0 .or. mute.eq.1) TxOK=0 !Lower TxOK endif @@ -130,7 +130,7 @@ subroutine fivehz if(nc0a.lt.5) nc0a=5 if(TxOK.eq.0 .and. TxOKz.eq.1 .and. iptt.eq.1) nc0=-nc0a-1 if(nc0.le.0) nc0=nc0+1 - if(nc0.eq.0) i3=ptt(nport,0,iptt) + if(nc0.eq.0) i3=ptt(nport,pttport,0,iptt) if(iptt.eq.0 .and.TxOK.eq.0) then sending=" " diff --git a/ftn_init.F90 b/ftn_init.F90 index 61b7948d0..fcc0290fe 100644 --- a/ftn_init.F90 +++ b/ftn_init.F90 @@ -1,103 +1,104 @@ -! Fortran logical units used in WSJT6 -! -! 10 wave files read from disk -! 11 decoded.txt -! 12 decoded.ave -! 13 tsky.dat -! 14 azel.dat -! 15 debug.txt -! 16 c:/wsjt.reg -! 17 wave files written to disk -! 18 test file to be transmitted (wsjtgen.f90) -! 19 -! 20 -! 21 ALL.TXT -! 22 kvasd.dat -! 23 CALL3.TXT - -!------------------------------------------------ ftn_init -subroutine ftn_init - - character*1 cjunk - include 'gcom1.f90' - include 'gcom2.f90' - include 'gcom3.f90' - include 'gcom4.f90' - - i=ptt(nport,0,iptt) !Clear the PTT line - addpfx=' ' - - do i=80,1,-1 - if(AppDir(i:i).ne.' ') goto 1 - enddo -1 iz=i - lenappdir=iz - call pfxdump(appdir(:iz)//'/prefixes.txt') - -#ifdef Win32 - open(11,file=appdir(:iz)//'/decoded.txt',status='unknown', & - share='denynone',err=910) -#else - open(11,file=appdir(:iz)//'/decoded.txt',status='unknown', & - err=910) -#endif - endfile 11 - -#ifdef Win32 - open(12,file=appdir(:iz)//'/decoded.ave',status='unknown', & - share='denynone',err=920) -#else - open(12,file=appdir(:iz)//'/decoded.ave',status='unknown', & - err=920) -#endif - endfile 12 - -#ifdef Win32 - open(14,file=appdir(:iz)//'/azel.dat',status='unknown', & - share='denynone',err=930) -#else - open(14,file=appdir(:iz)//'/azel.dat',status='unknown', & - err=930) -#endif - -#ifdef Win32 - open(15,file=appdir(:iz)//'/debug.txt',status='unknown', & - share='denynone',err=940) -#else - open(15,file=appdir(:iz)//'/debug.txt',status='unknown', & - err=940) -#endif - -#ifdef Win32 - open(21,file=appdir(:iz)//'/ALL.TXT',status='unknown', & - access='append',share='denynone',err=950) -#else - open(21,file=appdir(:iz)//'/ALL.TXT',status='unknown',err=950) - do i=1,9999999 - read(21,*,end=10) cjunk - enddo -10 continue -#endif - -#ifdef Win32 - open(22,file=appdir(:iz)//'/kvasd.dat',access='direct',recl=1024, & - status='unknown',share='denynone') -#else - open(22,file=appdir(:iz)//'/kvasd.dat',access='direct',recl=1024, & - status='unknown') -#endif - - return - -910 print*,'Error opening DECODED.TXT' - stop -920 print*,'Error opening DECODED.AVE' - stop -930 print*,'Error opening AZEL.DAT' - stop -940 print*,'Error opening DEBUG.TXT' - stop -950 print*,'Error opening ALL.TXT' - stop - -end subroutine ftn_init +! Fortran logical units used in WSJT6 +! +! 10 wave files read from disk +! 11 decoded.txt +! 12 decoded.ave +! 13 tsky.dat +! 14 azel.dat +! 15 debug.txt +! 16 c:/wsjt.reg +! 17 wave files written to disk +! 18 test file to be transmitted (wsjtgen.f90) +! 19 +! 20 +! 21 ALL.TXT +! 22 kvasd.dat +! 23 CALL3.TXT + +!------------------------------------------------ ftn_init +subroutine ftn_init + + character*1 cjunk + include 'gcom1.f90' + include 'gcom2.f90' + include 'gcom3.f90' + include 'gcom4.f90' + +! print*,'ftn_init.F90 nport=', nport, 'pttport=', pttport + i=ptt(nport,pttport,0,iptt) !Clear the PTT line + addpfx=' ' + + do i=80,1,-1 + if(AppDir(i:i).ne.' ') goto 1 + enddo +1 iz=i + lenappdir=iz + call pfxdump(appdir(:iz)//'/prefixes.txt') + +#ifdef Win32 + open(11,file=appdir(:iz)//'/decoded.txt',status='unknown', & + share='denynone',err=910) +#else + open(11,file=appdir(:iz)//'/decoded.txt',status='unknown', & + err=910) +#endif + endfile 11 + +#ifdef Win32 + open(12,file=appdir(:iz)//'/decoded.ave',status='unknown', & + share='denynone',err=920) +#else + open(12,file=appdir(:iz)//'/decoded.ave',status='unknown', & + err=920) +#endif + endfile 12 + +#ifdef Win32 + open(14,file=appdir(:iz)//'/azel.dat',status='unknown', & + share='denynone',err=930) +#else + open(14,file=appdir(:iz)//'/azel.dat',status='unknown', & + err=930) +#endif + +#ifdef Win32 + open(15,file=appdir(:iz)//'/debug.txt',status='unknown', & + share='denynone',err=940) +#else + open(15,file=appdir(:iz)//'/debug.txt',status='unknown', & + err=940) +#endif + +#ifdef Win32 + open(21,file=appdir(:iz)//'/ALL.TXT',status='unknown', & + access='append',share='denynone',err=950) +#else + open(21,file=appdir(:iz)//'/ALL.TXT',status='unknown',err=950) + do i=1,9999999 + read(21,*,end=10) cjunk + enddo +10 continue +#endif + +#ifdef Win32 + open(22,file=appdir(:iz)//'/kvasd.dat',access='direct',recl=1024, & + status='unknown',share='denynone') +#else + open(22,file=appdir(:iz)//'/kvasd.dat',access='direct',recl=1024, & + status='unknown') +#endif + + return + +910 print*,'Error opening DECODED.TXT' + stop +920 print*,'Error opening DECODED.AVE' + stop +930 print*,'Error opening AZEL.DAT' + stop +940 print*,'Error opening DEBUG.TXT' + stop +950 print*,'Error opening ALL.TXT' + stop + +end subroutine ftn_init diff --git a/options.py b/options.py index b57025ea3..7d68e6627 100644 --- a/options.py +++ b/options.py @@ -110,7 +110,7 @@ mygrid=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Grid Locator:', idinterval=Pmw.EntryField(g1.interior(),labelpos=W,label_text='ID Interval (m):', value=10,entry_textvariable=IDinterval,entry_width=12) comport=Pmw.EntryField(g1.interior(),labelpos=W,label_text='PTT Port:', - value='1',entry_textvariable=PttPort,entry_width=12) + value='/dev/cuad0',entry_textvariable=PttPort,entry_width=12) audioin=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio In:', value='0',entry_textvariable=DevinName,entry_width=12) audioout=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio Out:', diff --git a/ptt.c b/ptt.c index 9b31d1b5f..494062d0a 100644 --- a/ptt.c +++ b/ptt.c @@ -1,7 +1,7 @@ #include #include -int ptt_(int *nport, int *ntx, int *iptt) +int ptt_(int *nport, char *unused, int *ntx, int *iptt) { static HANDLE hFile; static int open=0; diff --git a/ptt_unix.c b/ptt_unix.c index f34963eea..6f1c6baa1 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -43,80 +43,6 @@ # include #endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#if (defined(__unix__) || defined(unix)) && !defined(USG) -# include -#endif - -int fd; /* Used for both serial and parallel */ - -#ifdef USE_SERIAL - -/* First cut, note that this only distinguishes Linux from BSDs, - * it will be done better later on using configure. N.B. that OSX - * will come up as BSD but I think this is also the right serial port - * for OSX. -db - */ -#if defined(BSD) -#define TTYNAME "/dev/cuad%d" /* Use non blocking form */ -#else -#include -#define TTYNAME "/dev/ttyUSB%d" -#endif - -/* Not quite right for size but '%d + 1' should be plenty enough -db */ -/* As TTYNAME is a string, just at 20 chars do udevd is happier. */ -/* E.g. USB serial ports appear as /dev/ttyUSB0 */ -#define TTYNAME_SIZE sizeof(TTYNAME)+20 - -int -ptt_(int *nport, int *ntx, int *iptt) -{ - /* Fixme, nport should be a sting and not a number */ - static int nopen=0; - int control = TIOCM_RTS | TIOCM_DTR; - - char s[TTYNAME_SIZE]; - - if(*nport < 0) { - *iptt=*ntx; - return(0); - } - - if(*ntx && (!nopen)) { - snprintf(s, TTYNAME_SIZE, TTYNAME, (*nport) - 1); /* Comport 1 == dev 0 */ - s[TTYNAME_SIZE] = '\0'; - - /* open the device */ - printf("Opening %s\n", s); - if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { - fprintf(stderr, "Can't open %s.\n", s); - return(1); - } - - nopen=1; - return(0); - } - - if(*ntx && nopen) { - ioctl(fd, TIOCMBIS, &control); // Set DTR and RTS - *iptt=1; - } - - else { - ioctl(fd, TIOCMBIC, &control); - close(fd); - *iptt=0; - nopen=0; - } - return(0); -} -#endif - -#ifdef USE_PARALLEL - #ifdef HAVE_LINUX_PPDEV_H # include # include @@ -124,6 +50,10 @@ ptt_(int *nport, int *ntx, int *iptt) #ifdef HAVE_DEV_PPBUS_PPI_H # include # include + +int lp_reset (int fd); +int lp_ptt (int fd, int onoff); + #endif #ifdef HAVE_SYS_STAT_H # include @@ -132,6 +62,108 @@ ptt_(int *nport, int *ntx, int *iptt) # include #endif +#ifndef BSD /* #ifdef LINUX ? */ +#include +#endif +#include +/* parport functions */ + +int dev_is_parport(const char *fname); +int ptt_parallel(int fd, int *ntx, int *iptt); +int ptt_serial(int fd, int *ntx, int *iptt); + +int fd=-1; /* Used for both serial and parallel */ + + +char nm[MAXPATHLEN]; + +/* + * ptt_ + * + * generic unix PTT routine called from Fortran + * + * unused - Unused, to satisfy old windows calling convention + * ptt_port - device name serial or parallel + * ntx - pointer to fortran command on or off + * iptt - pointer to fortran command status on or off + */ + +/* Tiny state machine */ +#define STATE_PORT_CLOSED 0 +#define STATE_PORT_OPEN_PARALLEL 1 +#define STATE_PORT_OPEN_SERIAL 2 + +int +ptt_(int unused, char *ptt_port, int *ntx, int *iptt) +{ + static int state=0; + char *p; + + switch (state) { + case STATE_PORT_CLOSED: + if ((p = strchr(ptt_port, ' ')) != NULL) + *p = '\0'; + if (p == NULL || *p == '\0') { + *iptt = *ntx; + return(0); + } + + if ((fd = dev_is_parport(ptt_port)) > 0) { + state = STATE_PORT_OPEN_PARALLEL; + lp_reset(fd); + } else { + if ((fd = open(nm, O_RDWR | O_NDELAY)) < 0) { + fprintf(stderr, "Can't open %s.\n", nm); + return(1); + } + else + state = STATE_PORT_OPEN_SERIAL; + } + break; + + case STATE_PORT_OPEN_PARALLEL: + ptt_parallel(fd, ntx, iptt); + break; + + case STATE_PORT_OPEN_SERIAL: + ptt_serial(fd, ntx, iptt); + break; + + default: + close(fd); + fd = -1; + state = STATE_PORT_CLOSED; + break; + } + return(0); +} + +/* + * ptt_serial + * + * generic serial unix PTT routine called indirectly from Fortran + * + * fd - already opened file descriptor + * ntx - pointer to fortran command on or off + * iptt - pointer to fortran command status on or off + */ + +int +ptt_serial(int fd, int *ntx, int *iptt) +{ + int control = TIOCM_RTS | TIOCM_DTR; + + if(*ntx) { + ioctl(fd, TIOCMBIS, &control); /* Set DTR and RTS */ + *iptt = 1; + } else { + ioctl(fd, TIOCMBIC, &control); + *iptt = 0; + } + return(0); +} + + /* parport functions */ int lp_reset (int fd); @@ -149,13 +181,11 @@ int lp_ptt (int fd, int onoff); int dev_is_parport(const char *fname) { - char nm[MAXPATHLEN]; struct stat st; - int fd, m; + int fd; + + snprintf(nm, sizeof(nm), "/dev/%s", fname); - m = snprintf(nm, sizeof(nm), "/dev/%s", fname); - if (m >= sizeof(nm)) - return (-1); if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) return (-1); if (fstat(fd, &st) == -1) @@ -175,14 +205,16 @@ out: int dev_is_parport(const char *fname) { - char nm[MAXPATHLEN]; struct stat st; unsigned char c; - int fd, m; + int fd; + char *p; + + if ((p = strchr(fname, '/')) != NULL) /* Look for /dev */ + snprintf(nm, sizeof(nm), "%s", fname); + else + snprintf(nm, sizeof(nm), "/dev/%s", fname); - m = snprintf(nm, sizeof(nm), "/dev/%s", fname); - if (m >= sizeof(nm)) - return (-1); if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) return (-1); if (fstat(fd, &st) == -1) @@ -275,7 +307,6 @@ lp_init (int fd) { fprintf(stderr, "Claiming parallel port %s", dev->desc); debug ("HINT: did you unload the lp kernel module?"); - debug ("HINT: perhaps there is another cwdaemon running?"); close (fd); exit (1); } @@ -341,47 +372,26 @@ lp_ptt (int fd, int onoff) return 0; } -/* XXX I am totally unsure of this, LPNAME should come from - * the WSJT.INI instead but for now this should work -- db +/* + * ptt_parallel + * + * generic parallel unix PTT routine called indirectly from Fortran + * + * fd - already opened file descriptor + * ntx - pointer to fortran command on or off + * iptt - pointer to fortran command status on or off */ -#ifdef BSD -#define LPNAME "lpt%d" -#else -#define LPNAME "lp%d" -#endif -#define LPNAME_SIZE (sizeof(LPNAME)) int -ptt_(int *nport, int *ntx, int *iptt) +ptt_parallel(int fd, int *ntx, int *iptt) { - static int nopen=0; - int fd; - char s[LPNAME_SIZE]; - - if(*nport < 0) { - *iptt=*ntx; - return(0); - } - - if(*ntx && (!nopen)) { - snprintf(s, LPNAME_SIZE, LPNAME, (*nport) - 1); /* Comport 1 == dev 0 */ - s[LPNAME_SIZE] = '\0'; - - if ((fd = dev_is_parport(s)) < 0) { - fprintf(stderr, "Can't use %s.", s); - return(1); - } - - if(*ntx && nopen) { - lp_ptt(fd, 1); - *iptt=1; - } else { - lp_ptt(fd, 0); - close(fd); - *iptt=0; - nopen=0; - } + if(*ntx) { + lp_ptt(fd, 1); + *iptt=1; + } else { + lp_ptt(fd, 0); + *iptt=0; } return(0); } -#endif + diff --git a/wsjt.py b/wsjt.py index 1d495ea5e..ff09db7a1 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1517,6 +1517,10 @@ def update(): Audio.gcom2.nport=options.ComPort.get() except: Audio.gcom2.nport=0 + +# print 'About to init Audio.gcom2.PttPort in save some parameters' + Audio.gcom2.pttport=(options.PttPort.get() + ' ')[:12] +# print Audio.gcom2.pttport # Queue up the next update ldate.after(100,update) @@ -2022,8 +2026,8 @@ try: options.ComPort.set(0) Audio.gcom2.nport=0 - Audio.gcom2.PttPort=options.ComPort.get() - + Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] + elif key == 'Mileskm': options.mileskm.set(value) elif key == 'MsgStyle': options.ireport.set(value) elif key == 'Region': options.iregion.set(value) From f55f7c0dc480abaf2590998c83caf055245ca577 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 17 Apr 2006 00:00:23 +0000 Subject: [PATCH 111/811] - undoing boo-boo git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@167 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 53 ++++++++++- configure.ac | 31 +++++++ fivehz.F90 | 6 +- ftn_init.F90 | 207 ++++++++++++++++++++++--------------------- options.py | 2 +- ptt.c | 2 +- ptt_unix.c | 242 ++++++++++++++++++++++++--------------------------- wsjt.py | 8 +- 8 files changed, 307 insertions(+), 244 deletions(-) diff --git a/configure b/configure index 76c0ec9e4..ad579685c 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 5.9.2. # -# $Id: configure.ac 162 2006-04-13 15:13:25Z va3db $ +# $Id: configure.ac 161 2006-04-13 04:50:00Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -840,6 +840,8 @@ Optional Features: --enable-oss Force OSS SOUND usage. --enable-portaudio Force PORTAUDIO SOUND usage. --enable-jack Force JACK usage. + --enable-parallel Force PARALLEL port usage for ptt. + --enable-serial Force SERIAL port usage for ptt. --enable-g95 Use G95 compiler if available. --enable-gfortran Use gfortran compiler if available. @@ -927,7 +929,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 162 2006-04-13 15:13:25Z va3db $ +$Id: configure.ac 161 2006-04-13 04:50:00Z va3db $ _ACEOF exit 0 fi @@ -2074,7 +2076,7 @@ fi # Provide some information about the compiler. -echo "$as_me:2077:" \ +echo "$as_me:2079:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -5975,6 +5977,23 @@ else fi; +# Check whether --enable-parallel or --disable-parallel was given. +if test "${enable_parallel+set}" = set; then + enableval="$enable_parallel" + parallel=$enableval +else + parallel=no +fi; + +# Check whether --enable-serial or --disable-serial was given. +if test "${enable_serial+set}" = set; then + enableval="$enable_serial" + serial=$enableval +else + serial=no +fi; + + # Check whether --enable-g95 or --disable-g95 was given. if test "${enable_g95+set}" = set; then enableval="$enable_g95" @@ -6037,6 +6056,26 @@ FC="${FC}" +if test "$serial" != yes -a "$parallel" != yes; then + serial=yes; +fi + +if test "$serial" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_SERIAL 1 +_ACEOF + +fi + +if test "$parallel" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_PARALLEL 1 +_ACEOF + +fi + if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then portaudio=yes; @@ -7040,6 +7079,14 @@ if test $jack == "yes"; then echo "Using jack."; fi +if test $serial == "yes"; then + echo "Using serial port for ptt."; +fi + +if test $parallel == "yes"; then + echo "Using parallel port for ptt."; +fi + echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/configure.ac b/configure.ac index 84dcb1a29..b024d1822 100644 --- a/configure.ac +++ b/configure.ac @@ -234,6 +234,17 @@ AC_ARG_ENABLE(jack, AC_HELP_STRING([--enable-jack],[Force JACK usage.]), [jack=$enableval] , [jack=no]) +dnl serial or parallel support (temporary until python changes) +dnl =========================================================== + +AC_ARG_ENABLE(parallel, +AC_HELP_STRING([--enable-parallel],[Force PARALLEL port usage for ptt.]), +[parallel=$enableval], [parallel=no]) + +AC_ARG_ENABLE(serial, +AC_HELP_STRING([--enable-serial],[Force SERIAL port usage for ptt.]), +[serial=$enableval], [serial=no]) + dnl pick gfortran or g95 dnl ==================== @@ -283,6 +294,18 @@ AC_SUBST(FC, "${FC}") dnl set defaults dnl ============ +if test "$serial" != yes -a "$parallel" != yes; then + [serial=yes]; +fi + +if test "$serial" = yes; then + AC_DEFINE(USE_SERIAL, 1, [Define if you want Serial port used.]) +fi + +if test "$parallel" = yes; then + AC_DEFINE(USE_PARALLEL, 1, [Define if you want Serial port used.]) +fi + if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then [portaudio=yes]; @@ -408,6 +431,14 @@ if test $jack == "yes"; then echo "Using jack."; fi +if test $serial == "yes"; then + echo "Using serial port for ptt."; +fi + +if test $parallel == "yes"; then + echo "Using parallel port for ptt."; +fi + echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/fivehz.F90 b/fivehz.F90 index a5cd40ba9..06834f88a 100644 --- a/fivehz.F90 +++ b/fivehz.F90 @@ -104,11 +104,11 @@ subroutine fivehz ! Switch PTT line and TxOK appropriately if(lauto.eq.1) then if(txtime .and. iptt.eq.0 .and. & - mute.eq.0) i1=ptt(nport,pttport,1,iptt) !Raise PTT + mute.eq.0) i1=ptt(nport,1,iptt) !Raise PTT if(.not.txtime .or. mute.eq.1) TxOK=0 !Lower TxOK else if(mantx.eq.1 .and. iptt.eq.0 .and. & - mute.eq.0) i2=ptt(nport,pttport,1,iptt) !Raise PTT + mute.eq.0) i2=ptt(nport,1,iptt) !Raise PTT if(mantx.eq.0 .or. mute.eq.1) TxOK=0 !Lower TxOK endif @@ -130,7 +130,7 @@ subroutine fivehz if(nc0a.lt.5) nc0a=5 if(TxOK.eq.0 .and. TxOKz.eq.1 .and. iptt.eq.1) nc0=-nc0a-1 if(nc0.le.0) nc0=nc0+1 - if(nc0.eq.0) i3=ptt(nport,pttport,0,iptt) + if(nc0.eq.0) i3=ptt(nport,0,iptt) if(iptt.eq.0 .and.TxOK.eq.0) then sending=" " diff --git a/ftn_init.F90 b/ftn_init.F90 index fcc0290fe..61b7948d0 100644 --- a/ftn_init.F90 +++ b/ftn_init.F90 @@ -1,104 +1,103 @@ -! Fortran logical units used in WSJT6 -! -! 10 wave files read from disk -! 11 decoded.txt -! 12 decoded.ave -! 13 tsky.dat -! 14 azel.dat -! 15 debug.txt -! 16 c:/wsjt.reg -! 17 wave files written to disk -! 18 test file to be transmitted (wsjtgen.f90) -! 19 -! 20 -! 21 ALL.TXT -! 22 kvasd.dat -! 23 CALL3.TXT - -!------------------------------------------------ ftn_init -subroutine ftn_init - - character*1 cjunk - include 'gcom1.f90' - include 'gcom2.f90' - include 'gcom3.f90' - include 'gcom4.f90' - -! print*,'ftn_init.F90 nport=', nport, 'pttport=', pttport - i=ptt(nport,pttport,0,iptt) !Clear the PTT line - addpfx=' ' - - do i=80,1,-1 - if(AppDir(i:i).ne.' ') goto 1 - enddo -1 iz=i - lenappdir=iz - call pfxdump(appdir(:iz)//'/prefixes.txt') - -#ifdef Win32 - open(11,file=appdir(:iz)//'/decoded.txt',status='unknown', & - share='denynone',err=910) -#else - open(11,file=appdir(:iz)//'/decoded.txt',status='unknown', & - err=910) -#endif - endfile 11 - -#ifdef Win32 - open(12,file=appdir(:iz)//'/decoded.ave',status='unknown', & - share='denynone',err=920) -#else - open(12,file=appdir(:iz)//'/decoded.ave',status='unknown', & - err=920) -#endif - endfile 12 - -#ifdef Win32 - open(14,file=appdir(:iz)//'/azel.dat',status='unknown', & - share='denynone',err=930) -#else - open(14,file=appdir(:iz)//'/azel.dat',status='unknown', & - err=930) -#endif - -#ifdef Win32 - open(15,file=appdir(:iz)//'/debug.txt',status='unknown', & - share='denynone',err=940) -#else - open(15,file=appdir(:iz)//'/debug.txt',status='unknown', & - err=940) -#endif - -#ifdef Win32 - open(21,file=appdir(:iz)//'/ALL.TXT',status='unknown', & - access='append',share='denynone',err=950) -#else - open(21,file=appdir(:iz)//'/ALL.TXT',status='unknown',err=950) - do i=1,9999999 - read(21,*,end=10) cjunk - enddo -10 continue -#endif - -#ifdef Win32 - open(22,file=appdir(:iz)//'/kvasd.dat',access='direct',recl=1024, & - status='unknown',share='denynone') -#else - open(22,file=appdir(:iz)//'/kvasd.dat',access='direct',recl=1024, & - status='unknown') -#endif - - return - -910 print*,'Error opening DECODED.TXT' - stop -920 print*,'Error opening DECODED.AVE' - stop -930 print*,'Error opening AZEL.DAT' - stop -940 print*,'Error opening DEBUG.TXT' - stop -950 print*,'Error opening ALL.TXT' - stop - -end subroutine ftn_init +! Fortran logical units used in WSJT6 +! +! 10 wave files read from disk +! 11 decoded.txt +! 12 decoded.ave +! 13 tsky.dat +! 14 azel.dat +! 15 debug.txt +! 16 c:/wsjt.reg +! 17 wave files written to disk +! 18 test file to be transmitted (wsjtgen.f90) +! 19 +! 20 +! 21 ALL.TXT +! 22 kvasd.dat +! 23 CALL3.TXT + +!------------------------------------------------ ftn_init +subroutine ftn_init + + character*1 cjunk + include 'gcom1.f90' + include 'gcom2.f90' + include 'gcom3.f90' + include 'gcom4.f90' + + i=ptt(nport,0,iptt) !Clear the PTT line + addpfx=' ' + + do i=80,1,-1 + if(AppDir(i:i).ne.' ') goto 1 + enddo +1 iz=i + lenappdir=iz + call pfxdump(appdir(:iz)//'/prefixes.txt') + +#ifdef Win32 + open(11,file=appdir(:iz)//'/decoded.txt',status='unknown', & + share='denynone',err=910) +#else + open(11,file=appdir(:iz)//'/decoded.txt',status='unknown', & + err=910) +#endif + endfile 11 + +#ifdef Win32 + open(12,file=appdir(:iz)//'/decoded.ave',status='unknown', & + share='denynone',err=920) +#else + open(12,file=appdir(:iz)//'/decoded.ave',status='unknown', & + err=920) +#endif + endfile 12 + +#ifdef Win32 + open(14,file=appdir(:iz)//'/azel.dat',status='unknown', & + share='denynone',err=930) +#else + open(14,file=appdir(:iz)//'/azel.dat',status='unknown', & + err=930) +#endif + +#ifdef Win32 + open(15,file=appdir(:iz)//'/debug.txt',status='unknown', & + share='denynone',err=940) +#else + open(15,file=appdir(:iz)//'/debug.txt',status='unknown', & + err=940) +#endif + +#ifdef Win32 + open(21,file=appdir(:iz)//'/ALL.TXT',status='unknown', & + access='append',share='denynone',err=950) +#else + open(21,file=appdir(:iz)//'/ALL.TXT',status='unknown',err=950) + do i=1,9999999 + read(21,*,end=10) cjunk + enddo +10 continue +#endif + +#ifdef Win32 + open(22,file=appdir(:iz)//'/kvasd.dat',access='direct',recl=1024, & + status='unknown',share='denynone') +#else + open(22,file=appdir(:iz)//'/kvasd.dat',access='direct',recl=1024, & + status='unknown') +#endif + + return + +910 print*,'Error opening DECODED.TXT' + stop +920 print*,'Error opening DECODED.AVE' + stop +930 print*,'Error opening AZEL.DAT' + stop +940 print*,'Error opening DEBUG.TXT' + stop +950 print*,'Error opening ALL.TXT' + stop + +end subroutine ftn_init diff --git a/options.py b/options.py index 7d68e6627..b57025ea3 100644 --- a/options.py +++ b/options.py @@ -110,7 +110,7 @@ mygrid=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Grid Locator:', idinterval=Pmw.EntryField(g1.interior(),labelpos=W,label_text='ID Interval (m):', value=10,entry_textvariable=IDinterval,entry_width=12) comport=Pmw.EntryField(g1.interior(),labelpos=W,label_text='PTT Port:', - value='/dev/cuad0',entry_textvariable=PttPort,entry_width=12) + value='1',entry_textvariable=PttPort,entry_width=12) audioin=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio In:', value='0',entry_textvariable=DevinName,entry_width=12) audioout=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio Out:', diff --git a/ptt.c b/ptt.c index 494062d0a..9b31d1b5f 100644 --- a/ptt.c +++ b/ptt.c @@ -1,7 +1,7 @@ #include #include -int ptt_(int *nport, char *unused, int *ntx, int *iptt) +int ptt_(int *nport, int *ntx, int *iptt) { static HANDLE hFile; static int open=0; diff --git a/ptt_unix.c b/ptt_unix.c index 6f1c6baa1..f34963eea 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -43,18 +43,6 @@ # include #endif -#ifdef HAVE_LINUX_PPDEV_H -# include -# include -#endif -#ifdef HAVE_DEV_PPBUS_PPI_H -# include -# include - -int lp_reset (int fd); -int lp_ptt (int fd, int onoff); - -#endif #ifdef HAVE_SYS_STAT_H # include #endif @@ -62,107 +50,87 @@ int lp_ptt (int fd, int onoff); # include #endif -#ifndef BSD /* #ifdef LINUX ? */ +int fd; /* Used for both serial and parallel */ + +#ifdef USE_SERIAL + +/* First cut, note that this only distinguishes Linux from BSDs, + * it will be done better later on using configure. N.B. that OSX + * will come up as BSD but I think this is also the right serial port + * for OSX. -db + */ +#if defined(BSD) +#define TTYNAME "/dev/cuad%d" /* Use non blocking form */ +#else #include +#define TTYNAME "/dev/ttyUSB%d" #endif -#include -/* parport functions */ -int dev_is_parport(const char *fname); -int ptt_parallel(int fd, int *ntx, int *iptt); -int ptt_serial(int fd, int *ntx, int *iptt); - -int fd=-1; /* Used for both serial and parallel */ - - -char nm[MAXPATHLEN]; - -/* - * ptt_ - * - * generic unix PTT routine called from Fortran - * - * unused - Unused, to satisfy old windows calling convention - * ptt_port - device name serial or parallel - * ntx - pointer to fortran command on or off - * iptt - pointer to fortran command status on or off - */ - -/* Tiny state machine */ -#define STATE_PORT_CLOSED 0 -#define STATE_PORT_OPEN_PARALLEL 1 -#define STATE_PORT_OPEN_SERIAL 2 +/* Not quite right for size but '%d + 1' should be plenty enough -db */ +/* As TTYNAME is a string, just at 20 chars do udevd is happier. */ +/* E.g. USB serial ports appear as /dev/ttyUSB0 */ +#define TTYNAME_SIZE sizeof(TTYNAME)+20 int -ptt_(int unused, char *ptt_port, int *ntx, int *iptt) -{ - static int state=0; - char *p; - - switch (state) { - case STATE_PORT_CLOSED: - if ((p = strchr(ptt_port, ' ')) != NULL) - *p = '\0'; - if (p == NULL || *p == '\0') { - *iptt = *ntx; - return(0); - } - - if ((fd = dev_is_parport(ptt_port)) > 0) { - state = STATE_PORT_OPEN_PARALLEL; - lp_reset(fd); - } else { - if ((fd = open(nm, O_RDWR | O_NDELAY)) < 0) { - fprintf(stderr, "Can't open %s.\n", nm); - return(1); - } - else - state = STATE_PORT_OPEN_SERIAL; - } - break; - - case STATE_PORT_OPEN_PARALLEL: - ptt_parallel(fd, ntx, iptt); - break; - - case STATE_PORT_OPEN_SERIAL: - ptt_serial(fd, ntx, iptt); - break; - - default: - close(fd); - fd = -1; - state = STATE_PORT_CLOSED; - break; - } - return(0); -} - -/* - * ptt_serial - * - * generic serial unix PTT routine called indirectly from Fortran - * - * fd - already opened file descriptor - * ntx - pointer to fortran command on or off - * iptt - pointer to fortran command status on or off - */ - -int -ptt_serial(int fd, int *ntx, int *iptt) +ptt_(int *nport, int *ntx, int *iptt) { + /* Fixme, nport should be a sting and not a number */ + static int nopen=0; int control = TIOCM_RTS | TIOCM_DTR; - if(*ntx) { - ioctl(fd, TIOCMBIS, &control); /* Set DTR and RTS */ - *iptt = 1; - } else { + char s[TTYNAME_SIZE]; + + if(*nport < 0) { + *iptt=*ntx; + return(0); + } + + if(*ntx && (!nopen)) { + snprintf(s, TTYNAME_SIZE, TTYNAME, (*nport) - 1); /* Comport 1 == dev 0 */ + s[TTYNAME_SIZE] = '\0'; + + /* open the device */ + printf("Opening %s\n", s); + if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { + fprintf(stderr, "Can't open %s.\n", s); + return(1); + } + + nopen=1; + return(0); + } + + if(*ntx && nopen) { + ioctl(fd, TIOCMBIS, &control); // Set DTR and RTS + *iptt=1; + } + + else { ioctl(fd, TIOCMBIC, &control); - *iptt = 0; + close(fd); + *iptt=0; + nopen=0; } return(0); } +#endif +#ifdef USE_PARALLEL + +#ifdef HAVE_LINUX_PPDEV_H +# include +# include +#endif +#ifdef HAVE_DEV_PPBUS_PPI_H +# include +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#if (defined(__unix__) || defined(unix)) && !defined(USG) +# include +#endif /* parport functions */ @@ -181,11 +149,13 @@ int lp_ptt (int fd, int onoff); int dev_is_parport(const char *fname) { + char nm[MAXPATHLEN]; struct stat st; - int fd; - - snprintf(nm, sizeof(nm), "/dev/%s", fname); + int fd, m; + m = snprintf(nm, sizeof(nm), "/dev/%s", fname); + if (m >= sizeof(nm)) + return (-1); if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) return (-1); if (fstat(fd, &st) == -1) @@ -205,16 +175,14 @@ out: int dev_is_parport(const char *fname) { + char nm[MAXPATHLEN]; struct stat st; unsigned char c; - int fd; - char *p; - - if ((p = strchr(fname, '/')) != NULL) /* Look for /dev */ - snprintf(nm, sizeof(nm), "%s", fname); - else - snprintf(nm, sizeof(nm), "/dev/%s", fname); + int fd, m; + m = snprintf(nm, sizeof(nm), "/dev/%s", fname); + if (m >= sizeof(nm)) + return (-1); if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) return (-1); if (fstat(fd, &st) == -1) @@ -307,6 +275,7 @@ lp_init (int fd) { fprintf(stderr, "Claiming parallel port %s", dev->desc); debug ("HINT: did you unload the lp kernel module?"); + debug ("HINT: perhaps there is another cwdaemon running?"); close (fd); exit (1); } @@ -372,26 +341,47 @@ lp_ptt (int fd, int onoff) return 0; } -/* - * ptt_parallel - * - * generic parallel unix PTT routine called indirectly from Fortran - * - * fd - already opened file descriptor - * ntx - pointer to fortran command on or off - * iptt - pointer to fortran command status on or off +/* XXX I am totally unsure of this, LPNAME should come from + * the WSJT.INI instead but for now this should work -- db */ +#ifdef BSD +#define LPNAME "lpt%d" +#else +#define LPNAME "lp%d" +#endif +#define LPNAME_SIZE (sizeof(LPNAME)) int -ptt_parallel(int fd, int *ntx, int *iptt) +ptt_(int *nport, int *ntx, int *iptt) { - if(*ntx) { - lp_ptt(fd, 1); - *iptt=1; - } else { - lp_ptt(fd, 0); - *iptt=0; + static int nopen=0; + int fd; + char s[LPNAME_SIZE]; + + if(*nport < 0) { + *iptt=*ntx; + return(0); + } + + if(*ntx && (!nopen)) { + snprintf(s, LPNAME_SIZE, LPNAME, (*nport) - 1); /* Comport 1 == dev 0 */ + s[LPNAME_SIZE] = '\0'; + + if ((fd = dev_is_parport(s)) < 0) { + fprintf(stderr, "Can't use %s.", s); + return(1); + } + + if(*ntx && nopen) { + lp_ptt(fd, 1); + *iptt=1; + } else { + lp_ptt(fd, 0); + close(fd); + *iptt=0; + nopen=0; + } } return(0); } - +#endif diff --git a/wsjt.py b/wsjt.py index ff09db7a1..1d495ea5e 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1517,10 +1517,6 @@ def update(): Audio.gcom2.nport=options.ComPort.get() except: Audio.gcom2.nport=0 - -# print 'About to init Audio.gcom2.PttPort in save some parameters' - Audio.gcom2.pttport=(options.PttPort.get() + ' ')[:12] -# print Audio.gcom2.pttport # Queue up the next update ldate.after(100,update) @@ -2026,8 +2022,8 @@ try: options.ComPort.set(0) Audio.gcom2.nport=0 - Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] - + Audio.gcom2.PttPort=options.ComPort.get() + elif key == 'Mileskm': options.mileskm.set(value) elif key == 'MsgStyle': options.ireport.set(value) elif key == 'Region': options.iregion.set(value) From 74b696e065da975f9ce6880f7e78e4f9b5cd9e35 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 17 Apr 2006 00:10:03 +0000 Subject: [PATCH 112/811] - backed out second boo-boo git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@168 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- audio_init.F90 | 2 +- gcom1.f90 | 3 +-- gcom2.f90 | 3 +-- options.py | 11 ++++------- specjt.py | 17 ++++------------- start_oss.c | 46 +++++++++++++++++++++------------------------- wsjt.py | 40 ++++++++++------------------------------ 7 files changed, 42 insertions(+), 80 deletions(-) diff --git a/audio_init.F90 b/audio_init.F90 index 92bbb7c1e..ff6cd46b0 100644 --- a/audio_init.F90 +++ b/audio_init.F90 @@ -70,7 +70,7 @@ subroutine audio_init(ndin,ndout) ! print*,'Audio INIT called.' ierr=start_threads(ndevin,ndevout,y1,y2,nmax,iwrite,iwave,nwave, & 11025,NSPB,TRPeriod,TxOK,ndebug,Transmitting, & - Tsec,ngo,nmode,tbuf,ibuf,ndsec,PttPort,devin_name,devout_name) + Tsec,ngo,nmode,tbuf,ibuf,ndsec) #endif diff --git a/gcom1.f90 b/gcom1.f90 index 192e7658c..abbb013f4 100644 --- a/gcom1.f90 +++ b/gcom1.f90 @@ -40,13 +40,12 @@ integer nx !x coordinate for waterfall pixmap GUI integer mfsample !Measured sample rate, input SoundIn integer mfsample2 !Measured sample rate, output SoundOut integer ns0 !Time at last ALL.TXT date entry Decoder -character*12 devin_name,devout_name ! GUI common/gcom1/Tbuf(1024),ntrbuf(1024),Tsec,rxdelay,txdelay, & samfacin,samfacout,txsnrdb,y1(NRXMAX),y2(NRXMAX), & nmax,iwrite,iread,iwave(NTXMAX),nwave,TxOK,Receiving,Transmitting, & TxFirst,TRPeriod,ibuf,ibuf0,ave,rms,ngo,level,mute,newdat,ndsec, & - ndevin,ndevout,nx,mfsample,mfsample2,ns0,devin_name,devout_name + ndevin,ndevout,nx,mfsample,mfsample2,ns0 !### volatile /gcom1/ diff --git a/gcom2.f90 b/gcom2.f90 index bb91f4c53..109858b64 100644 --- a/gcom2.f90 +++ b/gcom2.f90 @@ -79,7 +79,6 @@ character*24 decodedfile character*80 AppDir !WSJT installation directory GUI character*80 filetokilla !Filenames (full path) Decoder character*80 filetokillb -character*12 pttport common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & green(500),ngreen,dgain,iter,ndecoding,ndecoding0,mousebutton, & @@ -91,6 +90,6 @@ common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & idinterval,msmax,lenappdir,ndiskdat,nlines,nflat,ntxreq,ntxnow, & ndepth,nspecial,ndf,ss1(-224:224),ss2(-224:224), & mycall,hiscall,hisgrid,txmsg,sending,mode,fname0,fnamea, & - fnameb,decodedfile,AppDir,filetokilla,filetokillb,utcdate,pttport + fnameb,decodedfile,AppDir,filetokilla,filetokillb,utcdate !### volatile /gcom2/ diff --git a/options.py b/options.py index b57025ea3..df7b361d6 100644 --- a/options.py +++ b/options.py @@ -25,11 +25,8 @@ MyGrid=StringVar() #TxDelay=StringVar() IDinterval=IntVar() ComPort=IntVar() -PttPort=StringVar() ndevin=IntVar() ndevout=IntVar() -DevinName=StringVar() -DevoutName=StringVar() samfacin=DoubleVar() samfacout=DoubleVar() Template1=StringVar() @@ -109,12 +106,12 @@ mygrid=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Grid Locator:', ## value='0.2',entry_textvariable=TxDelay) idinterval=Pmw.EntryField(g1.interior(),labelpos=W,label_text='ID Interval (m):', value=10,entry_textvariable=IDinterval,entry_width=12) -comport=Pmw.EntryField(g1.interior(),labelpos=W,label_text='PTT Port:', - value='1',entry_textvariable=PttPort,entry_width=12) +comport=Pmw.EntryField(g1.interior(),labelpos=W,label_text='COM Port:', + value=1,entry_textvariable=ComPort,entry_width=12) audioin=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio In:', - value='0',entry_textvariable=DevinName,entry_width=12) + value=0,entry_textvariable=ndevin,entry_width=12) audioout=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio Out:', - value='0',entry_textvariable=DevoutName,entry_width=12) + value=0,entry_textvariable=ndevout,entry_width=12) ratein=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Rate In:', value=1.0000,entry_textvariable=samfacin,entry_width=12) rateout=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Rate Out:', diff --git a/specjt.py b/specjt.py index a204f2084..013681974 100644 --- a/specjt.py +++ b/specjt.py @@ -489,19 +489,10 @@ if g.cmap == "AFMHot": #---------------------------------------------- Display GUI and start mainloop draw_axis() -try: - ndevin=g.ndevin.get() -except: - ndevin=0 -Audio.gcom1.ndevin=ndevin - -try: - ndevout=g.ndevout.get() -except: - ndevout=0 -Audio.gcom1.ndevout=ndevout - # Only valid for windows - # for now +Audio.gcom1.ndevin=g.ndevin.get() +Audio.gcom1.ndevout=g.ndevout.get() +ndevin=g.ndevin.get() +ndevout=g.ndevout.get() Audio.audio_init(ndevin,ndevout) #Start the audio stream ltime.after(200,update) diff --git a/start_oss.c b/start_oss.c index dc85524af..c241829e3 100644 --- a/start_oss.c +++ b/start_oss.c @@ -80,8 +80,7 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int *nwave, int *nfsample, int *nsamperbuf, int *TRPeriod, int *TxOK, int *ndebug, int *Transmitting, double *Tsec, int *ngo, int *nmode, - double tbuf[], int *ibuf, int *ndsec, - char *PttPort, char *devin_name, char *devout_name) + double tbuf[], int *ibuf, int *ndsec) { pthread_t thread1,thread2; int iret1,iret2; @@ -91,35 +90,32 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int format; int channels; double dnfs; - int i; - char *p; - - p = strchr(devin_name, ' '); - if(p != NULL) - *p = '\0'; - - p = strchr(devin_name, '/'); - if(p != NULL) - snprintf(dsp_in, MAXDSPNAME, "%s", devin_name); /* assume /dev/... */ - else - snprintf(dsp_in, MAXDSPNAME, "/dev/%s", devin_name); + /* XXX OSS device is decoded from ndevin and ndevout + * This is not strictly speaking the way to do it and is + * probably specific to FreeBSD for now. + * i.e. the .0 addition is a vchan; I'll add configure magic later. --db + */ + snprintf(dsp_in, MAXDSPNAME, + "/dev/dsp%d.0", *ndevin); dsp_in[MAXDSPNAME] = '\0'; data.fd_in = open (dsp_in, O_RDWR, 0); if (data.fd_in < 0) { fprintf(stderr, "Cannot open %s for input.\n", dsp_in); - return(-1); + exit(-1); } - data.fd_out = data.fd_in; - strncpy(dsp_out, dsp_in, sizeof(dsp_out)); - dsp_out[sizeof(dsp_out)] = '\0'; + if (*ndevin == *ndevout) { + data.fd_out = data.fd_in; + strncpy(dsp_out, dsp_in, sizeof(dsp_out)); + dsp_out[sizeof(dsp_out)] = '\0'; - if (ioctl(data.fd_in, SNDCTL_DSP_SETDUPLEX, 0) < 0) { - fprintf(stderr, "Cannot use %s for full duplex.\n", dsp_in); - return(-1); + if (ioctl(data.fd_in, SNDCTL_DSP_SETDUPLEX, 0) < 0) { + fprintf(stderr, "Cannot use %s for full duplex.\n", dsp_in); + exit(-1); + } } data.Tsec = Tsec; @@ -144,23 +140,23 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], channels = 2; if (ioctl (data.fd_in, SNDCTL_DSP_CHANNELS, &channels) == -1) { fprintf (stderr, "Unable to set 2 channels for input.\n"); - return (-1); + exit (-1); } if (channels != 2) { fprintf (stderr, "Unable to set 2 channels.\n"); - return (-1); + exit (-1); } format = AFMT_S16_NE; if (ioctl (data.fd_in, SNDCTL_DSP_SETFMT, &format) == -1) { fprintf (stderr, "Unable to set format for input.\n"); - return (-1); + exit (-1); } if (ioctl (data.fd_in, SNDCTL_DSP_SPEED, &rate) == -1) { fprintf (stderr, "Unable to set rate for input\n"); - return (-1); + exit (-1); } printf("Audio OSS streams running normally.\n"); diff --git a/wsjt.py b/wsjt.py index 1d495ea5e..af5d98472 100644 --- a/wsjt.py +++ b/wsjt.py @@ -98,8 +98,6 @@ g.freeze_decode=0 g.mode="" g.ndevin=IntVar() g.ndevout=IntVar() -g.DevinName=StringVar() -g.DevoutName=StringVar() g.focus=0 #------------------------------------------------------ showspecjt def showspecjt(event=NONE): @@ -1514,7 +1512,7 @@ def update(): Audio.gcom2.nslim2=isync-4 if nosh441.get()==1 and mode.get()=='FSK441': Audio.gcom2.nslim2=99 try: - Audio.gcom2.nport=options.ComPort.get() + Audio.gcom2.nport=int(options.ComPort.get()) except: Audio.gcom2.nport=0 @@ -2015,35 +2013,17 @@ try: # elif key == 'TxDelay': options.TxDelay.set(value) elif key == 'IDinterval': options.IDinterval.set(value) elif key == 'ComPort': - try: - options.ComPort.set(value) - Audio.gcom2.nport=options.ComPort.get() - except: - options.ComPort.set(0) - Audio.gcom2.nport=0 - - Audio.gcom2.PttPort=options.ComPort.get() - + options.ComPort.set(value) + Audio.gcom2.nport=int(options.ComPort.get()) elif key == 'Mileskm': options.mileskm.set(value) elif key == 'MsgStyle': options.ireport.set(value) elif key == 'Region': options.iregion.set(value) elif key == 'AudioIn': - try: - g.ndevin.set(value) - except: - g.ndevin.set(0) - g.DevinName.set(value) - options.DevinName.set(value) - Audio.gcom1.devin_name=(options.DevinName.get()+' ')[:12] + g.ndevin.set(value) + options.ndevin.set(value) elif key == 'AudioOut': - try: - g.ndevout.set(value) - Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12] - except: - g.ndevout.set(0) - g.DevoutName.set(value) - options.DevoutName.set(value) - Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12] + g.ndevout.set(value) + options.ndevout.set(value) elif key == 'SamFacIn': options.samfacin.set(value) elif key == 'SamFacOut': options.samfacout.set(value) elif key == 'Template1': options.Template1.set(value.replace("_"," ")) @@ -2133,12 +2113,12 @@ f.write("HisGrid " + t + "\n") #f.write("RxDelay " + str(options.RxDelay.get()) + "\n") #f.write("TxDelay " + str(options.TxDelay.get()) + "\n") f.write("IDinterval " + str(options.IDinterval.get()) + "\n") -f.write("ComPort " + options.PttPort.get() + "\n") +f.write("ComPort " + str(options.ComPort.get()) + "\n") f.write("Mileskm " + str(options.mileskm.get()) + "\n") f.write("MsgStyle " + str(options.ireport.get()) + "\n") f.write("Region " + str(options.iregion.get()) + "\n") -f.write("AudioIn " + options.DevinName.get() + "\n") -f.write("AudioOut " + options.DevoutName.get() + "\n") +f.write("AudioIn " + str(options.ndevin.get()) + "\n") +f.write("AudioOut " + str(options.ndevout.get()) + "\n") f.write("SamFacIn " + str(options.samfacin.get()) + "\n") f.write("SamFacOut " + str(options.samfacout.get()) + "\n") if options.Template6.get()=="": options.Template6.set("_") From 464498eb53129ec43f8b78325eada59c4d7c8f33 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 17 Apr 2006 20:43:21 +0000 Subject: [PATCH 116/811] - More refinements on configure for jack - first (non working) cut at jack support (start_jack.c) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@175 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 13 +- configure.ac | 9 +- start_jack.c | 397 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 411 insertions(+), 8 deletions(-) create mode 100644 start_jack.c diff --git a/configure b/configure index ad579685c..41ece91b1 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 5.9.2. # -# $Id: configure.ac 161 2006-04-13 04:50:00Z va3db $ +# $Id: configure.ac 173 2006-04-17 06:26:09Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -929,7 +929,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 161 2006-04-13 04:50:00Z va3db $ +$Id: configure.ac 173 2006-04-17 06:26:09Z va3db $ _ACEOF exit 0 fi @@ -6076,11 +6076,14 @@ _ACEOF fi -if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then +if test "$alsa" != yes -a "$oss" != yes -a \ + "$portaudio" != yes -a "$jack" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then portaudio=yes; elif test $HAS_ASOUNDLIB_H -eq 1; then alsa=yes; + elif test $HAS_SOUNDCARD_H -eq 1; then + oss=yes; fi fi @@ -6122,9 +6125,9 @@ cat >>confdefs.h <<\_ACEOF #define USE_JACK 1 _ACEOF - AUDIO="a2d.f90 jtaudio.c start_jack.c" + AUDIO="start_jack.c" - LDFLAGS="${LDFLAGS} -ljack -lsamplerate" + LDFLAGS="${LDFLAGS} -ljack" fi diff --git a/configure.ac b/configure.ac index b024d1822..5d8653968 100644 --- a/configure.ac +++ b/configure.ac @@ -306,11 +306,14 @@ if test "$parallel" = yes; then AC_DEFINE(USE_PARALLEL, 1, [Define if you want Serial port used.]) fi -if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then +if test "$alsa" != yes -a "$oss" != yes -a \ + "$portaudio" != yes -a "$jack" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then [portaudio=yes]; elif test $HAS_ASOUNDLIB_H -eq 1; then [alsa=yes]; + elif test $HAS_SOUNDCARD_H -eq 1; then + [oss=yes]; fi fi @@ -333,8 +336,8 @@ fi if test "$jack" = yes; then AC_DEFINE(USE_JACK, 1, [Define if you want JACK used.]) - AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_jack.c") - LDFLAGS="${LDFLAGS} -ljack -lsamplerate" + AC_SUBST(AUDIO, "start_jack.c") + LDFLAGS="${LDFLAGS} -ljack" fi dnl set conf flags diff --git a/start_jack.c b/start_jack.c new file mode 100644 index 000000000..763707384 --- /dev/null +++ b/start_jack.c @@ -0,0 +1,397 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define AUDIOBUFSIZE 4096 +#define FRAMESPERBUFFER 1024 + +char rcv_buf[AUDIOBUFSIZE]; /* XXX grab one from upper app later --db */ +char tx_buf[AUDIOBUFSIZE]; /* XXX grab one from upper app later --db */ + +/* + * Lots of pieces stolen directly from jack simple_client.c + */ +jack_port_t *input_port; +jack_port_t *output_port; +jack_client_t *client; +void jack_read(void); +void jack_write(void); + +/* a simple state machine for this client */ +volatile enum { + Init, + Run, + Exit +} client_state = Init; + +extern void decode1_(int *iarg); + +/* + * local state data referencing some gcom common fortran variables as well + */ +struct audio_data { + int fd_in; /* Audio fd in; used only locally in this function */ + int fd_out; /* Audio fd out; used only locally in this function */ + double *Tsec; /* Present time SoundIn,SoundOut */ + double *tbuf; /* Tsec at time of input callback SoundIn */ + int *iwrite; /* Write pointer to Rx ring buffer SoundIn */ + int *ibuf; /* Most recent input buffer# SoundIn */ + int *TxOK; /* OK to transmit? SoundIn */ + int *ndebug; /* Write debugging info? GUI */ + int *ndsec; /* Dsec in units of 0.1 s GUI */ + int *Transmitting; /* Actually transmitting? SoundOut */ + int *nwave; /* Number of samples in iwave SoundIn */ + int *nmode; /* Which WSJT mode? GUI */ + int *trperiod; /* Tx or Rx period in seconds GUI */ + int nbuflen; + int nfs; + int16_t *y1; /* Ring buffer for audio channel 0 SoundIn */ + int16_t *y2; /* Ring buffer for audio channel 1 SoundIn */ + short *iwave; +}data; + +/** + * The process callback for this JACK application is called in a + * special realtime thread once for each audio cycle. + * + * This client follows a simple rule: when the JACK transport is + * running, copy the input port to the output. When it stops, exit. + */ +int +process (jack_nframes_t nframes, void *arg) +{ + jack_default_audio_sample_t *in, *out; + jack_transport_state_t ts = jack_transport_query(client, NULL); + int i; + + if (ts == JackTransportRolling) { + + if (client_state == Init) + client_state = Run; + printf("ZZZ nframes = %d\n", nframes); + in = jack_port_get_buffer (input_port, nframes); + /* First hack */ + memcpy (rcv_buf, in, AUDIOBUFSIZE); + jack_read(); + +#if 0 + out = jack_port_get_buffer (output_port, nframes); + memcpy (out, in, + sizeof (jack_default_audio_sample_t) * nframes); +#endif + + } else if (ts == JackTransportStopped) { + + if (client_state == Run) + client_state = Exit; + } + + return 0; +} + +/** + * JACK calls this shutdown_callback if the server ever shuts down or + * decides to disconnect the client. + */ +void +jack_shutdown (void *arg) +{ + return; +} + +/* + * start_threads() + * inputs - ndevin device number for input + * - ndevout device number for output + * - y1 short int array for channel 0 + * - y2 short int array for channel 1 + * - nmax + * - iwrite + * - iwave + * - nwave + * - rate + * - NSPB + * - TRPeriod + * - TxOK + * - ndebug debug output or not? + * - Transmitting + * - Tsec + * - ngo + * - nmode + * - tbuf + * - ibuf + * - ndsec + * output - ? + * side effects - Called from audio_init.f90 to start audio decode and + * OSS thread. + */ + +int +start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], + int *nbuflen, int *iwrite, short iwave[], + int *nwave, int *nfsample, int *nsamperbuf, + int *TRPeriod, int *TxOK, int *ndebug, + int *Transmitting, double *Tsec, int *ngo, int *nmode, + double tbuf[], int *ibuf, int *ndsec) +{ + pthread_t thread1,thread2; + int iret1,iret2; + int iarg1 = 1,iarg2 = 2; + int32_t rate=*nfsample; + double dnfs; + const char **ports; + const char *client_name; + jack_options_t options = JackNullOption; + jack_status_t status; + + data.Tsec = Tsec; + data.tbuf = tbuf; + data.iwrite = iwrite; + data.ibuf = ibuf; + data.TxOK = TxOK; + data.ndebug = ndebug; + data.ndsec = ndsec; + data.Transmitting = Transmitting; + data.y1 = y1; + data.y2 = y2; + data.nbuflen = *nbuflen; + data.nmode = nmode; + data.nwave = nwave; + data.iwave = iwave; + data.nfs = *nfsample; + data.trperiod = TRPeriod; + + dnfs=(double)*nfsample; + + /* open a client connection to the JACK server */ + + client = jack_client_open ("wsjt", options, &status, NULL); + if (client == NULL) { + fprintf (stderr, "jack_client_open() failed, " + "status = 0x%2.0x\n", status); + if (status & JackServerFailed) { + fprintf (stderr, "Unable to connect to JACK server\n"); + } + return(-1); + } + if (status & JackServerStarted) { + fprintf (stderr, "JACK server started\n"); + } + if (status & JackNameNotUnique) { + client_name = jack_get_client_name(client); + fprintf (stderr, "unique name `%s' assigned\n", client_name); + } + + /* tell the JACK server to call `process()' whenever + * there is work to be done. + */ + + jack_set_process_callback (client, process, 0); + + /* tell the JACK server to call `jack_shutdown()' if + * it ever shuts down, either entirely, or if it + * just decides to stop calling us. + */ + + jack_on_shutdown (client, jack_shutdown, 0); + + /* display the current sample rate. + */ + + printf ("engine sample rate: %" PRIu32 "\n", + jack_get_sample_rate (client)); + + /* create two ports */ + + input_port = jack_port_register (client, "input", + JACK_DEFAULT_AUDIO_TYPE, + JackPortIsInput, 0); + output_port = jack_port_register (client, "output", + JACK_DEFAULT_AUDIO_TYPE, + JackPortIsOutput, 0); + + if ((input_port == NULL) || (output_port == NULL)) { + fprintf(stderr, "no more JACK ports available\n"); + /* ZZZ close jack above */ + return(-1); + } + + /* Tell the JACK server that we are ready to roll. Our + * process() callback will start running now. + */ + + if (jack_activate (client)) { + fprintf (stderr, "cannot activate client"); + /* ZZZ close jack above */ + return(-1); + } + + /* Connect the ports. You can't do this before the client is + * activated, because we can't make connections to clients + * that aren't running. Note the confusing (but necessary) + * orientation of the driver backend ports: playback ports are + * "input" to the backend, and capture ports are "output" from + * it. + */ + + ports = jack_get_ports (client, NULL, NULL, + JackPortIsPhysical|JackPortIsOutput); + if (ports == NULL) { + fprintf(stderr, "no physical capture ports\n"); + /* ZZZ close jack above */ + return(-1); + } + + if (jack_connect (client, ports[0], jack_port_name (input_port))) { + fprintf (stderr, "cannot connect input ports\n"); + } + + free (ports); + + ports = jack_get_ports (client, NULL, NULL, + JackPortIsPhysical|JackPortIsInput); + if (ports == NULL) { + fprintf(stderr, "no physical playback ports\n"); + /* ZZZ close jack above */ + return(-1); + } + + if (jack_connect (client, jack_port_name (output_port), ports[0])) { + fprintf (stderr, "cannot connect output ports\n"); + } + + free (ports); + + + printf("Audio jack streams running normally.\n"); + printf("******************************************************************\n"); + + printf("start_threads: creating thread for decode1\n"); + // iret1 = pthread_create(&thread1, NULL, + // (void *(*)(void *))oss_loop, &iarg1); + // printf("start_threads: creating thread for decode1_\n"); + iret2 = pthread_create(&thread2, NULL, + (void *(*)(void *))decode1_,&iarg2); +/* keep running until the transport stops */ + + while (client_state != Exit) { + sleep (1); + } + + jack_client_close (client); + + return(0); +} + +/* + * oss_loop + * + * inputs - int pointer NOT USED + * output - none + * side effects - + */ + +void +jack_read(void) +{ + struct timeval tv; + unsigned int i; + static int n=0; + static int n2=0; + static int ia=0; + static int ib=0; + static int ic=0; + static int16_t *in; + static int16_t *wptr; + static int TxOKz=0; + static int ncall=0; + static int nsec=0; + static double stime; + + /* Get System time */ + gettimeofday(&tv, NULL); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + + *(data.ndsec) * 0.1; + *(data.Tsec) = stime; + + ncall++; + + /* increment buffer pointers only if data available */ + ia=*(data.iwrite); + ib=*(data.ibuf); + data.tbuf[ib-1] = stime; /* convert to c index to store */ + ib++; + if(ib>FRAMESPERBUFFER) + ib=1; + *(data.ibuf) = ib; + in = (int16_t *)rcv_buf; /* XXX */ + for(i=0; i= data.nbuflen) + ia=0; //Wrap buffer pointer if necessary + *(data.iwrite) = ia; /* Save buffer pointer */ + fivehz_(); /* Call fortran routine */ +} + +void +jack_write(void) +{ + int i; + static int n=0; + static int ic=0; + struct timeval tv; + static int n2=0; + static int16_t *wptr; + static int TxOKz=0; + static int nsec=0; + static double stime; + + /* Get System time */ + gettimeofday(&tv, NULL); + stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + + *(data.ndsec) * 0.1; + *(data.Tsec) = stime; + + if(*(data.TxOK) && (!TxOKz)) { + n=nsec/(*(data.trperiod)); + ic = (int)(stime - *(data.trperiod)*n) * data.nfs; + ic = ic % *(data.nwave); + } + + TxOKz = *(data.TxOK); + *(data.Transmitting) = *(data.TxOK); + wptr = (int16_t *)tx_buf; /* XXX */ + if(*(data.TxOK)) { + for(i=0 ; i= *(data.nwave)) { + ic = ic % *(data.nwave); /* Wrap buffer pointer if necessary */ + if(*(data.nmode) == 2) + *(data.TxOK) = 0; + } + } + } else { + memset(tx_buf, 0, AUDIOBUFSIZE); + } + + if (write(data.fd_out, tx_buf, AUDIOBUFSIZE) < 0) { + fprintf(stderr, "Can't write to soundcard.\n"); + return; + } + fivehztx_(); /* Call fortran routine */ +} From 688fd0c1a359052d7bcbb3a17f64953dba4074ae Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Tue, 18 Apr 2006 01:48:38 +0000 Subject: [PATCH 117/811] - Little more cleanup, still not fully working git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@176 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_jack.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/start_jack.c b/start_jack.c index 763707384..b3c54f268 100644 --- a/start_jack.c +++ b/start_jack.c @@ -72,14 +72,14 @@ process (jack_nframes_t nframes, void *arg) int i; if (ts == JackTransportRolling) { - if (client_state == Init) client_state = Run; - printf("ZZZ nframes = %d\n", nframes); in = jack_port_get_buffer (input_port, nframes); /* First hack */ - memcpy (rcv_buf, in, AUDIOBUFSIZE); - jack_read(); + if (nframes != 0) { + memcpy (rcv_buf, in, nframes); + jack_read(); + } #if 0 out = jack_port_get_buffer (output_port, nframes); @@ -280,20 +280,16 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], iret2 = pthread_create(&thread2, NULL, (void *(*)(void *))decode1_,&iarg2); /* keep running until the transport stops */ - - while (client_state != Exit) { - sleep (1); - } - +#if 0 jack_client_close (client); - +#endif return(0); } /* - * oss_loop + * jack_read * - * inputs - int pointer NOT USED + * inputs - none * output - none * side effects - */ From 5c0bdab60be79a6710a8489161f41393fe76b177 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 21 Apr 2006 14:02:46 +0000 Subject: [PATCH 118/811] Adjustments to allow "addpfx" (temporary add-on DXCC prefix) to have up to 8 characters. Augmented callsign (e.g., VU4AN/VU3RYF) must have no more than 12 characters. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@177 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- gcom4.f90 | 2 +- getpfx1.f | 21 +++++++++++++-------- getpfx2.f | 4 ++-- unpackmsg.f | 1 + wsjt.py | 6 +++--- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/gcom4.f90 b/gcom4.f90 index d9f0e70d8..d7ac35cc8 100644 --- a/gcom4.f90 +++ b/gcom4.f90 @@ -1,6 +1,6 @@ ! Variable Purpose Set in Thread !------------------------------------------------------------------------- -character addpfx*4 !Add-on prefix, as in ZA/PA2CHR GUI +character addpfx*8 !Add-on prefix, as in ZA/PA2CHR GUI integer*2 d2c !Rx data recovered from recorded file GUI integer jzc !Length of data available in d2c GUI character filename*24 !Name of wave file read from disk GUI diff --git a/getpfx1.f b/getpfx1.f index fb8646349..99bd3ba2d 100644 --- a/getpfx1.f +++ b/getpfx1.f @@ -1,15 +1,18 @@ subroutine getpfx1(callsign,k) character callsign*12 - character*4 c + character*8 c + character addpfx*8 + common/gcom4/addpfx !Can't 'include' *.f90 in *.f include 'pfx.f' iz=index(callsign,' ') - 1 + if(iz.lt.0) iz=12 islash=index(callsign(1:iz),'/') k=0 c=' ' - if(islash.gt.0 .and. (islash.le.4 .or. (islash.eq.5 .and. - + iz.ge.8))) then + if(islash.gt.0 .and. islash.le.(iz-4)) then +! Add-on prefix c=callsign(1:islash-1) callsign=callsign(islash+1:iz) do i=1,NZ @@ -18,8 +21,13 @@ go to 10 endif enddo + if(addpfx.eq.c) then + k=449 + go to 10 + endif - else if(islash.gt.5 .or. (islash.eq.5 .and. iz.eq.6)) then + else if(islash.eq.(iz-1)) then +! Add-on suffix c=callsign(islash+1:iz) callsign=callsign(1:islash-1) do i=1,NZ2 @@ -30,10 +38,7 @@ enddo endif - 10 continue - if(islash.ne.0 .and.k.eq.0) k=-1 -c print*,iz,islash,k,' ',c - + 10 if(islash.ne.0 .and.k.eq.0) k=-1 return end diff --git a/getpfx2.f b/getpfx2.f index 25a51a5d2..11d630159 100644 --- a/getpfx2.f +++ b/getpfx2.f @@ -2,7 +2,7 @@ character callsign*12 include 'pfx.f' - character addpfx*4 + character addpfx*8 common/gcom4/addpfx k=k0 @@ -15,7 +15,7 @@ callsign=callsign(1:iz)//'/'//sfx(k-400) else if(k.eq.449) then iz=index(addpfx,' ') - 1 - if(iz.lt.1) iz=4 + if(iz.lt.1) iz=8 callsign=addpfx(1:iz)//'/'//callsign endif diff --git a/unpackmsg.f b/unpackmsg.f index a96711285..81df6b783 100644 --- a/unpackmsg.f +++ b/unpackmsg.f @@ -73,6 +73,7 @@ msg(j:j)=c2(i:i) if(c2(i:i).eq.' ') go to 20 enddo + j=j+1 msg(j:j)=' ' 20 if(k.eq.0) then diff --git a/wsjt.py b/wsjt.py index af5d98472..24ddd7983 100644 --- a/wsjt.py +++ b/wsjt.py @@ -791,7 +791,7 @@ def prefixes(event=NONE): n=0 t1=t1+"\n" if options.addpfx.get().lstrip(): - t1=t1+"\nOptional prefix: "+(options.addpfx.get().lstrip()+' ')[:4] + t1=t1+"\nOptional prefix: "+(options.addpfx.get().lstrip()+' ')[:8] t2=t2+"\n"+t1 Label(pfx,text=t2,justify=LEFT).pack(padx=20) pfx.focus_set() @@ -1482,7 +1482,7 @@ def update(): Audio.gcom2.mycall=(options.MyCall.get()+' ')[:12] Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] Audio.gcom2.hisgrid=(HisGrid.get()+' ')[:6] - Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:4] + Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] Audio.gcom2.ntxreq=ntx.get() tx=(tx1,tx2,tx3,tx4,tx5,tx6) Audio.gcom2.txmsg=(tx[ntx.get()-1].get()+' ')[:28] @@ -2086,7 +2086,7 @@ Audio.gcom2.appdir=(appdir+' Audio.gcom2.ndepth=ndepth.get() Audio.ftn_init() GenStdMsgs() -Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:4] +Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] stopmon() first=1 if g.Win32: root.iconbitmap("wsjt.ico") From eea8944eebbd7e3df614d0e69174b2f094d655e0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 21 Apr 2006 19:33:30 +0000 Subject: [PATCH 119/811] More changes to support overlong calls like VU4AN/VU3RYH. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@178 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- chkmsg.f | 6 +++--- deep65.F | 2 ++ wsjt.py | 2 +- wsjt65.f | 10 +++++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/chkmsg.f b/chkmsg.f index 0a1ea7193..e4e98427b 100644 --- a/chkmsg.f +++ b/chkmsg.f @@ -11,17 +11,17 @@ enddo i=22 - 10 if(i.ge.11 .and. message(i-3:i).eq.' OOO') then + 10 if(i.ge.11 .and. (message(i-3:i).eq.' OOO') .or. + + (message(20:22).eq.' OO')) then cok='OOO' flip=-1.0 message=message(1:i-4) endif - if(message(1:3).eq.'ATT') nspecial=1 +! if(message(1:3).eq.'ATT') nspecial=1 if(message(1:2).eq.'RO') nspecial=2 if(message(1:3).eq.'RRR') nspecial=3 if(message(1:2).eq.'73') nspecial=4 return end - diff --git a/deep65.F b/deep65.F index 9a6c63676..e0d71acd7 100644 --- a/deep65.F +++ b/deep65.F @@ -62,8 +62,10 @@ 5 icall=icall+1 j1=index(mycall,' ') - 1 + if(j1.le.-1) j1=12 if(j1.lt.3) j1=6 j2=index(callsign,' ') - 1 + if(j2.le.-1) j2=12 if(j2.lt.3) j2=6 j3=index(mycall,'/') j4=index(callsign,'/') diff --git a/wsjt.py b/wsjt.py index 24ddd7983..36abaf883 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#-------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/wsjt65.f b/wsjt65.f index 4fcdf4677..6f8cd14d2 100644 --- a/wsjt65.f +++ b/wsjt65.f @@ -165,8 +165,8 @@ C result from the Reed-Solomon decoder. if(c1.ge.'a' .and. c1.le.'z') decoded(i:i)=char(ichar(c1)-32) enddo write(line,1010) cfile6,nsync,nsnr,dtx-1.0,ndf, - + nint(width),csync,special,decoded(1:18),cooo,kvqual,nqual,itry - 1010 format(a6,i3,i5,f5.1,i5,i3,1x,a1,1x,a5,a18,1x,a3,i5,i3,i2) + + nint(width),csync,special,decoded(1:19),cooo,kvqual,nqual,itry + 1010 format(a6,i3,i5,f5.1,i5,i3,1x,a1,1x,a5,a19,1x,a3,i4,i3,i2) C Blank DT if shorthand message (### wrong logic? ###) if(special.ne.' ') then @@ -195,13 +195,13 @@ C Write decoded msg unless this is an "Exclude" request: C Write the average line if(ns1.ge.1 .and. ns1.ne.ns10) then if(ns1.lt.10) write(ave1,1021) cfile6,1,nused1,ns1,avemsg1 - 1021 format(a6,i3,i4,'/',i1,20x,a18) + 1021 format(a6,i3,i4,'/',i1,20x,a19) if(ns1.ge.10 .and. nsave.le.99) write(ave1,1022) cfile6, + 1,nused1,ns1,avemsg1 - 1022 format(a6,i3,i4,'/',i2,19x,a18) + 1022 format(a6,i3,i4,'/',i2,19x,a19) if(ns1.ge.100) write(ave1,1023) cfile6,1,nused1,ns1, + avemsg1 - 1023 format(a6,i3,i4,'/',i3,18x,a18) + 1023 format(a6,i3,i4,'/',i3,18x,a19) if(lcum .and. (avemsg1.ne.' ')) + write(21,1011) ave1(1:57)//' ' ns10=ns1 From 8ef5de90a883563035b6374f9ce4def278755bb8 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 21 Apr 2006 19:37:02 +0000 Subject: [PATCH 120/811] Fixed reading of transmittable test files. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@179 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjtgen.F90 | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/wsjtgen.F90 b/wsjtgen.F90 index 1ce2bca99..1b9082d24 100644 --- a/wsjtgen.F90 +++ b/wsjtgen.F90 @@ -18,15 +18,15 @@ subroutine wsjtgen integer itone(84) character msg*28,msgsent*22,idmsg*22 real*8 freq,pha,dpha,twopi,dt - character testfile*27 + character testfile*27,tfile2*80 logical lcwid - integer*2 icwid(110250) + integer*2 icwid(110250),jwave(NWMAX) integer*1 hdr(44) integer*2 nfmt2,nchan2,nbitsam2,nbytesam2 character*4 ariff,awave,afmt,adata common/hdr/ariff,lenfile,awave,afmt,lenfmt,nfmt2,nchan2, & - nsamrate,nbytesec,nbytesam2,nbitsam2,adata,ndata + nsamrate,nbytesec,nbytesam2,nbitsam2,adata,ndata,jwave equivalence (ariff,hdr) data twopi/6.28318530718d0/ @@ -64,10 +64,6 @@ subroutine wsjtgen testfile=msg(2:) #ifdef Win32 open(18,file=testfile,form='binary',status='old',err=12) -#else - open(18,file=testfile,form='unformatted',status='old',err=12) -#endif - go to 14 12 print*,'Cannot open test file ',msg(2:) go to 999 @@ -76,15 +72,27 @@ subroutine wsjtgen call rfile(18,iwave,ndata,ierr) close(18) if(ierr.ne.0) print*,'Error reading test file ',msg(2:) + +#else + tfile2=testfile + call rfile2(tfile2,hdr,44+2*661500,nr) + if(nr.le.0) then + print*,'Error reading ',testfile + stop + endif + do i=1,ndata/2 + iwave(i)=jwave(i) + enddo +#endif nwave=ndata/2 + print*,nwave do i=nwave,NTXMAX iwave(i)=0 enddo - sending=txmsg - sendingsh=2 + sending=txmsg + sendingsh=2 go to 999 endif - ! Transmit a fixed tone at specified frequency freq=1000.0 From be86a297543147278dc81b162b4dc541b005ea98 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 21 Apr 2006 20:18:51 +0000 Subject: [PATCH 121/811] Another tweak for extra-long callsigns. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@180 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- chkmsg.f | 6 +++++- wsjt.py | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/chkmsg.f b/chkmsg.f index e4e98427b..7f19da4fb 100644 --- a/chkmsg.f +++ b/chkmsg.f @@ -15,7 +15,11 @@ + (message(20:22).eq.' OO')) then cok='OOO' flip=-1.0 - message=message(1:i-4) + if(message(20:22).eq.' OO') then + message=message(1:19) + else + message=message(1:i-4) + endif endif ! if(message(1:3).eq.'ATT') nspecial=1 diff --git a/wsjt.py b/wsjt.py index 36abaf883..90b265c06 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#-------------------------------------------------------------------- WSJT +#------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw @@ -1392,9 +1392,7 @@ def update(): nmsg=int(Audio.gcom2.nmsg) t=g.ftnstr(Audio.gcom2.sending) if t[:3]=="CQ ": nsked.set(0) - t="Transmitting: "+t[:nmsg] -# t="Transmitting: " -# t="Txing: "+t[:nmsg] + t="Txing: "+t[:nmsg] bgcolor='yellow' if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' #Shorthand (lt blue) if Audio.gcom2.sendingsh==-1: bgcolor='red' #Plain Text From 6c61754fb3232c918139a38e3ff3c5aaa930946a Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 23 Apr 2006 16:07:18 +0000 Subject: [PATCH 122/811] - Fix mis-match between spaces to pad and :8 argument given here. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@181 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsjt.py b/wsjt.py index 90b265c06..1fe717f28 100644 --- a/wsjt.py +++ b/wsjt.py @@ -2084,7 +2084,7 @@ Audio.gcom2.appdir=(appdir+' Audio.gcom2.ndepth=ndepth.get() Audio.ftn_init() GenStdMsgs() -Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] +Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] stopmon() first=1 if g.Win32: root.iconbitmap("wsjt.ico") From a4c75ffc9064a20000330a1d669553a3c21dfebc Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 3 Jul 2006 19:18:27 +0000 Subject: [PATCH 123/811] - corrected 4 vs. 8 space git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@182 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsjt.py b/wsjt.py index 1fe717f28..2742b833d 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1480,7 +1480,7 @@ def update(): Audio.gcom2.mycall=(options.MyCall.get()+' ')[:12] Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] Audio.gcom2.hisgrid=(HisGrid.get()+' ')[:6] - Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] + Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] Audio.gcom2.ntxreq=ntx.get() tx=(tx1,tx2,tx3,tx4,tx5,tx6) Audio.gcom2.txmsg=(tx[ntx.get()-1].get()+' ')[:28] From bbf2bc920878f78fd50191042a7061fd272485a1 Mon Sep 17 00:00:00 2001 From: Rainer Streubel Date: Tue, 4 Jul 2006 15:30:46 +0000 Subject: [PATCH 124/811] A short list of links and infos to build WSJT ( used SuSE Linux 10.0) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@183 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- HowtoWSJT-SuSE.html | 185 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 HowtoWSJT-SuSE.html diff --git a/HowtoWSJT-SuSE.html b/HowtoWSJT-SuSE.html new file mode 100644 index 000000000..f08a42438 --- /dev/null +++ b/HowtoWSJT-SuSE.html @@ -0,0 +1,185 @@ + + + + + + + + + + + +

HowTo for Linux SuSE 10.0 ( DL3LST)
+
+Use Yast  to install the following packages  from the Linux  Distribution DVD
+
+Compiler
+      cpp
+      gcc
+      gcc-c++
+      liggcc
+
+Tcl/tk
+      tcl-devel
+      tk-devel
+      alsa-devel
+
+Python
+        python
+        python-devel
+        python-imaging
+        python-numeric
+        python-tk
+
+--------------------------------------------------------------------------------------------------
+
+// Fortran compiler
+Page:                    http://www.g95.org/
+Downloadpage:    http://ftp.g95.org/
+Page:                    http://ftp.g95.org/g95-x86-linux.tgz
+
+install: g95
+
+follow instruction File:  Install 
+ 
+How to install g95:     
+
+File Install: 
+1) Unpack the downloaded tarball (e.g. g95-x86-linux.tgz) in a directory
+of your choice:
+
+   tar -zxvf g95-x86-linux.tgz
+
+2) For your convenience, you can create another symbolic link from a
+directory in your $PATH (e.g. ~/bin) to the executable
+
+   ln -s $PWD/g95-install/bin/*g95* ~/bin/g95
+
+
+You should now be able to run g95 and create executables.
+To get a list of environment variables that control the library, run a
+compiled binary with the --help option, ie:
+
+  ./a.out �help
+
+From console try the g95 command .
+The system should answer
+g95:  no input files 
+ 
+
+I changed the SymLink to /usr/bin where i installed the g77 packages too
+ln -s $PWD/g95-install/bin/*g95* /usr/bin/g95
+
+
+
+gcc-g77 compiler
+Page:               http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82721&release_id=15880
+Download:       http://prdownloads.sourceforge.net/mingw/gcc-g77-3.4.2-20040916-1.tar.gz?download
+
+From  gcc-g77-3.4.2-20040916-1.tar.gz  we need the /libexec folder  for l2g 
+copy from the archive  the folder
+/libexec        to      /usr/libexec
+ 
+------------------------------------------------------------------------------
+other packages
+------------------------------------------------------------------------------
+Install: PortaudioV1.19 
+
+Page:                http://www.portaudio.com/usingsvn.html
+Download:        http://www.portaudio.com/archives/pa_previous_snapshot_v19.tar.gz
+./configure
+make  all
+make  install
+------------------------------------------------------------------------------
+FFT3
+Page    :            http://www.fftw.org/  
+Download :       http://www.fftw.org/fftw-3.1.1.tar.gz
+./configure
+./make  all
+./ make install
+
+------------------------------------------------------------------------------
+libsamplerate
+libsamplerate-0.1.2.
+Download:         http://www.mega-nerd.com/SRC/download.html
+./configure
+./make  all
+./ make install
+------------------------------------------------------------------------------
+reed-solomon-4.0
+.Page:  http://www.ka9q.net/code/fec/
+Download:       http://www.ka9q.net/code/fec/reed-solomon-4.0.tar.gz
+/configure
+./make 
+./ make install
+
+
+------------------------------------------------------------------------------
+F2PY  ( Fortran to Python )
+Download:       http://cens.ioc.ee/projects/f2py2e/2.x/F2PY-2-latest.tar.gz
+python setup.py install
+
+
+Scipy_Distutils
+Page:                                     http://cens.ioc.ee/projects/f2py2e/2.x/
+Download:                             http://cens.ioc.ee/projects/f2py2e/2.x/scipy_distutils-latest.tar.gz
+python setup.py install
+
+
+WSJT source code
+K1JT Page:                           http://pulsar.princeton.edu/~joe/K1JT/
+Download page:                    http://developer.berlios.de/projects/wsjt/
+
+
+./configure
+make
+python wsjt.py
+
+that�s all  - have fun 
+
+------------------------------------------------------------------------------
+If you need the packages for other Linux distributions  see linkpages below
+------------------------------------------------------------------------------
+
+Python:
+Page.                                    http://www.python.org/download/releases/2.4.3
+Download:                            http://www.python.org/ftp/python/2.4.3/Python-2.4.3.tgz   
+/configure
+./make  
+./ make install
+than run
+python setup.py install
+
+
+Numeric 
+Page:                         http://numeric.scipy.org/
+Download:                 http://prdownloads.sourceforge.net/numpy/Numeric-24.2.tar.gz?download
+install
+
+Iimaging  (be sure  Tcl/Ck  Lib was installed before)
+Page:                         http://www.pythonware.com/products/pil/
+Download:                 http://effbot.org/downloads/Imaging-1.1.5.tar.gz
+python setup.py install
+
+------------------------------------------------------------------------------
+other sites 
+------------------------------------------------------------------------------
+for gcc compiler try
+http://gcc.gnu.org/mirrors.html
+
+Example German server
+ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.0/
+ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-4.1.1/
+
+the full program  ( !!! filesize is 21 MB  )
+ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.0/gcc-core-4.1.0.tar.gz
+./configure
+make
+make install
+
+ + \ No newline at end of file From 680a9194c9b9649161dd7b7ea6b7a2213100228e Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 5 Jul 2006 03:03:11 +0000 Subject: [PATCH 125/811] - Add in code to look for portaudio v19 beta as a subdir, if found compile it if necessary and use the libs from it instead of the system library. v19 has a different ABI than portaudio normally installed on unix systems. I have come across at least one other program that includes a copy of portaudio v19 with it's release package due to this problem. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@184 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- WSJT_Source_Code.txt | 2 +- configure | 3031 ++++++++++++++++++++++++++---------------- configure.ac | 16 +- 3 files changed, 1918 insertions(+), 1131 deletions(-) diff --git a/WSJT_Source_Code.txt b/WSJT_Source_Code.txt index dd6db58b0..fa0a2d0a0 100755 --- a/WSJT_Source_Code.txt +++ b/WSJT_Source_Code.txt @@ -268,7 +268,7 @@ can now be compiled in Windows as follows: In Linux or FreeBSD, do the following: - $ ./configure --enable-portaudio (or --enable-alsa) + $ ./configure --enable-portaudio (or --enable-alsa or --enable-oss) $ make diff --git a/configure b/configure index 41ece91b1..abffeab7b 100755 --- a/configure +++ b/configure @@ -1,21 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.53 for wsjt 5.9.2. +# Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 173 2006-04-17 06:26:09Z va3db $ +# $Id: configure.ac 175 2006-04-17 20:43:21Z va3db $ # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -24,46 +15,57 @@ fi if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# NLS nuisances. # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -74,6 +76,7 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -84,15 +87,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -140,6 +143,8 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -212,13 +217,20 @@ else fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -228,7 +240,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$as_unset CDPATH # Name of the host. @@ -242,6 +254,7 @@ exec 6>&1 # Initializations. # ac_default_prefix=/usr/local +ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= @@ -298,6 +311,8 @@ ac_includes_default="\ # include #endif" +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT F77 FFLAGS ac_ct_F77 CPP EGREP SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RM CP MV LN SED AR LD TEST PYTHON F2PY G95 GFORTRAN OS CLOBBER FC_LIB_PATH FC AUDIO LIBOBJS LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. ac_init_help= @@ -655,7 +670,7 @@ done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -695,10 +710,10 @@ if test -z "$srcdir"; then # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -721,6 +736,9 @@ if test ! -r $srcdir/$ac_unique_file; then { (exit 1); exit 1; }; } fi fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias @@ -795,9 +813,9 @@ _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -892,12 +910,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. @@ -908,7 +959,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else @@ -922,14 +973,13 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF wsjt configure 5.9.2 -generated by GNU Autoconf 2.53 +generated by GNU Autoconf 2.59 -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 173 2006-04-17 06:26:09Z va3db $ +$Id: configure.ac 175 2006-04-17 20:43:21Z va3db $ _ACEOF exit 0 fi @@ -939,7 +989,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by wsjt $as_me 5.9.2, which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -991,27 +1041,54 @@ _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_sep= -for ac_arg +ac_must_keep_next=false +for ac_pass in 1 2 do - case $ac_arg in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n ) continue ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - esac - # Get rid of the leading space. + 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=`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_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + 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 @@ -1022,6 +1099,7 @@ trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo + cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## @@ -1034,16 +1112,45 @@ _ASBOX case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## @@ -1051,14 +1158,14 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && + rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1138,7 +1245,7 @@ fi # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" @@ -1155,13 +1262,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -1217,6 +1324,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + OLD_CFLAGS="$CFLAGS" @@ -1424,9 +1532,7 @@ if test $ac_prog_rejected = yes; then # 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 - set dummy "$as_dir/$ac_word" ${1+"$@"} - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi @@ -1531,8 +1637,10 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +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. @@ -1556,15 +1664,12 @@ ac_compiler=`set X $ac_compile; echo $2` (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1574,12 +1679,12 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe" +ac_clean_files="$ac_clean_files a.out 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. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 @@ -1593,26 +1698,39 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= -for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; - a.out ) # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool --akim. - export ac_cv_exeext - break;; - * ) break;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; esac done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 -echo "$as_me: error: C compiler cannot create executables" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi @@ -1639,9 +1757,11 @@ if test "$cross_compiling" != yes; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&5 +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&2;} +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi @@ -1649,7 +1769,7 @@ fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. @@ -1669,18 +1789,21 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 # 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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + export ac_cv_exeext + break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +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 @@ -1697,15 +1820,12 @@ if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1722,16 +1842,19 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -1747,15 +1870,12 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1769,11 +1889,21 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1782,10 +1912,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -1801,15 +1932,12 @@ if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1820,11 +1948,21 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1833,10 +1971,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_cc_g=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 @@ -1855,6 +1994,121 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=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 +#include +#include +#include +/* 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 -std1 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 -std1. */ +int osf4_cc_array ['\x00' == 0 ? 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 +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide @@ -1866,19 +2120,28 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ - ''\ - '#include ' \ + '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ @@ -1886,16 +2149,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif +#include int main () { @@ -1906,11 +2166,21 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1919,20 +2189,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + continue fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1943,11 +2211,21 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1956,9 +2234,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then @@ -1969,9 +2248,10 @@ fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1989,7 +2269,7 @@ 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 f77 xlf cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran 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 @@ -2031,7 +2311,7 @@ fi fi if test -z "$F77"; then ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf cf77 cft77 frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 fc + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -2076,7 +2356,7 @@ fi # Provide some information about the compiler. -echo "$as_me:2079:" \ +echo "$as_me:2359:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -2094,9 +2374,10 @@ ac_compiler=`set X $ac_compile; echo $2` ac_status=$? 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. +# input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 @@ -2114,11 +2395,21 @@ else _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2127,17 +2418,17 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext -G77=`test $ac_compiler_gnu = yes && echo yes` ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= @@ -2154,11 +2445,21 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2167,10 +2468,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_f77_g=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 @@ -2178,18 +2480,20 @@ echo "${ECHO_T}$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 "$G77" = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else - if test "$G77" = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi + +G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2199,7 +2503,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$OLD_CFLAGS" -CPPFLAGS="-I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" +CPPFLAGS="-Iportaudio/pa_common -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" echo "$as_me:$LINENO: checking uname -s for Cygwin, Solaris or HPUX" >&5 @@ -2259,8 +2563,11 @@ else ac_func_search_save_LIBS=$LIBS ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -2269,12 +2576,6 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2285,11 +2586,21 @@ strerror (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2298,15 +2609,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_search_strerror="none required" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_strerror" = no; then for ac_lib in cposix; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -2315,12 +2631,6 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2331,11 +2641,21 @@ strerror (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2345,9 +2665,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS @@ -2359,103 +2681,6 @@ if test "$ac_cv_search_strerror" != no; then fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include -#include -#include -#include -/* 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; -} -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; -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then @@ -2464,21 +2689,35 @@ else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifndef __cplusplus -static $ac_kw int static_foo () {return 0; } -$ac_kw int foo () {return 0; } +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2487,25 +2726,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 + + case $ac_cv_c_inline in inline | yes) ;; - no) -cat >>confdefs.h <<\_ACEOF -#define inline + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif _ACEOF - ;; - *) cat >>confdefs.h <<_ACEOF -#define inline $ac_cv_c_inline -_ACEOF - ;; + ;; esac ac_ext=c @@ -2531,24 +2775,34 @@ 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 to if __STDC__ is defined, since + # 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 -#line $LINENO "configure" -#include "confdefs.h" -#include - Syntax error +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2559,7 +2813,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -2568,20 +2823,24 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2593,7 +2852,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -2622,24 +2882,34 @@ 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 to if __STDC__ is defined, since + # 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 -#line $LINENO "configure" -#include "confdefs.h" -#include - Syntax error +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2650,7 +2920,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -2659,20 +2930,24 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2684,7 +2959,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -2697,8 +2973,10 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -2709,6 +2987,21 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 @@ -2717,13 +3010,16 @@ if test "${ac_cv_prog_gcc_traditional+set}" = set; then else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no @@ -2733,13 +3029,16 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* @@ -2753,15 +3052,15 @@ echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 fi fi -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' + @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` @@ -2818,6 +3117,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 @@ -2834,6 +3134,7 @@ do 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. @@ -2841,20 +3142,20 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$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 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if $as_executable_p "$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 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; @@ -3415,49 +3716,68 @@ if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include #include +int +main () +{ + + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f 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 -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3469,13 +3789,16 @@ 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 -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3490,16 +3813,20 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #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 ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -3510,7 +3837,7 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) + || toupper (i) != TOUPPER (i)) exit(2); exit (0); } @@ -3530,11 +3857,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3560,7 +3888,7 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -3569,19 +3897,32 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3590,10 +3931,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -3643,18 +3985,31 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3663,10 +4018,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3674,20 +4030,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3698,7 +4058,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3706,26 +4067,43 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -3747,18 +4125,15 @@ if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -3770,11 +4145,21 @@ return 0; _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3783,10 +4168,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_time=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 @@ -3812,18 +4198,31 @@ else echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5 echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3832,10 +4231,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3843,20 +4243,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5 echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3867,7 +4271,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3875,19 +4280,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/soundcard.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 @@ -3920,18 +4342,31 @@ else echo "$as_me:$LINENO: checking alsa/asoundlib.h usability" >&5 echo $ECHO_N "checking alsa/asoundlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3940,10 +4375,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3951,20 +4387,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking alsa/asoundlib.h presence" >&5 echo $ECHO_N "checking alsa/asoundlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3975,7 +4415,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3983,19 +4424,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: alsa/asoundlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: alsa/asoundlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5 echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6 @@ -4028,18 +4486,31 @@ else echo "$as_me:$LINENO: checking jack/jack.h usability" >&5 echo $ECHO_N "checking jack/jack.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4048,10 +4519,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4059,20 +4531,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking jack/jack.h presence" >&5 echo $ECHO_N "checking jack/jack.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4083,7 +4559,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4091,19 +4568,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: jack/jack.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: jack/jack.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: jack/jack.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: jack/jack.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: jack/jack.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: jack/jack.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: jack/jack.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: jack/jack.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: jack/jack.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: jack/jack.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: jack/jack.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: jack/jack.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for jack/jack.h" >&5 echo $ECHO_N "checking for jack/jack.h... $ECHO_C" >&6 @@ -4123,114 +4617,13 @@ else fi -if test "${ac_cv_header_portaudio_h+set}" = set; then - echo "$as_me:$LINENO: checking for portaudio.h" >&5 -echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 -if test "${ac_cv_header_portaudio_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_portaudio_h" >&5 -echo "${ECHO_T}$ac_cv_header_portaudio_h" >&6 +if test -e "./portaudio/pa_common/portaudio.h" ; then + echo "Checking for portaudio...yes" + HAS_PORTAUDIO_H=1 else - # Is the header compilable? -echo "$as_me:$LINENO: checking portaudio.h usability" >&5 -echo $ECHO_N "checking portaudio.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no + echo "Checking for portaudio...no" + HAS_SAMPLERATE_H=0 fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking portaudio.h presence" >&5 -echo $ECHO_N "checking portaudio.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: portaudio.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: portaudio.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: portaudio.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;};; -esac -echo "$as_me:$LINENO: checking for portaudio.h" >&5 -echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 -if test "${ac_cv_header_portaudio_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_portaudio_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_portaudio_h" >&5 -echo "${ECHO_T}$ac_cv_header_portaudio_h" >&6 - -fi -if test $ac_cv_header_portaudio_h = yes; then - HAS_PORTAUDIO_H=1 -else - HAS_PORTAUDIO_H=0 -fi - - if test "${ac_cv_header_samplerate_h+set}" = set; then echo "$as_me:$LINENO: checking for samplerate.h" >&5 echo $ECHO_N "checking for samplerate.h... $ECHO_C" >&6 @@ -4244,18 +4637,31 @@ else echo "$as_me:$LINENO: checking samplerate.h usability" >&5 echo $ECHO_N "checking samplerate.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4264,10 +4670,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4275,20 +4682,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking samplerate.h presence" >&5 echo $ECHO_N "checking samplerate.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4299,7 +4710,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4307,19 +4719,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: samplerate.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: samplerate.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: samplerate.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: samplerate.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: samplerate.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: samplerate.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: samplerate.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: samplerate.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: samplerate.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: samplerate.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: samplerate.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: samplerate.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: samplerate.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: samplerate.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for samplerate.h" >&5 echo $ECHO_N "checking for samplerate.h... $ECHO_C" >&6 @@ -4352,11 +4781,21 @@ else _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4365,10 +4804,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 gcc_cv_header_string=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gcc_cv_header_string=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 @@ -4388,15 +4828,12 @@ if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4410,11 +4847,21 @@ if (sizeof (int64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4423,10 +4870,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_int64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_int64_t" >&6 @@ -4444,15 +4892,12 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4465,11 +4910,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4478,15 +4933,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4499,11 +4951,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4512,29 +4974,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4547,11 +5008,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4560,15 +5031,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4581,11 +5049,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4594,37 +5072,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4637,11 +5114,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4650,37 +5137,39 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int64_t=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77" >&5 -echo "$as_me: error: cannot compute sizeof (int64_t), 77" >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 -echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (int64_t)); } unsigned long ulongval () { return (long) (sizeof (int64_t)); } #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4723,13 +5212,16 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77" >&5 -echo "$as_me: error: cannot compute sizeof (int64_t), 77" >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -4750,15 +5242,12 @@ if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4772,11 +5261,21 @@ if (sizeof (long long)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4785,10 +5284,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_long_long=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6 @@ -4806,15 +5306,12 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4827,11 +5324,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4840,15 +5347,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4861,11 +5365,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4874,29 +5388,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4909,11 +5422,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4922,15 +5445,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4943,11 +5463,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4956,37 +5486,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4999,11 +5528,21 @@ test_array [0] = 0 _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5012,37 +5551,39 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77" >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77" >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 -echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long long)); } unsigned long ulongval () { return (long) (sizeof (long long)); } #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5085,13 +5626,16 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77" >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77" >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -5114,15 +5658,12 @@ if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5136,11 +5677,21 @@ if (sizeof (uint64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5149,10 +5700,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_uint64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 @@ -5163,15 +5715,12 @@ if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5185,11 +5734,21 @@ if (sizeof (int64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5198,10 +5757,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_int64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_int64_t" >&6 @@ -5213,15 +5773,12 @@ if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5235,11 +5792,21 @@ if (sizeof (uint64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5248,10 +5815,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_uint64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 @@ -5271,15 +5839,12 @@ if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5293,11 +5858,21 @@ if (sizeof (int64_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5306,10 +5881,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_int64_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_int64_t" >&6 @@ -5331,15 +5907,12 @@ if test "${ac_cv_type_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5353,11 +5926,21 @@ if (sizeof (u_int32_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5366,10 +5949,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_u_int32_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_u_int32_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 @@ -5383,15 +5967,12 @@ if test "${ac_cv_type_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5405,11 +5986,21 @@ if (sizeof (uint32_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5418,10 +6009,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint32_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_uint32_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 @@ -5455,15 +6047,12 @@ if test "${ac_cv_type_u_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5477,11 +6066,21 @@ if (sizeof (u_int16_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5490,10 +6089,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_u_int16_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_u_int16_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 @@ -5507,15 +6107,12 @@ if test "${ac_cv_type_uint16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5529,11 +6126,21 @@ if (sizeof (uint16_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5542,10 +6149,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_uint16_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_uint16_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 @@ -5580,17 +6188,14 @@ if test "${ac_cv_c_bigendian+set}" = set; then else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5604,11 +6209,21 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5616,17 +6231,14 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5640,11 +6252,21 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5653,32 +6275,31 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_bigendian=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # It does not; compile a test program. if test "$cross_compiling" = yes; then - # try to guess the endianess by grep'ing values into an object file + # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5689,20 +6310,30 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - if fgrep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi -if fgrep LiTTleEnDian conftest.$ac_objext >/dev/null ; then +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -5712,13 +6343,17 @@ if fgrep LiTTleEnDian conftest.$ac_objext >/dev/null ; then fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int main () { @@ -5747,14 +6382,15 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 @@ -5768,9 +6404,9 @@ _ACEOF no) ;; *) - { { echo "$as_me:$LINENO: error: unknown endianess + { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianess +echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -5789,18 +6425,31 @@ else echo "$as_me:$LINENO: checking stdarg.h usability" >&5 echo $ECHO_N "checking stdarg.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5809,10 +6458,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -5820,20 +6470,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking stdarg.h presence" >&5 echo $ECHO_N "checking stdarg.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -5844,7 +6498,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -5852,19 +6507,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdarg.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdarg.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdarg.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdarg.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stdarg.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stdarg.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdarg.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdarg.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdarg.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdarg.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: stdarg.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdarg.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdarg.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the wsjt lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for stdarg.h" >&5 echo $ECHO_N "checking for stdarg.h... $ECHO_C" >&6 @@ -5937,7 +6609,7 @@ _ACEOF fi -ac_config_files="$ac_config_files Makefile" + ac_config_files="$ac_config_files Makefile" @@ -6116,7 +6788,11 @@ _ACEOF AUDIO="a2d.f90 jtaudio.c start_portaudio.c" - LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" + if test ! -e "portaudio/lib/libportaudio.a" ; then + echo "Building portaudio" + (cd portaudio; ./configure --with-jack=no;make) + fi + LDFLAGS="./portaudio/lib/libportaudio.a ${LDFLAGS} -lsamplerate" fi if test "$jack" = yes; then @@ -6226,7 +6902,7 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overriden when +# `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. @@ -6244,13 +6920,13 @@ _ACEOF # `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" + "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 \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -6261,7 +6937,7 @@ _ACEOF t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if cmp -s $cache_file confcache; then :; else +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file @@ -6280,13 +6956,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # 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[ ]*=/{ + ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; +s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; -s/^[^=]*=[ ]*$//; +s/^[^=]*=[ ]*$//; }' fi @@ -6300,13 +6976,13 @@ fi cat >confdef2opt.sed <<\_ACEOF t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g @@ -6323,6 +6999,21 @@ DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed +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_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -6337,11 +7028,12 @@ cat >$CONFIG_STATUS <<_ACEOF # 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 - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -6350,46 +7042,57 @@ cat >>$CONFIG_STATUS <<\_ACEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# NLS nuisances. # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -6400,6 +7103,7 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -6410,15 +7114,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -6467,6 +7171,8 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -6540,13 +7246,20 @@ else fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -6556,7 +7269,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$as_unset CDPATH exec 6>&1 @@ -6573,7 +7286,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by wsjt $as_me 5.9.2, which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6613,10 +7326,11 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files @@ -6627,11 +7341,10 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ wsjt config.status 5.9.2 -configured by $0, generated by GNU Autoconf 2.53, +configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir @@ -6648,25 +7361,25 @@ do --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift ;; - -*);; *) # This is not an option, so the user has probably given explicit # arguments. + ac_option=$1 ac_need_defaults=false;; esac - case $1 in + case $ac_option in # Handling of the options. _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" - exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; -_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) @@ -6681,13 +7394,16 @@ Try \`$0 --help' for more information." >&2;} --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 @@ -6702,6 +7418,20 @@ Try \`$0 --help' for more information." >&2;} 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 +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + _ACEOF @@ -6728,6 +7458,9 @@ if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { @@ -6736,17 +7469,17 @@ $debug || } # Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} + { - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=$TMPDIR/cs$$-$RANDOM + tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } @@ -6805,6 +7538,7 @@ s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t @@ -6826,6 +7560,8 @@ s,@CLOBBER@,$CLOBBER,;t t s,@FC_LIB_PATH@,$FC_LIB_PATH,;t t s,@FC@,$FC,;t t s,@AUDIO@,$AUDIO,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF @@ -6855,9 +7591,9 @@ _ACEOF (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end @@ -6875,46 +7611,51 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. @@ -6941,12 +7682,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac case $INSTALL in @@ -6968,7 +7742,7 @@ echo "$as_me: creating $ac_file" >&6;} configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. @@ -6977,24 +7751,24 @@ echo "$as_me: creating $ac_file" >&6;} case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo $f;; + echo "$f";; *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } _ACEOF @@ -7045,8 +7819,11 @@ ac_clean_files=$ac_clean_files_save # 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_cs_success=false + $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. diff --git a/configure.ac b/configure.ac index 5d8653968..bb04d49a2 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ dnl Make sure autoconf doesn't interfere with cflags -jmallett CFLAGS="$OLD_CFLAGS" dnl Lets guess at some likely places for extra libs/includes XXX -db -CPPFLAGS="-I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" +CPPFLAGS="-Iportaudio/pa_common -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX]) @@ -111,7 +111,13 @@ AC_HEADER_TIME AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) AC_CHECK_HEADER([alsa/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) AC_CHECK_HEADER([jack/jack.h], [HAS_JACK_H=1], [HAS_JACK_H=0]) -AC_CHECK_HEADER([portaudio.h], [HAS_PORTAUDIO_H=1], [HAS_PORTAUDIO_H=0]) +if test -e "./portaudio/pa_common/portaudio.h" ; then + echo "Checking for portaudio...yes" + HAS_PORTAUDIO_H=1 +else + echo "Checking for portaudio...no" + HAS_SAMPLERATE_H=0 +fi AC_CHECK_HEADER([samplerate.h], [HAS_SAMPLERATE_H=1], [HAS_SAMPLERATE_H=0]) dnl See whether we can include both string.h and strings.h. @@ -331,7 +337,11 @@ fi if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c") - LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate" + if test ! -e "portaudio/lib/libportaudio.a" ; then + echo "Building portaudio" + (cd portaudio; ./configure --with-jack=no;make) + fi + LDFLAGS="./portaudio/lib/libportaudio.a ${LDFLAGS} -lsamplerate" fi if test "$jack" = yes; then From a0a3b799dc544ca03b9e57dd945c1dd52f44a618 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 5 Jul 2006 03:49:02 +0000 Subject: [PATCH 126/811] - This imports the freebsd branch modifications - This gets rid of the need to configure for parallel or serial port - The code picks up the device name from WSJT.INI for ComPort (misnamed now) which is actually a device name for either a serial port or parallel port. ptt_unix.c then uses the appropriate code to "talk" to a parallel or serial port. - audio in/audio out should work the same way on windows as it did before, however it is actually now a string name value, which can be used to open the appropriate /dev/dsp on OSS or in future, be passed to the ALSA init routines or other audio routines as needed. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@185 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 53 +---------- configure.ac | 31 ------- fivehz.F90 | 6 +- ftn_init.F90 | 3 +- gcom1.f90 | 3 +- gcom2.f90 | 3 +- options.py | 11 ++- ptt.c | 2 +- ptt_unix.c | 253 ++++++++++++++++++++++++++------------------------- specjt.py | 18 +++- wsjt.py | 13 ++- 11 files changed, 174 insertions(+), 222 deletions(-) diff --git a/configure b/configure index abffeab7b..d3e66595d 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 175 2006-04-17 20:43:21Z va3db $ +# $Id: configure.ac 184 2006-07-05 03:03:11Z va3db $ # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -858,8 +858,6 @@ Optional Features: --enable-oss Force OSS SOUND usage. --enable-portaudio Force PORTAUDIO SOUND usage. --enable-jack Force JACK usage. - --enable-parallel Force PARALLEL port usage for ptt. - --enable-serial Force SERIAL port usage for ptt. --enable-g95 Use G95 compiler if available. --enable-gfortran Use gfortran compiler if available. @@ -979,7 +977,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 175 2006-04-17 20:43:21Z va3db $ +$Id: configure.ac 184 2006-07-05 03:03:11Z va3db $ _ACEOF exit 0 fi @@ -2356,7 +2354,7 @@ fi # Provide some information about the compiler. -echo "$as_me:2359:" \ +echo "$as_me:2357:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6649,23 +6647,6 @@ else fi; -# Check whether --enable-parallel or --disable-parallel was given. -if test "${enable_parallel+set}" = set; then - enableval="$enable_parallel" - parallel=$enableval -else - parallel=no -fi; - -# Check whether --enable-serial or --disable-serial was given. -if test "${enable_serial+set}" = set; then - enableval="$enable_serial" - serial=$enableval -else - serial=no -fi; - - # Check whether --enable-g95 or --disable-g95 was given. if test "${enable_g95+set}" = set; then enableval="$enable_g95" @@ -6728,26 +6709,6 @@ FC="${FC}" -if test "$serial" != yes -a "$parallel" != yes; then - serial=yes; -fi - -if test "$serial" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_SERIAL 1 -_ACEOF - -fi - -if test "$parallel" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_PARALLEL 1 -_ACEOF - -fi - if test "$alsa" != yes -a "$oss" != yes -a \ "$portaudio" != yes -a "$jack" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then @@ -7859,14 +7820,6 @@ if test $jack == "yes"; then echo "Using jack."; fi -if test $serial == "yes"; then - echo "Using serial port for ptt."; -fi - -if test $parallel == "yes"; then - echo "Using parallel port for ptt."; -fi - echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/configure.ac b/configure.ac index bb04d49a2..24f7e5a79 100644 --- a/configure.ac +++ b/configure.ac @@ -240,17 +240,6 @@ AC_ARG_ENABLE(jack, AC_HELP_STRING([--enable-jack],[Force JACK usage.]), [jack=$enableval] , [jack=no]) -dnl serial or parallel support (temporary until python changes) -dnl =========================================================== - -AC_ARG_ENABLE(parallel, -AC_HELP_STRING([--enable-parallel],[Force PARALLEL port usage for ptt.]), -[parallel=$enableval], [parallel=no]) - -AC_ARG_ENABLE(serial, -AC_HELP_STRING([--enable-serial],[Force SERIAL port usage for ptt.]), -[serial=$enableval], [serial=no]) - dnl pick gfortran or g95 dnl ==================== @@ -300,18 +289,6 @@ AC_SUBST(FC, "${FC}") dnl set defaults dnl ============ -if test "$serial" != yes -a "$parallel" != yes; then - [serial=yes]; -fi - -if test "$serial" = yes; then - AC_DEFINE(USE_SERIAL, 1, [Define if you want Serial port used.]) -fi - -if test "$parallel" = yes; then - AC_DEFINE(USE_PARALLEL, 1, [Define if you want Serial port used.]) -fi - if test "$alsa" != yes -a "$oss" != yes -a \ "$portaudio" != yes -a "$jack" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then @@ -444,14 +421,6 @@ if test $jack == "yes"; then echo "Using jack."; fi -if test $serial == "yes"; then - echo "Using serial port for ptt."; -fi - -if test $parallel == "yes"; then - echo "Using parallel port for ptt."; -fi - echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/fivehz.F90 b/fivehz.F90 index 06834f88a..2e25971ed 100644 --- a/fivehz.F90 +++ b/fivehz.F90 @@ -104,11 +104,11 @@ subroutine fivehz ! Switch PTT line and TxOK appropriately if(lauto.eq.1) then if(txtime .and. iptt.eq.0 .and. & - mute.eq.0) i1=ptt(nport,1,iptt) !Raise PTT + mute.eq.0) i1=ptt(nport,pttport,1,iptt) !Raise PTT if(.not.txtime .or. mute.eq.1) TxOK=0 !Lower TxOK else if(mantx.eq.1 .and. iptt.eq.0 .and. & - mute.eq.0) i2=ptt(nport,1,iptt) !Raise PTT + mute.eq.0) i2=ptt(nport,1,pttport,iptt) !Raise PTT if(mantx.eq.0 .or. mute.eq.1) TxOK=0 !Lower TxOK endif @@ -130,7 +130,7 @@ subroutine fivehz if(nc0a.lt.5) nc0a=5 if(TxOK.eq.0 .and. TxOKz.eq.1 .and. iptt.eq.1) nc0=-nc0a-1 if(nc0.le.0) nc0=nc0+1 - if(nc0.eq.0) i3=ptt(nport,0,iptt) + if(nc0.eq.0) i3=ptt(nport,pttport,0,iptt) if(iptt.eq.0 .and.TxOK.eq.0) then sending=" " diff --git a/ftn_init.F90 b/ftn_init.F90 index 61b7948d0..64ae7cf3a 100644 --- a/ftn_init.F90 +++ b/ftn_init.F90 @@ -24,7 +24,8 @@ subroutine ftn_init include 'gcom3.f90' include 'gcom4.f90' - i=ptt(nport,0,iptt) !Clear the PTT line +! print*,'ftn_init.F90 nport=', nport, 'pttport=', pttport + i=ptt(nport,pttport,0,iptt) !Clear the PTT line addpfx=' ' do i=80,1,-1 diff --git a/gcom1.f90 b/gcom1.f90 index abbb013f4..192e7658c 100644 --- a/gcom1.f90 +++ b/gcom1.f90 @@ -40,12 +40,13 @@ integer nx !x coordinate for waterfall pixmap GUI integer mfsample !Measured sample rate, input SoundIn integer mfsample2 !Measured sample rate, output SoundOut integer ns0 !Time at last ALL.TXT date entry Decoder +character*12 devin_name,devout_name ! GUI common/gcom1/Tbuf(1024),ntrbuf(1024),Tsec,rxdelay,txdelay, & samfacin,samfacout,txsnrdb,y1(NRXMAX),y2(NRXMAX), & nmax,iwrite,iread,iwave(NTXMAX),nwave,TxOK,Receiving,Transmitting, & TxFirst,TRPeriod,ibuf,ibuf0,ave,rms,ngo,level,mute,newdat,ndsec, & - ndevin,ndevout,nx,mfsample,mfsample2,ns0 + ndevin,ndevout,nx,mfsample,mfsample2,ns0,devin_name,devout_name !### volatile /gcom1/ diff --git a/gcom2.f90 b/gcom2.f90 index 109858b64..bb91f4c53 100644 --- a/gcom2.f90 +++ b/gcom2.f90 @@ -79,6 +79,7 @@ character*24 decodedfile character*80 AppDir !WSJT installation directory GUI character*80 filetokilla !Filenames (full path) Decoder character*80 filetokillb +character*12 pttport common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & green(500),ngreen,dgain,iter,ndecoding,ndecoding0,mousebutton, & @@ -90,6 +91,6 @@ common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & idinterval,msmax,lenappdir,ndiskdat,nlines,nflat,ntxreq,ntxnow, & ndepth,nspecial,ndf,ss1(-224:224),ss2(-224:224), & mycall,hiscall,hisgrid,txmsg,sending,mode,fname0,fnamea, & - fnameb,decodedfile,AppDir,filetokilla,filetokillb,utcdate + fnameb,decodedfile,AppDir,filetokilla,filetokillb,utcdate,pttport !### volatile /gcom2/ diff --git a/options.py b/options.py index df7b361d6..7d68e6627 100644 --- a/options.py +++ b/options.py @@ -25,8 +25,11 @@ MyGrid=StringVar() #TxDelay=StringVar() IDinterval=IntVar() ComPort=IntVar() +PttPort=StringVar() ndevin=IntVar() ndevout=IntVar() +DevinName=StringVar() +DevoutName=StringVar() samfacin=DoubleVar() samfacout=DoubleVar() Template1=StringVar() @@ -106,12 +109,12 @@ mygrid=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Grid Locator:', ## value='0.2',entry_textvariable=TxDelay) idinterval=Pmw.EntryField(g1.interior(),labelpos=W,label_text='ID Interval (m):', value=10,entry_textvariable=IDinterval,entry_width=12) -comport=Pmw.EntryField(g1.interior(),labelpos=W,label_text='COM Port:', - value=1,entry_textvariable=ComPort,entry_width=12) +comport=Pmw.EntryField(g1.interior(),labelpos=W,label_text='PTT Port:', + value='/dev/cuad0',entry_textvariable=PttPort,entry_width=12) audioin=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio In:', - value=0,entry_textvariable=ndevin,entry_width=12) + value='0',entry_textvariable=DevinName,entry_width=12) audioout=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Audio Out:', - value=0,entry_textvariable=ndevout,entry_width=12) + value='0',entry_textvariable=DevoutName,entry_width=12) ratein=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Rate In:', value=1.0000,entry_textvariable=samfacin,entry_width=12) rateout=Pmw.EntryField(g1.interior(),labelpos=W,label_text='Rate Out:', diff --git a/ptt.c b/ptt.c index 9b31d1b5f..494062d0a 100644 --- a/ptt.c +++ b/ptt.c @@ -1,7 +1,7 @@ #include #include -int ptt_(int *nport, int *ntx, int *iptt) +int ptt_(int *nport, char *unused, int *ntx, int *iptt) { static HANDLE hFile; static int open=0; diff --git a/ptt_unix.c b/ptt_unix.c index f34963eea..afcb99130 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -43,80 +43,6 @@ # include #endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#if (defined(__unix__) || defined(unix)) && !defined(USG) -# include -#endif - -int fd; /* Used for both serial and parallel */ - -#ifdef USE_SERIAL - -/* First cut, note that this only distinguishes Linux from BSDs, - * it will be done better later on using configure. N.B. that OSX - * will come up as BSD but I think this is also the right serial port - * for OSX. -db - */ -#if defined(BSD) -#define TTYNAME "/dev/cuad%d" /* Use non blocking form */ -#else -#include -#define TTYNAME "/dev/ttyUSB%d" -#endif - -/* Not quite right for size but '%d + 1' should be plenty enough -db */ -/* As TTYNAME is a string, just at 20 chars do udevd is happier. */ -/* E.g. USB serial ports appear as /dev/ttyUSB0 */ -#define TTYNAME_SIZE sizeof(TTYNAME)+20 - -int -ptt_(int *nport, int *ntx, int *iptt) -{ - /* Fixme, nport should be a sting and not a number */ - static int nopen=0; - int control = TIOCM_RTS | TIOCM_DTR; - - char s[TTYNAME_SIZE]; - - if(*nport < 0) { - *iptt=*ntx; - return(0); - } - - if(*ntx && (!nopen)) { - snprintf(s, TTYNAME_SIZE, TTYNAME, (*nport) - 1); /* Comport 1 == dev 0 */ - s[TTYNAME_SIZE] = '\0'; - - /* open the device */ - printf("Opening %s\n", s); - if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { - fprintf(stderr, "Can't open %s.\n", s); - return(1); - } - - nopen=1; - return(0); - } - - if(*ntx && nopen) { - ioctl(fd, TIOCMBIS, &control); // Set DTR and RTS - *iptt=1; - } - - else { - ioctl(fd, TIOCMBIC, &control); - close(fd); - *iptt=0; - nopen=0; - } - return(0); -} -#endif - -#ifdef USE_PARALLEL - #ifdef HAVE_LINUX_PPDEV_H # include # include @@ -124,6 +50,10 @@ ptt_(int *nport, int *ntx, int *iptt) #ifdef HAVE_DEV_PPBUS_PPI_H # include # include + +int lp_reset (int fd); +int lp_ptt (int fd, int onoff); + #endif #ifdef HAVE_SYS_STAT_H # include @@ -132,6 +62,108 @@ ptt_(int *nport, int *ntx, int *iptt) # include #endif +#ifndef BSD /* #ifdef LINUX ? */ +#include +#endif +#include +/* parport functions */ + +int dev_is_parport(const char *fname); +int ptt_parallel(int fd, int *ntx, int *iptt); +int ptt_serial(int fd, int *ntx, int *iptt); + +int fd=-1; /* Used for both serial and parallel */ + + +char nm[MAXPATHLEN]; + +/* + * ptt_ + * + * generic unix PTT routine called from Fortran + * + * unused - Unused, to satisfy old windows calling convention + * ptt_port - device name serial or parallel + * ntx - pointer to fortran command on or off + * iptt - pointer to fortran command status on or off + */ + +/* Tiny state machine */ +#define STATE_PORT_CLOSED 0 +#define STATE_PORT_OPEN_PARALLEL 1 +#define STATE_PORT_OPEN_SERIAL 2 + +int +ptt_(int unused, char *ptt_port, int *ntx, int *iptt) +{ + static int state=0; + char *p; + + switch (state) { + case STATE_PORT_CLOSED: + if ((p = strchr(ptt_port, ' ')) != NULL) + *p = '\0'; + if (p == NULL || *p == '\0') { + *iptt = *ntx; + return(0); + } + + if ((fd = dev_is_parport(ptt_port)) > 0) { + state = STATE_PORT_OPEN_PARALLEL; + lp_reset(fd); + } else { + if ((fd = open(nm, O_RDWR | O_NDELAY)) < 0) { + fprintf(stderr, "Can't open %s.\n", nm); + return(1); + } + else + state = STATE_PORT_OPEN_SERIAL; + } + break; + + case STATE_PORT_OPEN_PARALLEL: + ptt_parallel(fd, ntx, iptt); + break; + + case STATE_PORT_OPEN_SERIAL: + ptt_serial(fd, ntx, iptt); + break; + + default: + close(fd); + fd = -1; + state = STATE_PORT_CLOSED; + break; + } + return(0); +} + +/* + * ptt_serial + * + * generic serial unix PTT routine called indirectly from Fortran + * + * fd - already opened file descriptor + * ntx - pointer to fortran command on or off + * iptt - pointer to fortran command status on or off + */ + +int +ptt_serial(int fd, int *ntx, int *iptt) +{ + int control = TIOCM_RTS | TIOCM_DTR; + + if(*ntx) { + ioctl(fd, TIOCMBIS, &control); /* Set DTR and RTS */ + *iptt = 1; + } else { + ioctl(fd, TIOCMBIC, &control); + *iptt = 0; + } + return(0); +} + + /* parport functions */ int lp_reset (int fd); @@ -149,13 +181,11 @@ int lp_ptt (int fd, int onoff); int dev_is_parport(const char *fname) { - char nm[MAXPATHLEN]; struct stat st; - int fd, m; + int fd; + + snprintf(nm, sizeof(nm), "/dev/%s", fname); - m = snprintf(nm, sizeof(nm), "/dev/%s", fname); - if (m >= sizeof(nm)) - return (-1); if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) return (-1); if (fstat(fd, &st) == -1) @@ -175,14 +205,16 @@ out: int dev_is_parport(const char *fname) { - char nm[MAXPATHLEN]; struct stat st; unsigned char c; - int fd, m; + int fd; + char *p; + + if ((p = strchr(fname, '/')) != NULL) /* Look for /dev */ + snprintf(nm, sizeof(nm), "%s", fname); + else + snprintf(nm, sizeof(nm), "/dev/%s", fname); - m = snprintf(nm, sizeof(nm), "/dev/%s", fname); - if (m >= sizeof(nm)) - return (-1); if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) return (-1); if (fstat(fd, &st) == -1) @@ -275,7 +307,6 @@ lp_init (int fd) { fprintf(stderr, "Claiming parallel port %s", dev->desc); debug ("HINT: did you unload the lp kernel module?"); - debug ("HINT: perhaps there is another cwdaemon running?"); close (fd); exit (1); } @@ -341,47 +372,25 @@ lp_ptt (int fd, int onoff) return 0; } -/* XXX I am totally unsure of this, LPNAME should come from - * the WSJT.INI instead but for now this should work -- db +/* + * ptt_parallel + * + * generic parallel unix PTT routine called indirectly from Fortran + * + * fd - already opened file descriptor + * ntx - pointer to fortran command on or off + * iptt - pointer to fortran command status on or off */ -#ifdef BSD -#define LPNAME "lpt%d" -#else -#define LPNAME "lp%d" -#endif -#define LPNAME_SIZE (sizeof(LPNAME)) int -ptt_(int *nport, int *ntx, int *iptt) +ptt_parallel(int fd, int *ntx, int *iptt) { - static int nopen=0; - int fd; - char s[LPNAME_SIZE]; - - if(*nport < 0) { - *iptt=*ntx; - return(0); - } - - if(*ntx && (!nopen)) { - snprintf(s, LPNAME_SIZE, LPNAME, (*nport) - 1); /* Comport 1 == dev 0 */ - s[LPNAME_SIZE] = '\0'; - - if ((fd = dev_is_parport(s)) < 0) { - fprintf(stderr, "Can't use %s.", s); - return(1); - } - - if(*ntx && nopen) { - lp_ptt(fd, 1); - *iptt=1; - } else { - lp_ptt(fd, 0); - close(fd); - *iptt=0; - nopen=0; - } + if(*ntx) { + lp_ptt(fd, 1); + *iptt=1; + } else { + lp_ptt(fd, 0); + *iptt=0; } return(0); } -#endif diff --git a/specjt.py b/specjt.py index 013681974..b0c2cdaaf 100644 --- a/specjt.py +++ b/specjt.py @@ -489,11 +489,21 @@ if g.cmap == "AFMHot": #---------------------------------------------- Display GUI and start mainloop draw_axis() -Audio.gcom1.ndevin=g.ndevin.get() -Audio.gcom1.ndevout=g.ndevout.get() -ndevin=g.ndevin.get() -ndevout=g.ndevout.get() +try: + ndevin=g.ndevin.get() +except: + ndevin=0 +Audio.gcom1.ndevin=ndevin + +try: + ndevout=g.ndevout.get() +except: + ndevout=0 +Audio.gcom1.ndevout=ndevout + # Only valid for windows + # for now Audio.audio_init(ndevin,ndevout) #Start the audio stream + ltime.after(200,update) root.deiconify() diff --git a/wsjt.py b/wsjt.py index 2742b833d..115687522 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1513,6 +1513,10 @@ def update(): Audio.gcom2.nport=int(options.ComPort.get()) except: Audio.gcom2.nport=0 + +# print 'About to init Audio.gcom2.PttPort in save some parameters' + Audio.gcom2.pttport=(options.PttPort.get() + ' ')[:12] +# print Audio.gcom2.pttport # Queue up the next update ldate.after(100,update) @@ -2013,7 +2017,8 @@ try: elif key == 'ComPort': options.ComPort.set(value) Audio.gcom2.nport=int(options.ComPort.get()) - elif key == 'Mileskm': options.mileskm.set(value) + Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] + elif key == 'Mileskm': options.mileskm.set(value) elif key == 'MsgStyle': options.ireport.set(value) elif key == 'Region': options.iregion.set(value) elif key == 'AudioIn': @@ -2111,12 +2116,12 @@ f.write("HisGrid " + t + "\n") #f.write("RxDelay " + str(options.RxDelay.get()) + "\n") #f.write("TxDelay " + str(options.TxDelay.get()) + "\n") f.write("IDinterval " + str(options.IDinterval.get()) + "\n") -f.write("ComPort " + str(options.ComPort.get()) + "\n") +f.write("ComPort " + str(options.PttPort.get()) + "\n") f.write("Mileskm " + str(options.mileskm.get()) + "\n") f.write("MsgStyle " + str(options.ireport.get()) + "\n") f.write("Region " + str(options.iregion.get()) + "\n") -f.write("AudioIn " + str(options.ndevin.get()) + "\n") -f.write("AudioOut " + str(options.ndevout.get()) + "\n") +f.write("AudioIn " + str(options.DevinName.get()) + "\n") +f.write("AudioOut " + str(options.DevoutName.get()) + "\n") f.write("SamFacIn " + str(options.samfacin.get()) + "\n") f.write("SamFacOut " + str(options.samfacout.get()) + "\n") if options.Template6.get()=="": options.Template6.set("_") From c0a27fd3c20312a3384937a9d8cb6b0ecf7d80a8 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 5 Jul 2006 14:28:20 +0000 Subject: [PATCH 127/811] - Manual editing in diffs I missed a few - This should be all the final merges from the freebsd branch git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@186 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/wsjt.py b/wsjt.py index 115687522..7cb6f2e19 100644 --- a/wsjt.py +++ b/wsjt.py @@ -98,6 +98,8 @@ g.freeze_decode=0 g.mode="" g.ndevin=IntVar() g.ndevout=IntVar() +g.DevinName=StringVar() +g.DevoutName=StringVar() g.focus=0 #------------------------------------------------------ showspecjt def showspecjt(event=NONE): @@ -2015,18 +2017,32 @@ try: # elif key == 'TxDelay': options.TxDelay.set(value) elif key == 'IDinterval': options.IDinterval.set(value) elif key == 'ComPort': - options.ComPort.set(value) - Audio.gcom2.nport=int(options.ComPort.get()) - Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] - elif key == 'Mileskm': options.mileskm.set(value) + try: + options.ComPort.set(value) + Audio.gcom2.nport=options.ComPort.get() + except: + options.ComPort.set(0) + Audio.gcom2.nport=0 + Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] + elif key == 'Mileskm': options.mileskm.set(value) elif key == 'MsgStyle': options.ireport.set(value) elif key == 'Region': options.iregion.set(value) elif key == 'AudioIn': - g.ndevin.set(value) - options.ndevin.set(value) + try: + g.ndevin.set(value) + except: + g.ndevin.set(0) + g.DevinName.set(value) + options.DevinName.set(value) + Audio.gcom1.devin_name=(options.DevinName.get()+' ')[:12] elif key == 'AudioOut': - g.ndevout.set(value) - options.ndevout.set(value) + try: + g.ndevout.set(value) + except: + g.ndevout.set(0) + g.DevoutName.set(value) + options.DevoutName.set(value) + Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12] elif key == 'SamFacIn': options.samfacin.set(value) elif key == 'SamFacOut': options.samfacout.set(value) elif key == 'Template1': options.Template1.set(value.replace("_"," ")) @@ -2120,8 +2136,8 @@ f.write("ComPort " + str(options.PttPort.get()) + "\n") f.write("Mileskm " + str(options.mileskm.get()) + "\n") f.write("MsgStyle " + str(options.ireport.get()) + "\n") f.write("Region " + str(options.iregion.get()) + "\n") -f.write("AudioIn " + str(options.DevinName.get()) + "\n") -f.write("AudioOut " + str(options.DevoutName.get()) + "\n") +f.write("AudioIn " + options.DevinName.get() + "\n") +f.write("AudioOut " + options.DevoutName.get() + "\n") f.write("SamFacIn " + str(options.samfacin.get()) + "\n") f.write("SamFacOut " + str(options.samfacout.get()) + "\n") if options.Template6.get()=="": options.Template6.set("_") From 019ece987d111de6175c81fd9bd1abcf169506a8 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 5 Jul 2006 15:32:17 +0000 Subject: [PATCH 128/811] - move portaudio to portaudio-v19, note portaudio-v19 itself still has to be imported. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@187 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 14 +++++--------- configure.ac | 10 +++------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/configure b/configure index d3e66595d..f9c47fc8c 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 184 2006-07-05 03:03:11Z va3db $ +# $Id: configure.ac 185 2006-07-05 03:49:02Z va3db $ # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -977,7 +977,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 184 2006-07-05 03:03:11Z va3db $ +$Id: configure.ac 185 2006-07-05 03:49:02Z va3db $ _ACEOF exit 0 fi @@ -2501,7 +2501,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$OLD_CFLAGS" -CPPFLAGS="-Iportaudio/pa_common -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" +CPPFLAGS="-Iportaudio-v19/pa_common -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" echo "$as_me:$LINENO: checking uname -s for Cygwin, Solaris or HPUX" >&5 @@ -4615,7 +4615,7 @@ else fi -if test -e "./portaudio/pa_common/portaudio.h" ; then +if test -e "portaudio-v19/pa_common/portaudio.h" ; then echo "Checking for portaudio...yes" HAS_PORTAUDIO_H=1 else @@ -6749,11 +6749,7 @@ _ACEOF AUDIO="a2d.f90 jtaudio.c start_portaudio.c" - if test ! -e "portaudio/lib/libportaudio.a" ; then - echo "Building portaudio" - (cd portaudio; ./configure --with-jack=no;make) - fi - LDFLAGS="./portaudio/lib/libportaudio.a ${LDFLAGS} -lsamplerate" + LDFLAGS="-Lportaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" fi if test "$jack" = yes; then diff --git a/configure.ac b/configure.ac index 24f7e5a79..a83829d62 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ dnl Make sure autoconf doesn't interfere with cflags -jmallett CFLAGS="$OLD_CFLAGS" dnl Lets guess at some likely places for extra libs/includes XXX -db -CPPFLAGS="-Iportaudio/pa_common -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" +CPPFLAGS="-Iportaudio-v19/pa_common -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX]) @@ -111,7 +111,7 @@ AC_HEADER_TIME AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) AC_CHECK_HEADER([alsa/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) AC_CHECK_HEADER([jack/jack.h], [HAS_JACK_H=1], [HAS_JACK_H=0]) -if test -e "./portaudio/pa_common/portaudio.h" ; then +if test -e "portaudio-v19/pa_common/portaudio.h" ; then echo "Checking for portaudio...yes" HAS_PORTAUDIO_H=1 else @@ -314,11 +314,7 @@ fi if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c") - if test ! -e "portaudio/lib/libportaudio.a" ; then - echo "Building portaudio" - (cd portaudio; ./configure --with-jack=no;make) - fi - LDFLAGS="./portaudio/lib/libportaudio.a ${LDFLAGS} -lsamplerate" + LDFLAGS="-Lportaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" fi if test "$jack" = yes; then From 8d353a5b3b8d54a9bf3000da7588cf8ec1d50d80 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Thu, 6 Jul 2006 03:57:24 +0000 Subject: [PATCH 129/811] - Import of portaudio v19 git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@189 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- portaudio-v19/LICENSE.txt | 65 + portaudio-v19/Makefile | 186 + portaudio-v19/Makefile.bak | 186 + portaudio-v19/Makefile.in | 185 + portaudio-v19/README.txt | 81 + portaudio-v19/SConscript | 198 + portaudio-v19/SConstruct | 78 + portaudio-v19/V19-devel-readme.txt | 222 + portaudio-v19/aclocal.m4 | 57 + portaudio-v19/config.cache | 30 + portaudio-v19/config.doxy | 185 + portaudio-v19/config.guess | 1407 +++++++ portaudio-v19/config.log | 23 + portaudio-v19/config.status | 175 + portaudio-v19/config.sub | 1504 +++++++ portaudio-v19/configure | 1990 +++++++++ portaudio-v19/configure.in | 250 ++ portaudio-v19/docs/index.html | 60 + portaudio-v19/docs/latency.html | 192 + portaudio-v19/docs/pa_impl_guide.html | 197 + portaudio-v19/docs/pa_impl_startstop.html | 190 + portaudio-v19/docs/pa_tut_asio.html | 55 + portaudio-v19/docs/pa_tut_callback.html | 91 + portaudio-v19/docs/pa_tut_devs.html | 65 + portaudio-v19/docs/pa_tut_explore.html | 42 + portaudio-v19/docs/pa_tut_init.html | 43 + portaudio-v19/docs/pa_tut_mac.html | 41 + portaudio-v19/docs/pa_tut_mac_osx.html | 46 + portaudio-v19/docs/pa_tut_open.html | 52 + portaudio-v19/docs/pa_tut_oss.html | 46 + portaudio-v19/docs/pa_tut_over.html | 92 + portaudio-v19/docs/pa_tut_pc.html | 78 + portaudio-v19/docs/pa_tut_run.html | 56 + portaudio-v19/docs/pa_tut_rw.html | 79 + portaudio-v19/docs/pa_tut_term.html | 47 + portaudio-v19/docs/pa_tut_util.html | 55 + portaudio-v19/docs/pa_tutorial.html | 46 + portaudio-v19/docs/portaudio_h.txt | 425 ++ portaudio-v19/docs/portaudio_icmc2001.pdf | Bin 0 -> 50968 bytes portaudio-v19/docs/proposals.html | 36 + portaudio-v19/docs/releases.html | 339 ++ portaudio-v19/fixdir.bat | 19 + portaudio-v19/fixfile.bat | 7 + portaudio-v19/index.html | 89 + portaudio-v19/install-sh | 251 ++ portaudio-v19/pa_asio/ASIO-README.txt | 137 + .../pa_asio/Callback_adaptation_.pdf | Bin 0 -> 50527 bytes portaudio-v19/pa_asio/Pa_ASIO.pdf | Bin 0 -> 50778 bytes .../pa_asio/iasiothiscallresolver.cpp | 563 +++ portaudio-v19/pa_asio/iasiothiscallresolver.h | 197 + portaudio-v19/pa_asio/pa_asio.cpp | 2958 ++++++++++++++ portaudio-v19/pa_asio/pa_asio.h | 122 + portaudio-v19/pa_beos/PlaybackNode.cc | 538 +++ portaudio-v19/pa_beos/PlaybackNode.h | 108 + portaudio-v19/pa_beos/pa_beos_mk.cc | 441 ++ portaudio-v19/pa_common/pa_allocation.c | 234 ++ portaudio-v19/pa_common/pa_allocation.h | 95 + portaudio-v19/pa_common/pa_converters.c | 1926 +++++++++ portaudio-v19/pa_common/pa_converters.h | 254 ++ portaudio-v19/pa_common/pa_cpuload.c | 96 + portaudio-v19/pa_common/pa_cpuload.h | 63 + portaudio-v19/pa_common/pa_dither.c | 204 + portaudio-v19/pa_common/pa_dither.h | 91 + portaudio-v19/pa_common/pa_endianness.h | 111 + portaudio-v19/pa_common/pa_front.c | 1978 +++++++++ portaudio-v19/pa_common/pa_hostapi.h | 244 ++ portaudio-v19/pa_common/pa_process.c | 1763 ++++++++ portaudio-v19/pa_common/pa_process.h | 741 ++++ portaudio-v19/pa_common/pa_skeleton.c | 807 ++++ portaudio-v19/pa_common/pa_stream.c | 141 + portaudio-v19/pa_common/pa_stream.h | 196 + portaudio-v19/pa_common/pa_trace.c | 88 + portaudio-v19/pa_common/pa_trace.h | 70 + portaudio-v19/pa_common/pa_types.h | 65 + portaudio-v19/pa_common/pa_util.h | 167 + portaudio-v19/pa_common/portaudio.h | 1124 +++++ portaudio-v19/pa_dll_switch/PaDllEntry.h | 184 + .../pa_dll_switch/letter_from_tim_010817.txt | Bin 0 -> 1176 bytes portaudio-v19/pa_dll_switch/loadPA_DLL.cpp | 203 + portaudio-v19/pa_dll_switch/pa_lib.c | 827 ++++ portaudio-v19/pa_dll_switch/portaudio.h | 439 ++ portaudio-v19/pa_jack/pa_jack.c | 1714 ++++++++ portaudio-v19/pa_linux_alsa/pa_linux_alsa.c | 3590 ++++++++++++++++ portaudio-v19/pa_linux_alsa/pa_linux_alsa.h | 64 + portaudio-v19/pa_mac/pa_mac_hostapis.c | 79 + portaudio-v19/pa_mac_core/notes.txt | 124 + portaudio-v19/pa_mac_core/pa_mac_core.h | 64 + portaudio-v19/pa_mac_core/pa_mac_core_auhal.c | 1934 +++++++++ portaudio-v19/pa_mac_core/pa_mac_core_old.c | 907 +++++ .../pa_mac_core/pa_mac_core_utilities.c | 466 +++ portaudio-v19/pa_mac_sm/pa_mac_sm.c | 1656 ++++++++ portaudio-v19/pa_sgi/pa_sgi.c | 1417 +++++++ portaudio-v19/pa_tests/README.txt | 60 + portaudio-v19/pa_tests/debug_convert.c | 131 + portaudio-v19/pa_tests/debug_dither_calc.c | 55 + portaudio-v19/pa_tests/debug_dual.c | 183 + portaudio-v19/pa_tests/debug_multi_in.c | 179 + portaudio-v19/pa_tests/debug_multi_out.c | 144 + portaudio-v19/pa_tests/debug_record.c | 339 ++ portaudio-v19/pa_tests/debug_record_reuse.c | 351 ++ portaudio-v19/pa_tests/debug_sine.c | 192 + portaudio-v19/pa_tests/debug_sine_amp.c | 157 + portaudio-v19/pa_tests/debug_sine_formats.c | 202 + portaudio-v19/pa_tests/debug_srate.c | 265 ++ portaudio-v19/pa_tests/debug_test1.c | 114 + portaudio-v19/pa_tests/pa_devs.c | 230 ++ portaudio-v19/pa_tests/pa_fuzz.c | 168 + portaudio-v19/pa_tests/pa_minlat.c | 187 + portaudio-v19/pa_tests/paqa_devs.c | 347 ++ portaudio-v19/pa_tests/paqa_errs.c | 380 ++ portaudio-v19/pa_tests/patest1.c | 192 + portaudio-v19/pa_tests/patest_buffer.c | 180 + portaudio-v19/pa_tests/patest_callbackstop.c | 221 + portaudio-v19/pa_tests/patest_clip.c | 178 + portaudio-v19/pa_tests/patest_dither.c | 178 + portaudio-v19/pa_tests/patest_hang.c | 152 + portaudio-v19/pa_tests/patest_in_overflow.c | 224 + portaudio-v19/pa_tests/patest_latency.c | 182 + portaudio-v19/pa_tests/patest_leftright.c | 173 + portaudio-v19/pa_tests/patest_longsine.c | 140 + portaudio-v19/pa_tests/patest_many.c | 198 + portaudio-v19/pa_tests/patest_maxsines.c | 204 + portaudio-v19/pa_tests/patest_mono.c | 145 + .../patest_mono_asio_channel_select.c | 155 + portaudio-v19/pa_tests/patest_multi_sine.c | 194 + portaudio-v19/pa_tests/patest_out_underflow.c | 217 + portaudio-v19/pa_tests/patest_pink.c | 269 ++ portaudio-v19/pa_tests/patest_prime.c | 223 + portaudio-v19/pa_tests/patest_read_record.c | 229 ++ portaudio-v19/pa_tests/patest_record.c | 337 ++ portaudio-v19/pa_tests/patest_ringmix.c | 79 + portaudio-v19/pa_tests/patest_saw.c | 125 + portaudio-v19/pa_tests/patest_sine.c | 151 + portaudio-v19/pa_tests/patest_sine8.c | 212 + portaudio-v19/pa_tests/patest_sine_formats.c | 196 + portaudio-v19/pa_tests/patest_sine_time.c | 208 + portaudio-v19/pa_tests/patest_start_stop.c | 162 + portaudio-v19/pa_tests/patest_stop.c | 313 ++ portaudio-v19/pa_tests/patest_stop_playout.c | 432 ++ portaudio-v19/pa_tests/patest_sync.c | 259 ++ portaudio-v19/pa_tests/patest_toomanysines.c | 173 + portaudio-v19/pa_tests/patest_two_rates.c | 168 + portaudio-v19/pa_tests/patest_underflow.c | 151 + portaudio-v19/pa_tests/patest_wire.c | 284 ++ portaudio-v19/pa_tests/patest_write_sine.c | 147 + portaudio-v19/pa_unix/pa_unix_hostapis.c | 64 + portaudio-v19/pa_unix/pa_unix_util.c | 192 + portaudio-v19/pa_unix/pa_unix_util.h | 73 + portaudio-v19/pa_unix_oss/low_latency_tip.txt | Bin 0 -> 3111 bytes portaudio-v19/pa_unix_oss/pa_unix_oss.c | 1923 +++++++++ portaudio-v19/pa_unix_oss/pa_unix_oss.c.orig | 1922 +++++++++ portaudio-v19/pa_unix_oss/recplay.c | 114 + portaudio-v19/pa_win/dev-cpp/Makefile-dll | 78 + portaudio-v19/pa_win/dev-cpp/Makefile-static | 75 + .../pa_win/dev-cpp/portaudio-dll.dev | 209 + .../pa_win/dev-cpp/portaudio-static.dev | 209 + portaudio-v19/pa_win/dev-cpp/readme.txt | 23 + portaudio-v19/pa_win/msvc/Makefile.msvc | 159 + portaudio-v19/pa_win/msvc/clean.bat | 7 + portaudio-v19/pa_win/msvc/make.bat | 8 + portaudio-v19/pa_win/msvc/portaudio.def | 43 + portaudio-v19/pa_win/msvc/readme.txt | 56 + portaudio-v19/pa_win/msvc/setenv.bat | 1 + portaudio-v19/pa_win/pa_win_hostapis.c | 86 + portaudio-v19/pa_win/pa_win_util.c | 134 + .../pa_win/pa_x86_plain_converters.c | 1167 ++++++ .../pa_win/pa_x86_plain_converters.h | 19 + portaudio-v19/pa_win_ds/dsound_wrapper.c | 616 +++ portaudio-v19/pa_win_ds/dsound_wrapper.h | 130 + portaudio-v19/pa_win_ds/pa_win_ds.c | 1857 +++++++++ portaudio-v19/pa_win_wdmks/pa_win_wdmks.c | 3269 +++++++++++++++ portaudio-v19/pa_win_wdmks/readme.txt | 82 + portaudio-v19/pa_win_wmme/pa_win_wmme.c | 3623 +++++++++++++++++ portaudio-v19/pa_win_wmme/pa_win_wmme.h | 160 + portaudio-v19/pablio/README.txt | 39 + portaudio-v19/pablio/pablio.c | 307 ++ portaudio-v19/pablio/pablio.def | 35 + portaudio-v19/pablio/pablio.h | 109 + portaudio-v19/pablio/ringbuffer.c | 199 + portaudio-v19/pablio/ringbuffer.h | 101 + portaudio-v19/pablio/test_rw.c | 99 + portaudio-v19/pablio/test_rw_echo.c | 123 + portaudio-v19/pablio/test_w_saw.c | 108 + portaudio-v19/pablio/test_w_saw8.c | 106 + portaudio-v19/testcvs/changeme.txt | 8 + 185 files changed, 67019 insertions(+) create mode 100644 portaudio-v19/LICENSE.txt create mode 100644 portaudio-v19/Makefile create mode 100644 portaudio-v19/Makefile.bak create mode 100644 portaudio-v19/Makefile.in create mode 100644 portaudio-v19/README.txt create mode 100644 portaudio-v19/SConscript create mode 100644 portaudio-v19/SConstruct create mode 100644 portaudio-v19/V19-devel-readme.txt create mode 100644 portaudio-v19/aclocal.m4 create mode 100644 portaudio-v19/config.cache create mode 100644 portaudio-v19/config.doxy create mode 100755 portaudio-v19/config.guess create mode 100644 portaudio-v19/config.log create mode 100755 portaudio-v19/config.status create mode 100755 portaudio-v19/config.sub create mode 100755 portaudio-v19/configure create mode 100644 portaudio-v19/configure.in create mode 100644 portaudio-v19/docs/index.html create mode 100644 portaudio-v19/docs/latency.html create mode 100644 portaudio-v19/docs/pa_impl_guide.html create mode 100644 portaudio-v19/docs/pa_impl_startstop.html create mode 100644 portaudio-v19/docs/pa_tut_asio.html create mode 100644 portaudio-v19/docs/pa_tut_callback.html create mode 100644 portaudio-v19/docs/pa_tut_devs.html create mode 100644 portaudio-v19/docs/pa_tut_explore.html create mode 100644 portaudio-v19/docs/pa_tut_init.html create mode 100644 portaudio-v19/docs/pa_tut_mac.html create mode 100644 portaudio-v19/docs/pa_tut_mac_osx.html create mode 100644 portaudio-v19/docs/pa_tut_open.html create mode 100644 portaudio-v19/docs/pa_tut_oss.html create mode 100644 portaudio-v19/docs/pa_tut_over.html create mode 100644 portaudio-v19/docs/pa_tut_pc.html create mode 100644 portaudio-v19/docs/pa_tut_run.html create mode 100644 portaudio-v19/docs/pa_tut_rw.html create mode 100644 portaudio-v19/docs/pa_tut_term.html create mode 100644 portaudio-v19/docs/pa_tut_util.html create mode 100644 portaudio-v19/docs/pa_tutorial.html create mode 100644 portaudio-v19/docs/portaudio_h.txt create mode 100644 portaudio-v19/docs/portaudio_icmc2001.pdf create mode 100644 portaudio-v19/docs/proposals.html create mode 100644 portaudio-v19/docs/releases.html create mode 100755 portaudio-v19/fixdir.bat create mode 100755 portaudio-v19/fixfile.bat create mode 100644 portaudio-v19/index.html create mode 100755 portaudio-v19/install-sh create mode 100644 portaudio-v19/pa_asio/ASIO-README.txt create mode 100644 portaudio-v19/pa_asio/Callback_adaptation_.pdf create mode 100644 portaudio-v19/pa_asio/Pa_ASIO.pdf create mode 100644 portaudio-v19/pa_asio/iasiothiscallresolver.cpp create mode 100644 portaudio-v19/pa_asio/iasiothiscallresolver.h create mode 100644 portaudio-v19/pa_asio/pa_asio.cpp create mode 100644 portaudio-v19/pa_asio/pa_asio.h create mode 100644 portaudio-v19/pa_beos/PlaybackNode.cc create mode 100644 portaudio-v19/pa_beos/PlaybackNode.h create mode 100644 portaudio-v19/pa_beos/pa_beos_mk.cc create mode 100644 portaudio-v19/pa_common/pa_allocation.c create mode 100644 portaudio-v19/pa_common/pa_allocation.h create mode 100644 portaudio-v19/pa_common/pa_converters.c create mode 100644 portaudio-v19/pa_common/pa_converters.h create mode 100644 portaudio-v19/pa_common/pa_cpuload.c create mode 100644 portaudio-v19/pa_common/pa_cpuload.h create mode 100644 portaudio-v19/pa_common/pa_dither.c create mode 100644 portaudio-v19/pa_common/pa_dither.h create mode 100644 portaudio-v19/pa_common/pa_endianness.h create mode 100644 portaudio-v19/pa_common/pa_front.c create mode 100644 portaudio-v19/pa_common/pa_hostapi.h create mode 100644 portaudio-v19/pa_common/pa_process.c create mode 100644 portaudio-v19/pa_common/pa_process.h create mode 100644 portaudio-v19/pa_common/pa_skeleton.c create mode 100644 portaudio-v19/pa_common/pa_stream.c create mode 100644 portaudio-v19/pa_common/pa_stream.h create mode 100644 portaudio-v19/pa_common/pa_trace.c create mode 100644 portaudio-v19/pa_common/pa_trace.h create mode 100644 portaudio-v19/pa_common/pa_types.h create mode 100644 portaudio-v19/pa_common/pa_util.h create mode 100644 portaudio-v19/pa_common/portaudio.h create mode 100644 portaudio-v19/pa_dll_switch/PaDllEntry.h create mode 100644 portaudio-v19/pa_dll_switch/letter_from_tim_010817.txt create mode 100644 portaudio-v19/pa_dll_switch/loadPA_DLL.cpp create mode 100644 portaudio-v19/pa_dll_switch/pa_lib.c create mode 100644 portaudio-v19/pa_dll_switch/portaudio.h create mode 100644 portaudio-v19/pa_jack/pa_jack.c create mode 100644 portaudio-v19/pa_linux_alsa/pa_linux_alsa.c create mode 100644 portaudio-v19/pa_linux_alsa/pa_linux_alsa.h create mode 100644 portaudio-v19/pa_mac/pa_mac_hostapis.c create mode 100644 portaudio-v19/pa_mac_core/notes.txt create mode 100644 portaudio-v19/pa_mac_core/pa_mac_core.h create mode 100644 portaudio-v19/pa_mac_core/pa_mac_core_auhal.c create mode 100644 portaudio-v19/pa_mac_core/pa_mac_core_old.c create mode 100644 portaudio-v19/pa_mac_core/pa_mac_core_utilities.c create mode 100644 portaudio-v19/pa_mac_sm/pa_mac_sm.c create mode 100644 portaudio-v19/pa_sgi/pa_sgi.c create mode 100644 portaudio-v19/pa_tests/README.txt create mode 100644 portaudio-v19/pa_tests/debug_convert.c create mode 100644 portaudio-v19/pa_tests/debug_dither_calc.c create mode 100644 portaudio-v19/pa_tests/debug_dual.c create mode 100644 portaudio-v19/pa_tests/debug_multi_in.c create mode 100644 portaudio-v19/pa_tests/debug_multi_out.c create mode 100644 portaudio-v19/pa_tests/debug_record.c create mode 100644 portaudio-v19/pa_tests/debug_record_reuse.c create mode 100644 portaudio-v19/pa_tests/debug_sine.c create mode 100644 portaudio-v19/pa_tests/debug_sine_amp.c create mode 100644 portaudio-v19/pa_tests/debug_sine_formats.c create mode 100644 portaudio-v19/pa_tests/debug_srate.c create mode 100644 portaudio-v19/pa_tests/debug_test1.c create mode 100644 portaudio-v19/pa_tests/pa_devs.c create mode 100644 portaudio-v19/pa_tests/pa_fuzz.c create mode 100644 portaudio-v19/pa_tests/pa_minlat.c create mode 100644 portaudio-v19/pa_tests/paqa_devs.c create mode 100644 portaudio-v19/pa_tests/paqa_errs.c create mode 100644 portaudio-v19/pa_tests/patest1.c create mode 100644 portaudio-v19/pa_tests/patest_buffer.c create mode 100644 portaudio-v19/pa_tests/patest_callbackstop.c create mode 100644 portaudio-v19/pa_tests/patest_clip.c create mode 100644 portaudio-v19/pa_tests/patest_dither.c create mode 100644 portaudio-v19/pa_tests/patest_hang.c create mode 100644 portaudio-v19/pa_tests/patest_in_overflow.c create mode 100644 portaudio-v19/pa_tests/patest_latency.c create mode 100644 portaudio-v19/pa_tests/patest_leftright.c create mode 100644 portaudio-v19/pa_tests/patest_longsine.c create mode 100644 portaudio-v19/pa_tests/patest_many.c create mode 100644 portaudio-v19/pa_tests/patest_maxsines.c create mode 100644 portaudio-v19/pa_tests/patest_mono.c create mode 100644 portaudio-v19/pa_tests/patest_mono_asio_channel_select.c create mode 100644 portaudio-v19/pa_tests/patest_multi_sine.c create mode 100644 portaudio-v19/pa_tests/patest_out_underflow.c create mode 100644 portaudio-v19/pa_tests/patest_pink.c create mode 100644 portaudio-v19/pa_tests/patest_prime.c create mode 100644 portaudio-v19/pa_tests/patest_read_record.c create mode 100644 portaudio-v19/pa_tests/patest_record.c create mode 100644 portaudio-v19/pa_tests/patest_ringmix.c create mode 100644 portaudio-v19/pa_tests/patest_saw.c create mode 100644 portaudio-v19/pa_tests/patest_sine.c create mode 100644 portaudio-v19/pa_tests/patest_sine8.c create mode 100644 portaudio-v19/pa_tests/patest_sine_formats.c create mode 100644 portaudio-v19/pa_tests/patest_sine_time.c create mode 100644 portaudio-v19/pa_tests/patest_start_stop.c create mode 100644 portaudio-v19/pa_tests/patest_stop.c create mode 100644 portaudio-v19/pa_tests/patest_stop_playout.c create mode 100644 portaudio-v19/pa_tests/patest_sync.c create mode 100644 portaudio-v19/pa_tests/patest_toomanysines.c create mode 100644 portaudio-v19/pa_tests/patest_two_rates.c create mode 100644 portaudio-v19/pa_tests/patest_underflow.c create mode 100644 portaudio-v19/pa_tests/patest_wire.c create mode 100644 portaudio-v19/pa_tests/patest_write_sine.c create mode 100644 portaudio-v19/pa_unix/pa_unix_hostapis.c create mode 100644 portaudio-v19/pa_unix/pa_unix_util.c create mode 100644 portaudio-v19/pa_unix/pa_unix_util.h create mode 100644 portaudio-v19/pa_unix_oss/low_latency_tip.txt create mode 100644 portaudio-v19/pa_unix_oss/pa_unix_oss.c create mode 100644 portaudio-v19/pa_unix_oss/pa_unix_oss.c.orig create mode 100644 portaudio-v19/pa_unix_oss/recplay.c create mode 100644 portaudio-v19/pa_win/dev-cpp/Makefile-dll create mode 100644 portaudio-v19/pa_win/dev-cpp/Makefile-static create mode 100644 portaudio-v19/pa_win/dev-cpp/portaudio-dll.dev create mode 100644 portaudio-v19/pa_win/dev-cpp/portaudio-static.dev create mode 100644 portaudio-v19/pa_win/dev-cpp/readme.txt create mode 100644 portaudio-v19/pa_win/msvc/Makefile.msvc create mode 100755 portaudio-v19/pa_win/msvc/clean.bat create mode 100755 portaudio-v19/pa_win/msvc/make.bat create mode 100644 portaudio-v19/pa_win/msvc/portaudio.def create mode 100644 portaudio-v19/pa_win/msvc/readme.txt create mode 100755 portaudio-v19/pa_win/msvc/setenv.bat create mode 100644 portaudio-v19/pa_win/pa_win_hostapis.c create mode 100644 portaudio-v19/pa_win/pa_win_util.c create mode 100644 portaudio-v19/pa_win/pa_x86_plain_converters.c create mode 100644 portaudio-v19/pa_win/pa_x86_plain_converters.h create mode 100644 portaudio-v19/pa_win_ds/dsound_wrapper.c create mode 100644 portaudio-v19/pa_win_ds/dsound_wrapper.h create mode 100644 portaudio-v19/pa_win_ds/pa_win_ds.c create mode 100644 portaudio-v19/pa_win_wdmks/pa_win_wdmks.c create mode 100644 portaudio-v19/pa_win_wdmks/readme.txt create mode 100644 portaudio-v19/pa_win_wmme/pa_win_wmme.c create mode 100644 portaudio-v19/pa_win_wmme/pa_win_wmme.h create mode 100644 portaudio-v19/pablio/README.txt create mode 100644 portaudio-v19/pablio/pablio.c create mode 100644 portaudio-v19/pablio/pablio.def create mode 100644 portaudio-v19/pablio/pablio.h create mode 100644 portaudio-v19/pablio/ringbuffer.c create mode 100644 portaudio-v19/pablio/ringbuffer.h create mode 100644 portaudio-v19/pablio/test_rw.c create mode 100644 portaudio-v19/pablio/test_rw_echo.c create mode 100644 portaudio-v19/pablio/test_w_saw.c create mode 100644 portaudio-v19/pablio/test_w_saw8.c create mode 100644 portaudio-v19/testcvs/changeme.txt diff --git a/portaudio-v19/LICENSE.txt b/portaudio-v19/LICENSE.txt new file mode 100644 index 000000000..105da3f75 --- /dev/null +++ b/portaudio-v19/LICENSE.txt @@ -0,0 +1,65 @@ +Portable header file to contain: +/* + * PortAudio Portable Real-Time Audio Library + * PortAudio API Header File + * Latest version available at: http://www.audiomulch.com/portaudio/ + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + + +Implementation files to contain: +/* + * PortAudio Portable Real-Time Audio Library + * Latest version at: http://www.audiomulch.com/portaudio/ + * Implementation + * Copyright (c) 1999-2000 + * + * 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. + * + * 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. + * + * 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. + * + */ \ No newline at end of file diff --git a/portaudio-v19/Makefile b/portaudio-v19/Makefile new file mode 100644 index 000000000..61b734506 --- /dev/null +++ b/portaudio-v19/Makefile @@ -0,0 +1,186 @@ +# Generated automatically from Makefile.in by configure. +# +# PortAudio V19 Makefile.in +# +# Dominic Mazzoni +# + +PREFIX = /usr/local +CC = cc +CFLAGS = -Ipa_common -g -O2 -Wall -pedantic -pipe -fPIC -DPA_LITTLE_ENDIAN -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_LIBPTHREAD=1 -DPA_USE_OSS=1 +LIBS = -lpthread -lm -lpthread +AR = /usr/bin/ar +RANLIB = ranlib +INSTALL = /usr/bin/install -c +SHARED_FLAGS = -shared -fPIC +DLL_LIBS = +CXXFLAGS = +NASM = +NASMOPT = + +OTHER_OBJS = pa_unix_oss/pa_unix_oss.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o + +PALIB = libportaudio.a +PADLL = libportaudio.so +PADLLV = $(PADLL).0.0.19 +PAINC = pa_common/portaudio.h + +COMMON_OBJS = \ + pa_common/pa_allocation.o \ + pa_common/pa_converters.o \ + pa_common/pa_cpuload.o \ + pa_common/pa_dither.o \ + pa_common/pa_front.o \ + pa_common/pa_process.o \ + pa_common/pa_skeleton.o \ + pa_common/pa_stream.o \ + pa_common/pa_trace.o + +TESTS = \ + bin/paqa_devs \ + bin/paqa_errs \ + bin/patest1 \ + bin/patest_buffer \ + bin/patest_callbackstop \ + bin/patest_clip \ + bin/patest_dither \ + bin/patest_hang \ + bin/patest_in_overflow \ + bin/patest_latency \ + bin/patest_leftright \ + bin/patest_longsine \ + bin/patest_many \ + bin/patest_maxsines \ + bin/patest_multi_sine \ + bin/patest_out_underflow \ + bin/patest_pink \ + bin/patest_prime \ + bin/patest_read_record \ + bin/patest_record \ + bin/patest_ringmix \ + bin/patest_saw \ + bin/patest_sine8 \ + bin/patest_sine \ + bin/patest_sine_formats \ + bin/patest_sine_time \ + bin/patest_start_stop \ + bin/patest_stop \ + bin/patest_sync \ + bin/patest_toomanysines \ + bin/patest_underflow \ + bin/patest_wire \ + bin/patest_write_sine \ + bin/pa_devs \ + bin/pa_fuzz \ + bin/pa_minlat + +# Most of these don't compile yet. Put them in TESTS, above, if +# you want to try to compile them... +ALL_TESTS = \ + bin/debug_convert \ + bin/debug_dither_calc \ + bin/debug_dual \ + bin/debug_multi_in \ + bin/debug_multi_out \ + bin/debug_record \ + bin/debug_record_reuse \ + bin/debug_sine_amp \ + bin/debug_sine \ + bin/debug_sine_formats \ + bin/debug_srate \ + bin/debug_test1 \ + bin/pa_devs \ + bin/pa_fuzz \ + bin/pa_minlat \ + bin/paqa_devs \ + bin/paqa_errs \ + bin/patest1 \ + bin/patest_buffer \ + bin/patest_clip \ + bin/patest_dither \ + bin/patest_hang \ + bin/patest_in_overflow \ + bin/patest_latency \ + bin/patest_leftright \ + bin/patest_longsine \ + bin/patest_many \ + bin/patest_maxsines \ + bin/patest_multi_sine \ + bin/patest_out_underflow \ + bin/patest_pink \ + bin/patest_read_record \ + bin/patest_record \ + bin/patest_ringmix \ + bin/patest_saw \ + bin/patest_sine8 \ + bin/patest_sine \ + bin/patest_sine_formats \ + bin/patest_sine_time \ + bin/patest_start_stop \ + bin/patest_stop \ + bin/patest_sync \ + bin/patest_toomanysines \ + bin/patest_underflow \ + bin/patest_wire \ + bin/patest_write_sine + +OBJS = $(COMMON_OBJS) $(OTHER_OBJS) + +all: lib/$(PALIB) lib/$(PADLLV) tests + +tests: bin/ $(TESTS) + +lib/$(PALIB): lib/ $(OBJS) Makefile $(PAINC) + $(AR) ruv lib/$(PALIB) $(OBJS) + $(RANLIB) lib/$(PALIB) + +lib/$(PADLLV): lib/ $(OBJS) Makefile $(PAINC) + $(CC) $(SHARED_FLAGS) -o lib/$(PADLLV) $(OBJS) $(DLL_LIBS) + +$(TESTS): bin/%: lib/$(PALIB) Makefile $(PAINC) pa_tests/%.c + $(CC) -o $@ $(CFLAGS) pa_tests/$*.c lib/$(PALIB) $(LIBS) + +install: lib/$(PALIB) lib/$(PADLLV) + $(INSTALL) -d $(PREFIX)/lib + $(INSTALL) -m 644 lib/$(PADLLV) $(PREFIX)/lib/$(PADLLV) + $(INSTALL) -m 644 lib/$(PALIB) $(PREFIX)/lib/$(PALIB) + cd $(PREFIX)/lib && rm -f $(PADLL) && ln -s $(PADLLV) $(PADLL) + $(INSTALL) -d $(PREFIX)/include + $(INSTALL) -m 644 pa_common/portaudio.h $(PREFIX)/include/portaudio.h + @echo "" + @echo "------------------------------------------------------------" + @echo "PortAudio was successfully installed." + @echo "" + @echo "On some systems (e.g. Linux) you should run 'ldconfig' now" + @echo "to make the shared object available. You may also need to" + @echo "modify your LD_LIBRARY_PATH environment variable to include" + @echo "the directory $(PREFIX)/lib" + @echo "------------------------------------------------------------" + @echo "" + +uninstall: + rm -f $(PREFIX)/lib/$(PADLLV) + rm -f $(PREFIX)/lib/$(PALIB) + rm -f $(PREFIX)/lib/$(PADLL) + rm -f $(PREFIX)/include/portaudio.h + +clean: + rm -f $(OBJS) $(TESTS) lib/$(PALIB) lib/$(PADLLV) + +%.o: %.c Makefile $(PAINC) + $(CC) -c $(CFLAGS) $< -o $@ + +%.o: %.cpp Makefile $(PAINC) + $(CXX) -c $(CXXFLAGS) $< -o $@ + +%.o: %.asm + $(NASM) $(NASMOPT) -o $@ $< + +bin: + mkdir bin + +lib: + mkdir lib + + + diff --git a/portaudio-v19/Makefile.bak b/portaudio-v19/Makefile.bak new file mode 100644 index 000000000..cace57300 --- /dev/null +++ b/portaudio-v19/Makefile.bak @@ -0,0 +1,186 @@ +# Generated automatically from Makefile.in by configure. +# +# PortAudio V19 Makefile.in +# +# Dominic Mazzoni +# + +PREFIX = /usr/local +CC = cc +CFLAGS = -g -O2 -Wall -pedantic -pipe -fPIC -DPA_LITTLE_ENDIAN -I/usr/local/include -Ipa_common -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_LIBPTHREAD=1 -DPA_USE_JACK=1 -DPA_USE_OSS=1 +LIBS = -lpthread -pthread -L/usr/local/lib -ljack -lm -lpthread +AR = /usr/bin/ar +RANLIB = ranlib +INSTALL = /usr/bin/install -c -o root -g wheel +SHARED_FLAGS = -shared -fPIC +DLL_LIBS = -pthread -L/usr/local/lib -ljack +CXXFLAGS = -O2 -pipe +NASM = +NASMOPT = + +OTHER_OBJS = pa_jack/pa_jack.o pa_unix_oss/pa_unix_oss.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o + +PALIB = libportaudio.a +PADLL = libportaudio.so +PADLLV = $(PADLL).0.0.19 +PAINC = pa_common/portaudio.h + +COMMON_OBJS = \ + pa_common/pa_allocation.o \ + pa_common/pa_converters.o \ + pa_common/pa_cpuload.o \ + pa_common/pa_dither.o \ + pa_common/pa_front.o \ + pa_common/pa_process.o \ + pa_common/pa_skeleton.o \ + pa_common/pa_stream.o \ + pa_common/pa_trace.o + +TESTS = \ + bin/paqa_devs \ + bin/paqa_errs \ + bin/patest1 \ + bin/patest_buffer \ + bin/patest_callbackstop \ + bin/patest_clip \ + bin/patest_dither \ + bin/patest_hang \ + bin/patest_in_overflow \ + bin/patest_latency \ + bin/patest_leftright \ + bin/patest_longsine \ + bin/patest_many \ + bin/patest_maxsines \ + bin/patest_multi_sine \ + bin/patest_out_underflow \ + bin/patest_pink \ + bin/patest_prime \ + bin/patest_read_record \ + bin/patest_record \ + bin/patest_ringmix \ + bin/patest_saw \ + bin/patest_sine8 \ + bin/patest_sine \ + bin/patest_sine_formats \ + bin/patest_sine_time \ + bin/patest_start_stop \ + bin/patest_stop \ + bin/patest_sync \ + bin/patest_toomanysines \ + bin/patest_underflow \ + bin/patest_wire \ + bin/patest_write_sine \ + bin/pa_devs \ + bin/pa_fuzz \ + bin/pa_minlat + +# Most of these don't compile yet. Put them in TESTS, above, if +# you want to try to compile them... +ALL_TESTS = \ + bin/debug_convert \ + bin/debug_dither_calc \ + bin/debug_dual \ + bin/debug_multi_in \ + bin/debug_multi_out \ + bin/debug_record \ + bin/debug_record_reuse \ + bin/debug_sine_amp \ + bin/debug_sine \ + bin/debug_sine_formats \ + bin/debug_srate \ + bin/debug_test1 \ + bin/pa_devs \ + bin/pa_fuzz \ + bin/pa_minlat \ + bin/paqa_devs \ + bin/paqa_errs \ + bin/patest1 \ + bin/patest_buffer \ + bin/patest_clip \ + bin/patest_dither \ + bin/patest_hang \ + bin/patest_in_overflow \ + bin/patest_latency \ + bin/patest_leftright \ + bin/patest_longsine \ + bin/patest_many \ + bin/patest_maxsines \ + bin/patest_multi_sine \ + bin/patest_out_underflow \ + bin/patest_pink \ + bin/patest_read_record \ + bin/patest_record \ + bin/patest_ringmix \ + bin/patest_saw \ + bin/patest_sine8 \ + bin/patest_sine \ + bin/patest_sine_formats \ + bin/patest_sine_time \ + bin/patest_start_stop \ + bin/patest_stop \ + bin/patest_sync \ + bin/patest_toomanysines \ + bin/patest_underflow \ + bin/patest_wire \ + bin/patest_write_sine + +OBJS = $(COMMON_OBJS) $(OTHER_OBJS) + +all: lib/$(PALIB) lib/$(PADLLV) + +tests: bin/ $(TESTS) + +lib/$(PALIB): lib/ $(OBJS) Makefile $(PAINC) + $(AR) ruv lib/$(PALIB) $(OBJS) + $(RANLIB) lib/$(PALIB) + +lib/$(PADLLV): lib/ $(OBJS) Makefile $(PAINC) + $(CC) $(SHARED_FLAGS) -o lib/$(PADLLV) $(OBJS) $(DLL_LIBS) + +$(TESTS): bin/%: lib/$(PALIB) Makefile $(PAINC) pa_tests/%.c + $(CC) -o $@ $(CFLAGS) pa_tests/$*.c lib/$(PALIB) $(LIBS) + +install: lib/$(PALIB) lib/$(PADLLV) + $(INSTALL) -d $(PREFIX)/lib + $(INSTALL) -m 644 lib/$(PADLLV) $(PREFIX)/lib/$(PADLLV) + $(INSTALL) -m 644 lib/$(PALIB) $(PREFIX)/lib/$(PALIB) + cd $(PREFIX)/lib && rm -f $(PADLL) && ln -s $(PADLLV) $(PADLL) + $(INSTALL) -d $(PREFIX)/include + $(INSTALL) -m 644 pa_common/portaudio.h $(PREFIX)/include/portaudio.h + @echo "" + @echo "------------------------------------------------------------" + @echo "PortAudio was successfully installed." + @echo "" + @echo "On some systems (e.g. Linux) you should run 'ldconfig' now" + @echo "to make the shared object available. You may also need to" + @echo "modify your LD_LIBRARY_PATH environment variable to include" + @echo "the directory $(PREFIX)/lib" + @echo "------------------------------------------------------------" + @echo "" + +uninstall: + rm -f $(PREFIX)/lib/$(PADLLV) + rm -f $(PREFIX)/lib/$(PALIB) + rm -f $(PREFIX)/lib/$(PADLL) + rm -f $(PREFIX)/include/portaudio.h + +clean: + rm -f $(OBJS) $(TESTS) lib/$(PALIB) lib/$(PADLLV) + +%.o: %.c Makefile $(PAINC) + $(CC) -c $(CFLAGS) $< -o $@ + +%.o: %.cpp Makefile $(PAINC) + $(CXX) -c $(CXXFLAGS) $< -o $@ + +%.o: %.asm + $(NASM) $(NASMOPT) -o $@ $< + +bin: + mkdir bin + +lib: + mkdir lib + + + diff --git a/portaudio-v19/Makefile.in b/portaudio-v19/Makefile.in new file mode 100644 index 000000000..9ba7a319c --- /dev/null +++ b/portaudio-v19/Makefile.in @@ -0,0 +1,185 @@ +# +# PortAudio V19 Makefile.in +# +# Dominic Mazzoni +# + +PREFIX = @prefix@ +CC = @CC@ +CFLAGS = -Ipa_common @CFLAGS@ @DEFS@ +LIBS = @LIBS@ +AR = @AR@ +RANLIB = @RANLIB@ +INSTALL = @INSTALL@ +SHARED_FLAGS = @SHARED_FLAGS@ +DLL_LIBS = @DLL_LIBS@ +CXXFLAGS = @CXXFLAGS@ +NASM = @NASM@ +NASMOPT = @NASMOPT@ + +OTHER_OBJS = @OTHER_OBJS@ + +PALIB = libportaudio.a +PADLL = @PADLL@ +PADLLV = $(PADLL).0.0.19 +PAINC = pa_common/portaudio.h + +COMMON_OBJS = \ + pa_common/pa_allocation.o \ + pa_common/pa_converters.o \ + pa_common/pa_cpuload.o \ + pa_common/pa_dither.o \ + pa_common/pa_front.o \ + pa_common/pa_process.o \ + pa_common/pa_skeleton.o \ + pa_common/pa_stream.o \ + pa_common/pa_trace.o + +TESTS = \ + bin/paqa_devs \ + bin/paqa_errs \ + bin/patest1 \ + bin/patest_buffer \ + bin/patest_callbackstop \ + bin/patest_clip \ + bin/patest_dither \ + bin/patest_hang \ + bin/patest_in_overflow \ + bin/patest_latency \ + bin/patest_leftright \ + bin/patest_longsine \ + bin/patest_many \ + bin/patest_maxsines \ + bin/patest_multi_sine \ + bin/patest_out_underflow \ + bin/patest_pink \ + bin/patest_prime \ + bin/patest_read_record \ + bin/patest_record \ + bin/patest_ringmix \ + bin/patest_saw \ + bin/patest_sine8 \ + bin/patest_sine \ + bin/patest_sine_formats \ + bin/patest_sine_time \ + bin/patest_start_stop \ + bin/patest_stop \ + bin/patest_sync \ + bin/patest_toomanysines \ + bin/patest_underflow \ + bin/patest_wire \ + bin/patest_write_sine \ + bin/pa_devs \ + bin/pa_fuzz \ + bin/pa_minlat + +# Most of these don't compile yet. Put them in TESTS, above, if +# you want to try to compile them... +ALL_TESTS = \ + bin/debug_convert \ + bin/debug_dither_calc \ + bin/debug_dual \ + bin/debug_multi_in \ + bin/debug_multi_out \ + bin/debug_record \ + bin/debug_record_reuse \ + bin/debug_sine_amp \ + bin/debug_sine \ + bin/debug_sine_formats \ + bin/debug_srate \ + bin/debug_test1 \ + bin/pa_devs \ + bin/pa_fuzz \ + bin/pa_minlat \ + bin/paqa_devs \ + bin/paqa_errs \ + bin/patest1 \ + bin/patest_buffer \ + bin/patest_clip \ + bin/patest_dither \ + bin/patest_hang \ + bin/patest_in_overflow \ + bin/patest_latency \ + bin/patest_leftright \ + bin/patest_longsine \ + bin/patest_many \ + bin/patest_maxsines \ + bin/patest_multi_sine \ + bin/patest_out_underflow \ + bin/patest_pink \ + bin/patest_read_record \ + bin/patest_record \ + bin/patest_ringmix \ + bin/patest_saw \ + bin/patest_sine8 \ + bin/patest_sine \ + bin/patest_sine_formats \ + bin/patest_sine_time \ + bin/patest_start_stop \ + bin/patest_stop \ + bin/patest_sync \ + bin/patest_toomanysines \ + bin/patest_underflow \ + bin/patest_wire \ + bin/patest_write_sine + +OBJS = $(COMMON_OBJS) $(OTHER_OBJS) + +all: lib/$(PALIB) lib/$(PADLLV) tests + +tests: bin/ $(TESTS) + +lib/$(PALIB): lib/ $(OBJS) Makefile $(PAINC) + $(AR) ruv lib/$(PALIB) $(OBJS) + $(RANLIB) lib/$(PALIB) + +lib/$(PADLLV): lib/ $(OBJS) Makefile $(PAINC) + $(CC) $(SHARED_FLAGS) -o lib/$(PADLLV) $(OBJS) $(DLL_LIBS) + +$(TESTS): bin/%: lib/$(PALIB) Makefile $(PAINC) pa_tests/%.c + $(CC) -o $@ $(CFLAGS) pa_tests/$*.c lib/$(PALIB) $(LIBS) + +install: lib/$(PALIB) lib/$(PADLLV) + $(INSTALL) -d $(PREFIX)/lib + $(INSTALL) -m 644 lib/$(PADLLV) $(PREFIX)/lib/$(PADLLV) + $(INSTALL) -m 644 lib/$(PALIB) $(PREFIX)/lib/$(PALIB) + cd $(PREFIX)/lib && rm -f $(PADLL) && ln -s $(PADLLV) $(PADLL) + $(INSTALL) -d $(PREFIX)/include + $(INSTALL) -m 644 pa_common/portaudio.h $(PREFIX)/include/portaudio.h + @echo "" + @echo "------------------------------------------------------------" + @echo "PortAudio was successfully installed." + @echo "" + @echo "On some systems (e.g. Linux) you should run 'ldconfig' now" + @echo "to make the shared object available. You may also need to" + @echo "modify your LD_LIBRARY_PATH environment variable to include" + @echo "the directory $(PREFIX)/lib" + @echo "------------------------------------------------------------" + @echo "" + +uninstall: + rm -f $(PREFIX)/lib/$(PADLLV) + rm -f $(PREFIX)/lib/$(PALIB) + rm -f $(PREFIX)/lib/$(PADLL) + rm -f $(PREFIX)/include/portaudio.h + +clean: + rm -f $(OBJS) $(TESTS) lib/$(PALIB) lib/$(PADLLV) + +%.o: %.c Makefile $(PAINC) + $(CC) -c $(CFLAGS) $< -o $@ + +%.o: %.cpp Makefile $(PAINC) + $(CXX) -c $(CXXFLAGS) $< -o $@ + +%.o: %.asm + $(NASM) $(NASMOPT) -o $@ $< + +bin: + mkdir bin + +lib: + mkdir lib + + + diff --git a/portaudio-v19/README.txt b/portaudio-v19/README.txt new file mode 100644 index 000000000..4cfc6166e --- /dev/null +++ b/portaudio-v19/README.txt @@ -0,0 +1,81 @@ +README for PortAudio +Implementations for PC DirectSound and Mac SoundManager + +/* + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com// + * + * Copyright (c) 1999-2000 Phil Burk and Ross Bencina + * + * 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. + * + * 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. + * + * 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. + * + */ + +PortAudio is a portable audio I/O library designed for cross-platform +support of audio. It uses a callback mechanism to request audio processing. +Audio can be generated in various formats, including 32 bit floating point, +and will be converted to the native format internally. + +Documentation: + See "pa_common/portaudio.h" for API spec. + See docs folder for a tutorial. + Also see http://www.portaudio.com/docs/ + And see "pa_tests/patest_saw.c" for an example. + +For information on compiling programs with PortAudio, please see the +tutorial at: + + http://www.portaudio.com/docs/pa_tutorial.html + +Important Files and Folders: + pa_common/ = platform independant code + pa_common/portaudio.h = header file for PortAudio API. Specifies API. + pa_common/pa_lib.c = host independant code for all implementations. + + pablio = simple blocking read/write interface + +Platform Implementations + pa_asio = ASIO for Windows and Macintosh + pa_beos = BeOS + pa_mac_sm = Macintosh Sound Manager for OS 8,9 and Carbon + pa_mac_core = Macintosh Core Audio for OS X + pa_sgi = Silicon Graphics AL + pa_unix_oss = OSS implementation for various Unixes + pa_win_ds = Windows Direct Sound + pa_win_wmme = Windows MME (most widely supported) + +Test Programs + pa_tests/pa_fuzz.c = guitar fuzz box + pa_tests/pa_devs.c = print a list of available devices + pa_tests/pa_minlat.c = determine minimum latency for your machine + pa_tests/paqa_devs.c = self test that opens all devices + pa_tests/paqa_errs.c = test error detection and reporting + pa_tests/patest_clip.c = hear a sine wave clipped and unclipped + pa_tests/patest_dither.c = hear effects of dithering (extremely subtle) + pa_tests/patest_pink.c = fun with pink noise + pa_tests/patest_record.c = record and playback some audio + pa_tests/patest_maxsines.c = how many sine waves can we play? Tests Pa_GetCPULoad(). + pa_tests/patest_sine.c = output a sine wave in a simple PA app + pa_tests/patest_sync.c = test syncronization of audio and video + pa_tests/patest_wire.c = pass input to output, wire simulator diff --git a/portaudio-v19/SConscript b/portaudio-v19/SConscript new file mode 100644 index 000000000..252ef5b26 --- /dev/null +++ b/portaudio-v19/SConscript @@ -0,0 +1,198 @@ +import os.path, copy, sys + +def checkSymbol(conf, header, library=None, symbol=None, autoadd=True, critical=False, pkgName=None): + env = conf.env + if library is None: + library = "c" # Standard library + autoadd = False + + if pkgName is not None: + origLibPath = copy.copy(env.get("LIBPATH", None)) + origLibs = copy.copy(env.get("LIBS", None)) + origLinkFlags = copy.copy(env.get("LINKFLAGS", None)) + origCppFlags = copy.copy(env.get("CPPFLAGS", None)) + origCppPath = copy.copy(env.get("CPPPATH", None)) + origCcFlags = copy.copy(env.get("CCFLAGS", None)) + origAsFlags = copy.copy(env.get("ASFLAGS", None)) + + try: env.ParseConfig("pkg-config --silence-errors %s --cflags --libs" % pkgName) + except: pass + else: + # I see no other way of checking that the parsing succeeded, if it did add no more linking parameters + if env["LIBS"] != origLibs: + autoadd = False + + try: + if not conf.CheckCHeader(header, include_quotes="<>"): + raise ConfigurationError("missing header %s" % header) + if symbol is not None and not conf.CheckLib(library, symbol, language="C", autoadd=autoadd): + raise ConfigurationError("missing symbol %s in library %s" % (symbol, library)) + except ConfigurationError: + if pkgName is not None: + # Restore any changes made by ParseConfig + if origLibPath is not None: + env["LIBPATH"] = origLibPath + if origLibs is not None: + env["LIBS"] = origLibs + if origLinkFlags is not None: + env["LINKFLAGS"] = origLinkFlags + if origCppFlags is not None: + env["CPPFLAGS"] = origCppFlags + if origCppPath is not None: + env["CPPPATH"] = origCppPath + if origCcFlags is not None: + env["CCFLAGS"] = origCcFlags + if origAsFlags is not None: + env["ASFLAGS"] = origAsFlags + + if not critical: + return False + raise + + return True + +Import("env", "Platform", "Posix", "ConfigurationError") + +# Store all signatures in one file, otherwise .sconsign files will get installed along with our own files +env.SConsignFile() + +neededLibs = [] +optionalImpls = {} +if Platform in Posix: + neededLibs += [("pthread", "pthread.h", "pthread_create"), ("m", "math.h", "sin")] + if env["useALSA"]: + optionalImpls["ALSA"] = ("asound", "alsa/asoundlib.h", "snd_pcm_open") + if env["useJACK"]: + optionalImpls["JACK"] = ("jack", "jack/jack.h", "jack_client_new") + if env["useOSS"]: + # TODO: It looks like the prefix for soundcard.h depends on the platform + optionalImpls["OSS"] = ("oss", "sys/soundcard.h", None) +else: + raise ConfigurationError("unknown platform %s" % Platform) + +if Platform == "darwin": + env.Append(LINKFLAGS=["-framework CoreAudio", "-framework AudioToolBox"]) + env.Append(CPPDEFINES=["PA_USE_COREAUDIO"]) +elif Platform == "cygwin": + env.Append(LIBS=["winmm"]) +elif Platform == "irix": + neededLibs += [("audio", "dmedia/audio.h", "alOpenPort"), ("dmedia", "dmedia/dmedia.h", "dmGetUST")] + env.Append(CPPDEFINES=["PA_USE_SGI"]) + +def CheckCTypeSize(context, tp): + context.Message("Checking the size of C type %s..." % tp) + ret = context.TryRun(""" +#include + +int main() { + printf("%%d", sizeof(%s)); + return 0; +} +""" % tp, ".c") + if not ret[0]: + context.Result(" Couldn't obtain size of type %s!" % tp) + return None + + assert ret[1] + sz = int(ret[1]) + context.Result("%d" % sz) + return sz + +if sys.byteorder == "little": + env.Append(CPPDEFINES=["PA_LITTLE_ENDIAN"]) +elif sys.byteorder == "big": + env.Append(CPPDEFINES=["PA_BIG_ENDIAN"]) +else: + raise ConfigurationError("unknown byte order: %s" % sys.byteorder) +if env["enableDebugOutput"]: + env.Append(CPPDEFINES=["PA_ENABLE_DEBUG_OUTPUT"]) + +# Start configuration + +conf = env.Configure(log_file="sconf.log", custom_tests={"CheckCTypeSize": CheckCTypeSize}) +env.Append(CPPDEFINES=["SIZEOF_SHORT=%d" % conf.CheckCTypeSize("short")]) +env.Append(CPPDEFINES=["SIZEOF_INT=%d" % conf.CheckCTypeSize("int")]) +env.Append(CPPDEFINES=["SIZEOF_LONG=%d" % conf.CheckCTypeSize("long")]) +if checkSymbol(conf, "time.h", "rt", "clock_gettime"): + env.Append(CPPDEFINES=["HAVE_CLOCK_GETTIME"]) +if checkSymbol(conf, "time.h", "nanosleep"): + env.Append(CPPDEFINES=["HAVE_NANOSLEEP"]) + +for lib, hdr, sym in neededLibs: + checkSymbol(conf, hdr, lib, sym, critical=True) +for name, val in optionalImpls.items(): + lib, hdr, sym = val + if checkSymbol(conf, hdr, lib, sym, critical=False, pkgName=name.lower()): + env.Append(CPPDEFINES=["PA_USE_%s=1" % name.upper()]) + +# Configuration finished +env = conf.Finish() + +CommonSources = [os.path.join("pa_common", f) for f in "pa_allocation.c pa_converters.c pa_cpuload.c pa_dither.c pa_front.c \ + pa_process.c pa_skeleton.c pa_stream.c pa_trace.c".split()] + +ImplSources = [] +if Platform in Posix: + env.AppendUnique(LINKFLAGS=["-pthread"]) + BaseCFlags = "-Wall -pedantic -pipe -pthread" + DebugCFlags = "-g" + OptCFlags = "-O2" + ImplSources += [os.path.join("pa_unix", f) for f in "pa_unix_hostapis.c pa_unix_util.c".split()] + +if "ALSA" in optionalImpls: + ImplSources.append(os.path.join("pa_linux_alsa", "pa_linux_alsa.c")) +if "JACK" in optionalImpls: + ImplSources.append(os.path.join("pa_jack", "pa_jack.c")) +if "OSS" in optionalImpls: + ImplSources.append(os.path.join("pa_unix_oss", "pa_unix_oss.c")) + +env["CCFLAGS"] = BaseCFlags +if env["enableDebug"]: + env["CCFLAGS"] += " " + DebugCFlags +if env["enableOptimize"]: + env["CCFLAGS"] += " " + OptCFlags +if not env["enableAsserts"]: + env.Append(CPPDEFINES=["-DNDEBUG"]) +if env["customCFlags"]: + env["CCFLAGS"] += " " + env["customCFlags"] + +sources = CommonSources + ImplSources + +if env["enableShared"]: + sharedLib = env.SharedLibrary(target="portaudio", source=sources) +else: + sharedLib = None +staticLib = env.StaticLibrary(target="portaudio", source=sources) + +if Platform in Posix: + prefix = env["prefix"] + env.Alias("install", env.Install(os.path.join(prefix, "include"), os.path.join("pa_common", "portaudio.h"))) + + if env["enableStatic"]: + env.Alias("install", env.Install(os.path.join(prefix, "lib"), staticLib)) + + def symlink(env, target, source): + trgt = str(target[0]) + src = str(source[0]) + print trgt, src + + if os.path.exists(trgt): + os.remove(trgt) + os.symlink("libportaudio.so.0.0.19", trgt) + if env["enableShared"]: + env.Alias("install", env.InstallAs(target=os.path.join(prefix, "lib", "%s.0.0.19") % sharedLib[0], source=sharedLib)) + env.Alias("install", env.Command(os.path.join(prefix, "lib", "libportaudio.so"), sharedLib, symlink)) + +testNames = ["patest_sine", "paqa_devs", "paqa_errs", "patest1", "patest_buffer", "patest_callbackstop", "patest_clip", \ + "patest_dither", "patest_hang", "patest_in_overflow", "patest_latency", "patest_leftright", "patest_longsine", \ + "patest_many", "patest_maxsines", "patest_multi_sine", "patest_out_underflow", "patest_pink", "patest_prime", \ + "patest_read_record", "patest_record", "patest_ringmix", "patest_saw", "patest_sine8", "patest_sine", \ + "patest_sine_time", "patest_start_stop", "patest_stop", "patest_sync", \ + "patest_toomanysines", "patest_underflow", "patest_wire", "patest_write_sine", "pa_devs", "pa_fuzz", "pa_minlat"] + +# The test directory ("bin") should be in the top-level PA directory, the calling script should ensure that SCons doesn't +# switch current directory by calling SConscriptChdir(False). Specifying an absolute directory for each target means it won't +# be relative to the build directory +tests = [env.Program(target=os.path.join(os.getcwd(), "bin", name), source=[os.path.join("pa_tests", name + ".c"), staticLib]) for name in testNames] + +Return("sources", "sharedLib", "staticLib") diff --git a/portaudio-v19/SConstruct b/portaudio-v19/SConstruct new file mode 100644 index 000000000..07e219a8b --- /dev/null +++ b/portaudio-v19/SConstruct @@ -0,0 +1,78 @@ +import sys, os.path + +class ConfigurationError(Exception): + def __init__(self, reason): + Exception.__init__(self, "Configuration failed: %s" % reason) + +def _PackageOption(pkgName, default="yes"): + return BoolOption("use%s" % pkgName[0].upper() + pkgName[1:], "use %s if available" % (pkgName), default) + +def _BoolOption(opt, explanation, default="yes"): + return BoolOption("enable%s" % opt[0].upper() + opt[1:], explanation, default) + +def _DirectoryOption(path, help, default): + return PathOption(path, help, default) + # Incompatible with the latest stable SCons + # return PathOption(path, help, default, PathOption.PathIsDir) + +def _EnumOption(opt, explanation, allowedValues, default): + assert default in allowedValues + return EnumOption("with%s" % opt[0].upper() + opt[1:], explanation, default, allowed_values=allowedValues) + +def getPlatform(): + global __platform + try: return __platform + except NameError: + env = Environment() + if env["PLATFORM"] == "posix": + if sys.platform[:5] == "linux": + __platform = "linux" + else: + raise ConfigurationError("Unknown platform %s" % sys.platform) + else: + if not env["PLATFORM"] in ("win32", "cygwin") + Posix: + raise ConfigurationError("Unknown platform %s" % env["PLATFORM"]) + __platform = env["PLATFORM"] + + return __platform + +# sunos, aix, hpux, irix, sunos appear to be platforms known by SCons, assuming they're POSIX compliant +Posix = ("linux", "darwin", "sunos", "aix", "hpux", "irix", "sunos") +Windows = ("win32", "cygwin") +env = Environment(CPPPATH="pa_common") + +Platform = getPlatform() + +opts = Options("options.cache", args=ARGUMENTS) +if Platform in Posix: + opts.AddOptions( + _DirectoryOption("prefix", "installation prefix", "/usr/local"), + _PackageOption("ALSA"), + _PackageOption("OSS"), + _PackageOption("JACK"), + ) +elif Platform in Windows: + if Platform == "cygwin": + opts.AddOptions(_DirectoryOption("prefix", "installation prefix", "/usr/local")) + opts.AddOptions(_EnumOption("winAPI", "Windows API to use", ("wmme", "directx", "asio"), "wmme")) + +if Platform == "darwin": + opts.AddOptions(_EnumOption("macAPI", "Mac API to use", ("asio", "core", "sm"), "core")) + +opts.AddOptions( + _BoolOption("shared", "create shared library"), + _BoolOption("static", "create static library"), + _BoolOption("debug", "compile with debug symbols"), + _BoolOption("optimize", "compile with optimization", default="no"), + _BoolOption("asserts", "runtime assertions are helpful for debugging, but can be detrimental to performance", default="yes"), + _BoolOption("debugOutput", "enable debug output", default="no"), + ("customCFlags", "customize compilation of C code", ""), + ) + +opts.Update(env) +opts.Save("options.cache", env) + +Help(opts.GenerateHelpText(env)) + +env.SConscriptChdir(False) +SConscript("SConscript", build_dir=".build_scons", exports=["env", "Platform", "Posix", "ConfigurationError"], duplicate=False) diff --git a/portaudio-v19/V19-devel-readme.txt b/portaudio-v19/V19-devel-readme.txt new file mode 100644 index 000000000..ae5570eb6 --- /dev/null +++ b/portaudio-v19/V19-devel-readme.txt @@ -0,0 +1,222 @@ +STATUS: + +MME, DirectSound and ASIO versions are more-or-less working. See FIXMEs @todos +and the proposals matrix at portaudio.com for further status. + +The pa_tests directory contains tests. pa_tests/README.txt notes which tests +currently build. + +The PaUtil support code is finished enough for other implementations to be +ported. No changes are expected to be made to the definition of the PaUtil +functions. + +Note that it's not yet 100% clear how the current support functions +will interact with blocking read/write streams. + +BUILD INSTRUCTIONS + +to build tests/patest_sine.c you will need to compile and link the following +files (MME) +pa_common\pa_process.c +pa_common\pa_skeleton.c +pa_common\pa_stream.c +pa_common\pa_trace.c +pa_common\pa_converters.c +pa_common\pa_cpuload.c +pa_common\pa_dither.c +pa_common\pa_front.c +pa_common\pa_allocation.h +pa_win\pa_win_util.c +pa_win\pa_win_hostapis.c +pa_win_wmme\pa_win_wmme.c + +see below for a description of these files. + + +FILES: + +portaudio.h + public api header file + +pa_front.c + implements the interface defined in portaudio.h. manages multiple host apis. + validates function parameters before calling through to host apis. tracks + open streams and closes them at Pa_Terminate(). + +pa_util.h + declares utility functions for use my implementations. including utility + functions which must be implemented separately for each platform. + +pa_hostapi.h + hostapi representation structure used to interface between pa_front.c + and implementations + +pa_stream.c/h + stream interface and representation structures and helper functions + used to interface between pa_front.c and implementations + +pa_cpuload.c/h + source and header for cpu load calculation facility + +pa_trace.c/h + source and header for debug trace log facility + +pa_converters.c/h + sample buffer conversion facility + +pa_dither.c/h + dither noise generator + +pa_process.c/h + callback buffer processing facility including interleave and block adaption + +pa_allocation.c/h + allocation context for tracking groups of allocations + +pa_skeleton.c + an skeleton implementation showing how the common code can be used. + +pa_win_util.c + Win32 implementation of platform specific PaUtil functions (memory allocation, + usec clock, Pa_Sleep().) The file will be used with all Win32 host APIs. + +pa_win_hostapis.c + contains the paHostApiInitializers array and an implementation of + Pa_GetDefaultHostApi() for win32 builds. + +pa_win_wmme.c + Win32 host api implementation for the windows multimedia extensions audio API. + +pa_win_wmme.h + public header file containing interfaces to mme-specific functions and the + deviceInfo data structure. + + +CODING GUIDELINES: + +naming conventions: + #defines begin with PA_ + #defines local to a file end with _ + global utility variables begin with paUtil + global utility types begin with PaUtil (including function types) + global utility functions begin with PaUtil_ + static variables end with _ + static constants begin with const and end with _ + static funtions have no special prefix/suffix + +In general, implementations should declare all of their members static, +except for their initializer which should be exported. All exported names +should be preceeded by Pa_ where MN is the module name, for example +the windows mme initializer should be named PaWinWmme_Initialize(). + +Every host api should define an initializer which returns an error code +and a PaHostApiInterface*. The initializer should only return an error other +than paNoError if it encounters an unexpected and fatal error (memory allocation +error for example). In general, there may be conditions under which it returns +a NULL interface pointer and also returns paNoError. For example, if the ASIO +implementation detects that ASIO is not installed, it should return a +NULL interface, and paNoError. + +Platform-specific shared functions should begin with Pa_ where PN is the +platform name. eg. PaWin_ for windows, PaUnix_ for unix. + +The above two conventions should also be followed whenever it is necessary to +share functions accross multiple source files. + +Two utilities for debug messages are provided. The PA_DEBUG macro defined in +pa_implementation.h provides a simple way to print debug messages to stderr. +Due to real-time performance issues, PA_DEBUG may not be suitable for use +within the portaudio processing callback, or in other threads. In such cases +the event tracing facility provided in pa_trace.h may be more appropriate. + +If PA_LOG_API_CALLS is defined, all calls to the public PortAudio API +will be logged to stderr along with parameter and return values. + + +TODO: + (this list is totally out of date) + + finish coding converter functions in pa_converters.c (anyone?) + + implement block adaption in pa_process.c (phil?) + + fix all current tests to work with new code. this should mostly involve + changing PortAudioStream to PaStream, and GetDefaultDeviceID to GetDefaultDevice etc. + + write some new tests to exercise the multi-api functions + + write (doxygen) documentation for pa_trace (phil?) + + remove unused typeids from PaHostAPITypeID + + create a global configuration file which documents which PA_ defines can be + used for configuration + + need a coding standard for comment formatting + + migrate directx (phil) + + migrate asio (ross?, stephane?) + + see top of pa_win_wmme.c for MME todo items (ross) + + write style guide document (ross) + + +DESIGN ISSUES: + (this list is totally out of date) + + consider removing Pa_ConvertHostApiDeviceIndexToGlobalDeviceIndex() from the API + + switch to new latency parameter mechanism now (?) + + question: if input or outputDriverInfo structures are passed for a different + hostApi from the one being called, do we return an error or just ignore + them? (i think return error) + + consider renaming PortAudioCallback to PaStreamCallback + + consider renaming PaError, PaResult + + +ASSORTED DISORGANISED NOTES: + + NOTE: + pa_lib.c performs the following validations for Pa_OpenStream() which we do not currently do: + - checks the device info to make sure that the device supports the requested sample rate, + it may also change the sample rate to the "closest available" sample rate if it + is within a particular error margin + + rationale for breaking up internalPortAudioStream: + each implementation has its own requirements and behavior, and should be + able to choose the best way to operate without being limited by the + constraints imposed by a common infrastructure. in other words the + implementations should be able to pick and choose services from the + common infrastructure. currently identified services include: + + - cpu load tracking + - buffering and conversion service (same code works for input and output) + - should support buffer multiplexing (non-integer length input and output buffers) + - in-place conversion where possible (only for callback, read/write always copies) + - should manage allocation of temporary buffers if necessary + - instrumentation (should be able to be disabled): callback count, framesProcessed + - common data: magic, streamInterface, callback, userdata + + +- conversion functions: + - should handle temp buffer allocation + - dithering (random number state per-stream) + - buffer size mismatches + - with new buffer slip rules, temp buffers may always be needed + - we should aim for in-place conversion wherever possible + - does phil's code support in-place conversion? (yes) + +- dicuss relationship between user and host buffer sizes + - completely independent.. individual implementations may constrain + host buffer sizes if necessary + + +- discuss device capabilities: + - i'd like to be able to request certain information: + - channel count for example + diff --git a/portaudio-v19/aclocal.m4 b/portaudio-v19/aclocal.m4 new file mode 100644 index 000000000..c80e0acfc --- /dev/null +++ b/portaudio-v19/aclocal.m4 @@ -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/portaudio-v19/config.cache b/portaudio-v19/config.cache new file mode 100644 index 000000000..e4d56e18d --- /dev/null +++ b/portaudio-v19/config.cache @@ -0,0 +1,30 @@ +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +ac_cv_c_bigendian=${ac_cv_c_bigendian=no} +ac_cv_lib_asound_snd_pcm_open=${ac_cv_lib_asound_snd_pcm_open=no} +ac_cv_lib_pthread_pthread_create=${ac_cv_lib_pthread_pthread_create=yes} +ac_cv_path_AR=${ac_cv_path_AR=/usr/bin/ar} +ac_cv_path_PKG_CONFIG=${ac_cv_path_PKG_CONFIG=/usr/local/bin/pkg-config} +ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'} +ac_cv_prog_CC=${ac_cv_prog_CC=cc} +ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=ranlib} +ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no} +ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes} +ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes} +ac_cv_prog_gcc=${ac_cv_prog_gcc=yes} +ac_cv_sizeof_int=${ac_cv_sizeof_int=4} +ac_cv_sizeof_long=${ac_cv_sizeof_long=4} +ac_cv_sizeof_short=${ac_cv_sizeof_short=2} +lt_cv_sys_max_cmd_len=${lt_cv_sys_max_cmd_len=262144} diff --git a/portaudio-v19/config.doxy b/portaudio-v19/config.doxy new file mode 100644 index 000000000..f6509a32d --- /dev/null +++ b/portaudio-v19/config.doxy @@ -0,0 +1,185 @@ +# Doxyfile 1.2.13-20020210 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = PortAudio +PROJECT_NUMBER = 2.0 +OUTPUT_DIRECTORY = "./docs/" +OUTPUT_LANGUAGE = English +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = NO +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ./pa_common ./pa_win_wmme ./pa_asio ./pa_win_ds ./pa_linux_alsa ./pa_unix_oss ./pa_jack ./pa_tests +FILE_PATTERNS = *.h *.c *.cpp +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 +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = doxygen_html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +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 = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = 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 +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# 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 = +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 = NO +HIDE_UNDOC_RELATIONS = NO +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = search.cgi +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = /usr/local/bin/ +EXT_DOC_PATHS = diff --git a/portaudio-v19/config.guess b/portaudio-v19/config.guess new file mode 100755 index 000000000..0e30d56e9 --- /dev/null +++ b/portaudio-v19/config.guess @@ -0,0 +1,1407 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-07-02' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + *:UNICOS/mp:*:*) + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + # GNU/FreeBSD systems have a "k" prefix to indicate we are using + # FreeBSD's kernel, but not the complete OS. + case ${LIBC} in gnu) kernel_only='k' ;; esac + echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/portaudio-v19/config.log b/portaudio-v19/config.log new file mode 100644 index 000000000..8f29e67d0 --- /dev/null +++ b/portaudio-v19/config.log @@ -0,0 +1,23 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +configure:618: checking for gcc +configure:731: checking whether the C compiler (cc ) works +configure:747: cc -o conftest conftest.c 1>&5 +configure:773: checking whether the C compiler (cc ) is a cross-compiler +configure:778: checking whether we are using GNU C +configure:806: checking whether cc accepts -g +configure:840: checking for ranlib +configure:898: checking for a BSD compatible install +configure:953: checking for ar +configure:991: checking whether byte ordering is bigendian +configure:1083: checking for snd_pcm_open in -lasound +configure:1131: checking host system type +configure:1159: checking for pkg-config +configure:1203: checking for jack +configure:1210: checking JACK_CFLAGS +configure:1215: checking JACK_LIBS +configure:1244: checking size of short +configure:1283: checking size of int +configure:1322: checking size of long +configure:1632: checking for pthread_create in -lpthread diff --git a/portaudio-v19/config.status b/portaudio-v19/config.status new file mode 100755 index 000000000..9ca00d332 --- /dev/null +++ b/portaudio-v19/config.status @@ -0,0 +1,175 @@ +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host night.db.net: +# +# ./configure --with-jack=no +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]" +for ac_option +do + case "$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running ${CONFIG_SHELL-/bin/sh} ./configure --with-jack=no --no-create --no-recursion" + exec ${CONFIG_SHELL-/bin/sh} ./configure --with-jack=no --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "./config.status generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "$ac_cs_usage"; exit 0 ;; + *) echo "$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=. +ac_given_INSTALL="/usr/bin/install -c" + +trap 'rm -fr Makefile conftest*; exit 1' 1 2 15 + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g; + s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF +/^[ ]*VPATH[ ]*=[^:]*$/d + +s%@SHELL@%/usr/local/bin/bash%g +s%@CFLAGS@%-g -O2 -Wall -pedantic -pipe -fPIC -DPA_LITTLE_ENDIAN%g +s%@CPPFLAGS@%%g +s%@CXXFLAGS@%%g +s%@FFLAGS@%%g +s%@DEFS@% -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_LIBPTHREAD=1 -DPA_USE_OSS=1 %g +s%@LDFLAGS@%%g +s%@LIBS@%-lpthread -lm -lpthread%g +s%@exec_prefix@%${prefix}%g +s%@prefix@%/usr/local%g +s%@program_transform_name@%s,x,x,%g +s%@bindir@%${exec_prefix}/bin%g +s%@sbindir@%${exec_prefix}/sbin%g +s%@libexecdir@%${exec_prefix}/libexec%g +s%@datadir@%${prefix}/share%g +s%@sysconfdir@%${prefix}/etc%g +s%@sharedstatedir@%${prefix}/com%g +s%@localstatedir@%${prefix}/var%g +s%@libdir@%${exec_prefix}/lib%g +s%@includedir@%${prefix}/include%g +s%@oldincludedir@%/usr/include%g +s%@infodir@%${prefix}/info%g +s%@mandir@%${prefix}/man%g +s%@CC@%cc%g +s%@RANLIB@%ranlib%g +s%@INSTALL_PROGRAM@%${INSTALL}%g +s%@INSTALL_SCRIPT@%${INSTALL_PROGRAM}%g +s%@INSTALL_DATA@%${INSTALL} -m 644%g +s%@AR@%/usr/bin/ar%g +s%@host@%i386-unknown-freebsd7.0%g +s%@host_alias@%i386-unknown-freebsd7.0%g +s%@host_cpu@%i386%g +s%@host_vendor@%unknown%g +s%@host_os@%freebsd7.0%g +s%@PKG_CONFIG@%/usr/local/bin/pkg-config%g +s%@JACK_CFLAGS@%-I/usr/local/include %g +s%@JACK_LIBS@%-pthread -L/usr/local/lib -ljack %g +s%@OTHER_OBJS@% pa_unix_oss/pa_unix_oss.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o%g +s%@PADLL@%libportaudio.so%g +s%@SHARED_FLAGS@%-shared -fPIC%g +s%@DLL_LIBS@%%g +s%@NASM@%%g +s%@NASMOPT@%%g + +CEOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi + +CONFIG_FILES=${CONFIG_FILES-"Makefile"} +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + + + +exit 0 diff --git a/portaudio-v19/config.sub b/portaudio-v19/config.sub new file mode 100755 index 000000000..9d7f73390 --- /dev/null +++ b/portaudio-v19/config.sub @@ -0,0 +1,1504 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-07-04' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/portaudio-v19/configure b/portaudio-v19/configure new file mode 100755 index 000000000..017015446 --- /dev/null +++ b/portaudio-v19/configure @@ -0,0 +1,1990 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-alsa (default=yes)" +ac_help="$ac_help + --with-jack (default=yes)" +ac_help="$ac_help + --with-oss (default=yes)" +ac_help="$ac_help + --with-host_os (no default)" +ac_help="$ac_help + --with-winapi ((wmme/directx/asio) default=wmme)" +ac_help="$ac_help + --with-macapi ((asio/core/sm) default=core)" +ac_help="$ac_help + --with-asiodir (default=/usr/local/asiosdk2)" +ac_help="$ac_help + --with-dxdir (default=/usr/local/dx7sdk)" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=pa_common/portaudio.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + + +# Check whether --with-alsa or --without-alsa was given. +if test "${with_alsa+set}" = set; then + withval="$with_alsa" + with_alsa=$withval +else + with_alsa="yes" +fi + + +# Check whether --with-jack or --without-jack was given. +if test "${with_jack+set}" = set; then + withval="$with_jack" + with_jack=$withval +else + with_jack="yes" +fi + + +# Check whether --with-oss or --without-oss was given. +if test "${with_oss+set}" = set; then + withval="$with_oss" + with_oss=$withval +else + with_oss="yes" +fi + + +# Check whether --with-host_os or --without-host_os was given. +if test "${with_host_os+set}" = set; then + withval="$with_host_os" + host_os=$withval +fi + + +# Check whether --with-winapi or --without-winapi was given. +if test "${with_winapi+set}" = set; then + withval="$with_winapi" + with_winapi=$withval +else + with_winapi="wmme" +fi + + +# Check whether --with-macapi or --without-macapi was given. +if test "${with_macapi+set}" = set; then + withval="$with_macapi" + with_macapi=$withval +else + with_macapi="core" +fi + + +# Check whether --with-asiodir or --without-asiodir was given. +if test "${with_asiodir+set}" = set; then + withval="$with_asiodir" + with_asiodir=$withval +else + with_asiodir="/usr/local/asiosdk2" +fi + + +# Check whether --with-dxdir or --without-dxdir was given. +if test "${with_dxdir+set}" = set; then + withval="$with_dxdir" + with_dxdir=$withval +else + with_dxdir="/usr/local/dx7sdk" +fi + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:618: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +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 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:648: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_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 $# -gt 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 + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:699: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:731: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 742 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:773: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:778: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:806: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:840: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:898: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:953: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$AR" in + /*) + ac_cv_path_AR="$AR" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_AR="$AR" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_AR="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_AR" && ac_cv_path_AR="no" + ;; +esac +fi +AR="$ac_cv_path_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if [ $AR = "no" ] ; then + { echo "configure: error: "Could not find ar - needed to create a library"" 1>&2; exit 1; }; +fi + +echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:991: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat > conftest.$ac_ext < +#include +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:1009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. +cat > conftest.$ac_ext < +#include +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:1024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_bigendian=no +fi +rm -f conftest* +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + +fi + + + +echo $ac_n "checking for snd_pcm_open in -lasound""... $ac_c" 1>&6 +echo "configure:1083: checking for snd_pcm_open in -lasound" >&5 +ac_lib_var=`echo asound'_'snd_pcm_open | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lasound $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_alsa=yes +else + echo "$ac_t""no" 1>&6 +have_alsa=no +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:1131: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + + succeeded=no + + if test -z "$PKG_CONFIG"; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1159: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PKG_CONFIG" in + /*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +if test -n "$PKG_CONFIG"; then + echo "$ac_t""$PKG_CONFIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + 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 + echo $ac_n "checking for jack""... $ac_c" 1>&6 +echo "configure:1203: checking for jack" >&5 + + if $PKG_CONFIG --exists "jack" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking JACK_CFLAGS""... $ac_c" 1>&6 +echo "configure:1210: checking JACK_CFLAGS" >&5 + JACK_CFLAGS=`$PKG_CONFIG --cflags "jack"` + echo "$ac_t""$JACK_CFLAGS" 1>&6 + + echo $ac_n "checking JACK_LIBS""... $ac_c" 1>&6 +echo "configure:1215: checking JACK_LIBS" >&5 + JACK_LIBS=`$PKG_CONFIG --libs "jack"` + echo "$ac_t""$JACK_LIBS" 1>&6 + else + JACK_CFLAGS="" + JACK_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + JACK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "jack"` + + fi + + + + 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 + have_jack=yes + else + have_jack=no + fi + + + +echo $ac_n "checking size of short""... $ac_c" 1>&6 +echo "configure:1244: checking size of short" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(short)); + exit(0); +} +EOF +if { (eval echo configure:1263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_short=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_short=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_short" 1>&6 +cat >> confdefs.h <&6 +echo "configure:1283: checking size of int" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(int)); + exit(0); +} +EOF +if { (eval echo configure:1302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_int=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_int=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_int" 1>&6 +cat >> confdefs.h <&6 +echo "configure:1322: checking size of long" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(long)); + exit(0); +} +EOF +if { (eval echo configure:1341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_long=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_long=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_long" 1>&6 +cat >> confdefs.h <> confdefs.h <<\EOF +#define PA_USE_COREAUDIO 1 +EOF + + OTHER_OBJS="pa_mac/pa_mac_hostapis.o pa_unix/pa_unix_util.o pa_mac_core/pa_mac_core.o"; + LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"; + PADLL="libportaudio.dylib"; + SHARED_FLAGS="-framework CoreAudio -framework AudioToolbox -dynamiclib -framework AudioUnit -framework Carbon"; + if [ $with_macapi = "asio" ] ; then + if [ $with_asiodir ] ; then + ASIODIR="$with_asiodir"; + else + ASIODIR="/usr/local/asiosdk2"; + fi + echo "ASIODIR: $ASIODIR"; + + OTHER_OBJS="$CFLAGS pa_asio/iasiothiscallresolver.o $ASIODIR/host/asiodrivers.o $ASIODIR/common/asio.o $ASIODIR/host/mac/asioshlib.o"; + CFLAGS="$CFLAGS -Ipa_asio -I$ASIDIR/host/mac -I$ASIODIR/common"; + CXXFLAGS="$CFLAGS"; + fi + ;; + + mingw* ) + + echo "WINAPI: $with_winapi" + if [ $with_winapi = "directx" ] ; then + if [ $with_dxdir ] ; then + DXDIR="$with_dxdir"; + else + DXDIR="/usr/local/dx7sdk"; + fi + echo "DXDIR: $DXDIR" + OTHER_OBJS="pa_win_ds/pa_win_ds.o pa_win_ds/dsound_wrapper.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + LIBS="-lwinmm -lm -ldsound -lole32"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -ldsound -lole32"; + #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""; + #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"; + CFLAGS="$CFLAGS -Ipa_common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO" -DPA_NO_WDMKS; + elif [ $with_winapi = "asio" ] ; then + if [ $with_asiodir ] ; then + ASIODIR="$with_asiodir"; + else + ASIODIR="/usr/local/asiosdk2"; + fi + echo "ASIODIR: $ASIODIR" + + OTHER_OBJS="pa_asio/pa_asio.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o pa_asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o"; + LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -Ipa_common -Ipa_asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS"; + CXXFLAGS="$CFLAGS"; + elif [ $with_winapi = "wdmks" ] ; then + if [ $with_dxdir ] ; then + DXDIR="$with_dxdir"; + else + DXDIR="/usr/local/dx7sdk"; + fi + echo "DXDIR: $DXDIR" + OTHER_OBJS="pa_win_wdmks/pa_win_wdmks.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + LIBS="-lwinmm -lm -luuid -lsetupapi -lole32"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -luuid -lsetupapi -lole32"; + #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""; + #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"; + CFLAGS="$CFLAGS -Ipa_common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO"; + else # WMME default + OTHER_OBJS="pa_win_wmme/pa_win_wmme.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm"; + CFLAGS="$CFLAGS -Ipa_common -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS"; + fi + ;; + + cygwin* ) + + OTHER_OBJS="pa_win_wmme/pa_win_wmme.o"; + LIBS="-lwinmm -lm"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm"; + ;; + + irix* ) + echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 +echo "configure:1471: checking for pthread_create in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +{ echo "configure: error: IRIX posix thread library not found!" 1>&2; exit 1; } +fi + + echo $ac_n "checking for alOpenPort in -laudio""... $ac_c" 1>&6 +echo "configure:1519: checking for alOpenPort in -laudio" >&5 +ac_lib_var=`echo audio'_'alOpenPort | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-laudio $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo audio | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +{ echo "configure: error: IRIX audio library not found!" 1>&2; exit 1; } +fi + + echo $ac_n "checking for dmGetUST in -ldmedia""... $ac_c" 1>&6 +echo "configure:1567: checking for dmGetUST in -ldmedia" >&5 +ac_lib_var=`echo dmedia'_'dmGetUST | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldmedia $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo dmedia | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +{ echo "configure: error: IRIX digital media library not found!" 1>&2; exit 1; } +fi + + + cat >> confdefs.h <<\EOF +#define PA_USE_SGI 1 +EOF + + + CFLAGS="$CFLAGS -D_REENTRANT" + + OTHER_OBJS="pa_sgi/pa_sgi.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o"; + + LIBS="-lm -ldmedia -laudio -lpthread"; + PADLL="libportaudio.so"; + SHARED_FLAGS="-shared"; + ;; + + *) + + echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 +echo "configure:1632: checking for pthread_create in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +{ echo "configure: error: libpthread not found!" 1>&2; exit 1; } +fi + + + if [ $have_alsa = "yes" ] && [ $with_alsa != "no" ] ; then + LIBS="$LIBS -lasound" + DLL_LIBS="$DLL_LIBS -lasound" + OTHER_OBJS="$OTHER_OBJS pa_linux_alsa/pa_linux_alsa.o" + cat >> confdefs.h <<\EOF +#define PA_USE_ALSA 1 +EOF + + fi + + if [ $have_jack = "yes" ] && [ $with_jack != "no" ] ; then + LIBS="$LIBS $JACK_LIBS" + DLL_LIBS="$DLL_LIBS $JACK_LIBS" + CFLAGS="$CFLAGS $JACK_CFLAGS" + OTHER_OBJS="$OTHER_OBJS pa_jack/pa_jack.o" + cat >> confdefs.h <<\EOF +#define PA_USE_JACK 1 +EOF + + fi + + if [ $with_oss != "no" ] ; then + OTHER_OBJS="$OTHER_OBJS pa_unix_oss/pa_unix_oss.o" + cat >> confdefs.h <<\EOF +#define PA_USE_OSS 1 +EOF + + fi + LIBS="$LIBS -lm -lpthread"; + PADLL="libportaudio.so"; + SHARED_FLAGS="-shared -fPIC"; + + OTHER_OBJS="$OTHER_OBJS pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o" +esac + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@CC@%$CC%g +s%@RANLIB@%$RANLIB%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@AR@%$AR%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@PKG_CONFIG@%$PKG_CONFIG%g +s%@JACK_CFLAGS@%$JACK_CFLAGS%g +s%@JACK_LIBS@%$JACK_LIBS%g +s%@OTHER_OBJS@%$OTHER_OBJS%g +s%@PADLL@%$PADLL%g +s%@SHARED_FLAGS@%$SHARED_FLAGS%g +s%@DLL_LIBS@%$DLL_LIBS%g +s%@NASM@%$NASM%g +s%@NASMOPT@%$NASMOPT%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/portaudio-v19/configure.in b/portaudio-v19/configure.in new file mode 100644 index 000000000..640f87800 --- /dev/null +++ b/portaudio-v19/configure.in @@ -0,0 +1,250 @@ +dnl +dnl portaudio V19 configure.in script +dnl +dnl Dominic Mazzoni, Arve Knudsen +dnl + +dnl Require autoconf >= 2.13 +AC_PREREQ(2.13) + +dnl Init autoconf and make sure configure is being called +dnl from the right directory +AC_INIT([pa_common/portaudio.h]) + +dnl Specify options + +AC_ARG_WITH(alsa, + [ --with-alsa (default=yes)], + with_alsa=$withval, with_alsa="yes") + +AC_ARG_WITH(jack, + [ --with-jack (default=yes)], + with_jack=$withval, with_jack="yes") + +AC_ARG_WITH(oss, + [ --with-oss (default=yes)], + with_oss=$withval, with_oss="yes") + +AC_ARG_WITH(host_os, + [ --with-host_os (no default)], + host_os=$withval) + +AC_ARG_WITH(winapi, + [ --with-winapi ((wmme/directx/asio) default=wmme)], + with_winapi=$withval, with_winapi="wmme") + +dnl Mac API added for ASIO, can have other api's listed +AC_ARG_WITH(macapi, + [ --with-macapi ((asio/core/sm) default=core)], + with_macapi=$withval, with_macapi="core") + +AC_ARG_WITH(asiodir, + [ --with-asiodir (default=/usr/local/asiosdk2)], + with_asiodir=$withval, with_asiodir="/usr/local/asiosdk2") + +AC_ARG_WITH(dxdir, + [ --with-dxdir (default=/usr/local/dx7sdk)], + with_dxdir=$withval, with_dxdir="/usr/local/dx7sdk") + + +dnl Checks for programs. + +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_INSTALL +AC_PATH_PROG(AR, ar, no) +if [[ $AR = "no" ]] ; then + AC_MSG_ERROR("Could not find ar - needed to create a library"); +fi + +dnl This must be one of the first tests we do or it will fail... +AC_C_BIGENDIAN + +dnl checks for various host APIs and arguments to configure that +dnl turn them on or off + +AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) + +dnl Determine the host description for the subsequent test. +dnl PKG_CHECK_MODULES seems to check and set the host variable also, but +dnl that then requires pkg-config availability which is not standard on +dnl MinGW systems and can be a pain to install. +AC_CANONICAL_HOST + +PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) + +dnl sizeof checks: we will need a 16-bit and a 32-bit type + +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) + +dnl extra variables +AC_SUBST(OTHER_OBJS) +AC_SUBST(PADLL) +AC_SUBST(SHARED_FLAGS) +AC_SUBST(DLL_LIBS) +AC_SUBST(CXXFLAGS) +AC_SUBST(NASM) +AC_SUBST(NASMOPT) + +CFLAGS="-g -O2 -Wall -pedantic -pipe -fPIC" + +if [[ $ac_cv_c_bigendian = "yes" ]] ; then + CFLAGS="$CFLAGS -DPA_BIG_ENDIAN" +else + CFLAGS="$CFLAGS -DPA_LITTLE_ENDIAN" +fi + +case "${host_os}" in + darwin* ) + dnl Mac OS X configuration + + AC_DEFINE(PA_USE_COREAUDIO) + OTHER_OBJS="pa_mac/pa_mac_hostapis.o pa_unix/pa_unix_util.o pa_mac_core/pa_mac_core.o"; + LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"; + PADLL="libportaudio.dylib"; + SHARED_FLAGS="-framework CoreAudio -framework AudioToolbox -framework -framework AudioUnit -framework Carbon -dynamiclib"; + if [[ $with_macapi = "asio" ]] ; then + if [[ $with_asiodir ]] ; then + ASIODIR="$with_asiodir"; + else + ASIODIR="/usr/local/asiosdk2"; + fi + echo "ASIODIR: $ASIODIR"; + + OTHER_OBJS="$CFLAGS pa_asio/iasiothiscallresolver.o $ASIODIR/host/asiodrivers.o $ASIODIR/common/asio.o $ASIODIR/host/mac/asioshlib.o"; + CFLAGS="$CFLAGS -Ipa_asio -I$ASIDIR/host/mac -I$ASIODIR/common"; + CXXFLAGS="$CFLAGS"; + fi + ;; + + mingw* ) + dnl MingW configuration + + echo "WINAPI: $with_winapi" + if [[ $with_winapi = "directx" ]] ; then + if [[ $with_dxdir ]] ; then + DXDIR="$with_dxdir"; + else + DXDIR="/usr/local/dx7sdk"; + fi + echo "DXDIR: $DXDIR" + OTHER_OBJS="pa_win_ds/pa_win_ds.o pa_win_ds/dsound_wrapper.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + LIBS="-lwinmm -lm -ldsound -lole32"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -ldsound -lole32"; + #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""; + #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"; + CFLAGS="$CFLAGS -Ipa_common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO" -DPA_NO_WDMKS; + elif [[ $with_winapi = "asio" ]] ; then + if [[ $with_asiodir ]] ; then + ASIODIR="$with_asiodir"; + else + ASIODIR="/usr/local/asiosdk2"; + fi + echo "ASIODIR: $ASIODIR" + + OTHER_OBJS="pa_asio/pa_asio.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o pa_asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o"; + LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -Ipa_common -Ipa_asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS"; + CXXFLAGS="$CFLAGS"; + elif [[ $with_winapi = "wdmks" ]] ; then + if [[ $with_dxdir ]] ; then + DXDIR="$with_dxdir"; + else + DXDIR="/usr/local/dx7sdk"; + fi + echo "DXDIR: $DXDIR" + OTHER_OBJS="pa_win_wdmks/pa_win_wdmks.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + LIBS="-lwinmm -lm -luuid -lsetupapi -lole32"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -luuid -lsetupapi -lole32"; + #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""; + #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"; + CFLAGS="$CFLAGS -Ipa_common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO"; + else # WMME default + OTHER_OBJS="pa_win_wmme/pa_win_wmme.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm"; + CFLAGS="$CFLAGS -Ipa_common -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS"; + fi + ;; + + cygwin* ) + dnl Cygwin configuration + + OTHER_OBJS="pa_win_wmme/pa_win_wmme.o"; + LIBS="-lwinmm -lm"; + PADLL="portaudio.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm"; + ;; + + irix* ) + dnl SGI IRIX audio library (AL) configuration (Pieter, oct 2-13, 2003). + dnl The 'dmedia' library is needed to read the Unadjusted System Time (UST). + dnl + AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([IRIX posix thread library not found!])) + AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR([IRIX audio library not found!])) + AC_CHECK_LIB(dmedia, dmGetUST, , AC_MSG_ERROR([IRIX digital media library not found!])) + + dnl See the '#ifdef PA_USE_SGI' in file pa_unix/pa_unix_hostapis.c + dnl which selects the appropriate PaXXX_Initialize() function. + dnl + AC_DEFINE(PA_USE_SGI) + + dnl The _REENTRANT option for pthread safety. Perhaps not necessary but it 'll do no harm. + dnl + CFLAGS="$CFLAGS -D_REENTRANT" + + OTHER_OBJS="pa_sgi/pa_sgi.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o"; + + dnl SGI books say -lpthread should be the last of the libs mentioned. + dnl + LIBS="-lm -ldmedia -laudio -lpthread"; + PADLL="libportaudio.so"; + SHARED_FLAGS="-shared"; + ;; + + *) + dnl Unix configuration + + AC_CHECK_LIB(pthread, pthread_create, + , + AC_MSG_ERROR([libpthread not found!])) + + if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then + LIBS="$LIBS -lasound" + DLL_LIBS="$DLL_LIBS -lasound" + OTHER_OBJS="$OTHER_OBJS pa_linux_alsa/pa_linux_alsa.o" + AC_DEFINE(PA_USE_ALSA) + fi + + if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then + LIBS="$LIBS $JACK_LIBS" + DLL_LIBS="$DLL_LIBS $JACK_LIBS" + CFLAGS="$CFLAGS $JACK_CFLAGS" + OTHER_OBJS="$OTHER_OBJS pa_jack/pa_jack.o" + AC_DEFINE(PA_USE_JACK) + fi + + if [[ $with_oss != "no" ]] ; then + OTHER_OBJS="$OTHER_OBJS pa_unix_oss/pa_unix_oss.o" + AC_DEFINE(PA_USE_OSS) + fi + LIBS="$LIBS -lm -lpthread"; + PADLL="libportaudio.so"; + SHARED_FLAGS="-shared -fPIC"; + + OTHER_OBJS="$OTHER_OBJS pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o" +esac + +AC_OUTPUT([Makefile]) diff --git a/portaudio-v19/docs/index.html b/portaudio-v19/docs/index.html new file mode 100644 index 000000000..7d9b248d3 --- /dev/null +++ b/portaudio-v19/docs/index.html @@ -0,0 +1,60 @@ + + + + + + + + + PortAudio Docs + + +  +
+ + + +
+
+

+PortAudio Documentation

+
+ +

Copyright 2000 Phil Burk and Ross Bencina +
  +

+API Reference

+ +
The Application Programmer Interface is documented in "portaudio.h".
+ +

+Tutorial

+ +
Describes how to write audio programs using the PortAudio API.
+ +

+Implementation Guide

+ +
Describes how to write an implementation of PortAudio for a +new computer platform.
+ +

+Paper Presented at ICMC2001 (PDF)

+ +
Describes the PortAudio API and discusses implementation issues. +Written July 2001.
+ +

+Improving Latency

+ +
How to tune your computer to achieve the lowest possible audio +delay.
+ +

+Proposed Changes

+ +
Describes API changes being considered by the developer community. +Feedback welcome.
+Return to PortAudio Home Page + + diff --git a/portaudio-v19/docs/latency.html b/portaudio-v19/docs/latency.html new file mode 100644 index 000000000..87f1d1222 --- /dev/null +++ b/portaudio-v19/docs/latency.html @@ -0,0 +1,192 @@ + + + + + + + + + PortAudio Implementation - Start/Stop + + +  +
+ + + +
+
+

+PortAudio Latency

+
+ +

This page discusses the issues of audio latency for PortAudio +. It offers suggestions on how to lower latency to improve the responsiveness +of applications. +

What is Latency? +
PortAudio and Latency +
Macintosh +
Unix +
WIndows
+By Phil Burk, Copyright 2002 Phil Burk and Ross Bencina +

+What is Latency?

+Latency is basically longest time that you have to wait before you obtain +a desired result. For digital audio output it is the time between making +a sound in software and finally hearing it. +

Consider the example of pressing a key on the ASCII keyboard to play +a note. There are several stages in this process which each contribute +their own latency. First the operating system must respond to the keypress. +Then the audio signal generated must work its way through the PortAudio +buffers. Then it must work its way through the audio card hardware. Then +it must go through the audio amplifier which is very quick and then travel +through the air. Sound travels at abous one foot per millisecond through +air so placing speakers across the room can add 5-20 msec of delay. +

The reverse process occurs when recording or responding to audio input. +If you are processing audio, for example if you implement a software guitar +fuzz box, then you have both the audio input and audio output latencies +added together. +

The audio buffers are used to prevent glitches in the audio stream. +The user software writes audio into the output buffers. That audio is read +by the low level audio driver or by DMA and sent to the DAC. If the computer +gets busy doing something like reading the disk or redrawing the screen, +then it may not have time to fill the audio buffer. The audio hardware +then runs out of audio data, which causes a glitch. By using a large enough +buffer we can ensure that there is always enough audio data for the audio +hardware to play. But if the buffer is too large then the latency is high +and the system feels sluggish. If you play notes on the keyboard then the +"instrument" will feel unresponsive. So you want the buffers to be as small +as possible without glitching. +

+PortAudio and Latency

+The only delay that PortAudio can control is the total length of its buffers. +The Pa_OpenStream() call takes two parameters: numBuffers and framesPerBuffer. +The latency is also affected by the sample rate which we will call framesPerSecond. +A frame is a set of samples that occur simultaneously. For a stereo stream, +a frame is two samples. +

The latency in milliseconds due to this buffering  is: +

latency_msec = 1000 * numBuffers * framesPerBuffer / framesPerSecond
+This is not the total latency, as we have seen, but it is the part we can +control. +

If you call Pa_OpenStream() with numBuffers equal to zero, then PortAudio +will select a conservative number that will prevent audio glitches. If +you still get glitches, then you can pass a larger value for numBuffers +until the glitching stops. if you try to pass a numBuffers value that is +too small, then PortAudio will use its own idea of the minimum value. +

PortAudio decides on the minimum number of buffers in a conservative +way based on the frameRate, operating system and other variables. You can +query the value that PortAudio will use by calling: +

int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate +);
+On some systems you can override the PortAudio minimum if you know your +system can handle a lower value. You do this by setting an environment +variable called PA_MIN_LATENCY_MSEC which is read by PortAudio when it +starts up. This is supported on the PortAudio implementations for Windows +MME, Windows DirectSound, and Unix OSS. +

+Macintosh

+The best thing you can do to improve latency on Mac OS 8 and 9 is to turn +off Virtual Memory. PortAudio V18 will detect that Virtual Memory is turned +off and use a very low latency. +

For Mac OS X the latency is very low because Apple Core Audio is so +well written. You can set the PA_MIN_LATENCY_MSEC variable using: +

setenv PA_MIN_LATENCY_MSEC 4
+ +

+Unix

+PortAudio under Unix currently uses a backgroud thread that reads and writes +to OSS. This gives you decent but not great latency. But if you raise the +priority of the background thread to a very priority then you can get under +10 milliseconds latency. In order to raise your priority you must run the +PortAudio program as root! You must also set PA_MIN_LATENCY_MSEC using +the appropriate command for your shell. +

+Windows

+Latency under Windows is a complex issue because of all the alternative +operating system versions and device drivers. I have seen latency range +from 8 milliseconds to 400 milliseconds. The worst case is when using Windows +NT. Windows 98 is a little better, and Windows XP can be quite good if +properly tuned. +

The underlying audio API also makes a lot of difference. If the audio +device has its own DirectSound driver then DirectSound can often provide +better latency than WMME. But if a real DirectSound driver is not available +for your device then it is emulated using WMME and the latency can be very +high. That's where I saw the 400 millisecond latency. The ASIO implementation +is generally very good and will give the lowest latency if available. +

You can set the PA_MIN_LATENCY_MSEC variable to 50, for example, by +entering in MS-DOS: +

set PA_MIN_LATENCY_MSEC=50
+If you enter this in a DOS window then you must run the PortAudio program +from that same window for the variable to have an effect. You can add that +line to your C:\AUTOEXEC.BAT file and reboot if you want it to affect any +PortAudio based program. +

For Windows XP, you can set environment variables as follows: +

    +
  1. +Select "Control Panel" from the "Start Menu".
  2. + +
  3. +Launch the "System" Control Panel
  4. + +
  5. +Click on the "Advanced" tab.
  6. + +
  7. +Click on the "Environment Variables" button.
  8. + +
  9. +Click "New" button under  User Variables.
  10. + +
  11. +Enter PA_MIN_LATENCY_MSEC for the name and some optimistic number for the +value.
  12. + +
  13. +Click OK, OK, OK.
  14. +
+ +

+Improving Latency on Windows

+There are several steps you can take to improve latency under windows. +
    +
  1. +Avoid reading or writng to disk when doing audio.
  2. + +
  3. +Turn off all automated background tasks such as email clients, virus scanners, +backup programs, FTP servers, web servers, etc. when doing audio.
  4. + +
  5. +Disconnect from the network to prevent network traffic from interrupting +your CPU.
  6. +
+Important: Windows XP users can also tune the OS to favor background +tasks, such as audio, over foreground tasks, such as word processing. I +lowered my latency from 40 to 10 milliseconds using this simple technique. +
    +
  1. +Select "Control Panel" from the "Start Menu".
  2. + +
  3. +Launch the "System" Control Panel
  4. + +
  5. +Click on the "Advanced" tab.
  6. + +
  7. +Click on the "Settings" button in the Performance area.
  8. + +
  9. +Click on the "Advanced" tab.
  10. + +
  11. +Select "Background services" in the Processor Scheduling area.
  12. + +
  13. +Click OK, OK.
  14. +
+Please let us know if you have others sugestions for lowering latency. +
  +
  + + diff --git a/portaudio-v19/docs/pa_impl_guide.html b/portaudio-v19/docs/pa_impl_guide.html new file mode 100644 index 000000000..50abc3045 --- /dev/null +++ b/portaudio-v19/docs/pa_impl_guide.html @@ -0,0 +1,197 @@ + + + + + + + + + PortAudio Implementation - Start/Stop + + +  +
+ + + +
+
+

+PortAudio Implementation Guide

+
+ +

This document describes how to implement the PortAudio API on a new +computer platform. Implementing PortAudio on a new platform, makes it possible +to port many existing audio applications to that platform. +

By Phil Burk +
Copyright 2000 Phil Burk and Ross Bencina +

Note that the license says: "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.". +So when you have finished a new implementation, please send it back to +us at  "http://www.portaudio.com" +so that we can make it available for other users. Thank you! +

+Download the Latest PortAudio Implementation

+Always start with the latest implementation available at "http://www.portaudio.com". +Look for the nightly snapshot under the CVS section. +

+Select an Existing Implementation as a Basis

+The fastest way to get started is to take an existing implementation and +translate it for your new platform. Choose an implementation whose architecture +is as close as possible to your target. +
    +
  • +DirectSound Implementation - pa_win_ds - Uses a timer callback for the +background "thread". Polls a circular buffer and writes blocks of data +to keep it full.
  • + +
  • +Windows MME - pa_win_wmme - Spawns an actual Win32 thread. Writes blocks +of data to the HW device and waits for events that signal buffer completion.
  • + +
  • +Linux OSS - pa_linux - Spawns a real thread that writes to the "/dev/dsp" +stream using blocking I/O calls.
  • +
+When you write a new implementation, you will be using some code that is +in common with all implementations. This code is in the folder "pa_common". +It provides various functions such as parameter checking, error code to +text conversion, sample format conversion, clipping and dithering, etc. +

The code that you write will go into a separate folder called "pa_{os}_{api}". +For example, code specific to the DirectSound interface for Windows goes +in "pa_win_ds". +

+Read Docs and Code

+Famialiarize yourself with the system by reading the documentation provided. +here is a suggested order: +
    +
  1. +User Programming Tutorial
  2. + +
  3. +Header file "pa_common/portaudio.h" which defines API.
  4. + +
  5. +Header file "pa_common/pa_host.h" for host dependant code. This definces +the routine you will need to provide.
  6. + +
  7. +Shared code in "pa_common/pa_lib.c".
  8. + +
  9. +Docs on Implementation of Start/Stop +code.
  10. +
+ +

+Implement  Output to Default Device

+Now we are ready to crank some code. For instant gratification, let's try +to play a sine wave. +
    +
  1. +Link the test program "pa_tests/patest_sine.c" with the file "pa_lib.c" +and the implementation specific file you are creating.
  2. + +
  3. +For now, just stub out the device query code and the audio input code.
  4. + +
  5. +Modify PaHost_OpenStream() to open your default target device and get everything +setup.
  6. + +
  7. +Modify PaHost_StartOutput() to start playing audio.
  8. + +
  9. +Modify PaHost_StopOutput() to stop audio.
  10. + +
  11. +Modify PaHost_CloseStream() to clean up. Free all memory that you allocated +in PaHost_OpenStream().
  12. + +
  13. +Keep cranking until you can play a sine wave using "patest_sine.c".
  14. + +
  15. +Once that works, try "patest_pink.c", "patest_clip.c", "patest_sine8.c".
  16. + +
  17. +To test your Open and Close code, try "patest_many.c".
  18. + +
  19. +Now test to make sure that the three modes of stopping are properly supported +by running "patest_stop.c".
  20. + +
  21. +Test your implementation of time stamping with "patest_sync.c".
  22. +
+ +

+Implement Device Queries

+Now that output is working, lets implement the code for querying what devices +are available to the user. Run "pa_tests/pa_devs.c". It should print all +of the devices available and their characteristics. +

+Implement Input

+Implement audio input and test it with: +
    +
  1. +patest_record.c - record in half duplex, play back as recorded.
  2. + +
  3. +patest_wire.c - full duplex, copies input to output. Note that some HW +may not support full duplex.
  4. + +
  5. +patest_fuzz.c - plug in your guitar and get a feel for why latency is an +important issue in computer music.
  6. + +
  7. +paqa_devs.c - try to open every device and use it with every possible format
  8. +
+ +

+Debugging Tools

+You generally cannot use printf() calls to debug real-time processes because +they disturb the timing. Also calling printf() from your background thread +or interrupt could crash the machine. So PA includes a tool for capturing +events and storing the information while it is running. It then prints +the events when Pa_Terminate() is called. +
    +
  1. +To enable trace mode, change TRACE_REALTIME_EVENTS in "pa_common/pa_trace.h" +from a (0) to a (1).
  2. + +
  3. +Link with "pa_common/pa_trace.c".
  4. + +
  5. +Add trace messages to your code by calling:
  6. + +
       void AddTraceMessage( char *msg, int data ); +
    for example +
       AddTraceMessage("Pa_TimeSlice: past_NumCallbacks ", +past->past_NumCallbacks ); +
  7. +Run your program. You will get a dump of events at the end.
  8. + +
  9. +You can leave the trace messages in your code. They will turn to NOOPs +when you change TRACE_REALTIME_EVENTS back to (0).
  10. +
+ +

+Delivery

+Please send your new code along with notes on the implementation back to +us at "http://www.portaudio.com". +We will review the implementation and post it with your name. If you had +to make any modifications to the code in "pa_common" or "pa_tests" please +send us those modifications and your notes. We will try to merge your changes +so that the "pa_common" code works with all implementations. +

If you have suggestions for how to make future implementations easier, +please let us know. +
THANKS! +
  + + diff --git a/portaudio-v19/docs/pa_impl_startstop.html b/portaudio-v19/docs/pa_impl_startstop.html new file mode 100644 index 000000000..0f2d0ce51 --- /dev/null +++ b/portaudio-v19/docs/pa_impl_startstop.html @@ -0,0 +1,190 @@ + + + + + + + + + PortAudio Implementation - Start/Stop + + +  +

+ + + +
+
+

+PortAudio Implementation

+
+ +

+Starting and Stopping Streams

+PortAudio is generally executed in two "threads". The foreground thread +is the application thread. The background "thread" may be implemented as +an actual thread, an interrupt handler, or a callback from a timer thread. +

There are three ways that PortAudio can stop a stream. In each case +we look at the sequence of events and the messages sent between the two +threads. The following variables are contained in the internalPortAudioStream. +

int   past_IsActive;     +/* Background is still playing. */ +
int   past_StopSoon;     /* Stop +when last buffer done. */ +
int   past_StopNow;      /* +Stop IMMEDIATELY. */
+ +

+Pa_AbortStream()

+This function causes the background thread to terminate as soon as possible +and audio I/O to stop abruptly. +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Foreground ThreadBackground Thread
sets StopNow
sees StopNow
clears IsActive, stops thread
waits for thread to exit
turns off audio I/O
+ +

+Pa_StopStream()

+This function stops the user callback function from being called and then +waits for all audio data written to the output buffer to be played. In +a system with very low latency, you may not hear any difference between +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Foreground ThreadBackground Thread
sets StopSoon
stops calling user callback
continues until output buffer empty
clears IsActive, stops thread
waits for thread to exit
turns off audio I/O
+ +

+User callback returns one.

+If the user callback returns one then the user callback function will no +longer be called. Audio output will continue until all audio data written +to the output buffer has been played. Then the audio I/O is stopped, the +background thread terminates, and the stream becomes inactive. +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Foreground ThreadBackground Thread
callback returns 1
sets StopSoon
stops calling user callback
continues until output buffer empty
clears IsActive, stops thread
waits for thread to exit
turns off audio I/O
+ +
  + + diff --git a/portaudio-v19/docs/pa_tut_asio.html b/portaudio-v19/docs/pa_tut_asio.html new file mode 100644 index 000000000..1c3e5bfa4 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_asio.html @@ -0,0 +1,55 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Compiling for ASIO (Windows or Macintosh)

+ +
ASIO is a low latency audio API from Steinberg. To compile +an ASIO application, you must first download +the ASIO SDK from Steinberg. You also need to obtain ASIO drivers for +your audio device. +

Note: I am using '/' as a file separator below. On Macintosh replace +'/' with ':'. On Windows, replace '/' with '\'. +

 To use ASIO with the PortAudio library add the following source +files to your project: +

+
pa_asio/pa_asio.cpp
+
+and also these files from the ASIO SDK: +
+
common/asio.cpp
+host/asiodrivers.cpp
+host/asiolist.cpp
+
+and add these directories to the path for include files +
+
asiosdk2/host/pc   (for Windows)
+asiosdk2/common
+asiosdk2/host
+
+You may try compiling the "pa_tests/patest_saw.c" file first because it +is the simplest.
+home | +contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_callback.html b/portaudio-v19/docs/pa_tut_callback.html new file mode 100644 index 000000000..f5ccaf0f1 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_callback.html @@ -0,0 +1,91 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Writing a Callback Function

+ +
To write a program using PortAudio, you must include the "portaudio.h" +include file. You may wish to read "portaudio.h" +because it contains a complete description of the PortAudio functions and +constants. +
+
#include "portaudio.h"
+
+The next task is to write your custom callback function. It is a function +that is called by the PortAudio engine whenever it has captured audio data, +or when it needs more audio data for output. +

Your callback function is often called by an interrupt, or low level +process so you should not do any complex system activities like allocating +memory, or reading or writing files, or printf(). Just crunch numbers and +generate audio signals. What is safe or not safe will vary from platform +to platform. On the Macintosh, for example, you can only call "interrupt +safe" routines. Also do not call any PortAudio functions in the callback +except for Pa_StreamTime() and Pa_GetCPULoad(). +

Your callback function must return an int and accept the exact parameters +specified in this typedef: +

+
typedef int (PortAudioCallback)(
+               void *inputBuffer, void *outputBuffer,
+               unsigned long framesPerBuffer,
+               PaTimestamp outTime, void *userData );
+
+Here is an example callback function from the test file "patests/patest_saw.c". +It calculates a simple left and right sawtooth signal and writes it to +the output buffer. Notice that in this example, the signals are of float +data type. The signals must be between -1.0 and +1.0. You can also use +16 bit integers or other formats which are specified during setup. You +can pass a pointer to your data structure through PortAudio which will +appear as userData. +
+
int patestCallback(  void *inputBuffer, void *outputBuffer,
+                     unsigned long framesPerBuffer,
+                     PaTimestamp outTime, void *userData )
+{
+    unsigned int i;
+/* Cast data passed through stream to our structure type. */
+    paTestData *data = (paTestData*)userData;
+    float *out = (float*)outputBuffer;
+        
+    for( i=0; i<framesPerBuffer; i++ )
+    {
+    /* Stereo channels are interleaved. */
+        *out++ = data->left_phase;              /* left */
+        *out++ = data->right_phase;             /* right */
+
+    /* Generate simple sawtooth phaser that ranges between -1.0 and 1.0. */
+        data->left_phase += 0.01f;
+    /* When signal reaches top, drop back down. */
+        if( data->left_phase >= 1.0f ) data->left_phase -= 2.0f;
+
+    /* higher pitch so we can distinguish left and right. */
+        data->right_phase += 0.03f; 
+        if( data->right_phase >= 1.0f ) data->right_phase -= 2.0f;
+    }
+    return 0;
+}
+
+
+home | +contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_devs.html b/portaudio-v19/docs/pa_tut_devs.html new file mode 100644 index 000000000..1756992cb --- /dev/null +++ b/portaudio-v19/docs/pa_tut_devs.html @@ -0,0 +1,65 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Querying for Available Devices

+ +
There are often several different audio devices available in +a computer with different capabilities. They can differ in the sample rates +supported, bit widths, etc. PortAudio provides a simple way to query for +the available devices, and then pass the selected device to Pa_OpenStream(). +For an example, see the file "pa_tests/pa_devs.c". +

To determine the number of devices: +

+
numDevices = Pa_CountDevices();
+
+You can then query each device in turn by calling Pa_GetDeviceInfo() with +an index. +
+
for( i=0; i<numDevices; i++ ) {
+     pdi = Pa_GetDeviceInfo( i );
+
+It will return a pointer to a PaDeviceInfo structure which is +defined as: +
+
typedef struct{
+    int structVersion; 
+    const char *name;
+    int maxInputChannels;
+    int maxOutputChannels;
+/* Number of discrete rates, or -1 if range supported. */
+    int numSampleRates;
+/* Array of supported sample rates, or {min,max} if range supported. */
+    const double *sampleRates;
+    PaSampleFormat nativeSampleFormat;
+}PaDeviceInfo;
+
+If the device supports a continuous range of sample rates, then numSampleRates +will equal -1, and the sampleRates array will have two values, the minimum  +and maximum rate. +

The device information is allocated by Pa_Initialize() and freed by +Pa_Terminate() so you do not have to free() the structure returned by Pa_GetDeviceInfo().

+home | +contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_explore.html b/portaudio-v19/docs/pa_tut_explore.html new file mode 100644 index 000000000..91c08a5b7 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_explore.html @@ -0,0 +1,42 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Exploring PortAudio

+ +
Now that you have a good idea of how PortAudio works, you can +try out the test programs. +
    +
  • +For an example of playing a sine wave, see "pa_tests/patest_sine.c".
  • + +
  • +For an example of recording and playing back a sound, see  "pa_tests/patest_record.c".
  • +
+I also encourage you to examine the source for the PortAudio libraries. +If you have suggestions on ways to improve them, please let us know. if +you want to implement PortAudio on a new platform, please let us know as +well so we can coordinate people's efforts.
+home | contents +| previous |  next + + diff --git a/portaudio-v19/docs/pa_tut_init.html b/portaudio-v19/docs/pa_tut_init.html new file mode 100644 index 000000000..91bfa8d98 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_init.html @@ -0,0 +1,43 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Initializing PortAudio

+ +
Before making any other calls to PortAudio, you must call Pa_Initialize(). +This will trigger a scan of available devices which can be queried later. +Like most PA functions, it will return a result of type paError. +If the result is not paNoError, then an error has occurred. +
+
err = Pa_Initialize();
+if( err != paNoError ) goto error;
+
+You can get a text message that explains the error message by passing it +to +
+
printf(  "PortAudio error: %s\n", Pa_GetErrorText( err ) );
+
+
+home | contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_mac.html b/portaudio-v19/docs/pa_tut_mac.html new file mode 100644 index 000000000..bf3dafd1a --- /dev/null +++ b/portaudio-v19/docs/pa_tut_mac.html @@ -0,0 +1,41 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Compiling for Macintosh

+ +
To compile a Macintosh application with the PortAudio library, +add the following source files to your project: +
+
pa_mac:pa_mac.c
+pa_common:pa_lib.c
+pa_common:portaudio.h
+pa_common:pa_host.h
+
+Also add the Apple SoundLib to your project. +

You may try compiling the "pa_tests:patest_saw.c" file first because +it is the simplest.

+home | +contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_mac_osx.html b/portaudio-v19/docs/pa_tut_mac_osx.html new file mode 100644 index 000000000..3af8c140f --- /dev/null +++ b/portaudio-v19/docs/pa_tut_mac_osx.html @@ -0,0 +1,46 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Compiling for Macintosh OS X

+ +
To compile a Macintosh OS X CoreAudio application with the +PortAudio library: +

Create a new ProjectBuilder project. You can use a "Tool" project to +run the PortAudio examples. +

Add the following source files to your Project: +

+
pa_mac_core/pa_mac_core.c
+pa_common/pa_lib.c
+pa_common/portaudio.h
+pa_common/pa_host.h
+pa_common/pa_convert.c
+
+Add the Apple CoreAudio.framework to your project by selecting "Add FrameWorks..." +from the Project menu. +

Compile and run the "pa_tests:patest_saw.c" file first because it is +the simplest.

+home | +contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_open.html b/portaudio-v19/docs/pa_tut_open.html new file mode 100644 index 000000000..1621ef30f --- /dev/null +++ b/portaudio-v19/docs/pa_tut_open.html @@ -0,0 +1,52 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Opening a Stream using Defaults

+ +
The next step is to open a stream which is similar to opening +a file. You can specify whether you want audio input and/or output, how +many channels, the data format, sample rate, etc. There are two calls for +opening streams, Pa_OpenStream() and Pa_OpenDefaultStream(). +

Pa_OpenStream() takes extra  parameters which give you +more control. You can normally just use Pa_OpenDefaultStream() +which just calls Pa_OpenStream() with some reasonable +default values.  Let's open a stream for stereo output, using floating +point data, at 44100 Hz. +

+
err = Pa_OpenDefaultStream(
+    &stream,        /* passes back stream pointer */
+    0,              /* no input channels */
+    2,              /* stereo output */
+    paFloat32,      /* 32 bit floating point output */
+    44100,          /* sample rate */
+    256,            /* frames per buffer */
+    0,              /* number of buffers, if zero then use default minimum */
+    patestCallback, /* specify our custom callback */
+    &data );        /* pass our data through to callback */
+
+If you want to use 16 bit integer data, pass paInt16 instead of +paFloat32.
+home | contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_oss.html b/portaudio-v19/docs/pa_tut_oss.html new file mode 100644 index 000000000..1bb76f259 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_oss.html @@ -0,0 +1,46 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Compiling for Unix OSS

+ +
[Skip this page if you are not using Unix and OSS] +

We currently support the OSS +audio drivers for Linux, Solaris, and FreeBSD. We hope to someday support +the newer ALSA drivers. +

    +
  1. +cd to pa_unix_oss directory
  2. + +
  3. +Edit the Makefile and uncomment one of the tests. You may try compiling +the "patest_sine.c" file first because it is very simple.
  4. + +
  5. +gmake run
  6. +
+
+home | +contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_over.html b/portaudio-v19/docs/pa_tut_over.html new file mode 100644 index 000000000..baa99205b --- /dev/null +++ b/portaudio-v19/docs/pa_tut_over.html @@ -0,0 +1,92 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Overview of PortAudio

+ +
PortAudio is a library that provides streaming audio input +and output. It is a cross-platform API (Application Programming Interface) +that works on Windows, Macintosh, Unix running OSS, SGI, BeOS, and perhaps +other platforms by the time you read this. This means that you can write +a simple 'C' program to process or generate an audio signal, and that program +can run on several different types of computer just by recompiling the +source code. +

Here are the steps to writing a PortAudio application: +

    +
  1. +Write a callback function that will be called by PortAudio when audio processing +is needed.
  2. + +
  3. +Initialize the PA library and open a stream for audio I/O.
  4. + +
  5. +Start the stream. Your callback function will be now be called repeatedly +by PA in the background.
  6. + +
  7. +In your callback you can read audio data from the inputBuffer and/or write +data to the outputBuffer.
  8. + +
  9. +Stop the stream by returning 1 from your callback, or by calling a stop +function.
  10. + +
  11. +Close the stream and terminate the library.
  12. +
+
+ +
There is also another interface +provided that allows you to generate audio in the foreground. You then +simply write data to the stream and the tool will not return until it is +ready to accept more data. This interface is simpler to use but is usually +not preferred for large applications because it requires that you launch +a thread to perform the synthesis. Launching a thread may be difficult +on non-multi-tasking systems such as the Macintosh prior to MacOS X. +

Let's continue by building a simple application that will play a sawtooth +wave. +

Please select the page for the specific implementation you would like +to use: +

+or continue with the next page of the programming +tutorial.
+home | +contents +| previous + + diff --git a/portaudio-v19/docs/pa_tut_pc.html b/portaudio-v19/docs/pa_tut_pc.html new file mode 100644 index 000000000..87e5f9a02 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_pc.html @@ -0,0 +1,78 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Compiling for Windows (WMME or DirectSound)

+ +
To compile PortAudio for Windows, you can choose between two +options. One implementation uses the DirectSound API. The other uses the +Windows MultiMedia Extensions API (aka WMME or WAVE). +

Some advantages of using DirectSound are that DirectSound may have lower +latency than WMME, and supports effects processing plugins. But one disadvantage +is that DirectSound is not installed on all PCs, and is not well supported +under Windows NT. So WMME is the best choice for most projects. +

For either implementation add the following source files to your project: +

+
pa_common\pa_lib.c
+pa_common\portaudio.h
+pa_common\pa_host.h
+
+Link with the system library "winmm.lib". For Visual C++: +
    +
  1. +select "Settings..." from the "Project" menu,
  2. + +
  3. +select the project name in the tree on the left,
  4. + +
  5. +choose "All Configurations" in the popup menu above the tree,
  6. + +
  7. +select the "Link" tab,
  8. + +
  9. +enter "winmm.lib", without quotes, as the first item in the "Object/library +modules:" field.
  10. +
+WMME - To use the WMME implementation, add the following source +files to your project: +
pa_win_wmme/pa_win_wmme.c
+DirectSound - If you want to use the DirectSound implementation +of PortAudio then you must have a recent copy of the free +DirectX +SDK for Developers from Microsoft installed on your computer. To compile +an application add the following source files to your project: +
+
pa_win_ds\dsound_wrapper.c
+pa_win_ds\pa_dsound.c
+
+Link with the system library "dsound.lib" using the procedure described +above for "winmm.lib".
+ +
You might try compiling the "pa_tests\patest_saw.c" file first +because it is the simplest.
+home | +contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_run.html b/portaudio-v19/docs/pa_tut_run.html new file mode 100644 index 000000000..5c70d0895 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_run.html @@ -0,0 +1,56 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Starting and Stopping a Stream

+ +
The stream will not start running until you call Pa_StartStream(). +Then it will start calling your callback function to perform the audio +processing. +
+
err = Pa_StartStream( stream );
+if( err != paNoError ) goto error;
+
+At this point, audio is being generated. You can communicate to your callback +routine through the data structure you passed in on the open call, or through +global variables, or using other interprocess communication techniques. +Please be aware that your callback function may be called at interrupt +time when your foreground process is least expecting it. So avoid sharing +complex data structures that are easily corrupted like double linked lists. +

In many of the tests we simply sleep for a few seconds so we can hear +the sound. This is easy to do with Pa_Sleep() which will sleep for some +number of milliseconds. Do not rely on this function for accurate scheduling. +it is mostly for writing examples. +

+
/* Sleep for several seconds. */
+Pa_Sleep(NUM_SECONDS*1000);
+
+When you are through, you can stop the stream from the foreground. +
+
err = Pa_StopStream( stream );
+if( err != paNoError ) goto error;
+
+You can also stop the stream by returning 1 from your custom callback function.
+home | contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_rw.html b/portaudio-v19/docs/pa_tut_rw.html new file mode 100644 index 000000000..93c7b8bb3 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_rw.html @@ -0,0 +1,79 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Blocking Read/Write Functions

+ +
[Note: These functions are not part of the official PortAudio +API. They are simply built on top of PortAudio as an extra utility. Also +note that they are under evaluation and their definition may change.] +

There are two fundamentally different ways to design an audio API. One +is to use callback functions the way we have already shown. The callback +function operates under an interrupt or background thread This leaves the +foreground application free to do other things while the audio just runs +in the background. But this can sometimes be awkward. +

So we have provided an alternative technique that lets a program generate +audio in the foreground and then just write it to the audio stream as if +it was a file. If there is not enough room in the audio buffer for more +data, then the write function will just block until more room is available. +This can make it very easy to write an audio example. To use this tool, +you must add the files "pablio/pablio.c" and "pablio/ringbuffer.c" to your +project. You must also: +

+
#include "pablio.h"
+
+Here is a short excerpt of a program that opens a stream for input and +output. It then reads a block of samples from input, and writes them to +output, in a loop.  The complete example can be found in "pablio/test_rw.c". +
+
    #define SAMPLES_PER_FRAME     (2)
+    #define FRAMES_PER_BLOCK    (1024)
+    SAMPLE          samples[SAMPLES_PER_FRAME * FRAMES_PER_BLOCK];
+    PaError         err;
+    PABLIO_Stream  *aStream;
+
+/* Open simplified blocking I/O layer on top of PortAudio. */
+    err = OpenAudioStream( &rwbl, SAMPLE_RATE, paFloat32,
+                         (PABLIO_READ_WRITE | PABLIO_STEREO) );
+    if( err != paNoError ) goto error;
+
+/* Process samples in the foreground. */
+    for( i=0; i<(NUM_SECONDS * SAMPLE_RATE); i++ )
+    {
+    /* Read one block of data into sample array from audio input. */
+        ReadAudioStream( aStream, samples, FRAMES_PER_BLOCK );
+    /*
+    ** At this point you could process the data in samples array,
+    ** and write the result back to the same samples array.
+    */
+    /* Write that same frame of data to output. */
+        WriteAudioStream( aStream, samples, FRAMES_PER_BLOCK );
+    }
+
+    CloseAudioStream( aStream );
+
+
+home | +contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_term.html b/portaudio-v19/docs/pa_tut_term.html new file mode 100644 index 000000000..1c72209f1 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_term.html @@ -0,0 +1,47 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Terminating PortAudio

+ +
You can start and stop a stream as many times as you like. +But when you are done using it, you should close it by calling:
+ +
+
+
err = Pa_CloseStream( stream );
+if( err != paNoError ) goto error;
+
+Then when you are done using PortAudio, you should terminate the whole +system by calling: +
+
Pa_Terminate();
+
+That's basically it. You can now write an audio program in 'C' that will +run on multiple platforms, for example PCs and Macintosh. +

In the rest of the tutorial we will look at some additional utility +functions, and a different way of using PortAudio that does not require +the use of a callback function.

+home | contents +| previousnext + + diff --git a/portaudio-v19/docs/pa_tut_util.html b/portaudio-v19/docs/pa_tut_util.html new file mode 100644 index 000000000..f4b547501 --- /dev/null +++ b/portaudio-v19/docs/pa_tut_util.html @@ -0,0 +1,55 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Utility Functions

+ +
Here are several more functions that are not critical, but +may be handy when using PortAudio. +

Pa_StreamActive() returns one when the stream in playing audio, zero +when not playing, or a negative error number if the stream is invalid. +The stream is active between calls to Pa_StartStream() and Pa_StopStream(), +but may also become inactive if the callback returns a non-zero value. +In the latter case, the stream is considered inactive after the last buffer +has finished playing. +

+
PaError Pa_StreamActive( PortAudioStream *stream );
+
+Pa_StreamTime() returns the number of samples that have been generated. +PaTimeStamp is a double precision number which is a convenient way to pass +big numbers around even though we only need integers. +
+
PaTimestamp Pa_StreamTime( PortAudioStream *stream );
+
+The "CPU Load" is a fraction of total CPU time consumed by the stream's +audio processing. A value of 0.5 would imply that PortAudio and the sound +generating callback was consuming roughly 50% of the available CPU time. +This function may be called from the callback function or the application. +
+
double Pa_GetCPULoad( PortAudioStream* stream );
+
+
+home | +contents | previous +|  next + + diff --git a/portaudio-v19/docs/pa_tutorial.html b/portaudio-v19/docs/pa_tutorial.html new file mode 100644 index 000000000..1371c44f0 --- /dev/null +++ b/portaudio-v19/docs/pa_tutorial.html @@ -0,0 +1,46 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

Copyright 2000 Phil Burk and Ross Bencina +

+Table of Contents

+ +
Overview of PortAudio +
Compiling for Macintosh OS 7,8,9 +
Compiling for Macintosh OS X +
Compiling for Windows (DirectSound and WMME) +
Compiling for ASIO on Windows or Mac OS +8,9 +
Compiling for Unix OSS +
Writing a Callback Function +
Initializing PortAudio +
Opening a Stream using Defaults +
Starting and Stopping a Stream +
Cleaning Up +
Utilities +
Querying for Devices +
Blocking Read/Write Functions +
Exploring the PortAudio Package
+home | contents | +previous |  next + + diff --git a/portaudio-v19/docs/portaudio_h.txt b/portaudio-v19/docs/portaudio_h.txt new file mode 100644 index 000000000..6d60086fc --- /dev/null +++ b/portaudio-v19/docs/portaudio_h.txt @@ -0,0 +1,425 @@ +#ifndef PORT_AUDIO_H +#define PORT_AUDIO_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * PortAudio Portable Real-Time Audio Library + * PortAudio API Header File + * Latest version available at: http://www.audiomulch.com/portaudio/ + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +typedef int PaError; +typedef enum { + paNoError = 0, + + paHostError = -10000, + paInvalidChannelCount, + paInvalidSampleRate, + paInvalidDeviceId, + paInvalidFlag, + paSampleFormatNotSupported, + paBadIODeviceCombination, + paInsufficientMemory, + paBufferTooBig, + paBufferTooSmall, + paNullCallback, + paBadStreamPtr, + paTimedOut, + paInternalError +} PaErrorNum; + +/* + Pa_Initialize() is the library initialisation function - call this before + using the library. +*/ + +PaError Pa_Initialize( void ); + +/* + Pa_Terminate() is the library termination function - call this after + using the library. +*/ + +PaError Pa_Terminate( void ); + +/* + Return host specific error. + This can be called after receiving a paHostError. +*/ +long Pa_GetHostError( void ); + +/* + Translate the error number into a human readable message. +*/ +const char *Pa_GetErrorText( PaError errnum ); + +/* + Sample formats + + These are formats used to pass sound data between the callback and the + stream. Each device has a "native" format which may be used when optimum + efficiency or control over conversion is required. + + Formats marked "always available" are supported (emulated) by all devices. + + The floating point representation uses +1.0 and -1.0 as the respective + maximum and minimum. + +*/ + +typedef unsigned long PaSampleFormat; +#define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ +#define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ +#define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ +#define paInt24 ((PaSampleFormat) (1<<3)) +#define paPackedInt24 ((PaSampleFormat) (1<<4)) +#define paInt8 ((PaSampleFormat) (1<<5)) +#define paUInt8 ((PaSampleFormat) (1<<6)) /* unsigned 8 bit, 128 is "ground" */ +#define paCustomFormat ((PaSampleFormat) (1<<16)) + +/* + Device enumeration mechanism. + + Device ids range from 0 to Pa_CountDevices()-1. + + Devices may support input, output or both. Device 0 is always the "default" + device and should support at least stereo in and out if that is available + on the taget platform _even_ if this involves kludging an input/output + device on platforms that usually separate input from output. Other platform + specific devices are specified by positive device ids. +*/ + +typedef int PaDeviceID; +#define paNoDevice -1 + +typedef struct{ + int structVersion; + const char *name; + int maxInputChannels; + int maxOutputChannels; +/* Number of discrete rates, or -1 if range supported. */ + int numSampleRates; +/* Array of supported sample rates, or {min,max} if range supported. */ + const double *sampleRates; + PaSampleFormat nativeSampleFormats; +} PaDeviceInfo; + + +int Pa_CountDevices(); +/* + Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() + + Return the default device ID or paNoDevice if there is no devices. + The result can be passed to Pa_OpenStream(). + + On the PC, the user can specify a default device by + setting an environment variable. For example, to use device #1. + + set PA_RECOMMENDED_OUTPUT_DEVICE=1 + + The user should first determine the available device ID by using + the supplied application "pa_devs". +*/ +PaDeviceID Pa_GetDefaultInputDeviceID( void ); +PaDeviceID Pa_GetDefaultOutputDeviceID( void ); + +/* + PaTimestamp is used to represent a continuous sample clock with arbitrary + start time useful for syncronisation. The type is used in the outTime + argument to the callback function and the result of Pa_StreamTime() +*/ + +typedef double PaTimestamp; + +/* + Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo 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 PortAudio implementation and must + not be manipulated or freed. The pointer is guaranteed to be valid until + between calls to Pa_Initialize() and Pa_Terminate(). +*/ + +const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID devID ); + +/* + PortAudioCallback is implemented by clients of the portable audio api. + + inputBuffer and outputBuffer are arrays of interleaved samples, + the format, packing and number of channels used by the buffers are + determined by parameters to Pa_OpenStream() (see below). + + framesPerBuffer is the number of sample frames to be processed by the callback. + + outTime is the time in samples when the buffer(s) processed by + this callback will begin being played at the audio output. + See also Pa_StreamTime() + + userData is the value of a user supplied pointer passed to Pa_OpenStream() + intended for storing synthesis data etc. + + return value: + The callback can return a nonzero value to stop the stream. This may be + useful in applications such as soundfile players where a specific duration + of output is required. However, it is not necessary to utilise this mechanism + as StopStream() will also terminate the stream. A callback returning a + nonzero value must fill the entire outputBuffer. + + NOTE: None of the other stream functions may be called from within the + callback function except for Pa_GetCPULoad(). + +*/ + +typedef int (PortAudioCallback)( + void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ); + + +/* + Stream flags + + These flags may be supplied (ored together) in the streamFlags argument to + the Pa_OpenStream() function. + + [ suggestions? ] +*/ + +#define paNoFlag (0) +#define paClipOff (1<<0) /* disable defult clipping of out of range samples */ +#define paDitherOff (1<<1) /* disable default dithering */ +#define paPlatformSpecificFlags (0x00010000) +typedef unsigned long PaStreamFlags; + +/* + A single PortAudioStream provides multiple channels of real-time + input and output audio streaming to a client application. + Pointers to PortAudioStream objects are passed between PortAudio functions. +*/ + +typedef void PortAudioStream; +#define PaStream PortAudioStream + +/* + Pa_OpenStream() opens a stream for either input, output or both. + + stream is the address of a PortAudioStream pointer which will receive + a pointer to the newly opened stream. + + inputDevice is the id of the device used for input (see PaDeviceID above.) + inputDevice may be paNoDevice to indicate that an input device is not required. + + numInputChannels is the number of channels of sound to be delivered to the + callback. It can range from 1 to the value of maxInputChannels in the + device input record for the device specified in the inputDevice parameter. + If inputDevice is paNoDevice numInputChannels is ignored. + + inputSampleFormat is the format of inputBuffer provided to the callback + function. inputSampleFormat may be any of the formats described by the + PaSampleFormat enumeration (see above). PortAudio guarantees support for + the sound devices native formats (nativeSampleFormats in the device info + record) and additionally 16 and 32 bit integer and 32 bit floating point + formats. Support for other formats is implementation defined. + + inputDriverInfo is a pointer to an optional driver specific data structure + containing additional information for device setup or stream 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 PaDeviceID above.) + outputDevice may be paNoDevice to indicate that an output device is not required. + + numOutputChannels is the number of channels of sound to be supplied by the + callback. See the definition of numInputChannels above for more details. + + outputSampleFormat is the sample format of the outputBuffer filled by the + callback function. See the definition of inputSampleFormat above for more + details. + + outputDriverInfo is a pointer to an optional driver specific data structure + containing additional information for device setup or stream processing. + outputDriverInfo is never required for correct operation. If not used + outputDriverInfo should be NULL. + + sampleRate is the desired sampleRate for input and output + + framesPerBuffer is the length in sample frames of all internal sample buffers + used for communication with platform specific audio routines. Wherever + possible this corresponds to the framesPerBuffer parameter passed to the + callback function. + + numberOfBuffers is the number of buffers used for multibuffered + communication with the platform specific audio routines. This parameter is + provided only as a guide - and does not imply that an implementation must + use multibuffered i/o when reliable double buffering is available (such as + SndPlayDoubleBuffer() on the Macintosh.) + + streamFlags may contain a combination of flags ORed together. + These flags modify the behavior of the + streaming process. Some flags may only be relevant to certain buffer formats. + + callback is a pointer to a client supplied function that is responsible + for processing and filling input and output buffers (see above for details.) + + userData is a client supplied pointer which is passed to the callback + function. It could for example, contain a pointer to instance data necessary + for processing the audio buffers. + + return value: + Apon success Pa_OpenStream() returns PaNoError and places a pointer to a + valid PortAudioStream in the stream argument. The stream is inactive (stopped). + If a call to Pa_OpenStream() fails a nonzero error code is returned (see + PAError above) and the value of stream is invalid. + +*/ + +PaError Pa_OpenStream( PortAudioStream** stream, + PaDeviceID inputDevice, + int numInputChannels, + PaSampleFormat inputSampleFormat, + void *inputDriverInfo, + PaDeviceID outputDevice, + int numOutputChannels, + PaSampleFormat outputSampleFormat, + void *outputDriverInfo, + double sampleRate, + unsigned long framesPerBuffer, + unsigned long numberOfBuffers, + PaStreamFlags streamFlags, + PortAudioCallback *callback, + void *userData ); + + +/* + Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that + opens the default input and/or ouput devices. Most parameters have + identical meaning to their Pa_OpenStream() counterparts, with the following + exceptions: + + If either numInputChannels or numOutputChannels is 0 the respective device + is not opened (same as passing paNoDevice in the device arguments to Pa_OpenStream() ) + + sampleFormat applies to both the input and output buffers. +*/ + +PaError Pa_OpenDefaultStream( PortAudioStream** stream, + int numInputChannels, + int numOutputChannels, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + unsigned long numberOfBuffers, + PortAudioCallback *callback, + void *userData ); + +/* + Pa_CloseStream() closes an audio stream, flushing any pending buffers. +*/ + +PaError Pa_CloseStream( PortAudioStream* ); + +/* + Pa_StartStream() and Pa_StopStream() begin and terminate audio processing. + Pa_StopStream() waits until all pending audio buffers have been played. + Pa_AbortStream() stops playing immediately without waiting for pending + buffers to complete. +*/ + +PaError Pa_StartStream( PortAudioStream *stream ); + +PaError Pa_StopStream( PortAudioStream *stream ); + +PaError Pa_AbortStream( PortAudioStream *stream ); + +/* + Pa_StreamActive() returns one when the stream is playing audio, + zero when not playing, or a negative error number if the + stream is invalid. + The stream is active between calls to Pa_StartStream() and Pa_StopStream(), + but may also become inactive if the callback returns a non-zero value. + In the latter case, the stream is considered inactive after the last + buffer has finished playing. +*/ + +PaError Pa_StreamActive( PortAudioStream *stream ); + +/* + Pa_StreamTime() returns the current output time for the stream in samples. + This time may be used as a time reference (for example syncronising audio to + MIDI). +*/ + +PaTimestamp Pa_StreamTime( PortAudioStream *stream ); + +/* + The "CPU Load" is a fraction of total CPU time consumed by the + stream's audio processing. + A value of 0.5 would imply that PortAudio and the sound generating + callback was consuming roughly 50% of the available CPU time. + This function may be called from the callback function or the application. +*/ +double Pa_GetCPULoad( PortAudioStream* stream ); + +/* + Use Pa_GetMinNumBuffers() to determine minimum number of buffers required for + the current host based on minimum latency. + On the PC, for the DirectSound implementation, latency can be optionally set + by user by setting an environment variable. + For example, to set latency to 200 msec, put: + + set PA_MIN_LATENCY_MSEC=200 + + in the AUTOEXEC.BAT file and reboot. + If the environment variable is not set, then the latency will be determined + based on the OS. Windows NT has higher latency than Win95. +*/ + +int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate ); + +/* + Sleep for at least 'msec' milliseconds. + You may sleep longer than the requested time so don't rely + on this for accurate musical timing. +*/ +void Pa_Sleep( long msec ); + +/* + Return size in bytes of a single sample in a given PaSampleFormat + or paSampleFormatNotSupported. +*/ +PaError Pa_GetSampleSize( PaSampleFormat format ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PORT_AUDIO_H */ diff --git a/portaudio-v19/docs/portaudio_icmc2001.pdf b/portaudio-v19/docs/portaudio_icmc2001.pdf new file mode 100644 index 0000000000000000000000000000000000000000..dd074b7d334d9b0d4415330c2a123131aa130115 GIT binary patch literal 50968 zcma&NcUV(h8|F(dAwf#$sG)aABM?ApfY2cnktV&DP((yTdha08M0y7S0RaK&9i%D( zBE5G3yN^)v_ohd?17 z*3KY+j0^}MhJl#Eet&?2h#B89fwA=AL z%=7=}#3RHJmuCE{W8mmZON9N^GjJIC(u{vK4GeL4jem6w41VeC!~Sg>B`-TGA14oY zjFpcagdZaXL&Kmjs017VLn6^|ae?0pN7u{4_KuC67lhvoA%Xh+k}!ipp$dP3&7a`) zCwTk`)_;Q4pWyQ+K>h^GpWyT-c>f9ieDTkr>z~7ag596iKUeujf%tPM`X@mD1lXVO z&lmQ8TK^>ae@?#n=d*vV=l-W<`@c`Q`={mor~m(y=<&PzDqdD@c3M_0ze^Dp6&FQl z!o;n9pYVUKeb`?Y$3HiYKjHtnYry`xJpNym|6U+!kbiDh22MV%zh^|n)#EN&5&?t$ zr=wyj5cr>Uf%|vA;s3V0rk%Tkk0V3^4VU~q04h$dKEG=g(=@q>v9s~8wfmo1Z=c_D z?*;+{(ZmEz=(fcnXn+_}B_xeCoCe4V%?Rpsm0$v?bQ6}XTZ^*w4@b;#t7}5gEX!e> zok13=0^M<2FhX!031b{-4`I+0qfH279|=88k%=UjeLT%7s#n(wnz3Uyl`lw1#@cO# zpU_=5lYFYS_l9D5>aHwn`~cBPj-o2hlb)?lgh7kmRMHd5qzc$YT}N;nDOoah&`zxc zL`nn{oa29g}WgVwh?J-%|RcM zCjp@D#fyfeJ0qZ46ZYjo!$2CxI|1ypukLHVrc#m2cPzac4`$<^_Xddp`4McV^V9B3 zjAlJRte+WEAyA;gFj!CY(Q^TSAgyR9vjQ&YOR2~1DJj49gza=gm1OS-nN_VWw9QrW zv{0doxQC*#r);oWenozX2E>J5ma5G!)0HA2rdWiddMewddu{T}h9ZTHQ^6pSJ?hct zcpsmx+G@%1xq4@eaUq$e!R;$>SJQ%@Seos5Nl?<7HbT)OhC+~3BhRubCW$qirxxJj z-}jO@w0Ed>t*Gif@Ss8cSPkT}1p;veY=IMq!?pxl)RkUJ#IN}T((vb}X(5JeUN)^M zrUh9Sfw~9|IJ-_=VI)11Jm6j_Eom0+aJsx6bV4FpBD>y@IghV2MfVUi5XU#IsD_ya82moR^C4(P*dSAIG4& zYroq>y`pY&V4i9?6RP8@(|@EE_!0G-M}!c!-j=Lsc-L#nH=f)YELEjD)K5)FFc0mC zla(g%=ki$-{3=VLvwcuo7TO83!SA9PMaGPG>h7u*&`3~=DdA4JY!a+{{c2Z{MlK2^s~6hN z?H(|m(S}=`Pc5*Sjxc@3leA9A0|#uEB;WRm9Z;~(GQAR$0+F>d z7BiI0Tb*=7p+wteG3?3H4R#=1XptfdntNG7cSeWHB17)vGAc5B)ekKw)!%7l$u6e; zk+coL%P+qYzRRt&s#f~IW0DTMosq;*e_h+r{5}yu4M3ru`gU-VMC2XnoNgCuQaanh zkf0dbB|ul0+w6Kj-KuHg7b%UM;LR}A*7e|Q8gcg}?hJg1$D~QUY1QO*1~JJ-oLMI4 zuZ7CL6r;K&cNL%;|2w56ePvy8AAXyjoXotB@{${ z`qK2}>rkS(8e@)cp~{`ZGTr9{`Z>f36X6&>2y`}Iz)3iorO;OxdJ(2#4*Y$)=y5KK90HrpF}XOOv97;^Jcn~ z&m9A1pA%X-tT!_|8C!&8?HQDp13AO-Pe>&_JNs2oLpN_s@ zj^_E&f|%_9)@B+!TR8nriktxJeg2{5_?^Sf-l}1$)GU9S8411EjH?kOWEbJQ8h@nb zF=cRaQ$JqQI?CuJI6VCcj_tFyPXlsFKc_vu*-_Ef!hIME?TTKOZ0y}j5Rx!5JdD;TcC#@cZJoX&HE^qFa$APK9s3k`)+s7|tj!&z9DCv>Bs zig{h5p@c<|{>(illy;v5GH-k7-l^7L5bFvrzm2~g8LXIKT_RuvpB@WXGf513yHUR^ zLmBZ*piD0{lk})8@E!QU+3`VeSi!HBBI38oz3ezQ)g_0gQu_%*FBbNJz$+0j^{ zRQAEU)Y>iEqW~7ip0v){@GnR0suq^71=~#rxXf4XL#-yhu{u&K%LytIxcdtGNV9Tg zKQ->J5f~ID)4F5Mq%q5qeNknNeQrR06KG{Tnw3cg9#!TpWCtL+q(^#7m}}SfK=qGg z%4SQ!2j0Bpx3t~u(D4pEP}UdrOiLvfUp$!hjFV~(y`p@kGRnJKufnN6R5XJN%`&x) zWGZm}4{+}oJHA(EMyh!2ckoaKywkXNQhZ7q6ksK2XTMyeIOI{=HdDA!gyR_gc@x71zf&gCEzQ{rnkl zq_g@)&7y7)kg>(NzLpMr9q8}yv(ZCcG-Q4~ay7$pJLV|Pw2%L%a?vce6t(Ix{PjL? zHJ@lRAOnwFF7#O{!x|_Vycdu{W7wA+cFWe1maKoyRN)H3Wp~|~G20DunD0``+zLHW z0wj_G6OK^4CCvSE3iU7Ys%H10_346{_2_FiOZ_*?saq_y)f{uwxwJcM7z24aP$Wx| z(HD^-i)xNPs19kA$^qhG^R{@B*kaBP0-xWH)Tpba>vZQ771!Hf*vm9{UzC+-9?Po~ z=V8W-1!yL4RL1K{$8viUD0gfHmN`PWjyM^vMtqfo;v0!p?^~t9Mkjo!3i}* z;h?POny6wmejWT0@_1GCxVJ&z*tE6}00DCy)bRDWm)iNRYwkW$`N9g(#bdwL#Xn>R zB`EdE*HVZ4B4^&CZkTgl?mjxkkWMLjSS*f*90*Z^UY{^0?fP>oW|N1!A5IXUeoWj4 z@H?o4jDFxCl3lR$S}48;sE4R0(38@*DxUc25lhfch>?=Y7!hTpV+8Tq$fde=&c1@x zdKkrq{DiIp*;F*s$Ko zAWY5i=T?Do%r~eIXTZQu6LO3+?ohO1TTH#EKk_)FItIAB1l+MmkB=I)FIb-y%A)R)&9S(SZ1uRA-8@>;J$CwThFR8*GN}a60l`R*qyu3HKz0Sj8qxx5SvC?cM|7gMlw|8B6l4=}B%tbc@k398nvZe%$GqKQIX_{2a<*j; z&tAZ&_d|+=kHsm8$6`=aT)2XmMy~Wjhj3+aHU6HCZIOrAgnm(xS9H+^YA{i_1BA?m zM8*Nv9cqjwiZ$xTC>FB|FyJlLttflHSH`K{?AuYU&9Tv1k+m%lAQijW!<`7}#>9XN zxJc}JGZYK&>rDn5#k!d4rkU`jN$|LtVdW@iD+QH|fR!l%WC1FT2?yTWa{?E)8v_z} z3JnuAJp}Z{=+4z%bL-Y4H?I7U*uoU0`ucmB{1l179ai4hD(E1NMIQLqh8Z1z$nlK}TIYF)(G4;FW%|FFbyo5Lp1f2M^d(S#8&q=6wNv~__JkePF0mq(w z!+Ge=l+1d^N`Ewz9r&3ZADBT7(-NJj1!P(wizbG$kq%rqogQxb)`JA7!AFY;6?(e* zGxGmouwLGKn67`UUHzFUv9gcR4!7_Ec++8JHem zUu>E>_`*-JlHkLdk@;Ewp2u>Bmit}C7!1mI4S=h@wtnmo<(C zG$*PdA&qOt_nx6X`JA0-G@Wtl5Ub~jyIfT^+z_;%ixf3M9{J_0Zy_+5h~!stQ!t$^ zKt32HO)6&U?vYf;2plk$X3TUjqKbhZLf_zJhevqW%YD!+wQGfX z!d`e2-l4n~Qq&AT?m(=fOS8(-v;1w1(^Cn>Dtg~$v?uNH#Joi{9H^Y1wCj_P&NT`p zm;NxPy`4_0CJZXj`}{7x(~K-*g+p>nOv1(5s~ zK~=v`W`2Xn&p*+u*77Vx>ye{xzmRO%#KzxY#LNoL)kW*Iq|`&+N%VzLH|j#Se&!6o zweI9I=x6vNjA538_2Rq|0;2}$LE4VK2btcEIDxpkOqLB7eDe0>l5}G7(>RkX@jHSK zFIu7J29J(V;rDDmAy2auuZ%x^T$bbnXM#^0>Z$oSfrFU^1li-KlEykp*M*t!dA(gGQbH?J%RnjVl%(<%we2>VRXtn3 zfQkCl^fRvctKQiMwC|EZ>OI-l$3X3nQ*r@UiJL}5zVe4y@1}9-wKf+e|4-~q;wd$l z(IRM-k@P61onw~X+jrEiezt4ow(=$}i@jbL7n7G~bNq$g0TcF{5a~@`7mVjf(K@C- z1jqil$*#>#2{7WrRPnXG)Z|4P=h_|cXOV#{3dEYVGD)glsLIp;*<{oj$y3*z$U?2G z&N@%o-_PB?ienD1=06d4f1ooXu`cjl-Jq~fSWO(+S72fTQ%sOR)EXrNbknk#7bKG_ zL)I!6c)3Nf7^y=?w|I8-HqQAWZ~vJbD5oB;t}39_Y*48tnYPx(NBK#;)^1$hhFlFM zT|cHx%e+XBbNwP57^9Mp;(IcL< zhyM2kK zcA-IZ3kl}k#!aOg<5Y(TTj##oet(`DU7!h>Yt{l^PN|hfre&6*CH=elkt&tKA(ke# zBd^A7c%!S03kM2!cW4}qe(jX~9#tvpqE-hbrmxau1=3@JbDl950r)a7o&6czZx`ZB)>CSqfwdd;N1(A zi#O5L=^^bXlxm>+mcm!~RQLM5bF=j@iGD8y^%L*Dr!WfguRARS4Yc}NKe-;gIaTP~ z52}A;W@w=I$q(`=fa7fhr#1KJrzk1ce$L{6QLoc!&)o6m%#Dz+v8v;nL=i^?NyjuJ zc04AgIh!)hHv%S2Fnw18-yRFyJrfS;d+7Rx%$R`7(u+^tmG5n4v=Pzt6bHQh)BYa3 zfiZxTh`1WWu0p~Bz-F>|~!U0HM9J7Sg?o)ea;PF>$@Rm)PYx)L>Za6FfTCt=$d z1-l;PI9Z`U374p+Od`!u|3H{AMx$6!7YP<&j*SQnZeCXKVgg2RC6@)2VVZ%YJ+wj7 z1b3Sm`^dbjOW8CF6!{`-%3De0q?CC3caQ~!*V1Evsa9lxDkAwg2`w4I*A4ik#u5yr z!PeqtWpmsnS07*$&^QX{dUxv1Y)6#H4O-2_^^i>Kza}mz`x~v7a z<@~5YdFWY`%qnHjG}Sg6NTpyUXx%0VwfwW^%3v9+hR}uLm)yQCxF4XP-jr47IJ}iI7*Q zHDjxzns8)`$bU}IB?{&G-YE}Nl+3Boqv$T| zH-bm+!Xvse+?mL{n9F_y>vH|#xuIA@ogKfHu?eFfrfQ1-6_(Ax;tBEn67l(#@{*Vy z%U-DjCF3A;C2`)SOngr<2*byjH_J-Vl|9#~Du&pDkLuXz_HwWEtkRH;w9T`>(pk3R zmSnd z&sYVrqia}K?r|EAPD4%B5<=fy8h4kXo{_=(bLJeUhNz{l5u>W&k57VMT^&E=68+Wf z(=K;qq@DfYjj8kZLEs89GbsM+#z(L1Hs2p_`CeeJl54Zhe!m&VqLq3#akA*=ZNz5y z;?0QG_8T6`FZ|z2)QLfVe&X2PxmK{u;l^^PpXbRhB)+S8_j?15Ti%y!+ivAqU3e$eoh!)OQ)_bF^R(Q&0zdY8 zoNp!-K{|W0B`h3deeW>*S@omPu))H(Ks`n zqN?G#c#o^L@&um36Z>Ew?^MR^&vG#04-sR830^Zh(BIg ztP6dg)X+tti#w)Jk4=|)OeLq*!fQZJg6WF^VKFD2}5 z`E~7i1FBmHs>)Y}``S)Vr;bOv>#sozxsi=^X=KW^h%q?TXE4L$+KH9=(sLfWK_mUvbv zh9qYzEGP#+5T=zUPe*a}Zi)*OO{OAEq74xdvc&~<3jCxX#zKljmV2)&?V0PxvfLd? zAHPvJ!FElf!{1@zGgGXV{M5(y!8`u+^YdKx`9#ke)533#I5@fP0Ll_+mKG-@LRMcF z7m+YduFPjAn!DqqvAzl1W|g<`*664fqr>fmnMhxI0`b;QJnN4o27GF+<~=Z~KrE>4 zR*C7yw5BnBdcS}OsBtSUln~wi;Qd~4WVG!SYJRfAMee?iJMl}VH@Ztyee#pK!)k{`5ZrLQFdijykw8fB0h8NWvu_e3*Mf^JS#X2`sRz^R_no- z2MXD~gOXo*EplR$KVB2}$av0@p&6~}R)P%8c>lsWE;=XEf%Hk8$s&Gp6F8c%s$!COPutQ_hAoc=B|Yg+kIv9^N%2NWg+_Lr>ScpUYfAf_O!{I#8}pUlRd9TR^Od3RF(pMO@yyoO*4-ezh^NUId}IKb=%p%#OY9& zKiTTK(yzL(^!bNAUcOjqZ+(t_ zxx3d~Z11rYSukNE$iI#n8=POL-f(L(eV#KiyqNLA_V~ec_GgP;*J~*L~lwqAdiH7*7`m)=7+?geqkCC+g{_|DyUbTvih5kgIN1xA>Hxp>1hYOUA#Q=x%J04;vWb0 zp4@x%$>_Yn$w%@C$mH?(p?xgl$lD#C=}>*vT!isxI`+rl;4jtsQE% zvRbs)OLWIFS^#rX={B=foIO!dkc8Tg!3ts2ER?|PA5k#JP>RuXYixT^tn63!V1;C+ zA+6HRgp@kD(q2MtFJDGx8Y5Rc2w#fj9{*BU z^~)>IOs$ilxK|$=^%)Yy&cGr@@A>joGCE_D2WTnLc{)I`oeL@#mczFs2a7A-%W4M- zP;S4A;-4xRRs|p~Vn;p_K|%lUKL2YA{C}Z8@P7j!zsUz1 zeLEkBsn~C{2qI=+=jQ|Yz3nfi;^FS|KX>U>5D@qu_T%?6{HmJtU60)CuB$_Ye|&dCtFk z2#LDX@xS4|zc~T&)W5CpAJPnsMx*}!lV%eCA{8v@{@-ph3(kxkj`ZVj)m7jJsC0*5n{hC<7!ndC{vt;x z_-aKV>#f=)0Ty5%IiRco&yQx`IS(c*>4bsV!Z{a$r(S5F&HETD^Ja8?Uc?ADdGm}f zLux^!WU0OoyBO3;xjpLx;kR*!IblWO>M|SSu9-T{(0dsQK`dq<#saYzxaJY(Mo zH|7YQt0?}Bw`oFJvA>_oR0&6;nXw$+%etLrFxH8(pbC_(O_;Q4l|&nA_i5O4b}yOq z6VVR%E4Jr7911h<%ElH?K7F4kyos-$>Ln+>H?j;y4IA%vw*!rrN+mt&bIU zfkGz~)C%g~dr6;VjMkD1o9?27TqKQKy4RW~kZlPs_fOiYxfxsJ^Br+Z5}mqb3~0bw z`Z^g_F`}R&IF+}hN_#531*Ul>`UR#tXMaImQLBpr#S)*vL2K*b=uQ&ouoCVd0>Ib0t)8vt~^(k0&NQWGQI@qtOPRJ zb6jB<-D!)KC^3F&u&28IwF>ko<$F=vn61#Yj$juC^S7g*VBoW!&^gY7NaGt_RUe zv~ewKykh;{eoUn38e@gHEtgj{{=!e@mPUfiWJ5l2RaqGDbnj+kE3v1Pz|UD zwx0esh@_ioAA(qSfetNRO(<6c|(0*6^ zh2;CToqF4lS@GWwsi+c|1GyKv^IOwPox2E9W-Op%{u0kLPu~rIUQ6{#kLRR~`G%Qh)3zQY8r^mj4i~tb};4;;Vplw|<&^Y=Koi z5jO(skAzg-u=^3lL7H)&mU7X*Bsz$juJ^&B+Or_M$dlY2&fM!tF4Fir=lKLvSBXbS zZ8koCe7uhOxX4=MUv|)q;0{~`?o;Ti)~zB|Q_NW>KizF_bai&)26eSnT5u`JA)}gi(iNKtArZD?7Qe~jYD15jZaOIHy@21=Xyq$Hw%caVny)
_indHVG)3^ZrAZg!fH65_!ltCUc#av(>q zqIL4E1T4iIn%nYCtx-Cd3gPrq)Osv{=t_kE&hSyhsWXS2 znn+n^S+{qiB-ko2b>l{rA-#5}2BB*ezh9NkiysE1!Fu7MPL8-uJ;*K3K1uP7j2kR8 z=Y(w&5gW`xZz91i3|>~^9^4bpcd;1`3s)?I^511i^*aow)+xW{4G`Ok`lzO6`ADT1 zOir`A9y>zsAwD0h&wQj9RSs^VJa;BG)NxBMrY$|w!_9z$Rh;xDH0%g5!C%bF9vC#_*to0WPUkf zFAD%DTq*1qKDDYHzAd07RQzJo@(+jl^(NQOVt)HO;gV^DT@-8v67 zOYy2Fsv&#Cp)6M2b}M=wN<5fz!s-<>?+E|gp5BjuI{c&RgO(;FE!nfNZzb}AbGq5z z71cM1xp?J>CxyY~2xTVzi5~$hinUCK6sj(6h5_V?<#_F}u19Z4xQFf>_qm6v+$K!f zUezd%KI|9ZR6C0wZD&+D2|;K1T`QPRGKti}SjZ~po!c?<2W!`Bgp{5<$xSbNew{^U z;CvopecqDgvgtaxzGt3;uC^Tca$8B@YrMP&apjpP!Nk!|1^pM5g>FkpU9CFgD>1qT zcc|HB{5)`rSM@5(cxzi{=J)A{u7N(`;eB7FUb!t0>zN~HB&b&S+j693QYr4d?Qf?? zi;9LMEVPDIJ~3=13%s?M-uIk6HZ5y#u5ZrY;V$V2982TgY*Tz+(#I5)A}ErxFlX&P z7V&&+3b)u3T^ReZo|5TS>ymdT^0gKp^}KlQ)|Kg}ZV@o>#?WTa*tG|d=8TB*Yo%}f zEg_)k2nh+KDiHNf}54vtVa%*ZseIiukA}!r% zl)aj~YsG2U<5q6n=Hb)9P9*Nn(#mQfP13w@-8Fk7QLCTjwH!;2!M@tcm#)%yNjvF> zaeM52Lf!ojuY8&^dZ36e!H%yL+MWzO6+3+`^TRy7P|#FJ&n@}uw~)PWQGj&O!l_8@ z#Y3X^LbelYvSh0e5;6nyAObsw#RZ5D25q{6a7$yI*mh3kHqvS zA1hPE6c!&-#2Cz$t+%=p^-)uB5l?LP=@1G7UatBqtYxeyC-wIRId!j}7g7-bwFu

&gNSFrDZ*$W4OAjDCKcIb)x)gQpF4a^Jqd-5UNW` zmDh_m>a8Xx?dH!|!=ZZ$32D;$b}0HeeGc*KQoAt^Oz{kt~N969_QJgN>80Nx1EBt zMHxO5bdG)t-iizCi-QiQI|pgI+FUg9JY_h{c-lSTZhzXMwCS>C{EeL1m8{HmfatTe zPn!T;gjR={2fuu&@oN%;i{aimhq<6Z?i*37kC)>T5{MEx1ruEwDJgkh0_o7zzG#7( zZsz zlU=5*tM^rqThQ=XBZU?@MN<4#OL;O&JU7If(DMW3#8m)jmufk;nNRdK!6LvVl)knK z$lcZpHDphk%W$(HUF9wXE%2{$qK^;X;-K8BfU?4`uV{=WG%O|#fO)HQQV_FD_@n?X zqrh!L;JBdB@+sAh!OX-MU_!K+>%9=Xj(9KO5w3X_-cfvfi=%!3v{$QIV#0|_;_?!@ zLY(r8D~F%Bn7sD8A8n3Gbw5|kHEwsGF?WCbb8Sy*O$W!64aM3(`@C%x)+cn1m^Grc z&n~DJs8)g6rl(s{cRgou~^pV z8qjI&8tsMRWT#Z`OD6I(p!`e+#*}S&huvF5H1?Yq-C-6T7oyXNV0?ox_C6F>D2SH^ zOg$4437D#H6@==8aGkTK>?O;N99uwB8sJK7=UbcWthM)Vyf(WL`B}LaK)uZvP{td^ z&)HLu4&p|UVWgxL`;>dHDPyncs{mkSrht!ghTNtKOLV^k#?$7yltSC7oNBhMQvUc!ei#o~u2{31`6p*z$*V znUM{9mHgr?MY!hKut$`yLtbwjcfE(@8xo3lxHTrMjVcT8McQ_KIZ++e>o)4N<)DVa zFB&izJ`#JVpC`fcm)}4AuruFPs*OrsYimH;qrW=zFE!e1X-1@6QMTXi&vN3gaEMA8 zIZT`Ou@*iF%C3LN;M48!h`<%=4rKyDHS{fEdqOf&-fhIfY3&dFJ}$oSugnUNGLE3W7rX5x$poZ$BI38&73nYghG z=Qt7bHwZ~_LFefhCzzjCvAwJP0CT8{j1Zj>trl*4!VTN~NwL?saLbkfTQiWyKX8uK zmP4&>Ng$3Pm1pni_TS@94{)T2t{lx%vAzbD+fD}hI5fD z<;}P3OTe3Eg@r0go+JC@@f?in+=@J$-9BBF_b3HpJUf>yqv$S%TVDeTjMu1fcQy4D zzncw=H>k;|buU+LR@{7Hwh_}TwihSCxpGr+n;V*@)9@69@%kk+pk7L=f}&}N4619? z;iWHS?jNorzbehgzACD@=Hni8@?B7EScoZ)lsx9l1$=h|d#B(WW;cFgTyq^majQH1 zqBqucTOGA}R;mh8z{pdovTJqQFmRsr>BlI6o<_SA)Ni+ z_?eWxg(1C%`EJHXJjYqz_0uW9lq%AqV4R0xVOi&AxsKp{ryetb@ozJOI~OXri$d*? z0^s%&9rbEw@l_B0L9O0m1N*A%rkqH_3ny%?qmGza?+JHZgoiJk4Qi^fme{S?H{UBx zTo6Jo)B~kqbN@)zO%T#78rCe<-Q)QY-#OyR#1Q6Js+fuhhYt&`D!X$k#2Q;&F&@E? z)2!4LHMW>`*G^_Obd2xgfE5hv=6s8UmR*HQQX@IDFDJM?C!`r>2-4 zg&n7iJgH$uvPQm2ws$OI?~K?#y1}fnl~R-*Wf;kOQStQIOx2odV*fTN!C?;E)d72- zVQLlWo#$b>$Lr~?L#ON5ypQ6~-*V|D;)C-VxdT-cyQ2+j$FyO`XLtZ0O zt(pZD-3Y^DPbw;2lxn7LIgSP5Y=4jGZHn{Y;zmTd&M7w6Z&lMh_d>_f$fND%Uoi;D-%{(faytaU_kLVk4-f(ac*m}bARL>V9lF@zZLU+7} zt+kz)3-MMzl`NT&vs`j1IH z>%1Q>uw?pW5;`iw#;z{y3=iIcdPV{_Rk)z=uV*e%WhV}ucc@UU!kP&D57&f-?C*{> zn&yl6FR_wNHJZOtt8G+xSD!I4^(IiKR)h6dTZ@xFS9BWV0|Pn3Z9YEmP0${ z3cXlg73qbZZOfU^nVs*wSa#l852l|#$mE<`D=F8z531rV6Y8!~$~%-*ddHO52)3UY zFF)MAM{Y#)>!qI4t!j_3(!~q?6KZ zE<9`Pbx3b}!}`uuPq|VqU%vLgmx4U2D}po5&QWsHQe`_Tsjd zEnv1m-V9F55N*bldN>(5N(wqKOXUvfvU@_HT;&3!HZs?P!=x&Uz@ zj*hE4`c7V7`}NK4#NeG_m*}^rJjc|Q`Co3wb8zaD)_41e)sVeQx5GoqBKYE*NQ z>YW}=G9m(gc#MjYr@|=i_k&DGk`0hs*DWH3nwF46bLmd>6F@RTQ=N*45wp56mCw%# z5Cjx+P6jnwLRq5#5opaeE7Gj18$5OLA;AhXSL0WcUBjkqX#j-=ez0+JZ7_ROniFLN z3l17Z6_PwxqQy^2HQ3`x(C=uUmZ01doEKz;r!f`jCd?R~6KA6!>!B@cww26cv;RmK zHSB~U)#z8EQo#8Eo~kMr(njS?(gep@b`vv~O7cg>TK4zY(%ACDl+MsUAbD>Y5eno) zq2({l$s&M_yjjpuT@MKbveeJ%1}+5?3W=P==^j3J(D;5cJ+egUnbqU)(i$^BJQ(R66BhbS7t53y|#ZcLN_~NxSfz-5ZoddPZC}+ zrp0svO?zx|CNV6nuc*VtFE9O?0)bG>)1%VY)mLxie8qPLG-U1W()7O32e#~yZ5EZ>rUZS@R(W(jB&v5SF<&kr9s22ttE!W*G{M^8x(2{Ll`8UNHv7NXZ?F zP>UA^^@`F~gz_!X;SvB`z3^MXH%--_Otuoj2=i>e$uT|J?u6bPCF|*YJMRhTLM_W9 zP^T#N8A&dma_2=Csj0O0FK`?Aq9dJV?G_5Pu1sV?FUbjCWcm_B7D;lV(401+6``QA z-K6LOERHN`H7ev~Y?X^>prF}EiA;;z?|32dW0>? zIV=azLhhQ5E1w{e191vax(1A&e?Za#Z8gJUL2oV3g(h z==wNK?}HwRV9--0B}~%0lRU?%2!=E-pDP;XPdoGIla$276Y8oU6Ez{Zm{GQOt^5LK za9S+h6rtbB9Z?)ZIh^O*RG6QJ*-clfSB-m5`Po6Db7DQx)*=Q}!CNqsLd|0GgfKx% zq-1-2G8@P3Pj^a>@LIW9Q7E4`-6fagKp;s@{>FW@TE zK;0w#Wnbs1v2Ee&+V@%6p(uJ7aolo2iOxqw{Gj19-h(_pU)KkUjh~kdhk+SrW8kRBZm3ek z{DjrQb;rC>){K4(NaHh_?1TaJY=*!(E8ob{>I#@Bb|q#wLdde(wp_f;h|Ls+bE6H8 zSIQV%yhVYG4{AkOy~zODxT-+sV6Inny_R)?RUeMN;~$sGMyo&nSSG-0d2L#h4PZ#r zyeGoR8J?7)JNYrS|2l_?m;GVlS+QN}Yuc{3CuFb9XG(l~_w|Y%tBRoWUwaKlGdRWC z42mz^X9}S&P^Yp!NM7$NOOhbF?;Yl24k(_;mo zH7~x>3^?OOi%V5^+MnsDGN?fKm!B^0GQXo4AETJl^G2G%t^_wDp}?pC zX16-pkB>QBf(m$hPx*!hGuL(w9?V(Xn0OaWWhMOUfP zb~}Ays1M;)mJ%EijZ^XX${tQ_|5)6>YTnjOZ-MFq+c=9z#~wW3TT68r=bJ|x*(KiY zN#=9#PxTqvmAwJp$9FmuYH3V!^P(kXbz8)W&$k6-3w11=B-Qjp?ff3e;*^HF(ckX8 z9VsuE?aEI=X-C+{+>y~l2{j4NQuWVV7O9PpIN1y)`}$)RmXR;QZ(5>d zTX&T@6(Y=EYQYFb*+K(nE7e}B_8yq<-SNu<5Me?Ee!VEAyDt64dfj4+`3TT|qcAbH zjFoD;DfanEE7eC}y(DlIn3;Vy1x7>TH&QBaF6eZ@-aopH>T$Oe5rve9r$;F+ zFd41&B=di;_TEuVZR`3lEf^r72BaH$LJx!v8hVG&k)retQWZO$&|9bin-Y4JCRORu zI|ztKmo803Mg7?Oo_l}i9N8b|j&c86gz>ERopU{F&N1eC-shzyY)R#%Un!#Brc4tJ zw4*I-6^hR}5on=PLQ%3mOA$NV0kzC!mu8@X>S?p@!1+!~d z#pF1=`52i)d_~=Aj_9~mB3V+hd@MXph6j|NP79mI&dx;_uS7a?V26Cmq$qRgkEu}u zG3C|SBEM*Ntdcq_C1zJUrs^cAK!cpMiA%yb(mdHo1!`-O!P&ts|NQ9IO6s##a2bP^ zY?G$x2o|_Dq(94TS_W$E1(r8!fyBVyBQ*_MA~Azl#V8Fo$^y>YJXm=3F%J#%O(DxFSXuHJ{^%Nv zXt@xVRUJ)NA^E0?P_BxgpJD7Yf^j|KVRA1OfG}9DV{oF4J-Uiup<`LM-|cFg|7@Mr zdz@Bu^3s>Kf!rP|Nf@8{Xl<)po?Gnq*E(2DQBX`Ara<%L114ZOPBycmI|}-(r^IYs zedj$&lSh#c&7NKWd%w|Hr_!Q?!^N=1cQ8?QXo&G;l@uo*q!OF% z7^tK<*jkQ(^kE=f_OVO`>Vw{s$f1{}fmCIilaGZV zbKyf}k0-D=1AmdE-4O$^t8I2IrCQyZ6=H)qb1!;?`8tc@{KIq!k6w~?i+K0o%s!Vl ze(Z<>Rx*BJDDBNz*c;7RR=|e^;z3`03u-ADVHk)W)rtUyD$7Jo@jFoxN=g^=g$W%k zvXO@26QsmN?u|}-ty_2CIC#^QMOK?G(V52Fj{XC(Igk}-6N6Bt)w7IkvrS2mld?u9 zHKB*}u7gikVx=@@4z*G;e6!G>>1;i5_Fiu^6l3v?x)jsotXHD**K$_EBjxy$wQr<& zF0l$c(a@?NOqYE_Vma_tBbh#s2Z4@B?=?PDqkX4koJcAyB_Ze(NkK1)8~fPCp(=!p zl?{LhF^p0?oX}fKHCDpr?4U|W2Po&iiXH{m;eDyd2&jmh7E>szJlFP?C zT!xt~YiO3Wk$=>n`>XvApx<|{QgSFT{fMixl!v!*iE<7r#z&ku4(NsFn9gIBSU`<3 zwakxS=6oJNy~CFGQf2kUn^weOpm|x(@#VJ_^Ys|`Qqzt(Q+v9ieW>FZ*+hK%`|*X8 ztv+G(ZyGB4GM0XP>!X-r`Yy|Uf$}DeK&Vp`q%z8>l?y^8OOmF9F9o6DA)Od|d(yAmyL{CD-89=pTo83zu93Wk=PsrIu)f7Khe4nF%(SD&MW5p23F-}`B z$kR{Yyp~J5)>*jrQmf*n_NtCfkvhXVIcowHL*k)G!PZ#Q4`$O4$7B)#s%+!p)_BQ^ zxb)DHK88dQzsf|VzH7NtQVBI;hrP6I-sVeF!K4CMac6VuDVYCfDg?=-I@FwSl2_V; zLj7a>`dLQbiKDb1FxwqF8$Lh(K2F6eSWVoKVf-z;!btnP@KehjRMC}ct`lz`XQ`D$eqr+r_^B9#+k(Syff)H303yydKIMX0f? z+zGImEg)Erby;mTk?56?Y&?|FlWXraIrSoI1RsHxBKjt*$W#25eDw8Bgw%2#+p$5t z8uQhXB88}Y#;i(dbqpqrrvm*><>5C+^UoOiQ0eMm>GfByCY=;pevv&)j(9xh(oImK zLbjQcCOJe?*1%Qp(`2jHG+Qv<$d9fjoi&?3vItMYzSB7|$di4J&pxANybQOt2u6>aW5XFcsMpGSK>cgoOG{>OLMIJ*O-EUYE)04!ibK>ys^uG zGxCj@2nJa9bC+#=%sLoP8SXRuj-6*d9ps#{9NmQzQl>0zy1;;Qh(O+82^u-rjQO)@=yN#qYmf4 zYl6;a^Pg|`--2feNwIVEe`u{K`47Rfry#QeF#$01Iy;mx=G-_YSxi9Y$}pj2I!FY)Q1Zulc3dv7iq}Cg2EBN-O>%o*qGc^wao=9#8q{TL{Gz` z$E3XIKtqMxyaXu3po9Y-6*TVBKoxfP)Q$#Ek}-O3*7YorP6?}9F`Gf3gK@@@1L)Y& z-g3k-kb-OyV%N6fAdumcz~Y=81KhsL=Vum>7>{m?^P2FSSx3K^K4G%}!_U81X6`vI z627cMIg5Xk;32e^w2^{5P;R2Q*ID#3|9j6B?SMWf2zb?pAJ>@QsLybnRMKoE)_uug zpk$vfj6r;m#tj+$ap&jvP(t7w;j2}vBTDjvYBci2$K%i6LP?*cW#uk6dj1hY@r>Y0 zF+qOgM~PB0eR^X28oHzB9!N&|FoZ1mLQIz=>a4^XuLmZfp^zdL%AYezDQ>O#Q=)N| zLx7e%7`65V?x~+r)+0|e$Sbkzb`9}rThzaxhen}>l5aW5Zn-8n9wh-j)bvJ6&soC3PmFI!9e&KiuURT=CpD>K1@B(7;TT-{1uAE3qI9^`_rFONuv) z*JAZbq_sw>FnH4T=T$hk8b!(Hhli5xJ5rnE9*n2ATbTm+z>stN74kP<_!Xm(;4ZaQ zLB8k$hvZS?icSbPrM0|#kiP=1E0V8tZf-rzqInHRbrMAphJFNjt1SGG^DTI0&`!4f zlW*)oqqo+=>zjLx=GHf=ADjMai@y%AdMU7$6xh?K`T49tca3|c-JsfL&f2Yl@hxIP zN1ZPEqmMnpN|?}pV2;9=%UUz_JFld}aN1hzf^DtesFgN^yS2N8B3Xz6+LnGJ&2?Snp zu=$2CAq5ACI*|$aU1j2=8Y$v68UaNEGo8HEg-xUZn>GBd*H1pwMnAIM3{KPf5^ zqKrSh*JVw5bJC7rkrI=}b187Kx72tkG@(xbeRDwOerKyGFFDK2@nm*SZfBdQ_c<=|Mbfms! zu4#iE>n|GK2S$;NG9^j_Ktgs;jd(fq^VR4UD-GTUV8k^XB+S)xa0m?FLU6Trchb0V zdQ^=|b2_z_uK;009}i#(pYXv9{F*?vDG@ko@yIZQF*rf$2vrYF0p&g7!;}P7*2{zA zN!tw_@V2w=)sO{d)FZBV_0|)b*=jvx5^<6rPjC1}5SUbt?2X@(o5^B`Bdb6Tqh~@U zvS&?K=3MdWzF$#cq6|#Hg7E^D5#60Y0#^m_Fp0o(NybD?ntW+M`=}<(8K|QlA|tZL zl9klH$4dA@ttd;7xBD8scCCZ$$JvFvZb=r3{sX%{mLPWZ zf8iu0L|F6TD-?65P#LYVAac|en5YfiKpn*h*(;uT64W{L6FnyUp&69STMdqy3BH9( zfzyNmZhpW`F%<`*19~O@FXN{YnIcDiolUefHfHVi4n{U*^i9n1+wsO5MxWG;>Yma@ z`I{x&moGNwZwe0Z%+nnf>*6F)pRn1>pmd=P!pp97BCEc_#j88^fZD~#Z5tM7)6Yc{ zk~Sj1`q06MkWEu$A#dl40!RfiIT6Vmx2>+j^P}uJhh0EAE!R^L_ZO3d8H?}up0KZ# zKI1d{c^laAfWz}3iKZD7>w@Sg;c_UL_FSagwm#y;uLsZq9&GX@gX^HRwkYtkioFeYSpe2I#*bx%FE7BjV03 zRR8dn4LA*3UJzzD`v~901GO%&m`+_-*3dS3gU%F@E4su);qn~hROGTxAODC|Mq09J z&V<`C+x;DjXchf*`=leODzFz`EHRUtv>TA%O=a5G#9BzlpK5Vn^uagr6CWWKhL@Y-pJ6$PN-kiS_!+CQq-mR3N8F9OR)RH z@VJYOQcfW{&vP@<^3#%yC{r@$@jmte{;L4pIrX~cp4*FU2V=hM=8|)xo*r}?08Z-ddZ;=Nv#V}`5~i+k&m>>Hm=Q}cvDz^8OR_-5!kp|lW4sz=3){MI4 z@bPBBYoKpBc8NmSH$LVy*$1g4YZ~!^(o#`SR2jEWhBmJCDh4mkoDS-Qtg>XsfPU-S3rJYg? zwmb5p;wF5Hy;l+0k$+u9$wf7y?>1E$0I$?M=KugL2J6aplm=XZdZ_7D%ee0HbcdwE z?dhC$Xo(W9E83InaF>#7=&KN&Iunu-L0ZsOzl7s!yiS`vf%=Lw0PZf(P6f0Aw@n$+ zWXr6O&lyK~?FbQH|d? zPC!+Ciyz}d!_x&t*sbF&PAPES1tEJ?se)CJ_M`U&d2=Ksoo!(<#|bcT*CPa*gF=JWh=6v4f=d%$Rfxz@opz() zg3&oENt1k~CoeUZkgCPSdMSeiu5@0RwyUgPafYPS#Lr0hqo(}leIV*W*ff_ZM@2T( z&iLz~up3K>mhQH?Yt2u>m;|G4!FvOgHOk>0ECh-lSbc&-u5jq(Z0MEo=y55K`{`@0 zG24l07$R>Q=N0K4WT=aL(w&fkcC8vsTeIUz#fLq3ydsmP1aoy8AK`g?S~UYdHLs@^#_wdewtN!CDHaJDRw$`@|(*L!VUQiZ@VkI>fC1I1r~OSS|AO6 z@`#+gHzgD*z8eSyXW-o%Rw&ZF>?ZbXI}r^>hj`S)mP)Ug_0>Md(d>d=8BUWyLhfg- zhYOi>q_BVxU2RbwXGP_4Mtxwcfs&y{)N_w}#+ZO1FoxZLvr!9g?P-b(Q_chhbyd)3 zWuUu-vKoDG1WB0fPfgDyBo?2}D#;?v;&zU$^01v{)j)xvj}b5h+|PYu>A;kveCl)G zJFa>&+{rB}y4o!eN;!oH;P4}-+xX4^@8(8*3A?$gy>NjG~z5MdvOS1({&v8$}y z8>~EXR)T=c^rj)OVMKXF=}n*GpCk~#c;o|WNbnf?_t*cd6kLo+%G)Y>?GND zD=WuK{$ThNJ9j!*{#-YCCZt}#E+~aWTF)e;Js9&AcxQ{fJO7STs#`|&(=n>Zwf5Hd zIosE1acejW7fn0KVWBI1nwTX_Jmrsq(P}lb?XG9ZsT_sMhvYZycb8Y1=}MJ z#;0Tzl2byWUe+rYI2k{6YMmgxo!j-(k?9L?>0P@fy8dR*GHmvQGlm3*4s* z3ZPGux+TQETs6alHuK$AzoGCV^W`I9Sei!A{UWn(Vdlo)ei9$ze-iL8ovG=X)nSYr z3AQ(DZr~xj#_HQj-kNf@X&z;Fs%t!JEcUu<#IXwYQY3mc5HlDg#f25L3nJe0)7!OV zU=?Y>Hq-x7p1B5fP(+zZ`M-$pyLZy$a6o?c<+jW1G3dJ_I^(3cF%Nr$Ca+eC82cd}x}DZeJ@}pvPRmFp%qpt^ zKuo2*?aUYXRmbKtM?MNmH9z>^JxhO*7*Qlpb~bFPTQig@r;ORs>+xd@!>h*}rlBZ) z-Ls&^6w^Kj{p7Mz6~EF9{U;$kRX@5L)bf5Ze|NGoDjNL++yp1wjIJ#B!@g5cdKmxu z*DrFjNA))mHn=%8&#;!l?y#VgJvqTp3?@cc*S9;#@2b&A!8@$9qIEvsSQA%5?{3TE zp4C*KcsHT1F}?U>mZu@ttk+b1vR!>uptr|byyi?_%-vo@IG7id{-|$_t#5nDr(bVx z8*R}59Koo=exj8=F|EQh(h8q0@&*o_KALMa7W>sR;*kD?VJUUx#yZmM-UGPfDLQj0 z<#U%9XR(r#qis=Gv*KJ#S%Ev(bz_)Yfmqo~=q7oycxZ8>{#w$0!qbjmpBheGFB#$b zAJWF}7<&7npMKc9MFp(S&fNp)PF2y{dpUN{YvYvPcs^o=``_uVrlKfU0B`Om0$m4v>|SK~$9qS03MR!A)Y2Sh(cAZ?Oh(Q0RY2g_(h{yyf_A zZ!t<*AQlnOXw6fSwmr2xd~Q>ho6(C({B6?&dUejM${YWk69rwBIG@W(K)J~$b^|8dwlp7!sEKtC>tDAhCe@sD0 z>RHVEDD2f{0r#?RnhzPTdQLUJTgKeIya8l&Ys0T=&*sgCQXc?-5JOrMR}S9yXe;rO z*+65(m(mdLdW8_;e(dMBs}SZ8R=9_mm}k`M)~g6d0$YKW^^YnTNvGyGcmQgeO&yJX z11%Re!*X|dF0Ko);dOtj>SH|WAm&RVBYO@sSf&sG9&CQ%?($!t6x}pXXssT35Vpma z8*jJA&&N1_+zMly6)mJFXAiA@KFC81AQWBu)Ww(dxw&D-jE*xlzRqD**vWLAr5nBm zN>kS|wTZc29tmuESyC4e$f3_9!QKORT8a~{$T%hlr7@$NQ+zI)78+Z-LUFZOFbz^x z#z)Yk03WGy+aDRxpN)L3MdLkJ5u?9N$x*IvH&2dTRhfZS%|nI@sM{TaYWdNxRXgxC zY5BE)Vk)6C$!IhpM?OOpJu)N{(m+HYqJ<@ai-=j{mQmS|MtH{6ThTMp`j9twEDI@3 zN^G6g22Tq}z0;$7XM&EiH()r#vB} z15lcw=|Uy^t|*i#6i_LIktWmEfV6%XpK%?zdN~0q9^Olo=zIHxL@BPzum`H`zkrP8 zD2sgMoWXbNjktQA&CzXZWnpabJ`eTEe{R%Py5*ZTfhlAlKb9rGJ4K5}-~A8?buH!1 z+s8+Bcbzzy_5gi5P-CBCe%Lwy98u&{dLdndu90?A@)iWi!%~7dA$*UHS z9at4sU4BZCy0vzln&EukeQ)t?qN^cR4nX_}15gk6H36PA1>5r(V*8w{gh}OK`4W>W zuqp8@jK}auSG;3D4&yUVGY|PpL*ji|2$66n6QS*OkafkopeqV@1`|zT758uQtXES$ z(rp(k2z&-ki0a#$oqP{_C|ZK22W#lvIPFXH0iLl26NLDp2)ZZzWAfr2ZanQkGmTlq@F}F zQ1N%E0a+<|J`;7^)FbhPRiq3zv&pGHXbo~z_k%`kzC`a4agnfvpu|DRaK=a4;Z(_q zQ(6p3K6AY5z5dcQe#+@GaJkpHL5Wa3*2KK;LTr6V91(ASf2a~y?m!G(FPR*=?1cc5 zG=1KH?+6r5z6A?+vHo6F^ty1dd4m>D04Alt91^&@!HGSoPToMNvjeiAT^ zSR>!1vuc^kLIDLxZ8NWme` zIcXr>sW9TcE1=na;BI@hd+m9jp6ko#uhzVRkQTdQ4gH$cn+R&Q`wrp`+#?gKj#w8} za^-ZZ+(d|3jK&fcjvjrM#6DgEXB6Dn_)J+B8?I|Z=E0fPq$}dT;l$=`5A?qd6&svmPFbMxW8oZhh~%462codcc#zh;&h}0mgK=f5T>@%>ik1G_MOaB?~B= zzY6VR8m)+JR!@LS<>&|CE9RDpm8#g1NcX+3tzl2&oHw;EWU+egY1pq3!}VJKA(_as zcNOAL*bmlua>Asbxn;!)l+M0-Kk!nLP}8(M3|0RA7Gdq%biR zt4kP_j6!uxrzANFKNvMIwoSnvp|@cQ#r4S?GnVNt$%`W<<$3~BAJkI@@SHww)yZX8 z#yGWRKJA;#EiltVWXRFg#W3~VRoYFW&w0Z?i9jFD>s6#ENBjzRAeH_EPt|DGpw27-++_R~rL?7AK&qQQx3se|i+w(g-)ii(Z9H{nOFs8L`D;j)1$3ED(1l&FL}Quw zn}wJ5jd9^)5$A!A$@i>9&2lg{W<}&Rn{DN9Qa4z<{|I|}Z%cp;JoCP_lok<tyl~~D0e~|%9xlLQc4-fb46X!UD{;tyJin!u_EaWPHn-# z<0U@tTVO{(&%DHC5mtKWi*z}l9ebR-E$nSvY!E|kDT-}uhi#iRcmCXQlr4{d0|za^ z)v)6F&gol=nG%e^cO`)>Cm+Os=Ikj>`v@8EIks=)w&&tB6czd?73Y<4E~+>)bv`pL zX1%N;Cwlzg6^K(fZG2?1=y3FGjDmgu5dA7H3PbbUy({2H)|QS?`yxdj0|~P(T@IEm zL0^!%HCb|vWiw7}O`plUS$092%ohzxzeU3aiW;&Y3^5P{G6*?^0AbQ{zBfVMco_O4 zxif1lS$h$*ut=th*`PbqiC)y23F9Rwq9(0W90$jbt)v-N5FL?CU`tDnY>T)aQO=au z0g%U1)Fv!OJ-`YZOvIriX(;31%R%*h4V|vTLFzo`+U{5%Z-%^k?5^S!lT0)v$UylQ zf?nheXi7q;>0>DC=_U5 z>iEH}WQox6*Gg1$4^I;Ff4*S))u(y2B$G&7<6(lL6N#p?y82KeGpIbWijwLiO*+4? zPgEob18>rLO=u1uyaPMr6~kskF#A!KF7vlW7ZN-hAfboQ*Qj#xBo2;7rq#CS2RvVS zk>(tpk}jk+U|m%H6nOMBPOpeU;iMi<0yRN0hzO)2^32F3PdpgHj8js;#Zr$Rbk&9M zkYv21Qaaat;x-YKG_}-ZF45mq5Uta%NSYFMCt2Y6WVTmg9)<@~Ewo@nLB7)*iut0s zeA-SB!tqs*(lpcffVQX}Hw}w6@?Ctqgm!xqh>{UFJ|o5;%S%=v$K=w2eb0MxZtt<5 zt>>B{VqP&d+rHZnpwAF#!H0)t=7bh>?VjSd7j&)(;o~#1r)6U;5Rn}Wsqr-gfjU66 zP>P*3*Fo?YN`gt7h%o=Q3JVblcA(c3A_7Yj8T!PQDNB%t>N>mLb;^*ZnKIhP#Gb~` zjo4E{ZC}+-5A>uYxX(|)Nnc3i&QV&`YedA&Yyi&OB9r<|SGo_rfBs!HA*$r1ked#0 z!LaYdLT^D2RE=fdUM94&!k~wG8IQ?0B;c^- z5he{ur?bF__Yu{S$fkFbwuJ@{o;1cs@-cDsTK$qt+zc+ek!2|vXS*#3#L;?9)y{F~ zgO&72-sQE2Vmy10v!CktHD2Va-!1mzZSpwt!=3%U(-H;#wvmYzeSODno6OY8kXh# zZB#@ov&@gW=?#)PNHRvMd2TA$Ub2v0;@Rq>rgdmtlQ_R^K2Jv=!F`BeSJx)6H^TP5Y@7% zOmjo(vS}k**#seKrjM@}0^$^*lv~bXlW)m}Fq*QKvxs+PDLOr}@1L=t`JJ{pU zwL-MCsn00jnWkN#0O2++b*G@L#!!7WvmV-fGMCzn3~3sua02QZ2*VVOmLb$;P?n-X zE8PN~-Mq>i06ZMS7+RQ}XwjbBWU-Bz4}Qx$?5EeN{)};_hw^jlyJA9+Cd*^ep@m%X z4#nQ_DIk0~!i`IX<9k_r%7QRNAwIV=k4do)Kq7mlxHp)`uAE0ZJi1b!heVKfb$5*S zLjWj^7h5qYl{r6nU0E2^#9LE9&}sS?~V$?i*<+aqOd*>{tv3iY|lyDFw{ z3^S+e^gySWlxQh9(8 z2ywFHCrrjv_=N1|r5{1OW|_)P?O^290D1{&ogl8tNzAm|)*QYQKg&TMNj3DDS`UF1 zomu&cqV5B}A<_(Kp{)R_l<+{63v6X|)xP6RSc76@9}ZpGXs7V$ETK>n7!k zY@Db)^(E<}W>w!M{O zrSqFB)Hs)0Cy?LX&^L>oA1ZnP8^mC!M-=*?@94Pi&KN7dS|g$84UuyYr!dxSOPU8g zEab`BDQ@-a+ir^*=j3ZsgDt${O)^Vztux(amz^V=k+C;iJ0 z#V)Joey{(msJjq(u_N($qxj2^;^&&+3v`p`ecLZZo_p0^g#1m3_}e(e5f>_=rG8Vh z{)Ut|*CSpO^ItWG7tYYd-qh#r(U*-=Lipkt`c2LHTejlo3g(Nl{Y}mKJMwSFc{zu~ z&s&>c5EF53RD9V$#V)oCKW}hon}+Dc z8x`WO9u{|OT)?D%wWPQZDtz(U^jFJ^|9_~+`R02OCI0G=aS8NqDDhWAjZ2^x7vUiO z>a}qR^x|3?gvjM=61muVAMsZW!X;5Ju8uI3n6Baq*r=cOSRj`i}j32|Q2bRqQewFzY$lsoaUXHBwS_iDo`?|4#|N%_ofvfSPM;|IIeM8sKHU6!-MQ!iW0 zN60E?5v55#3oG|0<`2s>4ZQGlvocVJk@Z%qBjTdg|k(L)kKB5!Jk#ov&mG>O3H% z?q*B8Dmy5P_mV&k45Q?TVgv`rzONxePsCs!bFW8fd;u|;qBs+;E8})KKd-;d0irhe zR-Mo=HMXRNrj_D)Wf$k3R45;C;;@{b{|Ew#%IF*u#wHeu3v`q&$%N+HWHZ96^R*>H zX%>PC;N_A_5@q;UPigt;2c6|gm5>*LA>?Xy>rHw2*#H%i`G<6~ypW0fXzho}s8U5s zy3PnT|Lh6m7~_10SrkYTVuY@^X^LV)Ep=FU2FxPo;%ix46@`_a0!nQg$Id#1w00|N ztd+~#E3f8{dLYTWR3CMFqHT#mUkVl$XP(O%Snn6SH@2;TnU2MR>+@?(j8wBbVTyvXp@7#oXwn;k8^193r~R zI5s#JX2uBMux|H^%zL)~t8{yFWC24wlG0+ebj)vQ7540V5hF2Q297zLEvn73)Mn+B zA=2~B`T2C_f;4x%PY8yAS20rsaWa&oQNo*xU49lqkf|aX(*?$sL^4#VHVbG=Se#Z@ zeo%F}8h>R^fTiM@$`JyT9|b+ z;swP5K%b#7D-WZWi5d z9y*~l09xTh|G{Egjg5{?4jUX!(-taNOiR>e&t1 z^msJ`0lhq7hy41CeC}13Q>t!rwDN8pllL5Te(f0W@CUn^S{RPzt8Vyc4qZ;4Ry*gi zdz?OOh9KlY2*;tmYB7DO0swjfDi)P-{z*m<#z1r1c0b0e0j^3A+hnLf>``U3+DFqw zfS;cah}|%)ystyQmVTdzI{E}^)rDj*d=9dkF;6a$wOtkAb_TB(1Qg~?%?E39Iy01s ziCmAy$GLNc;$^)SMym{4bn>%_a59TzFivUQ@K|Fjka$6~gb%p-M~qrRux*+Wi#=g1 zqRj?D9kw>9FRp{%L4h3`Fv&eG7Fx$3@`M-agZ+Jkg}*MOB0Y!G@huCLt9xJ2Ki0E@ zl-g`_HnME&zuzo11GLZe#fL9-=heJ=3IKfPP%)v1ZSs`fANHb$-=qk5-N8K-{*RG$4h~kfX)Oy8$h*RVZ^A)7e?N4S3{CT zc;i6x>idD$0P1mN?N4ULB}0Os33^J+q#EP$uR0)aMqskkEywkU{N&BeI->N46ch+` z;?PdIYqNW#bgg&E4}UVrk=m6Sd@GEf`MjE3v&@m!FHS+t$Y{Q@gBTaxtr6;kH2|Kh z!nufWANO4{pbLkZpoakJOkC2S`1YO0qQG2F$be5P*{uhr+479V5_#Gp+ua6bR-J>` z2QLHSKKWbNch)BJPFV0+To*&nv=XBh=7f_YJ?w3oa>|G;%Ameo;Gq}BsJ9`SFlUg_ zl9WkJ75NTVbOequ^7fkL-M}7WO_#lX%Ol@an>KTkyH319!YG%hQl-wYbb=Hb=w2aG zQvYhMmz}4+rHcYbrLphqHJ+zQdf%pb0bxb9GGA>=lMP=>;xSDpg*^A<{TM!Y=sKeT zwco`Ls@6p|n()RlmoZ-__m3`uGxo7~p~8ncAGnJ$ejEjyzv|~T_!JTM=9ug_)Wsbdt=EHt;ELKInVj8zmYUi&>=mH zI5`B|p;gs$sEDvT+~#dX=pUXtxs`Fr+475lJ?QyM(nKDP`io>rgykQ$o6Oh(7=P(* zJf5rGFyCvx*%@s0gvPYm$f1f}7UJ|QtZ=7ye$>9md-GFME}>wC+5^rT-gXkVuBt>B z`PVuT#PHo>m9qo+5B#XhbW`q2fNg^H$_NR#Ao2;!ZsbDO%8|~Bh- zCQu1-#wf7{4+-@hFm_}=N#zXquc62O^zu3PmC5vDyFI6i(E;wqcH2*-Nf zA}#A6t74ecqRU%4A#8LW?MdDw7HUM39_+$A#`B4OZO?}nIgz__i;t*)DLNfvUOL9r zk>B|Yz&rX?O=nNeU$A|!xbIX&DBD>fY~`{?04K^Vegvuj5>YJm3QQ;yIgxv~fCODE zDOOGaR`1wBLVF6t1BI?OlyhkR^bvPLXxN$696?U^nN@Edh1t9KN5ptuSE56KcZvac zP55|d^7h3^!l5cW!&8cv!K4R3-8#^aJV2Or*^ax4e3Y!`If!By6xl~kQAZvSQiZnz z7NV@&?pu!b*y3*B(4ER*e@OZvmr7`r%B7!5kBLHaWCKhe-u@2nb&df=6}3$ZMFjs^ ze_?q*&ab6)3IPh5fMJN{eo^dZ@lx?5-u$lvdptoc1m!#Owc_&N&9@~DRg{ez6v=@2 zllQ~T!swZ}&ZRS#PD>5{m+`l(Kl&@@ped~MNdu;!u}PHOt()=~KG!=yVqwS!!6>H7eCbT6jm>JjH{)f}*hhtimp zHfoY4z7}?%&AO||KA}ewe^wOmpo+Sd)uoT5y|fB1jU;ZBA%W3>U*S7yov4$$iaJqJ zuk!O@%@1#sw(jCjXaT)fY-jcARlIjxaVrz&e#?5=c;%+Tdis1-FC8jXY4(U7;Po?5 zyuRx7mT2r17sW}{>l|M#MWJyfVG3bE8sdt+N8~6=W{>-fBUsr4G9I@_@Yu{+f;1bi zpS~U=j-J(RclN;|HR0{n*Gm1tP=8;mVe$4(F|@vaUIBzh72>E$;S-XqI2JzsT>@(C zYh@hgx@}#P%CPgZfGVHSs}x^BQCw)sePZK_TIHO9oi>`c`MDH>h|`VyJql%O7Rt_V z$ED=~CfA;`7A2BFs}?iw{4}PHBu`M5tLm);@fKb&$KwFd*#hLAhu)~75-vaJ?y1)E zkt_;V6&?PLq!tp6?BgR?1~{s+jY$9C@?&z>spSur(-h-63M#TAN;z_sDpF;D%3tsN zEIwHpKKbPeD&|Ve91r_xpSS;)=lxRoKY39msw*uLcQp8Ga{y#2zE0NzRE<%F^Z+~~ z%{sg7DW_%FBh|bmS$8L4!-kb5J&Dei8z;*;q!Zzz%d9@Cs(D9Pf)>eMe_@Sa#Z8am z6K`R|gWZ!c-aAW^HBw?eBP*Cn*a>>~U|-naSdIE~`1lwx=tvOHRY{~tCt(uL(?ITc zRj79J0ZnC341yc6V^}A_wq$T4>FfdZ4ppU=;K~vOxz+K6wf+hYV4(9(JLvgwFOJK% z6tmd!ff<1JU6$;ZvXANTVRO#JP&xIufDy7hab9`iy_m9}>>%Gwzh{iee{f8hmKiZC zSG`llljl2ns-)q6=FEOJj88;SXT`gr!LJCm8aT6>Cn9&*{gC5`euuadFTj&ieV`0( zM}0*Dh;0D?Up-Ti6xa!AMAR3xXm|6hXKIQ2t0G_rK;FI|DH(#r_l+>wmR|$wU4rHdU^P=p9SBi8b z_{WhuWO_E0(_e`&k6|^qaylB3BvJCCo5-2s^b=-5yy&Vf0Gk_idE6cEMA9k(=_-Ph zDkAH9CJ^hDSmHPC!lNq>@T~8q3f%aDFlk4Z#;wvso72pYD^48jk=|DvO4gW`6&F?Y z*JI-RqD+W$r>ep>SGqJ;&ve?>QpZb{2P}L?y}ia6e$DOX192WTV`O$+v`~rxr|2!% z(tNnnW8eo>5~OtEDyy$&=FoH)G(MlyhL-fj7jY0UXOc5~qK%)rhpM5Q*Qf!I#|rl> zlC9)&`&{MGO?2kBU7iwm2RwR5kICvV>2@&S_8aWWdRii&aRj=S5c*~QK zg0!^~!2nENOR(?T`z8sXt60)|tp`=-W|i;g<5n?}G2ZMGzqUF=QuF3_KcG`Bkp@%> zL)+n9Y|%lJFhX}4jblHW`g`3z;cg0N?aLu=NPitiv0W8&rvK#ZpKN}YFZS+)NCo3r z`^K+R?|`*OPN^9Hl9sGe0E>)M9ww(;h0MX6@$Sd&k56{BY#IFaP?-pQk1N{ezCRyFC=9Wba_@=jIFl^BBe3 z-pkM4!}dN@T=@J?c@IZ7dnocx%M=68JH9G@9=5*DcRZj%`gi<1?7*b|-1PY04ru=? ziT`Pu{O29yp$^t=K7S^pi~gTWHAAS-KN9%2`~B;ulK;BjpDmpKyp^Ag?_Y!b^VdHI z^w&UyR7B4&l|5|l*g1PRp3mn$PLYHZtbOeNYW^%_=hD*8^=JIvraxhbdy&{n2xOL>FsTGRRe zfqn-6I`scg3bmGh^mT_GSR1j&wbETAABUUR_|fICFJdgk`EJcl&N=knpJ1enAWF zqn8<;iz?c^Gza@XH(*^;Y|Wu)?qnM^X-QF4Z3MQX<@Yd#vb`@hz~x$Q`i2za5kQVH zukXz9rf2}Ih7p&W`u@>zQ8(LLb107`*=d1;4q4T^a#K{tx|93I`@K2J#_Y)xtMKO+sON29 z;lhz$IP!}L`NcqY>B?NXGM8f+RCGC%y6E=uch}^VBe-$|S0jPE@&y7FYB<0LmiN`8 zylN}biEobhn%MMabR{$y))zX~%ED0>u0S!NE?m>aP)T9MQIKPV zX>e8mBTOd6IC3)~M*(LzWa-M3u1qbbiy9l(qYhN z)56h^oweuWgnEk@0A+xodMu`?@88rv#SaS2a-?T0*9kom_eT7%XZoL`_M=nXUt}PJ zXCnhP6nudJcdQjLa57+fQ35uVa3%r!$lVJJxX1A#2JGQs?BHHxz{S2Z4&15S3oQ8a zyoiVBSbiJ@a*6*aw{Wd?fc-;&{`^q5b5GQTap<8c8h?Glq$nZ{NTcRpoM(Z%qfRJ_ zdtWwf2R}jus4E`}0_|_Z1Dt8DEi(~Z370JXlAMXlW7pK%-p0oiNxw6w!*@Xb>-)d$ z@v6|{54#6dcYIN^znh=L1;vJ}*(hLi&8BDK>)wd#y6Mg_4Qp}UZ1!bmHeKJC=a?7{ z#W@q#2va7a@H|lj$#{ywO2?Br6X(~L;_AUP52g9@X)cm63+G8LyeNWX=+K^VF+a)w z8o01SQg$VR?-mvpixwDW@ymeuVNe;bW0*91o!Z@6# zp9~yg^uBbBDGuUOafJ0dz^FaLjn0NFh$p%60t(zvx&h;6o`W!OgK@iPnz|8xhn(R1 zch9jhCX_zOikF0E1-x5U!c@a6sSfs2ZLs8aN~h7Jv!&Uj)8P0gA|qPsT^{Z$D?mG@ z?K8Y9*bkp2G4PH|566wub|e&YxmhIRAv=RgwdL+8;FVhVOQ%#523*#In3w=0%RI?| zn|(n#Gs|N|c!B{a`ey`aWn=sQT+0gY*TyYdqX-?5e%?otIGKkLEzI4F%g&(B5JHH5 z$01-6NM4>-gTD9?@s@cmkhwkgnw*_MliwB*KWuM)dT1$wN{VY7V(pGrbt!bN}IM6$qiid&*eO&P4Yf zYeV1i2g>TVnayNK2m%-kJirw3#8^}#vKk?1g?*XbQ|7|vJ_aZe_EGWxX2QPu?LoYH zjbwB;8PN(9#NKW3UsuAWLOKZC*z86Rfmf@I9>gd6Qo9Ecm)HleJ&3S>J@%CLTGwN% zNc6M0kFG3|^zg`j;7F$e*}?;)g$nNZL!!~qu~Lm%#yVmBZML7Q6P6I>GSre`{M|)} z@O24zY%@bp?QQ`0@5n-hXhwR7*X8Pm?--oLq;1H;Wz~o87%rPCAK)BtaONM941G!_ zL!Y5n$z-%M^edT+cZQzfQrpN6`sNbFef!#{McOQP#^fQ3CtdbuoIh=9ANNccd`Qveul*;>Vx@rNx|Ve__3M30Y>{170#e% z$wUz|7$AB?e;7~9M3+75>2m=I3}3OpOePwYK^K#WPGwNWWTI6WcD$2`US;rI$yBp2 z#gnOStwhMQge=k6umS=Ey&Lrk6+yCrFPH*Mk^o`uK*|FIx^cXgq#yRqkL%x(^kXsh zAHN(Bf*o+MM3Cj~>iE*Ijic@(dKtok4+-AIA6zk@RKP$79$-TU+l+5yVTW(H`ZAmg ze89ey82mdREvylAt>aFXwRs*|3H##{7D~}2`?C-M%EYJyDe|jfn>;fq?&H|sWbj2- z!v0!46>44-L@B zgz_tlk^OZ8TNym=Fi2p2P$=qXpg_~3ErL-V4bd8=KQQtUIvyCgK7&Su57%eVl2GyW znG*Kb3aIt#Gfb3VX6H_kh)4hJHYwf~IMbw140~Bq;hf#gXbpIBO4M9EB|rE+tD7<4AiVoT6DB;WXVR zi*Y2=2$zxVk8z~15iTby8slg_MYtu|t_ZiH8+CIWTqdK1n`8ZjtBQHi7>F3RfXiWR ztW!2ddZF2P=tV|mV#c3dx>pr7hSiCaZL8`U*vJ4 zaw(a~2&c$LML12dRE#5M65%r1tcr1T`WoSK^5GF~N&Yv+(dKr9TT$E<%Sf=H(Ek#%-i&M$t@E&c>fJT#Aq|?gzAw*_RZdSIi%9OkYy0g<}4IWBQUJevD;+ z4NDCa7bPS|iN(Q=pAyuNP}>Ptz4eVi9f5WUtbk$zG*PCVSwR z>{Uv!O5Dbp$zEZa$2zXmg3VRnnCz9ZJOA^3sFcZGp(DHv6pZ;(ipftYO{;^b4bA%t z(-hB3g&}7$P&oy&QGH7`w}_S4_b9bu_CVnlGVjNlk1sAdvwpzA#rmu?Ewm&4bV}>x zInM}#SwFPmIt1~terQdBV^m+pbX@6-`8TC=+C+(Hb3SMElG#ax>B0N4qE%2--w8d% zkh6Yd3tG3%X){bXhNFv-aXB96AgZJFQdA$5m*bdiR~dxL%7H;P=NJK+5M+E zE%b%SB|G6imNVOlJfE_n6gGQ%{!95E%HW~Ix6gIm;ZHP8$7k~Lcv}Mu5U$z(Ro@t; z&0>+QjmmFU8~8r8$@1GAUa&y8^0${u_~YreLu!p%w&^95 + +Proposed Changes to PortAudio API + + + + + +  +

+ + + +
+
+

Proposed Changes to PortAudio API

+
+
+

PortAudio Home Page

+ +

Updated: July 27, 2002

+

The Proposals Have Moved

+ +

+All PortAudio Enhancement Proposal documentation has moved. On the web site, it is now located at: +http://www.portaudio.com/docs/proposals + +On the CVS server it is now located in a module named "pa_proposals". +

+ + + + diff --git a/portaudio-v19/docs/releases.html b/portaudio-v19/docs/releases.html new file mode 100644 index 000000000..aec80a1cb --- /dev/null +++ b/portaudio-v19/docs/releases.html @@ -0,0 +1,339 @@ + + + + + + + + + PortAudio Release Notes + + +  +
+ + + +
+
+

+PortAudio - Release Notes

+
+ +

Link to PortAudio Home Page +

+V18 - 5/6/02

+ +
All source code and documentation now under CVS. +

Ran most of the code through AStyle +to cleanup ragged indentation caused by using different editors. Used this +command: +
   astyle --style=ansi -c -o --convert-tabs --indent-preprocessor +*.c

+ +
Added "pa_common/pa_convert.c" for Mac OS X. Start of new conversion +utilities. +

ASIO +

    +
  • +New Pa_ASIO_Adaptor_Init function to init Callback adpatation variables,
  • + +
  • +Cleanup of Pa_ASIO_Callback_Input
  • + +
  • +Break apart device loading to debug random failure in Pa_ASIO_QueryDeviceInfo
  • + +
  • +Deallocate all resources in PaHost_Term for cases where Pa_CloseStream +is not called properly
  • + +
  • +New Pa_ASIO_loadDriver that calls CoInitialize on each thread on Windows. +Allows use by multiple threads.
  • + +
  • +Correct error code management in PaHost_Term, removed various compiler +warning
  • + +
  • +Add Mac includes for <Devices.h> and <Timer.h>
  • + +
  • +Pa_ASIO_QueryDeviceInfo bug correction, memory allocation checking, better +error handling
  • +
+Mac OS X +
    +
  • +Major cleanup and improvements.
  • + +
  • +Fixed device queries for numChannels and sampleRates,
  • + +
  • +Audio input works if using same CoreAudio device (some HW devices make +separate CoreAudio devices).
  • + +
  • +Added paInt16, paInt8, format using new "pa_common/pa_convert.c" file.
  • + +
  • +Return error if opened in mono mode cuz not supported.
  • + +
  • +Check for getenv("PA_MIN_LATEWNCY_MSEC") to set latency externally.
  • + +
  • +Use getrusage() instead of gettimeofday() for CPU Load calculation.
  • +
+Windows MME +
    +
  • +Fixed bug that caused TIMEOUT in Pa_StopStream(). Added check for past_StopSoon() +in Pa_TimeSlice(). Thanks Julien Maillard.
  • + +
  • +Detect Win XP versus NT, use lower latency.
  • + +
  • +Fix DBUG typo;
  • + +
  • +removed init of CurrentCount which was not compiling on Borland
  • + +
  • +general cleanup, factored streamData alloc and cpu usage initialization
  • + +
  • +stopped counting WAVE_MAPPER when there were no audio cards plugged in
  • +
+Windows DirectSound +
    +
  • +Detect Win XP and Win 2K properly when determining latency.
  • +
+Unix OSS +
    +
  • +Use high real-time priority if app is running with root priveledges. Lowers +latency.
  • + +
  • +Added watch dog thread that prevents real-time thread from hogging CPU +and hanging the computer.
  • + +
  • +Check error return from read() and write().
  • + +
  • +Check CPU endianness instead of assuming Little Endian.
  • +
+
+ +

+V17 - 10/15/01

+ +
Unix OSS +
    +
  • +Set num channels back to two after device query for ALSA. This fixed a +bug in V16 that sometimes caused a failure when querying for the sample +rates. Thanks Stweart Greenhill.
  • +
+
+ +
+

+Macintosh Sound Manager

+ +
    +
  • +Use NewSndCallBackUPP() for CARBON compatibility.
  • +
+
+ +

+V16 - 9/27/01

+ +
Added Alpha implementations for ASIO, SGI, and BeOS! +
  +
  • +CPULoad is now calculated based on the time spent to generate a known number +of frames. This is more accurate than a simple percentage of real-time. +Implemented in pa_unix_oss, pa_win_wmme and pa_win_ds.
  • + +
  • +Fix dither and shift for recording PaUInt8 format data.
  • + +
  • +Added "patest_maxsines.c" which tests Pa_GetCPULoad().
  • +
    + +
    +

    +Windows WMME

    + +
      +
    • +sDevicePtrs now allocated using GlobalAlloc(). This prevents a +crash in Pa_Terminate() on Win2000. Thanks Mike Berry for finding this. +Thanks Mike Berry.
    • + +
    • +Pass process instead of thread to SetPriorityClass(). This fixes +a bug that caused the priority to not be increased. Thanks to Alberto di +Bene for spotting this.
    • +
    + +

    +Windows DirectSound

    + +
      +
    • +Casts for compiling with __MWERKS__ CodeWarrior.
    • +
    + +

    +UNIX OSS

    + +
      +
    • +Derived from Linux OSS implementation.
    • + +
    • +Numerous patches from Heiko Purnhagen, Stephen Brandon, etc.
    • + +
    • +Improved query mechanism which often bailed out unnecessarily.
    • + +
    • +Removed sNumDevices and potential related bugs,
    • + +
    • +Use getenv("PA_MIN_LATENCY_MSEC") in code to set desired latency. +User can set by entering:
    • + +
          export PA_MIN_LATENCY_MSEC=40
    + +

    +Macintosh Sound Manager

    + +
      +
    • +Pass unused event to WaitNextEvent instead of NULL to prevent Mac OSX crash. +Thanks Dominic Mazzoni.
    • + +
    • +Use requested number of input channels.
    • + +
       
    +
    + +

    +V15 - 5/29/01

    + +
    +
      +
    • +New Linux OSS Beta
    • +
    + +

    +Windows WMME

    + +
      +
    • + sDevicePtrs now allocated based on sizeof(pointer). Was allocating +too much space.
    • + +
    • + Check for excessive numbers of channels. Some drivers reported bogus +numbers.
    • + +
    • +Apply Mike Berry's changes for CodeWarrior on PC including condition including +of memory.h, and explicit typecasting on memory allocation.
    • +
    + +

    +Macintosh Sound Manager

    + +
      +
    • +ScanInputDevices was setting sDefaultOutputDeviceID instead of sDefaultInputDeviceID.
    • + +
    • +Device Scan was crashing for anything other than siBadSoundInDevice, but +some Macs may return other errors! Caused failure to init on some G4s under +OS9.
    • + +
    • +Fix TIMEOUT in record mode.
    • + +
    • +Change CARBON_COMPATIBLE to TARGET_API_MAC_CARBON
    • +
    +
    + +

    +V14 - 2/6/01

    + +
    +
      +
    • +Added implementation for Windows MultiMedia Extensions (WMME) by Ross and +Phil
    • + +
    • +Changed Pa_StopStream() so that it waits for the buffers to drain.
    • + +
    • +Added Pa_AbortStream() that stops immediately without waiting.
    • + +
    • +Added new test: patest_stop.c to test above two mods.
    • + +
    • +Fixed Pa_StreamTime() so that it returns current play position instead +of the write position. Added "patest_sync.c" to demo audio/video sync.
    • + +
    • +Improved stability of Macintosh implementation. Added timeouts to prevent +hangs.
    • + +
    • +Added Pa_GetSampleSize( PaSampleFormat format );
    • + +
    • +Changes some "int"s to "long"s so that PA works properly on Macintosh which +often compiles using 16 bit ints.
    • + +
    • +Added Implementation Guide
    • +
    +
    + +

    +V12 - 1/9/01

    + +
    +
      +
    • +Mac now scans for and queries all devices. But it does not yet support +selecting any other than the default device.
    • + +
    • +Blocking I/O calls renamed to separate them from the PortAudio API.
    • + +
    • +Cleaned up indentation problems with tabs versus spaces.
    • + +
    • +Now attempts to correct bogus sample rate info returned from DirectSound +device queries.
    • +
    +
    + + + diff --git a/portaudio-v19/fixdir.bat b/portaudio-v19/fixdir.bat new file mode 100755 index 000000000..92d6c7470 --- /dev/null +++ b/portaudio-v19/fixdir.bat @@ -0,0 +1,19 @@ +rem Use Astyle to fix style in 'C' files +cd %1% + +fixlines -p *.c +fixlines -p *.cpp +fixlines -p *.cc + +astyle --style=ansi -c -o --convert-tabs --indent-preprocessor *.c +astyle --style=ansi -c -o --convert-tabs --indent-preprocessor *.cpp +astyle --style=ansi -c -o --convert-tabs --indent-preprocessor *.cc +del *.orig +@rem convert line terminators to Unix style LFs +fixlines -u *.c +fixlines -u *.cpp +fixlines -u *.cc +fixlines -u *.h +del *.bak + +cd ..\ diff --git a/portaudio-v19/fixfile.bat b/portaudio-v19/fixfile.bat new file mode 100755 index 000000000..48f6fbc2f --- /dev/null +++ b/portaudio-v19/fixfile.bat @@ -0,0 +1,7 @@ +rem Use Astyle to fix style in a file +fixlines -p %1% +astyle --style=ansi -c -o --convert-tabs --indent-preprocessor %1% +del %1%.orig +@rem convert line terminators to Unix style LFs +fixlines -u %1% +del %1%.bak diff --git a/portaudio-v19/index.html b/portaudio-v19/index.html new file mode 100644 index 000000000..91e5b4c38 --- /dev/null +++ b/portaudio-v19/index.html @@ -0,0 +1,89 @@ + + + + + + + + + PortAudio Implementations for DirectSound + + +  +
    + + + +
    +
    +

    +PortAudio - Portable Audio Library

    +
    + +

    Last updated 5/6/02. +

    PortAudio is a cross platform, open-source, audio +I/O library proposed by Ross Bencina to the music-dsp +mailing list. It lets you write simple audio programs in 'C' that will +compile and run on Windows, Macintosh, Unix, BeOS. PortAudio is +intended to promote the exchange of audio synthesis software between developers +on different platforms. +

    For complete information on PortAudio and to download the latest releases, +please visit "http://www.portaudio.com". +
      +
      +

    +

    +Click here for Documentation

    + +

    +

    + +

    +Contacts and E-Mail List

    + +
      +
    • +If you are using or implementing PortAudio then please join the PortAudio +mail list generously administered by +Bill +Eldridge.
    • + +
    • +If you find bugs in one of these implementations, or have suggestions, +please e-mail them to Phil Burk.
    • + +
    • +If you make improvements to the library, please send them to us so we can +incorporate the improvements.
    • +
    + +

    +License

    +PortAudio Portable Real-Time Audio Library +
    Copyright (c) 1999-2000 Ross Bencina and Phil Burk +

    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.
    • + +
    • +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.
    • +
    +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 ON INFRINGEMENT. +
    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. +
      + + diff --git a/portaudio-v19/install-sh b/portaudio-v19/install-sh new file mode 100755 index 000000000..e9de23842 --- /dev/null +++ b/portaudio-v19/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# 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}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# 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 $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/portaudio-v19/pa_asio/ASIO-README.txt b/portaudio-v19/pa_asio/ASIO-README.txt new file mode 100644 index 000000000..9fb74ae16 --- /dev/null +++ b/portaudio-v19/pa_asio/ASIO-README.txt @@ -0,0 +1,137 @@ +ASIO-README.txt + +This document contains information to help you compile PortAudio with +ASIO support. If you find any omissions or errors in this document +please notify Ross Bencina . + + +Building PortAudio with ASIO support +------------------------------------ + +To build PortAudio with ASIO support you need to compile and link with +pa_asio.c, and files from the ASIO SDK (see below), along with the common +files from pa_common/ and platform specific files from pa_win/ (for Win32) +or pa_mac/ (for Macintosh). + +If you are compiling with a non-Microsoft compiler on windows, also +compile and link with iasiothiscallresolver.cpp (see below for +an explanation). + +For some platforms (MingW, possibly Mac), you may simply +be able to type: + +./configure --with-host_os=mingw --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2] +make + +./configure --with-host_os=darwin --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2] +make + +and life will be good. + + +Obtaining the ASIO SDK +---------------------- + +In order to build PortAudio with ASIO support, you need to download +the ASIO SDK (version 2.0) from Steinberg. Steinberg makes the ASIO +SDK available to anyone free of charge, however they do not permit its +source code to be distributed. + +NOTE: In some cases the ASIO SDK may require patching, see below +for further details. + +http://www.steinberg.net/en/ps/support/3rdparty/asio_sdk/ + +If the above link is broken search Google for: +"download steinberg ASIO SDK" + + + +Building the ASIO SDK on Macintosh +---------------------------------- + +To build the ASIO SDK on Macintosh you need to compile and link with the +following files from the ASIO SDK: + +host/asiodrivers.cpp +host/mac/asioshlib.cpp +host/mac/codefragements.cpp + + + +Building the ASIO SDK on Windows +-------------------------------- + +To build the ASIO SDK on Windows you need to compile and link with the +following files from the ASIO SDK: + +asio_sdk\common\asio.cpp +asio_sdk\host\asiodrivers.cpp +asio_sdk\host\pc\asiolist.cpp + +You may also need to adjust your include paths to support inclusion of +header files from the above directories. + +The ASIO SDK depends on the following COM API functions: +CoInitialize, CoUninitialize, CoCreateInstance, CLSIDFromString +For compilation with MinGW you will need to link with -lole32, for +Borland link with Import32.lib. + + + +Non-Microsoft (MSVC) Compilers on Windows including Borland and GCC +------------------------------------------------------------------- + +Steinberg did not specify a calling convention in the IASIO interface +definition. This causes the Microsoft compiler to use the proprietary +thiscall convention which is not compatible with other compilers, such +as compilers from Borland (BCC and C++Builder) and GNU (gcc). +Steinberg's ASIO SDK will compile but crash on initialization if +compiled with a non-Microsoft compiler on Windows. + +PortAudio solves this problem using the iasiothiscallresolver library +which is included in the distribution. When building ASIO support for +non-Microsoft compilers, be sure to compile and link with +iasiothiscallresolver.cpp. Note that iasiothiscallresolver includes +conditional directives which cause it to have no effect if it is +compiled with a Microsoft compiler, or on the Macintosh. + +If you use configure and make (see above), this should be handled +automatically for you. + +For further information about the IASIO thiscall problem see this page: +http://www.audiomulch.com/~rossb/code/calliasio + + + +Macintosh ASIO SDK Bug Patch +---------------------------- + +There is a bug in the ASIO SDK that causes the Macintosh version to +often fail during initialization. Below is a patch that you can apply. + +In codefragments.cpp replace getFrontProcessDirectory function with +the following one (GetFrontProcess replaced by GetCurrentProcess). + + +bool CodeFragments::getFrontProcessDirectory(void *specs) +{ + FSSpec *fss = (FSSpec *)specs; + ProcessInfoRec pif; + ProcessSerialNumber psn; + + memset(&psn,0,(long)sizeof(ProcessSerialNumber)); + // if(GetFrontProcess(&psn) == noErr) // wrong !!! + if(GetCurrentProcess(&psn) == noErr) // correct !!! + { + pif.processName = 0; + pif.processAppSpec = fss; + pif.processInfoLength = sizeof(ProcessInfoRec); + if(GetProcessInformation(&psn, &pif) == noErr) + return true; + } + return false; +} + + +--- diff --git a/portaudio-v19/pa_asio/Callback_adaptation_.pdf b/portaudio-v19/pa_asio/Callback_adaptation_.pdf new file mode 100644 index 0000000000000000000000000000000000000000..76bf67863524626aa079d74629c9dd9f720b0b54 GIT binary patch literal 50527 zcmc$`by!`^@+OMAy9WpmeBceTl3PUGqls>;1qdjElN3HtASMuN{Q9lyNnZ(&UB zC?oVLg8b83M>Vdr)yS307`&vCP}05i+OyoELkyUVQBV!9Jy<>lq!R|1d}&21vresu zC$cHPF`omm4w~9HH9m0w9T9D#1;NFj@~dOr5W}o;Qp+f&l1ENlrDjcvFf&Fl>Y3jp z8EB2i8X9%C;}C)4BT0UkK_=r!dZy(Y$DWhD8yqyyUT818=R@vUuZ9_fJ?Rhfwg&;! zNm39)=cb^etGqsSDNgL7T?Tc|&J89L zIYNdbcl%qUnfKHA9)oU}+G|+<_t5c}Zsx7lxV$VuTe#dh4XEt{9UF0$JtR}SVH-)4 zUf6xA=vaP|iQ z!v_la)kz3<8r`2t?!+@pF?ByF?RnE&4-iOm``K(2ro5=n2UIdAip$xtzSzJ>T@lqzYP#b2c`JxOHWT+hV z_@o^iY0%a=1ngAjSH=`~KHXJ*Lkg*T}x& zjY8a5m0&n`2Vlr=ldz~kXV;6V;871+X&6nW2n~PUyIMD5g0YQP*Ra&Ko_MX&P960I zWux>w2?q>5et&&7`@~~MbHA7}V0BueN0lfw#r#4Lz7OV1NdT#cU>Q1WU2r53CoZ;X zfwg`xtN`?*W-mdD_xh+_*fc=;p}v2pcmx=kEOHq{Eq~>P+Q6gs8EYYi;#gIKE#8U^ zL@~1CKaR;?(Q;DH^j6KVP|mOr8AtRP_?e;_H%V4o0}oPsal|>1pVUo`#$m-yJJ$de za`v)lf3;)iSwn;1x97(C8~$MSAS&$b@F7(NiSlLB{NB0PFKf)i3wT+HHoL66gBVR%{h2{GV(?xF)%hVKPx;%FUX{;6^0>M)|xR@obu}yA=QTcS&>hHF3H8 zQaiY&{|gM_&PTG>Q?%Qby=TU+Si5U^XvUDcQAXp&L&!BW#PPU|(A?>d1>x)Gdu>xn zbFwpEUd5m&8>0)V4_ZnVOfyP8J`wo6fQF?TX>bhiB+G4WvY?Zg!9@E5CS&s)lw}-IW z77ck&zQVI^Pt%>1mACWCvOfgBG_Z`O>qdjqhg*)cU)nXF+#&fj@ZtxZ!)tmq8d$+0 z85reE*D^>YX(-8YJ#)*^GNrgmkxp+IV_!S$jq*voN0lqa>T~+kGDUik6~-hN$v{KT z$i}B#4isER&pf@@Q1huE2uUeAjt=hVT^kd#+mRP&Z_;>38=SP7A^TG0;XM5yGNp@D z#&z9+Z^~3V))33&H(HwLLmVt;F1=w2p#x8cC#k`s-+;9?3hskEtczo`nQpiFx$YQ0hb2}P3w^2=&57>zMtMp0E37k8m)%fTmlqR4ZnU5Z z$lGG)Z2Xm#9LQmVA3|)LC~jJ3B_;G!>B|G9nR|8Bge%&{P=c{wO3~u1g~@qy^lrVk?H{60h1J<26A&E)q6)pTN@|RKUgWjOv?7& zT;*M2A!Yxk#7fHXPl=tB^DpTgF#+OkPLirl?{VKMWn#NE#KglDGzg zE_H9RG%QIB3_OyF(1}vjCdX1iTbvKSN8moDz4=2!{qB(@h~tVLKCFft9(y+t4Dj47 zaKVuwP(Han5z4C8as!fnAFxntl#y3yCuG%0#CaoA~gKgr_u#%vxKo`R8yp z=WtZhleS|^t>;q8#EQf#nGc=|UXMQym%w%9f{66Z!UE8P4xLplrFC8v;~IQy2gtuy z`^I7CjdvV))rv*e#P~Xlx-mT&@faar4wch4tz49G+xP{sC6VK2U(b8&gav5So4{6; zt_ww2U`Pu{P_4_76A2TN8MDE65Zw%SU^$!~(}tORAE3bLWu5tX(1_$sfbP6xqK>Gc zrqH@-GMeJ(izlyrwjkd8faVwEWC`9cFQ$w%k^(P7Wh^#D<;hpzFZ%X&SJPP=xm8I| zLOea#S`Rmqm=tMA*powgzsh*dJ8a0CPP(N78jFzT;c)g@rHR)olIagK;9n^cxK>fm zvcU!z&CnBYWYH24T(Qa|I*tW4CzKA~23cDm&~1Txs%u-xn$29rtzx?IEriEORTWS*S;Nm-V1!g-TGUPyokRyI$Kk4%P|->2XX~gtD_*6W zJTsrxRuaQvgho0W*c9hf#l%~f6?uFwdh--6cOL1#$YayY$VQxbB+E;F%jgtuB z#1}2yyE5LVKpjxX{c1{I4ZIEFqm8uqmC}j7>gom^)UmA*FxM9a%dBsjAJj6TCUCu zBC4XSP2M*I3nUAb0losqKuk7*G$$pMs;b(_z--TaR6v@G29~t#s>)ib$yfi_rADs3 z!f>I(c5u|$%{IH*gE|f*i#(T7H`QlM6PRE1sJc!G_E8oD5{^)Y;{ezD9j#J@L|nZ+ z_;ae9st3Q1SwctLdIDq}FHQ~dOeIJCwoUqLD!k@-R*|ri;=p6xqCJxq)8jn2eUpcw z^P-6r4ubt1U8kzK*_v+-BdWF=hCb(+#H){-AJvk+dFBe#*Xsz`9XdaD6)7lHa2aKW zm1I9~F`d)JO^5dE9-8qwA!7|Lp8q^Sn^g*~?0#WC547BS$g$;}PX7|mU&^b&A7v&^ z#z8t-uDWmmkv{)fh8qk>>??FDO~BobP2t!Ur|P+%Ah!fc%*yuc5(ess7m0ux%@uNe z1Bb6+trd7SV#9(PvG(hZ`6mvwGl?DhS~6BUGzPLhrD%Pn4ZbHr-n(!}k%Q%=dzJ`E zwMGuh-BD;Vcdh)1Vx0vuxujel+#nww+YzoicKu0&iuXv&a#tV4dJmy^EyfUi@+(Vy z!~HH_`e>!^`u(?a{`s)iAye?CC}>5fxa?{q4w6YfPaGxd8`js~*zs4ec!I{Xi~CJm zknw$V&^@l^QYP`eii1LpJB<(kpP50Za@I~}M=gr$yDPJHjG#Fqgk@h7qBh>RrG``2 z(tckTipgGJ&1~xITm5T6?=9Lv79z~|kH+Ax3{OHoev@Ihez3aoRYeb+jDBe4`waOz zGc$??)}_HLnaNZC;oclvbvrE4mt5qHt(+@8h*AZDvzxHm?)Y0gKU4&C4R1tsdn>P& zn-SDl_RCTUVW0nH4fAF|;Q`AoHDcVU*LLHp=xD@%8 zWXcI)fp6)SBsGnV!v+0IqzBo2g{z*?R}Uc(zi&ftjH20^7*wun{JTobzx3OxD1th{ zN#QrieIUHA(h=h;A-}qezae^!-!{ z$lMw3gkd;6bsGT8DLSo=EJ_3B_&)Xa3r6{NZnB8hpMl;47wx-HWV1|sWDVZh8UycE3>`WJucY6OZN0&lD@b(Xy`Xvc0}>NT zZNT23<9qfG>7TWBgUAtP>yZ_#NBzn_TO|^E=Bd2yedXaElP08jA}3ayBCT)SHVYM) zQKM)hl%o%_N4+LXyVn&`dZ*0e$F)H{dS&!crWL;qp8RS%o`fBZ=$cP;JRxIdc|9Rv z8QZ%!wRlm_ksr>s)(ER_a)GSV!Ko)I)#E$ z)O>aZZ<$y3nA~)pS-zYP&f1G+CO;L6Wnap2E!uc@+2Zh_5?krCN6&~I6?&$78eY_# zf6yrDoEonxDc?riv6lRh1i$8K`-( zrapgb?wPOHsr3L~s+h?a|AF=chGRG!QVM|-PWy+#>m9Tc!mVRpg+-;FA2I1?X=mA= z%flx%^ptDeoio=el~=%J*8Q>7`!ADyn?&#{y{vFIdO*UXv z939(R>PASKE&^V>v|Y=-tCQ6;N9ucS6nUt4SRJcbrP+fAcbnIcUylQ?G2^u0D;z&u zA6U}QR7BUhvBxaDb#>Myd%eRR2YJOv$!fkyfvKR6+sXOyq}vEC;_7{+D>fi_^_Qx^ zQtn|E1{vzcX|<;>KMo?Q#$xK4#_(yguBC*Ia<#$JMQO}**xpEfe-#tkLfeY7+vxsL z#b|XUhTznHO}5|pf`~YIv|hBr-m*`a-0Tt-U`Q7DWZ~tINVwng`Y>>#gBlzHt2MpL zEcAb=P%b{u(FA~Z!H?n5b_V7IiDe7AVPdX%P#CCU5QXS3=}OTv@p^Bg+yjPatSwvZfh=?&44SZ!z9A{`sL@>cG1>|3 z_m}A^6o1nOvg~00Y~hXGDLc{Vqo>8$%nP1Et0t&jdwRf9V8{T~7cKSi;7=j#O7W~?penr*V| zNbrQ$+=z>&*b%q4%||3S7I@fj)QbN2!Oi{&Yb*!<1M=OI)Y^4F#fR(A0KmGv0QuEL zibjlJ#ey+p#m7hrf4GWUcnJ(YrKd^OcsR%bDT%3lC`@$KNE4GH{E;+63jc$F9;lD# z^hOlyJDK1SPlLk>tnr*ZQV8$F6P~n~E^|Dt+mtUhtprQ$6fhqSr&Gc$I1WpM^SdF1 z9~~;QijH6c+{XbajU=nVq&PRX;CLleR3@nAs|&MrNmzFz{9nQ15hke(wsk8Hlp1^| zL!mjvR|}Z%+hpZ3w5(3ASwRi zy?lMa63kU40OL3=2NmrX5omG#lNo+R4niXTjAt_lQPt!5=SUHs-Q3oI25D+T_m< z%|M#BQ9oC4)n4y-_IjjmFo@sRhAs69;i6GAnop%sG~ z{m$!yiAE|rsrC^nZmW161_${X+zrcF?BJY}t@=us5f&8a#T;LJ50A2li?Ej?ws0A5{eAvePh#aH@RtVKPWrS zp-B`eh&9Wy;1>4UQGW)up+s!Vje|T6Rf>=Z25^PV#_e=A*DI~Ss`NWZvN}3UEgpxo z7y_8DmW#Zn^>OZYsmDcrX1&uXhGK^?|HgXwLyP#-$VY>ox#G)!So-o zC@axxTsUtKzab4Ent4FjoYp=2IjnODnJ~I=Xq+!(lL7Q|jTqXcGx6WYm!>+fXyR(= z)O+${zg2{~a`XMTy4f(be^gY!TOq=U#CY{HK&P}Pikom39S ziDg&!%yIw}rZzXypOa?liQkqjV+%D&iN!`tsR$e_#GnoIxt+p^pQ1&_`pnMYqmD}K zRXLTQKsNoj-lp?_)*8haI z+hloZo6<$e;cTKhc62;}r=p6=i}N{m7`VfJM&4hk{G+`1A+*QO%6@M6i;%OYBkmk9 zi@~Z9elP{oF}N=sU$>WIwuW9F3F!>O7^Lq=_=G?2U0t*o1iU)T_kD#n2a{61lyRnd z8BsXU-lBC&U-}WE;vAmN7{9MAUP{nOo_FG%RmR_Kk}N{^6>_+d(`PGQm<-;vxfAI% z(*lj02$LnR*4?BG=7Kz~3k0fyG1Nrk$`8BBjxW)s#jIm4Lef~&a_}iV)lh#rUpAB1 zaF!9CF8`Qnz>EmVte&71)n6j~n>$q3jkI<2CILND(uxGeBAr6Da2n?W$^fLoSK$?B zgNu=55*7zt<0JWb# zpI(G=U@+Br36~Qdv8Z6?iAw5(MVkcZ$N2=qus}#m1;LRM{i&WtJj*pO} zNHe$MLOjC$@$1Z{Q^nH`MHSX+&YTmUo0NI6^FS*q((syXo5nd1(BP4Ls`*HQK*T0a zY^jhfp|QVqkS9Q*ANLV#MxX3ShN-${B@Bepbj^1^J1SI2)0Xa??dO-hDO7d$yVr}{2uTta)Djd~oHW*UE86_H-OkVe zZ#t7`ADDn#O1j;Z3Ot8}#Q4FgG@#o!KVR&InU}Bk2)*xXDy~;JO*eot*T!g5aBen6 z#-~$-OVC=kO9S&ES3^%?oKZh!<+kFQqSfkrbUU;6ix8t1atz6-hX@|7GxS<%JB;51 zHm|F|MI>C_W6aPDymd1qXVy29`!5Y_lYMjCP`f)_S~H#}170LW=jc*FjROaKI$I~V zTi>cOW^ZA}8}vjtQa)XVs7-}!Wz1J_rD7MIBDKOVVSoO#R`yfq(F8t)N^E%fli~O7 z!U$^jR8zYaI8j*$$$?A{BQ=P}c}&Ogj{~R+2|`ZIN<{N6HEn;16_HKHG( z=;SF&p>vz^JMi`|AlC)?#$xsX@$(pq<7jXD%4X<`CFj_OUU%A59bW-c z=f!geZ^XX&(}rYBi8rq3j5u3!WYvsXTZA7roPFU#!Weyidp2{!uFcCwRD$l$0+2Vh zVYhIdU5kCUI(UX5iv3xlAX4)qxNsEMGbRsHIOJ}nZs>iu^7%)2-I#%b=1B&|dLo36 ztma;V$1+b&NZtswa7Tez1z-BuDb?J@EvDdoP{Hh)}Q(*l|!*4Aile82*$3zq7K z0z-Xfs@|G_bs1GT-p{xwq`GFvzoBF;SmhBnp9y{FgwB!i~%`-Nw+$Cvrws!V~=iK z!F_%8?i<2tu`4kJOK))P`0wqB^P9}xUDEX1P4&`y0c+<$@U`cHIPSs^E35Qs0a9zK z8_AwdiB>U-@G(k@U{SLbAAXjP_>Q_v?hgyJLAR17jenW*gGG630}zDraM!m$^%gZg zRYBx2S3XY9{}h0=tA;(X5Yqxj#u5!gl@ z)p3!`Q;!7}5>#Z|2;zswRrj<26XuVC;4omk3?(W5##s8}6Z+e7`M+ZTAbRf{57FcaufOYN;=QT$cX_*Ahk-_7~UU9P!K3%%ug3Mz&TN zOZbeP+w<^DcM`>5Dq}^F2ya{y<<|GtPL+}f9t_hK4@r5(N?Q!lV#8ibW=ODXN2pQC zWriZ=j*MHvJOV|#ue>&AwYespx^Tu@0V$nbY9jVGI`c1HJZ{ftW3L^zd+WkhA(9Xx zB%;*5j>X^VM5ZpUetS~fVIQA|Eh2lp>3GRRcEYpDFnxMEZ3kMbLq*8#h#OhWROB%~)-Vv)Cw< zAP^Wcs+hYwDRfti+WbpWja$UKJ247l#%~nUk7S5*dne`i?30VGHvQl%2KtJ;Ge7)j z|9mg858tdxG zIpa+zKNJm2>kw({?5Q@rS_IpNq6-IuGgBBVW||H|hVHuu*PJp3YbXwXddL|vv6U5o zERz=Dyeq-_S$S9dA)k^!i|lr98g9iaFI%AzfriRi+hl+sNg5nc{D*?_NcM^eyFl3j zHibBXX94nwe9Mrgbbuh%8Le}2qIJerz>8z@Cv88^1TQ@e?Yfl{WNH0msIvPhNTiRa zeYlS|qsVmUZ8Sh_8&~VR`WTTCtgKB+_cC3)5$cm5K)doI!ioNtnPR+jbiw{wBM%_K zzf?ZDK=Nmty&XOO>N0PS^bKbEpjtjIehQTl!G5JuN+mDMSJ{O;iCH~$p-%D3n%nGZZ?#%#8 zob`^8=1(to_l|Kn%2;21Qiu!Vk+57b`{;zgl2k$r+Xpp-YPtXBaMhTq*@V1OhM2*U zMEe{EZjJCWafM_paWkih7eaQ43&XAF`=dzpWSn;yF+7D85qxBtJ;iW=i;2dewxOm+ zh`o~phEjMiwE4av8|(JjM|4j%c6bGb3rXA}swjpx*aWyJ0@&1^S?&TBmB_<1)xKaP z)cK{tr@$nwj{G*%RuOlbFPF5QFNU&D5R!y_OMw zA}tkPz+fk)A=OKKIJ7!bLlA~N`}sf{KMn?%=b^hp4m4&xHvp+`ILm5m^BdC5bk~yL zq~2Gvompz_xaPfJ&mZg*&YF)=OyQ2)q;;II?W##7$6Qc)I^jUWgg=zbuLpo~mypZrcuf)w>t|pbA%E^?T3+^t_EzK?fQdNDQA)V4gph5qJdAoFlXrCf)n&um3Lo)ZHlMMDt`Y=KL<@e(! zUJM&~;zG-!aHnbZ7YcTxX&pA6fvv^$=xJNCb>gLzb25GaM%gL3`uq}{GnHV72Zwe` z1`A=hx3qORWG>A_vv-}+2I8X@okvB#Y%t=MzOo+(2Z~1@6Mji;LB|SnVsE@&jJmw* zs5y!UH-N@X{m{LoNXYb~R5+jdN(!(%$N25sH=a+3lk+i6!AM^@bQEC{Ew5_acMP2u zxU%EOWBi>BeqMgTC=B=kGya}YDHBx(|C9#}*CRIbh(jmIExx=sXE469TK*!QRu*Sj z!lh7QEqt;f{y?Hn5gJ8)eqdQ7-EnP){;U-ax4lj51wv~R;OI<2-}l6tF4~5PQmX&` zY0C6UC*eRlfs6(#-9GVPr8V2hDGQQnhKg{9i*SDk^=z0DX-isypfqe?kVt$?660ky z#mnvSu)>{Cz^e?H+Xn`g#s1j=`tHm1Gyba{jhw6>0O#t4((UO8wmb<}sQK=W_8H~8 z^S30dMr$W0LYWI%dQn)Oy5wzNS{f|dxlTZ?yMBHOUs0D?l8(ay>!~E^3tyPMN6KL3 z{NCxBP3&D8&4Ix?3{O;ao&Jw7%<`{c82?)^43OX?W%=Vj`4b|-P0I2oxJ2bo1m%Ag z55n@V()kq<`!cLcYmAYm_H=dv!~ z){`NJT!{P?HFt@DWMVM^TNTGxxlgJpBKNUEEzi7ud_f`Y<%aH3bNRkpI(<3)oG-VJ zN)!t@!}C#R)jGSP?Fl&7C=({qwF--|hZ8|=Z7owS(i+IWLw&@Xb$gI0SC#zlQ=lTi zGK9eDIkchsjuiQbOXucI`_VOXU2ljI{j`>@U7SA>ZSh;p%4|$OK&G{%*K>XYT}P{8 z^U&vKJ>&Ivp+@9Dagjw6SNnDcE@K(obhgvlXd472n6ss1Qyzw3Kp!PDsglBKZjX-} zlN=Lau2U}&^6_NtbbZ)IZ;x^Pd zE4f~-EcLpWu=_);^@&F>mKet}6YmF$Q5>1ULs%dKMGWexJW82co8DlVA}GX3RBh|l zGQlRpx$;v<6K#Eyf{OHV?+M(*d90nN`9SrZdxf40U-+$G*;ErtPKukQNGNf$0DA)) zwzgK*?F4~Dn$_3h%~2=f0FQ4UX!laVN-3Vzvo?X^ym!mQ!}4exd9eWAT|vD<;*_o8^PkZw#Dt0Xvb&2AZiprZ3Aj*{i8c zmP&=~&NXer=~JuikGdIDB#9ZT-@%Iw`FQt-@U4%0h!lOy_xxHv8RA_$GeI137=E+I z50d^>!jvKp|M3&Wl{E>>8QU475x12bv|K+MUrb8WSYPXvh0Rs@EGmz+4nv#Qo-QAa!O_CTTL+|B#?{QG(*x4OIy zqT0k1aHWH4IYWc}EKZ}T-Wb&89Ba(ta4tI4hKR&#o34QYV5(Y-bZ(lEZ5-XsnZO}} zz`RgS^mkMT>IV~~UXQEKOV7W?Y|YbtMP_=;yH^&KB)~|o727?WE&|59kzNw$DgW@? z`B<)YC8souI}3Fc24$sh3X*8js~Roa1tOagbCdpsD$WMkV_3=^C;b6*m#6neaUBFp z=HFh<@P>l0BYqVj$O40U2Ty#2fwZK2IzV9}<~tAjj@E7%&CMA9Fm`55 zxa{8tM$HjHU{8rpiD^ZWk~pFaZH_?YdGc_c0a~`T{99MIC-Bl1`3SQ(lCPU z-WR4)^if*^-IOss(Zk#;df7Qb#bmCAFfG$hFvp!-*8&8uAG^Wu_JvCRjaL5?miHeY zuKrs*-{0Qr|6N`FuV=fzbvY{&_kVEEYJb<|dw+uLfA{f?mJGzsdvDNB%eS`CRIfnT zXDxawSdJc|FkD#O1iP1%E*x5~$4n;Bhx8dIVu@xycR z6-Yx**}Gu*qS%np$T-L5ALRJ&hUQ*nw+FlWemc%c8U)DX(2`Ef(MGZ2C#reV%*hDF zQNSvLlR%7rHF(Rd8&-om`hGngR&T7LYzlY4tGPHie7D${l2EZ6;gxn6EkK)_wa5TtDs-Jt8H)36phj|y?|lBO zqq$sbXpMZwC?~z-=$td5ixI5v_Ib7IpoTY)=#j|z`yn<3s2%gM)Irnx@*@URxeE#L zvX>Qwr%wn*ukb0y5(BWJ2(2SU=-Q(aeG~$NMXY)vEJAVa)8H}GVnWo_9=6%KV}n#=<1{OJKy?Zo3^?=JS!m=t1UowfV*Q1q{~X~v0}rITVgzki2MD=;gB^tH5XzvQGM z@|CWIz?LfA3=+n{=bz(M7Ql;UMsf${oNJ`kC{1-*e6Fua8K%+Wn4T|uauI4mpl9$? zQOB0`bWHN(z9uL7SkLkM2IkZ<^Cn;A&Q^M9Vfn*O6^cY`LA*+69mWKQon=Wx9K5P` z90`~+L%vF$G1qgKHL^kkO4h>B6>>2;Ns~L}DBmP0_hA|>g9HED2g_IvH+bS*G2jr9 z8Ba)7jk>(^i@9(pbYyVfPLFdyv~O?%)As#St&@XKADg}VfZ^mby-5c5lEt${IX&q} zcylY*1f%>3?ljU?--i7oDS;aEu7s22H%`97Td*f;EGOh1&ur6G_JVst_gklE_aP!A z7d+gydOgVSx5w)OoJk5vC2D;^4d&9gI5pf|!?GOlj!%fkIR!p3mp zsdbr4&-itu$@#t`()IG>o@Y}pli`XCBF^O}^FVt^f|_fx*rY?p;nOpY zP2rkF9I}`_^>+VK-!}5KLVIk{hA^P&H*75DAU8X@9;_r3pnc_Aex8p{BB5Xo@;SBd z4y_F?ibvE}AT|AZBoE$OXgpi1ys?zSoeGy`vQf}Zy13|8%?3^STg}t`c9En>=EAeZ79cJ6d3hxuQ$Yx=bH0w}1U@6&__ zs24U_I=#Bsexwt~>|boU)itJejN=O>Mjxab{Pfbrr8Da{Kl;Hq|8V?RB)X*QBXx-k zBdM2$Y=eW0SNC@8cDN%G@Ov>921l&STnC%?G|EohyQfAovb6hX6L0XHrtuZG;(+u*OY zEE+2@bt;TszTw9FjO&Ncpjz1Y7=+zgakx;BDELkQif^NBtX}n4gl}7~QKLBEc8(O5 zlz0a3i>ls~mZWf!xx+%&Y*BB#;6>D#1mtLa246BK<8^p741s` zCpbBj7TsjII>4XcpXDbVLEUf^ihv=sGcK0V&-*cZi&&G8R)~TsV%O0rGhWvAjdyU? z#G8*nb5CJR*I7*}cx1Xt3+>^JMde_HUPyaXO};APJV3|{V#IKzNpJ8?6jT#SQ#WRz z*jSgBKM_5UJ2qA0%`(21Kvzqeh;H@3bOS=5*Wc0 zg87^+D~jG$is5VUffjEka{*_2!UxAx#F~PEa##ZfMJ(x zH9J-<1nh*64hb9Nqgdu3>gO}$e(IY~15aInZ)9s4s2}w%AwK1s-_KTem<95ie+ejl z1M2o=4#Ip{?Sb?dJvX=VvYgJHYbd*&GY>$BZt#wLv;MP-% zPh?9HKi`0*$A4e>Ijn8Jye>#v{!vog*jg8?aK^Ot}{ZNH@m7|uG-7e#7{qmUN z1W#94JUM`Dbs+b6^tw*2mM5zJiN?bQ;XqV-0ACl5N#>mbnCSbR>urKDx}X$&vd@W8 z=3CIGWsH(VT#WV=^IXFdJY`?KeQjY4p{>m$U_90OD`uh{;ShIu0$Y?OtCSu1E&*`>0#i8(Nj7>=5RxncOn%9UQ%K5ZMqSv;9U|&r za)S+MSU;_6AoH`PFE|(tG??xG2oI*JiNWB>)yN)B3UO{{cE<6VQOS3|YzY0i<|o|MK_q;F%U0z%OPBng$xF?FqUb6Htu_PP0rWA&I&` z5dgNLOj&#+2LyldD~>&x8W=$d8q?dVqj?lu3l}p$gq#*c%Q+K8SLIC{l7066S{F?+ zrY8_2wH1hY;35&Ii`5;uj0LE}dVBk5aC_*8kBqCm>MpC2mwgq}{< z&2#!WWjE3JzVe&nrt8ltg^}&k?#NXn0Eo0_AC`$fk?f^;0=--$N9`LN)fvXU;wNXX z)Jx3+ffyZi9fgI#e!{^3gefd+WN78!QH!CzjJwTXvE@MSdi{x4S|7#s&{&w^rZ6;b zU$$-pN;zTUJdw5!eSwaz?0MjOdy@F(5Iaxm>LE)AF^bx_brBN;y-c1UVZ@D0AXkgZ zzC_cfm)4c6qq3>|+jJn^;U`L$`71AjPn3noS<+{Cw>qO#5V;hhvr|_gKWzqnQ#$Cq z_$C5XBK(mL&~22gG0j_zHLM%+0-1I`JdJ8)pZWBiSH+xPtW@qj!;X}gmoyACz?%Hu%R)gO|0>#jBh0-0_HC}&vvlRvNC%B9qj%r4qc7teK) zs@LGmJT}+WR-8alrowjgmTYg=LCa%ETe9g*6n~1ttsoeEy)%6KRhI5~qt#!1`cXDr@YGGBd>uBHwsNhV-W3|cczd^0C9Rp z`svRrxrQeEmS0HKub-Bj!HNY zj+{lKNGzeavE$wQkE#~gmNULp1hHd9uH1dC^40zEROFMyl;)7NM8b`)M6XDQ;*AM4 zRAi1l(&mPlJazgo5{K8PzjgAN(w*qhj<1l|BW_K59;)qz>zlJ8FHu!yNr(HT%54tI zri8^}YSDO^fY|&nd8=Yg*MvFlQ;zu56WUp6|E>QTPGN$$vz9qgDJCA*%2Phi3iX&N({uBpXZFmb(TiHm^Ol&@$o z27Fd~loNrm%cSrS7S}%9FN*KV{KHB_`@d1<|4NnrPdWSl^UD0+#2j*Pv-}6T+)HiE zVU-E%72?+pUpxv|{KSN}V`V`C8`2ZQNB})z`Jk3s{1}D7*2j@pHhG?LyeP`^mAbYe zGxy6oS{Q`qR!L*hr@k(Dzhft;=SE4xIo=L^<>eHTFgQx%VeU#hKi7wjUwD)1eW#03 z3+elU=us}_6xrx89GM>Vp|KPwa1>;$A$D6+zICmPcwZqjYBNAMHQfmM>^GWp*+wu3 zWCY6=Krv%+{GN4)O=V9=4dE|P%N;zu+hgI{zgx|hzT_YmvwxdqxE8>BCLae=Ai2F< z-j0=!dg@I$ZT*SU{cQc0ucY#%V1Ut2yg6 zA8EmjJ6OKf>f@p&t3`KC=cfORs~D=lE8&z5Bf(ox@ntAOcbn&nYze8(IJo$j#w{;( z(9UO^P-?>FF7yXzBQcLih?`G7s;k^$W~`d;*)aNy6wfVH3EB=<_d-tb(GWA9ic}dW zb9d-0FxDZCjECL_N!uB*pJ0ZSo+k{9|sg!8D|MGAJ3fz!k1DkFM$#aXY+W;)3IG67V}~GE!OhWdgiB z_RS!i2L&&jE***yS@ZXaB+5%%APM;ufq>a^rBM{v?+enTi0%*?lv-Ut-I^@hBk=;I z&-)Pud%YUs(>N+F%5P6>{_A~j3?FJbwD@VV0#O$D9g+~cB7rrUev94R^E`PP?vd^LAF5GgCW90wJ?S6k$nA8+#<@i1cMWw$bDK%2SKL`Dn zZrJ`c@a7-={K+d9134NySlBt)I=s)w(HQieY0km@J||J2ofOEz%>4Z)$Gckj)9gM$^KaQ;0n$!DD+}X)EXMn)s5*hHHAvqDt$z;B#>V+R8*`w;pTu}- zfECEm5#VI*00IFl0FnSFfGPk4GaQYofC<3t{Z^Ux)&Nrr7ZBhJzy)AzYi$h#*jYI{{{6VapCtf@ z0URyd0M-CGfVsP!Imia!3eW^t0USXt@3IX*9^ekJdmq)-1mFe$Isv2rMgUuY0>A?x z0{CkU0oni~=l5})0LB1OfE~cb!bTSv1W*JxS^*u+0crpbkb^A%1h5Avz0bkQ)&^h) zbO71>HPQDS1`q}~+5wG00C9i=00=PsGuWSh1K{Lp`(JPMkC~bS904i-34qx@dibmG z&(3@QpWg4*0kM*@{UMD0atZ%)d;L}Lx0~YM-M{l+H}o*EbG`FQs?J7Ef9?N2dx%-| z|9w4=$u|o%RZWPY53vU|cyTXUo1WgN0~Na*9_vl5q#8oPXh^(9*<|o!@TkLsMq24S zuq#jyfoLKo$@2NNbf4)a!R@E*@f#X5?0GU9S0~**Ca;ElIGpo(%J{jH`J2DX^YXVo zZy+dUd1b|&SOCw7>#Eu|MTuOA2-}1tSq4KTKs2CNK+dKbgYn`jFWwrxyx-`gFxduBRj9`Y&kB{L&;?8x}m`p?Cjf>u?4 zoituP+MIu|bz6IK1|dAxYZ zd3&BR`ju~622GvNIi;(LkI$U9xx4)Ik=lM+VrEXRnI7)bj_lPMt6g+G98sIgFOcV~ ztXwl{8g6`dc2;1fvWeEhJEC7uNkopRT5lF4m)Tc!Fd+GT@WtwfIeF~2H}xf&!N<@H zZx%+|FrHts+E@~7&Fl|5bN>z)DJAZk^jT;*xcTE>tK%AQ%4rIi`=694VZO%b}6|gE9FM)LC}tB8y!;}K~`YQqLdl_ zNwGX#vju{_H>=sDiXuu%StJEXn6T{1)ab780MokL+jZQrELdJqw>B%+$nK}GE2}kB z3nPsojj67ax-*)l+9iVNe+=|zHwZY^YS#=9ngZJ4?91cxZnf}iL%ycqOQ+Qq|1q%h z$N}E!fCMJspF`^+&=}*X;94s@XN{Wt8$Z0S57O1~JA4j?9EPYzB0+@7ltC&nSAS-I zh7k7iN|m_mY#EY~10@`9Lw+UCOg z%N6FcW_ULtp)ZYUVV3K0m;07ujdc`UDUp>UHOQX8V4%InxRr( zvZ8Rc_3X+6q(VKi9|-u>WtYVFn03vbhhK_*W&JcMpS z7CO$L>9i59CT$uN!In-%YwK=ZO*$Zwj-gqchA`p8jFB@{Hm!5AfX2;hCbvZ{L;8R#-itQMO2M9+CoU`cHT!sBY z2o#w1YW#Rzn`g@y7a}IC)?W2;;ox2bU7Z^eN!jbW60-#OFUCHMY_?n42Ua~ICq}0v z{Ti_;B>kn}im$2JZ3761b(1InhswEzM20{}^k3rQ*x>f;UM{E$jDr-obuS~1!$d$K zAcr!Kf?T~8!-0UgDYBxva+G}Elo*_*%o?aqAbMkLY0Qj%PDcGcv>IJYXs zEog=b?Zq+J7iAsGgU~T(Rd*g9EkhRWJGESW5~a>7j9oQigNHN6tg)1236XAU_LQ&3WQF9Cw0Akqs6!U-ZSn1Bff3Ztlkf>Nlq zAEtSA zHCVU8>wjef{{W?lBHGRTR7$Zl_=8_}W`nWuiX35POl5fAwX z&J@@>eoR7lFSTzl%rS~V-^ncW;^%X7h{8SV+17jq!jL|zsvI3cORTF7o{^%$`jR5Y zfMu*?ZyKWmVIgAGKNTT6I0SEmrxkULOy*EQmiiZd6zcZh78XySG?o(SoJWQr=4eIA3 zXYZY&=w}y$qvsNZX3E26be7td&C4cIK7d|}X!_*M#t$Jm>QPHdJKN$V^A7qy^|<2! z=Za>H?9| zvfn3*@j6AGGgtU$@%Mf2zG`!RlB^D>->C65HeQ|nkS=nCyF?b7p6FN(vzH?+v%7pc zFb<8v&=$hN=zxv2p(G!hrmE~269f&#f}^A92ODIXdGZz}^G2-aeV$R@wHK@pDCkGH zsi9HCDV~~MnzqMYmz%B5J}JP*L##PuI@VH0kfI-?QT7%CPa40yGN=_hfxha@YfB@~ zdWtLXjOEvBtZu{X;LA23tl0AIZ}W!WolrO$j_nl66yRjsc@iz3{AnqlF_xOq1r}%v zrmXmeTF?42(q@dbiH>1>C{xptsh|Ao7yM#gU6;g-2b`-}T#eKeTeW=YY5P;FmX)q< z8Oek4o#}>M;Rv_4?j359XJU9WQ5=aD^QSM|pE@t{wg{}um6BxN!wYK{RpysZ)R5pg zb{fP)-FxY2*k4w5k1{7xq=lRzTbi^9>!eLcb7L68H#e3WTWv?zG0WO>-u}d(nCr7S zs)AQSYO5uamxk?&|29Hf`?tvi&gj|YoUf^ z#gRuZw-9GS4%Q!>()VZzIRDuV5dHK3YBV=sdF%#*v=|ZOmM}`whU=pxh}-n%)DdaH^45TSYK*iG+tZgo8AJ?XuuFWA!Oubh2~#Cb6@KXjFdcEX_a^YP#N zpvc?I>nomI)IUBqVrzMCW~C%Mqq- zpbV-UJ!=)$#^=#D;#~*h3q#U}^LQRudHIg^21Xzj2&#br3v@<5YY6Q94l>*+^UW>k zicJn#dU*P|%~IEA096{g)h>4M!-)sDLk3XI5$c6jJnT#^YA{-%;eA`QtRXgWFFz3g zei5lzp~2bFChRKj7_|CP(2RarIfc-NP%v2Fh0Vp@Li0igL8+!SPm{yCIc`9b+byTd zbX4mLPaV#c9RCgOe*&K>&-SxPp(#tZ%1790Z^!GaU3Rm)&#i8MJ$`tGegN6`*e%LL zXe@}7S%iojmqD5qjohI^cLF8|h756O+GCCoBnFDd9P;T|419KKybJ<*i~?+|6@ zj{RWE-wOrphJe~&@bmYb0v&=_>?M;z?*y{bTXoq6d+B%02}gI)uhC8Ngi=Ox#eDZh zoj{ok;`g9LLI||UW*Z)(h|TR(f+yJZy~eWAgtyu~YfE!F2>4Syv^=@KlJfeIUE(}$ zwT+HDOT%zZlMa4fUDPZ~fq8{*y}P3*r%fVF?>8rj;xeh$=*@^k+8;<#4xov0q8w4| zA|sI_6PXhK3K$yQ3jP7RB1Lw?ryV;vB>fnNO9=u#3R@4ekY!N0155gNz;5;QaGf6G zEnX|`XTqPYmPCx#w;P3$Oz?-X)X2vUQgJ_lXP}a|J}_J8D%{T9>2DgvX0j%2N;oeq zugXiF45KnS29RrME8}R1ub?X(<<5bYGSL^kGoLut!O6)SBa=RG4svYI7;^)pl%srO z-&(?3Tucu8qvdp?d&$(WUh820yj^z@)9mV2v>sS#+XRJ@3P%KCBp?C=1SAy4PKcmK z#m7KMLI^1-0|AMEyiH+$_vK3v&c)SHy_~(4&F8k^oao%wg?Lpj$L;*n?tFdYd&0f* z^5H9nmDnB8d$BqWLvks2f3K3>4zKh=z6e-ynW1H&jH!H&9MPi>*aLp#Kee-1WX!SUK zN0=PZ$hy%~7+jXfNJ4y&y>w)Qm0Tfx_?E`=<1Pd-eLD-XH{I{fsD?ID6GO@e#{dVe z6flr!Zsa#;R89+$DohG3yTj+8D{^Jk`a z+WxGm+P-xq=4k?^XfjXf0=uqcnN5?M@zB6*lSi9cx)Rz0ZrEJEbL?S~I_IUUuOW9K z@lJR}N{>FqiN5<}w}&g~GbA#be%4xCzmTC*jPcaqx=Y9~{}Eb|fv+K_5&qmY-FJ8Q zdvZp%M+kphj0LQIYq2W*b?E9d%Vu-KQ1^ffxY)7vSics??7i}VAfeR6|-UqlWasMg0h+PpO6FR z9Dda;-OeRl)*#;Kw{p=3Rmr5~2Ls%H1GF(Vc;=if6Ha+r;;zY>qFnLSiy3RUu~W7> z3gm&|nKj5$%ZT0O2U%jektf%VmprjRhpf|fXyjf6n3VtG>*(hAkc+2MM?iKP$YzY(CNZD=~tyU^l+}*U{)H`!SIpZ14(=7QGz>eWbwBQd=6y+?Rz_* z_`o|H5n3=ogy?!D{TouZlUMf0fWQWlwe!ezgg7H#oN@&ZQ8odj9n*3kzJS!?CV;m$ z08U(aMICpU2?hm+0U%zn+~efQe>ed;A$q^qwr}XTzbsGb)`zOjcsy!@ z0J?WJ>|~V^*>UCjHeLrdwLhUrem+yS36Ra8-W4GIgc+88tS{eS=W<(%ho$l=cgZ1Z zl_CX=ejAbVKNLp3|1SLI4(F7YG$RG+|FNqxF4H$5A`h7M`yV)5{xzUtItrEF5&- zNw2;REpx}-rEgw*LMHGd&Y>2JJQ7M{?=c0&(+JS~K-Qi9Aczxhpc9eJ3EvM3J9!A} z0_WRTaT^t$25Zv8r8yHgGxEen>I^k0TB6^zXs^u~FKRS$uHx$_c2lw>M8SL+;2)}~ zFH2I5!$(50J82#CZ`n3m)sXab0##6;FQFilax%$6xiZ~4({i&KQNMuL<}HI4zxw%$ zQyFRPODbm>uPEHd?JC0bvNgmp@^$vWojSaVd2U}=G$ z)FF2H|A}uqT;Mi?)3~Hd!xPO#1pFmpqlnaMcpUqypvbYbHB#b$nO{riVSswD#5 zjp!H!Dm9sQ0+QUh|G+3Hfl+Wa7g`-z5D^MFcOUzu5t`eXD{_R&&H$C&iau)Z5!pqH zt&%Z;ToYU#p)lqxeqJ$U0L&tWhzh`bk^&}fpaoWY^qKXb@1@yz;~yY7cqIYAjrhZ= z&-wT3D(VA@S&q^dfIEi|R(1kh`J;)S^-P4L(O}=DIke{;$ITtb%vMoR-WD!v0-BU+ zRov(VLtCky%HJE>=us`{{$Wi<6|M)4^jK;7RfmSjJk><2Xw7BGRoo~_P{s?mWhzS7 zrV=G$H3_TKjDI-TG#>5It7+o-_Sq8f?SNpGMl7Yg&2;y_tSW)yGz)m-$?IJT_r zSX;DU*;tns4HGOQ(7+SN{$4YE;lIW~f4GMOJZ_oyyFWs6*@XJ=4;|dL=Ea^Y_IA6v zV8HuCLTZP(2k@s71`vMB2|=Ca%c#uNW@4{myI8=jstU5 zs{OIJgoLZklP{l%q%|@0Q|l0jO*igV0Y#Dqc6vixMDta9RO3<3sGuW@Tx^#@Hk==0 zv68Av!Q8kFI^jSQm7ai{H)y2vj9~5>vP2tCSVn1v+6n59CCUTmC!r*vv{QeUt0d?W ziu1Rhx4l{uC3}oI)+cQ5z*=-0Uv=+(!B5mk(z(@dpBSzv`-nP7CT`MWfF$_cWkkdU2Y2?wkH!#o9*PMe2?@DJ5Q=Q)=b`9_ zdWxLbsFq|exK)^MI4k3~~Nq$W6SR2#3f z*y6o{>U^AYFTNz+wdE4OpdqDi=irH>$jL*x$?hU|a3z$YQalX+UpQ%KSjmy`<2rFf z-aw#+9iDc)qDqgf!84%omr#Zfb?r}-8DnYac%hAF~NB^ z9jO|#wCVI?atDM9hP`LwQCK5sMBjK}Pr_gJchXO-#&-k7+GJdY)93coVaZ_(jW)Hh zlrFg0S^q48eGM%VvI1>FEB0NM_OU;9rFmQDhwk=osR^6WAEwX6??5KWMQ>9hoxDP1 z7RNM+i&}XZya+~;Mpd!C3dUREma&t@u5Db(BF`1XhdUuw;cn`*ge-p1rufqxtYl9( z(xAMdOz>35dZRSKc92N1ray*eDrNBK^VgYVi5vlrC8H#+*^uN9%t zLwt~?t;w5u7SK-9E-#d%gZutDNor%{Qg9%DE3uk)I^2PZYos3$>)bk;1Ajabw_|>d zRx*GwHe*K5H0J)zuYq0{S*b6s7pl@veR+t&L+ZhwEKnt0mij?qVg}r7c&r~{g7f)# zJV%Xw2dxhFef%EvO$(*Wk#57c+u*En#&9;Zjfs}y8U1ra$b>k_JCl}60y~+%=lCOu z5q(N+iCLdFsw^ad1$BjK@GUDgu(Z2)iy*-qV zbrnO*fWdH~<(SK+fOy#Ks7;E;JL|QH#{TGm-KDpA;M({)TX+va9vpos2W=B%e-nqk zkXps@!#hVuAhYmk#+xB$yCY?n+Y?z!W0MHOEV-o0L_0f5RX$;e_{WW-JwkExPsk~F z@eYTi{(VOgo+Lp_{6`v8z@0xzm5oBHO4{$+dK_KQ;HhrPm`J&QMC~o&DpktgB)GwV zpLh+{AtOqUlOaSN`FQ~Kwd8tFr9Ooml8~fVb7G;tjVUbsX61e|{;;?8vQ=#Y>Znw_ z0rBkL=ZRulYKuUNvbcK_z7lx&ws@i-Ij{?xmN_{2*UsM=;#LCGBW;1NCzVW@Xmtpcfjr$6Rc2h;d(#1)g z6c%zH%0UiqGh@(zYHEg2Gz_q$Z zkq9OM$P>3;pwdcQ7C)2~Oj?`HKLyJGHOfl5;N;DgOJhbTLU3NB(i$}^yB95-h;6ZF#}P!8>k_=Y1`hL?3d62jCZvSECK@guP^3{+&K zT%5#@b(rj0W`S4l)*10e*MjU&|IM(sLnR>?QKTT9n8b;bhBOs)*Z^$#M(}ejJYfdb z(hDlVu3EOMe-uvuV~q|`PLmWXWlLlRDv(t+SVCebhR~@b*19EV23B>?IbtV8m*P(2 zmYkt~?MET`XvteC{spEG>m>wDn*063!7N2znukDNCaBT+lOB>LSy`iE9iUgtR*@&O zxk=dznlBYQ4TqyD<%OC=DI-N%t%iAoq_R$Pm0(yu8}19m*Sh8P1jOgVDpXCdQV8#- zDNwVvyUzkrc9b*kZf<@t&w`PASeVVnN}mU<9!CQ`B5+gv*B3f7Ku*bOO+1Jqf{638 zU5vHbYLRtFz`e>xnZg5#kQfDZXWCh{RIzHvfW_FXa9*n}xLN__qeBYED3^fdse#3xlOkcFfg3OS?+aqS zCN9!nIJaDwfRr2x#1LfQ`hJA#6YhrQya$YXJJ_E*JZ8y8RVdt9N~sFxGpP@J`20P@8FEW8uBhKTYgd+!z1AOhX>AJ0|11G-xZt6beTsk-C&@0jM<7+c2nF8*W4~ zMGLqJsFq!oU6~o0wLauVd=>FCr!C$Y)+F};!oCHapfa9&H+gJ_^t|Oo#inCWra133 z6hU0jk3EoRFPx~kWOC& zJz&reep;jW44iN;xg)2?k`$I3y49nfK(`{Uzrh=O)))vWZtCtlCOo zTNuqi5}I!$ktGn2FzRJP$M)`H>)zu=xAedJTJ^v2uZsp02I_+}!6XS_ft^^dveamH z%U&*tFKOCf^cGt`G2xe4=V$Qg;oo`i-TC0VdFUN?Pu)y@{Z5SqUe-&X3oBaChNvjI zp5(p^qWH-B+y#Wmi%7jjM=}^8_8h^?=*9mbWbn%E20Fa_O{B^HF&U@~w5(uYP3mhKv|Ji_yII zNl+^Sf+kL$$nZ)=o+bJDrzJz4Ce9;f3S_6M5s z$|y4_Sh8xxD!No`(Pn?o$gadTL38aE-?Ai1Z`Eq6jQh7$Za=WpTO`&hp`pZ@W9rrD zSsp(=_s1A7V=&j?@r9Gc>6LlEZ>+$CP*1PSCUmai?epv*Orbp@$RD!Tg_W5}^or)j z9fmCE=%V27#Nk!JU6%npm>$aas|}PDOsfEK^JqDa=AC=W6yhLSc`HuMc%H zOxtYd6znPz52X6IV)$p(wi&q&G%PTV#jg`7{|YhL`^LJ(RR|B@g}m*5C)|&I3Ul@A zL$6la^Khc8ce#27W?326)!{G_1J#ifQ=zwKb-r`6D?vlsHmReQECwz|pz*$a1MtE^ zB-qX|r+kAQ_WVRIu4A=OUJ3Rq)E_+EiYI4Z4qqy6S`~l2EYiy%IJnPS-TK?EUHO!( z@hmH%Fk_EOkuO+4FMLh_<;Iy~-SCqx)UQ9cvH0cGsGp-OA#ieB$<1!ARV)=-zJVpf z8DbOcIfCyXDOo0c6!5Tv$SAKn!bBdontj)HN^xGYsfI51)?{mJvY{b@-Y?Ae;cSc= zZeY9~P9gw8;*AdPcW@%!_wrYwJq6b5>GW7mV!V{;Y*N?a-x>gNoSKy*OG3_HX*Rs? zcSc21P)$d<&u7ESq<>uFgauC(somwiNR13=MN)2&xJNBc6XK-Wx3Evbx$y6zjrdlgR z%b2C?3zZGP`)!%a2uglYZ#BYYoML;E&^NR`5u>5EEiqT&tK|(qi3@|KJP{?I(6Qa4 zlm@PtSPZT4yoCFsh_JBdA8dl)JH>~%ry7RiFe%`|p<1bHfuz=6Qjf}473W|Da^dgE zK+dL=QJ;%?f7dfJNKb><(ei#WLyeyxcm|tU7=R&4avl9-3VuhJqV?&L*gII0Q`^D0 zv`_MF8Gsi%RZ!H0iTl;d9?dYE#j=Zs9)Cr|)%0G$Xp+CrO4g2wBK76ap`TsWXWDu$ z8eKDEF|^gGPLT>IvjJc+`@qOfvLN+;0tY2!IwD+zqL;uJ;|`1y z9yuh|WOTP*P3D@+cTa*j6 zq&O4vcr-#n{4Ad;cPq4N89Nxt3OM|<4g4nbi5c$Y9KIYA=)zJ?Z`1-2{TQb zIPn1el8|fK-PAHfiPLi(mo7GN@G8j;+8If(}6|_cqkvEGpAnq;lh?T325{E^9WJ(sGLl;&i`zbzzXDX88}`$z78zk`m1vl=G@lIIUOcmCFm9J7IIh%}xdpuZNQM z14-Q45~sd&;Q%JfbXF!`k!wo%mm+OZjT(`cmi0>ylC9*!>U4YWYih z|EJ~sA9D9UPKo~~^;M!bvv+m+g}tuys{es@P5!5b{qJ=4e{;RIzijtE{qFyx-Tfb` z*8M*Luh4%dy#EPz|3m5;|KeTY|IoTBzg}15SM2^*ultL7f3@*{6}!K<_*d*Yo7!6b z$91Cr-R%B%-TNOm^WVU(`7itZuUuK|e-*p`v&89th~57>GVK2(b~%_Ce$##bN3iRn zVymF6j@6Brfb$6vE_Szl(M7X#9;38XJ~R|4QPHZR0E2=^9D+cgFCfI{?=LAbsKq#Z zi%US_EhPX`nnn~DX;hI{WhY)SUAkfWZ+&gLwc!Givu~@GyW{6M%VUSx{J3+*W1D%# z86)k7C#ugtp@Uy;H5;LaPLl)~jTDOY1KK40?ZbVq4s`x9_^=Hbduy=YbX#1WhQ9mtracZ89i&e-K%sM0q`DiKN4??mr`IraD1X(;=BfaKCIKtB0N+T1 zC3FbLMxLN#kO48&(py_!d6nu?7c7>M2mWQ_fcz=*-s`+)kbm_aW*OA29VXp5N!AeH_`s zO4856df6g1|HHYGC{vKuGFJ4%5s5rbnBGLvkZdB=YR^x~85QYD;6eHel`N93VK92kDQciReE~E`cMfFJT zBGNW(QJp89;etEz9$u&Y$U-p~1XSVv#i@|_`7b}WgF8C@?V7`bt3k$3iZYcN>#6#K1mk0Y%X3AZ7sPb zB>Qp`rsNWt9-#_q3e-}Nav;@otfaD7)GMKy6JkLiVS8?eHN$5L|o-Y$(#?#UU*V(J)P&obgzUn%qDlAc3zIa*% zGn09wc%|YcYuAw9|1xs$m^0~>WYz<1&4LE5%TKNcU+;EJ(e-7huAsr468}`@%87*Y zVd%?~SD7fa&4Lz-7%ijftqfyCxAUrAx>l13TQV=yJfQcS{^VIVI`* zZ<2Fsf|%EeOlRDQJbp4!24!;JT_XovXDk*RZ%`L}<-pBF6j8Abl(OSAn-aW0q(YDk zYMub7st>V{vC^E?bYr{jWpgh-n0{eoNPve;lS_6J!~U{UD%J&7-=RILdRy`XcsCfZ ziUA{mL#HCx1WZRJf5yD$L`~E(5z5KGT*VLpSt(>qNeEqg+zXaC&$}GS$&d-|$1Yft zH8IJf{>@07yH?}!7;j%FRc}k?&+mq0+74hT&`N|5Snnv>)XB`dM+0v~JLIpnQ@Sm2 z>iK&_^RiS|Nb~7$PfufS5pQ<3|IGcWcFaE&in2n{Vp36Yfi|KFrijt0bWU%2yHNlXt!B^(Z2c^klceZv(J38qx`uLO&u?Rs`NGjD&WPHTYp+GAQh?U+n zF9rymud;)Yo?YT~#RWSB_G^28Q<-(?;-5MDIY1X6Sm32ef{*-66Q@o2t*K4!xtQ?i*X@MHP8%w2 z_J&u2I{rFmo}3tb^k)p2Jh4K~LZW+A&t&;wsxF;S^X6mDqa=q*O-2)B2C(YR_Y3Ry zry64iLYRTvvYxSwyn3={AIzgp*YEKmJM>dGR$bg7e5o6NKXO|0ZQ6U|pz9^1Ejn_8v&b z0#$$fUp-lFMLz!Bd-Byh^!w1!nctk=lb~#o`6hh*$FtQOQ|O%=bBE{O<@ATevLhZZ zJYUCf2s|`V0SF5|7($C+2uTP=gxf-@TtbZQ9+)_w2>(0+v_Wbpqa{Uo#F>SMtO~6< zwLgh}63>nwd8}>Cvzq-bC#NsFA3k$-evgwEIG1RDWMWqKo?(g`*+q`r4v?&SnD-Z9 zRYUj?`9kb?#`5rktf*ezX;Yf3;*B;JlnrGZb9ScGw_syos}GvyLe$>PKNBLdy=7#< zd#yQ6r6CX<$O*W7I%SXKlv1=+RxK#fG$|`Z7KX(X?xaIs)9~B6-6y3aBbP0~=iag@sSHFY5!H%xl0lN@6_V3QO7Wj@e1jbrTy$7a)GzrMR z^3)=WP0Crhh-3-p!w$Gbo;B4-uHzOE(X(Evf3TAE>-(KV+0LHJr^fy)lo36;1gPHDWe^QnY7*w9&q5hCJ`B3d#>DCGD&VGsbWAyDLEFa z>D9qIy}vw#A&rkOms7R~P(#ebjf%Ydra%>&vg_g$i^;L?_yX}F=&bYhhp^W-2vNo^ z&1K)Tx;h7p3eubKai=6M4!V?h3#t@@unHa?bzSAM6-kJbK(a|3x&-=*;kU(;WhX+J zoH%hMX^F}%;{Oh@@ZPj~v-)EcUX*5=fZ--NEONaa9@&DPLMdsg8QKQQ?T{c0o+n>z zT9iek`PU;0^g2I>cJ4~0BH%ZLanr8~WGoA@#%Anx6vpuwnln!jo`3+WRm%VX)XR70 zz;tNj-~==QC>!fr z1R+Yp;`c+5I|s$>3EWnlMK{m+%Y~>N#Fy=gc~;U0ggUBzJm?$KR+9Jabx_X|ESIl# zWhC7!okH4cEb^!voH6n68tNsujJ{k4@;J>Rj8ttfwV~E}+QJvSgWfH~ftWh#3@gRN zOFs~&3sWEUks)s!V@$#7D3UrqG+)^icFUu)Nsivo$mYaQti6u2g5x#VV?{}2UaVH(0RcA3fG>QF+I;cc6~D}72T0gWlc&?ElvVww~+3~K1{XCi0sc^0vi7_C`Xb4H~cyCu{jfqpje zT6mwCN+se2iDzD_#Iw|$N3IG!JOOZwxK0W$5M=B;MezM_4*qw?8>FGH)BbRX@9%6s z*DvJHHDSqK-un&zJl&QqCdVdSRXEQ4X>!N8R$G@r!D*5@ji*kKM5lyDdJzT zJX|Gt=x|NwNeH3k`w2|I96GjR_Cws2)3OCI_~$BLGp&tk*nS*rk(Z|W>2JtjRlT|(yx z^Qu^;+6TV zwVdu5)F`^?&6J8_qb7UjN3G#%8pRfmDMk%xDENwBcU)#a*ym{%PEHv(awZHd4W%&@ z<;=6B%=J0CFzp7@J8qg+DlHszsu|N|=#(;<#s$URat_oPJdvb)M55^_ zFo_H+e5hWgJzA`TcD0^v;Hf0u)v(WVu6puxb-3aj9WD5& ziTEgJ*A>fnvJ9d>kUIq*{za?7u;ST+r-o_S@eYe6(uu+%C<6Cg`7Y&+!^<)C54ApY z{R!+24Z+K_R_O%v8E>&j_rZI4d&-X2HBlF-+M%&2CR3RvKlFAKYJ@5+_+maexH!AX z>G0`K#$UHDfMw-v_H`{mU;XW9+#JDg!-{7w`mDDnUh78f6h)6VK5dJkvBh00vxr}c zI2TzWRK*WM^CW`zJ=XKq<(bB@`b4G@_)52)>M zBrv?q$?$~#SE7uJ-Hk(P@4LpV;sL3mM^m6+g(!wS*NvlXh^n}#pr)%1B-4}vgl*T% zgoHTnMZ;VbK(mre5qZ>0F>_Kgkd{c1mCUD&Cp9V@GPie`Ov|Iu1q8pYq4NSiT)|da z#ta>cd)HlvyJD9~>7(yiBll-h%fxoXRmWQWLTed*S+oueg#?lj1OgBUWb}`O#A_N+ zutc{o1Yt0BT(AfbT^>KW)pl?6wVs9_$5+GGPq+E>L)J;w z2@YQ0Ln_>8fdJavmZ^-l9j{x5?dE0Ql&)LY2oOz9+!+p3DE^H(*yfNsQC$}5_=uCV z3>s*Dt(7hqzQwr>q;4RkBsJQ`P;}-NTIK-=#~#6k_}r?5k?r_q^Q+eJOEPG}oAK(a zzu*9lIabA{3ar+Jb_gbe>9?1SJh3|cz!OuIRvECTX?lFnJ?LE%<-|03+Kw~*n}+Hk zk3noy?m1AaQ6otP zFHC5|LI+y`?pcPFS+9DXGzbpC?&8r&zflK=LWDFB;S|JQ7!6PF;F=LMj9_2ayn6ha zhto~BQ*&WJ9bM<+RvY_@qDdF14V;bH}bHiA$%TS*p zr*U4mUsy#uvtL5-A=Ge-5as6rwyNpX7 z)5q{3WU~I8_|aETfu5M5hz-f0v^>@M{6-4y3tcgKi$>NFyZ*OWWNbz#-gI-@Q9k!a zfbvqtwWQ$Imh+@fVS>zMKT+DSpX=5Oo=EN)Pob`@-s4A?$ASyyHp@g2p-5VXvTU#3 z_QY<|gwRvdniJbq8Jq3iLiIU&q4(n63}_j-l^%0tkan*v?t92PN1ONKbU#$DL{RX* zP$EhMw1`%37B?S03*r%z*rfW{rK$wmZIc33^hLFg+yr$od}B~XJFZ)i(=;h0;hya< zSloLRj*(T~21l80m7y*-Lb?1o9Ru$f!)2%%%uURc7WW%jtqaF2UU36vl`ROzq0OGC zmG;YQ)_240X3>CB+}6BII>(TwffQU8ch5+CHB<8a4p#_2By#u6+1dzS-sKd;*%C7p z>lsk|qtfrZ+4V6}9-mYx3mQfWyRcBvS|z|-n(6Uj!FP8EZh3EM#U<#aS)rq%94}NM z#?%K1Z#HOMJWcK|aQjbBKeI`!eg|P&3L`Hx_mb`_88~t90QMv6 zqF48Z`)VNeFMV4nu|SmSE;>J6GX3PhZ19QD=I0v6 zAPFI<&F}>-N^Nv?L*U)PdlFfssf2feG#y7|pjttcZZ_p9Z&W7;%ZVa(Ak`TC$aMkE zNxQ9n#2|itb2&kTwgU~|ZJy&==ZY?B|5(h2L6lHd^KL1__-JL~teW6vxxAXtH!t)q zl{>UG>Nr;-Li|Sdqju=(tUU#~7C4+hhcoNG7kq$y*&SZqxj*7IEN9mtJC+MrmVlJ6 z?lx^1>L52vcP$TP;-pl^76?FXQPG;POE*L3uo=2RKJxcctYFlmRYlx|4dVW+x&q)% ztw?x)sArIm{*E9Uh(NDR4lDDal-$rTs;iF!Z-XOLre?%c8lII{6-)q;`P>) z-}7AQjozR4=kxx(zTZE-_w}0B%ri6R%$Yf7&df8<+;iTlS}B&?sp_LFCHrRNe?m$j zvpZhmsx{Hb#Xx^|!e{G#J<^+@xI!Mq)E#Gj{BYOS&9ZuZDKINgv(f4ceQ}tlBl8cq z&Lz*dt=S~PRS^O4k{gUV@0!gx^G2+BYNW`v-F*qVkS57w4P?$e0@_+yHyVb%7?hyh zZnraWE5r_-_VySGEBi?ZH8yX=ty(`*I9|9ztCtvwQ|Csb_mN37z2wZRQu3ro{W5$~ zc?tr;k~@9V(;Bb05-qhx&mk+%TN~Ow@XznsloLzBMR822$_6VbTZV9*S2|UN&H(f* z@28?5<~-7by2m?VMyQFo`NHKSo=#<|dchZ!Dt)y(AH`mkKfopDyL5g`_EM{I)z?$R z>ZN3cL4G%C=qGL26h<0aPwL|kU%phpjCZa1dc%+*QXL|Ty}xcI)aQEYi&HHm=?s;!?;|5*bGA%3WfsC0k=|K^fhQ;1a)p|Nu1F#(N8}Y5}2dYXijs`*hgGtekFfYIstCu>qGs7#wVklSX1Z0yVFnC zaOqNM$9-N5wi^j=&np+&axsT7+D9;uGR(7dh6?I^j|}~2MbJRqfog}~f2d`MucF>q zE((*b=W&mUyFz?Z&M{Cd5qF9;?x9R^&S%9}YqA+~Q+TqzJhvhf8_3Qu4V>>>kg~u% znJJeUkeg{>v|17PZ7I8KDX6+B*1K4FE6^HBoH^dSP2lOg-r5>2^r)}WvolBE6pe=A z*JVA|W$E~mT=qbXQAx2=u-`9-CVEGvjN%rUlYYs6|cF(0dR)totZNBh;4&uAK3@quR2~-^LccwkdeVeLi z;uwc?$a9AIRXuv$Rl5^$Dr5m=uheU*(;t6df;VGc2Pr#^PVkGirQ8-BTFNjQ&todN z`YOcINwhPKpM%n;7w{rf@g=W-dNf$5zn=Q_=!*qAdhJ0B4ZGOA*Y6X(#s+wUJ4$$Q z3qSQ#-dUGT&uZn?@YP;u`lMGmc6t;ht9d3 zh>FkOG|isg`3&q1?K6 zf-=56nKAO_cQ3Ud9D|dN7H5*5OWu;nG{9w&J>Law);InK7EBcr3b%Bcm;Tyyj)b>rNsw1?Y1Z&0JmM z-6&7XnWrZ_??|${ym|j!)q;zGTSTnq#aZKcpH#YwGS>%lc*i$NYDG(=vgznx%a&Fo z-kbu@==A-gnYktFBkNuoxfqbkomD=zQhAZJ*WywJO%^6b_>-hBA4sFYdF=QW=Kblt5AJ6oVws%NTZIUZLHRyf1^5Tc$+QVOyn{1xof3C zDRS=9V>X;t)_G6mCSFfZo$N77^G!?~imu}Q9$5QuphtEFVr%mAVN=srZH-E5E9&g0 z0ZVP=x`MciHP);wDTq{VP0mli|3?TTUVXI^7vyTL99-V!%@twtlATVU8J8KPiIq*h zq?&=-=SWv71!+E+AUXVsG@O^ukIdnMJ!;d@fRmf^9V<>bYoz0g$H$`2D@Bkg=DRpe zK{MVDPWbXlM~Dv#4^p8trbBw%C7JVE@MYysYR?(@OkJ~K;|OG4J%zhyZe=I5(hgtr zsEXyPdq_QSu58|AwPbVg8=lsS5Yw`bsSrGA$4Ct#^?;>x2So>RjF^qW>*O4U27}vO z`UTzgZ5^}7W66Y1qtSHeFW ziHmVCp-~f8cYIu&k)kWd#4{z;+s0fs$}^8pEL6T(rx&yOc-1*;Czw^X{{e0do@U3l zniW&aNiwPGgo_Jt>Au5c;Z(ZAKTo^8IpOyq=cZ8hGUFDbS1R;j?P*_JkB~mX^&l}W z&SG}cKCaluo!OgmH?uaoYB0;aYr%o`Mkc+dN%Rv!9J!)tLVn;)9LZ{aCpJZ=`HWXz zAh_8~booI61#=4OOsUm^*!l)6M3Wc}Z zHwKg5RxxOoG{#81j7sho8|6}N$gJ+Ny58=#cDHIlb8GB63ebdy2IC4xM85B zzCW$gfp=?uTc-nWttexS%^6`0%7Ir-tN;sfzwN_;hT+@+D{yvzIVSK1325u)Xh5Jo3q};PYsIQ@PCv zeCx#^zS$xb0*U8VKH0LD*pJFE)`Z+Y0{j~a$4DDuMTe_hRZ&-QD#V*pNkuaGrI8{VhJ@N81i@22rmEx1NgUQ;7u4# zaZ*V9MW+xP>+BLAesTG0WXqwC%M3OHJorZnJoE|IxTsBBE9ZzeoRXIs#s)gNKlFH2 zztQj4I5|2vbwn**V`(zlaX!w|cHToICo_YEMyMG2rXy`kiHDr~Ne}mx;)0)g+z;%` z3&$ukGfwOC*k^phbTx!FI=*1Ks=|>lDj}fy(!A=~R6`njXkx=ubT+G8Mhp{M@r$eX z1JBbH#~9r`6)35V_Wv>7`&}F*9d}G5s#@Wpsszoe<6Sh;FUmOQBmhH4kHZubGT{2P zRSlsWi7(Ph@-rAHAtBcK%p^T>tNwG(<(m~r^S*phH7j9*eS`8ywh?D1w`<~1h$v~W zG8-pH5uEg~Aahe;HWBJhKpp2j6*(wzU*6qN|MMfN#(6I5p)1zVF!_AFk=JD9xhfuX z?QzX06$6!Szex%l71GG5@mDg27e8pIYxNn3HohvT!s+cXOeIicsr=Tni_&x!E-^<~lM@Y40k=OFwbR1K5KJ+R-_L(>pM7TS#~KnQqUW zqb;9e`$&TjouF6OUG?^ZFmjNQG?CN{xK5XymZUFZkMg*S<3id6#gFlaEi|ux zQ@2&>6#@X;CStIm|?iS;vD+4hy ziRwh<64VbRoUV=ezty>RL8)U*^=1*Gy0RWRsuG=@(t7I5IPsC|lo}h$aT^>v!?5fvm?B_B%@C5qw(F?EC%gPqlg5i9;=hV&RW11M3 z6zXKxYAKHo0QN@%@%?>>(bgjz3oGYWJy_;?9^$JlXo~x%@e(qb-Z~O_!)u_J`)Kmo zm~M?;oYGIgiX);&y6pJCj!f%&2z)}UA%h{OAgo+6>Hd)f>&S=IeMHA!iOv`Zq?4vb zXFM~Tw3(Z;p-;GGF>2B6x;8*r;)&57Wm-}u!jR~v2rawenrp(-*d}f6R%G`Q%zONR51DTHN`H*>V)80m?%Y()`ox)~ zsf$Nc${XcR&mtv!?6vEMYUVr^MI#l9%Wtxd`Drg0wEi4@H}JN&F)e=nt-TxBxl*U( z+a&YTO_Xm!xczHi9kB{Ca(u%~HA_1@=Sq8V=2QsHed$|j?PKD1^VMpfN|L@Gq-|{B zL<=Yd1u!$KP!+jqIP=B_&CA6XJ={)T92>o2U}ocB;!b-mE-o|nogkfa_X#&m<=1Kk zJ-B^2+Dy8UNoq#yxrlBzI)sAGb0vKT&lJXI*XTGLEf;EgzV}$ds4rE*xYqE6HP^z_IorDKxNgooM|N_n z@w-1dj~TOcopfo7hYzQuY3JYJYCUmX$7rKjt?Y7DoIY4h!rY}v3@1jV<-FT!)mEcvB__^AuhA1p zb?d4ISNb(d67l>3nt6uI$ulg{n^G5~GKnp^5-PUPQMex!Q5iDT{Ok{+D~}=l)zz)e4f&bc<9<2x7<|HxW@9;j$)HuQ-`x(%hX~~iMLOuh6d){Tc*c^gL@u0i3tr6 z#OXapR2)hga-Wj==v_wbQP$^)iLLID`Z_w=U!AAaT&G<&WskY6)Rb&HRFs?ce{+i; z`1#X|pXy8$gRMw5wcPdk%|1G-N4)04M=qa!`_UtyI>N3`=oZ6mQNMdyp`nky$r!M> zN$2}6wpp!00`w;ytB!@AXup3ByhYLpD=Pl>tmE>8&1i3waNEFf7qVd< zkJx@OTFWz*Z=P1DC57Q-l*y;QGm`Sr!B<(CFk0(r;yE?s6!rC%Mr2voH^LpIf{TPA zF{&R0CC&~TkB!lDHI2L&wf&Y%qHtMK>9GXkmjnUD+nxlOm!$@8&=s#5Gd=6o&Qav_ zJ2{))l*vX(L);LM{OV2k%Q5A|ZnICvogcX0qq2lYzor??es-3kDYcN(`uTNk+t6V# zd%#LvU3$I}m72}*Vq;O-30293?#BLv#+q_c#}?a4EQhzc4&7A*7I+UK5~srArQjCa%-9Te&51>&>(6A%dXE`m+MK4=7p|=GY2Oq@0Xg z`~;5+)qS`aJNELv-t=RuIFm*%y z=w?u{WWeS?5FB)qH6@3t`v~f2fVEl>w*p=S*b(yTU22u=8U&hk@|$UFBg zR~5>&R6BNl7VNC@a=Ra!HmUjprznzG(UYe%SX36rwBc1^~pl3cnN%X@8Ws@p*$ zQ|v6VCFz70ayBd07co$j@R_*k4^(yJ64N>C4RWM_D|pHM;02?q7QD_1vR}&^0?wUBbzX4Do^S^zv4r zP_W;-&W=w(rCOHZ6jcdOX-CT9yJZa09n5yzvm8eGah4)yXoI&&GUIL!e%Fq97IT*P zIYoTuOzmueKx`CrI=W3ZD63I@^vL&&WK}=AQh|GqRG*&b!Mt)Qc0O0sX=_j5|D3b! zYiW9e%*+H?$f7Xlir zS#CDmzF|TAIJ_h-h|x=K&bM4-RMDVGBJpb3xz+LEmUjiABn8y2rTn7A3GcT#x(eQs z6sX#KVolv*?^08xdSPfz*iO=VIr5!E;A!lK@hX7BT*Kb0x`_K+B(HoH69 zwis;1?%|O6848_e6SGA5Ke{((s>l7MET86tUsZMtq2!(rzOK;syjk1yl_dGb1I>#m z?VPF(mG%7vVcLs4GFpw^FTL0pZ(3a>vdzb3cK(=L5UQ3^UerkimInL}9#8c#U zke`dCgO5h?^)F0#xipVD9{I|D6=bSWF*8}2QZG{`qsa4q&n>Rn9-w(LbG=wgt;uH2 zviRs=SP@FF{(?DCL~cB{@N+E^O2@Y?dhhzU-6QU0r(c!DPs!?ROZB$njQS3zxMOLS z2Swp}bvu-}-rmYmr@wLisSv|r5>I@~%=?Tdnif~(H18<|_#@oDYh)aiVA0v}EW|oRaC;lc=gk2%6QYJQTS)t#B!=_ zc8xmL0u23B*+pzZI-Y&^lI}650esxJvE*s_t@B+UWK@102jgfGT-^}x8YoLq}5U{-p!gpN4P1<1q5`Z z()1mEz!q&p=e%SB?_R_?-lw|;SeLB1v9+_6G&!x@*&=_{DS_v0XYT{lR}1GSo!X?g zhv{@QgH`5KOvClYSpD;&185a9OT}EgMC^HPEjG+Vp7_jVBAk9%lq$p1`cuAQVrpVW z3eSg|;S&-sW*w)Uj*_O{OJw_Ota6b({`=EN3W&g~d(HGa4gb)ly7)LfIoMah?O zF2b9qR-TGP^5fNwTv?qkx;6Yn#HP|w;mz_BN|y5Pz=f)#c+ef;Ai}m)22}j8;dZXU z6nUVIv=Y?eWZ*5-;~+wqUH9;DSvs=v*kGI9k+k-*Py(M5$`eKHr@aw7YY*(w+0t`4 z)VPdOm8Xzxp&G!y!aTSNb7Z70%W>p2-<`7h;X*hL|AD?xX>B&0N%Cr|q>IigJM)w; zgXl0%KF&^ncjM5;6(~-HZ{JB>li<6GY6bIpP9^P9Kgzin;{&9JU#pH~?QUU_m#!yzR6rs9UM)rWUoj~-^9NnoA{ z9Q)dTM>*yLuAUDunfms9vWG?Y47;`>JOW9{9!aWSuHdR*)#7Q^{HG=Sl*F{IWK(n6C`~hpTL<3=m{Eur9n-_S zJU_{v{YhnpODeXiBB=g;{k`o;8yur2pCGLYohQ}(t||J6KK4H!Z$)~_z(;>FX702~ zjhykkgIF(5Y3FAjz^;GVx$2i6BE;*eT6S`Xtqf+i+PKbUGQ6f2YavVi=($mZV4FRE zk#h2Letz}ECyv6rJ#(dc#LUbCSMbXgsTX?XJ4aHwY09D5Q`MHPGag(y(X?=aNq15e)bS<6p>><9*_?&`KS+H1;Dz z<9_<+^yi&;Dh)mL#$=?@Pxr}pnpK!A`>wuT-KP}t^r9t-qHk_$)0Z-PY3VyS={t11 zGqnFO?2sF1Pjo6k1)X?}?&=AtC?^xnnf!;Fr#^{9xjp=O?CVv^6-D}DJm)%NRv6QX zHh+0TbIH>m_})&{u199A-nTk(+`54Ej96T`uJ^#B+g0+890i=i@F68f z)zT9Y1?#GPbxqpyy+ZsVn@@*e+N{X1VD3kZc@XD>Ok7<@uToqMy)$FdxaA!WDP8it ztSpvq`$Wdm=sIZPY!G;RlWb`#OheCk7QD~h8T4gy)SIO8?W+&Ap!3%r|Ewc?@A%~O zdD)n*g=aV&LmK}0Oi<{(z6wjnt&b8PMNXIe7|Dn;?<6vsOW{2_=$)oKC0Sn7#Uxe( z&yT4jx|{a6im5Um-NS8PN0c4ej;Ooltg3^#@jAqWbw*z|bR_D7$bckVmmhj2Up>6# zJT-R7 zy?SLyyzAO(Z1GFc?ZPMx6VkjT%<-ilf8d5+88NqYNX~C-i4{ZILSp#xEo^YH=RP@rfC5(>ozH1G_9!q89% zSOx}c89xF`3-}BI!ht$qKKUNtKgD2WEC7H6`70n02nYragOH=(aKO6`3LCI#7z~0$ z@VRo*eD=z~7&`_a03Sdawx2*ISb!z*R~kf)00tEfJcBV3a5;nJ5zvj_ zUD!`P2#f^+0sl+Dc43dqy?8%~|1C|9_(kSkMLvMX2;}YzXOO2#ScMX01g0!XgGifD2Jl}Ap-LGU?4&?mgQiBVE3?+h!qYH5r_bY`C$N$ ze^CZ_RQfd?fPvZL>mCVUC30+yy`jSL17sqA2BZV50YZTun!xn$azJW8$-!a(B^xXN zkzlcb5PM7k<2^arg9hV0T0m}MIr%#S00x<{zw$q&0bfy)HiouF<~F8)fMP#)@rvm? z8iQZ*08d;0(RmbD{+9)rvY{!A;y}z%)2Od$JD3 zs z#bID9>0sGj0I2(0#f1c>09Xly0N4Wr?1=tmCZG^@hZv;w->5D=?6~i$uKk_dRb8Nr z{LiWjX!IZe`QE+@4%?l=d()U7h5Y}&@7j|i5XoKu z8^iz&lkY8OzeVKN^0vo)5Ez`QU^zIMKnnNQ-Bo}95Vi~8Yy(6FM2f8l=Kq?ed%Geq zM*PwZAoAZ^N3azT2^fQFYHv)yG#K{s!3Orqz<77x^-H4n0QX1+V=!P_1uDaVF~Dwe ze(k%kDi}KkK>zmQy}s{nWq*1P>0bQz>I-OXKhQs=|6YB8+a&mP4N9oAjoJK}!bwckbY|Dd~o7sJ2y zfFP_A`My0M)^jK~)^F%Or=~!M|CN3OtPcG{8{)Rk4(7%V`|D4#rN-4mJ=N z-{0iH(Y%+8fG!z3nmdx~>~Hf==KNEewoXRICJ;2xIySZIjudS2R|W)*`JIIAZxndx zgYVWp&^+jb^k9##>6-#hY_EZCPn{s3vt5AuO2&==N5G!%nn2=4R7SMz`FHVpLr3k<|xRPN4;znlZZ z{`5=y&nSU&hl41A1@R!2@ITLb{tL=qFKoZ5gzt{TUsS^Xl(zqZ@|Ohsg>rW!{z3`7 zhx|MC@Eztj-(ije3jAN9Jj`*v!yM=Pw;bm?%yGWM9RGWUJCgHWF*gEK1h!MaE*NAg zFhO@CEQ26eSy6&u`3po?#1QN_DgjFdwkDQdC170uR3R`AVZdctIb$PpeXNUT5GN9Y zgrE`d1FGat2i4;GfKz8%Q*b_;0<(9QnSb#PSRwx!XmQX9GvN4I0&v9)ILj6QPKjW^ zj}JJ8gYzMQi?D!$ZzE?zV+RP^B|`^W1AQlmgt?=WIp9v&0m8=vg+oki9U#|iU4chA zeM55_CtF7|0PK>plNnIJ2Ka-vGm}ODIoOuKtV?!wR>tbK4wjAr5a49e*g@UF9Pk4T zK|`bf%jRev6b}rju3`>2kA|>`>swhF0IsAV`bPS8PFPae_bJkw4#pv1{QNT56aKS{|79Z9~jMp_z-9WaLRTt4~j;?4)+%ZMS{W){(kcVfkHtK*F&Jt z(8IJK&`9KASQwNaIN3dj4+gAzf5P&E2UG{zg#m9phsO%WhXi%gfqDou3fLMS%!Bdq zBmaO!!oazI2p0XP93bJKW;sv~#t+W!gLw!vxW_%12kdCUeb+%)6hPr0dHlfaJX{Zj zIm}BK@Y-~^9vlM&m*@j+z%fX0K|GMhhXOA3AI?L={}?L-3iAgoz*+Pk_z)Nv>~KGT zJm5v?ce_pw`hX{O2XY}H;2hE1-58wvyh^sVPQc+ds6+vm_BJNAz{%^c2MLIl5DEn| zfWlB1q=^yK$Pj};Bl%HKJ~T?-2nyvhFoX;L_ZnE0>j-?Fbi%3}1cna-krZO{@InB(>%$%k&Gcz+YGrP=O#xgTAGc%X%yZ7m{XL@vd)IHMG zNGWAxM801re`Lhcvmz)IMaAiv832eBd;8P#h;YorOvHA^KM;9&5gAoI>`jRoH5H71 zn3^~vGOD;3JO8Uk%Erjt6p>Nh$mXwMDH~=)Mh#1#vjs7Ll?9Pe($v!2!kHMr!Gy>t zZ0YQzXzD0pXJc+bS^7A7)IXjvf*&xD6MqH%9cXrSr^oE5OYiVh_HeP=*ZzI+e zg&#pO9{<_qQ;6_i_XVtiyck@-jhk9>lzw|c{bi!mTAJuuCosI3a6GN}4E74Y@PX>f z^}zJ($NXTw>__v!+3H93V3FpB*M#ZkhuKJB?uXjQrs0R!C???t+o;Cj2ia&!#pYsF zEm`BGs@68tSnA{U9T!K3-~ppM+2#9+8neQl6rzXP%>0Ye+#97H;=QOolZY3+!9(PCvrvS~7kb0Zg3GbK-eybB#%?2VNtz|bi4QZi#{2x}h>gW;eOFfr$p7V1=mx%lnS&M}BU z2;Z{%M-)#NdT`ODC2U6IP9(>uml10*;^eL0CwfWQkd`QXTWV}FDcN#>okrg^1IG(G zv(H%)R+4jN?G~f8&I)x9N%8BEMMO~ct6(*7wX%TgS6w1&o7sSL(q-NeYbYY6Ky?VX zA6|R(`+gs5DPGfOx?ig|D82yx6}M$IoSVuc_Xgre8#jSt(cBt91_>dGVB%4W8u@~F zQfI(kLAGQYV}gEU4S){Vhr@{iIg;OrB3w%%ZY`%{nHL}tKywoY((}nSPT0UbnonjOpFnn#kdM9 z_eHBEdnGz1pS2dBa1-{4Y!BMXw%LW3t1OZ>1HNf_t}d;znRr^`N+qIvYXPw^w8Dg^ z!pCK4oN{W>8fW#W^3Hya0hd*g2#;va;ZuZhDHqd3t3x?eJw$wY=>jr~3Fj1sc%grWG>betdkxLjLe_2*WBJnZK$>ObBdegTna$ov??t30Z=W`}LtAC&k$QV^1a z64}0 zovV+*ffeZFImg~|OUSDBW1o#fa!jcfA6=yb9!yrvchTMos#(ZdDuR!hDNTk&M*O0@ zp3>!H`WKtV@<{bJO0j`VSe?k~2&51BTrBz(6;rwI3myZNSyn)X<<-~2Yci1%-iE6K z?TqoeYZ4tdhmQ$A!qu~g`o3VB5VAqVKrId^s}S^jU*U~g8}D6N8yd9_**6pbpbZNxm-Gy)NSS><(F{a6Wf{GmW^xJir&w|k|& zMT!B`#I#aJg2XhPQj;QKvn@QX9XCp@>4a-3=Kz4?1lRKoq=W0QdL$WPkJ#C-YNYld zT`_r-?-Ee_sE=F-LPM%@HYdf|w&hUBvpbJOvF~ zgOR1yE?lvGaC&@#l0>Qmu3xuGg6IKh$ZHo&wl@&jG-Ny~fU}3uli+G7`$_Lg1+Nv@ z5#$fPJ^PXohD3F%cLh;7NRVJ46q7xErcT_vhWo>-g+j!P_C6}Y9qj=3R(S$yAQWsO zvLtgiBwZ)L27qU5iDO1~i$7A$IW&Q6!(_=X6w3~5Y5=)Q6N9pvkTaP6Gl5IEdB(5l zP{EaYBwpLKzc*faOb73pNk9E-g3Z_r;c?b%jc$5EcPlFjlbwrcj%t2ihJ#t;%*HY2epczMc31QTOz0#cK@mebp(A&o+LcS2%We8Tr* zqXK1}1G}O3_9r=w*O=#79${I^9-Qk7-7v!%KMip5!#|jT&#%Z7SGr%v+n{X-R?-5J}+t&rVdW5CMB&UHbW&oN=eqjOQb{0G^IOP;-E1prJA) zGA9KfvNm2U(P2k|=CJ)o*|Uu8z?B0hfbM>mI_a0=-ATZ=f}cp7umb`f!nkP!#a(GG zz!xxiH_#zZ>2jl0BAR~ZYteb41fQ_y=_fV6jDud3==ye30H>Mjz{Ia zFW1J6Fe`%-8)onXMQnsg)9NnyR8fo@i5||z>Z!w|23IvMexp}i9D-NdS>PS!om%%{ z6#@#RC4?PN_wa||{-#Zwi4mRtus_&4ssKA@BL6Nfls*J+kwT%h+2_DS+(|->_hvy- zD_Or6)dMD&tCwLg)`;7bm=-u`m_n?{DrEl!MRF$bYCw`v8+4sXL33{lsV5LR!rx0+ z9?q2k%qvd{$0H^nhVfj`q%*kQJe_O+(d(Jn`o?iM1~Eiqf?h&5?gIL$_{Tu|eyePE zw?)XuJ{}GQtrd!};b#Qohv*hD>|hFmM!?UJL9Tv!94(CYt6*CDA_tnN$QS8uZaCrJ zT!@b_MWsSZsqr2;ny`0W6KgK0I8okxyhHUcu%~XR$pHp0Zc5+{*r7Se6#&3gI)PEj zx9j|{ca|4T!(D|}!o+iP+;~ReHBOZ6!=n!&b39*}mZqfrX#r)Z(v8$P5Hn7;3;3rt zs!wS!ohY{Nx$IK1JnWyz*WWRDSbM>R6Wfv`y!|Gu;MF2|1x9|bOgrfu`Gp!BlTn@+ z){MNo3sG+0t7aeT2;ZT%UDQX?p|Ktwn!Jb);Z-=|X@Dz#2#BJ# zBwoIrs)1)!qKQT}^5DxKZ{Ehp9;Sl}{VvqQ%pmPAv3soxkmyHJ-Kqx5$NWvs@j+6{LyaX5bSssRSIA5SHl z9;ioc`a>B`6D*su&~H6~opQeNSzWbV1#fJp#DW%Rm1x!~*v85Hi$i1;EvlTccH3Ub89ee9k92=`HO5 zl~lJ}QGed}3q5Np?3m!x#yqCks@)G$_@mAy*?U}MX&;>e)ZX>b6q2bUUR72RanLY0FevEW%9f)Y3OtQl3#nm4 z4MZrSh(SSODtUhm^PU14n%gkpr$$5QHSdm#3gp}>2l?C!YgD~TNvM8<`9@`+zcdU0 zbzY%{5zW5+1|NnEr5Zxhjc`q(3hpoh7V7E6n=yX~#R;S^we%bW-3fB70{WpOq!P{}T(K z>Tyw_r8L4!RdOK@0l>E}VXu&E2}_Mt+D3Go+*p{_+_3P$dY8p^8T`=v>@n-0`elHsD% zMU+t*+`9jA%IO(KHNSMLZ@szLN8!j388CVGxFh>W$2oG*{h;V`W9&ZAxf7O<^%}CN z6H1l4jE(Wh>&O_|$@03OiU-Z}p6+t}7Jx!nOo-3E*JnDy>hbZrXh86pms{lOIoFGj z$NGcE#Inbt1&B%{(OmOU%%#JgW7$dWs_OVD@mW_;%F%s7B<^Z&;S%C~&PnWAbalY@ z%tk9+0WrfTTvYtKI)dNmeeF^2tOWIg2tUdiHM63Vs74gH=Aa=@7Bc zO_SlBdl8e|KaieG@!>rJBHUJ`faTvAd)X8&vTOslUP@i%(qVf9MSkp!gYDS2f$_zMEV-kyhD z&kcF7$G#UX>}^>GJoA5?S=|WRNI06y&%@HaP;PoG6(%heLL%Rcp1j5@o111ImSsL! zzbxZDTDvZmN8nP)tNl+JN(f50>wP>`TQ6`kOJ5JY@wA~zG%jQT`152rARu7;1qI*8 z;XG<=wb;S$@QBh+O$&stQ0_muS4%?Z6WQsl5lu;Jg9+LhX>!Q0aI*?I_h7<^vWdq9Syq;ufES#t~&urJwZ~lNf6qEoJL@zTZySopDHQyT0Wd zArQ)oV|YH|d1O0#x=;;W_?qsZ{F{t)JDq9}p6?(qVU`(dMOas8$lF&{PXYD4b`Xo6X_2I+g8`Jg$ zhEmC8t*9*tGSEyzIz}AhHJll^2hK0&;qb{@)nhG*AgRbU9JS)7w4seyOA&-rzhRPi z{r){cXzq`&8jEg^%?SgPREfYpK1I}eO7no4&_N zz_c4_=;@yc+hYpn{jkG%nQ|hH0(h@ zFMQ-%bB4Ergpb2AKVlA#b;%>-3=W(0AAns8hdc(_R3|M2PdbLP5VsHVVV)^9R> z5#Gs$(?fCN8G98>!K^A*JCU}aUv`Dt{N~}#Q!#eO@l2KS zY5Z20$HCM}1$%@%ap?f}2g%SDxxgFsCo4WV?x)*O=!(Sr<~#R5YJ2Qa&xh1IRWC?> zjjJo7sV(r|DbQc7zauKv{}fgIJ40e-W&SIT`foF&V09anbxxE|$XDcdRNF+uQ9CIC zf~JuD&{X}TjI6AEe(IL&^5&9-#DJUgPTEzH02*kP-@oV1R*yYgHNK6{u2O(QjsIXZ z!YBPxGEE*yoYmKWBUVS4qeqWjeMy}ujyi6nHG@8W`!R5`omBPnIFG*{Vk^sRooltf zY^oBhTbfo($9hM+y43z{`)*o^H|7=^IsFbJl}H>NZloPqvR*#5VZ}l%9G4%DirMTp zWwc!3h4U-o?WCtSi=-x8Gz)UPpecBH^t+&e?0K?2xKFNI3BdmI5H~vXe(=!-2J5kp zG~5G>E`}yuBKh6oli8Smqkq#O)rLb@rY+%WR3f|-wxs_lqnKsQ?QV5r+$@CGe&b5R zOy$$K#K3(qQoLI(+cJdZl7Tqa?43Hdjl?qdL3(0%#uaT0saBMhK-U{|$czT)MCj1= zC(?ZLkJCHO*0?f1X{&znD!e@%tmQ)b@wHVTXN@+Pz3Zq~5%DcLf6lerfqs9|eTqvB zwXP<9*dQu>4D{asaK*? z{8JKjvg?qo;0fBNdIu}AE8H^D!F~&t^!iT!NxaxlqJMZjCy1jLG8SGDT=1NhR;WDUCfZiUfn9MW=ojD6jeC~Z>`8g7YNkddg?ckRfyW_#stJjqgPwXREK zkNK%R9;}vFZ5lCfx0es;Z$Y?n`w%a@@M0Z|B)YD>GAmt-H|EpxN9ltipcGxp6eRrN zP(-^|8nQB9*3>{Xuq49>$>WW3&AKvyGDEVN_dpy{+YT2va{84 z$H1de8MoBw<%I9#`CCoBYoJ~qD&|%n|3Z*ukB;$9yb1eyTo<9-^w>-LarCbE>6HUQ zRMk1NZi})$9sf%a=r%nb|mM!^%_r|qRbU+RglVya>F+dddtVl#z=vD}}g9+v91bFEM;(H6n z`kLEag)m8I{Gc~2yJnIFZQ+!C=QLve=dhUS%Xm%z5*wuU(fa&P)P|_?Md?W>htGcm7*5{N)@({{1ec_tzqC_m@xj+fs-#6SMz^NDv1QbNsu-Ld^N^ z78^0wzgmAugnv}Vzsmmd7Q}zc4&}e~0;8C_vxJKCU&`TMV-hNVjWPXSga1ic{5_$_ zU!(t_F8-?g>-F#L=}m|LfyF zrsbaiBsb{2?+_cqytdX#F@-mMn_x2n2D5|PDp`L zR)SZIg_1)++NU>#Y9^S$l%N+!$x97ZOBUPf=F&fYc9%UNUbGIrYxc_ zr_XImW+W(JLn~sTu1w1##mCOBD{kQI!b)#TE)AsR)s}OXBh!&n^ZnOv{eN!4%>UIc z%*Da+KiP#f)*aV5(LTVwzzGj)P=nxM13m6J(;n5$_6bgnDk*hTnji)@N+dDG25)^o zT=#{+>Z~a$NC)%n$~qM|eDw@|z5j+GJKtPPR0{OF&CrOHlv;YHmG1tlzsvaG{Wj7p z`6#=Z<0W-IvO2F8YujBvUO}XXYWe)jpWU`OBHCe4X!8v`*DN390L$Rbv#Rxp{GLi| zYV4H!a6-#aEf(ujH@==~`Ah%HWN8Y}7p2AJ?mu?jVP<{S@@imAGJPkF5de8eXJ3&W zvacDJ*`+XXQ=K??fone0JUDrFMY|RmO{bM`3$~+m7wsi8F)UmKZ!yb@%!_d+ELeCj zh%-{YGZZaE$Jz_1{mvzGu+;mJkNkKe%!4>vSfarY1#dw^0p6!8XR(QdOYX~e>FUYZ z?JwszNV*a{tuV-#uRiL{0N%F^7pYWWcC5KuC0ou>8C@^vXS?v_d)86D!gOi>D;D4->+_9mVYTf%@#x}5m~QVk0t#O|`rzmWBn81`1) ziqn2R@=~4^fWVG%zRp;DCF!%q{y}%M&_wT1hx>r#8yiP0ooQR;m*{KmYyCbiQe|T( zNraOnE%7$D%btK-3N~W0c{S1sN%0}L(rR`0uwqTPdyeV^a)cz(Gb?eE!pnTqlhodyF|8{x8v702OHx*E4NP6 z%#4|D-aBB|*=_SqC3^NNLKz5{61s9CX275;I+Tr6O*IlrXo9Cjohv+SON)_%$6RPu zRYET27Q>16XHx5^OTn=`#DPC8e>l`lO&!`o*D3fQp_$>O#f<4Q%C*4>eK+HfLFLrw zB7i|R>WNtH9ToZR1c5s9qf#AvMKHpc!ZKcR*8~GyLOYzFbr@VV)trC*9aK97 z#7l|BqXjdhLs42OQg>?`rUnBvt?$GOkr_6KuSSulMXKK;1g>KI=#^I!6JEOMCR*(P zRh`JMUs5bMRW{JJ*BO?5FTuiHUYi-T+{e zWEaKF#$I|OQpqQbKzenyjak;un$X*AJ9}xvDeK4^hqdT365FQ|70iB{~UDu{6bRtc!d5lDj5v} zq$c3Hp_J+Iu*HkUC(RK$X&RaZwavhv(v%a@77y{GM7IT_hM6D!@x9^uTw!j1lmzz1 zQy^`C9zy<^BG*tdN_k?XY#I^^aN~PMLR@(F=c%$g|8g;xxD=035m*+*c=rV71wANy zyUq#%r_=^51$-i#Ui3r^GI9C^Ub|^7nbKIfWN{vBH_)bJahh{L5}6Ap(7HW^KN27_ zV91$c3gYV5B^H|S=1 zE0`u`j^4E#i3cv-_tU%QTWc>}#tcKc{ix2i#h+;ubT?72)$fL)obgtvjQj?Srl5s2 z9+88iA4~bkETe$-w)UesNJjN12k5v#jd%H4t`+)^2rob5!kIv=89DsYBx~>rS$n)z z4;F|0o!&MFF30A?T9XtL^>PNWV`1}l8S3$m2M4}DxDiGaj-tpw9u?5f^Wv~$jgTdXY6DVopae)A5}U_u~?k+;=>C^pmSp61XY-f6mu()+PvaN?-BxrDBX)xO1>U7#rIf{7FGCZDC(E|CneRAlE&AOP zlJuHaKh?LkuWd1)LogK9R}bPJ@Z-42mII9II12#&mVP25F>UFBV+*a(9*#jt7L0_u(^)togm}YxLE^sVb5;Jd&7^1K)E9*E(pa zP-KaxJZ386OSmPI~_p}pcdw~Q8Ck^V471=>%jL@_EGdH?nl z=E~#HNeB;4V5Hhy+$4Jq;61bKSMd5!)yQ1fEFfBQtbCv9?%jYVRl@F$%faejrDt-O z&g!x0aXv_EsO+pDii4P!cp92dNDiV5>zF08e1l7D3Nx3K8cM1?Yaj{hUOf*`HJ$Ix z>lUV&u)#Zq*%ouRv7?Z_mDa12S&N7h`E#mFJY>==O@B%nrSGqYH|+}>1iH^0apAs$u8 zPRG>o+yXY>DeqPfX<4V>&2>pmarO@eFd5-e?7zWo<%lG}()#zFSPQPnLolr?`i2}2 zQRlMKKsawZ4zh>7N+L?P0B7bs{5MQ8XN~5FVEh5)K~+5@kWk_K0BQb4?jYH?BW4sq zd~(w{kuXWOL%k3ca?$(dIW^gxzh2698@ z0w-C2j~;jPEW{n}5_l(hz-J_~*W$Tz_HWg*3JIZ;0UkfeD$L$zW@pA0>#rrO%~W=s z-a%UPhuFSvmwh4#$bGqW;0RR4Zr4~k`az9vH8;q4W$tvL zelna{b^N|bXTxaMCWjj_zPxyP)dcrebQnEJg$}_|`n|tJM)QRU`koiQ4{ajXvx8;n6RcGOq(BM@fv8|ZhOb%K4#(p% z7qasbYhNG!@}a>B0Y(99RZQ-WrUv`s&tohBXp^xHQ! z#T81NR+VJ;((Vv)@W-VgsA6jTw42ah%22lvR@h?b0MtW+E?Mf>ttlL`QQ^DT316PU z)7G>Ccv_4_?~hXtgMBxke(E^ZYY^Y^?wika5mPE;4tPp5-{3Y}ky|)Nn zQ8ep=FN2LT*Y*0#Y$rD_06t7u^W8`k5CNBxAZZs```%bQTeywqigV?GK921(8Vhh( zY=q%~1%c!SQ-0Ookr*?#?O7x1F3H^@3EQg$_{ zaF!l49STUzYAcClj^&dh`~-cb_M^58t|MX`zUN`566jh8XLLr@Fh9gHG#KEI^frg4 zde_Jykq-v1r3q(8f4Cbf4)8MA=5l{Iu`RPxEb--?E=O5CD%39e91q2vcx2psRpz9t z8SwN~1Jy7*EH3(E745x1e?8=oL*zWbiPw_Gq^8AkeR8ql4+5{F(CPW^*yc1(5iKH21Ul zKM!`kIryw;LgrsP>@<221#HpRWO0rawRsFTG}XoK%EIXLF1BUwOn&mdR>8K5Q8M%B zxY)8WEjChyrUejPl*0OSZAvhrQr~Yq!JzGjsW%7*s~X32T!Jdq;SvG;@eUn| z+;Q#qJr(q(kpn^&TI(27aFR5}=+qJigOAN+zSn3A35RNci%ir+z>?}f4$av!6!N>M zzQ$^nUk}z9wvXRE1XAF~(0qeahaTx9?xL2260NfeXuX-3w7s_jg#w9`2w3>vp$hPK z{PYjX{8x$C|8GzQ_$S!g3g$D&O)=g(&=oW;<+=cm590ksIh5n zDS0FC$8UlxksP?Z5qxlabSc2EbXRWIPmDn0t-Yhb8d{cX=exO~7IZOcA1~VcL$Od@ z8==xFg783TJF{oQr{hZ!PHEXo$(wSzvUXJ8A|%h7#MHc7#l>Zluj(nmSzkN zsItDc_0YZg5FTPSvCHdz{VI=xS8^m3GWx=oslwq%dEdxP#mi7hHdMc`DZ8rZ6v4jP6j31|T%Uj$Gxl zdNjUYPo`1{P2{`j;LgyPKYuWpKP{@DV?HQKK|m?~EO8g^71c>JDQjL^cKqQq+pN&A zJOUwzdQLyoopxzxJObqlAck&1-US<{G07Zep;I#j`!xpxW=djUi@2%2&Ch(39~pGG zTYo)PA1}y)UWEsZaHQhMw~G5>JYi|Fjc$0Y&gIq3l%D$)=ND~Gwa`Wd61N`(aWbR< zgEBZ89W=in&VT{t9udMD-Uxgme-?8XS`xV#dmr!*^YBavxXlhwaiYVVCzeO=u<*jp zWM3hQIk48Ik&z=LE>gBV77dPjp#b>ue6zu&rt`&>-8yQf9Nu(u<#ZCr&afK4A{NRp zn_CQL1TqS3YDw$l&67uAj^G= zEo2}#n=fF`iNWZ-4msP(e4xr^>E+_7Ky-k%f!EMBZ$l zG)~Py<90fC;XVy#d+1GVbpVa@S{NBF5q1wwcvKs_IG{lEY|-RBi&b$bEqv|Ack1RC zA5(M|Y}ju+le!nIhqn0U)d8M_UbDpT0sdg@_KdsBd>5KpeXimaxhhe-)(7MDX}Ino zK}vlC$^u>W(IO{<${dJSv^Jto!Lfb|Fk1Nx9;wr-$tmQyoEsnb{NNB6OlUvOM)k(9VrIP1Z zZbrfKQF8iez>(o{1U-V&Ec!>2%0YFHHOvMF$bUEPWiaM)Gm{|ZFGj}*oi5e$fGJI` zCT=E}yZx5C#S=uI8SF>wjcO`zh~J~JqaDM;9)fJPM44=jPs7R;^Si{%3&ST;u80TWN+vcA%*aTL z%xP)l(@^vBf4ma!9P7cGsWyprw@rlBRt3D%OG8RCR*E~ITo&<;?(vS?3o%HtuYY4f zKVd~lHCRV1CemR^L(U?KAlM@U^1%oXd`tJG!-4`eMJ~MyREXr`t|#JM5m6*TaH?Qp zS;ex2;Tfqmxa668q>XZZzUR}XCIf+jch8@=`}K+7X$vkUlb#Vjb(V;INH>8(8%IAclw#@Oc>UW-q)Ko4oLxNTSv1K!^w z@7s)=+NXKN{q}Q-P&R#s+)4dvJCt#1ViWZ;acN+-D zGug0>2TEn1Ibtm(ZQjZ0l+}U#iL{~wwX4s>>?sJ$>x69QMpMLtrkj@%V>28498->- z(!z62htndf^x3X*S@$quyWU66YvacuI%&g9dyUt0|CblN*(|TATjL6F*^c9<8mCBG z!jZS{x#^goVfS*;1Bk_5qwde-67!sA#)p2HEo-i04-}gz!H>_B(&}o01-yIOcL$k9 z;=Ue+j=ikCiO$oA*+TP@%Rp@tqBkoF*_BhAlYP(rIr3bRUw6GHLbaqH-z->I-vX_x z&kpNSMA*H?Jq!>D(-K7tmc8XMol7gEDi*1GnY6-`OT;Fhj?xR41Hz2=9_kF#Pl(#ni3VD!c!pTr zvyhBZTS3OU`}MlDjunma-#x-5ug%;6hH;A;;SU-O>GM`-NW6QN&I#hD%a%Z+srC|R0)i$ zD&|Iuvy{GN4JhnEmI}|abk7aav@*S;XNTz6@{N|Jt-4I<7Y!yht{8MFQO)IQM@Q6j zOzh7n?fxOn07Y@Ky0Cg&VIXCi+2za%@L-#$0?9iXaJ<3qI9yG*rEC9f_}4$E58Z#O z@sVnRadMDt2Omj$cJZ!=E+5tc#af78Pn@tg{BX*i`Of!{bG&)qd(lmaF*aHJ3af)` zNJ71m6SAIADu0~WcTAHQz#G&Ui2Pjma08?C$+SR`s@0` zUw$|6nfspe?oe|87Q`vW%^yFw^0v(2i#|*M=7Qx-$9_qu7rF?57L+362(!Av@7Y9J zme1U7u!T~U8^WM$L0UrhkkIxl!FyK*x3JF$rX=9Xw?TuLEu8X0#_k(i+ZC?p4>N-* z!YLt}*dkj99?1tGHE?`M6nTsR3*C=$NI1}B#GXtqktDYny$K%&+zIx0m8#m5sn;)y ziF*anhn?|Ku???wwizjsTH@nO`*3 zw2`VpP@!p7CSh3kKy_=+{GoYvW~J|I7lU#PFOVL;LH(@$N8 zEZHk~B3)~x`9e)vp|P&G6x1Q zT*i^t>vIEQc8+?ou^@kun@6u`G(q?9hLw_ahR$`j%3oX0ojzZ-J*(wUB3bHZo{guf ze%+tf>BLFNjX*YWShO5?Z*7OP8Jz~JjzY%FObj+lXU#yWcrOCo=k z-9H!%3DG!W^a0tcsna~Jn=Soq;5+Iva zmovCLvxK=9YgJP!-;q9lN^0}7+RWO~Dm$0!$-jjHGVyRVYH)Bvy<7s7zM@~dzU zy#LU>p%sHSRv$xm2F1Kp>Pym!?3rg! z%%{q!+?ut4&*E947;+HmP|u($jRSWx@FN>U6Il}<1%{ABgw$QJn7p%+ z-Wx^<65?aE$y@rcH#^S#f z7Mfe=z%|z)6%jDIA9U1#VITy@_4=}2K%g9a9hUr#g5T-4RbOyaR;1)#GOnQJ{@ zzv*zf^pZG(Q&w3vdHql&k_a%T((nzJRCHfmH%4}KUCr}M*PCk9R#zX4mIm#O(u?ih zw6{4*Q4GglTg>X(jerf{5m&k zoaPAI3i`P?(H@!*eP8tL`2Zso0W3}))Zeb)I?u^RoeNhJ z)uW3c4s9Qz&H!oW0%Sh@0h8~YEu+sFJrgdX<^x?gSKk6|ZI9Y|=J9El@g1#W^LD*` za^AXr-Zbi9Igw~$jJDr-O2fC(vfHQ-bbf@31MaeUIM`8OStU08!LyQaHhRhL*{f=R zdS4Q|BDf*4Q;0)gsi%)a!X%9+U~Vq{j3N^<4CCgHdsno|@MS*eyC- z^I2QLE5b3NhV|qPsWiQgWV`XmuI`*Ge;(566F>P&IUO(9M2p0Yb|Rb3hk5(fOQXeE zADtM|npr`32;8MJjT=^!sDZl0wi;N%pHHEU1-k$6nQZU_ofvbnm>cjU_K2)mAZ{IyaU3U1b>Mz9Z$O=&xxWMnCGq+uSk6U!ve`k0d;6X^3F;L)2tYq zs@bZeR&X4i@Rv<)lgxEBY?Bc87U!18cmvl2 zWdYe!eM?-t(TZUq3jvnwQG@-t288W~T~?_|^E`x|ojdcU2_SyWRs$;|WBCK?VgvL_ zBFD(24U+WK16=d06q?w6o_pt~F~IlL*dj?Yb!i^drYmXt#^QVAFG?`vHu&{q-Qx-8$8JLlJlEd8LGVY{>j@(WI))`sFb_=A%5T(BZwuRHk4#( zpq{uvdkO<|&`FT4-SIcj9VDp-VU;_1Q<}ORyB{-nISDfYoOQGV`Wf5H_2cT-Ux(BV)CoBM3;6n5P5vLrrMG!4L!HN?u30n{t5GteTGMvpEO*IHg?DU z<=X?iF_dt?7#_t?hxC!2!&mQ|O^Z?=&=#yn@z2OOlRZ$4g5ElYA$V|^p7pMi+K6f$PTxo8gN?Kr z)wsuXWRI6PsxdlVPjk!K3iU>_LJi`l`d6&FUz^B0D}G)>{0Lafns)n;8!%{@KSI1b zl|g)G&x;o2GKc-LkhY}s+FkEF2Rzy`V9S5*N3=bSDJIrFNNsm5LdvT7GM`AEcAvngY8d!!>@*K%XI1_JCQ|W_G;oU0-JdmyV6?mC6 z;%D#>zh~XdVx|lMJc$htkx~2R`c~c{tb@StT%&moAPgY^ljkB>JP}m&y?QbJnB88a z)%vGWfLs5iy8uxaUjg6J&jCv3TlZi4UNRR84MK_a$GCs^VOD3y6E!Kq09ri0J)oJkK zX3$i4(!Wz)$jyI{ca`s`@31k#dlD9!-*>q+(Rd3k{gBS@>vrBcvQo2GS=(OGS&E{O z3H;S=#&W8&P!Kmk90rl9eh%2SOF|ERC;cUGc&J@wqk2c>+_@k^<*iljGb7B?y zoGW^MYt@qx9<#R%0%rRe1qL(>`cFBpzY6X!9W0N;o@*?tk?kpGf_YsyLT%IcvskE! z47O|r2Ab1$E~`;iE+min#Bi8L2XVS9+nw~7{mgD*qm8>j^>3^Q#;=X4C0knMoLohU zzPI%RF~@Qm%kMG>{um}>waBsj6Ph3cnrOIJ?jM=+(L3ul^ifQcuwibRTH~(BzSDP& z!Ro}>19)8+)5d){{X=4dDQL~#R-7&d3gVwdNX$WHMS=^$*wL~+AcFQGxIiMnVFfHnb|I5naa$} z%*;$>W@cuWnYn$=x%c&*o)<5AVj}hrr82itN-5*Z2rVs{-^FLM`JA1WJ37Mc?4Qoi znYp38^rugL?*nhfPMc0FX{I;RW~2bACx$gu{#=o<#b&Uc)nXLj`*NgxUY_lLI}vIutQC8Q_eGdAsfxB2Ba+Y|4E z7GHoC5gI)gLJRw>2cm-R zq;{P?y#zLBY5^_gT{644zw+B`GFz|y);2yj2pK9qF3cyZOk6(i$G~Y11q;)_5*Bq# z?&F2!rr|GajuJ>csU0(2H{2!^^t42uP)Owb^Yfoc7Wo-HwGh?ojv-lY;i8H$T0zuY z$H{?3fTmVOW2_So80VM47vD^M`>K=*8{tm56A|C-lk=GkaaiV zMKswMRc$^{_m}n{HY4sj=7B-{)Et7g&p424L@1e%;U5Ytx;|`jTcWT>B@j zsJxae5sU-YPp#oC$bD~vjt zIJlVD8hH@1eFaqkTQh4DLKfC9+l{@Qv#5)$k+X%JEg?YB&c)XFKVa{_>F|Gt<$rGd zUkLfve+39l4XmBMY9S~8@07UmUp)BVcm0oYzPRxJ9p3*b=P$5b*u=@m(Zb%@&he{C zPDX#JbJ#e)DkWrK|1ZA|8ygecS9$-Oqhn%Z`)Y}`fteHGUx}|01O@Hf3AN}L+1LsH zI{SsQGjI}eGBW>b+VCHDkGO!0l#DoyvW1O_ldOrGqMeO_t-O+qG8{m{*}&Su=%1(Y z^;ndgO>9&NzY^;Ix;+ca7vU{rZs7PAs80!SHg_~J0Z0KX0Ac`VfD*vOz{thf1mFNL zbTlxsGI6#xF?9x*+POFaECDV634nu(owJFtq4nSSDqpiX|GLicFLw~Y)WX#SUO{9J&ZfNFsKBAfUT_~C)5fcAm;foc|xL1;mw_^DD31{`NO?lW|4iJL#` z3A6l~qud~rjPTwRe|*~vh~C~p`5uo`wCVKcaGg1v9V2B4M%k(J2)|igvm+y!?=tdW z=~ivrw^2V#Tdb>L)wXl^rR`qm>~S&MT6YCMkG52SE6k^vA+*+DvM$!OL8r>Q{O9=2 zR@ABpSoj3SmiBIwagRme-0*C5MrTI1i-Y6Jg=9Ogy%tZWQYbJDN%m+Uq;&F5wqsz2 zZ_Jz_(dv~1?f%IV2zPG{5uUf$XhSL2Z~lkK^j zZDOk-FWhpTq2U}iS0YW~HJHzcqIvR|s}e*IaLAUitVYJj*Lv;iFi-8rI;bA#uKarHE_*L934Hz9Utw$3{wNRGSP?h10_tjKdmsC?tN>Hs)fuoR$ zo)L?}=XFn@+tAC~6qC3ql$eoLtT0yNhewL`HBUe7^qez4C^Z1KC<&-yRvBKvB)JPI zmnf`L&yp=9NM52!UFV8yOXV%5s;)FTI~`@6nCEOHZ;mQe8XcQEac<>O8-Xqe=7Xw5 zb}SO-pzFoIg%c61z|tDS=+UPnnK_#B(Lty@?motO8Cby&vTG;P1^4 zZ}C8CF!AJvLlw)Wmnz-OiMw#h$~Gh!4x0LwaB#IeyTbT zp(N$K%=;BO>^9sDANqqi*7~Um1>v17m*vuZ^SV<7LJkF@96`^UAIbx)l*2PjHB)>D zbPlzG7>4Nvm6JM1vTD;il%qxKrI8@g=RoiH4a+eHV;!V*`VZs4DC%Xt z_fRV178+it6nB**-0HY3{OV4Tpwll|pFQPAI34zxN}RG*F*#VXFqaCp-H1*|=?icGTGf&~-1RX=b$SE-hrG!ERahAdW z1-Zm5nMK^&@K0e;n5uI%n%8Asljb}L-FP>ydal%xWL05NMV}i)3sREUuzg@>Q`Heh zuyU?Am00<7d75f@0-`8%)T9z~laG&1YSqRgegj@IzSNB};Z-^=vND#fo*FUTdoNN39O4^08dY{q36W!KOX)(81pcFV0Jl9j4pi8GlmKYlT?B1 z3}*=L^qX^LL?1Hbl0-A<&dNh_{*3udSm?I?1bRkgk?_D{_$>|Y?m}0rqpkE)dnNct zCYtNQb-mN^wao#162TIj^|8DgK*H63mD;nyxqn^6T!{U05;~qA(pguuiFIB2n{(4) z4bwqeSrrqn^Hx|28pq3HiS9RQZi-@br2Mx+6tqu6@HM~!dm>5z#2l+}e4EX_k&{V;B6+0xS;+UCY48sYW_~tum5b2azJysksPW0C ztM7cCdyAqrv^eDxSl*(M%3l(K9&>Q|JA{Wmk(Q-N(gUJ5}bDXfm`EmNrlTKO3+ZN8TVZgmv+ucUh+z6 z_(KXK6W3siE0mj3mvmgzd37|jB9vk3RK#JTVI2fJNdAa~`h6s%J7_w^)QNt`o4_8z z_@YQbc>Xc^wcDlQjOV1*tLt6yjJ;9zWf%0KTVxG1FnKrN-@9ZCAHOb7Z(iF8HgKS*s zxJ4N<%UQF%NJ-6P)OjaZk10+vZQn6u>r zc>$ztjj|eLN`y?Ohp?D`FieHZcy7R1XYq>tC8>Eycj0^PK>(_cBLu^9ICe$niWU@e zM6L1#I}%KXVgR<;4!fO>)i0Pr0^=#pf{66c(SfPrVgZDu~AetpB4^yVLm1zECM{Q1Wi7U*E2n&2s-2OYm?&i`@rVJ6Z<=Oa9))L5+eX|<)k<~k`KF{)H)9;{mny8( zeYJSyMhcyDApU&g_rtWfIO<$$oMx;7G&K=y!Nq;=m(#u4uo=TI5vv*~)Bz@M1XkP> zF}HqPCHAp_yYD~yo))KvIJflJf4~sPwWF{|U*J4+)U*LBzi^df_NCxo-=}k@2@yTD4ReN+v04#nR12E1X3{ zbH+59WfQTLb4QoWNcA291HlGJB#xV7f%2?e5z-e>&HhT9+>{wOx-^I^#rSUsS?d8X z@m4nLv4u-X=huXrW=>7awT?nU)er|W?MJTbq@kJPo^X{8=6W!E$DXpTJOmxD-U!F7 z+zNaW9Ue&?UJ2OO-L_jn;`Z25MIIHPPADw)Nj;L7KOpEsaKlP}{$5IP+}^#)Cv6!< z(2Vi13GJkPI>yS!n;j8u)75dtvymD?JE$Uc7+z&z- zBy^}yhAxG0#)Bt0Ra*3e(KR#_5=2r-Zgu#CgAf-X z4m_ayKmJw39?T1*q@gpY zzlWeZ>V$+(2z3UOKoO5&G+|zSaI9$|CfKj+^KSV4K`5bb;He=!Jb$Ihd9XT^8>#T4 z;b`DWGB};AqgL?*9eQzBJqSnvVNA%1V5UWru=8j>gV2%3Li`+KP*WH9?yaoql-;Jr zoQHP~(!l(BaV>SKWb8GOddj;yuMtm|HD3>j+>f?iAE53 zf5%`HvCqV)-^6Y7{U)k5hMjQVg)0Lhd3#y|f)Cf0{3q~|wakBz4Q9Hf0? zYMD`#d|GQ9rG5uvb>b=G*5+CyF<9ARKGB7OU*y(8g~ma`44e72f-b?*?BxyX<6(*K z^*h_S(`ojPP5l(J)gD(G_vUA(+d~DNWoJcFW_BDO6JM`Cna~s5Xq{Yh#|>fVWwu4o z@e^wv4RC9xRxkchw^`9Rbjt`TFVt`=o@Mox+n>R=T~oJpdg~>jZB6q=%^H- zf%F>ZJXZgeFv?lQp-}PxSX#iJAIKcCqg~m!^<39x#s6dKT3pH8bUI;i26gXg!z1#0 zmoSeIB=5#YGN1#Bh;Ta}nw(ZbToCz&5K#~W3gAJu`}#Y#L?weM%j|4I=d#RcX^Xr& zrd_7>p=0uo9(Q~8`=86#XCJ<7fNH+Qae5!m)J*H)FI7AVD^|;T5Tz7~$qlkUymo`2 zFQ@Z{CfBcf5P@XIZTb$D9$rX(i~^i-6*Uz)D;BxdgC~zYXc55}%H!AZ6;NPVlhl%x zp-^vo6+BQY$wkMsd7~_i@wY8*R4@EYt3@Q0p2aW74x1NRQBR|9Bwg5-kVDPizqM|2 z=-TAKE|f{O!Ny}q!i(&E6!PWZmoB65PZ%vUg=%(%O6El*LC86If{@YgJE%ImPEee( zD*L)5%ahD2yBu)GF@7eg*&Buyh-7e}i(TpAPJNqy4gPeBio{S3`!O}wdt;22p6r0{ za1RrWP3Z!KM-T;Y&VgaxWX9E-cEf`R_7FH~wMW~3_t!CSa!B#O^XaP+CL)Ce8|!%y zN5oqu-byz;8i0nb0P0BJHnInWkl^km9|q%qvL6nzvg@w|T?b#f2$tGm8dZuNdq*ZF zv1hL6Gnh1J;eEsVLesP$wwXY>x=f$OzUIWP>PfGV5Vr~KFav$T0*1}%eR05hLAQP4 zJ3jE!ZB?ZC_72$Y?z8?7@gGZ_jnlHeioG&lVSluklV3xpx_dnG2Ldw-SH$*bqjbG| zVyQ_;tq=OyYd|R{e-HvUCGN&PIg2C{$}2CSWaLf@)ZV)5k%0f?p=n`SiW!iUj#PsQ zE+O(~)yeidK{56+y4t#FCaaMkBueX!q~v+fP$F`^>D-YRd?og2$RkTJK3uG-LST09Yh1AcTN*=LVyYL z8SQ{u_o*^S>KSIsBQi%KZ3?}ooj^0$ zKnJ@OQ_sqj6cMTIjp}%ICc6}7#fyRjd>Anr4q?6TZfheEiHWiVi9;PK*`=H)aBusf zK2c<7ZDTrMdKw=ZQM2G)LA#kEjUD$VWN>z9wks53S@xmLX<2+<+v_JF>`1)Ap>Qa&y!B4RwL@F$&>S7G6Z@fdNkQ)apVULU<6 zsqc}$igBu2><_x_=nG6|Y0I}1CtxKlQ>vwNqC zEotMN$-%5W&sg1pO6A1az6WU|mbvktVnTl)4o9_cpT^^cd&>tcr|Co+= zgb#UiJ?V(a301}_&W~B1SVo|;!IWREm!$+Ch%dJh1~|$wQuubAhM}=bxLA^vDyJ5B z2Toit8xxXGjEHg;R;VqM3fHYJrlH4%RnyAvt1kv|EdNmI;OCD#f_-h9E*x^9!%k{a zw251V?A&mp{&sTt!D~YWIy?ICO~+uIx|@9<*pCJusEQ6K>YG78Cjxi2C4llS7rR`w zI^Kv$r+8pcbE4gR`_C+hOH(TL>3l+)EPY-Orp|)4Lex6_9y@j<4pOrKj%*>>wtIr_(hsh znar9+D*Krgo^)YhCD*gscvw&5cLXX}#4?fs>=ynw;1erl#FMc@ius1mik@fz5Z+AC z*QAOq!X(tMQ_{2MOgSad)B~dwI;tC+`vp&Fy>+VS>u-vlaUj6;a=824_DK)032H#_ke>ao{z?i77fHg160PP?2 z#2=wPjcjdfs}aIND5I+*Gm1@${MdeDt#zEBe+qx3n$o=c4H8{`ac)zK)LgYMDx(;$ zP;`G)%%QE@!o?f6j?_&-ktQyeT*g!?t&&8v7RK0LGH1Y=hKi{L5smZIs*%oQ#C%)( z^SV9U4Y_+|H)BieJpJesjkdR&mB(R=cnH_F-=@z3DfzTC3faR)NmHpT5P)L%BT{3Z za2yZWWV=F(Mf69WKJ6i&v)ZSc(j!(D?v77e(_2k_gJ*TSnwE=|8(X&;*Q!ReO2jfT zu77|eBqj)y1gW0*@Wdky@(Lp;DLaS+q(6`-B*rtfNVqEAX~Ss^rIJ;-i;I@r(#an< zZ4NVbzsaWJ&mOO=M~|=HmK!9VJGm`<;hlWJxEV&yLL6r+^EVPpRI)X-9%mF*kP zBa-8z>FaL=>$~0QpM>vu4YmSr1N2yC3{mj2wMCQa`N9S?LeAh67Jbt6eMVN`O^0FO zcT?LV{UnZ_QBkvFYt6Bu$Tc&{ysUdqd2W~M9p-4%BSx9LBthd(%HP?5J^%t{! z@pg?le;0F2lMj&YZTT!_2x&B-%i{Bx0zw7y?lA4c>Ds*4^|51<3!EJjNR;l3W^yDc z?f9tyW*P%i4fb!5)j~^=pYd`-gj<^@*zFPCOpC7?8*0Blz~Y1ju;oC7JEXsZY1}W) zIM6rU2Oqb8yCY_}He8>lS{*+j;K1jIls8bKf)PSX@PrZnEzre`Cf$kVcI9broI^06 zm!i&l&1sgvs1tCkmZ2ACFppMc2j%WpT>IMv6pBqFGBRarniK&#Jtz{o8Y-m&KON%w z)$#}L_?Z*y(+<6hI-+3oxw!3WgtfThrAhMHW(GpRnm?(==TM?ObiD~mr^zW!sMQ`4 zb%Olqs4{qt+Q^tx%y$E0KgrO&@KeD*GB`CEhS9(5%u!I~?1~=kSq#T`$+SJ?l|u4e z+~wy=We?Gz&JP5$>V`=nK)VQr3=C?Hg^|)cqq8UqIUzH}0bC#VB!5oHPOFWshSH3{ z#AX7j{uDiGdn}Y^j#p<~a=3DjQva4!i5!8GE|~C!tg5_;fumg6MhMjO`{?hz5eSTG z#o=;;YUh}BIEQ&sns^Q%O7P*Wn(*pT2vXt9fDb`YR^^6&-hP2@?!>ONU&V8UuwQO~ zFoujrT1xI9szKN25N)7?lG;V@?1Yvrl|wMe&;8@md*ZF7=cB@;of8l*eHpZ^M^xyjqtxO=YyWaVsqDaYcD@i%8CQ(#f$A@6KFZ1HJOD z`x+*L$6||4xdyb%NQN)v2JTcS7w8E`!VhFB*S#1K{;?(r{p^s?7(hlvZGq4+(7p(MmE=I9nj_ z%7TpO1ZWa0W$mhYiCxSKro|*Lzt)*eC-fpae&-68_2uZK%y>K+4%k)Dju+{`WGm%E z!|x`Rhl6~6zZSf5o@g~&DP0M~Dw`-xY9hXLCMBy|*0w^cY2w`kx343IY%LS(1rPZ? zjd2M?ia{EcgU8QGC%A_UQUMG}))r-!?t&l=@@gv3Wn_sX-TtXV@@X>q3i;@b3dJOT zV9CoKv{0p}1M%a6Z1YHPe&#g>Kvxe2-~39K`0siBxXCqraSyfSbR`o zU}c4gv_W&>xm&BvT4a<&%!#M4J%MKx9C>jI&A%8OO6IMcLDW(gHG)f60#(CL?87yI zY0eTuR7$9w$5{ftcX{2tP%Iao8N6_Ml6`-E)pi|!Frs{l^NjrE3*KdhQw^)PGmuw#g_vjEPFh^J7axdBr@DmiC}^Jio}Lg z!6qd{E*$5s1x&qRHg#76H9=+Hc|zki`;hzqWKc<0)Ev?Dv_vc_(|Y-CNR8icW*1VH zU~VQ_-aC1MJmx5isQx@^l38uyO}2E_i&y+m5cLb*1&Yx7d4gSTbXe6rvo|%b*C9qb zlWAF@S}2WliHgDO={S%Yn${yRw!!{4YI-?MktC7!D!OWjBvG%&m17dObdKUnQI%q{ zPLPLRX#0y7f^~IpHyg|J9+swxc^?7RlmJ++rE`;#L$HlF^Fq}8zN3(zWuvmg9 zVh;$28}zH~cLWn<)G4sA2Z^Bl#P}Opm=5#sVaEsVsYtHVzU6g2DB^aLS&gZG~a8b!R3= zARe)0!~#c29}O7y_Q@q-Ri@oSo@(ZbIjLWlur(U-O+aWJ4Sl&iecBl$f>q-?&yhhJ z-f2wWe5Gkl@k<2-BG&_fcXqVFBLRG!*sf)YE^$t-+eL2vrA>}1A(n`KnE=}K6u1ovE0bVmbdG_DP8S$A)Hk!@i59}K)l6X}P$*}N`Q>!HDP*ZA0rmP3N8 zY4Lo^H)Z=qw^u-ImoAcd{V_`t@e2ODuwh7qBy8oH)t8iG9;;cRBy6%%1*8pwMqoo{eQbDXqt+vS-h%1{N-t9V*|ua| zzG~$-RiBsefvS4T^7&l6C!aEr`qS|TPzV=N&bk)zF&W;2>s#^t3Z1!9^S6+uxIk02y0US82<>V3z#-njPC`emfwPA%d5>8=JNQ|1u1y{|Ryii?U8T*=A`qf$M zoInyQaPZ;v2ris948W-iw!RctmMw>cSL|{$^sF&(7>SqNKXo8kO#+3Byl+>x(y~}L z?8YRgt(Qt_uu!mnZ#W8W(w*82o=puU;|$B$Dz3G4=NVq9MDd-%z4UQ#FCIn2u7+qW zaz7=nm1?E$A4)y|M|c4;U$D2cQMMPhGA0_NEh$dtsjOVV$7)VSNMln{3~YBFZBMwu zjAKU^i=%QlFS=3?5vXJ2oXF#mHH}=Mhe=3DSd2PDa82S}i3idiy;vLV zr$nCL1{hv@?r4 z1 zbe_>a@aP4R3rZ}C!CTc(gJPEq4n1Tjb`4db*1{%&erlru#>x$jXP0+d8=T5J~(C^8AD*Ahxdnr2$Lo}(jnx{CC(8S zaKyLl`FDpUxU< zvO66tdabwj=)m{@cM#yVFP8i%ol9kLZ6hdbSpXq^FB~;8mM7VR465a?sBwlcXYz0sZ?CZicWVi-Tn^EM4I3^@1ERO z^|O3Yp0#vCKtxicBwoV_soR^Pt3|d7K*vYD5ORtS{&w2Oce}7S%86 zCvgj$jIk`YTBXhkUaDFiSS0AN;sOGpcRSY3ZPjtYL$C{quN%v!4m}=u@bh}cejwbF z^va`DEY|c=2NeZ#x3tn{fg%*Bl*Z_Y~2Z8{@NBzMUiG^+U zNY0P~`A8~K*vR7N=3w`-c!H$ymz!*PuuI;SB`H*K?|EP1Z2)3)kQ`ZcU;&T!N!tEC z;6<`a=o(EKD4aFICYxxtf>c@ z7E~=Opyu27wm7CCM97bprM)_@vSo0z#YHJ9E+`SR^8El*!%yB$*6tekW~=AM4YuAv z)x#Yl$nLuUPn?2H`U{m&ahYfpqQL?m6X$GCY=jyi5~F?lY4-i!-n_{RQl5kz==s)) zopJJt$w9@d(__Q=zvQYh>~dJ!yMzvWVLnKDfLtxxi~ipPG4p>eZT_E8*uU7<|L-U) z2g?@<%k)2>u(Fc>Ckjg^XlHHwf5pSH{x>}A-=OF}?5D-wSge857sqPhWc5YK{sXiA zjl@cPA+h$>E>2$@o8+G;gB3%E4x~hM1um6y)e{rt=LRn@1 z3v~SpauxbQTmO@4bpZS)&Fc6?vKjzHwBY~>fd9f+|7KqQH^urFiTnSASO0QB|LxQM zH@y0va_IjFUgcos{M!5Te`Hq^RJ@dx#PGZLFD42NbB@6}*f-1N%d6_7)U@V}bfz_V zs-}qvd9fKuiTIHTNr?ilQ01)-kUXfWW3C`s1Neodk@Wm#+f=m9EDLqEmu;hMnv*Wt zoJL6h1oN0}yqkS4r`}GC6WqT0bf?~WGvh-Jp#Y?Sv845l|s4OU&m5?j`D(#$%Jk=Wd`YSS=yTb41>Taofvg zh_}q~5IDAzw5w=0`Z_7q3iF2Xw#!_1r3T~WUfLnCrPy8QqXbxbNq+jQIey3kVE76a zK)8c1e`^MlrGwITOob)6RQmW4W~bMdJa}S2Zm=?I@^YX%M%J6Ly+-6gWJE-N6%kDg zY&*ViMYLP8Gg_ovQGyz{nydn|%rFEFw=wm=J-``o#l7ygQ!20$0O(3fFS&`@DxG}LdW*Y*^|%3&}?o2e(zP( zhl|eiH@AG?;J$ZK>BW9~th=Jb?j&1@9~9?TT|#y+_P`hw-SAI6b9n5yN44E9EGR(> z8t2G3wkY8df|9W+6$?z7=SVK(r6p6AV@0esX5p_T%$XE4*3w3|Bj~4>L#WV^Y}Mw! zx)?~*3Xm+ASUgtTbzMs(C8(|DMe#C?SO{w6b?{tFQH+>aVdo>%GTEI~apW3VoYN+8 zlqMnA}iZ6fzI7^J6U-7n@vS@d_)0WEv(D43Kd|2FFFcJG*pk zCOJZq5gwDiHa5sMFW9_f%jOWe*E*9vmrg%%ZckUXUc^2@w^6m>B111l35uXqshq($ zfnkP;yQQ{HB*2aU-#bCjdUY_;+u(#*(J>xjn<@HJ(FQA7O08^#8Ck}mBv58)LQZ6Z zoRx&r0B%#5ryaLm^1ZTp$Rpi`R;mWuj2zOKSpyEz(Ndii*10Sb8lEKZO~79$&3u9$QHe={zO!V!3t*~R-$ZwIw0MqM__Bow6~h2OCrmW90B@a&x- zFqJu~hDpP^wBG3g9^DNvOI`FmGt11HqMGWFEvRHl5%2rYu3M6yt%6j_Kd*I$d9AVDC9rgII z_410MOB`LwK)&Ye1zansz*i5SB7(Y)oE-u>f0S4 z8V}(-?o`Q{sCkv4F&@!DCnBV^--BMB(j*y%wNX7tpQCJj!&1+?OG{$57x-IycWdx`CY^bT|R801%DTC^|boz(eRrcB}wApoTCfxSX>pmqBXeL)+Iz=-1C zhk}^OW%w@pM9c5Hwas1H<=^^(D71S&yPeo?Iiat}cGAG7OpAM+P^Z^h#U??WQI@WU zTOq*4S}xQqoBZv+g9AH78vub*Z~zuNCNOXp2L7=8I7|!n6(ZUruZ22Zxh7Mpbo1%H3B z90`jgkd7419;&d*xbkT$8PHIR4uh(C&D57qGvp&P<_oCj;+XkG9o?hYiJ08=8Gz_* zKTok(T?_X%Nk7!x&F+C(Tb)YrHCTJI**0u0FTe(=R>NQS+sF&UPbHrPHEBQ_`||Yl z*4arY6~xI!MWn#E1?qZ)Y~-dVFqNg9T05!EcZ&$8F_lj*gM24{P!OVk%^(9aPl5Kf zvmx!C2cbDi>gHN-1YdIZ7dDg~7+{BA{&8%kaFWyeCN z<-K9_uZZ=ipy;Cv^q|)n6a!*VgG~!*;YeEw>;Xy>fzMe%$RHd;cw+3&z(KHq;y7{$ zvW>vzX7k*6p!6fqr-!%AvJ&BMaZOy0RXh};MEWgEC zVVY%k?}TvH!zpbS`~J#h+E2;a*0t3ImHKnfSsFDSJ+XKFrFXkG0RA-nhHnYJ3AQQY z^3TcHg%yD78ej!; zIHQK9TsgJXxGEgHAai=6*aM3LWzR0rbS2oj@Q35cJtYbT4mah@*$I6%=BF!l=JgS) z6)c;1eMz|rdO-}I`TSA%hMA`C2~*~$mMUXsrD1o(&$*=b{Ed3YMzaH3c(H|~3lb-i zLEt6GM)lHZ?iGTQK!zvhxoe{m_zC6O<$L5Gy9F#kM;Q zWNhxD`R0Y1XpxNfz4rnKx?tJ8hNtSav9}-T> z0gz5=l7cHDu*=9hl~r;;LlPj!((McS2dHZ`TLv9+cQUK!N&1x{u-O*e9(6_w)=IM%_}b>DUiGKcP4vo#OR|qRg}srDVMhM9 z{BOj~L4Sbi5Vv3lM`}5^F%N7o)n@i z$41Dx6nF2`cD4-a&irc5p@9#+y*}wS;PoQ&svjO#cQI@eB$HDanP<9xz&+v3L7q|Y zjB+b^5dV(mOL}i^O0%rf)@+2Cee?U63;!iSXDoNjqayte)_r$k@J(b40WF-A_0ucA z)R>Ha7Zscl!q9M9Ez8G`(YOicInj7Wq{Z4|vUX237f~I>{1%0`od|-%tR^yDNy)P}O%i&i6Dl4eVs4Zza)Pe2> zfskCS^n5MD5$6Xmz&Q2>6|6l|4I*r$+0eMH_iD>pk1-&RNH9>t@?E@#cgX6n$qL%!tD1hQ9%&z-u)0gF-g&as ziwE1`2M3U1KXBhAdtn*8mfbA2Rv4chB$_MI%jGV0;l`dDyn%R&e;y=4W* zdN09q!5H66%2KeRJd~_|l07=ySE3xz|NM}GYaY5j+IjT#ihRo_shi1_33PaSFY3m> zjT)wr%!`Akkz!5cS89Eom&su3-=?s46<9$GT7^?xhftG-2(7AIC{NyQ8nHDXG8Ru! z%VUnseS7~f4(nR;@3am2kRSAhs+FcU8EGWgeOuCUfyL@~Ain2h5}4^ElT6XL zV?12rjJvuZP>y6O<(F10ZdBQ$g&yKVGqNeFy62KZ8T30wX=Y&8T`09i5WIDg}6R^b3vMrIu9d^?9sWf*AtdE-cNb zs1P{eGh|Ja)8=F;fz~^Mh-54IuSK#$VpbfN%Xmc_HljZecp!!*trP1`UGbJqElYpn z5Ql+PhDwA=_#rZ^_e%`(genQsw>lxm#|-q-u|v7%(u!aJ8gnYcD;8ZFW!=n9Pn*`V zwtroSE+KGpzZ!IR-;Uq=sVgS ze4Z-X-uvd6B$2j^O7G@Sdb1hKn`3|W1NHkJW*BGx+l+P_Mq* zC20iyrFM+g=GM08$N#5L*|fj@`{Psb(BsOSTV8&_#?iH_SKD`;&LI*4GR#?8Vd4aV zvjIHp^jS&>(Y(wUfmr(?uW|-cs`_6Va&9&s{w54f>eexTYSt!FRu0b~^S|{{lm|&9 z^yZVWZdfYHF1nVzhE0AZ`5@X!8EB86yNtOSJCTM5elAyS|kJ4%THS?n_b8{*K-e(&f`wXMGG`ciVzDQ*_5i^%|;lc*Iuhm3Ac%Gb1 zB2$sVjQD8nsc%^w+NJ}P-E-tqgT7{QE$ z`zvpVUm3`_s3($^;)V#ad!^RFSrD+)G)_<7UVMJ@6v!bp@iuN;V(y5=jPL6hfB2C8 zf;ua?NC>UNI3CSdNU8J=kYKetDsoT(k|84!{)|t=W~Pfs@m1;0^;mHiNGvzS$BmnN zb_-e8|Eli0qM}-sKqX3)AW7m#&M?C;3^{|KNX`h7Gf2)VIVc%LGKh$xWD&_pa+V-b zKv6)F1VK>X?LCSI_1tsreQUjs2dh{2?yj!tuBxux)6-KG7MV|UcwJTIx^WQ`O|RaS zZ++{Z?g?iGy;OMTxH8w|8%RkspV)mbFHXP6C%B^}V%j6dqtep_yK1MAIsB z*yvOqsEzVsKW(k#=Ch>WZ@76$InML|iqZXI3pI<#OVy#xpK-=Tdbrl&Sm=~(oderIwjDI zOk-2pJbxzFa5I*#ZAQUnd&zt!s?IOUGdFyBg2&b9m1aP}hFF}6&H5nzoGM-Aiut{O zo^y-BXxyIGibTEvW&Gx3u}|WxbG3S>E&Hts39Yj)y-GW+!>sl^sJ*uNX-JR#Aqyp` zIN?o7qnu)M_QN4)pOMHIH@&lLPNx)qo*lbM2@lKEi%OY2x-mHrL} zcCLv6@ag?&lV@>j%s9`^Wj4EVs$tez&DRfgq&#jF$cG9FJ!Ah|GOD+pWD3hS5r|OO zS1AJYzs#G1>M6tQt{Iu+>v{^y>vwtk`kKqjE{^84#GWZZ2t4jy9A*Pz5~X%;V?Ja` zQh^Z;bZ`=gX_1N2NO@M$!bU!y3cbQmPq1K|4`mi+4X91-<-Wu>of_Ftqy6GKOONXZ zIlPh!hvaJk8`vB4(zuin$mn#&7trcuUdl=7Ys+>8QYz5}WwcR_q{>0+cNXl51kv}l zReE*V>t>y&18%gj8Refot=QOj&eZ|^I@6c!X?6wj2a_rAq)rFZ4Q4vebG+rY>GX>N z)ftz2mbR%mp82r4J|h$tGTks~D*mD<+vEoE?sJ(Fpc)N}I5j$7nDg@B<{O!Q>xT)o zlVv=@?BcO0{ST4Pz3wH?k+!lv#yLyRo4BDKe~&=f#kR!uB43D<`RN9pH|P-JtSur;2ZiV8nUH|P{ZJ#{S=;lZ(PvT zA1_Zgz)Oy%F>$D<4(Ew)R@W;W?y@tNDg3MH#vd#ckm;E_=54A85Vvxo;~c#hE^x=F znC9O;ce?_@ruucimKow#tH7W<@tKp$NjqhJ^>cRJq23%el}WV2;8s#}B%^jz8Kr#G zoWf*P6+86DmPJ6=A!9|SLaUK%%4oir!omaBY-T#&%UcT2dA zEsB>5R$x~XJvN^=d6SJluql2a|4WyCY?y7%jiMF^2N=<`eNitm(%te zur(Q^ypJA78pmEb4D2%%S*BOE*6F@&!TkxX6LO3^GnPztH>B=OxEid^LFWwmo6*z z?Vb+p(3mX*b1B9>;!Dc;379%I3PPg=5RZcAg9Vz!y&eTuP9HuRc(8gj^Ui+(_@9Xv z-CVC%I!v;INLmFPeA()M(?IR+gd?KJLpf<1|3;lq<>P60ab(Fmt2~0cOKEVGM+%(t z$#>P!qq==JbMtL|9%9a5+#|f9yV-Ec>Zx#|3>BZDZ`ra>NauBG)1_UKOk?Q_kHn=` z2g4WUzMQjxi-?KLqj?q=+vjZ~#Z_FM)GovMl|(kZ8auOO+oJ`svFy}rY*lpMYSgil zUl^j&nlN_O-NBf$y=QbuoIIVDioo}#_0>j^o7*B;r5E0?pgq*2+jGv#>>Aab-Nq!r zy+ix1{I*w-h0*G;q76kIf%s^^gLH*ELxk_rAvmshzOHe#GItg+J@4m~a7*gC1`BDQ zI~5qk=*O#}cKf1osfLo0_Ia8(zP!yZT^UDgL_yGr*a%z?KDCG=L8`}%||^eSg@s6p{{ zO2?wOEjdz1GU6j9PD9`#rMX#_+0*y1fx}Xd%nxw?wV4kr!?p7f``;SZ@h24GZdS^_ zzu&ItKlU;ygzud|M+T8Nmh2FFWxZ-RA%v4k*8T@3Vx@C+tBi~k<4o9p&NQeH`4ta zYeP_5mm(IE>nFRnr?wb0Ul(&TCNjO^l%(id&C}7Gy!x@SEZPXsMe%OR|Q=bOM{MqA$+rcbYfm2+l5MoVIaUY1%FU#M)WqwS%S*2#R~HO=i) zyJm)`HY4NQrYrD12s?v{qjk=;*ITGWOR0)KRSxsA5SRr&**ZS@<-Z+U(e^#5X>oH&3X9h z%d=@)hF6dIxq7HY>jVaj>m@O>BB2-P-Dfu0)_H~{mgw=e(Q1a|@hiutMkhi&sOan( zFw-|r3z}aTP~G-}7Wa!#2eNIPS7Ml8BOxBSu%v{wF8(wmIoZtyA7Y;<88*tgMY^QA zc@Ga-WCuMJTvSDabu21QXa_%r!c<N3OgU6HyA$#oU2(YWi= zTJmu;0-i^fD+xEg1xez4Q=c3;_a)3MOfq^i-_6M(bq1d0x8x47BsSt5d%fyXqo(Ve z#d7nKO6LnxZX?kY@eOP$CEWxD=nJkstBY-^mR3uBK>>jRIt*#qp^XUwJ%wwM3kR~*OnCFA~$m_8V z-zY~eT-R6B+<5KIS&4c|*8e*Y+3-x#8+My;TW` zP+p#}=aXH{TM#}g)|mBzxgpFbc4D7VZ;Y~vI0b9C`b+gf5@Ikem3c$`d}8e#8`>LG zFGep8jlVC)7Hvd+zAi{+w^h0QNIG_cJGoh~OtxZD?IR1P!a>xxu=9FaD!VOCL9dtKEhT|NWu59pr{RevO*sfMD zO8uAIQFn~w4{l5FMcOLj+~e2B!Jkm^7S)7qEZw;{Vv)|ciM^Mz5%yWONbM3bu4mUnbyvuVtW_Hnj7|E?M%GOq=-hMesJUe7d+@L{BwV-^l&O#1-U*Q-~B%9iQQ ze?>muQQFDiweQzYz^f+KzuqwU9vt+qh@S!{UGo0Z4HE=EKi~xL zA8(krYuW3aT_VpsB|t#YbTPN{l1T6qo7We+pL;IndderYCQX_(M&RHxa+Ap13<>cg zZEmH(W=4~}sWeZD76=KVyoyCBFGcB7>*;8zJ34J(|Jvz^Npr}v;IG@(H){KL50DGu zz`vg)#ry~KQa$c0aZ%ae7Fi*=sFzBwN|;-XBa!D1&Ni{ubDvj9qN1)MerMexu8Y(W zY4%>5*_@I!ZN^+3{I>8i@+c#7tm_Gx1rRz0&MnZX0||tZcPMr=QJ`8}!17 z3Ij)Fs?>z+DeVVXhCT}wnbbr#qeb9vHj1Bp@8j*e&HZt2+`fOXmE#tJpP#p+5u?%m z+^apyk?vjIhK(&_&ndjQu2>zrg)GP$~Xf#$ib z=sl6ok2SQO6sd7QAHy_Lr5{9*4&_>Eakh6akb7qps*!aw-;-m@Ba=Hb^5FUGUDg05 zd5xs{&LI6^YjQGajt9QDyzvDo)W)9uRm$|~U71Hydp$F{jjGD;So2us6&W;H+#KpJ zL)$$1nF15FPxC{ z*4rrTQG%(VXv-;l$)S(soeozrrIm8*WY3L6o#U!52#aJ`puL7ClixQvwvGRC2j4J! zU=YnuWvs-0WvW0X;~~Y!@LigZP-V%h*X2&-9as$!cubG=2qH2Z9R#v{3uGr_1z2cV z$ft!G=ipgN{qxhqb^-F=R;LWqOYCyBgHIdC>Q1AhV04r88@2zB{DZI zr{7c}9Bx~7?Z4*MPbP#gSJ_7!5=T!O&${`(PyYpFsaH?$tFk?v(&F1$d>=mCawEeN zG>CI~!JIm$CP1qh(T8_2zC(`gjy#N83*Sn3+E7UDRN+Cz5}M%fK(nI_bR^BAV&bsN z@6Mw;nJ!tCNQR+{3-m49ZZEqJCwOO@8Z4Y6w(t)R?h;jEKE=&V&L()dt>Js_c{kNS zRq*1J3y-@9MRZ!`okN<_^;flL2xjAN3Sk&EzCBlR&T@bV5mYf|LS{mDU5;5Is(NDs zYg=a4^CL!jn7?I~6U33zWJl`i)^j5M3DMvWa)aw61UmzZo(;1%OAbiPv}j3;iDQaC zuh%ok(!b!#*rUNlI$j+?>ZuY0wwlzYdLs|7nOSU#`Ci}jJV^fXALT6A{?rHmly{pk3wy!Zy++NZiLWMJm0J|)o<5`Wg*SzXmI#C z%gnrRp}tlvx&VKx%k^5`zJ)wg|2nKjq?5|_GK~G%qOE!q;#~ff135qR&S_~5Lm|^S zkDwj)`*Rm=Y|}~14oaxL_L94=rO}&%IFU#EA^ zWK<0OphPMtBes>nk$JvC2T2jBT!856bjY0;4yqWPS;oADb2W7muR-2;N^K#NWwPvJ zf_X_uLa_4r!QfN6vo|w5Ius_*_+DItMLQm~7*VdiT?s1eX#U(MnIedADWnwTzFVy$ zTT}Ek=}ni*Q+ar&_J8GR`M#oW&1A*aNLIbyd>Puexl}c;wUw8^g=+q7g5G#9cl~9~eGym1I7o zfLVe(G5szLUL<3%zT24w@2XP!INC*es(KiY-CKWZR^^@^Y3c^Kh`4c-5y&X6rZk*}6(dv}BS|f@GIWt{5A{Jw^(nnqq@5s@1kKdufUF9hs z$uiA3V$#^Q@Q_ZXPX}3Wy**~VChwQ{+mounxhru;n?`HWDp!1HXU18)t-bELc!mk4 zcc(wOXz%mI$ZJ$%X5!9%1RMuPPd@Gx8Y#i~5axLmDN&|4HXkWcob$LB_(Q^N)TBxo z&B=LS!=DA8i+DUU9CspG8R>hYS9vsb)K|Cb)wjEKkm;;E5${0X*4>w2J(p!M5zKub zq9^Wow)SH>Lss|#eay@~>b9`_hZD}ThkXVq!8SS{$uzPhwEZ+NmhH9il%gLfa6Hj8 z^N7-P6(+W8r8t*lU;w{dTRuJP#3oW}b##h~G=pbT+C;tDk+R-O`y5l`1v7`~q`Nos zT9a>llF(a!BbbUSpkVFYzfn~a)97ec?Yuv+EnAdEUvWX+QNevKLE(mCFrl;k2s?L( z`ncRd=p*Co4^7q7(It1Yqzey?m{k+0!5ui8ZfLeJu-i3kxX{sEy7-QBzIFK;^j;9-(#v zh(Md{z$R|au>3+Q=<$4%uVB$2+(s}&!B6=K#+jCz0eJT*OG$Xkfl zChKYV{J1Cr4F`qL2eSHd?&U|^#E}Sq9S{?_cY4!>+_L8F!?2KJt>TWk6f!)>ZDf2^ zE;nNKU1=oE*uaI!Mau!UHB-Nw@C@67)0uHEEsI!2`7517h{K_8k?ZZjbVW(=7;z-~ zQCp;nF6_2v3Keg#6x7ma?9g_Tx8b!7(d;9qYu}9cK1iG`A(%zD)wN04EK}QQOKIk7UCdV2;L}7e)v>!PTP6II zAo+@OIf+i%n>BO^CAN0LY0JG24&OfIP+!K5ZxT*Q+p<;Xy`^3fnb;-COB#VG^H?hS zF%}lvkjoN1^~5=)HUGqP)uJbQxty^i{u(LT>K%N%lIo1ja+b8@$*u=s3WVx2-ev0e zsn0}m(F}S-Zei&OTBYD3xR_NK(@nIwC`b~h?_4(TQ>2=Of5r8$j-VX(ekoC zFROD{0KKWhGB=b9ymyHukDRhPN`UB<}Tbr zvR2_HronqDuD(j;W?kHk@tks!?RMV^95)>6>1}+iDy8cfTT6LgCH~Egp^lvnxmV;o zy<~J}OSr~|A8MO7lRht?lI$wW;9yd&vB%~O{905sz@1L0f^D^dkA@q*c?V{1%sTtJ z%px3e?g%@!o~cf4x~W}+vzJ^fuC?zXN1!DKL!_>HXZ7HCmICcAo?p0BBkd>5?EK;e zzn)OULa#37h#nc>D&|!#{#_)EO*HSNn zlYG8??f$oPV#G^?i~EeL;VVttMTj~Kp|p=9zB0v5_g%xE@Wxrmx^^z_+I&-qa_4nz~OSI zTAGrcCEX6Yu-z5ye!4vC-X`R8Y{y35rJ4y20S{5QvfJ1zOHzpLJl=EZSD&|ZQm@v) z!ihLPH&Z~#Dv{bwQ#VGZNSGB4&L(QkxK=N6Tba^-#bhmxAMJE`Uz{a?US41M9zP

    K75OA}9dN52TwZ4DErjd?^x+;{v+XKcikghe_ef|bhr}x>5vK#S<>}(O& zXI!6K^KSPq#}-Rgy9+P2Iq)Xe6ADp(d}KcQnA(yNqV^$bN5*w>Sr?u}CVYD|Ty1-i zXm_BXeUYf2-ZYapYvinP_I(O=nijVJUQw3t{NX77xfqXmf;utv=fz~7JVug`%!rza zP%m!+gz}r`Z`K00Fk0%%c`{foi+sK2g2r+tMXzXZw!$Mn?PCkm$LPiZ|2Lm;G(3rA z?dgYib_35_Ru151G~=B;-QV+6ELEDBxk0flzTv!^GZWpkuacy97-vC75Mq%mDNXrP zkc_-GG``F1!J2Acf5&)_k+kLJd67L=NuH0ANrg7I&y;~)x#)OL z&gGe%DD!T8BtbAVD1pwTnysezrP0CCW@4#fZY6Kb?JxXkH7d^SX(}FeEuy?#H|Eg& z>JoIS2TR_+*tn{rlQ%KD2?zu4LS$n~P0p6L3Q3MQV{kN7^_ z7EME-b($Bi%O`dx3auDNFVH$Kaj+=+G3RjHyeesMoq;EOcx!3(sMKgjS|#0w*10fJ z)Gfn!VGVY6XK6Lp+T@|vj=^$9jEH#OeH>U6UJx3$Ob9U!<^{xg8ksVEnQIT3Lx?vs ziDl+l!cGactJ|RoW2;Tjk2Tlb{;UxDcwywS-DjXFWI#t zt@M_7L?YezlCL!&J67d%s(JQ^r|$}Swvu8_zoFP)a$JJHh>1shAWdHlwISrW|;;EMab(8l`S zW^yvLtniiCF>$w*6SIOgHyJQ%xmfhHq zIBKwJ_o#f(vn>$Xr;~hoH(TKn>B>yjx5m}Nd6$N%4vKlV{`9fkK9?1lLo5w~g83uG zOp*{WzQcI(BJqr&3CX)_H{%}_A<&sNdFF+UzS?gyrfP_!4ka}rXr=GbZl>70^tvQk z*lroNRRBlFeOWHHLwG&uAadj#-MXO)?i(DFb()&b2UF82s$rz@5i@}mqO=rjizOA$ z$FfHppwE{kwdkU+uw!~w8Ps0QZWovh%^^yUgo;hk4%Fc2o*eyEH z+fiQ|qp;1MpG!;P>bp6Wn1x?39Hk&Uz~#uxkyL%5rj)SUhI&G4wu8gcg@oHzH6<wG<(K+2F(-Eku{ld-SY|SS#mea%HK7u)hbKD(jwfBw)0r(`Zmq^y(CrR9$>CdOdoQMi^vW%p@mTr9bkTa^bOt^JG zCVp|G^s$+z=&p2_T3L$-u@iof9^cSnu=s;@@%9aVuYun9)hT{No5@UCkKR;|6c;f= zroNF+$>!{qbMm;g^=pL&oIbOdz@0^6`rKlO9u9)N#x78%cab_r=k-(dcOtj?ir7T9 zdFvR&uiS188Q<2iAkpTG|3c+*+wV|iE#D@~L|K(O^u2!)d%f~?rnnVv$wj{zeAc%L zgvxZO**$)PGT}RHFAlWy<#(zu7S0&;+!-+sW33KFbJq+{4w}ZZOvZZzH=G$2gyAGD zui6#I*x-aNab2|-_WDe1bg#DCY^FTL+(=roa{5a6osfNPrfjc)AxQ#fmCJmrhdOhV zqmczK6YMTcW;>3e<(5u2N#(W>kEqgFG*BEarNv695SSjSHO^thIGv>nWi8GhA#9%Z zG&vYDwqhn454!0;n3`v-!Xc9tU&m)VmfonAa9(k$K2DLBuo z$1E2b%iJ*5Ok`hM*-O}l{n_Hw{+%`M_O+B=%8;^G_iLZ_1O?q9jU*Kq?6nfGfmZ4p z3>H)(Q^k2CH1j)y#;JnkPk+1ve;mSjM_N7n$tpEbs8kPdeP6A4ND_?=Tla2*y!{TR zUqnFs^cL_Va%hd)Qq31@y>9|XQ)HR^FNaMTpB8wHWGhiu7(B|ODx+X?w4;=N!Cow3 zgO{5A&{M$5vGiW5%YkKZ3M-Yy72`WzfRkPKNOq6i6fGCijcREde~WJ+k>|`OkiuQj z`8lwmhD&BaB-gLP2Nrhs0s@O}l9waHCqJP1MK`3B`b6p`hKR1^2=FXC;ZuY0liQ%#2@@qd03a`GtuuP;J= zKeQ+0`yRVS0XWWAuyu8F2fuoN01uadU)Q3_FhSsJ3SClfFZ3sAOEZ{TP5eC43 z^@PVA|0xH7Q5^szfbcWkPT$;P6l8V8ij0ehwdi0m~qN zj@!T-#RIT|05CMvJb_BE0X4)QWe_I5~W<0o4iY_%8`H zh2vo!=O>5wZ)HOGk6|7I3IH;O3x4N;5CWJAkc3a_1Y8*MQxZ^siGo1I&jcb9LO|fc zfCPX>Bn&_Vw8Mk|B?9UNfZ$X@2qa46AVF|?C{08u2Z#tn0OSZLAmbk+1L8ydSPnnr z3o__<2p|w43gVbmD0zTF1kixv03pC0V7w`?{Iea<8c=gk7(mSi8$cu|Y+#RLp@8|Z z9v$}va}WlV0BNEm`LhCO0EKZ9_@Bx^h=pzPKU;|C)9 zsd(T6*b_B&5F;=LK_p-uf2i+w+Y9I}sIDLuFh>D_69=A;nQ>eO83dM5i~(}OpPhiQ zqB{O)1Sz9{07NLHzygB7fVBZGBq0CAa2*d5%#Rz6JO7@8$WEreH(bX<1gCK_f%PX7 z(Dt{6OA!8j{zAZK0x+RC3eFETN5CL_XEDH1&^rCsrb_^zCjf{ZG+ie-^xbrUI`Ute zE`an;F@sb5Zo7^rdvd7%v+V+r{KWn9r3$DKN|iuCpGe2b3g$l*5+z7Ln8)gKJe+^Z z|J`=|gYS~x4H)QW<)oL6lM#mh3j+o?>iGY{fWd*4bS(1YeHRS+eF>v96_6xCNbvuD z-*qf75Xo@@2?_&*36EcAKUL(%>+M+jU}tctg6-g{14nog_PYTDI-#Zj0Dv7qq$ohJ z{>M^1-W7p4{D)xyk^kH}f>b~xU=HfsF;BoUn2zgDt~n6q`@ZXkHXnC99x|AN2}KnE zh5yHF+=#RG6@fO7}(2dz|<_n5r6p#Fiz1xp7{OLtpyQo$B#Gfl#uxR#uikTvKyP;6pQnpO4oGh<^$Z=5um(ax`_d2R6;F zmhK*|P7tWT-_*g7e9{)SKz}z|H^M6?Y5w_g`6rsr?iQ9-5F|hyRpLX1Rs~7^sDQwP ze-@!9i2@(|VBevCCI5%$)J&~`u)Jzu2v>Iqu-;HApke9e?BNPd{kwkg$pU+R0Kg6M z-J=x{{?{D{K?~slKDVEk9I(6jT{Hd#J@j|{!29U?2>zbHpWOQw0>G;Wh41GCpx_Dt zwEXX90Gtr~k23&_=dT0+d+<*LPI>_QzCizN2H&rE{v`s~51##p8T`3y{*Ay7j{Ia1 z?1v%vdjcpO`E}KR1l$PuF4|fEYX!v*Kt(|=0OvZW48>Lr2n;1$z+8frfFYCxf=B~_ zoC*0Y=Cak9>A$H&1aSHn zI5-@E1cdo(ogh*eVDGPWLQsA{u)o$J1;F+8OC1zAo&i?bFLl7X8`vlPTE~wN1l8tO zIHWM}cK@}GA0Y%T@?YTikwQX$_JxDm_zN5y`8PC#`GJF|U*Y(H>HaYfC=@uP`V|f? z3zt%yaFyY_nLIs52zteyV!+_6@zx5SB3jRSC0TudPmT+MKVCVB&Ujz*K2VEgy z;otj0kx<}3_P4%B0sh~|2Sp;`zr(?V1weBL{{7THn6MDAL;JN3h{P@QJ3eq~f655) zhrYm(LV(8qiVrR5{iid2j;fEKn#1}NL<6&*&R4l0L>2& z(%s3*8Q7!$c#wk_ioswOP<~+f@bg<)@x$O|7UpnEb0H|qN*FF|W)2gU_;(1D(Q + + BACKGROUND + + The IASIO interface declared in the Steinberg ASIO 2 SDK declares + functions with no explicit calling convention. This causes MSVC++ to default + to using the thiscall convention, which is a proprietary convention not + implemented by some non-microsoft compilers - notably borland BCC, + C++Builder, and gcc. MSVC++ is the defacto standard compiler used by + Steinberg. As a result of this situation, the ASIO sdk will compile with + any compiler, however attempting to execute the compiled code will cause a + crash due to different default calling conventions on non-Microsoft + compilers. + + IASIOThiscallResolver solves the problem by providing an adapter class that + delegates to the IASIO interface using the correct calling convention + (thiscall). Due to the lack of support for thiscall in the Borland and GCC + compilers, the calls have been implemented in assembly language. + + A number of macros are defined for thiscall function calls with different + numbers of parameters, with and without return values - it may be possible + to modify the format of these macros to make them work with other inline + assemblers. + + + THISCALL DEFINITION + + A number of definitions of the thiscall calling convention are floating + around the internet. The following definition has been validated against + output from the MSVC++ compiler: + + For non-vararg functions, thiscall works as follows: the object (this) + pointer is passed in ECX. All arguments are passed on the stack in + right to left order. The return value is placed in EAX. The callee + clears the passed arguments from the stack. + + + FINDING FUNCTION POINTERS FROM AN IASIO POINTER + + The first field of a COM object is a pointer to its vtble. Thus a pointer + to an object implementing the IASIO interface also points to a pointer to + that object's vtbl. The vtble is a table of function pointers for all of + the virtual functions exposed by the implemented interfaces. + + If we consider a variable declared as a pointer to IASO: + + IASIO *theAsioDriver + + theAsioDriver points to: + + object implementing IASIO + { + IASIOvtbl *vtbl + other data + } + + in other words, theAsioDriver points to a pointer to an IASIOvtbl + + vtbl points to a table of function pointers: + + IASIOvtbl ( interface IASIO : public IUnknown ) + { + (IUnknown functions) + 0 virtual HRESULT STDMETHODCALLTYPE (*QueryInterface)(REFIID riid, void **ppv) = 0; + 4 virtual ULONG STDMETHODCALLTYPE (*AddRef)() = 0; + 8 virtual ULONG STDMETHODCALLTYPE (*Release)() = 0; + + (IASIO functions) + 12 virtual ASIOBool (*init)(void *sysHandle) = 0; + 16 virtual void (*getDriverName)(char *name) = 0; + 20 virtual long (*getDriverVersion)() = 0; + 24 virtual void (*getErrorMessage)(char *string) = 0; + 28 virtual ASIOError (*start)() = 0; + 32 virtual ASIOError (*stop)() = 0; + 36 virtual ASIOError (*getChannels)(long *numInputChannels, long *numOutputChannels) = 0; + 40 virtual ASIOError (*getLatencies)(long *inputLatency, long *outputLatency) = 0; + 44 virtual ASIOError (*getBufferSize)(long *minSize, long *maxSize, + long *preferredSize, long *granularity) = 0; + 48 virtual ASIOError (*canSampleRate)(ASIOSampleRate sampleRate) = 0; + 52 virtual ASIOError (*getSampleRate)(ASIOSampleRate *sampleRate) = 0; + 56 virtual ASIOError (*setSampleRate)(ASIOSampleRate sampleRate) = 0; + 60 virtual ASIOError (*getClockSources)(ASIOClockSource *clocks, long *numSources) = 0; + 64 virtual ASIOError (*setClockSource)(long reference) = 0; + 68 virtual ASIOError (*getSamplePosition)(ASIOSamples *sPos, ASIOTimeStamp *tStamp) = 0; + 72 virtual ASIOError (*getChannelInfo)(ASIOChannelInfo *info) = 0; + 76 virtual ASIOError (*createBuffers)(ASIOBufferInfo *bufferInfos, long numChannels, + long bufferSize, ASIOCallbacks *callbacks) = 0; + 80 virtual ASIOError (*disposeBuffers)() = 0; + 84 virtual ASIOError (*controlPanel)() = 0; + 88 virtual ASIOError (*future)(long selector,void *opt) = 0; + 92 virtual ASIOError (*outputReady)() = 0; + }; + + The numbers in the left column show the byte offset of each function ptr + from the beginning of the vtbl. These numbers are used in the code below + to select different functions. + + In order to find the address of a particular function, theAsioDriver + must first be dereferenced to find the value of the vtbl pointer: + + mov eax, theAsioDriver + mov edx, [theAsioDriver] // edx now points to vtbl[0] + + Then an offset must be added to the vtbl pointer to select a + particular function, for example vtbl+44 points to the slot containing + a pointer to the getBufferSize function. + + Finally vtbl+x must be dereferenced to obtain the value of the function + pointer stored in that address: + + call [edx+44] // call the function pointed to by + // the value in the getBufferSize field of the vtbl + + + SEE ALSO + + Martin Fay's OpenASIO DLL at http://www.martinfay.com solves the same + problem by providing a new COM interface which wraps IASIO with an + interface that uses portable calling conventions. OpenASIO must be compiled + with MSVC, and requires that you ship the OpenASIO DLL with your + application. + + + ACKNOWLEDGEMENTS + + Ross Bencina: worked out the thiscall details above, wrote the original + Borland asm macros, and a patch for asio.cpp (which is no longer needed). + Thanks to Martin Fay for introducing me to the issues discussed here, + and to Rene G. Ceballos for assisting with asm dumps from MSVC++. + + Antti Silvast: converted the original calliasio to work with gcc and NASM + by implementing the asm code in a separate file. + + Fraser Adams: modified the original calliasio containing the Borland inline + asm to add inline asm for gcc i.e. Intel syntax for Borland and AT&T syntax + for gcc. This seems a neater approach for gcc than to have a separate .asm + file and it means that we only need one version of the thiscall patch. + + Fraser Adams: rewrote the original calliasio patch in the form of the + IASIOThiscallResolver class in order to avoid modifications to files from + the Steinberg SDK, which may have had potential licence issues. + + Andrew Baldwin: contributed fixes for compatibility problems with more + recent versions of the gcc assembler. +*/ + + +// We only need IASIOThiscallResolver at all if we are on Win32. For other +// platforms we simply bypass the IASIOThiscallResolver definition to allow us +// to be safely #include'd whatever the platform to keep client code portable +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) + + +// If microsoft compiler we can call IASIO directly so IASIOThiscallResolver +// is not used. +#if !defined(_MSC_VER) + + +#include +#include + +// We have a mechanism in iasiothiscallresolver.h to ensure that asio.h is +// #include'd before it in client code, we do NOT want to do this test here. +#define iasiothiscallresolver_sourcefile 1 +#include "iasiothiscallresolver.h" +#undef iasiothiscallresolver_sourcefile + +// iasiothiscallresolver.h redefines ASIOInit for clients, but we don't want +// this macro defined in this translation unit. +#undef ASIOInit + + +// theAsioDriver is a global pointer to the current IASIO instance which the +// ASIO SDK uses to perform all actions on the IASIO interface. We substitute +// our own forwarding interface into this pointer. +extern IASIO* theAsioDriver; + + +// The following macros define the inline assembler for BORLAND first then gcc + +#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) + + +#define CALL_THISCALL_0( resultName, thisPtr, funcOffset )\ + void *this_ = (thisPtr); \ + __asm { \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 )\ + void *this_ = (thisPtr); \ + __asm { \ + mov eax, param1 ; \ + push eax ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + } + + +#define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 )\ + void *this_ = (thisPtr); \ + __asm { \ + mov eax, param1 ; \ + push eax ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 )\ + void *this_ = (thisPtr); \ + void *doubleParamPtr_ (¶m1); \ + __asm { \ + mov eax, doubleParamPtr_ ; \ + push [eax+4] ; \ + push [eax] ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 )\ + void *this_ = (thisPtr); \ + __asm { \ + mov eax, param2 ; \ + push eax ; \ + mov eax, param1 ; \ + push eax ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\ + void *this_ = (thisPtr); \ + __asm { \ + mov eax, param4 ; \ + push eax ; \ + mov eax, param3 ; \ + push eax ; \ + mov eax, param2 ; \ + push eax ; \ + mov eax, param1 ; \ + push eax ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#elif defined(__GNUC__) + + +#define CALL_THISCALL_0( resultName, thisPtr, funcOffset ) \ + __asm__ __volatile__ ("movl (%1), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"c"(thisPtr) /* Input Operands */ \ + ); \ + + +#define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 ) \ + __asm__ __volatile__ ("pushl %0\n\t" \ + "movl (%1), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + : /* Output Operands */ \ + :"r"(param1), /* Input Operands */ \ + "c"(thisPtr) \ + ); \ + + +#define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 ) \ + __asm__ __volatile__ ("pushl %1\n\t" \ + "movl (%2), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"r"(param1), /* Input Operands */ \ + "c"(thisPtr) \ + ); \ + + +#define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 ) \ + __asm__ __volatile__ ("pushl 4(%1)\n\t" \ + "pushl (%1)\n\t" \ + "movl (%2), %%edx\n\t" \ + "call *"#funcOffset"(%%edx);\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"a"(¶m1), /* Input Operands */ \ + /* Note: Using "r" above instead of "a" fails */ \ + /* when using GCC 3.3.3, and maybe later versions*/\ + "c"(thisPtr) \ + ); \ + + +#define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 ) \ + __asm__ __volatile__ ("pushl %1\n\t" \ + "pushl %2\n\t" \ + "movl (%3), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"r"(param2), /* Input Operands */ \ + "r"(param1), \ + "c"(thisPtr) \ + ); \ + + +#define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\ + __asm__ __volatile__ ("pushl %1\n\t" \ + "pushl %2\n\t" \ + "pushl %3\n\t" \ + "pushl %4\n\t" \ + "movl (%5), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"r"(param4), /* Input Operands */ \ + "r"(param3), \ + "r"(param2), \ + "r"(param1), \ + "c"(thisPtr) \ + ); \ + +#endif + + + +// Our static singleton instance. +IASIOThiscallResolver IASIOThiscallResolver::instance; + +// Constructor called to initialize static Singleton instance above. Note that +// it is important not to clear that_ incase it has already been set by the call +// to placement new in ASIOInit(). +IASIOThiscallResolver::IASIOThiscallResolver() +{ +} + +// Constructor called from ASIOInit() below +IASIOThiscallResolver::IASIOThiscallResolver(IASIO* that) +: that_( that ) +{ +} + +// Implement IUnknown methods as assert(false). IASIOThiscallResolver is not +// really a COM object, just a wrapper which will work with the ASIO SDK. +// If you wanted to use ASIO without the SDK you might want to implement COM +// aggregation in these methods. +HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface(REFIID riid, void **ppv) +{ + (void)riid; // suppress unused variable warning + + assert( false ); // this function should never be called by the ASIO SDK. + + *ppv = NULL; + return E_NOINTERFACE; +} + +ULONG STDMETHODCALLTYPE IASIOThiscallResolver::AddRef() +{ + assert( false ); // this function should never be called by the ASIO SDK. + + return 1; +} + +ULONG STDMETHODCALLTYPE IASIOThiscallResolver::Release() +{ + assert( false ); // this function should never be called by the ASIO SDK. + + return 1; +} + + +// Implement the IASIO interface methods by performing the vptr manipulation +// described above then delegating to the real implementation. +ASIOBool IASIOThiscallResolver::init(void *sysHandle) +{ + ASIOBool result; + CALL_THISCALL_1( result, that_, 12, sysHandle ); + return result; +} + +void IASIOThiscallResolver::getDriverName(char *name) +{ + CALL_VOID_THISCALL_1( that_, 16, name ); +} + +long IASIOThiscallResolver::getDriverVersion() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 20 ); + return result; +} + +void IASIOThiscallResolver::getErrorMessage(char *string) +{ + CALL_VOID_THISCALL_1( that_, 24, string ); +} + +ASIOError IASIOThiscallResolver::start() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 28 ); + return result; +} + +ASIOError IASIOThiscallResolver::stop() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 32 ); + return result; +} + +ASIOError IASIOThiscallResolver::getChannels(long *numInputChannels, long *numOutputChannels) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 36, numInputChannels, numOutputChannels ); + return result; +} + +ASIOError IASIOThiscallResolver::getLatencies(long *inputLatency, long *outputLatency) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 40, inputLatency, outputLatency ); + return result; +} + +ASIOError IASIOThiscallResolver::getBufferSize(long *minSize, long *maxSize, + long *preferredSize, long *granularity) +{ + ASIOBool result; + CALL_THISCALL_4( result, that_, 44, minSize, maxSize, preferredSize, granularity ); + return result; +} + +ASIOError IASIOThiscallResolver::canSampleRate(ASIOSampleRate sampleRate) +{ + ASIOBool result; + CALL_THISCALL_1_DOUBLE( result, that_, 48, sampleRate ); + return result; +} + +ASIOError IASIOThiscallResolver::getSampleRate(ASIOSampleRate *sampleRate) +{ + ASIOBool result; + CALL_THISCALL_1( result, that_, 52, sampleRate ); + return result; +} + +ASIOError IASIOThiscallResolver::setSampleRate(ASIOSampleRate sampleRate) +{ + ASIOBool result; + CALL_THISCALL_1_DOUBLE( result, that_, 56, sampleRate ); + return result; +} + +ASIOError IASIOThiscallResolver::getClockSources(ASIOClockSource *clocks, long *numSources) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 60, clocks, numSources ); + return result; +} + +ASIOError IASIOThiscallResolver::setClockSource(long reference) +{ + ASIOBool result; + CALL_THISCALL_1( result, that_, 64, reference ); + return result; +} + +ASIOError IASIOThiscallResolver::getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 68, sPos, tStamp ); + return result; +} + +ASIOError IASIOThiscallResolver::getChannelInfo(ASIOChannelInfo *info) +{ + ASIOBool result; + CALL_THISCALL_1( result, that_, 72, info ); + return result; +} + +ASIOError IASIOThiscallResolver::createBuffers(ASIOBufferInfo *bufferInfos, + long numChannels, long bufferSize, ASIOCallbacks *callbacks) +{ + ASIOBool result; + CALL_THISCALL_4( result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks ); + return result; +} + +ASIOError IASIOThiscallResolver::disposeBuffers() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 80 ); + return result; +} + +ASIOError IASIOThiscallResolver::controlPanel() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 84 ); + return result; +} + +ASIOError IASIOThiscallResolver::future(long selector,void *opt) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 88, selector, opt ); + return result; +} + +ASIOError IASIOThiscallResolver::outputReady() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 92 ); + return result; +} + + +// Implement our substitute ASIOInit() method +ASIOError IASIOThiscallResolver::ASIOInit(ASIODriverInfo *info) +{ + // To ensure that our instance's vptr is correctly constructed, even if + // ASIOInit is called prior to main(), we explicitly call its constructor + // (potentially over the top of an existing instance). Note that this is + // pretty ugly, and is only safe because IASIOThiscallResolver has no + // destructor and contains no objects with destructors. + new((void*)&instance) IASIOThiscallResolver( theAsioDriver ); + + // Interpose between ASIO client code and the real driver. + theAsioDriver = &instance; + + // Note that we never need to switch theAsioDriver back to point to the + // real driver because theAsioDriver is reset to zero in ASIOExit(). + + // Delegate to the real ASIOInit + return ::ASIOInit(info); +} + + +#endif /* !defined(_MSC_VER) */ + +#endif /* Win32 */ + diff --git a/portaudio-v19/pa_asio/iasiothiscallresolver.h b/portaudio-v19/pa_asio/iasiothiscallresolver.h new file mode 100644 index 000000000..2ecfed799 --- /dev/null +++ b/portaudio-v19/pa_asio/iasiothiscallresolver.h @@ -0,0 +1,197 @@ +// **************************************************************************** +// File: IASIOThiscallResolver.h +// Description: The IASIOThiscallResolver class implements the IASIO +// interface and acts as a proxy to the real IASIO interface by +// calling through its vptr table using the thiscall calling +// convention. To put it another way, we interpose +// IASIOThiscallResolver between ASIO SDK code and the driver. +// This is necessary because most non-Microsoft compilers don't +// implement the thiscall calling convention used by IASIO. +// +// iasiothiscallresolver.cpp contains the background of this +// problem plus a technical description of the vptr +// manipulations. +// +// In order to use this mechanism one simply has to add +// iasiothiscallresolver.cpp to the list of files to compile +// and #include +// +// Note that this #include must come after the other ASIO SDK +// #includes, for example: +// +// #include +// #include +// #include +// #include +// #include +// +// Actually the important thing is to #include +// after . We have +// incorporated a test to enforce this ordering. +// +// The code transparently takes care of the interposition by +// using macro substitution to intercept calls to ASIOInit() +// and ASIOExit(). We save the original ASIO global +// "theAsioDriver" in our "that" variable, and then set +// "theAsioDriver" to equal our IASIOThiscallResolver instance. +// +// Whilst this method of resolving the thiscall problem requires +// the addition of #include to client +// code it has the advantage that it does not break the terms +// of the ASIO licence by publishing it. We are NOT modifying +// any Steinberg code here, we are merely implementing the IASIO +// interface in the same way that we would need to do if we +// wished to provide an open source ASIO driver. +// +// For compilation with MinGW -lole32 needs to be added to the +// linker options. For BORLAND, linking with Import32.lib is +// sufficient. +// +// The dependencies are with: CoInitialize, CoUninitialize, +// CoCreateInstance, CLSIDFromString - used by asiolist.cpp +// and are required on Windows whether ThiscallResolver is used +// or not. +// +// Searching for the above strings in the root library path +// of your compiler should enable the correct libraries to be +// identified if they aren't immediately obvious. +// +// Note that the current implementation of IASIOThiscallResolver +// is not COM compliant - it does not correctly implement the +// IUnknown interface. Implementing it is not necessary because +// it is not called by parts of the ASIO SDK which call through +// theAsioDriver ptr. The IUnknown methods are implemented as +// assert(false) to ensure that the code fails if they are +// ever called. +// Restrictions: None. Public Domain & Open Source distribute freely +// You may use IASIOThiscallResolver commercially as well as +// privately. +// You the user assume the responsibility for the use of the +// files, binary or text, and there is no guarantee or warranty, +// expressed or implied, including but not limited to the +// implied warranties of merchantability and fitness for a +// particular purpose. You assume all responsibility and agree +// to hold no entity, copyright holder or distributors liable +// for any loss of data or inaccurate representations of data +// as a result of using IASIOThiscallResolver. +// Version: 1.4 Added separate macro CALL_THISCALL_1_DOUBLE from +// Andrew Baldwin, and volatile for whole gcc asm blocks, +// both for compatibility with newer gcc versions. Cleaned up +// Borland asm to use one less register. +// 1.3 Switched to including assert.h for better compatibility. +// Wrapped entire .h and .cpp contents with a check for +// _MSC_VER to provide better compatibility with MS compilers. +// Changed Singleton implementation to use static instance +// instead of freestore allocated instance. Removed ASIOExit +// macro as it is no longer needed. +// 1.2 Removed semicolons from ASIOInit and ASIOExit macros to +// allow them to be embedded in expressions (if statements). +// Cleaned up some comments. Removed combase.c dependency (it +// doesn't compile with BCB anyway) by stubbing IUnknown. +// 1.1 Incorporated comments from Ross Bencina including things +// such as changing name from ThiscallResolver to +// IASIOThiscallResolver, tidying up the constructor, fixing +// a bug in IASIOThiscallResolver::ASIOExit() and improving +// portability through the use of conditional compilation +// 1.0 Initial working version. +// Created: 6/09/2003 +// Authors: Fraser Adams +// Ross Bencina +// Rene G. Ceballos +// Martin Fay +// Antti Silvast +// Andrew Baldwin +// +// **************************************************************************** + + +#ifndef included_iasiothiscallresolver_h +#define included_iasiothiscallresolver_h + +// We only need IASIOThiscallResolver at all if we are on Win32. For other +// platforms we simply bypass the IASIOThiscallResolver definition to allow us +// to be safely #include'd whatever the platform to keep client code portable +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) + + +// If microsoft compiler we can call IASIO directly so IASIOThiscallResolver +// is not used. +#if !defined(_MSC_VER) + + +// The following is in order to ensure that this header is only included after +// the other ASIO headers (except for the case of iasiothiscallresolver.cpp). +// We need to do this because IASIOThiscallResolver works by eclipsing the +// original definition of ASIOInit() with a macro (see below). +#if !defined(iasiothiscallresolver_sourcefile) + #if !defined(__ASIO_H) + #error iasiothiscallresolver.h must be included AFTER asio.h + #endif +#endif + +#include +#include /* From ASIO SDK */ + + +class IASIOThiscallResolver : public IASIO { +private: + IASIO* that_; // Points to the real IASIO + + static IASIOThiscallResolver instance; // Singleton instance + + // Constructors - declared private so construction is limited to + // our Singleton instance + IASIOThiscallResolver(); + IASIOThiscallResolver(IASIO* that); +public: + + // Methods from the IUnknown interface. We don't fully implement IUnknown + // because the ASIO SDK never calls these methods through theAsioDriver ptr. + // These methods are implemented as assert(false). + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv); + virtual ULONG STDMETHODCALLTYPE AddRef(); + virtual ULONG STDMETHODCALLTYPE Release(); + + // Methods from the IASIO interface, implemented as forwarning calls to that. + virtual ASIOBool init(void *sysHandle); + virtual void getDriverName(char *name); + virtual long getDriverVersion(); + virtual void getErrorMessage(char *string); + virtual ASIOError start(); + virtual ASIOError stop(); + virtual ASIOError getChannels(long *numInputChannels, long *numOutputChannels); + virtual ASIOError getLatencies(long *inputLatency, long *outputLatency); + virtual ASIOError getBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity); + virtual ASIOError canSampleRate(ASIOSampleRate sampleRate); + virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate); + virtual ASIOError setSampleRate(ASIOSampleRate sampleRate); + virtual ASIOError getClockSources(ASIOClockSource *clocks, long *numSources); + virtual ASIOError setClockSource(long reference); + virtual ASIOError getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp); + virtual ASIOError getChannelInfo(ASIOChannelInfo *info); + virtual ASIOError createBuffers(ASIOBufferInfo *bufferInfos, long numChannels, long bufferSize, ASIOCallbacks *callbacks); + virtual ASIOError disposeBuffers(); + virtual ASIOError controlPanel(); + virtual ASIOError future(long selector,void *opt); + virtual ASIOError outputReady(); + + // Class method, see ASIOInit() macro below. + static ASIOError ASIOInit(ASIODriverInfo *info); // Delegates to ::ASIOInit +}; + + +// Replace calls to ASIOInit with our interposing version. +// This macro enables us to perform thiscall resolution simply by #including +// after the asio #includes (this file _must_ be +// included _after_ the asio #includes) + +#define ASIOInit(name) IASIOThiscallResolver::ASIOInit((name)) + + +#endif /* !defined(_MSC_VER) */ + +#endif /* Win32 */ + +#endif /* included_iasiothiscallresolver_h */ + + diff --git a/portaudio-v19/pa_asio/pa_asio.cpp b/portaudio-v19/pa_asio/pa_asio.cpp new file mode 100644 index 000000000..6593e7277 --- /dev/null +++ b/portaudio-v19/pa_asio/pa_asio.cpp @@ -0,0 +1,2958 @@ +/* + * $Id$ + * Portable Audio I/O Library for ASIO Drivers + * + * Author: Stephane Letz + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 2000-2002 Stephane Letz, Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/* Modification History + + 08-03-01 First version : Stephane Letz + 08-06-01 Tweaks for PC, use C++, buffer allocation, Float32 to Int32 conversion : Phil Burk + 08-20-01 More conversion, PA_StreamTime, Pa_GetHostError : Stephane Letz + 08-21-01 PaUInt8 bug correction, implementation of ASIOSTFloat32LSB and ASIOSTFloat32MSB native formats : Stephane Letz + 08-24-01 MAX_INT32_FP hack, another Uint8 fix : Stephane and Phil + 08-27-01 Implementation of hostBufferSize < userBufferSize case, better management of the ouput buffer when + the stream is stopped : Stephane Letz + 08-28-01 Check the stream pointer for null in bufferSwitchTimeInfo, correct bug in bufferSwitchTimeInfo when + the stream is stopped : Stephane Letz + 10-12-01 Correct the PaHost_CalcNumHostBuffers function: computes FramesPerHostBuffer to be the lowest that + respect requested FramesPerUserBuffer and userBuffersPerHostBuffer : Stephane Letz + 10-26-01 Management of hostBufferSize and userBufferSize of any size : Stephane Letz + 10-27-01 Improve calculus of hostBufferSize to be multiple or divisor of userBufferSize if possible : Stephane and Phil + 10-29-01 Change MAX_INT32_FP to (2147483520.0f) to prevent roundup to 0x80000000 : Phil Burk + 10-31-01 Clear the ouput buffer and user buffers in PaHost_StartOutput, correct bug in GetFirstMultiple : Stephane Letz + 11-06-01 Rename functions : Stephane Letz + 11-08-01 New Pa_ASIO_Adaptor_Init function to init Callback adpatation variables, cleanup of Pa_ASIO_Callback_Input: Stephane Letz + 11-29-01 Break apart device loading to debug random failure in Pa_ASIO_QueryDeviceInfo ; Phil Burk + 01-03-02 Desallocate all resources in PaHost_Term for cases where Pa_CloseStream is not called properly : Stephane Letz + 02-01-02 Cleanup, test of multiple-stream opening : Stephane Letz + 19-02-02 New Pa_ASIO_loadDriver that calls CoInitialize on each thread on Windows : Stephane Letz + 09-04-02 Correct error code management in PaHost_Term, removes various compiler warning : Stephane Letz + 12-04-02 Add Mac includes for and : Phil Burk + 13-04-02 Removes another compiler warning : Stephane Letz + 30-04-02 Pa_ASIO_QueryDeviceInfo bug correction, memory allocation checking, better error handling : D Viens, P Burk, S Letz + 12-06-02 Rehashed into new multi-api infrastructure, added support for all ASIO sample formats : Ross Bencina + 18-06-02 Added pa_asio.h, PaAsio_GetAvailableLatencyValues() : Ross B. + 21-06-02 Added SelectHostBufferSize() which selects host buffer size based on user latency parameters : Ross Bencina + ** NOTE maintanance history is now stored in CVS ** +*/ + +/** @file + + Note that specific support for paInputUnderflow, paOutputOverflow and + paNeverDropInput is not necessary or possible with this driver due to the + synchronous full duplex double-buffered architecture of ASIO. + + @todo check that CoInitialize()/CoUninitialize() are always correctly + paired, even in error cases. + + @todo implement host api specific extension to set i/o buffer sizes in frames + + @todo implement ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable + + @todo implement IsFormatSupported + + @todo work out how to implement stream stoppage from callback and + implement IsStreamActive properly. Stream stoppage could be implemented + using a high-priority thread blocked on an Event which is signalled + by the callback. Or, we could just call ASIO stop from the callback + and see what happens. + + @todo rigorously check asio return codes and convert to pa error codes + + @todo Different channels of a multichannel stream can have different sample + formats, but we assume that all are the same as the first channel for now. + Fixing this will require the block processor to maintain per-channel + conversion functions - could get nasty. + + @todo investigate whether the asio processNow flag needs to be honoured + + @todo handle asioMessages() callbacks in a useful way, or at least document + what cases we don't handle. + + @todo miscellaneous other FIXMEs + + @todo provide an asio-specific method for setting the systems specific + value (aka main window handle) - check that this matches the value + passed to PaAsio_ShowControlPanel, or remove it entirely from + PaAsio_ShowControlPanel. - this would allow PaAsio_ShowControlPanel + to be called for the currently open stream (at present all streams + must be closed). +*/ + + + +#include +#include +#include +//#include + +#include +#include + +#include "portaudio.h" +#include "pa_asio.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + +#include "asiosys.h" +#include "asio.h" +#include "asiodrivers.h" +#include "iasiothiscallresolver.h" + +/* +#if MAC +#include +#include +#include +#else +*/ +/* +#include +#include +#include +*/ +/* +#endif +*/ + +/* external references */ +extern AsioDrivers* asioDrivers ; +bool loadAsioDriver(char *name); + + +/* We are trying to be compatible with CARBON but this has not been thoroughly tested. */ +/* not tested at all since new code was introduced. */ +#define CARBON_COMPATIBLE (0) + + + + +/* prototypes for functions declared in this file */ + +extern "C" PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ); +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + +/* our ASIO callback functions */ + +static void bufferSwitch(long index, ASIOBool processNow); +static ASIOTime *bufferSwitchTimeInfo(ASIOTime *timeInfo, long index, ASIOBool processNow); +static void sampleRateChanged(ASIOSampleRate sRate); +static long asioMessages(long selector, long value, void* message, double* opt); + +static ASIOCallbacks asioCallbacks_ = + { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo }; + + +#define PA_ASIO_SET_LAST_HOST_ERROR( errorCode, errorText ) \ + PaUtil_SetLastHostErrorInfo( paASIO, errorCode, errorText ) + + +static void PaAsio_SetLastSystemError( DWORD errorCode ) +{ + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + errorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + PaUtil_SetLastHostErrorInfo( paASIO, errorCode, (const char*)lpMsgBuf ); + LocalFree( lpMsgBuf ); +} + +#define PA_ASIO_SET_LAST_SYSTEM_ERROR( errorCode ) \ + PaAsio_SetLastSystemError( errorCode ) + + +static const char* PaAsio_GetAsioErrorText( ASIOError asioError ) +{ + const char *result; + + switch( asioError ){ + case ASE_OK: + case ASE_SUCCESS: result = "Success"; break; + case ASE_NotPresent: result = "Hardware input or output is not present or available"; break; + case ASE_HWMalfunction: result = "Hardware is malfunctioning"; break; + case ASE_InvalidParameter: result = "Input parameter invalid"; break; + case ASE_InvalidMode: result = "Hardware is in a bad mode or used in a bad mode"; break; + case ASE_SPNotAdvancing: result = "Hardware is not running when sample position is inquired"; break; + case ASE_NoClock: result = "Sample clock or rate cannot be determined or is not present"; break; + case ASE_NoMemory: result = "Not enough memory for completing the request"; break; + default: result = "Unknown ASIO error"; break; + } + + return result; +} + + +#define PA_ASIO_SET_LAST_ASIO_ERROR( asioError ) \ + PaUtil_SetLastHostErrorInfo( paASIO, asioError, PaAsio_GetAsioErrorText( asioError ) ) + + + + +// Atomic increment and decrement operations +#if MAC + /* need to be implemented on Mac */ + inline long PaAsio_AtomicIncrement(volatile long* v) {return ++(*const_cast(v));} + inline long PaAsio_AtomicDecrement(volatile long* v) {return --(*const_cast(v));} +#elif WINDOWS + inline long PaAsio_AtomicIncrement(volatile long* v) {return InterlockedIncrement(const_cast(v));} + inline long PaAsio_AtomicDecrement(volatile long* v) {return InterlockedDecrement(const_cast(v));} +#endif + + + +typedef struct PaAsioDriverInfo +{ + ASIODriverInfo asioDriverInfo; + long inputChannelCount, outputChannelCount; + long bufferMinSize, bufferMaxSize, bufferPreferredSize, bufferGranularity; + bool postOutput; +} +PaAsioDriverInfo; + + +/* PaAsioHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + void *systemSpecific; + + /* the ASIO C API only allows one ASIO driver to be open at a time, + so we keep track of whether we have the driver open here, and + use this information to return errors from OpenStream if the + driver is already open. + + openAsioDeviceIndex will be PaNoDevice if there is no device open + and a valid pa_asio (not global) device index otherwise. + + openAsioDriverInfo is populated with the driver info for the + currently open device (if any) + */ + PaDeviceIndex openAsioDeviceIndex; + PaAsioDriverInfo openAsioDriverInfo; +} +PaAsioHostApiRepresentation; + + +/* + Retrieve driver names from ASIO, returned in a char** + allocated in . +*/ +static char **GetAsioDriverNames( PaUtilAllocationGroup *group, long driverCount ) +{ + char **result = 0; + int i; + + result =(char**)PaUtil_GroupAllocateMemory( + group, sizeof(char*) * driverCount ); + if( !result ) + goto error; + + result[0] = (char*)PaUtil_GroupAllocateMemory( + group, 32 * driverCount ); + if( !result[0] ) + goto error; + + for( i=0; igetDriverNames( result, driverCount ); + +error: + return result; +} + + +static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat(ASIOSampleType type) +{ + switch (type) { + case ASIOSTInt16MSB: + case ASIOSTInt16LSB: + return paInt16; + + case ASIOSTFloat32MSB: + case ASIOSTFloat32LSB: + case ASIOSTFloat64MSB: + case ASIOSTFloat64LSB: + return paFloat32; + + case ASIOSTInt32MSB: + case ASIOSTInt32LSB: + case ASIOSTInt32MSB16: + case ASIOSTInt32LSB16: + case ASIOSTInt32MSB18: + case ASIOSTInt32MSB20: + case ASIOSTInt32MSB24: + case ASIOSTInt32LSB18: + case ASIOSTInt32LSB20: + case ASIOSTInt32LSB24: + return paInt32; + + case ASIOSTInt24MSB: + case ASIOSTInt24LSB: + return paInt24; + + default: + return paCustomFormat; + } +} + +void AsioSampleTypeLOG(ASIOSampleType type) +{ + switch (type) { + case ASIOSTInt16MSB: PA_DEBUG(("ASIOSTInt16MSB\n")); break; + case ASIOSTInt16LSB: PA_DEBUG(("ASIOSTInt16LSB\n")); break; + case ASIOSTFloat32MSB:PA_DEBUG(("ASIOSTFloat32MSB\n"));break; + case ASIOSTFloat32LSB:PA_DEBUG(("ASIOSTFloat32LSB\n"));break; + case ASIOSTFloat64MSB:PA_DEBUG(("ASIOSTFloat64MSB\n"));break; + case ASIOSTFloat64LSB:PA_DEBUG(("ASIOSTFloat64LSB\n"));break; + case ASIOSTInt32MSB: PA_DEBUG(("ASIOSTInt32MSB\n")); break; + case ASIOSTInt32LSB: PA_DEBUG(("ASIOSTInt32LSB\n")); break; + case ASIOSTInt32MSB16:PA_DEBUG(("ASIOSTInt32MSB16\n"));break; + case ASIOSTInt32LSB16:PA_DEBUG(("ASIOSTInt32LSB16\n"));break; + case ASIOSTInt32MSB18:PA_DEBUG(("ASIOSTInt32MSB18\n"));break; + case ASIOSTInt32MSB20:PA_DEBUG(("ASIOSTInt32MSB20\n"));break; + case ASIOSTInt32MSB24:PA_DEBUG(("ASIOSTInt32MSB24\n"));break; + case ASIOSTInt32LSB18:PA_DEBUG(("ASIOSTInt32LSB18\n"));break; + case ASIOSTInt32LSB20:PA_DEBUG(("ASIOSTInt32LSB20\n"));break; + case ASIOSTInt32LSB24:PA_DEBUG(("ASIOSTInt32LSB24\n"));break; + case ASIOSTInt24MSB: PA_DEBUG(("ASIOSTInt24MSB\n")); break; + case ASIOSTInt24LSB: PA_DEBUG(("ASIOSTInt24LSB\n")); break; + default: PA_DEBUG(("Custom Format%d\n",type));break; + + } +} + +static int BytesPerAsioSample( ASIOSampleType sampleType ) +{ + switch (sampleType) { + case ASIOSTInt16MSB: + case ASIOSTInt16LSB: + return 2; + + case ASIOSTFloat64MSB: + case ASIOSTFloat64LSB: + return 8; + + case ASIOSTFloat32MSB: + case ASIOSTFloat32LSB: + case ASIOSTInt32MSB: + case ASIOSTInt32LSB: + case ASIOSTInt32MSB16: + case ASIOSTInt32LSB16: + case ASIOSTInt32MSB18: + case ASIOSTInt32MSB20: + case ASIOSTInt32MSB24: + case ASIOSTInt32LSB18: + case ASIOSTInt32LSB20: + case ASIOSTInt32LSB24: + return 4; + + case ASIOSTInt24MSB: + case ASIOSTInt24LSB: + return 3; + + default: + return 0; + } +} + + +static void Swap16( void *buffer, long shift, long count ) +{ + unsigned short *p = (unsigned short*)buffer; + unsigned short temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + temp = *p; + *p++ = (unsigned short)((temp<<8) | (temp>>8)); + } +} + +static void Swap24( void *buffer, long shift, long count ) +{ + unsigned char *p = (unsigned char*)buffer; + unsigned char temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + temp = *p; + *p = *(p+2); + *(p+2) = temp; + p += 3; + } +} + +#define PA_SWAP32_( x ) ((x>>24) | ((x>>8)&0xFF00) | ((x<<8)&0xFF0000) | (x<<24)); + +static void Swap32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + temp = *p; + *p++ = PA_SWAP32_( temp); + } +} + +static void SwapShiftLeft32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + + while( count-- ) + { + temp = *p; + temp = PA_SWAP32_( temp); + *p++ = temp << shift; + } +} + +static void ShiftRightSwap32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + + while( count-- ) + { + temp = *p >> shift; + *p++ = PA_SWAP32_( temp); + } +} + +static void ShiftLeft32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + + while( count-- ) + { + temp = *p; + *p++ = temp << shift; + } +} + +static void ShiftRight32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + + while( count-- ) + { + temp = *p; + *p++ = temp >> shift; + } +} + +#define PA_SWAP_( x, y ) temp=x; x = y; y = temp; + +static void Swap64ConvertFloat64ToFloat32( void *buffer, long shift, long count ) +{ + double *in = (double*)buffer; + float *out = (float*)buffer; + unsigned char *p; + unsigned char temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + p = (unsigned char*)in; + PA_SWAP_( p[0], p[7] ); + PA_SWAP_( p[1], p[6] ); + PA_SWAP_( p[2], p[5] ); + PA_SWAP_( p[3], p[4] ); + + *out++ = (float) (*in++); + } +} + +static void ConvertFloat64ToFloat32( void *buffer, long shift, long count ) +{ + double *in = (double*)buffer; + float *out = (float*)buffer; + (void) shift; /* unused parameter */ + + while( count-- ) + *out++ = (float) (*in++); +} + +static void ConvertFloat32ToFloat64Swap64( void *buffer, long shift, long count ) +{ + float *in = ((float*)buffer) + (count-1); + double *out = ((double*)buffer) + (count-1); + unsigned char *p; + unsigned char temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + *out = *in--; + + p = (unsigned char*)out; + PA_SWAP_( p[0], p[7] ); + PA_SWAP_( p[1], p[6] ); + PA_SWAP_( p[2], p[5] ); + PA_SWAP_( p[3], p[4] ); + + out--; + } +} + +static void ConvertFloat32ToFloat64( void *buffer, long shift, long count ) +{ + float *in = ((float*)buffer) + (count-1); + double *out = ((double*)buffer) + (count-1); + (void) shift; /* unused parameter */ + + while( count-- ) + *out-- = *in--; +} + +#ifdef MAC +#define PA_MSB_IS_NATIVE_ +#undef PA_LSB_IS_NATIVE_ +#endif + +#ifdef WINDOWS +#undef PA_MSB_IS_NATIVE_ +#define PA_LSB_IS_NATIVE_ +#endif + +typedef void PaAsioBufferConverter( void *, long, long ); + +static void SelectAsioToPaConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) +{ + *shift = 0; + *converter = 0; + + switch (type) { + case ASIOSTInt16MSB: + /* dest: paInt16, no conversion necessary, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; + #endif + break; + case ASIOSTInt16LSB: + /* dest: paInt16, no conversion necessary, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; + #endif + break; + case ASIOSTFloat32MSB: + /* dest: paFloat32, no conversion necessary, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTFloat32LSB: + /* dest: paFloat32, no conversion necessary, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTFloat64MSB: + /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; + #else + *converter = ConvertFloat64ToFloat32; + #endif + break; + case ASIOSTFloat64LSB: + /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; + #else + *converter = ConvertFloat64ToFloat32; + #endif + break; + case ASIOSTInt32MSB: + /* dest: paInt32, no conversion necessary, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTInt32LSB: + /* dest: paInt32, no conversion necessary, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTInt32MSB16: + /* dest: paInt32, 16 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 16; + break; + case ASIOSTInt32MSB18: + /* dest: paInt32, 14 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 14; + break; + case ASIOSTInt32MSB20: + /* dest: paInt32, 12 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 12; + break; + case ASIOSTInt32MSB24: + /* dest: paInt32, 8 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 8; + break; + case ASIOSTInt32LSB16: + /* dest: paInt32, 16 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 16; + break; + case ASIOSTInt32LSB18: + /* dest: paInt32, 14 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 14; + break; + case ASIOSTInt32LSB20: + /* dest: paInt32, 12 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 12; + break; + case ASIOSTInt32LSB24: + /* dest: paInt32, 8 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 8; + break; + case ASIOSTInt24MSB: + /* dest: paInt24, no conversion necessary, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; + #endif + break; + case ASIOSTInt24LSB: + /* dest: paInt24, no conversion necessary, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; + #endif + break; + } +} + + +static void SelectPaToAsioConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) +{ + *shift = 0; + *converter = 0; + + switch (type) { + case ASIOSTInt16MSB: + /* src: paInt16, no conversion necessary, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; + #endif + break; + case ASIOSTInt16LSB: + /* src: paInt16, no conversion necessary, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; + #endif + break; + case ASIOSTFloat32MSB: + /* src: paFloat32, no conversion necessary, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTFloat32LSB: + /* src: paFloat32, no conversion necessary, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTFloat64MSB: + /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; + #else + *converter = ConvertFloat32ToFloat64; + #endif + break; + case ASIOSTFloat64LSB: + /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; + #else + *converter = ConvertFloat32ToFloat64; + #endif + break; + case ASIOSTInt32MSB: + /* src: paInt32, no conversion necessary, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTInt32LSB: + /* src: paInt32, no conversion necessary, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTInt32MSB16: + /* src: paInt32, 16 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 16; + break; + case ASIOSTInt32MSB18: + /* src: paInt32, 14 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 14; + break; + case ASIOSTInt32MSB20: + /* src: paInt32, 12 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 12; + break; + case ASIOSTInt32MSB24: + /* src: paInt32, 8 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 8; + break; + case ASIOSTInt32LSB16: + /* src: paInt32, 16 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 16; + break; + case ASIOSTInt32LSB18: + /* src: paInt32, 14 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 14; + break; + case ASIOSTInt32LSB20: + /* src: paInt32, 12 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 12; + break; + case ASIOSTInt32LSB24: + /* src: paInt32, 8 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 8; + break; + case ASIOSTInt24MSB: + /* src: paInt24, no conversion necessary, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; + #endif + break; + case ASIOSTInt24LSB: + /* src: paInt24, no conversion necessary, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; + #endif + break; + } +} + + +typedef struct PaAsioDeviceInfo +{ + PaDeviceInfo commonDeviceInfo; + long minBufferSize; + long maxBufferSize; + long preferredBufferSize; + long bufferGranularity; + + ASIOChannelInfo *asioChannelInfos; +} +PaAsioDeviceInfo; + + +PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device, + long *minLatency, long *maxLatency, long *preferredLatency, long *granularity ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiDevice; + + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + + if( result == paNoError ) + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + + if( result == paNoError ) + { + PaAsioDeviceInfo *asioDeviceInfo = + (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + + *minLatency = asioDeviceInfo->minBufferSize; + *maxLatency = asioDeviceInfo->maxBufferSize; + *preferredLatency = asioDeviceInfo->preferredBufferSize; + *granularity = asioDeviceInfo->bufferGranularity; + } + } + + return result; +} + + + +/* + load the asio driver named by and return statistics about + the driver in info. If no error occurred, the driver will remain open + and must be closed by the called by calling ASIOExit() - if an error + is returned the driver will already be closed. +*/ +static PaError LoadAsioDriver( const char *driverName, + PaAsioDriverInfo *driverInfo, void *systemSpecific ) +{ + PaError result = paNoError; + ASIOError asioError; + int asioIsInitialized = 0; + + if( !loadAsioDriver( const_cast(driverName) ) ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_HOST_ERROR( 0, "Failed to load ASIO driver" ); + goto error; + } + + memset( &driverInfo->asioDriverInfo, 0, sizeof(ASIODriverInfo) ); + driverInfo->asioDriverInfo.asioVersion = 2; + driverInfo->asioDriverInfo.sysRef = systemSpecific; + if( (asioError = ASIOInit( &driverInfo->asioDriverInfo )) != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + else + { + asioIsInitialized = 1; + } + + if( (asioError = ASIOGetChannels(&driverInfo->inputChannelCount, + &driverInfo->outputChannelCount)) != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + + if( (asioError = ASIOGetBufferSize(&driverInfo->bufferMinSize, + &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize, + &driverInfo->bufferGranularity)) != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + + if( ASIOOutputReady() == ASE_OK ) + driverInfo->postOutput = true; + else + driverInfo->postOutput = false; + + return result; + +error: + if( asioIsInitialized ) + ASIOExit(); + + return result; +} + + +#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ 13 /* must be the same number of elements as in the array below */ +static ASIOSampleRate defaultSampleRateSearchOrder_[] + = {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, + 192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 }; + + +PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i, driverCount; + PaAsioHostApiRepresentation *asioHostApi; + PaAsioDeviceInfo *deviceInfoArray; + char **names; + PaAsioDriverInfo paAsioDriverInfo; + + asioHostApi = (PaAsioHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaAsioHostApiRepresentation) ); + if( !asioHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + asioHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !asioHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + asioHostApi->systemSpecific = 0; + asioHostApi->openAsioDeviceIndex = paNoDevice; + + *hostApi = &asioHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + + (*hostApi)->info.type = paASIO; + (*hostApi)->info.name = "ASIO"; + (*hostApi)->info.deviceCount = 0; + + #ifdef WINDOWS + /* use desktop window as system specific ptr */ + asioHostApi->systemSpecific = GetDesktopWindow(); + CoInitialize(NULL); + #endif + + /* MUST BE CHECKED : to force fragments loading on Mac */ + loadAsioDriver( "dummy" ); + + /* driverCount is the number of installed drivers - not necessarily + the number of installed physical devices. */ + #if MAC + driverCount = asioDrivers->getNumFragments(); + #elif WINDOWS + driverCount = asioDrivers->asioGetNumDev(); + #endif + + if( driverCount > 0 ) + { + names = GetAsioDriverNames( asioHostApi->allocations, driverCount ); + if( !names ) + { + result = paInsufficientMemory; + goto error; + } + + + /* allocate enough space for all drivers, even if some aren't installed */ + + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, sizeof(PaDeviceInfo*) * driverCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaAsioDeviceInfo*)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, sizeof(PaAsioDeviceInfo) * driverCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < driverCount; ++i ) + { + + PA_DEBUG(("ASIO names[%d]:%s\n",i,names[i])); + + // Since portaudio opens ALL ASIO drivers, and no one else does that, + // we face fact that some drivers were not meant for it, drivers which act + // like shells on top of REAL drivers, for instance. + // so we get duplicate handles, locks and other problems. + // so lets NOT try to load any such wrappers. + // The ones i [davidv] know of so far are: + + if ( strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0 + || strcmp (names[i],"ASIO Multimedia Driver") == 0 + || strncmp(names[i],"Premiere",8) == 0 //"Premiere Elements Windows Sound 1.0" + || strncmp(names[i],"Adobe",5) == 0 ) //"Adobe Default Windows Sound 1.5" + { + PA_DEBUG(("BLACKLISTED!!!\n")); + continue; + } + + + /* Attempt to load the asio driver... */ + if( LoadAsioDriver( names[i], &paAsioDriverInfo, asioHostApi->systemSpecific ) == paNoError ) + { + PaAsioDeviceInfo *asioDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ]; + PaDeviceInfo *deviceInfo = &asioDeviceInfo->commonDeviceInfo; + + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + deviceInfo->name = names[i]; + PA_DEBUG(("PaAsio_Initialize: drv:%d name = %s\n", i,deviceInfo->name)); + PA_DEBUG(("PaAsio_Initialize: drv:%d inputChannels = %d\n", i, paAsioDriverInfo.inputChannelCount)); + PA_DEBUG(("PaAsio_Initialize: drv:%d outputChannels = %d\n", i, paAsioDriverInfo.outputChannelCount)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMinSize = %d\n", i, paAsioDriverInfo.bufferMinSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMaxSize = %d\n", i, paAsioDriverInfo.bufferMaxSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferGranularity = %d\n", i, paAsioDriverInfo.bufferGranularity)); + + deviceInfo->maxInputChannels = paAsioDriverInfo.inputChannelCount; + deviceInfo->maxOutputChannels = paAsioDriverInfo.outputChannelCount; + + deviceInfo->defaultSampleRate = 0.; + bool foundDefaultSampleRate = false; + for( int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j ) + { + ASIOError asioError = ASIOCanSampleRate( defaultSampleRateSearchOrder_[j] ); + if( asioError != ASE_NoClock && asioError != ASE_NotPresent ) + { + deviceInfo->defaultSampleRate = defaultSampleRateSearchOrder_[j]; + foundDefaultSampleRate = true; + break; + } + } + + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate)); + + if( foundDefaultSampleRate ){ + + /* calculate default latency values from bufferPreferredSize + for default low latency, and bufferPreferredSize * 3 + for default high latency. + use the default sample rate to convert from samples to + seconds. Without knowing what sample rate the user will + use this is the best we can do. + */ + + double defaultLowLatency = + paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate; + + deviceInfo->defaultLowInputLatency = defaultLowLatency; + deviceInfo->defaultLowOutputLatency = defaultLowLatency; + + long defaultHighLatencyBufferSize = + paAsioDriverInfo.bufferPreferredSize * 3; + + if( defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize ) + defaultHighLatencyBufferSize = paAsioDriverInfo.bufferMaxSize; + + double defaultHighLatency = + defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate; + + if( defaultHighLatency < defaultLowLatency ) + defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ + + deviceInfo->defaultHighInputLatency = defaultHighLatency; + deviceInfo->defaultHighOutputLatency = defaultHighLatency; + + }else{ + + deviceInfo->defaultLowInputLatency = 0.; + deviceInfo->defaultLowOutputLatency = 0.; + deviceInfo->defaultHighInputLatency = 0.; + deviceInfo->defaultHighOutputLatency = 0.; + } + + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency)); + + asioDeviceInfo->minBufferSize = paAsioDriverInfo.bufferMinSize; + asioDeviceInfo->maxBufferSize = paAsioDriverInfo.bufferMaxSize; + asioDeviceInfo->preferredBufferSize = paAsioDriverInfo.bufferPreferredSize; + asioDeviceInfo->bufferGranularity = paAsioDriverInfo.bufferGranularity; + + + asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, + sizeof(ASIOChannelInfo) * (deviceInfo->maxInputChannels + + deviceInfo->maxOutputChannels) ); + if( !asioDeviceInfo->asioChannelInfos ) + { + result = paInsufficientMemory; + goto error; + } + + int a; + + for( a=0; a < deviceInfo->maxInputChannels; ++a ){ + asioDeviceInfo->asioChannelInfos[a].channel = a; + asioDeviceInfo->asioChannelInfos[a].isInput = ASIOTrue; + ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[a] ); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + } + + for( a=0; a < deviceInfo->maxOutputChannels; ++a ){ + int b = deviceInfo->maxInputChannels + a; + asioDeviceInfo->asioChannelInfos[b].channel = a; + asioDeviceInfo->asioChannelInfos[b].isInput = ASIOFalse; + ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[b] ); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + } + + + /* unload the driver */ + ASIOExit(); + + (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo; + ++(*hostApi)->info.deviceCount; + } + } + } + + if( (*hostApi)->info.deviceCount > 0 ) + { + (*hostApi)->info.defaultInputDevice = 0; + (*hostApi)->info.defaultOutputDevice = 0; + } + else + { + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + } + + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &asioHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &asioHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( asioHostApi ) + { + if( asioHostApi->allocations ) + { + PaUtil_FreeAllAllocations( asioHostApi->allocations ); + PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); + } + + PaUtil_FreeMemory( asioHostApi ); + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + + /* + IMPLEMENT ME: + - clean up any resources not handled by the allocation group + */ + + if( asioHostApi->allocations ) + { + PaUtil_FreeAllAllocations( asioHostApi->allocations ); + PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); + } + + PaUtil_FreeMemory( asioHostApi ); +} + + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaError result = paNoError; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + PaAsioDriverInfo *driverInfo = &asioHostApi->openAsioDriverInfo; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaDeviceIndex asioDeviceIndex; + ASIOError asioError; + + if( inputParameters && outputParameters ) + { + /* full duplex ASIO stream must use the same device for input and output */ + + if( inputParameters->device != outputParameters->device ) + return paBadIODeviceCombination; + } + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + asioDeviceIndex = inputParameters->device; + + /* validate inputStreamInfo */ + /** @todo do more validation here */ + // if( inputParameters->hostApiSpecificStreamInfo ) + // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + asioDeviceIndex = outputParameters->device; + + /* validate outputStreamInfo */ + /** @todo do more validation here */ + // if( outputParameters->hostApiSpecificStreamInfo ) + // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + + + /* if an ASIO device is open we can only get format information for the currently open device */ + + if( asioHostApi->openAsioDeviceIndex != paNoDevice + && asioHostApi->openAsioDeviceIndex != asioDeviceIndex ) + { + return paDeviceUnavailable; + } + + + /* NOTE: we load the driver and use its current settings + rather than the ones in our device info structure which may be stale */ + + /* open the device if it's not already open */ + if( asioHostApi->openAsioDeviceIndex == paNoDevice ) + { + result = LoadAsioDriver( asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific ); + if( result != paNoError ) + return result; + } + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > 0 ) + { + if( inputChannelCount > driverInfo->inputChannelCount ) + { + result = paInvalidChannelCount; + goto done; + } + } + + /* check that output device can support outputChannelCount */ + if( outputChannelCount ) + { + if( outputChannelCount > driverInfo->outputChannelCount ) + { + result = paInvalidChannelCount; + goto done; + } + } + + /* query for sample rate support */ + asioError = ASIOCanSampleRate( sampleRate ); + if( asioError == ASE_NoClock || asioError == ASE_NotPresent ) + { + result = paInvalidSampleRate; + goto done; + } + +done: + /* close the device if it wasn't already open */ + if( asioHostApi->openAsioDeviceIndex == paNoDevice ) + { + ASIOExit(); /* not sure if we should check for errors here */ + } + + if( result == paNoError ) + return paFormatIsSupported; + else + return result; +} + + + +/* PaAsioStream - a stream data structure specifically for this implementation */ + +typedef struct PaAsioStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + PaAsioHostApiRepresentation *asioHostApi; + unsigned long framesPerHostCallback; + + /* ASIO driver info - these may not be needed for the life of the stream, + but store them here until we work out how format conversion is going + to work. */ + + ASIOBufferInfo *asioBufferInfos; + ASIOChannelInfo *asioChannelInfos; + long inputLatency, outputLatency; // actual latencies returned by asio + + long inputChannelCount, outputChannelCount; + bool postOutput; + + void **bufferPtrs; /* this is carved up for inputBufferPtrs and outputBufferPtrs */ + void **inputBufferPtrs[2]; + void **outputBufferPtrs[2]; + + PaAsioBufferConverter *inputBufferConverter; + long inputShift; + PaAsioBufferConverter *outputBufferConverter; + long outputShift; + + volatile bool stopProcessing; + int stopPlayoutCount; + HANDLE completedBuffersPlayedEvent; + + bool streamFinishedCallbackCalled; + volatile int isActive; + volatile bool zeroOutput; /* all future calls to the callback will output silence */ + + volatile long reenterCount; + volatile long reenterError; + + PaStreamCallbackFlags callbackFlags; +} +PaAsioStream; + +static PaAsioStream *theAsioStream = 0; /* due to ASIO sdk limitations there can be only one stream */ + + +static void ZeroOutputBuffers( PaAsioStream *stream, long index ) +{ + int i; + + for( i=0; i < stream->outputChannelCount; ++i ) + { + void *buffer = stream->asioBufferInfos[ i + stream->inputChannelCount ].buffers[index]; + + int bytesPerSample = BytesPerAsioSample( stream->asioChannelInfos[ i + stream->inputChannelCount ].type ); + + memset( buffer, 0, stream->framesPerHostCallback * bytesPerSample ); + } +} + + +static unsigned long SelectHostBufferSize( unsigned long suggestedLatencyFrames, + PaAsioDriverInfo *driverInfo ) +{ + unsigned long result; + + if( suggestedLatencyFrames == 0 ) + { + result = driverInfo->bufferPreferredSize; + } + else{ + if( suggestedLatencyFrames <= (unsigned long)driverInfo->bufferMinSize ) + { + result = driverInfo->bufferMinSize; + } + else if( suggestedLatencyFrames >= (unsigned long)driverInfo->bufferMaxSize ) + { + result = driverInfo->bufferMaxSize; + } + else + { + if( driverInfo->bufferGranularity == -1 ) + { + /* power-of-two */ + result = 2; + + while( result < suggestedLatencyFrames ) + result *= 2; + + if( result < (unsigned long)driverInfo->bufferMinSize ) + result = driverInfo->bufferMinSize; + + if( result > (unsigned long)driverInfo->bufferMaxSize ) + result = driverInfo->bufferMaxSize; + } + else if( driverInfo->bufferGranularity == 0 ) + { + /* the documentation states that bufferGranularity should be + zero when bufferMinSize, bufferMaxSize and + bufferPreferredSize are the same. We assume that is the case. + */ + + result = driverInfo->bufferPreferredSize; + } + else + { + /* modulo granularity */ + + unsigned long remainder = + suggestedLatencyFrames % driverInfo->bufferGranularity; + + if( remainder == 0 ) + { + result = suggestedLatencyFrames; + } + else + { + result = suggestedLatencyFrames + + (driverInfo->bufferGranularity - remainder); + + if( result > (unsigned long)driverInfo->bufferMaxSize ) + result = driverInfo->bufferMaxSize; + } + } + } + } + + return result; +} + + +/* returns channelSelectors if present */ + +static PaError ValidateAsioSpecificStreamInfo( + const PaStreamParameters *streamParameters, + const PaAsioStreamInfo *streamInfo, + int deviceChannelCount, + int **channelSelectors ) +{ + if( streamInfo ) + { + if( streamInfo->size != sizeof( PaAsioStreamInfo ) + || streamInfo->version != 1 ) + { + return paIncompatibleHostApiSpecificStreamInfo; + } + + if( streamInfo->flags & paAsioUseChannelSelectors ) + *channelSelectors = streamInfo->channelSelectors; + + if( !(*channelSelectors) ) + return paIncompatibleHostApiSpecificStreamInfo; + + for( int i=0; i < streamParameters->channelCount; ++i ){ + if( (*channelSelectors)[i] < 0 + || (*channelSelectors)[i] >= deviceChannelCount ){ + return paInvalidChannelCount; + } + } + } + + return paNoError; +} + + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + PaAsioStream *stream = 0; + PaAsioStreamInfo *inputStreamInfo, *outputStreamInfo; + unsigned long framesPerHostBuffer; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + unsigned long suggestedInputLatencyFrames; + unsigned long suggestedOutputLatencyFrames; + PaDeviceIndex asioDeviceIndex; + ASIOError asioError; + int asioIsInitialized = 0; + int asioBuffersCreated = 0; + int completedBuffersPlayedEventInited = 0; + int i; + PaAsioDriverInfo *driverInfo; + int *inputChannelSelectors = 0; + int *outputChannelSelectors = 0; + + /* unless we move to using lower level ASIO calls, we can only have + one device open at a time */ + if( asioHostApi->openAsioDeviceIndex != paNoDevice ){ + PA_DEBUG(("OpenStream paDeviceUnavailable\n")); + return paDeviceUnavailable; + } + + if( inputParameters && outputParameters ) + { + /* full duplex ASIO stream must use the same device for input and output */ + + if( inputParameters->device != outputParameters->device ){ + PA_DEBUG(("OpenStream paBadIODeviceCombination\n")); + return paBadIODeviceCombination; + } + } + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + suggestedInputLatencyFrames = (unsigned long)((inputParameters->suggestedLatency * sampleRate)+0.5f); + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + asioDeviceIndex = inputParameters->device; + + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; + + /* validate hostApiSpecificStreamInfo */ + inputStreamInfo = (PaAsioStreamInfo*)inputParameters->hostApiSpecificStreamInfo; + result = ValidateAsioSpecificStreamInfo( inputParameters, inputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxInputChannels, + &inputChannelSelectors + ); + if( result != paNoError ) return result; + } + else + { + inputChannelCount = 0; + inputSampleFormat = 0; + suggestedInputLatencyFrames = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + suggestedOutputLatencyFrames = (unsigned long)((outputParameters->suggestedLatency * sampleRate)+0.5f); + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + asioDeviceIndex = outputParameters->device; + + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; + + /* validate hostApiSpecificStreamInfo */ + outputStreamInfo = (PaAsioStreamInfo*)outputParameters->hostApiSpecificStreamInfo; + result = ValidateAsioSpecificStreamInfo( outputParameters, outputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxOutputChannels, + &outputChannelSelectors + ); + if( result != paNoError ) return result; + } + else + { + outputChannelCount = 0; + outputSampleFormat = 0; + suggestedOutputLatencyFrames = 0; + } + + driverInfo = &asioHostApi->openAsioDriverInfo; + + /* NOTE: we load the driver and use its current settings + rather than the ones in our device info structure which may be stale */ + + result = LoadAsioDriver( asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific ); + if( result == paNoError ) + asioIsInitialized = 1; + else{ + PA_DEBUG(("OpenStream ERROR1\n")); + goto error; + } + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > 0 ) + { + if( inputChannelCount > driverInfo->inputChannelCount ) + { + result = paInvalidChannelCount; + PA_DEBUG(("OpenStream ERROR2\n")); + goto error; + } + } + + /* check that output device can support outputChannelCount */ + if( outputChannelCount ) + { + if( outputChannelCount > driverInfo->outputChannelCount ) + { + result = paInvalidChannelCount; + PA_DEBUG(("OpenStream ERROR3\n")); + goto error; + } + } + + + // check that the device supports the requested sample rate + + asioError = ASIOCanSampleRate( sampleRate ); + PA_DEBUG(("ASIOCanSampleRate(%f):%d\n",sampleRate, asioError )); + + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + + + // retrieve the current sample rate, we only change to the requested + // sample rate if the device is not already in that rate. + + ASIOSampleRate oldRate; + asioError = ASIOGetSampleRate(&oldRate); + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + PA_DEBUG(("ASIOGetSampleRate:%f\n",oldRate)); + + if (oldRate != sampleRate){ + + PA_DEBUG(("before ASIOSetSampleRate(%f)\n",sampleRate)); + asioError = ASIOSetSampleRate( sampleRate ); + /* Set sample rate */ + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + PA_DEBUG(("after ASIOSetSampleRate(%f)\n",sampleRate)); + } + else + { + PA_DEBUG(("No Need to change SR\n")); + } + + + /* + IMPLEMENT ME: + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + */ + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ){ + PA_DEBUG(("OpenStream invalid flags!!\n")); + return paInvalidFlag; /* unexpected platform specific flag */ + } + + + stream = (PaAsioStream*)PaUtil_AllocateMemory( sizeof(PaAsioStream) ); + if( !stream ) + { + result = paInsufficientMemory; + PA_DEBUG(("OpenStream ERROR5\n")); + goto error; + } + + stream->completedBuffersPlayedEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + if( stream->completedBuffersPlayedEvent == NULL ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_DEBUG(("OpenStream ERROR6\n")); + goto error; + } + completedBuffersPlayedEventInited = 1; + + + stream->asioBufferInfos = 0; /* for deallocation in error */ + stream->asioChannelInfos = 0; /* for deallocation in error */ + stream->bufferPtrs = 0; /* for deallocation in error */ + + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &asioHostApi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &asioHostApi->blockingStreamInterface, streamCallback, userData ); + } + + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + stream->asioBufferInfos = (ASIOBufferInfo*)PaUtil_AllocateMemory( + sizeof(ASIOBufferInfo) * (inputChannelCount + outputChannelCount) ); + if( !stream->asioBufferInfos ) + { + result = paInsufficientMemory; + PA_DEBUG(("OpenStream ERROR7\n")); + goto error; + } + + + for( i=0; i < inputChannelCount; ++i ) + { + ASIOBufferInfo *info = &stream->asioBufferInfos[i]; + + info->isInput = ASIOTrue; + + if( inputChannelSelectors ){ + // inputChannelSelectors values have already been validated in + // ValidateAsioSpecificStreamInfo() above + info->channelNum = inputChannelSelectors[i]; + }else{ + info->channelNum = i; + } + + info->buffers[0] = info->buffers[1] = 0; + } + + for( i=0; i < outputChannelCount; ++i ){ + ASIOBufferInfo *info = &stream->asioBufferInfos[inputChannelCount+i]; + + info->isInput = ASIOFalse; + + if( outputChannelSelectors ){ + // outputChannelSelectors values have already been validated in + // ValidateAsioSpecificStreamInfo() above + info->channelNum = outputChannelSelectors[i]; + }else{ + info->channelNum = i; + } + + info->buffers[0] = info->buffers[1] = 0; + } + + + framesPerHostBuffer = SelectHostBufferSize( + (( suggestedInputLatencyFrames > suggestedOutputLatencyFrames ) + ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames), + driverInfo ); + + + PA_DEBUG(("PaAsioOpenStream: framesPerHostBuffer :%d\n", framesPerHostBuffer)); + + asioError = ASIOCreateBuffers( stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_ ); + + if( asioError != ASE_OK + && framesPerHostBuffer != (unsigned long)driverInfo->bufferPreferredSize ) + { + PA_DEBUG(("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText(asioError) )); + /* + Some buggy drivers (like the Hoontech DSP24) give incorrect + [min, preferred, max] values They should work with the preferred size + value, thus if Pa_ASIO_CreateBuffers fails with the hostBufferSize + computed in SelectHostBufferSize, we try again with the preferred size. + */ + + framesPerHostBuffer = driverInfo->bufferPreferredSize; + + PA_DEBUG(("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n", framesPerHostBuffer)); + + ASIOError asioError2 = ASIOCreateBuffers( stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_ ); + if( asioError2 == ASE_OK ) + asioError = ASE_OK; + } + + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_DEBUG(("OpenStream ERROR9\n")); + goto error; + } + + asioBuffersCreated = 1; + + stream->asioChannelInfos = (ASIOChannelInfo*)PaUtil_AllocateMemory( + sizeof(ASIOChannelInfo) * (inputChannelCount + outputChannelCount) ); + if( !stream->asioChannelInfos ) + { + result = paInsufficientMemory; + PA_DEBUG(("OpenStream ERROR10\n")); + goto error; + } + + for( i=0; i < inputChannelCount + outputChannelCount; ++i ) + { + stream->asioChannelInfos[i].channel = stream->asioBufferInfos[i].channelNum; + stream->asioChannelInfos[i].isInput = stream->asioBufferInfos[i].isInput; + asioError = ASIOGetChannelInfo( &stream->asioChannelInfos[i] ); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_DEBUG(("OpenStream ERROR11\n")); + goto error; + } + } + + stream->bufferPtrs = (void**)PaUtil_AllocateMemory( + 2 * sizeof(void*) * (inputChannelCount + outputChannelCount) ); + if( !stream->bufferPtrs ) + { + result = paInsufficientMemory; + PA_DEBUG(("OpenStream ERROR12\n")); + goto error; + } + + if( inputChannelCount > 0 ) + { + stream->inputBufferPtrs[0] = stream-> bufferPtrs; + stream->inputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount]; + + for( i=0; iinputBufferPtrs[0][i] = stream->asioBufferInfos[i].buffers[0]; + stream->inputBufferPtrs[1][i] = stream->asioBufferInfos[i].buffers[1]; + } + } + else + { + stream->inputBufferPtrs[0] = 0; + stream->inputBufferPtrs[1] = 0; + } + + if( outputChannelCount > 0 ) + { + stream->outputBufferPtrs[0] = &stream->bufferPtrs[inputChannelCount*2]; + stream->outputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount*2 + outputChannelCount]; + + for( i=0; ioutputBufferPtrs[0][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[0]; + stream->outputBufferPtrs[1][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[1]; + } + } + else + { + stream->outputBufferPtrs[0] = 0; + stream->outputBufferPtrs[1] = 0; + } + + if( inputChannelCount > 0 ) + { + /* FIXME: assume all channels use the same type for now */ + ASIOSampleType inputType = stream->asioChannelInfos[0].type; + + PA_DEBUG(("ASIO Input type:%d",inputType)); + AsioSampleTypeLOG(inputType); + hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( inputType ); + + SelectAsioToPaConverter( inputType, &stream->inputBufferConverter, &stream->inputShift ); + } + else + { + hostInputSampleFormat = 0; + stream->inputBufferConverter = 0; + } + + if( outputChannelCount > 0 ) + { + /* FIXME: assume all channels use the same type for now */ + ASIOSampleType outputType = stream->asioChannelInfos[inputChannelCount].type; + + PA_DEBUG(("ASIO Output type:%d",outputType)); + AsioSampleTypeLOG(outputType); + hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( outputType ); + + SelectPaToAsioConverter( outputType, &stream->outputBufferConverter, &stream->outputShift ); + } + else + { + hostOutputSampleFormat = 0; + stream->outputBufferConverter = 0; + } + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerHostBuffer, paUtilFixedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ){ + PA_DEBUG(("OpenStream ERROR13\n")); + goto error; + } + + + ASIOGetLatencies( &stream->inputLatency, &stream->outputLatency ); + + stream->streamRepresentation.streamInfo.inputLatency = + (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) + + stream->inputLatency) / sampleRate; // seconds + stream->streamRepresentation.streamInfo.outputLatency = + (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) + + stream->outputLatency) / sampleRate; // seconds + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + // the code below prints the ASIO latency which doesn't include the + // buffer processor latency. it reports the added latency separately + PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->inputLatency, + (long)((stream->inputLatency*1000)/ sampleRate), + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor), + (long)((PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)*1000)/ sampleRate) + )); + + PA_DEBUG(("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->outputLatency, + (long)((stream->outputLatency*1000)/ sampleRate), + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor), + (long)((PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)*1000)/ sampleRate) + )); + + stream->asioHostApi = asioHostApi; + stream->framesPerHostCallback = framesPerHostBuffer; + + stream->inputChannelCount = inputChannelCount; + stream->outputChannelCount = outputChannelCount; + stream->postOutput = driverInfo->postOutput; + stream->isActive = 0; + + asioHostApi->openAsioDeviceIndex = asioDeviceIndex; + + *s = (PaStream*)stream; + + return result; + +error: + PA_DEBUG(("goto errored\n")); + if( stream ) + { + if( completedBuffersPlayedEventInited ) + CloseHandle( stream->completedBuffersPlayedEvent ); + + if( stream->asioBufferInfos ) + PaUtil_FreeMemory( stream->asioBufferInfos ); + + if( stream->asioChannelInfos ) + PaUtil_FreeMemory( stream->asioChannelInfos ); + + if( stream->bufferPtrs ) + PaUtil_FreeMemory( stream->bufferPtrs ); + + PaUtil_FreeMemory( stream ); + } + + if( asioBuffersCreated ) + ASIODisposeBuffers(); + + if( asioIsInitialized ) + ASIOExit(); + + return result; +} + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaAsioStream *stream = (PaAsioStream*)s; + + /* + IMPLEMENT ME: + - additional stream closing + cleanup + */ + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + + stream->asioHostApi->openAsioDeviceIndex = paNoDevice; + + CloseHandle( stream->completedBuffersPlayedEvent ); + + PaUtil_FreeMemory( stream->asioBufferInfos ); + PaUtil_FreeMemory( stream->asioChannelInfos ); + PaUtil_FreeMemory( stream->bufferPtrs ); + PaUtil_FreeMemory( stream ); + + ASIODisposeBuffers(); + ASIOExit(); + + return result; +} + + +static void bufferSwitch(long index, ASIOBool directProcess) +{ +//TAKEN FROM THE ASIO SDK + + // the actual processing callback. + // Beware that this is normally in a seperate thread, hence be sure that + // you take care about thread synchronization. This is omitted here for + // simplicity. + + // as this is a "back door" into the bufferSwitchTimeInfo a timeInfo needs + // to be created though it will only set the timeInfo.samplePosition and + // timeInfo.systemTime fields and the according flags + + ASIOTime timeInfo; + memset( &timeInfo, 0, sizeof (timeInfo) ); + + // get the time stamp of the buffer, not necessary if no + // synchronization to other media is required + if( ASIOGetSamplePosition(&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK) + timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; + + // Call the real callback + bufferSwitchTimeInfo( &timeInfo, index, directProcess ); +} + + +// conversion from 64 bit ASIOSample/ASIOTimeStamp to double float +#if NATIVE_INT64 + #define ASIO64toDouble(a) (a) +#else + const double twoRaisedTo32 = 4294967296.; + #define ASIO64toDouble(a) ((a).lo + (a).hi * twoRaisedTo32) +#endif + +static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool directProcess ) +{ + // the actual processing callback. + // Beware that this is normally in a seperate thread, hence be sure that + // you take care about thread synchronization. + + + /* The SDK says the following about the directProcess flag: + suggests to the host whether it should immediately start processing + (directProcess == ASIOTrue), or whether its process should be deferred + because the call comes from a very low level (for instance, a high level + priority interrupt), and direct processing would cause timing instabilities for + the rest of the system. If in doubt, directProcess should be set to ASIOFalse. + + We just ignore directProcess. This could cause incompatibilities with + drivers which really don't want the audio processing to occur in this + callback, but none have been identified yet. + */ + + (void) directProcess; /* suppress unused parameter warning */ + +#if 0 + // store the timeInfo for later use + asioDriverInfo.tInfo = *timeInfo; + + // get the time stamp of the buffer, not necessary if no + // synchronization to other media is required + + if (timeInfo->timeInfo.flags & kSystemTimeValid) + asioDriverInfo.nanoSeconds = ASIO64toDouble(timeInfo->timeInfo.systemTime); + else + asioDriverInfo.nanoSeconds = 0; + + if (timeInfo->timeInfo.flags & kSamplePositionValid) + asioDriverInfo.samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); + else + asioDriverInfo.samples = 0; + + if (timeInfo->timeCode.flags & kTcValid) + asioDriverInfo.tcSamples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); + else + asioDriverInfo.tcSamples = 0; + + // get the system reference time + asioDriverInfo.sysRefTime = get_sys_reference_time(); +#endif + +#if 0 + // a few debug messages for the Windows device driver developer + // tells you the time when driver got its interrupt and the delay until the app receives + // the event notification. + static double last_samples = 0; + char tmp[128]; + sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples \n", asioDriverInfo.sysRefTime - (long)(asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long)(asioDriverInfo.nanoSeconds / 1000000.0), (long)(asioDriverInfo.samples - last_samples)); + OutputDebugString (tmp); + last_samples = asioDriverInfo.samples; +#endif + + + if( !theAsioStream ) + return 0L; + + // Keep sample position + // FIXME: asioDriverInfo.pahsc_NumFramesDone = timeInfo->timeInfo.samplePosition.lo; + + + // protect against reentrancy + if( PaAsio_AtomicIncrement(&theAsioStream->reenterCount) ) + { + theAsioStream->reenterError++; + //DBUG(("bufferSwitchTimeInfo : reentrancy detection = %d\n", asioDriverInfo.reenterError)); + return 0L; + } + + int buffersDone = 0; + + do + { + if( buffersDone > 0 ) + { + // this is a reentered buffer, we missed processing it on time + // set the input overflow and output underflow flags as appropriate + + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; + } + else + { + if( theAsioStream->zeroOutput ) + { + ZeroOutputBuffers( theAsioStream, index ); + + // Finally if the driver supports the ASIOOutputReady() optimization, + // do it here, all data are in place + if( theAsioStream->postOutput ) + ASIOOutputReady(); + + if( theAsioStream->stopProcessing ) + { + if( theAsioStream->stopPlayoutCount < 2 ) + { + ++theAsioStream->stopPlayoutCount; + if( theAsioStream->stopPlayoutCount == 2 ) + { + theAsioStream->isActive = 0; + if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) + theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); + theAsioStream->streamFinishedCallbackCalled = true; + SetEvent( theAsioStream->completedBuffersPlayedEvent ); + } + } + } + } + else + { + +#if 0 +// test code to try to detect slip conditions... these may work on some systems +// but neither of them work on the RME Digi96 + +// check that sample delta matches buffer size (otherwise we must have skipped +// a buffer. +static double last_samples = -512; +double samples; +//if( timeInfo->timeCode.flags & kTcValid ) +// samples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); +//else + samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); +int delta = samples - last_samples; +//printf( "%d\n", delta); +last_samples = samples; + +if( delta > theAsioStream->framesPerHostCallback ) +{ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; +} + +// check that the buffer index is not the previous index (which would indicate +// that a buffer was skipped. +static int previousIndex = 1; +if( index == previousIndex ) +{ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; +} +previousIndex = index; +#endif + + int i; + + PaUtil_BeginCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer ); + + PaStreamCallbackTimeInfo paTimeInfo; + + // asio systemTime is supposed to be measured according to the same + // clock as timeGetTime + paTimeInfo.currentTime = (ASIO64toDouble( timeInfo->timeInfo.systemTime ) * .000000001); + + /* patch from Paul Boege */ + paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - + ((double)theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + + paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + + ((double)theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + + /* old version is buggy because the buffer processor also adds in its latency to the time parameters + paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - theAsioStream->streamRepresentation.streamInfo.inputLatency; + paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + theAsioStream->streamRepresentation.streamInfo.outputLatency; + */ +#if 1 +// detect underflows by checking inter-callback time > 2 buffer period +static double previousTime = -1; +if( previousTime > 0 ){ + + double delta = paTimeInfo.currentTime - previousTime; + + if( delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate) ){ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; + } +} +previousTime = paTimeInfo.currentTime; +#endif + + // note that the above input and output times do not need to be + // adjusted for the latency of the buffer processor -- the buffer + // processor handles that. + + if( theAsioStream->inputBufferConverter ) + { + for( i=0; iinputChannelCount; i++ ) + { + theAsioStream->inputBufferConverter( theAsioStream->inputBufferPtrs[index][i], + theAsioStream->inputShift, theAsioStream->framesPerHostCallback ); + } + } + + PaUtil_BeginBufferProcessing( &theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags ); + + /* reset status flags once they've been passed to the callback */ + theAsioStream->callbackFlags = 0; + + PaUtil_SetInputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); + for( i=0; iinputChannelCount; ++i ) + PaUtil_SetNonInterleavedInputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i] ); + + PaUtil_SetOutputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); + for( i=0; ioutputChannelCount; ++i ) + PaUtil_SetNonInterleavedOutputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i] ); + + int callbackResult; + if( theAsioStream->stopProcessing ) + callbackResult = paComplete; + else + callbackResult = paContinue; + unsigned long framesProcessed = PaUtil_EndBufferProcessing( &theAsioStream->bufferProcessor, &callbackResult ); + + if( theAsioStream->outputBufferConverter ) + { + for( i=0; ioutputChannelCount; i++ ) + { + theAsioStream->outputBufferConverter( theAsioStream->outputBufferPtrs[index][i], + theAsioStream->outputShift, theAsioStream->framesPerHostCallback ); + } + } + + PaUtil_EndCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer, framesProcessed ); + + // Finally if the driver supports the ASIOOutputReady() optimization, + // do it here, all data are in place + if( theAsioStream->postOutput ) + ASIOOutputReady(); + + if( callbackResult == paContinue ) + { + /* nothing special to do */ + } + else if( callbackResult == paAbort ) + { + /* finish playback immediately */ + theAsioStream->isActive = 0; + if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) + theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); + theAsioStream->streamFinishedCallbackCalled = true; + SetEvent( theAsioStream->completedBuffersPlayedEvent ); + theAsioStream->zeroOutput = true; + } + else /* paComplete or other non-zero value indicating complete */ + { + /* Finish playback once currently queued audio has completed. */ + theAsioStream->stopProcessing = true; + + if( PaUtil_IsBufferProcessorOutputEmpty( &theAsioStream->bufferProcessor ) ) + { + theAsioStream->zeroOutput = true; + theAsioStream->stopPlayoutCount = 0; + } + } + } + } + + ++buffersDone; + }while( PaAsio_AtomicDecrement(&theAsioStream->reenterCount) >= 0 ); + + return 0L; +} + + +static void sampleRateChanged(ASIOSampleRate sRate) +{ + // TAKEN FROM THE ASIO SDK + // do whatever you need to do if the sample rate changed + // usually this only happens during external sync. + // Audio processing is not stopped by the driver, actual sample rate + // might not have even changed, maybe only the sample rate status of an + // AES/EBU or S/PDIF digital input at the audio device. + // You might have to update time/sample related conversion routines, etc. + + (void) sRate; /* unused parameter */ + PA_DEBUG( ("sampleRateChanged : %d \n", sRate)); +} + +static long asioMessages(long selector, long value, void* message, double* opt) +{ +// TAKEN FROM THE ASIO SDK + // currently the parameters "value", "message" and "opt" are not used. + long ret = 0; + + (void) message; /* unused parameters */ + (void) opt; + + PA_DEBUG( ("asioMessages : %d , %d \n", selector, value)); + + switch(selector) + { + case kAsioSelectorSupported: + if(value == kAsioResetRequest + || value == kAsioEngineVersion + || value == kAsioResyncRequest + || value == kAsioLatenciesChanged + // the following three were added for ASIO 2.0, you don't necessarily have to support them + || value == kAsioSupportsTimeInfo + || value == kAsioSupportsTimeCode + || value == kAsioSupportsInputMonitor) + ret = 1L; + break; + + case kAsioBufferSizeChange: + //printf("kAsioBufferSizeChange \n"); + break; + + case kAsioResetRequest: + // defer the task and perform the reset of the driver during the next "safe" situation + // You cannot reset the driver right now, as this code is called from the driver. + // Reset the driver is done by completely destruct is. I.e. ASIOStop(), ASIODisposeBuffers(), Destruction + // Afterwards you initialize the driver again. + + /*FIXME: commented the next line out */ + //asioDriverInfo.stopped; // In this sample the processing will just stop + ret = 1L; + break; + + case kAsioResyncRequest: + // This informs the application, that the driver encountered some non fatal data loss. + // It is used for synchronization purposes of different media. + // Added mainly to work around the Win16Mutex problems in Windows 95/98 with the + // Windows Multimedia system, which could loose data because the Mutex was hold too long + // by another thread. + // However a driver can issue it in other situations, too. + ret = 1L; + break; + + case kAsioLatenciesChanged: + // This will inform the host application that the drivers were latencies changed. + // Beware, it this does not mean that the buffer sizes have changed! + // You might need to update internal delay data. + ret = 1L; + //printf("kAsioLatenciesChanged \n"); + break; + + case kAsioEngineVersion: + // return the supported ASIO version of the host application + // If a host applications does not implement this selector, ASIO 1.0 is assumed + // by the driver + ret = 2L; + break; + + case kAsioSupportsTimeInfo: + // informs the driver wether the asioCallbacks.bufferSwitchTimeInfo() callback + // is supported. + // For compatibility with ASIO 1.0 drivers the host application should always support + // the "old" bufferSwitch method, too. + ret = 1; + break; + + case kAsioSupportsTimeCode: + // informs the driver wether application is interested in time code info. + // If an application does not need to know about time code, the driver has less work + // to do. + ret = 0; + break; + } + return ret; +} + + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaAsioStream *stream = (PaAsioStream*)s; + ASIOError asioError; + + if( stream->outputChannelCount > 0 ) + { + ZeroOutputBuffers( stream, 0 ); + ZeroOutputBuffers( stream, 1 ); + } + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + stream->stopProcessing = false; + stream->zeroOutput = false; + + /* Reentrancy counter initialisation */ + stream->reenterCount = -1; + stream->reenterError = 0; + + stream->callbackFlags = 0; + + if( ResetEvent( stream->completedBuffersPlayedEvent ) == 0 ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + + if( result == paNoError ) + { + theAsioStream = stream; + asioError = ASIOStart(); + if( asioError == ASE_OK ) + { + stream->isActive = 1; + stream->streamFinishedCallbackCalled = false; + } + else + { + theAsioStream = 0; + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + } + } + + return result; +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaAsioStream *stream = (PaAsioStream*)s; + ASIOError asioError; + + if( stream->isActive ) + { + stream->stopProcessing = true; + + /* wait for the stream to finish playing out enqueued buffers. + timeout after four times the stream latency. + + @todo should use a better time out value - if the user buffer + length is longer than the asio buffer size then that should + be taken into account. + */ + if( WaitForSingleObject( theAsioStream->completedBuffersPlayedEvent, + (DWORD)(stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.) ) + == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n" )); + } + } + + asioError = ASIOStop(); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + } + + theAsioStream = 0; + stream->isActive = 0; + + if( !stream->streamFinishedCallbackCalled ) + { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + + return result; +} + + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaAsioStream *stream = (PaAsioStream*)s; + ASIOError asioError; + + stream->zeroOutput = true; + + asioError = ASIOStop(); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + } + else + { + // make sure that the callback is not still in-flight when ASIOStop() + // returns. This has been observed to happen on the Hoontech DSP24 for + // example. + int count = 2000; // only wait for 2 seconds, rather than hanging. + while( theAsioStream->reenterCount != -1 && count > 0 ) + { + Sleep(1); + --count; + } + } + + /* it is questionable whether we should zero theAsioStream if ASIOStop() + returns an error, because the callback could still be active. We assume + not - this is based on the fact that ASIOStop is unlikely to fail + if the callback is running - it's more likely to fail because the + callback is not running. */ + + theAsioStream = 0; + stream->isActive = 0; + + if( !stream->streamFinishedCallbackCalled ) + { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + //PaAsioStream *stream = (PaAsioStream*)s; + (void) s; /* unused parameter */ + return theAsioStream == 0; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + return stream->isActive; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + (void) s; /* unused parameter */ + return (double)timeGetTime() * .001; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + (void) stream; /* unused parameters */ + (void) buffer; + (void) frames; + + return paNoError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + (void) stream; /* unused parameters */ + (void) buffer; + (void) frames; + + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + (void) stream; /* unused parameter */ + + return 0; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + (void) stream; /* unused parameter */ + + return 0; +} + + +PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiDevice; + ASIODriverInfo asioDriverInfo; + ASIOError asioError; + int asioIsInitialized = 0; + PaAsioHostApiRepresentation *asioHostApi; + PaAsioDeviceInfo *asioDeviceInfo; + + + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) + goto error; + + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) + goto error; + + /* + In theory we could proceed if the currently open device was the same + one for which the control panel was requested, however because the + window pointer is not available until this function is called we + currently need to call ASIOInit() again here, which of course can't be + done safely while a stream is open. + */ + + asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + if( asioHostApi->openAsioDeviceIndex != paNoDevice ) + { + result = paDeviceUnavailable; + goto error; + } + + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + + if( !loadAsioDriver( const_cast(asioDeviceInfo->commonDeviceInfo.name) ) ) + { + result = paUnanticipatedHostError; + goto error; + } + + /* CRUCIAL!!! */ + memset( &asioDriverInfo, 0, sizeof(ASIODriverInfo) ); + asioDriverInfo.asioVersion = 2; + asioDriverInfo.sysRef = systemSpecific; + asioError = ASIOInit( &asioDriverInfo ); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + else + { + asioIsInitialized = 1; + } + +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); +PA_DEBUG(("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion )); +PA_DEBUG(("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion )); +PA_DEBUG(("Name: ASIOInit(): %s\n", asioDriverInfo.name )); +PA_DEBUG(("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage )); + + asioError = ASIOControlPanel(); + if( asioError != ASE_OK ) + { + PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); + + asioError = ASIOExit(); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + asioIsInitialized = 0; + goto error; + } + +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); + + return result; + +error: + if( asioIsInitialized ) + ASIOExit(); + + return result; +} + + +PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiDevice; + PaAsioDeviceInfo *asioDeviceInfo; + + + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) + goto error; + + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) + goto error; + + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + + if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels ){ + result = paInvalidChannelCount; + goto error; + } + + *channelName = asioDeviceInfo->asioChannelInfos[channelIndex].name; + + return paNoError; + +error: + return result; +} + + +PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiDevice; + PaAsioDeviceInfo *asioDeviceInfo; + + + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) + goto error; + + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) + goto error; + + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + + if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels ){ + result = paInvalidChannelCount; + goto error; + } + + *channelName = asioDeviceInfo->asioChannelInfos[ + asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name; + + return paNoError; + +error: + return result; +} diff --git a/portaudio-v19/pa_asio/pa_asio.h b/portaudio-v19/pa_asio/pa_asio.h new file mode 100644 index 000000000..573930572 --- /dev/null +++ b/portaudio-v19/pa_asio/pa_asio.h @@ -0,0 +1,122 @@ +#ifndef PA_ASIO_H +#define PA_ASIO_H +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * ASIO specific extensions + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +/** @file + @brief ASIO-specific PortAudio API extension header file. +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** Retrieve legal latency settings for the specificed device, in samples. + + @param device The global index of the device about which the query is being made. + @param minLatency A pointer to the location which will recieve the minimum latency value. + @param maxLatency A pointer to the location which will recieve the maximum latency value. + @param preferredLatency A pointer to the location which will recieve the preferred latency value. + @param granularity A pointer to the location which will recieve the granularity. This value + determines which values between minLatency and maxLatency are available. ie the step size, + if granularity is -1 then available latency settings are powers of two. + + @see ASIOGetBufferSize in the ASIO SDK. + + @todo This function should have a better name, any suggestions? +*/ +PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device, + long *minLatency, long *maxLatency, long *preferredLatency, long *granularity ); + + +/** Display the ASIO control panel for the specified device. + + @param device The global index of the device whose control panel is to be displayed. + @param systemSpecific On Windows, the calling application's main window handle, + on Macintosh this value should be zero. +*/ +PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ); + + + + +/** Retrieve a pointer to a string containing the name of the specified + input channel. The string is valid until Pa_Terminate is called. + + The string will be no longer than 32 characters including the null terminator. +*/ +PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ); + + +/** Retrieve a pointer to a string containing the name of the specified + input channel. The string is valid until Pa_Terminate is called. + + The string will be no longer than 32 characters including the null terminator. +*/ +PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ); + + +#define paAsioUseChannelSelectors (0x01) + +typedef struct PaAsioStreamInfo{ + unsigned long size; /**< sizeof(PaAsioStreamInfo) */ + PaHostApiTypeId hostApiType; /**< paASIO */ + unsigned long version; /**< 1 */ + + unsigned long flags; + + /* Support for opening only specific channels of an ASIO device. + If the paAsioUseChannelSelectors flag is set, channelSelectors is a + pointer to an array of integers specifying the device channels to use. + When used, the length of the channelSelectors array must match the + corresponding channelCount parameter to Pa_OpenStream() otherwise a + crash may result. + The values in the selectors array must specify channels within the + range of supported channels for the device or paInvalidChannelCount will + result. + */ + int *channelSelectors; +}PaAsioStreamInfo; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* PA_ASIO_H */ diff --git a/portaudio-v19/pa_beos/PlaybackNode.cc b/portaudio-v19/pa_beos/PlaybackNode.cc new file mode 100644 index 000000000..a93b84120 --- /dev/null +++ b/portaudio-v19/pa_beos/PlaybackNode.cc @@ -0,0 +1,538 @@ +/* + * $Id: PlaybackNode.cc,v 1.1.1.1 2002/01/22 00:52:07 phil Exp $ + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * BeOS Media Kit Implementation by Joshua Haberman + * + * Copyright (c) 2001 Joshua Haberman + * + * 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. + * + * 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. + * + * 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. + * + * --- + * + * Significant portions of this file are based on sample code from Be. The + * Be Sample Code Licence follows: + * + * Copyright 1991-1999, Be Incorporated. + * All rights reserved. + * + * 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. + * + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF TITLE, NON-INFRINGEMENT, 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 + +#include +#include +#include + +#include "PlaybackNode.h" + +#define PRINT(x) { printf x; fflush(stdout); } + +#ifdef DEBUG +#define DBUG(x) PRINT(x) +#else +#define DBUG(x) +#endif + + +PaPlaybackNode::PaPlaybackNode(uint32 channels, float frame_rate, uint32 frames_per_buffer, + PortAudioCallback* callback, void *user_data) : + BMediaNode("PortAudio input node"), + BBufferProducer(B_MEDIA_RAW_AUDIO), + BMediaEventLooper(), + mAborted(false), + mRunning(false), + mBufferGroup(NULL), + mDownstreamLatency(0), + mStartTime(0), + mCallback(callback), + mUserData(user_data), + mFramesPerBuffer(frames_per_buffer) +{ + DBUG(("Constructor called.\n")); + + mPreferredFormat.type = B_MEDIA_RAW_AUDIO; + mPreferredFormat.u.raw_audio.channel_count = channels; + mPreferredFormat.u.raw_audio.frame_rate = frame_rate; + mPreferredFormat.u.raw_audio.byte_order = + (B_HOST_IS_BENDIAN) ? B_MEDIA_BIG_ENDIAN : B_MEDIA_LITTLE_ENDIAN; + mPreferredFormat.u.raw_audio.buffer_size = + media_raw_audio_format::wildcard.buffer_size; + + mOutput.destination = media_destination::null; + mOutput.format = mPreferredFormat; + + /* The amount of time it takes for this node to produce a buffer when + * asked. Essentially, it is how long the user's callback takes to run. + * We set this to be the length of the sound data each buffer of the + * requested size can hold. */ + //mInternalLatency = (bigtime_t)(1000000 * frames_per_buffer / frame_rate); + + /* ACK! it seems that the mixer (at least on my machine) demands that IT + * specify the buffer size, so for now I'll just make a generic guess here */ + mInternalLatency = 1000000 / 20; +} + + + +PaPlaybackNode::~PaPlaybackNode() +{ + DBUG(("Destructor called.\n")); + Quit(); /* Stop the BMediaEventLooper thread */ +} + + +/************************* + * + * Local methods + * + */ + +bool PaPlaybackNode::IsRunning() +{ + return mRunning; +} + + +PaTimestamp PaPlaybackNode::GetStreamTime() +{ + BTimeSource *timeSource = TimeSource(); + PaTimestamp time = (timeSource->Now() - mStartTime) * + mPreferredFormat.u.raw_audio.frame_rate / 1000000; + return time; +} + + +void PaPlaybackNode::SetSampleFormat(PaSampleFormat inFormat, + PaSampleFormat outFormat) +{ + uint32 beOutFormat; + + switch(outFormat) + { + case paFloat32: + beOutFormat = media_raw_audio_format::B_AUDIO_FLOAT; + mOutputSampleWidth = 4; + break; + + case paInt16: + beOutFormat = media_raw_audio_format::B_AUDIO_SHORT; + mOutputSampleWidth = 2; + break; + + case paInt32: + beOutFormat = media_raw_audio_format::B_AUDIO_INT; + mOutputSampleWidth = 4; + break; + + case paInt8: + beOutFormat = media_raw_audio_format::B_AUDIO_CHAR; + mOutputSampleWidth = 1; + break; + + case paUInt8: + beOutFormat = media_raw_audio_format::B_AUDIO_UCHAR; + mOutputSampleWidth = 1; + break; + + case paInt24: + case paPackedInt24: + case paCustomFormat: + DBUG(("Unsupported output format: %x\n", outFormat)); + break; + + default: + DBUG(("Unknown output format: %x\n", outFormat)); + } + + mPreferredFormat.u.raw_audio.format = beOutFormat; + mFramesPerBuffer * mPreferredFormat.u.raw_audio.channel_count * mOutputSampleWidth; +} + +BBuffer *PaPlaybackNode::FillNextBuffer(bigtime_t time) +{ + /* Get a buffer from the buffer group */ + BBuffer *buf = mBufferGroup->RequestBuffer( + mOutput.format.u.raw_audio.buffer_size, BufferDuration()); + unsigned long frames = mOutput.format.u.raw_audio.buffer_size / + mOutputSampleWidth / mOutput.format.u.raw_audio.channel_count; + bigtime_t start_time; + int ret; + + if( !buf ) + { + DBUG(("Unable to allocate a buffer\n")); + return NULL; + } + + start_time = mStartTime + + (bigtime_t)((double)mSamplesSent / + (double)mOutput.format.u.raw_audio.frame_rate / + (double)mOutput.format.u.raw_audio.channel_count * + 1000000.0); + + /* Now call the user callback to get the data */ + ret = mCallback(NULL, /* Input buffer */ + buf->Data(), /* Output buffer */ + frames, /* Frames per buffer */ + mSamplesSent / mOutput.format.u.raw_audio.channel_count, /* timestamp */ + mUserData); + + if( ret ) + mAborted = true; + + media_header *hdr = buf->Header(); + + hdr->type = B_MEDIA_RAW_AUDIO; + hdr->size_used = mOutput.format.u.raw_audio.buffer_size; + hdr->time_source = TimeSource()->ID(); + hdr->start_time = start_time; + + return buf; +} + + + + +/************************* + * + * BMediaNode methods + * + */ + +BMediaAddOn *PaPlaybackNode::AddOn( int32 * ) const +{ + DBUG(("AddOn() called.\n")); + return NULL; /* we don't provide service to outside applications */ +} + + +status_t PaPlaybackNode::HandleMessage( int32 message, const void *data, + size_t size ) +{ + DBUG(("HandleMessage() called.\n")); + return B_ERROR; /* we don't define any custom messages */ +} + + + + +/************************* + * + * BMediaEventLooper methods + * + */ + +void PaPlaybackNode::NodeRegistered() +{ + DBUG(("NodeRegistered() called.\n")); + + /* Start the BMediaEventLooper thread */ + SetPriority(B_REAL_TIME_PRIORITY); + Run(); + + /* set up as much information about our output as we can */ + mOutput.source.port = ControlPort(); + mOutput.source.id = 0; + mOutput.node = Node(); + ::strcpy(mOutput.name, "PortAudio Playback"); +} + + +void PaPlaybackNode::HandleEvent( const media_timed_event *event, + bigtime_t lateness, bool realTimeEvent ) +{ + // DBUG(("HandleEvent() called.\n")); + status_t err; + + switch(event->type) + { + case BTimedEventQueue::B_START: + DBUG((" Handling a B_START event\n")); + if( RunState() != B_STARTED ) + { + mStartTime = event->event_time + EventLatency(); + mSamplesSent = 0; + mAborted = false; + mRunning = true; + media_timed_event firstEvent( mStartTime, + BTimedEventQueue::B_HANDLE_BUFFER ); + EventQueue()->AddEvent( firstEvent ); + } + break; + + case BTimedEventQueue::B_STOP: + DBUG((" Handling a B_STOP event\n")); + mRunning = false; + EventQueue()->FlushEvents( 0, BTimedEventQueue::B_ALWAYS, true, + BTimedEventQueue::B_HANDLE_BUFFER ); + break; + + case BTimedEventQueue::B_HANDLE_BUFFER: + //DBUG((" Handling a B_HANDLE_BUFFER event\n")); + + /* make sure we're started and connected */ + if( RunState() != BMediaEventLooper::B_STARTED || + mOutput.destination == media_destination::null ) + break; + + BBuffer *buffer = FillNextBuffer(event->event_time); + + /* make sure we weren't aborted while this routine was running. + * this can happen in one of two ways: either the callback returned + * nonzero (in which case mAborted is set in FillNextBuffer() ) or + * the client called AbortStream */ + if( mAborted ) + { + if( buffer ) + buffer->Recycle(); + Stop(0, true); + break; + } + + if( buffer ) + { + err = SendBuffer(buffer, mOutput.destination); + if( err != B_OK ) + buffer->Recycle(); + } + + mSamplesSent += mOutput.format.u.raw_audio.buffer_size / mOutputSampleWidth; + + /* Now schedule the next buffer event, so we can send another + * buffer when this one runs out. We calculate when it should + * happen by calculating when the data we just sent will finish + * playing. + * + * NOTE, however, that the event will actually get generated + * earlier than we specify, to account for the latency it will + * take to produce the buffer. It uses the latency value we + * specified in SetEventLatency() to determine just how early + * to generate it. */ + + /* totalPerformanceTime includes the time represented by the buffer + * we just sent */ + bigtime_t totalPerformanceTime = (bigtime_t)((double)mSamplesSent / + (double)mOutput.format.u.raw_audio.channel_count / + (double)mOutput.format.u.raw_audio.frame_rate * 1000000.0); + + bigtime_t nextEventTime = mStartTime + totalPerformanceTime; + + media_timed_event nextBufferEvent(nextEventTime, + BTimedEventQueue::B_HANDLE_BUFFER); + EventQueue()->AddEvent(nextBufferEvent); + + break; + + } +} + + + + +/************************* + * + * BBufferProducer methods + * + */ + +status_t PaPlaybackNode::FormatSuggestionRequested( media_type type, + int32 /*quality*/, media_format* format ) +{ + /* the caller wants to know this node's preferred format and provides + * a suggestion, asking if we support it */ + DBUG(("FormatSuggestionRequested() called.\n")); + + if(!format) + return B_BAD_VALUE; + + *format = mPreferredFormat; + + /* we only support raw audio (a wildcard is okay too) */ + if ( type == B_MEDIA_UNKNOWN_TYPE || type == B_MEDIA_RAW_AUDIO ) + return B_OK; + else + return B_MEDIA_BAD_FORMAT; +} + + +status_t PaPlaybackNode::FormatProposal( const media_source& output, + media_format* format ) +{ + /* This is similar to FormatSuggestionRequested(), but it is actually part + * of the negotiation process. We're given the opportunity to specify any + * properties that are wildcards (ie. properties that the other node doesn't + * care one way or another about) */ + DBUG(("FormatProposal() called.\n")); + + /* Make sure this proposal really applies to our output */ + if( output != mOutput.source ) + return B_MEDIA_BAD_SOURCE; + + /* We return two things: whether we support the proposed format, and our own + * preferred format */ + *format = mPreferredFormat; + + if( format->type == B_MEDIA_UNKNOWN_TYPE || format->type == B_MEDIA_RAW_AUDIO ) + return B_OK; + else + return B_MEDIA_BAD_FORMAT; +} + + +status_t PaPlaybackNode::FormatChangeRequested( const media_source& source, + const media_destination& destination, media_format* io_format, int32* ) +{ + /* we refuse to change formats, supporting only 1 */ + DBUG(("FormatChangeRequested() called.\n")); + + return B_ERROR; +} + + +status_t PaPlaybackNode::GetNextOutput( int32* cookie, media_output* out_output ) +{ + /* this is where we allow other to enumerate our outputs -- the cookie is + * an integer we can use to keep track of where we are in enumeration. */ + DBUG(("GetNextOutput() called.\n")); + + if( *cookie == 0 ) + { + *out_output = mOutput; + *cookie = 1; + return B_OK; + } + + return B_BAD_INDEX; +} + + +status_t PaPlaybackNode::DisposeOutputCookie( int32 cookie ) +{ + DBUG(("DisposeOutputCookie() called.\n")); + return B_OK; +} + + +void PaPlaybackNode::LateNoticeReceived( const media_source& what, + bigtime_t how_much, bigtime_t performance_time ) +{ + /* This function is called as notification that a buffer we sent wasn't + * received by the time we stamped it with -- it got there late. Basically, + * it means we underestimated our own latency, so we should increase it */ + DBUG(("LateNoticeReceived() called.\n")); + + if( what != mOutput.source ) + return; + + if( RunMode() == B_INCREASE_LATENCY ) + { + mInternalLatency += how_much; + SetEventLatency( mDownstreamLatency + mInternalLatency ); + DBUG(("Increasing latency to %Ld\n", mDownstreamLatency + mInternalLatency)); + } + else + DBUG(("I don't know what to do with this notice!")); +} + + +void PaPlaybackNode::EnableOutput( const media_source& what, bool enabled, + int32* ) +{ + DBUG(("EnableOutput() called.\n")); + /* stub -- we don't support this yet */ +} + + +status_t PaPlaybackNode::PrepareToConnect( const media_source& what, + const media_destination& where, media_format* format, + media_source* out_source, char* out_name ) +{ + /* the final stage of format negotiations. here we _must_ make specific any + * remaining wildcards */ + DBUG(("PrepareToConnect() called.\n")); + + /* make sure this really refers to our source */ + if( what != mOutput.source ) + return B_MEDIA_BAD_SOURCE; + + /* make sure we're not already connected */ + if( mOutput.destination != media_destination::null ) + return B_MEDIA_ALREADY_CONNECTED; + + if( format->type != B_MEDIA_RAW_AUDIO ) + return B_MEDIA_BAD_FORMAT; + + if( format->u.raw_audio.format != mPreferredFormat.u.raw_audio.format ) + return B_MEDIA_BAD_FORMAT; + + if( format->u.raw_audio.buffer_size == + media_raw_audio_format::wildcard.buffer_size ) + { + DBUG(("We were left to decide buffer size: choosing 2048")); + format->u.raw_audio.buffer_size = 2048; + } + else + DBUG(("Using consumer specified buffer size of %lu.\n", + format->u.raw_audio.buffer_size)); + + /* Reserve the connection, return the information */ + mOutput.destination = where; + mOutput.format = *format; + *out_source = mOutput.source; + strncpy( out_name, mOutput.name, B_MEDIA_NAME_LENGTH ); + + return B_OK; +} + + +void PaPlaybackNode::Connect(status_t error, const media_source& source, + const media_destination& destination, const media_format& format, char* io_name) +{ + DBUG(("Connect() called.\n")); + diff --git a/portaudio-v19/pa_beos/PlaybackNode.h b/portaudio-v19/pa_beos/PlaybackNode.h new file mode 100644 index 000000000..64ee5b3bc --- /dev/null +++ b/portaudio-v19/pa_beos/PlaybackNode.h @@ -0,0 +1,108 @@ +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * BeOS Media Kit Implementation by Joshua Haberman + * + * Copyright (c) 2001 Joshua Haberman + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include + +#include "portaudio.h" + +class PaPlaybackNode : + public BBufferProducer, + public BMediaEventLooper +{ + +public: + PaPlaybackNode( uint32 channels, float frame_rate, uint32 frames_per_buffer, + PortAudioCallback *callback, void *user_data ); + ~PaPlaybackNode(); + + + /* Local methods ******************************************/ + + BBuffer *FillNextBuffer(bigtime_t time); + void SetSampleFormat(PaSampleFormat inFormat, PaSampleFormat outFormat); + bool IsRunning(); + PaTimestamp GetStreamTime(); + + /* BMediaNode methods *************************************/ + + BMediaAddOn* AddOn( int32 * ) const; + status_t HandleMessage( int32 message, const void *data, size_t size ); + + /* BMediaEventLooper methods ******************************/ + + void HandleEvent( const media_timed_event *event, bigtime_t lateness, + bool realTimeEvent ); + void NodeRegistered(); + + /* BBufferProducer methods ********************************/ + + status_t FormatSuggestionRequested( media_type type, int32 quality, + media_format* format ); + status_t FormatProposal( const media_source& output, media_format* format ); + status_t FormatChangeRequested( const media_source& source, + const media_destination& destination, media_format* io_format, int32* ); + + status_t GetNextOutput( int32* cookie, media_output* out_output ); + status_t DisposeOutputCookie( int32 cookie ); + + void LateNoticeReceived( const media_source& what, bigtime_t how_much, + bigtime_t performance_time ); + void EnableOutput( const media_source& what, bool enabled, int32* _deprecated_ ); + + status_t PrepareToConnect( const media_source& what, + const media_destination& where, media_format* format, + media_source* out_source, char* out_name ); + void Connect(status_t error, const media_source& source, + const media_destination& destination, const media_format& format, + char* io_name); + void Disconnect(const media_source& what, const media_destination& where); + + status_t SetBufferGroup(const media_source& for_source, BBufferGroup* newGroup); + + bool mAborted; + +private: + media_output mOutput; + media_format mPreferredFormat; + uint32 mOutputSampleWidth, mFramesPerBuffer; + BBufferGroup *mBufferGroup; + bigtime_t mDownstreamLatency, mInternalLatency, mStartTime; + uint64 mSamplesSent; + PortAudioCallback *mCallback; + void *mUserData; + bool mRunning; + +}; + diff --git a/portaudio-v19/pa_beos/pa_beos_mk.cc b/portaudio-v19/pa_beos/pa_beos_mk.cc new file mode 100644 index 000000000..ff35cdc34 --- /dev/null +++ b/portaudio-v19/pa_beos/pa_beos_mk.cc @@ -0,0 +1,441 @@ +/* + * $Id: pa_beos_mk.cc,v 1.1.1.1 2002/01/22 00:52:09 phil Exp $ + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * BeOS Media Kit Implementation by Joshua Haberman + * + * Copyright (c) 2001 Joshua Haberman + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include "portaudio.h" +#include "pa_host.h" + +#include "PlaybackNode.h" + +#define PRINT(x) { printf x; fflush(stdout); } + +#ifdef DEBUG +#define DBUG(x) PRINT(x) +#else +#define DBUG(x) +#endif + +typedef struct PaHostSoundControl +{ + /* These members are common to all modes of operation */ + media_node pahsc_TimeSource; /* the sound card's DAC. */ + media_format pahsc_Format; + + /* These methods are specific to playing mode */ + media_node pahsc_OutputNode; /* output to the mixer */ + media_node pahsc_InputNode; /* reads data from user callback -- PA specific */ + + media_input pahsc_MixerInput; /* input jack on the soundcard's mixer. */ + media_output pahsc_PaOutput; /* output jack from the PA node */ + + PaPlaybackNode *pahsc_InputNodeInstance; + +} +PaHostSoundControl; + +/*************************************************************************/ +PaDeviceID Pa_GetDefaultOutputDeviceID( void ) +{ + /* stub */ + return 0; +} + +/*************************************************************************/ +PaDeviceID Pa_GetDefaultInputDeviceID( void ) +{ + /* stub */ + return 0; +} + +/*************************************************************************/ +const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID id ) +{ + /* stub */ + return NULL; +} + +/*************************************************************************/ +int Pa_CountDevices() +{ + /* stub */ + return 1; +} + +/*************************************************************************/ +PaError PaHost_Init( void ) +{ + /* we have to create this in order to use BMediaRoster. I hope it doesn't + * cause problems */ + be_app = new BApplication("application/x-vnd.portaudio-app"); + + return paNoError; +} + +PaError PaHost_Term( void ) +{ + delete be_app; + return paNoError; +} + +/*************************************************************************/ +PaError PaHost_StreamActive( internalPortAudioStream *past ) +{ + PaHostSoundControl *pahsc = (PaHostSoundControl *)past->past_DeviceData; + DBUG(("IsRunning returning: %s\n", + pahsc->pahsc_InputNodeInstance->IsRunning() ? "true" : "false")); + + return (PaError)pahsc->pahsc_InputNodeInstance->IsRunning(); +} + +PaError PaHost_StartOutput( internalPortAudioStream *past ) +{ + return paNoError; +} + +/*************************************************************************/ +PaError PaHost_StartInput( internalPortAudioStream *past ) +{ + return paNoError; +} + +/*************************************************************************/ +PaError PaHost_StopInput( internalPortAudioStream *past, int abort ) +{ + return paNoError; +} + +/*************************************************************************/ +PaError PaHost_StopOutput( internalPortAudioStream *past, int abort ) +{ + return paNoError; +} + + +/*************************************************************************/ +PaError PaHost_StartEngine( internalPortAudioStream *past ) +{ + bigtime_t very_soon, start_latency; + status_t err; + BMediaRoster *roster = BMediaRoster::Roster(&err); + PaHostSoundControl *pahsc = (PaHostSoundControl *)past->past_DeviceData; + + /* for some reason, err indicates an error (though nothing it wrong) + * when the DBUG macro in pa_lib.c is enabled. It's reproducably + * linked. Weird. */ + if( !roster /* || err != B_OK */ ) + { + DBUG(("No media server! err=%d, roster=%x\n", err, roster)); + return paHostError; + } + + /* tell the node when to start -- since there aren't any other nodes + * starting that we have to wait for, just tell it to start now + */ + + BTimeSource *timeSource = roster->MakeTimeSourceFor(pahsc->pahsc_TimeSource); + very_soon = timeSource->PerformanceTimeFor( BTimeSource::RealTime() ); + timeSource->Release(); + + /* Add the latency of starting the network of nodes */ + err = roster->GetStartLatencyFor( pahsc->pahsc_TimeSource, &start_latency ); + very_soon += start_latency; + + err = roster->StartNode( pahsc->pahsc_InputNode, very_soon ); + /* No need to start the mixer -- it's always running */ + + return paNoError; +} + + +/*************************************************************************/ +PaError PaHost_StopEngine( internalPortAudioStream *past, int abort ) +{ + PaHostSoundControl *pahsc = (PaHostSoundControl *)past->past_DeviceData; + BMediaRoster *roster = BMediaRoster::Roster(); + + if( !roster ) + { + DBUG(("No media roster!\n")); + return paHostError; + } + + if( !pahsc ) + return paHostError; + + /* this crashes, and I don't know why yet */ + // if( abort ) + // pahsc->pahsc_InputNodeInstance->mAborted = true; + + roster->StopNode(pahsc->pahsc_InputNode, 0, /* immediate = */ true); + + return paNoError; +} + + +/*************************************************************************/ +PaError PaHost_OpenStream( internalPortAudioStream *past ) +{ + status_t err; + BMediaRoster *roster = BMediaRoster::Roster(&err); + PaHostSoundControl *pahsc; + + /* Allocate and initialize host data. */ + pahsc = (PaHostSoundControl *) PaHost_AllocateFastMemory(sizeof(PaHostSoundControl)); + if( pahsc == NULL ) + { + goto error; + } + memset( pahsc, 0, sizeof(PaHostSoundControl) ); + past->past_DeviceData = (void *) pahsc; + + if( !roster /* || err != B_OK */ ) + { + /* no media server! */ + DBUG(("No media server.\n")); + goto error; + } + + if ( past->past_NumInputChannels > 0 && past->past_NumOutputChannels > 0 ) + { + /* filter -- not implemented yet */ + goto error; + } + else if ( past->past_NumInputChannels > 0 ) + { + /* recorder -- not implemented yet */ + goto error; + } + else + { + /* player ****************************************************************/ + + status_t err; + int32 num; + + /* First we need to create the three components (like components in a stereo + * system). The mixer component is our interface to the sound card, data + * we write there will get played. The BePA_InputNode component is the node + * which represents communication with the PA client (it is what calls the + * client's callbacks). The time source component is the sound card's DAC, + * which allows us to slave the other components to it instead of the system + * clock. */ + err = roster->GetAudioMixer( &pahsc->pahsc_OutputNode ); + if( err != B_OK ) + { + DBUG(("Couldn't get default mixer.\n")); + goto error; + } + + err = roster->GetTimeSource( &pahsc->pahsc_TimeSource ); + if( err != B_OK ) + { + DBUG(("Couldn't get time source.\n")); + goto error; + } + + pahsc->pahsc_InputNodeInstance = new PaPlaybackNode(2, 44100, + past->past_FramesPerUserBuffer, past->past_Callback, past->past_UserData ); + pahsc->pahsc_InputNodeInstance->SetSampleFormat(0, + past->past_OutputSampleFormat); + err = roster->RegisterNode( pahsc->pahsc_InputNodeInstance ); + if( err != B_OK ) + { + DBUG(("Unable to register node.\n")); + goto error; + } + + roster->GetNodeFor( pahsc->pahsc_InputNodeInstance->Node().node, + &pahsc->pahsc_InputNode ); + if( err != B_OK ) + { + DBUG(("Unable to get input node.\n")); + goto error; + } + + /* Now we have three components (nodes) sitting next to each other. The + * next step is to look at them and find their inputs and outputs so we can + * wire them together. */ + err = roster->GetFreeInputsFor( pahsc->pahsc_OutputNode, + &pahsc->pahsc_MixerInput, 1, &num, B_MEDIA_RAW_AUDIO ); + if( err != B_OK || num < 1 ) + { + DBUG(("Couldn't get the mixer input.\n")); + goto error; + } + + err = roster->GetFreeOutputsFor( pahsc->pahsc_InputNode, + &pahsc->pahsc_PaOutput, 1, &num, B_MEDIA_RAW_AUDIO ); + if( err != B_OK || num < 1 ) + { + DBUG(("Couldn't get PortAudio output.\n")); + goto error; + } + + + /* We've found the input and output -- the final step is to run a wire + * between them so they are connected. */ + + /* try to make the mixer input adapt to what PA sends it */ + pahsc->pahsc_Format = pahsc->pahsc_PaOutput.format; + roster->Connect( pahsc->pahsc_PaOutput.source, + pahsc->pahsc_MixerInput.destination, &pahsc->pahsc_Format, + &pahsc->pahsc_PaOutput, &pahsc->pahsc_MixerInput ); + + + /* Actually, there's one final step -- tell them all to sync to the + * sound card's DAC */ + roster->SetTimeSourceFor( pahsc->pahsc_InputNode.node, + pahsc->pahsc_TimeSource.node ); + roster->SetTimeSourceFor( pahsc->pahsc_OutputNode.node, + pahsc->pahsc_TimeSource.node ); + + } + + return paNoError; + +error: + PaHost_CloseStream( past ); + return paHostError; +} + +/*************************************************************************/ +PaError PaHost_CloseStream( internalPortAudioStream *past ) +{ + PaHostSoundControl *pahsc = (PaHostSoundControl *)past->past_DeviceData; + status_t err; + BMediaRoster *roster = BMediaRoster::Roster(&err); + + if( !roster ) + { + DBUG(("Couldn't get media roster\n")); + return paHostError; + } + + if( !pahsc ) + return paHostError; + + /* Disconnect all the connections we made when opening the stream */ + + roster->Disconnect(pahsc->pahsc_InputNode.node, pahsc->pahsc_PaOutput.source, + pahsc->pahsc_OutputNode.node, pahsc->pahsc_MixerInput.destination); + + DBUG(("Calling ReleaseNode()")); + roster->ReleaseNode(pahsc->pahsc_InputNode); + + /* deleting the node shouldn't be necessary -- it is reference counted, and will + * delete itself when its references drop to zero. the call to ReleaseNode() + * above should decrease its reference count */ + pahsc->pahsc_InputNodeInstance = NULL; + + return paNoError; +} + +/*************************************************************************/ +PaTimestamp Pa_StreamTime( PortAudioStream *stream ) +{ + internalPortAudioStream *past = (internalPortAudioStream *) stream; + PaHostSoundControl *pahsc = (PaHostSoundControl *)past->past_DeviceData; + + return pahsc->pahsc_InputNodeInstance->GetStreamTime(); +} + +/*************************************************************************/ +void Pa_Sleep( long msec ) +{ + /* snooze() takes microseconds */ + snooze( msec * 1000 ); +} + +/************************************************************************* + * Allocate memory that can be accessed in real-time. + * This may need to be held in physical memory so that it is not + * paged to virtual memory. + * This call MUST be balanced with a call to PaHost_FreeFastMemory(). + * Memory will be set to zero. + */ +void *PaHost_AllocateFastMemory( long numBytes ) +{ + /* BeOS supports non-pagable memory through pools -- a pool is an area + * of physical memory that is locked. It would be best to pre-allocate + * that pool and then hand out memory from it, but we don't know in + * advance how much we'll need. So for now, we'll allocate a pool + * for every request we get, storing a pointer to the pool at the + * beginning of the allocated memory */ + rtm_pool *pool; + void *addr; + long size = numBytes + sizeof(rtm_pool *); + static int counter = 0; + char pool_name[100]; + + /* Every pool needs a unique name. */ + sprintf(pool_name, "PaPoolNumber%d", counter++); + + if( rtm_create_pool( &pool, size, pool_name ) != B_OK ) + return 0; + + addr = rtm_alloc( pool, size ); + if( addr == NULL ) + return 0; + + memset( addr, 0, numBytes ); + *((rtm_pool **)addr) = pool; // store the pointer to the pool + addr = (rtm_pool **)addr + 1; // and return the next location in memory + + return addr; +} + +/************************************************************************* + * Free memory that could be accessed in real-time. + * This call MUST be balanced with a call to PaHost_AllocateFastMemory(). + */ +void PaHost_FreeFastMemory( void *addr, long numBytes ) +{ + rtm_pool *pool; + + if( addr == NULL ) + return; + + addr = (rtm_pool **)addr - 1; + pool = *((rtm_pool **)addr); + + rtm_free( addr ); + rtm_delete_pool( pool ); +} diff --git a/portaudio-v19/pa_common/pa_allocation.c b/portaudio-v19/pa_common/pa_allocation.c new file mode 100644 index 000000000..98239c48f --- /dev/null +++ b/portaudio-v19/pa_common/pa_allocation.c @@ -0,0 +1,234 @@ +/* + * $Id$ + * Portable Audio I/O Library allocation group implementation + * memory allocation group for tracking allocation groups + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Allocation Group implementation. +*/ + + +#include "pa_allocation.h" +#include "pa_util.h" + + +/* + Maintain 3 singly linked lists... + linkBlocks: the buffers used to allocate the links + spareLinks: links available for use in the allocations list + allocations: the buffers currently allocated using PaUtil_ContextAllocateMemory() + + Link block size is doubled every time new links are allocated. +*/ + + +#define PA_INITIAL_LINK_COUNT_ 16 + +struct PaUtilAllocationGroupLink +{ + struct PaUtilAllocationGroupLink *next; + void *buffer; +}; + +/* + Allocate a block of links. The first link will have it's buffer member + pointing to the block, and it's next member set to . The remaining + links will have NULL buffer members, and each link will point to + the next link except the last, which will point to +*/ +static struct PaUtilAllocationGroupLink *AllocateLinks( long count, + struct PaUtilAllocationGroupLink *nextBlock, + struct PaUtilAllocationGroupLink *nextSpare ) +{ + struct PaUtilAllocationGroupLink *result; + int i; + + result = (struct PaUtilAllocationGroupLink *)PaUtil_AllocateMemory( + sizeof(struct PaUtilAllocationGroupLink) * count ); + if( result ) + { + /* the block link */ + result[0].buffer = result; + result[0].next = nextBlock; + + /* the spare links */ + for( i=1; ilinkCount = PA_INITIAL_LINK_COUNT_; + result->linkBlocks = &links[0]; + result->spareLinks = &links[1]; + result->allocations = 0; + } + else + { + PaUtil_FreeMemory( links ); + } + } + + return result; +} + + +void PaUtil_DestroyAllocationGroup( PaUtilAllocationGroup* group ) +{ + struct PaUtilAllocationGroupLink *current = group->linkBlocks; + struct PaUtilAllocationGroupLink *next; + + while( current ) + { + next = current->next; + PaUtil_FreeMemory( current->buffer ); + current = next; + } + + PaUtil_FreeMemory( group ); +} + + +void* PaUtil_GroupAllocateMemory( PaUtilAllocationGroup* group, long size ) +{ + struct PaUtilAllocationGroupLink *links, *link; + void *result = 0; + + /* allocate more links if necessary */ + if( !group->spareLinks ) + { + /* double the link count on each block allocation */ + links = AllocateLinks( group->linkCount, group->linkBlocks, group->spareLinks ); + if( links ) + { + group->linkCount += group->linkCount; + group->linkBlocks = &links[0]; + group->spareLinks = &links[1]; + } + } + + if( group->spareLinks ) + { + result = PaUtil_AllocateMemory( size ); + if( result ) + { + link = group->spareLinks; + group->spareLinks = link->next; + + link->buffer = result; + link->next = group->allocations; + + group->allocations = link; + } + } + + return result; +} + + +void PaUtil_GroupFreeMemory( PaUtilAllocationGroup* group, void *buffer ) +{ + struct PaUtilAllocationGroupLink *current = group->allocations; + struct PaUtilAllocationGroupLink *previous = 0; + + if( buffer == 0 ) + return; + + /* find the right link and remove it */ + while( current ) + { + if( current->buffer == buffer ) + { + if( previous ) + { + previous->next = current->next; + } + else + { + group->allocations = current->next; + } + + current->buffer = 0; + current->next = group->spareLinks; + group->spareLinks = current; + + break; + } + + previous = current; + current = current->next; + } + + PaUtil_FreeMemory( buffer ); /* free the memory whether we found it in the list or not */ +} + + +void PaUtil_FreeAllAllocations( PaUtilAllocationGroup* group ) +{ + struct PaUtilAllocationGroupLink *current = group->allocations; + struct PaUtilAllocationGroupLink *previous = 0; + + /* free all buffers in the allocations list */ + while( current ) + { + PaUtil_FreeMemory( current->buffer ); + current->buffer = 0; + + previous = current; + current = current->next; + } + + /* link the former allocations list onto the front of the spareLinks list */ + if( previous ) + { + previous->next = group->spareLinks; + group->spareLinks = group->allocations; + group->allocations = 0; + } +} + diff --git a/portaudio-v19/pa_common/pa_allocation.h b/portaudio-v19/pa_common/pa_allocation.h new file mode 100644 index 000000000..5bcfe75a6 --- /dev/null +++ b/portaudio-v19/pa_common/pa_allocation.h @@ -0,0 +1,95 @@ +#ifndef PA_ALLOCATION_H +#define PA_ALLOCATION_H +/* + * $Id$ + * Portable Audio I/O Library allocation context header + * memory allocation context for tracking allocation groups + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Allocation Group prototypes. An Allocation Group makes it easy to + allocate multiple blocks of memory and free them all simultanously. + + An allocation group is useful for keeping track of multiple blocks + of memory which are allocated at the same time (such as during initialization) + and need to be deallocated at the same time. The allocation group maintains + a list of allocated blocks, and can deallocate them all simultaneously which + can be usefull for cleaning up after a partially initialized object fails. + + The allocation group implementation is built on top of the lower + level allocation functions defined in pa_util.h +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +typedef struct +{ + long linkCount; + struct PaUtilAllocationGroupLink *linkBlocks; + struct PaUtilAllocationGroupLink *spareLinks; + struct PaUtilAllocationGroupLink *allocations; +}PaUtilAllocationGroup; + + + +/** Create an allocation group. +*/ +PaUtilAllocationGroup* PaUtil_CreateAllocationGroup( void ); + +/** Destroy an allocation group, but not the memory allocated through the group. +*/ +void PaUtil_DestroyAllocationGroup( PaUtilAllocationGroup* group ); + +/** Allocate a block of memory though an allocation group. +*/ +void* PaUtil_GroupAllocateMemory( PaUtilAllocationGroup* group, long size ); + +/** Free a block of memory that was previously allocated though an allocation + group. Calling this function is a relatively time consuming operation. + Under normal circumstances clients should call PaUtil_FreeAllAllocations to + free all allocated blocks simultaneously. + @see PaUtil_FreeAllAllocations +*/ +void PaUtil_GroupFreeMemory( PaUtilAllocationGroup* group, void *buffer ); + +/** Free all blocks of memory which have been allocated through the allocation + group. This function doesn't destroy the group itself. +*/ +void PaUtil_FreeAllAllocations( PaUtilAllocationGroup* group ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_ALLOCATION_H */ diff --git a/portaudio-v19/pa_common/pa_converters.c b/portaudio-v19/pa_common/pa_converters.c new file mode 100644 index 000000000..39f83e481 --- /dev/null +++ b/portaudio-v19/pa_common/pa_converters.c @@ -0,0 +1,1926 @@ +/* + * $Id$ + * Portable Audio I/O Library sample conversion mechanism + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Conversion functions implementations. + + If the C9x function lrintf() is available, define PA_USE_C99_LRINTF to use it + + @todo Consider whether functions which dither but don't clip should exist, + V18 automatically enabled clipping whenever dithering was selected. Perhaps + we should do the same. + + @todo implement the converters marked IMPLEMENT ME: Float32_To_UInt8_Dither, + Float32_To_UInt8_Clip, Float32_To_UInt8_DitherClip, Int32_To_Int24_Dither, + Int32_To_UInt8_Dither, Int24_To_Int16_Dither, Int24_To_Int8_Dither, + Int24_To_UInt8_Dither, Int16_To_Int8_Dither, Int16_To_UInt8_Dither, + + @todo review the converters marked REVIEW: Float32_To_Int32, + Float32_To_Int32_Dither, Float32_To_Int32_Clip, Float32_To_Int32_DitherClip, + Int32_To_Int16_Dither, Int32_To_Int8_Dither, Int16_To_Int32 +*/ + + +#include "pa_converters.h" +#include "pa_dither.h" +#include "pa_endianness.h" +#include "pa_types.h" + + +PaSampleFormat PaUtil_SelectClosestAvailableFormat( + PaSampleFormat availableFormats, PaSampleFormat format ) +{ + PaSampleFormat result; + + format &= ~paNonInterleaved; + availableFormats &= ~paNonInterleaved; + + if( (format & availableFormats) == 0 ) + { + /* NOTE: this code depends on the sample format constants being in + descending order of quality - ie best quality is 0 + FIXME: should write an assert which checks that all of the + known constants conform to that requirement. + */ + + if( format != 0x01 ) + { + /* scan for better formats */ + result = format; + do + { + result >>= 1; + } + while( (result & availableFormats) == 0 && result != 0 ); + } + else + { + result = 0; + } + + if( result == 0 ){ + /* scan for worse formats */ + result = format; + do + { + result <<= 1; + } + while( (result & availableFormats) == 0 && result != paCustomFormat ); + + if( (result & availableFormats) == 0 ) + result = paSampleFormatNotSupported; + } + + }else{ + result = format; + } + + return result; +} + +/* -------------------------------------------------------------------------- */ + +#define PA_SELECT_FORMAT_( format, float32, int32, int24, int16, int8, uint8 ) \ + switch( format & ~paNonInterleaved ){ \ + case paFloat32: \ + float32 \ + case paInt32: \ + int32 \ + case paInt24: \ + int24 \ + case paInt16: \ + int16 \ + case paInt8: \ + int8 \ + case paUInt8: \ + uint8 \ + default: return 0; \ + } + +/* -------------------------------------------------------------------------- */ + +#define PA_SELECT_CONVERTER_DITHER_CLIP_( flags, source, destination ) \ + if( flags & paClipOff ){ /* no clip */ \ + if( flags & paDitherOff ){ /* no dither */ \ + return paConverters. source ## _To_ ## destination; \ + }else{ /* dither */ \ + return paConverters. source ## _To_ ## destination ## _Dither; \ + } \ + }else{ /* clip */ \ + if( flags & paDitherOff ){ /* no dither */ \ + return paConverters. source ## _To_ ## destination ## _Clip; \ + }else{ /* dither */ \ + return paConverters. source ## _To_ ## destination ## _DitherClip; \ + } \ + } + +/* -------------------------------------------------------------------------- */ + +#define PA_SELECT_CONVERTER_DITHER_( flags, source, destination ) \ + if( flags & paDitherOff ){ /* no dither */ \ + return paConverters. source ## _To_ ## destination; \ + }else{ /* dither */ \ + return paConverters. source ## _To_ ## destination ## _Dither; \ + } + +/* -------------------------------------------------------------------------- */ + +#define PA_USE_CONVERTER_( source, destination )\ + return paConverters. source ## _To_ ## destination; + +/* -------------------------------------------------------------------------- */ + +#define PA_UNITY_CONVERSION_( wordlength )\ + return paConverters. Copy_ ## wordlength ## _To_ ## wordlength; + +/* -------------------------------------------------------------------------- */ + +PaUtilConverter* PaUtil_SelectConverter( PaSampleFormat sourceFormat, + PaSampleFormat destinationFormat, PaStreamFlags flags ) +{ + PA_SELECT_FORMAT_( sourceFormat, + /* paFloat32: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_UNITY_CONVERSION_( 32 ), + /* paInt32: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int32 ), + /* paInt24: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int24 ), + /* paInt16: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int16 ), + /* paInt8: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int8 ), + /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, UInt8 ) + ), + /* paInt32: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( Int32, Float32 ), + /* paInt32: */ PA_UNITY_CONVERSION_( 32 ), + /* paInt24: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, Int24 ), + /* paInt16: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, Int16 ), + /* paInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, Int8 ), + /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, UInt8 ) + ), + /* paInt24: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( Int24, Float32 ), + /* paInt32: */ PA_USE_CONVERTER_( Int24, Int32 ), + /* paInt24: */ PA_UNITY_CONVERSION_( 24 ), + /* paInt16: */ PA_SELECT_CONVERTER_DITHER_( flags, Int24, Int16 ), + /* paInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int24, Int8 ), + /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int24, UInt8 ) + ), + /* paInt16: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( Int16, Float32 ), + /* paInt32: */ PA_USE_CONVERTER_( Int16, Int32 ), + /* paInt24: */ PA_USE_CONVERTER_( Int16, Int24 ), + /* paInt16: */ PA_UNITY_CONVERSION_( 16 ), + /* paInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int16, Int8 ), + /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int16, UInt8 ) + ), + /* paInt8: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( Int8, Float32 ), + /* paInt32: */ PA_USE_CONVERTER_( Int8, Int32 ), + /* paInt24: */ PA_USE_CONVERTER_( Int8, Int24 ), + /* paInt16: */ PA_USE_CONVERTER_( Int8, Int16 ), + /* paInt8: */ PA_UNITY_CONVERSION_( 8 ), + /* paUInt8: */ PA_USE_CONVERTER_( Int8, UInt8 ) + ), + /* paUInt8: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( UInt8, Float32 ), + /* paInt32: */ PA_USE_CONVERTER_( UInt8, Int32 ), + /* paInt24: */ PA_USE_CONVERTER_( UInt8, Int24 ), + /* paInt16: */ PA_USE_CONVERTER_( UInt8, Int16 ), + /* paInt8: */ PA_USE_CONVERTER_( UInt8, Int8 ), + /* paUInt8: */ PA_UNITY_CONVERSION_( 8 ) + ) + ) +} + +/* -------------------------------------------------------------------------- */ + +#ifdef PA_NO_STANDARD_CONVERTERS + +/* -------------------------------------------------------------------------- */ + +PaUtilConverterTable paConverters = { + 0, /* PaUtilConverter *Float32_To_Int32; */ + 0, /* PaUtilConverter *Float32_To_Int32_Dither; */ + 0, /* PaUtilConverter *Float32_To_Int32_Clip; */ + 0, /* PaUtilConverter *Float32_To_Int32_DitherClip; */ + + 0, /* PaUtilConverter *Float32_To_Int24; */ + 0, /* PaUtilConverter *Float32_To_Int24_Dither; */ + 0, /* PaUtilConverter *Float32_To_Int24_Clip; */ + 0, /* PaUtilConverter *Float32_To_Int24_DitherClip; */ + + 0, /* PaUtilConverter *Float32_To_Int16; */ + 0, /* PaUtilConverter *Float32_To_Int16_Dither; */ + 0, /* PaUtilConverter *Float32_To_Int16_Clip; */ + 0, /* PaUtilConverter *Float32_To_Int16_DitherClip; */ + + 0, /* PaUtilConverter *Float32_To_Int8; */ + 0, /* PaUtilConverter *Float32_To_Int8_Dither; */ + 0, /* PaUtilConverter *Float32_To_Int8_Clip; */ + 0, /* PaUtilConverter *Float32_To_Int8_DitherClip; */ + + 0, /* PaUtilConverter *Float32_To_UInt8; */ + 0, /* PaUtilConverter *Float32_To_UInt8_Dither; */ + 0, /* PaUtilConverter *Float32_To_UInt8_Clip; */ + 0, /* PaUtilConverter *Float32_To_UInt8_DitherClip; */ + + 0, /* PaUtilConverter *Int32_To_Float32; */ + 0, /* PaUtilConverter *Int32_To_Int24; */ + 0, /* PaUtilConverter *Int32_To_Int24_Dither; */ + 0, /* PaUtilConverter *Int32_To_Int16; */ + 0, /* PaUtilConverter *Int32_To_Int16_Dither; */ + 0, /* PaUtilConverter *Int32_To_Int8; */ + 0, /* PaUtilConverter *Int32_To_Int8_Dither; */ + 0, /* PaUtilConverter *Int32_To_UInt8; */ + 0, /* PaUtilConverter *Int32_To_UInt8_Dither; */ + + 0, /* PaUtilConverter *Int24_To_Float32; */ + 0, /* PaUtilConverter *Int24_To_Int32; */ + 0, /* PaUtilConverter *Int24_To_Int16; */ + 0, /* PaUtilConverter *Int24_To_Int16_Dither; */ + 0, /* PaUtilConverter *Int24_To_Int8; */ + 0, /* PaUtilConverter *Int24_To_Int8_Dither; */ + 0, /* PaUtilConverter *Int24_To_UInt8; */ + 0, /* PaUtilConverter *Int24_To_UInt8_Dither; */ + + 0, /* PaUtilConverter *Int16_To_Float32; */ + 0, /* PaUtilConverter *Int16_To_Int32; */ + 0, /* PaUtilConverter *Int16_To_Int24; */ + 0, /* PaUtilConverter *Int16_To_Int8; */ + 0, /* PaUtilConverter *Int16_To_Int8_Dither; */ + 0, /* PaUtilConverter *Int16_To_UInt8; */ + 0, /* PaUtilConverter *Int16_To_UInt8_Dither; */ + + 0, /* PaUtilConverter *Int8_To_Float32; */ + 0, /* PaUtilConverter *Int8_To_Int32; */ + 0, /* PaUtilConverter *Int8_To_Int24 */ + 0, /* PaUtilConverter *Int8_To_Int16; */ + 0, /* PaUtilConverter *Int8_To_UInt8; */ + + 0, /* PaUtilConverter *UInt8_To_Float32; */ + 0, /* PaUtilConverter *UInt8_To_Int32; */ + 0, /* PaUtilConverter *UInt8_To_Int24; */ + 0, /* PaUtilConverter *UInt8_To_Int16; */ + 0, /* PaUtilConverter *UInt8_To_Int8; */ + + 0, /* PaUtilConverter *Copy_8_To_8; */ + 0, /* PaUtilConverter *Copy_16_To_16; */ + 0, /* PaUtilConverter *Copy_24_To_24; */ + 0 /* PaUtilConverter *Copy_32_To_32; */ +}; + +/* -------------------------------------------------------------------------- */ + +#else /* PA_NO_STANDARD_CONVERTERS is not defined */ + +/* -------------------------------------------------------------------------- */ + +#define PA_CLIP_( val, min, max )\ + { val = ((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val)); } + + +static const float const_1_div_128_ = 1.0f / 128.0f; /* 8 bit multiplier */ + +static const float const_1_div_32768_ = 1.0f / 32768.f; /* 16 bit multiplier */ + +static const double const_1_div_2147483648_ = 1.0 / 2147483648.0; /* 32 bit multiplier */ + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* REVIEW */ +#ifdef PA_USE_C99_LRINTF + float scaled = *src * 0x7FFFFFFF; + *dest = lrintf(scaled-0.5f); +#else + double scaled = *src * 0x7FFFFFFF; + *dest = (PaInt32) scaled; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + + while( count-- ) + { + /* REVIEW */ +#ifdef PA_USE_C99_LRINTF + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = ((float)*src * (2147483646.0f)) + dither; + *dest = lrintf(dithered - 0.5f); +#else + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + double dithered = ((double)*src * (2147483646.0)) + dither; + *dest = (PaInt32) dithered; +#endif + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* REVIEW */ +#ifdef PA_USE_C99_LRINTF + float scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648.f, 2147483647.f ); + *dest = lrintf(scaled-0.5f); +#else + double scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648., 2147483647. ); + *dest = (PaInt32) scaled; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + + while( count-- ) + { + /* REVIEW */ +#ifdef PA_USE_C99_LRINTF + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = ((float)*src * (2147483646.0f)) + dither; + PA_CLIP_( dithered, -2147483648.f, 2147483647.f ); + *dest = lrintf(dithered-0.5f); +#else + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + double dithered = ((double)*src * (2147483646.0)) + dither; + PA_CLIP_( dithered, -2147483648., 2147483647. ); + *dest = (PaInt32) dithered; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt32 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* convert to 32 bit and drop the low 8 bits */ + double scaled = *src * 0x7FFFFFFF; + temp = (PaInt32) scaled; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 24); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 8); +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt32 temp; + + while( count-- ) + { + /* convert to 32 bit and drop the low 8 bits */ + + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + double dithered = ((double)*src * (2147483646.0)) + dither; + + temp = (PaInt32) dithered; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 24); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 8); +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt32 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* convert to 32 bit and drop the low 8 bits */ + double scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648., 2147483647. ); + temp = (PaInt32) scaled; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 24); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 8); +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt32 temp; + + while( count-- ) + { + /* convert to 32 bit and drop the low 8 bits */ + + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + double dithered = ((double)*src * (2147483646.0)) + dither; + PA_CLIP_( dithered, -2147483648., 2147483647. ); + + temp = (PaInt32) dithered; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 24); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 8); +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { +#ifdef PA_USE_C99_LRINTF + float tempf = (*src * (32767.0f)) ; + *dest = lrintf(tempf-0.5f); +#else + short samp = (short) (*src * (32767.0f)); + *dest = samp; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + + while( count-- ) + { + + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = (*src * (32766.0f)) + dither; + +#ifdef PA_USE_C99_LRINTF + *dest = lrintf(dithered-0.5f); +#else + *dest = (PaInt16) dithered; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { +#ifdef PA_USE_C99_LRINTF + long samp = lrintf((*src * (32767.0f)) -0.5f); +#else + long samp = (PaInt32) (*src * (32767.0f)); +#endif + PA_CLIP_( samp, -0x8000, 0x7FFF ); + *dest = (PaInt16) samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = (*src * (32766.0f)) + dither; + PaInt32 samp = (PaInt32) dithered; + PA_CLIP_( samp, -0x8000, 0x7FFF ); +#ifdef PA_USE_C99_LRINTF + *dest = lrintf(samp-0.5f); +#else + *dest = (PaInt16) samp; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + signed char samp = (signed char) (*src * (127.0f)); + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = (*src * (126.0f)) + dither; + PaInt32 samp = (PaInt32) dithered; + *dest = (signed char) samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int8_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + PaInt32 samp = (PaInt32)(*src * (127.0f)); + PA_CLIP_( samp, -0x80, 0x7F ); + *dest = (signed char) samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int8_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = (*src * (126.0f)) + dither; + PaInt32 samp = (PaInt32) dithered; + PA_CLIP_( samp, -0x80, 0x7F ); + *dest = (signed char) samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + unsigned char samp = (unsigned char)(128 + ((unsigned char) (*src * (127.0f)))); + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_UInt8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_UInt8_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_UInt8_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + float *dest = (float*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = (float) ((double)*src * const_1_div_2147483648_); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* REVIEW */ +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(*src >> 8); + dest[1] = (unsigned char)(*src >> 16); + dest[2] = (unsigned char)(*src >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(*src >> 24); + dest[1] = (unsigned char)(*src >> 16); + dest[2] = (unsigned char)(*src >> 8); +#endif + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int24_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + (void) destinationBuffer; /* unused parameters */ + (void) destinationStride; /* unused parameters */ + (void) sourceBuffer; /* unused parameters */ + (void) sourceStride; /* unused parameters */ + (void) count; /* unused parameters */ + (void) ditherGenerator; /* unused parameters */ + /* IMPLEMENT ME */ +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = (PaInt16) ((*src) >> 16); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int16_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + PaInt32 dither; + + while( count-- ) + { + /* REVIEW */ + dither = PaUtil_Generate16BitTriangularDither( ditherGenerator ); + *dest = (PaInt16) ((((*src)>>1) + dither) >> 15); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = (signed char) ((*src) >> 24); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + PaInt32 dither; + + while( count-- ) + { + /* REVIEW */ + dither = PaUtil_Generate16BitTriangularDither( ditherGenerator ); + *dest = (signed char) ((((*src)>>1) + dither) >> 23); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (unsigned char)(((*src) >> 24) + 128); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_UInt8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + float *dest = (float*)destinationBuffer; + PaInt32 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + temp = (((long)src[0]) << 8); + temp = temp | (((long)src[1]) << 16); + temp = temp | (((long)src[2]) << 24); +#elif defined(PA_BIG_ENDIAN) + temp = (((long)src[0]) << 24); + temp = temp | (((long)src[1]) << 16); + temp = temp | (((long)src[2]) << 8); +#endif + + *dest = (float) ((double)temp * const_1_div_2147483648_); + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + PaInt32 *dest = (PaInt32*) destinationBuffer; + PaInt32 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + temp = (((long)src[0]) << 8); + temp = temp | (((long)src[1]) << 16); + temp = temp | (((long)src[2]) << 24); +#elif defined(PA_BIG_ENDIAN) + temp = (((long)src[0]) << 24); + temp = temp | (((long)src[1]) << 16); + temp = temp | (((long)src[2]) << 8); +#endif + + *dest = temp; + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + + PaInt16 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + /* src[0] is discarded */ + temp = (((PaInt16)src[1])); + temp = temp | (PaInt16)(((PaInt16)src[2]) << 8); +#elif defined(PA_BIG_ENDIAN) + /* src[2] is discarded */ + temp = (PaInt16)(((PaInt16)src[0]) << 8); + temp = temp | (((PaInt16)src[1])); +#endif + + *dest = temp; + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int16_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + (void) destinationBuffer; /* unused parameters */ + (void) destinationStride; /* unused parameters */ + (void) sourceBuffer; /* unused parameters */ + (void) sourceStride; /* unused parameters */ + (void) count; /* unused parameters */ + (void) ditherGenerator; /* unused parameters */ + /* IMPLEMENT ME */ +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + /* src[0] is discarded */ + /* src[1] is discarded */ + *dest = src[2]; +#elif defined(PA_BIG_ENDIAN) + /* src[2] is discarded */ + /* src[1] is discarded */ + *dest = src[0]; +#endif + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + (void) destinationBuffer; /* unused parameters */ + (void) destinationStride; /* unused parameters */ + (void) sourceBuffer; /* unused parameters */ + (void) sourceStride; /* unused parameters */ + (void) count; /* unused parameters */ + (void) ditherGenerator; /* unused parameters */ + /* IMPLEMENT ME */ +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + /* src[0] is discarded */ + /* src[1] is discarded */ + *dest = (unsigned char)(src[2] + 128); +#elif defined(PA_BIG_ENDIAN) + *dest = (unsigned char)(src[0] + 128); + /* src[1] is discarded */ + /* src[2] is discarded */ +#endif + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_UInt8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + (void) destinationBuffer; /* unused parameters */ + (void) destinationStride; /* unused parameters */ + (void) sourceBuffer; /* unused parameters */ + (void) sourceStride; /* unused parameters */ + (void) count; /* unused parameters */ + (void) ditherGenerator; /* unused parameters */ + /* IMPLEMENT ME */ +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + float *dest = (float*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float samp = *src * const_1_div_32768_; /* FIXME: i'm concerned about this being asymetrical with float->int16 -rb */ + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* REVIEW: we should consider something like + (*src << 16) | (*src & 0xFFFF) + */ + + *dest = *src << 16; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*) sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt16 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + temp = *src; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = 0; + dest[1] = (unsigned char)(temp); + dest[2] = (unsigned char)(temp >> 8); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp); + dest[2] = 0; +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (signed char)((*src) >> 8); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Int8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (unsigned char)(((*src) >> 8) + 128); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_UInt8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + float *dest = (float*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float samp = *src * const_1_div_128_; + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (*src) << 24; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = 0; + dest[1] = 0; + dest[2] = (*src); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (*src); + dest[1] = 0; + dest[2] = 0; +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (PaInt16)((*src) << 8); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (unsigned char)(*src + 128); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + float *dest = (float*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float samp = (*src - 128) * const_1_div_128_; + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (*src - 128) << 24; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void) ditherGenerator; /* unused parameters */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = 0; + dest[1] = 0; + dest[2] = (unsigned char)(*src - 128); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(*src - 128); + dest[1] = 0; + dest[2] = 0; +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (PaInt16)((*src - 128) << 8); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (signed char)(*src - 128); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Copy_8_To_8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = *src; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Copy_16_To_16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaUint16 *src = (PaUint16 *)sourceBuffer; + PaUint16 *dest = (PaUint16 *)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = *src; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Copy_24_To_24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + + src += sourceStride * 3; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Copy_32_To_32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaUint32 *dest = (PaUint32 *)destinationBuffer; + PaUint32 *src = (PaUint32 *)sourceBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = *src; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +PaUtilConverterTable paConverters = { + Float32_To_Int32, /* PaUtilConverter *Float32_To_Int32; */ + Float32_To_Int32_Dither, /* PaUtilConverter *Float32_To_Int32_Dither; */ + Float32_To_Int32_Clip, /* PaUtilConverter *Float32_To_Int32_Clip; */ + Float32_To_Int32_DitherClip, /* PaUtilConverter *Float32_To_Int32_DitherClip; */ + + Float32_To_Int24, /* PaUtilConverter *Float32_To_Int24; */ + Float32_To_Int24_Dither, /* PaUtilConverter *Float32_To_Int24_Dither; */ + Float32_To_Int24_Clip, /* PaUtilConverter *Float32_To_Int24_Clip; */ + Float32_To_Int24_DitherClip, /* PaUtilConverter *Float32_To_Int24_DitherClip; */ + + Float32_To_Int16, /* PaUtilConverter *Float32_To_Int16; */ + Float32_To_Int16_Dither, /* PaUtilConverter *Float32_To_Int16_Dither; */ + Float32_To_Int16_Clip, /* PaUtilConverter *Float32_To_Int16_Clip; */ + Float32_To_Int16_DitherClip, /* PaUtilConverter *Float32_To_Int16_DitherClip; */ + + Float32_To_Int8, /* PaUtilConverter *Float32_To_Int8; */ + Float32_To_Int8_Dither, /* PaUtilConverter *Float32_To_Int8_Dither; */ + Float32_To_Int8_Clip, /* PaUtilConverter *Float32_To_Int8_Clip; */ + Float32_To_Int8_DitherClip, /* PaUtilConverter *Float32_To_Int8_DitherClip; */ + + Float32_To_UInt8, /* PaUtilConverter *Float32_To_UInt8; */ + Float32_To_UInt8_Dither, /* PaUtilConverter *Float32_To_UInt8_Dither; */ + Float32_To_UInt8_Clip, /* PaUtilConverter *Float32_To_UInt8_Clip; */ + Float32_To_UInt8_DitherClip, /* PaUtilConverter *Float32_To_UInt8_DitherClip; */ + + Int32_To_Float32, /* PaUtilConverter *Int32_To_Float32; */ + Int32_To_Int24, /* PaUtilConverter *Int32_To_Int24; */ + Int32_To_Int24_Dither, /* PaUtilConverter *Int32_To_Int24_Dither; */ + Int32_To_Int16, /* PaUtilConverter *Int32_To_Int16; */ + Int32_To_Int16_Dither, /* PaUtilConverter *Int32_To_Int16_Dither; */ + Int32_To_Int8, /* PaUtilConverter *Int32_To_Int8; */ + Int32_To_Int8_Dither, /* PaUtilConverter *Int32_To_Int8_Dither; */ + Int32_To_UInt8, /* PaUtilConverter *Int32_To_UInt8; */ + Int32_To_UInt8_Dither, /* PaUtilConverter *Int32_To_UInt8_Dither; */ + + Int24_To_Float32, /* PaUtilConverter *Int24_To_Float32; */ + Int24_To_Int32, /* PaUtilConverter *Int24_To_Int32; */ + Int24_To_Int16, /* PaUtilConverter *Int24_To_Int16; */ + Int24_To_Int16_Dither, /* PaUtilConverter *Int24_To_Int16_Dither; */ + Int24_To_Int8, /* PaUtilConverter *Int24_To_Int8; */ + Int24_To_Int8_Dither, /* PaUtilConverter *Int24_To_Int8_Dither; */ + Int24_To_UInt8, /* PaUtilConverter *Int24_To_UInt8; */ + Int24_To_UInt8_Dither, /* PaUtilConverter *Int24_To_UInt8_Dither; */ + + Int16_To_Float32, /* PaUtilConverter *Int16_To_Float32; */ + Int16_To_Int32, /* PaUtilConverter *Int16_To_Int32; */ + Int16_To_Int24, /* PaUtilConverter *Int16_To_Int24; */ + Int16_To_Int8, /* PaUtilConverter *Int16_To_Int8; */ + Int16_To_Int8_Dither, /* PaUtilConverter *Int16_To_Int8_Dither; */ + Int16_To_UInt8, /* PaUtilConverter *Int16_To_UInt8; */ + Int16_To_UInt8_Dither, /* PaUtilConverter *Int16_To_UInt8_Dither; */ + + Int8_To_Float32, /* PaUtilConverter *Int8_To_Float32; */ + Int8_To_Int32, /* PaUtilConverter *Int8_To_Int32; */ + Int8_To_Int24, /* PaUtilConverter *Int8_To_Int24 */ + Int8_To_Int16, /* PaUtilConverter *Int8_To_Int16; */ + Int8_To_UInt8, /* PaUtilConverter *Int8_To_UInt8; */ + + UInt8_To_Float32, /* PaUtilConverter *UInt8_To_Float32; */ + UInt8_To_Int32, /* PaUtilConverter *UInt8_To_Int32; */ + UInt8_To_Int24, /* PaUtilConverter *UInt8_To_Int24; */ + UInt8_To_Int16, /* PaUtilConverter *UInt8_To_Int16; */ + UInt8_To_Int8, /* PaUtilConverter *UInt8_To_Int8; */ + + Copy_8_To_8, /* PaUtilConverter *Copy_8_To_8; */ + Copy_16_To_16, /* PaUtilConverter *Copy_16_To_16; */ + Copy_24_To_24, /* PaUtilConverter *Copy_24_To_24; */ + Copy_32_To_32 /* PaUtilConverter *Copy_32_To_32; */ +}; + +/* -------------------------------------------------------------------------- */ + +#endif /* PA_NO_STANDARD_CONVERTERS */ + +/* -------------------------------------------------------------------------- */ + +PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat ) +{ + switch( destinationFormat & ~paNonInterleaved ){ + case paFloat32: + return paZeroers.Zero32; + case paInt32: + return paZeroers.Zero32; + case paInt24: + return paZeroers.Zero24; + case paInt16: + return paZeroers.Zero16; + case paInt8: + return paZeroers.Zero8; + case paUInt8: + return paZeroers.ZeroU8; + default: return 0; + } +} + +/* -------------------------------------------------------------------------- */ + +#ifdef PA_NO_STANDARD_ZEROERS + +/* -------------------------------------------------------------------------- */ + +PaUtilZeroerTable paZeroers = { + 0, /* PaUtilZeroer *ZeroU8; */ + 0, /* PaUtilZeroer *Zero8; */ + 0, /* PaUtilZeroer *Zero16; */ + 0, /* PaUtilZeroer *Zero24; */ + 0, /* PaUtilZeroer *Zero32; */ +}; + +/* -------------------------------------------------------------------------- */ + +#else /* PA_NO_STANDARD_ZEROERS is not defined */ + +/* -------------------------------------------------------------------------- */ + +static void ZeroU8( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + unsigned char *dest = (unsigned char*)destinationBuffer; + + while( count-- ) + { + *dest = 128; + + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Zero8( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + unsigned char *dest = (unsigned char*)destinationBuffer; + + while( count-- ) + { + *dest = 0; + + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Zero16( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + PaUint16 *dest = (PaUint16 *)destinationBuffer; + + while( count-- ) + { + *dest = 0; + + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Zero24( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + unsigned char *dest = (unsigned char*)destinationBuffer; + + while( count-- ) + { + dest[0] = 0; + dest[1] = 0; + dest[2] = 0; + + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Zero32( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + PaUint32 *dest = (PaUint32 *)destinationBuffer; + + while( count-- ) + { + *dest = 0; + + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +PaUtilZeroerTable paZeroers = { + ZeroU8, /* PaUtilZeroer *ZeroU8; */ + Zero8, /* PaUtilZeroer *Zero8; */ + Zero16, /* PaUtilZeroer *Zero16; */ + Zero24, /* PaUtilZeroer *Zero24; */ + Zero32, /* PaUtilZeroer *Zero32; */ +}; + +/* -------------------------------------------------------------------------- */ + +#endif /* PA_NO_STANDARD_ZEROERS */ diff --git a/portaudio-v19/pa_common/pa_converters.h b/portaudio-v19/pa_common/pa_converters.h new file mode 100644 index 000000000..1d83c990b --- /dev/null +++ b/portaudio-v19/pa_common/pa_converters.h @@ -0,0 +1,254 @@ +#ifndef PA_CONVERTERS_H +#define PA_CONVERTERS_H +/* + * $Id$ + * Portable Audio I/O Library sample conversion mechanism + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Conversion functions used to convert buffers of samples from one + format to another. +*/ + + +#include "portaudio.h" /* for PaSampleFormat */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +struct PaUtilTriangularDitherGenerator; + + +/** Choose an available sample format which is most appropriate for + representing the requested format. If the requested format is not available + higher quality formats are considered before lower quality formates. + @param availableFormats A variable containing the logical OR of all available + formats. + @param format The desired format. + @return The most appropriate available format for representing the requested + format. +*/ +PaSampleFormat PaUtil_SelectClosestAvailableFormat( + PaSampleFormat availableFormats, PaSampleFormat format ); + + +/* high level conversions functions for use by implementations */ + + +/** The generic sample converter prototype. Sample converters convert count + samples from sourceBuffer to destinationBuffer. The actual type of the data + pointed to by these parameters varys for different converter functions. + @param destinationBuffer A pointer to the first sample of the destination. + @param destinationStride An offset between successive destination samples + expressed in samples (not bytes.) It may be negative. + @param sourceBuffer A pointer to the first sample of the source. + @param sourceStride An offset between successive source samples + expressed in samples (not bytes.) It may be negative. + @param count The number of samples to convert. + @param ditherState State information used to calculate dither. Converters + that do not perform dithering will ignore this parameter, in which case + NULL or invalid dither state may be passed. +*/ +typedef void PaUtilConverter( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ); + + +/** Find a sample converter function for the given source and destinations + formats and flags (clip and dither.) + @return + A pointer to a PaUtilConverter which will perform the requested + conversion, or NULL if the given format conversion is not supported. + For conversions where clipping or dithering is not necessary, the + clip and dither flags are ignored and a non-clipping or dithering + version is returned. + If the source and destination formats are the same, a function which + copies data of the appropriate size will be returned. +*/ +PaUtilConverter* PaUtil_SelectConverter( PaSampleFormat sourceFormat, + PaSampleFormat destinationFormat, PaStreamFlags flags ); + + +/** The generic buffer zeroer prototype. Buffer zeroers copy count zeros to + destinationBuffer. The actual type of the data pointed to varys for + different zeroer functions. + @param destinationBuffer A pointer to the first sample of the destination. + @param destinationStride An offset between successive destination samples + expressed in samples (not bytes.) It may be negative. + @param count The number of samples to zero. +*/ +typedef void PaUtilZeroer( + void *destinationBuffer, signed int destinationStride, unsigned int count ); + + +/** Find a buffer zeroer function for the given destination format. + @return + A pointer to a PaUtilZeroer which will perform the requested + zeroing. +*/ +PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat ); + +/*----------------------------------------------------------------------------*/ +/* low level functions and data structures which may be used for + substituting conversion functions */ + + +/** The type used to store all sample conversion functions. + @see paConverters; +*/ +typedef struct{ + PaUtilConverter *Float32_To_Int32; + PaUtilConverter *Float32_To_Int32_Dither; + PaUtilConverter *Float32_To_Int32_Clip; + PaUtilConverter *Float32_To_Int32_DitherClip; + + PaUtilConverter *Float32_To_Int24; + PaUtilConverter *Float32_To_Int24_Dither; + PaUtilConverter *Float32_To_Int24_Clip; + PaUtilConverter *Float32_To_Int24_DitherClip; + + PaUtilConverter *Float32_To_Int16; + PaUtilConverter *Float32_To_Int16_Dither; + PaUtilConverter *Float32_To_Int16_Clip; + PaUtilConverter *Float32_To_Int16_DitherClip; + + PaUtilConverter *Float32_To_Int8; + PaUtilConverter *Float32_To_Int8_Dither; + PaUtilConverter *Float32_To_Int8_Clip; + PaUtilConverter *Float32_To_Int8_DitherClip; + + PaUtilConverter *Float32_To_UInt8; + PaUtilConverter *Float32_To_UInt8_Dither; + PaUtilConverter *Float32_To_UInt8_Clip; + PaUtilConverter *Float32_To_UInt8_DitherClip; + + PaUtilConverter *Int32_To_Float32; + PaUtilConverter *Int32_To_Int24; + PaUtilConverter *Int32_To_Int24_Dither; + PaUtilConverter *Int32_To_Int16; + PaUtilConverter *Int32_To_Int16_Dither; + PaUtilConverter *Int32_To_Int8; + PaUtilConverter *Int32_To_Int8_Dither; + PaUtilConverter *Int32_To_UInt8; + PaUtilConverter *Int32_To_UInt8_Dither; + + PaUtilConverter *Int24_To_Float32; + PaUtilConverter *Int24_To_Int32; + PaUtilConverter *Int24_To_Int16; + PaUtilConverter *Int24_To_Int16_Dither; + PaUtilConverter *Int24_To_Int8; + PaUtilConverter *Int24_To_Int8_Dither; + PaUtilConverter *Int24_To_UInt8; + PaUtilConverter *Int24_To_UInt8_Dither; + + PaUtilConverter *Int16_To_Float32; + PaUtilConverter *Int16_To_Int32; + PaUtilConverter *Int16_To_Int24; + PaUtilConverter *Int16_To_Int8; + PaUtilConverter *Int16_To_Int8_Dither; + PaUtilConverter *Int16_To_UInt8; + PaUtilConverter *Int16_To_UInt8_Dither; + + PaUtilConverter *Int8_To_Float32; + PaUtilConverter *Int8_To_Int32; + PaUtilConverter *Int8_To_Int24; + PaUtilConverter *Int8_To_Int16; + PaUtilConverter *Int8_To_UInt8; + + PaUtilConverter *UInt8_To_Float32; + PaUtilConverter *UInt8_To_Int32; + PaUtilConverter *UInt8_To_Int24; + PaUtilConverter *UInt8_To_Int16; + PaUtilConverter *UInt8_To_Int8; + + PaUtilConverter *Copy_8_To_8; /* copy without any conversion */ + PaUtilConverter *Copy_16_To_16; /* copy without any conversion */ + PaUtilConverter *Copy_24_To_24; /* copy without any conversion */ + PaUtilConverter *Copy_32_To_32; /* copy without any conversion */ +} PaUtilConverterTable; + + +/** A table of pointers to all required converter functions. + PaUtil_SelectConverter() uses this table to lookup the appropriate + conversion functions. The fields of this structure are initialized + with default conversion functions. Fields may be NULL, indicating that + no conversion function is available. User code may substitue optimised + conversion functions by assigning different function pointers to + these fields. + + @note + If the PA_NO_STANDARD_CONVERTERS preprocessor variable is defined, + PortAudio's standard converters will not be compiled, and all fields + of this structure will be initialized to NULL. In such cases, users + should supply their own conversion functions if the require PortAudio + to open a stream that requires sample conversion. + + @see PaUtilConverterTable, PaUtilConverter, PaUtil_SelectConverter +*/ +extern PaUtilConverterTable paConverters; + + +/** The type used to store all buffer zeroing functions. + @see paZeroers; +*/ +typedef struct{ + PaUtilZeroer *ZeroU8; /* unsigned 8 bit, zero == 128 */ + PaUtilZeroer *Zero8; + PaUtilZeroer *Zero16; + PaUtilZeroer *Zero24; + PaUtilZeroer *Zero32; +} PaUtilZeroerTable; + + +/** A table of pointers to all required zeroer functions. + PaUtil_SelectZeroer() uses this table to lookup the appropriate + conversion functions. The fields of this structure are initialized + with default conversion functions. User code may substitue optimised + conversion functions by assigning different function pointers to + these fields. + + @note + If the PA_NO_STANDARD_ZEROERS preprocessor variable is defined, + PortAudio's standard zeroers will not be compiled, and all fields + of this structure will be initialized to NULL. In such cases, users + should supply their own zeroing functions for the sample sizes which + they intend to use. + + @see PaUtilZeroerTable, PaUtilZeroer, PaUtil_SelectZeroer +*/ +extern PaUtilZeroerTable paZeroers; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_CONVERTERS_H */ diff --git a/portaudio-v19/pa_common/pa_cpuload.c b/portaudio-v19/pa_common/pa_cpuload.c new file mode 100644 index 000000000..ee2147dc3 --- /dev/null +++ b/portaudio-v19/pa_common/pa_cpuload.c @@ -0,0 +1,96 @@ +/* + * $Id$ + * Portable Audio I/O Library CPU Load measurement functions + * Portable CPU load measurement facility. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 2002 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Functions to assist in measuring the CPU utilization of a callback + stream. Used to implement the Pa_GetStreamCpuLoad() function. + + @todo Dynamically calculate the coefficients used to smooth the CPU Load + Measurements over time to provide a uniform characterisation of CPU Load + independent of rate at which PaUtil_BeginCpuLoadMeasurement / + PaUtil_EndCpuLoadMeasurement are called. +*/ + + +#include "pa_cpuload.h" + +#include + +#include "pa_util.h" /* for PaUtil_GetTime() */ + + +void PaUtil_InitializeCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer, double sampleRate ) +{ + assert( sampleRate > 0 ); + + measurer->samplingPeriod = 1. / sampleRate; + measurer->averageLoad = 0.; +} + +void PaUtil_ResetCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer ) +{ + measurer->averageLoad = 0.; +} + +void PaUtil_BeginCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer ) +{ + measurer->measurementStartTime = PaUtil_GetTime(); +} + + +void PaUtil_EndCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer, unsigned long framesProcessed ) +{ + double measurementEndTime, secondsFor100Percent, measuredLoad; + + if( framesProcessed > 0 ){ + measurementEndTime = PaUtil_GetTime(); + + assert( framesProcessed > 0 ); + secondsFor100Percent = framesProcessed * measurer->samplingPeriod; + + measuredLoad = (measurementEndTime - measurer->measurementStartTime) / secondsFor100Percent; + + /* Low pass filter the calculated CPU load to reduce jitter using a simple IIR low pass filter. */ + /** FIXME @todo these coefficients shouldn't be hardwired */ +#define LOWPASS_COEFFICIENT_0 (0.9) +#define LOWPASS_COEFFICIENT_1 (0.99999 - LOWPASS_COEFFICIENT_0) + + measurer->averageLoad = (LOWPASS_COEFFICIENT_0 * measurer->averageLoad) + + (LOWPASS_COEFFICIENT_1 * measuredLoad); + } +} + + +double PaUtil_GetCpuLoad( PaUtilCpuLoadMeasurer* measurer ) +{ + return measurer->averageLoad; +} diff --git a/portaudio-v19/pa_common/pa_cpuload.h b/portaudio-v19/pa_common/pa_cpuload.h new file mode 100644 index 000000000..131ad10bd --- /dev/null +++ b/portaudio-v19/pa_common/pa_cpuload.h @@ -0,0 +1,63 @@ +#ifndef PA_CPULOAD_H +#define PA_CPULOAD_H +/* + * $Id$ + * Portable Audio I/O Library CPU Load measurement functions + * Portable CPU load measurement facility. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 2002 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Functions to assist in measuring the CPU utilization of a callback + stream. Used to implement the Pa_GetStreamCpuLoad() function. +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +typedef struct { + double samplingPeriod; + double measurementStartTime; + double averageLoad; +} PaUtilCpuLoadMeasurer; /**< @todo need better name than measurer */ + +void PaUtil_InitializeCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer, double sampleRate ); +void PaUtil_BeginCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer ); +void PaUtil_EndCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer, unsigned long framesProcessed ); +void PaUtil_ResetCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer ); +double PaUtil_GetCpuLoad( PaUtilCpuLoadMeasurer* measurer ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_CPULOAD_H */ diff --git a/portaudio-v19/pa_common/pa_dither.c b/portaudio-v19/pa_common/pa_dither.c new file mode 100644 index 000000000..d44a060cd --- /dev/null +++ b/portaudio-v19/pa_common/pa_dither.c @@ -0,0 +1,204 @@ +/* + * $Id$ + * Portable Audio I/O Library triangular dither generator + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Functions for generating dither noise +*/ + + +#include "pa_dither.h" +#include "pa_types.h" + +#define PA_DITHER_BITS_ (15) + + +void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *state ) +{ + state->previous = 0; + state->randSeed1 = 22222; + state->randSeed2 = 5555555; +} + + +signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *state ) +{ + signed long current, highPass; + + /* Generate two random numbers. */ + state->randSeed1 = (state->randSeed1 * 196314165) + 907633515; + state->randSeed2 = (state->randSeed2 * 196314165) + 907633515; + + /* Generate triangular distribution about 0. + * Shift before adding to prevent overflow which would skew the distribution. + * Also shift an extra bit for the high pass filter. + */ +#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) + current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + + (((signed long)state->randSeed2)>>DITHER_SHIFT_); + + /* High pass filter to reduce audibility. */ + highPass = current - state->previous; + state->previous = current; + return highPass; +} + + +/* Multiply by PA_FLOAT_DITHER_SCALE_ to get a float between -2.0 and +1.99999 */ +#define PA_FLOAT_DITHER_SCALE_ (1.0f / ((1<randSeed1 = (state->randSeed1 * 196314165) + 907633515; + state->randSeed2 = (state->randSeed2 * 196314165) + 907633515; + + /* Generate triangular distribution about 0. + * Shift before adding to prevent overflow which would skew the distribution. + * Also shift an extra bit for the high pass filter. + */ +#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) + current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + + (((signed long)state->randSeed2)>>DITHER_SHIFT_); + + /* High pass filter to reduce audibility. */ + highPass = current - state->previous; + state->previous = current; + return ((float)highPass) * const_float_dither_scale_; +} + + +/* +The following alternate dither algorithms (from musicdsp.org) could be +considered +*/ + +/*Noise shaped dither (March 2000) +------------------- + +This is a simple implementation of highpass triangular-PDF dither with +2nd-order noise shaping, for use when truncating floating point audio +data to fixed point. + +The noise shaping lowers the noise floor by 11dB below 5kHz (@ 44100Hz +sample rate) compared to triangular-PDF dither. The code below assumes +input data is in the range +1 to -1 and doesn't check for overloads! + +To save time when generating dither for multiple channels you can do +things like this: r3=(r1 & 0x7F)<<8; instead of calling rand() again. + + + + int r1, r2; //rectangular-PDF random numbers + float s1, s2; //error feedback buffers + float s = 0.5f; //set to 0.0f for no noise shaping + float w = pow(2.0,bits-1); //word length (usually bits=16) + float wi= 1.0f/w; + float d = wi / RAND_MAX; //dither amplitude (2 lsb) + float o = wi * 0.5f; //remove dc offset + float in, tmp; + int out; + + +//for each sample... + + r2=r1; //can make HP-TRI dither by + r1=rand(); //subtracting previous rand() + + in += s * (s1 + s1 - s2); //error feedback + tmp = in + o + d * (float)(r1 - r2); //dc offset and dither + + out = (int)(w * tmp); //truncate downwards + if(tmp<0.0f) out--; //this is faster than floor() + + s2 = s1; + s1 = in - wi * (float)out; //error + + + +-- +paul.kellett@maxim.abel.co.uk +http://www.maxim.abel.co.uk +*/ + + +/* +16-to-8-bit first-order dither + +Type : First order error feedforward dithering code +References : Posted by Jon Watte + +Notes : +This is about as simple a dithering algorithm as you can implement, but it's +likely to sound better than just truncating to N bits. + +Note that you might not want to carry forward the full difference for infinity. +It's probably likely that the worst performance hit comes from the saturation +conditionals, which can be avoided with appropriate instructions on many DSPs +and integer SIMD type instructions, or CMOV. + +Last, if sound quality is paramount (such as when going from > 16 bits to 16 +bits) you probably want to use a higher-order dither function found elsewhere +on this site. + + +Code : +// This code will down-convert and dither a 16-bit signed short +// mono signal into an 8-bit unsigned char signal, using a first +// order forward-feeding error term dither. + +#define uchar unsigned char + +void dither_one_channel_16_to_8( short * input, uchar * output, int count, int * memory ) +{ + int m = *memory; + while( count-- > 0 ) { + int i = *input++; + i += m; + int j = i + 32768 - 128; + uchar o; + if( j < 0 ) { + o = 0; + } + else if( j > 65535 ) { + o = 255; + } + else { + o = (uchar)((j>>8)&0xff); + } + m = ((j-32768+128)-i); + *output++ = o; + } + *memory = m; +} +*/ diff --git a/portaudio-v19/pa_common/pa_dither.h b/portaudio-v19/pa_common/pa_dither.h new file mode 100644 index 000000000..148db275f --- /dev/null +++ b/portaudio-v19/pa_common/pa_dither.h @@ -0,0 +1,91 @@ +#ifndef PA_DITHER_H +#define PA_DITHER_H +/* + * $Id$ + * Portable Audio I/O Library triangular dither generator + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Functions for generating dither noise +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** @brief State needed to generate a dither signal */ +typedef struct PaUtilTriangularDitherGenerator{ + unsigned long previous; + unsigned long randSeed1; + unsigned long randSeed2; +} PaUtilTriangularDitherGenerator; + + +/** @brief Initialize dither state */ +void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *ditherState ); + + +/** + @brief Calculate 2 LSB dither signal with a triangular distribution. + Ranged for adding to a 1 bit right-shifted 32 bit integer + prior to >>15. eg: +

    +    signed long in = *
    +    signed long dither = PaUtil_Generate16BitTriangularDither( ditherState );
    +    signed short out = (signed short)(((in>>1) + dither) >> 15);
    +
    + @return + A signed long with a range of +32767 to -32768 +*/ +signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); + + +/** + @brief Calculate 2 LSB dither signal with a triangular distribution. + Ranged for adding to a pre-scaled float. +
    +    float in = *
    +    float dither = PaUtil_GenerateFloatTriangularDither( ditherState );
    +    // use smaller scaler to prevent overflow when we add the dither
    +    signed short out = (signed short)(in*(32766.0f) + dither );
    +
    + @return + A float with a range of -2.0 to +1.99999. +*/ +float PaUtil_GenerateFloatTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_DITHER_H */ diff --git a/portaudio-v19/pa_common/pa_endianness.h b/portaudio-v19/pa_common/pa_endianness.h new file mode 100644 index 000000000..3a573929b --- /dev/null +++ b/portaudio-v19/pa_common/pa_endianness.h @@ -0,0 +1,111 @@ +#ifndef PA_ENDIANNESS_H +#define PA_ENDIANNESS_H +/* + * $Id$ + * Portable Audio I/O Library current platform endianness macros + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Configure endianness symbols for the target processor. + + Arrange for either the PA_LITTLE_ENDIAN or PA_BIG_ENDIAN preprocessor symbols + to be defined. The one that is defined reflects the endianness of the target + platform and may be used to implement conditional compilation of byte-order + dependent code. + + If either PA_LITTLE_ENDIAN or PA_BIG_ENDIAN is defined already, then no attempt + is made to override that setting. This may be useful if you have a better way + of determining the platform's endianness. The autoconf mechanism uses this for + example. + + A PA_VALIDATE_ENDIANNESS macro is provided to compare the compile time + and runtime endiannes and raise an assertion if they don't match. +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +#if defined(PA_LITTLE_ENDIAN) || defined(PA_BIG_ENDIAN) + /* endianness define has been set externally, such as by autoconf */ + + #if defined(PA_LITTLE_ENDIAN) && defined(PA_BIG_ENDIAN) + #error both PA_LITTLE_ENDIAN and PA_BIG_ENDIAN have been defined externally to pa_endianness.h - only one endianness at a time please + #endif + +#else + /* endianness define has not been set externally */ + + /* set PA_LITTLE_ENDIAN or PA_BIG_ENDIAN by testing well known platform specific defines */ + + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) + + #define PA_LITTLE_ENDIAN /* win32, assume intel byte order */ + + #else + +#endif + + #if !defined(PA_LITTLE_ENDIAN) && !defined(PA_BIG_ENDIAN) + /* + If the following error is raised, you either need to modify the code above + to automatically determine the endianness from other symbols defined on your + platform, or define either PA_LITTLE_ENDIAN or PA_BIG_ENDIAN externally. + */ + #error pa_endianness.h was unable to automatically determine the endianness of the target platform + #endif + +#endif + +/* PA_VALIDATE_ENDIANNESS compares the compile time and runtime endianness, + and raises an assertion if they don't match. must be included in + the context in which this macro is used. +*/ +#if defined(PA_LITTLE_ENDIAN) + #define PA_VALIDATE_ENDIANNESS \ + { \ + const long nativeOne = 1; \ + assert( "PortAudio: compile time and runtime endianness don't match" && (((char *)&nativeOne)[0]) == 1 ); \ + } +#elif defined(PA_BIG_ENDIAN) + #define PA_VALIDATE_ENDIANNESS \ + { \ + const long nativeOne = 1; \ + assert( "PortAudio: compile time and runtime endianness don't match" && (((char *)&nativeOne)[0]) == 0 ); \ + } +#endif + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_ENDIANNESS_H */ diff --git a/portaudio-v19/pa_common/pa_front.c b/portaudio-v19/pa_common/pa_front.c new file mode 100644 index 000000000..f330008a7 --- /dev/null +++ b/portaudio-v19/pa_common/pa_front.c @@ -0,0 +1,1978 @@ +/* + * $Id$ + * Portable Audio I/O Library Multi-Host API front end + * Validate function parameters and manage multiple host APIs. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/* doxygen index page */ +/** @mainpage + +PortAudio is an open-source cross-platform ‘C’ library for audio input +and output. It is designed to simplify the porting of audio applications +between various platforms, and also to simplify the development of audio +software in general by hiding the complexities of device interfacing. + +See the PortAudio website for further information http://www.portaudio.com/ + +This documentation pertains to PortAudio V19, API version 2.0 which is +currently under development. API version 2.0 differs in a number of ways from +previous versions, please consult the enhancement proposals for further details: +http://www.portaudio.com/docs/proposals/index.html + +This documentation is under construction. Things you might be interested in +include: + +- The PortAudio API 2.0, as documented in portaudio.h + +- The TODO List + +Feel free to pick an item off TODO list and fix/implement it. You may want to +enquire about status on the PortAudio mailing list first. +*/ + + +/** @file + @brief Implements public PortAudio API, checks some errors, forwards to + host API implementations. + + Implements the functions defined in the PortAudio API, checks for + some parameter and state inconsistencies and forwards API requests to + specific Host API implementations (via the interface declared in + pa_hostapi.h), and Streams (via the interface declared in pa_stream.h). + + This file handles initialization and termination of Host API + implementations via initializers stored in the paHostApiInitializers + global variable. + + Some utility functions declared in pa_util.h are implemented in this file. + + All PortAudio API functions can be conditionally compiled with logging code. + To compile with logging, define the PA_LOG_API_CALLS precompiler symbol. + + @todo Consider adding host API specific error text in Pa_GetErrorText() for + paUnanticipatedHostError + + @todo Consider adding a new error code for when (inputParameters == NULL) + && (outputParameters == NULL) + + @todo review whether Pa_CloseStream() should call the interface's + CloseStream function if aborting the stream returns an error code. + + @todo Create new error codes if a NULL buffer pointer, or a + zero frame count is passed to Pa_ReadStream or Pa_WriteStream. +*/ + + +#include +#include +#include +#include +#include /* needed by PA_VALIDATE_ENDIANNESS */ + +#include "portaudio.h" +#include "pa_util.h" +#include "pa_endianness.h" +#include "pa_types.h" +#include "pa_hostapi.h" +#include "pa_stream.h" + +#include "pa_trace.h" + + +#define PA_VERSION_ 1899 +#define PA_VERSION_TEXT_ "PortAudio V19-devel" + + + +/* #define PA_LOG_API_CALLS */ + +/* + The basic format for log messages is described below. If you need to + add any log messages, please follow this format. + + Function entry (void function): + + "FunctionName called.\n" + + Function entry (non void function): + + "FunctionName called:\n" + "\tParam1Type param1: param1Value\n" + "\tParam2Type param2: param2Value\n" (etc...) + + + Function exit (no return value): + + "FunctionName returned.\n" + + Function exit (simple return value): + + "FunctionName returned:\n" + "\tReturnType: returnValue\n\n" + + If the return type is an error code, the error text is displayed in () + + If the return type is not an error code, but has taken a special value + because an error occurred, then the reason for the error is shown in [] + + If the return type is a struct ptr, the struct is dumped. + + See the code below for examples +*/ + + +int Pa_GetVersion( void ) +{ + return PA_VERSION_; +} + + +const char* Pa_GetVersionText( void ) +{ + return PA_VERSION_TEXT_; +} + + + +#define PA_LAST_HOST_ERROR_TEXT_LENGTH_ 1024 + +static char lastHostErrorText_[ PA_LAST_HOST_ERROR_TEXT_LENGTH_ + 1 ] = {0}; + +static PaHostErrorInfo lastHostErrorInfo_ = { (PaHostApiTypeId)-1, 0, lastHostErrorText_ }; + + +void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode, + const char *errorText ) +{ + lastHostErrorInfo_.hostApiType = hostApiType; + lastHostErrorInfo_.errorCode = errorCode; + + strncpy( lastHostErrorText_, errorText, PA_LAST_HOST_ERROR_TEXT_LENGTH_ ); +} + + +void PaUtil_DebugPrint( const char *format, ... ) +{ + va_list ap; + + va_start( ap, format ); + vfprintf( stderr, format, ap ); + va_end( ap ); + + fflush( stderr ); +} + + +static PaUtilHostApiRepresentation **hostApis_ = 0; +static int hostApisCount_ = 0; +static int initializationCount_ = 0; +static int deviceCount_ = 0; + +PaUtilStreamRepresentation *firstOpenStream_ = NULL; + + +#define PA_IS_INITIALISED_ (initializationCount_ != 0) + + +static int CountHostApiInitializers( void ) +{ + int result = 0; + + while( paHostApiInitializers[ result ] != 0 ) + ++result; + return result; +} + + +static void TerminateHostApis( void ) +{ + /* terminate in reverse order from initialization */ + + while( hostApisCount_ > 0 ) + { + --hostApisCount_; + hostApis_[hostApisCount_]->Terminate( hostApis_[hostApisCount_] ); + } + hostApisCount_ = 0; + deviceCount_ = 0; + + if( hostApis_ != 0 ) + PaUtil_FreeMemory( hostApis_ ); + hostApis_ = 0; +} + + +static PaError InitializeHostApis( void ) +{ + PaError result = paNoError; + int i, initializerCount, baseDeviceIndex; + + initializerCount = CountHostApiInitializers(); + + hostApis_ = (PaUtilHostApiRepresentation**)PaUtil_AllocateMemory( + sizeof(PaUtilHostApiRepresentation*) * initializerCount ); + if( !hostApis_ ) + { + result = paInsufficientMemory; + goto error; + } + + hostApisCount_ = 0; + deviceCount_ = 0; + baseDeviceIndex = 0; + + for( i=0; i< initializerCount; ++i ) + { + hostApis_[hostApisCount_] = NULL; + result = paHostApiInitializers[i]( &hostApis_[hostApisCount_], hostApisCount_ ); + if( result != paNoError ) + goto error; + + if( hostApis_[hostApisCount_] ) + { + + hostApis_[hostApisCount_]->privatePaFrontInfo.baseDeviceIndex = baseDeviceIndex; + + if( hostApis_[hostApisCount_]->info.defaultInputDevice != paNoDevice ) + hostApis_[hostApisCount_]->info.defaultInputDevice += baseDeviceIndex; + + if( hostApis_[hostApisCount_]->info.defaultOutputDevice != paNoDevice ) + hostApis_[hostApisCount_]->info.defaultOutputDevice += baseDeviceIndex; + + baseDeviceIndex += hostApis_[hostApisCount_]->info.deviceCount; + deviceCount_ += hostApis_[hostApisCount_]->info.deviceCount; + + ++hostApisCount_; + } + } + + return result; + +error: + TerminateHostApis(); + return result; +} + + +/* + FindHostApi() finds the index of the host api to which + belongs and returns it. if is + non-null, the host specific device index is returned in it. + returns -1 if is out of range. + +*/ +static int FindHostApi( PaDeviceIndex device, int *hostSpecificDeviceIndex ) +{ + int i=0; + + if( !PA_IS_INITIALISED_ ) + return -1; + + if( device < 0 ) + return -1; + + while( i < hostApisCount_ + && device >= hostApis_[i]->info.deviceCount ) + { + + device -= hostApis_[i]->info.deviceCount; + ++i; + } + + if( i >= hostApisCount_ ) + return -1; + + if( hostSpecificDeviceIndex ) + *hostSpecificDeviceIndex = device; + + return i; +} + + +static void AddOpenStream( PaStream* stream ) +{ + ((PaUtilStreamRepresentation*)stream)->nextOpenStream = firstOpenStream_; + firstOpenStream_ = (PaUtilStreamRepresentation*)stream; +} + + +static void RemoveOpenStream( PaStream* stream ) +{ + PaUtilStreamRepresentation *previous = NULL; + PaUtilStreamRepresentation *current = firstOpenStream_; + + while( current != NULL ) + { + if( ((PaStream*)current) == stream ) + { + if( previous == NULL ) + { + firstOpenStream_ = current->nextOpenStream; + } + else + { + previous->nextOpenStream = current->nextOpenStream; + } + return; + } + else + { + previous = current; + current = current->nextOpenStream; + } + } +} + + +static void CloseOpenStreams( void ) +{ + /* we call Pa_CloseStream() here to ensure that the same destruction + logic is used for automatically closed streams */ + + while( firstOpenStream_ != NULL ) + Pa_CloseStream( firstOpenStream_ ); +} + + +PaError Pa_Initialize( void ) +{ + PaError result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint( "Pa_Initialize called.\n" ); +#endif + + if( PA_IS_INITIALISED_ ) + { + ++initializationCount_; + result = paNoError; + } + else + { + PA_VALIDATE_TYPE_SIZES; + PA_VALIDATE_ENDIANNESS; + + PaUtil_InitializeClock(); + PaUtil_ResetTraceMessages(); + + result = InitializeHostApis(); + if( result == paNoError ) + ++initializationCount_; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint( "Pa_Initialize returned:\n" ); + PaUtil_DebugPrint( "\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_Terminate( void ) +{ + PaError result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_Terminate called.\n" ); +#endif + + if( PA_IS_INITIALISED_ ) + { + if( --initializationCount_ == 0 ) + { + CloseOpenStreams(); + + TerminateHostApis(); + + PaUtil_DumpTraceMessages(); + } + result = paNoError; + } + else + { + result= paNotInitialized; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_Terminate returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ) +{ + return &lastHostErrorInfo_; +} + + +const char *Pa_GetErrorText( PaError errorCode ) +{ + const char *result; + + switch( errorCode ) + { + case paNoError: result = "Success"; break; + case paNotInitialized: result = "PortAudio not initialized"; break; + /** @todo could catenate the last host error text to result in the case of paUnanticipatedHostError */ + case paUnanticipatedHostError: result = "Unanticipated host error"; break; + case paInvalidChannelCount: result = "Invalid number of channels"; break; + case paInvalidSampleRate: result = "Invalid sample rate"; break; + case paInvalidDevice: result = "Invalid device"; break; + case paInvalidFlag: result = "Invalid flag"; break; + case paSampleFormatNotSupported: result = "Sample format not supported"; break; + case paBadIODeviceCombination: result = "Illegal combination of I/O devices"; break; + case paInsufficientMemory: result = "Insufficient memory"; break; + case paBufferTooBig: result = "Buffer too big"; break; + case paBufferTooSmall: result = "Buffer too small"; break; + case paNullCallback: result = "No callback routine specified"; break; + case paBadStreamPtr: result = "Invalid stream pointer"; break; + case paTimedOut: result = "Wait timed out"; break; + case paInternalError: result = "Internal PortAudio error"; break; + case paDeviceUnavailable: result = "Device unavailable"; break; + case paIncompatibleHostApiSpecificStreamInfo: result = "Incompatible host API specific stream info"; break; + case paStreamIsStopped: result = "Stream is stopped"; break; + case paStreamIsNotStopped: result = "Stream is not stopped"; break; + case paInputOverflowed: result = "Input overflowed"; break; + case paOutputUnderflowed: result = "Output underflowed"; break; + case paHostApiNotFound: result = "Host API not found"; break; + case paInvalidHostApi: result = "Invalid host API"; break; + case paCanNotReadFromACallbackStream: result = "Can't read from a callback stream"; break; + case paCanNotWriteToACallbackStream: result = "Can't write to a callback stream"; break; + case paCanNotReadFromAnOutputOnlyStream: result = "Can't read from an output only stream"; break; + case paCanNotWriteToAnInputOnlyStream: result = "Can't write to an input only stream"; break; + default: result = "Illegal error number"; break; + } + return result; +} + + +PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ) +{ + PaHostApiIndex result; + int i; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_HostApiTypeIdToHostApiIndex called:\n" ); + PaUtil_DebugPrint("\tPaHostApiTypeId type: %d\n", type ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = paHostApiNotFound; + + for( i=0; i < hostApisCount_; ++i ) + { + if( hostApis_[i]->info.type == type ) + { + result = i; + break; + } + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_HostApiTypeIdToHostApiIndex returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaHostApiIndex: %d\n\n", result ); +#endif + + return result; +} + + +PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **hostApi, + PaHostApiTypeId type ) +{ + PaError result; + int i; + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = paHostApiNotFound; + + for( i=0; i < hostApisCount_; ++i ) + { + if( hostApis_[i]->info.type == type ) + { + *hostApi = hostApis_[i]; + result = paNoError; + break; + } + } + } + + return result; +} + + +PaError PaUtil_DeviceIndexToHostApiDeviceIndex( + PaDeviceIndex *hostApiDevice, PaDeviceIndex device, struct PaUtilHostApiRepresentation *hostApi ) +{ + PaError result; + PaDeviceIndex x; + + x = device - hostApi->privatePaFrontInfo.baseDeviceIndex; + + if( x < 0 || x >= hostApi->info.deviceCount ) + { + result = paInvalidDevice; + } + else + { + *hostApiDevice = x; + result = paNoError; + } + + return result; +} + + +PaHostApiIndex Pa_GetHostApiCount( void ) +{ + int result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiCount called.\n" ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = hostApisCount_; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiCount returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaHostApiIndex %d\n\n", result ); +#endif + + return result; +} + + +PaHostApiIndex Pa_GetDefaultHostApi( void ) +{ + int result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultHostApi called.\n" ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = paDefaultHostApiIndex; + + /* internal consistency check: make sure that the default host api + index is within range */ + + if( result < 0 || result >= hostApisCount_ ) + { + result = paInternalError; + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultHostApi returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaHostApiIndex %d\n\n", result ); +#endif + + return result; +} + + +const PaHostApiInfo* Pa_GetHostApiInfo( PaHostApiIndex hostApi ) +{ + PaHostApiInfo *info; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiInfo called:\n" ); + PaUtil_DebugPrint("\tPaHostApiIndex hostApi: %d\n", hostApi ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + info = NULL; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiInfo returned:\n" ); + PaUtil_DebugPrint("\tPaHostApiInfo*: NULL [ PortAudio not initialized ]\n\n" ); +#endif + + } + else if( hostApi < 0 || hostApi >= hostApisCount_ ) + { + info = NULL; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiInfo returned:\n" ); + PaUtil_DebugPrint("\tPaHostApiInfo*: NULL [ hostApi out of range ]\n\n" ); +#endif + + } + else + { + info = &hostApis_[hostApi]->info; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiInfo returned:\n" ); + PaUtil_DebugPrint("\tPaHostApiInfo*: 0x%p\n", info ); + PaUtil_DebugPrint("\t{" ); + PaUtil_DebugPrint("\t\tint structVersion: %d\n", info->structVersion ); + PaUtil_DebugPrint("\t\tPaHostApiTypeId type: %d\n", info->type ); + PaUtil_DebugPrint("\t\tconst char *name: %s\n\n", info->name ); + PaUtil_DebugPrint("\t}\n\n" ); +#endif + + } + + return info; +} + + +PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, int hostApiDeviceIndex ) +{ + PaDeviceIndex result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_HostApiDeviceIndexToPaDeviceIndex called:\n" ); + PaUtil_DebugPrint("\tPaHostApiIndex hostApi: %d\n", hostApi ); + PaUtil_DebugPrint("\tint hostApiDeviceIndex: %d\n", hostApiDeviceIndex ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + if( hostApi < 0 || hostApi >= hostApisCount_ ) + { + result = paInvalidHostApi; + } + else + { + if( hostApiDeviceIndex < 0 || + hostApiDeviceIndex >= hostApis_[hostApi]->info.deviceCount ) + { + result = paInvalidDevice; + } + else + { + result = hostApis_[hostApi]->privatePaFrontInfo.baseDeviceIndex + hostApiDeviceIndex; + } + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_HostApiDeviceIndexToPaDeviceIndex returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); +#endif + + return result; +} + + +PaDeviceIndex Pa_GetDeviceCount( void ) +{ + PaDeviceIndex result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceCount called.\n" ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = deviceCount_; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceCount returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); +#endif + + return result; +} + + +PaDeviceIndex Pa_GetDefaultInputDevice( void ) +{ + PaHostApiIndex hostApi; + PaDeviceIndex result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultInputDevice called.\n" ); +#endif + + hostApi = Pa_GetDefaultHostApi(); + if( hostApi < 0 ) + { + result = paNoDevice; + } + else + { + result = hostApis_[hostApi]->info.defaultInputDevice; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultInputDevice returned:\n" ); + PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); +#endif + + return result; +} + + +PaDeviceIndex Pa_GetDefaultOutputDevice( void ) +{ + PaHostApiIndex hostApi; + PaDeviceIndex result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultOutputDevice called.\n" ); +#endif + + hostApi = Pa_GetDefaultHostApi(); + if( hostApi < 0 ) + { + result = paNoDevice; + } + else + { + result = hostApis_[hostApi]->info.defaultOutputDevice; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultOutputDevice returned:\n" ); + PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); +#endif + + return result; +} + + +const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ) +{ + int hostSpecificDeviceIndex; + int hostApiIndex = FindHostApi( device, &hostSpecificDeviceIndex ); + PaDeviceInfo *result; + + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceInfo called:\n" ); + PaUtil_DebugPrint("\tPaDeviceIndex device: %d\n", device ); +#endif + + if( hostApiIndex < 0 ) + { + result = NULL; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceInfo returned:\n" ); + PaUtil_DebugPrint("\tPaDeviceInfo* NULL [ invalid device index ]\n\n" ); +#endif + + } + else + { + result = hostApis_[hostApiIndex]->deviceInfos[ hostSpecificDeviceIndex ]; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceInfo returned:\n" ); + PaUtil_DebugPrint("\tPaDeviceInfo*: 0x%p:\n", result ); + PaUtil_DebugPrint("\t{\n" ); + + PaUtil_DebugPrint("\t\tint structVersion: %d\n", result->structVersion ); + PaUtil_DebugPrint("\t\tconst char *name: %s\n", result->name ); + PaUtil_DebugPrint("\t\tPaHostApiIndex hostApi: %d\n", result->hostApi ); + PaUtil_DebugPrint("\t\tint maxInputChannels: %d\n", result->maxInputChannels ); + PaUtil_DebugPrint("\t\tint maxOutputChannels: %d\n", result->maxOutputChannels ); + PaUtil_DebugPrint("\t}\n\n" ); +#endif + + } + + return result; +} + + +/* + SampleFormatIsValid() returns 1 if sampleFormat is a sample format + defined in portaudio.h, or 0 otherwise. +*/ +static int SampleFormatIsValid( PaSampleFormat format ) +{ + switch( format & ~paNonInterleaved ) + { + case paFloat32: return 1; + case paInt16: return 1; + case paInt32: return 1; + case paInt24: return 1; + case paInt8: return 1; + case paUInt8: return 1; + case paCustomFormat: return 1; + default: return 0; + } +} + +/* + NOTE: make sure this validation list is kept syncronised with the one in + pa_hostapi.h + + ValidateOpenStreamParameters() checks that parameters to Pa_OpenStream() + conform to the expected values as described below. This function is + also designed to be used with the proposed Pa_IsFormatSupported() function. + + There are basically two types of validation that could be performed: + Generic conformance validation, and device capability mismatch + validation. This function performs only generic conformance validation. + Validation that would require knowledge of device capabilities is + not performed because of potentially complex relationships between + combinations of parameters - for example, even if the sampleRate + seems ok, it might not be for a duplex stream - we have no way of + checking this in an API-neutral way, so we don't try. + + On success the function returns PaNoError and fills in hostApi, + hostApiInputDeviceID, and hostApiOutputDeviceID fields. On failure + the function returns an error code indicating the first encountered + parameter error. + + + If ValidateOpenStreamParameters() returns paNoError, the following + assertions are guaranteed to be true. + + - at least one of inputParameters & outputParmeters is valid (not NULL) + + - if inputParameters & outputParameters are both valid, that + inputParameters->device & outputParameters->device both use the same host api + + PaDeviceIndex inputParameters->device + - is within range (0 to Pa_GetDeviceCount-1) Or: + - is paUseHostApiSpecificDeviceSpecification and + inputParameters->hostApiSpecificStreamInfo is non-NULL and refers + to a valid host api + + int inputParameters->channelCount + - if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, channelCount is > 0 + - upper bound is NOT validated against device capabilities + + PaSampleFormat inputParameters->sampleFormat + - is one of the sample formats defined in portaudio.h + + void *inputParameters->hostApiSpecificStreamInfo + - if supplied its hostApi field matches the input device's host Api + + PaDeviceIndex outputParmeters->device + - is within range (0 to Pa_GetDeviceCount-1) + + int outputParmeters->channelCount + - if inputDevice is valid, channelCount is > 0 + - upper bound is NOT validated against device capabilities + + PaSampleFormat outputParmeters->sampleFormat + - is one of the sample formats defined in portaudio.h + + void *outputParmeters->hostApiSpecificStreamInfo + - if supplied its hostApi field matches the output device's host Api + + double sampleRate + - is not an 'absurd' rate (less than 1000. or greater than 200000.) + - sampleRate is NOT validated against device capabilities + + PaStreamFlags streamFlags + - unused platform neutral flags are zero + - paNeverDropInput is only used for full-duplex callback streams with + variable buffer size (paFramesPerBufferUnspecified) +*/ +static PaError ValidateOpenStreamParameters( + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + PaUtilHostApiRepresentation **hostApi, + PaDeviceIndex *hostApiInputDevice, + PaDeviceIndex *hostApiOutputDevice ) +{ + int inputHostApiIndex = -1, /* Surpress uninitialised var warnings: compiler does */ + outputHostApiIndex = -1; /* not see that if inputParameters and outputParame- */ + /* ters are both nonzero, these indices are set. */ + + if( (inputParameters == NULL) && (outputParameters == NULL) ) + { + return paInvalidDevice; /** @todo should be a new error code "invalid device parameters" or something */ + } + else + { + if( inputParameters == NULL ) + { + *hostApiInputDevice = paNoDevice; + } + else if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + { + if( inputParameters->hostApiSpecificStreamInfo ) + { + inputHostApiIndex = Pa_HostApiTypeIdToHostApiIndex( + ((PaUtilHostApiSpecificStreamInfoHeader*)inputParameters->hostApiSpecificStreamInfo)->hostApiType ); + + if( inputHostApiIndex != -1 ) + { + *hostApiInputDevice = paUseHostApiSpecificDeviceSpecification; + *hostApi = hostApis_[inputHostApiIndex]; + } + else + { + return paInvalidDevice; + } + } + else + { + return paInvalidDevice; + } + } + else + { + if( inputParameters->device < 0 || inputParameters->device >= deviceCount_ ) + return paInvalidDevice; + + inputHostApiIndex = FindHostApi( inputParameters->device, hostApiInputDevice ); + if( inputHostApiIndex < 0 ) + return paInternalError; + + *hostApi = hostApis_[inputHostApiIndex]; + + if( inputParameters->channelCount <= 0 ) + return paInvalidChannelCount; + + if( !SampleFormatIsValid( inputParameters->sampleFormat ) ) + return paSampleFormatNotSupported; + + if( inputParameters->hostApiSpecificStreamInfo != NULL ) + { + if( ((PaUtilHostApiSpecificStreamInfoHeader*)inputParameters->hostApiSpecificStreamInfo)->hostApiType + != (*hostApi)->info.type ) + return paIncompatibleHostApiSpecificStreamInfo; + } + } + + if( outputParameters == NULL ) + { + *hostApiOutputDevice = paNoDevice; + } + else if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + { + if( outputParameters->hostApiSpecificStreamInfo ) + { + outputHostApiIndex = Pa_HostApiTypeIdToHostApiIndex( + ((PaUtilHostApiSpecificStreamInfoHeader*)outputParameters->hostApiSpecificStreamInfo)->hostApiType ); + + if( outputHostApiIndex != -1 ) + { + *hostApiOutputDevice = paUseHostApiSpecificDeviceSpecification; + *hostApi = hostApis_[outputHostApiIndex]; + } + else + { + return paInvalidDevice; + } + } + else + { + return paInvalidDevice; + } + } + else + { + if( outputParameters->device < 0 || outputParameters->device >= deviceCount_ ) + return paInvalidDevice; + + outputHostApiIndex = FindHostApi( outputParameters->device, hostApiOutputDevice ); + if( outputHostApiIndex < 0 ) + return paInternalError; + + *hostApi = hostApis_[outputHostApiIndex]; + + if( outputParameters->channelCount <= 0 ) + return paInvalidChannelCount; + + if( !SampleFormatIsValid( outputParameters->sampleFormat ) ) + return paSampleFormatNotSupported; + + if( outputParameters->hostApiSpecificStreamInfo != NULL ) + { + if( ((PaUtilHostApiSpecificStreamInfoHeader*)outputParameters->hostApiSpecificStreamInfo)->hostApiType + != (*hostApi)->info.type ) + return paIncompatibleHostApiSpecificStreamInfo; + } + } + + if( (inputParameters != NULL) && (outputParameters != NULL) ) + { + /* ensure that both devices use the same API */ + if( inputHostApiIndex != outputHostApiIndex ) + return paBadIODeviceCombination; + } + } + + + /* Check for absurd sample rates. */ + if( (sampleRate < 1000.0) || (sampleRate > 200000.0) ) + return paInvalidSampleRate; + + if( ((streamFlags & ~paPlatformSpecificFlags) & ~(paClipOff | paDitherOff | paNeverDropInput | paPrimeOutputBuffersUsingStreamCallback ) ) != 0 ) + return paInvalidFlag; + + if( streamFlags & paNeverDropInput ) + { + /* must be a callback stream */ + if( !streamCallback ) + return paInvalidFlag; + + /* must be a full duplex stream */ + if( (inputParameters == NULL) || (outputParameters == NULL) ) + return paInvalidFlag; + + /* must use paFramesPerBufferUnspecified */ + if( framesPerBuffer != paFramesPerBufferUnspecified ) + return paInvalidFlag; + } + + return paNoError; +} + + +PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiInputDevice, hostApiOutputDevice; + PaStreamParameters hostApiInputParameters, hostApiOutputParameters; + PaStreamParameters *hostApiInputParametersPtr, *hostApiOutputParametersPtr; + + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsFormatSupported called:\n" ); + + if( inputParameters == NULL ){ + PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: NULL\n" ); + }else{ + PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: 0x%p\n", inputParameters ); + PaUtil_DebugPrint("\tPaDeviceIndex inputParameters->device: %d\n", inputParameters->device ); + PaUtil_DebugPrint("\tint inputParameters->channelCount: %d\n", inputParameters->channelCount ); + PaUtil_DebugPrint("\tPaSampleFormat inputParameters->sampleFormat: %d\n", inputParameters->sampleFormat ); + PaUtil_DebugPrint("\tPaTime inputParameters->suggestedLatency: %f\n", inputParameters->suggestedLatency ); + PaUtil_DebugPrint("\tvoid *inputParameters->hostApiSpecificStreamInfo: 0x%p\n", inputParameters->hostApiSpecificStreamInfo ); + } + + if( outputParameters == NULL ){ + PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: NULL\n" ); + }else{ + PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: 0x%p\n", outputParameters ); + PaUtil_DebugPrint("\tPaDeviceIndex outputParameters->device: %d\n", outputParameters->device ); + PaUtil_DebugPrint("\tint outputParameters->channelCount: %d\n", outputParameters->channelCount ); + PaUtil_DebugPrint("\tPaSampleFormat outputParameters->sampleFormat: %d\n", outputParameters->sampleFormat ); + PaUtil_DebugPrint("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ); + PaUtil_DebugPrint("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ); + } + + PaUtil_DebugPrint("\tdouble sampleRate: %g\n", sampleRate ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsFormatSupported returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + result = ValidateOpenStreamParameters( inputParameters, + outputParameters, + sampleRate, 0, paNoFlag, 0, + &hostApi, + &hostApiInputDevice, + &hostApiOutputDevice ); + if( result != paNoError ) + { +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsFormatSupported returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + + if( inputParameters ) + { + hostApiInputParameters.device = hostApiInputDevice; + hostApiInputParameters.channelCount = inputParameters->channelCount; + hostApiInputParameters.sampleFormat = inputParameters->sampleFormat; + hostApiInputParameters.suggestedLatency = inputParameters->suggestedLatency; + hostApiInputParameters.hostApiSpecificStreamInfo = inputParameters->hostApiSpecificStreamInfo; + hostApiInputParametersPtr = &hostApiInputParameters; + } + else + { + hostApiInputParametersPtr = NULL; + } + + if( outputParameters ) + { + hostApiOutputParameters.device = hostApiOutputDevice; + hostApiOutputParameters.channelCount = outputParameters->channelCount; + hostApiOutputParameters.sampleFormat = outputParameters->sampleFormat; + hostApiOutputParameters.suggestedLatency = outputParameters->suggestedLatency; + hostApiOutputParameters.hostApiSpecificStreamInfo = outputParameters->hostApiSpecificStreamInfo; + hostApiOutputParametersPtr = &hostApiOutputParameters; + } + else + { + hostApiOutputParametersPtr = NULL; + } + + result = hostApi->IsFormatSupported( hostApi, + hostApiInputParametersPtr, hostApiOutputParametersPtr, + sampleRate ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + if( result == paFormatIsSupported ) + PaUtil_DebugPrint("\tPaError: 0 [ paFormatIsSupported ]\n\n" ); + else + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_OpenStream( PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiInputDevice, hostApiOutputDevice; + PaStreamParameters hostApiInputParameters, hostApiOutputParameters; + PaStreamParameters *hostApiInputParametersPtr, *hostApiOutputParametersPtr; + + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream called:\n" ); + PaUtil_DebugPrint("\tPaStream** stream: 0x%p\n", stream ); + + if( inputParameters == NULL ){ + PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: NULL\n" ); + }else{ + PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: 0x%p\n", inputParameters ); + PaUtil_DebugPrint("\tPaDeviceIndex inputParameters->device: %d\n", inputParameters->device ); + PaUtil_DebugPrint("\tint inputParameters->channelCount: %d\n", inputParameters->channelCount ); + PaUtil_DebugPrint("\tPaSampleFormat inputParameters->sampleFormat: %d\n", inputParameters->sampleFormat ); + PaUtil_DebugPrint("\tPaTime inputParameters->suggestedLatency: %f\n", inputParameters->suggestedLatency ); + PaUtil_DebugPrint("\tvoid *inputParameters->hostApiSpecificStreamInfo: 0x%p\n", inputParameters->hostApiSpecificStreamInfo ); + } + + if( outputParameters == NULL ){ + PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: NULL\n" ); + }else{ + PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: 0x%p\n", outputParameters ); + PaUtil_DebugPrint("\tPaDeviceIndex outputParameters->device: %d\n", outputParameters->device ); + PaUtil_DebugPrint("\tint outputParameters->channelCount: %d\n", outputParameters->channelCount ); + PaUtil_DebugPrint("\tPaSampleFormat outputParameters->sampleFormat: %d\n", outputParameters->sampleFormat ); + PaUtil_DebugPrint("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ); + PaUtil_DebugPrint("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ); + } + + PaUtil_DebugPrint("\tdouble sampleRate: %g\n", sampleRate ); + PaUtil_DebugPrint("\tunsigned long framesPerBuffer: %d\n", framesPerBuffer ); + PaUtil_DebugPrint("\tPaStreamFlags streamFlags: 0x%x\n", streamFlags ); + PaUtil_DebugPrint("\tPaStreamCallback *streamCallback: 0x%p\n", streamCallback ); + PaUtil_DebugPrint("\tvoid *userData: 0x%p\n", userData ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): undefined\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + /* Check for parameter errors. + NOTE: make sure this validation list is kept syncronised with the one + in pa_hostapi.h + */ + + if( stream == NULL ) + { + result = paBadStreamPtr; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): undefined\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + result = ValidateOpenStreamParameters( inputParameters, + outputParameters, + sampleRate, framesPerBuffer, + streamFlags, streamCallback, + &hostApi, + &hostApiInputDevice, + &hostApiOutputDevice ); + if( result != paNoError ) + { +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): undefined\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + + if( inputParameters ) + { + hostApiInputParameters.device = hostApiInputDevice; + hostApiInputParameters.channelCount = inputParameters->channelCount; + hostApiInputParameters.sampleFormat = inputParameters->sampleFormat; + hostApiInputParameters.suggestedLatency = inputParameters->suggestedLatency; + hostApiInputParameters.hostApiSpecificStreamInfo = inputParameters->hostApiSpecificStreamInfo; + hostApiInputParametersPtr = &hostApiInputParameters; + } + else + { + hostApiInputParametersPtr = NULL; + } + + if( outputParameters ) + { + hostApiOutputParameters.device = hostApiOutputDevice; + hostApiOutputParameters.channelCount = outputParameters->channelCount; + hostApiOutputParameters.sampleFormat = outputParameters->sampleFormat; + hostApiOutputParameters.suggestedLatency = outputParameters->suggestedLatency; + hostApiOutputParameters.hostApiSpecificStreamInfo = outputParameters->hostApiSpecificStreamInfo; + hostApiOutputParametersPtr = &hostApiOutputParameters; + } + else + { + hostApiOutputParametersPtr = NULL; + } + + result = hostApi->OpenStream( hostApi, stream, + hostApiInputParametersPtr, hostApiOutputParametersPtr, + sampleRate, framesPerBuffer, streamFlags, streamCallback, userData ); + + if( result == paNoError ) + AddOpenStream( *stream ); + + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): 0x%p\n", *stream ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_OpenDefaultStream( PaStream** stream, + int inputChannelCount, + int outputChannelCount, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result; + PaStreamParameters hostApiInputParameters, hostApiOutputParameters; + PaStreamParameters *hostApiInputParametersPtr, *hostApiOutputParametersPtr; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenDefaultStream called:\n" ); + PaUtil_DebugPrint("\tPaStream** stream: 0x%p\n", stream ); + PaUtil_DebugPrint("\tint inputChannelCount: %d\n", inputChannelCount ); + PaUtil_DebugPrint("\tint outputChannelCount: %d\n", outputChannelCount ); + PaUtil_DebugPrint("\tPaSampleFormat sampleFormat: %d\n", sampleFormat ); + PaUtil_DebugPrint("\tdouble sampleRate: %g\n", sampleRate ); + PaUtil_DebugPrint("\tunsigned long framesPerBuffer: %d\n", framesPerBuffer ); + PaUtil_DebugPrint("\tPaStreamCallback *streamCallback: 0x%p\n", streamCallback ); + PaUtil_DebugPrint("\tvoid *userData: 0x%p\n", userData ); +#endif + + + if( inputChannelCount > 0 ) + { + hostApiInputParameters.device = Pa_GetDefaultInputDevice(); + hostApiInputParameters.channelCount = inputChannelCount; + hostApiInputParameters.sampleFormat = sampleFormat; + /* defaultHighInputLatency is used below instead of + defaultLowInputLatency because it is more important for the default + stream to work reliably than it is for it to work with the lowest + latency. + */ + hostApiInputParameters.suggestedLatency = + Pa_GetDeviceInfo( hostApiInputParameters.device )->defaultHighInputLatency; + hostApiInputParameters.hostApiSpecificStreamInfo = NULL; + hostApiInputParametersPtr = &hostApiInputParameters; + } + else + { + hostApiInputParametersPtr = NULL; + } + + if( outputChannelCount > 0 ) + { + hostApiOutputParameters.device = Pa_GetDefaultOutputDevice(); + hostApiOutputParameters.channelCount = outputChannelCount; + hostApiOutputParameters.sampleFormat = sampleFormat; + /* defaultHighOutputLatency is used below instead of + defaultLowOutputLatency because it is more important for the default + stream to work reliably than it is for it to work with the lowest + latency. + */ + hostApiOutputParameters.suggestedLatency = + Pa_GetDeviceInfo( hostApiOutputParameters.device )->defaultHighOutputLatency; + hostApiOutputParameters.hostApiSpecificStreamInfo = NULL; + hostApiOutputParametersPtr = &hostApiOutputParameters; + } + else + { + hostApiOutputParametersPtr = NULL; + } + + + result = Pa_OpenStream( + stream, hostApiInputParametersPtr, hostApiOutputParametersPtr, + sampleRate, framesPerBuffer, paNoFlag, streamCallback, userData ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenDefaultStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): 0x%p", *stream ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError PaUtil_ValidateStreamPointer( PaStream* stream ) +{ + if( !PA_IS_INITIALISED_ ) return paNotInitialized; + + if( stream == NULL ) return paBadStreamPtr; + + if( ((PaUtilStreamRepresentation*)stream)->magic != PA_STREAM_MAGIC ) + return paBadStreamPtr; + + return paNoError; +} + + +PaError Pa_CloseStream( PaStream* stream ) +{ + PaUtilStreamInterface *interface; + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_CloseStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + /* always remove the open stream from our list, even if this function + eventually returns an error. Otherwise CloseOpenStreams() will + get stuck in an infinite loop */ + RemoveOpenStream( stream ); /* be sure to call this _before_ closing the stream */ + + if( result == paNoError ) + { + interface = PA_STREAM_INTERFACE(stream); + + /* abort the stream if it isn't stopped */ + result = interface->IsStopped( stream ); + if( result == 1 ) + result = paNoError; + else if( result == 0 ) + result = interface->Abort( stream ); + + if( result == paNoError ) /** @todo REVIEW: shouldn't we close anyway? */ + result = interface->Close( stream ); + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_CloseStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_SetStreamFinishedCallback called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); + PaUtil_DebugPrint("\tPaStreamFinishedCallback* streamFinishedCallback: 0x%p\n", streamFinishedCallback ); +#endif + + if( result == paNoError ) + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = paStreamIsNotStopped ; + } + if( result == 1 ) + { + PA_STREAM_REP( stream )->streamFinishedCallback = streamFinishedCallback; + result = paNoError; + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_SetStreamFinishedCallback returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; + +} + + +PaError Pa_StartStream( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_StartStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = paStreamIsNotStopped ; + } + else if( result == 1 ) + { + result = PA_STREAM_INTERFACE(stream)->Start( stream ); + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_StartStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_StopStream( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_StopStream called\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = PA_STREAM_INTERFACE(stream)->Stop( stream ); + } + else if( result == 1 ) + { + result = paStreamIsStopped; + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_StopStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_AbortStream( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_AbortStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = PA_STREAM_INTERFACE(stream)->Abort( stream ); + } + else if( result == 1 ) + { + result = paStreamIsStopped; + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_AbortStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_IsStreamStopped( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsStreamStopped called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsStreamStopped returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_IsStreamActive( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsStreamActive called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + result = PA_STREAM_INTERFACE(stream)->IsActive( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsStreamActive returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + const PaStreamInfo *result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamInfo called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + result = 0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamInfo returned:\n" ); + PaUtil_DebugPrint("\tconst PaStreamInfo*: 0 [PaError error:%d ( %s )]\n\n", result, error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = &PA_STREAM_REP( stream )->streamInfo; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamInfo returned:\n" ); + PaUtil_DebugPrint("\tconst PaStreamInfo*: 0x%p:\n", result ); + PaUtil_DebugPrint("\t{" ); + + PaUtil_DebugPrint("\t\tint structVersion: %d\n", result->structVersion ); + PaUtil_DebugPrint("\t\tPaTime inputLatency: %f\n", result->inputLatency ); + PaUtil_DebugPrint("\t\tPaTime outputLatency: %f\n", result->outputLatency ); + PaUtil_DebugPrint("\t\tdouble sampleRate: %f\n", result->sampleRate ); + PaUtil_DebugPrint("\t}\n\n" ); +#endif + + } + + return result; +} + + +PaTime Pa_GetStreamTime( PaStream *stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + PaTime result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamTime called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + result = 0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamTime returned:\n" ); + PaUtil_DebugPrint("\tPaTime: 0 [PaError error:%d ( %s )]\n\n", result, error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = PA_STREAM_INTERFACE(stream)->GetTime( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamTime returned:\n" ); + PaUtil_DebugPrint("\tPaTime: %g\n\n", result ); +#endif + + } + + return result; +} + + +double Pa_GetStreamCpuLoad( PaStream* stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + double result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamCpuLoad called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + + result = 0.0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamCpuLoad returned:\n" ); + PaUtil_DebugPrint("\tdouble: 0.0 [PaError error: %d ( %s )]\n\n", error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = PA_STREAM_INTERFACE(stream)->GetCpuLoad( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamCpuLoad returned:\n" ); + PaUtil_DebugPrint("\tdouble: %g\n\n", result ); +#endif + + } + + return result; +} + + +PaError Pa_ReadStream( PaStream* stream, + void *buffer, + unsigned long frames ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_ReadStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + if( frames == 0 ) + { + /* XXX: Should we not allow the implementation to signal any overflow condition? */ + result = paNoError; + } + else if( buffer == 0 ) + { + result = paBadBufferPtr; + } + else + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = PA_STREAM_INTERFACE(stream)->Read( stream, buffer, frames ); + } + else if( result == 1 ) + { + result = paStreamIsStopped; + } + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_ReadStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_WriteStream( PaStream* stream, + const void *buffer, + unsigned long frames ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_WriteStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + if( frames == 0 ) + { + /* XXX: Should we not allow the implementation to signal any underflow condition? */ + result = paNoError; + } + else if( buffer == 0 ) + { + result = paBadBufferPtr; + } + else + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = PA_STREAM_INTERFACE(stream)->Write( stream, buffer, frames ); + } + else if( result == 1 ) + { + result = paStreamIsStopped; + } + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_WriteStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + +signed long Pa_GetStreamReadAvailable( PaStream* stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + signed long result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamReadAvailable called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + result = 0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamReadAvailable returned:\n" ); + PaUtil_DebugPrint("\tunsigned long: 0 [ PaError error: %d ( %s ) ]\n\n", error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = PA_STREAM_INTERFACE(stream)->GetReadAvailable( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamReadAvailable returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + } + + return result; +} + + +signed long Pa_GetStreamWriteAvailable( PaStream* stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + signed long result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamWriteAvailable called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + result = 0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamWriteAvailable returned:\n" ); + PaUtil_DebugPrint("\tunsigned long: 0 [ PaError error: %d ( %s ) ]\n\n", error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = PA_STREAM_INTERFACE(stream)->GetWriteAvailable( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamWriteAvailable returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + } + + return result; +} + + +PaError Pa_GetSampleSize( PaSampleFormat format ) +{ + int result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetSampleSize called:\n" ); + PaUtil_DebugPrint("\tPaSampleFormat format: %d\n", format ); +#endif + + switch( format & ~paNonInterleaved ) + { + + case paUInt8: + case paInt8: + result = 1; + break; + + case paInt16: + result = 2; + break; + + case paInt24: + result = 3; + break; + + case paFloat32: + case paInt32: + result = 4; + break; + + default: + result = paSampleFormatNotSupported; + break; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetSampleSize returned:\n" ); + if( result > 0 ) + PaUtil_DebugPrint("\tint: %d\n\n", result ); + else + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return (PaError) result; +} + diff --git a/portaudio-v19/pa_common/pa_hostapi.h b/portaudio-v19/pa_common/pa_hostapi.h new file mode 100644 index 000000000..fec4e4871 --- /dev/null +++ b/portaudio-v19/pa_common/pa_hostapi.h @@ -0,0 +1,244 @@ +#ifndef PA_HOSTAPI_H +#define PA_HOSTAPI_H +/* + * $Id$ + * Portable Audio I/O Library + * host api representation + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Interface used by pa_front to virtualize functions which operate on + host APIs. +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** **FOR THE USE OF pa_front.c ONLY** + Do NOT use fields in this structure, they my change at any time. + Use functions defined in pa_util.h if you think you need functionality + which can be derived from here. +*/ +typedef struct PaUtilPrivatePaFrontHostApiInfo { + + + unsigned long baseDeviceIndex; +}PaUtilPrivatePaFrontHostApiInfo; + + +/** The common header for all data structures whose pointers are passed through + the hostApiSpecificStreamInfo field of the PaStreamParameters structure. + Note that in order to keep the public PortAudio interface clean, this structure + is not used explicitly when declaring hostApiSpecificStreamInfo data structures. + However, some code in pa_front depends on the first 3 members being equivalent + with this structure. + @see PaStreamParameters +*/ +typedef struct PaUtilHostApiSpecificStreamInfoHeader +{ + unsigned long size; /**< size of whole structure including this header */ + PaHostApiTypeId hostApiType; /**< host API for which this data is intended */ + unsigned long version; /**< structure version */ +} PaUtilHostApiSpecificStreamInfoHeader; + + + +/** A structure representing the interface to a host API. Contains both + concrete data and pointers to functions which implement the interface. +*/ +typedef struct PaUtilHostApiRepresentation { + PaUtilPrivatePaFrontHostApiInfo privatePaFrontInfo; + + /** The host api implementation should populate the info field. In the + case of info.defaultInputDevice and info.defaultOutputDevice the + values stored should be 0 based indices within the host api's own + device index range (0 to deviceCount). These values will be converted + to global device indices by pa_front after PaUtilHostApiInitializer() + returns. + */ + PaHostApiInfo info; + + PaDeviceInfo** deviceInfos; + + /** + (*Terminate)() is guaranteed to be called with a valid + parameter, which was previously returned from the same implementation's + initializer. + */ + void (*Terminate)( struct PaUtilHostApiRepresentation *hostApi ); + + /** + The inputParameters and outputParameters pointers should not be saved + as they will not remain valid after OpenStream is called. + + + The following guarantees are made about parameters to (*OpenStream)(): + + [NOTE: the following list up to *END PA FRONT VALIDATIONS* should be + kept in sync with the one for ValidateOpenStreamParameters and + Pa_OpenStream in pa_front.c] + + PaHostApiRepresentation *hostApi + - is valid for this implementation + + PaStream** stream + - is non-null + + - at least one of inputParameters & outputParmeters is valid (not NULL) + + - if inputParameters & outputParmeters are both valid, that + inputParameters->device & outputParmeters->device both use the same host api + + PaDeviceIndex inputParameters->device + - is within range (0 to Pa_CountDevices-1) Or: + - is paUseHostApiSpecificDeviceSpecification and + inputParameters->hostApiSpecificStreamInfo is non-NULL and refers + to a valid host api + + int inputParameters->numChannels + - if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, numInputChannels is > 0 + - upper bound is NOT validated against device capabilities + + PaSampleFormat inputParameters->sampleFormat + - is one of the sample formats defined in portaudio.h + + void *inputParameters->hostApiSpecificStreamInfo + - if supplied its hostApi field matches the input device's host Api + + PaDeviceIndex outputParmeters->device + - is within range (0 to Pa_CountDevices-1) + + int outputParmeters->numChannels + - if inputDevice is valid, numInputChannels is > 0 + - upper bound is NOT validated against device capabilities + + PaSampleFormat outputParmeters->sampleFormat + - is one of the sample formats defined in portaudio.h + + void *outputParmeters->hostApiSpecificStreamInfo + - if supplied its hostApi field matches the output device's host Api + + double sampleRate + - is not an 'absurd' rate (less than 1000. or greater than 200000.) + - sampleRate is NOT validated against device capabilities + + PaStreamFlags streamFlags + - unused platform neutral flags are zero + - paNeverDropInput is only used for full-duplex callback streams + with variable buffer size (paFramesPerBufferUnspecified) + + [*END PA FRONT VALIDATIONS*] + + + The following validations MUST be performed by (*OpenStream)(): + + - check that input device can support numInputChannels + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if inputStreamInfo is supplied, validate its contents, + or return an error if no inputStreamInfo is expected + + - check that output device can support numOutputChannels + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if outputStreamInfo is supplied, validate its contents, + or return an error if no outputStreamInfo is expected + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + - alter sampleRate to a close allowable rate if necessary + + - validate inputLatency and outputLatency + + - validate any platform specific flags, if flags are supplied they + must be valid. + */ + PaError (*OpenStream)( struct PaUtilHostApiRepresentation *hostApi, + PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerCallback, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); + + + PaError (*IsFormatSupported)( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +} PaUtilHostApiRepresentation; + + +/** Prototype for the initialization function which must be implemented by every + host API. + + @see paHostApiInitializers +*/ +typedef PaError PaUtilHostApiInitializer( PaUtilHostApiRepresentation**, PaHostApiIndex ); + + +/** paHostApiInitializers is a NULL-terminated array of host API initialization + functions. These functions are called by pa_front to initialize the host APIs + when the client calls Pa_Initialize(). + + There is a platform specific file which defines paHostApiInitializers for that + platform, pa_win/pa_win_hostapis.c contains the Win32 definitions for example. +*/ +extern PaUtilHostApiInitializer *paHostApiInitializers[]; + + +/** The index of the default host API in the paHostApiInitializers array. + + There is a platform specific file which defines paDefaultHostApiIndex for that + platform, see pa_win/pa_win_hostapis.c for example. +*/ +extern int paDefaultHostApiIndex; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_HOSTAPI_H */ diff --git a/portaudio-v19/pa_common/pa_process.c b/portaudio-v19/pa_common/pa_process.c new file mode 100644 index 000000000..837bbef35 --- /dev/null +++ b/portaudio-v19/pa_common/pa_process.c @@ -0,0 +1,1763 @@ +/* + * $Id$ + * Portable Audio I/O Library + * streamCallback <-> host buffer processing adapter + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Buffer Processor implementation. + + The code in this file is not optimised yet - although it's not clear that + it needs to be. there may appear to be redundancies + that could be factored into common functions, but the redundanceis are left + intentionally as each appearance may have different optimisation possibilities. + + The optimisations which are planned involve only converting data in-place + where possible, rather than copying to the temp buffer(s). + + Note that in the extreme case of being able to convert in-place, and there + being no conversion necessary there should be some code which short-circuits + the operation. + + @todo Consider cache tilings for intereave<->deinterleave. + + @todo implement timeInfo->currentTime int PaUtil_BeginBufferProcessing() + + @todo specify and implement some kind of logical policy for handling the + underflow and overflow stream flags when the underflow/overflow overlaps + multiple user buffers/callbacks. + + @todo provide support for priming the buffers with data from the callback. + The client interface is now implemented through PaUtil_SetNoInput() + which sets bp->hostInputChannels[0][0].data to zero. However this is + currently only implemented in NonAdaptingProcess(). It shouldn't be + needed for AdaptingInputOnlyProcess() (no priming should ever be + requested for AdaptingInputOnlyProcess()). + Not sure if additional work should be required to make it work with + AdaptingOutputOnlyProcess, but it definitely is required for + AdaptingProcess. + + @todo implement PaUtil_SetNoOutput for AdaptingProcess + + @todo don't allocate temp buffers for blocking streams unless they are + needed. At the moment they are needed, but perhaps for host APIs + where the implementation passes a buffer to the host they could be + used. +*/ + + +#include +#include /* memset() */ + +#include "pa_process.h" +#include "pa_util.h" + + +#define PA_FRAMES_PER_TEMP_BUFFER_WHEN_HOST_BUFFER_SIZE_IS_UNKNOWN_ 1024 + +#define PA_MIN_( a, b ) ( ((a)<(b)) ? (a) : (b) ) + + +/* greatest common divisor - PGCD in French */ +static unsigned long GCD( unsigned long a, unsigned long b ) +{ + return (b==0) ? a : GCD( b, a%b); +} + +/* least common multiple - PPCM in French */ +static unsigned long LCM( unsigned long a, unsigned long b ) +{ + return (a*b) / GCD(a,b); +} + +#define PA_MAX_( a, b ) (((a) > (b)) ? (a) : (b)) + +static unsigned long CalculateFrameShift( unsigned long M, unsigned long N ) +{ + unsigned long result = 0; + unsigned long i; + unsigned long lcm; + + assert( M > 0 ); + assert( N > 0 ); + + lcm = LCM( M, N ); + for( i = M; i < lcm; i += M ) + result = PA_MAX_( result, i % N ); + + return result; +} + + +PaError PaUtil_InitializeBufferProcessor( PaUtilBufferProcessor* bp, + int inputChannelCount, PaSampleFormat userInputSampleFormat, + PaSampleFormat hostInputSampleFormat, + int outputChannelCount, PaSampleFormat userOutputSampleFormat, + PaSampleFormat hostOutputSampleFormat, + double sampleRate, + PaStreamFlags streamFlags, + unsigned long framesPerUserBuffer, + unsigned long framesPerHostBuffer, + PaUtilHostBufferSizeMode hostBufferSizeMode, + PaStreamCallback *streamCallback, void *userData ) +{ + PaError result = paNoError; + PaError bytesPerSample; + unsigned long tempInputBufferSize, tempOutputBufferSize; + + if( streamFlags & paNeverDropInput ) + { + /* paNeverDropInput is only valid for full-duplex callback streams, with an unspecified number of frames per buffer. */ + if( !streamCallback || !(inputChannelCount > 0 && outputChannelCount > 0) || + framesPerUserBuffer != paFramesPerBufferUnspecified ) + return paInvalidFlag; + } + + /* initialize buffer ptrs to zero so they can be freed if necessary in error */ + bp->tempInputBuffer = 0; + bp->tempInputBufferPtrs = 0; + bp->tempOutputBuffer = 0; + bp->tempOutputBufferPtrs = 0; + + bp->framesPerUserBuffer = framesPerUserBuffer; + bp->framesPerHostBuffer = framesPerHostBuffer; + + bp->inputChannelCount = inputChannelCount; + bp->outputChannelCount = outputChannelCount; + + bp->hostBufferSizeMode = hostBufferSizeMode; + + bp->hostInputChannels[0] = bp->hostInputChannels[1] = 0; + bp->hostOutputChannels[0] = bp->hostOutputChannels[1] = 0; + + if( framesPerUserBuffer == 0 ) /* streamCallback will accept any buffer size */ + { + bp->useNonAdaptingProcess = 1; + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = 0; + + if( hostBufferSizeMode == paUtilFixedHostBufferSize + || hostBufferSizeMode == paUtilBoundedHostBufferSize ) + { + bp->framesPerTempBuffer = framesPerHostBuffer; + } + else /* unknown host buffer size */ + { + bp->framesPerTempBuffer = PA_FRAMES_PER_TEMP_BUFFER_WHEN_HOST_BUFFER_SIZE_IS_UNKNOWN_; + } + } + else + { + bp->framesPerTempBuffer = framesPerUserBuffer; + + if( hostBufferSizeMode == paUtilFixedHostBufferSize + && framesPerHostBuffer % framesPerUserBuffer == 0 ) + { + bp->useNonAdaptingProcess = 1; + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = 0; + } + else + { + bp->useNonAdaptingProcess = 0; + + if( inputChannelCount > 0 && outputChannelCount > 0 ) + { + /* full duplex */ + if( hostBufferSizeMode == paUtilFixedHostBufferSize ) + { + unsigned long frameShift = + CalculateFrameShift( framesPerHostBuffer, framesPerUserBuffer ); + + if( framesPerUserBuffer > framesPerHostBuffer ) + { + bp->initialFramesInTempInputBuffer = frameShift; + bp->initialFramesInTempOutputBuffer = 0; + } + else + { + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = frameShift; + } + } + else /* variable host buffer size, add framesPerUserBuffer latency */ + { + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = framesPerUserBuffer; + } + } + else + { + /* half duplex */ + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = 0; + } + } + } + + + bp->framesInTempInputBuffer = bp->initialFramesInTempInputBuffer; + bp->framesInTempOutputBuffer = bp->initialFramesInTempOutputBuffer; + + + if( inputChannelCount > 0 ) + { + bytesPerSample = Pa_GetSampleSize( hostInputSampleFormat ); + if( bytesPerSample > 0 ) + { + bp->bytesPerHostInputSample = bytesPerSample; + } + else + { + result = bytesPerSample; + goto error; + } + + bytesPerSample = Pa_GetSampleSize( userInputSampleFormat ); + if( bytesPerSample > 0 ) + { + bp->bytesPerUserInputSample = bytesPerSample; + } + else + { + result = bytesPerSample; + goto error; + } + + bp->inputConverter = + PaUtil_SelectConverter( hostInputSampleFormat, userInputSampleFormat, streamFlags ); + + bp->inputZeroer = PaUtil_SelectZeroer( hostInputSampleFormat ); + + bp->userInputIsInterleaved = (userInputSampleFormat & paNonInterleaved)?0:1; + + + tempInputBufferSize = + bp->framesPerTempBuffer * bp->bytesPerUserInputSample * inputChannelCount; + + bp->tempInputBuffer = PaUtil_AllocateMemory( tempInputBufferSize ); + if( bp->tempInputBuffer == 0 ) + { + result = paInsufficientMemory; + goto error; + } + + if( bp->framesInTempInputBuffer > 0 ) + memset( bp->tempInputBuffer, 0, tempInputBufferSize ); + + if( userInputSampleFormat & paNonInterleaved ) + { + bp->tempInputBufferPtrs = + (void **)PaUtil_AllocateMemory( sizeof(void*)*inputChannelCount ); + if( bp->tempInputBufferPtrs == 0 ) + { + result = paInsufficientMemory; + goto error; + } + } + + bp->hostInputChannels[0] = (PaUtilChannelDescriptor*) + PaUtil_AllocateMemory( sizeof(PaUtilChannelDescriptor) * inputChannelCount * 2); + if( bp->hostInputChannels[0] == 0 ) + { + result = paInsufficientMemory; + goto error; + } + + bp->hostInputChannels[1] = &bp->hostInputChannels[0][inputChannelCount]; + } + + if( outputChannelCount > 0 ) + { + bytesPerSample = Pa_GetSampleSize( hostOutputSampleFormat ); + if( bytesPerSample > 0 ) + { + bp->bytesPerHostOutputSample = bytesPerSample; + } + else + { + result = bytesPerSample; + goto error; + } + + bytesPerSample = Pa_GetSampleSize( userOutputSampleFormat ); + if( bytesPerSample > 0 ) + { + bp->bytesPerUserOutputSample = bytesPerSample; + } + else + { + result = bytesPerSample; + goto error; + } + + bp->outputConverter = + PaUtil_SelectConverter( userOutputSampleFormat, hostOutputSampleFormat, streamFlags ); + + bp->outputZeroer = PaUtil_SelectZeroer( hostOutputSampleFormat ); + + bp->userOutputIsInterleaved = (userOutputSampleFormat & paNonInterleaved)?0:1; + + tempOutputBufferSize = + bp->framesPerTempBuffer * bp->bytesPerUserOutputSample * outputChannelCount; + + bp->tempOutputBuffer = PaUtil_AllocateMemory( tempOutputBufferSize ); + if( bp->tempOutputBuffer == 0 ) + { + result = paInsufficientMemory; + goto error; + } + + if( bp->framesInTempOutputBuffer > 0 ) + memset( bp->tempOutputBuffer, 0, tempOutputBufferSize ); + + if( userOutputSampleFormat & paNonInterleaved ) + { + bp->tempOutputBufferPtrs = + (void **)PaUtil_AllocateMemory( sizeof(void*)*outputChannelCount ); + if( bp->tempOutputBufferPtrs == 0 ) + { + result = paInsufficientMemory; + goto error; + } + } + + bp->hostOutputChannels[0] = (PaUtilChannelDescriptor*) + PaUtil_AllocateMemory( sizeof(PaUtilChannelDescriptor)*outputChannelCount * 2 ); + if( bp->hostOutputChannels[0] == 0 ) + { + result = paInsufficientMemory; + goto error; + } + + bp->hostOutputChannels[1] = &bp->hostOutputChannels[0][outputChannelCount]; + } + + PaUtil_InitializeTriangularDitherState( &bp->ditherGenerator ); + + bp->samplePeriod = 1. / sampleRate; + + bp->streamCallback = streamCallback; + bp->userData = userData; + + return result; + +error: + if( bp->tempInputBuffer ) + PaUtil_FreeMemory( bp->tempInputBuffer ); + + if( bp->tempInputBufferPtrs ) + PaUtil_FreeMemory( bp->tempInputBufferPtrs ); + + if( bp->hostInputChannels[0] ) + PaUtil_FreeMemory( bp->hostInputChannels[0] ); + + if( bp->tempOutputBuffer ) + PaUtil_FreeMemory( bp->tempOutputBuffer ); + + if( bp->tempOutputBufferPtrs ) + PaUtil_FreeMemory( bp->tempOutputBufferPtrs ); + + if( bp->hostOutputChannels[0] ) + PaUtil_FreeMemory( bp->hostOutputChannels[0] ); + + return result; +} + + +void PaUtil_TerminateBufferProcessor( PaUtilBufferProcessor* bp ) +{ + if( bp->tempInputBuffer ) + PaUtil_FreeMemory( bp->tempInputBuffer ); + + if( bp->tempInputBufferPtrs ) + PaUtil_FreeMemory( bp->tempInputBufferPtrs ); + + if( bp->hostInputChannels[0] ) + PaUtil_FreeMemory( bp->hostInputChannels[0] ); + + if( bp->tempOutputBuffer ) + PaUtil_FreeMemory( bp->tempOutputBuffer ); + + if( bp->tempOutputBufferPtrs ) + PaUtil_FreeMemory( bp->tempOutputBufferPtrs ); + + if( bp->hostOutputChannels[0] ) + PaUtil_FreeMemory( bp->hostOutputChannels[0] ); +} + + +void PaUtil_ResetBufferProcessor( PaUtilBufferProcessor* bp ) +{ + unsigned long tempInputBufferSize, tempOutputBufferSize; + + bp->framesInTempInputBuffer = bp->initialFramesInTempInputBuffer; + bp->framesInTempOutputBuffer = bp->initialFramesInTempOutputBuffer; + + if( bp->framesInTempInputBuffer > 0 ) + { + tempInputBufferSize = + bp->framesPerTempBuffer * bp->bytesPerUserInputSample * bp->inputChannelCount; + memset( bp->tempInputBuffer, 0, tempInputBufferSize ); + } + + if( bp->framesInTempOutputBuffer > 0 ) + { + tempOutputBufferSize = + bp->framesPerTempBuffer * bp->bytesPerUserOutputSample * bp->outputChannelCount; + memset( bp->tempOutputBuffer, 0, tempOutputBufferSize ); + } +} + + +unsigned long PaUtil_GetBufferProcessorInputLatency( PaUtilBufferProcessor* bp ) +{ + return bp->initialFramesInTempInputBuffer; +} + + +unsigned long PaUtil_GetBufferProcessorOutputLatency( PaUtilBufferProcessor* bp ) +{ + return bp->initialFramesInTempOutputBuffer; +} + + +void PaUtil_SetInputFrameCount( PaUtilBufferProcessor* bp, + unsigned long frameCount ) +{ + if( frameCount == 0 ) + bp->hostInputFrameCount[0] = bp->framesPerHostBuffer; + else + bp->hostInputFrameCount[0] = frameCount; +} + + +void PaUtil_SetNoInput( PaUtilBufferProcessor* bp ) +{ + assert( bp->inputChannelCount > 0 ); + + bp->hostInputChannels[0][0].data = 0; +} + + +void PaUtil_SetInputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data, unsigned int stride ) +{ + assert( channel < bp->inputChannelCount ); + + bp->hostInputChannels[0][channel].data = data; + bp->hostInputChannels[0][channel].stride = stride; +} + + +void PaUtil_SetInterleavedInputChannels( PaUtilBufferProcessor* bp, + unsigned int firstChannel, void *data, unsigned int channelCount ) +{ + unsigned int i; + unsigned int channel = firstChannel; + unsigned char *p = (unsigned char*)data; + + if( channelCount == 0 ) + channelCount = bp->inputChannelCount; + + assert( firstChannel < bp->inputChannelCount ); + assert( firstChannel + channelCount <= bp->inputChannelCount ); + + for( i=0; i< channelCount; ++i ) + { + bp->hostInputChannels[0][channel+i].data = p; + p += bp->bytesPerHostInputSample; + bp->hostInputChannels[0][channel+i].stride = channelCount; + } +} + + +void PaUtil_SetNonInterleavedInputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data ) +{ + assert( channel < bp->inputChannelCount ); + + bp->hostInputChannels[0][channel].data = data; + bp->hostInputChannels[0][channel].stride = 1; +} + + +void PaUtil_Set2ndInputFrameCount( PaUtilBufferProcessor* bp, + unsigned long frameCount ) +{ + bp->hostInputFrameCount[1] = frameCount; +} + + +void PaUtil_Set2ndInputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data, unsigned int stride ) +{ + assert( channel < bp->inputChannelCount ); + + bp->hostInputChannels[1][channel].data = data; + bp->hostInputChannels[1][channel].stride = stride; +} + + +void PaUtil_Set2ndInterleavedInputChannels( PaUtilBufferProcessor* bp, + unsigned int firstChannel, void *data, unsigned int channelCount ) +{ + unsigned int i; + unsigned int channel = firstChannel; + unsigned char *p = (unsigned char*)data; + + if( channelCount == 0 ) + channelCount = bp->inputChannelCount; + + assert( firstChannel < bp->inputChannelCount ); + assert( firstChannel + channelCount <= bp->inputChannelCount ); + + for( i=0; i< channelCount; ++i ) + { + bp->hostInputChannels[1][channel+i].data = p; + p += bp->bytesPerHostInputSample; + bp->hostInputChannels[1][channel+i].stride = channelCount; + } +} + + +void PaUtil_Set2ndNonInterleavedInputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data ) +{ + assert( channel < bp->inputChannelCount ); + + bp->hostInputChannels[1][channel].data = data; + bp->hostInputChannels[1][channel].stride = 1; +} + + +void PaUtil_SetOutputFrameCount( PaUtilBufferProcessor* bp, + unsigned long frameCount ) +{ + if( frameCount == 0 ) + bp->hostOutputFrameCount[0] = bp->framesPerHostBuffer; + else + bp->hostOutputFrameCount[0] = frameCount; +} + + +void PaUtil_SetNoOutput( PaUtilBufferProcessor* bp ) +{ + assert( bp->outputChannelCount > 0 ); + + bp->hostOutputChannels[0][0].data = 0; +} + + +void PaUtil_SetOutputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data, unsigned int stride ) +{ + assert( channel < bp->outputChannelCount ); + assert( data != NULL ); + + bp->hostOutputChannels[0][channel].data = data; + bp->hostOutputChannels[0][channel].stride = stride; +} + + +void PaUtil_SetInterleavedOutputChannels( PaUtilBufferProcessor* bp, + unsigned int firstChannel, void *data, unsigned int channelCount ) +{ + unsigned int i; + unsigned int channel = firstChannel; + unsigned char *p = (unsigned char*)data; + + if( channelCount == 0 ) + channelCount = bp->outputChannelCount; + + assert( firstChannel < bp->outputChannelCount ); + assert( firstChannel + channelCount <= bp->outputChannelCount ); + + for( i=0; i< channelCount; ++i ) + { + PaUtil_SetOutputChannel( bp, channel + i, p, channelCount ); + p += bp->bytesPerHostOutputSample; + } +} + + +void PaUtil_SetNonInterleavedOutputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data ) +{ + assert( channel < bp->outputChannelCount ); + + PaUtil_SetOutputChannel( bp, channel, data, 1 ); +} + + +void PaUtil_Set2ndOutputFrameCount( PaUtilBufferProcessor* bp, + unsigned long frameCount ) +{ + bp->hostOutputFrameCount[1] = frameCount; +} + + +void PaUtil_Set2ndOutputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data, unsigned int stride ) +{ + assert( channel < bp->outputChannelCount ); + assert( data != NULL ); + + bp->hostOutputChannels[1][channel].data = data; + bp->hostOutputChannels[1][channel].stride = stride; +} + + +void PaUtil_Set2ndInterleavedOutputChannels( PaUtilBufferProcessor* bp, + unsigned int firstChannel, void *data, unsigned int channelCount ) +{ + unsigned int i; + unsigned int channel = firstChannel; + unsigned char *p = (unsigned char*)data; + + if( channelCount == 0 ) + channelCount = bp->outputChannelCount; + + assert( firstChannel < bp->outputChannelCount ); + assert( firstChannel + channelCount <= bp->outputChannelCount ); + + for( i=0; i< channelCount; ++i ) + { + PaUtil_Set2ndOutputChannel( bp, channel + i, p, channelCount ); + p += bp->bytesPerHostOutputSample; + } +} + + +void PaUtil_Set2ndNonInterleavedOutputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data ) +{ + assert( channel < bp->outputChannelCount ); + + PaUtil_Set2ndOutputChannel( bp, channel, data, 1 ); +} + + +void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bp, + PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags callbackStatusFlags ) +{ + bp->timeInfo = timeInfo; + + /* the first streamCallback will be called to process samples which are + currently in the input buffer before the ones starting at the timeInfo time */ + + bp->timeInfo->inputBufferAdcTime -= bp->framesInTempInputBuffer * bp->samplePeriod; + + bp->timeInfo->currentTime = 0; /** FIXME: @todo time info currentTime not implemented */ + + /* the first streamCallback will be called to generate samples which will be + outputted after the frames currently in the output buffer have been + outputted. */ + bp->timeInfo->outputBufferDacTime += bp->framesInTempOutputBuffer * bp->samplePeriod; + + bp->callbackStatusFlags = callbackStatusFlags; + + bp->hostInputFrameCount[1] = 0; + bp->hostOutputFrameCount[1] = 0; +} + + +/* + NonAdaptingProcess() is a simple buffer copying adaptor that can handle + both full and half duplex copies. It processes framesToProcess frames, + broken into blocks bp->framesPerTempBuffer long. + This routine can be used when the streamCallback doesn't care what length + the buffers are, or when framesToProcess is an integer multiple of + bp->framesPerTempBuffer, in which case streamCallback will always be called + with bp->framesPerTempBuffer samples. +*/ +static unsigned long NonAdaptingProcess( PaUtilBufferProcessor *bp, + int *streamCallbackResult, + PaUtilChannelDescriptor *hostInputChannels, + PaUtilChannelDescriptor *hostOutputChannels, + unsigned long framesToProcess ) +{ + void *userInput, *userOutput; + unsigned char *srcBytePtr, *destBytePtr; + unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + unsigned long frameCount; + unsigned long framesToGo = framesToProcess; + unsigned long framesProcessed = 0; + + + if( *streamCallbackResult == paContinue ) + { + do + { + frameCount = PA_MIN_( bp->framesPerTempBuffer, framesToGo ); + + /* configure user input buffer and convert input data (host -> user) */ + if( bp->inputChannelCount == 0 ) + { + /* no input */ + userInput = 0; + } + else /* there are input channels */ + { + /* + could use more elaborate logic here and sometimes process + buffers in-place. + */ + + destBytePtr = (unsigned char *)bp->tempInputBuffer; + + if( bp->userInputIsInterleaved ) + { + destSampleStrideSamples = bp->inputChannelCount; + destChannelStrideBytes = bp->bytesPerUserInputSample; + userInput = bp->tempInputBuffer; + } + else /* user input is not interleaved */ + { + destSampleStrideSamples = 1; + destChannelStrideBytes = frameCount * bp->bytesPerUserInputSample; + + /* setup non-interleaved ptrs */ + for( i=0; iinputChannelCount; ++i ) + { + bp->tempInputBufferPtrs[i] = ((unsigned char*)bp->tempInputBuffer) + + i * bp->bytesPerUserInputSample * frameCount; + } + + userInput = bp->tempInputBufferPtrs; + } + + if( !bp->hostInputChannels[0][0].data ) + { + /* no input was supplied (see PaUtil_SetNoInput), so + zero the input buffer */ + + for( i=0; iinputChannelCount; ++i ) + { + bp->inputZeroer( destBytePtr, destSampleStrideSamples, frameCount ); + destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ + } + } + else + { + for( i=0; iinputChannelCount; ++i ) + { + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + frameCount, &bp->ditherGenerator ); + + destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ + + /* advance src ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + frameCount * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + } + } + + /* configure user output buffer */ + if( bp->outputChannelCount == 0 ) + { + /* no output */ + userOutput = 0; + } + else /* there are output channels */ + { + if( bp->userOutputIsInterleaved ) + { + userOutput = bp->tempOutputBuffer; + } + else /* user output is not interleaved */ + { + for( i = 0; i < bp->outputChannelCount; ++i ) + { + bp->tempOutputBufferPtrs[i] = ((unsigned char*)bp->tempOutputBuffer) + + i * bp->bytesPerUserOutputSample * frameCount; + } + + userOutput = bp->tempOutputBufferPtrs; + } + } + + *streamCallbackResult = bp->streamCallback( userInput, userOutput, + frameCount, bp->timeInfo, bp->callbackStatusFlags, bp->userData ); + + if( *streamCallbackResult == paAbort ) + { + /* callback returned paAbort, don't advance framesProcessed + and framesToGo, they will be handled below */ + } + else + { + bp->timeInfo->inputBufferAdcTime += frameCount * bp->samplePeriod; + bp->timeInfo->outputBufferDacTime += frameCount * bp->samplePeriod; + + /* convert output data (user -> host) */ + + if( bp->outputChannelCount != 0 && bp->hostOutputChannels[0][0].data ) + { + /* + could use more elaborate logic here and sometimes process + buffers in-place. + */ + + srcBytePtr = (unsigned char *)bp->tempOutputBuffer; + + if( bp->userOutputIsInterleaved ) + { + srcSampleStrideSamples = bp->outputChannelCount; + srcChannelStrideBytes = bp->bytesPerUserOutputSample; + } + else /* user output is not interleaved */ + { + srcSampleStrideSamples = 1; + srcChannelStrideBytes = frameCount * bp->bytesPerUserOutputSample; + } + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + frameCount, &bp->ditherGenerator ); + + srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + } + + framesProcessed += frameCount; + + framesToGo -= frameCount; + } + } + while( framesToGo > 0 && *streamCallbackResult == paContinue ); + } + + if( framesToGo > 0 ) + { + /* zero any remaining frames output. There will only be remaining frames + if the callback has returned paComplete or paAbort */ + + frameCount = framesToGo; + + if( bp->outputChannelCount != 0 && bp->hostOutputChannels[0][0].data ) + { + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputZeroer( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + frameCount ); + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + } + + framesProcessed += frameCount; + } + + return framesProcessed; +} + + +/* + AdaptingInputOnlyProcess() is a half duplex input buffer processor. It + converts data from the input buffers into the temporary input buffer, + when the temporary input buffer is full, it calls the streamCallback. +*/ +static unsigned long AdaptingInputOnlyProcess( PaUtilBufferProcessor *bp, + int *streamCallbackResult, + PaUtilChannelDescriptor *hostInputChannels, + unsigned long framesToProcess ) +{ + void *userInput, *userOutput; + unsigned char *destBytePtr; + unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + unsigned long frameCount; + unsigned long framesToGo = framesToProcess; + unsigned long framesProcessed = 0; + + userOutput = 0; + + do + { + frameCount = ( bp->framesInTempInputBuffer + framesToGo > bp->framesPerUserBuffer ) + ? ( bp->framesPerUserBuffer - bp->framesInTempInputBuffer ) + : framesToGo; + + /* convert frameCount samples into temp buffer */ + + if( bp->userInputIsInterleaved ) + { + destBytePtr = ((unsigned char*)bp->tempInputBuffer) + + bp->bytesPerUserInputSample * bp->inputChannelCount * + bp->framesInTempInputBuffer; + + destSampleStrideSamples = bp->inputChannelCount; + destChannelStrideBytes = bp->bytesPerUserInputSample; + + userInput = bp->tempInputBuffer; + } + else /* user input is not interleaved */ + { + destBytePtr = ((unsigned char*)bp->tempInputBuffer) + + bp->bytesPerUserInputSample * bp->framesInTempInputBuffer; + + destSampleStrideSamples = 1; + destChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserInputSample; + + /* setup non-interleaved ptrs */ + for( i=0; iinputChannelCount; ++i ) + { + bp->tempInputBufferPtrs[i] = ((unsigned char*)bp->tempInputBuffer) + + i * bp->bytesPerUserInputSample * bp->framesPerUserBuffer; + } + + userInput = bp->tempInputBufferPtrs; + } + + for( i=0; iinputChannelCount; ++i ) + { + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + frameCount, &bp->ditherGenerator ); + + destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ + + /* advance src ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + frameCount * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + + bp->framesInTempInputBuffer += frameCount; + + if( bp->framesInTempInputBuffer == bp->framesPerUserBuffer ) + { + /** + @todo (non-critical optimisation) + The conditional below implements the continue/complete/abort mechanism + simply by continuing on iterating through the input buffer, but not + passing the data to the callback. With care, the outer loop could be + terminated earlier, thus some unneeded conversion cycles would be + saved. + */ + if( *streamCallbackResult == paContinue ) + { + bp->timeInfo->outputBufferDacTime = 0; + + *streamCallbackResult = bp->streamCallback( userInput, userOutput, + bp->framesPerUserBuffer, bp->timeInfo, + bp->callbackStatusFlags, bp->userData ); + + bp->timeInfo->inputBufferAdcTime += frameCount * bp->samplePeriod; + } + + bp->framesInTempInputBuffer = 0; + } + + framesProcessed += frameCount; + + framesToGo -= frameCount; + }while( framesToGo > 0 ); + + return framesProcessed; +} + + +/* + AdaptingOutputOnlyProcess() is a half duplex output buffer processor. + It converts data from the temporary output buffer, to the output buffers, + when the temporary output buffer is empty, it calls the streamCallback. +*/ +static unsigned long AdaptingOutputOnlyProcess( PaUtilBufferProcessor *bp, + int *streamCallbackResult, + PaUtilChannelDescriptor *hostOutputChannels, + unsigned long framesToProcess ) +{ + void *userInput, *userOutput; + unsigned char *srcBytePtr; + unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + unsigned long frameCount; + unsigned long framesToGo = framesToProcess; + unsigned long framesProcessed = 0; + + do + { + if( bp->framesInTempOutputBuffer == 0 && *streamCallbackResult == paContinue ) + { + userInput = 0; + + /* setup userOutput */ + if( bp->userOutputIsInterleaved ) + { + userOutput = bp->tempOutputBuffer; + } + else /* user output is not interleaved */ + { + for( i = 0; i < bp->outputChannelCount; ++i ) + { + bp->tempOutputBufferPtrs[i] = ((unsigned char*)bp->tempOutputBuffer) + + i * bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; + } + + userOutput = bp->tempOutputBufferPtrs; + } + + bp->timeInfo->inputBufferAdcTime = 0; + + *streamCallbackResult = bp->streamCallback( userInput, userOutput, + bp->framesPerUserBuffer, bp->timeInfo, + bp->callbackStatusFlags, bp->userData ); + + if( *streamCallbackResult == paAbort ) + { + /* if the callback returned paAbort, we disregard its output */ + } + else + { + bp->timeInfo->outputBufferDacTime += bp->framesPerUserBuffer * bp->samplePeriod; + + bp->framesInTempOutputBuffer = bp->framesPerUserBuffer; + } + } + + if( bp->framesInTempOutputBuffer > 0 ) + { + /* convert frameCount frames from user buffer to host buffer */ + + frameCount = PA_MIN_( bp->framesInTempOutputBuffer, framesToGo ); + + if( bp->userOutputIsInterleaved ) + { + srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + + bp->bytesPerUserOutputSample * bp->outputChannelCount * + (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); + + srcSampleStrideSamples = bp->outputChannelCount; + srcChannelStrideBytes = bp->bytesPerUserOutputSample; + } + else /* user output is not interleaved */ + { + srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + + bp->bytesPerUserOutputSample * + (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); + + srcSampleStrideSamples = 1; + srcChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; + } + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + frameCount, &bp->ditherGenerator ); + + srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + + bp->framesInTempOutputBuffer -= frameCount; + } + else + { + /* no more user data is available because the callback has returned + paComplete or paAbort. Fill the remainder of the host buffer + with zeros. + */ + + frameCount = framesToGo; + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputZeroer( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + frameCount ); + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + } + + framesProcessed += frameCount; + + framesToGo -= frameCount; + + }while( framesToGo > 0 ); + + return framesProcessed; +} + +/* CopyTempOutputBuffersToHostOutputBuffers is called from AdaptingProcess to copy frames from + tempOutputBuffer to hostOutputChannels. This includes data conversion + and interleaving. +*/ +static void CopyTempOutputBuffersToHostOutputBuffers( PaUtilBufferProcessor *bp) +{ + unsigned long maxFramesToCopy; + PaUtilChannelDescriptor *hostOutputChannels; + unsigned int frameCount; + unsigned char *srcBytePtr; + unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + + /* copy frames from user to host output buffers */ + while( bp->framesInTempOutputBuffer > 0 && + ((bp->hostOutputFrameCount[0] + bp->hostOutputFrameCount[1]) > 0) ) + { + maxFramesToCopy = bp->framesInTempOutputBuffer; + + /* select the output buffer set (1st or 2nd) */ + if( bp->hostOutputFrameCount[0] > 0 ) + { + hostOutputChannels = bp->hostOutputChannels[0]; + frameCount = PA_MIN_( bp->hostOutputFrameCount[0], maxFramesToCopy ); + } + else + { + hostOutputChannels = bp->hostOutputChannels[1]; + frameCount = PA_MIN_( bp->hostOutputFrameCount[1], maxFramesToCopy ); + } + + if( bp->userOutputIsInterleaved ) + { + srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + + bp->bytesPerUserOutputSample * bp->outputChannelCount * + (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); + + srcSampleStrideSamples = bp->outputChannelCount; + srcChannelStrideBytes = bp->bytesPerUserOutputSample; + } + else /* user output is not interleaved */ + { + srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + + bp->bytesPerUserOutputSample * + (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); + + srcSampleStrideSamples = 1; + srcChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; + } + + for( i=0; ioutputChannelCount; ++i ) + { + assert( hostOutputChannels[i].data != NULL ); + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + frameCount, &bp->ditherGenerator ); + + srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + + if( bp->hostOutputFrameCount[0] > 0 ) + bp->hostOutputFrameCount[0] -= frameCount; + else + bp->hostOutputFrameCount[1] -= frameCount; + + bp->framesInTempOutputBuffer -= frameCount; + } +} + +/* + AdaptingProcess is a full duplex adapting buffer processor. It converts + data from the temporary output buffer into the host output buffers, then + from the host input buffers into the temporary input buffers. Calling the + streamCallback when necessary. + When processPartialUserBuffers is 0, all available input data will be + consumed and all available output space will be filled. When + processPartialUserBuffers is non-zero, as many full user buffers + as possible will be processed, but partial buffers will not be consumed. +*/ +static unsigned long AdaptingProcess( PaUtilBufferProcessor *bp, + int *streamCallbackResult, int processPartialUserBuffers ) +{ + void *userInput, *userOutput; + unsigned long framesProcessed = 0; + unsigned long framesAvailable; + unsigned long endProcessingMinFrameCount; + unsigned long maxFramesToCopy; + PaUtilChannelDescriptor *hostInputChannels, *hostOutputChannels; + unsigned int frameCount; + unsigned char *destBytePtr; + unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i, j; + + + framesAvailable = bp->hostInputFrameCount[0] + bp->hostInputFrameCount[1];/* this is assumed to be the same as the output buffer's frame count */ + + if( processPartialUserBuffers ) + endProcessingMinFrameCount = 0; + else + endProcessingMinFrameCount = (bp->framesPerUserBuffer - 1); + + /* Fill host output with remaining frames in user output (tempOutputBuffer) */ + CopyTempOutputBuffersToHostOutputBuffers( bp ); + + while( framesAvailable > endProcessingMinFrameCount ) + { + + if( bp->framesInTempOutputBuffer == 0 && *streamCallbackResult != paContinue ) + { + /* the callback will not be called any more, so zero what remains + of the host output buffers */ + + for( i=0; i<2; ++i ) + { + frameCount = bp->hostOutputFrameCount[i]; + if( frameCount > 0 ) + { + hostOutputChannels = bp->hostOutputChannels[i]; + + for( j=0; joutputChannelCount; ++j ) + { + bp->outputZeroer( hostOutputChannels[j].data, + hostOutputChannels[j].stride, + frameCount ); + + /* advance dest ptr for next iteration */ + hostOutputChannels[j].data = ((unsigned char*)hostOutputChannels[j].data) + + frameCount * hostOutputChannels[j].stride * bp->bytesPerHostOutputSample; + } + bp->hostOutputFrameCount[i] = 0; + } + } + } + + + /* copy frames from host to user input buffers */ + while( bp->framesInTempInputBuffer < bp->framesPerUserBuffer && + ((bp->hostInputFrameCount[0] + bp->hostInputFrameCount[1]) > 0) ) + { + maxFramesToCopy = bp->framesPerUserBuffer - bp->framesInTempInputBuffer; + + /* select the input buffer set (1st or 2nd) */ + if( bp->hostInputFrameCount[0] > 0 ) + { + hostInputChannels = bp->hostInputChannels[0]; + frameCount = PA_MIN_( bp->hostInputFrameCount[0], maxFramesToCopy ); + } + else + { + hostInputChannels = bp->hostInputChannels[1]; + frameCount = PA_MIN_( bp->hostInputFrameCount[1], maxFramesToCopy ); + } + + /* configure conversion destination pointers */ + if( bp->userInputIsInterleaved ) + { + destBytePtr = ((unsigned char*)bp->tempInputBuffer) + + bp->bytesPerUserInputSample * bp->inputChannelCount * + bp->framesInTempInputBuffer; + + destSampleStrideSamples = bp->inputChannelCount; + destChannelStrideBytes = bp->bytesPerUserInputSample; + } + else /* user input is not interleaved */ + { + destBytePtr = ((unsigned char*)bp->tempInputBuffer) + + bp->bytesPerUserInputSample * bp->framesInTempInputBuffer; + + destSampleStrideSamples = 1; + destChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserInputSample; + } + + for( i=0; iinputChannelCount; ++i ) + { + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + frameCount, &bp->ditherGenerator ); + + destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ + + /* advance src ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + frameCount * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + + if( bp->hostInputFrameCount[0] > 0 ) + bp->hostInputFrameCount[0] -= frameCount; + else + bp->hostInputFrameCount[1] -= frameCount; + + bp->framesInTempInputBuffer += frameCount; + + /* update framesAvailable and framesProcessed based on input consumed + unless something is very wrong this will also correspond to the + amount of output generated */ + framesAvailable -= frameCount; + framesProcessed += frameCount; + } + + /* call streamCallback */ + if( bp->framesInTempInputBuffer == bp->framesPerUserBuffer && + bp->framesInTempOutputBuffer == 0 ) + { + if( *streamCallbackResult == paContinue ) + { + /* setup userInput */ + if( bp->userInputIsInterleaved ) + { + userInput = bp->tempInputBuffer; + } + else /* user input is not interleaved */ + { + for( i = 0; i < bp->inputChannelCount; ++i ) + { + bp->tempInputBufferPtrs[i] = ((unsigned char*)bp->tempInputBuffer) + + i * bp->framesPerUserBuffer * bp->bytesPerUserInputSample; + } + + userInput = bp->tempInputBufferPtrs; + } + + /* setup userOutput */ + if( bp->userOutputIsInterleaved ) + { + userOutput = bp->tempOutputBuffer; + } + else /* user output is not interleaved */ + { + for( i = 0; i < bp->outputChannelCount; ++i ) + { + bp->tempOutputBufferPtrs[i] = ((unsigned char*)bp->tempOutputBuffer) + + i * bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; + } + + userOutput = bp->tempOutputBufferPtrs; + } + + /* call streamCallback */ + + *streamCallbackResult = bp->streamCallback( userInput, userOutput, + bp->framesPerUserBuffer, bp->timeInfo, + bp->callbackStatusFlags, bp->userData ); + + bp->timeInfo->inputBufferAdcTime += bp->framesPerUserBuffer * bp->samplePeriod; + bp->timeInfo->outputBufferDacTime += bp->framesPerUserBuffer * bp->samplePeriod; + + bp->framesInTempInputBuffer = 0; + + if( *streamCallbackResult == paAbort ) + bp->framesInTempOutputBuffer = 0; + else + bp->framesInTempOutputBuffer = bp->framesPerUserBuffer; + } + else + { + /* paComplete or paAbort has already been called. */ + + bp->framesInTempInputBuffer = 0; + } + } + + /* copy frames from user (tempOutputBuffer) to host output buffers (hostOutputChannels) + Means to process the user output provided by the callback. Has to be called after + each callback. */ + CopyTempOutputBuffersToHostOutputBuffers( bp ); + + } + + return framesProcessed; +} + + +unsigned long PaUtil_EndBufferProcessing( PaUtilBufferProcessor* bp, int *streamCallbackResult ) +{ + unsigned long framesToProcess, framesToGo; + unsigned long framesProcessed = 0; + + if( bp->inputChannelCount != 0 && bp->outputChannelCount != 0 + && bp->hostInputChannels[0][0].data /* input was supplied (see PaUtil_SetNoInput) */ + && bp->hostOutputChannels[0][0].data /* output was supplied (see PaUtil_SetNoOutput) */ ) + { + assert( (bp->hostInputFrameCount[0] + bp->hostInputFrameCount[1]) == + (bp->hostOutputFrameCount[0] + bp->hostOutputFrameCount[1]) ); + } + + assert( *streamCallbackResult == paContinue + || *streamCallbackResult == paComplete + || *streamCallbackResult == paAbort ); /* don't forget to pass in a valid callback result value */ + + if( bp->useNonAdaptingProcess ) + { + if( bp->inputChannelCount != 0 && bp->outputChannelCount != 0 ) + { + /* full duplex non-adapting process, splice buffers if they are + different lengths */ + + framesToGo = bp->hostOutputFrameCount[0] + bp->hostOutputFrameCount[1]; /* relies on assert above for input/output equivalence */ + + do{ + unsigned long noInputInputFrameCount; + unsigned long *hostInputFrameCount; + PaUtilChannelDescriptor *hostInputChannels; + unsigned long noOutputOutputFrameCount; + unsigned long *hostOutputFrameCount; + PaUtilChannelDescriptor *hostOutputChannels; + unsigned long framesProcessedThisIteration; + + if( !bp->hostInputChannels[0][0].data ) + { + /* no input was supplied (see PaUtil_SetNoInput) + NonAdaptingProcess knows how to deal with this + */ + noInputInputFrameCount = framesToGo; + hostInputFrameCount = &noInputInputFrameCount; + hostInputChannels = 0; + } + else if( bp->hostInputFrameCount[0] != 0 ) + { + hostInputFrameCount = &bp->hostInputFrameCount[0]; + hostInputChannels = bp->hostInputChannels[0]; + } + else + { + hostInputFrameCount = &bp->hostInputFrameCount[1]; + hostInputChannels = bp->hostInputChannels[1]; + } + + if( !bp->hostOutputChannels[0][0].data ) + { + /* no output was supplied (see PaUtil_SetNoOutput) + NonAdaptingProcess knows how to deal with this + */ + noOutputOutputFrameCount = framesToGo; + hostOutputFrameCount = &noOutputOutputFrameCount; + hostOutputChannels = 0; + } + if( bp->hostOutputFrameCount[0] != 0 ) + { + hostOutputFrameCount = &bp->hostOutputFrameCount[0]; + hostOutputChannels = bp->hostOutputChannels[0]; + } + else + { + hostOutputFrameCount = &bp->hostOutputFrameCount[1]; + hostOutputChannels = bp->hostOutputChannels[1]; + } + + framesToProcess = PA_MIN_( *hostInputFrameCount, + *hostOutputFrameCount ); + + assert( framesToProcess != 0 ); + + framesProcessedThisIteration = NonAdaptingProcess( bp, streamCallbackResult, + hostInputChannels, hostOutputChannels, + framesToProcess ); + + *hostInputFrameCount -= framesProcessedThisIteration; + *hostOutputFrameCount -= framesProcessedThisIteration; + + framesProcessed += framesProcessedThisIteration; + framesToGo -= framesProcessedThisIteration; + + }while( framesToGo > 0 ); + } + else + { + /* half duplex non-adapting process, just process 1st and 2nd buffer */ + /* process first buffer */ + + framesToProcess = (bp->inputChannelCount != 0) + ? bp->hostInputFrameCount[0] + : bp->hostOutputFrameCount[0]; + + framesProcessed = NonAdaptingProcess( bp, streamCallbackResult, + bp->hostInputChannels[0], bp->hostOutputChannels[0], + framesToProcess ); + + /* process second buffer if provided */ + + framesToProcess = (bp->inputChannelCount != 0) + ? bp->hostInputFrameCount[1] + : bp->hostOutputFrameCount[1]; + if( framesToProcess > 0 ) + { + framesProcessed += NonAdaptingProcess( bp, streamCallbackResult, + bp->hostInputChannels[1], bp->hostOutputChannels[1], + framesToProcess ); + } + } + } + else /* block adaption necessary*/ + { + + if( bp->inputChannelCount != 0 && bp->outputChannelCount != 0 ) + { + /* full duplex */ + + if( bp->hostBufferSizeMode == paUtilVariableHostBufferSizePartialUsageAllowed ) + { + framesProcessed = AdaptingProcess( bp, streamCallbackResult, + 0 /* dont process partial user buffers */ ); + } + else + { + framesProcessed = AdaptingProcess( bp, streamCallbackResult, + 1 /* process partial user buffers */ ); + } + } + else if( bp->inputChannelCount != 0 ) + { + /* input only */ + framesToProcess = bp->hostInputFrameCount[0]; + + framesProcessed = AdaptingInputOnlyProcess( bp, streamCallbackResult, + bp->hostInputChannels[0], framesToProcess ); + + framesToProcess = bp->hostInputFrameCount[1]; + if( framesToProcess > 0 ) + { + framesProcessed += AdaptingInputOnlyProcess( bp, streamCallbackResult, + bp->hostInputChannels[1], framesToProcess ); + } + } + else + { + /* output only */ + framesToProcess = bp->hostOutputFrameCount[0]; + + framesProcessed = AdaptingOutputOnlyProcess( bp, streamCallbackResult, + bp->hostOutputChannels[0], framesToProcess ); + + framesToProcess = bp->hostOutputFrameCount[1]; + if( framesToProcess > 0 ) + { + framesProcessed += AdaptingOutputOnlyProcess( bp, streamCallbackResult, + bp->hostOutputChannels[1], framesToProcess ); + } + } + } + + return framesProcessed; +} + + +int PaUtil_IsBufferProcessorOutputEmpty( PaUtilBufferProcessor* bp ) +{ + return (bp->framesInTempOutputBuffer) ? 0 : 1; +} + + +unsigned long PaUtil_CopyInput( PaUtilBufferProcessor* bp, + void **buffer, unsigned long frameCount ) +{ + PaUtilChannelDescriptor *hostInputChannels; + unsigned int framesToCopy; + unsigned char *destBytePtr; + void **nonInterleavedDestPtrs; + unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + + hostInputChannels = bp->hostInputChannels[0]; + framesToCopy = PA_MIN_( bp->hostInputFrameCount[0], frameCount ); + + if( bp->userInputIsInterleaved ) + { + destBytePtr = (unsigned char*)*buffer; + + destSampleStrideSamples = bp->inputChannelCount; + destChannelStrideBytes = bp->bytesPerUserInputSample; + + for( i=0; iinputChannelCount; ++i ) + { + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + framesToCopy, &bp->ditherGenerator ); + + destBytePtr += destChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + framesToCopy * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + + /* advance callers dest pointer (buffer) */ + *buffer = ((unsigned char *)*buffer) + + framesToCopy * bp->inputChannelCount * bp->bytesPerUserInputSample; + } + else + { + /* user input is not interleaved */ + + nonInterleavedDestPtrs = (void**)*buffer; + + destSampleStrideSamples = 1; + + for( i=0; iinputChannelCount; ++i ) + { + destBytePtr = (unsigned char*)nonInterleavedDestPtrs[i]; + + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + framesToCopy, &bp->ditherGenerator ); + + /* advance callers dest pointer (nonInterleavedDestPtrs[i]) */ + destBytePtr += bp->bytesPerUserInputSample * framesToCopy; + nonInterleavedDestPtrs[i] = destBytePtr; + + /* advance dest ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + framesToCopy * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + } + + bp->hostInputFrameCount[0] -= framesToCopy; + + return framesToCopy; +} + +unsigned long PaUtil_CopyOutput( PaUtilBufferProcessor* bp, + const void ** buffer, unsigned long frameCount ) +{ + PaUtilChannelDescriptor *hostOutputChannels; + unsigned int framesToCopy; + unsigned char *srcBytePtr; + void **nonInterleavedSrcPtrs; + unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + + hostOutputChannels = bp->hostOutputChannels[0]; + framesToCopy = PA_MIN_( bp->hostOutputFrameCount[0], frameCount ); + + if( bp->userOutputIsInterleaved ) + { + srcBytePtr = (unsigned char*)*buffer; + + srcSampleStrideSamples = bp->outputChannelCount; + srcChannelStrideBytes = bp->bytesPerUserOutputSample; + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + framesToCopy, &bp->ditherGenerator ); + + srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + framesToCopy * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + + /* advance callers source pointer (buffer) */ + *buffer = ((unsigned char *)*buffer) + + framesToCopy * bp->outputChannelCount * bp->bytesPerUserOutputSample; + + } + else + { + /* user output is not interleaved */ + + nonInterleavedSrcPtrs = (void**)*buffer; + + srcSampleStrideSamples = 1; + + for( i=0; ioutputChannelCount; ++i ) + { + srcBytePtr = (unsigned char*)nonInterleavedSrcPtrs[i]; + + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + framesToCopy, &bp->ditherGenerator ); + + + /* advance callers source pointer (nonInterleavedSrcPtrs[i]) */ + srcBytePtr += bp->bytesPerUserOutputSample * framesToCopy; + nonInterleavedSrcPtrs[i] = srcBytePtr; + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + framesToCopy * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + } + + bp->hostOutputFrameCount[0] += framesToCopy; + + return framesToCopy; +} + + +unsigned long PaUtil_ZeroOutput( PaUtilBufferProcessor* bp, unsigned long frameCount ) +{ + PaUtilChannelDescriptor *hostOutputChannels; + unsigned int framesToZero; + unsigned int i; + + hostOutputChannels = bp->hostOutputChannels[0]; + framesToZero = PA_MIN_( bp->hostOutputFrameCount[0], frameCount ); + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputZeroer( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + framesToZero ); + + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + framesToZero * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + + bp->hostOutputFrameCount[0] += framesToZero; + + return framesToZero; +} diff --git a/portaudio-v19/pa_common/pa_process.h b/portaudio-v19/pa_common/pa_process.h new file mode 100644 index 000000000..8d13d903a --- /dev/null +++ b/portaudio-v19/pa_common/pa_process.h @@ -0,0 +1,741 @@ +#ifndef PA_PROCESS_H +#define PA_PROCESS_H +/* + * $Id$ + * Portable Audio I/O Library callback buffer processing adapters + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Buffer Processor prototypes. A Buffer Processor performs buffer length + adaption, coordinates sample format conversion, and interleaves/deinterleaves + channels. + +

    Overview

    + + The "Buffer Processor" (PaUtilBufferProcessor) manages conversion of audio + data from host buffers to user buffers and back again. Where required, the + buffer processor takes care of converting between host and user sample formats, + interleaving and deinterleaving multichannel buffers, and adapting between host + and user buffers with different lengths. The buffer processor may be used with + full and half duplex streams, for both callback streams and blocking read/write + streams. + + One of the important capabilities provided by the buffer processor is + the ability to adapt between user and host buffer sizes of different lengths + with minimum latency. Although this task is relatively easy to perform when + the host buffer size is an integer multiple of the user buffer size, the + problem is more complicated when this is not the case - especially for + full-duplex callback streams. Where necessary the adaption is implemented by + internally buffering some input and/or output data. The buffer adation + algorithm used by the buffer processor was originally implemented by + Stephan Letz for the ASIO version of PortAudio, and is described in his + Callback_adaption_.pdf which is included in the distribution. + + The buffer processor performs sample conversion using the functions provided + by pa_converters.c. + + The following sections provide an overview of how to use the buffer processor. + Interested readers are advised to consult the host API implementations for + examples of buffer processor usage. + + +

    Initialization, resetting and termination

    + + When a stream is opened, the buffer processor should be initialized using + PaUtil_InitializeBufferProcessor. This function initializes internal state + and allocates temporary buffers as neccesary according to the supplied + configuration parameters. Some of the parameters correspond to those requested + by the user in their call to Pa_OpenStream(), others reflect the requirements + of the host API implementation - they indicate host buffer sizes, formats, + and the type of buffering which the Host API uses. The buffer processor should + be initialized for callback streams and blocking read/write streams. + + Call PaUtil_ResetBufferProcessor to clear any sample data which is present + in the buffer processor before starting to use it (for example when + Pa_StartStream is called). + + When the buffer processor is no longer used call + PaUtil_TerminateBufferProcessor. + + +

    Using the buffer processor for a callback stream

    + + The buffer processor's role in a callback stream is to take host input buffers + process them with the stream callback, and fill host output buffers. For a + full duplex stream, the buffer processor handles input and output simultaneously + due to the requirements of the minimum-latency buffer adation algorithm. + + When a host buffer becomes available, the implementation should call + the buffer processor to process the buffer. The buffer processor calls the + stream callback to consume and/or produce audio data as necessary. The buffer + processor will convert sample formats, interleave/deinterleave channels, + and slice or chunk the data to the appropriate buffer lengths according to + the requirements of the stream callback and the host API. + + To process a host buffer (or a pair of host buffers for a full-duplex stream) + use the following calling sequence: + + -# Call PaUtil_BeginBufferProcessing + -# For a stream which takes input: + - Call PaUtil_SetInputFrameCount with the number of frames in the host input + buffer. + - Call one of the following functions one or more times to tell the + buffer processor about the host input buffer(s): PaUtil_SetInputChannel, + PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel. + Which function you call will depend on whether the host buffer(s) are + interleaved or not. + - If the available host data is split accross two buffers (for example a + data range at the end of a circular buffer and another range at the + beginning of the circular buffer), also call + PaUtil_Set2ndInputFrameCount, PaUtil_Set2ndInputChannel, + PaUtil_Set2ndInterleavedInputChannels, + PaUtil_Set2ndNonInterleavedInputChannel as necessary to tell the buffer + processor about the second buffer. + -# For a stream which generates output: + - Call PaUtil_SetOutputFrameCount with the number of frames in the host + output buffer. + - Call one of the following functions one or more times to tell the + buffer processor about the host output buffer(s): PaUtil_SetOutputChannel, + PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel. + Which function you call will depend on whether the host buffer(s) are + interleaved or not. + - If the available host output buffer space is split accross two buffers + (for example a data range at the end of a circular buffer and another + range at the beginning of the circular buffer), call + PaUtil_Set2ndOutputFrameCount, PaUtil_Set2ndOutputChannel, + PaUtil_Set2ndInterleavedOutputChannels, + PaUtil_Set2ndNonInterleavedOutputChannel as necessary to tell the buffer + processor about the second buffer. + -# Call PaUtil_EndBufferProcessing, this function performs the actual data + conversion and processing. + + +

    Using the buffer processor for a blocking read/write stream

    + + Blocking read/write streams use the buffer processor to convert and copy user + output data to a host buffer, and to convert and copy host input data to + the user's buffer. The buffer processor does not perform any buffer adaption. + When using the buffer processor in a blocking read/write stream the input and + output conversion are performed separately by the PaUtil_CopyInput and + PaUtil_CopyOutput functions. + + To copy data from a host input buffer to the buffer(s) which the user supplies + to Pa_ReadStream, use the following calling sequence. + + - Repeat the following three steps until the user buffer(s) have been filled + with samples from the host input buffers: + -# Call PaUtil_SetInputFrameCount with the number of frames in the host + input buffer. + -# Call one of the following functions one or more times to tell the + buffer processor about the host input buffer(s): PaUtil_SetInputChannel, + PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel. + Which function you call will depend on whether the host buffer(s) are + interleaved or not. + -# Call PaUtil_CopyInput with the user buffer pointer (or a copy of the + array of buffer pointers for a non-interleaved stream) passed to + Pa_ReadStream, along with the number of frames in the user buffer(s). + Be careful to pass a copy of the user buffer pointers to + PaUtil_CopyInput because PaUtil_CopyInput advances the pointers to + the start of the next region to copy. + - PaUtil_CopyInput will not copy more data than is available in the + host buffer(s), so the above steps need to be repeated until the user + buffer(s) are full. + + + To copy data to the host output buffer from the user buffers(s) supplied + to Pa_WriteStream use the following calling sequence. + + - Repeat the following three steps until all frames from the user buffer(s) + have been copied to the host API: + -# Call PaUtil_SetOutputFrameCount with the number of frames in the host + output buffer. + -# Call one of the following functions one or more times to tell the + buffer processor about the host output buffer(s): PaUtil_SetOutputChannel, + PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel. + Which function you call will depend on whether the host buffer(s) are + interleaved or not. + -# Call PaUtil_CopyOutput with the user buffer pointer (or a copy of the + array of buffer pointers for a non-interleaved stream) passed to + Pa_WriteStream, along with the number of frames in the user buffer(s). + Be careful to pass a copy of the user buffer pointers to + PaUtil_CopyOutput because PaUtil_CopyOutput advances the pointers to + the start of the next region to copy. + - PaUtil_CopyOutput will not copy more data than fits in the host buffer(s), + so the above steps need to be repeated until all user data is copied. +*/ + + +#include "portaudio.h" +#include "pa_converters.h" +#include "pa_dither.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** @brief Mode flag passed to PaUtil_InitializeBufferProcessor indicating the type + of buffering that the host API uses. + + The mode used depends on whether the host API or the implementation manages + the buffers, and how these buffers are used (scatter gather, circular buffer). +*/ +typedef enum { +/** The host buffer size is a fixed known size. */ + paUtilFixedHostBufferSize, + +/** The host buffer size may vary, but has a known maximum size. */ + paUtilBoundedHostBufferSize, + +/** Nothing is known about the host buffer size. */ + paUtilUnknownHostBufferSize, + +/** The host buffer size varies, and the client does not require the buffer + processor to consume all of the input and fill all of the output buffer. This + is useful when the implementation has access to the host API's circular buffer + and only needs to consume/fill some of it, not necessarily all of it, with each + call to the buffer processor. This is the only mode where + PaUtil_EndBufferProcessing() may not consume the whole buffer. +*/ + paUtilVariableHostBufferSizePartialUsageAllowed +}PaUtilHostBufferSizeMode; + + +/** @brief An auxilliary data structure used internally by the buffer processor + to represent host input and output buffers. */ +typedef struct PaUtilChannelDescriptor{ + void *data; + unsigned int stride; /**< stride in samples, not bytes */ +}PaUtilChannelDescriptor; + + +/** @brief The main buffer processor data structure. + + Allocate one of these, initialize it with PaUtil_InitializeBufferProcessor + and terminate it with PaUtil_TerminateBufferProcessor. +*/ +typedef struct { + unsigned long framesPerUserBuffer; + unsigned long framesPerHostBuffer; + + PaUtilHostBufferSizeMode hostBufferSizeMode; + int useNonAdaptingProcess; + unsigned long framesPerTempBuffer; + + unsigned int inputChannelCount; + unsigned int bytesPerHostInputSample; + unsigned int bytesPerUserInputSample; + int userInputIsInterleaved; + PaUtilConverter *inputConverter; + PaUtilZeroer *inputZeroer; + + unsigned int outputChannelCount; + unsigned int bytesPerHostOutputSample; + unsigned int bytesPerUserOutputSample; + int userOutputIsInterleaved; + PaUtilConverter *outputConverter; + PaUtilZeroer *outputZeroer; + + unsigned long initialFramesInTempInputBuffer; + unsigned long initialFramesInTempOutputBuffer; + + void *tempInputBuffer; /**< used for slips, block adaption, and conversion. */ + void **tempInputBufferPtrs; /**< storage for non-interleaved buffer pointers, NULL for interleaved user input */ + unsigned long framesInTempInputBuffer; /**< frames remaining in input buffer from previous adaption iteration */ + + void *tempOutputBuffer; /**< used for slips, block adaption, and conversion. */ + void **tempOutputBufferPtrs; /**< storage for non-interleaved buffer pointers, NULL for interleaved user output */ + unsigned long framesInTempOutputBuffer; /**< frames remaining in input buffer from previous adaption iteration */ + + PaStreamCallbackTimeInfo *timeInfo; + + PaStreamCallbackFlags callbackStatusFlags; + + unsigned long hostInputFrameCount[2]; + PaUtilChannelDescriptor *hostInputChannels[2]; /**< pointers to arrays of channel descriptors. + pointers are NULL for half-duplex output processing. + hostInputChannels[i].data is NULL when the caller + calls PaUtil_SetNoInput() + */ + unsigned long hostOutputFrameCount[2]; + PaUtilChannelDescriptor *hostOutputChannels[2]; /**< pointers to arrays of channel descriptors. + pointers are NULL for half-duplex input processing. + hostOutputChannels[i].data is NULL when the caller + calls PaUtil_SetNoOutput() + */ + + PaUtilTriangularDitherGenerator ditherGenerator; + + double samplePeriod; + + PaStreamCallback *streamCallback; + void *userData; +} PaUtilBufferProcessor; + + +/** @name Initialization, termination, resetting and info */ +/*@{*/ + +/** Initialize a buffer processor's representation stored in a + PaUtilBufferProcessor structure. Be sure to call + PaUtil_TerminateBufferProcessor after finishing with a buffer processor. + + @param bufferProcessor The buffer processor structure to initialize. + + @param inputChannelCount The number of input channels as passed to + Pa_OpenStream or 0 for an output-only stream. + + @param userInputSampleFormat Format of user input samples, as passed to + Pa_OpenStream. This parameter is ignored for ouput-only streams. + + @param hostInputSampleFormat Format of host input samples. This parameter is + ignored for output-only streams. See note about host buffer interleave below. + + @param outputChannelCount The number of output channels as passed to + Pa_OpenStream or 0 for an input-only stream. + + @param userOutputSampleFormat Format of user output samples, as passed to + Pa_OpenStream. This parameter is ignored for input-only streams. + + @param hostOutputSampleFormat Format of host output samples. This parameter is + ignored for input-only streams. See note about host buffer interleave below. + + @param sampleRate Sample rate of the stream. The more accurate this is the + better - it is used for updating time stamps when adapting buffers. + + @param streamFlags Stream flags as passed to Pa_OpenStream, this parameter is + used for selecting special sample conversion options such as clipping and + dithering. + + @param framesPerUserBuffer Number of frames per user buffer, as requested + by the framesPerBuffer parameter to Pa_OpenStream. This parameter may be + zero to indicate that the user will accept any (and varying) buffer sizes. + + @param framesPerHostBuffer Specifies the number of frames per host buffer + for the fixed buffer size mode, and the maximum number of frames + per host buffer for the bounded host buffer size mode. It is ignored for + the other modes. + + @param hostBufferSizeMode A mode flag indicating the size variability of + host buffers that will be passed to the buffer processor. See + PaUtilHostBufferSizeMode for further details. + + @param streamCallback The user stream callback passed to Pa_OpenStream. + + @param userData The user data field passed to Pa_OpenStream. + + @note The interleave flag is ignored for host buffer formats. Host + interleave is determined by the use of different SetInput and SetOutput + functions. + + @return An error code indicating whether the initialization was successful. + If the error code is not PaNoError, the buffer processor was not initialized + and should not be used. + + @see Pa_OpenStream, PaUtilHostBufferSizeMode, PaUtil_TerminateBufferProcessor +*/ +PaError PaUtil_InitializeBufferProcessor( PaUtilBufferProcessor* bufferProcessor, + int inputChannelCount, PaSampleFormat userInputSampleFormat, + PaSampleFormat hostInputSampleFormat, + int outputChannelCount, PaSampleFormat userOutputSampleFormat, + PaSampleFormat hostOutputSampleFormat, + double sampleRate, + PaStreamFlags streamFlags, + unsigned long framesPerUserBuffer, /* 0 indicates don't care */ + unsigned long framesPerHostBuffer, + PaUtilHostBufferSizeMode hostBufferSizeMode, + PaStreamCallback *streamCallback, void *userData ); + + +/** Terminate a buffer processor's representation. Deallocates any temporary + buffers allocated by PaUtil_InitializeBufferProcessor. + + @param bufferProcessor The buffer processor structure to terminate. + + @see PaUtil_InitializeBufferProcessor. +*/ +void PaUtil_TerminateBufferProcessor( PaUtilBufferProcessor* bufferProcessor ); + + +/** Clear any internally buffered data. If you call + PaUtil_InitializeBufferProcessor in your OpenStream routine, make sure you + call PaUtil_ResetBufferProcessor in your StartStream call. + + @param bufferProcessor The buffer processor to reset. +*/ +void PaUtil_ResetBufferProcessor( PaUtilBufferProcessor* bufferProcessor ); + + +/** Retrieve the input latency of a buffer processor. + + @param bufferProcessor The buffer processor examine. + + @return The input latency introduced by the buffer processor, in frames. + + @see PaUtil_GetBufferProcessorOutputLatency +*/ +unsigned long PaUtil_GetBufferProcessorInputLatency( PaUtilBufferProcessor* bufferProcessor ); + +/** Retrieve the output latency of a buffer processor. + + @param bufferProcessor The buffer processor examine. + + @return The output latency introduced by the buffer processor, in frames. + + @see PaUtil_GetBufferProcessorInputLatency +*/ +unsigned long PaUtil_GetBufferProcessorOutputLatency( PaUtilBufferProcessor* bufferProcessor ); + +/*@}*/ + + +/** @name Host buffer pointer configuration + + Functions to set host input and output buffers, used by both callback streams + and blocking read/write streams. +*/ +/*@{*/ + + +/** Set the number of frames in the input host buffer(s) specified by the + PaUtil_Set*InputChannel functions. + + @param bufferProcessor The buffer processor. + + @param frameCount The number of host input frames. A 0 frameCount indicates to + use the framesPerHostBuffer value passed to PaUtil_InitializeBufferProcessor. + + @see PaUtil_SetNoInput, PaUtil_SetInputChannel, + PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel +*/ +void PaUtil_SetInputFrameCount( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + + +/** Indicate that no input is avalable. This function should be used when + priming the output of a full-duplex stream opened with the + paPrimeOutputBuffersUsingStreamCallback flag. Note that it is not necessary + to call this or any othe PaUtil_Set*Input* functions for ouput-only streams. + + @param bufferProcessor The buffer processor. +*/ +void PaUtil_SetNoInput( PaUtilBufferProcessor* bufferProcessor ); + + +/** Provide the buffer processor with a pointer to a host input channel. + + @param bufferProcessor The buffer processor. + @param channel The channel number. + @param data The buffer. + @param stride The stride from one sample to the next, in samples. For + interleaved host buffers, the stride will usually be the same as the number of + channels in the buffer. +*/ +void PaUtil_SetInputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data, unsigned int stride ); + + +/** Provide the buffer processor with a pointer to an number of interleaved + host input channels. + + @param bufferProcessor The buffer processor. + @param firstChannel The first channel number. + @param data The buffer. + @param channelCount The number of interleaved channels in the buffer. If + channelCount is zero, the number of channels specified to + PaUtil_InitializeBufferProcessor will be used. +*/ +void PaUtil_SetInterleavedInputChannels( PaUtilBufferProcessor* bufferProcessor, + unsigned int firstChannel, void *data, unsigned int channelCount ); + + +/** Provide the buffer processor with a pointer to one non-interleaved host + output channel. + + @param bufferProcessor The buffer processor. + @param channel The channel number. + @param data The buffer. +*/ +void PaUtil_SetNonInterleavedInputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data ); + + +/** Use for the second buffer half when the input buffer is split in two halves. + @see PaUtil_SetInputFrameCount +*/ +void PaUtil_Set2ndInputFrameCount( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + +/** Use for the second buffer half when the input buffer is split in two halves. + @see PaUtil_SetInputChannel +*/ +void PaUtil_Set2ndInputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data, unsigned int stride ); + +/** Use for the second buffer half when the input buffer is split in two halves. + @see PaUtil_SetInterleavedInputChannels +*/ +void PaUtil_Set2ndInterleavedInputChannels( PaUtilBufferProcessor* bufferProcessor, + unsigned int firstChannel, void *data, unsigned int channelCount ); + +/** Use for the second buffer half when the input buffer is split in two halves. + @see PaUtil_SetNonInterleavedInputChannel +*/ +void PaUtil_Set2ndNonInterleavedInputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data ); + + +/** Set the number of frames in the output host buffer(s) specified by the + PaUtil_Set*OutputChannel functions. + + @param bufferProcessor The buffer processor. + + @param frameCount The number of host output frames. A 0 frameCount indicates to + use the framesPerHostBuffer value passed to PaUtil_InitializeBufferProcessor. + + @see PaUtil_SetOutputChannel, PaUtil_SetInterleavedOutputChannels, + PaUtil_SetNonInterleavedOutputChannel +*/ +void PaUtil_SetOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + + +/** Indicate that the output will be discarded. This function should be used + when implementing the paNeverDropInput mode for full duplex streams. + + @param bufferProcessor The buffer processor. +*/ +void PaUtil_SetNoOutput( PaUtilBufferProcessor* bufferProcessor ); + + +/** Provide the buffer processor with a pointer to a host output channel. + + @param bufferProcessor The buffer processor. + @param channel The channel number. + @param data The buffer. + @param stride The stride from one sample to the next, in samples. For + interleaved host buffers, the stride will usually be the same as the number of + channels in the buffer. +*/ +void PaUtil_SetOutputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data, unsigned int stride ); + + +/** Provide the buffer processor with a pointer to a number of interleaved + host output channels. + + @param bufferProcessor The buffer processor. + @param firstChannel The first channel number. + @param data The buffer. + @param channelCount The number of interleaved channels in the buffer. If + channelCount is zero, the number of channels specified to + PaUtil_InitializeBufferProcessor will be used. +*/ +void PaUtil_SetInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, + unsigned int firstChannel, void *data, unsigned int channelCount ); + + +/** Provide the buffer processor with a pointer to one non-interleaved host + output channel. + + @param bufferProcessor The buffer processor. + @param channel The channel number. + @param data The buffer. +*/ +void PaUtil_SetNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data ); + + +/** Use for the second buffer half when the output buffer is split in two halves. + @see PaUtil_SetOutputFrameCount +*/ +void PaUtil_Set2ndOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + +/** Use for the second buffer half when the output buffer is split in two halves. + @see PaUtil_SetOutputChannel +*/ +void PaUtil_Set2ndOutputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data, unsigned int stride ); + +/** Use for the second buffer half when the output buffer is split in two halves. + @see PaUtil_SetInterleavedOutputChannels +*/ +void PaUtil_Set2ndInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, + unsigned int firstChannel, void *data, unsigned int channelCount ); + +/** Use for the second buffer half when the output buffer is split in two halves. + @see PaUtil_SetNonInterleavedOutputChannel +*/ +void PaUtil_Set2ndNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data ); + +/*@}*/ + + +/** @name Buffer processing functions for callback streams +*/ +/*@{*/ + +/** Commence processing a host buffer (or a pair of host buffers in the + full-duplex case) for a callback stream. + + @param bufferProcessor The buffer processor. + + @param timeInfo Timing information for the first sample of the host + buffer(s). This information may be adjusted when buffer adaption is being + performed. + + @param callbackStatusFlags Flags indicating whether underruns and overruns + have occurred since the last time the buffer processor was called. +*/ +void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bufferProcessor, + PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags callbackStatusFlags ); + + +/** Finish processing a host buffer (or a pair of host buffers in the + full-duplex case) for a callback stream. + + @param bufferProcessor The buffer processor. + + @param callbackResult On input, indicates a previous callback result, and on + exit, the result of the user stream callback, if it is called. + On entry callbackResult should contain one of { paContinue, paComplete, or + paAbort}. If paComplete is passed, the stream callback will not be called + but any audio that was generated by previous stream callbacks will be copied + to the output buffer(s). You can check whether the buffer processor's internal + buffer is empty by calling PaUtil_IsBufferProcessorOutputEmpty. + + If the stream callback is called its result is stored in *callbackResult. If + the stream callback returns paComplete or paAbort, all output buffers will be + full of valid data - some of which may be zeros to acount for data that + wasn't generated by the terminating callback. + + @return The number of frames processed. This usually corresponds to the + number of frames specified by the PaUtil_Set*FrameCount functions, exept in + the paUtilVariableHostBufferSizePartialUsageAllowed buffer size mode when a + smaller value may be returned. +*/ +unsigned long PaUtil_EndBufferProcessing( PaUtilBufferProcessor* bufferProcessor, + int *callbackResult ); + + +/** Determine whether any callback generated output remains in the bufffer + processor's internal buffers. This method may be used to determine when to + continue calling PaUtil_EndBufferProcessing() after the callback has returned + a callbackResult of paComplete. + + @param bufferProcessor The buffer processor. + + @return Returns non-zero when callback generated output remains in the internal + buffer and zero (0) when there internal buffer contains no callback generated + data. +*/ +int PaUtil_IsBufferProcessorOutputEmpty( PaUtilBufferProcessor* bufferProcessor ); + +/*@}*/ + + +/** @name Buffer processing functions for blocking read/write streams +*/ +/*@{*/ + +/** Copy samples from host input channels set up by the PaUtil_Set*InputChannels + functions to a user supplied buffer. This function is intended for use with + blocking read/write streams. Copies the minimum of the number of + user frames (specified by the frameCount parameter) and the number of available + host frames (specified in a previous call to SetInputFrameCount()). + + @param bufferProcessor The buffer processor. + + @param buffer A pointer to the user buffer pointer, or a pointer to a pointer + to an array of user buffer pointers for a non-interleaved stream. It is + important that this parameter points to a copy of the user buffer pointers, + not to the actual user buffer pointers, because this function updates the + pointers before returning. + + @param frameCount The number of frames of data in the buffer(s) pointed to by + the buffer parameter. + + @return The number of frames copied. The buffer pointer(s) pointed to by the + buffer parameter are advanced to point to the frame(s) following the last one + filled. +*/ +unsigned long PaUtil_CopyInput( PaUtilBufferProcessor* bufferProcessor, + void **buffer, unsigned long frameCount ); + + +/* Copy samples from a user supplied buffer to host output channels set up by + the PaUtil_Set*OutputChannels functions. This function is intended for use with + blocking read/write streams. Copies the minimum of the number of + user frames (specified by the frameCount parameter) and the number of + host frames (specified in a previous call to SetOutputFrameCount()). + + @param bufferProcessor The buffer processor. + + @param buffer A pointer to the user buffer pointer, or a pointer to a pointer + to an array of user buffer pointers for a non-interleaved stream. It is + important that this parameter points to a copy of the user buffer pointers, + not to the actual user buffer pointers, because this function updates the + pointers before returning. + + @param frameCount The number of frames of data in the buffer(s) pointed to by + the buffer parameter. + + @return The number of frames copied. The buffer pointer(s) pointed to by the + buffer parameter are advanced to point to the frame(s) following the last one + copied. +*/ +unsigned long PaUtil_CopyOutput( PaUtilBufferProcessor* bufferProcessor, + const void ** buffer, unsigned long frameCount ); + + +/* Zero samples in host output channels set up by the PaUtil_Set*OutputChannels + functions. This function is useful for flushing streams. + Zeros the minimum of frameCount and the number of host frames specified in a + previous call to SetOutputFrameCount(). + + @param bufferProcessor The buffer processor. + + @param frameCount The maximum number of frames to zero. + + @return The number of frames zeroed. +*/ +unsigned long PaUtil_ZeroOutput( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + + +/*@}*/ + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_PROCESS_H */ diff --git a/portaudio-v19/pa_common/pa_skeleton.c b/portaudio-v19/pa_common/pa_skeleton.c new file mode 100644 index 000000000..51f95c8a3 --- /dev/null +++ b/portaudio-v19/pa_common/pa_skeleton.c @@ -0,0 +1,807 @@ +/* + * $Id$ + * Portable Audio I/O Library skeleton implementation + * demonstrates how to use the common functions to implement support + * for a host API + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Skeleton implementation of support for a host API. + + @note This file is provided as a starting point for implementing support for + a new host API. IMPLEMENT ME comments are used to indicate functionality + which much be customised for each implementation. +*/ + + +#include /* strlen() */ + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + + +/* IMPLEMENT ME: a macro like the following one should be used for reporting + host errors */ +#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \ + PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText ) + +/* PaSkeletonHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ +} +PaSkeletonHostApiRepresentation; /* IMPLEMENT ME: rename this */ + + +PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i, deviceCount; + PaSkeletonHostApiRepresentation *skeletonHostApi; + PaDeviceInfo *deviceInfoArray; + + skeletonHostApi = (PaSkeletonHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaSkeletonHostApiRepresentation) ); + if( !skeletonHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + skeletonHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !skeletonHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + *hostApi = &skeletonHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paInDevelopment; /* IMPLEMENT ME: change to correct type id */ + (*hostApi)->info.name = "skeleton implementation"; /* IMPLEMENT ME: change to correct name */ + + (*hostApi)->info.defaultInputDevice = paNoDevice; /* IMPLEMENT ME */ + (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */ + + (*hostApi)->info.deviceCount = 0; + + deviceCount = 0; /* IMPLEMENT ME */ + + if( deviceCount > 0 ) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + skeletonHostApi->allocations, sizeof(PaDeviceInfo*) * deviceCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + skeletonHostApi->allocations, sizeof(PaDeviceInfo) * deviceCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < deviceCount; ++i ) + { + PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + deviceInfo->name = 0; /* IMPLEMENT ME: allocate block and copy name eg: + deviceName = (char*)PaUtil_GroupAllocateMemory( skeletonHostApi->allocations, strlen(srcName) + 1 ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, srcName ); + deviceInfo->name = deviceName; + */ + + deviceInfo->maxInputChannels = 0; /* IMPLEMENT ME */ + deviceInfo->maxOutputChannels = 0; /* IMPLEMENT ME */ + + deviceInfo->defaultLowInputLatency = 0.; /* IMPLEMENT ME */ + deviceInfo->defaultLowOutputLatency = 0.; /* IMPLEMENT ME */ + deviceInfo->defaultHighInputLatency = 0.; /* IMPLEMENT ME */ + deviceInfo->defaultHighOutputLatency = 0.; /* IMPLEMENT ME */ + + deviceInfo->defaultSampleRate = 0.; /* IMPLEMENT ME */ + + (*hostApi)->deviceInfos[i] = deviceInfo; + ++(*hostApi)->info.deviceCount; + } + } + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &skeletonHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &skeletonHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( skeletonHostApi ) + { + if( skeletonHostApi->allocations ) + { + PaUtil_FreeAllAllocations( skeletonHostApi->allocations ); + PaUtil_DestroyAllocationGroup( skeletonHostApi->allocations ); + } + + PaUtil_FreeMemory( skeletonHostApi ); + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaSkeletonHostApiRepresentation *skeletonHostApi = (PaSkeletonHostApiRepresentation*)hostApi; + + /* + IMPLEMENT ME: + - clean up any resources not handled by the allocation group + */ + + if( skeletonHostApi->allocations ) + { + PaUtil_FreeAllAllocations( skeletonHostApi->allocations ); + PaUtil_DestroyAllocationGroup( skeletonHostApi->allocations ); + } + + PaUtil_FreeMemory( skeletonHostApi ); +} + + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support outputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + /* + IMPLEMENT ME: + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported if necessary + + - check that the device supports sampleRate + + Because the buffer adapter handles conversion between all standard + sample formats, the following checks are only required if paCustomFormat + is implemented, or under some other unusual conditions. + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from inputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + */ + + + /* suppress unused variable warnings */ + (void) sampleRate; + + return paFormatIsSupported; +} + +/* PaSkeletonStream - a stream data structure specifically for this implementation */ + +typedef struct PaSkeletonStream +{ /* IMPLEMENT ME: rename this */ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + /* IMPLEMENT ME: + - implementation specific data goes here + */ + unsigned long framesPerHostCallback; /* just an example */ +} +PaSkeletonStream; + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaSkeletonHostApiRepresentation *skeletonHostApi = (PaSkeletonHostApiRepresentation*)hostApi; + PaSkeletonStream *stream = 0; + unsigned long framesPerHostBuffer = framesPerBuffer; /* these may not be equivalent for all implementations */ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + /* IMPLEMENT ME - establish which host formats are available */ + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, inputSampleFormat ); + } + else + { + inputChannelCount = 0; + inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + /* IMPLEMENT ME - establish which host formats are available */ + hostOutputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, outputSampleFormat ); + } + else + { + outputChannelCount = 0; + outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ + } + + /* + IMPLEMENT ME: + + ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? ) + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + - alter sampleRate to a close allowable rate if possible / necessary + + - validate suggestedInputLatency and suggestedOutputLatency parameters, + use default values where necessary + */ + + + + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + + stream = (PaSkeletonStream*)PaUtil_AllocateMemory( sizeof(PaSkeletonStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &skeletonHostApi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &skeletonHostApi->blockingStreamInterface, streamCallback, userData ); + } + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + /* we assume a fixed host buffer size in this example, but the buffer processor + can also support bounded and unknown host buffer sizes by passing + paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of + paUtilFixedHostBufferSize below. */ + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerHostBuffer, paUtilFixedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ) + goto error; + + + /* + IMPLEMENT ME: initialise the following fields with estimated or actual + values. + */ + stream->streamRepresentation.streamInfo.inputLatency = + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor); + stream->streamRepresentation.streamInfo.outputLatency = + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor); + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + + /* + IMPLEMENT ME: + - additional stream setup + opening + */ + + stream->framesPerHostCallback = framesPerHostBuffer; + + *s = (PaStream*)stream; + + return result; + +error: + if( stream ) + PaUtil_FreeMemory( stream ); + + return result; +} + +/* + ExampleHostProcessingLoop() illustrates the kind of processing which may + occur in a host implementation. + +*/ +static void ExampleHostProcessingLoop( void *inputBuffer, void *outputBuffer, void *userData ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)userData; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */ + int callbackResult; + unsigned long framesProcessed; + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + /* + IMPLEMENT ME: + - generate timing information + - handle buffer slips + */ + + /* + If you need to byte swap or shift inputBuffer to convert it into a + portaudio format, do it here. + */ + + + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ ); + + /* + depending on whether the host buffers are interleaved, non-interleaved + or a mixture, you will want to call PaUtil_SetInterleaved*Channels(), + PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here. + */ + + PaUtil_SetInputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, + 0, /* first channel of inputBuffer is channel 0 */ + inputBuffer, + 0 ); /* 0 - use inputChannelCount passed to init buffer processor */ + + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, + 0, /* first channel of outputBuffer is channel 0 */ + outputBuffer, + 0 ); /* 0 - use outputChannelCount passed to init buffer processor */ + + /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing() + in general you would pass paContinue for normal operation, and + paComplete to drain the buffer processor's internal output buffer. + You can check whether the buffer processor's output buffer is empty + using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor ) + */ + callbackResult = paContinue; + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + + + /* + If you need to byte swap or shift outputBuffer to convert it to + host format, do it here. + */ + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + + if( callbackResult == paContinue ) + { + /* nothing special to do */ + } + else if( callbackResult == paAbort ) + { + /* IMPLEMENT ME - finish playback immediately */ + + /* once finished, call the finished callback */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + else + { + /* User callback has asked us to stop with paComplete or other non-zero value */ + + /* IMPLEMENT ME - finish playback once currently queued audio has completed */ + + /* once finished, call the finished callback */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } +} + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* + IMPLEMENT ME: + - additional stream closing + cleanup + */ + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); + + return result; +} + + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + /* suppress unused function warning. the code in ExampleHostProcessingLoop or + something similar should be implemented to feed samples to and from the + host after StartStream() is called. + */ + (void) ExampleHostProcessingLoop; + + return result; +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return result; +} + + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return 0; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return 0; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + + + diff --git a/portaudio-v19/pa_common/pa_stream.c b/portaudio-v19/pa_common/pa_stream.c new file mode 100644 index 000000000..e820671bc --- /dev/null +++ b/portaudio-v19/pa_common/pa_stream.c @@ -0,0 +1,141 @@ +/* + * $Id$ + * Portable Audio I/O Library + * + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 2002 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Interface used by pa_front to virtualize functions which operate on + streams. +*/ + + +#include "pa_stream.h" + + +void PaUtil_InitializeStreamInterface( PaUtilStreamInterface *streamInterface, + PaError (*Close)( PaStream* ), + PaError (*Start)( PaStream* ), + PaError (*Stop)( PaStream* ), + PaError (*Abort)( PaStream* ), + PaError (*IsStopped)( PaStream* ), + PaError (*IsActive)( PaStream* ), + PaTime (*GetTime)( PaStream* ), + double (*GetCpuLoad)( PaStream* ), + PaError (*Read)( PaStream*, void *, unsigned long ), + PaError (*Write)( PaStream*, const void *, unsigned long ), + signed long (*GetReadAvailable)( PaStream* ), + signed long (*GetWriteAvailable)( PaStream* ) ) +{ + streamInterface->Close = Close; + streamInterface->Start = Start; + streamInterface->Stop = Stop; + streamInterface->Abort = Abort; + streamInterface->IsStopped = IsStopped; + streamInterface->IsActive = IsActive; + streamInterface->GetTime = GetTime; + streamInterface->GetCpuLoad = GetCpuLoad; + streamInterface->Read = Read; + streamInterface->Write = Write; + streamInterface->GetReadAvailable = GetReadAvailable; + streamInterface->GetWriteAvailable = GetWriteAvailable; +} + + +void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation, + PaUtilStreamInterface *streamInterface, + PaStreamCallback *streamCallback, + void *userData ) +{ + streamRepresentation->magic = PA_STREAM_MAGIC; + streamRepresentation->nextOpenStream = 0; + streamRepresentation->streamInterface = streamInterface; + streamRepresentation->streamCallback = streamCallback; + streamRepresentation->streamFinishedCallback = 0; + + streamRepresentation->userData = userData; + + streamRepresentation->streamInfo.inputLatency = 0.; + streamRepresentation->streamInfo.outputLatency = 0.; + streamRepresentation->streamInfo.sampleRate = 0.; +} + + +void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation ) +{ + streamRepresentation->magic = 0; +} + + +PaError PaUtil_DummyRead( PaStream* stream, + void *buffer, + unsigned long frames ) +{ + (void)stream; /* unused parameter */ + (void)buffer; /* unused parameter */ + (void)frames; /* unused parameter */ + + return paCanNotReadFromACallbackStream; +} + + +PaError PaUtil_DummyWrite( PaStream* stream, + const void *buffer, + unsigned long frames ) +{ + (void)stream; /* unused parameter */ + (void)buffer; /* unused parameter */ + (void)frames; /* unused parameter */ + + return paCanNotWriteToACallbackStream; +} + + +signed long PaUtil_DummyGetReadAvailable( PaStream* stream ) +{ + (void)stream; /* unused parameter */ + + return paCanNotReadFromACallbackStream; +} + + +signed long PaUtil_DummyGetWriteAvailable( PaStream* stream ) +{ + (void)stream; /* unused parameter */ + + return paCanNotWriteToACallbackStream; +} + + +double PaUtil_DummyGetCpuLoad( PaStream* stream ) +{ + (void)stream; /* unused parameter */ + + return 0.0; +} diff --git a/portaudio-v19/pa_common/pa_stream.h b/portaudio-v19/pa_common/pa_stream.h new file mode 100644 index 000000000..aaf89cf21 --- /dev/null +++ b/portaudio-v19/pa_common/pa_stream.h @@ -0,0 +1,196 @@ +#ifndef PA_STREAM_H +#define PA_STREAM_H +/* + * $Id$ + * Portable Audio I/O Library + * stream interface + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Interface used by pa_front to virtualize functions which operate on + streams. +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +#define PA_STREAM_MAGIC (0x18273645) + + +/** A structure representing an (abstract) interface to a host API. Contains + pointers to functions which implement the interface. + + All PaStreamInterface functions are guaranteed to be called with a non-null, + valid stream parameter. +*/ +typedef struct { + PaError (*Close)( PaStream* stream ); + PaError (*Start)( PaStream *stream ); + PaError (*Stop)( PaStream *stream ); + PaError (*Abort)( PaStream *stream ); + PaError (*IsStopped)( PaStream *stream ); + PaError (*IsActive)( PaStream *stream ); + PaTime (*GetTime)( PaStream *stream ); + double (*GetCpuLoad)( PaStream* stream ); + PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ); + PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ); + signed long (*GetReadAvailable)( PaStream* stream ); + signed long (*GetWriteAvailable)( PaStream* stream ); +} PaUtilStreamInterface; + + +/** Initialize the fields of a PaUtilStreamInterface structure. +*/ +void PaUtil_InitializeStreamInterface( PaUtilStreamInterface *streamInterface, + PaError (*Close)( PaStream* ), + PaError (*Start)( PaStream* ), + PaError (*Stop)( PaStream* ), + PaError (*Abort)( PaStream* ), + PaError (*IsStopped)( PaStream* ), + PaError (*IsActive)( PaStream* ), + PaTime (*GetTime)( PaStream* ), + double (*GetCpuLoad)( PaStream* ), + PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ), + PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ), + signed long (*GetReadAvailable)( PaStream* stream ), + signed long (*GetWriteAvailable)( PaStream* stream ) ); + + +/** Dummy Read function for use in interfaces to a callback based streams. + Pass to the Read parameter of PaUtil_InitializeStreamInterface. + @return An error code indicating that the function has no effect + because the stream is a callback stream. +*/ +PaError PaUtil_DummyRead( PaStream* stream, + void *buffer, + unsigned long frames ); + + +/** Dummy Write function for use in an interfaces to callback based streams. + Pass to the Write parameter of PaUtil_InitializeStreamInterface. + @return An error code indicating that the function has no effect + because the stream is a callback stream. +*/ +PaError PaUtil_DummyWrite( PaStream* stream, + const void *buffer, + unsigned long frames ); + + +/** Dummy GetReadAvailable function for use in interfaces to callback based + streams. Pass to the GetReadAvailable parameter of PaUtil_InitializeStreamInterface. + @return An error code indicating that the function has no effect + because the stream is a callback stream. +*/ +signed long PaUtil_DummyGetReadAvailable( PaStream* stream ); + + +/** Dummy GetWriteAvailable function for use in interfaces to callback based + streams. Pass to the GetWriteAvailable parameter of PaUtil_InitializeStreamInterface. + @return An error code indicating that the function has no effect + because the stream is a callback stream. +*/ +signed long PaUtil_DummyGetWriteAvailable( PaStream* stream ); + + + +/** Dummy GetCpuLoad function for use in an interface to a read/write stream. + Pass to the GetCpuLoad parameter of PaUtil_InitializeStreamInterface. + @return Returns 0. +*/ +double PaUtil_DummyGetCpuLoad( PaStream* stream ); + + +/** Non host specific data for a stream. This data is used by pa_front to + forward to the appropriate functions in the streamInterface structure. +*/ +typedef struct PaUtilStreamRepresentation { + unsigned long magic; /**< set to PA_STREAM_MAGIC */ + struct PaUtilStreamRepresentation *nextOpenStream; /**< field used by multi-api code */ + PaUtilStreamInterface *streamInterface; + PaStreamCallback *streamCallback; + PaStreamFinishedCallback *streamFinishedCallback; + void *userData; + PaStreamInfo streamInfo; +} PaUtilStreamRepresentation; + + +/** Initialize a PaUtilStreamRepresentation structure. + + @see PaUtil_InitializeStreamRepresentation +*/ +void PaUtil_InitializeStreamRepresentation( + PaUtilStreamRepresentation *streamRepresentation, + PaUtilStreamInterface *streamInterface, + PaStreamCallback *streamCallback, + void *userData ); + + +/** Clean up a PaUtilStreamRepresentation structure previously initialized + by a call to PaUtil_InitializeStreamRepresentation. + + @see PaUtil_InitializeStreamRepresentation +*/ +void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation ); + + +/** Check that the stream pointer is valid. + + @return Returns paNoError if the stream pointer appears to be OK, otherwise + returns an error indicating the cause of failure. +*/ +PaError PaUtil_ValidateStreamPointer( PaStream *stream ); + + +/** Cast an opaque stream pointer into a pointer to a PaUtilStreamRepresentation. + + @see PaUtilStreamRepresentation +*/ +#define PA_STREAM_REP( stream )\ + ((PaUtilStreamRepresentation*) (stream) ) + + +/** Cast an opaque stream pointer into a pointer to a PaUtilStreamInterface. + + @see PaUtilStreamRepresentation, PaUtilStreamInterface +*/ +#define PA_STREAM_INTERFACE( stream )\ + PA_STREAM_REP( (stream) )->streamInterface + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_STREAM_H */ diff --git a/portaudio-v19/pa_common/pa_trace.c b/portaudio-v19/pa_common/pa_trace.c new file mode 100644 index 000000000..6619d423a --- /dev/null +++ b/portaudio-v19/pa_common/pa_trace.c @@ -0,0 +1,88 @@ +/* + * $Id$ + * Portable Audio I/O Library Trace Facility + * Store trace information in real-time for later printing. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2000 Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Event trace mechanism for debugging. +*/ + + +#include +#include +#include +#include "pa_trace.h" + +#if PA_TRACE_REALTIME_EVENTS + +static char *traceTextArray[PA_MAX_TRACE_RECORDS]; +static int traceIntArray[PA_MAX_TRACE_RECORDS]; +static int traceIndex = 0; +static int traceBlock = 0; + +/*********************************************************************/ +void PaUtil_ResetTraceMessages() +{ + traceIndex = 0; +} + +/*********************************************************************/ +void PaUtil_DumpTraceMessages() +{ + int i; + int messageCount = (traceIndex < PA_MAX_TRACE_RECORDS) ? traceIndex : PA_MAX_TRACE_RECORDS; + + printf("DumpTraceMessages: traceIndex = %d\n", traceIndex ); + for( i=0; i must be included in the + context in which this macro is used. +*/ +#define PA_VALIDATE_TYPE_SIZES \ + { \ + assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaUint16 ) == 2 ); \ + assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaInt16 ) == 2 ); \ + assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaUint32 ) == 4 ); \ + assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaInt32 ) == 4 ); \ + } + + +#endif /* PA_TYPES_H */ diff --git a/portaudio-v19/pa_common/pa_util.h b/portaudio-v19/pa_common/pa_util.h new file mode 100644 index 000000000..ab8dbe046 --- /dev/null +++ b/portaudio-v19/pa_common/pa_util.h @@ -0,0 +1,167 @@ +#ifndef PA_UTIL_H +#define PA_UTIL_H +/* + * $Id$ + * Portable Audio I/O Library implementation utilities header + * common implementation utilities and interfaces + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Prototypes for utility functions used by PortAudio implementations. + + @todo Document and adhere to the alignment guarantees provided by + PaUtil_AllocateMemory(). +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +struct PaUtilHostApiRepresentation; + + +/** Retrieve a specific host API representation. This function can be used + by implementations to retrieve a pointer to their representation in + host api specific extension functions which aren't passed a rep pointer + by pa_front.c. + + @param hostApi A pointer to a host API represenation pointer. Apon success + this will receive the requested representation pointer. + + @param type A valid host API type identifier. + + @returns An error code. If the result is PaNoError then a pointer to the + requested host API representation will be stored in *hostApi. If the host API + specified by type is not found, this function returns paHostApiNotFound. +*/ +PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **hostApi, + PaHostApiTypeId type ); + + +/** Convert a PortAudio device index into a host API specific device index. + @param hostApiDevice Pointer to a device index, on success this will recieve the + converted device index value. + @param device The PortAudio device index to convert. + @param hostApi The host api which the index should be converted for. + + @returns On success returns PaNoError and places the converted index in the + hostApiDevice parameter. +*/ +PaError PaUtil_DeviceIndexToHostApiDeviceIndex( + PaDeviceIndex *hostApiDevice, PaDeviceIndex device, + struct PaUtilHostApiRepresentation *hostApi ); + + +/** Set the host error information returned by Pa_GetLastHostErrorInfo. This + function and the paUnanticipatedHostError error code should be used as a + last resort. Implementors should use existing PA error codes where possible, + or nominate new ones. Note that at it is always better to use + PaUtil_SetLastHostErrorInfo() and paUnanticipatedHostError than to return an + ambiguous or inaccurate PaError code. + + @param hostApiType The host API which encountered the error (ie of the caller) + + @param errorCode The error code returned by the native API function. + + @param errorText A string describing the error. PaUtil_SetLastHostErrorInfo + makes a copy of the string, so it is not necessary for the pointer to remain + valid after the call to PaUtil_SetLastHostErrorInfo() returns. + +*/ +void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode, + const char *errorText ); + + + +/** PA_DEBUG() provides a simple debug message printing facility. The macro + passes it's argument to a printf-like function called PaUtil_DebugPrint() + which prints to stderr and always flushes the stream after printing. + Because preprocessor macros cannot directly accept variable length argument + lists, calls to the macro must include an additional set of parenthesis, eg: + PA_DEBUG(("errorno: %d", 1001 )); +*/ + +void PaUtil_DebugPrint( const char *format, ... ); + +#ifdef PA_ENABLE_DEBUG_OUTPUT +#define PA_DEBUG(x) PaUtil_DebugPrint x ; +#else +#define PA_DEBUG(x) +#endif + + +/* the following functions are implemented in a platform platform specific + .c file +*/ + +/** Allocate size bytes, guaranteed to be aligned to a FIXME byte boundary */ +void *PaUtil_AllocateMemory( long size ); + + +/** Realease block if non-NULL. block may be NULL */ +void PaUtil_FreeMemory( void *block ); + + +/** Return the number of currently allocated blocks. This function can be + used for detecting memory leaks. + + @note Allocations will only be tracked if PA_TRACK_MEMORY is #defined. If + it isn't, this function will always return 0. +*/ +int PaUtil_CountCurrentlyAllocatedBlocks( void ); + + +/** Initialize the clock used by PaUtil_GetTime(). Call this before calling + PaUtil_GetTime. + + @see PaUtil_GetTime +*/ +void PaUtil_InitializeClock( void ); + + +/** Return the system time in seconds. Used to implement CPU load functions + + @see PaUtil_InitializeClock +*/ +double PaUtil_GetTime( void ); + + +/* void Pa_Sleep( long msec ); must also be implemented in per-platform .c file */ + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_UTIL_H */ diff --git a/portaudio-v19/pa_common/portaudio.h b/portaudio-v19/pa_common/portaudio.h new file mode 100644 index 000000000..2b257399b --- /dev/null +++ b/portaudio-v19/pa_common/portaudio.h @@ -0,0 +1,1124 @@ + +#ifndef PORTAUDIO_H +#define PORTAUDIO_H +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * PortAudio API Header File + * Latest version available at: http://www.portaudio.com/ + * + * Copyright (c) 1999-2002 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief The PortAudio API. +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** Retrieve the release number of the currently running PortAudio build, + eg 1900. +*/ +int Pa_GetVersion( void ); + + +/** Retrieve a textual description of the current PortAudio build, + eg "PortAudio V19-devel 13 October 2002". +*/ +const char* Pa_GetVersionText( void ); + + +/** Error codes returned by PortAudio functions. + Note that with the exception of paNoError, all PaErrorCodes are negative. +*/ + +typedef int PaError; +typedef enum PaErrorCode +{ + paNoError = 0, + + paNotInitialized = -10000, + paUnanticipatedHostError, + paInvalidChannelCount, + paInvalidSampleRate, + paInvalidDevice, + paInvalidFlag, + paSampleFormatNotSupported, + paBadIODeviceCombination, + paInsufficientMemory, + paBufferTooBig, + paBufferTooSmall, + paNullCallback, + paBadStreamPtr, + paTimedOut, + paInternalError, + paDeviceUnavailable, + paIncompatibleHostApiSpecificStreamInfo, + paStreamIsStopped, + paStreamIsNotStopped, + paInputOverflowed, + paOutputUnderflowed, + paHostApiNotFound, + paInvalidHostApi, + paCanNotReadFromACallbackStream, /**< @todo review error code name */ + paCanNotWriteToACallbackStream, /**< @todo review error code name */ + paCanNotReadFromAnOutputOnlyStream, /**< @todo review error code name */ + paCanNotWriteToAnInputOnlyStream, /**< @todo review error code name */ + paIncompatibleStreamHostApi, + paBadBufferPtr +} PaErrorCode; + + +/** Translate the supplied PortAudio error code into a human readable + message. +*/ +const char *Pa_GetErrorText( PaError errorCode ); + + +/** Library initialization function - call this before using PortAudio. + This function initialises internal data structures and prepares underlying + host APIs for use. This function MUST be called before using any other + PortAudio API functions. + + If Pa_Initialize() is called multiple times, each successful + call must be matched with a corresponding call to Pa_Terminate(). + Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not + required to be fully nested. + + Note that if Pa_Initialize() returns an error code, Pa_Terminate() should + NOT be called. + + @return paNoError if successful, otherwise an error code indicating the cause + of failure. + + @see Pa_Terminate +*/ +PaError Pa_Initialize( void ); + + +/** Library termination function - call this when finished using PortAudio. + This function deallocates all resources allocated by PortAudio since it was + initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has + been called multiple times, each call must be matched with a corresponding call + to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically + close any PortAudio streams that are still open. + + Pa_Terminate() MUST be called before exiting a program which uses PortAudio. + Failure to do so may result in serious resource leaks, such as audio devices + not being available until the next reboot. + + @return paNoError if successful, otherwise an error code indicating the cause + of failure. + + @see Pa_Initialize +*/ +PaError Pa_Terminate( void ); + + + +/** The type used to refer to audio devices. Values of this type usually + range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice + and paUseHostApiSpecificDeviceSpecification values. + + @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification +*/ +typedef int PaDeviceIndex; + + +/** A special PaDeviceIndex value indicating that no device is available, + or should be used. + + @see PaDeviceIndex +*/ +#define paNoDevice ((PaDeviceIndex)-1) + + +/** A special PaDeviceIndex value indicating that the device(s) to be used + are specified in the host api specific stream info structure. + + @see PaDeviceIndex +*/ +#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2) + + +/* Host API enumeration mechanism */ + +/** The type used to enumerate to host APIs at runtime. Values of this type + range from 0 to (Pa_GetHostApiCount()-1). + + @see Pa_GetHostApiCount +*/ +typedef int PaHostApiIndex; + + +/** Retrieve the number of available host APIs. Even if a host API is + available it may have no devices available. + + @return A non-negative value indicating the number of available host APIs + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + @see PaHostApiIndex +*/ +PaHostApiIndex Pa_GetHostApiCount( void ); + + +/** Retrieve the index of the default host API. The default host API will be + the lowest common denominator host API on the current platform and is + unlikely to provide the best performance. + + @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1) + indicating the default host API index or, a PaErrorCode (which are always + negative) if PortAudio is not initialized or an error is encountered. +*/ +PaHostApiIndex Pa_GetDefaultHostApi( void ); + + +/** Unchanging unique identifiers for each supported host API. This type + is used in the PaHostApiInfo structure. The values are guaranteed to be + unique and to never change, thus allowing code to be written that + conditionally uses host API specific extensions. + + New type ids will be allocated when support for a host API reaches + "public alpha" status, prior to that developers should use the + paInDevelopment type id. + + @see PaHostApiInfo +*/ +typedef enum PaHostApiTypeId +{ + paInDevelopment=0, /* use while developing support for a new host API */ + paDirectSound=1, + paMME=2, + paASIO=3, + paSoundManager=4, + paCoreAudio=5, + paOSS=7, + paALSA=8, + paAL=9, + paBeOS=10, + paWDMKS=11, + paJACK=12 +} PaHostApiTypeId; + + +/** A structure containing information about a particular host API. */ + +typedef struct PaHostApiInfo +{ + /** this is struct version 1 */ + int structVersion; + /** The well known unique identifier of this host API @see PaHostApiTypeId */ + PaHostApiTypeId type; + /** A textual description of the host API for display on user interfaces. */ + const char *name; + + /** The number of devices belonging to this host API. This field may be + used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate + all devices for this host API. + @see Pa_HostApiDeviceIndexToDeviceIndex + */ + int deviceCount; + + /** The the default input device for this host API. The value will be a + device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice + if no default input device is available. + */ + PaDeviceIndex defaultInputDevice; + + /** The the default output device for this host API. The value will be a + device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice + if no default output device is available. + */ + PaDeviceIndex defaultOutputDevice; + +} PaHostApiInfo; + + +/** Retrieve a pointer to a structure containing information about a specific + host Api. + + @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) + + @return A pointer to an immutable PaHostApiInfo structure describing + a specific host API. If the hostApi parameter is out of range or an error + is encountered, the function returns NULL. + + The returned structure is owned by the PortAudio implementation and must not + be manipulated or freed. The pointer is only guaranteed to be valid between + calls to Pa_Initialize() and Pa_Terminate(). +*/ +const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi ); + + +/** Convert a static host API unique identifier, into a runtime + host API index. + + @param type A unique host API identifier belonging to the PaHostApiTypeId + enumeration. + + @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or, + a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + The paHostApiNotFound error code indicates that the host API specified by the + type parameter is not available. + + @see PaHostApiTypeId +*/ +PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ); + + +/** Convert a host-API-specific device index to standard PortAudio device index. + This function may be used in conjunction with the deviceCount field of + PaHostApiInfo to enumerate all devices for the specified host API. + + @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) + + @param hostApiDeviceIndex A valid per-host device index in the range + 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1) + + @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1) + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + A paInvalidHostApi error code indicates that the host API index specified by + the hostApi parameter is out of range. + + A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter + is out of range. + + @see PaHostApiInfo +*/ +PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, + int hostApiDeviceIndex ); + + + +/** Structure used to return information about a host error condition. +*/ +typedef struct PaHostErrorInfo{ + PaHostApiTypeId hostApiType; /**< the host API which returned the error code */ + long errorCode; /**< the error code returned */ + const char *errorText; /**< a textual description of the error if available, otherwise a zero-length string */ +}PaHostErrorInfo; + + +/** Return information about the last host error encountered. The error + information returned by Pa_GetLastHostErrorInfo() will never be modified + asyncronously by errors occurring in other PortAudio owned threads + (such as the thread that manages the stream callback.) + + This function is provided as a last resort, primarily to enhance debugging + by providing clients with access to all available error information. + + @return A pointer to an immutable structure constaining information about + the host error. The values in this structure will only be valid if a + PortAudio function has previously returned the paUnanticipatedHostError + error code. +*/ +const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ); + + + +/* Device enumeration and capabilities */ + +/** Retrieve the number of available devices. The number of available devices + may be zero. + + @return A non-negative value indicating the number of available devices or, + a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. +*/ +PaDeviceIndex Pa_GetDeviceCount( void ); + + +/** Retrieve the index of the default input device. The result can be + used in the inputDevice parameter to Pa_OpenStream(). + + @return The default input device index for the default host API, or paNoDevice + if no default input device is available or an error was encountered. +*/ +PaDeviceIndex Pa_GetDefaultInputDevice( void ); + + +/** Retrieve the index of the default output device. The result can be + used in the outputDevice parameter to Pa_OpenStream(). + + @return The default output device index for the defualt host API, or paNoDevice + if no default output device is available or an error was encountered. + + @note + On the PC, the user can specify a default device by + setting an environment variable. For example, to use device #1. +
    + set PA_RECOMMENDED_OUTPUT_DEVICE=1
    +
    + The user should first determine the available device ids by using + the supplied application "pa_devs". +*/ +PaDeviceIndex Pa_GetDefaultOutputDevice( void ); + + +/** The type used to represent monotonic time in seconds that can be used + for syncronisation. The type is used for the outTime argument to the + PaStreamCallback and as the result of Pa_GetStreamTime(). + + @see PaStreamCallback, Pa_GetStreamTime +*/ +typedef double PaTime; + + +/** A type used to specify one or more sample formats. Each value indicates + a possible format for sound data passed to and from the stream callback, + Pa_ReadStream and Pa_WriteStream. + + The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 + and aUInt8 are usually implemented by all implementations. + + The floating point representation (paFloat32) uses +1.0 and -1.0 as the + maximum and minimum respectively. + + paUInt8 is an unsigned 8 bit format where 128 is considered "ground" + + The paNonInterleaved flag indicates that a multichannel buffer is passed + as a set of non-interleaved pointers. + + @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo + @see paFloat32, paInt16, paInt32, paInt24, paInt8 + @see paUInt8, paCustomFormat, paNonInterleaved +*/ +typedef unsigned long PaSampleFormat; + + +#define paFloat32 ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */ +#define paInt32 ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */ +#define paInt24 ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */ +#define paInt16 ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */ +#define paInt8 ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */ +#define paUInt8 ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */ +#define paCustomFormat ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */ + +#define paNonInterleaved ((PaSampleFormat) 0x80000000) + +/** A structure providing information and capabilities of PortAudio devices. + Devices may support input, output or both input and output. +*/ +typedef struct PaDeviceInfo +{ + int structVersion; /* this is struct version 2 */ + const char *name; + PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/ + + int maxInputChannels; + int maxOutputChannels; + + /* Default latency values for interactive performance. */ + PaTime defaultLowInputLatency; + PaTime defaultLowOutputLatency; + /* Default latency values for robust non-interactive applications (eg. playing sound files). */ + PaTime defaultHighInputLatency; + PaTime defaultHighOutputLatency; + + double defaultSampleRate; +} PaDeviceInfo; + + +/** Retrieve a pointer to a PaDeviceInfo structure containing information + about the specified device. + @return A pointer to an immutable PaDeviceInfo structure. If the device + parameter is out of range the function returns NULL. + + @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1) + + @note PortAudio manages the memory referenced by the returned pointer, + the client must not manipulate or free the memory. The pointer is only + guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate(). + + @see PaDeviceInfo, PaDeviceIndex +*/ +const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ); + + +/** Parameters for one direction (input or output) of a stream. +*/ +typedef struct PaStreamParameters +{ + /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1) + specifying the device to be used or the special constant + paUseHostApiSpecificDeviceSpecification which indicates that the actual + device(s) to use are specified in hostApiSpecificStreamInfo. + This field must not be set to paNoDevice. + */ + PaDeviceIndex device; + + /** The number of channels of sound to be delivered to the + stream callback or accessed by Pa_ReadStream() or Pa_WriteStream(). + It can range from 1 to the value of maxInputChannels in the + PaDeviceInfo record for the device specified by the device parameter. + */ + int channelCount; + + /** The sample format of the buffer provided to the stream callback, + a_ReadStream() or Pa_WriteStream(). It may be any of the formats described + by the PaSampleFormat enumeration. + */ + PaSampleFormat sampleFormat; + + /** The desired latency in seconds. Where practical, implementations should + configure their latency based on these parameters, otherwise they may + choose the closest viable latency instead. Unless the suggested latency + is greater than the absolute upper limit for the device implementations + should round the suggestedLatency up to the next practial value - ie to + provide an equal or higher latency than suggestedLatency wherever possibe. + Actual latency values for an open stream may be retrieved using the + inputLatency and outputLatency fields of the PaStreamInfo structure + returned by Pa_GetStreamInfo(). + @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo + */ + PaTime suggestedLatency; + + /** An optional pointer to a host api specific data structure + containing additional information for device setup and/or stream processing. + hostApiSpecificStreamInfo is never required for correct operation, + if not used it should be set to NULL. + */ + void *hostApiSpecificStreamInfo; + +} PaStreamParameters; + + +/** Return code for Pa_IsFormatSupported indicating success. */ +#define paFormatIsSupported (0) + +/** Determine whether it would be possible to open a stream with the specified + parameters. + + @param inputParameters A structure that describes the input parameters used to + open a stream. The suggestedLatency field is ignored. See PaStreamParameters + for a description of these parameters. inputParameters must be NULL for + output-only streams. + + @param outputParameters A structure that describes the output parameters used + to open a stream. The suggestedLatency field is ignored. See PaStreamParameters + for a description of these parameters. outputParameters must be NULL for + input-only streams. + + @param sampleRate The required sampleRate. For full-duplex streams it is the + sample rate for both input and output + + @return Returns 0 if the format is supported, and an error code indicating why + the format is not supported otherwise. The constant paFormatIsSupported is + provided to compare with the return value for success. + + @see paFormatIsSupported, PaStreamParameters +*/ +PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); + + + +/* Streaming types and functions */ + + +/** + A single PaStream can provide multiple channels of real-time + streaming audio input and output to a client application. A stream + provides access to audio hardware represented by one or more + PaDevices. Depending on the underlying Host API, it may be possible + to open multiple streams using the same device, however this behavior + is implementation defined. Portable applications should assume that + a PaDevice may be simultaneously used by at most one PaStream. + + Pointers to PaStream objects are passed between PortAudio functions that + operate on streams. + + @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream, + Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive, + Pa_GetStreamTime, Pa_GetStreamCpuLoad + +*/ +typedef void PaStream; + + +/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream() + or Pa_OpenDefaultStream() to indicate that the stream callback will + accept buffers of any size. +*/ +#define paFramesPerBufferUnspecified (0) + + +/** Flags used to control the behavior of a stream. They are passed as + parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be + ORed together. + + @see Pa_OpenStream, Pa_OpenDefaultStream + @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput, + paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags +*/ +typedef unsigned long PaStreamFlags; + +/** @see PaStreamFlags */ +#define paNoFlag ((PaStreamFlags) 0) + +/** Disable default clipping of out of range samples. + @see PaStreamFlags +*/ +#define paClipOff ((PaStreamFlags) 0x00000001) + +/** Disable default dithering. + @see PaStreamFlags +*/ +#define paDitherOff ((PaStreamFlags) 0x00000002) + +/** Flag requests that where possible a full duplex stream will not discard + overflowed input samples without calling the stream callback. This flag is + only valid for full duplex callback streams and only when used in combination + with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using + this flag incorrectly results in a paInvalidFlag error being returned from + Pa_OpenStream and Pa_OpenDefaultStream. + + @see PaStreamFlags, paFramesPerBufferUnspecified +*/ +#define paNeverDropInput ((PaStreamFlags) 0x00000004) + +/** Call the stream callback to fill initial output buffers, rather than the + default behavior of priming the buffers with zeros (silence). This flag has + no effect for input-only and blocking read/write streams. + + @see PaStreamFlags +*/ +#define paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) + +/** A mask specifying the platform specific bits. + @see PaStreamFlags +*/ +#define paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000) + +/** + Timing information for the buffers passed to the stream callback. +*/ +typedef struct PaStreamCallbackTimeInfo{ + PaTime inputBufferAdcTime; + PaTime currentTime; + PaTime outputBufferDacTime; +} PaStreamCallbackTimeInfo; + + +/** + Flag bit constants for the statusFlags to PaStreamCallback. + + @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow, + paPrimingOutput +*/ +typedef unsigned long PaStreamCallbackFlags; + +/** In a stream opened with paFramesPerBufferUnspecified, indicates that + input data is all silence (zeros) because no real data is available. In a + stream opened without paFramesPerBufferUnspecified, it indicates that one or + more zero samples have been inserted into the input buffer to compensate + for an input underflow. + @see PaStreamCallbackFlags +*/ +#define paInputUnderflow ((PaStreamCallbackFlags) 0x00000001) + +/** In a stream opened with paFramesPerBufferUnspecified, indicates that data + prior to the first sample of the input buffer was discarded due to an + overflow, possibly because the stream callback is using too much CPU time. + Otherwise indicates that data prior to one or more samples in the + input buffer was discarded. + @see PaStreamCallbackFlags +*/ +#define paInputOverflow ((PaStreamCallbackFlags) 0x00000002) + +/** Indicates that output data (or a gap) was inserted, possibly because the + stream callback is using too much CPU time. + @see PaStreamCallbackFlags +*/ +#define paOutputUnderflow ((PaStreamCallbackFlags) 0x00000004) + +/** Indicates that output data will be discarded because no room is available. + @see PaStreamCallbackFlags +*/ +#define paOutputOverflow ((PaStreamCallbackFlags) 0x00000008) + +/** Some of all of the output data will be used to prime the stream, input + data may be zero. + @see PaStreamCallbackFlags +*/ +#define paPrimingOutput ((PaStreamCallbackFlags) 0x00000010) + +/** + Allowable return values for the PaStreamCallback. + @see PaStreamCallback +*/ +typedef enum PaStreamCallbackResult +{ + paContinue=0, + paComplete=1, + paAbort=2 +} PaStreamCallbackResult; + + +/** + Functions of type PaStreamCallback are implemented by PortAudio clients. + They consume, process or generate audio in response to requests from an + active PortAudio stream. + + @param input and @param output are arrays of interleaved samples, + the format, packing and number of channels used by the buffers are + determined by parameters to Pa_OpenStream(). + + @param frameCount The number of sample frames to be processed by + the stream callback. + + @param timeInfo The time in seconds when the first sample of the input + buffer was received at the audio input, the time in seconds when the first + sample of the output buffer will begin being played at the audio output, and + the time in seconds when the stream callback was called. + See also Pa_GetStreamTime() + + @param statusFlags Flags indicating whether input and/or output buffers + have been inserted or will be dropped to overcome underflow or overflow + conditions. + + @param userData The value of a user supplied pointer passed to + Pa_OpenStream() intended for storing synthesis data etc. + + @return + The stream callback should return one of the values in the + PaStreamCallbackResult enumeration. To ensure that the callback continues + to be called, it should return paContinue (0). Either paComplete or paAbort + can be returned to finish stream processing, after either of these values is + returned the callback will not be called again. If paAbort is returned the + stream will finish as soon as possible. If paComplete is returned, the stream + will continue until all buffers generated by the callback have been played. + This may be useful in applications such as soundfile players where a specific + duration of output is required. However, it is not necessary to utilise this + mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also + be used to stop the stream. The callback must always fill the entire output + buffer irrespective of its return value. + + @see Pa_OpenStream, Pa_OpenDefaultStream + + @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call + PortAudio API functions from within the stream callback. +*/ +typedef int PaStreamCallback( + const void *input, void *output, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + + +/** Opens a stream for either input, output or both. + + @param stream The address of a PaStream pointer which will receive + a pointer to the newly opened stream. + + @param inputParameters A structure that describes the input parameters used by + the opened stream. See PaStreamParameters for a description of these parameters. + inputParameters must be NULL for output-only streams. + + @param outputParameters A structure that describes the output parameters used by + the opened stream. See PaStreamParameters for a description of these parameters. + outputParameters must be NULL for input-only streams. + + @param sampleRate The desired sampleRate. For full-duplex streams it is the + sample rate for both input and output + + @param framesPerBuffer The number of frames passed to the stream callback + function, or the preferred block granularity for a blocking read/write stream. + The special value paFramesPerBufferUnspecified (0) may be used to request that + the stream callback will recieve an optimal (and possibly varying) number of + frames based on host requirements and the requested latency settings. + Note: With some host APIs, the use of non-zero framesPerBuffer for a callback + stream may introduce an additional layer of buffering which could introduce + additional latency. PortAudio guarantees that the additional latency + will be kept to the theoretical minimum however, it is strongly recommended + that a non-zero framesPerBuffer value only be used when your algorithm + requires a fixed number of frames per stream callback. + + @param streamFlags Flags which modify the behaviour of the streaming process. + This parameter may contain a combination of flags ORed together. Some flags may + only be relevant to certain buffer formats. + + @param streamCallback A pointer to a client supplied function that is responsible + for processing and filling input and output buffers. If this parameter is NULL + the stream will be opened in 'blocking read/write' mode. In blocking mode, + the client can receive sample data using Pa_ReadStream and write sample data + using Pa_WriteStream, the number of samples that may be read or written + without blocking is returned by Pa_GetStreamReadAvailable and + Pa_GetStreamWriteAvailable respectively. + + @param userData A client supplied pointer which is passed to the stream callback + function. It could for example, contain a pointer to instance data necessary + for processing the audio buffers. This parameter is ignored if streamCallback + is NULL. + + @return + Upon success Pa_OpenStream() returns paNoError and places a pointer to a + valid PaStream in the stream argument. The stream is inactive (stopped). + If a call to Pa_OpenStream() fails, a non-zero error code is returned (see + PaError for possible error codes) and the value of stream is invalid. + + @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream, + Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable +*/ +PaError Pa_OpenStream( PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); + + +/** A simplified version of Pa_OpenStream() that opens the default input + and/or output devices. + + @param stream The address of a PaStream pointer which will receive + a pointer to the newly opened stream. + + @param numInputChannels The number of channels of sound that will be supplied + to the stream callback or returned by Pa_ReadStream. It can range from 1 to + the value of maxInputChannels in the PaDeviceInfo record for the default input + device. If 0 the stream is opened as an output-only stream. + + @param numOutputChannels The number of channels of sound to be delivered to the + stream callback or passed to Pa_WriteStream. It can range from 1 to the value + of maxOutputChannels in the PaDeviceInfo record for the default output dvice. + If 0 the stream is opened as an output-only stream. + + @param sampleFormat The sample format of both the input and output buffers + provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream. + sampleFormat may be any of the formats described by the PaSampleFormat + enumeration. + + @param sampleRate Same as Pa_OpenStream parameter of the same name. + @param framesPerBuffer Same as Pa_OpenStream parameter of the same name. + @param streamCallback Same as Pa_OpenStream parameter of the same name. + @param userData Same as Pa_OpenStream parameter of the same name. + + @return As for Pa_OpenStream + + @see Pa_OpenStream, PaStreamCallback +*/ +PaError Pa_OpenDefaultStream( PaStream** stream, + int numInputChannels, + int numOutputChannels, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamCallback *streamCallback, + void *userData ); + + +/** Closes an audio stream. If the audio stream is active it + discards any pending buffers as if Pa_AbortStream() had been called. +*/ +PaError Pa_CloseStream( PaStream *stream ); + + +/** Functions of type PaStreamFinishedCallback are implemented by PortAudio + clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback + function. Once registered they are called when the stream becomes inactive + (ie once a call to Pa_StopStream() will not block). + A stream will become inactive after the stream callback returns non-zero, + or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio + output, if the stream callback returns paComplete, or Pa_StopStream is called, + the stream finished callback will not be called until all generated sample data + has been played. + + @param userData The userData parameter supplied to Pa_OpenStream() + + @see Pa_SetStreamFinishedCallback +*/ +typedef void PaStreamFinishedCallback( void *userData ); + + +/** Register a stream finished callback function which will be called when the + stream becomes inactive. See the description of PaStreamFinishedCallback for + further details about when the callback will be called. + + @param stream a pointer to a PaStream that is in the stopped state - if the + stream is not stopped, the stream's finished callback will remain unchanged + and an error code will be returned. + + @param streamFinishedCallback a pointer to a function with the same signature + as PaStreamFinishedCallback, that will be called when the stream becomes + inactive. Passing NULL for this parameter will un-register a previously + registered stream finished callback function. + + @return on success returns paNoError, otherwise an error code indicating the cause + of the error. + + @see PaStreamFinishedCallback +*/ +PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); + + +/** Commences audio processing. +*/ +PaError Pa_StartStream( PaStream *stream ); + + +/** Terminates audio processing. It waits until all pending + audio buffers have been played before it returns. +*/ +PaError Pa_StopStream( PaStream *stream ); + + +/** Terminates audio processing immediately without waiting for pending + buffers to complete. +*/ +PaError Pa_AbortStream( PaStream *stream ); + + +/** Determine whether the stream is stopped. + A stream is considered to be stopped prior to a successful call to + Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream. + If a stream callback returns a value other than paContinue the stream is NOT + considered to be stopped. + + @return Returns one (1) when the stream is stopped, zero (0) when + the stream is running or, a PaErrorCode (which are always negative) if + PortAudio is not initialized or an error is encountered. + + @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive +*/ +PaError Pa_IsStreamStopped( PaStream *stream ); + + +/** Determine whether the stream is active. + A stream is active after a successful call to Pa_StartStream(), until it + becomes inactive either as a result of a call to Pa_StopStream() or + Pa_AbortStream(), or as a result of a return value other than paContinue from + the stream callback. In the latter case, the stream is considered inactive + after the last buffer has finished playing. + + @return Returns one (1) when the stream is active (ie playing or recording + audio), zero (0) when not playing or, a PaErrorCode (which are always negative) + if PortAudio is not initialized or an error is encountered. + + @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped +*/ +PaError Pa_IsStreamActive( PaStream *stream ); + + + +/** A structure containing unchanging information about an open stream. + @see Pa_GetStreamInfo +*/ + +typedef struct PaStreamInfo +{ + /** this is struct version 1 */ + int structVersion; + + /** The input latency of the stream in seconds. This value provides the most + accurate estimate of input latency available to the implementation. It may + differ significantly from the suggestedLatency value passed to Pa_OpenStream(). + The value of this field will be zero (0.) for output-only streams. + @see PaTime + */ + PaTime inputLatency; + + /** The output latency of the stream in seconds. This value provides the most + accurate estimate of output latency available to the implementation. It may + differ significantly from the suggestedLatency value passed to Pa_OpenStream(). + The value of this field will be zero (0.) for input-only streams. + @see PaTime + */ + PaTime outputLatency; + + /** The sample rate of the stream in Hertz (samples per second). In cases + where the hardware sample rate is inaccurate and PortAudio is aware of it, + the value of this field may be different from the sampleRate parameter + passed to Pa_OpenStream(). If information about the actual hardware sample + rate is not available, this field will have the same value as the sampleRate + parameter passed to Pa_OpenStream(). + */ + double sampleRate; + +} PaStreamInfo; + + +/** Retrieve a pointer to a PaStreamInfo structure containing information + about the specified stream. + @return A pointer to an immutable PaStreamInfo structure. If the stream + parameter invalid, or an error is encountered, the function returns NULL. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @note PortAudio manages the memory referenced by the returned pointer, + the client must not manipulate or free the memory. The pointer is only + guaranteed to be valid until the specified stream is closed. + + @see PaStreamInfo +*/ +const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ); + + +/** Determine the current time for the stream according to the same clock used + to generate buffer timestamps. This time may be used for syncronising other + events to the audio stream, for example synchronizing audio to MIDI. + + @return The stream's current time in seconds, or 0 if an error occurred. + + @see PaTime, PaStreamCallback +*/ +PaTime Pa_GetStreamTime( PaStream *stream ); + + +/** Retrieve CPU usage information for the specified stream. + The "CPU Load" is a fraction of total CPU time consumed by a callback stream's + audio processing routines including, but not limited to the client supplied + stream callback. This function does not work with blocking read/write streams. + + This function may be called from the stream callback function or the + application. + + @return + A floating point value, typically between 0.0 and 1.0, where 1.0 indicates + that the stream callback is consuming the maximum number of CPU cycles possible + to maintain real-time operation. A value of 0.5 would imply that PortAudio and + the stream callback was consuming roughly 50% of the available CPU time. The + return value may exceed 1.0. A value of 0.0 will always be returned for a + blocking read/write stream, or if an error occurrs. +*/ +double Pa_GetStreamCpuLoad( PaStream* stream ); + + +/** Read samples from an input stream. The function doesn't return until + the entire buffer has been filled - this may involve waiting for the operating + system to supply the data. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @param buffer A pointer to a buffer of sample frames. The buffer contains + samples in the format specified by the inputParameters->sampleFormat field + used to open the stream, and the number of channels specified by + inputParameters->numChannels. If non-interleaved samples were requested, + buffer is a pointer to the first element of an array of non-interleaved + buffer pointers, one for each channel. + + @param frames The number of frames to be read into buffer. This parameter + is not constrained to a specific range, however high performance applications + will want to match this parameter to the framesPerBuffer parameter used + when opening the stream. + + @return On success PaNoError will be returned, or PaInputOverflowed if input + data was discarded by PortAudio after the previous call and before this call. +*/ +PaError Pa_ReadStream( PaStream* stream, + void *buffer, + unsigned long frames ); + + +/** Write samples to an output stream. This function doesn't return until the + entire buffer has been consumed - this may involve waiting for the operating + system to consume the data. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @param buffer A pointer to a buffer of sample frames. The buffer contains + samples in the format specified by the outputParameters->sampleFormat field + used to open the stream, and the number of channels specified by + outputParameters->numChannels. If non-interleaved samples were requested, + buffer is a pointer to the first element of an array of non-interleaved + buffer pointers, one for each channel. + + @param frames The number of frames to be written from buffer. This parameter + is not constrained to a specific range, however high performance applications + will want to match this parameter to the framesPerBuffer parameter used + when opening the stream. + + @return On success PaNoError will be returned, or paOutputUnderflowed if + additional output data was inserted after the previous call and before this + call. +*/ +PaError Pa_WriteStream( PaStream* stream, + const void *buffer, + unsigned long frames ); + + +/** Retrieve the number of frames that can be read from the stream without + waiting. + + @return Returns a non-negative value representing the maximum number of frames + that can be read from the stream without blocking or busy waiting or, a + PaErrorCode (which are always negative) if PortAudio is not initialized or an + error is encountered. +*/ +signed long Pa_GetStreamReadAvailable( PaStream* stream ); + + +/** Retrieve the number of frames that can be written to the stream without + waiting. + + @return Returns a non-negative value representing the maximum number of frames + that can be written to the stream without blocking or busy waiting or, a + PaErrorCode (which are always negative) if PortAudio is not initialized or an + error is encountered. +*/ +signed long Pa_GetStreamWriteAvailable( PaStream* stream ); + + +/* Miscellaneous utilities */ + + +/** Retrieve the size of a given sample format in bytes. + + @return The size in bytes of a single sample in the specified format, + or paSampleFormatNotSupported if the format is not supported. +*/ +PaError Pa_GetSampleSize( PaSampleFormat format ); + + +/** Put the caller to sleep for at least 'msec' milliseconds. This function is + provided only as a convenience for authors of portable code (such as the tests + and examples in the PortAudio distribution.) + + The function may sleep longer than requested so don't rely on this for accurate + musical timing. +*/ +void Pa_Sleep( long msec ); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PORTAUDIO_H */ diff --git a/portaudio-v19/pa_dll_switch/PaDllEntry.h b/portaudio-v19/pa_dll_switch/PaDllEntry.h new file mode 100644 index 000000000..e070054b3 --- /dev/null +++ b/portaudio-v19/pa_dll_switch/PaDllEntry.h @@ -0,0 +1,184 @@ + +/* + * PortAudio Portable Real-Time Audio Library + * PortAudio DLL Header File + * Latest version available at: http://www.audiomulch.com/portaudio/ + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +// changed by zplane.developement in order to generate a DLL + +#ifndef __PADLLENTRY_HEADER_INCLUDED__ + +#define __PADLLENTRY_HEADER_INCLUDED__ + +typedef int PaError; +typedef enum { + paNoError = 0, + + paHostError = -10000, + paInvalidChannelCount, + paInvalidSampleRate, + paInvalidDeviceId, + paInvalidFlag, + paSampleFormatNotSupported, + paBadIODeviceCombination, + paInsufficientMemory, + paBufferTooBig, + paBufferTooSmall, + paNullCallback, + paBadStreamPtr, + paTimedOut, + paInternalError +} PaErrorNum; + +typedef unsigned long PaSampleFormat; +#define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ +#define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ +#define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ +#define paInt24 ((PaSampleFormat) (1<<3)) +#define paPackedInt24 ((PaSampleFormat) (1<<4)) +#define paInt8 ((PaSampleFormat) (1<<5)) +#define paUInt8 ((PaSampleFormat) (1<<6)) /* unsigned 8 bit, 128 is "ground" */ +#define paCustomFormat ((PaSampleFormat) (1<<16)) + + +typedef int PaDeviceID; +#define paNoDevice -1 + +typedef struct +{ + int structVersion; + const char *name; + int maxInputChannels; + int maxOutputChannels; + /* Number of discrete rates, or -1 if range supported. */ + int numSampleRates; + /* Array of supported sample rates, or {min,max} if range supported. */ + const double *sampleRates; + PaSampleFormat nativeSampleFormats; +} +PaDeviceInfo; + + +typedef double PaTimestamp; + + +typedef int (PortAudioCallback)( + void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ); + + +#define paNoFlag (0) +#define paClipOff (1<<0) /* disable default clipping of out of range samples */ +#define paDitherOff (1<<1) /* disable default dithering */ +#define paPlatformSpecificFlags (0x00010000) +typedef unsigned long PaStreamFlags; + +typedef void PortAudioStream; +#define PaStream PortAudioStream + +extern PaError (__cdecl* Pa_Initialize)( void ); + + + +extern PaError (__cdecl* Pa_Terminate)( void ); + + +extern long (__cdecl* Pa_GetHostError)( void ); + + +extern const char* (__cdecl* Pa_GetErrorText)( PaError ); + + + +extern int (__cdecl* Pa_CountDevices)(void); + +extern PaDeviceID (__cdecl* Pa_GetDefaultInputDeviceID)( void ); + +extern PaDeviceID (__cdecl* Pa_GetDefaultOutputDeviceID)( void ); + + +extern const PaDeviceInfo* (__cdecl* Pa_GetDeviceInfo)( PaDeviceID); + + + +extern PaError (__cdecl* Pa_OpenStream)( + PortAudioStream ** , + PaDeviceID , + int , + PaSampleFormat , + void *, + PaDeviceID , + int , + PaSampleFormat , + void *, + double , + unsigned long , + unsigned long , + unsigned long , + PortAudioCallback *, + void * ); + + + +extern PaError (__cdecl* Pa_OpenDefaultStream)( PortAudioStream** stream, + int numInputChannels, + int numOutputChannels, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + unsigned long numberOfBuffers, + PortAudioCallback *callback, + void *userData ); + + +extern PaError (__cdecl* Pa_CloseStream)( PortAudioStream* ); + + +extern PaError (__cdecl* Pa_StartStream)( PortAudioStream *stream ); + +extern PaError (__cdecl* Pa_StopStream)( PortAudioStream *stream ); + +extern PaError (__cdecl* Pa_AbortStream)( PortAudioStream *stream ); + +extern PaError (__cdecl* Pa_StreamActive)( PortAudioStream *stream ); + +extern PaTimestamp (__cdecl* Pa_StreamTime)( PortAudioStream *stream ); + +extern double (__cdecl* Pa_GetCPULoad)( PortAudioStream* stream ); + +extern int (__cdecl* Pa_GetMinNumBuffers)( int framesPerBuffer, double sampleRate ); + +extern void (__cdecl* Pa_Sleep)( long msec ); + +extern PaError (__cdecl* Pa_GetSampleSize)( PaSampleFormat format ); + +#endif // __PADLLENTRY_HEADER_INCLUDED__ + diff --git a/portaudio-v19/pa_dll_switch/letter_from_tim_010817.txt b/portaudio-v19/pa_dll_switch/letter_from_tim_010817.txt new file mode 100644 index 0000000000000000000000000000000000000000..a535cd1dae6afccc58d304b141166f7f7600dbd5 GIT binary patch literal 1176 zcmZuxTT9$P6z=oV{oit8R;E*@}X#()!Rhna!MR#+}TBxv1M;-|u9#rL+*p zkaPPkXL1okH>0gP+tGy!ZREH`ADhkT>}T(^=gRP@x(mpji@Uw+ukuPbiHD4lA7y`q>E^cUhmO)S(cP( za4U;D09O>SYBC-uVX`k6BwO>hkw??RUw$=lQD{8et zNgaw12@N&H*F&fe7KJg9;l_F(*-6Z#__^lTXL3QC+w=SR^>tPE{Vs5V!IHB8wvisS zD-2rf2L=KOG^I$e98{$7B_KCaV;!eWeMvl|--6@0a2&nDNdr(3<5tg|`|NXELjYxc z?aI*eiugH4U4!h<<8OczN)~$HpF)W>;{}!5&_n;cok$fAAybCLdI2d?=(r6}u%aO! zGBwPOng|J?wN9%_sk^~F4F|PDw?9yu5aA!!E9;kH!Q4h{&<{~SKWgh_fOxFCp|y$( zH2|#0GBiMsL_Cx6_${1?QoKhC5V(?jTMrB&H@5KW9i?^3+@T^vjzpbJN#=@HuaHny z(UJHsUkw!SrV>vE5gueq2fQ+UqXzN-=EKb{-E4|BUSTOkU5qh-li!Bjj5g~~2A)G> zfzG%axC@39q!9Ub=9?HcB+(1s1y*m^kk{-DNedzRK42B3?aGHIOw@U|QkUY^a7$z| zRF-|yehol=sT3%{L8Y?olp2lXO)ocJ{qqM<>i5s!kzMFJ_F1*TK}+jxLN7`=R&;PO un(nK~{^b3H795@RxK>T@GkP~YsSd`~@!^!lCp0;%#uCxb|A`!`H@^T5#E2*W literal 0 HcmV?d00001 diff --git a/portaudio-v19/pa_dll_switch/loadPA_DLL.cpp b/portaudio-v19/pa_dll_switch/loadPA_DLL.cpp new file mode 100644 index 000000000..043eda878 --- /dev/null +++ b/portaudio-v19/pa_dll_switch/loadPA_DLL.cpp @@ -0,0 +1,203 @@ +////////////////////////////////////////////////////////////////////////// + + +HINSTANCE pPaDll; + +/* + the function pointers to the PortAudio DLLs +*/ + +PaError (__cdecl* Pa_Initialize)( void ); + + + +PaError (__cdecl* Pa_Terminate)( void ); + + +long (__cdecl* Pa_GetHostError)( void ); + + +const char* (__cdecl* Pa_GetErrorText)( PaError ); + + +int (__cdecl* Pa_CountDevices)(void); + +PaDeviceID (__cdecl* Pa_GetDefaultInputDeviceID)( void ); + +PaDeviceID (__cdecl* Pa_GetDefaultOutputDeviceID)( void ); + + +const PaDeviceInfo* (__cdecl* Pa_GetDeviceInfo)( PaDeviceID); + + + +PaError (__cdecl* Pa_OpenStream)( + PortAudioStream ** , + PaDeviceID , + int , + PaSampleFormat , + void *, + PaDeviceID , + int , + PaSampleFormat , + void *, + double , + unsigned long , + unsigned long , + unsigned long , + PortAudioCallback *, + void * ); + + + +PaError (__cdecl* Pa_OpenDefaultStream)( PortAudioStream** stream, + int numInputChannels, + int numOutputChannels, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + unsigned long numberOfBuffers, + PortAudioCallback *callback, + void *userData ); + + +PaError (__cdecl* Pa_CloseStream)( PortAudioStream* ); + + +PaError (__cdecl* Pa_StartStream)( PortAudioStream *stream ); + +PaError (__cdecl* Pa_StopStream)( PortAudioStream *stream ); + +PaError (__cdecl* Pa_AbortStream)( PortAudioStream *stream ); + +PaError (__cdecl* Pa_StreamActive)( PortAudioStream *stream ); + +PaTimestamp (__cdecl* Pa_StreamTime)( PortAudioStream *stream ); + +double (__cdecl* Pa_GetCPULoad)( PortAudioStream* stream ); + +int (__cdecl* Pa_GetMinNumBuffers)( int framesPerBuffer, double sampleRate ); + +void (__cdecl* Pa_Sleep)( long msec ); + +PaError (__cdecl* Pa_GetSampleSize)( PaSampleFormat format ); + + +////////////////////////////////////////////////////////////////////////// + +... + +ZERROR AudioEngine::DirectXSupport(ZBOOL bSupDX) +{ + if (bSupDX) + if (CheckForDirectXSupport()) + bSupportDirectX = _TRUE; + else + return _NO_SOUND; + else + bSupportDirectX = _FALSE; + return _NO_ERROR; +} + + + +ZBOOL AudioEngine::CheckForDirectXSupport() +{ + HMODULE pTestDXLib; + FARPROC pFunctionality; + + pTestDXLib=LoadLibrary("DSOUND"); + if (pTestDXLib!=NULL) // check if there is a DirectSound + { + pFunctionality = GetProcAddress(pTestDXLib, (char*) 7); + if (pFunctionality!=NULL) + { + FreeLibrary(pTestDXLib); + return _TRUE; + } + else + { + FreeLibrary(pTestDXLib); + return _FALSE; + } + } + else + return _FALSE; +} + + +ZERROR AudioEngine::LoadPALib() +{ +#ifdef _DEBUG + if (bSupportDirectX) + pPaDll = LoadLibrary("PA_DXD"); + else + pPaDll = LoadLibrary("PA_MMED"); +#else + if (bSupportDirectX) + pPaDll = LoadLibrary("PA_DX"); + else + pPaDll = LoadLibrary("PA_MME"); +#endif + if (pPaDll!=NULL) + { + + Pa_Initialize = (int (__cdecl*)(void))GetProcAddress(pPaDll,"Pa_Initialize"); + Pa_Terminate = (int (__cdecl*)(void))GetProcAddress(pPaDll,"Pa_Terminate"); + Pa_GetHostError = (long (__cdecl* )( void )) GetProcAddress(pPaDll,"Pa_GetHostError"); + Pa_GetErrorText = (const char* (__cdecl* )( PaError )) GetProcAddress(pPaDll,"Pa_GetErrorText"); + Pa_CountDevices = (int (__cdecl*)(void))GetProcAddress(pPaDll,"Pa_CountDevices"); + Pa_GetDefaultInputDeviceID = (int (__cdecl*)(void))GetProcAddress(pPaDll,"Pa_GetDefaultInputDeviceID"); + Pa_GetDefaultOutputDeviceID = (int (__cdecl*)(void))GetProcAddress(pPaDll,"Pa_GetDefaultOutputDeviceID"); + Pa_GetDeviceInfo = (const PaDeviceInfo* (__cdecl* )( PaDeviceID)) GetProcAddress(pPaDll,"Pa_GetDeviceInfo"); + Pa_OpenStream = ( PaError (__cdecl* )( + PortAudioStream ** , + PaDeviceID , + int , + PaSampleFormat , + void *, + PaDeviceID , + int , + PaSampleFormat , + void *, + double , + unsigned long , + unsigned long , + unsigned long , + PortAudioCallback *, + void * )) GetProcAddress(pPaDll,"Pa_OpenStream"); + + Pa_OpenDefaultStream = (PaError (__cdecl* )( PortAudioStream** , + int , + int , + PaSampleFormat , + double , + unsigned long , + unsigned long , + PortAudioCallback *, + void * )) GetProcAddress(pPaDll,"Pa_OpenDefaultStream"); + Pa_CloseStream = (PaError (__cdecl* )( PortAudioStream* )) GetProcAddress(pPaDll,"Pa_CloseStream"); + Pa_StartStream = (PaError (__cdecl* )( PortAudioStream* )) GetProcAddress(pPaDll,"Pa_StartStream"); + Pa_StopStream = (PaError (__cdecl* )( PortAudioStream* ))GetProcAddress(pPaDll,"Pa_StopStream"); + Pa_AbortStream = (PaError (__cdecl* )( PortAudioStream* )) GetProcAddress(pPaDll,"Pa_AbortStream"); + Pa_StreamActive = (PaError (__cdecl* )( PortAudioStream* )) GetProcAddress(pPaDll,"Pa_StreamActive"); + Pa_StreamTime = (PaTimestamp (__cdecl* )( PortAudioStream *))GetProcAddress(pPaDll,"Pa_StreamTime"); + Pa_GetCPULoad = (double (__cdecl* )( PortAudioStream* ))GetProcAddress(pPaDll,"Pa_GetCPULoad"); + Pa_GetMinNumBuffers = (int (__cdecl* )( int , double )) GetProcAddress(pPaDll,"Pa_GetMinNumBuffers"); + Pa_Sleep = (void (__cdecl* )( long )) GetProcAddress(pPaDll,"Pa_Sleep"); + Pa_GetSampleSize = (PaError (__cdecl* )( PaSampleFormat )) GetProcAddress(pPaDll,"Pa_GetSampleSize"); + + return _NO_ERROR; + } + else + return _DLL_NOT_FOUND; +} + +ZERROR AudioEngine::UnLoadPALib() +{ + if (pPaDll!=NULL) + FreeLibrary(pPaDll); + return _NO_ERROR; +} + +... diff --git a/portaudio-v19/pa_dll_switch/pa_lib.c b/portaudio-v19/pa_dll_switch/pa_lib.c new file mode 100644 index 000000000..86601592c --- /dev/null +++ b/portaudio-v19/pa_dll_switch/pa_lib.c @@ -0,0 +1,827 @@ +/* + * Portable Audio I/O Library + * Host Independant Layer + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2000 Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +/* Modification History: + PLB20010422 - apply Mike Berry's changes for CodeWarrior on PC +*/ + +#include +#include +#include +#include + +/* PLB20010422 - "memory.h" doesn't work on CodeWarrior for PC. Thanks Mike Berry for the mod. */ +#ifdef _WIN32 +#ifndef __MWERKS__ +#include +#endif /* __MWERKS__ */ +#else /* !_WIN32 */ +#include +#endif /* _WIN32 */ + +#include "portaudio.h" +#include "pa_host.h" +#include "pa_trace.h" + +/* The reason we might NOT want to validate the rate before opening the stream + * is because many DirectSound drivers lie about the rates they actually support. + */ +#define PA_VALIDATE_RATE (0) /* If true validate sample rate against driver info. */ + +/* +O- maybe not allocate past_InputBuffer and past_OutputBuffer if not needed for conversion +*/ + +#ifndef FALSE + #define FALSE (0) + #define TRUE (!FALSE) +#endif + +#define PRINT(x) { printf x; fflush(stdout); } +#define ERR_RPT(x) PRINT(x) +#define DBUG(x) /* PRINT(x) */ +#define DBUGX(x) /* PRINT(x) */ + +static int gInitCount = 0; /* Count number of times Pa_Initialize() called to allow nesting and overlapping. */ + +static PaError Pa_KillStream( PortAudioStream *stream, int abort ); + +/***********************************************************************/ +int PaHost_FindClosestTableEntry( double allowableError, const double *rateTable, int numRates, double frameRate ) +{ + double err, minErr = allowableError; + int i, bestFit = -1; + + for( i=0; inumSampleRates == -1 ) + { + /* Is it out of range? */ + if( (requestedFrameRate < pdi->sampleRates[0]) || + (requestedFrameRate > pdi->sampleRates[1]) ) + { + return paInvalidSampleRate; + } + + *closestFrameRatePtr = requestedFrameRate; + } + else + { + bestRateIndex = PaHost_FindClosestTableEntry( 1.0, pdi->sampleRates, pdi->numSampleRates, requestedFrameRate ); + if( bestRateIndex < 0 ) return paInvalidSampleRate; + *closestFrameRatePtr = pdi->sampleRates[bestRateIndex]; + } + return paNoError; +} + +/*************************************************************************/ +DLL_API PaError Pa_OpenStream( + PortAudioStream** streamPtrPtr, + PaDeviceID inputDeviceID, + int numInputChannels, + PaSampleFormat inputSampleFormat, + void *inputDriverInfo, + PaDeviceID outputDeviceID, + int numOutputChannels, + PaSampleFormat outputSampleFormat, + void *outputDriverInfo, + double sampleRate, + unsigned long framesPerBuffer, + unsigned long numberOfBuffers, + unsigned long streamFlags, + PortAudioCallback *callback, + void *userData ) +{ + internalPortAudioStream *past = NULL; + PaError result = paNoError; + int bitsPerInputSample; + int bitsPerOutputSample; + /* Print passed parameters. */ + DBUG(("Pa_OpenStream( %p, %d, %d, %d, %p, /* input */ \n", + streamPtrPtr, inputDeviceID, numInputChannels, + inputSampleFormat, inputDriverInfo )); + DBUG((" %d, %d, %d, %p, /* output */\n", + outputDeviceID, numOutputChannels, + outputSampleFormat, outputDriverInfo )); + DBUG((" %g, %d, %d, 0x%x, , %p )\n", + sampleRate, framesPerBuffer, numberOfBuffers, + streamFlags, userData )); + + /* Check for parameter errors. */ + if( (streamFlags & ~(paClipOff | paDitherOff)) != 0 ) return paInvalidFlag; + if( streamPtrPtr == NULL ) return paBadStreamPtr; + if( inputDriverInfo != NULL ) return paHostError; /* REVIEW */ + if( outputDriverInfo != NULL ) return paHostError; /* REVIEW */ + if( (inputDeviceID < 0) && ( outputDeviceID < 0) ) return paInvalidDeviceId; + if( (outputDeviceID >= Pa_CountDevices()) || (inputDeviceID >= Pa_CountDevices()) ) return paInvalidDeviceId; + if( (numInputChannels <= 0) && ( numOutputChannels <= 0) ) return paInvalidChannelCount; + +#if SUPPORT_AUDIO_CAPTURE + if( inputDeviceID >= 0 ) + { + PaError size = Pa_GetSampleSize( inputSampleFormat ); + if( size < 0 ) return size; + bitsPerInputSample = 8 * size; + if( (numInputChannels <= 0) ) return paInvalidChannelCount; + } +#else + if( inputDeviceID >= 0 ) + { + return paInvalidChannelCount; + } +#endif /* SUPPORT_AUDIO_CAPTURE */ + else + { + if( numInputChannels > 0 ) return paInvalidChannelCount; + bitsPerInputSample = 0; + } + + if( outputDeviceID >= 0 ) + { + PaError size = Pa_GetSampleSize( outputSampleFormat ); + if( size < 0 ) return size; + bitsPerOutputSample = 8 * size; + if( (numOutputChannels <= 0) ) return paInvalidChannelCount; + } + else + { + if( numOutputChannels > 0 ) return paInvalidChannelCount; + bitsPerOutputSample = 0; + } + + if( callback == NULL ) return paNullCallback; + + /* Allocate and clear stream structure. */ + past = (internalPortAudioStream *) PaHost_AllocateFastMemory( sizeof(internalPortAudioStream) ); + if( past == NULL ) return paInsufficientMemory; + memset( past, 0, sizeof(internalPortAudioStream) ); + AddTraceMessage("Pa_OpenStream: past", (long) past ); + + past->past_Magic = PA_MAGIC; /* Set ID to catch bugs. */ + past->past_FramesPerUserBuffer = framesPerBuffer; + past->past_NumUserBuffers = numberOfBuffers; /* NOTE - PaHost_OpenStream() NMUST CHECK FOR ZERO! */ + past->past_Callback = callback; + past->past_UserData = userData; + past->past_OutputSampleFormat = outputSampleFormat; + past->past_InputSampleFormat = inputSampleFormat; + past->past_OutputDeviceID = outputDeviceID; + past->past_InputDeviceID = inputDeviceID; + past->past_NumInputChannels = numInputChannels; + past->past_NumOutputChannels = numOutputChannels; + past->past_Flags = streamFlags; + + /* Check for absurd sample rates. */ + if( (sampleRate < 1000.0) || (sampleRate > 200000.0) ) + { + result = paInvalidSampleRate; + goto cleanup; + } + + /* Allocate buffers that may be used for format conversion from user to native buffers. */ + if( numInputChannels > 0 ) + { + +#if PA_VALIDATE_RATE + result = PaHost_ValidateSampleRate( inputDeviceID, sampleRate, &past->past_SampleRate ); + if( result < 0 ) + { + goto cleanup; + } +#else + past->past_SampleRate = sampleRate; +#endif + /* Allocate single Input buffer. */ + past->past_InputBufferSize = framesPerBuffer * numInputChannels * ((bitsPerInputSample+7) / 8); + past->past_InputBuffer = PaHost_AllocateFastMemory(past->past_InputBufferSize); + if( past->past_InputBuffer == NULL ) + { + result = paInsufficientMemory; + goto cleanup; + } + } + else + { + past->past_InputBuffer = NULL; + } + + /* Allocate single Output buffer. */ + if( numOutputChannels > 0 ) + { +#if PA_VALIDATE_RATE + result = PaHost_ValidateSampleRate( outputDeviceID, sampleRate, &past->past_SampleRate ); + if( result < 0 ) + { + goto cleanup; + } +#else + past->past_SampleRate = sampleRate; +#endif + past->past_OutputBufferSize = framesPerBuffer * numOutputChannels * ((bitsPerOutputSample+7) / 8); + past->past_OutputBuffer = PaHost_AllocateFastMemory(past->past_OutputBufferSize); + if( past->past_OutputBuffer == NULL ) + { + result = paInsufficientMemory; + goto cleanup; + } + } + else + { + past->past_OutputBuffer = NULL; + } + + result = PaHost_OpenStream( past ); + if( result < 0 ) goto cleanup; + + *streamPtrPtr = (void *) past; + + return result; + +cleanup: + if( past != NULL ) Pa_CloseStream( past ); + *streamPtrPtr = NULL; + return result; +} + + +/*************************************************************************/ +DLL_API PaError Pa_OpenDefaultStream( PortAudioStream** stream, + int numInputChannels, + int numOutputChannels, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + unsigned long numberOfBuffers, + PortAudioCallback *callback, + void *userData ) +{ + return Pa_OpenStream( + stream, + ((numInputChannels > 0) ? Pa_GetDefaultInputDeviceID() : paNoDevice), + numInputChannels, sampleFormat, NULL, + ((numOutputChannels > 0) ? Pa_GetDefaultOutputDeviceID() : paNoDevice), + numOutputChannels, sampleFormat, NULL, + sampleRate, framesPerBuffer, numberOfBuffers, paNoFlag, callback, userData ); +} + +/*************************************************************************/ +DLL_API PaError Pa_CloseStream( PortAudioStream* stream) +{ + PaError result; + internalPortAudioStream *past; + + DBUG(("Pa_CloseStream()\n")); + if( stream == NULL ) return paBadStreamPtr; + past = (internalPortAudioStream *) stream; + + Pa_AbortStream( past ); + result = PaHost_CloseStream( past ); + + if( past->past_InputBuffer ) PaHost_FreeFastMemory( past->past_InputBuffer, past->past_InputBufferSize ); + if( past->past_OutputBuffer ) PaHost_FreeFastMemory( past->past_OutputBuffer, past->past_OutputBufferSize ); + PaHost_FreeFastMemory( past, sizeof(internalPortAudioStream) ); + + return result; +} + +/*************************************************************************/ +DLL_API PaError Pa_StartStream( PortAudioStream *stream ) +{ + PaError result = paHostError; + internalPortAudioStream *past; + + if( stream == NULL ) return paBadStreamPtr; + past = (internalPortAudioStream *) stream; + + past->past_FrameCount = 0.0; + + if( past->past_NumInputChannels > 0 ) + { + result = PaHost_StartInput( past ); + DBUG(("Pa_StartStream: PaHost_StartInput returned = 0x%X.\n", result)); + if( result < 0 ) goto error; + } + + if( past->past_NumOutputChannels > 0 ) + { + result = PaHost_StartOutput( past ); + DBUG(("Pa_StartStream: PaHost_StartOutput returned = 0x%X.\n", result)); + if( result < 0 ) goto error; + } + + result = PaHost_StartEngine( past ); + DBUG(("Pa_StartStream: PaHost_StartEngine returned = 0x%X.\n", result)); + if( result < 0 ) goto error; + + return paNoError; + +error: + return result; +} + +/*************************************************************************/ +DLL_API PaError Pa_StopStream( PortAudioStream *stream ) +{ + return Pa_KillStream( stream, 0 ); +} + +/*************************************************************************/ +DLL_API PaError Pa_AbortStream( PortAudioStream *stream ) +{ + return Pa_KillStream( stream, 1 ); +} + +/*************************************************************************/ +static PaError Pa_KillStream( PortAudioStream *stream, int abort ) +{ + PaError result = paNoError; + internalPortAudioStream *past; + + DBUG(("Pa_StopStream().\n")); + if( stream == NULL ) return paBadStreamPtr; + past = (internalPortAudioStream *) stream; + + if( (past->past_NumInputChannels > 0) || (past->past_NumOutputChannels > 0) ) + { + result = PaHost_StopEngine( past, abort ); + DBUG(("Pa_StopStream: PaHost_StopEngine returned = 0x%X.\n", result)); + if( result < 0 ) goto error; + } + + if( past->past_NumInputChannels > 0 ) + { + result = PaHost_StopInput( past, abort ); + DBUG(("Pa_StopStream: PaHost_StopInput returned = 0x%X.\n", result)); + if( result != paNoError ) goto error; + } + + if( past->past_NumOutputChannels > 0 ) + { + result = PaHost_StopOutput( past, abort ); + DBUG(("Pa_StopStream: PaHost_StopOutput returned = 0x%X.\n", result)); + if( result != paNoError ) goto error; + } + +error: + past->past_Usage = 0; + past->past_IfLastExitValid = 0; + + return result; +} + +/*************************************************************************/ +DLL_API PaError Pa_StreamActive( PortAudioStream *stream ) +{ + internalPortAudioStream *past; + if( stream == NULL ) return paBadStreamPtr; + past = (internalPortAudioStream *) stream; + return PaHost_StreamActive( past ); +} + +/*************************************************************************/ +DLL_API const char *Pa_GetErrorText( PaError errnum ) +{ + const char *msg; + + switch(errnum) + { + case paNoError: msg = "Success"; break; + case paHostError: msg = "Host error."; break; + case paInvalidChannelCount: msg = "Invalid number of channels."; break; + case paInvalidSampleRate: msg = "Invalid sample rate."; break; + case paInvalidDeviceId: msg = "Invalid device ID."; break; + case paInvalidFlag: msg = "Invalid flag."; break; + case paSampleFormatNotSupported: msg = "Sample format not supported"; break; + case paBadIODeviceCombination: msg = "Illegal combination of I/O devices."; break; + case paInsufficientMemory: msg = "Insufficient memory."; break; + case paBufferTooBig: msg = "Buffer too big."; break; + case paBufferTooSmall: msg = "Buffer too small."; break; + case paNullCallback: msg = "No callback routine specified."; break; + case paBadStreamPtr: msg = "Invalid stream pointer."; break; + case paTimedOut : msg = "Wait Timed Out."; break; + case paInternalError: msg = "Internal PortAudio Error."; break; + default: msg = "Illegal error number."; break; + } + return msg; +} + +/* + Get CPU Load as a fraction of total CPU time. + A value of 0.5 would imply that PortAudio and the sound generating + callback was consuming roughly 50% of the available CPU time. + The amount may vary depending on CPU load. + This function may be called from the callback function. +*/ +DLL_API double Pa_GetCPULoad( PortAudioStream* stream) +{ + internalPortAudioStream *past; + if( stream == NULL ) return (double) paBadStreamPtr; + past = (internalPortAudioStream *) stream; + return past->past_Usage; +} + +/************************************************************* +** Calculate 2 LSB dither signal with a triangular distribution. +** Ranged properly for adding to a 32 bit integer prior to >>15. +*/ +#define DITHER_BITS (15) +#define DITHER_SCALE (1.0f / ((1<>(32-DITHER_BITS)) + (((long)randSeed2)>>(32-DITHER_BITS)); + /* High pass filter to reduce audibility. */ + highPass = current - previous; + previous = current; + return highPass; +} + +/************************************************************************* +** Called by host code. +** Convert input from Int16, call user code, then convert output +** to Int16 format for native use. +** Assumes host native format is paInt16. +** Returns result from user callback. +*/ +long Pa_CallConvertInt16( internalPortAudioStream *past, + short *nativeInputBuffer, + short *nativeOutputBuffer ) +{ + long temp; + long bytesEmpty = 0; + long bytesFilled = 0; + int userResult; + unsigned int i; + void *inputBuffer = NULL; + void *outputBuffer = NULL; + +#if SUPPORT_AUDIO_CAPTURE + /* Get native data from DirectSound. */ + if( (past->past_NumInputChannels > 0) && (nativeInputBuffer != NULL) ) + { + /* Convert from native format to PA format. */ + unsigned int samplesPerBuffer = past->past_FramesPerUserBuffer * past->past_NumInputChannels; + switch(past->past_InputSampleFormat) + { + + case paFloat32: + { + float *inBufPtr = (float *) past->past_InputBuffer; + inputBuffer = past->past_InputBuffer; + for( i=0; ipast_InputBuffer; + inputBuffer = past->past_InputBuffer; + for( i=0; ipast_InputBuffer; + inputBuffer = past->past_InputBuffer; + if( past->past_Flags & paDitherOff ) + { + for( i=0; i> 8); + } + } + else + { + for( i=0; i> 7; + temp = ((temp < -0x8000) ? -0x8000 : ((temp > 0x7FFF) ? 0x7FFF : temp)); + inBufPtr[i] = (char)(temp >> 8); + } + } + break; + } + + case paUInt8: + { + /* Convert 16 bit data to 8 bit unsigned chars */ + unsigned char *inBufPtr = (unsigned char *) past->past_InputBuffer; + inputBuffer = past->past_InputBuffer; + if( past->past_Flags & paDitherOff ) + { + for( i=0; i> 8)) + 0x80; + } + } + else + { + /* If you dither then you have to clip because dithering could push the signal out of range! */ + for( i=0; i> 7; + temp = ((temp < -0x8000) ? -0x8000 : ((temp > 0x7FFF) ? 0x7FFF : temp)); + inBufPtr[i] = (unsigned char)(temp + 0x80); + } + } + break; + } + + default: + break; + } + } +#endif /* SUPPORT_AUDIO_CAPTURE */ + + /* Are we doing output time? */ + if( (past->past_NumOutputChannels > 0) && (nativeOutputBuffer != NULL) ) + { + /* May already be in native format so just write directly to native buffer. */ + outputBuffer = (past->past_OutputSampleFormat == paInt16) ? + nativeOutputBuffer : past->past_OutputBuffer; + } + /* + AddTraceMessage("Pa_CallConvertInt16: inputBuffer = ", (int) inputBuffer ); + AddTraceMessage("Pa_CallConvertInt16: outputBuffer = ", (int) outputBuffer ); + */ + /* Call user callback routine. */ + userResult = past->past_Callback( + inputBuffer, + outputBuffer, + past->past_FramesPerUserBuffer, + past->past_FrameCount, + past->past_UserData ); + + past->past_FrameCount += (PaTimestamp) past->past_FramesPerUserBuffer; + + /* Convert to native format if necessary. */ + if( outputBuffer != NULL ) + { + unsigned int samplesPerBuffer = past->past_FramesPerUserBuffer * past->past_NumOutputChannels; + switch(past->past_OutputSampleFormat) + { + case paFloat32: + { + float *outBufPtr = (float *) past->past_OutputBuffer; + if( past->past_Flags & paDitherOff ) + { + if( past->past_Flags & paClipOff ) /* NOTHING */ + { + for( i=0; i 0x7FFF) ? 0x7FFF : temp)); + } + } + } + else + { + /* If you dither then you have to clip because dithering could push the signal out of range! */ + for( i=0; i 0x7FFF) ? 0x7FFF : temp)); + } + } + break; + } + + case paInt32: + { + int *outBufPtr = (int *) past->past_OutputBuffer; + if( past->past_Flags & paDitherOff ) + { + for( i=0; i> 16 ); + } + } + else + { + for( i=0; i> 1) + Pa_TriangularDither(); + temp = temp >> 15; + *nativeOutputBuffer++ = (short)((temp < -0x8000) ? -0x8000 : ((temp > 0x7FFF) ? 0x7FFF : temp)); + } + } + break; + } + + case paInt8: + { + char *outBufPtr = (char *) past->past_OutputBuffer; + for( i=0; ipast_OutputBuffer; + for( i=0; ipast_NumInputChannels > 0) && (nativeInputBuffer != NULL) ) + { + inputBuffer = nativeInputBuffer; // FIXME + } + + /* Are we doing output time? */ + if( (past->past_NumOutputChannels > 0) && (nativeOutputBuffer != NULL) ) + { + /* May already be in native format so just write directly to native buffer. */ + outputBuffer = (past->past_OutputSampleFormat == paFloat32) ? + nativeOutputBuffer : past->past_OutputBuffer; + } + /* + AddTraceMessage("Pa_CallConvertInt16: inputBuffer = ", (int) inputBuffer ); + AddTraceMessage("Pa_CallConvertInt16: outputBuffer = ", (int) outputBuffer ); + */ + /* Call user callback routine. */ + userResult = past->past_Callback( + inputBuffer, + outputBuffer, + past->past_FramesPerUserBuffer, + past->past_FrameCount, + past->past_UserData ); + + past->past_FrameCount += (PaTimestamp) past->past_FramesPerUserBuffer; + + /* Convert to native format if necessary. */ // FIXME + return userResult; +} + +/*************************************************************************/ +DLL_API PaError Pa_Initialize( void ) +{ + if( gInitCount++ > 0 ) return paNoError; + ResetTraceMessages(); + return PaHost_Init(); +} + +DLL_API PaError Pa_Terminate( void ) +{ + PaError result = paNoError; + + if( gInitCount == 0 ) return paNoError; + else if( --gInitCount == 0 ) + { + result = PaHost_Term(); + DumpTraceMessages(); + } + return result; +} + +/*************************************************************************/ +DLL_API PaError Pa_GetSampleSize( PaSampleFormat format ) +{ + int size; + switch(format ) + { + + case paUInt8: + case paInt8: + size = 1; + break; + + case paInt16: + size = 2; + break; + + case paPackedInt24: + size = 3; + break; + + case paFloat32: + case paInt32: + case paInt24: + size = 4; + break; + + default: + size = paSampleFormatNotSupported; + break; + } + return (PaError) size; +} + + diff --git a/portaudio-v19/pa_dll_switch/portaudio.h b/portaudio-v19/pa_dll_switch/portaudio.h new file mode 100644 index 000000000..9632521eb --- /dev/null +++ b/portaudio-v19/pa_dll_switch/portaudio.h @@ -0,0 +1,439 @@ +#ifndef PORT_AUDIO_H +#define PORT_AUDIO_H + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/* + * PortAudio Portable Real-Time Audio Library + * PortAudio API Header File + * Latest version available at: http://www.audiomulch.com/portaudio/ + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +// added by zplane.developement in order to generate a DLL + +#if defined(PA_MME_EXPORTS) || defined(PA_DX_EXPORTS) +#define DLL_API __declspec( dllexport ) +#elif defined(_LIB) || defined(_STATIC_LINK) || defined(_STATIC_APP) +#define DLL_API +#else +#define DLL_API __declspec(dllexport) +#endif + + +typedef int PaError; +typedef enum { + paNoError = 0, + + paHostError = -10000, + paInvalidChannelCount, + paInvalidSampleRate, + paInvalidDeviceId, + paInvalidFlag, + paSampleFormatNotSupported, + paBadIODeviceCombination, + paInsufficientMemory, + paBufferTooBig, + paBufferTooSmall, + paNullCallback, + paBadStreamPtr, + paTimedOut, + paInternalError +} PaErrorNum; + +/* + Pa_Initialize() is the library initialisation function - call this before + using the library. +*/ + +DLL_API PaError Pa_Initialize( void ); + +/* + Pa_Terminate() is the library termination function - call this after + using the library. +*/ + +DLL_API PaError Pa_Terminate( void ); + +/* + Return host specific error. + This can be called after receiving a paHostError. +*/ +DLL_API long Pa_GetHostError( void ); + +/* + Translate the error number into a human readable message. +*/ +DLL_API const char *Pa_GetErrorText( PaError errnum ); + +/* + Sample formats + + These are formats used to pass sound data between the callback and the + stream. Each device has a "native" format which may be used when optimum + efficiency or control over conversion is required. + + Formats marked "always available" are supported (emulated) by all devices. + + The floating point representation uses +1.0 and -1.0 as the respective + maximum and minimum. + +*/ + +typedef unsigned long PaSampleFormat; +#define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ +#define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ +#define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ +#define paInt24 ((PaSampleFormat) (1<<3)) +#define paPackedInt24 ((PaSampleFormat) (1<<4)) +#define paInt8 ((PaSampleFormat) (1<<5)) +#define paUInt8 ((PaSampleFormat) (1<<6)) /* unsigned 8 bit, 128 is "ground" */ +#define paCustomFormat ((PaSampleFormat) (1<<16)) + +/* + Device enumeration mechanism. + + Device ids range from 0 to Pa_CountDevices()-1. + + Devices may support input, output or both. Device 0 is always the "default" + device and should support at least stereo in and out if that is available + on the taget platform _even_ if this involves kludging an input/output + device on platforms that usually separate input from output. Other platform + specific devices are specified by positive device ids. +*/ + +typedef int PaDeviceID; +#define paNoDevice -1 + +typedef struct +{ + int structVersion; + const char *name; + int maxInputChannels; + int maxOutputChannels; + /* Number of discrete rates, or -1 if range supported. */ + int numSampleRates; + /* Array of supported sample rates, or {min,max} if range supported. */ + const double *sampleRates; + PaSampleFormat nativeSampleFormats; +} +PaDeviceInfo; + + +DLL_API int Pa_CountDevices(); +/* + Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() + + Return the default device ID or paNoDevice if there is no devices. + The result can be passed to Pa_OpenStream(). + + On the PC, the user can specify a default device by + setting an environment variable. For example, to use device #1. + + set PA_RECOMMENDED_OUTPUT_DEVICE=1 + + The user should first determine the available device ID by using + the supplied application "pa_devs". +*/ +DLL_API PaDeviceID Pa_GetDefaultInputDeviceID( void ); +DLL_API PaDeviceID Pa_GetDefaultOutputDeviceID( void ); + +/* + PaTimestamp is used to represent a continuous sample clock with arbitrary + start time useful for syncronisation. The type is used in the outTime + argument to the callback function and the result of Pa_StreamTime() +*/ + +typedef double PaTimestamp; + +/* + Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo 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 PortAudio implementation and must + not be manipulated or freed. The pointer is guaranteed to be valid until + between calls to Pa_Initialize() and Pa_Terminate(). +*/ + +DLL_API const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID id ); + +/* + PortAudioCallback is implemented by clients of the portable audio api. + + inputBuffer and outputBuffer are arrays of interleaved samples, + the format, packing and number of channels used by the buffers are + determined by parameters to Pa_OpenStream() (see below). + + framesPerBuffer is the number of sample frames to be processed by the callback. + + outTime is the time in samples when the buffer(s) processed by + this callback will begin being played at the audio output. + See also Pa_StreamTime() + + userData is the value of a user supplied pointer passed to Pa_OpenStream() + intended for storing synthesis data etc. + + return value: + The callback can return a nonzero value to stop the stream. This may be + useful in applications such as soundfile players where a specific duration + of output is required. However, it is not necessary to utilise this mechanism + as StopStream() will also terminate the stream. A callback returning a + nonzero value must fill the entire outputBuffer. + + NOTE: None of the other stream functions may be called from within the + callback function except for Pa_GetCPULoad(). + +*/ + +typedef int (PortAudioCallback)( + void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ); + + +/* + Stream flags + + These flags may be supplied (ored together) in the streamFlags argument to + the Pa_OpenStream() function. + + [ suggestions? ] +*/ + +#define paNoFlag (0) +#define paClipOff (1<<0) /* disable defult clipping of out of range samples */ +#define paDitherOff (1<<1) /* disable default dithering */ +#define paPlatformSpecificFlags (0x00010000) +typedef unsigned long PaStreamFlags; + +/* + A single PortAudioStream provides multiple channels of real-time + input and output audio streaming to a client application. + Pointers to PortAudioStream objects are passed between PortAudio functions. +*/ + +typedef void PortAudioStream; +#define PaStream PortAudioStream + +/* + Pa_OpenStream() opens a stream for either input, output or both. + + stream is the address of a PortAudioStream pointer which will receive + a pointer to the newly opened stream. + + inputDevice is the id of the device used for input (see PaDeviceID above.) + inputDevice may be paNoDevice to indicate that an input device is not required. + + numInputChannels is the number of channels of sound to be delivered to the + callback. It can range from 1 to the value of maxInputChannels in the + device input record for the device specified in the inputDevice parameter. + If inputDevice is paNoDevice numInputChannels is ignored. + + inputSampleFormat is the format of inputBuffer provided to the callback + function. inputSampleFormat may be any of the formats described by the + PaSampleFormat enumeration (see above). PortAudio guarantees support for + the sound devices native formats (nativeSampleFormats in the device info + record) and additionally 16 and 32 bit integer and 32 bit floating point + formats. Support for other formats is implementation defined. + + inputDriverInfo is a pointer to an optional driver specific data structure + containing additional information for device setup or stream 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 PaDeviceID above.) + outputDevice may be paNoDevice to indicate that an output device is not required. + + numOutputChannels is the number of channels of sound to be supplied by the + callback. See the definition of numInputChannels above for more details. + + outputSampleFormat is the sample format of the outputBuffer filled by the + callback function. See the definition of inputSampleFormat above for more + details. + + outputDriverInfo is a pointer to an optional driver specific data structure + containing additional information for device setup or stream processing. + outputDriverInfo is never required for correct operation. If not used + outputDriverInfo should be NULL. + + sampleRate is the desired sampleRate for input and output + + framesPerBuffer is the length in sample frames of all internal sample buffers + used for communication with platform specific audio routines. Wherever + possible this corresponds to the framesPerBuffer parameter passed to the + callback function. + + numberOfBuffers is the number of buffers used for multibuffered + communication with the platform specific audio routines. This parameter is + provided only as a guide - and does not imply that an implementation must + use multibuffered i/o when reliable double buffering is available (such as + SndPlayDoubleBuffer() on the Macintosh.) + + streamFlags may contain a combination of flags ORed together. + These flags modify the behavior of the + streaming process. Some flags may only be relevant to certain buffer formats. + + callback is a pointer to a client supplied function that is responsible + for processing and filling input and output buffers (see above for details.) + + userData is a client supplied pointer which is passed to the callback + function. It could for example, contain a pointer to instance data necessary + for processing the audio buffers. + + return value: + Apon success Pa_OpenStream() returns PaNoError and places a pointer to a + valid PortAudioStream in the stream argument. The stream is inactive (stopped). + If a call to Pa_OpenStream() fails a nonzero error code is returned (see + PAError above) and the value of stream is invalid. + +*/ + +DLL_API PaError Pa_OpenStream( PortAudioStream** stream, + PaDeviceID inputDevice, + int numInputChannels, + PaSampleFormat inputSampleFormat, + void *inputDriverInfo, + PaDeviceID outputDevice, + int numOutputChannels, + PaSampleFormat outputSampleFormat, + void *outputDriverInfo, + double sampleRate, + unsigned long framesPerBuffer, + unsigned long numberOfBuffers, + PaStreamFlags streamFlags, + PortAudioCallback *callback, + void *userData ); + + +/* + Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that + opens the default input and/or ouput devices. Most parameters have + identical meaning to their Pa_OpenStream() counterparts, with the following + exceptions: + + If either numInputChannels or numOutputChannels is 0 the respective device + is not opened (same as passing paNoDevice in the device arguments to Pa_OpenStream() ) + + sampleFormat applies to both the input and output buffers. +*/ + +DLL_API PaError Pa_OpenDefaultStream( PortAudioStream** stream, + int numInputChannels, + int numOutputChannels, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + unsigned long numberOfBuffers, + PortAudioCallback *callback, + void *userData ); + +/* + Pa_CloseStream() closes an audio stream, flushing any pending buffers. +*/ + +DLL_API PaError Pa_CloseStream( PortAudioStream* ); + +/* + Pa_StartStream() and Pa_StopStream() begin and terminate audio processing. + When Pa_StopStream() returns, all pending audio buffers have been played. + Pa_AbortStream() stops playing immediately without waiting for pending + buffers to complete. +*/ + +DLL_API PaError Pa_StartStream( PortAudioStream *stream ); + +DLL_API PaError Pa_StopStream( PortAudioStream *stream ); + +DLL_API PaError Pa_AbortStream( PortAudioStream *stream ); + +/* + Pa_StreamActive() returns one when the stream is playing audio, + zero when not playing, or a negative error number if the + stream is invalid. + The stream is active between calls to Pa_StartStream() and Pa_StopStream(), + but may also become inactive if the callback returns a non-zero value. + In the latter case, the stream is considered inactive after the last + buffer has finished playing. +*/ + +DLL_API PaError Pa_StreamActive( PortAudioStream *stream ); + +/* + Pa_StreamTime() returns the current output time for the stream in samples. + This time may be used as a time reference (for example syncronising audio to + MIDI). +*/ + +DLL_API PaTimestamp Pa_StreamTime( PortAudioStream *stream ); + +/* + The "CPU Load" is a fraction of total CPU time consumed by the + stream's audio processing. + A value of 0.5 would imply that PortAudio and the sound generating + callback was consuming roughly 50% of the available CPU time. + This function may be called from the callback function or the application. +*/ +DLL_API double Pa_GetCPULoad( PortAudioStream* stream ); + +/* + Use Pa_GetMinNumBuffers() to determine minimum number of buffers required for + the current host based on minimum latency. + On the PC, for the DirectSound implementation, latency can be optionally set + by user by setting an environment variable. + For example, to set latency to 200 msec, put: + + set PA_MIN_LATENCY_MSEC=200 + + in the AUTOEXEC.BAT file and reboot. + If the environment variable is not set, then the latency will be determined + based on the OS. Windows NT has higher latency than Win95. +*/ + +DLL_API int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate ); + +/* + Sleep for at least 'msec' milliseconds. + You may sleep longer than the requested time so don't rely + on this for accurate musical timing. +*/ +DLL_API void Pa_Sleep( long msec ); + +/* + Return size in bytes of a single sample in a given PaSampleFormat + or paSampleFormatNotSupported. +*/ +DLL_API PaError Pa_GetSampleSize( PaSampleFormat format ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PORT_AUDIO_H */ diff --git a/portaudio-v19/pa_jack/pa_jack.c b/portaudio-v19/pa_jack/pa_jack.c new file mode 100644 index 000000000..17bf3d371 --- /dev/null +++ b/portaudio-v19/pa_jack/pa_jack.c @@ -0,0 +1,1714 @@ +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * JACK Implementation by Joshua Haberman + * + * Copyright (c) 2004 Stefan Westerfeld + * Copyright (c) 2004 Arve Knudsen + * Copyright (c) 2002 Joshua Haberman + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include /* EBUSY */ +#include /* sig_atomic_t */ +#include +#include + +#include +#include + +#include "pa_util.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_process.h" +#include "pa_allocation.h" +#include "pa_cpuload.h" +#include "../pablio/ringbuffer.c" + +static int aErr_; +static PaError paErr_; /* For use with ENSURE_PA */ +static pthread_t mainThread_; +static char *jackErr_ = NULL; + +#define STRINGIZE_HELPER(expr) #expr +#define STRINGIZE(expr) STRINGIZE_HELPER(expr) + +/* Check PaError */ +#define ENSURE_PA(expr) \ + do { \ + if( (paErr_ = (expr)) < paNoError ) \ + { \ + if( (paErr_) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \ + { \ + assert( jackErr_ ); \ + PaUtil_SetLastHostErrorInfo( paJACK, -1, jackErr_ ); \ + } \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = paErr_; \ + goto error; \ + } \ + } while( 0 ) + +#define UNLESS(expr, code) \ + do { \ + if( (expr) == 0 ) \ + { \ + if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \ + { \ + assert( jackErr_ ); \ + PaUtil_SetLastHostErrorInfo( paJACK, -1, jackErr_ ); \ + } \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = (code); \ + goto error; \ + } \ + } while( 0 ) + +#define ASSERT_CALL(expr, success) \ + aErr_ = (expr); \ + assert( aErr_ == success ); + +/* + * Functions that directly map to the PortAudio stream interface + */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +/*static PaTime GetStreamInputLatency( PaStream *stream );*/ +/*static PaTime GetStreamOutputLatency( PaStream *stream );*/ +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); + + +/* + * Data specific to this API + */ + +struct PaJackStream; + +typedef struct +{ + PaUtilHostApiRepresentation commonHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *deviceInfoMemory; + + jack_client_t *jack_client; + int jack_buffer_size; + PaHostApiIndex hostApiIndex; + + pthread_mutex_t mtx; + pthread_cond_t cond; + unsigned long inputBase, outputBase; + + /* For dealing with the process thread */ + volatile int xrun; /* Received xrun notification from JACK? */ + struct PaJackStream * volatile toAdd, * volatile toRemove; + struct PaJackStream *processQueue; + volatile sig_atomic_t jackIsDown; +} +PaJackHostApiRepresentation; + +/* PaJackStream - a stream data structure specifically for this implementation */ + +typedef struct PaJackStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilBufferProcessor bufferProcessor; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaJackHostApiRepresentation *hostApi; + + /* our input and output ports */ + jack_port_t **local_input_ports; + jack_port_t **local_output_ports; + + /* the input and output ports of the client we are connecting to */ + jack_port_t **remote_input_ports; + jack_port_t **remote_output_ports; + + int num_incoming_connections; + int num_outgoing_connections; + + jack_client_t *jack_client; + + /* The stream is running if it's still producing samples. + * The stream is active if samples it produced are still being heard. + */ + volatile sig_atomic_t is_running; + volatile sig_atomic_t is_active; + /* Used to signal processing thread that stream should start or stop, respectively */ + volatile sig_atomic_t doStart, doStop, doAbort; + + jack_nframes_t t0; + + PaUtilAllocationGroup *stream_memory; + + /* These are useful in the process callback */ + + int callbackResult; + int isSilenced; + int xrun; + + /* These are useful for the blocking API */ + + int isBlockingStream; + RingBuffer inFIFO; + RingBuffer outFIFO; + volatile sig_atomic_t data_available; + sem_t data_semaphore; + int bytesPerFrame; + int samplesPerFrame; + + struct PaJackStream *next; +} +PaJackStream; + +#define TRUE 1 +#define FALSE 0 + +/* + * Functions specific to this API + */ + +static int JackCallback( jack_nframes_t frames, void *userData ); + + +/* + * + * Implementation + * + */ + +/* ---- blocking emulation layer ---- */ + +/* Allocate buffer. */ +static PaError BlockingInitFIFO( RingBuffer *rbuf, long numFrames, long bytesPerFrame ) +{ + long numBytes = numFrames * bytesPerFrame; + char *buffer = (char *) malloc( numBytes ); + if( buffer == NULL ) return paInsufficientMemory; + memset( buffer, 0, numBytes ); + return (PaError) RingBuffer_Init( rbuf, numBytes, buffer ); +} + +/* Free buffer. */ +static PaError BlockingTermFIFO( RingBuffer *rbuf ) +{ + if( rbuf->buffer ) free( rbuf->buffer ); + rbuf->buffer = NULL; + return paNoError; +} + +static int +BlockingCallback( const void *inputBuffer, + void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + struct PaJackStream *stream = (PaJackStream *)userData; + long numBytes = stream->bytesPerFrame * framesPerBuffer; + + /* This may get called with NULL inputBuffer during initial setup. */ + if( inputBuffer != NULL ) + { + RingBuffer_Write( &stream->inFIFO, inputBuffer, numBytes ); + } + if( outputBuffer != NULL ) + { + int numRead = RingBuffer_Read( &stream->outFIFO, outputBuffer, numBytes ); + /* Zero out remainder of buffer if we run out of data. */ + memset( (char *)outputBuffer + numRead, 0, numBytes - numRead ); + } + + if( !stream->data_available ) + { + stream->data_available = 1; + sem_post( &stream->data_semaphore ); + } + return paContinue; +} + +static PaError +BlockingBegin( PaJackStream *stream, int minimum_buffer_size ) +{ + long doRead = 0; + long doWrite = 0; + PaError result = paNoError; + long numFrames; + + doRead = stream->local_input_ports != NULL; + doWrite = stream->local_output_ports != NULL; + /* */ + stream->samplesPerFrame = 2; + stream->bytesPerFrame = sizeof(float) * stream->samplesPerFrame; + /* */ + numFrames = 32; + while (numFrames < minimum_buffer_size) + numFrames *= 2; + + if( doRead ) + { + ENSURE_PA( BlockingInitFIFO( &stream->inFIFO, numFrames, stream->bytesPerFrame ) ); + } + if( doWrite ) + { + long numBytes; + + ENSURE_PA( BlockingInitFIFO( &stream->outFIFO, numFrames, stream->bytesPerFrame ) ); + + /* Make Write FIFO appear full initially. */ + numBytes = RingBuffer_GetWriteAvailable( &stream->outFIFO ); + RingBuffer_AdvanceWriteIndex( &stream->outFIFO, numBytes ); + } + + stream->data_available = 0; + sem_init( &stream->data_semaphore, 0, 0 ); + +error: + return result; +} + +static void +BlockingEnd( PaJackStream *stream ) +{ + BlockingTermFIFO( &stream->inFIFO ); + BlockingTermFIFO( &stream->outFIFO ); + + sem_destroy( &stream->data_semaphore ); +} + +static PaError BlockingReadStream( PaStream* s, void *data, unsigned long numFrames ) +{ + PaError result = paNoError; + PaJackStream *stream = (PaJackStream *)s; + + long bytesRead; + char *p = (char *) data; + long numBytes = stream->bytesPerFrame * numFrames; + while( numBytes > 0 ) + { + bytesRead = RingBuffer_Read( &stream->inFIFO, p, numBytes ); + numBytes -= bytesRead; + p += bytesRead; + if( numBytes > 0 ) + { + /* see write for an explanation */ + if( stream->data_available ) + stream->data_available = 0; + else + sem_wait( &stream->data_semaphore ); + } + } + + return result; +} + +static PaError BlockingWriteStream( PaStream* s, const void *data, unsigned long numFrames ) +{ + PaError result = paNoError; + PaJackStream *stream = (PaJackStream *)s; + long bytesWritten; + char *p = (char *) data; + long numBytes = stream->bytesPerFrame * numFrames; + while( numBytes > 0 ) + { + bytesWritten = RingBuffer_Write( &stream->outFIFO, p, numBytes ); + numBytes -= bytesWritten; + p += bytesWritten; + if( numBytes > 0 ) + { + /* we use the following algorithm: + * (1) write data + * (2) if some data didn't fit into the ringbuffer, set data_available to 0 + * to indicate to the audio that if space becomes available, we want to know + * (3) retry to write data (because it might be that between (1) and (2) + * new space in the buffer became available) + * (4) if this failed, we are sure that the buffer is really empty and + * we will definitely receive a notification when it becomes available + * thus we can safely sleep + * + * if the algorithm bailed out in step (3) before, it leaks a count of 1 + * on the semaphore; however, it doesn't matter, because if we block in (4), + * we also do it in a loop + */ + if( stream->data_available ) + stream->data_available = 0; + else + sem_wait( &stream->data_semaphore ); + } + } + + return result; +} + +static signed long +BlockingGetStreamReadAvailable( PaStream* s ) +{ + PaJackStream *stream = (PaJackStream *)s; + + int bytesFull = RingBuffer_GetReadAvailable( &stream->inFIFO ); + return bytesFull / stream->bytesPerFrame; +} + +static signed long +BlockingGetStreamWriteAvailable( PaStream* s ) +{ + PaJackStream *stream = (PaJackStream *)s; + + int bytesEmpty = RingBuffer_GetWriteAvailable( &stream->outFIFO ); + return bytesEmpty / stream->bytesPerFrame; +} + +static PaError +BlockingWaitEmpty( PaStream *s ) +{ + PaJackStream *stream = (PaJackStream *)s; + + while( RingBuffer_GetReadAvailable( &stream->outFIFO ) > 0 ) + { + stream->data_available = 0; + sem_wait( &stream->data_semaphore ); + } + return 0; +} + +/* ---- jack driver ---- */ + +/* BuildDeviceList(): + * + * The process of determining a list of PortAudio "devices" from + * JACK's client/port system is fairly involved, so it is separated + * into its own routine. + */ + +static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi ) +{ + /* Utility macros for the repetitive process of allocating memory */ + + /* ... MALLOC: allocate memory as part of the device list + * allocation group */ +#define MALLOC(size) \ + (PaUtil_GroupAllocateMemory( jackApi->deviceInfoMemory, (size) )) + + /* JACK has no concept of a device. To JACK, there are clients + * which have an arbitrary number of ports. To make this + * intelligible to PortAudio clients, we will group each JACK client + * into a device, and make each port of that client a channel */ + + PaError result = paNoError; + PaUtilHostApiRepresentation *commonApi = &jackApi->commonHostApiRep; + + const char **jack_ports = NULL; + char **client_names = NULL; + char *regex_pattern = alloca( jack_client_name_size() + 3 ); + int port_index, client_index, i; + double globalSampleRate; + regex_t port_regex; + unsigned long numClients = 0, numPorts = 0; + char *tmp_client_name = alloca( jack_client_name_size() ); + + commonApi->info.defaultInputDevice = paNoDevice; + commonApi->info.defaultOutputDevice = paNoDevice; + commonApi->info.deviceCount = 0; + + /* Parse the list of ports, using a regex to grab the client names */ + ASSERT_CALL( regcomp( &port_regex, "^[^:]*", REG_EXTENDED ), 0 ); + + /* since we are rebuilding the list of devices, free all memory + * associated with the previous list */ + PaUtil_FreeAllAllocations( jackApi->deviceInfoMemory ); + + /* We can only retrieve the list of clients indirectly, by first + * asking for a list of all ports, then parsing the port names + * according to the client_name:port_name convention (which is + * enforced by jackd) + * A: If jack_get_ports returns NULL, there's nothing for us to do */ + UNLESS( (jack_ports = jack_get_ports( jackApi->jack_client, "", "", 0 )) && jack_ports[0], paNoError ); + /* Find number of ports */ + while( jack_ports[numPorts] ) + ++numPorts; + /* At least there will be one port per client :) */ + UNLESS( client_names = alloca( numPorts * sizeof (char *) ), paInsufficientMemory ); + + /* Build a list of clients from the list of ports */ + for( numClients = 0, port_index = 0; jack_ports[port_index] != NULL; port_index++ ) + { + int client_seen = FALSE; + regmatch_t match_info; + const char *port = jack_ports[port_index]; + + /* extract the client name from the port name, using a regex + * that parses the clientname:portname syntax */ + UNLESS( !regexec( &port_regex, port, 1, &match_info, 0 ), paInternalError ); + assert(match_info.rm_eo - match_info.rm_so < jack_client_name_size()); + memcpy( tmp_client_name, port + match_info.rm_so, + match_info.rm_eo - match_info.rm_so ); + tmp_client_name[match_info.rm_eo - match_info.rm_so] = '\0'; + + /* do we know about this port's client yet? */ + for( i = 0; i < numClients; i++ ) + { + if( strcmp( tmp_client_name, client_names[i] ) == 0 ) + client_seen = TRUE; + } + + if (client_seen) + continue; /* A: Nothing to see here, move along */ + + UNLESS( client_names[numClients] = (char*)MALLOC(strlen(tmp_client_name) + 1), paInsufficientMemory ); + + /* The alsa_pcm client should go in spot 0. If this + * is the alsa_pcm client AND we are NOT about to put + * it in spot 0 put it in spot 0 and move whatever + * was already in spot 0 to the end. */ + if( strcmp( "alsa_pcm", tmp_client_name ) == 0 && numClients > 0 ) + { + /* alsa_pcm goes in spot 0 */ + strcpy( client_names[ numClients ], client_names[0] ); + strcpy( client_names[0], tmp_client_name ); + } + else + { + /* put the new client at the end of the client list */ + strcpy( client_names[ numClients ], tmp_client_name ); + } + ++numClients; + } + + /* Now we have a list of clients, which will become the list of + * PortAudio devices. */ + + /* there is one global sample rate all clients must conform to */ + + globalSampleRate = jack_get_sample_rate( jackApi->jack_client ); + UNLESS( commonApi->deviceInfos = (PaDeviceInfo**)MALLOC( sizeof(PaDeviceInfo*) * + numClients ), paInsufficientMemory ); + + assert( commonApi->info.deviceCount == 0 ); + + /* Create a PaDeviceInfo structure for every client */ + for( client_index = 0; client_index < numClients; client_index++ ) + { + PaDeviceInfo *curDevInfo; + const char **clientPorts = NULL; + + UNLESS( curDevInfo = (PaDeviceInfo*)MALLOC( sizeof(PaDeviceInfo) ), paInsufficientMemory ); + UNLESS( curDevInfo->name = (char*)MALLOC( strlen(client_names[client_index]) + 1 ), paInsufficientMemory ); + strcpy( (char *)curDevInfo->name, client_names[client_index] ); + + curDevInfo->structVersion = 2; + curDevInfo->hostApi = jackApi->hostApiIndex; + + /* JACK is very inflexible: there is one sample rate the whole + * system must run at, and all clients must speak IEEE float. */ + curDevInfo->defaultSampleRate = globalSampleRate; + + /* To determine how many input and output channels are available, + * we re-query jackd with more specific parameters. */ + + sprintf( regex_pattern, "%s:.*", client_names[client_index] ); + + /* ... what are your output ports (that we could input from)? */ + clientPorts = jack_get_ports( jackApi->jack_client, regex_pattern, + NULL, JackPortIsOutput); + curDevInfo->maxInputChannels = 0; + curDevInfo->defaultLowInputLatency = 0.; + curDevInfo->defaultHighInputLatency = 0.; + if( clientPorts ) + { + jack_port_t *p = jack_port_by_name( jackApi->jack_client, clientPorts[0] ); + curDevInfo->defaultLowInputLatency = curDevInfo->defaultHighInputLatency = + jack_port_get_latency( p ) / globalSampleRate; + + for( i = 0; clientPorts[i] != NULL; i++) + { + /* The number of ports returned is the number of output channels. + * We don't care what they are, we just care how many */ + curDevInfo->maxInputChannels++; + } + free(clientPorts); + } + + /* ... what are your input ports (that we could output to)? */ + clientPorts = jack_get_ports( jackApi->jack_client, regex_pattern, + NULL, JackPortIsInput); + curDevInfo->maxOutputChannels = 0; + curDevInfo->defaultLowOutputLatency = 0.; + curDevInfo->defaultHighOutputLatency = 0.; + if( clientPorts ) + { + jack_port_t *p = jack_port_by_name( jackApi->jack_client, clientPorts[0] ); + curDevInfo->defaultLowOutputLatency = curDevInfo->defaultHighOutputLatency = + jack_port_get_latency( p ) / globalSampleRate; + + for( i = 0; clientPorts[i] != NULL; i++) + { + /* The number of ports returned is the number of input channels. + * We don't care what they are, we just care how many */ + curDevInfo->maxOutputChannels++; + } + free(clientPorts); + } + + /* Add this client to the list of devices */ + commonApi->deviceInfos[client_index] = curDevInfo; + ++commonApi->info.deviceCount; + if( commonApi->info.defaultInputDevice == paNoDevice && curDevInfo->maxInputChannels > 0 ) + commonApi->info.defaultInputDevice = client_index; + if( commonApi->info.defaultOutputDevice == paNoDevice && curDevInfo->maxOutputChannels > 0 ) + commonApi->info.defaultOutputDevice = client_index; + } + +error: + regfree( &port_regex ); + free( jack_ports ); + return result; +} +#undef MALLOC + +static void UpdateSampleRate( PaJackStream *stream, double sampleRate ) +{ + /* XXX: Maybe not the cleanest way of going about this? */ + stream->cpuLoadMeasurer.samplingPeriod = stream->bufferProcessor.samplePeriod = 1. / sampleRate; + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; +} + +static void JackErrorCallback( const char *msg ) +{ + if( pthread_self() == mainThread_ ) + { + assert( msg ); + free( jackErr_ ); + jackErr_ = malloc( strlen( msg ) ); + sprintf( jackErr_, msg ); + } +} + +static void JackOnShutdown( void *arg ) +{ + PaJackHostApiRepresentation *jackApi = (PaJackHostApiRepresentation *)arg; + PaJackStream *stream = jackApi->processQueue; + + PA_DEBUG(( "%s: JACK server is shutting down\n", __FUNCTION__ )); + for( ; stream; stream = stream->next ) + { + stream->is_active = 0; + } + + /* Make sure that the main thread doesn't get stuck waiting on the condition */ + ASSERT_CALL( pthread_mutex_lock( &jackApi->mtx ), 0 ); + jackApi->jackIsDown = 1; + ASSERT_CALL( pthread_cond_signal( &jackApi->cond ), 0 ); + ASSERT_CALL( pthread_mutex_unlock( &jackApi->mtx ), 0 ); + +} + +static int JackSrCb( jack_nframes_t nframes, void *arg ) +{ + PaJackHostApiRepresentation *jackApi = (PaJackHostApiRepresentation *)arg; + double sampleRate = (double)nframes; + PaJackStream *stream = jackApi->processQueue; + + /* Update all streams in process queue */ + PA_DEBUG(( "%s: Acting on change in JACK samplerate: %f\n", __FUNCTION__, sampleRate )); + for( ; stream; stream = stream->next ) + { + if( stream->streamRepresentation.streamInfo.sampleRate != sampleRate ) + { + PA_DEBUG(( "%s: Updating samplerate\n", __FUNCTION__ )); + UpdateSampleRate( stream, sampleRate ); + } + } + + return 0; +} + +static int JackXRunCb(void *arg) { + PaJackHostApiRepresentation *hostApi = (PaJackHostApiRepresentation *)arg; + assert( hostApi ); + hostApi->xrun = TRUE; + PA_DEBUG(( "%s: JACK signalled xrun\n", __FUNCTION__ )); + return 0; +} + +PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, + PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *jackHostApi; + int activated = 0; + char *clientName; + int written; + *hostApi = NULL; /* Initialize to NULL */ + + UNLESS( jackHostApi = (PaJackHostApiRepresentation*) + PaUtil_AllocateMemory( sizeof(PaJackHostApiRepresentation) ), paInsufficientMemory ); + jackHostApi->deviceInfoMemory = NULL; + + mainThread_ = pthread_self(); + ASSERT_CALL( pthread_mutex_init( &jackHostApi->mtx, NULL ), 0 ); + ASSERT_CALL( pthread_cond_init( &jackHostApi->cond, NULL ), 0 ); + + /* Try to become a client of the JACK server. If we cannot do + * this, then this API cannot be used. */ + + clientName = alloca( jack_client_name_size() ); + written = snprintf( clientName, jack_client_name_size(), "PortAudio-%d", getpid() ); + assert( written < jack_client_name_size() ); + jackHostApi->jack_client = jack_client_new( clientName ); + if( jackHostApi->jack_client == NULL ) + { + /* the V19 development docs say that if an implementation + * detects that it cannot be used, it should return a NULL + * interface and paNoError */ + result = paNoError; + goto error; + } + + UNLESS( jackHostApi->deviceInfoMemory = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + jackHostApi->hostApiIndex = hostApiIndex; + + *hostApi = &jackHostApi->commonHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paJACK; + (*hostApi)->info.name = "JACK Audio Connection Kit"; + + /* Build a device list by querying the JACK server */ + + ENSURE_PA( BuildDeviceList( jackHostApi ) ); + + /* Register functions */ + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &jackHostApi->callbackStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, + IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &jackHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + BlockingReadStream, BlockingWriteStream, + BlockingGetStreamReadAvailable, BlockingGetStreamWriteAvailable ); + + jackHostApi->inputBase = jackHostApi->outputBase = 0; + jackHostApi->xrun = 0; + jackHostApi->toAdd = jackHostApi->toRemove = NULL; + jackHostApi->processQueue = NULL; + jackHostApi->jackIsDown = 0; + + jack_on_shutdown( jackHostApi->jack_client, JackOnShutdown, jackHostApi ); + jack_set_error_function( JackErrorCallback ); + jackHostApi->jack_buffer_size = jack_get_buffer_size ( jackHostApi->jack_client ); + UNLESS( !jack_set_sample_rate_callback( jackHostApi->jack_client, JackSrCb, jackHostApi ), paUnanticipatedHostError ); + UNLESS( !jack_set_xrun_callback( jackHostApi->jack_client, JackXRunCb, jackHostApi ), paUnanticipatedHostError ); + UNLESS( !jack_set_process_callback( jackHostApi->jack_client, JackCallback, jackHostApi ), paUnanticipatedHostError ); + UNLESS( !jack_activate( jackHostApi->jack_client ), paUnanticipatedHostError ); + activated = 1; + + return result; + +error: + if( activated ) + ASSERT_CALL( jack_deactivate( jackHostApi->jack_client ), 0 ); + + if( jackHostApi ) + { + if( jackHostApi->jack_client ) + ASSERT_CALL( jack_client_close( jackHostApi->jack_client ), 0 ); + + if( jackHostApi->deviceInfoMemory ) + { + PaUtil_FreeAllAllocations( jackHostApi->deviceInfoMemory ); + PaUtil_DestroyAllocationGroup( jackHostApi->deviceInfoMemory ); + } + + PaUtil_FreeMemory( jackHostApi ); + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaJackHostApiRepresentation *jackHostApi = (PaJackHostApiRepresentation*)hostApi; + + /* note: this automatically disconnects all ports, since a deactivated + * client is not allowed to have any ports connected */ + ASSERT_CALL( jack_deactivate( jackHostApi->jack_client ), 0 ); + + ASSERT_CALL( pthread_mutex_destroy( &jackHostApi->mtx ), 0 ); + ASSERT_CALL( pthread_cond_destroy( &jackHostApi->cond ), 0 ); + + ASSERT_CALL( jack_client_close( jackHostApi->jack_client ), 0 ); + + if( jackHostApi->deviceInfoMemory ) + { + PaUtil_FreeAllAllocations( jackHostApi->deviceInfoMemory ); + PaUtil_DestroyAllocationGroup( jackHostApi->deviceInfoMemory ); + } + + PaUtil_FreeMemory( jackHostApi ); + + free( jackErr_ ); +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount = 0, outputChannelCount = 0; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + /* + The following check is not necessary for JACK. + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + + Because the buffer adapter handles conversion between all standard + sample formats, the following checks are only required if paCustomFormat + is implemented, or under some other unusual conditions. + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + */ + + /* check that the device supports sampleRate */ + +#define ABS(x) ( (x) > 0 ? (x) : -(x) ) + if( ABS(sampleRate - jack_get_sample_rate(((PaJackHostApiRepresentation *) hostApi)->jack_client )) > 1 ) + return paInvalidSampleRate; +#undef ABS + + return paFormatIsSupported; +} + +/* Basic stream initialization */ +static PaError InitializeStream( PaJackStream *stream, PaJackHostApiRepresentation *hostApi, int numInputChannels, + int numOutputChannels ) +{ + PaError result = paNoError; + assert( stream ); + + memset( stream, 0, sizeof (PaJackStream) ); + UNLESS( stream->stream_memory = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + stream->jack_client = hostApi->jack_client; + stream->hostApi = hostApi; + + if( numInputChannels > 0 ) + { + UNLESS( stream->local_input_ports = + (jack_port_t**) PaUtil_GroupAllocateMemory( stream->stream_memory, sizeof(jack_port_t*) * numInputChannels ), + paInsufficientMemory ); + memset( stream->local_input_ports, 0, sizeof(jack_port_t*) * numInputChannels ); + UNLESS( stream->remote_output_ports = + (jack_port_t**) PaUtil_GroupAllocateMemory( stream->stream_memory, sizeof(jack_port_t*) * numInputChannels ), + paInsufficientMemory ); + memset( stream->remote_output_ports, 0, sizeof(jack_port_t*) * numInputChannels ); + } + if( numOutputChannels > 0 ) + { + UNLESS( stream->local_output_ports = + (jack_port_t**) PaUtil_GroupAllocateMemory( stream->stream_memory, sizeof(jack_port_t*) * numOutputChannels ), + paInsufficientMemory ); + memset( stream->local_output_ports, 0, sizeof(jack_port_t*) * numOutputChannels ); + UNLESS( stream->remote_input_ports = + (jack_port_t**) PaUtil_GroupAllocateMemory( stream->stream_memory, sizeof(jack_port_t*) * numOutputChannels ), + paInsufficientMemory ); + memset( stream->remote_input_ports, 0, sizeof(jack_port_t*) * numOutputChannels ); + } + + stream->num_incoming_connections = numInputChannels; + stream->num_outgoing_connections = numOutputChannels; + +error: + return result; +} + +/*! + * Free resources associated with stream, and eventually stream itself. + * + * Frees allocated memory, and closes opened pcms. + */ +static void CleanUpStream( PaJackStream *stream, int terminateStreamRepresentation, int terminateBufferProcessor ) +{ + int i; + assert( stream ); + + if( stream->isBlockingStream ) + BlockingEnd( stream ); + + for( i = 0; i < stream->num_incoming_connections; ++i ) + { + if( stream->local_input_ports[i] ) + ASSERT_CALL( jack_port_unregister( stream->jack_client, stream->local_input_ports[i] ), 0 ); + } + for( i = 0; i < stream->num_outgoing_connections; ++i ) + { + if( stream->local_output_ports[i] ) + ASSERT_CALL( jack_port_unregister( stream->jack_client, stream->local_output_ports[i] ), 0 ); + } + + if( terminateStreamRepresentation ) + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + if( terminateBufferProcessor ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + + if( stream->stream_memory ) + { + PaUtil_FreeAllAllocations( stream->stream_memory ); + PaUtil_DestroyAllocationGroup( stream->stream_memory ); + } + PaUtil_FreeMemory( stream ); +} + +static PaError WaitCondition( PaJackHostApiRepresentation *hostApi ) +{ + PaError result = paNoError; + int err = 0; + PaTime pt = PaUtil_GetTime(); + struct timespec ts; + + ts.tv_sec = (time_t) floor( pt + 1 ); + ts.tv_nsec = (long) ((pt - floor( pt )) * 1000000000); + /* XXX: Best enclose in loop, in case of spurious wakeups? */ + err = pthread_cond_timedwait( &hostApi->cond, &hostApi->mtx, &ts ); + + /* Make sure we didn't time out */ + UNLESS( err != ETIMEDOUT, paTimedOut ); + UNLESS( !err, paInternalError ); + +error: + return result; +} + +static PaError AddStream( PaJackStream *stream ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *hostApi = stream->hostApi; + /* Add to queue of streams that should be processed */ + ASSERT_CALL( pthread_mutex_lock( &hostApi->mtx ), 0 ); + if( !hostApi->jackIsDown ) + { + hostApi->toAdd = stream; + /* Unlock mutex and await signal from processing thread */ + result = WaitCondition( stream->hostApi ); + } + ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 ); + ENSURE_PA( result ); + + UNLESS( !hostApi->jackIsDown, paDeviceUnavailable ); + +error: + return result; +} + +/* Remove stream from processing queue */ +static PaError RemoveStream( PaJackStream *stream ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *hostApi = stream->hostApi; + + /* Add to queue over streams that should be processed */ + ASSERT_CALL( pthread_mutex_lock( &hostApi->mtx ), 0 ); + if( !hostApi->jackIsDown ) + { + hostApi->toRemove = stream; + /* Unlock mutex and await signal from processing thread */ + result = WaitCondition( stream->hostApi ); + } + ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 ); + ENSURE_PA( result ); + +error: + return result; +} + +/* Add stream to processing queue */ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *jackHostApi = (PaJackHostApiRepresentation*)hostApi; + PaJackStream *stream = NULL; + char *port_string = alloca( jack_port_name_size() ); + unsigned long regexSz = jack_client_name_size() + 3; + char *regex_pattern = alloca( regexSz ); + const char **jack_ports = NULL; + /* int jack_max_buffer_size = jack_get_buffer_size( jackHostApi->jack_client ); */ + int i; + int inputChannelCount, outputChannelCount; + const double jackSr = jack_get_sample_rate( jackHostApi->jack_client ); + PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0; + int bpInitialized = 0, srInitialized = 0; /* Initialized buffer processor and stream representation? */ + unsigned long ofs; + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + if( (streamFlags & paPrimeOutputBuffersUsingStreamCallback) != 0 ) + { + streamFlags &= ~paPrimeOutputBuffersUsingStreamCallback; + /*return paInvalidFlag;*/ /* This implementation does not support buffer priming */ + } + + if( framesPerBuffer != paFramesPerBufferUnspecified ) + { + /* Jack operates with power of two buffers, and we don't support non-integer buffer adaption (yet) */ + /*UNLESS( !(framesPerBuffer & (framesPerBuffer - 1)), paBufferTooBig );*/ /* TODO: Add descriptive error code? */ + } + + /* Preliminary checks */ + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + /* ... check that the sample rate exactly matches the ONE acceptable rate + * A: This rate isn't necessarily constant though? */ + +#define ABS(x) ( (x) > 0 ? (x) : -(x) ) + if( ABS(sampleRate - jackSr) > 1 ) + return paInvalidSampleRate; +#undef ABS + + UNLESS( stream = (PaJackStream*)PaUtil_AllocateMemory( sizeof(PaJackStream) ), paInsufficientMemory ); + ENSURE_PA( InitializeStream( stream, jackHostApi, inputChannelCount, outputChannelCount ) ); + + /* the blocking emulation, if necessary */ + stream->isBlockingStream = !streamCallback; + if( stream->isBlockingStream ) + { + float latency = 0.001; /* 1ms is the absolute minimum we support */ + int minimum_buffer_frames = 0; + + if( inputParameters && inputParameters->suggestedLatency > latency ) + latency = inputParameters->suggestedLatency; + else if( outputParameters && outputParameters->suggestedLatency > latency ) + latency = outputParameters->suggestedLatency; + + /* the latency the user asked for indicates the minimum buffer size in frames */ + minimum_buffer_frames = (int) (latency * jack_get_sample_rate( jackHostApi->jack_client )); + + /* we also need to be able to store at least three full jack buffers to avoid dropouts */ + if( jackHostApi->jack_buffer_size * 3 > minimum_buffer_frames ) + minimum_buffer_frames = jackHostApi->jack_buffer_size * 3; + + /* setup blocking API data structures (FIXME: can fail) */ + BlockingBegin( stream, minimum_buffer_frames ); + + /* install our own callback for the blocking API */ + streamCallback = BlockingCallback; + userData = stream; + + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &jackHostApi->blockingStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &jackHostApi->callbackStreamInterface, streamCallback, userData ); + } + srInitialized = 1; + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, jackSr ); + + /* create the JACK ports. We cannot connect them until audio + * processing begins */ + + /* Register a unique set of ports for this stream + * TODO: Robust allocation of new port names */ + + ofs = jackHostApi->inputBase; + for( i = 0; i < inputChannelCount; i++ ) + { + snprintf( port_string, jack_port_name_size(), "in_%lu", ofs + i ); + UNLESS( stream->local_input_ports[i] = jack_port_register( + jackHostApi->jack_client, port_string, + JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0 ), paInsufficientMemory ); + } + jackHostApi->inputBase += inputChannelCount; + + ofs = jackHostApi->outputBase; + for( i = 0; i < outputChannelCount; i++ ) + { + snprintf( port_string, jack_port_name_size(), "out_%lu", ofs + i ); + UNLESS( stream->local_output_ports[i] = jack_port_register( + jackHostApi->jack_client, port_string, + JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 ), paInsufficientMemory ); + } + jackHostApi->outputBase += outputChannelCount; + + /* look up the jack_port_t's for the remote ports. We could do + * this at stream start time, but doing it here ensures the + * name lookup only happens once. */ + + if( inputChannelCount > 0 ) + { + int err = 0; + + /* ... remote output ports (that we input from) */ + snprintf( regex_pattern, regexSz, "%s:.*", hostApi->deviceInfos[ inputParameters->device ]->name ); + UNLESS( jack_ports = jack_get_ports( jackHostApi->jack_client, regex_pattern, + NULL, JackPortIsOutput ), paUnanticipatedHostError ); + for( i = 0; i < inputChannelCount && jack_ports[i]; i++ ) + { + if( (stream->remote_output_ports[i] = jack_port_by_name( + jackHostApi->jack_client, jack_ports[i] )) == NULL ) + { + err = 1; + break; + } + } + free( jack_ports ); + UNLESS( !err, paInsufficientMemory ); + + /* Fewer ports than expected? */ + UNLESS( i == inputChannelCount, paInternalError ); + } + + if( outputChannelCount > 0 ) + { + int err = 0; + + /* ... remote input ports (that we output to) */ + snprintf( regex_pattern, regexSz, "%s:.*", hostApi->deviceInfos[ outputParameters->device ]->name ); + UNLESS( jack_ports = jack_get_ports( jackHostApi->jack_client, regex_pattern, + NULL, JackPortIsInput ), paUnanticipatedHostError ); + for( i = 0; i < outputChannelCount && jack_ports[i]; i++ ) + { + if( (stream->remote_input_ports[i] = jack_port_by_name( + jackHostApi->jack_client, jack_ports[i] )) == 0 ) + { + err = 1; + break; + } + } + free( jack_ports ); + UNLESS( !err , paInsufficientMemory ); + + /* Fewer ports than expected? */ + UNLESS( i == outputChannelCount, paInternalError ); + } + + ENSURE_PA( PaUtil_InitializeBufferProcessor( + &stream->bufferProcessor, + inputChannelCount, + inputSampleFormat, + paFloat32, /* hostInputSampleFormat */ + outputChannelCount, + outputSampleFormat, + paFloat32, /* hostOutputSampleFormat */ + jackSr, + streamFlags, + framesPerBuffer, + 0, /* Ignored */ + paUtilUnknownHostBufferSize, /* Buffer size may vary on JACK's discretion */ + streamCallback, + userData ) ); + bpInitialized = 1; + + if( stream->num_incoming_connections > 0 ) + stream->streamRepresentation.streamInfo.inputLatency = (jack_port_get_latency( stream->remote_output_ports[0] ) + - jack_get_buffer_size( jackHostApi->jack_client ) /* One buffer is not counted as latency */ + + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor )) / sampleRate; + if( stream->num_outgoing_connections > 0 ) + stream->streamRepresentation.streamInfo.outputLatency = (jack_port_get_latency( stream->remote_input_ports[0] ) + - jack_get_buffer_size( jackHostApi->jack_client ) /* One buffer is not counted as latency */ + + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor )) / sampleRate; + + stream->streamRepresentation.streamInfo.sampleRate = jackSr; + stream->t0 = jack_frame_time( jackHostApi->jack_client ); /* A: Time should run from Pa_OpenStream */ + + ENSURE_PA( AddStream( stream ) ); /* Add to queue over opened streams */ + + *s = (PaStream*)stream; + + return result; + +error: + if( stream ) + CleanUpStream( stream, srInitialized, bpInitialized ); + + return result; +} + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaJackStream *stream = (PaJackStream*)s; + + /* Remove this stream from the processing queue */ + ENSURE_PA( RemoveStream( stream ) ); + +error: + CleanUpStream( stream, 1, 1 ); + return result; +} + +static PaError RealProcess( PaJackStream *stream, jack_nframes_t frames ) +{ + PaError result = paNoError; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; + int chn; + int framesProcessed; + const double sr = jack_get_sample_rate( stream->jack_client ); /* Shouldn't change during the process callback */ + PaStreamCallbackFlags cbFlags = 0; + + /* If the user has returned !paContinue from the callback we'll want to flush the internal buffers, + * when these are empty we can finally mark the stream as inactive */ + if( stream->callbackResult != paContinue && + PaUtil_IsBufferProcessorOutputEmpty( &stream->bufferProcessor ) ) + { + stream->is_active = 0; + if( stream->streamRepresentation.streamFinishedCallback ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + PA_DEBUG(( "%s: Callback finished\n", __FUNCTION__ )); + + goto end; + } + + timeInfo.currentTime = (jack_frame_time( stream->jack_client ) - stream->t0) / sr; + if( stream->num_incoming_connections > 0 ) + timeInfo.inputBufferAdcTime = timeInfo.currentTime - jack_port_get_latency( stream->remote_output_ports[0] ) + / sr; + if( stream->num_outgoing_connections > 0 ) + timeInfo.outputBufferDacTime = timeInfo.currentTime + jack_port_get_latency( stream->remote_input_ports[0] ) + / sr; + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + if( stream->xrun ) + { + /* XXX: Any way to tell which of these occurred? */ + cbFlags = paOutputUnderflow | paInputOverflow; + stream->xrun = FALSE; + } + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, + cbFlags ); + + if( stream->num_incoming_connections > 0 ) + PaUtil_SetInputFrameCount( &stream->bufferProcessor, frames ); + if( stream->num_outgoing_connections > 0 ) + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, frames ); + + for( chn = 0; chn < stream->num_incoming_connections; chn++ ) + { + jack_default_audio_sample_t *channel_buf = (jack_default_audio_sample_t*) + jack_port_get_buffer( stream->local_input_ports[chn], + frames ); + + PaUtil_SetNonInterleavedInputChannel( &stream->bufferProcessor, + chn, + channel_buf ); + } + + for( chn = 0; chn < stream->num_outgoing_connections; chn++ ) + { + jack_default_audio_sample_t *channel_buf = (jack_default_audio_sample_t*) + jack_port_get_buffer( stream->local_output_ports[chn], + frames ); + + PaUtil_SetNonInterleavedOutputChannel( &stream->bufferProcessor, + chn, + channel_buf ); + } + + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, + &stream->callbackResult ); + /* We've specified a host buffer size mode where every frame should be consumed by the buffer processor */ + assert( framesProcessed == frames ); + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + +end: + return result; +} + +/* Alter the processing queue if necessary */ +static PaError UpdateQueue( PaJackHostApiRepresentation *hostApi ) +{ + PaError result = paNoError; + int queueModified = 0; + const double jackSr = jack_get_sample_rate( hostApi->jack_client ); + int err; + + if( (err = pthread_mutex_trylock( &hostApi->mtx )) != 0 ) + { + assert( err == EBUSY ); + return paNoError; + } + + if( hostApi->toAdd ) + { + if( hostApi->processQueue ) + { + PaJackStream *node = hostApi->processQueue; + /* Advance to end of queue */ + while( node->next ) + node = node->next; + + node->next = hostApi->toAdd; + } + else + hostApi->processQueue = (PaJackStream *)hostApi->toAdd; + + /* If necessary, update stream state */ + if( hostApi->toAdd->streamRepresentation.streamInfo.sampleRate != jackSr ) + UpdateSampleRate( hostApi->toAdd, jackSr ); + + hostApi->toAdd = NULL; + queueModified = 1; + } + if( hostApi->toRemove ) + { + int removed = 0; + PaJackStream *node = hostApi->processQueue, *prev = NULL; + assert( hostApi->processQueue ); + + while( node ) + { + if( node == hostApi->toRemove ) + { + if( prev ) + prev->next = node->next; + else + hostApi->processQueue = (PaJackStream *)node->next; + + removed = 1; + break; + } + + prev = node; + node = node->next; + } + UNLESS( removed, paInternalError ); + hostApi->toRemove = NULL; + PA_DEBUG(( "%s: Removed stream from processing queue\n", __FUNCTION__ )); + queueModified = 1; + } + + if( queueModified ) + { + /* Signal that we've done what was asked of us */ + ASSERT_CALL( pthread_cond_signal( &hostApi->cond ), 0 ); + } + +error: + ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 ); + + return result; +} + +static int JackCallback( jack_nframes_t frames, void *userData ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *hostApi = (PaJackHostApiRepresentation *)userData; + PaJackStream *stream = NULL; + int xrun = hostApi->xrun; + hostApi->xrun = 0; + + assert( hostApi ); + + ENSURE_PA( UpdateQueue( hostApi ) ); + + /* Process each stream */ + stream = hostApi->processQueue; + for( ; stream; stream = stream->next ) + { + if( xrun ) /* Don't override if already set */ + stream->xrun = 1; + + /* See if this stream is to be started */ + if( stream->doStart ) + { + /* If we can't obtain a lock, we'll try next time */ + int err = pthread_mutex_trylock( &stream->hostApi->mtx ); + if( !err ) + { + if( stream->doStart ) /* Could potentially change before obtaining the lock */ + { + stream->is_active = 1; + stream->doStart = 0; + PA_DEBUG(( "%s: Starting stream\n", __FUNCTION__ )); + ASSERT_CALL( pthread_cond_signal( &stream->hostApi->cond ), 0 ); + stream->callbackResult = paContinue; + stream->isSilenced = 0; + } + + ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 ); + } + else + assert( err == EBUSY ); + } + else if( stream->doStop || stream->doAbort ) /* Should we stop/abort stream? */ + { + if( stream->callbackResult == paContinue ) /* Ok, make it stop */ + { + PA_DEBUG(( "%s: Stopping stream\n", __FUNCTION__ )); + stream->callbackResult = stream->doStop ? paComplete : paAbort; + } + } + + if( stream->is_active ) + ENSURE_PA( RealProcess( stream, frames ) ); + /* If we have just entered inactive state, silence output */ + if( !stream->is_active && !stream->isSilenced ) + { + int i; + + /* Silence buffer after entering inactive state */ + PA_DEBUG(( "Silencing the output\n" )); + for( i = 0; i < stream->num_outgoing_connections; ++i ) + { + jack_default_audio_sample_t *buffer = jack_port_get_buffer( stream->local_output_ports[i], frames ); + memset( buffer, 0, sizeof (jack_default_audio_sample_t) * frames ); + } + + stream->isSilenced = 1; + } + + if( stream->doStop || stream->doAbort ) + { + /* See if RealProcess has acted on the request */ + if( !stream->is_active ) /* Ok, signal to the main thread that we've carried out the operation */ + { + /* If we can't obtain a lock, we'll try next time */ + int err = pthread_mutex_trylock( &stream->hostApi->mtx ); + if( !err ) + { + stream->doStop = stream->doAbort = 0; + ASSERT_CALL( pthread_cond_signal( &stream->hostApi->cond ), 0 ); + ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 ); + } + else + assert( err == EBUSY ); + } + } + } + + return 0; +error: + return -1; +} + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaJackStream *stream = (PaJackStream*)s; + int i; + + /* Ready the processor */ + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + /* connect the ports */ + + /* NOTE: I would rather use jack_port_connect which uses jack_port_t's + * instead of port names, but it is not implemented yet. */ + if( stream->num_incoming_connections > 0 ) + { + for( i = 0; i < stream->num_incoming_connections; i++ ) + UNLESS( jack_connect( stream->jack_client, + jack_port_name( stream->remote_output_ports[i] ), + jack_port_name( stream->local_input_ports[i] ) ) == 0, paUnanticipatedHostError ); + } + + if( stream->num_outgoing_connections > 0 ) + { + for( i = 0; i < stream->num_outgoing_connections; i++ ) + UNLESS( jack_connect( stream->jack_client, + jack_port_name( stream->local_output_ports[i] ), + jack_port_name( stream->remote_input_ports[i] ) ) == 0, paUnanticipatedHostError ); + } + + stream->xrun = FALSE; + + /* Enable processing */ + + ASSERT_CALL( pthread_mutex_lock( &stream->hostApi->mtx ), 0 ); + stream->doStart = 1; + + /* Wait for stream to be started */ + result = WaitCondition( stream->hostApi ); + /* + do + { + err = pthread_cond_timedwait( &stream->hostApi->cond, &stream->hostApi->mtx, &ts ); + } while( !stream->is_active && !err ); + */ + if( result != paNoError ) /* Something went wrong, call off the stream start */ + { + stream->doStart = 0; + stream->is_active = 0; /* Cancel any processing */ + } + ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 ); + + ENSURE_PA( result ); + + stream->is_running = TRUE; + PA_DEBUG(( "%s: Stream started\n", __FUNCTION__ )); + +error: + return result; +} + +static PaError RealStop( PaJackStream *stream, int abort ) +{ + PaError result = paNoError; + int i; + + if( stream->isBlockingStream ) + BlockingWaitEmpty ( stream ); + + ASSERT_CALL( pthread_mutex_lock( &stream->hostApi->mtx ), 0 ); + if( abort ) + stream->doAbort = 1; + else + stream->doStop = 1; + + /* Wait for stream to be stopped */ + result = WaitCondition( stream->hostApi ); + ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 ); + ENSURE_PA( result ); + + UNLESS( !stream->is_active, paInternalError ); + + PA_DEBUG(( "%s: Stream stopped\n", __FUNCTION__ )); + +error: + stream->is_running = FALSE; + + /* Disconnect ports belonging to this stream */ + + if( !stream->hostApi->jackIsDown ) /* XXX: Well? */ + { + if( stream->num_incoming_connections > 0 ) + { + for( i = 0; i < stream->num_incoming_connections; i++ ) + UNLESS( !jack_disconnect( stream->jack_client, + jack_port_name( stream->remote_output_ports[i] ), + jack_port_name( stream->local_input_ports[i] ) ), paUnanticipatedHostError ); + } + if( stream->num_outgoing_connections > 0 ) + { + for( i = 0; i < stream->num_outgoing_connections; i++ ) + UNLESS( !jack_disconnect( stream->jack_client, + jack_port_name( stream->local_output_ports[i] ), + jack_port_name( stream->remote_input_ports[i] ) ), paUnanticipatedHostError ); + } + } + + return result; +} + +static PaError StopStream( PaStream *s ) +{ + assert(s); + return RealStop( (PaJackStream *)s, 0 ); +} + +static PaError AbortStream( PaStream *s ) +{ + assert(s); + return RealStop( (PaJackStream *)s, 1 ); +} + +static PaError IsStreamStopped( PaStream *s ) +{ + PaJackStream *stream = (PaJackStream*)s; + return !stream->is_running; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaJackStream *stream = (PaJackStream*)s; + return stream->is_active; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + PaJackStream *stream = (PaJackStream*)s; + + /* A: Is this relevant?? --> TODO: what if we're recording-only? */ + return (jack_frame_time( stream->jack_client ) - stream->t0) / (PaTime)jack_get_sample_rate( stream->jack_client ); +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaJackStream *stream = (PaJackStream*)s; + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} diff --git a/portaudio-v19/pa_linux_alsa/pa_linux_alsa.c b/portaudio-v19/pa_linux_alsa/pa_linux_alsa.c new file mode 100644 index 000000000..dce232e36 --- /dev/null +++ b/portaudio-v19/pa_linux_alsa/pa_linux_alsa.c @@ -0,0 +1,3590 @@ +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * ALSA implementation by Joshua Haberman and Arve Knudsen + * + * Copyright (c) 2002 Joshua Haberman + * Copyright (c) 2005 Arve Knudsen + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +#define ALSA_PCM_NEW_HW_PARAMS_API +#define ALSA_PCM_NEW_SW_PARAMS_API +#include +#undef ALSA_PCM_NEW_HW_PARAMS_API +#undef ALSA_PCM_NEW_SW_PARAMS_API + +#include +#include /* strlen() */ +#include +#include +#include +#include +#include +#include +#include /* For sig_atomic_t */ + +#include "portaudio.h" +#include "pa_util.h" +#include "../pa_unix/pa_unix_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + +#include "pa_linux_alsa.h" + +/* Check return value of ALSA function, and map it to PaError */ +#define ENSURE_(expr, code) \ + do { \ + if( UNLIKELY( (aErr_ = (expr)) < 0 ) ) \ + { \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( (code) == paUnanticipatedHostError && pthread_self() != callbackThread_ ) \ + { \ + PaUtil_SetLastHostErrorInfo( paALSA, aErr_, snd_strerror( aErr_ ) ); \ + } \ + PaUtil_DebugPrint( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" ); \ + if( (code) == paUnanticipatedHostError ) \ + PA_DEBUG(( "Host error description: %s\n", snd_strerror( aErr_ ) )); \ + result = (code); \ + goto error; \ + } \ + } while( 0 ); + +#define ENSURE_SYSTEM_(expr, success) \ + do { \ + if( UNLIKELY( (aErr_ = (expr)) != success ) ) \ + { \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( pthread_self() != callbackThread_ ) \ + { \ + PaUtil_SetLastHostErrorInfo( paALSA, aErr_, strerror( aErr_ ) ); \ + } \ + PaUtil_DebugPrint( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" ); \ + result = paUnanticipatedHostError; \ + goto error; \ + } \ + } while( 0 ); + +#define ASSERT_CALL_(expr, success) \ + aErr_ = (expr); \ + assert( success == aErr_ ); + +static int aErr_; /* Used with ENSURE_ */ +static pthread_t callbackThread_; + +typedef enum +{ + StreamDirection_In, + StreamDirection_Out +} StreamDirection; + +/* Threading utility struct */ +typedef struct PaAlsaThreading +{ + pthread_t watchdogThread; + pthread_t callbackThread; + int watchdogRunning; + int rtSched; + int rtPrio; + int useWatchdog; + unsigned long throttledSleepTime; + volatile PaTime callbackTime; + volatile PaTime callbackCpuTime; + PaUtilCpuLoadMeasurer *cpuLoadMeasurer; +} PaAlsaThreading; + +typedef struct +{ + PaSampleFormat hostSampleFormat; + unsigned long framesPerBuffer; + int numUserChannels, numHostChannels; + int userInterleaved, hostInterleaved; + + snd_pcm_t *pcm; + snd_pcm_uframes_t bufferSize; + snd_pcm_format_t nativeFormat; + unsigned int nfds; + int ready; /* Marked ready from poll */ + void **userBuffers; + snd_pcm_uframes_t offset; + StreamDirection streamDir; + + snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */ +} PaAlsaStreamComponent; + +/* Implementation specific stream structure */ +typedef struct PaAlsaStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + PaAlsaThreading threading; + + unsigned long framesPerUserBuffer, maxFramesPerHostBuffer; + + int primeBuffers; + int callbackMode; /* bool: are we running in callback mode? */ + int pcmsSynced; /* Have we successfully synced pcms */ + + /* the callback thread uses these to poll the sound device(s), waiting + * for data to be ready/available */ + struct pollfd* pfds; + int pollTimeout; + + /* Used in communication between threads */ + volatile sig_atomic_t callback_finished; /* bool: are we in the "callback finished" state? */ + volatile sig_atomic_t callbackAbort; /* Drop frames? */ + volatile sig_atomic_t callbackStop; /* Signal a stop */ + volatile sig_atomic_t isActive; /* Is stream in active state? (Between StartStream and StopStream || !paContinue) */ + pthread_mutex_t stateMtx; /* Used to synchronize access to stream state */ + pthread_mutex_t startMtx; /* Used to synchronize stream start in callback mode */ + pthread_cond_t startCond; /* Wait untill audio is started in callback thread */ + + int neverDropInput; + + PaTime underrun; + PaTime overrun; + + PaAlsaStreamComponent capture, playback; +} +PaAlsaStream; + +/* PaAlsaHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct PaAlsaHostApiRepresentation +{ + PaUtilHostApiRepresentation commonHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + PaHostApiIndex hostApiIndex; +} +PaAlsaHostApiRepresentation; + +typedef struct PaAlsaDeviceInfo +{ + PaDeviceInfo commonDeviceInfo; + char *alsaName; + int isPlug; + int minInputChannels; + int minOutputChannels; +} +PaAlsaDeviceInfo; + +/* Threading utilities */ + +static void InitializeThreading( PaAlsaThreading *th, PaUtilCpuLoadMeasurer *clm ) +{ + th->watchdogRunning = 0; + th->rtSched = 0; + th->callbackTime = 0; + th->callbackCpuTime = 0; + th->useWatchdog = 1; + th->throttledSleepTime = 0; + th->cpuLoadMeasurer = clm; + + th->rtPrio = (sched_get_priority_max( SCHED_FIFO ) - sched_get_priority_min( SCHED_FIFO )) / 2 + + sched_get_priority_min( SCHED_FIFO ); +} + +static PaError KillCallbackThread( PaAlsaThreading *th, int wait, PaError *exitResult, PaError *watchdogExitResult ) +{ + PaError result = paNoError; + void *pret; + + if( exitResult ) + *exitResult = paNoError; + if( watchdogExitResult ) + *watchdogExitResult = paNoError; + + if( th->watchdogRunning ) + { + pthread_cancel( th->watchdogThread ); + ENSURE_SYSTEM_( pthread_join( th->watchdogThread, &pret ), 0 ); + + if( pret && pret != PTHREAD_CANCELED ) + { + if( watchdogExitResult ) + *watchdogExitResult = *(PaError *) pret; + free( pret ); + } + } + + /* Only kill the thread if it isn't in the process of stopping (flushing adaptation buffers) */ + /* TODO: Make join time out */ + if( !wait ) + { + PA_DEBUG(( "%s: Canceling thread %d\n", __FUNCTION__, th->callbackThread )); + pthread_cancel( th->callbackThread ); /* XXX: Safe to call this if the thread has exited on its own? */ + } + PA_DEBUG(( "%s: Joining thread %d\n", __FUNCTION__, th->callbackThread )); + ENSURE_SYSTEM_( pthread_join( th->callbackThread, &pret ), 0 ); + + if( pret && pret != PTHREAD_CANCELED ) + { + if( exitResult ) + *exitResult = *(PaError *) pret; + free( pret ); + } + +error: + return result; +} + +/** Lock a pthread_mutex_t. + * + * @concern ThreadCancellation We're disabling thread cancellation while the thread is holding a lock, so mutexes are + * properly unlocked at termination time. + */ +static PaError LockMutex( pthread_mutex_t *mtx ) +{ + PaError result = paNoError; + int oldState; + + ENSURE_SYSTEM_( pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &oldState ), 0 ); + ENSURE_SYSTEM_( pthread_mutex_lock( mtx ), 0 ); + +error: + return result; +} + +/** Unlock a pthread_mutex_t. + * + * @concern ThreadCancellation Thread cancellation is enabled again after the mutex is properly unlocked. + */ +static PaError UnlockMutex( pthread_mutex_t *mtx ) +{ + PaError result = paNoError; + int oldState; + + ENSURE_SYSTEM_( pthread_mutex_unlock( mtx ), 0 ); + ENSURE_SYSTEM_( pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, &oldState ), 0 ); + +error: + return result; +} + +static void OnWatchdogExit( void *userData ) +{ + PaAlsaThreading *th = (PaAlsaThreading *) userData; + struct sched_param spm = { 0 }; + assert( th ); + + ASSERT_CALL_( pthread_setschedparam( th->callbackThread, SCHED_OTHER, &spm ), 0 ); /* Lower before exiting */ + PA_DEBUG(( "Watchdog exiting\n" )); +} + +static PaError BoostPriority( PaAlsaThreading *th ) +{ + PaError result = paNoError; + struct sched_param spm = { 0 }; + spm.sched_priority = th->rtPrio; + + assert( th ); + + if( pthread_setschedparam( th->callbackThread, SCHED_FIFO, &spm ) != 0 ) + { + PA_UNLESS( errno == EPERM, paInternalError ); /* Lack permission to raise priority */ + PA_DEBUG(( "Failed bumping priority\n" )); + result = 0; + } + else + result = 1; /* Success */ +error: + return result; +} + +static void *WatchdogFunc( void *userData ) +{ + PaError result = paNoError, *pres = NULL; + int err; + PaAlsaThreading *th = (PaAlsaThreading *) userData; + unsigned intervalMsec = 500; + const PaTime maxSeconds = 3.; /* Max seconds between callbacks */ + PaTime timeThen = PaUtil_GetTime(), timeNow, timeElapsed, cpuTimeThen, cpuTimeNow, cpuTimeElapsed; + double cpuLoad, avgCpuLoad = 0.; + int throttled = 0; + + assert( th ); + + /* Execute OnWatchdogExit when exiting */ + pthread_cleanup_push( &OnWatchdogExit, th ); + + /* Boost priority of callback thread */ + PA_ENSURE( result = BoostPriority( th ) ); + if( !result ) + { + /* Boost failed, might as well exit */ + pthread_exit( NULL ); + } + + cpuTimeThen = th->callbackCpuTime; + { + int policy; + struct sched_param spm = { 0 }; + pthread_getschedparam( pthread_self(), &policy, &spm ); + PA_DEBUG(( "%s: Watchdog priority is %d\n", __FUNCTION__, spm.sched_priority )); + } + + while( 1 ) + { + double lowpassCoeff = 0.9, lowpassCoeff1 = 0.99999 - lowpassCoeff; + + /* Test before and after in case whatever underlying sleep call isn't interrupted by pthread_cancel */ + pthread_testcancel(); + Pa_Sleep( intervalMsec ); + pthread_testcancel(); + + if( PaUtil_GetTime() - th->callbackTime > maxSeconds ) + { + PA_DEBUG(( "Watchdog: Terminating callback thread\n" )); + /* Tell thread to terminate */ + err = pthread_kill( th->callbackThread, SIGKILL ); + pthread_exit( NULL ); + } + + PA_DEBUG(( "%s: PortAudio reports CPU load: %g\n", __FUNCTION__, PaUtil_GetCpuLoad( th->cpuLoadMeasurer ) )); + + /* Check if we should throttle, or unthrottle :P */ + cpuTimeNow = th->callbackCpuTime; + cpuTimeElapsed = cpuTimeNow - cpuTimeThen; + cpuTimeThen = cpuTimeNow; + + timeNow = PaUtil_GetTime(); + timeElapsed = timeNow - timeThen; + timeThen = timeNow; + cpuLoad = cpuTimeElapsed / timeElapsed; + avgCpuLoad = avgCpuLoad * lowpassCoeff + cpuLoad * lowpassCoeff1; + /* + if( throttled ) + PA_DEBUG(( "Watchdog: CPU load: %g, %g\n", avgCpuLoad, cpuTimeElapsed )); + */ + if( PaUtil_GetCpuLoad( th->cpuLoadMeasurer ) > .925 ) + { + static int policy; + static struct sched_param spm = { 0 }; + static const struct sched_param defaultSpm = { 0 }; + PA_DEBUG(( "%s: Throttling audio thread, priority %d\n", __FUNCTION__, spm.sched_priority )); + + pthread_getschedparam( th->callbackThread, &policy, &spm ); + if( !pthread_setschedparam( th->callbackThread, SCHED_OTHER, &defaultSpm ) ) + { + throttled = 1; + } + else + PA_DEBUG(( "Watchdog: Couldn't lower priority of audio thread: %s\n", strerror( errno ) )); + + /* Give other processes a go, before raising priority again */ + PA_DEBUG(( "%s: Watchdog sleeping for %lu msecs before unthrottling\n", __FUNCTION__, th->throttledSleepTime )); + Pa_Sleep( th->throttledSleepTime ); + + /* Reset callback priority */ + if( pthread_setschedparam( th->callbackThread, SCHED_FIFO, &spm ) != 0 ) + { + PA_DEBUG(( "%s: Couldn't raise priority of audio thread: %s\n", __FUNCTION__, strerror( errno ) )); + } + + if( PaUtil_GetCpuLoad( th->cpuLoadMeasurer ) >= .99 ) + intervalMsec = 50; + else + intervalMsec = 100; + + /* + lowpassCoeff = .97; + lowpassCoeff1 = .99999 - lowpassCoeff; + */ + } + else if( throttled && avgCpuLoad < .8 ) + { + intervalMsec = 500; + throttled = 0; + + /* + lowpassCoeff = .9; + lowpassCoeff1 = .99999 - lowpassCoeff; + */ + } + } + + pthread_cleanup_pop( 1 ); /* Execute cleanup on exit */ + +error: + /* Shouldn't get here in the normal case */ + + /* Pass on error code */ + pres = malloc( sizeof (PaError) ); + *pres = result; + + pthread_exit( pres ); +} + +static PaError CreateCallbackThread( PaAlsaThreading *th, void *(*callbackThreadFunc)( void * ), PaStream *s ) +{ + PaError result = paNoError; + pthread_attr_t attr; + int started = 0; + +#if defined _POSIX_MEMLOCK && (_POSIX_MEMLOCK != -1) + if( th->rtSched ) + { + if( mlockall( MCL_CURRENT | MCL_FUTURE ) < 0 ) + { + int savedErrno = errno; /* In case errno gets overwritten */ + assert( savedErrno != EINVAL ); /* Most likely a programmer error */ + PA_UNLESS( (savedErrno == EPERM), paInternalError ); + PA_DEBUG(( "%s: Failed locking memory\n", __FUNCTION__ )); + } + else + PA_DEBUG(( "%s: Successfully locked memory\n", __FUNCTION__ )); + } +#endif + + PA_UNLESS( !pthread_attr_init( &attr ), paInternalError ); + /* Priority relative to other processes */ + PA_UNLESS( !pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ), paInternalError ); + + PA_UNLESS( !pthread_create( &th->callbackThread, &attr, callbackThreadFunc, s ), paInternalError ); + started = 1; + + if( th->rtSched ) + { + if( th->useWatchdog ) + { + int err; + struct sched_param wdSpm = { 0 }; + /* Launch watchdog, watchdog sets callback thread priority */ + int prio = PA_MIN( th->rtPrio + 4, sched_get_priority_max( SCHED_FIFO ) ); + wdSpm.sched_priority = prio; + + PA_UNLESS( !pthread_attr_init( &attr ), paInternalError ); + PA_UNLESS( !pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ), paInternalError ); + PA_UNLESS( !pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ), paInternalError ); + PA_UNLESS( !pthread_attr_setschedpolicy( &attr, SCHED_FIFO ), paInternalError ); + PA_UNLESS( !pthread_attr_setschedparam( &attr, &wdSpm ), paInternalError ); + if( (err = pthread_create( &th->watchdogThread, &attr, &WatchdogFunc, th )) ) + { + PA_UNLESS( err == EPERM, paInternalError ); + /* Permission error, go on without realtime privileges */ + PA_DEBUG(( "Failed bumping priority\n" )); + } + else + { + int policy; + th->watchdogRunning = 1; + ENSURE_SYSTEM_( pthread_getschedparam( th->watchdogThread, &policy, &wdSpm ), 0 ); + /* Check if priority is right, policy could potentially differ from SCHED_FIFO (but that's alright) */ + if( wdSpm.sched_priority != prio ) + { + PA_DEBUG(( "Watchdog priority not set correctly (%d)\n", wdSpm.sched_priority )); + PA_ENSURE( paInternalError ); + } + } + } + else + PA_ENSURE( BoostPriority( th ) ); + } + +end: + return result; +error: + if( started ) + KillCallbackThread( th, 0, NULL, NULL ); + + goto end; +} + +static void CallbackUpdate( PaAlsaThreading *th ) +{ + th->callbackTime = PaUtil_GetTime(); + th->callbackCpuTime = PaUtil_GetCpuLoad( th->cpuLoadMeasurer ); +} + +/* prototypes for functions declared in this file */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *callback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError BuildDeviceList( PaAlsaHostApiRepresentation *hostApi ); +static int SetApproximateSampleRate( snd_pcm_t *pcm, snd_pcm_hw_params_t *hwParams, double sampleRate ); +static int GetExactSampleRate( snd_pcm_hw_params_t *hwParams, double *sampleRate ); + +/* Callback prototypes */ +static void *CallbackThreadFunc( void *userData ); + +/* Blocking prototypes */ +static signed long GetStreamReadAvailable( PaStream* s ); +static signed long GetStreamWriteAvailable( PaStream* s ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); + + +static const PaAlsaDeviceInfo *GetDeviceInfo( const PaUtilHostApiRepresentation *hostApi, int device ) +{ + return (const PaAlsaDeviceInfo *)hostApi->deviceInfos[device]; +} + +PaError PaAlsa_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaAlsaHostApiRepresentation *alsaHostApi = NULL; + + PA_UNLESS( alsaHostApi = (PaAlsaHostApiRepresentation*) PaUtil_AllocateMemory( + sizeof(PaAlsaHostApiRepresentation) ), paInsufficientMemory ); + PA_UNLESS( alsaHostApi->allocations = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + alsaHostApi->hostApiIndex = hostApiIndex; + + *hostApi = (PaUtilHostApiRepresentation*)alsaHostApi; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paALSA; + (*hostApi)->info.name = "ALSA"; + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PA_ENSURE( BuildDeviceList( alsaHostApi ) ); + + PaUtil_InitializeStreamInterface( &alsaHostApi->callbackStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, + IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &alsaHostApi->blockingStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, + IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, + GetStreamReadAvailable, + GetStreamWriteAvailable ); + + return result; + +error: + if( alsaHostApi ) + { + if( alsaHostApi->allocations ) + { + PaUtil_FreeAllAllocations( alsaHostApi->allocations ); + PaUtil_DestroyAllocationGroup( alsaHostApi->allocations ); + } + + PaUtil_FreeMemory( alsaHostApi ); + } + + return result; +} + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaAlsaHostApiRepresentation *alsaHostApi = (PaAlsaHostApiRepresentation*)hostApi; + + assert( hostApi ); + + if( alsaHostApi->allocations ) + { + PaUtil_FreeAllAllocations( alsaHostApi->allocations ); + PaUtil_DestroyAllocationGroup( alsaHostApi->allocations ); + } + + PaUtil_FreeMemory( alsaHostApi ); + snd_config_update_free_global(); +} + +/*! Determine max channels and default latencies. + * + * This function provides functionality to grope an opened (might be opened for capture or playback) pcm device for + * traits like max channels, suitable default latencies and default sample rate. Upon error, max channels is set to zero, + * and a suitable result returned. The device is closed before returning. + */ +static PaError GropeDevice( snd_pcm_t *pcm, int *minChannels, int *maxChannels, double *defaultLowLatency, + double *defaultHighLatency, double *defaultSampleRate, int isPlug ) +{ + PaError result = paNoError; + snd_pcm_hw_params_t *hwParams; + snd_pcm_uframes_t lowLatency = 512, highLatency = 2048; + unsigned int minChans, maxChans; + double defaultSr = *defaultSampleRate; + + assert( pcm ); + + ENSURE_( snd_pcm_nonblock( pcm, 0 ), paUnanticipatedHostError ); + + snd_pcm_hw_params_alloca( &hwParams ); + snd_pcm_hw_params_any( pcm, hwParams ); + + if( defaultSr >= 0 ) + { + /* Could be that the device opened in one mode supports samplerates that the other mode wont have, + * so try again .. */ + if( SetApproximateSampleRate( pcm, hwParams, defaultSr ) < 0 ) + { + defaultSr = -1.; + PA_DEBUG(( "%s: Original default samplerate failed, trying again ..\n", __FUNCTION__ )); + } + } + + if( defaultSr < 0. ) /* Default sample rate not set */ + { + unsigned int sampleRate = 44100; /* Will contain approximate rate returned by alsa-lib */ + ENSURE_( snd_pcm_hw_params_set_rate_near( pcm, hwParams, &sampleRate, NULL ), paUnanticipatedHostError ); + ENSURE_( GetExactSampleRate( hwParams, &defaultSr ), paUnanticipatedHostError ); + } + + ENSURE_( snd_pcm_hw_params_get_channels_min( hwParams, &minChans ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_get_channels_max( hwParams, &maxChans ), paUnanticipatedHostError ); + assert( maxChans <= INT_MAX ); + assert( maxChans > 0 ); /* Weird linking issue could cause wrong version of ALSA symbols to be called, + resulting in zeroed values */ + + /* XXX: Limit to sensible number (ALSA plugins accept a crazy amount of channels)? */ + if( isPlug && maxChans > 128 ) + { + maxChans = 128; + PA_DEBUG(( "%s: Limiting number of plugin channels to %u\n", __FUNCTION__, maxChans )); + } + + /* TWEAKME: + * + * Giving values for default min and max latency is not + * straightforward. Here are our objectives: + * + * * for low latency, we want to give the lowest value + * that will work reliably. This varies based on the + * sound card, kernel, CPU, etc. I think it is better + * to give sub-optimal latency than to give a number + * too low and cause dropouts. My conservative + * estimate at this point is to base it on 4096-sample + * latency at 44.1 kHz, which gives a latency of 23ms. + * * for high latency we want to give a large enough + * value that dropouts are basically impossible. This + * doesn't really require as much tweaking, since + * providing too large a number will just cause us to + * select the nearest setting that will work at stream + * config time. + */ + ENSURE_( snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &lowLatency ), paUnanticipatedHostError ); + + /* Have to reset hwParams, to set new buffer size */ + ENSURE_( snd_pcm_hw_params_any( pcm, hwParams ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &highLatency ), paUnanticipatedHostError ); + + *minChannels = (int)minChans; + *maxChannels = (int)maxChans; + *defaultSampleRate = defaultSr; + *defaultLowLatency = (double) lowLatency / *defaultSampleRate; + *defaultHighLatency = (double) highLatency / *defaultSampleRate; + +end: + snd_pcm_close( pcm ); + return result; + +error: + goto end; +} + +/* Initialize device info with invalid values (maxInputChannels and maxOutputChannels are set to zero since these indicate + * wether input/output is available) */ +static void InitializeDeviceInfo( PaDeviceInfo *deviceInfo ) +{ + deviceInfo->structVersion = -1; + deviceInfo->name = NULL; + deviceInfo->hostApi = -1; + deviceInfo->maxInputChannels = 0; + deviceInfo->maxOutputChannels = 0; + deviceInfo->defaultLowInputLatency = -1.; + deviceInfo->defaultLowOutputLatency = -1.; + deviceInfo->defaultHighInputLatency = -1.; + deviceInfo->defaultHighOutputLatency = -1.; + deviceInfo->defaultSampleRate = -1.; +} + +/* Helper struct */ +typedef struct +{ + char *alsaName; + char *name; + int isPlug; + int hasPlayback; + int hasCapture; +} DeviceNames; + +static PaError PaAlsa_StrDup( PaAlsaHostApiRepresentation *alsaApi, + char **dst, + const char *src) +{ + PaError result = paNoError; + int len = strlen( src ) + 1; + + /* PA_DEBUG(("PaStrDup %s %d\n", src, len)); */ + + PA_UNLESS( *dst = (char *)PaUtil_GroupAllocateMemory( alsaApi->allocations, len ), + paInsufficientMemory ); + strncpy( *dst, src, len ); + +error: + return result; +} + +/* Disregard standard plugins + * XXX: Might want to make the "default" plugin available, if we can make it work + */ +static int IgnorePlugin( const char *pluginId ) +{ +#define numIgnored 10 + static const char *ignoredPlugins[numIgnored] = {"hw", "plughw", "plug", "default", "dsnoop", "dmix", "tee", + "file", "null", "shm"}; + int i; + + for( i = 0; i < numIgnored; ++i ) + { + if( !strcmp( pluginId, ignoredPlugins[i] ) ) + { + return 1; + } + } + + return 0; +} + +/* Build PaDeviceInfo list, ignore devices for which we cannot determine capabilities (possibly busy, sigh) */ +static PaError BuildDeviceList( PaAlsaHostApiRepresentation *alsaApi ) +{ + PaUtilHostApiRepresentation *commonApi = &alsaApi->commonHostApiRep; + PaAlsaDeviceInfo *deviceInfoArray; + int cardIdx = -1, devIdx = 0; + snd_ctl_card_info_t *cardInfo; + PaError result = paNoError; + size_t numDeviceNames = 0, maxDeviceNames = 1, i; + DeviceNames *deviceNames = NULL; + snd_config_t *topNode = NULL; + snd_pcm_info_t *pcmInfo; + int res; + int blocking = SND_PCM_NONBLOCK; + char alsaCardName[50]; + if( getenv( "PA_ALSA_INITIALIZE_BLOCK" ) && atoi( getenv( "PA_ALSA_INITIALIZE_BLOCK" ) ) ) + blocking = 0; + + /* These two will be set to the first working input and output device, respectively */ + commonApi->info.defaultInputDevice = paNoDevice; + commonApi->info.defaultOutputDevice = paNoDevice; + + /* count the devices by enumerating all the card numbers */ + + /* snd_card_next() modifies the integer passed to it to be: + * the index of the first card if the parameter is -1 + * the index of the next card if the parameter is the index of a card + * -1 if there are no more cards + * + * The function itself returns 0 if it succeeded. */ + cardIdx = -1; + snd_ctl_card_info_alloca( &cardInfo ); + snd_pcm_info_alloca( &pcmInfo ); + while( snd_card_next( &cardIdx ) == 0 && cardIdx >= 0 ) + { + char *cardName; + int devIdx = -1; + snd_ctl_t *ctl; + char buf[50]; + + snprintf( alsaCardName, sizeof (alsaCardName), "hw:%d", cardIdx ); + + /* Acquire name of card */ + if( snd_ctl_open( &ctl, alsaCardName, 0 ) < 0 ) + continue; /* Unable to open card :( */ + snd_ctl_card_info( ctl, cardInfo ); + + PA_ENSURE( PaAlsa_StrDup( alsaApi, &cardName, snd_ctl_card_info_get_name( cardInfo )) ); + + while( snd_ctl_pcm_next_device( ctl, &devIdx ) == 0 && devIdx >= 0 ) + { + char *alsaDeviceName, *deviceName; + size_t len; + int hasPlayback = 0, hasCapture = 0; + snprintf( buf, sizeof (buf), "%s:%d,%d", "hw", cardIdx, devIdx ); + + /* Obtain info about this particular device */ + snd_pcm_info_set_device( pcmInfo, devIdx ); + snd_pcm_info_set_subdevice( pcmInfo, 0 ); + snd_pcm_info_set_stream( pcmInfo, SND_PCM_STREAM_CAPTURE ); + if( snd_ctl_pcm_info( ctl, pcmInfo ) >= 0 ) + hasCapture = 1; + + snd_pcm_info_set_stream( pcmInfo, SND_PCM_STREAM_PLAYBACK ); + if( snd_ctl_pcm_info( ctl, pcmInfo ) >= 0 ) + hasPlayback = 1; + + if( !hasPlayback && !hasCapture ) + { + continue; /* Error */ + } + + /* The length of the string written by snprintf plus terminating 0 */ + len = snprintf( NULL, 0, "%s: %s (%s)", cardName, snd_pcm_info_get_name( pcmInfo ), buf ) + 1; + PA_UNLESS( deviceName = (char *)PaUtil_GroupAllocateMemory( alsaApi->allocations, len ), + paInsufficientMemory ); + snprintf( deviceName, len, "%s: %s (%s)", cardName, + snd_pcm_info_get_name( pcmInfo ), buf ); + + ++numDeviceNames; + if( !deviceNames || numDeviceNames > maxDeviceNames ) + { + maxDeviceNames *= 2; + PA_UNLESS( deviceNames = (DeviceNames *) realloc( deviceNames, maxDeviceNames * sizeof (DeviceNames) ), + paInsufficientMemory ); + } + + PA_ENSURE( PaAlsa_StrDup( alsaApi, &alsaDeviceName, buf ) ); + + deviceNames[ numDeviceNames - 1 ].alsaName = alsaDeviceName; + deviceNames[ numDeviceNames - 1 ].name = deviceName; + deviceNames[ numDeviceNames - 1 ].isPlug = 0; + deviceNames[ numDeviceNames - 1 ].hasPlayback = hasPlayback; + deviceNames[ numDeviceNames - 1 ].hasCapture = hasCapture; + } + snd_ctl_close( ctl ); + } + + /* Iterate over plugin devices */ + if( NULL == snd_config ) + { + /* snd_config_update is called implicitly by some functions, if this hasn't happened snd_config will be NULL (bleh) */ + ENSURE_( snd_config_update(), paUnanticipatedHostError ); + PA_DEBUG(( "Updating snd_config\n" )); + } + assert( snd_config ); + if( (res = snd_config_search( snd_config, "pcm", &topNode )) >= 0 ) + { + snd_config_iterator_t i, next; + + snd_config_for_each( i, next, topNode ) + { + const char *tpStr = NULL, *idStr = NULL; + char *alsaDeviceName, *deviceName; + snd_config_t *n = snd_config_iterator_entry( i ), *tp = NULL; + if( snd_config_get_type( n ) != SND_CONFIG_TYPE_COMPOUND ) + continue; + + ENSURE_( snd_config_search( n, "type", &tp ), paUnanticipatedHostError ); + ENSURE_( snd_config_get_string( tp, &tpStr ), paUnanticipatedHostError ); + + ENSURE_( snd_config_get_id( n, &idStr ), paUnanticipatedHostError ); + if( IgnorePlugin( idStr ) ) + { + PA_DEBUG(( "%s: Ignoring ALSA plugin device %s of type %s\n", __FUNCTION__, idStr, tpStr )); + continue; + } + + PA_DEBUG(( "%s: Found plugin %s of type %s\n", __FUNCTION__, idStr, tpStr )); + + PA_UNLESS( alsaDeviceName = (char*)PaUtil_GroupAllocateMemory( alsaApi->allocations, + strlen(idStr) + 6 ), paInsufficientMemory ); + strcpy( alsaDeviceName, idStr ); + PA_UNLESS( deviceName = (char*)PaUtil_GroupAllocateMemory( alsaApi->allocations, + strlen(idStr) + 1 ), paInsufficientMemory ); + strcpy( deviceName, idStr ); + + ++numDeviceNames; + if( !deviceNames || numDeviceNames > maxDeviceNames ) + { + maxDeviceNames *= 2; + PA_UNLESS( deviceNames = (DeviceNames *) realloc( deviceNames, maxDeviceNames * sizeof (DeviceNames) ), + paInsufficientMemory ); + } + + deviceNames[numDeviceNames - 1].alsaName = alsaDeviceName; + deviceNames[numDeviceNames - 1].name = deviceName; + deviceNames[numDeviceNames - 1].isPlug = 1; + deviceNames[numDeviceNames - 1].hasPlayback = 1; + deviceNames[numDeviceNames - 1].hasCapture = 1; + } + } + else + PA_DEBUG(( "%s: Iterating over ALSA plugins failed: %s\n", __FUNCTION__, snd_strerror( res ) )); + + /* allocate deviceInfo memory based on the number of devices */ + PA_UNLESS( commonApi->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + alsaApi->allocations, sizeof(PaDeviceInfo*) * (numDeviceNames) ), paInsufficientMemory ); + + /* allocate all device info structs in a contiguous block */ + PA_UNLESS( deviceInfoArray = (PaAlsaDeviceInfo*)PaUtil_GroupAllocateMemory( + alsaApi->allocations, sizeof(PaAlsaDeviceInfo) * numDeviceNames ), paInsufficientMemory ); + + /* Loop over list of cards, filling in info, if a device is deemed unavailable (can't get name), + * it's ignored. + */ + /* while( snd_card_next( &cardIdx ) == 0 && cardIdx >= 0 ) */ + for( i = 0, devIdx = 0; i < numDeviceNames; ++i ) + { + snd_pcm_t *pcm; + PaAlsaDeviceInfo *deviceInfo = &deviceInfoArray[devIdx]; + PaDeviceInfo *commonDeviceInfo = &deviceInfo->commonDeviceInfo; + + /* Zero fields */ + InitializeDeviceInfo( commonDeviceInfo ); + + /* to determine device capabilities, we must open the device and query the + * hardware parameter configuration space */ + + /* Query capture */ + if( deviceNames[i].hasCapture && + snd_pcm_open( &pcm, deviceNames[i].alsaName, SND_PCM_STREAM_CAPTURE, blocking ) >= 0 ) + { + if( GropeDevice( pcm, &deviceInfo->minInputChannels, &commonDeviceInfo->maxInputChannels, + &commonDeviceInfo->defaultLowInputLatency, &commonDeviceInfo->defaultHighInputLatency, + &commonDeviceInfo->defaultSampleRate, deviceNames[i].isPlug ) != paNoError ) + continue; /* Error */ + } + + /* Query playback */ + if( deviceNames[i].hasPlayback && + snd_pcm_open( &pcm, deviceNames[i].alsaName, SND_PCM_STREAM_PLAYBACK, blocking ) >= 0 ) + { + if( GropeDevice( pcm, &deviceInfo->minOutputChannels, &commonDeviceInfo->maxOutputChannels, + &commonDeviceInfo->defaultLowOutputLatency, &commonDeviceInfo->defaultHighOutputLatency, + &commonDeviceInfo->defaultSampleRate, deviceNames[i].isPlug ) != paNoError ) + continue; /* Error */ + } + + commonDeviceInfo->structVersion = 2; + commonDeviceInfo->hostApi = alsaApi->hostApiIndex; + commonDeviceInfo->name = deviceNames[i].name; + deviceInfo->alsaName = deviceNames[i].alsaName; + deviceInfo->isPlug = deviceNames[i].isPlug; + + /* A: Storing pointer to PaAlsaDeviceInfo object as pointer to PaDeviceInfo object. + * Should now be safe to add device info, unless the device supports neither capture nor playback + */ + if( commonDeviceInfo->maxInputChannels > 0 || commonDeviceInfo->maxOutputChannels > 0 ) + { + if( commonApi->info.defaultInputDevice == paNoDevice && commonDeviceInfo->maxInputChannels > 0 ) + commonApi->info.defaultInputDevice = devIdx; + if( commonApi->info.defaultOutputDevice == paNoDevice && commonDeviceInfo->maxOutputChannels > 0 ) + commonApi->info.defaultOutputDevice = devIdx; + + commonApi->deviceInfos[devIdx++] = (PaDeviceInfo *) deviceInfo; + } + } + free( deviceNames ); + + commonApi->info.deviceCount = devIdx; /* Number of successfully queried devices */ + +end: + return result; + +error: + /* No particular action */ + goto end; +} + +/* Check against known device capabilities */ +static PaError ValidateParameters( const PaStreamParameters *parameters, PaUtilHostApiRepresentation *hostApi, StreamDirection mode ) +{ + PaError result = paNoError; + int maxChans; + const PaAlsaDeviceInfo *deviceInfo = NULL; + assert( parameters ); + + if( parameters->device != paUseHostApiSpecificDeviceSpecification ) + { + assert( parameters->device < hostApi->info.deviceCount ); + PA_UNLESS( parameters->hostApiSpecificStreamInfo == NULL, paBadIODeviceCombination ); + deviceInfo = GetDeviceInfo( hostApi, parameters->device ); + } + else + { + const PaAlsaStreamInfo *streamInfo = parameters->hostApiSpecificStreamInfo; + + PA_UNLESS( parameters->device == paUseHostApiSpecificDeviceSpecification, paInvalidDevice ); + PA_UNLESS( streamInfo->size == sizeof (PaAlsaStreamInfo) && streamInfo->version == 1, + paIncompatibleHostApiSpecificStreamInfo ); + PA_UNLESS( streamInfo->deviceString != NULL, paInvalidDevice ); + + /* Skip further checking */ + return paNoError; + } + + assert( deviceInfo ); + assert( parameters->hostApiSpecificStreamInfo == NULL ); + maxChans = (StreamDirection_In == mode ? deviceInfo->commonDeviceInfo.maxInputChannels : + deviceInfo->commonDeviceInfo.maxOutputChannels); + PA_UNLESS( parameters->channelCount <= maxChans, paInvalidChannelCount ); + +error: + return result; +} + +/* Given an open stream, what sample formats are available? */ +static PaSampleFormat GetAvailableFormats( snd_pcm_t *pcm ) +{ + PaSampleFormat available = 0; + snd_pcm_hw_params_t *hwParams; + snd_pcm_hw_params_alloca( &hwParams ); + + snd_pcm_hw_params_any( pcm, hwParams ); + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_FLOAT ) >= 0) + available |= paFloat32; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_S32 ) >= 0) + available |= paInt32; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_S24 ) >= 0) + available |= paInt24; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_S16 ) >= 0) + available |= paInt16; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_U8 ) >= 0) + available |= paUInt8; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_S8 ) >= 0) + available |= paInt8; + + return available; +} + +static snd_pcm_format_t Pa2AlsaFormat( PaSampleFormat paFormat ) +{ + switch( paFormat ) + { + case paFloat32: + return SND_PCM_FORMAT_FLOAT; + + case paInt16: + return SND_PCM_FORMAT_S16; + + case paInt24: + return SND_PCM_FORMAT_S24; + + case paInt32: + return SND_PCM_FORMAT_S32; + + case paInt8: + return SND_PCM_FORMAT_S8; + + case paUInt8: + return SND_PCM_FORMAT_U8; + + default: + return SND_PCM_FORMAT_UNKNOWN; + } +} + +/** Open an ALSA pcm handle. + * + * The device to be open can be specified in a custom PaAlsaStreamInfo struct, or it will be a device number. In case of a + * device number, it maybe specified through an env variable (PA_ALSA_PLUGHW) that we should open the corresponding plugin + * device. + */ +static PaError AlsaOpen( const PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *params, StreamDirection + streamDir, snd_pcm_t **pcm ) +{ + PaError result = paNoError; + int ret; + const char *deviceName = alloca( 50 ); + const PaAlsaDeviceInfo *deviceInfo = NULL; + PaAlsaStreamInfo *streamInfo = (PaAlsaStreamInfo *)params->hostApiSpecificStreamInfo; + + if( !streamInfo ) + { + int usePlug = 0; + deviceInfo = GetDeviceInfo( hostApi, params->device ); + + /* If device name starts with hw: and PA_ALSA_PLUGHW is 1, we open the plughw device instead */ + if( !strncmp( "hw:", deviceInfo->alsaName, 3 ) && getenv( "PA_ALSA_PLUGHW" ) ) + usePlug = atoi( getenv( "PA_ALSA_PLUGHW" ) ); + if( usePlug ) + snprintf( (char *) deviceName, 50, "plug%s", deviceInfo->alsaName ); + else + deviceName = deviceInfo->alsaName; + } + else + deviceName = streamInfo->deviceString; + + PA_DEBUG(( "%s: Opening device %s\n", __FUNCTION__, deviceName )); + if( (ret = snd_pcm_open( pcm, deviceName, streamDir == StreamDirection_In ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK, + SND_PCM_NONBLOCK )) < 0 ) + { + /* Not to be closed */ + *pcm = NULL; + ENSURE_( ret, ret == -EBUSY ? paDeviceUnavailable : paBadIODeviceCombination ); + } + ENSURE_( snd_pcm_nonblock( *pcm, 0 ), paUnanticipatedHostError ); + +end: + return result; + +error: + goto end; +} + +static PaError TestParameters( const PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *parameters, + double sampleRate, StreamDirection streamDir ) +{ + PaError result = paNoError; + snd_pcm_t *pcm = NULL; + PaSampleFormat availableFormats; + /* We are able to adapt to a number of channels less than what the device supports */ + unsigned int numHostChannels; + PaSampleFormat hostFormat; + snd_pcm_hw_params_t *hwParams; + snd_pcm_hw_params_alloca( &hwParams ); + + if( !parameters->hostApiSpecificStreamInfo ) + { + const PaAlsaDeviceInfo *devInfo = GetDeviceInfo( hostApi, parameters->device ); + numHostChannels = PA_MAX( parameters->channelCount, StreamDirection_In == streamDir ? + devInfo->minInputChannels : devInfo->minOutputChannels ); + } + else + numHostChannels = parameters->channelCount; + + PA_ENSURE( AlsaOpen( hostApi, parameters, streamDir, &pcm ) ); + + snd_pcm_hw_params_any( pcm, hwParams ); + + if( SetApproximateSampleRate( pcm, hwParams, sampleRate ) < 0 ) + { + result = paInvalidSampleRate; + goto error; + } + + if( snd_pcm_hw_params_set_channels( pcm, hwParams, numHostChannels ) < 0 ) + { + result = paInvalidChannelCount; + goto error; + } + + /* See if we can find a best possible match */ + availableFormats = GetAvailableFormats( pcm ); + PA_ENSURE( hostFormat = PaUtil_SelectClosestAvailableFormat( availableFormats, parameters->sampleFormat ) ); + ENSURE_( snd_pcm_hw_params_set_format( pcm, hwParams, Pa2AlsaFormat( hostFormat ) ), paUnanticipatedHostError ); + + { + /* It happens that this call fails because the device is busy */ + int ret = 0; + if( (ret = snd_pcm_hw_params( pcm, hwParams )) < 0) + { + ENSURE_( ret, ret == -EBUSY ? paDeviceUnavailable : paUnanticipatedHostError ); + } + } + +end: + if( pcm ) + { + snd_pcm_close( pcm ); + } + return result; + +error: + goto end; +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount = 0, outputChannelCount = 0; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaError result = paFormatIsSupported; + + if( inputParameters ) + { + PA_ENSURE( ValidateParameters( inputParameters, hostApi, StreamDirection_In ) ); + + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + } + + if( outputParameters ) + { + PA_ENSURE( ValidateParameters( outputParameters, hostApi, StreamDirection_Out ) ); + + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + } + + if( inputChannelCount ) + { + if( (result = TestParameters( hostApi, inputParameters, sampleRate, StreamDirection_In )) + != paNoError ) + goto error; + } + if ( outputChannelCount ) + { + if( (result = TestParameters( hostApi, outputParameters, sampleRate, StreamDirection_Out )) + != paNoError ) + goto error; + } + + return paFormatIsSupported; + +error: + return result; +} + +static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, PaAlsaHostApiRepresentation *alsaApi, + const PaStreamParameters *params, StreamDirection streamDir, int callbackMode ) +{ + PaError result = paNoError; + PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat; + assert( params->channelCount > 0 ); + + /* Make sure things have an initial value */ + memset( self, 0, sizeof (PaAlsaStreamComponent) ); + + if( NULL == params->hostApiSpecificStreamInfo ) + { + const PaAlsaDeviceInfo *devInfo = GetDeviceInfo( &alsaApi->commonHostApiRep, params->device ); + self->numHostChannels = PA_MAX( params->channelCount, StreamDirection_In == streamDir ? devInfo->minInputChannels + : devInfo->minOutputChannels ); + } + else + { + /* We're blissfully unaware of the minimum channelCount */ + self->numHostChannels = params->channelCount; + } + + PA_ENSURE( AlsaOpen( &alsaApi->commonHostApiRep, params, streamDir, &self->pcm ) ); + self->nfds = snd_pcm_poll_descriptors_count( self->pcm ); + hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ); + + self->hostSampleFormat = hostSampleFormat; + self->nativeFormat = Pa2AlsaFormat( hostSampleFormat ); + self->hostInterleaved = self->userInterleaved = !(userSampleFormat & paNonInterleaved); + self->numUserChannels = params->channelCount; + self->streamDir = streamDir; + + if( !callbackMode && !self->userInterleaved ) + { + /* Pre-allocate non-interleaved user provided buffers */ + PA_UNLESS( self->userBuffers = PaUtil_AllocateMemory( sizeof (void *) * self->numUserChannels ), + paInsufficientMemory ); + } + +error: + return result; +} + +static void PaAlsaStreamComponent_Terminate( PaAlsaStreamComponent *self ) +{ + snd_pcm_close( self->pcm ); + if( self->userBuffers ) + PaUtil_FreeMemory( self->userBuffers ); +} + +int nearbyint_(float value) { + if( value - (int)value > .5 ) + return (int)ceil( value ); + return (int)floor( value ); +} + +/** Initiate configuration, preparing for determining a period size suitable for both capture and playback components. + * + */ +static PaError PaAlsaStreamComponent_InitialConfigure( PaAlsaStreamComponent *self, const PaStreamParameters *params, + int primeBuffers, snd_pcm_hw_params_t *hwParams, double *sampleRate ) +{ + /* Configuration consists of setting all of ALSA's parameters. + * These parameters come in two flavors: hardware parameters + * and software paramters. Hardware parameters will affect + * the way the device is initialized, software parameters + * affect the way ALSA interacts with me, the user-level client. + */ + + PaError result = paNoError; + snd_pcm_access_t accessMode, alternateAccessMode; + int dir = 0; + snd_pcm_t *pcm = self->pcm; + double sr = *sampleRate; + unsigned int minPeriods = 2; + + /* self->framesPerBuffer = framesPerHostBuffer; */ + + /* ... fill up the configuration space with all possibile + * combinations of parameters this device will accept */ + ENSURE_( snd_pcm_hw_params_any( pcm, hwParams ), paUnanticipatedHostError ); + + ENSURE_( snd_pcm_hw_params_set_periods_integer( pcm, hwParams ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_set_period_size_integer( pcm, hwParams ), paUnanticipatedHostError ); + /* I think there should be at least 2 periods (even though ALSA doesn't appear to enforce this) */ + dir = 0; + ENSURE_( snd_pcm_hw_params_set_periods_min( pcm, hwParams, &minPeriods, &dir ), paUnanticipatedHostError ); + + if( self->userInterleaved ) + { + accessMode = SND_PCM_ACCESS_MMAP_INTERLEAVED; + alternateAccessMode = SND_PCM_ACCESS_MMAP_NONINTERLEAVED; + } + else + { + accessMode = SND_PCM_ACCESS_MMAP_NONINTERLEAVED; + alternateAccessMode = SND_PCM_ACCESS_MMAP_INTERLEAVED; + } + /* If requested access mode fails, try alternate mode */ + if( snd_pcm_hw_params_set_access( pcm, hwParams, accessMode ) < 0 ) + { + ENSURE_( snd_pcm_hw_params_set_access( pcm, hwParams, alternateAccessMode ), paUnanticipatedHostError ); + /* Flip mode */ + self->hostInterleaved = !self->userInterleaved; + } + + ENSURE_( snd_pcm_hw_params_set_format( pcm, hwParams, self->nativeFormat ), paUnanticipatedHostError ); + + ENSURE_( SetApproximateSampleRate( pcm, hwParams, sr ), paInvalidSampleRate ); + ENSURE_( GetExactSampleRate( hwParams, &sr ), paUnanticipatedHostError ); + /* reject if there's no sample rate within 1% of the one requested */ + if( (fabs( *sampleRate - sr ) / *sampleRate) > 0.01 ) + { + PA_DEBUG(("%s: Wanted %f, closest sample rate was %d\n", __FUNCTION__, sampleRate, sr )); + PA_ENSURE( paInvalidSampleRate ); + } + + ENSURE_( snd_pcm_hw_params_set_channels( pcm, hwParams, self->numHostChannels ), paInvalidChannelCount ); + + *sampleRate = sr; + +end: + return result; + +error: + /* No particular action */ + goto end; +} + +static PaError PaAlsaStreamComponent_FinishConfigure( PaAlsaStreamComponent *self, snd_pcm_hw_params_t* hwParams, + const PaStreamParameters *params, int primeBuffers, double sampleRate, PaTime* returnedLatency ) +{ + PaError result = paNoError; + snd_pcm_sw_params_t* swParams; + snd_pcm_uframes_t bufSz = 0; + *returnedLatency = -1.; + + snd_pcm_sw_params_alloca( &swParams ); + + bufSz = (params->suggestedLatency * sampleRate) + self->framesPerBuffer; /* One period does not count as latency */ + ENSURE_( snd_pcm_hw_params_set_buffer_size_near( self->pcm, hwParams, &bufSz ), paUnanticipatedHostError ); + + /* Set the parameters! */ + ENSURE_( snd_pcm_hw_params( self->pcm, hwParams ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_get_buffer_size( hwParams, &self->bufferSize ), paUnanticipatedHostError ); + /* Latency in seconds, one period is not counted as latency */ + *returnedLatency = (self->bufferSize - self->framesPerBuffer) / sampleRate; + + /* Now software parameters... */ + ENSURE_( snd_pcm_sw_params_current( self->pcm, swParams ), paUnanticipatedHostError ); + + ENSURE_( snd_pcm_sw_params_set_start_threshold( self->pcm, swParams, self->framesPerBuffer ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_stop_threshold( self->pcm, swParams, self->bufferSize ), paUnanticipatedHostError ); + + /* Silence buffer in the case of underrun */ + if( !primeBuffers ) /* XXX: Make sense? */ + { + snd_pcm_uframes_t boundary; + ENSURE_( snd_pcm_sw_params_get_boundary( swParams, &boundary ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_silence_threshold( self->pcm, swParams, 0 ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_silence_size( self->pcm, swParams, boundary ), paUnanticipatedHostError ); + } + + ENSURE_( snd_pcm_sw_params_set_avail_min( self->pcm, swParams, self->framesPerBuffer ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_xfer_align( self->pcm, swParams, 1 ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_tstamp_mode( self->pcm, swParams, SND_PCM_TSTAMP_MMAP ), paUnanticipatedHostError ); + + /* Set the parameters! */ + ENSURE_( snd_pcm_sw_params( self->pcm, swParams ), paUnanticipatedHostError ); + +error: + return result; +} + +static PaError PaAlsaStream_Initialize( PaAlsaStream *self, PaAlsaHostApiRepresentation *alsaApi, const PaStreamParameters *inParams, + const PaStreamParameters *outParams, double sampleRate, unsigned long framesPerUserBuffer, PaStreamCallback callback, + PaStreamFlags streamFlags, void *userData ) +{ + PaError result = paNoError; + assert( self ); + + memset( self, 0, sizeof (PaAlsaStream) ); + + if( NULL != callback ) + { + PaUtil_InitializeStreamRepresentation( &self->streamRepresentation, + &alsaApi->callbackStreamInterface, + callback, userData ); + self->callbackMode = 1; + } + else + { + PaUtil_InitializeStreamRepresentation( &self->streamRepresentation, + &alsaApi->blockingStreamInterface, + NULL, userData ); + } + + self->framesPerUserBuffer = framesPerUserBuffer; + self->neverDropInput = streamFlags & paNeverDropInput; + /* XXX: Ignore paPrimeOutputBuffersUsingStreamCallback untill buffer priming is fully supported in pa_process.c */ + /* + if( outParams & streamFlags & paPrimeOutputBuffersUsingStreamCallback ) + self->primeBuffers = 1; + */ + memset( &self->capture, 0, sizeof (PaAlsaStreamComponent) ); + memset( &self->playback, 0, sizeof (PaAlsaStreamComponent) ); + if( inParams ) + PA_ENSURE( PaAlsaStreamComponent_Initialize( &self->capture, alsaApi, inParams, StreamDirection_In, NULL != callback ) ); + if( outParams ) + PA_ENSURE( PaAlsaStreamComponent_Initialize( &self->playback, alsaApi, outParams, StreamDirection_Out, NULL != callback ) ); + + assert( self->capture.nfds || self->playback.nfds ); + + PA_UNLESS( self->pfds = (struct pollfd*)PaUtil_AllocateMemory( (self->capture.nfds + + self->playback.nfds) * sizeof (struct pollfd) ), paInsufficientMemory ); + + PaUtil_InitializeCpuLoadMeasurer( &self->cpuLoadMeasurer, sampleRate ); + InitializeThreading( &self->threading, &self->cpuLoadMeasurer ); + ASSERT_CALL_( pthread_mutex_init( &self->stateMtx, NULL ), 0 ); + ASSERT_CALL_( pthread_mutex_init( &self->startMtx, NULL ), 0 ); + ASSERT_CALL_( pthread_cond_init( &self->startCond, NULL ), 0 ); + +error: + return result; +} + +/** Free resources associated with stream, and eventually stream itself. + * + * Frees allocated memory, and terminates individual StreamComponents. + */ +static void PaAlsaStream_Terminate( PaAlsaStream *self ) +{ + assert( self ); + + if( self->capture.pcm ) + { + PaAlsaStreamComponent_Terminate( &self->capture ); + } + if( self->playback.pcm ) + { + PaAlsaStreamComponent_Terminate( &self->playback ); + } + + PaUtil_FreeMemory( self->pfds ); + ASSERT_CALL_( pthread_mutex_destroy( &self->stateMtx ), 0 ); + ASSERT_CALL_( pthread_mutex_destroy( &self->startMtx ), 0 ); + ASSERT_CALL_( pthread_cond_destroy( &self->startCond ), 0 ); + + PaUtil_FreeMemory( self ); +} + +/** Calculate polling timeout + * + * @param frames Time to wait + * @return Polling timeout in milliseconds + */ +static int CalculatePollTimeout( const PaAlsaStream *stream, unsigned long frames ) +{ + assert( stream->streamRepresentation.streamInfo.sampleRate > 0.0 ); + /* Period in msecs, rounded up */ + return (int)ceil( 1000 * frames / stream->streamRepresentation.streamInfo.sampleRate ); +} + +static PaError PaAlsaStreamComponent_DetermineFramesPerBuffer( PaAlsaStreamComponent* self, const PaStreamParameters* params, + unsigned long framesPerUserBuffer, double sampleRate, snd_pcm_hw_params_t* hwParams ) +{ + PaError result = paNoError; + unsigned long bufferSize = params->suggestedLatency * sampleRate, framesPerHostBuffer; + int dir = 0; + + { + snd_pcm_uframes_t tmp; + snd_pcm_hw_params_get_buffer_size_min(hwParams, &tmp); + bufferSize = PA_MAX(bufferSize, tmp); + snd_pcm_hw_params_get_buffer_size_max(hwParams, &tmp); + bufferSize = PA_MIN(bufferSize, tmp); + } + + assert(bufferSize > 0); + + if( framesPerUserBuffer != paFramesPerBufferUnspecified ) + { + /* Preferably the host buffer size should be a multiple of the user buffer size */ + + if( bufferSize > framesPerUserBuffer ) + { + snd_pcm_uframes_t remainder = bufferSize % framesPerUserBuffer; + if( remainder > framesPerUserBuffer / 2. ) + bufferSize += framesPerUserBuffer - remainder; + else + bufferSize -= remainder; + + assert( bufferSize % framesPerUserBuffer == 0 ); + } + else if( framesPerUserBuffer % bufferSize != 0 ) + { + /* Find a good compromise between user specified latency and buffer size */ + if( bufferSize > framesPerUserBuffer * .75 ) + { + bufferSize = framesPerUserBuffer; + } + else + { + snd_pcm_uframes_t newSz = framesPerUserBuffer; + while( newSz / 2 >= bufferSize ) + { + if( framesPerUserBuffer % (newSz / 2) != 0 ) + { + /* No use dividing any further */ + break; + } + newSz /= 2; + } + bufferSize = newSz; + } + + assert( framesPerUserBuffer % bufferSize == 0 ); + } + } + + /* Using 5 as a base number of periods, we try to approximate the suggested latency (+1 period), + finding a combination of period/buffer size which best fits these constraints */ + { + unsigned numPeriods = 4, maxPeriods = 0; + /* It may be that the device only supports 2 periods for instance */ + dir = 0; + ENSURE_( snd_pcm_hw_params_get_periods_max( hwParams, &maxPeriods, &dir ), paUnanticipatedHostError ); + assert( maxPeriods > 1 ); + /* One period is not counted as latency */ + maxPeriods -= 1; + numPeriods = PA_MIN( maxPeriods, numPeriods ); + + if( framesPerUserBuffer != paFramesPerBufferUnspecified ) + { + framesPerHostBuffer = framesPerUserBuffer; + if( framesPerHostBuffer < bufferSize ) + { + while( bufferSize / framesPerHostBuffer > numPeriods ) + { + framesPerHostBuffer *= 2; + } + } + else + { + while( bufferSize / framesPerHostBuffer < numPeriods ) + { + if( framesPerUserBuffer % (framesPerHostBuffer / 2) != 0 ) + { + /* Can't be divided any further */ + break; + } + framesPerHostBuffer /= 2; + } + } + + if( framesPerHostBuffer < framesPerUserBuffer ) + { + assert( framesPerUserBuffer % framesPerHostBuffer == 0 ); + if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer, 0 ) < 0 ) + { + if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer * 2, 0 ) == 0 ) + framesPerHostBuffer *= 2; + else if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer / 2, 0 ) == 0 ) + framesPerHostBuffer /= 2; + } + } + else + { + assert( framesPerHostBuffer % framesPerUserBuffer == 0 ); + if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer, 0 ) < 0 ) + { + if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer + framesPerUserBuffer, 0 ) == 0 ) + framesPerHostBuffer += framesPerUserBuffer; + else if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer - framesPerUserBuffer, 0 ) == 0 ) + framesPerHostBuffer -= framesPerUserBuffer; + } + } + } + else + { + framesPerHostBuffer = bufferSize / numPeriods; + } + } + + assert( framesPerHostBuffer > 0 ); + dir = 0; + ENSURE_( snd_pcm_hw_params_set_period_size_near( self->pcm, hwParams, &framesPerHostBuffer, &dir ), paUnanticipatedHostError ); + self->framesPerBuffer = framesPerHostBuffer; + +error: + return result; +} + +/* We need to determine how many frames per host buffer (period) to use. Our + * goals are to provide the best possible performance, but also to + * honor the requested latency settings as closely as we can. Therefore this + * decision is based on: + * + * - the period sizes that playback and/or capture support. The + * host buffer size has to be one of these. + * - the number of periods that playback and/or capture support. + * + * We want to make period_size*(num_periods-1) to be as close as possible + * to latency*rate for both playback and capture. + * + * This method will determine suitable period sizes for capture and playback handles, and report the maximum number of + * frames per host buffer. The latter is relevant, in case we should be so unfortunate that the period size differs + * between capture and playback. If this should happen, the stream's hostBufferSizeMode attribute will be set to + * paUtilBoundedHostBufferSize, because the best we can do is limit the size of individual host buffers to the upper + * bound. The size of host buffers scheduled for processing should only matter if the user has specified a buffer size, + * but when he/she does we must strive for an optimal configuration. By default we'll opt for a fixed host buffer size, + * which should be fine if the period size is the same for capture and playback. In general, if there is a specified user + * buffer size, this method tries it best to determine a period size which is a multiple of the user buffer size. + * + * The framesPerBuffer attributes of the individual capture and playback components of the stream are set to corresponding + * values determined here. Since these should be reported as + * + * This is one of those blocks of code that will just take a lot of + * refinement to be any good. + * + * In the full-duplex case it is possible that the routine was unable + * to find a number of frames per buffer acceptable to both devices + * TODO: Implement an algorithm to find the value closest to acceptance + * by both devices, to minimize difference between period sizes? + */ +static PaError PaAlsaStream_DetermineFramesPerBuffer( PaAlsaStream* self, double sampleRate, const PaStreamParameters* inputParameters, + const PaStreamParameters* outputParameters, unsigned long framesPerUserBuffer, snd_pcm_hw_params_t* hwParamsCapture, + snd_pcm_hw_params_t* hwParamsPlayback, PaUtilHostBufferSizeMode* hostBufferSizeMode ) +{ + PaError result = paNoError; + unsigned long framesPerHostBuffer = 0; + int dir = 0; + + if( self->capture.pcm && self->playback.pcm ) + { + if( framesPerUserBuffer == paFramesPerBufferUnspecified ) + { + snd_pcm_uframes_t desiredLatency, e, minPeriodSize, maxPeriodSize, optimalPeriodSize, periodSize, + minCapture, minPlayback, maxCapture, maxPlayback; + + /* Come up with a common desired latency */ + + dir = 0; + ENSURE_( snd_pcm_hw_params_get_period_size_min( hwParamsCapture, &minCapture, &dir ), paUnanticipatedHostError ); + dir = 0; + ENSURE_( snd_pcm_hw_params_get_period_size_min( hwParamsPlayback, &minPlayback, &dir ), paUnanticipatedHostError ); + dir = 0; + ENSURE_( snd_pcm_hw_params_get_period_size_max( hwParamsCapture, &maxCapture, &dir ), paUnanticipatedHostError ); + dir = 0; + ENSURE_( snd_pcm_hw_params_get_period_size_max( hwParamsPlayback, &maxPlayback, &dir ), paUnanticipatedHostError ); + minPeriodSize = PA_MAX( minPlayback, minCapture ); + maxPeriodSize = PA_MIN( maxPlayback, maxCapture ); + PA_UNLESS( minPeriodSize <= maxPeriodSize, paBadIODeviceCombination ); + + desiredLatency = (snd_pcm_uframes_t)(PA_MIN( outputParameters->suggestedLatency, inputParameters->suggestedLatency ) + * sampleRate); + /* Clamp desiredLatency */ + { + snd_pcm_uframes_t maxBufferSize; + snd_pcm_uframes_t maxBufferSizeCapture, maxBufferSizePlayback; + ENSURE_( snd_pcm_hw_params_get_buffer_size_max( hwParamsCapture, &maxBufferSizeCapture ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_get_buffer_size_max( hwParamsPlayback, &maxBufferSizePlayback ), paUnanticipatedHostError ); + maxBufferSize = PA_MIN( maxBufferSizeCapture, maxBufferSizePlayback ); + + desiredLatency = PA_MIN( desiredLatency, maxBufferSize ); + } + + /* Find the closest power of 2 */ + e = ilogb( minPeriodSize ); + if( minPeriodSize & (minPeriodSize - 1) ) + e += 1; + periodSize = (snd_pcm_uframes_t)pow( 2, e ); + + while( periodSize <= maxPeriodSize ) + { + if( snd_pcm_hw_params_test_period_size( self->playback.pcm, hwParamsPlayback, periodSize, 0 ) >= 0 && + snd_pcm_hw_params_test_period_size( self->capture.pcm, hwParamsCapture, periodSize, 0 ) >= 0 ) + break; /* Ok! */ + + periodSize *= 2; + } + + /* 4 periods considered optimal */ + optimalPeriodSize = PA_MAX( desiredLatency / 4, minPeriodSize ); + optimalPeriodSize = PA_MIN( optimalPeriodSize, maxPeriodSize ); + + /* Find the closest power of 2 */ + e = ilogb( optimalPeriodSize ); + if( optimalPeriodSize & (optimalPeriodSize - 1) ) + e += 1; + optimalPeriodSize = (snd_pcm_uframes_t)pow( 2, e ); + + while( optimalPeriodSize >= periodSize ) + { + if( snd_pcm_hw_params_test_period_size( self->capture.pcm, hwParamsCapture, optimalPeriodSize, 0 ) < 0 ) + continue; + if( snd_pcm_hw_params_test_period_size( self->playback.pcm, hwParamsPlayback, optimalPeriodSize, 0 ) >= 0 ) + break; + optimalPeriodSize /= 2; + } + if( optimalPeriodSize > periodSize ) + periodSize = optimalPeriodSize; + + if( periodSize <= maxPeriodSize ) + { + /* Looks good, the periodSize _should_ be acceptable by both devices */ + ENSURE_( snd_pcm_hw_params_set_period_size( self->capture.pcm, hwParamsCapture, periodSize, 0 ), + paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_set_period_size( self->playback.pcm, hwParamsPlayback, periodSize, 0 ), + paUnanticipatedHostError ); + self->capture.framesPerBuffer = self->playback.framesPerBuffer = periodSize; + framesPerHostBuffer = periodSize; + } + else + { + /* Unable to find a common period size, oh well */ + optimalPeriodSize = PA_MAX( desiredLatency / 4, minPeriodSize ); + optimalPeriodSize = PA_MIN( optimalPeriodSize, maxPeriodSize ); + + self->capture.framesPerBuffer = optimalPeriodSize; + dir = 0; + ENSURE_( snd_pcm_hw_params_set_period_size_near( self->capture.pcm, hwParamsCapture, &self->capture.framesPerBuffer, &dir ), + paUnanticipatedHostError ); + self->playback.framesPerBuffer = optimalPeriodSize; + dir = 0; + ENSURE_( snd_pcm_hw_params_set_period_size_near( self->playback.pcm, hwParamsPlayback, &self->playback.framesPerBuffer, &dir ), + paUnanticipatedHostError ); + framesPerHostBuffer = PA_MAX( self->capture.framesPerBuffer, self->playback.framesPerBuffer ); + *hostBufferSizeMode = paUtilBoundedHostBufferSize; + } + } + else + { + /* We choose the simple route and determine a suitable number of frames per buffer for one component of + * the stream, then we hope that this will work for the other component too (it should!). + */ + + unsigned maxPeriods = 0; + PaAlsaStreamComponent* first = &self->capture, * second = &self->playback; + const PaStreamParameters* firstStreamParams = inputParameters; + snd_pcm_hw_params_t* firstHwParams = hwParamsCapture, * secondHwParams = hwParamsPlayback; + + dir = 0; + ENSURE_( snd_pcm_hw_params_get_periods_max( hwParamsPlayback, &maxPeriods, &dir ), paUnanticipatedHostError ); + if( maxPeriods < 4 ) + { + /* The playback component is tricker to get right, try that first */ + first = &self->playback; + second = &self->capture; + firstStreamParams = outputParameters; + firstHwParams = hwParamsPlayback; + secondHwParams = hwParamsCapture; + } + + PA_ENSURE( PaAlsaStreamComponent_DetermineFramesPerBuffer( first, firstStreamParams, framesPerUserBuffer, + sampleRate, firstHwParams ) ); + + second->framesPerBuffer = first->framesPerBuffer; + dir = 0; + ENSURE_( snd_pcm_hw_params_set_period_size_near( second->pcm, secondHwParams, &second->framesPerBuffer, &dir ), + paUnanticipatedHostError ); + if( self->capture.framesPerBuffer == self->playback.framesPerBuffer ) + { + framesPerHostBuffer = self->capture.framesPerBuffer; + } + else + { + framesPerHostBuffer = PA_MAX( self->capture.framesPerBuffer, self->playback.framesPerBuffer ); + *hostBufferSizeMode = paUtilBoundedHostBufferSize; + } + } + } + else /* half-duplex is a slightly simpler case */ + { + if( self->capture.pcm ) + { + PA_ENSURE( PaAlsaStreamComponent_DetermineFramesPerBuffer( &self->capture, inputParameters, framesPerUserBuffer, + sampleRate, hwParamsCapture) ); + framesPerHostBuffer = self->capture.framesPerBuffer; + } + else + { + assert( self->playback.pcm ); + PA_ENSURE( PaAlsaStreamComponent_DetermineFramesPerBuffer( &self->playback, outputParameters, framesPerUserBuffer, + sampleRate, hwParamsPlayback ) ); + framesPerHostBuffer = self->playback.framesPerBuffer; + } + } + + PA_UNLESS( framesPerHostBuffer != 0, paInternalError ); + self->maxFramesPerHostBuffer = framesPerHostBuffer; + +error: + return result; +} + +/** Set up ALSA stream parameters. + * + */ +static PaError PaAlsaStream_Configure( PaAlsaStream *self, const PaStreamParameters *inParams, const PaStreamParameters* + outParams, double sampleRate, unsigned long framesPerUserBuffer, double* inputLatency, double* outputLatency, + PaUtilHostBufferSizeMode* hostBufferSizeMode ) +{ + PaError result = paNoError; + double realSr = sampleRate; + snd_pcm_hw_params_t* hwParamsCapture, * hwParamsPlayback; + + snd_pcm_hw_params_alloca( &hwParamsCapture ); + snd_pcm_hw_params_alloca( &hwParamsPlayback ); + + if( self->capture.pcm ) + PA_ENSURE( PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, + &realSr ) ); + if( self->playback.pcm ) + PA_ENSURE( PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, + &realSr ) ); + + PA_ENSURE( PaAlsaStream_DetermineFramesPerBuffer( self, realSr, inParams, outParams, framesPerUserBuffer, + hwParamsCapture, hwParamsPlayback, hostBufferSizeMode ) ); + + if( self->capture.pcm ) + { + assert( self->capture.framesPerBuffer != 0 ); + PA_ENSURE( PaAlsaStreamComponent_FinishConfigure( &self->capture, hwParamsCapture, inParams, self->primeBuffers, realSr, + inputLatency ) ); + PA_DEBUG(( "%s: Capture period size: %lu, latency: %f\n", __FUNCTION__, self->capture.framesPerBuffer, *inputLatency )); + } + if( self->playback.pcm ) + { + assert( self->playback.framesPerBuffer != 0 ); + PA_ENSURE( PaAlsaStreamComponent_FinishConfigure( &self->playback, hwParamsPlayback, outParams, self->primeBuffers, realSr, + outputLatency ) ); + PA_DEBUG(( "%s: Playback period size: %lu, latency: %f\n", __FUNCTION__, self->playback.framesPerBuffer, *outputLatency )); + } + + /* Should be exact now */ + self->streamRepresentation.streamInfo.sampleRate = realSr; + + /* this will cause the two streams to automatically start/stop/prepare in sync. + * We only need to execute these operations on one of the pair. + * A: We don't want to do this on a blocking stream. + */ + if( self->callbackMode && self->capture.pcm && self->playback.pcm ) + { + int err = snd_pcm_link( self->capture.pcm, self->playback.pcm ); + if( err == 0 ) + self->pcmsSynced = 1; + else + PA_DEBUG(( "%s: Unable to sync pcms: %s\n", __FUNCTION__, snd_strerror( err ) )); + } + + { + unsigned long minFramesPerHostBuffer = PA_MIN( self->capture.pcm ? self->capture.framesPerBuffer : ULONG_MAX, + self->playback.pcm ? self->playback.framesPerBuffer : ULONG_MAX ); + self->pollTimeout = CalculatePollTimeout( self, minFramesPerHostBuffer ); /* Period in msecs, rounded up */ + + /* Time before watchdog unthrottles realtime thread == 1/4 of period time in msecs */ + self->threading.throttledSleepTime = (unsigned long) (minFramesPerHostBuffer / sampleRate / 4 * 1000); + } + + if( self->callbackMode ) + { + /* If the user expects a certain number of frames per callback we will either have to rely on block adaption + * (framesPerHostBuffer is not an integer multiple of framesPerBuffer) or we can simply align the number + * of host buffer frames with what the user specified */ + if( self->framesPerUserBuffer != paFramesPerBufferUnspecified ) + { + /* self->alignFrames = 1; */ + + /* Unless the ratio between number of host and user buffer frames is an integer we will have to rely + * on block adaption */ + /* + if( framesPerHostBuffer % framesPerBuffer != 0 || (self->capture.pcm && self->playback.pcm && + self->capture.framesPerBuffer != self->playback.framesPerBuffer) ) + self->useBlockAdaption = 1; + else + self->alignFrames = 1; + */ + } + } + +error: + return result; +} + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback* callback, + void *userData ) +{ + PaError result = paNoError; + PaAlsaHostApiRepresentation *alsaHostApi = (PaAlsaHostApiRepresentation*)hostApi; + PaAlsaStream *stream = NULL; + PaSampleFormat hostInputSampleFormat = 0, hostOutputSampleFormat = 0; + PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0; + int numInputChannels = 0, numOutputChannels = 0; + PaTime inputLatency, outputLatency; + PaUtilHostBufferSizeMode hostBufferSizeMode = paUtilFixedHostBufferSize; + + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; + + if( inputParameters ) + { + PA_ENSURE( ValidateParameters( inputParameters, hostApi, StreamDirection_In ) ); + + numInputChannels = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + } + if( outputParameters ) + { + PA_ENSURE( ValidateParameters( outputParameters, hostApi, StreamDirection_Out ) ); + + numOutputChannels = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + } + + /* XXX: Why do we support this anyway? */ + if( framesPerBuffer == paFramesPerBufferUnspecified && getenv( "PA_ALSA_PERIODSIZE" ) != NULL ) + { + PA_DEBUG(( "%s: Getting framesPerBuffer from environment\n", __FUNCTION__ )); + framesPerBuffer = atoi( getenv("PA_ALSA_PERIODSIZE") ); + } + + PA_UNLESS( stream = (PaAlsaStream*)PaUtil_AllocateMemory( sizeof(PaAlsaStream) ), paInsufficientMemory ); + PA_ENSURE( PaAlsaStream_Initialize( stream, alsaHostApi, inputParameters, outputParameters, sampleRate, + framesPerBuffer, callback, streamFlags, userData ) ); + + PA_ENSURE( PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, + &inputLatency, &outputLatency, &hostBufferSizeMode ) ); + if( stream->capture.pcm && stream->playback.pcm ) + { + /* In full-duplex mode, host buffers should be of a fixed size unless we were unable to match the period + * sizes of the two handles */ + if( hostBufferSizeMode == paUtilFixedHostBufferSize ) + { + PA_UNLESS( stream->capture.framesPerBuffer == stream->playback.framesPerBuffer, paInternalError ); + } + else + { + assert( hostBufferSizeMode == paUtilBoundedHostBufferSize ); + PA_UNLESS( stream->capture.framesPerBuffer != stream->playback.framesPerBuffer, paInternalError ); + } + } + else + { + if( stream->capture.pcm ) + { + PA_UNLESS( stream->maxFramesPerHostBuffer == stream->capture.framesPerBuffer, paInternalError ); + } + else + { + PA_UNLESS( stream->maxFramesPerHostBuffer == stream->playback.framesPerBuffer, paInternalError ); + } + } + hostInputSampleFormat = stream->capture.hostSampleFormat; + hostOutputSampleFormat = stream->playback.hostSampleFormat; + + PA_ENSURE( PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + numInputChannels, inputSampleFormat, hostInputSampleFormat, + numOutputChannels, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, stream->maxFramesPerHostBuffer, + hostBufferSizeMode, callback, userData ) ); + + /* Ok, buffer processor is initialized, now we can deduce it's latency */ + if( numInputChannels > 0 ) + stream->streamRepresentation.streamInfo.inputLatency = inputLatency + PaUtil_GetBufferProcessorInputLatency( + &stream->bufferProcessor ); + if( numOutputChannels > 0 ) + stream->streamRepresentation.streamInfo.outputLatency = outputLatency + PaUtil_GetBufferProcessorOutputLatency( + &stream->bufferProcessor ); + + *s = (PaStream*)stream; + + return result; + +error: + if( stream ) + { + PA_DEBUG(( "%s: Stream in error, terminating\n", __FUNCTION__ )); + PaAlsaStream_Terminate( stream ); + } + + return result; +} + +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*)s; + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + + PaAlsaStream_Terminate( stream ); + + return result; +} + +static void SilenceBuffer( PaAlsaStream *stream ) +{ + const snd_pcm_channel_area_t *areas; + snd_pcm_uframes_t frames = (snd_pcm_uframes_t)snd_pcm_avail_update( stream->playback.pcm ), offset; + + snd_pcm_mmap_begin( stream->playback.pcm, &areas, &offset, &frames ); + snd_pcm_areas_silence( areas, offset, stream->playback.numHostChannels, frames, stream->playback.nativeFormat ); + snd_pcm_mmap_commit( stream->playback.pcm, offset, frames ); +} + +/** Start/prepare pcm(s) for streaming. + * + * Depending on wether the stream is in callback or blocking mode, we will respectively start or simply + * prepare the playback pcm. If the buffer has _not_ been primed, we will in callback mode prepare and + * silence the buffer before starting playback. In blocking mode we simply prepare, as the playback will + * be started automatically as the user writes to output. + * + * The capture pcm, however, will simply be prepared and started. + * + * PaAlsaStream::startMtx makes sure access is synchronized (useful in callback mode) + */ +static PaError AlsaStart( PaAlsaStream *stream, int priming ) +{ + PaError result = paNoError; + + if( stream->playback.pcm ) + { + if( stream->callbackMode ) + { + if( !priming ) + { + /* Buffer isn't primed, so prepare and silence */ + ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); + SilenceBuffer( stream ); + } + ENSURE_( snd_pcm_start( stream->playback.pcm ), paUnanticipatedHostError ); + } + else + ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); + } + if( stream->capture.pcm && !stream->pcmsSynced ) + { + ENSURE_( snd_pcm_prepare( stream->capture.pcm ), paUnanticipatedHostError ); + /* For a blocking stream we want to start capture as well, since nothing will happen otherwise */ + ENSURE_( snd_pcm_start( stream->capture.pcm ), paUnanticipatedHostError ); + } + +end: + return result; +error: + goto end; +} + +/** Utility function for determining if pcms are in running state. + * + */ +static int IsRunning( PaAlsaStream *stream ) +{ + int result = 0; + + LockMutex( &stream->stateMtx ); + if( stream->capture.pcm ) + { + snd_pcm_state_t capture_state = snd_pcm_state( stream->capture.pcm ); + + if( capture_state == SND_PCM_STATE_RUNNING || capture_state == SND_PCM_STATE_XRUN + || capture_state == SND_PCM_STATE_DRAINING ) + { + result = 1; + goto end; + } + } + + if( stream->playback.pcm ) + { + snd_pcm_state_t playback_state = snd_pcm_state( stream->playback.pcm ); + + if( playback_state == SND_PCM_STATE_RUNNING || playback_state == SND_PCM_STATE_XRUN + || playback_state == SND_PCM_STATE_DRAINING ) + { + result = 1; + goto end; + } + } + +end: + ASSERT_CALL_( UnlockMutex( &stream->stateMtx ), paNoError ); + + return result; +} + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*)s; + int streamStarted = 0; /* So we can know wether we need to take the stream down */ + + /* Ready the processor */ + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + /* Set now, so we can test for activity further down */ + stream->isActive = 1; + + if( stream->callbackMode ) + { + int res = 0; + PaTime pt = PaUtil_GetTime(); + struct timespec ts; + + PA_ENSURE( CreateCallbackThread( &stream->threading, &CallbackThreadFunc, stream ) ); + streamStarted = 1; + + /* Wait for stream to be started */ + ts.tv_sec = (time_t) floor( pt + 1 ); + ts.tv_nsec = (long) ((pt - floor( pt )) * 1000000000); + + /* Since we'll be holding a lock on the startMtx (when not waiting on the condition), IsRunning won't be checking + * stream state at the same time as the callback thread affects it. We also check IsStreamActive, in the unlikely + * case the callback thread exits in the meantime (the stream will be considered inactive after the thread exits) */ + PA_ENSURE( LockMutex( &stream->startMtx ) ); + + /* Due to possible spurious wakeups, we enclose in a loop */ + while( !IsRunning( stream ) && IsStreamActive( s ) && !res ) + { + res = pthread_cond_timedwait( &stream->startCond, &stream->startMtx, &ts ); + } + PA_ENSURE( UnlockMutex( &stream->startMtx ) ); + + PA_UNLESS( !res || res == ETIMEDOUT, paInternalError ); + PA_DEBUG(( "%s: Waited for %g seconds for stream to start\n", __FUNCTION__, PaUtil_GetTime() - pt )); + + if( res == ETIMEDOUT ) + { + PA_ENSURE( paTimedOut ); + } + } + else + { + PA_ENSURE( AlsaStart( stream, 0 ) ); + streamStarted = 1; + } + +end: + return result; +error: + if( streamStarted ) + AbortStream( stream ); + stream->isActive = 0; + + goto end; +} + +static PaError AlsaStop( PaAlsaStream *stream, int abort ) +{ + PaError result = paNoError; + + if( abort ) + { + if( stream->playback.pcm ) + { + ENSURE_( snd_pcm_drop( stream->playback.pcm ), paUnanticipatedHostError ); + } + if( stream->capture.pcm && !stream->pcmsSynced ) + { + ENSURE_( snd_pcm_drop( stream->capture.pcm ), paUnanticipatedHostError ); + } + + PA_DEBUG(( "%s: Dropped frames\n", __FUNCTION__ )); + } + else + { + if( stream->playback.pcm ) + { + ENSURE_( snd_pcm_nonblock( stream->playback.pcm, 0 ), paUnanticipatedHostError ); + if( snd_pcm_drain( stream->playback.pcm ) < 0 ) + { + PA_DEBUG(( "%s: Draining playback handle failed!\n", __FUNCTION__ )); + } + } + if( stream->capture.pcm && !stream->pcmsSynced ) + { + /* We don't need to retrieve any remaining frames */ + if( snd_pcm_drop( stream->capture.pcm ) < 0 ) + { + PA_DEBUG(( "%s: Draining capture handle failed!\n", __FUNCTION__ )); + } + } + } + +end: + return result; +error: + goto end; +} + +/** Stop or abort stream. + * + * If a stream is in callback mode we will have to inspect wether the background thread has + * finished, or we will have to take it out. In either case we join the thread before + * returning. In blocking mode, we simply tell ALSA to stop abruptly (abort) or finish + * buffers (drain) + * + * Stream will be considered inactive (!PaAlsaStream::isActive) after a call to this function + */ +static PaError RealStop( PaAlsaStream *stream, int abort ) +{ + PaError result = paNoError; + + /* First deal with the callback thread, cancelling and/or joining + * it if necessary + */ + if( stream->callbackMode ) + { + PaError threadRes, watchdogRes; + stream->callbackAbort = abort; + + if( !abort ) + { + PA_DEBUG(( "Stopping callback\n" )); + stream->callbackStop = 1; + } + PA_ENSURE( KillCallbackThread( &stream->threading, !abort, &threadRes, &watchdogRes ) ); + if( threadRes != paNoError ) + PA_DEBUG(( "Callback thread returned: %d\n", threadRes )); + if( watchdogRes != paNoError ) + PA_DEBUG(( "Watchdog thread returned: %d\n", watchdogRes )); + + stream->callbackStop = 0; /* The deed is done */ + stream->callback_finished = 0; + } + else + { + PA_ENSURE( AlsaStop( stream, abort ) ); + } + + stream->isActive = 0; + +end: + return result; + +error: + goto end; +} + +static PaError StopStream( PaStream *s ) +{ + return RealStop( (PaAlsaStream *) s, 0 ); +} + +static PaError AbortStream( PaStream *s ) +{ + return RealStop( (PaAlsaStream * ) s, 1 ); +} + +/** The stream is considered stopped before StartStream, or AFTER a call to Abort/StopStream (callback + * returning !paContinue is not considered) + * + */ +static PaError IsStreamStopped( PaStream *s ) +{ + PaAlsaStream *stream = (PaAlsaStream *)s; + + /* callback_finished indicates we need to join callback thread (ie. in Abort/StopStream) */ + return !IsStreamActive( s ) && !stream->callback_finished; +} + +static PaError IsStreamActive( PaStream *s ) +{ + PaAlsaStream *stream = (PaAlsaStream*)s; + return stream->isActive; +} + +static PaTime GetStreamTime( PaStream *s ) +{ + PaAlsaStream *stream = (PaAlsaStream*)s; + + snd_timestamp_t timestamp; + snd_pcm_status_t *status; + snd_pcm_status_alloca( &status ); + + /* TODO: what if we have both? does it really matter? */ + + /* TODO: if running in callback mode, this will mean + * libasound routines are being called from multiple threads. + * need to verify that libasound is thread-safe. */ + + if( stream->capture.pcm ) + { + snd_pcm_status( stream->capture.pcm, status ); + } + else if( stream->playback.pcm ) + { + snd_pcm_status( stream->playback.pcm, status ); + } + + snd_pcm_status_get_tstamp( status, ×tamp ); + return timestamp.tv_sec + (PaTime)timestamp.tv_usec / 1000000.0; +} + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaAlsaStream *stream = (PaAlsaStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + +static int SetApproximateSampleRate( snd_pcm_t *pcm, snd_pcm_hw_params_t *hwParams, double sampleRate ) +{ + unsigned long approx = (unsigned long) sampleRate; + int dir = 0; + double fraction = sampleRate - approx; + + assert( pcm && hwParams ); + + if( fraction > 0.0 ) + { + if( fraction > 0.5 ) + { + ++approx; + dir = -1; + } + else + dir = 1; + } + + return snd_pcm_hw_params_set_rate( pcm, hwParams, approx, dir ); +} + +/* Return exact sample rate in param sampleRate */ +static int GetExactSampleRate( snd_pcm_hw_params_t *hwParams, double *sampleRate ) +{ + unsigned int num, den; + int err; + + assert( hwParams ); + + err = snd_pcm_hw_params_get_rate_numden( hwParams, &num, &den ); + *sampleRate = (double) num / den; + + return err; +} + +/* Utility functions for blocking/callback interfaces */ + +/* Atomic restart of stream (we don't want the intermediate state visible) */ +static PaError AlsaRestart( PaAlsaStream *stream ) +{ + PaError result = paNoError; + + PA_ENSURE( LockMutex( &stream->stateMtx ) ); + PA_ENSURE( AlsaStop( stream, 0 ) ); + PA_ENSURE( AlsaStart( stream, 0 ) ); + + PA_DEBUG(( "%s: Restarted audio\n", __FUNCTION__ )); + +error: + PA_ENSURE( UnlockMutex( &stream->stateMtx ) ); + + return result; +} + +/** Recover from xrun state. + * + */ +static PaError PaAlsaStream_HandleXrun( PaAlsaStream *self ) +{ + PaError result = paNoError; + snd_pcm_status_t *st; + PaTime now = PaUtil_GetTime(); + snd_timestamp_t t; + + snd_pcm_status_alloca( &st ); + + if( self->playback.pcm ) + { + snd_pcm_status( self->playback.pcm, st ); + if( snd_pcm_status_get_state( st ) == SND_PCM_STATE_XRUN ) + { + snd_pcm_status_get_trigger_tstamp( st, &t ); + self->underrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000); + } + } + if( self->capture.pcm ) + { + snd_pcm_status( self->capture.pcm, st ); + if( snd_pcm_status_get_state( st ) == SND_PCM_STATE_XRUN ) + { + snd_pcm_status_get_trigger_tstamp( st, &t ); + self->overrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000); + } + } + + PA_ENSURE( AlsaRestart( self ) ); + +end: + return result; +error: + goto end; +} + +/** Decide if we should continue polling for specified direction, eventually adjust the poll timeout. + * + */ +static PaError ContinuePoll( const PaAlsaStream *stream, StreamDirection streamDir, int *pollTimeout, int *continuePoll ) +{ + PaError result = paNoError; + snd_pcm_sframes_t delay, margin; + int err; + const PaAlsaStreamComponent *component = NULL, *otherComponent = NULL; + + *continuePoll = 1; + + if( StreamDirection_In == streamDir ) + { + component = &stream->capture; + otherComponent = &stream->playback; + } + else + { + component = &stream->playback; + otherComponent = &stream->capture; + } + + /* ALSA docs say that negative delay should indicate xrun, but in my experience snd_pcm_delay returns -EPIPE */ + if( (err = snd_pcm_delay( otherComponent->pcm, &delay )) < 0 ) + { + if( err == -EPIPE ) + { + /* Xrun */ + *continuePoll = 0; + goto error; + } + + ENSURE_( err, paUnanticipatedHostError ); + } + + if( StreamDirection_Out == streamDir ) + { + /* Number of eligible frames before capture overrun */ + delay = otherComponent->bufferSize - delay; + } + margin = delay - otherComponent->framesPerBuffer / 2; + + if( margin < 0 ) + { + PA_DEBUG(( "%s: Stopping poll for %s\n", __FUNCTION__, StreamDirection_In == streamDir ? "capture" : "playback" )); + *continuePoll = 0; + } + else if( margin < otherComponent->framesPerBuffer ) + { + *pollTimeout = CalculatePollTimeout( stream, margin ); + PA_DEBUG(( "%s: Trying to poll again for %s frames, pollTimeout: %d\n", + __FUNCTION__, StreamDirection_In == streamDir ? "capture" : "playback", *pollTimeout )); + } + +error: + return result; +} + +/* Callback interface */ + +static void OnExit( void *data ) +{ + PaAlsaStream *stream = (PaAlsaStream *) data; + + assert( data ); + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + stream->callback_finished = 1; /* Let the outside world know stream was stopped in callback */ + PA_DEBUG(( "%s: Stopping ALSA handles\n", __FUNCTION__ )); + AlsaStop( stream, stream->callbackAbort ); + stream->callbackAbort = 0; /* Clear state */ + + PA_DEBUG(( "%s: Stoppage\n", __FUNCTION__ )); + + /* Eventually notify user all buffers have played */ + if( stream->streamRepresentation.streamFinishedCallback ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + stream->isActive = 0; +} + +static void CalculateTimeInfo( PaAlsaStream *stream, PaStreamCallbackTimeInfo *timeInfo ) +{ + snd_pcm_status_t *capture_status, *playback_status; + snd_timestamp_t capture_timestamp, playback_timestamp; + PaTime capture_time = 0., playback_time = 0.; + + snd_pcm_status_alloca( &capture_status ); + snd_pcm_status_alloca( &playback_status ); + + if( stream->capture.pcm ) + { + snd_pcm_sframes_t capture_delay; + + snd_pcm_status( stream->capture.pcm, capture_status ); + snd_pcm_status_get_tstamp( capture_status, &capture_timestamp ); + + capture_time = capture_timestamp.tv_sec + + ((PaTime)capture_timestamp.tv_usec / 1000000.0); + timeInfo->currentTime = capture_time; + + capture_delay = snd_pcm_status_get_delay( capture_status ); + timeInfo->inputBufferAdcTime = timeInfo->currentTime - + (PaTime)capture_delay / stream->streamRepresentation.streamInfo.sampleRate; + } + if( stream->playback.pcm ) + { + snd_pcm_sframes_t playback_delay; + + snd_pcm_status( stream->playback.pcm, playback_status ); + snd_pcm_status_get_tstamp( playback_status, &playback_timestamp ); + + playback_time = playback_timestamp.tv_sec + + ((PaTime)playback_timestamp.tv_usec / 1000000.0); + + if( stream->capture.pcm ) /* Full duplex */ + { + /* Hmm, we have both a playback and a capture timestamp. + * Hopefully they are the same... */ + if( fabs( capture_time - playback_time ) > 0.01 ) + PA_DEBUG(("Capture time and playback time differ by %f\n", fabs(capture_time-playback_time))); + } + else + timeInfo->currentTime = playback_time; + + playback_delay = snd_pcm_status_get_delay( playback_status ); + timeInfo->outputBufferDacTime = timeInfo->currentTime + + (PaTime)playback_delay / stream->streamRepresentation.streamInfo.sampleRate; + } +} + +/** Called after buffer processing is finished. + * + * A number of mmapped frames is committed, it is possible that an xrun has occurred in the meantime. + * + * @param numFrames The number of frames that has been processed + * @param xrun Return whether an xrun has occurred + */ +static PaError PaAlsaStreamComponent_EndProcessing( PaAlsaStreamComponent *self, unsigned long numFrames, int *xrun ) +{ + PaError result = paNoError; + int res; + + /* @concern FullDuplex It is possible that only one direction is marked ready after polling, and processed + * afterwards + */ + if( !self->ready ) + goto end; + + res = snd_pcm_mmap_commit( self->pcm, self->offset, numFrames ); + if( res == -EPIPE || res == -ESTRPIPE ) + { + *xrun = 1; + } + else + { + ENSURE_( res, paUnanticipatedHostError ); + } + +end: +error: + return result; +} + +/* Extract buffer from channel area */ +static unsigned char *ExtractAddress( const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset ) +{ + return (unsigned char *) area->addr + (area->first + offset * area->step) / 8; +} + +/** Do necessary adaption between user and host channels. + * + @concern ChannelAdaption Adapting between user and host channels can involve silencing unused channels and + duplicating mono information if host outputs come in pairs. + */ +static PaError PaAlsaStreamComponent_DoChannelAdaption( PaAlsaStreamComponent *self, PaUtilBufferProcessor *bp, int numFrames ) +{ + PaError result = paNoError; + unsigned char *p; + int i; + int unusedChans = self->numHostChannels - self->numUserChannels; + unsigned char *src, *dst; + int convertMono = (self->numHostChannels % 2) == 0 && (self->numUserChannels % 2) != 0; + + assert( StreamDirection_Out == self->streamDir ); + + if( self->hostInterleaved ) + { + int swidth = snd_pcm_format_size( self->nativeFormat, 1 ); + unsigned char *buffer = ExtractAddress( self->channelAreas, self->offset ); + + /* Start after the last user channel */ + p = buffer + self->numUserChannels * swidth; + + if( convertMono ) + { + /* Convert the last user channel into stereo pair */ + src = buffer + (self->numUserChannels - 1) * swidth; + for( i = 0; i < numFrames; ++i ) + { + dst = src + swidth; + memcpy( dst, src, swidth ); + src += self->numHostChannels * swidth; + } + + /* Don't touch the channel we just wrote to */ + p += swidth; + --unusedChans; + } + + if( unusedChans > 0 ) + { + /* Silence unused output channels */ + for( i = 0; i < numFrames; ++i ) + { + memset( p, 0, swidth * unusedChans ); + p += self->numHostChannels * swidth; + } + } + } + else + { + /* We extract the last user channel */ + if( convertMono ) + { + ENSURE_( snd_pcm_area_copy( self->channelAreas + self->numUserChannels, self->offset, self->channelAreas + + (self->numUserChannels - 1), self->offset, numFrames, self->nativeFormat ), paUnanticipatedHostError ); + --unusedChans; + } + if( unusedChans > 0 ) + { + snd_pcm_areas_silence( self->channelAreas + (self->numHostChannels - unusedChans), self->offset, unusedChans, numFrames, + self->nativeFormat ); + } + } + +error: + return result; +} + +static PaError PaAlsaStream_EndProcessing( PaAlsaStream *self, unsigned long numFrames, int *xrunOccurred ) +{ + PaError result = paNoError; + int xrun = 0; + + if( self->capture.pcm ) + { + PA_ENSURE( PaAlsaStreamComponent_EndProcessing( &self->capture, numFrames, &xrun ) ); + } + if( self->playback.pcm ) + { + if( self->playback.numHostChannels > self->playback.numUserChannels ) + PA_ENSURE( PaAlsaStreamComponent_DoChannelAdaption( &self->playback, &self->bufferProcessor, numFrames ) ); + PA_ENSURE( PaAlsaStreamComponent_EndProcessing( &self->playback, numFrames, &xrun ) ); + } + +error: + *xrunOccurred = xrun; + return result; +} + +/** Update the number of available frames. + * + */ +static PaError PaAlsaStreamComponent_GetAvailableFrames( PaAlsaStreamComponent *self, unsigned long *numFrames, int *xrunOccurred ) +{ + PaError result = paNoError; + snd_pcm_sframes_t framesAvail = snd_pcm_avail_update( self->pcm ); + *xrunOccurred = 0; + + if( -EPIPE == framesAvail ) + { + *xrunOccurred = 1; + framesAvail = 0; + } + else + ENSURE_( framesAvail, paUnanticipatedHostError ); + + *numFrames = framesAvail; + +error: + return result; +} + +/** Fill in pollfd objects. + */ +static PaError PaAlsaStreamComponent_BeginPolling( PaAlsaStreamComponent* self, struct pollfd* pfds ) +{ + PaError result = paNoError; + int ret = snd_pcm_poll_descriptors( self->pcm, pfds, self->nfds ); + (void)ret; /* Prevent unused variable warning if asserts are turned off */ + assert( ret == self->nfds ); + + self->ready = 0; + + return result; +} + +/** Examine results from poll(). + * + * @param pfds pollfds to inspect + * @param shouldPoll Should we continue to poll + * @param xrun Has an xrun occurred + */ +static PaError PaAlsaStreamComponent_EndPolling( PaAlsaStreamComponent* self, struct pollfd* pfds, int* shouldPoll, int* xrun ) +{ + PaError result = paNoError; + unsigned short revents; + + ENSURE_( snd_pcm_poll_descriptors_revents( self->pcm, pfds, self->nfds, &revents ), paUnanticipatedHostError ); + if( revents != 0 ) + { + if( revents & POLLERR ) + { + *xrun = 1; + } + else + self->ready = 1; + + *shouldPoll = 0; + } + +error: + return result; +} + +/** Return the number of available frames for this stream. + * + * @concern FullDuplex The minimum available for the two directions is calculated, it might be desirable to ignore + * one direction however (not marked ready from poll), so this is controlled by queryCapture and queryPlayback. + * + * @param queryCapture Check available for capture + * @param queryPlayback Check available for playback + * @param available The returned number of frames + * @param xrunOccurred Return whether an xrun has occurred + */ +static PaError PaAlsaStream_GetAvailableFrames( PaAlsaStream *self, int queryCapture, int queryPlayback, unsigned long + *available, int *xrunOccurred ) +{ + PaError result = paNoError; + unsigned long captureFrames, playbackFrames; + *xrunOccurred = 0; + + assert( queryCapture || queryPlayback ); + + if( queryCapture ) + { + assert( self->capture.pcm ); + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &self->capture, &captureFrames, xrunOccurred ) ); + if( *xrunOccurred ) + goto end; + } + if( queryPlayback ) + { + assert( self->playback.pcm ); + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &self->playback, &playbackFrames, xrunOccurred ) ); + if( *xrunOccurred ) + goto end; + } + + if( queryCapture && queryPlayback ) + { + *available = PA_MIN( captureFrames, playbackFrames ); + /*PA_DEBUG(("capture: %lu, playback: %lu, combined: %lu\n", captureFrames, playbackFrames, *available));*/ + } + else if( queryCapture ) + { + *available = captureFrames; + } + else + { + *available = playbackFrames; + } + +end: +error: + return result; +} + +/** Wait for and report available buffer space from ALSA. + * + * Unless ALSA reports a minimum of frames available for I/O, we poll the ALSA filedescriptors for more. + * Both of these operations can uncover xrun conditions. + * + * @concern Xruns Both polling and querying available frames can report an xrun condition. + * + * @param framesAvail Return the number of available frames + * @param xrunOccurred Return whether an xrun has occurred + */ +static PaError PaAlsaStream_WaitForFrames( PaAlsaStream *self, unsigned long *framesAvail, int *xrunOccurred ) +{ + PaError result = paNoError; + int pollPlayback = self->playback.pcm != NULL, pollCapture = self->capture.pcm != NULL; + int pollTimeout = self->pollTimeout; + int xrun = 0; + + assert( self ); + assert( framesAvail ); + + if( !self->callbackMode ) + { + /* In blocking mode we will only wait if necessary */ + PA_ENSURE( PaAlsaStream_GetAvailableFrames( self, self->capture.pcm != NULL, self->playback.pcm != NULL, + framesAvail, &xrun ) ); + if( xrun ) + { + goto end; + } + + if( *framesAvail > 0 ) + { + /* Mark pcms ready from poll */ + if( self->capture.pcm ) + self->capture.ready = 1; + if( self->playback.pcm ) + self->playback.ready = 1; + + goto end; + } + } + + while( pollPlayback || pollCapture ) + { + int totalFds = 0; + struct pollfd *capturePfds = NULL, *playbackPfds = NULL; + + pthread_testcancel(); + + if( pollCapture ) + { + capturePfds = self->pfds; + PA_ENSURE( PaAlsaStreamComponent_BeginPolling( &self->capture, capturePfds ) ); + totalFds += self->capture.nfds; + } + if( pollPlayback ) + { + playbackPfds = self->pfds + (self->capture.pcm ? self->capture.nfds : 0); + PA_ENSURE( PaAlsaStreamComponent_BeginPolling( &self->playback, playbackPfds ) ); + totalFds += self->playback.nfds; + } + + if( poll( self->pfds, totalFds, pollTimeout ) < 0 ) + { + /* XXX: Depend on preprocessor condition? */ + if( errno == EINTR ) { /* gdb */ + continue; + } + + /* TODO: Add macro for checking system calls */ + PA_ENSURE( paInternalError ); + } + + /* check the return status of our pfds */ + if( pollCapture ) + { + PA_ENSURE( PaAlsaStreamComponent_EndPolling( &self->capture, capturePfds, &pollCapture, &xrun ) ); + } + if( pollPlayback ) + { + PA_ENSURE( PaAlsaStreamComponent_EndPolling( &self->playback, playbackPfds, &pollPlayback, &xrun ) ); + } + if( xrun ) + { + break; + } + + /* @concern FullDuplex If only one of two pcms is ready we may want to compromise between the two. + * If there is less than half a period's worth of samples left of frames in the other pcm's buffer we will + * stop polling. + */ + if( self->capture.pcm && self->playback.pcm ) + { + if( pollCapture && !pollPlayback ) + { + PA_ENSURE( ContinuePoll( self, StreamDirection_In, &pollTimeout, &pollCapture ) ); + } + else if( pollPlayback && !pollCapture ) + { + PA_ENSURE( ContinuePoll( self, StreamDirection_Out, &pollTimeout, &pollPlayback ) ); + } + } + } + + if( !xrun ) + { + /* Get the number of available frames for the pcms that are marked ready. + * @concern FullDuplex If only one direction is marked ready (from poll), the number of frames available for + * the other direction is returned. Output is normally preferred over capture however, so capture frames may be + * discarded to avoid overrun unless paNeverDropInput is specified. + */ + int captureReady = self->capture.pcm ? self->capture.ready : 0, + playbackReady = self->playback.pcm ? self->playback.ready : 0; + PA_ENSURE( PaAlsaStream_GetAvailableFrames( self, captureReady, playbackReady, framesAvail, &xrun ) ); + + if( self->capture.pcm && self->playback.pcm ) + { + if( !self->playback.ready && !self->neverDropInput ) + { + /* Drop input, a period's worth */ + assert( self->capture.ready ); + PaAlsaStreamComponent_EndProcessing( &self->capture, PA_MIN( self->capture.framesPerBuffer, + *framesAvail ), &xrun ); + *framesAvail = 0; + self->capture.ready = 0; + } + } + else if( self->capture.pcm ) + assert( self->capture.ready ); + else + assert( self->playback.ready ); + } + +end: +error: + if( xrun ) + { + /* Recover from the xrun state */ + PA_ENSURE( PaAlsaStream_HandleXrun( self ) ); + *framesAvail = 0; + } + else + { + if( 0 != *framesAvail ) + { + /* If we're reporting frames eligible for processing, one of the handles better be ready */ + PA_UNLESS( self->capture.ready || self->playback.ready, paInternalError ); + } + } + *xrunOccurred = xrun; + + return result; +} + +/** Register per-channel ALSA buffer information with buffer processor. + * + * Mmapped buffer space is acquired from ALSA, and registered with the buffer processor. Differences between the + * number of host and user channels is taken into account. + * + * @param numFrames On entrance the number of requested frames, on exit the number of contiguously accessible frames. + */ +static PaError PaAlsaStreamComponent_RegisterChannels( PaAlsaStreamComponent *self, PaUtilBufferProcessor *bp, + unsigned long *numFrames, int *xrun ) +{ + PaError result = paNoError; + const snd_pcm_channel_area_t *areas, *area; + void (*setChannel)(PaUtilBufferProcessor *, unsigned int, void *, unsigned int) = + StreamDirection_In == self->streamDir ? PaUtil_SetInputChannel : PaUtil_SetOutputChannel; + unsigned char *buffer, *p; + int i; + unsigned long framesAvail; + + /* This _must_ be called before mmap_begin */ + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( self, &framesAvail, xrun ) ); + if( *xrun ) + { + *numFrames = 0; + goto end; + } + + ENSURE_( snd_pcm_mmap_begin( self->pcm, &areas, &self->offset, numFrames ), paUnanticipatedHostError ); + + if( self->hostInterleaved ) + { + int swidth = snd_pcm_format_size( self->nativeFormat, 1 ); + + p = buffer = ExtractAddress( areas, self->offset ); + for( i = 0; i < self->numUserChannels; ++i ) + { + /* We're setting the channels up to userChannels, but the stride will be hostChannels samples */ + setChannel( bp, i, p, self->numHostChannels ); + p += swidth; + } + } + else + { + for( i = 0; i < self->numUserChannels; ++i ) + { + area = areas + i; + buffer = ExtractAddress( area, self->offset ); + setChannel( bp, i, buffer, 1 ); + } + } + + /* @concern ChannelAdaption Buffer address is recorded so we can do some channel adaption later */ + self->channelAreas = (snd_pcm_channel_area_t *)areas; + +end: +error: + return result; +} + +/** Initiate buffer processing. + * + * ALSA buffers are registered with the PA buffer processor and the buffer size (in frames) set. + * + * @concern FullDuplex If both directions are being processed, the minimum amount of frames for the two directions is + * calculated. + * + * @param numFrames On entrance the number of available frames, on exit the number of received frames + * @param xrunOccurred Return whether an xrun has occurred + */ +static PaError PaAlsaStream_SetUpBuffers( PaAlsaStream *self, unsigned long *numFrames, int *xrunOccurred ) +{ + PaError result = paNoError; + unsigned long captureFrames = ULONG_MAX, playbackFrames = ULONG_MAX, commonFrames = 0; + int xrun = 0; + + if( *xrunOccurred ) + { + *numFrames = 0; + return result; + } + /* If we got here at least one of the pcm's should be marked ready */ + PA_UNLESS( self->capture.ready || self->playback.ready, paInternalError ); + + /* Extract per-channel ALSA buffer pointers and register them with the buffer processor. + * It is possible that a direction is not marked ready however, because it is out of sync with the other. + */ + if( self->capture.pcm && self->capture.ready ) + { + captureFrames = *numFrames; + PA_ENSURE( PaAlsaStreamComponent_RegisterChannels( &self->capture, &self->bufferProcessor, &captureFrames, + &xrun ) ); + } + if( self->playback.pcm && self->playback.ready ) + { + playbackFrames = *numFrames; + PA_ENSURE( PaAlsaStreamComponent_RegisterChannels( &self->playback, &self->bufferProcessor, &playbackFrames, + &xrun ) ); + } + if( xrun ) + { + /* Nothing more to do */ + assert( 0 == commonFrames ); + goto end; + } + + commonFrames = PA_MIN( captureFrames, playbackFrames ); + /* assert( commonFrames <= *numFrames ); */ + if( commonFrames > *numFrames ) + { + /* Hmmm ... how come there are more frames available than we requested!? Blah. */ + PA_DEBUG(( "%s: Common available frames are reported to be more than number requested: %lu, %lu, callbackMode: %d\n", __FUNCTION__, + commonFrames, *numFrames, self->callbackMode )); + if( self->capture.pcm ) + { + PA_DEBUG(( "%s: captureFrames: %lu, capture.ready: %d\n", __FUNCTION__, captureFrames, self->capture.ready )); + } + if( self->playback.pcm ) + { + PA_DEBUG(( "%s: playbackFrames: %lu, playback.ready: %d\n", __FUNCTION__, playbackFrames, self->playback.ready )); + } + + commonFrames = 0; + goto end; + } + + /* Inform PortAudio of the number of frames we got. + * @concern FullDuplex We might be experiencing underflow in either end; if its an input underflow, we go on + * with output. If its output underflow however, depending on the paNeverDropInput flag, we may want to simply + * discard the excess input or call the callback with paOutputOverflow flagged. + */ + if( self->capture.pcm ) + { + if( self->capture.ready ) + { + PaUtil_SetInputFrameCount( &self->bufferProcessor, commonFrames ); + } + else + { + /* We have input underflow */ + PaUtil_SetNoInput( &self->bufferProcessor ); + } + } + if( self->playback.pcm ) + { + if( self->playback.ready ) + { + PaUtil_SetOutputFrameCount( &self->bufferProcessor, commonFrames ); + } + else + { + /* We have output underflow, but keeping input data (paNeverDropInput) */ + assert( self->neverDropInput ); + assert( self->capture.pcm != NULL ); + PA_DEBUG(( "%s: Setting output buffers to NULL\n", __FUNCTION__ )); + PaUtil_SetNoOutput( &self->bufferProcessor ); + } + } + +end: + *numFrames = commonFrames; +error: + if( xrun ) + { + PA_ENSURE( PaAlsaStream_HandleXrun( self ) ); + *numFrames = 0; + } + *xrunOccurred = xrun; + + return result; +} + +/** Callback thread's function. + * + * Roughly, the workflow can be described in the following way: The number of available frames that can be processed + * directly is obtained from ALSA, we then request as much directly accessible memory as possible within this amount + * from ALSA. The buffer memory is registered with the PA buffer processor and processing is carried out with + * PaUtil_EndBufferProcessing. Finally, the number of processed frames is reported to ALSA. The processing can + * happen in several iterations untill we have consumed the known number of available frames (or an xrun is detected). + */ +static void *CallbackThreadFunc( void *userData ) +{ + PaError result = paNoError, *pres = NULL; + PaAlsaStream *stream = (PaAlsaStream*) userData; + PaStreamCallbackTimeInfo timeInfo = {0, 0, 0}; + snd_pcm_sframes_t startThreshold = 0; + int callbackResult = paContinue; + PaStreamCallbackFlags cbFlags = 0; /* We might want to keep state across iterations */ + int streamStarted = 0; + + assert( stream ); + + callbackThread_ = pthread_self(); + /* Execute OnExit when exiting */ + pthread_cleanup_push( &OnExit, stream ); + + /* Not implemented */ + assert( !stream->primeBuffers ); + + /* @concern StreamStart If the output is being primed the output pcm needs to be prepared, otherwise the + * stream is started immediately. The latter involves signaling the waiting main thread. + */ + if( stream->primeBuffers ) + { + snd_pcm_sframes_t avail; + + if( stream->playback.pcm ) + ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); + if( stream->capture.pcm && !stream->pcmsSynced ) + ENSURE_( snd_pcm_prepare( stream->capture.pcm ), paUnanticipatedHostError ); + + /* We can't be certain that the whole ring buffer is available for priming, but there should be + * at least one period */ + avail = snd_pcm_avail_update( stream->playback.pcm ); + startThreshold = avail - (avail % stream->playback.framesPerBuffer); + assert( startThreshold >= stream->playback.framesPerBuffer ); + } + else + { + PA_ENSURE( LockMutex( &stream->startMtx ) ); + PA_ENSURE( AlsaStart( stream, 0 ) ); /* Buffer will be zeroed */ + ENSURE_SYSTEM_( pthread_cond_signal( &stream->startCond ), 0 ); + PA_ENSURE( UnlockMutex( &stream->startMtx ) ); + + streamStarted = 1; + } + + while( 1 ) + { + unsigned long framesAvail, framesGot; + int xrun = 0; + + pthread_testcancel(); + + /* @concern StreamStop if the main thread has requested a stop and the stream has not been effectively + * stopped we signal this condition by modifying callbackResult (we'll want to flush buffered output). + */ + if( stream->callbackStop && paContinue == callbackResult ) + { + PA_DEBUG(( "Setting callbackResult to paComplete\n" )); + callbackResult = paComplete; + } + + if( paContinue != callbackResult ) + { + stream->callbackAbort = (paAbort == callbackResult); + if( stream->callbackAbort || + /** @concern BlockAdaption: Go on if adaption buffers are empty */ + PaUtil_IsBufferProcessorOutputEmpty( &stream->bufferProcessor ) ) + goto end; + + PA_DEBUG(( "%s: Flushing buffer processor\n", __FUNCTION__ )); + /* There is still buffered output that needs to be processed */ + } + + /* Wait for data to become available, this comes down to polling the ALSA file descriptors untill we have + * a number of available frames. + */ + PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) ); + if( xrun ) + { + assert( 0 == framesAvail ); + continue; + + /* XXX: Report xruns to the user? A situation is conceivable where the callback is never invoked due + * to constant xruns, it might be desirable to notify the user of this. + */ + } + + /* Consume buffer space. Once we have a number of frames available for consumption we must retrieve the + * mmapped buffers from ALSA, this is contiguously accessible memory however, so we may receive smaller + * portions at a time than is available as a whole. Therefore we should be prepared to process several + * chunks successively. The buffers are passed to the PA buffer processor. + */ + while( framesAvail > 0 ) + { + xrun = 0; + + pthread_testcancel(); + + /** @concern Xruns Under/overflows are to be reported to the callback */ + if( stream->underrun > 0.0 ) + { + cbFlags |= paOutputUnderflow; + stream->underrun = 0.0; + } + if( stream->overrun > 0.0 ) + { + cbFlags |= paInputOverflow; + stream->overrun = 0.0; + } + if( stream->capture.pcm && stream->playback.pcm ) + { + /** @concern FullDuplex It's possible that only one direction is being processed to avoid an + * under- or overflow, this should be reported correspondingly */ + if( !stream->capture.ready ) + { + cbFlags |= paInputUnderflow; + PA_DEBUG(( "%s: Input underflow\n", __FUNCTION__ )); + } + else if( !stream->playback.ready ) + { + cbFlags |= paOutputOverflow; + PA_DEBUG(( "%s: Output overflow\n", __FUNCTION__ )); + } + } + + CallbackUpdate( &stream->threading ); + CalculateTimeInfo( stream, &timeInfo ); + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, cbFlags ); + cbFlags = 0; + + /* CPU load measurement should include processing activivity external to the stream callback */ + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + framesGot = framesAvail; + PA_ENSURE( PaAlsaStream_SetUpBuffers( stream, &framesGot, &xrun ) ); + /* Check the host buffer size against the buffer processor configuration */ + if( stream->bufferProcessor.hostBufferSizeMode == paUtilFixedHostBufferSize ) + { + /* We've committed to a fixed host buffer size, stick to that */ + framesGot = framesGot >= stream->maxFramesPerHostBuffer ? stream->maxFramesPerHostBuffer : 0; + } + else + { + /* We've committed to an upper bound on the size of host buffers */ + assert( stream->bufferProcessor.hostBufferSizeMode == paUtilBoundedHostBufferSize ); + framesGot = PA_MIN( framesGot, stream->maxFramesPerHostBuffer ); + } + framesAvail -= framesGot; + + if( framesGot > 0 ) + { + assert( !xrun ); + PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + PA_ENSURE( PaAlsaStream_EndProcessing( stream, framesGot, &xrun ) ); + } + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesGot ); + + if( framesGot == 0 ) + { + if( !xrun ) + { + PA_DEBUG(( "%s: Received less frames than reported from ALSA, framesAvail: %lu\n", __FUNCTION__, + framesAvail )); + } + + /* Go back to polling for more frames */ + break; + + } + + if( paContinue != callbackResult ) + break; + } + } + + /* Match pthread_cleanup_push */ + pthread_cleanup_pop( 1 ); + +end: + PA_DEBUG(( "%s: Thread %d exiting\n ", __FUNCTION__, pthread_self() )); + pthread_exit( pres ); + +error: + /* Pass on error code */ + pres = malloc( sizeof (PaError) ); + *pres = result; + + goto end; +} + +/* Blocking interface */ + +static PaError ReadStream( PaStream* s, void *buffer, unsigned long frames ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*)s; + unsigned long framesGot, framesAvail; + void *userBuffer; + snd_pcm_t *save = stream->playback.pcm; + + assert( stream ); + + PA_UNLESS( stream->capture.pcm, paCanNotReadFromAnOutputOnlyStream ); + + /* Disregard playback */ + stream->playback.pcm = NULL; + + if( stream->overrun > 0. ) + { + result = paInputOverflowed; + stream->overrun = 0.0; + } + + if( stream->capture.userInterleaved ) + { + userBuffer = buffer; + } + else + { + /* Copy channels into local array */ + userBuffer = stream->capture.userBuffers; + memcpy( userBuffer, buffer, sizeof (void *) * stream->capture.numUserChannels ); + } + + /* Start stream if in prepared state */ + if( snd_pcm_state( stream->capture.pcm ) == SND_PCM_STATE_PREPARED ) + { + ENSURE_( snd_pcm_start( stream->capture.pcm ), paUnanticipatedHostError ); + } + + while( frames > 0 ) + { + int xrun = 0; + PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) ); + framesGot = PA_MIN( framesAvail, frames ); + + PA_ENSURE( PaAlsaStream_SetUpBuffers( stream, &framesGot, &xrun ) ); + if( framesGot > 0 ) + { + framesGot = PaUtil_CopyInput( &stream->bufferProcessor, &userBuffer, framesGot ); + PA_ENSURE( PaAlsaStream_EndProcessing( stream, framesGot, &xrun ) ); + frames -= framesGot; + } + } + +end: + stream->playback.pcm = save; + return result; +error: + goto end; +} + +static PaError WriteStream( PaStream* s, const void *buffer, unsigned long frames ) +{ + PaError result = paNoError; + signed long err; + PaAlsaStream *stream = (PaAlsaStream*)s; + snd_pcm_uframes_t framesGot, framesAvail; + const void *userBuffer; + snd_pcm_t *save = stream->capture.pcm; + + assert( stream ); + + PA_UNLESS( stream->playback.pcm, paCanNotWriteToAnInputOnlyStream ); + + /* Disregard capture */ + stream->capture.pcm = NULL; + + if( stream->underrun > 0. ) + { + result = paOutputUnderflowed; + stream->underrun = 0.0; + } + + if( stream->playback.userInterleaved ) + userBuffer = buffer; + else /* Copy channels into local array */ + { + userBuffer = stream->playback.userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->playback.numUserChannels ); + } + + while( frames > 0 ) + { + int xrun = 0; + snd_pcm_uframes_t hwAvail; + + PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) ); + framesGot = PA_MIN( framesAvail, frames ); + + PA_ENSURE( PaAlsaStream_SetUpBuffers( stream, &framesGot, &xrun ) ); + if( framesGot > 0 ) + { + framesGot = PaUtil_CopyOutput( &stream->bufferProcessor, &userBuffer, framesGot ); + PA_ENSURE( PaAlsaStream_EndProcessing( stream, framesGot, &xrun ) ); + frames -= framesGot; + } + + /* Start stream after one period of samples worth */ + + /* Frames residing in buffer */ + PA_ENSURE( err = GetStreamWriteAvailable( stream ) ); + framesAvail = err; + hwAvail = stream->playback.bufferSize - framesAvail; + + if( snd_pcm_state( stream->playback.pcm ) == SND_PCM_STATE_PREPARED && + hwAvail >= stream->playback.framesPerBuffer ) + { + ENSURE_( snd_pcm_start( stream->playback.pcm ), paUnanticipatedHostError ); + } + } + +end: + stream->capture.pcm = save; + return result; +error: + goto end; +} + +/* Return frames available for reading. In the event of an overflow, the capture pcm will be restarted */ +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*)s; + unsigned long avail; + int xrun; + + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &stream->capture, &avail, &xrun ) ); + if( xrun ) + { + PA_ENSURE( PaAlsaStream_HandleXrun( stream ) ); + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &stream->capture, &avail, &xrun ) ); + if( xrun ) + PA_ENSURE( paInputOverflowed ); + } + + return (signed long)avail; + +error: + return result; +} + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*)s; + unsigned long avail; + int xrun; + + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &stream->playback, &avail, &xrun ) ); + if( xrun ) + { + snd_pcm_sframes_t savail; + + PA_ENSURE( PaAlsaStream_HandleXrun( stream ) ); + savail = snd_pcm_avail_update( stream->playback.pcm ); + + /* savail should not contain -EPIPE now, since PaAlsaStream_HandleXrun will only prepare the pcm */ + ENSURE_( savail, paUnanticipatedHostError ); + + avail = (unsigned long) savail; + } + + return (signed long)avail; + +error: + return result; +} + +/* Extensions */ + +/* Initialize host api specific structure */ +void PaAlsa_InitializeStreamInfo( PaAlsaStreamInfo *info ) +{ + info->size = sizeof (PaAlsaStreamInfo); + info->hostApiType = paALSA; + info->version = 1; + info->deviceString = NULL; +} + +void PaAlsa_EnableRealtimeScheduling( PaStream *s, int enable ) +{ + PaAlsaStream *stream = (PaAlsaStream *) s; + stream->threading.rtSched = enable; +} + +void PaAlsa_EnableWatchdog( PaStream *s, int enable ) +{ + PaAlsaStream *stream = (PaAlsaStream *) s; + stream->threading.useWatchdog = enable; +} diff --git a/portaudio-v19/pa_linux_alsa/pa_linux_alsa.h b/portaudio-v19/pa_linux_alsa/pa_linux_alsa.h new file mode 100644 index 000000000..b9d43c929 --- /dev/null +++ b/portaudio-v19/pa_linux_alsa/pa_linux_alsa.h @@ -0,0 +1,64 @@ +#ifndef PA_LINUX_ALSA_H +#define PA_LINUX_ALSA_H + +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * ALSA-specific extensions + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +/** @file + * ALSA-specific PortAudio API extension header file. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct PaAlsaStreamInfo +{ + unsigned long size; + PaHostApiTypeId hostApiType; + unsigned long version; + + const char *deviceString; +} +PaAlsaStreamInfo; + +void PaAlsa_InitializeStreamInfo( PaAlsaStreamInfo *info ); + +void PaAlsa_EnableRealtimeScheduling( PaStream *s, int enable ); + +void PaAlsa_EnableWatchdog( PaStream *s, int enable ); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/portaudio-v19/pa_mac/pa_mac_hostapis.c b/portaudio-v19/pa_mac/pa_mac_hostapis.c new file mode 100644 index 000000000..f8306c302 --- /dev/null +++ b/portaudio-v19/pa_mac/pa_mac_hostapis.c @@ -0,0 +1,79 @@ +/* + * $Id$ + * Portable Audio I/O Library Windows initialization table + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file +Mac OS host API initialization function table. +*/ + + +#include "pa_hostapi.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaMacSm_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaMacAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +PaUtilHostApiInitializer *paHostApiInitializers[] = +{ +#ifdef PA_USE_COREAUDIO + PaMacCore_Initialize, +#endif + +#ifdef PA_USE_SM + PaMacSm_Initialize, +#endif + +#ifdef PA_USE_JACK + PaJack_Initialize, +#endif + +#ifdef PA_USE_ASIO + PaMacAsio_Initialize, +#endif + + PaSkeleton_Initialize, /* just for testing */ + + 0 /* NULL terminated array */ +}; + + +int paDefaultHostApiIndex = 0; diff --git a/portaudio-v19/pa_mac_core/notes.txt b/portaudio-v19/pa_mac_core/notes.txt new file mode 100644 index 000000000..4b9aa0f1d --- /dev/null +++ b/portaudio-v19/pa_mac_core/notes.txt @@ -0,0 +1,124 @@ +Notes on status of CoreAudio Implementation of PortAudio + +Document Last Updated December 9, 2005 + +There are currently two implementations of PortAudio for Mac Core Audio. + +The original is in pa_mac_core_old.c, and the newer one is in pa_mac_core_auhal.c. +Only pa_mac_core_auhal.c is currently developed and supported as it uses apple's +current core audio technology. To select one of the implementations, copy the +appropriate file to pa_mac_core.c, (eg. "cp pa_mac_core_auhal.c pa_mac_core.c") +then run configure and make as usual. + +---------------------------------------- + +Notes on Original/Default implementation: + +by Phil Burk and Darren Gibbs + +Last updated March 20, 2002 + +WHAT WORKS + +Output with very low latency, <10 msec. +Half duplex input or output. +Full duplex on the same CoreAudio device. +The paFLoat32, paInt16, paInt8, paUInt8 sample formats. +Pa_GetCPULoad() +Pa_StreamTime() + +KNOWN BUGS OR LIMITATIONS + +We do not yet support simultaneous input and output on different +devices. Note that some CoreAudio devices like the Roland UH30 look +like one device but are actually two different CoreAudio devices. The +Built-In audio is typically one CoreAudio device. + +Mono doesn't work. + +DEVICE MAPPING + +CoreAudio devices can support both input and output. But the sample +rates supported may be different. So we have map one or two PortAudio +device to each CoreAudio device depending on whether it supports +input, output or both. + +When we query devices, we first get a list of CoreAudio devices. Then +we scan the list and add a PortAudio device for each CoreAudio device +that supports input. Then we make a scan for output devices. + +------------------------------------------- + +Notes on Newer AUHAL implementation: + +by Bjorn Roche + +Last Updated December 9, 2005 + +Principle of Operation: + +This implementation uses AUHAL for audio I/O. To some extent, it also +operates at the "HAL" Layer, though this behavior can be limited by +platform specific flags (see pa_mac_core.h for details). The default +settings should be reasonable: they don't change the SR of the device and +don't cause interruptions if other devices are using the device. + +Major Software Elements Used: Apple's HAL AUs provide output SR +conversion transparently, however, only on output, so this +implementation uses AudioConverters to convert the sample rate on input. +A PortAudio ring buffer is used to buffer input when sample rate +conversion is required or when separate audio units are used for duplex +IO. Finally, a PortAudio buffer processor is used to convert formats and +provide additional buffers if needed. Internally, interleaved floating +point data streams are used exclusively - the audio unit converts from +the audio hardware's native format to interleaved float PCM and +PortAudio's Buffer processor is used for conversion to user formats. + +Simplex Input: Simplex input uses a single callback. If sample rate +conversion is required, a ring buffer and AudioConverter are used as +well. + +Simplex output: Simplex output uses a single callback. No ring buffer or +audio converter is used because AUHAL does its own output SR conversion. + +Duplex, one device (no SR conversion): When one device is used, a single +callback is used. This achieves very low latency. + +Duplex, separate devices or SR conversion: When SR conversion is +required, data must be buffered before it is converted and data is not +always available at the same times on input and output, so SR conversion +requires the same treatment as separate devices. The input callback +reads data and puts it in the ring buffer. The output callback reads the +data off the ring buffer, into an audio converter and finally to the +buffer processor. + + + +Known issues: + +- Latency: Latency settings are ignored except when doing I/O between different +devices. Still, latency should be very low. + +- Timing info. It reports on stream time, but I'm probably doing something +wrong since patest_sine_time often reports negative latency numbers. + +- xrun detection: The only xrun detection performed is when reading +and writing the ring buffer. There is probably more that can be done. + +- abort/stop issues: stopping a stream is always a complete operation, +but latency should be low enough to make the lack of a separate abort +unnecessary. Apple clarifies its AudioOutputUnitStop() call here: +http://lists.apple.com/archives/coreaudio-api/2005/Dec/msg00055.html + +- blocking interface: Not implemented. + +- multichannel: I don't have a multichannel IO box, so I didn't test it. +It should work though ;) I haven't done anything with "channel maps" +yet, so it's possible that more needs to be done. + +- sample rate conversion quality: the input audio converter is set to +the highest quality. I don't do anything about the output converter, and +I am not sure how AUHAL manages quality. + +- x86: I haven't tested it on an x86 Mac, but I tried to be aware of it, so +it should work without too much trouble. diff --git a/portaudio-v19/pa_mac_core/pa_mac_core.h b/portaudio-v19/pa_mac_core/pa_mac_core.h new file mode 100644 index 000000000..9dbe51824 --- /dev/null +++ b/portaudio-v19/pa_mac_core/pa_mac_core.h @@ -0,0 +1,64 @@ +/* + * Mac spcific flags for PA. + * portaudio.h should be included before this file. + */ + +/* + * A pointer to a paMacCoreStreamInfo may be passed as + * the hostApiSpecificStreamInfo in the PaStreamParameters struct + * when opening a stream. Use NULL, for the defaults. Note that for + * duplex streams, both infos should be the same or behaviour + * is undefined. + */ +typedef struct paMacCoreStreamInfo +{ + unsigned long size; /**< size of whole structure including this header */ + PaHostApiTypeId hostApiType;/**< host API for which this data is intended */ + unsigned long version; /**< structure version */ + unsigned long flags; /* flags to modify behaviour */ +} paMacCoreStreamInfo; + +/* Use this function to initialize a paMacCoreStreamInfo struct + using the requested flags. */ +void paSetupMacCoreStreamInfo( paMacCoreStreamInfo *data, unsigned long flags ) +{ + bzero( data, sizeof( paMacCoreStreamInfo ) ); + data->size = sizeof( paMacCoreStreamInfo ); + data->hostApiType = paCoreAudio; + data->version = 0x01; + data->flags = flags; +} + +/* + * Here is the struct that shoul + */ + +/* + * The following flags alter the behaviour of PA on the mac platform. + * they can be ORed together. These should work both for opening and + * checking a device. + */ +/* Allows PortAudio to change things like the device's frame size, + * which allows for much lower latency, but might disrupt the device + * if other programs are using it. */ +const unsigned long paMacCore_ChangeDeviceParameters = 0x01; + +/* In combination with the above flag, + * causes the stream opening to fail, unless the exact sample rates + * are supported by the device. */ +const unsigned long paMacCore_FailIfConversionRequired = 0x02; + + + +/* + * Here are some "preset" combinations of flags (above) to get to some + * common configurations. THIS IS OVERKILL, but if more flags are added + * it won't be. + */ +/*This is the default setting: do as much sample rate conversion as possible + * and as little mucking with the device as possible. */ +const unsigned long paMacCorePlayNice = 0x00; +/*This setting is tuned for pro audio apps. It allows SR conversion on input + and output, but it tries to set the appropriate SR on the device.*/ +const unsigned long paMacCorePro = 0x01; + diff --git a/portaudio-v19/pa_mac_core/pa_mac_core_auhal.c b/portaudio-v19/pa_mac_core/pa_mac_core_auhal.c new file mode 100644 index 000000000..c447fd5a3 --- /dev/null +++ b/portaudio-v19/pa_mac_core/pa_mac_core_auhal.c @@ -0,0 +1,1934 @@ +/* + * This is the AUHAL implementation of portaudio. Hopefully this will + * one day replace pa_mac_core. + * + * Written by Bjorn Roche of XO Audio LLC, from PA skeleton code. + * Portions copied from code by Dominic Mazzoni (who wrote a HAL implementation) + * + * Dominic's code was based on code by Phil Burk, Darren Gibbs, + * Gord Peters, Stephane Letz, and Greg Pfiel. + * + * Bjorn Roche and XO Audio LLC reserve no rights to this code. + * The maintainers of PortAudio may redistribute and modify the code and + * licenses as they deam appropriate. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** + @file pa_mac_core + @author Bjorn Roche + @brief AUHAL implementation of PortAudio +*/ + +#include /* strlen(), memcmp() etc. */ + +#include +#include + + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" +#include "../pablio/ringbuffer.h" +#include "pa_mac_core.h" + +#ifndef MIN +#define MIN(a, b) (((a)<(b))?(a):(b)) +#endif + +#ifndef MAX +#define MAX(a, b) (((a)<(b))?(b):(a)) +#endif + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#define ERR(mac_error) PaMacCore_SetError(mac_error, __LINE__, 1 ) +#define WARNING(mac_error) PaMacCore_SetError(mac_error, __LINE__, 0 ) + +/* Help keep track of AUHAL element numbers */ +#define INPUT_ELEMENT (1) +#define OUTPUT_ELEMENT (0) + +/* Normal level of debugging */ +/* + */ +#define MAC_CORE_DEBUG +#ifdef MAC_CORE_DEBUG +# define DBUG(MSG) do { printf("||PaMacCore (AUHAL)|| "); printf MSG ; fflush(stdout); } while(0) +#else +# define DBUG(MSG) +#endif + +/* Very verbose debugging */ +/* +#define MAC_CORE_VERBOSE_DEBUG + */ +#ifdef MAC_CORE_VERBOSE_DEBUG +# define VDBUG(MSG) do { printf("||PaMacCore|| "); printf MSG ; fflush(stdout); } while(0) +#else +# define VDBUG(MSG) +#endif + +#define RING_BUFFER_ADVANCE_DENOMINATOR (4) + +/* Some utilities that sort of belong here, but were getting too unweildy */ +#include "pa_mac_core_utilities.c" +/* Special purpose ring buffer just for pa_mac_core input processing. */ +/* #include "pa_mac_core_input_ring_buffer.c" */ +#include "../pablio/ringbuffer.c" + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static OSStatus AudioIOProc( void *inRefCon, + AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList *ioData ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); +/* PaMacAUHAL - host api datastructure specific to this implementation */ +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ + long devCount; + AudioDeviceID *devIds; /*array of all audio devices*/ + AudioDeviceID defaultIn; + AudioDeviceID defaultOut; +} +PaMacAUHAL; + +/* stream data structure specifically for this implementation */ +typedef struct PaMacCoreStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + /* implementation specific data goes here */ + bool bufferProcessorIsInitialized; + AudioUnit inputUnit; + AudioUnit outputUnit; + AudioDeviceID inputDevice; + AudioDeviceID outputDevice; + size_t userInChan; + size_t userOutChan; + size_t inputFramesPerBuffer; + size_t outputFramesPerBuffer; + /* We use this ring buffer when input and out devs are different. */ + RingBuffer inputRingBuffer; + /* We may need to do SR conversion on input. */ + AudioConverterRef inputSRConverter; + /* We need to preallocate an inputBuffer for reading data. */ + AudioBufferList inputAudioBufferList; + AudioTimeStamp startTime; + volatile bool isTimeSet; + volatile PaStreamCallbackFlags xrunFlags; + volatile enum { + STOPPED = 0, /* playback is completely stopped, + and the user has called StopStream(). */ + CALLBACK_STOPPED = 1, /* callback has requested stop, + but user has not yet called StopStream(). */ + STOPPING = 2, /* The stream is in the process of closing. + This state is just used internally; + externally it is indistinguishable from + ACTIVE.*/ + ACTIVE = 3 /* The stream is active and running. */ + } state; + double sampleRate; +} +PaMacCoreStream; + +static PaError OpenAndSetupOneAudioUnit( + const PaStreamParameters *inStreamParams, + const PaStreamParameters *outStreamParams, + const unsigned long requestedFramesPerBuffer, + unsigned long *actualInputFramesPerBuffer, + unsigned long *actualOutputFramesPerBuffer, + const PaMacAUHAL *auhalHostApi, + AudioUnit *audioUnit, + AudioConverterRef *srConverter, + AudioDeviceID *audioDevice, + const double sampleRate, + void *refCon ); + +/* for setting errors. */ +#define PA_AUHAL_SET_LAST_HOST_ERROR( errorCode, errorText ) \ + PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText ) + + + + +/*currently, this is only used in initialization, but it might be modified + to be used when the list of devices changes.*/ +static PaError gatherDeviceInfo(PaMacAUHAL *auhalHostApi) +{ + UInt32 size; + UInt32 propsize; + /* -- free any previous allocations -- */ + if( auhalHostApi->devIds ) + PaUtil_GroupFreeMemory(auhalHostApi->allocations, auhalHostApi->devIds); + auhalHostApi->devIds = NULL; + + /* -- figure out how many devices there are -- */ + AudioHardwareGetPropertyInfo( kAudioHardwarePropertyDevices, + &propsize, + NULL ); + auhalHostApi->devCount = propsize / sizeof( AudioDeviceID ); + + VDBUG( ( "Found %ld device(s).\n", auhalHostApi->devCount ) ); + + /* -- copy the device IDs -- */ + auhalHostApi->devIds = (AudioDeviceID *)PaUtil_GroupAllocateMemory( + auhalHostApi->allocations, + propsize ); + if( !auhalHostApi->devIds ) + return paInsufficientMemory; + AudioHardwareGetProperty( kAudioHardwarePropertyDevices, + &propsize, + auhalHostApi->devIds ); +#ifdef MAC_CORE_VERBOSE_DEBUG + { + int i; + for( i=0; idevCount; ++i ) + printf( "Device %d\t: %ld\n", i, auhalHostApi->devIds[i] ); + } +#endif + + size = sizeof(AudioDeviceID); + auhalHostApi->defaultIn = kAudioDeviceUnknown; + auhalHostApi->defaultOut = kAudioDeviceUnknown; + /* FEEDBACK: these calls could fail, in which case default in and out will + be unknown devices or could be undefined. Do I need to be more + rigorous here? */ + AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, + &size, + &auhalHostApi->defaultIn); + AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, + &size, + &auhalHostApi->defaultOut); + VDBUG( ( "Default in : %ld\n", auhalHostApi->defaultIn ) ); + VDBUG( ( "Default out: %ld\n", auhalHostApi->defaultOut ) ); + + return paNoError; +} + +static PaError GetChannelInfo( PaMacAUHAL *auhalHostApi, + PaDeviceInfo *deviceInfo, + AudioDeviceID macCoreDeviceId, + int isInput) +{ + UInt32 propSize; + PaError err = paNoError; + UInt32 i; + int numChannels = 0; + AudioBufferList *buflist; + UInt32 frameLatency; + + /* Get the number of channels from the stream configuration. + Fail if we can't get this. */ + + err = ERR(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, NULL)); + if (err) + return err; + + buflist = PaUtil_AllocateMemory(propSize); + err = ERR(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, buflist)); + if (err) + return err; + + for (i = 0; i < buflist->mNumberBuffers; ++i) + numChannels += buflist->mBuffers[i].mNumberChannels; + + if (isInput) + deviceInfo->maxInputChannels = numChannels; + else + deviceInfo->maxOutputChannels = numChannels; + + /* Get the latency. Don't fail if we can't get this. */ + /* default to something reasonable */ + deviceInfo->defaultLowInputLatency = .01; + deviceInfo->defaultHighInputLatency = .01; + propSize = sizeof(UInt32); + err = WARNING(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyLatency, &propSize, &frameLatency)); + if (!err) { + double secondLatency = frameLatency / deviceInfo->defaultSampleRate; + if (isInput) { + deviceInfo->defaultLowInputLatency = secondLatency; + deviceInfo->defaultHighInputLatency = secondLatency; + } + else { + deviceInfo->defaultLowOutputLatency = secondLatency; + deviceInfo->defaultHighOutputLatency = secondLatency; + } + } + return paNoError; +} + +static PaError InitializeDeviceInfo( PaMacAUHAL *auhalHostApi, + PaDeviceInfo *deviceInfo, + AudioDeviceID macCoreDeviceId, + PaHostApiIndex hostApiIndex ) +{ + Float64 sampleRate; + char *name; + PaError err = paNoError; + UInt32 propSize; + + memset(deviceInfo, 0, sizeof(deviceInfo)); + + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + /* Get the device name. Fail if we can't get it. */ + err = ERR(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, NULL)); + if (err) + return err; + + name = PaUtil_GroupAllocateMemory(auhalHostApi->allocations,propSize); + if ( !name ) + return paInsufficientMemory; + err = ERR(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, name)); + if (err) + return err; + deviceInfo->name = name; + + /* Try to get the default sample rate. Don't fail if we can't get this. */ + propSize = sizeof(Float64); + err = ERR(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyNominalSampleRate, &propSize, &sampleRate)); + if (err) + deviceInfo->defaultSampleRate = 0.0; + else + deviceInfo->defaultSampleRate = sampleRate; + + /* Get the maximum number of input and output channels. Fail if we can't get this. */ + + err = GetChannelInfo(auhalHostApi, deviceInfo, macCoreDeviceId, 1); + if (err) + return err; + + err = GetChannelInfo(auhalHostApi, deviceInfo, macCoreDeviceId, 0); + if (err) + return err; + + return paNoError; +} + +PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i; + PaMacAUHAL *auhalHostApi; + PaDeviceInfo *deviceInfoArray; + + auhalHostApi = (PaMacAUHAL*)PaUtil_AllocateMemory( sizeof(PaMacAUHAL) ); + if( !auhalHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + auhalHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !auhalHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + auhalHostApi->devIds = NULL; + auhalHostApi->devCount = 0; + + /* get the info we need about the devices */ + result = gatherDeviceInfo( auhalHostApi ); + if( result != paNoError ) + goto error; + + *hostApi = &auhalHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paCoreAudio; + (*hostApi)->info.name = "Core Audio"; + + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + + (*hostApi)->info.deviceCount = 0; + + if( auhalHostApi->devCount > 0 ) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + auhalHostApi->allocations, sizeof(PaDeviceInfo*) * auhalHostApi->devCount); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + auhalHostApi->allocations, sizeof(PaDeviceInfo) * auhalHostApi->devCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < auhalHostApi->devCount; ++i ) + { + int err; + err = InitializeDeviceInfo( auhalHostApi, &deviceInfoArray[i], + auhalHostApi->devIds[i], + hostApiIndex ); + if (err == paNoError) + { /* copy some info and set the defaults */ + (*hostApi)->deviceInfos[(*hostApi)->info.deviceCount] = &deviceInfoArray[i]; + if (auhalHostApi->devIds[i] == auhalHostApi->defaultIn) + (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; + if (auhalHostApi->devIds[i] == auhalHostApi->defaultOut) + (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount; + (*hostApi)->info.deviceCount++; + } + else + { /* there was an error. we need to shift the devices down, so we ignore this one */ + int j; + auhalHostApi->devCount--; + for( j=i; jdevCount; ++j ) + auhalHostApi->devIds[j] = auhalHostApi->devIds[j+1]; + i--; + } + } + } + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &auhalHostApi->callbackStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, + IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &auhalHostApi->blockingStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, + IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, + GetStreamReadAvailable, + GetStreamWriteAvailable ); + + return result; + +error: + if( auhalHostApi ) + { + if( auhalHostApi->allocations ) + { + PaUtil_FreeAllAllocations( auhalHostApi->allocations ); + PaUtil_DestroyAllocationGroup( auhalHostApi->allocations ); + } + + PaUtil_FreeMemory( auhalHostApi ); + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaMacAUHAL *auhalHostApi = (PaMacAUHAL*)hostApi; + + /* + IMPLEMENT ME: + - clean up any resources not handled by the allocation group + TODO: Double check that everything is handled by alloc group + */ + + if( auhalHostApi->allocations ) + { + PaUtil_FreeAllAllocations( auhalHostApi->allocations ); + PaUtil_DestroyAllocationGroup( auhalHostApi->allocations ); + } + + PaUtil_FreeMemory( auhalHostApi ); +} + + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + /** These first checks are standard PA checks. We do some fancier checks + later. */ + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support outputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + } + else + { + outputChannelCount = 0; + } + + /* FEEDBACK */ + /* I think the only way to check a given format SR combo is */ + /* to try opening it. This could be disruptive, is that Okay? */ + /* The alternative is to just read off available sample rates, */ + /* but this will not work %100 of the time (eg, a device that */ + /* supports N output at one rate but only N/2 at a higher rate.)*/ + + /* The following code opens the device with the requested parameters to + see if it works. */ + { + PaError err; + PaStream *s; + err = OpenStream( hostApi, &s, inputParameters, outputParameters, + sampleRate, 1024, 0, (PaStreamCallback *)1, NULL ); + if( err != paNoError && err != paInvalidSampleRate ) + DBUG( ( "OpenStream @ %g returned: %d: %s\n", + (float) sampleRate, err, Pa_GetErrorText( err ) ) ); + if( err ) + return err; + err = CloseStream( s ); + if( err ) { + /* FEEDBACK: is this more serious? should we assert? */ + DBUG( ( "WARNING: could not close Stream. %d: %s\n", + err, Pa_GetErrorText( err ) ) ); + } + } + + return paFormatIsSupported; +} + +static PaError OpenAndSetupOneAudioUnit( + const PaStreamParameters *inStreamParams, + const PaStreamParameters *outStreamParams, + const unsigned long requestedFramesPerBuffer, + unsigned long *actualInputFramesPerBuffer, + unsigned long *actualOutputFramesPerBuffer, + const PaMacAUHAL *auhalHostApi, + AudioUnit *audioUnit, + AudioConverterRef *srConverter, + AudioDeviceID *audioDevice, + const double sampleRate, + void *refCon ) +{ + ComponentDescription desc; + Component comp; + /*An Apple TN suggests using CAStreamBasicDescription, but that is C++*/ + AudioStreamBasicDescription desiredFormat; + OSErr result = noErr; + PaError paResult = paNoError; + int line; + UInt32 callbackKey; + AURenderCallbackStruct rcbs; + unsigned long macInputStreamFlags = paMacCorePlayNice; + unsigned long macOutputStreamFlags = paMacCorePlayNice; + + /*change the flags here, if desired, for testing.*/ + /*macInputStreamInfo = macOutputStreamInfo = paMacCore_ChangeDeviceParameters ;*/ + + /* -- handle the degenerate case -- */ + if( !inStreamParams && !outStreamParams ) { + *audioUnit = NULL; + *audioDevice = kAudioDeviceUnknown; + return paNoError; + } + + /* -- get the user's api specific info, if they set any -- */ + if( inStreamParams && inStreamParams->hostApiSpecificStreamInfo ) + macInputStreamFlags= + ((paMacCoreStreamInfo*)inStreamParams->hostApiSpecificStreamInfo) + ->flags; + if( outStreamParams && outStreamParams->hostApiSpecificStreamInfo ) + macOutputStreamFlags= + ((paMacCoreStreamInfo*)outStreamParams->hostApiSpecificStreamInfo) + ->flags; + + /* + * The HAL AU is a Mac OS style "component". + * the first few steps deal with that. + * Later steps work on a combination of Mac OS + * components and the slightly lower level + * HAL. + */ + + /* -- describe the output type AudioUnit -- */ + /* Note: for the default AudioUnit, we could use the + * componentSubType value kAudioUnitSubType_DefaultOutput; + * but I don't think that's relevant here. + */ + desc.componentType = kAudioUnitType_Output; + desc.componentSubType = kAudioUnitSubType_HALOutput; + desc.componentManufacturer = kAudioUnitManufacturer_Apple; + desc.componentFlags = 0; + desc.componentFlagsMask = 0; + /* -- find the component -- */ + comp = FindNextComponent( NULL, &desc ); + if( !comp ) + { + DBUG( ( "AUHAL component not found." ) ); + *audioUnit = NULL; + *audioDevice = kAudioDeviceUnknown; + return paUnanticipatedHostError; + } + /* -- open it -- */ + result = OpenAComponent( comp, audioUnit ); + if( result ) + { + DBUG( ( "Failed to open AUHAL component." ) ); + *audioUnit = NULL; + *audioDevice = kAudioDeviceUnknown; + return ERR( result ); + } + /* -- prepare a little error handling logic / hackery -- */ +#define ERR_WRAP(mac_err) do { result = mac_err ; line = __LINE__ ; if ( result != noErr ) goto error ; } while(0) + + /* -- if there is input, we have to explicitly enable input -- */ + if( inStreamParams ) + { + UInt32 enableIO; + enableIO = 1; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Input, + INPUT_ELEMENT, + &enableIO, + sizeof(enableIO) ) ); + } + /* -- if there is no output, we must explicitly disable output -- */ + if( !outStreamParams ) + { + UInt32 enableIO; + enableIO = 0; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Output, + OUTPUT_ELEMENT, + &enableIO, + sizeof(enableIO) ) ); + } + /* -- set the devices -- */ + /* make sure input and output are the same device if we are doing input and + output. */ + if( inStreamParams && outStreamParams ) + assert( outStreamParams->device == inStreamParams->device ); + if( inStreamParams ) + { + *audioDevice = auhalHostApi->devIds[inStreamParams->device] ; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, + INPUT_ELEMENT, + audioDevice, + sizeof(AudioDeviceID) ) ); + } + if( outStreamParams ) + { + *audioDevice = auhalHostApi->devIds[outStreamParams->device] ; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, + OUTPUT_ELEMENT, + audioDevice, + sizeof(AudioDeviceID) ) ); + } + + /* -- set format -- */ + bzero( &desiredFormat, sizeof(desiredFormat) ); + desiredFormat.mFormatID = kAudioFormatLinearPCM ; + desiredFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; + desiredFormat.mFramesPerPacket = 1; + desiredFormat.mBitsPerChannel = sizeof( float ) * 8; + + result = 0; + /* set device format first, but only touch the device if the user asked */ + if( inStreamParams ) { + /*The callback never calls back if we don't set the FPB */ + /*This seems wierd, because I would think setting anything on the device + would be disruptive.*/ + paResult = setBestFramesPerBuffer( *audioDevice, FALSE, + requestedFramesPerBuffer, + actualInputFramesPerBuffer ); + if( paResult ) goto error; + if( macInputStreamFlags & paMacCore_ChangeDeviceParameters ) { + bool requireExact; + requireExact=macInputStreamFlags&paMacCore_FailIfConversionRequired; + paResult = setBestSampleRateForDevice( *audioDevice, FALSE, + requireExact, sampleRate ); + if( paResult ) goto error; + } + if( actualInputFramesPerBuffer && actualOutputFramesPerBuffer ) + *actualOutputFramesPerBuffer = *actualInputFramesPerBuffer ; + } + if( outStreamParams && !inStreamParams ) { + /*The callback never calls back if we don't set the FPB */ + /*This seems wierd, because I would think setting anything on the device + would be disruptive.*/ + paResult = setBestFramesPerBuffer( *audioDevice, TRUE, + requestedFramesPerBuffer, + actualOutputFramesPerBuffer ); + if( paResult ) goto error; + if( macOutputStreamFlags & paMacCore_ChangeDeviceParameters ) { + bool requireExact; + requireExact=macOutputStreamFlags&paMacCore_FailIfConversionRequired; + paResult = setBestSampleRateForDevice( *audioDevice, TRUE, + requireExact, sampleRate ); + if( paResult ) goto error; + } + } + /* now set the format on the Audio Units. */ + if( outStreamParams ) + { + desiredFormat.mSampleRate =sampleRate; + desiredFormat.mBytesPerPacket=sizeof(float)*outStreamParams->channelCount; + desiredFormat.mBytesPerFrame =sizeof(float)*outStreamParams->channelCount; + desiredFormat.mChannelsPerFrame = outStreamParams->channelCount; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, + OUTPUT_ELEMENT, + &desiredFormat, + sizeof(AudioStreamBasicDescription) ) ); + } + if( inStreamParams ) + { + AudioStreamBasicDescription sourceFormat; + UInt32 size = sizeof( AudioStreamBasicDescription ); + + /* keep the sample rate of the device, or we confuse AUHAL */ + ERR_WRAP( AudioUnitGetProperty( *audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, + INPUT_ELEMENT, + &sourceFormat, + &size ) ); + desiredFormat.mSampleRate = sourceFormat.mSampleRate; + desiredFormat.mBytesPerPacket=sizeof(float)*inStreamParams->channelCount; + desiredFormat.mBytesPerFrame =sizeof(float)*inStreamParams->channelCount; + desiredFormat.mChannelsPerFrame = inStreamParams->channelCount; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Output, + INPUT_ELEMENT, + &desiredFormat, + sizeof(AudioStreamBasicDescription) ) ); + } + /* set the maximumFramesPerSlice */ + /* not doing this causes real problems + (eg. the callback might not be called). The idea of setting both this + and the frames per buffer on the device is that we'll be most likely + to actually get the frame size we requested in the callback with the + minimum latency. */ + if( outStreamParams ) { + UInt32 size = sizeof( *actualOutputFramesPerBuffer ); + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioUnitProperty_MaximumFramesPerSlice, + kAudioUnitScope_Input, + OUTPUT_ELEMENT, + actualOutputFramesPerBuffer, + sizeof(unsigned long) ) ); + ERR_WRAP( AudioUnitGetProperty( *audioUnit, + kAudioUnitProperty_MaximumFramesPerSlice, + kAudioUnitScope_Global, + OUTPUT_ELEMENT, + actualOutputFramesPerBuffer, + &size ) ); + } + if( inStreamParams ) { + /*UInt32 size = sizeof( *actualInputFramesPerBuffer );*/ + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioUnitProperty_MaximumFramesPerSlice, + kAudioUnitScope_Output, + INPUT_ELEMENT, + actualInputFramesPerBuffer, + sizeof(unsigned long) ) ); +/* Don't know why this causes problems + ERR_WRAP( AudioUnitGetProperty( *audioUnit, + kAudioUnitProperty_MaximumFramesPerSlice, + kAudioUnitScope_Global, //Output, + INPUT_ELEMENT, + actualInputFramesPerBuffer, + &size ) ); +*/ + } + + /* -- if we have input, we may need to setup an SR converter -- */ + /* even if we got the sample rate we asked for, we need to do + the conversion in case another program changes the underlying SR. */ + /* FIXME: I think we need to monitor stream and change the converter if the incoming format changes. */ + if( inStreamParams ) { + AudioStreamBasicDescription desiredFormat; + AudioStreamBasicDescription sourceFormat; + UInt32 sourceSize = sizeof( sourceFormat ); + bzero( &desiredFormat, sizeof(desiredFormat) ); + desiredFormat.mSampleRate = sampleRate; + desiredFormat.mFormatID = kAudioFormatLinearPCM ; + desiredFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; + desiredFormat.mFramesPerPacket = 1; + desiredFormat.mBitsPerChannel = sizeof( float ) * 8; + desiredFormat.mBytesPerPacket=sizeof(float)*inStreamParams->channelCount; + desiredFormat.mBytesPerFrame =sizeof(float)*inStreamParams->channelCount; + desiredFormat.mChannelsPerFrame = inStreamParams->channelCount; + + /* get the source format */ + ERR_WRAP( AudioUnitGetProperty( + *audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Output, + INPUT_ELEMENT, + &sourceFormat, + &sourceSize ) ); + + if( desiredFormat.mSampleRate != sourceFormat.mSampleRate ) + { + UInt32 value = kAudioConverterQuality_Max; + VDBUG(( "Creating sample rate converter for input" + " to convert from %g to %g\n", + (float)sourceFormat.mSampleRate, + (float)desiredFormat.mSampleRate ) ); + /* create our converter */ + ERR_WRAP( AudioConverterNew( + &sourceFormat, + &desiredFormat, + srConverter ) ); + /* Use highest quality */ + ERR_WRAP( AudioConverterSetProperty( + *srConverter, + kAudioConverterSampleRateConverterQuality, + sizeof( value ), + &value ) ); + } + } + /* -- set IOProc (callback) -- */ + callbackKey = outStreamParams ? kAudioUnitProperty_SetRenderCallback + : kAudioOutputUnitProperty_SetInputCallback ; + rcbs.inputProc = AudioIOProc; + rcbs.inputProcRefCon = refCon; + ERR_WRAP( AudioUnitSetProperty( + *audioUnit, + callbackKey, + kAudioUnitScope_Output, + outStreamParams ? OUTPUT_ELEMENT : INPUT_ELEMENT, + &rcbs, + sizeof(rcbs)) ); + + if( inStreamParams && outStreamParams && *srConverter ) + ERR_WRAP( AudioUnitSetProperty( + *audioUnit, + kAudioOutputUnitProperty_SetInputCallback, + kAudioUnitScope_Output, + INPUT_ELEMENT, + &rcbs, + sizeof(rcbs)) ); + + /*IMPLEMENTME: may need to worry about channel mapping.*/ + + /* initialize the audio unit */ + ERR_WRAP( AudioUnitInitialize(*audioUnit) ); + + if( inStreamParams && outStreamParams ) + VDBUG( ("Opened device %ld for input and output.\n", *audioDevice ) ); + else if( inStreamParams ) + VDBUG( ("Opened device %ld for input.\n", *audioDevice ) ); + else if( outStreamParams ) + VDBUG( ("Opened device %ld for output.\n", *audioDevice ) ); + return paNoError; +#undef ERR_WRAP + + error: + CloseComponent( *audioUnit ); + *audioUnit = NULL; + if( result ) + return PaMacCore_SetError( result, line, 1 ); + return paResult; +} + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaMacAUHAL *auhalHostApi = (PaMacAUHAL*)hostApi; + PaMacCoreStream *stream = 0; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + VDBUG( ("Opening Stream.\n") ); + + /*These first few bits of code are from paSkeleton with few modifications.*/ + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* Host supports interleaved float32 */ + hostInputSampleFormat = paFloat32; + } + else + { + inputChannelCount = 0; + inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* Host supports interleaved float32 */ + hostOutputSampleFormat = paFloat32; + } + else + { + outputChannelCount = 0; + outputSampleFormat = hostOutputSampleFormat = paFloat32; /* Surpress 'uninitialized var' warnings. */ + } + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + stream = (PaMacCoreStream*)PaUtil_AllocateMemory( sizeof(PaMacCoreStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + + /* If we fail after this point, we my be left in a bad state, with + some data structures setup and others not. So, first thing we + do is initialize everything so that if we fail, we know what hasn't + been touched. + */ + + stream->inputAudioBufferList.mBuffers[0].mData = NULL; + stream->inputRingBuffer.buffer = NULL; + stream->inputSRConverter = NULL; + stream->inputUnit = NULL; + stream->outputUnit = NULL; + stream->inputFramesPerBuffer = 0; + stream->outputFramesPerBuffer = 0; + stream->bufferProcessorIsInitialized = FALSE; + + assert( streamCallback ) ; /* only callback mode is implemented */ + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &auhalHostApi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &auhalHostApi->blockingStreamInterface, streamCallback, userData ); + } + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + /* -- Now we actually open and setup streams. -- */ + if( inputParameters && outputParameters && outputParameters->device == inputParameters->device ) + { /* full duplex. One device. */ + result = OpenAndSetupOneAudioUnit( inputParameters, + outputParameters, + framesPerBuffer, + &(stream->inputFramesPerBuffer), + &(stream->outputFramesPerBuffer), + auhalHostApi, + &(stream->inputUnit), + &(stream->inputSRConverter), + &(stream->inputDevice), + sampleRate, + stream ); + stream->outputUnit = stream->inputUnit; + stream->outputDevice = stream->inputDevice; + if( result != paNoError ) + goto error; + } + else + { /* full duplex, different devices OR simplex */ + result = OpenAndSetupOneAudioUnit( NULL, + outputParameters, + framesPerBuffer, + NULL, + &(stream->outputFramesPerBuffer), + auhalHostApi, + &(stream->outputUnit), + NULL, + &(stream->outputDevice), + sampleRate, + stream ); + if( result != paNoError ) + goto error; + result = OpenAndSetupOneAudioUnit( inputParameters, + NULL, + framesPerBuffer, + &(stream->inputFramesPerBuffer), + NULL, + auhalHostApi, + &(stream->inputUnit), + &(stream->inputSRConverter), + &(stream->inputDevice), + sampleRate, + stream ); + if( result != paNoError ) + goto error; + } + + if( stream->inputUnit ) { + const size_t szfl = sizeof(float); + /* setup the AudioBufferList used for input */ + bzero( &stream->inputAudioBufferList, sizeof( AudioBufferList ) ); + stream->inputAudioBufferList.mNumberBuffers = 1; + stream->inputAudioBufferList.mBuffers[0].mNumberChannels + = inputChannelCount; + stream->inputAudioBufferList.mBuffers[0].mDataByteSize + = stream->inputFramesPerBuffer*inputChannelCount*szfl; + stream->inputAudioBufferList.mBuffers[0].mData + = (float *) calloc( + stream->inputFramesPerBuffer*inputChannelCount, + szfl ); + if( !stream->inputAudioBufferList.mBuffers[0].mData ) + { + result = paInsufficientMemory; + goto error; + } + + /* + * If input and output devs are different or we are doing SR conversion, + * we also need a + * ring buffer to store inpt data while waiting for output + * data. + */ + if( (stream->outputUnit && stream->inputUnit != stream->outputUnit) + || stream->inputSRConverter ) + { + /* May want the ringSize ot initial position in + ring buffer to depend somewhat on sample rate change */ + /* Calculate an appropriate ring buffer size. It must be at least + 3x framesPerBuffer and 2x suggested latency and it must be a + power of 2. FEEDBACK: too liberal/conservative/another way?*/ + double latency; + int index, i; + void *data; + long ringSize; + if( !outputParameters ) + latency = inputParameters->suggestedLatency; + else + latency = MAX( inputParameters->suggestedLatency, + outputParameters->suggestedLatency ); + ringSize = latency * sampleRate * 2 * inputChannelCount; + VDBUG( ( "suggested latency: %d\n", (int) (latency*sampleRate) ) ); + if( ringSize < stream->inputFramesPerBuffer * 3 ) + ringSize = stream->inputFramesPerBuffer * 3 * inputChannelCount; + if( outputParameters && ringSize < stream->outputFramesPerBuffer * 3 ) + ringSize = stream->outputFramesPerBuffer * 3 * inputChannelCount; + VDBUG(("inFramesPerBuffer:%d\n",(int)stream->inputFramesPerBuffer)); + if( outputParameters ) + VDBUG(("outFramesPerBuffer:%d\n", + (int)stream->outputFramesPerBuffer)); + VDBUG(("Ringbuffer size (1): %d\n", (int)ringSize )); + + /* round up to the next power of 2 */ + index = -1; + for( i=0; i> i & 0x01 ) + index = i; + assert( index > 0 ); + if( ringSize <= ( 0x01 << index ) ) + ringSize = 0x01 << index ; + else + ringSize = 0x01 << ( index + 1 ); + + /*ringSize <<= 4; *//*16x bigger, for testing */ + + VDBUG(( "Final Ringbuffer size (2): %d\n", (int)ringSize )); + + /*now, we need to allocate memory for the ring buffer*/ + data = calloc( ringSize, szfl ); + if( !data ) + { + result = paInsufficientMemory; + goto error; + } + + /* now we can initialize the ring buffer */ + assert( 0 == + RingBuffer_Init( &stream->inputRingBuffer, + ringSize*szfl, data ) ); + /* advance the read point a little, so we are reading from the + middle of the buffer */ + if( stream->outputUnit ) + RingBuffer_AdvanceWriteIndex( &stream->inputRingBuffer, ringSize*szfl / RING_BUFFER_ADVANCE_DENOMINATOR ); + } + } + + /* -- initialize Buffer Processor -- */ + { + unsigned long maxHostFrames = stream->inputFramesPerBuffer; + if( stream->outputFramesPerBuffer > maxHostFrames ) + maxHostFrames = stream->outputFramesPerBuffer; + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, + hostInputSampleFormat, + outputChannelCount, outputSampleFormat, + hostOutputSampleFormat, + sampleRate, + streamFlags, + framesPerBuffer, + /* If sample rate conversion takes place, the buffer size + will not be known. */ + maxHostFrames, + stream->inputSRConverter + ? paUtilUnknownHostBufferSize + : paUtilBoundedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ) + goto error; + } + stream->bufferProcessorIsInitialized = TRUE; + + /* + IMPLEMENT ME: initialise the following fields with estimated or actual + values. + I think this is okay the way it is br 12/1/05 + maybe need to change input latency estimate if IO devs differ + */ + stream->streamRepresentation.streamInfo.inputLatency = + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor); + stream->streamRepresentation.streamInfo.outputLatency = + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor); + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + stream->sampleRate = sampleRate; + stream->userInChan = inputChannelCount; + stream->userOutChan = outputChannelCount; + + stream->isTimeSet = FALSE; + stream->state = STOPPED; + stream->xrunFlags = 0; + + *s = (PaStream*)stream; + + return result; + +error: + CloseStream( stream ); + return result; +} + +PaTime GetStreamTime( PaStream *s ) +{ + /* FIXME: I am not at all sure this timing info stuff is right. + patest_sine_time reports negative latencies, which is wierd.*/ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + AudioTimeStamp timeStamp; + + if ( !stream->isTimeSet ) + return (PaTime)0; + + if ( stream->outputDevice ) + AudioDeviceGetCurrentTime( stream->outputDevice, &timeStamp); + else if ( stream->inputDevice ) + AudioDeviceGetCurrentTime( stream->inputDevice, &timeStamp); + else + return (PaTime)0; + + return (PaTime)(timeStamp.mSampleTime - stream->startTime.mSampleTime)/stream->sampleRate; +} + +static void setStreamStartTime( PaMacCoreStream *stream ) +{ + /* FIXME: I am not at all sure this timing info stuff is right. + patest_sine_time reports negative latencies, which is wierd.*/ + if( stream->inputDevice ) + AudioDeviceGetCurrentTime( stream->inputDevice, &stream->startTime); + else + AudioDeviceGetCurrentTime( stream->outputDevice, &stream->startTime); +} + + +static PaTime TimeStampToSecs(PaMacCoreStream *stream, const AudioTimeStamp* timeStamp) +{ + if (timeStamp->mFlags & kAudioTimeStampSampleTimeValid) + return (timeStamp->mSampleTime / stream->sampleRate); + else + return 0; +} + +#define RING_BUFFER_EMPTY (1000) + +static OSStatus ringBufferIOProc( AudioConverterRef inAudioConverter, + UInt32*ioDataSize, + void** outData, + void*inUserData ) +{ + void *dummyData; + long dummySize; + RingBuffer *rb = (RingBuffer *) inUserData; + + assert( sizeof( UInt32 ) == sizeof( long ) ); + if( RingBuffer_GetReadAvailable( rb ) == 0 ) { + *outData = NULL; + *ioDataSize = 0; + return RING_BUFFER_EMPTY; + } + RingBuffer_GetReadRegions( rb, *ioDataSize, + outData, (long *)ioDataSize, + &dummyData, &dummySize ); + + assert( *ioDataSize ); + RingBuffer_AdvanceReadIndex( rb, *ioDataSize ); + + return noErr; +} + +/* + * Called by the AudioUnit API to process audio from the sound card. + * This is where the magic happens. + */ +/* FEEDBACK: there is a lot of redundant code here because of how all the cases differ. This makes it hard to maintain, so if there are suggestinos for cleaning it up, I'm all ears. */ +static OSStatus AudioIOProc( void *inRefCon, + AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList *ioData ) +{ + unsigned long framesProcessed = 0; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; + PaMacCoreStream *stream = (PaMacCoreStream*)inRefCon; + const bool isRender = inBusNumber == OUTPUT_ELEMENT; + int callbackResult = paContinue ; + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + if( !stream->isTimeSet ) + setStreamStartTime( stream ); + stream->isTimeSet = TRUE; + + + /* -----------------------------------------------------------------*\ + This output may be useful for debugging, + But printing durring the callback is a bad enough idea that + this is not enabled by enableing the usual debugging calls. + \* -----------------------------------------------------------------*/ + /* + static int renderCount = 0; + static int inputCount = 0; + printf( "------------------- starting reder/input\n" ); + if( isRender ) + printf("Render callback (%d):\t", ++renderCount); + else + printf("Input callback (%d):\t", ++inputCount); + printf( "Call totals: %d (input), %d (render)\n", inputCount, renderCount ); + + printf( "--- inBusNumber: %lu\n", inBusNumber ); + printf( "--- inNumberFrames: %lu\n", inNumberFrames ); + printf( "--- %x ioData\n", (unsigned) ioData ); + if( ioData ) + { + int i=0; + printf( "--- ioData.mNumBuffers %lu: \n", ioData->mNumberBuffers ); + for( i=0; imNumberBuffers; ++i ) + printf( "--- ioData buffer %d size: %lu.\n", i, ioData->mBuffers[i].mDataByteSize ); + } + ----------------------------------------------------------------- */ + + if( isRender ) { + AudioTimeStamp currentTime; + timeInfo.outputBufferDacTime = TimeStampToSecs(stream, inTimeStamp); + AudioDeviceGetCurrentTime(stream->outputDevice, ¤tTime); + timeInfo.currentTime = TimeStampToSecs(stream, ¤tTime); + } + if( isRender && stream->inputUnit == stream->outputUnit ) + timeInfo.inputBufferAdcTime = TimeStampToSecs(stream, inTimeStamp); + if( !isRender ) { + AudioTimeStamp currentTime; + timeInfo.inputBufferAdcTime = TimeStampToSecs(stream, inTimeStamp); + AudioDeviceGetCurrentTime(stream->inputDevice, ¤tTime); + timeInfo.currentTime = TimeStampToSecs(stream, ¤tTime); + } + + + if( isRender && stream->inputUnit == stream->outputUnit + && !stream->inputSRConverter ) + { + /* --------- Full Duplex, One Device, no SR Conversion ------- + * + * This is the lowest latency case, and also the simplest. + * Input data and output data are available at the same time. + * we do not use the input SR converter or the input ring buffer. + * + */ + OSErr err = 0; + unsigned long frames; + int callbackResult; + + /* -- start processing -- */ + PaUtil_BeginBufferProcessing( &(stream->bufferProcessor), + &timeInfo, + stream->xrunFlags ); + stream->xrunFlags = 0; + + /* -- compute frames. do some checks -- */ + assert( ioData->mNumberBuffers == 1 ); + assert( ioData->mBuffers[0].mNumberChannels == stream->userOutChan ); + frames = ioData->mBuffers[0].mDataByteSize; + frames /= sizeof( float ) * ioData->mBuffers[0].mNumberChannels; + /* -- copy and process input data -- */ + err= AudioUnitRender(stream->inputUnit, + ioActionFlags, + inTimeStamp, + INPUT_ELEMENT, + inNumberFrames, + &stream->inputAudioBufferList ); + /* FEEDBACK: I'm not sure what to do when this call fails */ + assert( !err ); + + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + stream->inputAudioBufferList.mBuffers[0].mData, + stream->inputAudioBufferList.mBuffers[0].mNumberChannels); + /* -- Copy and process output data -- */ + PaUtil_SetOutputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedOutputChannels( &(stream->bufferProcessor), + 0, + ioData->mBuffers[0].mData, + ioData->mBuffers[0].mNumberChannels); + /* -- complete processing -- */ + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + else if( isRender ) + { + /* -------- Output Side of Full Duplex (Separate Devices or SR Conversion) + * -- OR Simplex Output + * + * This case handles output data as in the full duplex case, + * and, if there is input data, reads it off the ring buffer + * and into the PA buffer processor. If sample rate conversion + * is required on input, that is done here as well. + */ + unsigned long frames; + + /* Sometimes, when stopping a duplex stream we get erroneous + xrun flags, so if this is our last run, clear the flags. */ + int xrunFlags = stream->xrunFlags; + if( xrunFlags & paInputUnderflow ) + printf( "input underflow.\n" ); + if( xrunFlags & paInputOverflow ) + printf( "input overflow.\n" ); + if( stream->state == STOPPING || stream->state == CALLBACK_STOPPED ) + xrunFlags = 0; + + /* -- start processing -- */ + PaUtil_BeginBufferProcessing( &(stream->bufferProcessor), + &timeInfo, + xrunFlags ); + stream->xrunFlags = 0; /* FEEDBACK: we only send flags to Buf Proc once */ + + /* -- Copy and process output data -- */ + assert( ioData->mNumberBuffers == 1 ); + frames = ioData->mBuffers[0].mDataByteSize; + frames /= sizeof( float ) * ioData->mBuffers[0].mNumberChannels; + assert( ioData->mBuffers[0].mNumberChannels == stream->userOutChan ); + PaUtil_SetOutputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedOutputChannels( &(stream->bufferProcessor), + 0, + ioData->mBuffers[0].mData, + ioData->mBuffers[0].mNumberChannels); + + /* -- copy and process input data, and complete processing -- */ + if( stream->inputUnit ) { + const int flsz = sizeof( float ); + /* Here, we read the data out of the ring buffer, through the + audio converter. */ + int inChan = stream->inputAudioBufferList.mBuffers[0].mNumberChannels; + if( stream->inputSRConverter ) + { + OSStatus err; + UInt32 size; + float data[ inChan * frames ]; + size = sizeof( data ); + err = AudioConverterFillBuffer( + stream->inputSRConverter, + ringBufferIOProc, + &stream->inputRingBuffer, + &size, + (void *)&data ); + if( err == RING_BUFFER_EMPTY ) + { /*the ring buffer callback underflowed */ + err = 0; + bzero( ((char *)data) + size, sizeof(data)-size ); + stream->xrunFlags |= paInputUnderflow; + } + ERR( err ); + assert( !err ); + + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data, + inChan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + else + { + /* Without the AudioConverter is actually a bit more complex + because we have to do a little buffer processing that the + AudioConverter would otherwise handle for us. */ + void *data1, *data2; + long size1, size2; + RingBuffer_GetReadRegions( &stream->inputRingBuffer, + inChan*frames*flsz, + &data1, &size1, + &data2, &size2 ); + if( size1 / ( flsz * inChan ) == frames ) { + /* simplest case: all in first buffer */ + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data1, + inChan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + RingBuffer_AdvanceReadIndex(&stream->inputRingBuffer, size1 ); + } else if( ( size1 + size2 ) / ( flsz * inChan ) < frames ) { + /*we underflowed. take what data we can, zero the rest.*/ + float data[frames*inChan]; + if( size1 ) + memcpy( data, data1, size1 ); + if( size2 ) + memcpy( data+size1, data2, size2 ); + bzero( data+size1+size2, frames*flsz*inChan - size1 - size2 ); + + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data, + inChan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + RingBuffer_AdvanceReadIndex( &stream->inputRingBuffer, + size1+size2 ); + /* flag underflow */ + stream->xrunFlags |= paInputUnderflow; + } else { + /*we got all the data, but split between buffers*/ + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), + size1 / ( flsz * inChan ) ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data1, + inChan ); + PaUtil_Set2ndInputFrameCount( &(stream->bufferProcessor), + size2 / ( flsz * inChan ) ); + PaUtil_Set2ndInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data2, + inChan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + RingBuffer_AdvanceReadIndex(&stream->inputRingBuffer, size1+size2 ); + } + } + } else { + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + + } + else + { + /* ------------------ Input + * + * First, we read off the audio data and put it in the ring buffer. + * if this is an input-only stream, we need to process it more, + * otherwise, we let the output case deal with it. + */ + OSErr err = 0; + int chan = stream->inputAudioBufferList.mBuffers[0].mNumberChannels ; + /* FIXME: looping here may not actually be necessary, but it was something I tried in testing. */ + do { + err= AudioUnitRender(stream->inputUnit, + ioActionFlags, + inTimeStamp, + INPUT_ELEMENT, + inNumberFrames, + &stream->inputAudioBufferList ); + if( err == -10874 ) + inNumberFrames /= 2; + } while( err == -10874 && inNumberFrames > 1 ); + /* FEEDBACK: I'm not sure what to do when this call fails */ + ERR( err ); + assert( !err ); + if( stream->inputSRConverter || stream->outputUnit ) + { + /* If this is duplex or we use a converter, put the data + into the ring buffer. */ + long bytesIn, bytesOut; + bytesIn = sizeof( float ) * inNumberFrames * chan; + bytesOut = RingBuffer_Write( &stream->inputRingBuffer, + stream->inputAudioBufferList.mBuffers[0].mData, + bytesIn ); + if( bytesIn != bytesOut ) + stream->xrunFlags |= paInputOverflow ; + } + else + { + /* for simplex input w/o SR conversion, + just pop the data into the buffer processor.*/ + PaUtil_BeginBufferProcessing( &(stream->bufferProcessor), + &timeInfo, + stream->xrunFlags ); + stream->xrunFlags = 0; + + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), inNumberFrames); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + stream->inputAudioBufferList.mBuffers[0].mData, + chan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + if( !stream->outputUnit && stream->inputSRConverter ) + { + /* ------------------ Simplex Input w/ SR Conversion + * + * if this is a simplex input stream, we need to read off the buffer, + * do our sample rate conversion and pass the results to the buffer + * processor. + * The logic here is complicated somewhat by the fact that we don't + * know how much data is available, so we loop on reasonably sized + * chunks, and let the BufferProcessor deal with the rest. + * + */ + /*This might be too big or small depending on SR conversion*/ + float data[ chan * inNumberFrames ]; + OSStatus err; + do + { /*Run the buffer processor until we are out of data*/ + UInt32 size; + long f; + + size = sizeof( data ); + err = AudioConverterFillBuffer( + stream->inputSRConverter, + ringBufferIOProc, + &stream->inputRingBuffer, + &size, + (void *)data ); + if( err != RING_BUFFER_EMPTY ) + ERR( err ); + assert( err == 0 || err == RING_BUFFER_EMPTY ); + + f = size / ( chan * sizeof(float) ); + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), f ); + if( f ) + { + PaUtil_BeginBufferProcessing( &(stream->bufferProcessor), + &timeInfo, + stream->xrunFlags ); + stream->xrunFlags = 0; + + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data, + chan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + } while( callbackResult == paContinue && !err ); + } + } + + switch( callbackResult ) + { + case paContinue: break; + case paComplete: + case paAbort: + stream->state = CALLBACK_STOPPED ; + if( stream->outputUnit ) + AudioOutputUnitStop(stream->outputUnit); + if( stream->inputUnit ) + AudioOutputUnitStop(stream->inputUnit); + break; + } + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + return noErr; +} + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + /* This may be called from a failed OpenStream. + Therefore, each piece of info is treated seperately. */ + PaError result = paNoError; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + VDBUG( ( "Closing stream.\n" ) ); + + if( stream ) { + if( stream->outputUnit && stream->outputUnit != stream->inputUnit ) { + AudioUnitUninitialize( stream->outputUnit ); + CloseComponent( stream->outputUnit ); + } + stream->outputUnit = NULL; + if( stream->inputUnit ) + { + AudioUnitUninitialize( stream->inputUnit ); + CloseComponent( stream->inputUnit ); + stream->inputUnit = NULL; + } + if( stream->inputRingBuffer.buffer ) + free( stream->inputRingBuffer.buffer ); + stream->inputRingBuffer.buffer = NULL; + /*TODO: is there more that needs to be done on error + from AudioConverterDispose?*/ + if( stream->inputSRConverter ) + ERR( AudioConverterDispose( stream->inputSRConverter ) ); + stream->inputSRConverter = NULL; + if( stream->inputAudioBufferList.mBuffers[0].mData ) + free( stream->inputAudioBufferList.mBuffers[0].mData ); + stream->inputAudioBufferList.mBuffers[0].mData = NULL; + + if( stream->bufferProcessorIsInitialized ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); + } + + return result; +} + + +static PaError StartStream( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + OSErr result = noErr; + VDBUG( ( "Starting stream.\n" ) ); + +#define ERR_WRAP(mac_err) do { result = mac_err ; if ( result != noErr ) return ERR(result) ; } while(0) + + /*FIXME: maybe want to do this on close/abort for faster start? */ + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + if( stream->inputSRConverter ) + ERR_WRAP( AudioConverterReset( stream->inputSRConverter ) ); + + /* -- start -- */ + stream->state = ACTIVE; + if( stream->inputUnit ) { + ERR_WRAP( AudioOutputUnitStart(stream->inputUnit) ); + } + if( stream->outputUnit && stream->outputUnit != stream->inputUnit ) { + ERR_WRAP( AudioOutputUnitStart(stream->outputUnit) ); + } + + return paNoError; +#undef ERR_WRAP +} + + +static PaError StopStream( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + OSErr result = noErr; + VDBUG( ( "Stopping stream.\n" ) ); + + stream->state = STOPPING; + +#define ERR_WRAP(mac_err) do { result = mac_err ; if ( result != noErr ) return ERR(result) ; } while(0) + /* -- stop and reset -- */ + if( stream->inputUnit == stream->outputUnit && stream->inputUnit ) + { + ERR_WRAP( AudioOutputUnitStop(stream->inputUnit) ); + ERR_WRAP( AudioUnitReset(stream->inputUnit, kAudioUnitScope_Global, 1) ); + ERR_WRAP( AudioUnitReset(stream->inputUnit, kAudioUnitScope_Global, 0) ); + } + else + { + if( stream->inputUnit ) + { + ERR_WRAP(AudioOutputUnitStop(stream->inputUnit) ); + ERR_WRAP(AudioUnitReset(stream->inputUnit,kAudioUnitScope_Global,1)); + } + if( stream->outputUnit ) + { + ERR_WRAP(AudioOutputUnitStop(stream->outputUnit)); + ERR_WRAP(AudioUnitReset(stream->outputUnit,kAudioUnitScope_Global,0)); + } + } + if( stream->inputRingBuffer.buffer ) { + RingBuffer_Flush( &stream->inputRingBuffer ); + bzero(stream->inputRingBuffer.buffer,stream->inputRingBuffer.bufferSize); + /* advance the write point a little, so we are reading from the + middle of the buffer. We'll need extra at the end because + testing has shown that this helps. */ + if( stream->outputUnit ) + RingBuffer_AdvanceWriteIndex( &stream->inputRingBuffer, + stream->inputRingBuffer.bufferSize + / RING_BUFFER_ADVANCE_DENOMINATOR ); + } + + stream->isTimeSet = FALSE; + stream->xrunFlags = 0; + stream->state = STOPPED; + + VDBUG( ( "Stream Stopped.\n" ) ); + return paNoError; +#undef ERR_WRAP +} + +static PaError AbortStream( PaStream *s ) +{ + VDBUG( ( "Aborting stream.\n" ) ); + /* We have nothing faster than StopStream. */ + return StopStream(s); +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + return stream->state == STOPPED ? 1 : 0; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + return ( stream->state == ACTIVE || stream->state == STOPPING ); +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. IMPLEMENTME: no blocking interface yet! +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} diff --git a/portaudio-v19/pa_mac_core/pa_mac_core_old.c b/portaudio-v19/pa_mac_core/pa_mac_core_old.c new file mode 100644 index 000000000..d9a2df26c --- /dev/null +++ b/portaudio-v19/pa_mac_core/pa_mac_core_old.c @@ -0,0 +1,907 @@ +/* + * $Id$ + * pa_mac_core.c + * Implementation of PortAudio for Mac OS X CoreAudio + * + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * + * Authors: Ross Bencina and Phil Burk + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include +#include +#include +#include + +#include "portaudio.h" +#include "pa_trace.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + +// ===== constants ===== + +// ===== structs ===== +#pragma mark structs + +// PaMacCoreHostApiRepresentation - host api datastructure specific to this implementation +typedef struct PaMacCore_HAR +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + AudioDeviceID *macCoreDeviceIds; +} +PaMacCoreHostApiRepresentation; + +typedef struct PaMacCore_DI +{ + PaDeviceInfo inheritedDeviceInfo; +} +PaMacCoreDeviceInfo; + +// PaMacCoreStream - a stream data structure specifically for this implementation +typedef struct PaMacCore_S +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + int primeStreamUsingCallback; + + AudioDeviceID inputDevice; + AudioDeviceID outputDevice; + + // Processing thread management -------------- +// HANDLE abortEvent; +// HANDLE processingThread; +// DWORD processingThreadId; + + char throttleProcessingThreadOnOverload; // 0 -> don't throtte, non-0 -> throttle + int processingThreadPriority; + int highThreadPriority; + int throttledThreadPriority; + unsigned long throttledSleepMsecs; + + int isStopped; + volatile int isActive; + volatile int stopProcessing; // stop thread once existing buffers have been returned + volatile int abortProcessing; // stop thread immediately + +// DWORD allBuffersDurationMs; // used to calculate timeouts +} +PaMacCoreStream; + +// Data needed by the CoreAudio callback functions +typedef struct PaMacCore_CD +{ + PaMacCoreStream *stream; + PaStreamCallback *callback; + void *userData; + PaUtilConverter *inputConverter; + PaUtilConverter *outputConverter; + void *inputBuffer; + void *outputBuffer; + int inputChannelCount; + int outputChannelCount; + PaSampleFormat inputSampleFormat; + PaSampleFormat outputSampleFormat; + PaUtilTriangularDitherGenerator *ditherGenerator; +} +PaMacClientData; + +// ===== CoreAudio-PortAudio bridge functions ===== +#pragma mark CoreAudio-PortAudio bridge functions + +// Maps CoreAudio OSStatus codes to PortAudio PaError codes +static PaError conv_err(OSStatus error) +{ + PaError result; + + switch (error) { + case kAudioHardwareNoError: + result = paNoError; break; + case kAudioHardwareNotRunningError: + result = paInternalError; break; + case kAudioHardwareUnspecifiedError: + result = paInternalError; break; + case kAudioHardwareUnknownPropertyError: + result = paInternalError; break; + case kAudioHardwareBadPropertySizeError: + result = paInternalError; break; + case kAudioHardwareIllegalOperationError: + result = paInternalError; break; + case kAudioHardwareBadDeviceError: + result = paInvalidDevice; break; + case kAudioHardwareBadStreamError: + result = paBadStreamPtr; break; + case kAudioHardwareUnsupportedOperationError: + result = paInternalError; break; + case kAudioDeviceUnsupportedFormatError: + result = paSampleFormatNotSupported; break; + case kAudioDevicePermissionsError: + result = paDeviceUnavailable; break; + default: + result = paInternalError; + } + + return result; +} + +/* This function is unused +static AudioStreamBasicDescription *InitializeStreamDescription(const PaStreamParameters *parameters, double sampleRate) +{ + struct AudioStreamBasicDescription *streamDescription = PaUtil_AllocateMemory(sizeof(AudioStreamBasicDescription)); + streamDescription->mSampleRate = sampleRate; + streamDescription->mFormatID = kAudioFormatLinearPCM; + streamDescription->mFormatFlags = 0; + streamDescription->mFramesPerPacket = 1; + + if (parameters->sampleFormat & paNonInterleaved) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsNonInterleaved; + streamDescription->mChannelsPerFrame = 1; + streamDescription->mBytesPerFrame = Pa_GetSampleSize(parameters->sampleFormat); + streamDescription->mBytesPerPacket = Pa_GetSampleSize(parameters->sampleFormat); + } + else { + streamDescription->mChannelsPerFrame = parameters->channelCount; + } + + streamDescription->mBytesPerFrame = Pa_GetSampleSize(parameters->sampleFormat) * streamDescription->mChannelsPerFrame; + streamDescription->mBytesPerPacket = streamDescription->mBytesPerFrame * streamDescription->mFramesPerPacket; + + if (parameters->sampleFormat & paFloat32) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsFloat; + streamDescription->mBitsPerChannel = 32; + } + else if (parameters->sampleFormat & paInt32) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + streamDescription->mBitsPerChannel = 32; + } + else if (parameters->sampleFormat & paInt24) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + streamDescription->mBitsPerChannel = 24; + } + else if (parameters->sampleFormat & paInt16) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + streamDescription->mBitsPerChannel = 16; + } + else if (parameters->sampleFormat & paInt8) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + streamDescription->mBitsPerChannel = 8; + } + else if (parameters->sampleFormat & paInt32) { + streamDescription->mBitsPerChannel = 8; + } + + return streamDescription; +} +*/ + +static PaStreamCallbackTimeInfo *InitializeTimeInfo(const AudioTimeStamp* now, const AudioTimeStamp* inputTime, const AudioTimeStamp* outputTime) +{ + PaStreamCallbackTimeInfo *timeInfo = PaUtil_AllocateMemory(sizeof(PaStreamCallbackTimeInfo)); + + timeInfo->inputBufferAdcTime = inputTime->mSampleTime; + timeInfo->currentTime = now->mSampleTime; + timeInfo->outputBufferDacTime = outputTime->mSampleTime; + + return timeInfo; +} + +// ===== support functions ===== +#pragma mark support functions + +static void CleanUp(PaMacCoreHostApiRepresentation *macCoreHostApi) +{ + if( macCoreHostApi->allocations ) + { + PaUtil_FreeAllAllocations( macCoreHostApi->allocations ); + PaUtil_DestroyAllocationGroup( macCoreHostApi->allocations ); + } + + PaUtil_FreeMemory( macCoreHostApi ); +} + +static PaError GetChannelInfo(PaDeviceInfo *deviceInfo, AudioDeviceID macCoreDeviceId, int isInput) +{ + UInt32 propSize; + PaError err = paNoError; + UInt32 i; + int numChannels = 0; + AudioBufferList *buflist; + + err = conv_err(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, NULL)); + buflist = PaUtil_AllocateMemory(propSize); + err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, buflist)); + if (!err) { + for (i = 0; i < buflist->mNumberBuffers; ++i) { + numChannels += buflist->mBuffers[i].mNumberChannels; + } + + if (isInput) + deviceInfo->maxInputChannels = numChannels; + else + deviceInfo->maxOutputChannels = numChannels; + + int frameLatency; + propSize = sizeof(UInt32); + err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyLatency, &propSize, &frameLatency)); + if (!err) { + double secondLatency = frameLatency / deviceInfo->defaultSampleRate; + if (isInput) { + deviceInfo->defaultLowInputLatency = secondLatency; + deviceInfo->defaultHighInputLatency = secondLatency; + } + else { + deviceInfo->defaultLowOutputLatency = secondLatency; + deviceInfo->defaultHighOutputLatency = secondLatency; + } + } + } + PaUtil_FreeMemory(buflist); + + return err; +} + +static PaError InitializeDeviceInfo(PaMacCoreDeviceInfo *macCoreDeviceInfo, AudioDeviceID macCoreDeviceId, PaHostApiIndex hostApiIndex ) +{ + PaDeviceInfo *deviceInfo = &macCoreDeviceInfo->inheritedDeviceInfo; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + PaError err = paNoError; + UInt32 propSize; + + err = conv_err(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, NULL)); + // FIXME: this allocation should be part of the allocations group + char *name = PaUtil_AllocateMemory(propSize); + err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, name)); + if (!err) { + deviceInfo->name = name; + } + + Float64 sampleRate; + propSize = sizeof(Float64); + err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyNominalSampleRate, &propSize, &sampleRate)); + if (!err) { + deviceInfo->defaultSampleRate = sampleRate; + } + + + // Get channel info + err = GetChannelInfo(deviceInfo, macCoreDeviceId, 1); + err = GetChannelInfo(deviceInfo, macCoreDeviceId, 0); + + return err; +} + +static PaError InitializeDeviceInfos( PaMacCoreHostApiRepresentation *macCoreHostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *hostApi; + PaMacCoreDeviceInfo *deviceInfoArray; + + // initialise device counts and default devices under the assumption that there are no devices. These values are incremented below if and when devices are successfully initialized. + hostApi = &macCoreHostApi->inheritedHostApiRep; + hostApi->info.deviceCount = 0; + hostApi->info.defaultInputDevice = paNoDevice; + hostApi->info.defaultOutputDevice = paNoDevice; + + UInt32 propsize; + AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &propsize, NULL); + int numDevices = propsize / sizeof(AudioDeviceID); + hostApi->info.deviceCount = numDevices; + if (numDevices > 0) { + hostApi->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + macCoreHostApi->allocations, sizeof(PaDeviceInfo*) * numDevices ); + if( !hostApi->deviceInfos ) + { + return paInsufficientMemory; + } + + // allocate all device info structs in a contiguous block + deviceInfoArray = (PaMacCoreDeviceInfo*)PaUtil_GroupAllocateMemory( + macCoreHostApi->allocations, sizeof(PaMacCoreDeviceInfo) * numDevices ); + if( !deviceInfoArray ) + { + return paInsufficientMemory; + } + + macCoreHostApi->macCoreDeviceIds = PaUtil_GroupAllocateMemory(macCoreHostApi->allocations, propsize); + AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &propsize, macCoreHostApi->macCoreDeviceIds); + + AudioDeviceID defaultInputDevice, defaultOutputDevice; + propsize = sizeof(AudioDeviceID); + AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, &propsize, &defaultInputDevice); + AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &propsize, &defaultOutputDevice); + + UInt32 i; + for (i = 0; i < numDevices; ++i) { + if (macCoreHostApi->macCoreDeviceIds[i] == defaultInputDevice) { + hostApi->info.defaultInputDevice = i; + } + if (macCoreHostApi->macCoreDeviceIds[i] == defaultOutputDevice) { + hostApi->info.defaultOutputDevice = i; + } + InitializeDeviceInfo(&deviceInfoArray[i], macCoreHostApi->macCoreDeviceIds[i], hostApiIndex); + hostApi->deviceInfos[i] = &(deviceInfoArray[i].inheritedDeviceInfo); + } + } + + return result; +} + +static OSStatus CheckFormat(AudioDeviceID macCoreDeviceId, const PaStreamParameters *parameters, double sampleRate, int isInput) +{ + UInt32 propSize = sizeof(AudioStreamBasicDescription); + AudioStreamBasicDescription *streamDescription = PaUtil_AllocateMemory(propSize); + + streamDescription->mSampleRate = sampleRate; + streamDescription->mFormatID = 0; + streamDescription->mFormatFlags = 0; + streamDescription->mBytesPerPacket = 0; + streamDescription->mFramesPerPacket = 0; + streamDescription->mBytesPerFrame = 0; + streamDescription->mChannelsPerFrame = 0; + streamDescription->mBitsPerChannel = 0; + streamDescription->mReserved = 0; + + OSStatus result = AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamFormatSupported, &propSize, streamDescription); + PaUtil_FreeMemory(streamDescription); + return result; +} + +static OSStatus CopyInputData(PaMacClientData* destination, const AudioBufferList *source, unsigned long frameCount) +{ + int frameSpacing, channelSpacing; + if (destination->inputSampleFormat & paNonInterleaved) { + frameSpacing = 1; + channelSpacing = destination->inputChannelCount; + } + else { + frameSpacing = destination->inputChannelCount; + channelSpacing = 1; + } + + AudioBuffer const *inputBuffer = &source->mBuffers[0]; + void *coreAudioBuffer = inputBuffer->mData; + void *portAudioBuffer = destination->inputBuffer; + UInt32 i, streamNumber, streamChannel; + for (i = streamNumber = streamChannel = 0; i < destination->inputChannelCount; ++i, ++streamChannel) { + if (streamChannel >= inputBuffer->mNumberChannels) { + ++streamNumber; + inputBuffer = &source->mBuffers[streamNumber]; + coreAudioBuffer = inputBuffer->mData; + streamChannel = 0; + } + destination->inputConverter(portAudioBuffer, frameSpacing, coreAudioBuffer, inputBuffer->mNumberChannels, frameCount, destination->ditherGenerator); + coreAudioBuffer += sizeof(Float32); + portAudioBuffer += Pa_GetSampleSize(destination->inputSampleFormat) * channelSpacing; + } + return noErr; +} + +static OSStatus CopyOutputData(AudioBufferList* destination, PaMacClientData *source, unsigned long frameCount) +{ + int frameSpacing, channelSpacing; + if (source->outputSampleFormat & paNonInterleaved) { + frameSpacing = 1; + channelSpacing = source->outputChannelCount; + } + else { + frameSpacing = source->outputChannelCount; + channelSpacing = 1; + } + + AudioBuffer *outputBuffer = &destination->mBuffers[0]; + void *coreAudioBuffer = outputBuffer->mData; + void *portAudioBuffer = source->outputBuffer; + UInt32 i, streamNumber, streamChannel; + for (i = streamNumber = streamChannel = 0; i < source->outputChannelCount; ++i, ++streamChannel) { + if (streamChannel >= outputBuffer->mNumberChannels) { + ++streamNumber; + outputBuffer = &destination->mBuffers[streamNumber]; + coreAudioBuffer = outputBuffer->mData; + streamChannel = 0; + } + source->outputConverter(coreAudioBuffer, outputBuffer->mNumberChannels, portAudioBuffer, frameSpacing, frameCount, NULL); + coreAudioBuffer += sizeof(Float32); + portAudioBuffer += Pa_GetSampleSize(source->outputSampleFormat) * channelSpacing; + } + return noErr; +} + +static OSStatus AudioIOProc( AudioDeviceID inDevice, + const AudioTimeStamp* inNow, + const AudioBufferList* inInputData, + const AudioTimeStamp* inInputTime, + AudioBufferList* outOutputData, + const AudioTimeStamp* inOutputTime, + void* inClientData) +{ + PaMacClientData *clientData = (PaMacClientData *)inClientData; + PaStreamCallbackTimeInfo *timeInfo = InitializeTimeInfo(inNow, inInputTime, inOutputTime); + + PaUtil_BeginCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer ); + + AudioBuffer *outputBuffer = &outOutputData->mBuffers[0]; + unsigned long frameCount = outputBuffer->mDataByteSize / (outputBuffer->mNumberChannels * sizeof(Float32)); + + if (clientData->inputBuffer) { + CopyInputData(clientData, inInputData, frameCount); + } + PaStreamCallbackResult result = clientData->callback(clientData->inputBuffer, clientData->outputBuffer, frameCount, timeInfo, paNoFlag, clientData->userData); + if (clientData->outputBuffer) { + CopyOutputData(outOutputData, clientData, frameCount); + } + + PaUtil_EndCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer, frameCount ); + + if (result == paComplete || result == paAbort) { + Pa_StopStream(clientData->stream); + } + + PaUtil_FreeMemory( timeInfo ); + return noErr; +} + +// This is not for input-only streams, this is for streams where the input device is different from the output device +static OSStatus AudioInputProc( AudioDeviceID inDevice, + const AudioTimeStamp* inNow, + const AudioBufferList* inInputData, + const AudioTimeStamp* inInputTime, + AudioBufferList* outOutputData, + const AudioTimeStamp* inOutputTime, + void* inClientData) +{ + PaMacClientData *clientData = (PaMacClientData *)inClientData; + PaStreamCallbackTimeInfo *timeInfo = InitializeTimeInfo(inNow, inInputTime, inOutputTime); + + PaUtil_BeginCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer ); + + AudioBuffer const *inputBuffer = &inInputData->mBuffers[0]; + unsigned long frameCount = inputBuffer->mDataByteSize / (inputBuffer->mNumberChannels * sizeof(Float32)); + + CopyInputData(clientData, inInputData, frameCount); + PaStreamCallbackResult result = clientData->callback(clientData->inputBuffer, clientData->outputBuffer, frameCount, timeInfo, paNoFlag, clientData->userData); + + PaUtil_EndCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer, frameCount ); + if( result == paComplete || result == paAbort ) + Pa_StopStream(clientData->stream); + PaUtil_FreeMemory( timeInfo ); + return noErr; +} + +// This is not for output-only streams, this is for streams where the input device is different from the output device +static OSStatus AudioOutputProc( AudioDeviceID inDevice, + const AudioTimeStamp* inNow, + const AudioBufferList* inInputData, + const AudioTimeStamp* inInputTime, + AudioBufferList* outOutputData, + const AudioTimeStamp* inOutputTime, + void* inClientData) +{ + PaMacClientData *clientData = (PaMacClientData *)inClientData; + //PaStreamCallbackTimeInfo *timeInfo = InitializeTimeInfo(inNow, inInputTime, inOutputTime); + + PaUtil_BeginCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer ); + + AudioBuffer *outputBuffer = &outOutputData->mBuffers[0]; + unsigned long frameCount = outputBuffer->mDataByteSize / (outputBuffer->mNumberChannels * sizeof(Float32)); + + //clientData->callback(NULL, clientData->outputBuffer, frameCount, timeInfo, paNoFlag, clientData->userData); + + CopyOutputData(outOutputData, clientData, frameCount); + + PaUtil_EndCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer, frameCount ); + return noErr; +} + +static PaError SetSampleRate(AudioDeviceID device, double sampleRate, int isInput) +{ + PaError result = paNoError; + + double actualSampleRate; + UInt32 propSize = sizeof(double); + result = conv_err(AudioDeviceSetProperty(device, NULL, 0, isInput, kAudioDevicePropertyNominalSampleRate, propSize, &sampleRate)); + + result = conv_err(AudioDeviceGetProperty(device, 0, isInput, kAudioDevicePropertyNominalSampleRate, &propSize, &actualSampleRate)); + + if (result == paNoError && actualSampleRate != sampleRate) { + result = paInvalidSampleRate; + } + + return result; +} + +static PaError SetFramesPerBuffer(AudioDeviceID device, unsigned long framesPerBuffer, int isInput) +{ + PaError result = paNoError; + UInt32 preferredFramesPerBuffer = framesPerBuffer; + // while (preferredFramesPerBuffer > UINT32_MAX) { + // preferredFramesPerBuffer /= 2; + // } + + UInt32 actualFramesPerBuffer; + UInt32 propSize = sizeof(UInt32); + result = conv_err(AudioDeviceSetProperty(device, NULL, 0, isInput, kAudioDevicePropertyBufferFrameSize, propSize, &preferredFramesPerBuffer)); + + result = conv_err(AudioDeviceGetProperty(device, 0, isInput, kAudioDevicePropertyBufferFrameSize, &propSize, &actualFramesPerBuffer)); + + if (result != paNoError) { + // do nothing + } + else if (actualFramesPerBuffer > framesPerBuffer) { + result = paBufferTooSmall; + } + else if (actualFramesPerBuffer < framesPerBuffer) { + result = paBufferTooBig; + } + + return result; +} + +static PaError SetUpUnidirectionalStream(AudioDeviceID device, double sampleRate, unsigned long framesPerBuffer, int isInput) +{ + PaError err = paNoError; + err = SetSampleRate(device, sampleRate, isInput); + if( err == paNoError ) + err = SetFramesPerBuffer(device, framesPerBuffer, isInput); + return err; +} + +// ===== PortAudio functions ===== +#pragma mark PortAudio functions + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + + PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif // __cplusplus + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaMacCoreHostApiRepresentation *macCoreHostApi = (PaMacCoreHostApiRepresentation*)hostApi; + + CleanUp(macCoreHostApi); +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaMacCoreHostApiRepresentation *macCoreHostApi = (PaMacCoreHostApiRepresentation*)hostApi; + PaDeviceInfo *deviceInfo; + + PaError result = paNoError; + if (inputParameters) { + deviceInfo = macCoreHostApi->inheritedHostApiRep.deviceInfos[inputParameters->device]; + if (inputParameters->channelCount > deviceInfo->maxInputChannels) + result = paInvalidChannelCount; + else if (CheckFormat(macCoreHostApi->macCoreDeviceIds[inputParameters->device], inputParameters, sampleRate, 1) != kAudioHardwareNoError) { + result = paInvalidSampleRate; + } + } + if (outputParameters && result == paNoError) { + deviceInfo = macCoreHostApi->inheritedHostApiRep.deviceInfos[outputParameters->device]; + if (outputParameters->channelCount > deviceInfo->maxOutputChannels) + result = paInvalidChannelCount; + else if (CheckFormat(macCoreHostApi->macCoreDeviceIds[outputParameters->device], outputParameters, sampleRate, 0) != kAudioHardwareNoError) { + result = paInvalidSampleRate; + } + } + + return result; +} + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError err = paNoError; + PaMacCoreHostApiRepresentation *macCoreHostApi = (PaMacCoreHostApiRepresentation *)hostApi; + PaMacCoreStream *stream = PaUtil_AllocateMemory(sizeof(PaMacCoreStream)); + stream->isActive = 0; + stream->isStopped = 1; + stream->inputDevice = kAudioDeviceUnknown; + stream->outputDevice = kAudioDeviceUnknown; + + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + ( (streamCallback) + ? &macCoreHostApi->callbackStreamInterface + : &macCoreHostApi->blockingStreamInterface ), + streamCallback, userData ); + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + *s = (PaStream*)stream; + PaMacClientData *clientData = PaUtil_AllocateMemory(sizeof(PaMacClientData)); + clientData->stream = stream; + clientData->callback = streamCallback; + clientData->userData = userData; + clientData->inputBuffer = 0; + clientData->outputBuffer = 0; + clientData->ditherGenerator = PaUtil_AllocateMemory(sizeof(PaUtilTriangularDitherGenerator)); + PaUtil_InitializeTriangularDitherState(clientData->ditherGenerator); + + if (inputParameters != NULL) { + stream->inputDevice = macCoreHostApi->macCoreDeviceIds[inputParameters->device]; + clientData->inputConverter = PaUtil_SelectConverter(paFloat32, inputParameters->sampleFormat, streamFlags); + clientData->inputBuffer = PaUtil_AllocateMemory(Pa_GetSampleSize(inputParameters->sampleFormat) * framesPerBuffer * inputParameters->channelCount); + clientData->inputChannelCount = inputParameters->channelCount; + clientData->inputSampleFormat = inputParameters->sampleFormat; + err = SetUpUnidirectionalStream(stream->inputDevice, sampleRate, framesPerBuffer, 1); + } + + if (err == paNoError && outputParameters != NULL) { + stream->outputDevice = macCoreHostApi->macCoreDeviceIds[outputParameters->device]; + clientData->outputConverter = PaUtil_SelectConverter(outputParameters->sampleFormat, paFloat32, streamFlags); + clientData->outputBuffer = PaUtil_AllocateMemory(Pa_GetSampleSize(outputParameters->sampleFormat) * framesPerBuffer * outputParameters->channelCount); + clientData->outputChannelCount = outputParameters->channelCount; + clientData->outputSampleFormat = outputParameters->sampleFormat; + err = SetUpUnidirectionalStream(stream->outputDevice, sampleRate, framesPerBuffer, 0); + } + + if (inputParameters == NULL || outputParameters == NULL || stream->inputDevice == stream->outputDevice) { + AudioDeviceID device = (inputParameters == NULL) ? stream->outputDevice : stream->inputDevice; + + AudioDeviceAddIOProc(device, AudioIOProc, clientData); + } + else { + // using different devices for input and output + AudioDeviceAddIOProc(stream->inputDevice, AudioInputProc, clientData); + AudioDeviceAddIOProc(stream->outputDevice, AudioOutputProc, clientData); + } + + return err; +} + +// Note: When CloseStream() is called, the multi-api layer ensures that the stream has already been stopped or aborted. +static PaError CloseStream( PaStream* s ) +{ + PaError err = paNoError; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + if (stream->inputDevice != kAudioDeviceUnknown) { + if (stream->outputDevice == kAudioDeviceUnknown || stream->outputDevice == stream->inputDevice) { + err = conv_err(AudioDeviceRemoveIOProc(stream->inputDevice, AudioIOProc)); + } + else { + err = conv_err(AudioDeviceRemoveIOProc(stream->inputDevice, AudioInputProc)); + err = conv_err(AudioDeviceRemoveIOProc(stream->outputDevice, AudioOutputProc)); + } + } + else { + err = conv_err(AudioDeviceRemoveIOProc(stream->outputDevice, AudioIOProc)); + } + + return err; +} + + +static PaError StartStream( PaStream *s ) +{ + PaError err = paNoError; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + if (stream->inputDevice != kAudioDeviceUnknown) { + if (stream->outputDevice == kAudioDeviceUnknown || stream->outputDevice == stream->inputDevice) { + err = conv_err(AudioDeviceStart(stream->inputDevice, AudioIOProc)); + } + else { + err = conv_err(AudioDeviceStart(stream->inputDevice, AudioInputProc)); + err = conv_err(AudioDeviceStart(stream->outputDevice, AudioOutputProc)); + } + } + else { + err = conv_err(AudioDeviceStart(stream->outputDevice, AudioIOProc)); + } + + stream->isActive = 1; + stream->isStopped = 0; + return err; +} + +static PaError AbortStream( PaStream *s ) +{ + PaError err = paNoError; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + if (stream->inputDevice != kAudioDeviceUnknown) { + if (stream->outputDevice == kAudioDeviceUnknown || stream->outputDevice == stream->inputDevice) { + err = conv_err(AudioDeviceStop(stream->inputDevice, AudioIOProc)); + } + else { + err = conv_err(AudioDeviceStop(stream->inputDevice, AudioInputProc)); + err = conv_err(AudioDeviceStop(stream->outputDevice, AudioOutputProc)); + } + } + else { + err = conv_err(AudioDeviceStop(stream->outputDevice, AudioIOProc)); + } + + stream->isActive = 0; + stream->isStopped = 1; + return err; +} + +static PaError StopStream( PaStream *s ) +{ + // TODO: this should be nicer than abort + return AbortStream(s); +} + +static PaError IsStreamStopped( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + return stream->isStopped; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + return stream->isActive; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + OSStatus err; + PaTime result; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + AudioTimeStamp *timeStamp = PaUtil_AllocateMemory(sizeof(AudioTimeStamp)); + if (stream->inputDevice != kAudioDeviceUnknown) { + err = AudioDeviceGetCurrentTime(stream->inputDevice, timeStamp); + } + else { + err = AudioDeviceGetCurrentTime(stream->outputDevice, timeStamp); + } + + result = err ? 0 : timeStamp->mSampleTime; + PaUtil_FreeMemory(timeStamp); + + return result; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +// As separate stream interfaces are used for blocking and callback streams, the following functions can be guaranteed to only be called for blocking streams. + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + return paInternalError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + return paInternalError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + return paInternalError; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + return paInternalError; +} + +// HostAPI-specific initialization function +PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaMacCoreHostApiRepresentation *macCoreHostApi = (PaMacCoreHostApiRepresentation *)PaUtil_AllocateMemory( sizeof(PaMacCoreHostApiRepresentation) ); + if( !macCoreHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + macCoreHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !macCoreHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + *hostApi = &macCoreHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paCoreAudio; + (*hostApi)->info.name = "CoreAudio"; + + result = InitializeDeviceInfos(macCoreHostApi, hostApiIndex); + if (result != paNoError) { + goto error; + } + + // Set up the proper callbacks to this HostApi's functions + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &macCoreHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &macCoreHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( macCoreHostApi ) { + CleanUp(macCoreHostApi); + } + + return result; +} diff --git a/portaudio-v19/pa_mac_core/pa_mac_core_utilities.c b/portaudio-v19/pa_mac_core/pa_mac_core_utilities.c new file mode 100644 index 000000000..f2cbd29cb --- /dev/null +++ b/portaudio-v19/pa_mac_core/pa_mac_core_utilities.c @@ -0,0 +1,466 @@ +/* + * + * pa_mac_core_utilities.c + * + * utilitiy functions for pa_mac_core.c + * + * This functions are more like helper functions than part of the core, + * so I moved them to a separate file so the core code would be cleaner. + * + * by Bjorn Roche. + */ + +/* + * Translates MacOS generated errors into PaErrors + */ +static PaError PaMacCore_SetError(OSStatus error, int line, int isError) +{ + /*FIXME: still need to handle possible ComponentResult values.*/ + /* unfortunately, they don't seem to be documented anywhere.*/ + PaError result; + const char *errorType; + const char *errorText; + + switch (error) { + case kAudioHardwareNoError: + return paNoError; + case kAudioHardwareNotRunningError: + errorText = "Audio Hardware Not Running"; + result = paInternalError; break; + case kAudioHardwareUnspecifiedError: + errorText = "Unspecified Audio Hardware Error"; + result = paInternalError; break; + case kAudioHardwareUnknownPropertyError: + errorText = "Audio Hardware: Unknown Property"; + result = paInternalError; break; + case kAudioHardwareBadPropertySizeError: + errorText = "Audio Hardware: Bad Property Size"; + result = paInternalError; break; + case kAudioHardwareIllegalOperationError: + errorText = "Audio Hardware: Illegal Operation"; + result = paInternalError; break; + case kAudioHardwareBadDeviceError: + errorText = "Audio Hardware: Bad Device"; + result = paInvalidDevice; break; + case kAudioHardwareBadStreamError: + errorText = "Audio Hardware: BadStream"; + result = paBadStreamPtr; break; + case kAudioHardwareUnsupportedOperationError: + errorText = "Audio Hardware: Unsupported Operation"; + result = paInternalError; break; + case kAudioDeviceUnsupportedFormatError: + errorText = "Audio Device: Unsupported Format"; + result = paSampleFormatNotSupported; break; + case kAudioDevicePermissionsError: + errorText = "Audio Device: Permissions Error"; + result = paDeviceUnavailable; break; + /* Audio Unit Errors: http://developer.apple.com/documentation/MusicAudio/Reference/CoreAudio/audio_units/chapter_5_section_3.html */ + case kAudioUnitErr_InvalidProperty: + errorText = "Audio Unit: Invalid Property"; + result = paInternalError; break; + case kAudioUnitErr_InvalidParameter: + errorText = "Audio Unit: Invalid Parameter"; + result = paInternalError; break; + case kAudioUnitErr_NoConnection: + errorText = "Audio Unit: No Connection"; + result = paInternalError; break; + case kAudioUnitErr_FailedInitialization: + errorText = "Audio Unit: Initialization Failed"; + result = paInternalError; break; + case kAudioUnitErr_TooManyFramesToProcess: + errorText = "Audio Unit: Too Many Frames"; + result = paInternalError; break; + case kAudioUnitErr_IllegalInstrument: + errorText = "Audio Unit: Illegal Instrument"; + result = paInternalError; break; + case kAudioUnitErr_InstrumentTypeNotFound: + errorText = "Audio Unit: Instrument Type Not Found"; + result = paInternalError; break; + case kAudioUnitErr_InvalidFile: + errorText = "Audio Unit: Invalid File"; + result = paInternalError; break; + case kAudioUnitErr_UnknownFileType: + errorText = "Audio Unit: Unknown File Type"; + result = paInternalError; break; + case kAudioUnitErr_FileNotSpecified: + errorText = "Audio Unit: File Not Specified"; + result = paInternalError; break; + case kAudioUnitErr_FormatNotSupported: + errorText = "Audio Unit: Format Not Supported"; + result = paInternalError; break; + case kAudioUnitErr_Uninitialized: + errorText = "Audio Unit: Unitialized"; + result = paInternalError; break; + case kAudioUnitErr_InvalidScope: + errorText = "Audio Unit: Invalid Scope"; + result = paInternalError; break; + case kAudioUnitErr_PropertyNotWritable: + errorText = "Audio Unit: PropertyNotWritable"; + result = paInternalError; break; + case kAudioUnitErr_InvalidPropertyValue: + errorText = "Audio Unit: Invalid Property Value"; + result = paInternalError; break; + case kAudioUnitErr_PropertyNotInUse: + errorText = "Audio Unit: Property Not In Use"; + result = paInternalError; break; + case kAudioUnitErr_Initialized: + errorText = "Audio Unit: Initialized"; + result = paInternalError; break; + case kAudioUnitErr_InvalidOfflineRender: + errorText = "Audio Unit: Invalid Offline Render"; + result = paInternalError; break; + case kAudioUnitErr_Unauthorized: + errorText = "Audio Unit: Unauthorized"; + result = paInternalError; break; + case kAudioUnitErr_CannotDoInCurrentContext: + errorText = "Audio Unit: cannot do in current context"; + result = paInternalError; break; + default: + errorText = "Unknown Error"; + result = paInternalError; + } + + if (isError) + errorType = "Error"; + else + errorType = "Warning"; + + if ((int)error < -99999 || (int)error > 99999) + DBUG(("%s on line %d: err='%4s', msg='%s'\n", errorType, line, (const char *)&error, errorText)); + else + DBUG(("%s on line %d: err=%d, 0x%x, msg='%s'\n", errorType, line, (int)error, (unsigned)error, errorText)); + + PaUtil_SetLastHostErrorInfo( paCoreAudio, error, errorText ); + + return result; +} + + + + +/* + * Durring testing of core audio, I found that serious crashes could occur + * if properties such as sample rate were changed multiple times in rapid + * succession. The function below has some fancy logic to make sure that changes + * are acknowledged before another is requested. That seems to help a lot. + */ + +#include +typedef struct { + bool once; /* I didn't end up using this. bdr */ + pthread_mutex_t mutex; +} MutexAndBool ; + +static OSStatus propertyProc( + AudioDeviceID inDevice, + UInt32 inChannel, + Boolean isInput, + AudioDevicePropertyID inPropertyID, + void* inClientData ) +{ + MutexAndBool *mab = (MutexAndBool *) inClientData; + mab->once = TRUE; + pthread_mutex_unlock( &(mab->mutex) ); + return noErr; +} + +/* sets the value of the given property and waits for the change to + be acknowledged, and returns the final value, which is not guaranteed + by this function to be the same as the desired value. Obviously, this + function can only be used for data whose input and output are the + same size and format, and their size and format are known in advance.*/ +PaError AudioDeviceSetPropertyNowAndWaitForChange( + AudioDeviceID inDevice, + UInt32 inChannel, + Boolean isInput, + AudioDevicePropertyID inPropertyID, + UInt32 inPropertyDataSize, + const void *inPropertyData, + void *outPropertyData ) +{ + OSStatus macErr; + int unixErr; + MutexAndBool mab; + UInt32 outPropertyDataSize = inPropertyDataSize; + + /* First, see if it already has that value. If so, return. */ + macErr = AudioDeviceGetProperty( inDevice, inChannel, + isInput, inPropertyID, + &outPropertyDataSize, outPropertyData ); + if( macErr ) + goto failMac2; + if( inPropertyDataSize!=outPropertyDataSize ) + return paInternalError; + if( 0==memcmp( outPropertyData, inPropertyData, outPropertyDataSize ) ) + return paNoError; + + /* setup and lock mutex */ + mab.once = FALSE; + unixErr = pthread_mutex_init( &mab.mutex, NULL ); + if( unixErr ) + goto failUnix2; + unixErr = pthread_mutex_lock( &mab.mutex ); + if( unixErr ) + goto failUnix; + + /* add property listener */ + macErr = AudioDeviceAddPropertyListener( inDevice, inChannel, isInput, + inPropertyID, propertyProc, + &mab ); + if( macErr ) + goto failMac; + /* set property */ + macErr = AudioDeviceSetProperty( inDevice, NULL, inChannel, + isInput, inPropertyID, + inPropertyDataSize, inPropertyData ); + if( macErr ) { + /* we couldn't set the property, so we'll just unlock the mutex + and move on. */ + pthread_mutex_unlock( &mab.mutex ); + } + + /* wait for property to change */ + unixErr = pthread_mutex_lock( &mab.mutex ); + if( unixErr ) + goto failUnix; + + /* now read the property back out */ + macErr = AudioDeviceGetProperty( inDevice, inChannel, + isInput, inPropertyID, + &outPropertyDataSize, outPropertyData ); + if( macErr ) + goto failMac; + /* cleanup */ + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, + inPropertyID, propertyProc ); + unixErr = pthread_mutex_unlock( &mab.mutex ); + if( unixErr ) + goto failUnix2; + unixErr = pthread_mutex_destroy( &mab.mutex ); + if( unixErr ) + goto failUnix2; + + return paNoError; + + failUnix: + pthread_mutex_destroy( &mab.mutex ); + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, + inPropertyID, propertyProc ); + + failUnix2: + DBUG( ("Error #%d while setting a device property: %s\n", unixErr, strerror( unixErr ) ) ); + return paUnanticipatedHostError; + + failMac: + pthread_mutex_destroy( &mab.mutex ); + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, + inPropertyID, propertyProc ); + failMac2: + return ERR( macErr ); +} + +/* + * Sets the sample rate the HAL device. + * if requireExact: set the sample rate or fail. + * + * otherwise : set the exact sample rate. + * If that fails, check for available sample rates, and choose one + * higher than the requested rate. If there isn't a higher one, + * just use the highest available. + */ +static PaError setBestSampleRateForDevice( const AudioDeviceID device, + const bool isOutput, + const bool requireExact, + const Float64 desiredSrate ) +{ + /*FIXME: changing the sample rate is disruptive to other programs using the + device, so it might be good to offer a custom flag to not change the + sample rate and just do conversion. (in my casual tests, there is + no disruption unless the sample rate really does need to change) */ + const bool isInput = isOutput ? 0 : 1; + Float64 srate; + UInt32 propsize = sizeof( Float64 ); + OSErr err; + AudioValueRange *ranges; + int i=0; + Float64 max = -1; /*the maximum rate available*/ + Float64 best = -1; /*the lowest sample rate still greater than desired rate*/ + VDBUG(("Setting sample rate for device %ld to %g.\n",device,(float)desiredSrate)); + + /* -- try setting the sample rate -- */ + err = AudioDeviceSetPropertyNowAndWaitForChange( + device, 0, isInput, + kAudioDevicePropertyNominalSampleRate, + propsize, &desiredSrate, &srate ); + if( err ) + return err; + + /* -- if the rate agrees, and we got no errors, we are done -- */ + if( !err && srate == desiredSrate ) + return paNoError; + /* -- we've failed if the rates disagree and we are setting input -- */ + if( requireExact ) + return paInvalidSampleRate; + + /* -- generate a list of available sample rates -- */ + err = AudioDeviceGetPropertyInfo( device, 0, isInput, + kAudioDevicePropertyAvailableNominalSampleRates, + &propsize, NULL ); + if( err ) + return ERR( err ); + ranges = (AudioValueRange *)calloc( 1, propsize ); + if( !ranges ) + return paInsufficientMemory; + err = AudioDeviceGetProperty( device, 0, isInput, + kAudioDevicePropertyAvailableNominalSampleRates, + &propsize, ranges ); + if( err ) + { + free( ranges ); + return ERR( err ); + } + VDBUG(("Requested sample rate of %g was not available.\n", (float)desiredSrate)); + VDBUG(("%lu Available Sample Rates are:\n",propsize/sizeof(AudioValueRange))); +#ifdef MAC_CORE_VERBOSE_DEBUG + for( i=0; i max ) max = ranges[i].mMaximum; + if( ranges[i].mMinimum > desiredSrate ) { + if( best < 0 ) + best = ranges[i].mMinimum; + else if( ranges[i].mMinimum < best ) + best = ranges[i].mMinimum; + } + } + if( best < 0 ) + best = max; + VDBUG( ("Maximum Rate %g. best is %g.\n", max, best ) ); + free( ranges ); + + /* -- set the sample rate -- */ + propsize = sizeof( best ); + err = AudioDeviceSetPropertyNowAndWaitForChange( + device, 0, isInput, + kAudioDevicePropertyNominalSampleRate, + propsize, &best, &srate ); + if( err ) + return err; + + if( err ) + return ERR( err ); + /* -- if the set rate matches, we are done -- */ + if( srate == best ) + return paNoError; + + /* -- otherwise, something wierd happened: we didn't set the rate, and we got no errors. Just bail. */ + return paInternalError; +} + + +/* + Attempts to set the requestedFramesPerBuffer. If it can't set the exact + value, it settles for something smaller if available. If nothing smaller + is available, it uses the smallest available size. + actualFramesPerBuffer will be set to the actual value on successful return. + OK to pass NULL to actualFramesPerBuffer. + The logic is very simmilar too setBestSampleRate only failure here is + not usually catastrophic. +*/ +static PaError setBestFramesPerBuffer( const AudioDeviceID device, + const bool isOutput, + unsigned long requestedFramesPerBuffer, + unsigned long *actualFramesPerBuffer ) +{ + UInt32 afpb; + const bool isInput = !isOutput; + UInt32 propsize = sizeof(UInt32); + OSErr err; + Float64 min = -1; /*the min blocksize*/ + Float64 best = -1; /*the best blocksize*/ + int i=0; + AudioValueRange *ranges; + + if( actualFramesPerBuffer == NULL ) + actualFramesPerBuffer = &afpb; + + + /* -- try and set exact FPB -- */ + err = AudioDeviceSetProperty( device, NULL, 0, isInput, + kAudioDevicePropertyBufferFrameSize, + propsize, &requestedFramesPerBuffer); + err = AudioDeviceGetProperty( device, 0, isInput, + kAudioDevicePropertyBufferFrameSize, + &propsize, actualFramesPerBuffer); + if( err ) + return ERR( err ); + if( *actualFramesPerBuffer == requestedFramesPerBuffer ) + return paNoError; /* we are done */ + + /* -- fetch available block sizes -- */ + err = AudioDeviceGetPropertyInfo( device, 0, isInput, + kAudioDevicePropertyBufferSizeRange, + &propsize, NULL ); + if( err ) + return ERR( err ); + ranges = (AudioValueRange *)calloc( 1, propsize ); + if( !ranges ) + return paInsufficientMemory; + err = AudioDeviceGetProperty( device, 0, isInput, + kAudioDevicePropertyBufferSizeRange, + &propsize, ranges ); + if( err ) + { + free( ranges ); + return ERR( err ); + } + VDBUG(("Requested block size of %lu was not available.\n", + requestedFramesPerBuffer )); + VDBUG(("%lu Available block sizes are:\n",propsize/sizeof(AudioValueRange))); +#ifdef MAC_CORE_VERBOSE_DEBUG + for( i=0; i best ) + best = ranges[i].mMaximum; + } + } + if( best == -1 ) + best = min; + VDBUG( ("Minimum FPB %g. best is %g.\n", min, best ) ); + free( ranges ); + + /* --- set the buffer size (ignore errors) -- */ + requestedFramesPerBuffer = (UInt32) best ; + propsize = sizeof( UInt32 ); + err = AudioDeviceSetProperty( device, NULL, 0, isInput, + kAudioDevicePropertyBufferSize, + propsize, &requestedFramesPerBuffer ); + /* --- read the property to check that it was set -- */ + err = AudioDeviceGetProperty( device, 0, isInput, + kAudioDevicePropertyBufferSize, + &propsize, actualFramesPerBuffer ); + + if( err ) + return ERR( err ); + + return paNoError; +} diff --git a/portaudio-v19/pa_mac_sm/pa_mac_sm.c b/portaudio-v19/pa_mac_sm/pa_mac_sm.c new file mode 100644 index 000000000..7a8e03009 --- /dev/null +++ b/portaudio-v19/pa_mac_sm/pa_mac_sm.c @@ -0,0 +1,1656 @@ +/* + * $Id$ + * Portable Audio I/O Library for Macintosh + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2000 Phil Burk + * + * Special thanks to Chris Rolfe for his many helpful suggestions, bug fixes, + * and code contributions. + * Thanks also to Tue Haste Andersen, Alberto Ricci, Nico Wald, + * Roelf Toxopeus and Tom Erbe for testing the code and making + * numerous suggestions. + * + * 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. + * + * 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. + * + * 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. + */ +/* Modification History + PLB20010415 - ScanInputDevices was setting sDefaultOutputDeviceID instead of sDefaultInputDeviceID + PLB20010415 - Device Scan was crashing for anything other than siBadSoundInDevice, but some Macs may return other errors! + PLB20010420 - Fix TIMEOUT in record mode. + PLB20010420 - Change CARBON_COMPATIBLE to TARGET_API_MAC_CARBON + PLB20010907 - Pass unused event to WaitNextEvent to prevent Mac OSX crash. Thanks Dominic Mazzoni. + PLB20010908 - Use requested number of input channels. Thanks Dominic Mazzoni. + PLB20011009 - Use NewSndCallBackUPP() for CARBON + PLB20020417 - I used to call Pa_GetMinNumBuffers() which doesn't take into account the + variable minFramesPerHostBuffer. Now I call PaMac_GetMinNumBuffers() which will + give lower latency when virtual memory is turned off. + Thanks Kristoffer Jensen and Georgios Marentakis for spotting this bug. + PLB20020423 - Use new method to calculate CPU load similar to other ports. Based on num frames calculated. + Fixed Pa_StreamTime(). Now estimates how many frames have played based on MicroSecond timer. + Added PA_MAX_USAGE_ALLOWED to prevent Mac form hanging when CPU load approaches 100%. + PLB20020424 - Fixed return value in Pa_StreamTime +*/ + +/* +COMPATIBILITY +This Macintosh implementation is designed for use with Mac OS 7, 8 and +9 on PowerMacs, and OS X if compiled with CARBON + +OUTPUT +A circular array of CmpSoundHeaders is used as a queue. For low latency situations +there will only be two small buffers used. For higher latency, more and larger buffers +may be used. +To play the sound we use SndDoCommand() with bufferCmd. Each buffer is followed +by a callbackCmd which informs us when the buffer has been processsed. + +INPUT +The SndInput Manager SPBRecord call is used for sound input. If only +input is used, then the PA user callback is called from the Input completion proc. +For full-duplex, or output only operation, the PA callback is called from the +HostBuffer output completion proc. In that case, input sound is passed to the +callback by a simple FIFO. + +TODO: +O- Add support for native sample data formats other than int16. +O- Review buffer sizing. Should it be based on result of siDeviceBufferInfo query? +O- Determine default devices somehow. +*/ +#include +#include +#include +#include +#include + +/* Mac specific includes */ +#include "OSUtils.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "portaudio.h" +#include "pa_host.h" +#include "pa_trace.h" + +#ifndef FALSE + #define FALSE (0) + #define TRUE (!FALSE) +#endif + +/* #define TARGET_API_MAC_CARBON (1) */ + +/* + * Define maximum CPU load that will be allowed. User callback will + * be skipped if load exceeds this limit. This is to prevent the Mac + * from hanging when the CPU is hogged by the sound thread. + * On my PowerBook G3, the mac hung when I used 94% of CPU ( usage = 0.94 ). + */ +#define PA_MAX_USAGE_ALLOWED (0.92) + +/* Debugging output macros. */ +#define PRINT(x) { printf x; fflush(stdout); } +#define ERR_RPT(x) PRINT(x) +#define DBUG(x) /* PRINT(x) /**/ +#define DBUGX(x) /* PRINT(x) /**/ + +#define MAC_PHYSICAL_FRAMES_PER_BUFFER (512) /* Minimum number of stereo frames per SoundManager double buffer. */ +#define MAC_VIRTUAL_FRAMES_PER_BUFFER (4096) /* Need this many when using Virtual Memory for recording. */ +#define PA_MIN_NUM_HOST_BUFFERS (2) +#define PA_MAX_NUM_HOST_BUFFERS (16) /* Do not exceed!! */ +#define PA_MAX_DEVICE_INFO (32) + +/* Conversions for 16.16 fixed point code. */ +#define DoubleToUnsignedFixed(x) ((UnsignedFixed) ((x) * 65536.0)) +#define UnsignedFixedToDouble(fx) (((double)(fx)) * (1.0/(1<<16))) + +/************************************************************************************/ +/****************** Structures ******************************************************/ +/************************************************************************************/ +/* Use for passing buffers from input callback to output callback for processing. */ +typedef struct MultiBuffer +{ + char *buffers[PA_MAX_NUM_HOST_BUFFERS]; + int numBuffers; + int nextWrite; + int nextRead; +} +MultiBuffer; + +/* Define structure to contain all Macintosh specific data. */ +typedef struct PaHostSoundControl +{ + UInt64 pahsc_EntryCount; + double pahsc_InverseMicrosPerHostBuffer; /* 1/Microseconds of real-time audio per user buffer. */ + + /* Use char instead of Boolean for atomic operation. */ + volatile char pahsc_IsRecording; /* Recording in progress. Set by foreground. Cleared by background. */ + volatile char pahsc_StopRecording; /* Signal sent to background. */ + volatile char pahsc_IfInsideCallback; + /* Input */ + SPB pahsc_InputParams; + SICompletionUPP pahsc_InputCompletionProc; + MultiBuffer pahsc_InputMultiBuffer; + int32 pahsc_BytesPerInputHostBuffer; + int32 pahsc_InputRefNum; + /* Output */ + CmpSoundHeader pahsc_SoundHeaders[PA_MAX_NUM_HOST_BUFFERS]; + int32 pahsc_BytesPerOutputHostBuffer; + SndChannelPtr pahsc_Channel; + SndCallBackUPP pahsc_OutputCompletionProc; + int32 pahsc_NumOutsQueued; + int32 pahsc_NumOutsPlayed; + PaTimestamp pahsc_NumFramesDone; + UInt64 pahsc_WhenFramesDoneIncremented; + /* Init Time -------------- */ + int32 pahsc_NumHostBuffers; + int32 pahsc_FramesPerHostBuffer; + int32 pahsc_UserBuffersPerHostBuffer; + int32 pahsc_MinFramesPerHostBuffer; /* Can vary depending on virtual memory usage. */ +} +PaHostSoundControl; + +/* Mac specific device information. */ +typedef struct internalPortAudioDevice +{ + long pad_DeviceRefNum; + long pad_DeviceBufferSize; + Component pad_Identifier; + PaDeviceInfo pad_Info; +} +internalPortAudioDevice; + +/************************************************************************************/ +/****************** Data ************************************************************/ +/************************************************************************************/ +static int sNumDevices = 0; +static internalPortAudioDevice sDevices[PA_MAX_DEVICE_INFO] = { 0 }; +static int32 sPaHostError = 0; +static int sDefaultOutputDeviceID; +static int sDefaultInputDeviceID; + +/************************************************************************************/ +/****************** Prototypes ******************************************************/ +/************************************************************************************/ +static PaError PaMac_TimeSlice( internalPortAudioStream *past, int16 *macOutputBufPtr ); +static PaError PaMac_CallUserLoop( internalPortAudioStream *past, int16 *outPtr ); +static PaError PaMac_RecordNext( internalPortAudioStream *past ); +static void PaMac_StartLoadCalculation( internalPortAudioStream *past ); +static int PaMac_GetMinNumBuffers( int minFramesPerHostBuffer, int framesPerBuffer, double sampleRate ); +static double *PaMac_GetSampleRatesFromHandle ( int numRates, Handle h ); +static PaError PaMac_ScanInputDevices( void ); +static PaError PaMac_ScanOutputDevices( void ); +static PaError PaMac_QueryOutputDeviceInfo( Component identifier, internalPortAudioDevice *ipad ); +static PaError PaMac_QueryInputDeviceInfo( Str255 deviceName, internalPortAudioDevice *ipad ); +static void PaMac_InitSoundHeader( internalPortAudioStream *past, CmpSoundHeader *sndHeader ); +static void PaMac_EndLoadCalculation( internalPortAudioStream *past ); +static void PaMac_PlayNext ( internalPortAudioStream *past, int index ); +static long PaMac_FillNextOutputBuffer( internalPortAudioStream *past, int index ); +static pascal void PaMac_InputCompletionProc(SPBPtr recParams); +static pascal void PaMac_OutputCompletionProc (SndChannelPtr theChannel, SndCommand * theCmd); +static PaError PaMac_BackgroundManager( internalPortAudioStream *past, int index ); +long PaHost_GetTotalBufferFrames( internalPortAudioStream *past ); +static int Mac_IsVirtualMemoryOn( void ); +static void PToCString(unsigned char* inString, char* outString); +char *MultiBuffer_GetNextWriteBuffer( MultiBuffer *mbuf ); +char *MultiBuffer_GetNextReadBuffer( MultiBuffer *mbuf ); +int MultiBuffer_GetNextReadIndex( MultiBuffer *mbuf ); +int MultiBuffer_GetNextWriteIndex( MultiBuffer *mbuf ); +int MultiBuffer_IsWriteable( MultiBuffer *mbuf ); +int MultiBuffer_IsReadable( MultiBuffer *mbuf ); +void MultiBuffer_AdvanceReadIndex( MultiBuffer *mbuf ); +void MultiBuffer_AdvanceWriteIndex( MultiBuffer *mbuf ); + +/************************************************************************* +** Simple FIFO index control for multiple buffers. +** Read and Write indices range from 0 to 2N-1. +** This allows us to distinguish between full and empty. +*/ +char *MultiBuffer_GetNextWriteBuffer( MultiBuffer *mbuf ) +{ + return mbuf->buffers[mbuf->nextWrite % mbuf->numBuffers]; +} +char *MultiBuffer_GetNextReadBuffer( MultiBuffer *mbuf ) +{ + return mbuf->buffers[mbuf->nextRead % mbuf->numBuffers]; +} +int MultiBuffer_GetNextReadIndex( MultiBuffer *mbuf ) +{ + return mbuf->nextRead % mbuf->numBuffers; +} +int MultiBuffer_GetNextWriteIndex( MultiBuffer *mbuf ) +{ + return mbuf->nextWrite % mbuf->numBuffers; +} + +int MultiBuffer_IsWriteable( MultiBuffer *mbuf ) +{ + int bufsFull = mbuf->nextWrite - mbuf->nextRead; + if( bufsFull < 0 ) bufsFull += (2 * mbuf->numBuffers); + return (bufsFull < mbuf->numBuffers); +} +int MultiBuffer_IsReadable( MultiBuffer *mbuf ) +{ + int bufsFull = mbuf->nextWrite - mbuf->nextRead; + if( bufsFull < 0 ) bufsFull += (2 * mbuf->numBuffers); + return (bufsFull > 0); +} +void MultiBuffer_AdvanceReadIndex( MultiBuffer *mbuf ) +{ + int temp = mbuf->nextRead + 1; + mbuf->nextRead = (temp >= (2 * mbuf->numBuffers)) ? 0 : temp; +} +void MultiBuffer_AdvanceWriteIndex( MultiBuffer *mbuf ) +{ + int temp = mbuf->nextWrite + 1; + mbuf->nextWrite = (temp >= (2 * mbuf->numBuffers)) ? 0 : temp; +} + +/************************************************************************* +** String Utility by Chris Rolfe +*/ +static void PToCString(unsigned char* inString, char* outString) +{ + long i; + for(i=0; isampleRates; + if( (rates != NULL) ) free( rates ); /* MEM_011 */ + dev->sampleRates = NULL; + if( dev->name != NULL ) free( (void *) dev->name ); /* MEM_010 */ + dev->name = NULL; + } + sNumDevices = 0; + return paNoError; +} + +/************************************************************************* + PaHost_Init() is the library initialization function - call this before + using the library. +*/ +PaError PaHost_Init( void ) +{ + PaError err; + NumVersionVariant version; + + version.parts = SndSoundManagerVersion(); + DBUG(("SndSoundManagerVersion = 0x%x\n", version.whole)); + + /* Have we already initialized the device info? */ + err = (PaError) Pa_CountDevices(); + if( err < 0 ) return err; + else return paNoError; +} + +/************************************************************************* + PaMac_ScanOutputDevices() queries the properties of all output devices. +*/ +static PaError PaMac_ScanOutputDevices( void ) +{ + PaError err; + Component identifier=0; + ComponentDescription criteria = { kSoundOutputDeviceType, 0, 0, 0, 0 }; + long numComponents, i; + + /* Search the system linked list for output components */ + numComponents = CountComponents (&criteria); + identifier = 0; + sDefaultOutputDeviceID = sNumDevices; /* FIXME - query somehow */ + for (i = 0; i < numComponents; i++) + { + /* passing nil returns first matching component. */ + identifier = FindNextComponent( identifier, &criteria); + sDevices[sNumDevices].pad_Identifier = identifier; + + /* Set up for default OUTPUT devices. */ + err = PaMac_QueryOutputDeviceInfo( identifier, &sDevices[sNumDevices] ); + if( err < 0 ) return err; + else sNumDevices++; + + } + + return paNoError; +} + +/************************************************************************* + PaMac_ScanInputDevices() queries the properties of all input devices. +*/ +static PaError PaMac_ScanInputDevices( void ) +{ + Str255 deviceName; + int count; + Handle iconHandle; + PaError err; + OSErr oserr; + count = 1; + sDefaultInputDeviceID = sNumDevices; /* FIXME - query somehow */ /* PLB20010415 - was setting sDefaultOutputDeviceID */ + while(true) + { + /* Thanks Chris Rolfe and Alberto Ricci for this trick. */ + oserr = SPBGetIndexedDevice(count++, deviceName, &iconHandle); + DBUG(("PaMac_ScanInputDevices: SPBGetIndexedDevice returned %d\n", oserr )); +#if 1 + /* PLB20010415 - was giving error for anything other than siBadSoundInDevice, but some Macs may return other errors! */ + if(oserr != noErr) break; /* Some type of error is expected when count > devices */ +#else + if(oserr == siBadSoundInDevice) + { /* it's expected when count > devices */ + oserr = noErr; + break; + } + if(oserr != noErr) + { + ERR_RPT(("ERROR: SPBGetIndexedDevice(%d,,) returned %d\n", count-1, oserr )); + sPaHostError = oserr; + return paHostError; + } +#endif + DisposeHandle(iconHandle); /* Don't need the icon */ + + err = PaMac_QueryInputDeviceInfo( deviceName, &sDevices[sNumDevices] ); + DBUG(("PaMac_ScanInputDevices: PaMac_QueryInputDeviceInfo returned %d\n", err )); + if( err < 0 ) return err; + else if( err == 1 ) sNumDevices++; + } + + return paNoError; +} + +/* Sample rate info returned by using siSampleRateAvailable selector in SPBGetDeviceInfo() */ +/* Thanks to Chris Rolfe for help with this query. */ +#pragma options align=mac68k +typedef struct +{ + int16 numRates; + UnsignedFixed (**rates)[]; /* Handle created by SPBGetDeviceInfo */ +} +SRateInfo; +#pragma options align=reset + +/************************************************************************* +** PaMac_QueryOutputDeviceInfo() +** Query information about a named output device. +** Clears contents of ipad and writes info based on queries. +** Return one if OK, +** zero if device cannot be used, +** or negative error. +*/ +static PaError PaMac_QueryOutputDeviceInfo( Component identifier, internalPortAudioDevice *ipad ) +{ + int len; + OSErr err; + PaDeviceInfo *dev = &ipad->pad_Info; + SRateInfo srinfo = {0}; + int numRates; + ComponentDescription tempD; + Handle nameH=nil, infoH=nil, iconH=nil; + + memset( ipad, 0, sizeof(internalPortAudioDevice) ); + + dev->structVersion = 1; + dev->maxInputChannels = 0; + dev->maxOutputChannels = 2; + dev->nativeSampleFormats = paInt16; /* FIXME - query to see if 24 or 32 bit data can be handled. */ + + /* Get sample rates supported. */ + err = GetSoundOutputInfo(identifier, siSampleRateAvailable, (Ptr) &srinfo); + if(err != noErr) + { + ERR_RPT(("Error in PaMac_QueryOutputDeviceInfo: GetSoundOutputInfo siSampleRateAvailable returned %d\n", err )); + goto error; + } + numRates = srinfo.numRates; + DBUG(("PaMac_QueryOutputDeviceInfo: srinfo.numRates = 0x%x\n", srinfo.numRates )); + if( numRates == 0 ) + { + dev->numSampleRates = -1; + numRates = 2; + } + else + { + dev->numSampleRates = numRates; + } + dev->sampleRates = PaMac_GetSampleRatesFromHandle( numRates, (Handle) srinfo.rates ); + /* SPBGetDeviceInfo created the handle, but it's OUR job to release it. */ + DisposeHandle((Handle) srinfo.rates); + + /* Device name */ + /* we pass an existing handle for the component name; + we don't care about the info (type, subtype, etc.) or icon, so set them to nil */ + infoH = nil; + iconH = nil; + nameH = NewHandle(0); + if(nameH == nil) return paInsufficientMemory; + err = GetComponentInfo(identifier, &tempD, nameH, infoH, iconH); + if (err) + { + ERR_RPT(("Error in PaMac_QueryOutputDeviceInfo: GetComponentInfo returned %d\n", err )); + goto error; + } + len = (*nameH)[0] + 1; + dev->name = (char *) malloc(len); /* MEM_010 */ + if( dev->name == NULL ) + { + DisposeHandle(nameH); + return paInsufficientMemory; + } + else + { + PToCString((unsigned char *)(*nameH), (char *) dev->name); + DisposeHandle(nameH); + } + + DBUG(("PaMac_QueryOutputDeviceInfo: dev->name = %s\n", dev->name )); + return paNoError; + +error: + sPaHostError = err; + return paHostError; + +} + +/************************************************************************* +** PaMac_QueryInputDeviceInfo() +** Query information about a named input device. +** Clears contents of ipad and writes info based on queries. +** Return one if OK, +** zero if device cannot be used, +** or negative error. +*/ +static PaError PaMac_QueryInputDeviceInfo( Str255 deviceName, internalPortAudioDevice *ipad ) +{ + PaError result = paNoError; + int len; + OSErr err; + long mRefNum = 0; + long tempL; + int16 tempS; + Fixed tempF; + PaDeviceInfo *dev = &ipad->pad_Info; + SRateInfo srinfo = {0}; + int numRates; + + memset( ipad, 0, sizeof(internalPortAudioDevice) ); + dev->maxOutputChannels = 0; + + /* Open device based on name. If device is in use, it may not be able to open in write mode. */ + err = SPBOpenDevice( deviceName, siWritePermission, &mRefNum); + if (err) + { + /* If device is in use, it may not be able to open in write mode so try read mode. */ + err = SPBOpenDevice( deviceName, siReadPermission, &mRefNum); + if (err) + { + ERR_RPT(("Error in PaMac_QueryInputDeviceInfo: SPBOpenDevice returned %d\n", err )); + sPaHostError = err; + return paHostError; + } + } + + /* Define macros for printing out device info. */ +#define PrintDeviceInfo(selector,var) \ + err = SPBGetDeviceInfo(mRefNum, selector, (Ptr) &var); \ + if (err) { \ + DBUG(("query %s failed\n", #selector )); \ + }\ + else { \ + DBUG(("query %s = 0x%x\n", #selector, var )); \ + } + + PrintDeviceInfo( siContinuous, tempS ); + PrintDeviceInfo( siAsync, tempS ); + PrintDeviceInfo( siNumberChannels, tempS ); + PrintDeviceInfo( siSampleSize, tempS ); + PrintDeviceInfo( siSampleRate, tempF ); + PrintDeviceInfo( siChannelAvailable, tempS ); + PrintDeviceInfo( siActiveChannels, tempL ); + PrintDeviceInfo( siDeviceBufferInfo, tempL ); + + err = SPBGetDeviceInfo(mRefNum, siActiveChannels, (Ptr) &tempL); + if (err == 0) DBUG(("%s = 0x%x\n", "siActiveChannels", tempL )); + /* Can we use this device? */ + err = SPBGetDeviceInfo(mRefNum, siAsync, (Ptr) &tempS); + if (err) + { + ERR_RPT(("Error in PaMac_QueryInputDeviceInfo: SPBGetDeviceInfo siAsync returned %d\n", err )); + goto error; + } + if( tempS == 0 ) goto useless; /* Does not support async recording so forget about it. */ + + err = SPBGetDeviceInfo(mRefNum, siChannelAvailable, (Ptr) &tempS); + if (err) + { + ERR_RPT(("Error in PaMac_QueryInputDeviceInfo: SPBGetDeviceInfo siChannelAvailable returned %d\n", err )); + goto error; + } + dev->maxInputChannels = tempS; + + /* Get sample rates supported. */ + err = SPBGetDeviceInfo(mRefNum, siSampleRateAvailable, (Ptr) &srinfo); + if (err) + { + ERR_RPT(("Error in PaMac_QueryInputDeviceInfo: SPBGetDeviceInfo siSampleRateAvailable returned %d\n", err )); + goto error; + } + + numRates = srinfo.numRates; + DBUG(("numRates = 0x%x\n", numRates )); + if( numRates == 0 ) + { + dev->numSampleRates = -1; + numRates = 2; + } + else + { + dev->numSampleRates = numRates; + } + dev->sampleRates = PaMac_GetSampleRatesFromHandle( numRates, (Handle) srinfo.rates ); + /* SPBGetDeviceInfo created the handle, but it's OUR job to release it. */ + DisposeHandle((Handle) srinfo.rates); + + /* Get size of device buffer. */ + err = SPBGetDeviceInfo(mRefNum, siDeviceBufferInfo, (Ptr) &tempL); + if (err) + { + ERR_RPT(("Error in PaMac_QueryInputDeviceInfo: SPBGetDeviceInfo siDeviceBufferInfo returned %d\n", err )); + goto error; + } + ipad->pad_DeviceBufferSize = tempL; + DBUG(("siDeviceBufferInfo = %d\n", tempL )); + + /* Set format based on sample size. */ + err = SPBGetDeviceInfo(mRefNum, siSampleSize, (Ptr) &tempS); + if (err) + { + ERR_RPT(("Error in PaMac_QueryInputDeviceInfo: SPBGetDeviceInfo siSampleSize returned %d\n", err )); + goto error; + } + switch( tempS ) + { + case 0x0020: + dev->nativeSampleFormats = paInt32; /* FIXME - warning, code probably won't support this! */ + break; + case 0x0010: + default: /* FIXME - What about other formats? */ + dev->nativeSampleFormats = paInt16; + break; + } + DBUG(("nativeSampleFormats = %d\n", dev->nativeSampleFormats )); + + /* Device name */ + len = deviceName[0] + 1; /* Get length of Pascal string */ + dev->name = (char *) malloc(len); /* MEM_010 */ + if( dev->name == NULL ) + { + result = paInsufficientMemory; + goto cleanup; + } + PToCString(deviceName, (char *) dev->name); + DBUG(("deviceName = %s\n", dev->name )); + result = (PaError) 1; + /* All done so close up device. */ +cleanup: + if( mRefNum ) SPBCloseDevice(mRefNum); + return result; + +error: + if( mRefNum ) SPBCloseDevice(mRefNum); + sPaHostError = err; + return paHostError; + +useless: + if( mRefNum ) SPBCloseDevice(mRefNum); + return (PaError) 0; +} + +/************************************************************************* +** Allocate a double array and fill it with listed sample rates. +*/ +static double * PaMac_GetSampleRatesFromHandle ( int numRates, Handle h ) +{ + OSErr err = noErr; + SInt8 hState; + int i; + UnsignedFixed *fixedRates; + double *rates = (double *) malloc( numRates * sizeof(double) ); /* MEM_011 */ + if( rates == NULL ) return NULL; + /* Save and restore handle state as suggested by TechNote at: + http://developer.apple.com/technotes/tn/tn1122.html + */ + hState = HGetState (h); + if (!(err = MemError ())) + { + HLock (h); + if (!(err = MemError ( ))) + { + fixedRates = (UInt32 *) *h; + for( i=0; i= Pa_CountDevices()) ) return NULL; + return &sDevices[id].pad_Info; +} +/*************************************************************************/ +PaDeviceID Pa_GetDefaultInputDeviceID( void ) +{ + return sDefaultInputDeviceID; +} + +/*************************************************************************/ +PaDeviceID Pa_GetDefaultOutputDeviceID( void ) +{ + return sDefaultOutputDeviceID; +} + +/********************************* BEGIN CPU UTILIZATION MEASUREMENT ****/ +static void PaMac_StartLoadCalculation( internalPortAudioStream *past ) +{ + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + UnsignedWide widePad; + if( pahsc == NULL ) return; + /* Query system timer for usage analysis and to prevent overuse of CPU. */ + Microseconds( &widePad ); + pahsc->pahsc_EntryCount = UnsignedWideToUInt64( widePad ); +} + +/****************************************************************************** +** Measure fractional CPU load based on real-time it took to calculate +** buffers worth of output. +*/ +/**************************************************************************/ +static void PaMac_EndLoadCalculation( internalPortAudioStream *past ) +{ + UnsignedWide widePad; + UInt64 currentCount; + long usecsElapsed; + double newUsage; + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + if( pahsc == NULL ) return; + + /* Measure CPU utilization during this callback. Note that this calculation + ** assumes that we had the processor the whole time. + */ +#define LOWPASS_COEFFICIENT_0 (0.95) +#define LOWPASS_COEFFICIENT_1 (0.99999 - LOWPASS_COEFFICIENT_0) + Microseconds( &widePad ); + currentCount = UnsignedWideToUInt64( widePad ); + + usecsElapsed = (long) U64Subtract(currentCount, pahsc->pahsc_EntryCount); + + /* Use inverse because it is faster than the divide. */ + newUsage = usecsElapsed * pahsc->pahsc_InverseMicrosPerHostBuffer; + + past->past_Usage = (LOWPASS_COEFFICIENT_0 * past->past_Usage) + + (LOWPASS_COEFFICIENT_1 * newUsage); + +} + +/*********************************************************************** +** Called by Pa_StartStream() +*/ +PaError PaHost_StartInput( internalPortAudioStream *past ) +{ + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + pahsc->pahsc_IsRecording = 0; + pahsc->pahsc_StopRecording = 0; + pahsc->pahsc_InputMultiBuffer.nextWrite = 0; + pahsc->pahsc_InputMultiBuffer.nextRead = 0; + return PaMac_RecordNext( past ); +} + +/*********************************************************************** +** Called by Pa_StopStream(). +** May be called during error recovery or cleanup code +** so protect against NULL pointers. +*/ +PaError PaHost_StopInput( internalPortAudioStream *past, int abort ) +{ + int32 timeOutMsec; + PaError result = paNoError; + OSErr err = 0; + long mRefNum; + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + if( pahsc == NULL ) return paNoError; + + (void) abort; + + mRefNum = pahsc->pahsc_InputRefNum; + + DBUG(("PaHost_StopInput: mRefNum = %d\n", mRefNum )); + if( mRefNum ) + { + DBUG(("PaHost_StopInput: pahsc_IsRecording = %d\n", pahsc->pahsc_IsRecording )); + if( pahsc->pahsc_IsRecording ) + { + /* PLB20010420 - Fix TIMEOUT in record mode. */ + pahsc->pahsc_StopRecording = 1; /* Request that we stop recording. */ + err = SPBStopRecording(mRefNum); + DBUG(("PaHost_StopInput: then pahsc_IsRecording = %d\n", pahsc->pahsc_IsRecording )); + + /* Calculate timeOut longer than longest time it could take to play one buffer. */ + timeOutMsec = (int32) ((1500.0 * pahsc->pahsc_FramesPerHostBuffer) / past->past_SampleRate); + /* Keep querying sound channel until it is no longer busy playing. */ + while( !err && pahsc->pahsc_IsRecording && (timeOutMsec > 0)) + { + Pa_Sleep(20); + timeOutMsec -= 20; + } + if( timeOutMsec <= 0 ) + { + ERR_RPT(("PaHost_StopInput: timed out!\n")); + return paTimedOut; + } + } + } + if( err ) + { + sPaHostError = err; + result = paHostError; + } + + DBUG(("PaHost_StopInput: finished.\n", mRefNum )); + return result; +} + +/***********************************************************************/ +static void PaMac_InitSoundHeader( internalPortAudioStream *past, CmpSoundHeader *sndHeader ) +{ + sndHeader->numChannels = past->past_NumOutputChannels; + sndHeader->sampleRate = DoubleToUnsignedFixed(past->past_SampleRate); + sndHeader->loopStart = 0; + sndHeader->loopEnd = 0; + sndHeader->encode = cmpSH; + sndHeader->baseFrequency = kMiddleC; + sndHeader->markerChunk = nil; + sndHeader->futureUse2 = nil; + sndHeader->stateVars = nil; + sndHeader->leftOverSamples = nil; + sndHeader->compressionID = 0; + sndHeader->packetSize = 0; + sndHeader->snthID = 0; + sndHeader->sampleSize = 8 * sizeof(int16); // FIXME - might be 24 or 32 bits some day; + sndHeader->sampleArea[0] = 0; + sndHeader->format = kSoundNotCompressed; +} + +static void SetFramesDone( PaHostSoundControl *pahsc, PaTimestamp framesDone ) +{ + UnsignedWide now; + Microseconds( &now ); + pahsc->pahsc_NumFramesDone = framesDone; + pahsc->pahsc_WhenFramesDoneIncremented = UnsignedWideToUInt64( now ); +} + +/***********************************************************************/ +PaError PaHost_StartOutput( internalPortAudioStream *past ) +{ + SndCommand pauseCommand; + SndCommand resumeCommand; + int i; + OSErr error; + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + if( pahsc == NULL ) return paInternalError; + if( pahsc->pahsc_Channel == NULL ) return paInternalError; + + past->past_StopSoon = 0; + past->past_IsActive = 1; + pahsc->pahsc_NumOutsQueued = 0; + pahsc->pahsc_NumOutsPlayed = 0; + + SetFramesDone( pahsc, 0.0 ); + + /* Pause channel so it does not do back ground processing while we are still filling the queue. */ + pauseCommand.cmd = pauseCmd; + pauseCommand.param1 = pauseCommand.param2 = 0; + error = SndDoCommand (pahsc->pahsc_Channel, &pauseCommand, true); + if (noErr != error) goto exit; + + /* Queue all of the buffers so we start off full. */ + for (i = 0; ipahsc_NumHostBuffers; i++) + { + PaMac_PlayNext( past, i ); + } + + /* Resume channel now that the queue is full. */ + resumeCommand.cmd = resumeCmd; + resumeCommand.param1 = resumeCommand.param2 = 0; + error = SndDoImmediate( pahsc->pahsc_Channel, &resumeCommand ); + if (noErr != error) goto exit; + + return paNoError; +exit: + past->past_IsActive = 0; + sPaHostError = error; + ERR_RPT(("Error in PaHost_StartOutput: SndDoCommand returned %d\n", error )); + return paHostError; +} + +/*******************************************************************/ +long PaHost_GetTotalBufferFrames( internalPortAudioStream *past ) +{ + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + return (long) (pahsc->pahsc_NumHostBuffers * pahsc->pahsc_FramesPerHostBuffer); +} + +/*********************************************************************** +** Called by Pa_StopStream(). +** May be called during error recovery or cleanup code +** so protect against NULL pointers. +*/ +PaError PaHost_StopOutput( internalPortAudioStream *past, int abort ) +{ + int32 timeOutMsec; + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + if( pahsc == NULL ) return paNoError; + if( pahsc->pahsc_Channel == NULL ) return paNoError; + + DBUG(("PaHost_StopOutput()\n")); + if( past->past_IsActive == 0 ) return paNoError; + + /* Set flags for callback function to see. */ + if( abort ) past->past_StopNow = 1; + past->past_StopSoon = 1; + /* Calculate timeOut longer than longest time it could take to play all buffers. */ + timeOutMsec = (int32) ((1500.0 * PaHost_GetTotalBufferFrames( past )) / past->past_SampleRate); + /* Keep querying sound channel until it is no longer busy playing. */ + while( past->past_IsActive && (timeOutMsec > 0)) + { + Pa_Sleep(20); + timeOutMsec -= 20; + } + if( timeOutMsec <= 0 ) + { + ERR_RPT(("PaHost_StopOutput: timed out!\n")); + return paTimedOut; + } + else return paNoError; +} + +/***********************************************************************/ +PaError PaHost_StartEngine( internalPortAudioStream *past ) +{ + (void) past; /* Prevent unused variable warnings. */ + return paNoError; +} + +/***********************************************************************/ +PaError PaHost_StopEngine( internalPortAudioStream *past, int abort ) +{ + (void) past; /* Prevent unused variable warnings. */ + (void) abort; /* Prevent unused variable warnings. */ + return paNoError; +} +/***********************************************************************/ +PaError PaHost_StreamActive( internalPortAudioStream *past ) +{ + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + return (PaError) ( past->past_IsActive + pahsc->pahsc_IsRecording ); +} +int Mac_IsVirtualMemoryOn( void ) +{ + long attr; + OSErr result = Gestalt( gestaltVMAttr, &attr ); + DBUG(("gestaltVMAttr : 0x%x\n", attr )); + return ((attr >> gestaltVMHasPagingControl ) & 1); +} + +/******************************************************************* +* Determine number of host Buffers +* and how many User Buffers we can put into each host buffer. +*/ +static void PaHost_CalcNumHostBuffers( internalPortAudioStream *past ) +{ + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + int32 minNumBuffers; + int32 minFramesPerHostBuffer; + int32 minTotalFrames; + int32 userBuffersPerHostBuffer; + int32 framesPerHostBuffer; + int32 numHostBuffers; + + minFramesPerHostBuffer = pahsc->pahsc_MinFramesPerHostBuffer; + minFramesPerHostBuffer = (minFramesPerHostBuffer + 7) & ~7; + DBUG(("PaHost_CalcNumHostBuffers: minFramesPerHostBuffer = %d\n", minFramesPerHostBuffer )); + + /* Determine number of user buffers based on minimum latency. */ + /* PLB20020417 I used to call Pa_GetMinNumBuffers() which doesn't take into account the + ** variable minFramesPerHostBuffer. Now I call PaMac_GetMinNumBuffers() which will + ** gove lower latency when virtual memory is turned off. */ + /* minNumBuffers = Pa_GetMinNumBuffers( past->past_FramesPerUserBuffer, past->past_SampleRate ); WRONG */ + minNumBuffers = PaMac_GetMinNumBuffers( minFramesPerHostBuffer, past->past_FramesPerUserBuffer, past->past_SampleRate ); + + past->past_NumUserBuffers = ( minNumBuffers > past->past_NumUserBuffers ) ? minNumBuffers : past->past_NumUserBuffers; + DBUG(("PaHost_CalcNumHostBuffers: min past_NumUserBuffers = %d\n", past->past_NumUserBuffers )); + minTotalFrames = past->past_NumUserBuffers * past->past_FramesPerUserBuffer; + + /* We cannot make the buffers too small because they may not get serviced quickly enough. */ + if( (int32) past->past_FramesPerUserBuffer < minFramesPerHostBuffer ) + { + userBuffersPerHostBuffer = + (minFramesPerHostBuffer + past->past_FramesPerUserBuffer - 1) / + past->past_FramesPerUserBuffer; + } + else + { + userBuffersPerHostBuffer = 1; + } + framesPerHostBuffer = past->past_FramesPerUserBuffer * userBuffersPerHostBuffer; + + /* Calculate number of host buffers needed. Round up to cover minTotalFrames. */ + numHostBuffers = (minTotalFrames + framesPerHostBuffer - 1) / framesPerHostBuffer; + /* Make sure we have enough host buffers. */ + if( numHostBuffers < PA_MIN_NUM_HOST_BUFFERS) + { + numHostBuffers = PA_MIN_NUM_HOST_BUFFERS; + } + else + { + /* If we have too many host buffers, try to put more user buffers in a host buffer. */ + while(numHostBuffers > PA_MAX_NUM_HOST_BUFFERS) + { + userBuffersPerHostBuffer += 1; + framesPerHostBuffer = past->past_FramesPerUserBuffer * userBuffersPerHostBuffer; + numHostBuffers = (minTotalFrames + framesPerHostBuffer - 1) / framesPerHostBuffer; + } + } + + pahsc->pahsc_UserBuffersPerHostBuffer = userBuffersPerHostBuffer; + pahsc->pahsc_FramesPerHostBuffer = framesPerHostBuffer; + pahsc->pahsc_NumHostBuffers = numHostBuffers; + DBUG(("PaHost_CalcNumHostBuffers: pahsc_UserBuffersPerHostBuffer = %d\n", pahsc->pahsc_UserBuffersPerHostBuffer )); + DBUG(("PaHost_CalcNumHostBuffers: pahsc_NumHostBuffers = %d\n", pahsc->pahsc_NumHostBuffers )); + DBUG(("PaHost_CalcNumHostBuffers: pahsc_FramesPerHostBuffer = %d\n", pahsc->pahsc_FramesPerHostBuffer )); + DBUG(("PaHost_CalcNumHostBuffers: past_NumUserBuffers = %d\n", past->past_NumUserBuffers )); +} + +/*******************************************************************/ +PaError PaHost_OpenStream( internalPortAudioStream *past ) +{ + OSErr err; + PaError result = paHostError; + PaHostSoundControl *pahsc; + int i; + /* Allocate and initialize host data. */ + pahsc = (PaHostSoundControl *) PaHost_AllocateFastMemory(sizeof(PaHostSoundControl)); + if( pahsc == NULL ) + { + return paInsufficientMemory; + } + past->past_DeviceData = (void *) pahsc; + + /* If recording, and virtual memory is turned on, then use bigger buffers to prevent glitches. */ + if( (past->past_NumInputChannels > 0) && Mac_IsVirtualMemoryOn() ) + { + pahsc->pahsc_MinFramesPerHostBuffer = MAC_VIRTUAL_FRAMES_PER_BUFFER; + } + else + { + pahsc->pahsc_MinFramesPerHostBuffer = MAC_PHYSICAL_FRAMES_PER_BUFFER; + } + + PaHost_CalcNumHostBuffers( past ); + + /* Setup constants for CPU load measurement. */ + pahsc->pahsc_InverseMicrosPerHostBuffer = past->past_SampleRate / (1000000.0 * pahsc->pahsc_FramesPerHostBuffer); + + /* ------------------ OUTPUT */ + if( past->past_NumOutputChannels > 0 ) + { + /* Create sound channel to which we can send commands. */ + pahsc->pahsc_Channel = 0L; + err = SndNewChannel(&pahsc->pahsc_Channel, sampledSynth, 0, nil); /* FIXME - use kUseOptionalOutputDevice if not default. */ + if(err != 0) + { + ERR_RPT(("Error in PaHost_OpenStream: SndNewChannel returned 0x%x\n", err )); + goto error; + } + + /* Install our callback function pointer straight into the sound channel structure */ + /* Use new CARBON name for callback procedure. */ +#if TARGET_API_MAC_CARBON + pahsc->pahsc_OutputCompletionProc = NewSndCallBackUPP(PaMac_OutputCompletionProc); +#else + pahsc->pahsc_OutputCompletionProc = NewSndCallBackProc(PaMac_OutputCompletionProc); +#endif + + pahsc->pahsc_Channel->callBack = pahsc->pahsc_OutputCompletionProc; + + pahsc->pahsc_BytesPerOutputHostBuffer = pahsc->pahsc_FramesPerHostBuffer * past->past_NumOutputChannels * sizeof(int16); + for (i = 0; ipahsc_NumHostBuffers; i++) + { + char *buf = (char *)PaHost_AllocateFastMemory(pahsc->pahsc_BytesPerOutputHostBuffer); + if (buf == NULL) + { + ERR_RPT(("Error in PaHost_OpenStream: could not allocate output buffer. Size = \n", pahsc->pahsc_BytesPerOutputHostBuffer )); + goto memerror; + } + + PaMac_InitSoundHeader( past, &pahsc->pahsc_SoundHeaders[i] ); + pahsc->pahsc_SoundHeaders[i].samplePtr = buf; + pahsc->pahsc_SoundHeaders[i].numFrames = (unsigned long) pahsc->pahsc_FramesPerHostBuffer; + + } + } +#ifdef SUPPORT_AUDIO_CAPTURE + /* ------------------ INPUT */ + /* Use double buffer scheme that matches output. */ + if( past->past_NumInputChannels > 0 ) + { + int16 tempS; + long tempL; + Fixed tempF; + long mRefNum; + unsigned char noname = 0; /* FIXME - use real device names. */ +#if TARGET_API_MAC_CARBON + pahsc->pahsc_InputCompletionProc = NewSICompletionUPP((SICompletionProcPtr)PaMac_InputCompletionProc); +#else + pahsc->pahsc_InputCompletionProc = NewSICompletionProc((ProcPtr)PaMac_InputCompletionProc); +#endif + pahsc->pahsc_BytesPerInputHostBuffer = pahsc->pahsc_FramesPerHostBuffer * past->past_NumInputChannels * sizeof(int16); + for (i = 0; ipahsc_NumHostBuffers; i++) + { + char *buf = (char *) PaHost_AllocateFastMemory(pahsc->pahsc_BytesPerInputHostBuffer); + if ( buf == NULL ) + { + ERR_RPT(("PaHost_OpenStream: could not allocate input buffer. Size = \n", pahsc->pahsc_BytesPerInputHostBuffer )); + goto memerror; + } + pahsc->pahsc_InputMultiBuffer.buffers[i] = buf; + } + pahsc->pahsc_InputMultiBuffer.numBuffers = pahsc->pahsc_NumHostBuffers; + + err = SPBOpenDevice( (const unsigned char *) &noname, siWritePermission, &mRefNum); /* FIXME - use name so we get selected device */ + // FIXME err = SPBOpenDevice( (const unsigned char *) sDevices[past->past_InputDeviceID].pad_Info.name, siWritePermission, &mRefNum); + if (err) goto error; + pahsc->pahsc_InputRefNum = mRefNum; + DBUG(("PaHost_OpenStream: mRefNum = %d\n", mRefNum )); + + /* Set input device characteristics. */ + tempS = 1; + err = SPBSetDeviceInfo(mRefNum, siContinuous, (Ptr) &tempS); + if (err) + { + ERR_RPT(("Error in PaHost_OpenStream: SPBSetDeviceInfo siContinuous returned %d\n", err )); + goto error; + } + + tempL = 0x03; + err = SPBSetDeviceInfo(mRefNum, siActiveChannels, (Ptr) &tempL); + if (err) + { + DBUG(("PaHost_OpenStream: setting siActiveChannels returned 0x%x. Error ignored.\n", err )); + } + + /* PLB20010908 - Use requested number of input channels. Thanks Dominic Mazzoni. */ + tempS = past->past_NumInputChannels; + err = SPBSetDeviceInfo(mRefNum, siNumberChannels, (Ptr) &tempS); + if (err) + { + ERR_RPT(("Error in PaHost_OpenStream: SPBSetDeviceInfo siNumberChannels returned %d\n", err )); + goto error; + } + + tempF = ((unsigned long)past->past_SampleRate) << 16; + err = SPBSetDeviceInfo(mRefNum, siSampleRate, (Ptr) &tempF); + if (err) + { + ERR_RPT(("Error in PaHost_OpenStream: SPBSetDeviceInfo siSampleRate returned %d\n", err )); + goto error; + } + + /* Setup record-parameter block */ + pahsc->pahsc_InputParams.inRefNum = mRefNum; + pahsc->pahsc_InputParams.milliseconds = 0; // not used + pahsc->pahsc_InputParams.completionRoutine = pahsc->pahsc_InputCompletionProc; + pahsc->pahsc_InputParams.interruptRoutine = 0; + pahsc->pahsc_InputParams.userLong = (long) past; + pahsc->pahsc_InputParams.unused1 = 0; + } +#endif /* SUPPORT_AUDIO_CAPTURE */ + DBUG(("PaHost_OpenStream: complete.\n")); + return paNoError; + +error: + PaHost_CloseStream( past ); + ERR_RPT(("PaHost_OpenStream: sPaHostError = 0x%x.\n", err )); + sPaHostError = err; + return paHostError; + +memerror: + PaHost_CloseStream( past ); + return paInsufficientMemory; +} + +/*********************************************************************** +** Called by Pa_CloseStream(). +** May be called during error recovery or cleanup code +** so protect against NULL pointers. +*/ +PaError PaHost_CloseStream( internalPortAudioStream *past ) +{ + PaError result = paNoError; + OSErr err = 0; + int i; + PaHostSoundControl *pahsc; + + DBUG(("PaHost_CloseStream( 0x%x )\n", past )); + + if( past == NULL ) return paBadStreamPtr; + + pahsc = (PaHostSoundControl *) past->past_DeviceData; + if( pahsc == NULL ) return paNoError; + + if( past->past_NumOutputChannels > 0 ) + { + /* TRUE means flush now instead of waiting for quietCmd to be processed. */ + if( pahsc->pahsc_Channel != NULL ) SndDisposeChannel(pahsc->pahsc_Channel, TRUE); + { + for (i = 0; ipahsc_NumHostBuffers; i++) + { + Ptr p = (Ptr) pahsc->pahsc_SoundHeaders[i].samplePtr; + if( p != NULL ) PaHost_FreeFastMemory( p, pahsc->pahsc_BytesPerOutputHostBuffer ); + } + } + } + + if( past->past_NumInputChannels > 0 ) + { + if( pahsc->pahsc_InputRefNum ) + { + err = SPBCloseDevice(pahsc->pahsc_InputRefNum); + pahsc->pahsc_InputRefNum = 0; + if( err ) + { + sPaHostError = err; + result = paHostError; + } + } + { + for (i = 0; ipahsc_InputMultiBuffer.numBuffers; i++) + { + Ptr p = (Ptr) pahsc->pahsc_InputMultiBuffer.buffers[i]; + if( p != NULL ) PaHost_FreeFastMemory( p, pahsc->pahsc_BytesPerInputHostBuffer ); + } + } + } + + past->past_DeviceData = NULL; + PaHost_FreeFastMemory( pahsc, sizeof(PaHostSoundControl) ); + + DBUG(("PaHost_CloseStream: complete.\n", past )); + return result; +} +/*************************************************************************/ +int Pa_GetMinNumBuffers( int framesPerUserBuffer, double sampleRate ) +{ +/* We use the MAC_VIRTUAL_FRAMES_PER_BUFFER because we might be recording. +** This routine doesn't have enough information to determine the best value +** and is being depracated. */ + return PaMac_GetMinNumBuffers( MAC_VIRTUAL_FRAMES_PER_BUFFER, framesPerUserBuffer, sampleRate ); +} +/*************************************************************************/ +static int PaMac_GetMinNumBuffers( int minFramesPerHostBuffer, int framesPerUserBuffer, double sampleRate ) +{ + int minUserPerHost = ( minFramesPerHostBuffer + framesPerUserBuffer - 1) / framesPerUserBuffer; + int numBufs = PA_MIN_NUM_HOST_BUFFERS * minUserPerHost; + if( numBufs < PA_MIN_NUM_HOST_BUFFERS ) numBufs = PA_MIN_NUM_HOST_BUFFERS; + (void) sampleRate; + return numBufs; +} + +/*************************************************************************/ +void Pa_Sleep( int32 msec ) +{ + EventRecord event; + int32 sleepTime, endTime; + /* Convert to ticks. Round up so we sleep a MINIMUM of msec time. */ + sleepTime = ((msec * 60) + 999) / 1000; + if( sleepTime < 1 ) sleepTime = 1; + endTime = TickCount() + sleepTime; + do + { + DBUGX(("Sleep for %d ticks.\n", sleepTime )); + /* Use WaitNextEvent() to sleep without getting events. */ + /* PLB20010907 - Pass unused event to WaitNextEvent instead of NULL to prevent + * Mac OSX crash. Thanks Dominic Mazzoni. */ + WaitNextEvent( 0, &event, sleepTime, NULL ); + sleepTime = endTime - TickCount(); + } + while( sleepTime > 0 ); +} +/*************************************************************************/ +int32 Pa_GetHostError( void ) +{ + int32 err = sPaHostError; + sPaHostError = 0; + return err; +} + +/************************************************************************* + * Allocate memory that can be accessed in real-time. + * This may need to be held in physical memory so that it is not + * paged to virtual memory. + * This call MUST be balanced with a call to PaHost_FreeFastMemory(). + */ +void *PaHost_AllocateFastMemory( long numBytes ) +{ + void *addr = NewPtrClear( numBytes ); + if( (addr == NULL) || (MemError () != 0) ) return NULL; + +#if (TARGET_API_MAC_CARBON == 0) + if( HoldMemory( addr, numBytes ) != noErr ) + { + DisposePtr( (Ptr) addr ); + return NULL; + } +#endif + return addr; +} + +/************************************************************************* + * Free memory that could be accessed in real-time. + * This call MUST be balanced with a call to PaHost_AllocateFastMemory(). + */ +void PaHost_FreeFastMemory( void *addr, long numBytes ) +{ + if( addr == NULL ) return; +#if TARGET_API_MAC_CARBON + (void) numBytes; +#else + UnholdMemory( addr, numBytes ); +#endif + DisposePtr( (Ptr) addr ); +} + +/*************************************************************************/ +PaTimestamp Pa_StreamTime( PortAudioStream *stream ) +{ + PaTimestamp framesDone1; + PaTimestamp framesDone2; + UInt64 whenIncremented; + UnsignedWide now; + UInt64 now64; + long microsElapsed; + long framesElapsed; + + PaHostSoundControl *pahsc; + internalPortAudioStream *past = (internalPortAudioStream *) stream; + if( past == NULL ) return paBadStreamPtr; + pahsc = (PaHostSoundControl *) past->past_DeviceData; + +/* Capture information from audio thread. + * We have to be careful that we don't get interrupted in the middle. + * So we grab the pahsc_NumFramesDone twice and make sure it didn't change. + */ + do + { + framesDone1 = pahsc->pahsc_NumFramesDone; + whenIncremented = pahsc->pahsc_WhenFramesDoneIncremented; + framesDone2 = pahsc->pahsc_NumFramesDone; + } while( framesDone1 != framesDone2 ); + + /* Calculate how many microseconds have elapsed and convert to frames. */ + Microseconds( &now ); + now64 = UnsignedWideToUInt64( now ); + microsElapsed = U64Subtract( now64, whenIncremented ); + framesElapsed = microsElapsed * past->past_SampleRate * 0.000001; + + return framesDone1 + framesElapsed; +} + +/************************************************************************** +** Callback for Input, SPBRecord() +*/ +int gRecordCounter = 0; +int gPlayCounter = 0; +pascal void PaMac_InputCompletionProc(SPBPtr recParams) +{ + PaError result = paNoError; + int finished = 1; + internalPortAudioStream *past; + PaHostSoundControl *pahsc; + + gRecordCounter += 1; /* debug hack to see if engine running */ + + /* Get our PA data from Mac structure. */ + past = (internalPortAudioStream *) recParams->userLong; + if( past == NULL ) return; + + if( past->past_Magic != PA_MAGIC ) + { + AddTraceMessage("PaMac_InputCompletionProc: bad MAGIC, past", (long) past ); + AddTraceMessage("PaMac_InputCompletionProc: bad MAGIC, magic", (long) past->past_Magic ); + goto error; + } + pahsc = (PaHostSoundControl *) past->past_DeviceData; + past->past_NumCallbacks += 1; + + /* Have we been asked to stop recording? */ + if( (recParams->error == abortErr) || pahsc->pahsc_StopRecording ) goto error; + + /* If there are no output channels, then we need to call the user callback function from here. + * Otherwise we will call the user code during the output completion routine. + */ + if(past->past_NumOutputChannels == 0) + { + SetFramesDone( pahsc, + pahsc->pahsc_NumFramesDone + pahsc->pahsc_FramesPerHostBuffer ); + result = PaMac_CallUserLoop( past, NULL ); + } + + /* Did user code ask us to stop? If not, issue another recording request. */ + if( (result == paNoError) && (pahsc->pahsc_StopRecording == 0) ) + { + result = PaMac_RecordNext( past ); + if( result != paNoError ) pahsc->pahsc_IsRecording = 0; + } + else goto error; + + return; + +error: + pahsc->pahsc_IsRecording = 0; + pahsc->pahsc_StopRecording = 0; + return; +} + +/*********************************************************************** +** Called by either input or output completion proc. +** Grabs input data if any present, and calls PA conversion code, +** that in turn calls user code. +*/ +static PaError PaMac_CallUserLoop( internalPortAudioStream *past, int16 *outPtr ) +{ + PaError result = paNoError; + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + int16 *inPtr = NULL; + int i; + + + /* Advance read index for sound input FIFO here, independantly of record/write process. */ + if(past->past_NumInputChannels > 0) + { + if( MultiBuffer_IsReadable( &pahsc->pahsc_InputMultiBuffer ) ) + { + inPtr = (int16 *) MultiBuffer_GetNextReadBuffer( &pahsc->pahsc_InputMultiBuffer ); + MultiBuffer_AdvanceReadIndex( &pahsc->pahsc_InputMultiBuffer ); + } + } + + /* Call user code enough times to fill buffer. */ + if( (inPtr != NULL) || (outPtr != NULL) ) + { + PaMac_StartLoadCalculation( past ); /* CPU usage */ + +#ifdef PA_MAX_USAGE_ALLOWED + /* If CPU usage exceeds limit, skip user callback to prevent hanging CPU. */ + if( past->past_Usage > PA_MAX_USAGE_ALLOWED ) + { + past->past_FrameCount += (PaTimestamp) pahsc->pahsc_FramesPerHostBuffer; + } + else +#endif + { + + for( i=0; ipahsc_UserBuffersPerHostBuffer; i++ ) + { + result = (PaError) Pa_CallConvertInt16( past, inPtr, outPtr ); + if( result != 0) + { + /* Recording might be in another process, so tell it to stop with a flag. */ + pahsc->pahsc_StopRecording = pahsc->pahsc_IsRecording; + break; + } + /* Advance sample pointers. */ + if(inPtr != NULL) inPtr += past->past_FramesPerUserBuffer * past->past_NumInputChannels; + if(outPtr != NULL) outPtr += past->past_FramesPerUserBuffer * past->past_NumOutputChannels; + } + } + + PaMac_EndLoadCalculation( past ); + } + return result; +} + +/*********************************************************************** +** Setup next recording buffer in FIFO and issue recording request to Snd Input Manager. +*/ +static PaError PaMac_RecordNext( internalPortAudioStream *past ) +{ + PaError result = paNoError; + OSErr err; + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + /* Get pointer to next buffer to record into. */ + pahsc->pahsc_InputParams.bufferPtr = MultiBuffer_GetNextWriteBuffer( &pahsc->pahsc_InputMultiBuffer ); + + /* Advance write index if there is room. Otherwise keep writing same buffer. */ + if( MultiBuffer_IsWriteable( &pahsc->pahsc_InputMultiBuffer ) ) + { + MultiBuffer_AdvanceWriteIndex( &pahsc->pahsc_InputMultiBuffer ); + } + + AddTraceMessage("PaMac_RecordNext: bufferPtr", (long) pahsc->pahsc_InputParams.bufferPtr ); + AddTraceMessage("PaMac_RecordNext: nextWrite", pahsc->pahsc_InputMultiBuffer.nextWrite ); + + /* Setup parameters and issue an asynchronous recording request. */ + pahsc->pahsc_InputParams.bufferLength = pahsc->pahsc_BytesPerInputHostBuffer; + pahsc->pahsc_InputParams.count = pahsc->pahsc_BytesPerInputHostBuffer; + err = SPBRecord(&pahsc->pahsc_InputParams, true); + if( err ) + { + AddTraceMessage("PaMac_RecordNext: SPBRecord error ", err ); + sPaHostError = err; + result = paHostError; + } + else + { + pahsc->pahsc_IsRecording = 1; + } + return result; +} + +/************************************************************************** +** Callback for Output Playback() +** Return negative error, 0 to continue, 1 to stop. +*/ +long PaMac_FillNextOutputBuffer( internalPortAudioStream *past, int index ) +{ + PaHostSoundControl *pahsc; + long result = 0; + int finished = 1; + char *outPtr; + + gPlayCounter += 1; /* debug hack */ + + past->past_NumCallbacks += 1; + pahsc = (PaHostSoundControl *) past->past_DeviceData; + if( pahsc == NULL ) return -1; + /* Are we nested?! */ + if( pahsc->pahsc_IfInsideCallback ) return 0; + pahsc->pahsc_IfInsideCallback = 1; + /* Get pointer to buffer to fill. */ + outPtr = pahsc->pahsc_SoundHeaders[index].samplePtr; + /* Combine with any sound input, and call user callback. */ + result = PaMac_CallUserLoop( past, (int16 *) outPtr ); + + pahsc->pahsc_IfInsideCallback = 0; + return result; +} + +/************************************************************************************* +** Called by SoundManager when ready for another buffer. +*/ +static pascal void PaMac_OutputCompletionProc (SndChannelPtr theChannel, SndCommand * theCallBackCmd) +{ + internalPortAudioStream *past; + PaHostSoundControl *pahsc; + (void) theChannel; + (void) theCallBackCmd; + + /* Get our data from Mac structure. */ + past = (internalPortAudioStream *) theCallBackCmd->param2; + if( past == NULL ) return; + + pahsc = (PaHostSoundControl *) past->past_DeviceData; + pahsc->pahsc_NumOutsPlayed += 1; + + SetFramesDone( pahsc, + pahsc->pahsc_NumFramesDone + pahsc->pahsc_FramesPerHostBuffer ); + + PaMac_BackgroundManager( past, theCallBackCmd->param1 ); +} + +/*******************************************************************/ +static PaError PaMac_BackgroundManager( internalPortAudioStream *past, int index ) +{ + PaError result = paNoError; + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + /* Has someone asked us to abort by calling Pa_AbortStream()? */ + if( past->past_StopNow ) + { + SndCommand command; + /* Clear the queue of any pending commands. */ + command.cmd = flushCmd; + command.param1 = command.param2 = 0; + SndDoImmediate( pahsc->pahsc_Channel, &command ); + /* Then stop currently playing buffer, if any. */ + command.cmd = quietCmd; + SndDoImmediate( pahsc->pahsc_Channel, &command ); + past->past_IsActive = 0; + } + /* Has someone asked us to stop by calling Pa_StopStream() + * OR has a user callback returned '1' to indicate finished. + */ + else if( past->past_StopSoon ) + { + if( (pahsc->pahsc_NumOutsQueued - pahsc->pahsc_NumOutsPlayed) <= 0 ) + { + past->past_IsActive = 0; /* We're finally done. */ + } + } + else + { + PaMac_PlayNext( past, index ); + } + return result; +} + +/************************************************************************************* +** Fill next buffer with sound and queue it for playback. +*/ +static void PaMac_PlayNext ( internalPortAudioStream *past, int index ) +{ + OSErr error; + long result; + SndCommand playCmd; + SndCommand callbackCmd; + PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData; + + /* If this was the last buffer, or abort requested, then just be done. */ + if ( past->past_StopSoon ) goto done; + + /* Load buffer with sound. */ + result = PaMac_FillNextOutputBuffer ( past, index ); + if( result > 0 ) past->past_StopSoon = 1; /* Stop generating audio but wait until buffers play. */ + else if( result < 0 ) goto done; + + /* Play the next buffer. */ + playCmd.cmd = bufferCmd; + playCmd.param1 = 0; + playCmd.param2 = (long) &pahsc->pahsc_SoundHeaders[ index ]; + error = SndDoCommand (pahsc->pahsc_Channel, &playCmd, true ); + if( error != noErr ) goto gotError; + + /* Ask for a callback when it is done. */ + callbackCmd.cmd = callBackCmd; + callbackCmd.param1 = index; + callbackCmd.param2 = (long)past; + error = SndDoCommand (pahsc->pahsc_Channel, &callbackCmd, true ); + if( error != noErr ) goto gotError; + pahsc->pahsc_NumOutsQueued += 1; + + return; + +gotError: + sPaHostError = error; +done: + return; +} diff --git a/portaudio-v19/pa_sgi/pa_sgi.c b/portaudio-v19/pa_sgi/pa_sgi.c new file mode 100644 index 000000000..8b742d1cc --- /dev/null +++ b/portaudio-v19/pa_sgi/pa_sgi.c @@ -0,0 +1,1417 @@ +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library. + * Latest Version at: http://www.portaudio.com. + * Silicon Graphics (SGI) IRIX implementation by Pieter Suurmond. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +/** @file + @brief SGI IRIX AL implementation (according to V19 API version 2.0). + + @note This file started as a copy of pa_skeleton.c (v 1.1.2.35 2003/09/20), it + has nothing to do with the old V18 pa_sgi version: this implementation uses the + newer IRIX AL calls and uses pthreads instead of sproc. + + On IRIX, one may type './configure' followed by 'gmake' from the portaudio root + directory to build the static and shared libraries, as well as all the tests. + + On IRIX 6.5, using 'make' instead of 'gmake' may cause Makefile to fail. (This + happens on my machine: make does not understand syntax with 2 colons on a line, + like this: + $(TESTS): bin/%: [snip] + + Maybe this is due to an old make version(?), my only solution is: use gmake. + Anyway, all the tests compile well now, with GCC 3.3, as well as with MIPSpro 7.2.1. + Tested: + - paqa_devs ok, but at a certain point digital i/o fails: + TestAdvance: INPUT, device = 2, rate = 32000, numChannels = 1, format = 1 + Possibly, this is an illegal sr or number of channels for digital i/o. + - paqa_errs 13 of the tests run ok, but 5 of them give weird results. + + patest1 ok. + + patest_buffer ok. + + patest_callbackstop ok. + - patest_clip ok, but hear no difference between dithering turned OFF and ON. + + patest_hang ok. + + patest_latency ok. + + patest_leftright ok. + + patest_maxsines ok. + + patest_many ok. + + patest_multi_sine ok. + + patest_pink ok. + + patest_prime ok. + - patest_read_record ok, but playback stops a little earlier than 5 seconds it seems(?). + + patest_record ok. + + patest_ringmix ok. + + patest_saw ok. + + patest_sine ok. + + patest_sine8 ok. + - patest_sine_formats ok, FLOAT32 + INT16 + INT18 are OK, but UINT8 IS NOT OK! + + patest_sine_time ok. + + patest_start_stop ok, but under/overflow errors of course in the AL queue monitor. + + patest_stop ok. + - patest_sync ok? + + patest_toomanysines ok. + - patest_underflow ok? (stopping after SleepTime = 91: err=Stream is stopped) + - patest_wire ok. + + patest_write_sine ok. + + pa_devs ok. + Ok on an Indy, in both stereo and quadrophonic mode. + + pa_fuzz ok. + + pa_minlat ok. + + Worked on (or checked) proposals: + + 003: Improve Latency Specification OK, but not 100% sure: plus or minus 1 host buffer? + 004 OK: Allow Callbacks to Accept Variable Number of Frames per Buffer. + Simply using a fixed host buffer size. Very roughly implemented now, the adaption + to limited-requested latencies and samplerate may be improved. At least this + implementation chooses its own internal host buffer size (no coredumps any longer). + 005 OK: Blocking Read/Write Interface. + 006: Non-interleaved buffers seems OK? Covered by the buffer-processor and such?.... + 009 OK: Host error reporting should now be. + 010 OK: State Machine and State Querying Functions. + 011 OK: Renaming done. + 014 Implementation Style Guidelines (sorry, my braces are not ANSI style). + 015 OK: Callback Timestamps (During priming, though, these are still null!). + 016 OK: Use Structs for Pa_OpenStream() Parameters. + 019: Notify Client When All Buffers Have Played (Ok, covered by the buffer processor?) + 020 OK: Allow Callback to prime output stream (StartStream() should do the priming) + Should be tested more thoroughly for full duplex streams. (patest_prime seems ok). + + + @todo Underrun or overflow flags at some more places. + + @todo Callback Timestamps during priming. + + @todo Improve adaption to number of channels, samplerate and such when inventing + some frames per host buffer (when client requests 0). + + @todo Make a complete new version to support 'sproc'-applications. + Or could we manage that with some clever if-defs? + It must be clear which version we use (especially when using pa as lib!): + an irix-sproc() version or pthread version. + + @todo In Makefile.in: 'make clean' does not remove lib/libportaudio.so.0.0.19. + + Note: Even when mono-output is requested, with ALv7, the audio library opens + a outputs stereo. One can observe this in SGI's 'Audio Queue Monitor'. +*/ + +#include /* For strlen() but also for strerror()! */ +#include /* printf() */ +#include /* fabs() */ + +#include /* IRIX AL (audio library). Link with -laudio. */ +#include /* IRIX DL (digital media library), solely for */ + /* function dmGetUST(). Link with -ldmedia. */ +#include /* To catch 'oserror' after AL-calls. */ +#include /* POSIX threads. */ +#include + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + + /* Uncomment for diagnostics: */ +#define DBUG(x) /*{ printf x; fflush(stdout); }*/ + + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaSGI_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *ipp, + const PaStreamParameters *opp, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + + +/* + Apparently, we must use macros for reporting unanticipated host errors. + Only in case we return paUnanticipatedHostError from an Portaudio call, + we have to call one of the following three macro's. + (Constant paAL is defined in pa_common/portaudio.h. See also proposal 009.) + + After an AL error, use this to translate the AL error code to human text: +*/ +#define PA_SGI_SET_LAST_AL_ERROR() \ + {\ + int ee = oserror();\ + PaUtil_SetLastHostErrorInfo(paAL, ee, alGetErrorString(ee));\ + } +/* + But after a generic IRIX error, let strerror() translate the error code from + the operating system and use this (strerror() gives the same as perror()): +*/ +#define PA_SGI_SET_LAST_IRIX_ERROR() \ + {\ + int ee = oserror();\ + PaUtil_SetLastHostErrorInfo(paAL, ee, strerror(ee));\ + } + +/* GOT RID OF calling PaUtil_SetLastHostErrorInfo() with 0 as error number. +- Weird samplerate difference became: paInvalidSampleRate. +- Failing to set AL queue size became: paInternalError + (Because I cannot decide between paBufferTooBig and paBufferTooSmall + because it may even the 'default AL queue size that failed... Or + should we introduce another error-code like 'paInvalidQueueSize'?... NO) +*/ + +/* PaSGIHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + PaUtilAllocationGroup* allocations; + /* implementation specific data goes here. */ + ALvalue* sgiDeviceIDs; /* Array of AL resource device numbers. */ + /* PaHostApiIndex hostApiIndex; Hu? As in the linux and oss files? */ +} +PaSGIHostApiRepresentation; + +/* + Initialises sgiDeviceIDs array. +*/ +PaError PaSGI_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int e, i, deviceCount, def_in, def_out; + PaSGIHostApiRepresentation* SGIHostApi; + PaDeviceInfo* deviceInfoArray; + static const short numParams = 4; /* Array with name, samplerate, channels */ + ALpv y[numParams]; /* and type. */ + static const short maxDevNameChars = 32; /* Including the terminating null char. */ + char devName[maxDevNameChars]; /* Too lazy for dynamic alloc. */ + + /* DBUG(("PaSGI_Initialize() started.\n")); */ + SGIHostApi = (PaSGIHostApiRepresentation*)PaUtil_AllocateMemory(sizeof(PaSGIHostApiRepresentation)); + if( !SGIHostApi ) + { result = paInsufficientMemory; goto cleanup; } + SGIHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !SGIHostApi->allocations ) + { result = paInsufficientMemory; goto cleanup; } + *hostApi = &SGIHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paAL; /* IRIX AL type id, was paInDevelopment. */ + (*hostApi)->info.name = "SGI IRIX AL"; + (*hostApi)->info.defaultInputDevice = paNoDevice; /* Set later. */ + (*hostApi)->info.defaultOutputDevice = paNoDevice; /* Set later. */ + (*hostApi)->info.deviceCount = 0; /* We 'll increment in the loop below. */ + + /* Determine the total number of input and output devices (thanks to Gary Scavone). */ + deviceCount = alQueryValues(AL_SYSTEM, AL_DEVICES, 0, 0, 0, 0); + if (deviceCount < 0) /* Returns -1 in case of failure. */ + { + DBUG(("Failed to count devices: alQueryValues()=%d; %s.\n", + deviceCount, alGetErrorString(oserror()))); + result = paDeviceUnavailable; /* Is this an appropriate error return code? */ + goto cleanup; + } + if (deviceCount > 0) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + SGIHostApi->allocations, sizeof(PaDeviceInfo*) * deviceCount); + if (!(*hostApi)->deviceInfos) + { result = paInsufficientMemory; goto cleanup; } + + /* Allocate all device info structs in a contiguous block. */ + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + SGIHostApi->allocations, sizeof(PaDeviceInfo) * deviceCount); + if (!deviceInfoArray) + { result = paInsufficientMemory; goto cleanup; } + /* Store all AL device IDs in an array. */ + SGIHostApi->sgiDeviceIDs = (ALvalue*)PaUtil_GroupAllocateMemory(SGIHostApi->allocations, + deviceCount * sizeof(ALvalue)); + if (!SGIHostApi->sgiDeviceIDs) + { result = paInsufficientMemory; goto cleanup; } + /* Same query again, but now store all IDs in array sgiDeviceIDs (still using no qualifiers).*/ + e = alQueryValues(AL_SYSTEM, AL_DEVICES, SGIHostApi->sgiDeviceIDs, deviceCount, 0, 0); + if (e != deviceCount) + { + if (e < 0) /* Sure an AL error really occurred. */ + { PA_SGI_SET_LAST_AL_ERROR() result = paUnanticipatedHostError; } + else /* Seems we lost some devices. */ + { DBUG(("Number of devices suddenly changed!\n")); result = paDeviceUnavailable; } + goto cleanup; + } + y[0].param = AL_DEFAULT_INPUT; + y[1].param = AL_DEFAULT_OUTPUT; + e = alGetParams(AL_SYSTEM, y, 2); /* Get params global to the AL system. */ + if (e != 2) + { + if (e < 0) + { + PA_SGI_SET_LAST_AL_ERROR() /* Calls oserror() and alGetErrorString(). */ + result = paUnanticipatedHostError; /* Sure an AL error really occurred. */ + } + else + { + DBUG(("Default input and/or output could not be found!\n")); + result = paDeviceUnavailable; /* FIX: What if only in or out are available? */ + } + goto cleanup; + } + def_in = y[0].value.i; /* Remember both AL devices for a while. */ + def_out = y[1].value.i; + y[0].param = AL_NAME; + y[0].value.ptr = devName; + y[0].sizeIn = maxDevNameChars; /* Including terminating null char. */ + y[1].param = AL_RATE; + y[2].param = AL_CHANNELS; + y[3].param = AL_TYPE; /* Subtype of AL_INPUT_DEVICE_TYPE or AL_OUTPUT_DEVICE_TYPE? */ + for (i=0; i < deviceCount; ++i) /* Fill allocated deviceInfo structs. */ + { + PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; /* Retrieve name, samplerate, channels and type. */ + e = alGetParams(SGIHostApi->sgiDeviceIDs[i].i, y, numParams); + if (e != numParams) + { + if (e < 0) /* Calls oserror() and alGetErrorString(). */ + { PA_SGI_SET_LAST_AL_ERROR() result = paUnanticipatedHostError; } + else + { DBUG(("alGetParams() could not get all params!\n")); result = paInternalError; } + goto cleanup; + } + deviceInfo->name = (char*)PaUtil_GroupAllocateMemory(SGIHostApi->allocations, strlen(devName) + 1); + if (!deviceInfo->name) + { result = paInsufficientMemory; goto cleanup; } + strcpy((char*)deviceInfo->name, devName); + + /* Determine whether the received number of channels belongs to input or output device. */ + if (alIsSubtype(AL_INPUT_DEVICE_TYPE, y[3].value.i)) + { + deviceInfo->maxInputChannels = y[2].value.i; + deviceInfo->maxOutputChannels = 0; + } + else if (alIsSubtype(AL_OUTPUT_DEVICE_TYPE, y[3].value.i)) + { + deviceInfo->maxInputChannels = 0; + deviceInfo->maxOutputChannels = y[2].value.i; + } + else /* Should never occur. */ + { + DBUG(("AL device is neither input nor output!\n")); + result = paInternalError; + goto cleanup; + } + + /* Determine if this device is the default (in or out). If so, assign. */ + if (def_in == SGIHostApi->sgiDeviceIDs[i].i) + { + if ((*hostApi)->info.defaultInputDevice != paNoDevice) + { + DBUG(("Default input already assigned!\n")); + result = paInternalError; + goto cleanup; + } + (*hostApi)->info.defaultInputDevice = i; + /* DBUG(("Default input assigned to pa device %d (%s).\n", i, deviceInfo->name)); */ + } + else if (def_out == SGIHostApi->sgiDeviceIDs[i].i) + { + if ((*hostApi)->info.defaultOutputDevice != paNoDevice) + { + DBUG(("Default output already assigned!\n")); + result = paInternalError; + goto cleanup; + } + (*hostApi)->info.defaultOutputDevice = i; + /* DBUG(("Default output assigned to pa device %d (%s).\n", i, deviceInfo->name)); */ + } + /*---------------------------------------------- Default latencies set to 'reasonable' values. */ + deviceInfo->defaultLowInputLatency = 0.050; /* 50 milliseconds seems ok. */ + deviceInfo->defaultLowOutputLatency = 0.050; /* These are ALSO ABSOLUTE MINIMA in OpenStream(). */ + deviceInfo->defaultHighInputLatency = 0.500; /* 500 milliseconds a reasonable value? */ + deviceInfo->defaultHighOutputLatency = 0.500; /* Ten times these are ABSOLUTE MAX in OpenStream()). */ + + deviceInfo->defaultSampleRate = alFixedToDouble(y[1].value.ll); /* Read current sr. */ + (*hostApi)->deviceInfos[i] = deviceInfo; + ++(*hostApi)->info.deviceCount; + } + } + /* What if (deviceCount==0)? */ + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface(&SGIHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface(&SGIHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); +cleanup: + if (result != paNoError) + { + if (SGIHostApi) + { + if (SGIHostApi->allocations) + { + PaUtil_FreeAllAllocations(SGIHostApi->allocations); + PaUtil_DestroyAllocationGroup(SGIHostApi->allocations); + } + PaUtil_FreeMemory(SGIHostApi); + } + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaSGIHostApiRepresentation *SGIHostApi = (PaSGIHostApiRepresentation*)hostApi; + + /* Clean up any resources not handled by the allocation group. */ + if( SGIHostApi->allocations ) + { + PaUtil_FreeAllAllocations( SGIHostApi->allocations ); + PaUtil_DestroyAllocationGroup( SGIHostApi->allocations ); + } + PaUtil_FreeMemory( SGIHostApi ); +} + +/* + Check if samplerate is supported for this output device. Called once + or twice by function IsFormatSupported() and one time by OpenStream(). + When paUnanticipatedHostError is returned, the caller does NOT have + to call PA_SGI_SET_LAST_AL_ERROR() or such. +*/ +static PaError sr_supported(int al_device, double sr) +{ + int e; + PaError result; + ALparamInfo pinfo; + long long lsr; /* 64 bit fixed point internal AL samplerate. */ + + if (alGetParamInfo(al_device, AL_RATE, &pinfo)) + { + e = oserror(); + DBUG(("alGetParamInfo(AL_RATE) failed: %s.\n", alGetErrorString(e))); + if (e == AL_BAD_RESOURCE) + result = paInvalidDevice; + else + { + PA_SGI_SET_LAST_AL_ERROR() /* Sure an AL error occured. */ + result = paUnanticipatedHostError; + } + } + else + { + lsr = alDoubleToFixed(sr); /* Within the range? */ + if ((pinfo.min.ll <= lsr) && (lsr <= pinfo.max.ll)) + result = paFormatIsSupported; + else + result = paInvalidSampleRate; + } + /* DBUG(("sr_supported()=%d.\n", result)); */ + return result; +} + + +/* + See common/portaudio.h (suggestedLatency field is ignored). +*/ +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaSGIHostApiRepresentation* SGIHostApi = (PaSGIHostApiRepresentation*)hostApi; + int inputChannelCount, outputChannelCount, result; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + /* Unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification. */ + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + /* Check that input device can support inputChannelCount. */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + /* Validate inputStreamInfo. */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + /* Check if samplerate is supported for this input device. */ + result = sr_supported(SGIHostApi->sgiDeviceIDs[inputParameters->device].i, sampleRate); + if (result != paFormatIsSupported) /* PA_SGI_SET_LAST_AL_ERROR() may already be called. */ + return result; + } + else + { + inputChannelCount = 0; + } + if( outputParameters ) /* As with input above. */ + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + /* Check if samplerate is supported for this output device. */ + result = sr_supported(SGIHostApi->sgiDeviceIDs[outputParameters->device].i, sampleRate); + if (result != paFormatIsSupported) + return result; + } + else + { + outputChannelCount = 0; + } + /* IMPLEMENT ME: + Because the buffer adapter handles conversion between all standard + sample formats, the following checks are only required if paCustomFormat + is implemented, or under some other unusual conditions. + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + */ + /* suppress unused variable warnings */ + (void) inputSampleFormat; + (void) outputSampleFormat; + return paFormatIsSupported; +} + +/** Auxilary struct, embedded twice in the struct below, for inputs and outputs. */ +typedef struct PaSGIhostPortBuffer +{ + /** NULL means IRIX AL port closed. */ + ALport port; + /** NULL means memory not allocated. */ + void* buffer; +} + PaSGIhostPortBuffer; + +/** Stream data structure specifically for this IRIX AL implementation. */ +typedef struct PaSGIStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + unsigned long framesPerHostCallback; + /** Allocated host buffers and AL ports. */ + PaSGIhostPortBuffer hostPortBuffIn, + hostPortBuffOut; + /** Copy of stream flags given to OpenStream(). */ + PaStreamFlags streamFlags; + /** Stream state may be 0 or 1 or 2, but never 3. */ + unsigned char state; + /** Requests to stop or abort may come from the parent, + or from the child itself (user callback result). */ + unsigned char stopAbort; + pthread_t thread; +} + PaSGIStream; + +/** Stream can be in only one of the following three states: stopped (1), active (2), or + callback finshed (0). To prevent 'state 3' from occurring, Setting and testing of the + state bits is done atomically. +*/ +#define PA_SGI_STREAM_FLAG_FINISHED_ (0) /* After callback finished or cancelled queued buffers. */ +#define PA_SGI_STREAM_FLAG_STOPPED_ (1) /* Set by OpenStream(), StopStream() and AbortStream(). */ +#define PA_SGI_STREAM_FLAG_ACTIVE_ (2) /* Set by StartStream. Reset by OpenStream(), */ + /* StopStream() and AbortStream(). */ + +/** Stop requests, via the 'stopAbort' field can be either 1, meaning 'stop' or 2, meaning 'abort'. + When both occur at the same time, 'abort' takes precedence, even after a first 'stop'. +*/ +#define PA_SGI_REQ_CONT_ (0) /* Reset by OpenStream(), StopStream and AbortStream. */ +#define PA_SGI_REQ_STOP_ (1) /* Set by StopStream(). */ +#define PA_SGI_REQ_ABORT_ (2) /* Set by AbortStream(). */ + + +/** Called by OpenStream() once or twice. First, the number of channels, sampleformat, and + queue size are configured. The configuration is then bound to the specified AL device. + Then an AL port is opened. Finally, the samplerate of the device is altered (or at least + set again). + + After successful return, actual latency is written in *latency, and actual samplerate + in *samplerate. + + @param pa_params may be NULL and pa_params->channelCount may also be null, in both + cases the function immediately returns. + @return paNoError if configuration was skipped or if it succeeded. +*/ +static PaError set_sgi_device(ALvalue* sgiDeviceIDs, /* Array built by PaSGI_Initialize(). */ + const PaStreamParameters* pa_params, /* read device and channels. */ + double* latency, /* Read and write in seconds. */ + + PaSampleFormat pasfmt, /* Don't read from pa_params!. */ + char* direction, /* "r" or "w". */ + char* name, + long framesPerHostBuffer, + double* samplerate, /* Also writes back here. */ + PaSGIhostPortBuffer* hostPortBuff) /* Receive pointers here. */ +{ + int bytesPerFrame, sgiDevice, alErr, d, dd, iq_size, default_iq_size; + ALpv pvs[2]; + ALconfig alc = NULL; + PaError result = paNoError; + + if (!pa_params) + goto cleanup; /* Not errors, just not full duplex, skip all. */ + if (!pa_params->channelCount) + goto cleanup; + alc = alNewConfig(); /* Create default config. This defaults to stereo, 16-bit integer data. */ + if (!alc) /* Call alFreeConfig() later, when done with it. */ + { result = paInsufficientMemory; goto cleanup; } + /*----------------------- CONFIGURE NUMBER OF CHANNELS: ---------------------------*/ + if (alSetChannels(alc, pa_params->channelCount)) /* Returns 0 on success. */ + { + if (oserror() == AL_BAD_CHANNELS) + result = paInvalidChannelCount; + else + { + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + } + goto cleanup; + } + bytesPerFrame = pa_params->channelCount; /* Is multiplied by width below. */ + /*----------------------- CONFIGURE SAMPLE FORMAT: --------------------------------*/ + if (pasfmt == paFloat32) + { + if (alSetSampFmt(alc, AL_SAMPFMT_FLOAT)) + { + if (oserror() == AL_BAD_SAMPFMT) + result = paSampleFormatNotSupported; + else + { + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + } + goto cleanup; + } + bytesPerFrame *= 4; /* No need to set width for floats. */ + } + else + { + if (alSetSampFmt(alc, AL_SAMPFMT_TWOSCOMP)) + { + if (oserror() == AL_BAD_SAMPFMT) + result = paSampleFormatNotSupported; + else + { + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + } + goto cleanup; + } + if (pasfmt == paInt8) + { + if (alSetWidth(alc, AL_SAMPLE_8)) + { + if (oserror() == AL_BAD_WIDTH) + result = paSampleFormatNotSupported; + else + { + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + } + goto cleanup; + } + /* bytesPerFrame *= 1; */ + } + else if (pasfmt == paInt16) + { + if (alSetWidth(alc, AL_SAMPLE_16)) + { + if (oserror() == AL_BAD_WIDTH) + result = paSampleFormatNotSupported; + else + { + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + } + goto cleanup; + } + bytesPerFrame *= 2; + } + else if (pasfmt == paInt24) + { + if (alSetWidth(alc, AL_SAMPLE_24)) + { + if (oserror() == AL_BAD_WIDTH) + result = paSampleFormatNotSupported; + else + { + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + } + goto cleanup; + } + bytesPerFrame *= 3; /* OR 4 ???????! */ + } + else return paSampleFormatNotSupported; + } + /*----------------------- SET INTERNAL AL QUEUE SIZE: -------------------------------*/ + /* The AL API doesn't provide a means for querying minimum and maximum buffer sizes. + So, if the requested size fails, try again with a value that is closer to the AL's + default queue size. In this implementation, 'Portaudio latency' corresponds to + the AL queue size minus one buffersize: + AL queue size - framesPerHostBuffer + PA latency = ----------------------------------- + sample rate */ + default_iq_size = alGetQueueSize(alc); + if (default_iq_size < 0) /* So let's first get that 'default size'. */ + { /* Default internal queue size could not be determined. */ + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + goto cleanup; + } + /* AL buffer becomes somewhat bigger than the suggested latency, notice this is */ + /* based on requsted samplerate, not in the actual rate, which is measured later. */ + /* Do NOT read pa_params->suggestedLatency, but use the limited *latency param! */ + + iq_size = (int)(0.5 + ((*latency) * (*samplerate))) + (int)framesPerHostBuffer; + /* The AL buffer becomes somewhat */ + /* bigger than the suggested latency. */ + if (iq_size < (framesPerHostBuffer << 1)) /* Make sure the minimum is twice */ + { /* framesPerHostBuffer. */ + DBUG(("Setting minimum queue size.\n")); + iq_size = (framesPerHostBuffer << 1); + } + d = iq_size - default_iq_size; /* Determine whether we'll decrease */ + while (alSetQueueSize(alc, iq_size)) /* or increase after failing. */ + { /* Size in sample frames. */ + if (oserror() != AL_BAD_QSIZE) /* Stop at AL_BAD_CONFIG. */ + { + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + goto cleanup; + } + dd = iq_size - default_iq_size; /* Stop when even the default size failed */ + if (((d >= 0) && (dd <= 0)) || /* (dd=0) or when difference flipped sign. */ + ((d <= 0) && (dd >= 0)) || + (iq_size <= framesPerHostBuffer)) /* Also guarentee that framesPerHostBuffer */ + { /* can be subtracted (res>0) after return. */ + DBUG(("Could not set AL queue size to %d sample frames!\n", iq_size)); + result = paInternalError; /* FIX: PROBABLY AN INAPROPRIATE ERROR CODE HERE. */ + goto cleanup; /* As inapropriate as paUnanticipatedHostError was? */ + } + DBUG(("Failed to set internal queue size to %d frames, ", iq_size)); + if (d > 0) + iq_size -= framesPerHostBuffer; /* Try lesser multiple. */ + else + iq_size += framesPerHostBuffer; /* Try larger multiple. */ + DBUG(("trying %d frames now...\n", iq_size)); + } + /* Note: Actual latency is written back to *latency after meausuring actual (not + the requested) samplerate. See below. + */ + /*----------------------- ALLOCATE HOST BUFFER: --------------------------------------*/ + hostPortBuff->buffer = PaUtil_AllocateMemory((long)bytesPerFrame * framesPerHostBuffer); + if (!hostPortBuff->buffer) /* Caller is responsible for cleanup+close after failures! */ + { result = paInsufficientMemory; goto cleanup; } + /*----------------------- BIND CONFIGURATION TO DEVICE: ------------------------------*/ + sgiDevice = sgiDeviceIDs[pa_params->device].i; + if (alSetDevice(alc, sgiDevice)) /* Try to switch the hardware. */ + { + if (oserror() == AL_BAD_DEVICE) + result = paInvalidDevice; + else + { + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + } + goto cleanup; + } + /*----------------------- OPEN PORT: ----------------------------------------------*/ + hostPortBuff->port = alOpenPort(name, direction, alc); /* Caller is responsible */ + if (!hostPortBuff->port) /* for closing after fail. */ + { + PA_SGI_SET_LAST_AL_ERROR() + result = paUnanticipatedHostError; + goto cleanup; + } /* Maybe set SR earlier? */ + /*----------------------- SET SAMPLERATE: -----------------------------------------*/ + pvs[0].param = AL_MASTER_CLOCK; /* Attempt to set a crystal-based sample- */ + pvs[0].value.i = AL_CRYSTAL_MCLK_TYPE; /* rate on input or output device. */ + pvs[1].param = AL_RATE; + pvs[1].value.ll = alDoubleToFixed(*samplerate); + if (2 != alSetParams(sgiDevice, pvs, 2)) + { + DBUG(("alSetParams() failed to set samplerate to %.4f Hz!\n", *samplerate)); + result = paInvalidSampleRate; + goto cleanup; + } + /*----------------------- GET ACTUAL SAMPLERATE: ---------------------------*/ + alErr = alGetParams(sgiDevice, &pvs[1], 1); /* SEE WHAT WE REALY SET IT TO. */ + if (alErr != 1) /* And return that to caller. */ + { + DBUG(("alGetParams() failed to read samplerate!\n")); + result = paInvalidSampleRate; + goto cleanup; + } + *samplerate = alFixedToDouble(pvs[1].value.ll); /* Between 1 Hz and 1 MHz. */ + if ((*samplerate < 1.0) || (*samplerate > 1000000.0)) + { + DBUG(("alFixedToDouble() resulted a weird samplerate: %.6f Hz!\n", *samplerate)); + result = paInvalidSampleRate; + goto cleanup; + } + /*----------------------- CALC ACTUAL LATENCY (based on actual SR): -----------------------*/ + *latency = (iq_size - framesPerHostBuffer) / (*samplerate); /* FIX: SURE > 0!???? */ +cleanup: + if (alc) + alFreeConfig(alc); /* We no longer need configuration. */ + return result; +} + +/** + Called by OpenStream() if it fails and by CloseStream. Only used here, in this file. + Fields MUST be set to NULL or to a valid value, prior to call. +*/ +static void streamCleanupAndClose(PaSGIStream* stream) +{ + if (stream->hostPortBuffIn.port) alClosePort(stream->hostPortBuffIn.port); /* Close AL ports. */ + if (stream->hostPortBuffIn.buffer) PaUtil_FreeMemory(stream->hostPortBuffIn.buffer); /* Release buffers. */ + if (stream->hostPortBuffOut.port) alClosePort(stream->hostPortBuffOut.port); + if (stream->hostPortBuffOut.buffer) PaUtil_FreeMemory(stream->hostPortBuffOut.buffer); +} + + +/* See pa_hostapi.h for a list of validity guarantees made about OpenStream parameters. */ +static PaError OpenStream(struct PaUtilHostApiRepresentation* hostApi, + PaStream** s, + const PaStreamParameters* ipp, + const PaStreamParameters* opp, + double sampleRate, /* Common to both i and o. */ + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback* streamCallback, + void* userData) +{ + PaError result = paNoError; + PaSGIHostApiRepresentation* SGIHostApi = (PaSGIHostApiRepresentation*)hostApi; + PaSGIStream* stream = 0; + unsigned long framesPerHostBuffer; /* Not necessarily the same as framesPerBuffer. */ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat, + hostInputSampleFormat, hostOutputSampleFormat; + double sr_in, sr_out, + latency_in, latency_out; + static const PaSampleFormat irixFormats = (paInt8 | paInt16 | paInt24 | paFloat32); + /* Constant used by PaUtil_SelectClosestAvailableFormat(). Because IRIX AL does not + provide a way to query for possible formats for a given device, interface or port, + just add together the formats we know that are supported in general by IRIX AL + (at the end of the year 2003): AL_SAMPFMT_TWOSCOMP with AL_SAMPLE_8(=paInt8), + AL_SAMPLE_16(=paInt16) or AL_SAMPLE_24(=paInt24); AL_SAMPFMT_FLOAT(=paFloat32); + AL_SAMPFMT_DOUBLE(=paFloat64); IRIX misses unsigned 8 and 32 bit signed ints. + */ + DBUG(("OpenStream() started.\n")); + if (ipp) + { + inputChannelCount = ipp->channelCount; + inputSampleFormat = ipp->sampleFormat; + /* Unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification. */ + if (ipp->device == paUseHostApiSpecificDeviceSpecification) /* DEVICE CHOOSEN BY CLIENT. */ + return paInvalidDevice; + /* Check that input device can support inputChannelCount. */ + if (inputChannelCount > hostApi->deviceInfos[ipp->device]->maxInputChannels) + return paInvalidChannelCount; + /* Validate inputStreamInfo. */ + if (ipp->hostApiSpecificStreamInfo) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + hostInputSampleFormat = PaUtil_SelectClosestAvailableFormat(irixFormats, inputSampleFormat); + /* Check if samplerate is supported for this input device. */ + result = sr_supported(SGIHostApi->sgiDeviceIDs[ipp->device].i, sampleRate); + if (result != paFormatIsSupported) /* PA_SGI_SET_LAST_AL_ERROR() may already be called. */ + return result; + /* Validate input latency. Use defaults if necessary. */ + if (ipp->suggestedLatency < hostApi->deviceInfos[ipp->device]->defaultLowInputLatency) + latency_in = hostApi->deviceInfos[ipp->device]->defaultLowInputLatency; /* Low = minimum. */ + else if (ipp->suggestedLatency > 10.0 * hostApi->deviceInfos[ipp->device]->defaultHighInputLatency) + latency_in = 10.0 * hostApi->deviceInfos[ipp->device]->defaultHighInputLatency; /* 10*High = max. */ + else + latency_in = ipp->suggestedLatency; + } + else + { + inputChannelCount = 0; + inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ + latency_in = 0.0; /* Necessary? */ + } + if (opp) + { + outputChannelCount = opp->channelCount; + outputSampleFormat = opp->sampleFormat; + if (opp->device == paUseHostApiSpecificDeviceSpecification) /* Like input (above). */ + return paInvalidDevice; + if (outputChannelCount > hostApi->deviceInfos[opp->device]->maxOutputChannels) + return paInvalidChannelCount; + if (opp->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat(irixFormats, outputSampleFormat); + /* Check if samplerate is supported for this output device. */ + result = sr_supported(SGIHostApi->sgiDeviceIDs[opp->device].i, sampleRate); + if (result != paFormatIsSupported) + return result; + /* Validate output latency. Use defaults if necessary. */ + if (opp->suggestedLatency < hostApi->deviceInfos[opp->device]->defaultLowOutputLatency) + latency_out = hostApi->deviceInfos[opp->device]->defaultLowOutputLatency; /* Low = minimum. */ + else if (opp->suggestedLatency > 10.0 * hostApi->deviceInfos[opp->device]->defaultHighOutputLatency) + latency_out = 10.0 * hostApi->deviceInfos[opp->device]->defaultHighOutputLatency; /* 10*High = max. */ + else + latency_out = opp->suggestedLatency; + } + else + { + outputChannelCount = 0; + outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialised var' warning. */ + latency_out = 0.0; + } + /* Sure that ipp and opp will never be both NULL. */ + + if( (streamFlags & paPlatformSpecificFlags) != 0 ) /* Validate platform specific flags. */ + return paInvalidFlag; /* Unexpected platform specific flag. */ + + stream = (PaSGIStream*)PaUtil_AllocateMemory( sizeof(PaSGIStream) ); + if (!stream) + { result = paInsufficientMemory; goto cleanup; } + + stream->hostPortBuffIn.port = (ALport)NULL; /* Ports closed. */ + stream->hostPortBuffIn.buffer = NULL; /* No buffers yet. */ + stream->hostPortBuffOut.port = (ALport)NULL; + stream->hostPortBuffOut.buffer = NULL; + + if (streamCallback) + PaUtil_InitializeStreamRepresentation(&stream->streamRepresentation, + &SGIHostApi->callbackStreamInterface, streamCallback, userData); + else + PaUtil_InitializeStreamRepresentation(&stream->streamRepresentation, + &SGIHostApi->blockingStreamInterface, streamCallback, userData); + /* (NULL.) */ + if (framesPerBuffer == paFramesPerBufferUnspecified) /* Proposal 004. */ + { /* Keep framesPerBuffer zero but come up with some fixed host buffer size. */ + double lowest_lat = 0.0; /* 0.0 to surpress uninit warning, we're sure it will end up higher. */ + if (ipp) + lowest_lat = latency_in; /* Sure > 0.0! */ + if (opp && (latency_out < lowest_lat)) + lowest_lat = latency_out; + /* So that queue size becomes approximately 5 times framesPerHostBuffer: */ + framesPerHostBuffer = (unsigned long)((lowest_lat * sampleRate) / 4.0); + /* But always limit: */ + if (framesPerHostBuffer < 64L) + framesPerHostBuffer = 64L; + else if (framesPerHostBuffer > 32768L) + framesPerHostBuffer = 32768L; + DBUG(("Decided to use a fixed host buffer size of %ld frames.\n", framesPerHostBuffer)); + } + else + framesPerHostBuffer = framesPerBuffer; /* Then just take the requested amount. No buffer-adaption yet? */ + + sr_in = sr_out = sampleRate; + /*-------------------------------------------------------------------------------------------*/ + result = set_sgi_device(SGIHostApi->sgiDeviceIDs, /* Needed by alSetDevice and other functs. */ + ipp, /* Reads channelCount, device but NOT latency. */ + &latency_in, /* Read limited requested latency but also WRITE actual. */ + hostInputSampleFormat, /* For alSetSampFmt and alSetWidth. */ + "r", /* "r" for reading from input port. */ + "portaudio in", /* Name string. */ + framesPerHostBuffer, /* As calculated or as requested by the client. */ + &sr_in, /* Receive actual s.rate after setting it. */ + &stream->hostPortBuffIn); /* Receives ALport and input host buffer. */ + if (result != paNoError) goto cleanup; + /*-------------------------------------------------------------------------------------------*/ + result = set_sgi_device(SGIHostApi->sgiDeviceIDs, + opp, + &latency_out, + hostOutputSampleFormat, + "w", /* "w" for writing. */ + "portaudio out", + framesPerHostBuffer, + &sr_out, + &stream->hostPortBuffOut); + if (result != paNoError) goto cleanup; + /*------------------------------------------------------------------------------------------*/ + if (fabs(sr_in - sr_out) > 0.001) /* Make sure both are the 'same'. */ + { + DBUG(("Weird samplerate difference between input and output!\n")); + result = paInvalidSampleRate; /* Could not come up with a better error code. */ + goto cleanup; + } /* sr_in '==' sr_out. */ + sampleRate = sr_in; /* Following fields set to estimated or actual values: */ + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + stream->streamRepresentation.streamInfo.inputLatency = latency_in; /* 0.0 if output only. */ + stream->streamRepresentation.streamInfo.outputLatency = latency_out; /* 0.0 if input only. */ + + PaUtil_InitializeCpuLoadMeasurer(&stream->cpuLoadMeasurer, sampleRate); + result = PaUtil_InitializeBufferProcessor(&stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, + framesPerBuffer, /* As requested by OpenStream(), may be zero! */ + framesPerHostBuffer, /* Use fixed number of frames per host buffer */ + paUtilFixedHostBufferSize, /* to keep things simple. See pa_common/pa_ */ + streamCallback, userData); /* process.h for more hostbuffersize options. */ + if (result != paNoError) + goto cleanup; + + stream->framesPerHostCallback = framesPerHostBuffer; + stream->streamFlags = streamFlags; /* Remember priming request. */ + stream->state = PA_SGI_STREAM_FLAG_STOPPED_; /* After opening, the stream */ + stream->stopAbort = PA_SGI_REQ_CONT_; /* is in the stopped state. */ + *s = (PaStream*)stream; /* Pass object to caller. */ +cleanup: + if (result != paNoError) /* Always set result when jumping to cleanup after failure. */ + { + if (stream) + { + streamCleanupAndClose(stream); /* Frees i/o buffers and closes AL ports. */ + PaUtil_FreeMemory(stream); + } + } + return result; +} + +/** POSIX thread that performs the actual i/o and calls the client's callback, + spawned by StartStream(). +*/ +static void* PaSGIpthread(void *userData) +{ + PaSGIStream* stream = (PaSGIStream*)userData; + int callbackResult = paContinue; + double nanosec_per_frame; + PaStreamCallbackTimeInfo timeInfo = { 0, 0, 0 }; + + stream->state = PA_SGI_STREAM_FLAG_ACTIVE_; /* Parent thread also sets active flag, but we + make no assumption about who does this first. */ + nanosec_per_frame = 1000000000.0 / stream->streamRepresentation.streamInfo.sampleRate; + /*----------------------------------------------- OUTPUT PRIMING: -----------------------------*/ + if (stream->hostPortBuffOut.port) /* Somewhat less than AL queue size so the next */ + { /* output buffer will (probably) not block. */ + unsigned long frames_to_prime = (long)(0.5 + + (stream->streamRepresentation.streamInfo.outputLatency + * stream->streamRepresentation.streamInfo.sampleRate)); + if (stream->streamFlags & paPrimeOutputBuffersUsingStreamCallback) + { + PaStreamCallbackFlags cbflags = paPrimingOutput; + if (stream->hostPortBuffIn.port) /* Only set this flag in case of full duplex. */ + cbflags |= paInputUnderflow; + DBUG(("Prime with client's callback: < %ld frames.\n", frames_to_prime)); + while (frames_to_prime >= stream->framesPerHostCallback) /* We will not do less (yet). */ + { /* TODO: Timestamps and CPU load */ + PaUtil_BeginBufferProcessing(&stream->bufferProcessor, /* measurement during priming. */ + &timeInfo, + cbflags); /* Pass underflow + priming flags. */ + if (stream->hostPortBuffIn.port) /* Does that provide client's call- */ + PaUtil_SetNoInput(&stream->bufferProcessor); /* back with silent inputbuffers? */ + + PaUtil_SetOutputFrameCount(&stream->bufferProcessor, 0); /* 0=take host buffer size. */ + PaUtil_SetInterleavedOutputChannels(&stream->bufferProcessor, 0, + stream->hostPortBuffOut.buffer, 0); + callbackResult = paContinue; /* Call the client's callback. */ + frames_to_prime -= PaUtil_EndBufferProcessing(&stream->bufferProcessor, &callbackResult); + if (callbackResult == paAbort) + { /* What should we do in other cases */ + stream->stopAbort = PA_SGI_REQ_ABORT_; /* where (callbackResult!=paContinue). */ + break; /* Don't even output the samples just returned (also skip following while). */ + } + else /* Write interleaved samples to SGI device. */ + alWriteFrames(stream->hostPortBuffOut.port, stream->hostPortBuffOut.buffer, + stream->framesPerHostCallback); + } + } + else /* Prime with silence. */ + { + DBUG(("Prime with silence: %ld frames.\n", frames_to_prime)); + alZeroFrames(stream->hostPortBuffOut.port, frames_to_prime); + } + } + /*------------------------------------------------------ I/O: ---------------------------------*/ + while (!stream->stopAbort) /* Exit loop immediately when 'stop' or 'abort' are raised. */ + { + unsigned long framesProcessed; + stamp_t fn, t, fnd, td; /* Unsigned 64 bit. */ + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + /* IMPLEMENT ME: - handle buffer slips. */ + if (stream->hostPortBuffIn.port) + { + /* Get device sample frame number associated with next audio sample frame + we're going to read from this port. */ + alGetFrameNumber(stream->hostPortBuffIn.port, &fn); + /* Get some recent pair of (frame number, time) from the audio device to + which our port is connected. time is 'UST' which is given in nanoseconds + and shared with the other audio devices and with other media. */ + alGetFrameTime(stream->hostPortBuffIn.port, &fnd, &td); + /* Calculate UST associated with fn, the next sample frame we're going to read or + write. Because this is signed arithmetic, code works for both inputs and outputs. */ + t = td + (stamp_t) ((double)(fn - fnd) * nanosec_per_frame); + /* If port is not in underflow or overflow state, we can alReadFrames() or + alWriteFrames() here and know that t is the time associated with the first + sample frame of the buffer we read or write. */ + timeInfo.inputBufferAdcTime = ((PaTime)t) / 1000000000.0; + /* Read interleaved samples from AL port (I think it will block only the first time). */ + alReadFrames(stream->hostPortBuffIn.port, stream->hostPortBuffIn.buffer, + stream->framesPerHostCallback); + } + if (stream->hostPortBuffOut.port) + { + alGetFrameNumber(stream->hostPortBuffOut.port, &fn); + alGetFrameTime(stream->hostPortBuffOut.port, &fnd, &td); + t = td + (stamp_t) ((double)(fn - fnd) * nanosec_per_frame); + timeInfo.outputBufferDacTime = ((PaTime)t) / 1000000000.0; + } + dmGetUST((unsigned long long*)(&t)); /* Receive time in nanoseconds in t. */ + timeInfo.currentTime = ((PaTime)t) / 1000000000.0; + + /* If you need to byte swap or shift inputBuffer to convert it into a pa format, do it here. */ + PaUtil_BeginBufferProcessing(&stream->bufferProcessor, + &timeInfo, + 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */); + + if (stream->hostPortBuffIn.port) /* Equivalent to (inputChannelCount > 0) */ + { /* We are sure about the amount to transfer (PaUtil_Set before alRead). */ + PaUtil_SetInputFrameCount(&stream->bufferProcessor, 0 /* 0 means take host buffer size */); + PaUtil_SetInterleavedInputChannels(&stream->bufferProcessor, + 0, /* first channel of inputBuffer is channel 0 */ + stream->hostPortBuffIn.buffer, + 0 ); /* 0 - use inputChannelCount passed to init buffer processor */ + } + if (stream->hostPortBuffOut.port) + { + PaUtil_SetOutputFrameCount(&stream->bufferProcessor, 0 /* 0 means take host buffer size */); + PaUtil_SetInterleavedOutputChannels(&stream->bufferProcessor, + 0, /* first channel of outputBuffer is channel 0 */ + stream->hostPortBuffOut.buffer, + 0 ); /* 0 - use outputChannelCount passed to init buffer processor */ + } + /* + You must pass a valid value of callback result to PaUtil_EndBufferProcessing() + in general you would pass paContinue for normal operation, and + paComplete to drain the buffer processor's internal output buffer. + You can check whether the buffer processor's output buffer is empty + using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor ) + */ + callbackResult = paContinue; /* Whoops, lost this somewhere, back again in v 1.2.2.16! */ + framesProcessed = PaUtil_EndBufferProcessing(&stream->bufferProcessor, &callbackResult); + /* If you need to byte swap or shift outputBuffer to convert it to host format, do it here. */ + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + if (callbackResult != paContinue) + { /* Once finished, call the finished callback. */ + DBUG(("SGI callbackResult = %d.\n", callbackResult)); + if (stream->streamRepresentation.streamFinishedCallback) + stream->streamRepresentation.streamFinishedCallback(stream->streamRepresentation.userData); + if (callbackResult == paAbort) + { + stream->stopAbort = PA_SGI_REQ_ABORT_; + break; /* Don't play the last buffer returned. */ + } + else /* paComplete or some other non-zero value. */ + stream->stopAbort = PA_SGI_REQ_STOP_; + } + if (stream->hostPortBuffOut.port) /* Write interleaved samples to SGI device */ + alWriteFrames(stream->hostPortBuffOut.port, /* (like unix_oss, AFTER checking callback result). */ + stream->hostPortBuffOut.buffer, stream->framesPerHostCallback); + } + if (stream->hostPortBuffOut.port) /* Drain output buffer(s), as long as we don't see an 'abort' request. */ + { + while ((!(stream->stopAbort & PA_SGI_REQ_ABORT_)) && /* Assume _STOP_ is set (or meant). */ + (alGetFilled(stream->hostPortBuffOut.port) > 1)) /* In case of ABORT we quickly leave (again). */ + ; /* Don't provide any new (not even silent) samples, but let an underrun [almost] occur. */ + } + if (callbackResult != paContinue) + stream->state = PA_SGI_STREAM_FLAG_FINISHED_; + return NULL; +} + + +/* + When CloseStream() is called, the multi-api layer ensures + that the stream has already been stopped or aborted. +*/ +static PaError CloseStream(PaStream* s) +{ + PaError result = paNoError; + PaSGIStream* stream = (PaSGIStream*)s; + + DBUG(("SGI CloseStream() started.\n")); + streamCleanupAndClose(stream); /* Releases i/o buffers and closes AL ports. */ + PaUtil_TerminateBufferProcessor(&stream->bufferProcessor); + PaUtil_TerminateStreamRepresentation(&stream->streamRepresentation); + PaUtil_FreeMemory(stream); + return result; +} + + +static PaError StartStream(PaStream *s) +{ + PaError result = paNoError; + PaSGIStream* stream = (PaSGIStream*)s; + + DBUG(("StartStream() started.\n")); + PaUtil_ResetBufferProcessor(&stream->bufferProcessor); /* See pa_common/pa_process.h. */ + if (stream->bufferProcessor.streamCallback) + { /* only when callback is used */ + if (pthread_create(&stream->thread, + NULL, /* pthread_attr_t * attr */ + PaSGIpthread, /* Function to spawn. */ + (void*)stream)) /* Pass stream as arg. */ + { + PA_SGI_SET_LAST_IRIX_ERROR() /* Let's hope oserror() tells something useful. */ + result = paUnanticipatedHostError; + } + else + stream->state = PA_SGI_STREAM_FLAG_ACTIVE_; + } /* Set active before returning from this function. */ + else + stream->state = PA_SGI_STREAM_FLAG_ACTIVE_; /* Apparently, setting active for blocking i/o is */ + return result; /* necessary (for patest_write_sine for example). */ +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaSGIStream* stream = (PaSGIStream*)s; + + if (stream->bufferProcessor.streamCallback) /* Only for callback streams. */ + { + stream->stopAbort = PA_SGI_REQ_STOP_; /* Signal and wait for the thread to drain outputs. */ + if (pthread_join(stream->thread, NULL)) /* When succesful, stream->state */ + { /* is still ACTIVE, or FINISHED. */ + PA_SGI_SET_LAST_IRIX_ERROR() + result = paUnanticipatedHostError; + } + else /* Transition from ACTIVE or FINISHED to STOPPED. */ + stream->state = PA_SGI_STREAM_FLAG_STOPPED_; + stream->stopAbort = PA_SGI_REQ_CONT_; /* For possible next start. */ + } +/* else + stream->state = PA_SGI_STREAM_FLAG_STOPPED_; Is this necessary for blocking i/o? */ + return result; +} + + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaSGIStream *stream = (PaSGIStream*)s; + + if (stream->bufferProcessor.streamCallback) /* Only for callback streams. */ + { + stream->stopAbort = PA_SGI_REQ_ABORT_; + if (pthread_join(stream->thread, NULL)) + { + PA_SGI_SET_LAST_IRIX_ERROR() + result = paUnanticipatedHostError; + } + else /* Transition from ACTIVE or FINISHED to STOPPED. */ + stream->state = PA_SGI_STREAM_FLAG_STOPPED_; + stream->stopAbort = PA_SGI_REQ_CONT_; /* For possible next start. */ + } +/* else + stream->state = PA_SGI_STREAM_FLAG_STOPPED_; Is this necessary for blocking i/o? */ + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) /* Not just the opposite of IsStreamActive(): */ +{ /* in the 'callback finished' state, it */ + /* returns zero instead of nonzero. */ + if (((PaSGIStream*)s)->state & PA_SGI_STREAM_FLAG_STOPPED_) + return 1; + return 0; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + if (((PaSGIStream*)s)->state & PA_SGI_STREAM_FLAG_ACTIVE_) + return 1; + return 0; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + stamp_t t; + + (void) s; /* Suppress unused argument warning. */ + dmGetUST((unsigned long long*)(&t)); /* Receive time in nanoseconds in t. */ + return (PaTime)t / 1000000000.0; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaSGIStream *stream = (PaSGIStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaSGIStream* stream = (PaSGIStream*)s; + int n; + +printf("stream->framesPerHostCallback=%ld.\n", stream->framesPerHostCallback); +fflush(stdout); + + while (frames) + { + if (frames > stream->framesPerHostCallback) n = stream->framesPerHostCallback; + else n = frames; + /* Read interleaved samples from SGI device. */ + alReadFrames(stream->hostPortBuffIn.port, /* Port already opened by OpenStream(). */ + stream->hostPortBuffIn.buffer, n); /* Already allocated by OpenStream(). */ + /* alReadFrames() always returns 0. */ + PaUtil_SetInputFrameCount(&stream->bufferProcessor, 0); /* 0 means take host buffer size */ + PaUtil_SetInterleavedInputChannels(&stream->bufferProcessor, + 0, /* first channel of inputBuffer is channel 0 */ + stream->hostPortBuffIn.buffer, + 0 ); /* 0 means use inputChannelCount passed at init. */ + /* Copy samples from host input channels set up by the PaUtil_SetInterleavedInputChannels + to a user supplied buffer. */ +printf("frames=%ld, buffer=%ld\n", frames, (long)buffer); +fflush(stdout); + PaUtil_CopyInput(&stream->bufferProcessor, &buffer, n); + frames -= n; + } +printf("DONE: frames=%ld, buffer=%ld\n", frames, (long)buffer); + return paNoError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaSGIStream* stream = (PaSGIStream*)s; + unsigned long n; + while (frames) + { + PaUtil_SetOutputFrameCount(&stream->bufferProcessor, 0); /* 0 means take host buffer size */ + PaUtil_SetInterleavedOutputChannels(&stream->bufferProcessor, + 0, /* first channel of inputBuffer is channel 0 */ + stream->hostPortBuffOut.buffer, + 0 ); /* 0 means use inputChannelCount passed at init. */ + /* Copy samples from user supplied buffer to host input channels set up by + PaUtil_SetInterleavedOutputChannels. Copies the minimum of the number of user frames + (specified by the frameCount parameter) and the number of host frames (specified in + a previous call to SetOutputFrameCount()). */ + n = PaUtil_CopyOutput(&stream->bufferProcessor, &buffer, frames); + /* Write interleaved samples to SGI device. */ + alWriteFrames(stream->hostPortBuffOut.port, stream->hostPortBuffOut.buffer, n); + frames -= n; /* alWriteFrames always returns 0. */ + } + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + return (signed long)alGetFilled(((PaSGIStream*)s)->hostPortBuffIn.port); +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + return (signed long)alGetFillable(((PaSGIStream*)s)->hostPortBuffOut.port); +} + + +/* CVS reminder: + To download the 'v19-devel' branch from portaudio's CVS server for the first time, type: + cvs -d:pserver:anonymous@www.portaudio.com:/home/cvs checkout -r v19-devel portaudio + Then 'cd' to the 'portaudio' directory that should have been created. + To commit changes: + cvs -d:pserver:pieter@www.portaudio.com:/home/cvs login + cvs -d:pserver:pieter@www.portaudio.com:/home/cvs commit -m 'blabla.' -r v19-devel pa_sgi/pa_sgi.c + cvs -d:pserver:pieter@www.portaudio.com:/home/cvs logout + To see if someone else worked on something: + cvs -d:pserver:anonymous@www.portaudio.com:/home/cvs update -r v19-devel + To get an older revision of a certain file (without sticky business): + cvs -d:pserver:anonymous@www.portaudio.com:/home/cvs update -p -r 1.1.1.1.2.4 pa_tests/patest1.c >pa_tests/patest1.c-OLD + To see logs: + cvs -d:pserver:anonymous@www.portaudio.com:/home/cvs log pa_common/pa_skeleton.c +*/ diff --git a/portaudio-v19/pa_tests/README.txt b/portaudio-v19/pa_tests/README.txt new file mode 100644 index 000000000..f3a0b8226 --- /dev/null +++ b/portaudio-v19/pa_tests/README.txt @@ -0,0 +1,60 @@ +This directory contains various programs to test PortAudio. The files +named patest_* are tests, the files named debug_* are just scratch +files that may or may not work. + +All following tests are up to date with the V19 API. They should all compile +(without any warnings on GCC 3.3). Note that this does not necissarily mean that +the tests pass, just that they compile. + + x- paqa_devs.c + x- paqa_errs.c (needs reviewing) + x- patest1.c + x- patest_buffer.c + x- patest_callbackstop.c + x- patest_clip.c (last test fails, dither doesn't currently force clip in V19) + x- patest_dither.c + x- patest_hang.c + x- patest_latency.c + x- patest_leftright.c + x- patest_longsine.c + x- patest_many.c + x- patest_maxsines.c + o- patest_mono.c + x- patest_multi_sine.c + x- patest_pink.c + x- patest_prime.c + x- patest_read_record.c + x- patest_record.c + x- patest_ringmix.c + x- patest_saw.c + x- patest_sine.c + x- patest_sine8.c + x- patest_sine_formats.c + x- patest_sine_time.c + x- patest_start_stop.c + x- patest_stop.c + x- patest_sync.c + x- patest_toomanysines.c + o- patest_two_rates.c + x- patest_underflow.c + x- patest_wire.c + x- patest_write_sine.c + x- pa_devs.c + x- pa_fuzz.c + x- pa_minlat.c + +The debug_ files are still in V18 format and may need some V19 adaption. +Feel free to fix them, most simply require adjusting to the new API. + +o- pa_tests/debug_convert.c +o- pa_tests/debug_dither_calc.c +o- pa_tests/debug_dual.c +o- pa_tests/debug_multi_in.c +o- pa_tests/debug_multi_out.c +o- pa_tests/debug_record.c +o- pa_tests/debug_record_reuse.c +o- pa_tests/debug_sine.c +o- pa_tests/debug_sine_amp.c +o- pa_tests/debug_sine_formats.c +o- pa_tests/debug_srate.c +o- pa_tests/debug_test1.c diff --git a/portaudio-v19/pa_tests/debug_convert.c b/portaudio-v19/pa_tests/debug_convert.c new file mode 100644 index 000000000..a17b556e4 --- /dev/null +++ b/portaudio-v19/pa_tests/debug_convert.c @@ -0,0 +1,131 @@ +/* + * $Id$ + * Convert tagged values. + * + * Author: Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +//#define OUTPUT_DEVICE (11) +#define NUM_SECONDS (8) +#define SLEEP_DUR (800) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) + +#define NUM_BUFFERS (0) + +typedef struct +{ + unsigned int framesToGo; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + short *out = (short*)outputBuffer; + int i; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + if( data->framesToGo < framesPerBuffer ) finished = 1; + + for( i=0; i +#include +#include "portaudio.h" +#include "pa_host.h" + +/*******************************************************************/ +int main(void); +int main(void) +{ + long max,min; + int i; + + for( i=0; i<10000; i++ ) + { + long dither = PaConvert_TriangularDither(); + // printf("dither = 0x%08X\n", dither ); + if( dither < min ) min = dither; + else if( dither > max ) max = dither; + } + printf("min = 0x%08X = %d, max = 0x%08X = %d\n", min, min, max, max ); +} diff --git a/portaudio-v19/pa_tests/debug_dual.c b/portaudio-v19/pa_tests/debug_dual.c new file mode 100644 index 000000000..35ba032d0 --- /dev/null +++ b/portaudio-v19/pa_tests/debug_dual.c @@ -0,0 +1,183 @@ +/* + * $Id$ + * debug_dual.c + * Try to open TWO streams on separate cards. + * Play a sine sweep using the Portable Audio api for several seconds. + * Hacked test for debugging PA. + * + * Author: Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#define DEV_ID_1 (13) +#define DEV_ID_2 (15) +#define NUM_SECONDS (8) +#define SLEEP_DUR (800) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#if 0 +#define MIN_LATENCY_MSEC (200) +#define NUM_BUFFERS ((MIN_LATENCY_MSEC * SAMPLE_RATE) / (FRAMES_PER_BUFFER * 1000)) +#else +#define NUM_BUFFERS (0) +#endif +#define MIN_FREQ (100.0f) +#define MAX_FREQ (4000.0f) +#define FREQ_SCALAR (1.00002f) +#define CalcPhaseIncrement(freq) (freq/SAMPLE_RATE) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (400) +typedef struct +{ + float sine[TABLE_SIZE + 1]; // add one for guard point for interpolation + float phase_increment; + float left_phase; + float right_phase; +} +paTestData; +/* Convert phase between and 1.0 to sine value + * using linear interpolation. + */ +float LookupSine( paTestData *data, float phase ); +float LookupSine( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->sine[index]; + float hi = data->sine[index+1]; + float val = lo + fract*(hi-lo); + return val; +} +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + + for( i=0; ileft_phase); /* left */ + *out++ = LookupSine(data, data->right_phase); /* right */ + data->left_phase += data->phase_increment; + if( data->left_phase >= 1.0f ) data->left_phase -= 1.0f; + data->right_phase += (data->phase_increment * 1.5f); /* fifth above */ + if( data->right_phase >= 1.0f ) data->right_phase -= 1.0f; + /* sweep frequency then start over. */ + data->phase_increment *= FREQ_SCALAR; + if( data->phase_increment > CalcPhaseIncrement(MAX_FREQ) ) data->phase_increment = CalcPhaseIncrement(MIN_FREQ); + } + return 0; +} + +PaError TestStart( PortAudioStream **streamPtr, PaDeviceID devID, + paTestData *data ); +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream1, *stream2; + PaError err; + paTestData DATA1, DATA2; + printf("PortAudio Test: DUAL sine sweep. ask for %d buffers\n", NUM_BUFFERS ); + err = Pa_Initialize(); + if( err != paNoError ) goto error; + err = TestStart( &stream1, DEV_ID_1, &DATA1 ); + if( err != paNoError ) goto error; + err = TestStart( &stream2, DEV_ID_2, &DATA2 ); + if( err != paNoError ) goto error; + printf("Hit ENTER\n"); + getchar(); + err = Pa_StopStream( stream1 ); + if( err != paNoError ) goto error; + err = Pa_StopStream( stream2 ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} +PaError TestStart( PortAudioStream **streamPtr, PaDeviceID devID, paTestData *data ) +{ + PortAudioStream *stream; + PaError err; + int i; + /* initialise sinusoidal wavetable */ + for( i=0; isine[i] = (float) sin( ((double)i/(double)TABLE_SIZE) * M_PI * 2. ); + } + data->sine[TABLE_SIZE] = data->sine[0]; // set guard point + data->left_phase = data->right_phase = 0.0; + data->phase_increment = CalcPhaseIncrement(MIN_FREQ); + printf("PortAudio Test: output device = %d\n", devID ); + err = Pa_OpenStream( + &stream, + paNoDevice, + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + devID, + 2, /* stereo output */ + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + NUM_BUFFERS, /* number of buffers, if zero then use default minimum */ + paClipOff|paDitherOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + *streamPtr = stream; + return 0; +error: + return err; +} diff --git a/portaudio-v19/pa_tests/debug_multi_in.c b/portaudio-v19/pa_tests/debug_multi_in.c new file mode 100644 index 000000000..def729c1b --- /dev/null +++ b/portaudio-v19/pa_tests/debug_multi_in.c @@ -0,0 +1,179 @@ +/* + * $Id$ + * debug_multi_in.c + * Pass output from each of multiple channels + * to a stereo output using the Portable Audio api. + * Hacked test for debugging PA. + * + * Author: Phil Burk http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +//#define INPUT_DEVICE_NAME ("EWS88 MT Interleaved Rec") +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +//#define OUTPUT_DEVICE (18) +#define SAMPLE_RATE (22050) +#define FRAMES_PER_BUFFER (256) +#define MIN_LATENCY_MSEC (400) +#define NUM_BUFFERS ((MIN_LATENCY_MSEC * SAMPLE_RATE) / (FRAMES_PER_BUFFER * 1000)) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +typedef struct +{ + int liveChannel; + int numChannels; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float *in = (float*)inputBuffer; + int i; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + if( in == NULL ) return 0; + for( i=0; i<(int)framesPerBuffer; i++ ) + { + /* Copy one channel of input to output. */ + *out++ = in[data->liveChannel]; + *out++ = in[data->liveChannel]; + in += data->numChannels; + } + return 0; +} +/*******************************************************************/ +int PaFindDeviceByName( const char *name ) +{ + int i; + int numDevices; + const PaDeviceInfo *pdi; + int len = strlen( name ); + PaDeviceID result = paNoDevice; + numDevices = Pa_CountDevices(); + for( i=0; iname, len ) == 0 ) + { + result = i; + break; + } + } + return result; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream; + PaError err; + paTestData data; + int i; + PaDeviceID inputDevice; + const PaDeviceInfo *pdi; + printf("PortAudio Test: input signal from each channel. %d buffers\n", NUM_BUFFERS ); + data.liveChannel = 0; + err = Pa_Initialize(); + if( err != paNoError ) goto error; +#ifdef INPUT_DEVICE_NAME + printf("Try to use device: %s\n", INPUT_DEVICE_NAME ); + inputDevice = PaFindDeviceByName(INPUT_DEVICE_NAME); + if( inputDevice == paNoDevice ) + { + printf("Could not find %s. Using default instead.\n", INPUT_DEVICE_NAME ); + inputDevice = Pa_GetDefaultInputDeviceID(); + } +#else + printf("Using default input device.\n"); + inputDevice = Pa_GetDefaultInputDeviceID(); +#endif + pdi = Pa_GetDeviceInfo( inputDevice ); + if( pdi == NULL ) + { + printf("Could not get device info!\n"); + goto error; + } + data.numChannels = pdi->maxInputChannels; + printf("Input Device name is %s\n", pdi->name ); + printf("Input Device has %d channels.\n", pdi->maxInputChannels); + err = Pa_OpenStream( + &stream, + inputDevice, + pdi->maxInputChannels, + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + 2, + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + NUM_BUFFERS, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + data.liveChannel = 0; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + for( i=0; i +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#define FREQ_INCR (300.0 / SAMPLE_RATE) +#define MAX_CHANNELS (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ + int numChannels; + double phases[MAX_CHANNELS]; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int frameIndex, channelIndex; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + for( channelIndex=0; channelIndexnumChannels; channelIndex++ ) + { + /* Output sine wave on every channel. */ + *out++ = (float) sin(data->phases[channelIndex]); + + /* Play each channel at a higher frequency. */ + data->phases[channelIndex] += FREQ_INCR * (4 + channelIndex); + if( data->phases[channelIndex] >= (2.0 * M_PI) ) data->phases[channelIndex] -= (2.0 * M_PI); + } + } + + return 0; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream; + PaError err; + const PaDeviceInfo *pdi; + paTestData data = {0}; + printf("PortAudio Test: output sine wave on each channel.\n" ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + pdi = Pa_GetDeviceInfo( OUTPUT_DEVICE ); + data.numChannels = pdi->maxOutputChannels; + if( data.numChannels > MAX_CHANNELS ) data.numChannels = MAX_CHANNELS; + printf("Number of Channels = %d\n", data.numChannels ); + + err = Pa_OpenStream( + &stream, + paNoDevice, /* default input device */ + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + data.numChannels, + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Hit ENTER to stop sound.\n"); + fflush(stdout); + getchar(); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + Pa_CloseStream( stream ); + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/debug_record.c b/portaudio-v19/pa_tests/debug_record.c new file mode 100644 index 000000000..57b11f581 --- /dev/null +++ b/portaudio-v19/pa_tests/debug_record.c @@ -0,0 +1,339 @@ +/* + * $Id$ + * debug_record.c + * Record input into an array. + * Save array to a file. + * Based on patest_record.c but with various ugly debug hacks thrown in. + * + * Author: Phil Burk http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +#define SAMPLE_RATE (22050) +#define NUM_SECONDS (10) +#define SLEEP_DUR_MSEC (200) +#define FRAMES_PER_BUFFER (1<<10) +#define NUM_REC_BUFS (0) + +#if 1 +#define PA_SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#else +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#endif + +typedef struct +{ + long frameIndex; /* Index into sample array. */ + long maxFrameIndex; + long samplesPerFrame; + long numSamples; + SAMPLE *recordedSamples; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int recordCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = (SAMPLE*)inputBuffer; + SAMPLE *wptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; + long framesToCalc; + unsigned long i; + int finished; + unsigned long framesLeft = data->maxFrameIndex - data->frameIndex; + + (void) outputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( framesLeft < framesPerBuffer ) + { + framesToCalc = framesLeft; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + finished = 0; + } + if( inputBuffer == NULL ) + { + for( i=0; iframeIndex += framesToCalc; + return finished; +} +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int playCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; + SAMPLE *wptr = (SAMPLE*)outputBuffer; + unsigned long i; + int finished; + unsigned int framesLeft = data->maxFrameIndex - data->frameIndex; + if( outputBuffer == NULL ) return 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( framesLeft < framesPerBuffer ) + { + /* final buffer... */ + for( i=0; iframeIndex += framesLeft; + finished = 1; + } + else + { + for( i=0; iframeIndex += framesPerBuffer; + finished = 0; + } + return finished; +} + +/****************************************************************/ +PaError TestRecording( paTestData *dataPtr ) +{ + PortAudioStream *stream; + PaError err; + int i; + + /* Record some audio. */ + err = Pa_OpenStream( + &stream, + Pa_GetDefaultInputDeviceID(), + dataPtr->samplesPerFrame, /* stereo input */ + PA_SAMPLE_TYPE, + NULL, + paNoDevice, + 0, + PA_SAMPLE_TYPE, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + NUM_REC_BUFS, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + recordCallback, + dataPtr ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Now recording!\n"); fflush(stdout); + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + if( Pa_StreamActive( stream ) <= 0) + { + printf("Stream inactive!\n"); + break; + } + if( dataPtr->maxFrameIndex <= dataPtr->frameIndex ) + { + printf("Buffer recording complete.\n"); + break; + } + Pa_Sleep(100); + printf("index = %d\n", dataPtr->frameIndex ); fflush(stdout); + } + + printf("Finished loop. Close stream.\n"); fflush(stdout); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + printf("Done.\n"); fflush(stdout); + { + SAMPLE max = 0; + SAMPLE posVal; + int i; + for( i=0; inumSamples; i++ ) + { + posVal = dataPtr->recordedSamples[i]; + if( posVal < 0 ) posVal = -posVal; + if( posVal > max ) max = posVal; + } + printf("Largest recorded sample = %d\n", max ); + } + /* Write recorded data to a file. */ +#if 0 + { + FILE *fid; + fid = fopen("recorded.raw", "wb"); + if( fid == NULL ) + { + printf("Could not open file."); + } + else + { + fwrite( dataPtr->recordedSamples, dataPtr->samplesPerFrame * sizeof(SAMPLE), totalFrames, fid ); + fclose( fid ); + printf("Wrote data to 'recorded.raw'\n"); + } + } +#endif + +error: + return err; +} + +/****************************************************************/ +PaError TestPlayback( paTestData *dataPtr ) +{ + PortAudioStream *stream; + PaError err; + int i; + + /* Playback recorded data. */ + dataPtr->frameIndex = 0; + printf("Begin playback.\n"); fflush(stdout); + err = Pa_OpenStream( + &stream, + paNoDevice, + 0, /* NO input */ + PA_SAMPLE_TYPE, + NULL, + Pa_GetDefaultOutputDeviceID(), + dataPtr->samplesPerFrame, /* stereo output */ + PA_SAMPLE_TYPE, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + playCallback, + dataPtr ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Waiting for playback to finish.\n"); fflush(stdout); + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + Pa_Sleep(100); + printf("index = %d\n", dataPtr->frameIndex ); + } + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + +error: + return err; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData data; + long totalFrames; + long numBytes; + long i; + printf("patest_record.c\n"); fflush(stdout); + + data.frameIndex = 0; + data.samplesPerFrame = 2; + data.maxFrameIndex = totalFrames = NUM_SECONDS*SAMPLE_RATE; + + printf("totalFrames = %d\n", totalFrames ); fflush(stdout); + data.numSamples = totalFrames * data.samplesPerFrame; + + numBytes = data.numSamples * sizeof(SAMPLE); + data.recordedSamples = (SAMPLE *) malloc( numBytes ); + if( data.recordedSamples == NULL ) + { + printf("Could not allocate record array.\n"); + exit(1); + } + for( i=0; i +#include +#include +#include "portaudio.h" +#define SAMPLE_RATE (22050) +#define NUM_SECONDS (4) +#define SLEEP_DUR_MSEC (200) +#define FRAMES_PER_BUFFER (256) +#define NUM_REC_BUFS (0) + +#if 1 +#define PA_SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#else +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#endif + +typedef struct +{ + long frameIndex; /* Index into sample array. */ + long maxFrameIndex; + long samplesPerFrame; + long numSamples; + PortAudioStream *outputStream; + PortAudioStream *inputStream; + SAMPLE *recordedSamples; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int recordCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = (SAMPLE*)inputBuffer; + SAMPLE *wptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; + long framesToCalc; + unsigned long i; + int finished; + unsigned long framesLeft = data->maxFrameIndex - data->frameIndex; + + (void) outputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( framesLeft < framesPerBuffer ) + { + framesToCalc = framesLeft; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + finished = 0; + } + if( inputBuffer == NULL ) + { + for( i=0; iframeIndex += framesToCalc; + return finished; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int playCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; + SAMPLE *wptr = (SAMPLE*)outputBuffer; + unsigned long i; + int finished; + unsigned int framesLeft = data->maxFrameIndex - data->frameIndex; + if( outputBuffer == NULL ) return 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( framesLeft < framesPerBuffer ) + { + /* final buffer... */ + for( i=0; iframeIndex += framesLeft; + finished = 1; + } + else + { + for( i=0; iframeIndex += framesPerBuffer; + finished = 0; + } + return finished; +} + +/****************************************************************/ +PaError TestRecording( paTestData *dataPtr ) +{ + PaError err; + int i; + int lastIndex = 0; + +/* Open input stream if not already open. */ + if( dataPtr->inputStream == NULL ) + { + /* Record some audio. */ + err = Pa_OpenStream( + &dataPtr->inputStream, + Pa_GetDefaultInputDeviceID(), + dataPtr->samplesPerFrame, /* stereo input */ + PA_SAMPLE_TYPE, + NULL, + paNoDevice, + 0, + PA_SAMPLE_TYPE, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + NUM_REC_BUFS, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + recordCallback, + dataPtr ); + if( err != paNoError ) goto error; + } + + dataPtr->frameIndex = 0; + + err = Pa_StartStream( dataPtr->inputStream ); + if( err != paNoError ) goto error; + + printf("Now recording!\n"); fflush(stdout); + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + int frameIndex, delta; + Pa_Sleep(SLEEP_DUR_MSEC); + + frameIndex = dataPtr->frameIndex; + if( Pa_StreamActive( dataPtr->inputStream ) <= 0) + { + printf("Stream inactive!\n"); + break; + } + if( dataPtr->maxFrameIndex <= frameIndex ) + { + printf("Buffer recording complete.\n"); + break; + } + + delta = frameIndex - lastIndex; + lastIndex = frameIndex; + printf("index = %d, delta = %d\n", frameIndex, delta ); fflush(stdout); + } + + err = Pa_StopStream( dataPtr->inputStream ); + if( err != paNoError ) goto error; + + printf("Done.\n"); fflush(stdout); + +error: + return err; +} + +/****************************************************************/ +PaError TestPlayback( paTestData *dataPtr ) +{ + PaError err; + int i; + int lastIndex = 0; + + /* Playback recorded data. */ + dataPtr->frameIndex = 0; + printf("Begin playback.\n"); fflush(stdout); + +/* Open output stream if not already open. */ + if( dataPtr->outputStream == NULL ) + { + err = Pa_OpenStream( + &dataPtr->outputStream, + paNoDevice, + 0, /* NO input */ + PA_SAMPLE_TYPE, + NULL, + Pa_GetDefaultOutputDeviceID(), + dataPtr->samplesPerFrame, /* stereo output */ + PA_SAMPLE_TYPE, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + playCallback, + dataPtr ); + if( err != paNoError ) goto error; + } + + err = Pa_StartStream( dataPtr->outputStream ); + if( err != paNoError ) goto error; + + printf("Waiting for playback to finish.\n"); fflush(stdout); + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + int frameIndex, delta; + Pa_Sleep(SLEEP_DUR_MSEC); + frameIndex = dataPtr->frameIndex; + delta = frameIndex - lastIndex; + lastIndex = frameIndex; + printf("index = %d, delta = %d\n", frameIndex, delta ); fflush(stdout); + } + + err = Pa_StopStream( dataPtr->outputStream ); + if( err != paNoError ) goto error; + +error: + return err; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData data = { 0 }; + long totalFrames; + long numBytes; + long i; + printf("patest_record.c\n"); fflush(stdout); + +/* Set up test data structure and sample array. */ + data.frameIndex = 0; + data.samplesPerFrame = 2; + data.maxFrameIndex = totalFrames = NUM_SECONDS*SAMPLE_RATE; + + printf("totalFrames = %d\n", totalFrames ); fflush(stdout); + data.numSamples = totalFrames * data.samplesPerFrame; + + numBytes = data.numSamples * sizeof(SAMPLE); + data.recordedSamples = (SAMPLE *) malloc( numBytes ); + if( data.recordedSamples == NULL ) + { + printf("Could not allocate record array.\n"); + exit(1); + } + for( i=0; i + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +//#define OUTPUT_DEVICE (11) +#define NUM_SECONDS (8) +#define SLEEP_DUR (800) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#if 0 +#define MIN_LATENCY_MSEC (200) +#define NUM_BUFFERS ((MIN_LATENCY_MSEC * SAMPLE_RATE) / (FRAMES_PER_BUFFER * 1000)) +#else +#define NUM_BUFFERS (0) +#endif +#define MIN_FREQ (100.0f) +#define MAX_FREQ (4000.0f) +#define FREQ_SCALAR (1.00002f) +#define CalcPhaseIncrement(freq) (freq/SAMPLE_RATE) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (400) +typedef struct +{ + float sine[TABLE_SIZE + 1]; // add one for guard point for interpolation + float phase_increment; + float left_phase; + float right_phase; + unsigned int framesToGo; +} +paTestData; +/* Convert phase between and 1.0 to sine value + * using linear interpolation. + */ +float LookupSine( paTestData *data, float phase ); +float LookupSine( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->sine[index]; + float hi = data->sine[index+1]; + float val = lo + fract*(hi-lo); + return val; +} +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int framesToCalc; + int i; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + if( data->framesToGo < framesPerBuffer ) + { + framesToCalc = data->framesToGo; + data->framesToGo = 0; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + data->framesToGo -= framesPerBuffer; + } + + for( i=0; ileft_phase); /* left */ + *out++ = LookupSine(data, data->right_phase); /* right */ + data->left_phase += data->phase_increment; + if( data->left_phase >= 1.0f ) data->left_phase -= 1.0f; + data->right_phase += (data->phase_increment * 1.5f); /* fifth above */ + if( data->right_phase >= 1.0f ) data->right_phase -= 1.0f; + /* sweep frequency then start over. */ + data->phase_increment *= FREQ_SCALAR; + if( data->phase_increment > CalcPhaseIncrement(MAX_FREQ) ) data->phase_increment = CalcPhaseIncrement(MIN_FREQ); + } + /* zero remainder of final buffer */ + for( ; i<(int)framesPerBuffer; i++ ) + { + *out++ = 0; /* left */ + *out++ = 0; /* right */ + } + return finished; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream; + PaError err; + paTestData data; + int i; + int totalSamps; + printf("PortAudio Test: output sine sweep. ask for %d buffers\n", NUM_BUFFERS ); + /* initialise sinusoidal wavetable */ + for( i=0; i +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#define FREQ_INCR (300.0 / SAMPLE_RATE) +#define MAX_CHANNELS (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ + int numChannels; + double phases[MAX_CHANNELS]; + float amplitude; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int frameIndex, channelIndex; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + for( channelIndex=0; channelIndexnumChannels; channelIndex++ ) + { + /* Output sine wave on every channel. */ + *out++ = (float) ( data->amplitude * sin(data->phases[channelIndex]) ); + + /* Play each channel at a higher frequency. */ + data->phases[channelIndex] += FREQ_INCR * (4 + channelIndex); + if( data->phases[channelIndex] >= (2.0 * M_PI) ) data->phases[channelIndex] -= (2.0 * M_PI); + } + } + + return 0; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + char pad[256]; + PortAudioStream *stream; + PaError err; + const PaDeviceInfo *pdi; + paTestData data = {0}; + printf("PortAudio Test: output sine wave on each channel.\n" ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + pdi = Pa_GetDeviceInfo( OUTPUT_DEVICE ); + data.numChannels = pdi->maxOutputChannels; + if( data.numChannels > MAX_CHANNELS ) data.numChannels = MAX_CHANNELS; + printf("Number of Channels = %d\n", data.numChannels ); + data.amplitude = 1.0; + + err = Pa_OpenStream( + &stream, + paNoDevice, /* default input device */ + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + data.numChannels, + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + do + { + printf("Current amplitude = %f\n", data.amplitude ); + printf("Enter new amplitude or 'q' to quit.\n"); + fflush(stdout); + gets( pad ); + if( pad[0] != 'q' ) + { + // I tried to use atof but it seems to be broken on Mac OS X 10.1 + float amp; + sscanf( pad, "%f", & ); + data.amplitude = amp; + } + } while( pad[0] != 'q' ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + Pa_CloseStream( stream ); + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/debug_sine_formats.c b/portaudio-v19/pa_tests/debug_sine_formats.c new file mode 100644 index 000000000..a1fce567c --- /dev/null +++ b/portaudio-v19/pa_tests/debug_sine_formats.c @@ -0,0 +1,202 @@ +/* + * $Id$ + * patest_sine_formats.c + * Play a sine wave using the Portable Audio api for several seconds. + * Test various data formats. + * + * Author: Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (10) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) + +#define LEFT_FREQ (SAMPLE_RATE/512.0) /* So we hit 1.0 */ +#define RIGHT_FREQ (500.0) + +#define AMPLITUDE (1.0) + +/* Select ONE format for testing. */ +#define TEST_UINT8 (1) +#define TEST_INT8 (0) +#define TEST_INT16 (0) +#define TEST_FLOAT32 (0) + +#if TEST_UINT8 +#define TEST_FORMAT paUInt8 +typedef unsigned char SAMPLE_t; +#define SAMPLE_ZERO (0x80) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(127.0 * (x))) +#define FORMAT_NAME "Unsigned 8 Bit" + +#elif TEST_INT8 +#define TEST_FORMAT paInt8 +typedef char SAMPLE_t; +#define SAMPLE_ZERO (0) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(127.0 * (x))) +#define FORMAT_NAME "Signed 8 Bit" + +#elif TEST_INT16 +#define TEST_FORMAT paInt16 +typedef short SAMPLE_t; +#define SAMPLE_ZERO (0) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(32767 * (x))) +#define FORMAT_NAME "Signed 16 Bit" + +#elif TEST_FLOAT32 +#define TEST_FORMAT paFloat32 +typedef float SAMPLE_t; +#define SAMPLE_ZERO (0.0) +#define DOUBLE_TO_SAMPLE(x) ((SAMPLE_t)(x)) +#define FORMAT_NAME "Float 32 Bit" +#endif + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + + +typedef struct +{ + double left_phase; + double right_phase; + unsigned int framesToGo; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE_t *out = (SAMPLE_t *)outputBuffer; + SAMPLE_t sample; + int i; + int framesToCalc; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + if( data->framesToGo < framesPerBuffer ) + { + framesToCalc = data->framesToGo; + data->framesToGo = 0; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + data->framesToGo -= framesPerBuffer; + } + + for( i=0; ileft_phase += (LEFT_FREQ / SAMPLE_RATE); + if( data->left_phase > 1.0) data->left_phase -= 1.0; + sample = DOUBLE_TO_SAMPLE( AMPLITUDE * sin( (data->left_phase * M_PI * 2. ))); /**/ + *out++ = sample; +/* *out++ = sample; /**/ +/* *out++ = 0; /**/ + + data->right_phase += (RIGHT_FREQ / SAMPLE_RATE); + if( data->right_phase > 1.0) data->right_phase -= 1.0; + *out++ = DOUBLE_TO_SAMPLE( AMPLITUDE * sin( (data->right_phase * M_PI * 2. ))); /**/ +/* *out++ = 0; /* */ + } + /* zero remainder of final buffer */ + for( ; i<(int)framesPerBuffer; i++ ) + { + *out++ = SAMPLE_ZERO; /* left */ + *out++ = SAMPLE_ZERO; /* right */ + } + return finished; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream; + PaError err; + paTestData data; + int totalSamps; + + printf("PortAudio Test: output " FORMAT_NAME "\n"); + + + data.left_phase = data.right_phase = 0.0; + data.framesToGo = totalSamps = NUM_SECONDS * SAMPLE_RATE; /* Play for a few seconds. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + err = Pa_OpenStream( + &stream, + paNoDevice,/* default input device */ + 0, /* no input */ + TEST_FORMAT, + NULL, + Pa_GetDefaultOutputDeviceID(), /* default output device */ + 2, /* stereo output */ + TEST_FORMAT, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Waiting %d seconds for sound to finish.\n", NUM_SECONDS ); + while( Pa_StreamActive( stream ) ) Pa_Sleep(10); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + + printf("PortAudio Test Finished: " FORMAT_NAME "\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/debug_srate.c b/portaudio-v19/pa_tests/debug_srate.c new file mode 100644 index 000000000..07371f28e --- /dev/null +++ b/portaudio-v19/pa_tests/debug_srate.c @@ -0,0 +1,265 @@ +/* + * $Id$ + * debug_record_reuse.c + * Record input into an array. + * Save array to a file. + * Based on patest_record.c but with various ugly debug hacks thrown in. + * Loop twice and reuse same streams. + * + * Author: Phil Burk http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" + +#define EWS88MT_12_REC (1) +#define EWS88MT_12_PLAY (10) +#define SBLIVE_REC (2) +#define SBLIVE_PLAY (11) + +#if 0 +#define INPUT_DEVICE_ID Pa_GetDefaultInputDeviceID() +#define OUTPUT_DEVICE_ID Pa_GetDefaultOutputDeviceID() +#else +#define INPUT_DEVICE_ID (EWS88MT_12_REC) +#define OUTPUT_DEVICE_ID (SBLIVE_PLAY) +#endif + +#define INPUT_SAMPLE_RATE (22050.0) +#define OUTPUT_SAMPLE_RATE (22050.0) +#define NUM_SECONDS (4) +#define SLEEP_DUR_MSEC (1000) +#define FRAMES_PER_BUFFER (64) +#define NUM_REC_BUFS (0) +#define SAMPLES_PER_FRAME (2) + +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; + +typedef struct +{ + long frameIndex; /* Index into sample array. */ +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int recordCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData *) userData; + (void) outputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( inputBuffer != NULL ) + { + data->frameIndex += framesPerBuffer; + } + return 0; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int playCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData *) userData; + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( outputBuffer != NULL ) + { + data->frameIndex += framesPerBuffer; + } + return 0; +} + +/****************************************************************/ +PaError MeasureStreamRate( PortAudioStream *stream, paTestData *dataPtr, double *ratePtr ) +{ + PaError err; + int i; + int totalFrames = 0; + int totalMSec = 0; + + dataPtr->frameIndex = 0; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + int delta, endIndex; + + int startIndex = dataPtr->frameIndex; + Pa_Sleep(SLEEP_DUR_MSEC); + endIndex = dataPtr->frameIndex; + + delta = endIndex - startIndex; + totalFrames += delta; + totalMSec += SLEEP_DUR_MSEC; + + printf("index = %d, delta = %d\n", endIndex, delta ); fflush(stdout); + } + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + *ratePtr = (totalFrames * 1000.0) / totalMSec; + +error: + return err; +} + +void ReportRate( double measuredRate, double expectedRate ) +{ + double error; + + error = (measuredRate - expectedRate) / expectedRate; + error = (error < 0 ) ? -error : error; + + printf("Measured rate = %6.1f, expected rate = %6.1f\n", + measuredRate, expectedRate ); + if( error > 0.1 ) + { + printf("ERROR: unexpected rate! --------------------- ERROR!\n"); + } + else + { + printf("SUCCESS: rate within tolerance!\n"); + } +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData data = { 0 }; + long i; + double rate; + const PaDeviceInfo *pdi; + + PortAudioStream *outputStream; + PortAudioStream *inputStream; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + + pdi = Pa_GetDeviceInfo( INPUT_DEVICE_ID ); + printf("Input device = %s\n", pdi->name ); + pdi = Pa_GetDeviceInfo( OUTPUT_DEVICE_ID ); + printf("Output device = %s\n", pdi->name ); + +/* Open input stream. */ + err = Pa_OpenStream( + &inputStream, + INPUT_DEVICE_ID, + SAMPLES_PER_FRAME, /* stereo input */ + PA_SAMPLE_TYPE, + NULL, + paNoDevice, + 0, + PA_SAMPLE_TYPE, + NULL, + INPUT_SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + NUM_REC_BUFS, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + recordCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_OpenStream( + &outputStream, + paNoDevice, + 0, /* NO input */ + PA_SAMPLE_TYPE, + NULL, + OUTPUT_DEVICE_ID, + SAMPLES_PER_FRAME, /* stereo output */ + PA_SAMPLE_TYPE, + NULL, + OUTPUT_SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + playCallback, + &data ); + if( err != paNoError ) goto error; + +/* Record and playback multiple times. */ + for( i=0; i<2; i++ ) + { + printf("Measuring INPUT ------------------------- \n"); + err = MeasureStreamRate( inputStream, &data, &rate ); + if( err != paNoError ) goto error; + ReportRate( rate, INPUT_SAMPLE_RATE ); + + printf("Measuring OUTPUT ------------------------- \n"); + err = MeasureStreamRate( outputStream, &data, &rate ); + if( err != paNoError ) goto error; + ReportRate( rate, OUTPUT_SAMPLE_RATE ); + } + +/* Clean up. */ + err = Pa_CloseStream( inputStream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( outputStream ); + if( err != paNoError ) goto error; + + if( err != paNoError ) goto error; + + Pa_Terminate(); + + printf("Test complete.\n"); fflush(stdout); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + if( err == paHostError ) + { + fprintf( stderr, "Host Error number: %d\n", Pa_GetHostError() ); + } + return -1; +} diff --git a/portaudio-v19/pa_tests/debug_test1.c b/portaudio-v19/pa_tests/debug_test1.c new file mode 100644 index 000000000..1321f62c8 --- /dev/null +++ b/portaudio-v19/pa_tests/debug_test1.c @@ -0,0 +1,114 @@ +/* + * $Id$ + patest1.c + Ring modulate the audio input with a 441hz sine wave for 20 seconds + using the Portable Audio api + Author: Ross Bencina + Modifications: + April 5th, 2001 - PLB - Check for NULL inputBuffer. +*/ +#include +#include +#include "portaudio.h" +#ifndef M_PI +#define M_PI (3.14159265) +#endif +typedef struct +{ + float sine[100]; + int phase; + int sampsToGo; +} +patest1data; +static int patest1Callback( void *inputBuffer, void *outputBuffer, + unsigned long bufferFrames, + PaTimestamp outTime, void *userData ) +{ + patest1data *data = (patest1data*)userData; + float *in = (float*)inputBuffer; + float *out = (float*)outputBuffer; + int framesToCalc = bufferFrames; + unsigned long i; + int finished = 0; + if(inputBuffer == NULL) return 0; + if( data->sampsToGo < bufferFrames ) + { + finished = 1; + } + for( i=0; iphase >= 100 ) + data->phase = 0; + } + data->sampsToGo -= bufferFrames; + /* zero remainder of final buffer if not already done */ + for( ; i +#include +#include "portaudio.h" + +#ifdef WIN32 +#ifndef PA_NO_ASIO +#include "pa_asio.h" +#endif +#endif + +/*******************************************************************/ +static void PrintSupportedStandardSampleRates( + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters ) +{ + static double standardSampleRates[] = { + 8000.0, 9600.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 32000.0, + 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, -1 /* negative terminated list */ + }; + int i, printCount; + PaError err; + + printCount = 0; + for( i=0; standardSampleRates[i] > 0; i++ ) + { + err = Pa_IsFormatSupported( inputParameters, outputParameters, standardSampleRates[i] ); + if( err == paFormatIsSupported ) + { + if( printCount == 0 ) + { + printf( "\t%8.2f", standardSampleRates[i] ); + printCount = 1; + } + else if( printCount == 4 ) + { + printf( ",\n\t%8.2f", standardSampleRates[i] ); + printCount = 1; + } + else + { + printf( ", %8.2f", standardSampleRates[i] ); + ++printCount; + } + } + } + if( !printCount ) + printf( "None\n" ); + else + printf( "\n" ); +} +/*******************************************************************/ +int main(void); +int main(void) +{ + int i, numDevices, defaultDisplayed; + const PaDeviceInfo *deviceInfo; + PaStreamParameters inputParameters, outputParameters; + PaError err; + + + Pa_Initialize(); + + printf( "PortAudio version number = %d\nPortAudio version text = '%s'\n", + Pa_GetVersion(), Pa_GetVersionText() ); + + + numDevices = Pa_GetDeviceCount(); + if( numDevices < 0 ) + { + printf( "ERROR: Pa_CountDevices returned 0x%x\n", numDevices ); + err = numDevices; + goto error; + } + + printf( "Number of devices = %d\n", numDevices ); + for( i=0; ihostApi )->defaultInputDevice ) + { + const PaHostApiInfo *hostInfo = Pa_GetHostApiInfo( deviceInfo->hostApi ); + printf( "[ Default %s Input", hostInfo->name ); + defaultDisplayed = 1; + } + + if( i == Pa_GetDefaultOutputDevice() ) + { + printf( (defaultDisplayed ? "," : "[") ); + printf( " Default Output" ); + defaultDisplayed = 1; + } + else if( i == Pa_GetHostApiInfo( deviceInfo->hostApi )->defaultOutputDevice ) + { + const PaHostApiInfo *hostInfo = Pa_GetHostApiInfo( deviceInfo->hostApi ); + printf( (defaultDisplayed ? "," : "[") ); + printf( " Default %s Output", hostInfo->name ); + defaultDisplayed = 1; + } + + if( defaultDisplayed ) + printf( " ]\n" ); + + /* print device info fields */ + printf( "Name = %s\n", deviceInfo->name ); + printf( "Host API = %s\n", Pa_GetHostApiInfo( deviceInfo->hostApi )->name ); + printf( "Max inputs = %d", deviceInfo->maxInputChannels ); + printf( ", Max outputs = %d\n", deviceInfo->maxOutputChannels ); + + printf( "Default low input latency = %8.3f\n", deviceInfo->defaultLowInputLatency ); + printf( "Default low output latency = %8.3f\n", deviceInfo->defaultLowOutputLatency ); + printf( "Default high input latency = %8.3f\n", deviceInfo->defaultHighInputLatency ); + printf( "Default high output latency = %8.3f\n", deviceInfo->defaultHighOutputLatency ); + +#ifdef WIN32 +#ifndef PA_NO_ASIO +/* ASIO specific latency information */ + if( Pa_GetHostApiInfo( deviceInfo->hostApi )->type == paASIO ){ + long minLatency, maxLatency, preferredLatency, granularity; + + err = PaAsio_GetAvailableLatencyValues( i, + &minLatency, &maxLatency, &preferredLatency, &granularity ); + + printf( "ASIO minimum buffer size = %ld\n", minLatency ); + printf( "ASIO maximum buffer size = %ld\n", maxLatency ); + printf( "ASIO preferred buffer size = %ld\n", preferredLatency ); + + if( granularity == -1 ) + printf( "ASIO buffer granularity = power of 2\n" ); + else + printf( "ASIO buffer granularity = %ld\n", granularity ); + } +#endif /* !PA_NO_ASIO */ +#endif /* WIN32 */ + + printf( "Default sample rate = %8.2f\n", deviceInfo->defaultSampleRate ); + + /* poll for standard sample rates */ + inputParameters.device = i; + inputParameters.channelCount = deviceInfo->maxInputChannels; + inputParameters.sampleFormat = paInt16; + inputParameters.suggestedLatency = 0; /* ignored by Pa_IsFormatSupported() */ + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = i; + outputParameters.channelCount = deviceInfo->maxOutputChannels; + outputParameters.sampleFormat = paInt16; + outputParameters.suggestedLatency = 0; /* ignored by Pa_IsFormatSupported() */ + outputParameters.hostApiSpecificStreamInfo = NULL; + + if( inputParameters.channelCount > 0 ) + { + printf("Supported standard sample rates\n for half-duplex 16 bit %d channel input = \n", + inputParameters.channelCount ); + PrintSupportedStandardSampleRates( &inputParameters, NULL ); + } + + if( outputParameters.channelCount > 0 ) + { + printf("Supported standard sample rates\n for half-duplex 16 bit %d channel output = \n", + outputParameters.channelCount ); + PrintSupportedStandardSampleRates( NULL, &outputParameters ); + } + + if( inputParameters.channelCount > 0 && outputParameters.channelCount > 0 ) + { + printf("Supported standard sample rates\n for full-duplex 16 bit %d channel input, %d channel output = \n", + inputParameters.channelCount, outputParameters.channelCount ); + PrintSupportedStandardSampleRates( &inputParameters, &outputParameters ); + } + } + + Pa_Terminate(); + + printf("----------------------------------------------\n"); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/pa_fuzz.c b/portaudio-v19/pa_tests/pa_fuzz.c new file mode 100644 index 000000000..127c2e3e6 --- /dev/null +++ b/portaudio-v19/pa_tests/pa_fuzz.c @@ -0,0 +1,168 @@ +/** @file pa_fuzz.c + @brief Distort input like a fuzz boz. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +/* +** Note that many of the older ISA sound cards on PCs do NOT support +** full duplex audio (simultaneous record and playback). +** And some only support full duplex at lower sample rates. +*/ +#define SAMPLE_RATE (44100) +#define PA_SAMPLE_TYPE paFloat32 +#define FRAMES_PER_BUFFER (64) + +typedef float SAMPLE; + +float CubicAmplifier( float input ); +static int fuzzCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + +/* Non-linear amplifier with soft distortion curve. */ +float CubicAmplifier( float input ) +{ + float output, temp; + if( input < 0.0 ) + { + temp = input + 1.0f; + output = (temp * temp * temp) - 1.0f; + } + else + { + temp = input - 1.0f; + output = (temp * temp * temp) + 1.0f; + } + + return output; +} +#define FUZZ(x) CubicAmplifier(CubicAmplifier(CubicAmplifier(CubicAmplifier(x)))) + +static int gNumNoInputs = 0; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int fuzzCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + SAMPLE *out = (SAMPLE*)outputBuffer; + const SAMPLE *in = (const SAMPLE*)inputBuffer; + unsigned int i; + (void) timeInfo; /* Prevent unused variable warnings. */ + (void) statusFlags; + (void) userData; + + if( inputBuffer == NULL ) + { + for( i=0; idefaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = PA_SAMPLE_TYPE; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + &inputParameters, + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + 0, /* paClipOff, */ /* we won't output out of range samples so don't bother clipping them */ + fuzzCallback, + NULL ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Hit ENTER to stop program.\n"); + getchar(); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + printf("Finished. gNumNoInputs = %d\n", gNumNoInputs ); + Pa_Terminate(); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return -1; +} diff --git a/portaudio-v19/pa_tests/pa_minlat.c b/portaudio-v19/pa_tests/pa_minlat.c new file mode 100644 index 000000000..8400dfd27 --- /dev/null +++ b/portaudio-v19/pa_tests/pa_minlat.c @@ -0,0 +1,187 @@ +/** @file pa_minlat.c + @brief Experiment with different numbers of buffers to determine the + minimum latency for a computer. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include +#include +#include "portaudio.h" + +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +#define DEFAULT_BUFFER_SIZE (32) + +typedef struct +{ + double left_phase; + double right_phase; +} +paTestData; + +/* Very simple synthesis routine to generate two sine waves. */ +static int paminlatCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + double left_phaseInc = 0.02; + double right_phaseInc = 0.06; + + double left_phase = data->left_phase; + double right_phase = data->right_phase; + + for( i=0; i TWOPI ) left_phase -= TWOPI; + *out++ = (float) sin( left_phase ); + + right_phase += right_phaseInc; + if( right_phase > TWOPI ) right_phase -= TWOPI; + *out++ = (float) sin( right_phase ); + } + + data->left_phase = left_phase; + data->right_phase = right_phase; + return 0; +} + +int main( int argc, char **argv ); +int main( int argc, char **argv ) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int go; + int outLatency = 0; + int minLatency = DEFAULT_BUFFER_SIZE * 2; + int framesPerBuffer; + double sampleRate = 44100.0; + char str[256]; + + printf("pa_minlat - Determine minimum latency for your computer.\n"); + printf(" usage: pa_minlat {userBufferSize}\n"); + printf(" for example: pa_minlat 64\n"); + printf("Adjust your stereo until you hear a smooth tone in each speaker.\n"); + printf("Then try to find the smallest number of frames that still sounds smooth.\n"); + printf("Note that the sound will stop momentarily when you change the number of buffers.\n"); + + /* Get bufferSize from command line. */ + framesPerBuffer = ( argc > 1 ) ? atol( argv[1] ) : DEFAULT_BUFFER_SIZE; + printf("Frames per buffer = %d\n", framesPerBuffer ); + + data.left_phase = data.right_phase = 0.0; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outLatency = sampleRate * 200.0 / 1000.0; /* 200 msec. */ + + /* Try different numBuffers in a loop. */ + go = 1; + while( go ) + { + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Default output device. */ + outputParameters.channelCount = 2; /* Stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output. */ + outputParameters.suggestedLatency = (double)outLatency / sampleRate; /* In seconds. */ + outputParameters.hostApiSpecificStreamInfo = NULL; + + printf("Latency = %d frames = %6.1f msec.\n", outLatency, outputParameters.suggestedLatency * 1000.0 ); + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + sampleRate, + framesPerBuffer, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + paminlatCallback, + &data ); + if( err != paNoError ) goto error; + if( stream == NULL ) goto error; + + /* Start audio. */ + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + /* Ask user for a new nlatency. */ + printf("\nMove windows around to see if the sound glitches.\n"); + printf("Latency now %d, enter new number of frames, or 'q' to quit: ", outLatency ); + fgets( str, 256, stdin ); + { + /* Get rid of newline */ + size_t l = strlen( str ) - 1; + if( str[ l ] == '\n') + str[ l ] = '\0'; + } + if( str[0] == 'q' ) go = 0; + else + { + outLatency = atol( str ); + if( outLatency < minLatency ) + { + printf( "Latency below minimum of %d! Set to minimum!!!\n", minLatency ); + outLatency = minLatency; + } + } + /* Stop sound until ENTER hit. */ + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + } + printf("A good setting for latency would be somewhat higher than\n"); + printf("the minimum latency that worked.\n"); + printf("PortAudio: Test finished.\n"); + Pa_Terminate(); + return 0; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return 1; +} diff --git a/portaudio-v19/pa_tests/paqa_devs.c b/portaudio-v19/pa_tests/paqa_devs.c new file mode 100644 index 000000000..f52143c19 --- /dev/null +++ b/portaudio-v19/pa_tests/paqa_devs.c @@ -0,0 +1,347 @@ +/** @file paqa_devs.c + @brief Self Testing Quality Assurance app for PortAudio + Try to open each device and run through all the + possible configurations. + + @author Phil Burk http://www.softsynth.com + + Pieter adapted to V19 API. Test now relies heavily on + Pa_IsFormatSupported(). Uses same 'standard' sample rates + as in test pa_devs.c. +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#include "pa_trace.h" + +/****************************************** Definitions ***********/ +#define MODE_INPUT (0) +#define MODE_OUTPUT (1) + +typedef struct PaQaData +{ + unsigned long framesLeft; + int numChannels; + int bytesPerSample; + int mode; + short sawPhase; + PaSampleFormat format; +} +PaQaData; + +/****************************************** Prototypes ***********/ +static void TestDevices( int mode ); +static void TestFormats( int mode, PaDeviceIndex deviceID, double sampleRate, + int numChannels ); +static int TestAdvance( int mode, PaDeviceIndex deviceID, double sampleRate, + int numChannels, PaSampleFormat format ); +static int QaCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + +/****************************************** Globals ***********/ +static int gNumPassed = 0; +static int gNumFailed = 0; + +/****************************************** Macros ***********/ +/* Print ERROR if it fails. Tally success or failure. */ +/* Odd do-while wrapper seems to be needed for some compilers. */ +#define EXPECT(_exp) \ + do \ + { \ + if ((_exp)) {\ + /* printf("SUCCESS for %s\n", #_exp ); */ \ + gNumPassed++; \ + } \ + else { \ + printf("ERROR - 0x%x - %s for %s\n", result, \ + ((result == 0) ? "-" : Pa_GetErrorText(result)), \ + #_exp ); \ + gNumFailed++; \ + goto error; \ + } \ + } while(0) + +/*******************************************************************/ +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int QaCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + unsigned long i; + short phase; + PaQaData *data = (PaQaData *) userData; + (void) inputBuffer; + + /* Play simle sawtooth wave. */ + if( data->mode == MODE_OUTPUT ) + { + phase = data->sawPhase; + switch( data->format ) + { + case paFloat32: + { + float *out = (float *) outputBuffer; + for( i=0; inumChannels == 2 ) + { + *out++ = (float) (phase * (1.0 / 32768.0)); + } + } + } + break; + + case paInt32: + { + int *out = (int *) outputBuffer; + for( i=0; inumChannels == 2 ) + { + *out++ = ((int) phase ) << 16; + } + } + } + break; + case paInt16: + { + short *out = (short *) outputBuffer; + for( i=0; inumChannels == 2 ) + { + *out++ = phase; + } + } + } + break; + + default: + { + unsigned char *out = (unsigned char *) outputBuffer; + unsigned long numBytes = framesPerBuffer * data->numChannels * data->bytesPerSample; + for( i=0; isawPhase = phase; + } + /* Are we through yet? */ + if( data->framesLeft > framesPerBuffer ) + { + PaUtil_AddTraceMessage("QaCallback: running. framesLeft", data->framesLeft ); + data->framesLeft -= framesPerBuffer; + return 0; + } + else + { + PaUtil_AddTraceMessage("QaCallback: DONE! framesLeft", data->framesLeft ); + data->framesLeft = 0; + return 1; + } +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError result; + EXPECT( ((result=Pa_Initialize()) == 0) ); + printf("Test OUTPUT ---------------\n"); + TestDevices( MODE_OUTPUT ); + printf("Test INPUT ---------------\n"); + TestDevices( MODE_INPUT ); +error: + Pa_Terminate(); + printf("QA Report: %d passed, %d failed.\n", gNumPassed, gNumFailed ); + return 0; +} + +/******************************************************************* +* Try each output device, through its full range of capabilities. */ +static void TestDevices( int mode ) +{ + int id, jc, i; + int maxChannels; + const PaDeviceInfo *pdi; + static double standardSampleRates[] = { 8000.0, 9600.0, 11025.0, 12000.0, + 16000.0, 22050.0, 24000.0, + 32000.0, 44100.0, 48000.0, + 88200.0, 96000.0, + -1.0 }; /* Negative terminated list. */ + int numDevices = Pa_GetDeviceCount(); + for( id=0; idmaxInputChannels : pdi->maxOutputChannels); + + for( jc=1; jc<=maxChannels; jc++ ) + { + printf("Name = %s\n", pdi->name ); + /* Try each standard sample rate. */ + for( i=0; standardSampleRates[i] > 0; i++ ) + { + TestFormats( mode, (PaDeviceIndex)id, standardSampleRates[i], jc ); + } + } + } +} + +/*******************************************************************/ +static void TestFormats( int mode, PaDeviceIndex deviceID, double sampleRate, + int numChannels ) +{ + TestAdvance( mode, deviceID, sampleRate, numChannels, paFloat32 ); + TestAdvance( mode, deviceID, sampleRate, numChannels, paInt16 ); + TestAdvance( mode, deviceID, sampleRate, numChannels, paInt32 ); + /* TestAdvance( mode, deviceID, sampleRate, numChannels, paInt24 ); */ +} + +/*******************************************************************/ +static int TestAdvance( int mode, PaDeviceIndex deviceID, double sampleRate, + int numChannels, PaSampleFormat format ) +{ + PaStreamParameters inputParameters, outputParameters, *ipp, *opp; + PaStream *stream = NULL; + PaError result = paNoError; + PaQaData myData; + #define FRAMES_PER_BUFFER (64) + + /* Setup data for synthesis thread. */ + myData.framesLeft = (unsigned long) (sampleRate * 100); /* 100 seconds */ + myData.numChannels = numChannels; + myData.mode = mode; + myData.format = format; + switch( format ) + { + case paFloat32: + case paInt32: + case paInt24: + myData.bytesPerSample = 4; + break; +/* case paPackedInt24: + myData.bytesPerSample = 3; + break; */ + default: + myData.bytesPerSample = 2; + break; + } + + if( mode == MODE_INPUT ) + { + inputParameters.device = deviceID; + inputParameters.channelCount = numChannels; + inputParameters.sampleFormat = format; + inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + ipp = &inputParameters; + } + else + ipp = NULL; + if( mode == MODE_OUTPUT ) /* Pa_GetDeviceInfo(paNoDevice) COREDUMPS!!! */ + { + outputParameters.device = deviceID; + outputParameters.channelCount = numChannels; + outputParameters.sampleFormat = format; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + opp = &outputParameters; + } + else + opp = NULL; + + if(paFormatIsSupported == Pa_IsFormatSupported( ipp, opp, sampleRate )) + { + printf("------ TestAdvance: %s, device = %d, rate = %g, numChannels = %d, format = %lu -------\n", + ( mode == MODE_INPUT ) ? "INPUT" : "OUTPUT", + deviceID, sampleRate, numChannels, (unsigned long)format); + EXPECT( ((result = Pa_OpenStream( &stream, + ipp, + opp, + sampleRate, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + QaCallback, + &myData ) ) == 0) ); + if( stream ) + { + PaTime oldStamp, newStamp; + unsigned long oldFrames; + int minDelay = ( mode == MODE_INPUT ) ? 1000 : 400; + /* Was: + int minNumBuffers = Pa_GetMinNumBuffers( FRAMES_PER_BUFFER, sampleRate ); + int msec = (int) ((minNumBuffers * 3 * 1000.0 * FRAMES_PER_BUFFER) / sampleRate); + */ + int msec = (int)( 3.0 * + (( mode == MODE_INPUT ) ? inputParameters.suggestedLatency : outputParameters.suggestedLatency )); + if( msec < minDelay ) msec = minDelay; + printf("msec = %d\n", msec); /**/ + EXPECT( ((result=Pa_StartStream( stream )) == 0) ); + /* Check to make sure PortAudio is advancing timeStamp. */ + oldStamp = Pa_GetStreamTime(stream); + Pa_Sleep(msec); + newStamp = Pa_GetStreamTime(stream); + printf("oldStamp = %g,newStamp = %g\n", oldStamp, newStamp ); /**/ + EXPECT( (oldStamp < newStamp) ); + /* Check to make sure callback is decrementing framesLeft. */ + oldFrames = myData.framesLeft; + Pa_Sleep(msec); + printf("oldFrames = %lu, myData.framesLeft = %lu\n", oldFrames, myData.framesLeft ); /**/ + EXPECT( (oldFrames > myData.framesLeft) ); + EXPECT( ((result=Pa_CloseStream( stream )) == 0) ); + stream = NULL; + } + } +error: + if( stream != NULL ) Pa_CloseStream( stream ); + return result; +} diff --git a/portaudio-v19/pa_tests/paqa_errs.c b/portaudio-v19/pa_tests/paqa_errs.c new file mode 100644 index 000000000..3f9077173 --- /dev/null +++ b/portaudio-v19/pa_tests/paqa_errs.c @@ -0,0 +1,380 @@ +/** @file paqa_errs.c + @brief Self Testing Quality Assurance app for PortAudio + Do lots of bad things to test error reporting. + @author Phil Burk http://www.softsynth.com + Pieter Suurmond adapted to V19 API. +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include + +#include "portaudio.h" + +/*--------- Definitions ---------*/ +#define MODE_INPUT (0) +#define MODE_OUTPUT (1) +#define FRAMES_PER_BUFFER (64) +#define SAMPLE_RATE (44100.0) + +typedef struct PaQaData +{ + unsigned long framesLeft; + int numChannels; + int bytesPerSample; + int mode; +} +PaQaData; + +static int gNumPassed = 0; /* Two globals */ +static int gNumFailed = 0; + +/*------------------- Macros ------------------------------*/ +/* Print ERROR if it fails. Tally success or failure. Odd */ +/* do-while wrapper seems to be needed for some compilers. */ + +#define EXPECT(_exp) \ + do \ + { \ + if ((_exp)) {\ + gNumPassed++; \ + } \ + else { \ + printf("\nERROR - 0x%x - %s for %s\n", result, Pa_GetErrorText(result), #_exp ); \ + gNumFailed++; \ + goto error; \ + } \ + } while(0) + +#define HOPEFOR(_exp) \ + do \ + { \ + if ((_exp)) {\ + gNumPassed++; \ + } \ + else { \ + printf("\nERROR - 0x%x - %s for %s\n", result, Pa_GetErrorText(result), #_exp ); \ + gNumFailed++; \ + } \ + } while(0) + +/*-------------------------------------------------------------------------*/ +/* This routine will be called by the PortAudio engine when audio is needed. + It may be called at interrupt level on some machines so don't do anything + that could mess up the system like calling malloc() or free(). +*/ +static int QaCallback( const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData ) +{ + unsigned long i; + unsigned char* out = (unsigned char *) outputBuffer; + PaQaData* data = (PaQaData *) userData; + + (void)inputBuffer; /* Prevent "unused variable" warnings. */ + + /* Zero out buffer so we don't hear terrible noise. */ + if( data->mode == MODE_OUTPUT ) + { + unsigned long numBytes = framesPerBuffer * data->numChannels * data->bytesPerSample; + for( i=0; iframesLeft > framesPerBuffer ) + { + data->framesLeft -= framesPerBuffer; + return 0; + } + else + { + data->framesLeft = 0; + return 1; + } +} + +static PaDeviceIndex FindInputOnlyDevice(void) +{ + PaDeviceIndex result = Pa_GetDefaultInputDevice(); + if( result != paNoDevice && Pa_GetDeviceInfo(result)->maxOutputChannels == 0 ) + return result; + + for( result = 0; result < Pa_GetDeviceCount(); ++result ) + { + if( Pa_GetDeviceInfo(result)->maxOutputChannels == 0 ) + return result; + } + + return paNoDevice; +} + +static PaDeviceIndex FindOutputOnlyDevice(void) +{ + PaDeviceIndex result = Pa_GetDefaultOutputDevice(); + if( result != paNoDevice && Pa_GetDeviceInfo(result)->maxInputChannels == 0 ) + return result; + + for( result = 0; result < Pa_GetDeviceCount(); ++result ) + { + if( Pa_GetDeviceInfo(result)->maxInputChannels == 0 ) + return result; + } + + return paNoDevice; +} + +/*-------------------------------------------------------------------------------------------------*/ +static int TestBadOpens( void ) +{ + PaStream* stream = NULL; + PaError result; + PaQaData myData; + PaStreamParameters ipp, opp; + + /* Setup data for synthesis thread. */ + myData.framesLeft = (unsigned long) (SAMPLE_RATE * 100); /* 100 seconds */ + myData.numChannels = 1; + myData.mode = MODE_OUTPUT; + + /*----------------------------- No devices specified: */ + ipp.device = opp.device = paNoDevice; + ipp.channelCount = opp.channelCount = 0; /* Also no channels. */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + /* Take the low latency of the default device for all subsequent tests. */ + ipp.suggestedLatency = Pa_GetDeviceInfo(Pa_GetDefaultInputDevice())->defaultLowInputLatency; + opp.suggestedLatency = Pa_GetDeviceInfo(Pa_GetDefaultOutputDevice())->defaultLowOutputLatency; + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- No devices specified #2: */ + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, NULL, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- Out of range input device specified: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = Pa_GetDeviceCount(); /* And no output device, and no channels. */ + opp.channelCount = 0; opp.device = paNoDevice; + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, NULL, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- Out of range output device specified: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; /* And no input device, and no channels. */ + opp.channelCount = 0; opp.device = Pa_GetDeviceCount(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- Zero input channels: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = Pa_GetDefaultInputDevice(); + opp.channelCount = 0; opp.device = paNoDevice; /* And no output device, and no output channels. */ + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, NULL, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidChannelCount)); + + /*----------------------------- Zero output channels: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; /* And no input device, and no input channels. */ + opp.channelCount = 0; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidChannelCount)); + + /*----------------------------- Nonzero input and output channels but no output device: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 2; ipp.device = Pa_GetDefaultInputDevice(); /* Both stereo. */ + opp.channelCount = 2; opp.device = paNoDevice; + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- Nonzero input and output channels but no input device: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 2; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- NULL stream pointer: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; /* Output is more likely than input. */ + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); /* Only 2 output channels. */ + HOPEFOR(((result = Pa_OpenStream(NULL, &ipp, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paBadStreamPtr)); + + /*----------------------------- Low sample rate: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + 1.0, FRAMES_PER_BUFFER, /* 1 cycle per second (1 Hz) is too low. */ + paClipOff, QaCallback, &myData )) == paInvalidSampleRate)); + + /*----------------------------- High sample rate: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + 10000000.0, FRAMES_PER_BUFFER, /* 10^6 cycles per second (10 MHz) is too high. */ + paClipOff, QaCallback, &myData )) == paInvalidSampleRate)); + + /*----------------------------- NULL callback: */ + /* NULL callback is valid in V19 -- it means use blocking read/write stream + + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, + NULL, + &myData )) == paNullCallback)); + */ + + /*----------------------------- Bad flag: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + 255, /* Is 8 maybe legal V19 API? */ + QaCallback, &myData )) == paInvalidFlag)); + + /*----------------------------- using input device as output device: */ + if( FindInputOnlyDevice() != paNoDevice ) + { + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; /* And no input device, and no channels. */ + opp.channelCount = 2; opp.device = FindInputOnlyDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidChannelCount)); + } + + /*----------------------------- using output device as input device: */ + if( FindOutputOnlyDevice() != paNoDevice ) + { + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 2; ipp.device = FindOutputOnlyDevice(); + opp.channelCount = 0; opp.device = paNoDevice; /* And no output device, and no channels. */ + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, NULL, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidChannelCount)); + + } + + if( stream != NULL ) Pa_CloseStream( stream ); + return result; +} + +/*-----------------------------------------------------------------------------------------*/ +static int TestBadActions( void ) +{ + PaStream* stream = NULL; + PaError result; + PaQaData myData; + PaStreamParameters opp; + + /* Setup data for synthesis thread. */ + myData.framesLeft = (unsigned long)(SAMPLE_RATE * 100); /* 100 seconds */ + myData.numChannels = 1; + myData.mode = MODE_OUTPUT; + + opp.device = Pa_GetDefaultOutputDevice(); /* Default output. */ + opp.channelCount = 2; /* Stereo output. */ + opp.hostApiSpecificStreamInfo = NULL; + opp.sampleFormat = paFloat32; + opp.suggestedLatency = Pa_GetDeviceInfo(opp.device)->defaultLowOutputLatency; + + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, /* Take NULL as input parame- */ + &opp, /* ters, meaning try only output. */ + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paNoError)); + + HOPEFOR(((result = Pa_StartStream(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_StopStream(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_IsStreamStopped(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_IsStreamActive(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_CloseStream(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_SetStreamFinishedCallback(NULL, NULL)) == paBadStreamPtr)); + HOPEFOR(((result = !Pa_GetStreamInfo(NULL)))); + HOPEFOR(((result = Pa_GetStreamTime(NULL)) == 0.0)); + HOPEFOR(((result = Pa_GetStreamCpuLoad(NULL)) == 0.0)); + HOPEFOR(((result = Pa_ReadStream(NULL, NULL, 0)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_WriteStream(NULL, NULL, 0)) == paBadStreamPtr)); + + /** @todo test Pa_GetStreamReadAvailable and Pa_GetStreamWriteAvailable */ + + if (stream != NULL) Pa_CloseStream(stream); + return result; +} + +/*---------------------------------------------------------------------*/ +int main(void); +int main(void) +{ + PaError result; + + EXPECT(((result = Pa_Initialize()) == paNoError)); + TestBadOpens(); + TestBadActions(); +error: + Pa_Terminate(); + printf("QA Report: %d passed, %d failed.\n", gNumPassed, gNumFailed); + return 0; +} diff --git a/portaudio-v19/pa_tests/patest1.c b/portaudio-v19/pa_tests/patest1.c new file mode 100644 index 000000000..15fdfdd3d --- /dev/null +++ b/portaudio-v19/pa_tests/patest1.c @@ -0,0 +1,192 @@ +/** @file patest1.c + @brief Ring modulate the audio input with a sine wave for 20 seconds. + @author Ross Bencina +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define SAMPLE_RATE (44100) + +typedef struct +{ + float sine[100]; + int phase; + int sampsToGo; +} +patest1data; + +static int patest1Callback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + patest1data *data = (patest1data*)userData; + float *in = (float*)inputBuffer; + float *out = (float*)outputBuffer; + int framesToCalc = framesPerBuffer; + unsigned long i = 0; + int finished; + + if( data->sampsToGo < framesPerBuffer ) + { + framesToCalc = data->sampsToGo; + finished = paComplete; + } + else + { + finished = paContinue; + } + + for( ; isine[data->phase]; /* left */ + *out++ = *in++ * data->sine[data->phase++]; /* right */ + if( data->phase >= 100 ) + data->phase = 0; + } + + data->sampsToGo -= framesToCalc; + + /* zero remainder of final buffer if not already done */ + for( ; idefaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + &inputParameters, + &outputParameters, + (double)SAMPLE_RATE, /* Samplerate in Hertz. */ + 512, /* Small buffers */ + paClipOff, /* We won't output out of range samples so don't bother clipping them. */ + patest1Callback, + &data ); + if( err != paNoError ) goto done; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto done; + + printf( "Press any key to end.\n" ); fflush(stdout); + + getc( stdin ); /* wait for input before exiting */ + + err = Pa_AbortStream( stream ); + if( err != paNoError ) goto done; + + printf( "Waiting for stream to complete...\n" ); + + /* sleep until playback has finished */ + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(1000); + if( err < 0 ) goto done; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto done; + +done: + Pa_Terminate(); + + if( err != paNoError ) + { + fprintf( stderr, "An error occured while using portaudio\n" ); + if( err == paUnanticipatedHostError ) + { + fprintf( stderr, " unanticipated host error.\n"); + herr = Pa_GetLastHostErrorInfo(); + if (herr) + { + fprintf( stderr, " Error number: %ld\n", herr->errorCode ); + if (herr->errorText) + fprintf( stderr, " Error text: %s\n", herr->errorText ); + } + else + fprintf( stderr, " Pa_GetLastHostErrorInfo() failed!\n" ); + } + else + { + fprintf( stderr, " Error number: %d\n", err ); + fprintf( stderr, " Error text: %s\n", Pa_GetErrorText( err ) ); + } + + err = 1; /* Always return 0 or 1, but no other return codes. */ + } + + printf( "bye\n" ); + + return err; +} diff --git a/portaudio-v19/pa_tests/patest_buffer.c b/portaudio-v19/pa_tests/patest_buffer.c new file mode 100644 index 000000000..39c5dd21d --- /dev/null +++ b/portaudio-v19/pa_tests/patest_buffer.c @@ -0,0 +1,180 @@ +/** @file patest_buffer.c + @brief Test opening streams with different buffer sizes. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +#define NUM_SECONDS (1) +#define SAMPLE_RATE (44100) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) + +#define BUFFER_TABLE 9 +long buffer_table[] = {200,256,500,512,600, 723, 1000, 1024, 2345}; + +typedef struct +{ + short sine[TABLE_SIZE]; + int left_phase; + int right_phase; + unsigned int sampsToGo; +} +paTestData; +PaError TestOnce( int buffersize ); + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patest1Callback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + short *out = (short*)outputBuffer; + unsigned int i; + int finished = 0; + (void) inputBuffer; /* Prevent "unused variable" warnings. */ + + if( data->sampsToGo < framesPerBuffer ) + { + /* final buffer... */ + + for( i=0; isampsToGo; i++ ) + { + *out++ = data->sine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + /* zero remainder of final buffer */ + for( ; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + data->sampsToGo -= framesPerBuffer; + } + return finished; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + int i; + PaError err; + printf("Test opening streams with different buffer sizes\n\n"); + + for (i = 0 ; i < BUFFER_TABLE; i++) + { + printf("Buffer size %ld\n", buffer_table[i]); + err = TestOnce(buffer_table[i]); + if( err < 0 ) return 0; + + } + return 0; +} + + +PaError TestOnce( int buffersize ) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + int totalSamps; + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + buffersize, /* frames per buffer */ + (paClipOff | paDitherOff), + patest1Callback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Waiting for sound to finish.\n"); + Pa_Sleep(1000); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + return paNoError; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_callbackstop.c b/portaudio-v19/pa_tests/patest_callbackstop.c new file mode 100644 index 000000000..2da642e43 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_callbackstop.c @@ -0,0 +1,221 @@ +/** @file patest_callbackstop.c + @brief Test the paComplete callback result code. + @author Ross Bencina +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define NUM_LOOPS (4) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (67) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int phase; + unsigned long generatedFramesCount; + volatile int callbackReturnedPaComplete; + volatile int callbackInvokedAfterReturningPaComplete; +} +TestData; + +/* + This routine will be called by the PortAudio stream when audio is needed. + It may be called at interrupt level on some machines so don't do anything + that could mess up the system like calling malloc() or free(). +*/ +static int TestCallback( const void *input, void *output, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + TestData *data = (TestData*)userData; + float *out = (float*)output; + unsigned long i; + float x; + + (void) input; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + + + if( data->callbackReturnedPaComplete ) + data->callbackInvokedAfterReturningPaComplete = 1; + + for( i=0; isine[ data->phase++ ]; + if( data->phase >= TABLE_SIZE ) + data->phase -= TABLE_SIZE; + + *out++ = x; /* left */ + *out++ = x; /* right */ + } + + data->generatedFramesCount += frameCount; + if( data->generatedFramesCount >= (NUM_SECONDS * SAMPLE_RATE) ) + { + data->callbackReturnedPaComplete = 1; + return paComplete; + } + else + { + return paContinue; + } +} + +/*----------------------------------------------------------------------------*/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + TestData data; + int i, j; + + + printf( "PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", + SAMPLE_RATE, FRAMES_PER_BUFFER ); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* output will be in-range, so no need to clip */ + TestCallback, + &data ); + if( err != paNoError ) goto error; + + printf("Repeating test %d times.\n", NUM_LOOPS ); + + for( i=0; i < NUM_LOOPS; ++i ) + { + data.phase = 0; + data.generatedFramesCount = 0; + data.callbackReturnedPaComplete = 0; + data.callbackInvokedAfterReturningPaComplete = 0; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); + + /* wait for the callback to complete generating NUM_SECONDS of tone */ + + do + { + Pa_Sleep( 500 ); + } + while( !data.callbackReturnedPaComplete ); + + printf( "Callback returned paComplete.\n" ); + printf( "Waiting for buffers to finish playing...\n" ); + + /* wait for stream to become inactive, + or for a timeout of approximately NUM_SECONDS + */ + + j = 0; + while( (err = Pa_IsStreamActive( stream )) == 1 && j < NUM_SECONDS * 2 ) + { + printf(".\n" ); + Pa_Sleep( 500 ); + ++j; + } + + if( err < 0 ) + { + goto error; + } + else if( err == 1 ) + { + printf( "TEST FAILED: Timed out waiting for buffers to finish playing.\n" ); + } + else + { + printf("Buffers finished.\n" ); + } + + if( data.callbackInvokedAfterReturningPaComplete ) + { + printf( "TEST FAILED: Callback was invoked after returning paComplete.\n" ); + } + + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + } + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_clip.c b/portaudio-v19/pa_tests/patest_clip.c new file mode 100644 index 000000000..1d17d11b2 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_clip.c @@ -0,0 +1,178 @@ +/** @file patest_clip.c + @brief Play a sine wave for several seconds at an amplitude + that would require clipping. + + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (4) +#define SAMPLE_RATE (44100) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) + +typedef struct paTestData +{ + float sine[TABLE_SIZE]; + float amplitude; + int left_phase; + int right_phase; +} +paTestData; + +PaError PlaySine( paTestData *data, unsigned long flags, float amplitude ); + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int sineCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float amplitude = data->amplitude; + unsigned int i; + (void) inputBuffer; /* Prevent "unused variable" warnings. */ + (void) timeInfo; + (void) statusFlags; + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = amplitude * data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + return 0; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData data; + int i; + + printf("PortAudio Test: output sine wave with and without clipping.\n"); + /* initialise sinusoidal wavetable */ + for( i=0; ileft_phase = data->right_phase = 0; + data->amplitude = amplitude; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + 1024, + flags, + sineCallback, + data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + Pa_Sleep( NUM_SECONDS * 1000 ); + printf("CPULoad = %8.6f\n", Pa_GetStreamCpuLoad( stream ) ); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + return paNoError; +error: + return err; +} diff --git a/portaudio-v19/pa_tests/patest_dither.c b/portaudio-v19/pa_tests/patest_dither.c new file mode 100644 index 000000000..10f03e42b --- /dev/null +++ b/portaudio-v19/pa_tests/patest_dither.c @@ -0,0 +1,178 @@ +/** @file patest_dither.c + @brief Attempt to hear difference between dithered and non-dithered signal. + + This only has an effect if the native format is 16 bit. + + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include + +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define SAMPLE_RATE (44100) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) + +typedef struct paTestData +{ + float sine[TABLE_SIZE]; + float amplitude; + int left_phase; + int right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int sineCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo, + PaStreamCallbackFlags statusFlags, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float amplitude = data->amplitude; + unsigned int i; + (void) inputBuffer; + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = amplitude * data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + return 0; +} + +/*****************************************************************************/ +/* + V18 version did not call Pa_Terminate() if Pa_Initialize() failed. + This V19 version ALWAYS calls Pa_Terminate(). PS. +*/ +PaError PlaySine( paTestData *data, PaStreamFlags flags, float amplitude ); +PaError PlaySine( paTestData *data, PaStreamFlags flags, float amplitude ) +{ + PaStream* stream; + PaStreamParameters outputParameters; + PaError err; + + data->left_phase = data->right_phase = 0; + data->amplitude = amplitude; + + err = Pa_Initialize(); + if (err != paNoError) + goto done; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output. */ + /* When you change this, also */ + /* adapt the callback routine! */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device ) + ->defaultLowOutputLatency; /* Low latency. */ + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, + SAMPLE_RATE, + 1024, /* frames per buffer */ + flags, + sineCallback, + (void*)data ); + if (err != paNoError) + goto done; + + err = Pa_StartStream( stream ); + if (err != paNoError) + goto done; + + Pa_Sleep( NUM_SECONDS * 1000 ); + printf("CPULoad = %8.6f\n", Pa_GetStreamCpuLoad(stream)); + + err = Pa_CloseStream( stream ); +done: + Pa_Sleep( 250 ); /* Just a small silence. */ + Pa_Terminate(); + return err; +} + + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData DATA; + int i; + float amplitude = 4.0 / (1<<15); + + printf("PortAudio Test: output EXTREMELY QUIET sine wave with and without dithering.\n"); + /* initialise sinusoidal wavetable */ + for( i=0; i + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include + +#include "portaudio.h" + +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +typedef struct paTestData +{ + int sleepFor; + double phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + double phaseInc = 0.02; + double phase = data->phase; + + (void) inputBuffer; /* Prevent unused argument warning. */ + + for( i=0; i TWOPI ) phase -= TWOPI; + /* This is not a very efficient way to calc sines. */ + *out++ = (float) sin( phase ); /* mono */ + } + + if( data->sleepFor > 0 ) + { + Pa_Sleep( data->sleepFor ); + } + + data->phase = phase; + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream* stream; + PaStreamParameters outputParameters; + PaError err; + int i; + paTestData data = {0}; + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", + SAMPLE_RATE, FRAMES_PER_BUFFER ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Default output device. */ + outputParameters.channelCount = 1; /* Mono output. */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point. */ + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device) + ->defaultLowOutputLatency; + err = Pa_OpenStream(&stream, + NULL, /* No input. */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* No out of range samples. */ + patestCallback, + &data); + if (err != paNoError) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + /* Gradually increase sleep time. */ + /* Was: for( i=0; i<10000; i+= 1000 ) */ + for(i=0; i <= 1000; i += 100) + { + printf("Sleep for %d milliseconds in audio callback.\n", i ); + data.sleepFor = i; + Pa_Sleep( ((i<1000) ? 1000 : i) ); + } + + printf("Suffer for 10 seconds.\n"); + Pa_Sleep( 10000 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_in_overflow.c b/portaudio-v19/pa_tests/patest_in_overflow.c new file mode 100644 index 000000000..a0be2c6a1 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_in_overflow.c @@ -0,0 +1,224 @@ +/** @file patest_in_overflow.c + @brief Count input overflows (using paInputOverflow flag) under + overloaded and normal conditions. + This test uses the same method to overload the stream as does + patest_out_underflow.c -- it generates sine waves until the cpu load + exceeds a certain level. However this test is only concerned with + input and so doesn't ouput any sound. + + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2004 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define MAX_SINES (500) +#define MAX_LOAD (1.2) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +typedef struct paTestData +{ + int sineCount; + double phases[MAX_SINES]; + int countOverflows; + int inputOverflowCount; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float out; /* variable to hold dummy output */ + unsigned long i; + int j; + int finished = paContinue; + (void) timeInfo; /* Prevent unused variable warning. */ + (void) inputBuffer; /* Prevent unused variable warning. */ + (void) outputBuffer; /* Prevent unused variable warning. */ + + if( data->countOverflows && (statusFlags & paInputOverflow) ) + data->inputOverflowCount++; + + for( i=0; isineCount; j++ ) + { + /* Advance phase of next oscillator. */ + phase = data->phases[j]; + phase += phaseInc; + if( phase > TWOPI ) phase -= TWOPI; + + phaseInc *= 1.02; + if( phaseInc > 0.5 ) phaseInc *= 0.5; + + /* This is not a very efficient way to calc sines. */ + output += (float) sin( phase ); + data->phases[j] = phase; + } + /* this is an input-only stream so we don't actually use the output */ + out = (float) (output / data->sineCount); + (void) out; /* suppress unused variable warning*/ + } + + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters inputParameters; + PaStream *stream; + PaError err; + int safeSineCount, stressedSineCount; + int safeOverflowCount, stressedOverflowCount; + paTestData data = {0}; + double load; + + + printf("PortAudio Test: input only, no sound output. Load callback by performing calculations, count input overflows. SR = %d, BufSize = %d. MAX_LOAD = %f\n", + SAMPLE_RATE, FRAMES_PER_BUFFER, (float)MAX_LOAD ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */ + inputParameters.channelCount = 1; /* mono output */ + inputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + &inputParameters, + NULL, /* no output */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Establishing load conditions...\n" ); + + /* Determine number of sines required to get to 50% */ + do + { + data.sineCount++; + Pa_Sleep( 100 ); + + load = Pa_GetStreamCpuLoad( stream ); + printf("sineCount = %d, CPU load = %f\n", data.sineCount, load ); + } + while( load < 0.5 && data.sineCount < (MAX_SINES-1)); + + safeSineCount = data.sineCount; + + /* Calculate target stress value then ramp up to that level*/ + stressedSineCount = (int) (2.0 * data.sineCount * MAX_LOAD ); + if( stressedSineCount > MAX_SINES ) + stressedSineCount = MAX_SINES; + for( ; data.sineCount < stressedSineCount; data.sineCount++ ) + { + Pa_Sleep( 100 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("STRESSING: sineCount = %d, CPU load = %f\n", data.sineCount, load ); + } + + printf("Counting overflows for 5 seconds.\n"); + data.countOverflows = 1; + Pa_Sleep( 5000 ); + + stressedOverflowCount = data.inputOverflowCount; + + data.countOverflows = 0; + data.sineCount = safeSineCount; + + printf("Resuming safe load...\n"); + Pa_Sleep( 1500 ); + data.inputOverflowCount = 0; + Pa_Sleep( 1500 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("sineCount = %d, CPU load = %f\n", data.sineCount, load ); + + printf("Counting overflows for 5 seconds.\n"); + data.countOverflows = 1; + Pa_Sleep( 5000 ); + + safeOverflowCount = data.inputOverflowCount; + + printf("Stop stream.\n"); + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + + if( stressedOverflowCount == 0 ) + printf("Test failed, no input overflows detected under stress.\n"); + else if( safeOverflowCount != 0 ) + printf("Test failed, %d unexpected overflows detected under safe load.\n", safeOverflowCount); + else + printf("Test passed, %d expected input overflows detected under stress, 0 unexpected overflows detected under safe load.\n", stressedOverflowCount ); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_latency.c b/portaudio-v19/pa_tests/patest_latency.c new file mode 100644 index 000000000..f4225112a --- /dev/null +++ b/portaudio-v19/pa_tests/patest_latency.c @@ -0,0 +1,182 @@ +/** @file + @brief Hear the latency caused by big buffers. + Play a sine wave and change frequency based on letter input. + @author Phil Burk , and Darren Gibbs +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDevice()) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (64) + +#define MIN_FREQ (100.0f) +#define CalcPhaseIncrement(freq) ((freq)/SAMPLE_RATE) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (400) + +typedef struct +{ + float sine[TABLE_SIZE + 1]; /* add one for guard point for interpolation */ + float phase_increment; + float left_phase; + float right_phase; +} +paTestData; + +float LookupSine( paTestData *data, float phase ); +/* Convert phase between and 1.0 to sine value + * using linear interpolation. + */ +float LookupSine( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->sine[index]; + float hi = data->sine[index+1]; + float val = lo + fract*(hi-lo); + return val; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int i; + + (void) inputBuffer; /* Prevent unused variable warning. */ + + for( i=0; ileft_phase); /* left */ + *out++ = LookupSine(data, data->right_phase); /* right */ + data->left_phase += data->phase_increment; + if( data->left_phase >= 1.0f ) data->left_phase -= 1.0f; + data->right_phase += (data->phase_increment * 1.5f); /* fifth above */ + if( data->right_phase >= 1.0f ) data->right_phase -= 1.0f; + } + return 0; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream *stream; + PaStreamParameters outputParameters; + PaError err; + paTestData data; + int i; + int done = 0; + + printf("PortAudio Test: enter letter then hit ENTER.\n" ); + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + printf("Requested output latency = %.4f seconds.\n", outputParameters.suggestedLatency ); + printf("%d frames per buffer.\n.", FRAMES_PER_BUFFER ); + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff|paDitherOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Play ASCII keyboard. Hit 'q' to stop. (Use RETURN key on Mac)\n"); + fflush(stdout); + while ( !done ) + { + float freq; + int index; + char c; + do + { + c = getchar(); + } + while( c < ' '); /* Strip white space and control chars. */ + + if( c == 'q' ) done = 1; + index = c % 26; + freq = MIN_FREQ + (index * 40.0); + data.phase_increment = CalcPhaseIncrement(freq); + } + printf("Call Pa_StopStream()\n"); + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_leftright.c b/portaudio-v19/pa_tests/patest_leftright.c new file mode 100644 index 000000000..158223649 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_leftright.c @@ -0,0 +1,173 @@ +/** @file patest_leftright.c + @brief Play different tone sine waves that + alternate between left and right channel. + + The low tone should be on the left channel. + + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (8) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; + int toggle; + int countDown; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, + void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + /* Prevent unused variable warnings. */ + (void) inputBuffer; + + for( i=0; itoggle ) + { + *out++ = data->sine[data->left_phase]; /* left */ + *out++ = 0; /* right */ + } + else + { + *out++ = 0; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + } + + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + + if( data->countDown < 0 ) + { + data->countDown = SAMPLE_RATE; + data->toggle = !data->toggle; + } + data->countDown -= framesPerBuffer; + + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream *stream; + PaStreamParameters outputParameters; + PaError err; + paTestData data; + int i; + int timeout; + + printf("Play different tone sine waves that alternate between left and right channel.\n"); + printf("The low tone should be on the left channel.\n"); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, /* As above. */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for several seconds.\n"); + timeout = NUM_SECONDS * 4; + while( timeout > 0 ) + { + Pa_Sleep( 300 ); /*(Irix very much likes sleeps <= 1000 ms.)*/ + timeout -= 1; + } + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_longsine.c b/portaudio-v19/pa_tests/patest_longsine.c new file mode 100644 index 000000000..3a6ec39ef --- /dev/null +++ b/portaudio-v19/pa_tests/patest_longsine.c @@ -0,0 +1,140 @@ +/** @file patest_longsine.c + @brief Play a sine wave until ENTER hit. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include + +#include "portaudio.h" + +#define SAMPLE_RATE (44100) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback(const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + (void) inputBuffer; /* Prevent unused argument warning. */ + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + return 0; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + printf("PortAudio Test: output sine wave.\n"); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, /* As above. */ + SAMPLE_RATE, + 256, /* Frames per buffer. */ + paClipOff, /* No out of range samples expected. */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Hit ENTER to stop program.\n"); + getchar(); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + + printf("Test finished.\n"); + return err; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_many.c b/portaudio-v19/pa_tests/patest_many.c new file mode 100644 index 000000000..6a678467b --- /dev/null +++ b/portaudio-v19/pa_tests/patest_many.c @@ -0,0 +1,198 @@ +/** @file patest_many.c + @brief Start and stop the PortAudio Driver multiple times. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +#define NUM_SECONDS (1) +#define SAMPLE_RATE (44100) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) +typedef struct +{ + short sine[TABLE_SIZE]; + int left_phase; + int right_phase; + unsigned int sampsToGo; +} +paTestData; +PaError TestOnce( void ); +static int patest1Callback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patest1Callback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + short *out = (short*)outputBuffer; + unsigned int i; + int finished = 0; + (void) inputBuffer; /* Prevent "unused variable" warnings. */ + + if( data->sampsToGo < framesPerBuffer ) + { + /* final buffer... */ + + for( i=0; isampsToGo; i++ ) + { + *out++ = data->sine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + /* zero remainder of final buffer */ + for( ; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + data->sampsToGo -= framesPerBuffer; + } + return finished; +} +/*******************************************************************/ +#ifdef MACINTOSH +int main(void); +int main(void) +{ + int i; + PaError err; + int numLoops = 10; + printf("Loop %d times.\n", numLoops ); + for( i=0; i 1 ) + { + numLoops = atoi(argv[1]); + } + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + 1024, /* frames per buffer */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patest1Callback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Waiting for sound to finish.\n"); + Pa_Sleep(1000); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + return paNoError; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_maxsines.c b/portaudio-v19/pa_tests/patest_maxsines.c new file mode 100644 index 000000000..56592ea47 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_maxsines.c @@ -0,0 +1,204 @@ +/** @file patest_maxsines.c + @brief How many sine waves can we calculate and play in less than 80% CPU Load. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define MAX_SINES (500) +#define MAX_USAGE (0.8) +#define SAMPLE_RATE (44100) +#define FREQ_TO_PHASE_INC(freq) (freq/(float)SAMPLE_RATE) + +#define MIN_PHASE_INC FREQ_TO_PHASE_INC(200.0f) +#define MAX_PHASE_INC (MIN_PHASE_INC * (1 << 5)) + +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +#define TABLE_SIZE (512) + +typedef struct paTestData +{ + int numSines; + float sine[TABLE_SIZE + 1]; /* add one for guard point for interpolation */ + float phases[MAX_SINES]; +} +paTestData; + +/* Convert phase between and 1.0 to sine value + * using linear interpolation. + */ +float LookupSine( paTestData *data, float phase ); +float LookupSine( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->sine[index]; + float hi = data->sine[index+1]; + float val = lo + fract*(hi-lo); + return val; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback(const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float outSample; + float scaler; + int numForScale; + unsigned long i; + int j; + int finished = 0; + (void) inputBuffer; /* Prevent unused argument warning. */ + + /* Determine amplitude scaling factor */ + numForScale = data->numSines; + if( numForScale < 8 ) numForScale = 8; /* prevent pops at beginning */ + scaler = 1.0f / numForScale; + + for( i=0; inumSines; j++ ) + { + /* Advance phase of next oscillator. */ + phase = data->phases[j]; + phase += phaseInc; + if( phase >= 1.0 ) phase -= 1.0; + + output += LookupSine(data, phase); + data->phases[j] = phase; + + phaseInc *= 1.02f; + if( phaseInc > MAX_PHASE_INC ) phaseInc = MIN_PHASE_INC; + } + + outSample = (float) (output * scaler); + *out++ = outSample; /* Left */ + *out++ = outSample; /* Right */ + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + int i; + PaStream* stream; + PaStreamParameters outputParameters; + PaError err; + paTestData data = {0}; + double load; + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultHighOutputLatency; + err = Pa_OpenStream(&stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* No out of range samples should occur. */ + patestCallback, + &data); + if( err != paNoError ) + goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) + goto error; + + /* Play an increasing number of sine waves until we hit MAX_USAGE */ + do { + data.numSines++; + Pa_Sleep(200); + load = Pa_GetStreamCpuLoad(stream); + printf("numSines = %d, CPU load = %f\n", data.numSines, load ); + fflush(stdout); + } while((load < MAX_USAGE) && (data.numSines < MAX_SINES)); + + Pa_Sleep(2000); /* Stay for 2 seconds around 80% CPU. */ + + err = Pa_StopStream( stream ); + if( err != paNoError ) + goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) + goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_mono.c b/portaudio-v19/pa_tests/patest_mono.c new file mode 100644 index 000000000..e7b57362f --- /dev/null +++ b/portaudio-v19/pa_tests/patest_mono.c @@ -0,0 +1,145 @@ +/* + * $Id$ + * patest_sine.c + * Play a monophonic sine wave using the Portable Audio api for several seconds. + * + * Authors: + * Ross Bencina + * Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (10) +#define SAMPLE_RATE (44100) +#define AMPLITUDE (0.8) +#define FRAMES_PER_BUFFER (64) +#define OUTPUT_DEVICE Pa_GetDefaultOutputDevice() + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + /* avoid unused variable warnings */ + (void) inputBuffer; + (void) timeInfo; + (void) statusFlags; + for( i=0; isine[data->phase]; /* left */ + data->phase += 1; + if( data->phase >= TABLE_SIZE ) data->phase -= TABLE_SIZE; + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + printf("PortAudio Test: output MONO sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); fflush(stdout); + Pa_Sleep( NUM_SECONDS * 1000 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} \ No newline at end of file diff --git a/portaudio-v19/pa_tests/patest_mono_asio_channel_select.c b/portaudio-v19/pa_tests/patest_mono_asio_channel_select.c new file mode 100644 index 000000000..4c4ffccdf --- /dev/null +++ b/portaudio-v19/pa_tests/patest_mono_asio_channel_select.c @@ -0,0 +1,155 @@ +/* + * $Id$ + * patest_sine.c + * Play a monophonic sine wave using the Portable Audio api for several seconds. + * + * Authors: + * Ross Bencina + * Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#include "pa_asio.h" + +#define NUM_SECONDS (10) +#define SAMPLE_RATE (44100) +#define AMPLITUDE (0.8) +#define FRAMES_PER_BUFFER (64) +#define OUTPUT_DEVICE Pa_GetDefaultOutputDevice() + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + /* avoid unused variable warnings */ + (void) inputBuffer; + (void) timeInfo; + (void) statusFlags; + for( i=0; isine[data->phase]; /* left */ + data->phase += 1; + if( data->phase >= TABLE_SIZE ) data->phase -= TABLE_SIZE; + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaAsioStreamInfo asioOutputInfo; + PaStream *stream; + PaError err; + paTestData data; + int outputChannelSelectors[1]; + int i; + printf("PortAudio Test: output MONO sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + + asioOutputInfo.size = sizeof(PaAsioStreamInfo); + asioOutputInfo.hostApiType = paASIO; + asioOutputInfo.version = 1; + asioOutputInfo.flags = paAsioUseChannelSelectors; + outputChannelSelectors[0] = 1; /* select the second (right) ASIO device channel */ + asioOutputInfo.channelSelectors = outputChannelSelectors; + outputParameters.hostApiSpecificStreamInfo = &asioOutputInfo; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); fflush(stdout); + Pa_Sleep( NUM_SECONDS * 1000 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_multi_sine.c b/portaudio-v19/pa_tests/patest_multi_sine.c new file mode 100644 index 000000000..161c88222 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_multi_sine.c @@ -0,0 +1,194 @@ +/** @file patest_multi_sine.c + @brief Play a different sine wave on each channel. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include + +#include "portaudio.h" + +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#define FREQ_INCR (300.0 / SAMPLE_RATE) +#define MAX_CHANNELS (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ + short interleaved; /* Nonzero for interleaved / zero for non-interleaved. */ + int numChannels; /* Actually used. */ + double phases[MAX_CHANNELS]; /* Each channel gets its' own frequency. */ +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback(const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData) +{ + int frameIndex, channelIndex; + float** outputs = (float**)outputBuffer; + paTestData* data = (paTestData*)userData; + + (void) inputBuffer; /* Prevent unused arg warning. */ + if (data->interleaved) + { + float *out = (float*)outputBuffer; /* interleaved version */ + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + for( channelIndex=0; channelIndexnumChannels; channelIndex++ ) + { + /* Output sine wave on every channel. */ + *out++ = (float) sin(data->phases[channelIndex]); + + /* Play each channel at a higher frequency. */ + data->phases[channelIndex] += FREQ_INCR * (4 + channelIndex); + if( data->phases[channelIndex] >= (2.0 * M_PI) ) data->phases[channelIndex] -= (2.0 * M_PI); + } + } + } + else + { + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + for( channelIndex=0; channelIndexnumChannels; channelIndex++ ) + { + /* Output sine wave on every channel. */ + outputs[channelIndex][frameIndex] = (float) sin(data->phases[channelIndex]); + + /* Play each channel at a higher frequency. */ + data->phases[channelIndex] += FREQ_INCR * (4 + channelIndex); + if( data->phases[channelIndex] >= (2.0 * M_PI) ) data->phases[channelIndex] -= (2.0 * M_PI); + } + } + } + return 0; +} + +/*******************************************************************/ +int test(short interleaved) +{ + PaStream* stream; + PaStreamParameters outputParameters; + PaError err; + const PaDeviceInfo* pdi; + paTestData data; + short n; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Default output device, max channels. */ + pdi = Pa_GetDeviceInfo(outputParameters.device); + outputParameters.channelCount = pdi->maxOutputChannels; + if (outputParameters.channelCount > MAX_CHANNELS) + outputParameters.channelCount = MAX_CHANNELS; + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = pdi->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + data.interleaved = interleaved; + data.numChannels = outputParameters.channelCount; + for (n = 0; n < data.numChannels; n++) + data.phases[n] = 0.0; /* Phases wrap and maybe don't need initialisation. */ + printf("%d ", data.numChannels); + if (interleaved) + printf("interleaved "); + else + { + printf(" non-interleaved "); + outputParameters.sampleFormat |= paNonInterleaved; + } + printf("channels.\n"); + + err = Pa_OpenStream(&stream, + NULL, /* No input. */ + &outputParameters, + SAMPLE_RATE, /* Sample rate. */ + FRAMES_PER_BUFFER, /* Frames per buffer. */ + paClipOff, /* Samples never out of range, no clipping. */ + patestCallback, + &data); + if (err == paNoError) + { + err = Pa_StartStream(stream); + if (err == paNoError) + { + printf("Hit ENTER to stop this test.\n"); + getchar(); + err = Pa_StopStream(stream); + } + Pa_CloseStream( stream ); + } + return err; +} + + +/*******************************************************************/ +int main(void) +{ + PaError err; + + printf("PortAudio Test: output sine wave on each channel.\n" ); + + err = Pa_Initialize(); + if (err != paNoError) + goto done; + + err = test(1); /* 1 means interleaved. */ + if (err != paNoError) + goto done; + + err = test(0); /* 0 means not interleaved. */ + if (err != paNoError) + goto done; + + printf("Test finished.\n"); +done: + if (err) + { + fprintf(stderr, "An error occured while using the portaudio stream\n"); + fprintf(stderr, "Error number: %d\n", err ); + fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(err)); + } + Pa_Terminate(); + return 0; +} diff --git a/portaudio-v19/pa_tests/patest_out_underflow.c b/portaudio-v19/pa_tests/patest_out_underflow.c new file mode 100644 index 000000000..8e6f27897 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_out_underflow.c @@ -0,0 +1,217 @@ +/** @file patest_out_underflow.c + @brief Count output underflows (using paOutputUnderflow flag) + under overloaded and normal conditions. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2004 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define MAX_SINES (500) +#define MAX_LOAD (1.2) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +typedef struct paTestData +{ + int sineCount; + double phases[MAX_SINES]; + int countUnderflows; + int outputUnderflowCount; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int j; + int finished = paContinue; + (void) timeInfo; /* Prevent unused variable warning. */ + (void) inputBuffer; /* Prevent unused variable warning. */ + + + if( data->countUnderflows && (statusFlags & paOutputUnderflow) ) + data->outputUnderflowCount++; + + for( i=0; isineCount; j++ ) + { + /* Advance phase of next oscillator. */ + phase = data->phases[j]; + phase += phaseInc; + if( phase > TWOPI ) phase -= TWOPI; + + phaseInc *= 1.02; + if( phaseInc > 0.5 ) phaseInc *= 0.5; + + /* This is not a very efficient way to calc sines. */ + output += (float) sin( phase ); + data->phases[j] = phase; + } + *out++ = (float) (output / data->sineCount); + } + + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + int safeSineCount, stressedSineCount; + int safeUnderflowCount, stressedUnderflowCount; + paTestData data = {0}; + double load; + + + printf("PortAudio Test: output sine waves, count underflows. SR = %d, BufSize = %d. MAX_LOAD = %f\n", + SAMPLE_RATE, FRAMES_PER_BUFFER, (float)MAX_LOAD ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 1; /* mono output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Establishing load conditions...\n" ); + + /* Determine number of sines required to get to 50% */ + do + { + data.sineCount++; + Pa_Sleep( 100 ); + + load = Pa_GetStreamCpuLoad( stream ); + printf("sineCount = %d, CPU load = %f\n", data.sineCount, load ); + } + while( load < 0.5 && data.sineCount < (MAX_SINES-1)); + + safeSineCount = data.sineCount; + + /* Calculate target stress value then ramp up to that level*/ + stressedSineCount = (int) (2.0 * data.sineCount * MAX_LOAD ); + if( stressedSineCount > MAX_SINES ) + stressedSineCount = MAX_SINES; + for( ; data.sineCount < stressedSineCount; data.sineCount++ ) + { + Pa_Sleep( 100 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("STRESSING: sineCount = %d, CPU load = %f\n", data.sineCount, load ); + } + + printf("Counting underflows for 5 seconds.\n"); + data.countUnderflows = 1; + Pa_Sleep( 5000 ); + + stressedUnderflowCount = data.outputUnderflowCount; + + data.countUnderflows = 0; + data.sineCount = safeSineCount; + + printf("Resuming safe load...\n"); + Pa_Sleep( 1500 ); + data.outputUnderflowCount = 0; + Pa_Sleep( 1500 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("sineCount = %d, CPU load = %f\n", data.sineCount, load ); + + printf("Counting underflows for 5 seconds.\n"); + data.countUnderflows = 1; + Pa_Sleep( 5000 ); + + safeUnderflowCount = data.outputUnderflowCount; + + printf("Stop stream.\n"); + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + + if( stressedUnderflowCount == 0 ) + printf("Test failed, no output underflows detected under stress.\n"); + else if( safeUnderflowCount != 0 ) + printf("Test failed, %d unexpected underflows detected under safe load.\n", safeUnderflowCount); + else + printf("Test passed, %d expected output underflows detected under stress, 0 unexpected underflows detected under safe load.\n", stressedUnderflowCount ); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_pink.c b/portaudio-v19/pa_tests/patest_pink.c new file mode 100644 index 000000000..f2db85d9c --- /dev/null +++ b/portaudio-v19/pa_tests/patest_pink.c @@ -0,0 +1,269 @@ +/** @file patest_pink.c + @brief Generate Pink Noise using Gardner method. + + Optimization suggested by James McCartney uses a tree + to select which random value to replace. +
    +	x x x x x x x x x x x x x x x x 
    +	x   x   x   x   x   x   x   x   
    +	x       x       x       x       
    +	 x               x               
    +	   x   
    +
    + Tree is generated by counting trailing zeros in an increasing index. + When the index is zero, no random number is selected. + + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +#define PINK_MAX_RANDOM_ROWS (30) +#define PINK_RANDOM_BITS (24) +#define PINK_RANDOM_SHIFT ((sizeof(long)*8)-PINK_RANDOM_BITS) + +typedef struct +{ + long pink_Rows[PINK_MAX_RANDOM_ROWS]; + long pink_RunningSum; /* Used to optimize summing of generators. */ + int pink_Index; /* Incremented each sample. */ + int pink_IndexMask; /* Index wrapped by ANDing with this mask. */ + float pink_Scalar; /* Used to scale within range of -1.0 to +1.0 */ +} +PinkNoise; + +/* Prototypes */ +static unsigned long GenerateRandomNumber( void ); +void InitializePinkNoise( PinkNoise *pink, int numRows ); +float GeneratePinkNoise( PinkNoise *pink ); + +/************************************************************/ +/* Calculate pseudo-random 32 bit number based on linear congruential method. */ +static unsigned long GenerateRandomNumber( void ) +{ + /* Change this seed for different random sequences. */ + static unsigned long randSeed = 22222; + randSeed = (randSeed * 196314165) + 907633515; + return randSeed; +} + +/************************************************************/ +/* Setup PinkNoise structure for N rows of generators. */ +void InitializePinkNoise( PinkNoise *pink, int numRows ) +{ + int i; + long pmax; + pink->pink_Index = 0; + pink->pink_IndexMask = (1<pink_Scalar = 1.0f / pmax; + /* Initialize rows. */ + for( i=0; ipink_Rows[i] = 0; + pink->pink_RunningSum = 0; +} + +#define PINK_MEASURE +#ifdef PINK_MEASURE +float pinkMax = -999.0; +float pinkMin = 999.0; +#endif + +/* Generate Pink noise values between -1.0 and +1.0 */ +float GeneratePinkNoise( PinkNoise *pink ) +{ + long newRandom; + long sum; + float output; + /* Increment and mask index. */ + pink->pink_Index = (pink->pink_Index + 1) & pink->pink_IndexMask; + /* If index is zero, don't update any random values. */ + if( pink->pink_Index != 0 ) + { + /* Determine how many trailing zeros in PinkIndex. */ + /* This algorithm will hang if n==0 so test first. */ + int numZeros = 0; + int n = pink->pink_Index; + while( (n & 1) == 0 ) + { + n = n >> 1; + numZeros++; + } + /* Replace the indexed ROWS random value. + * Subtract and add back to RunningSum instead of adding all the random + * values together. Only one changes each time. + */ + pink->pink_RunningSum -= pink->pink_Rows[numZeros]; + newRandom = ((long)GenerateRandomNumber()) >> PINK_RANDOM_SHIFT; + pink->pink_RunningSum += newRandom; + pink->pink_Rows[numZeros] = newRandom; + } + + /* Add extra white noise value. */ + newRandom = ((long)GenerateRandomNumber()) >> PINK_RANDOM_SHIFT; + sum = pink->pink_RunningSum + newRandom; + /* Scale to range of -1.0 to 0.9999. */ + output = pink->pink_Scalar * sum; +#ifdef PINK_MEASURE + /* Check Min/Max */ + if( output > pinkMax ) pinkMax = output; + else if( output < pinkMin ) pinkMin = output; +#endif + return output; +} + +/*******************************************************************/ +#define PINK_TEST +#ifdef PINK_TEST + +/* Context for callback routine. */ +typedef struct +{ + PinkNoise leftPink; + PinkNoise rightPink; + unsigned int sampsToGo; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback(const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData) +{ + int finished; + int i; + int numFrames; + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + (void) inputBuffer; /* Prevent "unused variable" warnings. */ + + /* Are we almost at end. */ + if( data->sampsToGo < framesPerBuffer ) + { + numFrames = data->sampsToGo; + finished = 1; + } + else + { + numFrames = framesPerBuffer; + finished = 0; + } + for( i=0; ileftPink ); + *out++ = GeneratePinkNoise( &data->rightPink ); + } + data->sampsToGo -= numFrames; + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream* stream; + PaError err; + paTestData data; + PaStreamParameters outputParameters; + int totalSamps; + static const double SR = 44100.0; + static const int FPB = 2048; /* Frames per buffer: 46 ms buffers. */ + + /* Initialize two pink noise signals with different numbers of rows. */ + InitializePinkNoise( &data.leftPink, 12 ); + InitializePinkNoise( &data.rightPink, 16 ); + + /* Look at a few values. */ + { + int i; + float pink; + for( i=0; i<20; i++ ) + { + pink = GeneratePinkNoise( &data.leftPink ); + printf("Pink = %f\n", pink ); + } + } + + data.sampsToGo = totalSamps = (int)(60.0 * SR); /* Play a whole minute. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + /* Open a stereo PortAudio stream so we can hear the result. */ + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Take the default output device. */ + outputParameters.channelCount = 2; /* Stereo output, most likely supported. */ + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output. */ + outputParameters.suggestedLatency = + Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency; + err = Pa_OpenStream(&stream, + NULL, /* No input. */ + &outputParameters, + SR, /* Sample rate. */ + FPB, /* Frames per buffer. */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Stereo pink noise for one minute...\n"); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(100); + if( err < 0 ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; +#ifdef PINK_MEASURE + printf("Pink min = %f, max = %f\n", pinkMin, pinkMax ); +#endif + Pa_Terminate(); + return 0; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return 0; +} +#endif /* PINK_TEST */ diff --git a/portaudio-v19/pa_tests/patest_prime.c b/portaudio-v19/pa_tests/patest_prime.c new file mode 100644 index 000000000..47d1f5f56 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_prime.c @@ -0,0 +1,223 @@ +/** @file patest_prime.c + @brief Test stream priming mode. + @author Ross Bencina http://www.audiomulch.com/~rossb +*/ + +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" +#include "pa_util.h" + +#define NUM_BEEPS (3) +#define SAMPLE_RATE (44100) +#define SAMPLE_PERIOD (1.0/44100.0) +#define FRAMES_PER_BUFFER (256) +#define BEEP_DURATION (400) +#define IDLE_DURATION (SAMPLE_RATE*2) /* 2 seconds */ +#define SLEEP_MSEC (50) + +#define STATE_BKG_IDLE (0) +#define STATE_BKG_BEEPING (1) + +typedef struct +{ + float leftPhase; + float rightPhase; + int state; + int beepCountdown; + int idleCountdown; +} +paTestData; + +static void InitializeTestData( paTestData *testData ) +{ + testData->leftPhase = 0; + testData->rightPhase = 0; + testData->state = STATE_BKG_BEEPING; + testData->beepCountdown = BEEP_DURATION; + testData->idleCountdown = IDLE_DURATION; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo, + PaStreamCallbackFlags statusFlags, void *userData ) +{ + /* Cast data passed through stream to our structure. */ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + int result = paContinue; + + /* supress unused parameter warnings */ + (void) inputBuffer; + (void) timeInfo; + (void) statusFlags; + + for( i=0; istate ) + { + case STATE_BKG_IDLE: + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + --data->idleCountdown; + + if( data->idleCountdown <= 0 ) result = paComplete; + break; + + case STATE_BKG_BEEPING: + if( data->beepCountdown <= 0 ) + { + data->state = STATE_BKG_IDLE; + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + } + else + { + /* Play sawtooth wave. */ + *out++ = data->leftPhase; /* left */ + *out++ = data->rightPhase; /* right */ + /* Generate simple sawtooth phaser that ranges between -1.0 and 1.0. */ + data->leftPhase += 0.01f; + /* When signal reaches top, drop back down. */ + if( data->leftPhase >= 1.0f ) data->leftPhase -= 2.0f; + /* higher pitch so we can distinguish left and right. */ + data->rightPhase += 0.03f; + if( data->rightPhase >= 1.0f ) data->rightPhase -= 2.0f; + } + --data->beepCountdown; + break; + } + } + + return result; +} + +/*******************************************************************/ +static PaError DoTest( int flags ) +{ + PaStream *stream; + PaError err; + paTestData data; + PaStreamParameters outputParameters; + + InitializeTestData( &data ); + + outputParameters.device = Pa_GetDefaultOutputDevice(); + outputParameters.channelCount = 2; + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.sampleFormat = paFloat32; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency; + + /* Open an audio I/O stream. */ + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + paClipOff | flags, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("hear \"BEEP\"\n" ); + fflush(stdout); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(SLEEP_MSEC); + if( err < 0 ) goto error; + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + return err; +error: + return err; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err = paNoError; + int i; + + /* Initialize library before making any other calls. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + printf("PortAudio Test: Testing stream playback with no priming.\n"); + printf("PortAudio Test: you should see BEEP before you hear it.\n"); + printf("BEEP %d times.\n", NUM_BEEPS ); + + for( i=0; i< NUM_BEEPS; ++i ) + { + err = DoTest( 0 ); + if( err != paNoError ) + goto error; + } + + printf("PortAudio Test: Testing stream playback with priming.\n"); + printf("PortAudio Test: you should see BEEP around the same time you hear it.\n"); + for( i=0; i< NUM_BEEPS; ++i ) + { + err = DoTest( paPrimeOutputBuffersUsingStreamCallback ); + if( err != paNoError ) + goto error; + } + + printf("Test finished.\n"); + + Pa_Terminate(); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_read_record.c b/portaudio-v19/pa_tests/patest_read_record.c new file mode 100644 index 000000000..5e9ca0109 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_read_record.c @@ -0,0 +1,229 @@ +/** @file patest_read_record.c + @brief Record input into an array; Save array to a file; Playback recorded + data. Implemented using the blocking API (Pa_ReadStream(), Pa_WriteStream() ) + @author Phil Burk http://www.softsynth.com + @author Ross Bencina rossb@audiomulch.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +/* #define SAMPLE_RATE (17932) // Test failure to open with this value. */ +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) +#define NUM_SECONDS (5) +#define NUM_CHANNELS (2) +/* #define DITHER_FLAG (paDitherOff) */ +#define DITHER_FLAG (0) /**/ + +/* Select sample format. */ +#if 1 +#define PA_SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#define SAMPLE_SILENCE (0.0f) +#define PRINTF_S_FORMAT "%.8f" +#elif 1 +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#elif 0 +#define PA_SAMPLE_TYPE paInt8 +typedef char SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#else +#define PA_SAMPLE_TYPE paUInt8 +typedef unsigned char SAMPLE; +#define SAMPLE_SILENCE (128) +#define PRINTF_S_FORMAT "%d" +#endif + + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters inputParameters, outputParameters; + PaStream *stream; + PaError err; + SAMPLE *recordedSamples; + int i; + int totalFrames; + int numSamples; + int numBytes; + SAMPLE max, average, val; + + + printf("patest_read_record.c\n"); fflush(stdout); + + totalFrames = NUM_SECONDS * SAMPLE_RATE; /* Record for a few seconds. */ + numSamples = totalFrames * NUM_CHANNELS; + + numBytes = numSamples * sizeof(SAMPLE); + recordedSamples = (SAMPLE *) malloc( numBytes ); + if( recordedSamples == NULL ) + { + printf("Could not allocate record array.\n"); + exit(1); + } + for( i=0; idefaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + /* Record some audio. -------------------------------------------- */ + err = Pa_OpenStream( + &stream, + &inputParameters, + NULL, /* &outputParameters, */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Now recording!!\n"); fflush(stdout); + + err = Pa_ReadStream( stream, recordedSamples, totalFrames ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + /* Measure maximum peak amplitude. */ + max = 0; + average = 0; + for( i=0; i max ) + { + max = val; + } + average += val; + } + + average = average / numSamples; + + printf("Sample max amplitude = "PRINTF_S_FORMAT"\n", max ); + printf("Sample average = "PRINTF_S_FORMAT"\n", average ); +/* Was as below. Better choose at compile time because this + keeps generating compiler-warnings: + if( PA_SAMPLE_TYPE == paFloat32 ) + { + printf("sample max amplitude = %f\n", max ); + printf("sample average = %f\n", average ); + } + else + { + printf("sample max amplitude = %d\n", max ); + printf("sample average = %d\n", average ); + } +*/ + /* Write recorded data to a file. */ +#if 0 + { + FILE *fid; + fid = fopen("recorded.raw", "wb"); + if( fid == NULL ) + { + printf("Could not open file."); + } + else + { + fwrite( recordedSamples, NUM_CHANNELS * sizeof(SAMPLE), totalFrames, fid ); + fclose( fid ); + printf("Wrote data to 'recorded.raw'\n"); + } + } +#endif + + /* Playback recorded data. -------------------------------------------- */ + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = NUM_CHANNELS; + outputParameters.sampleFormat = PA_SAMPLE_TYPE; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + printf("Begin playback.\n"); fflush(stdout); + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + if( stream ) + { + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Waiting for playback to finish.\n"); fflush(stdout); + + err = Pa_WriteStream( stream, recordedSamples, totalFrames ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + printf("Done.\n"); fflush(stdout); + } + free( recordedSamples ); + + Pa_Terminate(); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return -1; +} + diff --git a/portaudio-v19/pa_tests/patest_record.c b/portaudio-v19/pa_tests/patest_record.c new file mode 100644 index 000000000..7ba35825d --- /dev/null +++ b/portaudio-v19/pa_tests/patest_record.c @@ -0,0 +1,337 @@ +/** @file patest_record.c + @brief Record input into an array; Save array to a file; Playback recorded data. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +/* #define SAMPLE_RATE (17932) // Test failure to open with this value. */ +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) +#define NUM_SECONDS (5) +#define NUM_CHANNELS (2) +/* #define DITHER_FLAG (paDitherOff) */ +#define DITHER_FLAG (0) /**/ + +/* Select sample format. */ +#if 1 +#define PA_SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#define SAMPLE_SILENCE (0.0f) +#define PRINTF_S_FORMAT "%.8f" +#elif 1 +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#elif 0 +#define PA_SAMPLE_TYPE paInt8 +typedef char SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#else +#define PA_SAMPLE_TYPE paUInt8 +typedef unsigned char SAMPLE; +#define SAMPLE_SILENCE (128) +#define PRINTF_S_FORMAT "%d" +#endif + +typedef struct +{ + int frameIndex; /* Index into sample array. */ + int maxFrameIndex; + SAMPLE *recordedSamples; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int recordCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + const SAMPLE *rptr = (const SAMPLE*)inputBuffer; + SAMPLE *wptr = &data->recordedSamples[data->frameIndex * NUM_CHANNELS]; + long framesToCalc; + long i; + int finished; + unsigned long framesLeft = data->maxFrameIndex - data->frameIndex; + + (void) outputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + (void) userData; + + if( framesLeft < framesPerBuffer ) + { + framesToCalc = framesLeft; + finished = paComplete; + } + else + { + framesToCalc = framesPerBuffer; + finished = paContinue; + } + + if( inputBuffer == NULL ) + { + for( i=0; iframeIndex += framesToCalc; + return finished; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int playCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = &data->recordedSamples[data->frameIndex * NUM_CHANNELS]; + SAMPLE *wptr = (SAMPLE*)outputBuffer; + unsigned int i; + int finished; + unsigned int framesLeft = data->maxFrameIndex - data->frameIndex; + + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + (void) userData; + + if( framesLeft < framesPerBuffer ) + { + /* final buffer... */ + for( i=0; iframeIndex += framesLeft; + finished = paComplete; + } + else + { + for( i=0; iframeIndex += framesPerBuffer; + finished = paContinue; + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters inputParameters, + outputParameters; + PaStream* stream; + PaError err = paNoError; + paTestData data; + int i; + int totalFrames; + int numSamples; + int numBytes; + SAMPLE max, val; + double average; + + printf("patest_record.c\n"); fflush(stdout); + + data.maxFrameIndex = totalFrames = NUM_SECONDS * SAMPLE_RATE; /* Record for a few seconds. */ + data.frameIndex = 0; + numSamples = totalFrames * NUM_CHANNELS; + numBytes = numSamples * sizeof(SAMPLE); + data.recordedSamples = (SAMPLE *) malloc( numBytes ); /* From now on, recordedSamples is initialised. */ + if( data.recordedSamples == NULL ) + { + printf("Could not allocate record array.\n"); + goto done; + } + for( i=0; idefaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + /* Record some audio. -------------------------------------------- */ + err = Pa_OpenStream( + &stream, + &inputParameters, + NULL, /* &outputParameters, */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + recordCallback, + &data ); + if( err != paNoError ) goto done; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto done; + printf("Now recording!!\n"); fflush(stdout); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) + { + Pa_Sleep(1000); + printf("index = %d\n", data.frameIndex ); fflush(stdout); + } + if( err < 0 ) goto done; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto done; + + /* Measure maximum peak amplitude. */ + max = 0; + average = 0.0; + for( i=0; i max ) + { + max = val; + } + average += val; + } + + average = average / (double)numSamples; + + printf("sample max amplitude = "PRINTF_S_FORMAT"\n", max ); + printf("sample average = %lf\n", average ); + + /* Write recorded data to a file. */ +#if 0 + { + FILE *fid; + fid = fopen("recorded.raw", "wb"); + if( fid == NULL ) + { + printf("Could not open file."); + } + else + { + fwrite( data.recordedSamples, NUM_CHANNELS * sizeof(SAMPLE), totalFrames, fid ); + fclose( fid ); + printf("Wrote data to 'recorded.raw'\n"); + } + } +#endif + + /* Playback recorded data. -------------------------------------------- */ + data.frameIndex = 0; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = PA_SAMPLE_TYPE; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + printf("Begin playback.\n"); fflush(stdout); + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + playCallback, + &data ); + if( err != paNoError ) goto done; + + if( stream ) + { + err = Pa_StartStream( stream ); + if( err != paNoError ) goto done; + + printf("Waiting for playback to finish.\n"); fflush(stdout); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(100); + if( err < 0 ) goto done; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto done; + + printf("Done.\n"); fflush(stdout); + } + +done: + Pa_Terminate(); + if( data.recordedSamples ) /* Sure it is NULL or valid. */ + free( data.recordedSamples ); + if( err != paNoError ) + { + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + err = 1; /* Always return 0 or 1, but no other return codes. */ + } + return err; +} + diff --git a/portaudio-v19/pa_tests/patest_ringmix.c b/portaudio-v19/pa_tests/patest_ringmix.c new file mode 100644 index 000000000..1df062388 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_ringmix.c @@ -0,0 +1,79 @@ +/** @file patest_ringmix.c + @brief Ring modulate inputs to left output, mix inputs to right output. +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + + +#include "stdio.h" +#include "portaudio.h" +/* This will be called asynchronously by the PortAudio engine. */ +static int myCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + const float *in = (const float *) inputBuffer; + float *out = (float *) outputBuffer; + float leftInput, rightInput; + unsigned int i; + + /* Read input buffer, process data, and fill output buffer. */ + for( i=0; i +#include +#include "portaudio.h" +#define NUM_SECONDS (4) +#define SAMPLE_RATE (44100) + +typedef struct +{ + float left_phase; + float right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + /* Cast data passed through stream to our structure. */ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + (void) inputBuffer; /* Prevent unused variable warning. */ + + for( i=0; ileft_phase; /* left */ + *out++ = data->right_phase; /* right */ + /* Generate simple sawtooth phaser that ranges between -1.0 and 1.0. */ + data->left_phase += 0.01f; + /* When signal reaches top, drop back down. */ + if( data->left_phase >= 1.0f ) data->left_phase -= 2.0f; + /* higher pitch so we can distinguish left and right. */ + data->right_phase += 0.03f; + if( data->right_phase >= 1.0f ) data->right_phase -= 2.0f; + } + return 0; +} + +/*******************************************************************/ +static paTestData data; +int main(void); +int main(void) +{ + PaStream *stream; + PaError err; + + printf("PortAudio Test: output sawtooth wave.\n"); + /* Initialize our data for use by callback. */ + data.left_phase = data.right_phase = 0.0; + /* Initialize library before making any other calls. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + /* Open an audio I/O stream. */ + err = Pa_OpenDefaultStream( &stream, + 0, /* no input channels */ + 2, /* stereo output */ + paFloat32, /* 32 bit floating point output */ + SAMPLE_RATE, + 256, /* frames per buffer */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + /* Sleep for several seconds. */ + Pa_Sleep(NUM_SECONDS*1000); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_sine.c b/portaudio-v19/pa_tests/patest_sine.c new file mode 100644 index 000000000..c952b5805 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_sine.c @@ -0,0 +1,151 @@ +/** @file patest_sine.c + @brief Play a sine wave for several seconds. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + + (void) timeInfo; /* Prevent unused variable warnings. */ + (void) statusFlags; + (void) inputBuffer; + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + + return paContinue; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); + Pa_Sleep( NUM_SECONDS * 1000 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_sine8.c b/portaudio-v19/pa_tests/patest_sine8.c new file mode 100644 index 000000000..5a9d1fe72 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_sine8.c @@ -0,0 +1,212 @@ +/** @file patest_sine8.c + @brief Test 8 bit data: play a sine wave for several seconds. + @author Ross Bencina +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (8) +#define SAMPLE_RATE (44100) +#define TABLE_SIZE (200) +#define TEST_UNSIGNED (0) + +#if TEST_UNSIGNED +#define TEST_FORMAT paUInt8 +#else +#define TEST_FORMAT paInt8 +#endif + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ +#if TEST_UNSIGNED + unsigned char sine[TABLE_SIZE]; +#else + char sine[TABLE_SIZE]; +#endif + int left_phase; + int right_phase; + unsigned int framesToGo; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + char *out = (char*)outputBuffer; + int i; + int framesToCalc; + int finished = 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + + if( data->framesToGo < framesPerBuffer ) + { + framesToCalc = data->framesToGo; + data->framesToGo = 0; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + data->framesToGo -= framesPerBuffer; + } + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + /* zero remainder of final buffer */ + for( ; i<(int)framesPerBuffer; i++ ) + { +#if TEST_UNSIGNED + *out++ = (unsigned char) 0x80; /* left */ + *out++ = (unsigned char) 0x80; /* right */ +#else + *out++ = 0; /* left */ + *out++ = 0; /* right */ +#endif + + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream* stream; + PaError err; + paTestData data; + PaTime streamOpened; + int i, totalSamps; + +#if TEST_UNSIGNED + printf("PortAudio Test: output UNsigned 8 bit sine wave.\n"); +#else + printf("PortAudio Test: output signed 8 bit sine wave.\n"); +#endif + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, + SAMPLE_RATE, + 256, /* Frames per buffer. */ + paClipOff, /* We won't output out of range samples so don't bother clipping them. */ + patestCallback, + &data ); + if( err != paNoError ) + goto error; + + streamOpened = Pa_GetStreamTime( stream ); /* Time in seconds when stream was opened (approx). */ + + err = Pa_StartStream( stream ); + if( err != paNoError ) + goto error; + + /* Watch until sound is halfway finished. */ + /* (Was ( Pa_StreamTime( stream ) < (totalSamps/2) ) in V18. */ + while( (Pa_GetStreamTime( stream ) - streamOpened) < (PaTime)NUM_SECONDS / 2.0 ) + Pa_Sleep(10); + + /* Stop sound until ENTER hit. (Hu? don't see any keyboard-input here.) */ + err = Pa_StopStream( stream ); + if( err != paNoError ) + goto error; + + printf("Pause for 2 seconds.\n"); + Pa_Sleep( 2000 ); + + err = Pa_StartStream( stream ); + if( err != paNoError ) + goto error; + + printf("Waiting for sound to finish.\n"); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) + Pa_Sleep(100); + if( err < 0 ) + goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) + goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_sine_formats.c b/portaudio-v19/pa_tests/patest_sine_formats.c new file mode 100644 index 000000000..448a4ebe9 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_sine_formats.c @@ -0,0 +1,196 @@ +/** @file patest_sine_formats.c + @brief Play a sine wave for several seconds. Test various data formats. + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (10) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#define LEFT_FREQ (SAMPLE_RATE/256.0) /* So we hit 1.0 */ +#define RIGHT_FREQ (500.0) +#define AMPLITUDE (1.0) + +/* Select ONE format for testing. */ +#define TEST_UINT8 (0) +#define TEST_INT8 (0) +#define TEST_INT16 (1) +#define TEST_FLOAT32 (0) + +#if TEST_UINT8 +#define TEST_FORMAT paUInt8 +typedef unsigned char SAMPLE_t; +#define SAMPLE_ZERO (0x80) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(127.0 * (x))) +#define FORMAT_NAME "Unsigned 8 Bit" + +#elif TEST_INT8 +#define TEST_FORMAT paInt8 +typedef char SAMPLE_t; +#define SAMPLE_ZERO (0) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(127.0 * (x))) +#define FORMAT_NAME "Signed 8 Bit" + +#elif TEST_INT16 +#define TEST_FORMAT paInt16 +typedef short SAMPLE_t; +#define SAMPLE_ZERO (0) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(32767 * (x))) +#define FORMAT_NAME "Signed 16 Bit" + +#elif TEST_FLOAT32 +#define TEST_FORMAT paFloat32 +typedef float SAMPLE_t; +#define SAMPLE_ZERO (0.0) +#define DOUBLE_TO_SAMPLE(x) ((SAMPLE_t)(x)) +#define FORMAT_NAME "Float 32 Bit" +#endif + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + + +typedef struct +{ + double left_phase; + double right_phase; + unsigned int framesToGo; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, + void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE_t *out = (SAMPLE_t *)outputBuffer; + int i; + int framesToCalc; + int finished = 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + + if( data->framesToGo < framesPerBuffer ) + { + framesToCalc = data->framesToGo; + data->framesToGo = 0; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + data->framesToGo -= framesPerBuffer; + } + + for( i=0; ileft_phase += (LEFT_FREQ / SAMPLE_RATE); + if( data->left_phase > 1.0) data->left_phase -= 1.0; + *out++ = DOUBLE_TO_SAMPLE( AMPLITUDE * sin( (data->left_phase * M_PI * 2. ))); + + data->right_phase += (RIGHT_FREQ / SAMPLE_RATE); + if( data->right_phase > 1.0) data->right_phase -= 1.0; + *out++ = DOUBLE_TO_SAMPLE( AMPLITUDE * sin( (data->right_phase * M_PI * 2. ))); + } + /* zero remainder of final buffer */ + for( ; i<(int)framesPerBuffer; i++ ) + { + *out++ = SAMPLE_ZERO; /* left */ + *out++ = SAMPLE_ZERO; /* right */ + } + return finished; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream *stream; + PaStreamParameters outputParameters; + PaError err; + paTestData data; + int totalSamps; + + printf("PortAudio Test: output " FORMAT_NAME "\n"); + + data.left_phase = data.right_phase = 0.0; + data.framesToGo = totalSamps = NUM_SECONDS * SAMPLE_RATE; /* Play for a few seconds. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Default output device. */ + outputParameters.channelCount = 2; /* Stereo output */ + outputParameters.sampleFormat = TEST_FORMAT; /* Selected above. */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, /* As above. */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Waiting %d seconds for sound to finish.\n", NUM_SECONDS ); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(100); + if( err < 0 ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + + printf("PortAudio Test Finished: " FORMAT_NAME "\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_sine_time.c b/portaudio-v19/pa_tests/patest_sine_time.c new file mode 100644 index 000000000..cf45275fe --- /dev/null +++ b/portaudio-v19/pa_tests/patest_sine_time.c @@ -0,0 +1,208 @@ +/** @file patest_sine_time.c + @brief Play a sine wave for several seconds, pausing in the middle. + Uses the Pa_GetStreamTime() call. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include + +#include "portaudio.h" +#include "pa_util.h" + +#define NUM_SECONDS (8) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +#define TABLE_SIZE (200) + +typedef struct +{ + double left_phase; + double right_phase; + volatile PaTime outTime; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + + double left_phaseInc = 0.02; + double right_phaseInc = 0.06; + + double left_phase = data->left_phase; + double right_phase = data->right_phase; + + (void) statusFlags; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + data->outTime = timeInfo->outputBufferDacTime; + + for( i=0; i TWOPI ) left_phase -= TWOPI; + *out++ = (float) sin( left_phase ); + + right_phase += right_phaseInc; + if( right_phase > TWOPI ) right_phase -= TWOPI; + *out++ = (float) sin( right_phase ); + } + + data->left_phase = left_phase; + data->right_phase = right_phase; + + return paContinue; +} + +/*******************************************************************/ +static void ReportStreamTime( PaStream *stream, paTestData *data ); +static void ReportStreamTime( PaStream *stream, paTestData *data ) +{ + PaTime streamTime, latency, outTime; + + streamTime = Pa_GetStreamTime( stream ); + outTime = data->outTime; + if( outTime < 0.0 ) + { + printf("Stream time = %8.1f\n", streamTime ); + } + else + { + latency = outTime - streamTime; + printf("Stream time = %8.4f, outTime = %8.4f, latency = %8.4f\n", + streamTime, outTime, latency ); + } + fflush(stdout); +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + PaTime startTime; + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + data.left_phase = data.right_phase = 0; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + /* Watch until sound is halfway finished. */ + printf("Play for %d seconds.\n", NUM_SECONDS/2 ); fflush(stdout); + + data.outTime = -1.0; /* mark time for callback as undefined */ + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + startTime = Pa_GetStreamTime( stream ); + + do + { + ReportStreamTime( stream, &data ); + Pa_Sleep(100); + } while( (Pa_GetStreamTime( stream ) - startTime) < (NUM_SECONDS/2) ); + + /* Stop sound for 2 seconds. */ + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + printf("Pause for 2 seconds.\n"); fflush(stdout); + Pa_Sleep( 2000 ); + + data.outTime = -1.0; /* mark time for callback as undefined */ + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + startTime = Pa_GetStreamTime( stream ); + + printf("Play until sound is finished.\n"); fflush(stdout); + do + { + ReportStreamTime( stream, &data ); + Pa_Sleep(100); + } while( (Pa_GetStreamTime( stream ) - startTime) < (NUM_SECONDS/2) ); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_start_stop.c b/portaudio-v19/pa_tests/patest_start_stop.c new file mode 100644 index 000000000..03ade1721 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_start_stop.c @@ -0,0 +1,162 @@ +/** @file patest_start_stop.c + @brief Play a sine wave for several seconds + - start and stop the stream multiple times. + + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE Pa_GetDefaultOutputDevice() /* default output device */ + +#define NUM_SECONDS (3) +#define NUM_LOOPS (4) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (400) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + + (void) timeInfo; /* Prevent unused variable warnings. */ + (void) statusFlags; + (void) inputBuffer; + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + + return paContinue; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + for( i=0; i +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDevice()) +#define SLEEP_DUR (200) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#define LATENCY_SECONDS (3.f) +#define FRAMES_PER_NOTE (SAMPLE_RATE/2) +#define MAX_REPEATS (2) +#define FUNDAMENTAL (400.0f / SAMPLE_RATE) +#define NOTE_0 (FUNDAMENTAL * 1.0f / 1.0f) +#define NOTE_1 (FUNDAMENTAL * 5.0f / 4.0f) +#define NOTE_2 (FUNDAMENTAL * 4.0f / 3.0f) +#define NOTE_3 (FUNDAMENTAL * 3.0f / 2.0f) +#define NOTE_4 (FUNDAMENTAL * 2.0f / 1.0f) +#define MODE_FINISH (0) +#define MODE_STOP (1) +#define MODE_ABORT (2) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (400) + +typedef struct +{ + float waveform[TABLE_SIZE + 1]; /* Add one for guard point for interpolation. */ + float phase_increment; + float phase; + float *tune; + int notesPerTune; + int frameCounter; + int noteCounter; + int repeatCounter; + PaTime outTime; + int stopMode; + int done; +} +paTestData; + +/************* Prototypes *****************************/ +int TestStopMode( paTestData *data ); +float LookupWaveform( paTestData *data, float phase ); + +/****************************************************** + * Convert phase between 0.0 and 1.0 to waveform value + * using linear interpolation. + */ +float LookupWaveform( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->waveform[index]; + float hi = data->waveform[index+1]; + float val = lo + fract*(hi-lo); + return val; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float value; + unsigned int i = 0; + int finished = paContinue; + + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + + + /* data->outTime = outTime; */ + + if( !data->done ) + { + for( i=0; iframeCounter >= FRAMES_PER_NOTE ) + { + data->noteCounter += 1; + data->frameCounter = 0; + /* Are we done with this tune? */ + if( data->noteCounter >= data->notesPerTune ) + { + data->noteCounter = 0; + data->repeatCounter += 1; + /* Are we totally done? */ + if( data->repeatCounter >= MAX_REPEATS ) + { + data->done = 1; + if( data->stopMode == MODE_FINISH ) + { + finished = paComplete; + break; + } + } + } + data->phase_increment = data->tune[data->noteCounter]; + } + value = LookupWaveform(data, data->phase); + *out++ = value; /* left */ + *out++ = value; /* right */ + data->phase += data->phase_increment; + if( data->phase >= 1.0f ) data->phase -= 1.0f; + + data->frameCounter += 1; + } + } + /* zero remainder of final buffer */ + for( ; idone = 0; + data->phase = 0.0; + data->frameCounter = 0; + data->noteCounter = 0; + data->repeatCounter = 0; + data->phase_increment = data->tune[data->noteCounter]; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = OUTPUT_DEVICE; + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = LATENCY_SECONDS; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + if( data->stopMode == MODE_FINISH ) + { + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) + { + /*printf("outTime = %g, note# = %d, repeat# = %d\n", data->outTime, + data->noteCounter, data->repeatCounter ); + fflush(stdout); */ + Pa_Sleep( SLEEP_DUR ); + } + if( err < 0 ) goto error; + } + else + { + while( data->repeatCounter < MAX_REPEATS ) + { + /*printf("outTime = %g, note# = %d, repeat# = %d\n", data->outTime, + data->noteCounter, data->repeatCounter ); + fflush(stdout); */ + Pa_Sleep( SLEEP_DUR ); + } + } + + if( data->stopMode == MODE_ABORT ) + { + printf("Call Pa_AbortStream()\n"); + err = Pa_AbortStream( stream ); + } + else + { + printf("Call Pa_StopStream()\n"); + err = Pa_StopStream( stream ); + } + if( err != paNoError ) goto error; + + printf("Call Pa_CloseStream()\n"); fflush(stdout); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_stop_playout.c b/portaudio-v19/pa_tests/patest_stop_playout.c new file mode 100644 index 000000000..41134d581 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_stop_playout.c @@ -0,0 +1,432 @@ +/** @file patest_stop_playout.c + @brief Test whether all queued samples are played when Pa_StopStream() + is used with a callback or read/write stream, or when the callback + returns paComplete. + @author Ross Bencina +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2004 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) + +#define TONE_SECONDS (1) /* long tone */ +#define TONE_FADE_SECONDS (.04) /* fades at start and end of long tone */ +#define GAP_SECONDS (.25) /* gap between long tone and blip */ +#define BLIP_SECONDS (.035) /* short blip */ + +#define NUM_REPEATS (3) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (2048) +typedef struct +{ + float sine[TABLE_SIZE+1]; + + int repeatCount; + + double phase; + double lowIncrement, highIncrement; + + int gap1Length, toneLength, toneFadesLength, gap2Length, blipLength; + int gap1Countdown, toneCountdown, gap2Countdown, blipCountdown; +} +TestData; + + +static void RetriggerTestSignalGenerator( TestData *data ) +{ + data->phase = 0.; + data->gap1Countdown = data->gap1Length; + data->toneCountdown = data->toneLength; + data->gap2Countdown = data->gap2Length; + data->blipCountdown = data->blipLength; +} + + +static void ResetTestSignalGenerator( TestData *data ) +{ + data->repeatCount = 0; + RetriggerTestSignalGenerator( data ); +} + + +static void InitTestSignalGenerator( TestData *data ) +{ + int signalLengthModBufferLength, i; + + /* initialise sinusoidal wavetable */ + for( i=0; isine[i] = (float) sin( ((double)i/(double)TABLE_SIZE) * M_PI * 2. ); + } + data->sine[TABLE_SIZE] = data->sine[0]; /* guard point for linear interpolation */ + + + + data->lowIncrement = (330. / SAMPLE_RATE) * TABLE_SIZE; + data->highIncrement = (1760. / SAMPLE_RATE) * TABLE_SIZE; + + data->gap1Length = GAP_SECONDS * SAMPLE_RATE; + data->toneLength = TONE_SECONDS * SAMPLE_RATE; + data->toneFadesLength = TONE_FADE_SECONDS * SAMPLE_RATE; + data->gap2Length = GAP_SECONDS * SAMPLE_RATE; + data->blipLength = BLIP_SECONDS * SAMPLE_RATE; + + /* adjust signal length to be a multiple of the buffer length */ + signalLengthModBufferLength = (data->gap1Length + data->toneLength + data->gap2Length + data->blipLength) % FRAMES_PER_BUFFER; + if( signalLengthModBufferLength > 0 ) + data->toneLength += signalLengthModBufferLength; + + ResetTestSignalGenerator( data ); +} + + +#define MIN( a, b ) (((a)<(b))?(a):(b)) + +static void GenerateTestSignal( TestData *data, float *stereo, int frameCount ) +{ + int framesGenerated = 0; + float output; + long index; + float fraction; + int count, i; + + while( framesGenerated < frameCount && data->repeatCount < NUM_REPEATS ) + { + if( framesGenerated < frameCount && data->gap1Countdown > 0 ){ + count = MIN( frameCount - framesGenerated, data->gap1Countdown ); + for( i=0; i < count; ++i ) + { + *stereo++ = 0.f; + *stereo++ = 0.f; + } + + data->gap1Countdown -= count; + framesGenerated += count; + } + + if( framesGenerated < frameCount && data->toneCountdown > 0 ){ + count = MIN( frameCount - framesGenerated, data->toneCountdown ); + for( i=0; i < count; ++i ) + { + /* tone with data->lowIncrement phase increment */ + index = (long)data->phase; + fraction = data->phase - index; + output = data->sine[ index ] + (data->sine[ index + 1 ] - data->sine[ index ]) * fraction; + + data->phase += data->lowIncrement; + while( data->phase >= TABLE_SIZE ) + data->phase -= TABLE_SIZE; + + /* apply fade to ends */ + + if( data->toneCountdown < data->toneFadesLength ) + { + /* cosine-bell fade out at end */ + output *= (-cos(((float)data->toneCountdown / (float)data->toneFadesLength) * M_PI) + 1.) * .5; + } + else if( data->toneCountdown > data->toneLength - data->toneFadesLength ) + { + /* cosine-bell fade in at start */ + output *= (cos(((float)(data->toneCountdown - (data->toneLength - data->toneFadesLength)) / (float)data->toneFadesLength) * M_PI) + 1.) * .5; + } + + output *= .5; /* play tone half as loud as blip */ + + *stereo++ = output; + *stereo++ = output; + + data->toneCountdown--; + } + + framesGenerated += count; + } + + if( framesGenerated < frameCount && data->gap2Countdown > 0 ){ + count = MIN( frameCount - framesGenerated, data->gap2Countdown ); + for( i=0; i < count; ++i ) + { + *stereo++ = 0.f; + *stereo++ = 0.f; + } + + data->gap2Countdown -= count; + framesGenerated += count; + } + + if( framesGenerated < frameCount && data->blipCountdown > 0 ){ + count = MIN( frameCount - framesGenerated, data->blipCountdown ); + for( i=0; i < count; ++i ) + { + /* tone with data->highIncrement phase increment */ + index = (long)data->phase; + fraction = data->phase - index; + output = data->sine[ index ] + (data->sine[ index + 1 ] - data->sine[ index ]) * fraction; + + data->phase += data->highIncrement; + while( data->phase >= TABLE_SIZE ) + data->phase -= TABLE_SIZE; + + /* cosine-bell envelope over whole blip */ + output *= (-cos( ((float)data->blipCountdown / (float)data->blipLength) * 2. * M_PI) + 1.) * .5; + + *stereo++ = output; + *stereo++ = output; + + data->blipCountdown--; + } + + framesGenerated += count; + } + + + if( data->blipCountdown == 0 ) + { + RetriggerTestSignalGenerator( data ); + data->repeatCount++; + } + } + + if( framesGenerated < frameCount ) + { + count = frameCount - framesGenerated; + for( i=0; i < count; ++i ) + { + *stereo++ = 0.f; + *stereo++ = 0.f; + } + } +} + + +static int IsTestSignalFinished( TestData *data ) +{ + if( data->repeatCount >= NUM_REPEATS ) + return 1; + else + return 0; +} + + +static int TestCallback1( const void *inputBuffer, void *outputBuffer, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + + GenerateTestSignal( (TestData*)userData, (float*)outputBuffer, frameCount ); + + if( IsTestSignalFinished( (TestData*)userData ) ) + return paComplete; + else + return paContinue; +} + + +volatile int testCallback2Finished = 0; + +static int TestCallback2( const void *inputBuffer, void *outputBuffer, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + + GenerateTestSignal( (TestData*)userData, (float*)outputBuffer, frameCount ); + + if( IsTestSignalFinished( (TestData*)userData ) ) + testCallback2Finished = 1; + + return paContinue; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + TestData data; + float writeBuffer[ FRAMES_PER_BUFFER * 2 ]; + + printf("PortAudio Test: check that stopping stream plays out all queued samples. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + InitTestSignalGenerator( &data ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + +/* test paComplete ---------------------------------------------------------- */ + + ResetTestSignalGenerator( &data ); + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + TestCallback1, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + + printf("\nPlaying 'tone-blip' %d times using callback, stops by returning paComplete from callback.\n", NUM_REPEATS ); + printf("If final blip is not intact, callback+paComplete implementation may be faulty.\n\n" ); + + while( (err = Pa_IsStreamActive( stream )) == 1 ) + Pa_Sleep( 5 ); + + if( err != 0 ) goto error; + + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Sleep( 500 ); + +/* test Pa_StopStream() with callback --------------------------------------- */ + + ResetTestSignalGenerator( &data ); + + testCallback2Finished = 0; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + TestCallback2, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + + printf("\nPlaying 'tone-blip' %d times using callback, stops by calling Pa_StopStream.\n", NUM_REPEATS ); + printf("If final blip is not intact, callback+Pa_StopStream implementation may be faulty.\n\n" ); + + /* note that polling a volatile flag is not a good way to synchronise with + the callback, but it's the best we can do portably. */ + while( !testCallback2Finished ) + Pa_Sleep( 2 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Sleep( 500 ); + +/* test Pa_StopStream() with Pa_WriteStream --------------------------------- */ + + ResetTestSignalGenerator( &data ); + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + + printf("\nPlaying 'tone-blip' %d times using Pa_WriteStream, stops by calling Pa_StopStream.\n", NUM_REPEATS ); + printf("If final blip is not intact, Pa_WriteStream+Pa_StopStream implementation may be faulty.\n\n" ); + + do{ + GenerateTestSignal( &data, writeBuffer, FRAMES_PER_BUFFER ); + err = Pa_WriteStream( stream, writeBuffer, FRAMES_PER_BUFFER ); + if( err != paNoError ) goto error; + + }while( !IsTestSignalFinished( &data ) ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + +/* -------------------------------------------------------------------------- */ + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_sync.c b/portaudio-v19/pa_tests/patest_sync.c new file mode 100644 index 000000000..01e471420 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_sync.c @@ -0,0 +1,259 @@ +/** @file patest_sync.c + @brief Test time stamping and synchronization of audio and video. + + A high latency is used so we can hear the difference in time. + Random durations are used so we know we are hearing the right beep + and not the one before or after. + + Sequence of events: + -# Foreground requests a beep. + -# Background randomly schedules a beep. + -# Foreground waits for the beep to be heard based on PaUtil_GetTime(). + -# Foreground outputs video (printf) in sync with audio. + -# Repeat. + + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#include "pa_util.h" +#define NUM_BEEPS (6) +#define SAMPLE_RATE (44100) +#define SAMPLE_PERIOD (1.0/44100.0) +#define FRAMES_PER_BUFFER (256) +#define BEEP_DURATION (400) +#define LATENCY_MSEC (2000) +#define SLEEP_MSEC (10) +#define TIMEOUT_MSEC (15000) + +#define STATE_BKG_IDLE (0) +#define STATE_BKG_PENDING (1) +#define STATE_BKG_BEEPING (2) +typedef struct +{ + float left_phase; + float right_phase; + int state; + int requestBeep; /* Set by foreground, cleared by background. */ + PaTime beepTime; + int beepCount; + double latency; /* For debugging. */ +} +paTestData; + +static unsigned long GenerateRandomNumber( void ); +/************************************************************/ +/* Calculate pseudo-random 32 bit number based on linear congruential method. */ +static unsigned long GenerateRandomNumber( void ) +{ + static unsigned long randSeed = 99887766; /* Change this for different random sequences. */ + randSeed = (randSeed * 196314165) + 907633515; + return randSeed; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo, + PaStreamCallbackFlags statusFlags, void *userData ) +{ + /* Cast data passed through stream to our structure. */ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + (void) inputBuffer; + + data->latency = timeInfo->outputBufferDacTime - timeInfo->currentTime; + + for( i=0; istate ) + { + case STATE_BKG_IDLE: + /* Schedule beep at some random time in the future. */ + if( data->requestBeep ) + { + int random = GenerateRandomNumber() >> 14; + data->beepTime = timeInfo->outputBufferDacTime + (( (double)(random + SAMPLE_RATE)) * SAMPLE_PERIOD ); + data->state = STATE_BKG_PENDING; + } + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + break; + + case STATE_BKG_PENDING: + if( (timeInfo->outputBufferDacTime + (i*SAMPLE_PERIOD)) >= data->beepTime ) + { + data->state = STATE_BKG_BEEPING; + data->beepCount = BEEP_DURATION; + data->left_phase = data->right_phase = 0.0; + } + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + break; + + case STATE_BKG_BEEPING: + if( data->beepCount <= 0 ) + { + data->state = STATE_BKG_IDLE; + data->requestBeep = 0; + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + } + else + { + /* Play sawtooth wave. */ + *out++ = data->left_phase; /* left */ + *out++ = data->right_phase; /* right */ + /* Generate simple sawtooth phaser that ranges between -1.0 and 1.0. */ + data->left_phase += 0.01f; + /* When signal reaches top, drop back down. */ + if( data->left_phase >= 1.0f ) data->left_phase -= 2.0f; + /* higher pitch so we can distinguish left and right. */ + data->right_phase += 0.03f; + if( data->right_phase >= 1.0f ) data->right_phase -= 2.0f; + } + data->beepCount -= 1; + break; + + default: + data->state = STATE_BKG_IDLE; + break; + } + } + return 0; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream *stream; + PaError err; + paTestData DATA; + int i, timeout; + PaTime previousTime; + PaStreamParameters outputParameters; + printf("PortAudio Test: you should see BEEP at the same time you hear it.\n"); + printf("Wait for a few seconds random delay between BEEPs.\n"); + printf("BEEP %d times.\n", NUM_BEEPS ); + /* Initialize our DATA for use by callback. */ + DATA.left_phase = DATA.right_phase = 0.0; + DATA.state = STATE_BKG_IDLE; + DATA.requestBeep = 0; + /* Initialize library before making any other calls. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); + outputParameters.channelCount = 2; + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.sampleFormat = paFloat32; + outputParameters.suggestedLatency = (double)LATENCY_MSEC / 1000; + + /* Open an audio I/O stream. */ + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &DATA ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("started\n"); + fflush(stdout); + + previousTime = Pa_GetStreamTime( stream ); + for( i=0; i 0 ) ) Pa_Sleep(SLEEP_MSEC); + if( timeout <= 0 ) + { + fprintf( stderr, "Timed out waiting for background to acknowledge request.\n" ); + goto error; + } + printf("calc beep for %9.3f, latency = %6.3f\n", DATA.beepTime, DATA.latency ); + fflush(stdout); + + /* Wait for scheduled beep time. */ + timeout = TIMEOUT_MSEC + (10000/SLEEP_MSEC); + while( (Pa_GetStreamTime( stream ) < DATA.beepTime) && (timeout-- > 0 ) ) + { + Pa_Sleep(SLEEP_MSEC); + } + if( timeout <= 0 ) + { + fprintf( stderr, "Timed out waiting for time. Now = %9.3f, Beep for %9.3f.\n", + PaUtil_GetTime(), DATA.beepTime ); + goto error; + } + + /* Beep should be sounding now so print synchronized BEEP. */ + printf("hear \"BEEP\" at %9.3f, delta = %9.3f\n", + Pa_GetStreamTime( stream ), (DATA.beepTime - previousTime) ); + fflush(stdout); + + previousTime = DATA.beepTime; + } + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_toomanysines.c b/portaudio-v19/pa_tests/patest_toomanysines.c new file mode 100644 index 000000000..b7b22667c --- /dev/null +++ b/portaudio-v19/pa_tests/patest_toomanysines.c @@ -0,0 +1,173 @@ +/** @file patest_toomanysines.c + @brief Play more sine waves than we can handle in real time as a stress test. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define MAX_SINES (500) +#define MAX_LOAD (1.2) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +typedef struct paTestData +{ + int numSines; + double phases[MAX_SINES]; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int j; + int finished = 0; + (void) inputBuffer; /* Prevent unused variable warning. */ + + for( i=0; inumSines; j++ ) + { + /* Advance phase of next oscillator. */ + phase = data->phases[j]; + phase += phaseInc; + if( phase > TWOPI ) phase -= TWOPI; + + phaseInc *= 1.02; + if( phaseInc > 0.5 ) phaseInc *= 0.5; + + /* This is not a very efficient way to calc sines. */ + output += (float) sin( phase ); + data->phases[j] = phase; + } + *out++ = (float) (output / data->numSines); + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + int numStress; + paTestData data = {0}; + double load; + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d. MAX_LOAD = %f\n", + SAMPLE_RATE, FRAMES_PER_BUFFER, MAX_LOAD ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 1; /* mono output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + /* Determine number of sines required to get to 50% */ + do + { + data.numSines++; + Pa_Sleep( 100 ); + + load = Pa_GetStreamCpuLoad( stream ); + printf("numSines = %d, CPU load = %f\n", data.numSines, load ); + } + while( load < 0.5 ); + + /* Calculate target stress value then ramp up to that level*/ + numStress = (int) (2.0 * data.numSines * MAX_LOAD ); + for( ; data.numSines < numStress; data.numSines++ ) + { + Pa_Sleep( 200 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("STRESSING: numSines = %d, CPU load = %f\n", data.numSines, load ); + } + + printf("Suffer for 5 seconds.\n"); + Pa_Sleep( 5000 ); + + printf("Stop stream.\n"); + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_two_rates.c b/portaudio-v19/pa_tests/patest_two_rates.c new file mode 100644 index 000000000..99532411f --- /dev/null +++ b/portaudio-v19/pa_tests/patest_two_rates.c @@ -0,0 +1,168 @@ +/* + * $Id$ + * patest_two_rates.c + * Play two streams at different rates to make sure they don't interfere. + * + * Author: Phil Burk http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +#define SAMPLE_RATE_1 (44100) +#define SAMPLE_RATE_2 (44100) +#define FRAMES_PER_BUFFER (256) +#define FREQ_INCR (0.1) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ + double phase; + double numFrames; +} paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int frameIndex, channelIndex; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + /* Generate sine wave. */ + float value = (float) 0.3 * sin(data->phase); + /* Stereo - two channels. */ + *out++ = value; + *out++ = value; + + data->phase += FREQ_INCR; + if( data->phase >= (2.0 * M_PI) ) data->phase -= (2.0 * M_PI); + } + + return 0; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + PortAudioStream *stream1; + PortAudioStream *stream2; + paTestData data1 = {0}; + paTestData data2 = {0}; + printf("PortAudio Test: two rates.\n" ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + /* Start first stream. **********************/ + err = Pa_OpenStream( + &stream1, + paNoDevice, /* default input device */ + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + 2, /* Stereo */ + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE_1, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data1 ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream1 ); + if( err != paNoError ) goto error; + + Pa_Sleep( 3 * 1000 ); + + /* Start second stream. **********************/ + err = Pa_OpenStream( + &stream2, + paNoDevice, /* default input device */ + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + 2, /* Stereo */ + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE_2, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data2 ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream2 ); + if( err != paNoError ) goto error; + + Pa_Sleep( 3 * 1000 ); + + err = Pa_StopStream( stream2 ); + if( err != paNoError ) goto error; + + Pa_Sleep( 3 * 1000 ); + + err = Pa_StopStream( stream1 ); + if( err != paNoError ) goto error; + + Pa_CloseStream( stream2 ); + Pa_CloseStream( stream1 ); + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_underflow.c b/portaudio-v19/pa_tests/patest_underflow.c new file mode 100644 index 000000000..7ff3de6a4 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_underflow.c @@ -0,0 +1,151 @@ +/** @file patest_underflow.c + @brief Simulate an output buffer underflow condition. + Tests whether the stream can be stopped when underflowing buffers. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (20) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (2048) +#define MSEC_PER_BUFFER ( (FRAMES_PER_BUFFER * 1000) / SAMPLE_RATE ) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; + int sleepTime; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + + /* Cause underflow to occur. */ + if( data->sleepTime > 0 ) Pa_Sleep( data->sleepTime ); + data->sleepTime += 1; + + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + while( data.sleepTime < (2 * MSEC_PER_BUFFER) ) + { + printf("SleepTime = %d\n", data.sleepTime ); + Pa_Sleep( data.sleepTime ); + } + + printf("Try to stop stream.\n"); + err = Pa_StopStream( stream ); /* */ + err = Pa_AbortStream( stream ); /* */ + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_tests/patest_wire.c b/portaudio-v19/pa_tests/patest_wire.c new file mode 100644 index 000000000..d83ce22d6 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_wire.c @@ -0,0 +1,284 @@ +/** @file patest_wire.c + @brief Pass input directly to output. + + Note that some HW devices, for example many ISA audio cards + on PCs, do NOT support full duplex! For a PC, you normally need + a PCI based audio card such as the SBLive. + + @author Phil Burk http://www.softsynth.com + + While adapting to V19-API, I excluded configs with framesPerCallback=0 + because of an assert in file pa_common/pa_process.c. Pieter, Oct 9, 2003. + +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define SAMPLE_RATE (44100) + +typedef struct WireConfig_s +{ + int isInputInterleaved; + int isOutputInterleaved; + int numInputChannels; + int numOutputChannels; + int framesPerCallback; +} WireConfig_t; + +#define USE_FLOAT_INPUT (1) +#define USE_FLOAT_OUTPUT (1) + +/* Latencies set to defaults. */ + +#if USE_FLOAT_INPUT + #define INPUT_FORMAT paFloat32 + typedef float INPUT_SAMPLE; +#else + #define INPUT_FORMAT paInt16 + typedef short INPUT_SAMPLE; +#endif + +#if USE_FLOAT_OUTPUT + #define OUTPUT_FORMAT paFloat32 + typedef float OUTPUT_SAMPLE; +#else + #define OUTPUT_FORMAT paInt16 + typedef short OUTPUT_SAMPLE; +#endif + +double gInOutScaler = 1.0; +#define CONVERT_IN_TO_OUT(in) ((OUTPUT_SAMPLE) ((in) * gInOutScaler)) + +#define INPUT_DEVICE (Pa_GetDefaultInputDevice()) +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDevice()) + +static PaError TestConfiguration( WireConfig_t *config ); + +static int wireCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ + +static int wireCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + INPUT_SAMPLE *in; + OUTPUT_SAMPLE *out; + int inStride; + int outStride; + int inDone = 0; + int outDone = 0; + WireConfig_t *config = (WireConfig_t *) userData; + unsigned int i; + int inChannel, outChannel; + + /* This may get called with NULL inputBuffer during initial setup. */ + if( inputBuffer == NULL) return 0; + + inChannel=0, outChannel=0; + while( !(inDone && outDone) ) + { + if( config->isInputInterleaved ) + { + in = ((INPUT_SAMPLE*)inputBuffer) + inChannel; + inStride = config->numInputChannels; + } + else + { + in = ((INPUT_SAMPLE**)inputBuffer)[inChannel]; + inStride = 1; + } + + if( config->isOutputInterleaved ) + { + out = ((OUTPUT_SAMPLE*)outputBuffer) + outChannel; + outStride = config->numOutputChannels; + } + else + { + out = ((OUTPUT_SAMPLE**)outputBuffer)[outChannel]; + outStride = 1; + } + + for( i=0; inumInputChannels - 1)) inChannel++; + else inDone = 1; + if(outChannel < (config->numOutputChannels - 1)) outChannel++; + else outDone = 1; + } + return 0; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + WireConfig_t CONFIG; + WireConfig_t *config = &CONFIG; + int configIndex = 0;; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + printf("Please connect audio signal to input and listen for it on output!\n"); + printf("input format = %lu\n", INPUT_FORMAT ); + printf("output format = %lu\n", OUTPUT_FORMAT ); + printf("input device ID = %d\n", INPUT_DEVICE ); + printf("output device ID = %d\n", OUTPUT_DEVICE ); + + if( INPUT_FORMAT == OUTPUT_FORMAT ) + { + gInOutScaler = 1.0; + } + else if( (INPUT_FORMAT == paInt16) && (OUTPUT_FORMAT == paFloat32) ) + { + gInOutScaler = 1.0/32768.0; + } + else if( (INPUT_FORMAT == paFloat32) && (OUTPUT_FORMAT == paInt16) ) + { + gInOutScaler = 32768.0; + } + + for( config->isInputInterleaved = 0; config->isInputInterleaved < 2; config->isInputInterleaved++ ) + { + for( config->isOutputInterleaved = 0; config->isOutputInterleaved < 2; config->isOutputInterleaved++ ) + { + for( config->numInputChannels = 1; config->numInputChannels < 3; config->numInputChannels++ ) + { + for( config->numOutputChannels = 1; config->numOutputChannels < 3; config->numOutputChannels++ ) + { + /* If framesPerCallback = 0, assertion fails in file pa_common/pa_process.c, line 1413: EX. */ + for( config->framesPerCallback = 64; config->framesPerCallback < 129; config->framesPerCallback += 64 ) + { + printf("-----------------------------------------------\n" ); + printf("Configuration #%d\n", configIndex++ ); + err = TestConfiguration( config ); + /* Give user a chance to bail out. */ + if( err == 1 ) + { + err = paNoError; + goto done; + } + else if( err != paNoError ) goto error; + } + } + } + } + } + +done: + Pa_Terminate(); + printf("Full duplex sound test complete.\n"); fflush(stdout); + printf("Hit ENTER to quit.\n"); fflush(stdout); + getchar(); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + printf("Hit ENTER to quit.\n"); fflush(stdout); + getchar(); + return -1; +} + +static PaError TestConfiguration( WireConfig_t *config ) +{ + int c; + PaError err; + PaStream *stream; + PaStreamParameters inputParameters, outputParameters; + + printf("input %sinterleaved!\n", (config->isInputInterleaved ? " " : "NOT ") ); + printf("output %sinterleaved!\n", (config->isOutputInterleaved ? " " : "NOT ") ); + printf("input channels = %d\n", config->numInputChannels ); + printf("output channels = %d\n", config->numOutputChannels ); + printf("framesPerCallback = %d\n", config->framesPerCallback ); + + inputParameters.device = INPUT_DEVICE; /* default input device */ + inputParameters.channelCount = config->numInputChannels; + inputParameters.sampleFormat = INPUT_FORMAT | (config->isInputInterleaved ? 0 : paNonInterleaved); + inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = OUTPUT_DEVICE; /* default output device */ + outputParameters.channelCount = config->numOutputChannels; + outputParameters.sampleFormat = OUTPUT_FORMAT | (config->isOutputInterleaved ? 0 : paNonInterleaved); + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + &inputParameters, + &outputParameters, + SAMPLE_RATE, + config->framesPerCallback, /* frames per buffer */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + wireCallback, + config ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Hit ENTER for next configuration, or 'q' to quit.\n"); fflush(stdout); + c = getchar(); + + printf("Closing stream.\n"); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + if( c == 'q' ) return 1; + +error: + return err; +} diff --git a/portaudio-v19/pa_tests/patest_write_sine.c b/portaudio-v19/pa_tests/patest_write_sine.c new file mode 100644 index 000000000..f0fcba0b6 --- /dev/null +++ b/portaudio-v19/pa_tests/patest_write_sine.c @@ -0,0 +1,147 @@ +/** @file patest_write_sine.c + @brief Play a sine wave for several seconds using the blocking API (Pa_WriteStream()) + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) + + +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + float buffer[FRAMES_PER_BUFFER][2]; /* stereo output buffer */ + float sine[TABLE_SIZE]; /* sine wavetable */ + int left_phase = 0; + int right_phase = 0; + int left_inc = 1; + int right_inc = 3; /* higher pitch so we can distinguish left and right. */ + int i, j, k; + int bufferCount; + + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + + printf( "Play 3 times, higher each time.\n" ); + + for( k=0; k < 3; ++k ) + { + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); + + bufferCount = ((NUM_SECONDS * SAMPLE_RATE) / FRAMES_PER_BUFFER); + + for( i=0; i < bufferCount; i++ ) + { + for( j=0; j < FRAMES_PER_BUFFER; j++ ) + { + buffer[j][0] = sine[left_phase]; /* left */ + buffer[j][1] = sine[right_phase]; /* right */ + left_phase += left_inc; + if( left_phase >= TABLE_SIZE ) left_phase -= TABLE_SIZE; + right_phase += right_inc; + if( right_phase >= TABLE_SIZE ) right_phase -= TABLE_SIZE; + } + + err = Pa_WriteStream( stream, buffer, FRAMES_PER_BUFFER ); + if( err != paNoError ) goto error; + } + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + ++left_inc; + ++right_inc; + + Pa_Sleep( 1000 ); + } + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/pa_unix/pa_unix_hostapis.c b/portaudio-v19/pa_unix/pa_unix_hostapis.c new file mode 100644 index 000000000..570f596e7 --- /dev/null +++ b/portaudio-v19/pa_unix/pa_unix_hostapis.c @@ -0,0 +1,64 @@ +/* + * $Id$ + * Portable Audio I/O Library UNIX initialization table + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + + +#include "pa_hostapi.h" + +PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaAlsa_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaOSS_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +/* Added for IRIX, Pieter, oct 2, 2003: */ +PaError PaSGI_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + + +PaUtilHostApiInitializer *paHostApiInitializers[] = + { +#ifdef PA_USE_OSS + PaOSS_Initialize, +#endif + +#ifdef PA_USE_ALSA + PaAlsa_Initialize, +#endif + +#ifdef PA_USE_JACK + PaJack_Initialize, +#endif + /* Added for IRIX, Pieter, oct 2, 2003: */ +#ifdef PA_USE_SGI + PaSGI_Initialize, +#endif + 0 /* NULL terminated array */ + }; + +int paDefaultHostApiIndex = 0; + + diff --git a/portaudio-v19/pa_unix/pa_unix_util.c b/portaudio-v19/pa_unix/pa_unix_util.c new file mode 100644 index 000000000..0aa2d0c65 --- /dev/null +++ b/portaudio-v19/pa_unix/pa_unix_util.c @@ -0,0 +1,192 @@ +/* + * $Id$ + * Portable Audio I/O Library + * UNIX platform-specific support functions + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2000 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + + +#include +#include +#include +#include +#include +#include +#include /* For memset */ + +#include "pa_util.h" +#include "pa_unix_util.h" + +/* + Track memory allocations to avoid leaks. + */ + +#if PA_TRACK_MEMORY +static int numAllocations_ = 0; +#endif + + +void *PaUtil_AllocateMemory( long size ) +{ + void *result = malloc( size ); + +#if PA_TRACK_MEMORY + if( result != NULL ) numAllocations_ += 1; +#endif + return result; +} + + +void PaUtil_FreeMemory( void *block ) +{ + if( block != NULL ) + { + free( block ); +#if PA_TRACK_MEMORY + numAllocations_ -= 1; +#endif + + } +} + + +int PaUtil_CountCurrentlyAllocatedBlocks( void ) +{ +#if PA_TRACK_MEMORY + return numAllocations_; +#else + return 0; +#endif +} + + +void Pa_Sleep( long msec ) +{ +#ifdef HAVE_NANOSLEEP + struct timespec req = {0}, rem = {0}; + PaTime time = msec / 1.e3; + req.tv_sec = (time_t)time; + assert(time - req.tv_sec < 1.0); + req.tv_nsec = (long)((time - req.tv_sec) * 1.e9); + nanosleep(&req, &rem); + /* XXX: Try sleeping the remaining time (contained in rem) if interrupted by a signal? */ +#else + while( msec > 999 ) /* For OpenBSD and IRIX, argument */ + { /* to usleep must be < 1000000. */ + usleep( 999000 ); + msec -= 999; + } + usleep( msec * 1000 ); +#endif +} + +/* *** NOT USED YET: *** +static int usePerformanceCounter_; +static double microsecondsPerTick_; +*/ + +void PaUtil_InitializeClock( void ) +{ + /* TODO */ +} + + +PaTime PaUtil_GetTime( void ) +{ +#ifdef HAVE_CLOCK_GETTIME + struct timespec tp; + clock_gettime(CLOCK_REALTIME, &tp); + return (PaTime)(tp.tv_sec + tp.tv_nsec / 1.e9); +#else + struct timeval tv; + gettimeofday( &tv, NULL ); + return (PaTime) tv.tv_usec / 1000000. + tv.tv_sec; +#endif +} + +PaError PaUtil_InitializeThreading( PaUtilThreading *threading ) +{ + (void) paUtilErr_; + return paNoError; +} + +void PaUtil_TerminateThreading( PaUtilThreading *threading ) +{ +} + +PaError PaUtil_StartThreading( PaUtilThreading *threading, void *(*threadRoutine)(void *), void *data ) +{ + pthread_create( &threading->callbackThread, NULL, threadRoutine, data ); + return paNoError; +} + +PaError PaUtil_CancelThreading( PaUtilThreading *threading, int wait, PaError *exitResult ) +{ + PaError result = paNoError; + void *pret; + + if( exitResult ) + *exitResult = paNoError; + + /* Only kill the thread if it isn't in the process of stopping (flushing adaptation buffers) */ + if( !wait ) + pthread_cancel( threading->callbackThread ); /* XXX: Safe to call this if the thread has exited on its own? */ + pthread_join( threading->callbackThread, &pret ); + +#ifdef PTHREAD_CANCELED + if( pret && PTHREAD_CANCELED != pret ) +#else + /* !wait means the thread may have been canceled */ + if( pret && wait ) +#endif + { + if( exitResult ) + *exitResult = *(PaError *) pret; + free( pret ); + } + + return result; +} + +/* +static void *CanaryFunc( void *userData ) +{ + const unsigned intervalMsec = 1000; + PaUtilThreading *th = (PaUtilThreading *) userData; + + while( 1 ) + { + th->canaryTime = PaUtil_GetTime(); + + pthread_testcancel(); + Pa_Sleep( intervalMsec ); + } + + pthread_exit( NULL ); +} +*/ diff --git a/portaudio-v19/pa_unix/pa_unix_util.h b/portaudio-v19/pa_unix/pa_unix_util.h new file mode 100644 index 000000000..01dda01e5 --- /dev/null +++ b/portaudio-v19/pa_unix/pa_unix_util.h @@ -0,0 +1,73 @@ +#ifndef PA_UNIX_UTIL_H +#define PA_UNIX_UTIL_H + +#include "pa_cpuload.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#define PA_MIN(x,y) ( (x) < (y) ? (x) : (y) ) +#define PA_MAX(x,y) ( (x) > (y) ? (x) : (y) ) + +/* Utilize GCC branch prediction for error tests */ +#if defined __GNUC__ && __GNUC__ >= 3 +#define UNLIKELY(expr) __builtin_expect( (expr), 0 ) +#else +#define UNLIKELY(expr) (expr) +#endif + +#define STRINGIZE_HELPER(expr) #expr +#define STRINGIZE(expr) STRINGIZE_HELPER(expr) + +#define PA_UNLESS(expr, code) \ + do { \ + if( UNLIKELY( (expr) == 0 ) ) \ + { \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = (code); \ + goto error; \ + } \ + } while (0); + +static PaError paUtilErr_; /* Used with PA_ENSURE */ + +/* Check PaError */ +#define PA_ENSURE(expr) \ + do { \ + if( UNLIKELY( (paUtilErr_ = (expr)) < paNoError ) ) \ + { \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = paUtilErr_; \ + goto error; \ + } \ + } while (0); + +typedef struct { + pthread_t callbackThread; +} PaUtilThreading; + +PaError PaUtil_InitializeThreading( PaUtilThreading *threading ); +void PaUtil_TerminateThreading( PaUtilThreading *threading ); +PaError PaUtil_StartThreading( PaUtilThreading *threading, void *(*threadRoutine)(void *), void *data ); +PaError PaUtil_CancelThreading( PaUtilThreading *threading, int wait, PaError *exitResult ); + +/* State accessed by utility functions */ + +/* +void PaUnix_SetRealtimeScheduling( int rt ); + +void PaUtil_InitializeThreading( PaUtilThreading *th, PaUtilCpuLoadMeasurer *clm ); + +PaError PaUtil_CreateCallbackThread( PaUtilThreading *th, void *(*CallbackThreadFunc)( void * ), PaStream *s ); + +PaError PaUtil_KillCallbackThread( PaUtilThreading *th, PaError *exitResult ); + +void PaUtil_CallbackUpdate( PaUtilThreading *th ); +*/ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif diff --git a/portaudio-v19/pa_unix_oss/low_latency_tip.txt b/portaudio-v19/pa_unix_oss/low_latency_tip.txt new file mode 100644 index 0000000000000000000000000000000000000000..2d982b79baa6d943c1fae0c7122d190ebf46c6f4 GIT binary patch literal 3111 zcmb_e+in}l5zX^_MZtMka>JV_VPg}vVpflr&clN4ctL+YE&U7Sw$Nrvj#V9W!?cY$ zC`VjAku{{~Rhz%cu2sOcwF=P{YCodiN5gbJ8_|3=JEPZ&vp2N-oMqY46z(6RY;Pke z$K-9jli>L7sC9Nzb3>tG>YT;nPVE#zLoZ2p=y`+zuucjt4j znzm*?BwZ#ng2H1zTe6N`Z2Ruw#V&fWO%hDt8*A(&%LaudV*{1eZ3Uktl?S~8iB!hA z4iV=)QKv(NT|$s>@^F8*`uOqY?g59#vK(duiF%}_blL|h_!Ov5SQ!vkvB4hHI>iZ2 zZ@277mB=AIxn5q8_F3z=)O8I;2cDTWT-$Cq%(8oM2{3g{TfO6yivs4LYSN~S3BQd& zKGjIU5>{Id9SD$XKA8uE-U#Q32C}f&fTs)xe=|im9A&2K=wb4PVT7OkZGbtoAj*?b3 z)&=B4jfFNtg;*&23oUg{2ObQGF6fD#vlGlxpq}xv04oqiA>>-9I+1$hd6NAJRRvpk z09K`fJ+qKO;cSaH9tlIqH4n~)^h-u!y#lAcIIx8CX?cBxmn}P}sCj^`ACfMx5>^mA z&l|Ari2eB?2|Sb@FaMThtMVjLMJW7{eR^bPxF!)&tM;S8r^KAiAH}7*pz{}%)#9(Vj-Ggjm=Su)t=X{?UG_?nC7T#B#1!kJEZ|m7JR8qb zB&W=lX?eR`eLn-j=A5*XT1g-+ikZoEJmA5EC6 zRslDV-6O`az2ZDbyKe=hHX!}DzTlP(*gDAP6jnrvo;Q*zkZOD0q~9Kz3t5N|ZbF`Z zkH*;GM0gMlc9f;zgzr@d?P5CZx^7Zy6Q2@A1@9*4fJB1tlf`gB-}pgZ(=xT|Yj9oL zwt+e@Jmlw#kts96Y>^q0#>=R8k+T><*(G6x44v`pyYc)D&CeF+ujw~4JQ~rzO-h+D z{SIuxw)J{?>(KV#S0tO-OFwR;%D)z5GATU$E-g=g?!n_X9uukAhiZaH_+3#2I!Kh` zC$tz3`^S=DiQX(qNc3x)hkCI7@%rlihllI+PY>&x``f$a$ImxE-Ve#gJjcwFwi_x$ z*r_@KlS&1~fwQNx*=+V(8ery2YaM?`=!B@D7)F$Fsw-OiB`hipywcl>a8ro*2Yqdr z@|u-{As|nkv*=}X=+8c4On9hG@FIeiT))Lk{ZQHf-KH%aI6sh~q5O)B3ir8h8i1`NFBGL+-OowG}5Ic&Q9Z3qTP8RN+1(124i>TSCJz5w|)W&`}Qe zslm +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __FreeBSD__ +# include +# include +# define DEVICE_NAME_BASE "/dev/dsp" +#elif defined __linux__ +#include +#include +# include +# define DEVICE_NAME_BASE "/dev/dsp" +#else +# include /* JH20010905 */ +# define DEVICE_NAME_BASE "/dev/audio" +#endif + +#include "portaudio.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" +#include "../pa_unix/pa_unix_util.h" + +static int sysErr_; +static pthread_t mainThread_; + +/* Check return value of system call, and map it to PaError */ +#define ENSURE_(expr, code) \ + do { \ + if( UNLIKELY( (sysErr_ = (expr)) < 0 ) ) \ + { \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \ + { \ + PaUtil_SetLastHostErrorInfo( paALSA, sysErr_, strerror( errno ) ); \ + } \ + \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = (code); \ + goto error; \ + } \ + } while( 0 ); + +#ifndef AFMT_S16_NE +#define AFMT_S16_NE Get_AFMT_S16_NE() +/********************************************************************* + * Some versions of OSS do not define AFMT_S16_NE. So check CPU. + * PowerPC is Big Endian. X86 is Little Endian. + */ +static int Get_AFMT_S16_NE( void ) +{ + long testData = 1; + char *ptr = (char *) &testData; + int isLittle = ( *ptr == 1 ); /* Does address point to least significant byte? */ + return isLittle ? AFMT_S16_LE : AFMT_S16_BE; +} +#endif + +/* PaOSSHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + PaHostApiIndex hostApiIndex; +} +PaOSSHostApiRepresentation; + +/** Per-direction structure for PaOssStream. + * + * Aspect StreamChannels: In case the user requests to open the same device for both capture and playback, + * but with different number of channels we will have to adapt between the number of user and host + * channels for at least one direction, since the configuration space is the same for both directions + * of an OSS device. + */ +typedef struct +{ + int fd; + const char *devName; + int userChannelCount, hostChannelCount; + int userInterleaved; + void *buffer; + PaSampleFormat userFormat, hostFormat; + double latency; + unsigned long hostFrames, numBufs; + void **userBuffers; /* For non-interleaved blocking */ +} PaOssStreamComponent; + +/** Implementation specific representation of a PaStream. + * + */ +typedef struct PaOssStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + PaUtilThreading threading; + + int sharedDevice; + unsigned long framesPerHostBuffer; + int triggered; /* Have the devices been triggered yet (first start) */ + + int isActive; + int isStopped; + + int lastPosPtr; + double lastStreamBytes; + + int framesProcessed; + + double sampleRate; + + int callbackMode; + int callbackStop, callbackAbort; + + PaOssStreamComponent *capture, *playback; + unsigned long pollTimeout; + sem_t semaphore; +} +PaOssStream; + +typedef enum { + StreamMode_In, + StreamMode_Out +} StreamMode; + +/* prototypes for functions declared in this file */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); +static PaError BuildDeviceList( PaOSSHostApiRepresentation *hostApi ); + + +/** Initialize the OSS API implementation. + * + * This function will initialize host API datastructures and query host devices for information. + * + * Aspect DeviceCapabilities: Enumeration of host API devices is initiated from here + * + * Aspect FreeResources: If an error is encountered under way we have to free each resource allocated in this function, + * this happens with the usual "error" label. + */ +PaError PaOSS_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaOSSHostApiRepresentation *ossHostApi = NULL; + + PA_UNLESS( ossHostApi = (PaOSSHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaOSSHostApiRepresentation) ), + paInsufficientMemory ); + PA_UNLESS( ossHostApi->allocations = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + ossHostApi->hostApiIndex = hostApiIndex; + + /* Initialize host API structure */ + *hostApi = &ossHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paOSS; + (*hostApi)->info.name = "OSS"; + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PA_ENSURE( BuildDeviceList( ossHostApi ) ); + + PaUtil_InitializeStreamInterface( &ossHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &ossHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + mainThread_ = pthread_self(); + + return result; + +error: + if( ossHostApi ) + { + if( ossHostApi->allocations ) + { + PaUtil_FreeAllAllocations( ossHostApi->allocations ); + PaUtil_DestroyAllocationGroup( ossHostApi->allocations ); + } + + PaUtil_FreeMemory( ossHostApi ); + } + return result; +} + +PaError PaUtil_InitializeDeviceInfo( PaDeviceInfo *deviceInfo, const char *name, PaHostApiIndex hostApiIndex, int maxInputChannels, + int maxOutputChannels, PaTime defaultLowInputLatency, PaTime defaultLowOutputLatency, PaTime defaultHighInputLatency, + PaTime defaultHighOutputLatency, double defaultSampleRate, PaUtilAllocationGroup *allocations ) +{ + PaError result = paNoError; + + deviceInfo->structVersion = 2; + if( allocations ) + { + size_t len = strlen( name ) + 1; + PA_UNLESS( deviceInfo->name = PaUtil_GroupAllocateMemory( allocations, len ), paInsufficientMemory ); + strncpy( (char *)deviceInfo->name, name, len ); + } + else + deviceInfo->name = name; + + deviceInfo->hostApi = hostApiIndex; + deviceInfo->maxInputChannels = maxInputChannels; + deviceInfo->maxOutputChannels = maxOutputChannels; + deviceInfo->defaultLowInputLatency = defaultLowInputLatency; + deviceInfo->defaultLowOutputLatency = defaultLowOutputLatency; + deviceInfo->defaultHighInputLatency = defaultHighInputLatency; + deviceInfo->defaultHighOutputLatency = defaultHighOutputLatency; + deviceInfo->defaultSampleRate = defaultSampleRate; + +error: + return result; +} + +static PaError QueryDirection( const char *deviceName, StreamMode mode, double *defaultSampleRate, int *maxChannelCount, + double *defaultLowLatency, double *defaultHighLatency ) +{ + PaError result = paNoError; + int numChannels, maxNumChannels; + int busy = 0; + int devHandle = -1; + int sr; + *maxChannelCount = 0; /* Default value in case this fails */ + + if ( (devHandle = open( deviceName, (mode == StreamMode_In ? O_RDONLY : O_WRONLY) | O_NONBLOCK )) < 0 ) + { + if( errno == EBUSY || errno == EAGAIN ) + { + PA_DEBUG(( "%s: Device %s busy\n", __FUNCTION__, deviceName )); + } + else + { + PA_DEBUG(( "%s: Can't access device: %s\n", __FUNCTION__, strerror( errno ) )); + } + + return paDeviceUnavailable; + } + + /* Negotiate for the maximum number of channels for this device. PLB20010927 + * Consider up to 16 as the upper number of channels. + * Variable maxNumChannels should contain the actual upper limit after the call. + * Thanks to John Lazzaro and Heiko Purnhagen for suggestions. + */ + maxNumChannels = 0; + for( numChannels = 1; numChannels <= 16; numChannels++ ) + { + int temp = numChannels; + if( ioctl( devHandle, SNDCTL_DSP_CHANNELS, &temp ) < 0 ) + { + busy = EAGAIN == errno || EBUSY == errno; + /* ioctl() failed so bail out if we already have stereo */ + if( maxNumChannels >= 2 ) + break; + } + else + { + /* ioctl() worked but bail out if it does not support numChannels. + * We don't want to leave gaps in the numChannels supported. + */ + if( (numChannels > 2) && (temp != numChannels) ) + break; + if( temp > maxNumChannels ) + maxNumChannels = temp; /* Save maximum. */ + } + } + /* A: We're able to open a device for capture if it's busy playing back and vice versa, + * but we can't configure anything */ + if( 0 == maxNumChannels && busy ) + { + result = paDeviceUnavailable; + goto error; + } + + /* The above negotiation may fail for an old driver so try this older technique. */ + if( maxNumChannels < 1 ) + { + int stereo = 1; + if( ioctl( devHandle, SNDCTL_DSP_STEREO, &stereo ) < 0 ) + { + maxNumChannels = 1; + } + else + { + maxNumChannels = (stereo) ? 2 : 1; + } + PA_DEBUG(( "%s: use SNDCTL_DSP_STEREO, maxNumChannels = %d\n", __FUNCTION__, maxNumChannels )) + } + + /* During channel negotiation, the last ioctl() may have failed. This can + * also cause sample rate negotiation to fail. Hence the following, to return + * to a supported number of channels. SG20011005 */ + { + /* use most reasonable default value */ + int temp = PA_MIN( maxNumChannels, 2 ); + ENSURE_( ioctl( devHandle, SNDCTL_DSP_CHANNELS, &temp ), paUnanticipatedHostError ); + } + + /* Get supported sample rate closest to 44100 Hz */ + if( *defaultSampleRate < 0 ) + { + sr = 44100; + if( ioctl( devHandle, SNDCTL_DSP_SPEED, &sr ) < 0 ) + { + result = paUnanticipatedHostError; + goto error; + } + + *defaultSampleRate = sr; + } + + *maxChannelCount = maxNumChannels; + /* TODO */ + *defaultLowLatency = 512. / *defaultSampleRate; + *defaultHighLatency = 2048. / *defaultSampleRate; + +error: + if( devHandle >= 0 ) + close( devHandle ); + + return result; +} + +/** Query OSS device. + * + * This is where PaDeviceInfo objects are constructed and filled in with relevant information. + * + * Aspect DeviceCapabilities: The inferred device capabilities are recorded in a PaDeviceInfo object that is constructed + * in place. + */ +static PaError QueryDevice( char *deviceName, PaOSSHostApiRepresentation *ossApi, PaDeviceInfo **deviceInfo ) +{ + PaError result = paNoError; + double sampleRate = -1.; + int maxInputChannels, maxOutputChannels; + PaTime defaultLowInputLatency, defaultLowOutputLatency, defaultHighInputLatency, defaultHighOutputLatency; + PaError tmpRes = paNoError; + int busy = 0; + *deviceInfo = NULL; + + /* douglas: + we have to do this querying in a slightly different order. apparently + some sound cards will give you different info based on their settins. + e.g. a card might give you stereo at 22kHz but only mono at 44kHz. + the correct order for OSS is: format, channels, sample rate + */ + + /* Aspect StreamChannels: The number of channels supported for a device may depend on the mode it is + * opened in, it may have more channels available for capture than playback and vice versa. Therefore + * we will open the device in both read- and write-only mode to determine the supported number. + */ + if( (tmpRes = QueryDirection( deviceName, StreamMode_In, &sampleRate, &maxInputChannels, &defaultLowInputLatency, + &defaultHighInputLatency )) != paNoError ) + { + if( tmpRes != paDeviceUnavailable ) + { + PA_DEBUG(( "%s: Querying device %s for capture failed!\n", __FUNCTION__, deviceName )); + /* PA_ENSURE( tmpRes ); */ + } + ++busy; + } + if( (tmpRes = QueryDirection( deviceName, StreamMode_Out, &sampleRate, &maxOutputChannels, &defaultLowOutputLatency, + &defaultHighOutputLatency )) != paNoError ) + { + if( tmpRes != paDeviceUnavailable ) + { + PA_DEBUG(( "%s: Querying device %s for playback failed!\n", __FUNCTION__, deviceName )); + /* PA_ENSURE( tmpRes ); */ + } + ++busy; + } + assert( 0 <= busy && busy <= 2 ); + if( 2 == busy ) /* Both directions are unavailable to us */ + { + result = paDeviceUnavailable; + goto error; + } + + PA_UNLESS( *deviceInfo = PaUtil_GroupAllocateMemory( ossApi->allocations, sizeof (PaDeviceInfo) ), paInsufficientMemory ); + PA_ENSURE( PaUtil_InitializeDeviceInfo( *deviceInfo, deviceName, ossApi->hostApiIndex, maxInputChannels, maxOutputChannels, + defaultLowInputLatency, defaultLowOutputLatency, defaultHighInputLatency, defaultHighOutputLatency, sampleRate, + ossApi->allocations ) ); + +error: + return result; +} + +/** Query host devices. + * + * Loop over host devices and query their capabilitiesu + * + * Aspect DeviceCapabilities: This function calls QueryDevice on each device entry and receives a filled in PaDeviceInfo object + * per device, these are placed in the host api representation's deviceInfos array. + */ +static PaError BuildDeviceList( PaOSSHostApiRepresentation *ossApi ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *commonApi = &ossApi->inheritedHostApiRep; + int i; + int numDevices = 0, maxDeviceInfos = 1; + PaDeviceInfo **deviceInfos = NULL; + + /* These two will be set to the first working input and output device, respectively */ + commonApi->info.defaultInputDevice = paNoDevice; + commonApi->info.defaultOutputDevice = paNoDevice; + + /* Find devices by calling QueryDevice on each + * potential device names. When we find a valid one, + * add it to a linked list. + * A: Can there only be 10 devices? */ + + for( i = 0; i < 10; i++ ) + { + char deviceName[32]; + PaDeviceInfo *deviceInfo; + int testResult; + struct stat stbuf; + + if( i == 0 ) + snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE); + else + snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i); + + /* PA_DEBUG(("PaOSS BuildDeviceList: trying device %s\n", deviceName )); */ + if( stat( deviceName, &stbuf ) < 0 ) + { + if( ENOENT != errno ) + PA_DEBUG(( "%s: Error stat'ing %s: %s\n", __FUNCTION__, deviceName, strerror( errno ) )); + continue; + } + if( (testResult = QueryDevice( deviceName, ossApi, &deviceInfo )) != paNoError ) + { + if( testResult != paDeviceUnavailable ) + PA_ENSURE( testResult ); + + continue; + } + + ++numDevices; + if( !deviceInfos || numDevices > maxDeviceInfos ) + { + maxDeviceInfos *= 2; + PA_UNLESS( deviceInfos = (PaDeviceInfo **) realloc( deviceInfos, maxDeviceInfos * sizeof (PaDeviceInfo *) ), + paInsufficientMemory ); + } + deviceInfos[numDevices - 1] = deviceInfo; + + if( commonApi->info.defaultInputDevice == paNoDevice && deviceInfo->maxInputChannels > 0 ) + commonApi->info.defaultInputDevice = i; + if( commonApi->info.defaultOutputDevice == paNoDevice && deviceInfo->maxOutputChannels > 0 ) + commonApi->info.defaultOutputDevice = i; + } + + /* Make an array of PaDeviceInfo pointers out of the linked list */ + + PA_DEBUG(("PaOSS %s: Total number of devices found: %d\n", __FUNCTION__, numDevices)); + + commonApi->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + ossApi->allocations, sizeof(PaDeviceInfo*) * numDevices ); + memcpy( commonApi->deviceInfos, deviceInfos, numDevices * sizeof (PaDeviceInfo *) ); + + commonApi->info.deviceCount = numDevices; + +error: + free( deviceInfos ); + + return result; +} + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaOSSHostApiRepresentation *ossHostApi = (PaOSSHostApiRepresentation*)hostApi; + + if( ossHostApi->allocations ) + { + PaUtil_FreeAllAllocations( ossHostApi->allocations ); + PaUtil_DestroyAllocationGroup( ossHostApi->allocations ); + } + + PaUtil_FreeMemory( ossHostApi ); +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaError result = paNoError; + PaDeviceIndex device; + PaDeviceInfo *deviceInfo; + char *deviceName; + int inputChannelCount, outputChannelCount; + int tempDevHandle = -1; + int flags; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + if (inputChannelCount == 0 && outputChannelCount == 0) + return paInvalidChannelCount; + + /* if full duplex, make sure that they're the same device */ + + if (inputChannelCount > 0 && outputChannelCount > 0 && + inputParameters->device != outputParameters->device) + return paInvalidDevice; + + /* if full duplex, also make sure that they're the same number of channels */ + + if (inputChannelCount > 0 && outputChannelCount > 0 && + inputChannelCount != outputChannelCount) + return paInvalidChannelCount; + + /* open the device so we can do more tests */ + + if( inputChannelCount > 0 ) + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex(&device, inputParameters->device, hostApi); + if (result != paNoError) + return result; + } + else + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex(&device, outputParameters->device, hostApi); + if (result != paNoError) + return result; + } + + deviceInfo = hostApi->deviceInfos[device]; + deviceName = (char *)deviceInfo->name; + + flags = O_NONBLOCK; + if (inputChannelCount > 0 && outputChannelCount > 0) + flags |= O_RDWR; + else if (inputChannelCount > 0) + flags |= O_RDONLY; + else + flags |= O_WRONLY; + + ENSURE_( tempDevHandle = open( deviceInfo->name, flags ), paDeviceUnavailable ); + + /* PaOssStream_Configure will do the rest of the checking for us */ + /* PA_ENSURE( PaOssStream_Configure( tempDevHandle, deviceName, outputChannelCount, &sampleRate ) ); */ + + /* everything succeeded! */ + + error: + if( tempDevHandle >= 0 ) + close( tempDevHandle ); + + return result; +} + +/** Validate stream parameters. + * + * Aspect StreamChannels: We verify that the number of channels is within the allowed range for the device + */ +static PaError ValidateParameters( const PaStreamParameters *parameters, const PaDeviceInfo *deviceInfo, StreamMode mode ) +{ + int maxChans; + + assert( parameters ); + + if( parameters->device == paUseHostApiSpecificDeviceSpecification ) + { + return paInvalidDevice; + } + + maxChans = (mode == StreamMode_In ? deviceInfo->maxInputChannels : + deviceInfo->maxOutputChannels); + if( parameters->channelCount > maxChans ) + { + return paInvalidChannelCount; + } + + return paNoError; +} + +static PaError PaOssStreamComponent_Initialize( PaOssStreamComponent *component, const PaStreamParameters *parameters, + int callbackMode, int fd, const char *deviceName ) +{ + PaError result = paNoError; + assert( component ); + + memset( component, 0, sizeof (PaOssStreamComponent) ); + + component->fd = fd; + component->devName = deviceName; + component->userChannelCount = parameters->channelCount; + component->userFormat = parameters->sampleFormat; + component->latency = parameters->suggestedLatency; + component->userInterleaved = !(parameters->sampleFormat & paNonInterleaved); + + if( !callbackMode && !component->userInterleaved ) + { + /* Pre-allocate non-interleaved user provided buffers */ + PA_UNLESS( component->userBuffers = PaUtil_AllocateMemory( sizeof (void *) * component->userChannelCount ), + paInsufficientMemory ); + } + +error: + return result; +} + +static void PaOssStreamComponent_Terminate( PaOssStreamComponent *component ) +{ + assert( component ); + + if( component->fd >= 0 ) + close( component->fd ); + if( component->buffer ) + PaUtil_FreeMemory( component->buffer ); + + if( component->userBuffers ) + PaUtil_FreeMemory( component->userBuffers ); + + PaUtil_FreeMemory( component ); +} + +static PaError ModifyBlocking( int fd, int blocking ) +{ + PaError result = paNoError; + int fflags; + + ENSURE_( fflags = fcntl( fd, F_GETFL ), paUnanticipatedHostError ); + + if( blocking ) + fflags &= ~O_NONBLOCK; + else + fflags |= O_NONBLOCK; + + ENSURE_( fcntl( fd, F_SETFL, fflags ), paUnanticipatedHostError ); + +error: + return result; +} + +static PaError OpenDevices( const char *idevName, const char *odevName, int *idev, int *odev ) +{ + PaError result = paNoError; + int flags = O_NONBLOCK, duplex = 0; + int enableBits = 0; + *idev = *odev = -1; + + if( idevName && odevName ) + { + duplex = 1; + flags |= O_RDWR; + } + else if( idevName ) + flags |= O_RDONLY; + else + flags |= O_WRONLY; + + /* open first in nonblocking mode, in case it's busy... + * A: then unset the non-blocking attribute */ + assert( flags & O_NONBLOCK ); + if( idevName ) + { + ENSURE_( *idev = open( idevName, flags ), paDeviceUnavailable ); + PA_ENSURE( ModifyBlocking( *idev, 1 ) ); /* Blocking */ + + /* Initially disable */ + enableBits = ~PCM_ENABLE_INPUT; + ENSURE_( ioctl( *idev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + if( odevName ) + { + if( !idevName ) + { + ENSURE_( *odev = open( odevName, flags ), paDeviceUnavailable ); + PA_ENSURE( ModifyBlocking( *odev, 1 ) ); /* Blocking */ + + /* Initially disable */ + enableBits = ~PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( *odev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + else + { + ENSURE_( *odev = dup( *idev ), paUnanticipatedHostError ); + } + } + +error: + return result; +} + +static PaError PaOssStream_Initialize( PaOssStream *stream, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, + PaStreamCallback callback, void *userData, PaStreamFlags streamFlags, + PaOSSHostApiRepresentation *ossApi ) +{ + PaError result = paNoError; + int idev, odev; + PaUtilHostApiRepresentation *hostApi = &ossApi->inheritedHostApiRep; + const char *idevName = NULL, *odevName = NULL; + + assert( stream ); + + memset( stream, 0, sizeof (PaOssStream) ); + stream->isStopped = 1; + + PA_ENSURE( PaUtil_InitializeThreading( &stream->threading ) ); + + if( inputParameters && outputParameters ) + { + if( inputParameters->device == outputParameters->device ) + stream->sharedDevice = 1; + } + + if( inputParameters ) + idevName = hostApi->deviceInfos[inputParameters->device]->name; + if( outputParameters ) + odevName = hostApi->deviceInfos[outputParameters->device]->name; + PA_ENSURE( OpenDevices( idevName, odevName, &idev, &odev ) ); + if( inputParameters ) + { + PA_UNLESS( stream->capture = PaUtil_AllocateMemory( sizeof (PaOssStreamComponent) ), paInsufficientMemory ); + PA_ENSURE( PaOssStreamComponent_Initialize( stream->capture, inputParameters, callback != NULL, idev, idevName ) ); + } + if( outputParameters ) + { + PA_UNLESS( stream->playback = PaUtil_AllocateMemory( sizeof (PaOssStreamComponent) ), paInsufficientMemory ); + PA_ENSURE( PaOssStreamComponent_Initialize( stream->playback, outputParameters, callback != NULL, odev, odevName ) ); + } + + if( callback != NULL ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &ossApi->callbackStreamInterface, callback, userData ); + stream->callbackMode = 1; + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &ossApi->blockingStreamInterface, callback, userData ); + } + + ENSURE_( sem_init( &stream->semaphore, 0, 0 ), paInternalError ); + +error: + return result; +} + +static void PaOssStream_Terminate( PaOssStream *stream ) +{ + assert( stream ); + + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_TerminateThreading( &stream->threading ); + + if( stream->capture ) + PaOssStreamComponent_Terminate( stream->capture ); + if( stream->playback ) + PaOssStreamComponent_Terminate( stream->playback ); + + sem_destroy( &stream->semaphore ); + + PaUtil_FreeMemory( stream ); +} + +/** Translate from PA format to OSS native. + * + */ +static PaError Pa2OssFormat( PaSampleFormat paFormat, int *ossFormat ) +{ + switch( paFormat ) + { + case paUInt8: + *ossFormat = AFMT_U8; + break; + case paInt8: + *ossFormat = AFMT_S8; + break; + case paInt16: + *ossFormat = AFMT_S16_NE; + break; + default: + return paInternalError; /* This shouldn't happen */ + } + + return paNoError; +} + +/** Return the PA-compatible formats that this device can support. + * + */ +static PaError GetAvailableFormats( PaOssStreamComponent *component, PaSampleFormat *availableFormats ) +{ + PaError result = paNoError; + int mask = 0; + PaSampleFormat frmts = 0; + + ENSURE_( ioctl( component->fd, SNDCTL_DSP_GETFMTS, &mask ), paUnanticipatedHostError ); + if( mask & AFMT_U8 ) + frmts |= paUInt8; + if( mask & AFMT_S8 ) + frmts |= paInt8; + if( mask & AFMT_S16_NE ) + frmts |= paInt16; + else + result = paSampleFormatNotSupported; + + *availableFormats = frmts; + +error: + return result; +} + +static unsigned int PaOssStreamComponent_FrameSize( PaOssStreamComponent *component ) +{ + return Pa_GetSampleSize( component->hostFormat ) * component->hostChannelCount; +} + +/** Buffer size in bytes. + * + */ +static unsigned long PaOssStreamComponent_BufferSize( PaOssStreamComponent *component ) +{ + return PaOssStreamComponent_FrameSize( component ) * component->hostFrames * component->numBufs; +} + +static int CalcHigherLogTwo( int n ) +{ + int log2 = 0; + while( (1<userChannelCount; + int frgmt; + int numBufs; + int bytesPerBuf; + double bufSz; + unsigned long fragSz; + audio_buf_info bufInfo; + + /* We may have a situation where only one component (the master) is configured, if both point to the same device. + * In that case, the second component will copy settings from the other */ + if( !master ) + { + /* Aspect BufferSettings: If framesPerBuffer is unspecified we have to infer a suitable fragment size. + * The hardware need not respect the requested fragment size, so we may have to adapt. + */ + if( framesPerBuffer == paFramesPerBufferUnspecified ) + { + bufSz = component->latency * sampleRate; + fragSz = bufSz / 4; + } + else + { + fragSz = framesPerBuffer; + bufSz = component->latency * sampleRate + fragSz; /* Latency + 1 buffer */ + } + + PA_ENSURE( GetAvailableFormats( component, &availableFormats ) ); + hostFormat = PaUtil_SelectClosestAvailableFormat( availableFormats, component->userFormat ); + + /* OSS demands at least 2 buffers, and 16 bytes per buffer */ + numBufs = PA_MAX( bufSz / fragSz, 2 ); + bytesPerBuf = PA_MAX( fragSz * Pa_GetSampleSize( hostFormat ) * chans, 16 ); + + /* The fragment parameters are encoded like this: + * Most significant byte: number of fragments + * Least significant byte: exponent of fragment size (i.e., for 256, 8) + */ + frgmt = (numBufs << 16) + (CalcHigherLogTwo( bytesPerBuf ) & 0xffff); + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SETFRAGMENT, &frgmt ), paUnanticipatedHostError ); + + /* A: according to the OSS programmer's guide parameters should be set in this order: + * format, channels, rate */ + + /* This format should be deemed good before we get this far */ + PA_ENSURE( Pa2OssFormat( hostFormat, &temp ) ); + nativeFormat = temp; + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SETFMT, &temp ), paUnanticipatedHostError ); + PA_UNLESS( temp == nativeFormat, paInternalError ); + + /* try to set the number of channels */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_CHANNELS, &chans ), paSampleFormatNotSupported ); /* XXX: Should be paInvalidChannelCount? */ + /* It's possible that the minimum number of host channels is greater than what the user requested */ + PA_UNLESS( chans >= component->userChannelCount, paInvalidChannelCount ); + + /* try to set the sample rate */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SPEED, &sr ), paInvalidSampleRate ); + + /* reject if there's no sample rate within 1% of the one requested */ + if( (fabs( sampleRate - sr ) / sampleRate) > 0.01 ) + { + PA_DEBUG(("%s: Wanted %f, closest sample rate was %d\n", __FUNCTION__, sampleRate, sr )); + PA_ENSURE( paInvalidSampleRate ); + } + + ENSURE_( ioctl( component->fd, streamMode == StreamMode_In ? SNDCTL_DSP_GETISPACE : SNDCTL_DSP_GETOSPACE, &bufInfo ), + paUnanticipatedHostError ); + component->numBufs = bufInfo.fragstotal; + + /* This needs to be the last ioctl call before the first read/write, according to the OSS programmer's guide */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_GETBLKSIZE, &bytesPerBuf ), paUnanticipatedHostError ); + + component->hostFrames = bytesPerBuf / Pa_GetSampleSize( hostFormat ) / chans; + component->hostChannelCount = chans; + component->hostFormat = hostFormat; + } + else + { + component->hostFormat = master->hostFormat; + component->hostFrames = master->hostFrames; + component->hostChannelCount = master->hostChannelCount; + component->numBufs = master->numBufs; + } + + PA_UNLESS( component->buffer = PaUtil_AllocateMemory( PaOssStreamComponent_BufferSize( component ) ), + paInsufficientMemory ); + +error: + return result; +} + +static PaError PaOssStreamComponent_Read( PaOssStreamComponent *component, unsigned long *frames ) +{ + PaError result = paNoError; + size_t len = *frames * PaOssStreamComponent_FrameSize( component ); + ssize_t bytesRead; + + ENSURE_( bytesRead = read( component->fd, component->buffer, len ), paUnanticipatedHostError ); + *frames = bytesRead / PaOssStreamComponent_FrameSize( component ); + /* TODO: Handle condition where number of frames read doesn't equal number of frames requested */ + +error: + return result; +} + +static PaError PaOssStreamComponent_Write( PaOssStreamComponent *component, unsigned long *frames ) +{ + PaError result = paNoError; + size_t len = *frames * PaOssStreamComponent_FrameSize( component ); + ssize_t bytesWritten; + + ENSURE_( bytesWritten = write( component->fd, component->buffer, len ), paUnanticipatedHostError ); + *frames = bytesWritten / PaOssStreamComponent_FrameSize( component ); + /* TODO: Handle condition where number of frames written doesn't equal number of frames requested */ + +error: + return result; +} + +/** Configure the stream according to input/output parameters. + * + * Aspect StreamChannels: The minimum number of channels supported by the device may exceed that requested by + * the user, if so we'll record the actual number of host channels and adapt later. + */ +static PaError PaOssStream_Configure( PaOssStream *stream, double sampleRate, unsigned long framesPerBuffer, + double *inputLatency, double *outputLatency ) +{ + PaError result = paNoError; + int duplex = stream->capture && stream->playback; + unsigned long framesPerHostBuffer = 0; + + /* We should request full duplex first thing after opening the device */ + if( duplex && stream->sharedDevice ) + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETDUPLEX, 0 ), paUnanticipatedHostError ); + + if( stream->capture ) + { + PaOssStreamComponent *component = stream->capture; + PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_In, NULL ); + + assert( component->hostChannelCount > 0 ); + assert( component->hostFrames > 0 ); + + *inputLatency = component->hostFrames * (component->numBufs - 1) / sampleRate; + } + if( stream->playback ) + { + PaOssStreamComponent *component = stream->playback, *master = stream->sharedDevice ? stream->capture : NULL; + PA_ENSURE( PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_Out, + master ) ); + + assert( component->hostChannelCount > 0 ); + assert( component->hostFrames > 0 ); + + *outputLatency = component->hostFrames * (component->numBufs - 1) / sampleRate; + } + + if( duplex ) + framesPerHostBuffer = PA_MIN( stream->capture->hostFrames, stream->playback->hostFrames ); + else if( stream->capture ) + framesPerHostBuffer = stream->capture->hostFrames; + else if( stream->playback ) + framesPerHostBuffer = stream->playback->hostFrames; + + stream->framesPerHostBuffer = framesPerHostBuffer; + stream->pollTimeout = (int) ceil( 1e6 * framesPerHostBuffer / sampleRate ); /* Period in usecs, rounded up */ + + stream->sampleRate = stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + +error: + return result; +} + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +/** Open a PA OSS stream. + * + * Aspect StreamChannels: The number of channels is specified per direction (in/out), and can differ between the + * two. However, OSS doesn't support separate configuration spaces for capture and playback so if both + * directions are the same device we will demand the same number of channels. The number of channels can range + * from 1 to the maximum supported by the device. + * + * Aspect BufferSettings: If framesPerBuffer != paFramesPerBufferUnspecified the number of frames per callback + * must reflect this, in addition the host latency per device should approximate the corresponding + * suggestedLatency. Based on these constraints we need to determine a number of frames per host buffer that + * both capture and playback can agree on (they can be different devices), the buffer processor can adapt + * between host and user buffer size, but the ratio should preferably be integral. + */ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaOSSHostApiRepresentation *ossHostApi = (PaOSSHostApiRepresentation*)hostApi; + PaOssStream *stream = NULL; + int inputChannelCount = 0, outputChannelCount = 0; + PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0, inputHostFormat = 0, outputHostFormat = 0; + const PaDeviceInfo *inputDeviceInfo = 0, *outputDeviceInfo = 0; + int bpInitialized = 0; + double inLatency, outLatency; + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + if( inputParameters ) + { + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + inputDeviceInfo = hostApi->deviceInfos[inputParameters->device]; + PA_ENSURE( ValidateParameters( inputParameters, inputDeviceInfo, StreamMode_In ) ); + + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + } + if( outputParameters ) + { + outputDeviceInfo = hostApi->deviceInfos[outputParameters->device]; + PA_ENSURE( ValidateParameters( outputParameters, outputDeviceInfo, StreamMode_Out ) ); + + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + } + + /* Aspect StreamChannels: We currently demand that number of input and output channels are the same, if the same + * device is opened for both directions + */ + if( inputChannelCount > 0 && outputChannelCount > 0 ) + { + if( inputParameters->device == outputParameters->device ) + { + if( inputParameters->channelCount != outputParameters->channelCount ) + return paInvalidChannelCount; + } + } + + /* allocate and do basic initialization of the stream structure */ + PA_UNLESS( stream = (PaOssStream*)PaUtil_AllocateMemory( sizeof(PaOssStream) ), paInsufficientMemory ); + PA_ENSURE( PaOssStream_Initialize( stream, inputParameters, outputParameters, streamCallback, userData, streamFlags, ossHostApi ) ); + + PA_ENSURE( PaOssStream_Configure( stream, sampleRate, framesPerBuffer, &inLatency, &outLatency ) ); + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + if( inputParameters ) + { + inputHostFormat = stream->capture->hostFormat; + stream->streamRepresentation.streamInfo.inputLatency = inLatency + + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor ) / sampleRate; + } + if( outputParameters ) + { + outputHostFormat = stream->playback->hostFormat; + stream->streamRepresentation.streamInfo.outputLatency = outLatency + + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor ) / sampleRate; + } + + /* Initialize buffer processor with fixed host buffer size. + * Aspect StreamSampleFormat: Here we commit the user and host sample formats, PA infrastructure will + * convert between the two. + */ + PA_ENSURE( PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, inputHostFormat, outputChannelCount, outputSampleFormat, + outputHostFormat, sampleRate, streamFlags, framesPerBuffer, stream->framesPerHostBuffer, + paUtilFixedHostBufferSize, streamCallback, userData ) ); + bpInitialized = 1; + + *s = (PaStream*)stream; + + return result; + +error: + if( bpInitialized ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + if( stream ) + PaOssStream_Terminate( stream ); + + return result; +} + +/*! Poll on I/O filedescriptors. + + Poll till we've determined there's data for read or write. In the full-duplex case, + we don't want to hang around forever waiting for either input or output frames, so + whenever we have a timed out filedescriptor we check if we're nearing under/overrun + for the other direction (critical limit set at one buffer). If so, we exit the waiting + state, and go on with what we got. We align the number of frames on a host buffer + boundary because it is possible that the buffer size differs for the two directions and + the host buffer size is a compromise between the two. + */ +static PaError PaOssStream_WaitForFrames( PaOssStream *stream, unsigned long *frames ) +{ + PaError result = paNoError; + int pollPlayback = 0, pollCapture = 0; + int captureAvail = INT_MAX, playbackAvail = INT_MAX, commonAvail; + audio_buf_info bufInfo; + /* int ofs = 0, nfds = stream->nfds; */ + fd_set readFds, writeFds; + int nfds = 0; + struct timeval selectTimeval = {0, 0}; + unsigned long timeout = stream->pollTimeout; /* In usecs */ + int captureFd = -1, playbackFd = -1; + + assert( stream ); + assert( frames ); + + if( stream->capture ) + { + pollCapture = 1; + captureFd = stream->capture->fd; + /* stream->capture->pfd->events = POLLIN; */ + } + if( stream->playback ) + { + pollPlayback = 1; + playbackFd = stream->playback->fd; + /* stream->playback->pfd->events = POLLOUT; */ + } + + FD_ZERO( &readFds ); + FD_ZERO( &writeFds ); + + while( pollPlayback || pollCapture ) + { + pthread_testcancel(); + + /* select may modify the timeout parameter */ + selectTimeval.tv_usec = timeout; + nfds = 0; + + if( pollCapture ) + { + FD_SET( captureFd, &readFds ); + nfds = captureFd + 1; + } + if( pollPlayback ) + { + FD_SET( playbackFd, &writeFds ); + nfds = PA_MAX( nfds, playbackFd + 1 ); + } + ENSURE_( select( nfds, &readFds, &writeFds, NULL, &selectTimeval ), paUnanticipatedHostError ); + /* + if( poll( stream->pfds + ofs, nfds, stream->pollTimeout ) < 0 ) + { + + ENSURE_( -1, paUnanticipatedHostError ); + } + */ + pthread_testcancel(); + + if( pollCapture ) + { + if( FD_ISSET( captureFd, &readFds ) ) + { + FD_CLR( captureFd, &readFds ); + pollCapture = 0; + } + /* + if( stream->capture->pfd->revents & POLLIN ) + { + --nfds; + ++ofs; + pollCapture = 0; + } + */ + else if( stream->playback ) /* Timed out, go on with playback? */ + { + /*PA_DEBUG(( "%s: Trying to poll again for capture frames, pollTimeout: %d\n", + __FUNCTION__, stream->pollTimeout ));*/ + } + } + if( pollPlayback ) + { + if( FD_ISSET( playbackFd, &writeFds ) ) + { + FD_CLR( playbackFd, &writeFds ); + pollPlayback = 0; + } + /* + if( stream->playback->pfd->revents & POLLOUT ) + { + --nfds; + pollPlayback = 0; + } + */ + else if( stream->capture ) /* Timed out, go on with capture? */ + { + /*PA_DEBUG(( "%s: Trying to poll again for playback frames, pollTimeout: %d\n\n", + __FUNCTION__, stream->pollTimeout ));*/ + } + } + } + + if( stream->capture ) + { + ENSURE_( ioctl( captureFd, SNDCTL_DSP_GETISPACE, &bufInfo ), paUnanticipatedHostError ); + captureAvail = bufInfo.fragments * stream->capture->hostFrames; + if( !captureAvail ) + PA_DEBUG(( "%s: captureAvail: 0\n", __FUNCTION__ )); + + captureAvail = captureAvail == 0 ? INT_MAX : captureAvail; /* Disregard if zero */ + } + if( stream->playback ) + { + ENSURE_( ioctl( playbackFd, SNDCTL_DSP_GETOSPACE, &bufInfo ), paUnanticipatedHostError ); + playbackAvail = bufInfo.fragments * stream->playback->hostFrames; + if( !playbackAvail ) + { + PA_DEBUG(( "%s: playbackAvail: 0\n", __FUNCTION__ )); + } + + playbackAvail = playbackAvail == 0 ? INT_MAX : playbackAvail; /* Disregard if zero */ + } + + commonAvail = PA_MIN( captureAvail, playbackAvail ); + if( commonAvail == INT_MAX ) + commonAvail = 0; + commonAvail -= commonAvail % stream->framesPerHostBuffer; + + assert( commonAvail != INT_MAX ); + assert( commonAvail >= 0 ); + *frames = commonAvail; + +error: + return result; +} + +/** Prepare stream for capture/playback. + * + * In order to synchronize capture and playback properly we use the SETTRIGGER command. + */ +static PaError PaOssStream_Prepare( PaOssStream *stream ) +{ + PaError result = paNoError; + int enableBits = 0; + + if( stream->triggered ) + return result; + + if( stream->playback ) + { + size_t bufSz = PaOssStreamComponent_BufferSize( stream->playback ); + memset( stream->playback->buffer, 0, bufSz ); + + /* Looks like we have to turn off blocking before we try this, but if we don't fill the buffer + * OSS will complain. */ + PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); + while (1) + { + if( write( stream->playback->fd, stream->playback->buffer, bufSz ) < 0 ) + break; + } + PA_ENSURE( ModifyBlocking( stream->playback->fd, 1 ) ); + } + + if( stream->sharedDevice ) + { + enableBits = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + else + { + if( stream->capture ) + { + enableBits = PCM_ENABLE_INPUT; + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + if( stream->playback ) + { + enableBits = PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( stream->playback->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + } + + /* Ok, we have triggered the stream */ + stream->triggered = 1; + +error: + return result; +} + +/** Stop audio processing + * + */ +static PaError PaOssStream_Stop( PaOssStream *stream, int abort ) +{ + PaError result = paNoError; + + /* Looks like the only safe way to stop audio without reopening the device is SNDCTL_DSP_POST. + * Also disable capture/playback till the stream is started again */ + if( stream->capture ) + { + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); + } + if( stream->playback && !stream->sharedDevice ) + { + ENSURE_( ioctl( stream->playback->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); + } + +error: + return result; +} + +/** Clean up after thread exit. + * + * Aspect StreamState: If the user has registered a streamFinishedCallback it will be called here + */ +static void OnExit( void *data ) +{ + PaOssStream *stream = (PaOssStream *) data; + assert( data ); + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + PaOssStream_Stop( stream, stream->callbackAbort ); + + PA_DEBUG(( "OnExit: Stoppage\n" )); + + /* Eventually notify user all buffers have played */ + if( stream->streamRepresentation.streamFinishedCallback ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + + stream->callbackAbort = 0; /* Clear state */ + stream->isActive = 0; +} + +static PaError SetUpBuffers( PaOssStream *stream, unsigned long framesAvail ) +{ + PaError result = paNoError; + + if( stream->capture ) + { + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, stream->capture->buffer, + stream->capture->hostChannelCount ); + PaUtil_SetInputFrameCount( &stream->bufferProcessor, framesAvail ); + } + if( stream->playback ) + { + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, stream->playback->buffer, + stream->playback->hostChannelCount ); + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, framesAvail ); + } + + return result; +} + +/** Thread procedure for callback processing. + * + * Aspect StreamState: StartStream will wait on this to initiate audio processing, useful in case the + * callback should be used for buffer priming. When the stream is cancelled a separate function will + * take care of the transition to the Callback Finished state (the stream isn't considered Stopped + * before StopStream() or AbortStream() are called). + */ +static void *PaOSS_AudioThreadProc( void *userData ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)userData; + unsigned long framesAvail, framesProcessed; + int callbackResult = paContinue; + int triggered = stream->triggered; /* See if SNDCTL_DSP_TRIGGER has been issued already */ + int initiateProcessing = triggered; /* Already triggered? */ + PaStreamCallbackFlags cbFlags = 0; /* We might want to keep state across iterations */ + + /* +#if ( SOUND_VERSION > 0x030904 ) + audio_errinfo errinfo; +#endif +*/ + + assert( stream ); + + pthread_cleanup_push( &OnExit, stream ); /* Execute OnExit when exiting */ + + /* The first time the stream is started we use SNDCTL_DSP_TRIGGER to accurately start capture and + * playback in sync, when the stream is restarted after being stopped we simply start by reading/ + * writing. + */ + PA_ENSURE( PaOssStream_Prepare( stream ) ); + + /* If we are to initiate processing implicitly by reading/writing data, we start off in blocking mode */ + if( initiateProcessing ) + { + /* Make sure devices are in blocking mode */ + if( stream->capture ) + ModifyBlocking( stream->capture->fd, 1 ); + if( stream->playback ) + ModifyBlocking( stream->playback->fd, 1 ); + } + + while( 1 ) + { + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* TODO: IMPLEMENT ME */ + + pthread_testcancel(); + + if( stream->callbackStop && callbackResult == paContinue ) + { + PA_DEBUG(( "Setting callbackResult to paComplete\n" )); + callbackResult = paComplete; + } + + /* Aspect StreamState: Because of the messy OSS scheme we can't explicitly trigger device start unless + * the stream has been recently started, we will have to go right ahead and read/write in blocking + * fashion to trigger operation. Therefore we begin with processing one host buffer before we switch + * to non-blocking mode. + */ + if( !initiateProcessing ) + { + PA_ENSURE( PaOssStream_WaitForFrames( stream, &framesAvail ) ); /* Wait on available frames */ + assert( framesAvail % stream->framesPerHostBuffer == 0 ); + } + else + { + framesAvail = stream->framesPerHostBuffer; + } + + while( framesAvail > 0 ) + { + unsigned long frames = framesAvail; + + pthread_testcancel(); + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + /* Read data */ + if ( stream->capture ) + { + PA_ENSURE( PaOssStreamComponent_Read( stream->capture, &frames ) ); + assert( frames == framesAvail ); + } + +#if ( SOUND_VERSION >= 0x030904 ) + /* + Check with OSS to see if there have been any under/overruns + since last time we checked. + */ + /* + if( ioctl( stream->deviceHandle, SNDCTL_DSP_GETERROR, &errinfo ) >= 0 ) + { + if( errinfo.play_underruns ) + cbFlags |= paOutputUnderflow ; + if( errinfo.record_underruns ) + cbFlags |= paInputUnderflow ; + } + else + PA_DEBUG(( "SNDCTL_DSP_GETERROR command failed: %s\n", strerror( errno ) )); + */ +#endif + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, + cbFlags ); + cbFlags = 0; + PA_ENSURE( SetUpBuffers( stream, framesAvail ) ); + + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, + &callbackResult ); + assert( framesProcessed == framesAvail ); + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + if ( stream->playback ) + { + frames = framesAvail; + + PA_ENSURE( PaOssStreamComponent_Write( stream->playback, &frames ) ); + assert( frames == framesAvail ); + + /* TODO: handle bytesWritten != bytesRequested (slippage?) */ + } + + framesAvail -= framesProcessed; + stream->framesProcessed += framesProcessed; + + if( callbackResult != paContinue ) + break; + } + + if( initiateProcessing || !triggered ) + { + /* Non-blocking */ + if( stream->capture ) + PA_ENSURE( ModifyBlocking( stream->capture->fd, 0 ) ); + if( stream->playback && !stream->sharedDevice ) + PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); + + initiateProcessing = 0; + sem_post( &stream->semaphore ); + } + + if( callbackResult != paContinue ) + { + stream->callbackAbort = callbackResult == paAbort; + if( stream->callbackAbort || PaUtil_IsBufferProcessorOutputEmpty( &stream->bufferProcessor ) ) + break; + } + } + + pthread_cleanup_pop( 1 ); + +error: + pthread_exit( NULL ); +} + +/** Close the stream. + * + */ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)s; + + assert( stream ); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaOssStream_Terminate( stream ); + + return result; +} + +/** Start the stream. + * + * Aspect StreamState: After returning, the stream shall be in the Active state, implying that an eventual + * callback will be repeatedly called in a separate thread. If a separate thread is started this function + * will block untill it has started processing audio, otherwise audio processing is started directly. + */ +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)s; + + stream->isActive = 1; + stream->isStopped = 0; + stream->lastPosPtr = 0; + stream->lastStreamBytes = 0; + stream->framesProcessed = 0; + + /* only use the thread for callback streams */ + if( stream->bufferProcessor.streamCallback ) + { + PA_ENSURE( PaUtil_StartThreading( &stream->threading, &PaOSS_AudioThreadProc, stream ) ); + sem_wait( &stream->semaphore ); + } + else + PA_ENSURE( PaOssStream_Prepare( stream ) ); + +error: + return result; +} + +static PaError RealStop( PaOssStream *stream, int abort ) +{ + PaError result = paNoError; + + if( stream->callbackMode ) + { + if( abort ) + stream->callbackAbort = 1; + else + stream->callbackStop = 1; + + PA_ENSURE( PaUtil_CancelThreading( &stream->threading, !abort, NULL ) ); + + stream->callbackStop = stream->callbackAbort = 0; + } + else + PA_ENSURE( PaOssStream_Stop( stream, abort ) ); + + stream->isStopped = 1; + +error: + return result; +} + +/** Stop the stream. + * + * Aspect StreamState: This will cause the stream to transition to the Stopped state, playing all enqueued + * buffers. + */ +static PaError StopStream( PaStream *s ) +{ + return RealStop( (PaOssStream *)s, 0 ); +} + +/** Abort the stream. + * + * Aspect StreamState: This will cause the stream to transition to the Stopped state, discarding all enqueued + * buffers. Note that the buffers are not currently correctly discarded, this is difficult without closing + * the OSS device. + */ +static PaError AbortStream( PaStream *s ) +{ + return RealStop( (PaOssStream *)s, 1 ); +} + +/** Is the stream in the Stopped state. + * + */ +static PaError IsStreamStopped( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return (stream->isStopped); +} + +/** Is the stream in the Active state. + * + */ +static PaError IsStreamActive( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return (stream->isActive); +} + +static PaTime GetStreamTime( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + count_info info; + int delta; + + if( stream->playback ) { + if( ioctl( stream->playback->fd, SNDCTL_DSP_GETOPTR, &info) == 0 ) { + delta = ( info.bytes - stream->lastPosPtr ) /* & 0x000FFFFF*/; + return (float)(stream->lastStreamBytes + delta) / PaOssStreamComponent_FrameSize( stream->playback ) / stream->sampleRate; + } + } + else { + if (ioctl( stream->capture->fd, SNDCTL_DSP_GETIPTR, &info) == 0) { + delta = (info.bytes - stream->lastPosPtr) /*& 0x000FFFFF*/; + return (float)(stream->lastStreamBytes + delta) / PaOssStreamComponent_FrameSize( stream->capture ) / stream->sampleRate; + } + } + + /* the ioctl failed, but we can still give a coarse estimate */ + + return stream->framesProcessed / stream->sampleRate; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaOssStream *stream = (PaOssStream*)s; + int bytesRequested, bytesRead; + unsigned long framesRequested; + void *userBuffer; + + /* If user input is non-interleaved, PaUtil_CopyInput will manipulate the channel pointers, + * so we copy the user provided pointers */ + if( stream->bufferProcessor.userInputIsInterleaved ) + userBuffer = buffer; + else /* Copy channels into local array */ + { + userBuffer = stream->capture->userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->capture->userChannelCount ); + } + + while( frames ) + { + framesRequested = PA_MIN( frames, stream->capture->hostFrames ); + + bytesRequested = framesRequested * PaOssStreamComponent_FrameSize( stream->capture ); + bytesRead = read( stream->capture->fd, stream->capture->buffer, bytesRequested ); + if ( bytesRequested != bytesRead ) + return paUnanticipatedHostError; + + PaUtil_SetInputFrameCount( &stream->bufferProcessor, stream->capture->hostFrames ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, stream->capture->buffer, stream->capture->hostChannelCount ); + PaUtil_CopyInput( &stream->bufferProcessor, &userBuffer, framesRequested ); + frames -= framesRequested; + } + return paNoError; +} + + +static PaError WriteStream( PaStream *s, const void *buffer, unsigned long frames ) +{ + PaOssStream *stream = (PaOssStream*)s; + int bytesRequested, bytesWritten; + unsigned long framesConverted; + const void *userBuffer; + + /* If user output is non-interleaved, PaUtil_CopyOutput will manipulate the channel pointers, + * so we copy the user provided pointers */ + if( stream->bufferProcessor.userOutputIsInterleaved ) + userBuffer = buffer; + else + { + /* Copy channels into local array */ + userBuffer = stream->playback->userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->playback->userChannelCount ); + } + + while( frames ) + { + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, stream->playback->hostFrames ); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, stream->playback->buffer, stream->playback->hostChannelCount ); + + framesConverted = PaUtil_CopyOutput( &stream->bufferProcessor, &userBuffer, frames ); + frames -= framesConverted; + + bytesRequested = framesConverted * PaOssStreamComponent_FrameSize( stream->playback ); + bytesWritten = write( stream->playback->fd, stream->playback->buffer, bytesRequested ); + + if ( bytesRequested != bytesWritten ) + return paUnanticipatedHostError; + } + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + audio_buf_info info; + + if( ioctl( stream->capture->fd, SNDCTL_DSP_GETISPACE, &info ) < 0 ) + return paUnanticipatedHostError; + return info.fragments * stream->capture->hostFrames; +} + + +/* TODO: Compute number of allocated bytes somewhere else, can we use ODELAY with capture */ +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + int delay = 0; + + if( ioctl( stream->playback->fd, SNDCTL_DSP_GETODELAY, &delay ) < 0 ) + return paUnanticipatedHostError; + + return (PaOssStreamComponent_BufferSize( stream->playback ) - delay) / PaOssStreamComponent_FrameSize( stream->playback ); +} + diff --git a/portaudio-v19/pa_unix_oss/pa_unix_oss.c.orig b/portaudio-v19/pa_unix_oss/pa_unix_oss.c.orig new file mode 100644 index 000000000..3d81433cb --- /dev/null +++ b/portaudio-v19/pa_unix_oss/pa_unix_oss.c.orig @@ -0,0 +1,1922 @@ +/* + * $Id: pa_unix_oss.c,v 1.6.2.26 2005/12/10 11:35:24 aknudsen Exp $ + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * OSS implementation by: + * Douglas Repetto + * Phil Burk + * Dominic Mazzoni + * Arve Knudsen + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __FreeBSD__ +# include +# define DEVICE_NAME_BASE "/dev/dsp" +#elif defined __linux__ +# include +# define DEVICE_NAME_BASE "/dev/dsp" +#else +# include /* JH20010905 */ +# define DEVICE_NAME_BASE "/dev/audio" +#endif + +#include "portaudio.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" +#include "../pa_unix/pa_unix_util.h" + +static int sysErr_; +static pthread_t mainThread_; + +/* Check return value of system call, and map it to PaError */ +#define ENSURE_(expr, code) \ + do { \ + if( UNLIKELY( (sysErr_ = (expr)) < 0 ) ) \ + { \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \ + { \ + PaUtil_SetLastHostErrorInfo( paALSA, sysErr_, strerror( errno ) ); \ + } \ + \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = (code); \ + goto error; \ + } \ + } while( 0 ); + +#ifndef AFMT_S16_NE +#define AFMT_S16_NE Get_AFMT_S16_NE() +/********************************************************************* + * Some versions of OSS do not define AFMT_S16_NE. So check CPU. + * PowerPC is Big Endian. X86 is Little Endian. + */ +static int Get_AFMT_S16_NE( void ) +{ + long testData = 1; + char *ptr = (char *) &testData; + int isLittle = ( *ptr == 1 ); /* Does address point to least significant byte? */ + return isLittle ? AFMT_S16_LE : AFMT_S16_BE; +} +#endif + +/* PaOSSHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + PaHostApiIndex hostApiIndex; +} +PaOSSHostApiRepresentation; + +/** Per-direction structure for PaOssStream. + * + * Aspect StreamChannels: In case the user requests to open the same device for both capture and playback, + * but with different number of channels we will have to adapt between the number of user and host + * channels for at least one direction, since the configuration space is the same for both directions + * of an OSS device. + */ +typedef struct +{ + int fd; + const char *devName; + int userChannelCount, hostChannelCount; + int userInterleaved; + void *buffer; + PaSampleFormat userFormat, hostFormat; + double latency; + unsigned long hostFrames, numBufs; + void **userBuffers; /* For non-interleaved blocking */ +} PaOssStreamComponent; + +/** Implementation specific representation of a PaStream. + * + */ +typedef struct PaOssStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + PaUtilThreading threading; + + int sharedDevice; + unsigned long framesPerHostBuffer; + int triggered; /* Have the devices been triggered yet (first start) */ + + int isActive; + int isStopped; + + int lastPosPtr; + double lastStreamBytes; + + int framesProcessed; + + double sampleRate; + + int callbackMode; + int callbackStop, callbackAbort; + + PaOssStreamComponent *capture, *playback; + unsigned long pollTimeout; + sem_t semaphore; +} +PaOssStream; + +typedef enum { + StreamMode_In, + StreamMode_Out +} StreamMode; + +/* prototypes for functions declared in this file */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); +static PaError BuildDeviceList( PaOSSHostApiRepresentation *hostApi ); + + +/** Initialize the OSS API implementation. + * + * This function will initialize host API datastructures and query host devices for information. + * + * Aspect DeviceCapabilities: Enumeration of host API devices is initiated from here + * + * Aspect FreeResources: If an error is encountered under way we have to free each resource allocated in this function, + * this happens with the usual "error" label. + */ +PaError PaOSS_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaOSSHostApiRepresentation *ossHostApi = NULL; + + PA_UNLESS( ossHostApi = (PaOSSHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaOSSHostApiRepresentation) ), + paInsufficientMemory ); + PA_UNLESS( ossHostApi->allocations = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + ossHostApi->hostApiIndex = hostApiIndex; + + /* Initialize host API structure */ + *hostApi = &ossHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paOSS; + (*hostApi)->info.name = "OSS"; + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PA_ENSURE( BuildDeviceList( ossHostApi ) ); + + PaUtil_InitializeStreamInterface( &ossHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &ossHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + mainThread_ = pthread_self(); + + return result; + +error: + if( ossHostApi ) + { + if( ossHostApi->allocations ) + { + PaUtil_FreeAllAllocations( ossHostApi->allocations ); + PaUtil_DestroyAllocationGroup( ossHostApi->allocations ); + } + + PaUtil_FreeMemory( ossHostApi ); + } + return result; +} + +PaError PaUtil_InitializeDeviceInfo( PaDeviceInfo *deviceInfo, const char *name, PaHostApiIndex hostApiIndex, int maxInputChannels, + int maxOutputChannels, PaTime defaultLowInputLatency, PaTime defaultLowOutputLatency, PaTime defaultHighInputLatency, + PaTime defaultHighOutputLatency, double defaultSampleRate, PaUtilAllocationGroup *allocations ) +{ + PaError result = paNoError; + + deviceInfo->structVersion = 2; + if( allocations ) + { + size_t len = strlen( name ) + 1; + PA_UNLESS( deviceInfo->name = PaUtil_GroupAllocateMemory( allocations, len ), paInsufficientMemory ); + strncpy( (char *)deviceInfo->name, name, len ); + } + else + deviceInfo->name = name; + + deviceInfo->hostApi = hostApiIndex; + deviceInfo->maxInputChannels = maxInputChannels; + deviceInfo->maxOutputChannels = maxOutputChannels; + deviceInfo->defaultLowInputLatency = defaultLowInputLatency; + deviceInfo->defaultLowOutputLatency = defaultLowOutputLatency; + deviceInfo->defaultHighInputLatency = defaultHighInputLatency; + deviceInfo->defaultHighOutputLatency = defaultHighOutputLatency; + deviceInfo->defaultSampleRate = defaultSampleRate; + +error: + return result; +} + +static PaError QueryDirection( const char *deviceName, StreamMode mode, double *defaultSampleRate, int *maxChannelCount, + double *defaultLowLatency, double *defaultHighLatency ) +{ + PaError result = paNoError; + int numChannels, maxNumChannels; + int busy = 0; + int devHandle = -1; + int sr; + *maxChannelCount = 0; /* Default value in case this fails */ + + if ( (devHandle = open( deviceName, (mode == StreamMode_In ? O_RDONLY : O_WRONLY) | O_NONBLOCK )) < 0 ) + { + if( errno == EBUSY || errno == EAGAIN ) + { + PA_DEBUG(( "%s: Device %s busy\n", __FUNCTION__, deviceName )); + } + else + { + PA_DEBUG(( "%s: Can't access device: %s\n", __FUNCTION__, strerror( errno ) )); + } + + return paDeviceUnavailable; + } + + /* Negotiate for the maximum number of channels for this device. PLB20010927 + * Consider up to 16 as the upper number of channels. + * Variable maxNumChannels should contain the actual upper limit after the call. + * Thanks to John Lazzaro and Heiko Purnhagen for suggestions. + */ + maxNumChannels = 0; + for( numChannels = 1; numChannels <= 16; numChannels++ ) + { + int temp = numChannels; + if( ioctl( devHandle, SNDCTL_DSP_CHANNELS, &temp ) < 0 ) + { + busy = EAGAIN == errno || EBUSY == errno; + /* ioctl() failed so bail out if we already have stereo */ + if( maxNumChannels >= 2 ) + break; + } + else + { + /* ioctl() worked but bail out if it does not support numChannels. + * We don't want to leave gaps in the numChannels supported. + */ + if( (numChannels > 2) && (temp != numChannels) ) + break; + if( temp > maxNumChannels ) + maxNumChannels = temp; /* Save maximum. */ + } + } + /* A: We're able to open a device for capture if it's busy playing back and vice versa, + * but we can't configure anything */ + if( 0 == maxNumChannels && busy ) + { + result = paDeviceUnavailable; + goto error; + } + + /* The above negotiation may fail for an old driver so try this older technique. */ + if( maxNumChannels < 1 ) + { + int stereo = 1; + if( ioctl( devHandle, SNDCTL_DSP_STEREO, &stereo ) < 0 ) + { + maxNumChannels = 1; + } + else + { + maxNumChannels = (stereo) ? 2 : 1; + } + PA_DEBUG(( "%s: use SNDCTL_DSP_STEREO, maxNumChannels = %d\n", __FUNCTION__, maxNumChannels )) + } + + /* During channel negotiation, the last ioctl() may have failed. This can + * also cause sample rate negotiation to fail. Hence the following, to return + * to a supported number of channels. SG20011005 */ + { + /* use most reasonable default value */ + int temp = PA_MIN( maxNumChannels, 2 ); + ENSURE_( ioctl( devHandle, SNDCTL_DSP_CHANNELS, &temp ), paUnanticipatedHostError ); + } + + /* Get supported sample rate closest to 44100 Hz */ + if( *defaultSampleRate < 0 ) + { + sr = 44100; + if( ioctl( devHandle, SNDCTL_DSP_SPEED, &sr ) < 0 ) + { + result = paUnanticipatedHostError; + goto error; + } + + *defaultSampleRate = sr; + } + + *maxChannelCount = maxNumChannels; + /* TODO */ + *defaultLowLatency = 512. / *defaultSampleRate; + *defaultHighLatency = 2048. / *defaultSampleRate; + +error: + if( devHandle >= 0 ) + close( devHandle ); + + return result; +} + +/** Query OSS device. + * + * This is where PaDeviceInfo objects are constructed and filled in with relevant information. + * + * Aspect DeviceCapabilities: The inferred device capabilities are recorded in a PaDeviceInfo object that is constructed + * in place. + */ +static PaError QueryDevice( char *deviceName, PaOSSHostApiRepresentation *ossApi, PaDeviceInfo **deviceInfo ) +{ + PaError result = paNoError; + double sampleRate = -1.; + int maxInputChannels, maxOutputChannels; + PaTime defaultLowInputLatency, defaultLowOutputLatency, defaultHighInputLatency, defaultHighOutputLatency; + PaError tmpRes = paNoError; + int busy = 0; + *deviceInfo = NULL; + + /* douglas: + we have to do this querying in a slightly different order. apparently + some sound cards will give you different info based on their settins. + e.g. a card might give you stereo at 22kHz but only mono at 44kHz. + the correct order for OSS is: format, channels, sample rate + */ + + /* Aspect StreamChannels: The number of channels supported for a device may depend on the mode it is + * opened in, it may have more channels available for capture than playback and vice versa. Therefore + * we will open the device in both read- and write-only mode to determine the supported number. + */ + if( (tmpRes = QueryDirection( deviceName, StreamMode_In, &sampleRate, &maxInputChannels, &defaultLowInputLatency, + &defaultHighInputLatency )) != paNoError ) + { + if( tmpRes != paDeviceUnavailable ) + { + PA_DEBUG(( "%s: Querying device %s for capture failed!\n", __FUNCTION__, deviceName )); + /* PA_ENSURE( tmpRes ); */ + } + ++busy; + } + if( (tmpRes = QueryDirection( deviceName, StreamMode_Out, &sampleRate, &maxOutputChannels, &defaultLowOutputLatency, + &defaultHighOutputLatency )) != paNoError ) + { + if( tmpRes != paDeviceUnavailable ) + { + PA_DEBUG(( "%s: Querying device %s for playback failed!\n", __FUNCTION__, deviceName )); + /* PA_ENSURE( tmpRes ); */ + } + ++busy; + } + assert( 0 <= busy && busy <= 2 ); + if( 2 == busy ) /* Both directions are unavailable to us */ + { + result = paDeviceUnavailable; + goto error; + } + + PA_UNLESS( *deviceInfo = PaUtil_GroupAllocateMemory( ossApi->allocations, sizeof (PaDeviceInfo) ), paInsufficientMemory ); + PA_ENSURE( PaUtil_InitializeDeviceInfo( *deviceInfo, deviceName, ossApi->hostApiIndex, maxInputChannels, maxOutputChannels, + defaultLowInputLatency, defaultLowOutputLatency, defaultHighInputLatency, defaultHighOutputLatency, sampleRate, + ossApi->allocations ) ); + +error: + return result; +} + +/** Query host devices. + * + * Loop over host devices and query their capabilitiesu + * + * Aspect DeviceCapabilities: This function calls QueryDevice on each device entry and receives a filled in PaDeviceInfo object + * per device, these are placed in the host api representation's deviceInfos array. + */ +static PaError BuildDeviceList( PaOSSHostApiRepresentation *ossApi ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *commonApi = &ossApi->inheritedHostApiRep; + int i; + int numDevices = 0, maxDeviceInfos = 1; + PaDeviceInfo **deviceInfos = NULL; + + /* These two will be set to the first working input and output device, respectively */ + commonApi->info.defaultInputDevice = paNoDevice; + commonApi->info.defaultOutputDevice = paNoDevice; + + /* Find devices by calling QueryDevice on each + * potential device names. When we find a valid one, + * add it to a linked list. + * A: Can there only be 10 devices? */ + + for( i = 0; i < 10; i++ ) + { + char deviceName[32]; + PaDeviceInfo *deviceInfo; + int testResult; + struct stat stbuf; + + if( i == 0 ) + snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE); + else + snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i); + + /* PA_DEBUG(("PaOSS BuildDeviceList: trying device %s\n", deviceName )); */ + if( stat( deviceName, &stbuf ) < 0 ) + { + if( ENOENT != errno ) + PA_DEBUG(( "%s: Error stat'ing %s: %s\n", __FUNCTION__, deviceName, strerror( errno ) )); + continue; + } + if( (testResult = QueryDevice( deviceName, ossApi, &deviceInfo )) != paNoError ) + { + if( testResult != paDeviceUnavailable ) + PA_ENSURE( testResult ); + + continue; + } + + ++numDevices; + if( !deviceInfos || numDevices > maxDeviceInfos ) + { + maxDeviceInfos *= 2; + PA_UNLESS( deviceInfos = (PaDeviceInfo **) realloc( deviceInfos, maxDeviceInfos * sizeof (PaDeviceInfo *) ), + paInsufficientMemory ); + } + deviceInfos[numDevices - 1] = deviceInfo; + + if( commonApi->info.defaultInputDevice == paNoDevice && deviceInfo->maxInputChannels > 0 ) + commonApi->info.defaultInputDevice = i; + if( commonApi->info.defaultOutputDevice == paNoDevice && deviceInfo->maxOutputChannels > 0 ) + commonApi->info.defaultOutputDevice = i; + } + + /* Make an array of PaDeviceInfo pointers out of the linked list */ + + PA_DEBUG(("PaOSS %s: Total number of devices found: %d\n", __FUNCTION__, numDevices)); + + commonApi->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + ossApi->allocations, sizeof(PaDeviceInfo*) * numDevices ); + memcpy( commonApi->deviceInfos, deviceInfos, numDevices * sizeof (PaDeviceInfo *) ); + + commonApi->info.deviceCount = numDevices; + +error: + free( deviceInfos ); + + return result; +} + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaOSSHostApiRepresentation *ossHostApi = (PaOSSHostApiRepresentation*)hostApi; + + if( ossHostApi->allocations ) + { + PaUtil_FreeAllAllocations( ossHostApi->allocations ); + PaUtil_DestroyAllocationGroup( ossHostApi->allocations ); + } + + PaUtil_FreeMemory( ossHostApi ); +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaError result = paNoError; + PaDeviceIndex device; + PaDeviceInfo *deviceInfo; + char *deviceName; + int inputChannelCount, outputChannelCount; + int tempDevHandle = -1; + int flags; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + if (inputChannelCount == 0 && outputChannelCount == 0) + return paInvalidChannelCount; + + /* if full duplex, make sure that they're the same device */ + + if (inputChannelCount > 0 && outputChannelCount > 0 && + inputParameters->device != outputParameters->device) + return paInvalidDevice; + + /* if full duplex, also make sure that they're the same number of channels */ + + if (inputChannelCount > 0 && outputChannelCount > 0 && + inputChannelCount != outputChannelCount) + return paInvalidChannelCount; + + /* open the device so we can do more tests */ + + if( inputChannelCount > 0 ) + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex(&device, inputParameters->device, hostApi); + if (result != paNoError) + return result; + } + else + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex(&device, outputParameters->device, hostApi); + if (result != paNoError) + return result; + } + + deviceInfo = hostApi->deviceInfos[device]; + deviceName = (char *)deviceInfo->name; + + flags = O_NONBLOCK; + if (inputChannelCount > 0 && outputChannelCount > 0) + flags |= O_RDWR; + else if (inputChannelCount > 0) + flags |= O_RDONLY; + else + flags |= O_WRONLY; + + ENSURE_( tempDevHandle = open( deviceInfo->name, flags ), paDeviceUnavailable ); + + /* PaOssStream_Configure will do the rest of the checking for us */ + /* PA_ENSURE( PaOssStream_Configure( tempDevHandle, deviceName, outputChannelCount, &sampleRate ) ); */ + + /* everything succeeded! */ + + error: + if( tempDevHandle >= 0 ) + close( tempDevHandle ); + + return result; +} + +/** Validate stream parameters. + * + * Aspect StreamChannels: We verify that the number of channels is within the allowed range for the device + */ +static PaError ValidateParameters( const PaStreamParameters *parameters, const PaDeviceInfo *deviceInfo, StreamMode mode ) +{ + int maxChans; + + assert( parameters ); + + if( parameters->device == paUseHostApiSpecificDeviceSpecification ) + { + return paInvalidDevice; + } + + maxChans = (mode == StreamMode_In ? deviceInfo->maxInputChannels : + deviceInfo->maxOutputChannels); + if( parameters->channelCount > maxChans ) + { + return paInvalidChannelCount; + } + + return paNoError; +} + +static PaError PaOssStreamComponent_Initialize( PaOssStreamComponent *component, const PaStreamParameters *parameters, + int callbackMode, int fd, const char *deviceName ) +{ + PaError result = paNoError; + assert( component ); + + memset( component, 0, sizeof (PaOssStreamComponent) ); + + component->fd = fd; + component->devName = deviceName; + component->userChannelCount = parameters->channelCount; + component->userFormat = parameters->sampleFormat; + component->latency = parameters->suggestedLatency; + component->userInterleaved = !(parameters->sampleFormat & paNonInterleaved); + + if( !callbackMode && !component->userInterleaved ) + { + /* Pre-allocate non-interleaved user provided buffers */ + PA_UNLESS( component->userBuffers = PaUtil_AllocateMemory( sizeof (void *) * component->userChannelCount ), + paInsufficientMemory ); + } + +error: + return result; +} + +static void PaOssStreamComponent_Terminate( PaOssStreamComponent *component ) +{ + assert( component ); + + if( component->fd >= 0 ) + close( component->fd ); + if( component->buffer ) + PaUtil_FreeMemory( component->buffer ); + + if( component->userBuffers ) + PaUtil_FreeMemory( component->userBuffers ); + + PaUtil_FreeMemory( component ); +} + +static PaError ModifyBlocking( int fd, int blocking ) +{ + PaError result = paNoError; + int fflags; + + ENSURE_( fflags = fcntl( fd, F_GETFL ), paUnanticipatedHostError ); + + if( blocking ) + fflags &= ~O_NONBLOCK; + else + fflags |= O_NONBLOCK; + + ENSURE_( fcntl( fd, F_SETFL, fflags ), paUnanticipatedHostError ); + +error: + return result; +} + +static PaError OpenDevices( const char *idevName, const char *odevName, int *idev, int *odev ) +{ + PaError result = paNoError; + int flags = O_NONBLOCK, duplex = 0; + int enableBits = 0; + *idev = *odev = -1; + + if( idevName && odevName ) + { + duplex = 1; + flags |= O_RDWR; + } + else if( idevName ) + flags |= O_RDONLY; + else + flags |= O_WRONLY; + + /* open first in nonblocking mode, in case it's busy... + * A: then unset the non-blocking attribute */ + assert( flags & O_NONBLOCK ); + if( idevName ) + { + ENSURE_( *idev = open( idevName, flags ), paDeviceUnavailable ); + PA_ENSURE( ModifyBlocking( *idev, 1 ) ); /* Blocking */ + + /* Initially disable */ + enableBits = ~PCM_ENABLE_INPUT; + ENSURE_( ioctl( *idev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + if( odevName ) + { + if( !idevName ) + { + ENSURE_( *odev = open( odevName, flags ), paDeviceUnavailable ); + PA_ENSURE( ModifyBlocking( *odev, 1 ) ); /* Blocking */ + + /* Initially disable */ + enableBits = ~PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( *odev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + else + { + ENSURE_( *odev = dup( *idev ), paUnanticipatedHostError ); + } + } + +error: + return result; +} + +static PaError PaOssStream_Initialize( PaOssStream *stream, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, + PaStreamCallback callback, void *userData, PaStreamFlags streamFlags, + PaOSSHostApiRepresentation *ossApi ) +{ + PaError result = paNoError; + int idev, odev; + PaUtilHostApiRepresentation *hostApi = &ossApi->inheritedHostApiRep; + const char *idevName = NULL, *odevName = NULL; + + assert( stream ); + + memset( stream, 0, sizeof (PaOssStream) ); + stream->isStopped = 1; + + PA_ENSURE( PaUtil_InitializeThreading( &stream->threading ) ); + + if( inputParameters && outputParameters ) + { + if( inputParameters->device == outputParameters->device ) + stream->sharedDevice = 1; + } + + if( inputParameters ) + idevName = hostApi->deviceInfos[inputParameters->device]->name; + if( outputParameters ) + odevName = hostApi->deviceInfos[outputParameters->device]->name; + PA_ENSURE( OpenDevices( idevName, odevName, &idev, &odev ) ); + if( inputParameters ) + { + PA_UNLESS( stream->capture = PaUtil_AllocateMemory( sizeof (PaOssStreamComponent) ), paInsufficientMemory ); + PA_ENSURE( PaOssStreamComponent_Initialize( stream->capture, inputParameters, callback != NULL, idev, idevName ) ); + } + if( outputParameters ) + { + PA_UNLESS( stream->playback = PaUtil_AllocateMemory( sizeof (PaOssStreamComponent) ), paInsufficientMemory ); + PA_ENSURE( PaOssStreamComponent_Initialize( stream->playback, outputParameters, callback != NULL, odev, odevName ) ); + } + + if( callback != NULL ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &ossApi->callbackStreamInterface, callback, userData ); + stream->callbackMode = 1; + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &ossApi->blockingStreamInterface, callback, userData ); + } + + ENSURE_( sem_init( &stream->semaphore, 0, 0 ), paInternalError ); + +error: + return result; +} + +static void PaOssStream_Terminate( PaOssStream *stream ) +{ + assert( stream ); + + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_TerminateThreading( &stream->threading ); + + if( stream->capture ) + PaOssStreamComponent_Terminate( stream->capture ); + if( stream->playback ) + PaOssStreamComponent_Terminate( stream->playback ); + + sem_destroy( &stream->semaphore ); + + PaUtil_FreeMemory( stream ); +} + +/** Translate from PA format to OSS native. + * + */ +static PaError Pa2OssFormat( PaSampleFormat paFormat, int *ossFormat ) +{ + switch( paFormat ) + { + case paUInt8: + *ossFormat = AFMT_U8; + break; + case paInt8: + *ossFormat = AFMT_S8; + break; + case paInt16: + *ossFormat = AFMT_S16_NE; + break; + default: + return paInternalError; /* This shouldn't happen */ + } + + return paNoError; +} + +/** Return the PA-compatible formats that this device can support. + * + */ +static PaError GetAvailableFormats( PaOssStreamComponent *component, PaSampleFormat *availableFormats ) +{ + PaError result = paNoError; + int mask = 0; + PaSampleFormat frmts = 0; + + ENSURE_( ioctl( component->fd, SNDCTL_DSP_GETFMTS, &mask ), paUnanticipatedHostError ); + if( mask & AFMT_U8 ) + frmts |= paUInt8; + if( mask & AFMT_S8 ) + frmts |= paInt8; + if( mask & AFMT_S16_NE ) + frmts |= paInt16; + else + result = paSampleFormatNotSupported; + + *availableFormats = frmts; + +error: + return result; +} + +static unsigned int PaOssStreamComponent_FrameSize( PaOssStreamComponent *component ) +{ + return Pa_GetSampleSize( component->hostFormat ) * component->hostChannelCount; +} + +/** Buffer size in bytes. + * + */ +static unsigned long PaOssStreamComponent_BufferSize( PaOssStreamComponent *component ) +{ + return PaOssStreamComponent_FrameSize( component ) * component->hostFrames * component->numBufs; +} + +static int CalcHigherLogTwo( int n ) +{ + int log2 = 0; + while( (1<userChannelCount; + int frgmt; + int numBufs; + int bytesPerBuf; + double bufSz; + unsigned long fragSz; + audio_buf_info bufInfo; + + /* We may have a situation where only one component (the master) is configured, if both point to the same device. + * In that case, the second component will copy settings from the other */ + if( !master ) + { + /* Aspect BufferSettings: If framesPerBuffer is unspecified we have to infer a suitable fragment size. + * The hardware need not respect the requested fragment size, so we may have to adapt. + */ + if( framesPerBuffer == paFramesPerBufferUnspecified ) + { + bufSz = component->latency * sampleRate; + fragSz = bufSz / 4; + } + else + { + fragSz = framesPerBuffer; + bufSz = component->latency * sampleRate + fragSz; /* Latency + 1 buffer */ + } + + PA_ENSURE( GetAvailableFormats( component, &availableFormats ) ); + hostFormat = PaUtil_SelectClosestAvailableFormat( availableFormats, component->userFormat ); + + /* OSS demands at least 2 buffers, and 16 bytes per buffer */ + numBufs = PA_MAX( bufSz / fragSz, 2 ); + bytesPerBuf = PA_MAX( fragSz * Pa_GetSampleSize( hostFormat ) * chans, 16 ); + + /* The fragment parameters are encoded like this: + * Most significant byte: number of fragments + * Least significant byte: exponent of fragment size (i.e., for 256, 8) + */ + frgmt = (numBufs << 16) + (CalcHigherLogTwo( bytesPerBuf ) & 0xffff); + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SETFRAGMENT, &frgmt ), paUnanticipatedHostError ); + + /* A: according to the OSS programmer's guide parameters should be set in this order: + * format, channels, rate */ + + /* This format should be deemed good before we get this far */ + PA_ENSURE( Pa2OssFormat( hostFormat, &temp ) ); + nativeFormat = temp; + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SETFMT, &temp ), paUnanticipatedHostError ); + PA_UNLESS( temp == nativeFormat, paInternalError ); + + /* try to set the number of channels */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_CHANNELS, &chans ), paSampleFormatNotSupported ); /* XXX: Should be paInvalidChannelCount? */ + /* It's possible that the minimum number of host channels is greater than what the user requested */ + PA_UNLESS( chans >= component->userChannelCount, paInvalidChannelCount ); + + /* try to set the sample rate */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SPEED, &sr ), paInvalidSampleRate ); + + /* reject if there's no sample rate within 1% of the one requested */ + if( (fabs( sampleRate - sr ) / sampleRate) > 0.01 ) + { + PA_DEBUG(("%s: Wanted %f, closest sample rate was %d\n", __FUNCTION__, sampleRate, sr )); + PA_ENSURE( paInvalidSampleRate ); + } + + ENSURE_( ioctl( component->fd, streamMode == StreamMode_In ? SNDCTL_DSP_GETISPACE : SNDCTL_DSP_GETOSPACE, &bufInfo ), + paUnanticipatedHostError ); + component->numBufs = bufInfo.fragstotal; + + /* This needs to be the last ioctl call before the first read/write, according to the OSS programmer's guide */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_GETBLKSIZE, &bytesPerBuf ), paUnanticipatedHostError ); + + component->hostFrames = bytesPerBuf / Pa_GetSampleSize( hostFormat ) / chans; + component->hostChannelCount = chans; + component->hostFormat = hostFormat; + } + else + { + component->hostFormat = master->hostFormat; + component->hostFrames = master->hostFrames; + component->hostChannelCount = master->hostChannelCount; + component->numBufs = master->numBufs; + } + + PA_UNLESS( component->buffer = PaUtil_AllocateMemory( PaOssStreamComponent_BufferSize( component ) ), + paInsufficientMemory ); + +error: + return result; +} + +static PaError PaOssStreamComponent_Read( PaOssStreamComponent *component, unsigned long *frames ) +{ + PaError result = paNoError; + size_t len = *frames * PaOssStreamComponent_FrameSize( component ); + ssize_t bytesRead; + + ENSURE_( bytesRead = read( component->fd, component->buffer, len ), paUnanticipatedHostError ); + *frames = bytesRead / PaOssStreamComponent_FrameSize( component ); + /* TODO: Handle condition where number of frames read doesn't equal number of frames requested */ + +error: + return result; +} + +static PaError PaOssStreamComponent_Write( PaOssStreamComponent *component, unsigned long *frames ) +{ + PaError result = paNoError; + size_t len = *frames * PaOssStreamComponent_FrameSize( component ); + ssize_t bytesWritten; + + ENSURE_( bytesWritten = write( component->fd, component->buffer, len ), paUnanticipatedHostError ); + *frames = bytesWritten / PaOssStreamComponent_FrameSize( component ); + /* TODO: Handle condition where number of frames written doesn't equal number of frames requested */ + +error: + return result; +} + +/** Configure the stream according to input/output parameters. + * + * Aspect StreamChannels: The minimum number of channels supported by the device may exceed that requested by + * the user, if so we'll record the actual number of host channels and adapt later. + */ +static PaError PaOssStream_Configure( PaOssStream *stream, double sampleRate, unsigned long framesPerBuffer, + double *inputLatency, double *outputLatency ) +{ + PaError result = paNoError; + int duplex = stream->capture && stream->playback; + unsigned long framesPerHostBuffer = 0; + + /* We should request full duplex first thing after opening the device */ + if( duplex && stream->sharedDevice ) + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETDUPLEX, 0 ), paUnanticipatedHostError ); + + if( stream->capture ) + { + PaOssStreamComponent *component = stream->capture; + PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_In, NULL ); + + assert( component->hostChannelCount > 0 ); + assert( component->hostFrames > 0 ); + + *inputLatency = component->hostFrames * (component->numBufs - 1) / sampleRate; + } + if( stream->playback ) + { + PaOssStreamComponent *component = stream->playback, *master = stream->sharedDevice ? stream->capture : NULL; + PA_ENSURE( PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_Out, + master ) ); + + assert( component->hostChannelCount > 0 ); + assert( component->hostFrames > 0 ); + + *outputLatency = component->hostFrames * (component->numBufs - 1) / sampleRate; + } + + if( duplex ) + framesPerHostBuffer = PA_MIN( stream->capture->hostFrames, stream->playback->hostFrames ); + else if( stream->capture ) + framesPerHostBuffer = stream->capture->hostFrames; + else if( stream->playback ) + framesPerHostBuffer = stream->playback->hostFrames; + + stream->framesPerHostBuffer = framesPerHostBuffer; + stream->pollTimeout = (int) ceil( 1e6 * framesPerHostBuffer / sampleRate ); /* Period in usecs, rounded up */ + + stream->sampleRate = stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + +error: + return result; +} + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +/** Open a PA OSS stream. + * + * Aspect StreamChannels: The number of channels is specified per direction (in/out), and can differ between the + * two. However, OSS doesn't support separate configuration spaces for capture and playback so if both + * directions are the same device we will demand the same number of channels. The number of channels can range + * from 1 to the maximum supported by the device. + * + * Aspect BufferSettings: If framesPerBuffer != paFramesPerBufferUnspecified the number of frames per callback + * must reflect this, in addition the host latency per device should approximate the corresponding + * suggestedLatency. Based on these constraints we need to determine a number of frames per host buffer that + * both capture and playback can agree on (they can be different devices), the buffer processor can adapt + * between host and user buffer size, but the ratio should preferably be integral. + */ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaOSSHostApiRepresentation *ossHostApi = (PaOSSHostApiRepresentation*)hostApi; + PaOssStream *stream = NULL; + int inputChannelCount = 0, outputChannelCount = 0; + PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0, inputHostFormat = 0, outputHostFormat = 0; + const PaDeviceInfo *inputDeviceInfo = 0, *outputDeviceInfo = 0; + int bpInitialized = 0; + double inLatency, outLatency; + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + if( inputParameters ) + { + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + inputDeviceInfo = hostApi->deviceInfos[inputParameters->device]; + PA_ENSURE( ValidateParameters( inputParameters, inputDeviceInfo, StreamMode_In ) ); + + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + } + if( outputParameters ) + { + outputDeviceInfo = hostApi->deviceInfos[outputParameters->device]; + PA_ENSURE( ValidateParameters( outputParameters, outputDeviceInfo, StreamMode_Out ) ); + + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + } + + /* Aspect StreamChannels: We currently demand that number of input and output channels are the same, if the same + * device is opened for both directions + */ + if( inputChannelCount > 0 && outputChannelCount > 0 ) + { + if( inputParameters->device == outputParameters->device ) + { + if( inputParameters->channelCount != outputParameters->channelCount ) + return paInvalidChannelCount; + } + } + + /* allocate and do basic initialization of the stream structure */ + PA_UNLESS( stream = (PaOssStream*)PaUtil_AllocateMemory( sizeof(PaOssStream) ), paInsufficientMemory ); + PA_ENSURE( PaOssStream_Initialize( stream, inputParameters, outputParameters, streamCallback, userData, streamFlags, ossHostApi ) ); + + PA_ENSURE( PaOssStream_Configure( stream, sampleRate, framesPerBuffer, &inLatency, &outLatency ) ); + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + if( inputParameters ) + { + inputHostFormat = stream->capture->hostFormat; + stream->streamRepresentation.streamInfo.inputLatency = inLatency + + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor ) / sampleRate; + } + if( outputParameters ) + { + outputHostFormat = stream->playback->hostFormat; + stream->streamRepresentation.streamInfo.outputLatency = outLatency + + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor ) / sampleRate; + } + + /* Initialize buffer processor with fixed host buffer size. + * Aspect StreamSampleFormat: Here we commit the user and host sample formats, PA infrastructure will + * convert between the two. + */ + PA_ENSURE( PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, inputHostFormat, outputChannelCount, outputSampleFormat, + outputHostFormat, sampleRate, streamFlags, framesPerBuffer, stream->framesPerHostBuffer, + paUtilFixedHostBufferSize, streamCallback, userData ) ); + bpInitialized = 1; + + *s = (PaStream*)stream; + + return result; + +error: + if( bpInitialized ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + if( stream ) + PaOssStream_Terminate( stream ); + + return result; +} + +/*! Poll on I/O filedescriptors. + + Poll till we've determined there's data for read or write. In the full-duplex case, + we don't want to hang around forever waiting for either input or output frames, so + whenever we have a timed out filedescriptor we check if we're nearing under/overrun + for the other direction (critical limit set at one buffer). If so, we exit the waiting + state, and go on with what we got. We align the number of frames on a host buffer + boundary because it is possible that the buffer size differs for the two directions and + the host buffer size is a compromise between the two. + */ +static PaError PaOssStream_WaitForFrames( PaOssStream *stream, unsigned long *frames ) +{ + PaError result = paNoError; + int pollPlayback = 0, pollCapture = 0; + int captureAvail = INT_MAX, playbackAvail = INT_MAX, commonAvail; + audio_buf_info bufInfo; + /* int ofs = 0, nfds = stream->nfds; */ + fd_set readFds, writeFds; + int nfds = 0; + struct timeval selectTimeval = {0, 0}; + unsigned long timeout = stream->pollTimeout; /* In usecs */ + int captureFd = -1, playbackFd = -1; + + assert( stream ); + assert( frames ); + + if( stream->capture ) + { + pollCapture = 1; + captureFd = stream->capture->fd; + /* stream->capture->pfd->events = POLLIN; */ + } + if( stream->playback ) + { + pollPlayback = 1; + playbackFd = stream->playback->fd; + /* stream->playback->pfd->events = POLLOUT; */ + } + + FD_ZERO( &readFds ); + FD_ZERO( &writeFds ); + + while( pollPlayback || pollCapture ) + { + pthread_testcancel(); + + /* select may modify the timeout parameter */ + selectTimeval.tv_usec = timeout; + nfds = 0; + + if( pollCapture ) + { + FD_SET( captureFd, &readFds ); + nfds = captureFd + 1; + } + if( pollPlayback ) + { + FD_SET( playbackFd, &writeFds ); + nfds = PA_MAX( nfds, playbackFd + 1 ); + } + ENSURE_( select( nfds, &readFds, &writeFds, NULL, &selectTimeval ), paUnanticipatedHostError ); + /* + if( poll( stream->pfds + ofs, nfds, stream->pollTimeout ) < 0 ) + { + + ENSURE_( -1, paUnanticipatedHostError ); + } + */ + pthread_testcancel(); + + if( pollCapture ) + { + if( FD_ISSET( captureFd, &readFds ) ) + { + FD_CLR( captureFd, &readFds ); + pollCapture = 0; + } + /* + if( stream->capture->pfd->revents & POLLIN ) + { + --nfds; + ++ofs; + pollCapture = 0; + } + */ + else if( stream->playback ) /* Timed out, go on with playback? */ + { + /*PA_DEBUG(( "%s: Trying to poll again for capture frames, pollTimeout: %d\n", + __FUNCTION__, stream->pollTimeout ));*/ + } + } + if( pollPlayback ) + { + if( FD_ISSET( playbackFd, &writeFds ) ) + { + FD_CLR( playbackFd, &writeFds ); + pollPlayback = 0; + } + /* + if( stream->playback->pfd->revents & POLLOUT ) + { + --nfds; + pollPlayback = 0; + } + */ + else if( stream->capture ) /* Timed out, go on with capture? */ + { + /*PA_DEBUG(( "%s: Trying to poll again for playback frames, pollTimeout: %d\n\n", + __FUNCTION__, stream->pollTimeout ));*/ + } + } + } + + if( stream->capture ) + { + ENSURE_( ioctl( captureFd, SNDCTL_DSP_GETISPACE, &bufInfo ), paUnanticipatedHostError ); + captureAvail = bufInfo.fragments * stream->capture->hostFrames; + if( !captureAvail ) + PA_DEBUG(( "%s: captureAvail: 0\n", __FUNCTION__ )); + + captureAvail = captureAvail == 0 ? INT_MAX : captureAvail; /* Disregard if zero */ + } + if( stream->playback ) + { + ENSURE_( ioctl( playbackFd, SNDCTL_DSP_GETOSPACE, &bufInfo ), paUnanticipatedHostError ); + playbackAvail = bufInfo.fragments * stream->playback->hostFrames; + if( !playbackAvail ) + { + PA_DEBUG(( "%s: playbackAvail: 0\n", __FUNCTION__ )); + } + + playbackAvail = playbackAvail == 0 ? INT_MAX : playbackAvail; /* Disregard if zero */ + } + + commonAvail = PA_MIN( captureAvail, playbackAvail ); + if( commonAvail == INT_MAX ) + commonAvail = 0; + commonAvail -= commonAvail % stream->framesPerHostBuffer; + + assert( commonAvail != INT_MAX ); + assert( commonAvail >= 0 ); + *frames = commonAvail; + +error: + return result; +} + +/** Prepare stream for capture/playback. + * + * In order to synchronize capture and playback properly we use the SETTRIGGER command. + */ +static PaError PaOssStream_Prepare( PaOssStream *stream ) +{ + PaError result = paNoError; + int enableBits = 0; + + if( stream->triggered ) + return result; + + if( stream->playback ) + { + size_t bufSz = PaOssStreamComponent_BufferSize( stream->playback ); + memset( stream->playback->buffer, 0, bufSz ); + + /* Looks like we have to turn off blocking before we try this, but if we don't fill the buffer + * OSS will complain. */ + PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); + while (1) + { + if( write( stream->playback->fd, stream->playback->buffer, bufSz ) < 0 ) + break; + } + PA_ENSURE( ModifyBlocking( stream->playback->fd, 1 ) ); + } + + if( stream->sharedDevice ) + { + enableBits = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + else + { + if( stream->capture ) + { + enableBits = PCM_ENABLE_INPUT; + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + if( stream->playback ) + { + enableBits = PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( stream->playback->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + } + + /* Ok, we have triggered the stream */ + stream->triggered = 1; + +error: + return result; +} + +/** Stop audio processing + * + */ +static PaError PaOssStream_Stop( PaOssStream *stream, int abort ) +{ + PaError result = paNoError; + + /* Looks like the only safe way to stop audio without reopening the device is SNDCTL_DSP_POST. + * Also disable capture/playback till the stream is started again */ + if( stream->capture ) + { + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); + } + if( stream->playback && !stream->sharedDevice ) + { + ENSURE_( ioctl( stream->playback->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); + } + +error: + return result; +} + +/** Clean up after thread exit. + * + * Aspect StreamState: If the user has registered a streamFinishedCallback it will be called here + */ +static void OnExit( void *data ) +{ + PaOssStream *stream = (PaOssStream *) data; + assert( data ); + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + PaOssStream_Stop( stream, stream->callbackAbort ); + + PA_DEBUG(( "OnExit: Stoppage\n" )); + + /* Eventually notify user all buffers have played */ + if( stream->streamRepresentation.streamFinishedCallback ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + + stream->callbackAbort = 0; /* Clear state */ + stream->isActive = 0; +} + +static PaError SetUpBuffers( PaOssStream *stream, unsigned long framesAvail ) +{ + PaError result = paNoError; + + if( stream->capture ) + { + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, stream->capture->buffer, + stream->capture->hostChannelCount ); + PaUtil_SetInputFrameCount( &stream->bufferProcessor, framesAvail ); + } + if( stream->playback ) + { + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, stream->playback->buffer, + stream->playback->hostChannelCount ); + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, framesAvail ); + } + + return result; +} + +/** Thread procedure for callback processing. + * + * Aspect StreamState: StartStream will wait on this to initiate audio processing, useful in case the + * callback should be used for buffer priming. When the stream is cancelled a separate function will + * take care of the transition to the Callback Finished state (the stream isn't considered Stopped + * before StopStream() or AbortStream() are called). + */ +static void *PaOSS_AudioThreadProc( void *userData ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)userData; + unsigned long framesAvail, framesProcessed; + int callbackResult = paContinue; + int triggered = stream->triggered; /* See if SNDCTL_DSP_TRIGGER has been issued already */ + int initiateProcessing = triggered; /* Already triggered? */ + PaStreamCallbackFlags cbFlags = 0; /* We might want to keep state across iterations */ + + /* +#if ( SOUND_VERSION > 0x030904 ) + audio_errinfo errinfo; +#endif +*/ + + assert( stream ); + + pthread_cleanup_push( &OnExit, stream ); /* Execute OnExit when exiting */ + + /* The first time the stream is started we use SNDCTL_DSP_TRIGGER to accurately start capture and + * playback in sync, when the stream is restarted after being stopped we simply start by reading/ + * writing. + */ + PA_ENSURE( PaOssStream_Prepare( stream ) ); + + /* If we are to initiate processing implicitly by reading/writing data, we start off in blocking mode */ + if( initiateProcessing ) + { + /* Make sure devices are in blocking mode */ + if( stream->capture ) + ModifyBlocking( stream->capture->fd, 1 ); + if( stream->playback ) + ModifyBlocking( stream->playback->fd, 1 ); + } + + while( 1 ) + { + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* TODO: IMPLEMENT ME */ + + pthread_testcancel(); + + if( stream->callbackStop && callbackResult == paContinue ) + { + PA_DEBUG(( "Setting callbackResult to paComplete\n" )); + callbackResult = paComplete; + } + + /* Aspect StreamState: Because of the messy OSS scheme we can't explicitly trigger device start unless + * the stream has been recently started, we will have to go right ahead and read/write in blocking + * fashion to trigger operation. Therefore we begin with processing one host buffer before we switch + * to non-blocking mode. + */ + if( !initiateProcessing ) + { + PA_ENSURE( PaOssStream_WaitForFrames( stream, &framesAvail ) ); /* Wait on available frames */ + assert( framesAvail % stream->framesPerHostBuffer == 0 ); + } + else + { + framesAvail = stream->framesPerHostBuffer; + } + + while( framesAvail > 0 ) + { + unsigned long frames = framesAvail; + + pthread_testcancel(); + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + /* Read data */ + if ( stream->capture ) + { + PA_ENSURE( PaOssStreamComponent_Read( stream->capture, &frames ) ); + assert( frames == framesAvail ); + } + +#if ( SOUND_VERSION >= 0x030904 ) + /* + Check with OSS to see if there have been any under/overruns + since last time we checked. + */ + /* + if( ioctl( stream->deviceHandle, SNDCTL_DSP_GETERROR, &errinfo ) >= 0 ) + { + if( errinfo.play_underruns ) + cbFlags |= paOutputUnderflow ; + if( errinfo.record_underruns ) + cbFlags |= paInputUnderflow ; + } + else + PA_DEBUG(( "SNDCTL_DSP_GETERROR command failed: %s\n", strerror( errno ) )); + */ +#endif + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, + cbFlags ); + cbFlags = 0; + PA_ENSURE( SetUpBuffers( stream, framesAvail ) ); + + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, + &callbackResult ); + assert( framesProcessed == framesAvail ); + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + if ( stream->playback ) + { + frames = framesAvail; + + PA_ENSURE( PaOssStreamComponent_Write( stream->playback, &frames ) ); + assert( frames == framesAvail ); + + /* TODO: handle bytesWritten != bytesRequested (slippage?) */ + } + + framesAvail -= framesProcessed; + stream->framesProcessed += framesProcessed; + + if( callbackResult != paContinue ) + break; + } + + if( initiateProcessing || !triggered ) + { + /* Non-blocking */ + if( stream->capture ) + PA_ENSURE( ModifyBlocking( stream->capture->fd, 0 ) ); + if( stream->playback && !stream->sharedDevice ) + PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); + + initiateProcessing = 0; + sem_post( &stream->semaphore ); + } + + if( callbackResult != paContinue ) + { + stream->callbackAbort = callbackResult == paAbort; + if( stream->callbackAbort || PaUtil_IsBufferProcessorOutputEmpty( &stream->bufferProcessor ) ) + break; + } + } + + pthread_cleanup_pop( 1 ); + +error: + pthread_exit( NULL ); +} + +/** Close the stream. + * + */ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)s; + + assert( stream ); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaOssStream_Terminate( stream ); + + return result; +} + +/** Start the stream. + * + * Aspect StreamState: After returning, the stream shall be in the Active state, implying that an eventual + * callback will be repeatedly called in a separate thread. If a separate thread is started this function + * will block untill it has started processing audio, otherwise audio processing is started directly. + */ +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)s; + + stream->isActive = 1; + stream->isStopped = 0; + stream->lastPosPtr = 0; + stream->lastStreamBytes = 0; + stream->framesProcessed = 0; + + /* only use the thread for callback streams */ + if( stream->bufferProcessor.streamCallback ) + { + PA_ENSURE( PaUtil_StartThreading( &stream->threading, &PaOSS_AudioThreadProc, stream ) ); + sem_wait( &stream->semaphore ); + } + else + PA_ENSURE( PaOssStream_Prepare( stream ) ); + +error: + return result; +} + +static PaError RealStop( PaOssStream *stream, int abort ) +{ + PaError result = paNoError; + + if( stream->callbackMode ) + { + if( abort ) + stream->callbackAbort = 1; + else + stream->callbackStop = 1; + + PA_ENSURE( PaUtil_CancelThreading( &stream->threading, !abort, NULL ) ); + + stream->callbackStop = stream->callbackAbort = 0; + } + else + PA_ENSURE( PaOssStream_Stop( stream, abort ) ); + + stream->isStopped = 1; + +error: + return result; +} + +/** Stop the stream. + * + * Aspect StreamState: This will cause the stream to transition to the Stopped state, playing all enqueued + * buffers. + */ +static PaError StopStream( PaStream *s ) +{ + return RealStop( (PaOssStream *)s, 0 ); +} + +/** Abort the stream. + * + * Aspect StreamState: This will cause the stream to transition to the Stopped state, discarding all enqueued + * buffers. Note that the buffers are not currently correctly discarded, this is difficult without closing + * the OSS device. + */ +static PaError AbortStream( PaStream *s ) +{ + return RealStop( (PaOssStream *)s, 1 ); +} + +/** Is the stream in the Stopped state. + * + */ +static PaError IsStreamStopped( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return (stream->isStopped); +} + +/** Is the stream in the Active state. + * + */ +static PaError IsStreamActive( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return (stream->isActive); +} + +static PaTime GetStreamTime( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + count_info info; + int delta; + + if( stream->playback ) { + if( ioctl( stream->playback->fd, SNDCTL_DSP_GETOPTR, &info) == 0 ) { + delta = ( info.bytes - stream->lastPosPtr ) /* & 0x000FFFFF*/; + return (float)(stream->lastStreamBytes + delta) / PaOssStreamComponent_FrameSize( stream->playback ) / stream->sampleRate; + } + } + else { + if (ioctl( stream->capture->fd, SNDCTL_DSP_GETIPTR, &info) == 0) { + delta = (info.bytes - stream->lastPosPtr) /*& 0x000FFFFF*/; + return (float)(stream->lastStreamBytes + delta) / PaOssStreamComponent_FrameSize( stream->capture ) / stream->sampleRate; + } + } + + /* the ioctl failed, but we can still give a coarse estimate */ + + return stream->framesProcessed / stream->sampleRate; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaOssStream *stream = (PaOssStream*)s; + int bytesRequested, bytesRead; + unsigned long framesRequested; + void *userBuffer; + + /* If user input is non-interleaved, PaUtil_CopyInput will manipulate the channel pointers, + * so we copy the user provided pointers */ + if( stream->bufferProcessor.userInputIsInterleaved ) + userBuffer = buffer; + else /* Copy channels into local array */ + { + userBuffer = stream->capture->userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->capture->userChannelCount ); + } + + while( frames ) + { + framesRequested = PA_MIN( frames, stream->capture->hostFrames ); + + bytesRequested = framesRequested * PaOssStreamComponent_FrameSize( stream->capture ); + bytesRead = read( stream->capture->fd, stream->capture->buffer, bytesRequested ); + if ( bytesRequested != bytesRead ) + return paUnanticipatedHostError; + + PaUtil_SetInputFrameCount( &stream->bufferProcessor, stream->capture->hostFrames ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, stream->capture->buffer, stream->capture->hostChannelCount ); + PaUtil_CopyInput( &stream->bufferProcessor, &userBuffer, framesRequested ); + frames -= framesRequested; + } + return paNoError; +} + + +static PaError WriteStream( PaStream *s, const void *buffer, unsigned long frames ) +{ + PaOssStream *stream = (PaOssStream*)s; + int bytesRequested, bytesWritten; + unsigned long framesConverted; + const void *userBuffer; + + /* If user output is non-interleaved, PaUtil_CopyOutput will manipulate the channel pointers, + * so we copy the user provided pointers */ + if( stream->bufferProcessor.userOutputIsInterleaved ) + userBuffer = buffer; + else + { + /* Copy channels into local array */ + userBuffer = stream->playback->userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->playback->userChannelCount ); + } + + while( frames ) + { + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, stream->playback->hostFrames ); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, stream->playback->buffer, stream->playback->hostChannelCount ); + + framesConverted = PaUtil_CopyOutput( &stream->bufferProcessor, &userBuffer, frames ); + frames -= framesConverted; + + bytesRequested = framesConverted * PaOssStreamComponent_FrameSize( stream->playback ); + bytesWritten = write( stream->playback->fd, stream->playback->buffer, bytesRequested ); + + if ( bytesRequested != bytesWritten ) + return paUnanticipatedHostError; + } + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + audio_buf_info info; + + if( ioctl( stream->capture->fd, SNDCTL_DSP_GETISPACE, &info ) < 0 ) + return paUnanticipatedHostError; + return info.fragments * stream->capture->hostFrames; +} + + +/* TODO: Compute number of allocated bytes somewhere else, can we use ODELAY with capture */ +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + int delay = 0; + + if( ioctl( stream->playback->fd, SNDCTL_DSP_GETODELAY, &delay ) < 0 ) + return paUnanticipatedHostError; + + return (PaOssStreamComponent_BufferSize( stream->playback ) - delay) / PaOssStreamComponent_FrameSize( stream->playback ); +} + diff --git a/portaudio-v19/pa_unix_oss/recplay.c b/portaudio-v19/pa_unix_oss/recplay.c new file mode 100644 index 000000000..9d4c78cfa --- /dev/null +++ b/portaudio-v19/pa_unix_oss/recplay.c @@ -0,0 +1,114 @@ +/* + * recplay.c + * Phil Burk + * Minimal record and playback test. + * + */ +#include +#include +#include +#ifndef __STDC__ +/* #include */ +#endif /* __STDC__ */ +#include +#ifdef __STDC__ +#include +#else /* __STDC__ */ +#include +#endif /* __STDC__ */ +#include + +#define NUM_BYTES (64*1024) +#define BLOCK_SIZE (4*1024) + +#define AUDIO "/dev/dsp" + +char buffer[NUM_BYTES]; + +int audioDev = 0; + +main (int argc, char *argv[]) +{ + int numLeft; + char *ptr; + int num; + int samplesize; + + /********** RECORD ********************/ + /* Open audio device. */ + audioDev = open (AUDIO, O_RDONLY, 0); + if (audioDev == -1) + { + perror (AUDIO); + exit (-1); + } + + /* Set to 16 bit samples. */ + samplesize = 16; + ioctl(audioDev, SNDCTL_DSP_SAMPLESIZE, &samplesize); + if (samplesize != 16) + { + perror("Unable to set the sample size."); + exit(-1); + } + + /* Record in blocks */ + printf("Begin recording.\n"); + numLeft = NUM_BYTES; + ptr = buffer; + while( numLeft >= BLOCK_SIZE ) + { + if ( (num = read (audioDev, ptr, BLOCK_SIZE)) < 0 ) + { + perror (AUDIO); + exit (-1); + } + else + { + printf("Read %d bytes\n", num); + ptr += num; + numLeft -= num; + } + } + + close( audioDev ); + + /********** PLAYBACK ********************/ + /* Open audio device for writing. */ + audioDev = open (AUDIO, O_WRONLY, 0); + if (audioDev == -1) + { + perror (AUDIO); + exit (-1); + } + + /* Set to 16 bit samples. */ + samplesize = 16; + ioctl(audioDev, SNDCTL_DSP_SAMPLESIZE, &samplesize); + if (samplesize != 16) + { + perror("Unable to set the sample size."); + exit(-1); + } + + /* Play in blocks */ + printf("Begin playing.\n"); + numLeft = NUM_BYTES; + ptr = buffer; + while( numLeft >= BLOCK_SIZE ) + { + if ( (num = write (audioDev, ptr, BLOCK_SIZE)) < 0 ) + { + perror (AUDIO); + exit (-1); + } + else + { + printf("Wrote %d bytes\n", num); + ptr += num; + numLeft -= num; + } + } + + close( audioDev ); +} diff --git a/portaudio-v19/pa_win/dev-cpp/Makefile-dll b/portaudio-v19/pa_win/dev-cpp/Makefile-dll new file mode 100644 index 000000000..856af638e --- /dev/null +++ b/portaudio-v19/pa_win/dev-cpp/Makefile-dll @@ -0,0 +1,78 @@ +# Project: portaudio-dll +# Makefile created by Dev-C++ 4.9.8.2 + +CPP = g++.exe +CC = gcc.exe +WINDRES = windres.exe +RES = +OBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) +LINKOBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) +LIBS = -L"C:/Dev-CPP/lib" -fmessage-length=0 --no-export-all-symbols --add-stdcall-alias ../../../asiosdk2/asiosdk2.a -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm -O3 -s +INCS = -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" +CXXINCS = -I"C:/Dev-CPP/include/c++" -I"C:/Dev-CPP/include/c++/mingw32" -I"C:/Dev-CPP/include/c++/backward" -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" +BIN = portaudio-dll.dll +CXXFLAGS = $(CXXINCS)-O3 -fmessage-length=0 -Wall +CFLAGS = $(INCS)-DBUILDING_DLL=1 -O3 -fmessage-length=0 -Wall + +.PHONY: all all-before all-after clean clean-custom + +all: all-before portaudio-dll.dll all-after + + +clean: clean-custom + rm -f $(OBJ) $(BIN) + +DLLWRAP=dllwrap.exe +DEFFILE=libportaudio-dll.def +STATICLIB=libportaudio-dll.a + +$(BIN): $(LINKOBJ) + $(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(LINKOBJ) $(LIBS) -o $(BIN) + +./pa_skeleton.o: ../../pa_common/pa_skeleton.c + $(CPP) -c ../../pa_common/pa_skeleton.c -o ./pa_skeleton.o $(CXXFLAGS) + +./pa_stream.o: ../../pa_common/pa_stream.c + $(CPP) -c ../../pa_common/pa_stream.c -o ./pa_stream.o $(CXXFLAGS) + +./pa_trace.o: ../../pa_common/pa_trace.c + $(CPP) -c ../../pa_common/pa_trace.c -o ./pa_trace.o $(CXXFLAGS) + +./pa_allocation.o: ../../pa_common/pa_allocation.c + $(CPP) -c ../../pa_common/pa_allocation.c -o ./pa_allocation.o $(CXXFLAGS) + +./pa_converters.o: ../../pa_common/pa_converters.c + $(CPP) -c ../../pa_common/pa_converters.c -o ./pa_converters.o $(CXXFLAGS) + +./pa_cpuload.o: ../../pa_common/pa_cpuload.c + $(CPP) -c ../../pa_common/pa_cpuload.c -o ./pa_cpuload.o $(CXXFLAGS) + +./pa_dither.o: ../../pa_common/pa_dither.c + $(CPP) -c ../../pa_common/pa_dither.c -o ./pa_dither.o $(CXXFLAGS) + +./pa_front.o: ../../pa_common/pa_front.c + $(CPP) -c ../../pa_common/pa_front.c -o ./pa_front.o $(CXXFLAGS) + +./pa_process.o: ../../pa_common/pa_process.c + $(CPP) -c ../../pa_common/pa_process.c -o ./pa_process.o $(CXXFLAGS) + +./pa_asio.o: ../../pa_asio/pa_asio.cpp + $(CPP) -c ../../pa_asio/pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) + +./pa_win_util.o: ../pa_win_util.c + $(CPP) -c ../pa_win_util.c -o ./pa_win_util.o $(CXXFLAGS) + +./pa_win_hostapis.o: ../pa_win_hostapis.c + $(CPP) -c ../pa_win_hostapis.c -o ./pa_win_hostapis.o $(CXXFLAGS) + +./pa_win_ds.o: ../../pa_win_ds/pa_win_ds.c + $(CPP) -c ../../pa_win_ds/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS) + +./dsound_wrapper.o: ../../pa_win_ds/dsound_wrapper.c + $(CPP) -c ../../pa_win_ds/dsound_wrapper.c -o ./dsound_wrapper.o $(CXXFLAGS) + +./pa_win_wmme.o: ../../pa_win_wmme/pa_win_wmme.c + $(CPP) -c ../../pa_win_wmme/pa_win_wmme.c -o ./pa_win_wmme.o $(CXXFLAGS) + +./iasiothiscallresolver.o: ../../pa_asio/iasiothiscallresolver.cpp + $(CPP) -c ../../pa_asio/iasiothiscallresolver.cpp -o ./iasiothiscallresolver.o $(CXXFLAGS) diff --git a/portaudio-v19/pa_win/dev-cpp/Makefile-static b/portaudio-v19/pa_win/dev-cpp/Makefile-static new file mode 100644 index 000000000..2a1647ddc --- /dev/null +++ b/portaudio-v19/pa_win/dev-cpp/Makefile-static @@ -0,0 +1,75 @@ +# Project: portaudio-static +# Makefile created by Dev-C++ 4.9.8.2 + +CPP = g++.exe +CC = gcc.exe +WINDRES = windres.exe +RES = +OBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) +LINKOBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) +LIBS = -L"C:/Dev-CPP/lib" -fmessage-length=0 -O3 -s +INCS = -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" +CXXINCS = -I"C:/Dev-CPP/include/c++" -I"C:/Dev-CPP/include/c++/mingw32" -I"C:/Dev-CPP/include/c++/backward" -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" +BIN = portaudio-static.a +CXXFLAGS = $(CXXINCS)-O3 -fmessage-length=0 -Wall +CFLAGS = $(INCS)-O3 -fmessage-length=0 -Wall + +.PHONY: all all-before all-after clean clean-custom + +all: all-before portaudio-static.a all-after + + +clean: clean-custom + rm -f $(OBJ) $(BIN) + +$(BIN): $(LINKOBJ) + ar r $(BIN) $(LINKOBJ) + ranlib $(BIN) + +./pa_skeleton.o: ../../pa_common/pa_skeleton.c + $(CPP) -c ../../pa_common/pa_skeleton.c -o ./pa_skeleton.o $(CXXFLAGS) + +./pa_stream.o: ../../pa_common/pa_stream.c + $(CPP) -c ../../pa_common/pa_stream.c -o ./pa_stream.o $(CXXFLAGS) + +./pa_trace.o: ../../pa_common/pa_trace.c + $(CPP) -c ../../pa_common/pa_trace.c -o ./pa_trace.o $(CXXFLAGS) + +./pa_allocation.o: ../../pa_common/pa_allocation.c + $(CPP) -c ../../pa_common/pa_allocation.c -o ./pa_allocation.o $(CXXFLAGS) + +./pa_converters.o: ../../pa_common/pa_converters.c + $(CPP) -c ../../pa_common/pa_converters.c -o ./pa_converters.o $(CXXFLAGS) + +./pa_cpuload.o: ../../pa_common/pa_cpuload.c + $(CPP) -c ../../pa_common/pa_cpuload.c -o ./pa_cpuload.o $(CXXFLAGS) + +./pa_dither.o: ../../pa_common/pa_dither.c + $(CPP) -c ../../pa_common/pa_dither.c -o ./pa_dither.o $(CXXFLAGS) + +./pa_front.o: ../../pa_common/pa_front.c + $(CPP) -c ../../pa_common/pa_front.c -o ./pa_front.o $(CXXFLAGS) + +./pa_process.o: ../../pa_common/pa_process.c + $(CPP) -c ../../pa_common/pa_process.c -o ./pa_process.o $(CXXFLAGS) + +./pa_asio.o: ../../pa_asio/pa_asio.cpp + $(CPP) -c ../../pa_asio/pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) + +./pa_win_util.o: ../pa_win_util.c + $(CPP) -c ../pa_win_util.c -o ./pa_win_util.o $(CXXFLAGS) + +./pa_win_hostapis.o: ../pa_win_hostapis.c + $(CPP) -c ../pa_win_hostapis.c -o ./pa_win_hostapis.o $(CXXFLAGS) + +./pa_win_ds.o: ../../pa_win_ds/pa_win_ds.c + $(CPP) -c ../../pa_win_ds/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS) + +./dsound_wrapper.o: ../../pa_win_ds/dsound_wrapper.c + $(CPP) -c ../../pa_win_ds/dsound_wrapper.c -o ./dsound_wrapper.o $(CXXFLAGS) + +./pa_win_wmme.o: ../../pa_win_wmme/pa_win_wmme.c + $(CPP) -c ../../pa_win_wmme/pa_win_wmme.c -o ./pa_win_wmme.o $(CXXFLAGS) + +./iasiothiscallresolver.o: ../../pa_asio/iasiothiscallresolver.cpp + $(CPP) -c ../../pa_asio/iasiothiscallresolver.cpp -o ./iasiothiscallresolver.o $(CXXFLAGS) diff --git a/portaudio-v19/pa_win/dev-cpp/portaudio-dll.dev b/portaudio-v19/pa_win/dev-cpp/portaudio-dll.dev new file mode 100644 index 000000000..086e109ee --- /dev/null +++ b/portaudio-v19/pa_win/dev-cpp/portaudio-dll.dev @@ -0,0 +1,209 @@ +[Project] +FileName=portaudio-dll.dev +Name=portaudio-dll +UnitCount=16 +Type=3 +Ver=1 +ObjFiles= +Includes=..\..\..\asiosdk2;..\..\..\asiosdk2\common;..\..\..\asiosdk2\host;..\..\..\asiosdk2\host\pc;..\..\pa_common +Libs= +PrivateResource= +ResourceIncludes= +MakeIncludes= +Compiler=-DBUILDING_DLL=1_@@_-O3_@@_ +CppCompiler=-O3_@@_ +Linker=--no-export-all-symbols --add-stdcall-alias_@@_../../../asiosdk2/asiosdk2.a_@@_-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm_@@_-O3 -s_@@_ +IsCpp=1 +Icon= +ExeOutput=. +ObjectOutput=. +OverrideOutput=0 +OverrideOutputName=portaudio.a +HostApplication= +Folders= +CommandLine= +IncludeVersionInfo=0 +SupportXPThemes=0 +CompilerSet=0 +CompilerSettings=0000000000000000000 +UseCustomMakefile=0 +CustomMakefile= + +[Unit1] +FileName=..\..\pa_common\pa_skeleton.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_skeleton.c -o ./pa_skeleton.o $(CFLAGS) + +[Unit2] +FileName=..\..\pa_common\pa_stream.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_stream.c -o ./pa_stream.o $(CFLAGS) + +[Unit3] +FileName=..\..\pa_common\pa_trace.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_trace.c -o ./pa_trace.o $(CFLAGS) + +[Unit4] +FileName=..\..\pa_common\pa_allocation.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_allocation.c -o ./pa_allocation.o $(CFLAGS) + +[Unit5] +FileName=..\..\pa_common\pa_converters.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_converters.c -o ./pa_converters.o $(CFLAGS) + +[Unit6] +FileName=..\..\pa_common\pa_cpuload.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_cpuload.c -o ./pa_cpuload.o $(CFLAGS) + +[Unit7] +FileName=..\..\pa_common\pa_dither.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_dither.c -o ./pa_dither.o $(CFLAGS) + +[Unit8] +FileName=..\..\pa_common\pa_front.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_front.c -o ./pa_front.o $(CFLAGS) + +[Unit9] +FileName=..\..\pa_common\pa_process.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_process.c -o ./pa_process.o $(CFLAGS) + +[VersionInfo] +Major=0 +Minor=1 +Release=1 +Build=1 +LanguageID=1033 +CharsetID=1252 +CompanyName= +FileVersion= +FileDescription=Developed using the Dev-C++ IDE +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion= +AutoIncBuildNr=0 + +[Unit10] +FileName=..\..\pa_asio\pa_asio.cpp +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CPP) -c pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) + +[Unit11] +FileName=..\pa_win_util.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_util.c -o ./pa_win_util.o $(CFLAGS) + +[Unit12] +FileName=..\pa_win_hostapis.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_hostapis.c -o ./pa_win_hostapis.o $(CFLAGS) + +[Unit13] +FileName=..\..\pa_win_ds\pa_win_ds.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_ds.c -o ./pa_win_ds.o $(CFLAGS) + +[Unit14] +FileName=..\..\pa_win_ds\dsound_wrapper.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c dsound_wrapper.c -o ./dsound_wrapper.o $(CFLAGS) + +[Unit15] +FileName=..\..\pa_win_wmme\pa_win_wmme.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_wmme.c -o ./pa_win_wmme.o $(CFLAGS) + +[Unit16] +FileName=..\..\pa_asio\iasiothiscallresolver.cpp +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + diff --git a/portaudio-v19/pa_win/dev-cpp/portaudio-static.dev b/portaudio-v19/pa_win/dev-cpp/portaudio-static.dev new file mode 100644 index 000000000..2aae584df --- /dev/null +++ b/portaudio-v19/pa_win/dev-cpp/portaudio-static.dev @@ -0,0 +1,209 @@ +[Project] +FileName=portaudio-static.dev +Name=portaudio-static +UnitCount=16 +Type=2 +Ver=1 +ObjFiles= +Includes=..\..\..\asiosdk2;..\..\..\asiosdk2\common;..\..\..\asiosdk2\host;..\..\..\asiosdk2\host\pc;..\..\pa_common +Libs= +PrivateResource= +ResourceIncludes= +MakeIncludes= +Compiler=-O3_@@_ +CppCompiler=-O3_@@_ +Linker=-O3 -s_@@_ +IsCpp=1 +Icon= +ExeOutput=. +ObjectOutput=. +OverrideOutput=0 +OverrideOutputName=portaudio.a +HostApplication= +Folders= +CommandLine= +IncludeVersionInfo=0 +SupportXPThemes=0 +CompilerSet=0 +CompilerSettings=0000000000000000000 +UseCustomMakefile=0 +CustomMakefile= + +[Unit1] +FileName=..\..\pa_common\pa_skeleton.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_skeleton.c -o ./pa_skeleton.o $(CFLAGS) + +[Unit2] +FileName=..\..\pa_common\pa_stream.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_stream.c -o ./pa_stream.o $(CFLAGS) + +[Unit3] +FileName=..\..\pa_common\pa_trace.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_trace.c -o ./pa_trace.o $(CFLAGS) + +[Unit4] +FileName=..\..\pa_common\pa_allocation.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_allocation.c -o ./pa_allocation.o $(CFLAGS) + +[Unit5] +FileName=..\..\pa_common\pa_converters.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_converters.c -o ./pa_converters.o $(CFLAGS) + +[Unit6] +FileName=..\..\pa_common\pa_cpuload.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_cpuload.c -o ./pa_cpuload.o $(CFLAGS) + +[Unit7] +FileName=..\..\pa_common\pa_dither.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_dither.c -o ./pa_dither.o $(CFLAGS) + +[Unit8] +FileName=..\..\pa_common\pa_front.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_front.c -o ./pa_front.o $(CFLAGS) + +[Unit9] +FileName=..\..\pa_common\pa_process.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_process.c -o ./pa_process.o $(CFLAGS) + +[VersionInfo] +Major=0 +Minor=1 +Release=1 +Build=1 +LanguageID=1033 +CharsetID=1252 +CompanyName= +FileVersion= +FileDescription=Developed using the Dev-C++ IDE +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion= +AutoIncBuildNr=0 + +[Unit10] +FileName=..\..\pa_asio\pa_asio.cpp +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CPP) -c pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) + +[Unit11] +FileName=..\..\pa_win\pa_win_util.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_util.c -o ./pa_win_util.o $(CFLAGS) + +[Unit12] +FileName=..\..\pa_win\pa_win_hostapis.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_hostapis.c -o ./pa_win_hostapis.o $(CFLAGS) + +[Unit13] +FileName=..\..\pa_win_ds\pa_win_ds.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_ds.c -o ./pa_win_ds.o $(CFLAGS) + +[Unit14] +FileName=..\..\pa_win_ds\dsound_wrapper.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c dsound_wrapper.c -o ./dsound_wrapper.o $(CFLAGS) + +[Unit15] +FileName=..\..\pa_win_wmme\pa_win_wmme.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_wmme.c -o ./pa_win_wmme.o $(CFLAGS) + +[Unit16] +FileName=..\..\pa_asio\iasiothiscallresolver.cpp +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + diff --git a/portaudio-v19/pa_win/dev-cpp/readme.txt b/portaudio-v19/pa_win/dev-cpp/readme.txt new file mode 100644 index 000000000..07108a7dd --- /dev/null +++ b/portaudio-v19/pa_win/dev-cpp/readme.txt @@ -0,0 +1,23 @@ +From: "Peter L Jones" +Sent: Wednesday, September 17, 2003 5:18 AM +Subject: Dev-C++ project files + +I attach two project files intended for portaudio/pa_win/dev-cpp (i.e. in +parallel with the msvc directory), if you want them. One is for a static +library build and one for a DLL. I've used the static library (in building +a single monolithic DLL) but I can't guarantee the DLL version will build a +working library (I think it's mostly there, though!). + +I also attach the resulting makefiles, which may be of use to other MinGW +users. + +They're rooted in the directory given above and drop their object and +library files in the same place. They assume the asiosdk2 files are in the +same directory as portaudio/ in a sub-directory called asiosdk2/. Oh! The +DLL is built against a static asiosdk2.a library... maybe not the best way +to do it... I ought to figure out how to link against a "home made" dll in +Dev-C++, I guess ;-) + +Cheers, + +-- Peter diff --git a/portaudio-v19/pa_win/msvc/Makefile.msvc b/portaudio-v19/pa_win/msvc/Makefile.msvc new file mode 100644 index 000000000..2f1a104e7 --- /dev/null +++ b/portaudio-v19/pa_win/msvc/Makefile.msvc @@ -0,0 +1,159 @@ +# Portaudio v1.9-devel VC6 DLL makefile 1.0 +# +# David Viens, davidv@plogue.com +# (im far from a VC6 makefile expert, so please bear with me :) +# +# For more info, look at readme.txt +# +#if you keep the ASIODIR as ".", it will use the SDK files that direclty in "pa_win/msvc" dir +ASIODIR=. +ASIOINC=/I ".\host" /I ".\host\pc" /I ".\common" +# + +LIBZ=kernel32.lib user32.lib gdi32.lib wininet.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib dsound.lib dxguid.lib + +CPP=cl.exe +LINK32=link.exe + +#release +CFLAGS=/nologo /MD /W3 /GX /O2 /Ob2 /I "src" /I "Win32" /I "$(MSVCDir)\Include" /D "WIN32" /D "NDEBUG" /D "_USRDLL" /YX /FD +DLL_LINK_FLAGS= /nologo /dll /incremental:no /libpath:"$(MSVCDir)\Lib" $(LIBZ) /pdb:"portaudio.pdb" /implib:".\portaudio.lib" /machine:I386 /out:"portaudio.dll" + + +COMMONINC=/I "..\..\pa_common" /I "." + +#==================================================================== +# Targets + +ALL : portaudio.dll + +CLEAN : + -@erase "*.obj" + +#==================================================================== + + +LINK32_OBJS= \ + ".\pa_allocation.obj" \ + ".\pa_converters.obj" \ + ".\pa_x86_plain_converters.obj" \ +# ".\pa_cppHelp.obj" \ + ".\pa_cpuload.obj" \ + ".\pa_dither.obj" \ + ".\pa_front.obj" \ + ".\pa_process.obj" \ + ".\pa_skeleton.obj" \ + ".\pa_stream.obj" \ + ".\pa_trace.obj" \ +# + ".\pa_win_hostapis.obj" \ + ".\pa_win_util.obj" \ +# + ".\pa_win_wmme.obj" \ +# + ".\pa_win_ds.obj" \ + ".\dsound_wrapper.obj" \ +# + ".\pa_asio.obj" \ +# + ".\asio.obj" \ + ".\ASIOConvertSamples.obj" \ + ".\asiodrivers.obj" \ + ".\asiolist.obj" \ + ".\combase.obj" \ + ".\debugmessage.obj" \ +# ".\dllentry.obj" \ + ".\register.obj" + + +portaudio.dll : $(LINK32_OBJS) ".\portaudio.def" + $(LINK32) $(DLL_LINK_FLAGS) /def:".\portaudio.def" $(LINK32_OBJS) + +#==================================================================== +# asio files (need to agree to steinberg agreement) +# this makefile assumes all files have being copied in the pa_win/msvc dir (for now) +# see readme.txt for details + +".\asio.obj" : ".\common\asio.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\asio.obj" /c ".\common\asio.cpp" + +".\ASIOConvertSamples.obj" : ".\host\ASIOConvertSamples.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\ASIOConvertSamples.obj" /c ".\host\ASIOConvertSamples.cpp" + +".\asiodrivers.obj" : ".\host\asiodrivers.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\asiodrivers.obj" /c ".\host\asiodrivers.cpp" + +".\asiolist.obj" : ".\host\pc\asiolist.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\asiolist.obj" /c ".\host\pc\asiolist.cpp" + +".\combase.obj" : ".\common\combase.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\combase.obj" /c ".\common\combase.cpp" + +".\debugmessage.obj" : ".\common\debugmessage.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\debugmessage.obj" /c ".\common\debugmessage.cpp" + +".\register.obj" : ".\common\register.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\register.obj" /c ".\common\register.cpp" + +#==================================================================== +# Portaudio Common +# +".\pa_allocation.obj" : "..\..\pa_common\pa_allocation.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_allocation.obj" /c "..\..\pa_common\pa_allocation.c" + +".\pa_converters.obj" : "..\..\pa_common\pa_converters.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_converters.obj" /c "..\..\pa_common\pa_converters.c" + +".\pa_cppHelp.obj" : "..\..\pa_common\pa_cppHelp.cpp" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_cppHelp.obj" /c "..\..\pa_common\pa_cppHelp.cpp" + +".\pa_cpuload.obj" : "..\..\pa_common\pa_cpuload.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_cpuload.obj" /c "..\..\pa_common\pa_cpuload.c" + +".\pa_dither.obj" : "..\..\pa_common\pa_dither.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_dither.obj" /c "..\..\pa_common\pa_dither.c" + +".\pa_front.obj" : "..\..\pa_common\pa_front.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_front.obj" /c "..\..\pa_common\pa_front.c" + +".\pa_process.obj" : "..\..\pa_common\pa_process.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_process.obj" /c "..\..\pa_common\pa_process.c" + +".\pa_skeleton.obj" : "..\..\pa_common\pa_skeleton.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_skeleton.obj" /c "..\..\pa_common\pa_skeleton.c" + +".\pa_stream.obj" : "..\..\pa_common\pa_stream.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_stream.obj" /c "..\..\pa_common\pa_stream.c" + +".\pa_trace.obj" : "..\..\pa_common\pa_trace.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_trace.obj" /c "..\..\pa_common\pa_trace.c" + +#==================================================================== +# Portaudio implementations +# + +".\pa_win_hostapis.obj" : "..\..\pa_win\pa_win_hostapis.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_win_hostapis.obj" /c "..\..\pa_win\pa_win_hostapis.c" + +".\pa_win_util.obj" : "..\..\pa_win\pa_win_util.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_win_util.obj" /c "..\..\pa_win\pa_win_util.c" + +".\pa_x86_plain_converters.obj" : "..\..\pa_win\pa_x86_plain_converters.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_x86_plain_converters.obj" /c "..\..\pa_win\pa_x86_plain_converters.c" + +".\pa_asio.obj" : "..\..\pa_asio\pa_asio.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) $(COMMONINC) /Fo".\pa_asio.obj" /c "..\..\pa_asio\pa_asio.cpp" + +".\pa_win_wmme.obj" : "..\..\pa_win_wmme\pa_win_wmme.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_win_wmme.obj" /c "..\..\pa_win_wmme\pa_win_wmme.c" + +".\pa_win_ds.obj" : "..\..\pa_win_ds\pa_win_ds.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_win_ds.obj" /c "..\..\pa_win_ds\pa_win_ds.c" + +".\dsound_wrapper.obj" : "..\..\pa_win_ds\dsound_wrapper.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\dsound_wrapper.obj" /c "..\..\pa_win_ds\dsound_wrapper.c" + + +# End of Makefile +#==================================================================== +# \ No newline at end of file diff --git a/portaudio-v19/pa_win/msvc/clean.bat b/portaudio-v19/pa_win/msvc/clean.bat new file mode 100755 index 000000000..601c0d314 --- /dev/null +++ b/portaudio-v19/pa_win/msvc/clean.bat @@ -0,0 +1,7 @@ +del *.obj +del *.dll +del *.lib +del *.exp +del *.pch +del *.idb + diff --git a/portaudio-v19/pa_win/msvc/make.bat b/portaudio-v19/pa_win/msvc/make.bat new file mode 100755 index 000000000..34d6aed48 --- /dev/null +++ b/portaudio-v19/pa_win/msvc/make.bat @@ -0,0 +1,8 @@ +CALL C:\progra~1\micros~2\VC98\bin\vcvars32 +del *.dll +del *.lib +nmake Makefile.msvc +del *.obj +del *.exp +del *.pch +del *.idb diff --git a/portaudio-v19/pa_win/msvc/portaudio.def b/portaudio-v19/pa_win/msvc/portaudio.def new file mode 100644 index 000000000..97a1c3502 --- /dev/null +++ b/portaudio-v19/pa_win/msvc/portaudio.def @@ -0,0 +1,43 @@ +LIBRARY portaudio.dll +EXPORTS + +; +Pa_GetVersion @1 +Pa_GetVersionText @2 +Pa_GetErrorText @3 +Pa_Initialize @4 +Pa_Terminate @5 +Pa_GetHostApiCount @6 +Pa_GetDefaultHostApi @7 +Pa_GetHostApiInfo @8 +Pa_HostApiTypeIdToHostApiIndex @9 +Pa_HostApiDeviceIndexToDeviceIndex @10 +Pa_GetLastHostErrorInfo @11 +Pa_GetDeviceCount @12 +Pa_GetDefaultInputDevice @13 +Pa_GetDefaultOutputDevice @14 +Pa_GetDeviceInfo @15 +Pa_IsFormatSupported @16 +Pa_OpenStream @17 +Pa_OpenDefaultStream @18 +Pa_CloseStream @19 +Pa_SetStreamFinishedCallback @20 +Pa_StartStream @21 +Pa_StopStream @22 +Pa_AbortStream @23 +Pa_IsStreamStopped @24 +Pa_IsStreamActive @25 +Pa_GetStreamInfo @26 +Pa_GetStreamTime @27 +Pa_GetStreamCpuLoad @28 +Pa_ReadStream @29 +Pa_WriteStream @30 +Pa_GetStreamReadAvailable @31 +Pa_GetStreamWriteAvailable @32 +Pa_GetSampleSize @33 +Pa_Sleep @34 +PaAsio_GetAvailableLatencyValues @50 +PaAsio_ShowControlPanel @51 +PaUtil_InitializeX86PlainConverters @52 +PaAsio_GetInputChannelName @53 +PaAsio_GetOutputChannelName @54 \ No newline at end of file diff --git a/portaudio-v19/pa_win/msvc/readme.txt b/portaudio-v19/pa_win/msvc/readme.txt new file mode 100644 index 000000000..19ced4c4c --- /dev/null +++ b/portaudio-v19/pa_win/msvc/readme.txt @@ -0,0 +1,56 @@ +Hello + + This is a small list of steps in order to build portaudio +(Currently v19-devel) into a VC6 DLL and lib file. +This DLL contains all 3 current win32 PA APIS (MM/DS/ASIO) + +1)Copy the source dirs that comes with the ASIO SDK inside pa_win\msvc + so you should now have: + + pa_win\msvc\common + pa_win\msvc\host + pa_win\msvc\host\sample + pa_win\msvc\host\pc + pa_win\msvc\host\mac (not needed) + + You dont need "driver" + + +2)execure "make.bat", this assumes VC6 is installed in + C:\Program Files\Microsoft Visual Studio\ + + if its not, + + Open a command Prompt and execute "vcvars32.bat" which sets the environment + so that you can use Microsoft's "nmake" + EX: C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat + or (C:\progra~1\micros~2\VC98\bin\vcvars32) dumb de dumb + + You should now have seen a line that said: + "Setting environment for using Microsoft Visual C++ tools." + While in pa_win\msvc , type "nmake makefile.msvc" + this _should_ create portaudio.dll and portaudio.lib + +3)Now in any VC6 project, in which you require portaudio, + you can just link with portaudio.lib, and of course include the + relevant headers + (portaudio.h, and/or pa_asio.h , pa_x86_plain_converters.h) See (*) + +4) Your new exe should now use portaudio.dll. + + +Have fun! + +(*): you may want to add/remove some DLL entry points. +Right now those 3 entries are _not_ from portaudio.h + +(from portaudio.def) +(...) +PaAsio_GetAvailableLatencyValues @50 +PaAsio_ShowControlPanel @51 +PaUtil_InitializeX86PlainConverters @52 + + +----- +last update April 16th 2003 +David Viens, davidv@plogue.com \ No newline at end of file diff --git a/portaudio-v19/pa_win/msvc/setenv.bat b/portaudio-v19/pa_win/msvc/setenv.bat new file mode 100755 index 000000000..f4c815a78 --- /dev/null +++ b/portaudio-v19/pa_win/msvc/setenv.bat @@ -0,0 +1 @@ +C:\progra~1\micros~2\VC98\bin\vcvars32 diff --git a/portaudio-v19/pa_win/pa_win_hostapis.c b/portaudio-v19/pa_win/pa_win_hostapis.c new file mode 100644 index 000000000..5d5ac87f3 --- /dev/null +++ b/portaudio-v19/pa_win/pa_win_hostapis.c @@ -0,0 +1,86 @@ +/* + * $Id$ + * Portable Audio I/O Library Windows initialization table + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + Win32 host API initialization function table. + + @todo Consider using PA_USE_WMME etc instead of PA_NO_WMME. This is what + the Unix version does, we should consider being consistent. +*/ + + +#include "pa_hostapi.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaWinDs_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaWinWdm_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +PaUtilHostApiInitializer *paHostApiInitializers[] = + { + +#ifndef PA_NO_WMME + PaWinMme_Initialize, +#endif + +#ifndef PA_NO_DS + PaWinDs_Initialize, +#endif + +#ifndef PA_NO_ASIO + PaAsio_Initialize, +#endif + +/* +#ifndef PA_NO_WDMKS + PaWinWdm_Initialize, +#endif +*/ + + PaSkeleton_Initialize, /* just for testing */ + + 0 /* NULL terminated array */ + }; + + +int paDefaultHostApiIndex = 0; + diff --git a/portaudio-v19/pa_win/pa_win_util.c b/portaudio-v19/pa_win/pa_win_util.c new file mode 100644 index 000000000..32d0dbb98 --- /dev/null +++ b/portaudio-v19/pa_win/pa_win_util.c @@ -0,0 +1,134 @@ +/* + * $Id$ + * Portable Audio I/O Library + * Win32 platform-specific support functions + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2000 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + Win32 platform-specific support functions. + + @todo Implement workaround for QueryPerformanceCounter() skipping forward + bug. (see msdn kb Q274323). +*/ + +#include +#include /* for timeGetTime() */ + +#include "pa_util.h" + + +/* + Track memory allocations to avoid leaks. + */ + +#if PA_TRACK_MEMORY +static int numAllocations_ = 0; +#endif + + +void *PaUtil_AllocateMemory( long size ) +{ + void *result = GlobalAlloc( GPTR, size ); + +#if PA_TRACK_MEMORY + if( result != NULL ) numAllocations_ += 1; +#endif + return result; +} + + +void PaUtil_FreeMemory( void *block ) +{ + if( block != NULL ) + { + GlobalFree( block ); +#if PA_TRACK_MEMORY + numAllocations_ -= 1; +#endif + + } +} + + +int PaUtil_CountCurrentlyAllocatedBlocks( void ) +{ +#if PA_TRACK_MEMORY + return numAllocations_; +#else + return 0; +#endif +} + + +void Pa_Sleep( long msec ) +{ + Sleep( msec ); +} + +static int usePerformanceCounter_; +static double secondsPerTick_; + +void PaUtil_InitializeClock( void ) +{ + LARGE_INTEGER ticksPerSecond; + + if( QueryPerformanceFrequency( &ticksPerSecond ) != 0 ) + { + usePerformanceCounter_ = 1; + secondsPerTick_ = 1.0 / (double)ticksPerSecond.QuadPart; + } + else + { + usePerformanceCounter_ = 0; + } +} + + +double PaUtil_GetTime( void ) +{ + LARGE_INTEGER time; + + if( usePerformanceCounter_ ) + { + /* FIXME: + according to this knowledge-base article, QueryPerformanceCounter + can skip forward by seconds! + http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q274323& + + it may be better to use the rtdsc instruction using inline asm, + however then a method is needed to calculate a ticks/seconds ratio. + */ + QueryPerformanceCounter( &time ); + return time.QuadPart * secondsPerTick_; + } + else + { + return timeGetTime() * .001; + } +} diff --git a/portaudio-v19/pa_win/pa_x86_plain_converters.c b/portaudio-v19/pa_win/pa_x86_plain_converters.c new file mode 100644 index 000000000..98442a8c6 --- /dev/null +++ b/portaudio-v19/pa_win/pa_x86_plain_converters.c @@ -0,0 +1,1167 @@ +#include "pa_x86_plain_converters.h" + +#include "pa_converters.h" +#include "pa_dither.h" + +/* + plain intel assemby versions of standard pa converter functions. + + the main reason these versions are faster than the equivalent C versions + is that float -> int casting is expensive in C on x86 because the rounding + mode needs to be changed for every cast. these versions only set + the rounding mode once outside the loop. + + small additional speed gains are made by the way that clamping is + implemented. + +TODO: + o- inline dither code + o- implement Dither only (no-clip) versions + o- implement int8 and uint8 versions + o- test thouroughly + + o- the packed 24 bit functions could benefit from unrolling and avoiding + byte and word sized register access. +*/ + +/* -------------------------------------------------------------------------- */ + +/* +#define PA_CLIP_( val, min, max )\ + { val = ((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val)); } +*/ + +/* + the following notes were used to determine whether a floating point + value should be saturated (ie >1 or <-1) by loading it into an integer + register. these should be rewritten so that they make sense. + + an ieee floating point value + + 1.xxxxxxxxxxxxxxxxxxxx? + + + is less than or equal to 1 and greater than or equal to -1 either: + + if the mantissa is 0 and the unbiased exponent is 0 + + OR + + if the unbiased exponent < 0 + + this translates to: + + if the mantissa is 0 and the biased exponent is 7F + + or + + if the biased exponent is less than 7F + + + therefore the value is greater than 1 or less than -1 if + + the mantissa is not 0 and the biased exponent is 7F + + or + + if the biased exponent is greater than 7F + + + in other words, if we mask out the sign bit, the value is + greater than 1 or less than -1 if its integer representation is greater than: + + 0 01111111 0000 0000 0000 0000 0000 000 + + 0011 1111 1000 0000 0000 0000 0000 0000 => 0x3F800000 +*/ + +/* -------------------------------------------------------------------------- */ + +static const short fpuControlWord_ = 0x033F; /*round to nearest, 64 bit precision, all exceptions masked*/ +static const double int32Scaler_ = 0x7FFFFFFF; +static const double ditheredInt32Scaler_ = 0x7FFFFFFE; +static const double int24Scaler_ = 0x7FFFFF; +static const double ditheredInt24Scaler_ = 0x7FFFFE; +static const double int16Scaler_ = 0x7FFF; +static const double ditheredInt16Scaler_ = 0x7FFE; + +#define PA_DITHER_BITS_ (15) +/* Multiply by PA_FLOAT_DITHER_SCALE_ to get a float between -2.0 and +1.99999 */ +#define PA_FLOAT_DITHER_SCALE_ (1.0 / ((1< source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 and int32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int32Scaler_ // stack: (int)0x7FFFFFFF + + Float32_To_Int32_loop: + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFFFFFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFFFFFF, (int)0x7FFFFFFF + /* + note: we could store to a temporary qword here which would cause + wraparound distortion instead of int indefinite 0x10. that would + be more work, and given that not enabling clipping is only advisable + when you know that your signal isn't going to clip it isn't worth it. + */ + fistp dword ptr [edi] // pop st(0) into dest, stack: (int)0x7FFFFFFF + + add edi, ebx // increment destination ptr + //lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int32_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + signed long *dest = (signed long*)destinationBuffer; + (void) ditherGenerator; // unused parameter + + while( count-- ) + { + // REVIEW + double scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648., 2147483647. ); + *dest = (signed long) scaled; + + src += sourceStride; + dest += destinationStride; + } +*/ + + short savedFpuControlWord; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 and int32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int32Scaler_ // stack: (int)0x7FFFFFFF + + Float32_To_Int32_Clip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int32_Clip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFFFFFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFFFFFF, (int)0x7FFFFFFF + fistp dword ptr [edi] // pop st(0) into dest, stack: (int)0x7FFFFFFF + jmp Float32_To_Int32_Clip_stored + + Float32_To_Int32_Clip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add edx, 0x7FFFFFFF // convert to maximum range integers + mov dword ptr [edi], edx + + Float32_To_Int32_Clip_stored: + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int32_Clip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + /* + float *src = (float*)sourceBuffer; + signed long *dest = (signed long*)destinationBuffer; + + while( count-- ) + { + // REVIEW + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + // use smaller scaler to prevent overflow when we add the dither + double dithered = ((double)*src * (2147483646.0)) + dither; + PA_CLIP_( dithered, -2147483648., 2147483647. ); + *dest = (signed long) dithered; + + + src += sourceStride; + dest += destinationStride; + } + */ + + short savedFpuControlWord; + + // spill storage: + signed long sourceByteStride; + signed long highpassedDither; + + // dither state: + unsigned long ditherPrevious = ditherGenerator->previous; + unsigned long ditherRandSeed1 = ditherGenerator->randSeed1; + unsigned long ditherRandSeed2 = ditherGenerator->randSeed2; + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 and int32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld ditheredInt32Scaler_ // stack: int scaler + + Float32_To_Int32_DitherClip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int32_DitherClip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, int scaler + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*(int scaler), int scaler + + /* + // call PaUtil_GenerateFloatTriangularDither with C calling convention + mov sourceByteStride, eax // save eax + mov sourceEnd, ecx // save ecx + push ditherGenerator // pass ditherGenerator parameter on stack + call PaUtil_GenerateFloatTriangularDither // stack: dither, value*(int scaler), int scaler + pop edx // clear parameter off stack + mov ecx, sourceEnd // restore ecx + mov eax, sourceByteStride // restore eax + */ + + // generate dither + mov sourceByteStride, eax // save eax + mov edx, 196314165 + mov eax, ditherRandSeed1 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov ditherRandSeed1, eax + mov edx, 196314165 + mov eax, ditherRandSeed2 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov edx, ditherRandSeed1 + shr edx, PA_DITHER_SHIFT_ + mov ditherRandSeed2, eax + shr eax, PA_DITHER_SHIFT_ + //add eax, edx // eax -> current + lea eax, [eax+edx] + mov edx, ditherPrevious + neg edx + lea edx, [eax+edx] // highpass = current - previous + mov highpassedDither, edx + mov ditherPrevious, eax // previous = current + mov eax, sourceByteStride // restore eax + fild highpassedDither + fmul const_float_dither_scale_ + // end generate dither, dither signal in st(0) + + faddp st(1), st(0) // stack: dither + value*(int scaler), int scaler + fistp dword ptr [edi] // pop st(0) into dest, stack: int scaler + jmp Float32_To_Int32_DitherClip_stored + + Float32_To_Int32_DitherClip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add edx, 0x7FFFFFFF // convert to maximum range integers + mov dword ptr [edi], edx + + Float32_To_Int32_DitherClip_stored: + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int32_DitherClip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } + + ditherGenerator->previous = ditherPrevious; + ditherGenerator->randSeed1 = ditherRandSeed1; + ditherGenerator->randSeed2 = ditherRandSeed2; +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + signed long temp; + + (void) ditherGenerator; // unused parameter + + while( count-- ) + { + // convert to 32 bit and drop the low 8 bits + double scaled = *src * 0x7FFFFFFF; + temp = (signed long) scaled; + + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); + + src += sourceStride; + dest += destinationStride * 3; + } +*/ + + short savedFpuControlWord; + + signed long tempInt32; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov edx, 3 // sizeof int24 + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int24Scaler_ // stack: (int)0x7FFFFF + + Float32_To_Int24_loop: + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFFFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFFFF, (int)0x7FFFFF + fistp tempInt32 // pop st(0) into tempInt32, stack: (int)0x7FFFFF + mov edx, tempInt32 + + mov byte ptr [edi], DL + shr edx, 8 + //mov byte ptr [edi+1], DL + //mov byte ptr [edi+2], DH + mov word ptr [edi+1], DX + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int24_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + signed long temp; + + (void) ditherGenerator; // unused parameter + + while( count-- ) + { + // convert to 32 bit and drop the low 8 bits + double scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648., 2147483647. ); + temp = (signed long) scaled; + + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); + + src += sourceStride; + dest += destinationStride * 3; + } +*/ + + short savedFpuControlWord; + + signed long tempInt32; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov edx, 3 // sizeof int24 + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int24Scaler_ // stack: (int)0x7FFFFF + + Float32_To_Int24_Clip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int24_Clip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFFFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFFFF, (int)0x7FFFFF + fistp tempInt32 // pop st(0) into tempInt32, stack: (int)0x7FFFFF + mov edx, tempInt32 + jmp Float32_To_Int24_Clip_store + + Float32_To_Int24_Clip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add edx, 0x7FFFFF // convert to maximum range integers + + Float32_To_Int24_Clip_store: + + mov byte ptr [edi], DL + shr edx, 8 + //mov byte ptr [edi+1], DL + //mov byte ptr [edi+2], DH + mov word ptr [edi+1], DX + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int24_Clip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + signed long temp; + + while( count-- ) + { + // convert to 32 bit and drop the low 8 bits + + // FIXME: the dither amplitude here appears to be too small by 8 bits + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + // use smaller scaler to prevent overflow when we add the dither + double dithered = ((double)*src * (2147483646.0)) + dither; + PA_CLIP_( dithered, -2147483648., 2147483647. ); + + temp = (signed long) dithered; + + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); + + src += sourceStride; + dest += destinationStride * 3; + } +*/ + + short savedFpuControlWord; + + // spill storage: + signed long sourceByteStride; + signed long highpassedDither; + + // dither state: + unsigned long ditherPrevious = ditherGenerator->previous; + unsigned long ditherRandSeed1 = ditherGenerator->randSeed1; + unsigned long ditherRandSeed2 = ditherGenerator->randSeed2; + + signed long tempInt32; + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov edx, 3 // sizeof int24 + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld ditheredInt24Scaler_ // stack: int scaler + + Float32_To_Int24_DitherClip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int24_DitherClip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, int scaler + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*(int scaler), int scaler + + /* + // call PaUtil_GenerateFloatTriangularDither with C calling convention + mov sourceByteStride, eax // save eax + mov sourceEnd, ecx // save ecx + push ditherGenerator // pass ditherGenerator parameter on stack + call PaUtil_GenerateFloatTriangularDither // stack: dither, value*(int scaler), int scaler + pop edx // clear parameter off stack + mov ecx, sourceEnd // restore ecx + mov eax, sourceByteStride // restore eax + */ + + // generate dither + mov sourceByteStride, eax // save eax + mov edx, 196314165 + mov eax, ditherRandSeed1 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov ditherRandSeed1, eax + mov edx, 196314165 + mov eax, ditherRandSeed2 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov edx, ditherRandSeed1 + shr edx, PA_DITHER_SHIFT_ + mov ditherRandSeed2, eax + shr eax, PA_DITHER_SHIFT_ + //add eax, edx // eax -> current + lea eax, [eax+edx] + mov edx, ditherPrevious + neg edx + lea edx, [eax+edx] // highpass = current - previous + mov highpassedDither, edx + mov ditherPrevious, eax // previous = current + mov eax, sourceByteStride // restore eax + fild highpassedDither + fmul const_float_dither_scale_ + // end generate dither, dither signal in st(0) + + faddp st(1), st(0) // stack: dither * value*(int scaler), int scaler + fistp tempInt32 // pop st(0) into tempInt32, stack: int scaler + mov edx, tempInt32 + jmp Float32_To_Int24_DitherClip_store + + Float32_To_Int24_DitherClip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add edx, 0x7FFFFF // convert to maximum range integers + + Float32_To_Int24_DitherClip_store: + + mov byte ptr [edi], DL + shr edx, 8 + //mov byte ptr [edi+1], DL + //mov byte ptr [edi+2], DH + mov word ptr [edi+1], DX + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int24_DitherClip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } + + ditherGenerator->previous = ditherPrevious; + ditherGenerator->randSeed1 = ditherRandSeed1; + ditherGenerator->randSeed2 = ditherRandSeed2; +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + signed short *dest = (signed short*)destinationBuffer; + (void)ditherGenerator; // unused parameter + + while( count-- ) + { + + short samp = (short) (*src * (32767.0f)); + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +*/ + + short savedFpuControlWord; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx // source byte stride + + mov ecx, count + imul ecx, eax + add ecx, esi // source end ptr = count * source byte stride + source ptr + + mov edi, destinationBuffer + + mov edx, 2 // sizeof int16 + mov ebx, destinationStride + imul ebx, edx // destination byte stride + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int16Scaler_ // stack: (int)0x7FFF + + Float32_To_Int16_loop: + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFF, (int)0x7FFF + fistp word ptr [edi] // store scaled int into dest, stack: (int)0x7FFF + + add edi, ebx // increment destination ptr + //lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int16_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + signed short *dest = (signed short*)destinationBuffer; + (void)ditherGenerator; // unused parameter + + while( count-- ) + { + long samp = (signed long) (*src * (32767.0f)); + PA_CLIP_( samp, -0x8000, 0x7FFF ); + *dest = (signed short) samp; + + src += sourceStride; + dest += destinationStride; + } +*/ + + short savedFpuControlWord; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx // source byte stride + + mov ecx, count + imul ecx, eax + add ecx, esi // source end ptr = count * source byte stride + source ptr + + mov edi, destinationBuffer + + mov edx, 2 // sizeof int16 + mov ebx, destinationStride + imul ebx, edx // destination byte stride + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int16Scaler_ // stack: (int)0x7FFF + + Float32_To_Int16_Clip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int16_Clip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFF, (int)0x7FFF + fistp word ptr [edi] // store scaled int into dest, stack: (int)0x7FFF + jmp Float32_To_Int16_Clip_stored + + Float32_To_Int16_Clip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add dx, 0x7FFF // convert to maximum range integers + mov word ptr [edi], dx // store clamped into into dest + + Float32_To_Int16_Clip_stored: + + add edi, ebx // increment destination ptr + //lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int16_Clip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + signed short *dest = (signed short*)destinationBuffer; + (void)ditherGenerator; // unused parameter + + while( count-- ) + { + + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + // use smaller scaler to prevent overflow when we add the dither + float dithered = (*src * (32766.0f)) + dither; + signed long samp = (signed long) dithered; + PA_CLIP_( samp, -0x8000, 0x7FFF ); + *dest = (signed short) samp; + + src += sourceStride; + dest += destinationStride; + } +*/ + + short savedFpuControlWord; + + // spill storage: + signed long sourceByteStride; + signed long highpassedDither; + + // dither state: + unsigned long ditherPrevious = ditherGenerator->previous; + unsigned long ditherRandSeed1 = ditherGenerator->randSeed1; + unsigned long ditherRandSeed2 = ditherGenerator->randSeed2; + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx // source byte stride + + mov ecx, count + imul ecx, eax + add ecx, esi // source end ptr = count * source byte stride + source ptr + + mov edi, destinationBuffer + + mov edx, 2 // sizeof int16 + mov ebx, destinationStride + imul ebx, edx // destination byte stride + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld ditheredInt16Scaler_ // stack: int scaler + + Float32_To_Int16_DitherClip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int16_DitherClip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, int scaler + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*(int scaler), int scaler + + /* + // call PaUtil_GenerateFloatTriangularDither with C calling convention + mov sourceByteStride, eax // save eax + mov sourceEnd, ecx // save ecx + push ditherGenerator // pass ditherGenerator parameter on stack + call PaUtil_GenerateFloatTriangularDither // stack: dither, value*(int scaler), int scaler + pop edx // clear parameter off stack + mov ecx, sourceEnd // restore ecx + mov eax, sourceByteStride // restore eax + */ + + // generate dither + mov sourceByteStride, eax // save eax + mov edx, 196314165 + mov eax, ditherRandSeed1 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov ditherRandSeed1, eax + mov edx, 196314165 + mov eax, ditherRandSeed2 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov edx, ditherRandSeed1 + shr edx, PA_DITHER_SHIFT_ + mov ditherRandSeed2, eax + shr eax, PA_DITHER_SHIFT_ + //add eax, edx // eax -> current + lea eax, [eax+edx] // current = randSeed1>>x + randSeed2>>x + mov edx, ditherPrevious + neg edx + lea edx, [eax+edx] // highpass = current - previous + mov highpassedDither, edx + mov ditherPrevious, eax // previous = current + mov eax, sourceByteStride // restore eax + fild highpassedDither + fmul const_float_dither_scale_ + // end generate dither, dither signal in st(0) + + faddp st(1), st(0) // stack: dither * value*(int scaler), int scaler + fistp word ptr [edi] // store scaled int into dest, stack: int scaler + jmp Float32_To_Int16_DitherClip_stored + + Float32_To_Int16_DitherClip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add dx, 0x7FFF // convert to maximum range integers + mov word ptr [edi], dx // store clamped into into dest + + Float32_To_Int16_DitherClip_stored: + + add edi, ebx // increment destination ptr + //lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int16_DitherClip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } + + ditherGenerator->previous = ditherPrevious; + ditherGenerator->randSeed1 = ditherRandSeed1; + ditherGenerator->randSeed2 = ditherRandSeed2; +} + +/* -------------------------------------------------------------------------- */ + +void PaUtil_InitializeX86PlainConverters( void ) +{ + paConverters.Float32_To_Int32 = Float32_To_Int32; + paConverters.Float32_To_Int32_Clip = Float32_To_Int32_Clip; + paConverters.Float32_To_Int32_DitherClip = Float32_To_Int32_DitherClip; + + paConverters.Float32_To_Int24 = Float32_To_Int24; + paConverters.Float32_To_Int24_Clip = Float32_To_Int24_Clip; + paConverters.Float32_To_Int24_DitherClip = Float32_To_Int24_DitherClip; + + paConverters.Float32_To_Int16 = Float32_To_Int16; + paConverters.Float32_To_Int16_Clip = Float32_To_Int16_Clip; + paConverters.Float32_To_Int16_DitherClip = Float32_To_Int16_DitherClip; +} + +/* -------------------------------------------------------------------------- */ diff --git a/portaudio-v19/pa_win/pa_x86_plain_converters.h b/portaudio-v19/pa_win/pa_x86_plain_converters.h new file mode 100644 index 000000000..f56c710fd --- /dev/null +++ b/portaudio-v19/pa_win/pa_x86_plain_converters.h @@ -0,0 +1,19 @@ +#ifndef PA_X86_PLAIN_CONVERTERS_H +#define PA_X86_PLAIN_CONVERTERS_H + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** + @brief Install optimised converter functions suitable for all IA32 processors +*/ +void PaUtil_InitializeX86PlainConverters( void ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_X86_PLAIN_CONVERTERS_H */ diff --git a/portaudio-v19/pa_win_ds/dsound_wrapper.c b/portaudio-v19/pa_win_ds/dsound_wrapper.c new file mode 100644 index 000000000..e29019a8d --- /dev/null +++ b/portaudio-v19/pa_win_ds/dsound_wrapper.c @@ -0,0 +1,616 @@ +/* + * $Id$ + * Simplified DirectSound interface. + * + * Author: Phil Burk & Robert Marsanyi + * + * PortAudio Portable Real-Time Audio Library + * For more information see: http://www.softsynth.com/portaudio/ + * DirectSound Implementation + * Copyright (c) 1999-2000 Phil Burk & Robert Marsanyi + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include + +#include "dsound_wrapper.h" +#include "pa_trace.h" + +/* + Rather than linking with dxguid.a or using "#define INITGUID" to force a + header file to instantiate the required GUID(s), we define them directly + below. +*/ +#include // needed for the DEFINE_GUID macro +DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + + +/************************************************************************************/ +DSoundEntryPoints dswDSoundEntryPoints = { 0, 0, 0, 0, 0, 0, 0 }; +/************************************************************************************/ +static HRESULT WINAPI DummyDirectSoundCreate(LPGUID lpcGuidDevice, LPDIRECTSOUND *ppDS, LPUNKNOWN pUnkOuter) +{ + (void)lpcGuidDevice; /* unused parameter */ + (void)ppDS; /* unused parameter */ + (void)pUnkOuter; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext) +{ + (void)lpDSEnumCallback; /* unused parameter */ + (void)lpContext; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundEnumerateA(LPDSENUMCALLBACKA lpDSEnumCallback, LPVOID lpContext) +{ + (void)lpDSEnumCallback; /* unused parameter */ + (void)lpContext; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundCaptureCreate(LPGUID lpcGUID, LPDIRECTSOUNDCAPTURE *lplpDSC, LPUNKNOWN pUnkOuter) +{ + (void)lpcGUID; /* unused parameter */ + (void)lplpDSC; /* unused parameter */ + (void)pUnkOuter; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW lpDSCEnumCallback, LPVOID lpContext) +{ + (void)lpDSCEnumCallback; /* unused parameter */ + (void)lpContext; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA lpDSCEnumCallback, LPVOID lpContext) +{ + (void)lpDSCEnumCallback; /* unused parameter */ + (void)lpContext; /* unused parameter */ + return E_NOTIMPL; +} +/************************************************************************************/ +void DSW_InitializeDSoundEntryPoints(void) +{ + dswDSoundEntryPoints.hInstance_ = LoadLibrary("dsound.dll"); + if( dswDSoundEntryPoints.hInstance_ != NULL ) + { + dswDSoundEntryPoints.DirectSoundCreate = + (HRESULT (WINAPI *)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN)) + GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundCreate" ); + if( dswDSoundEntryPoints.DirectSoundCreate == NULL ) + dswDSoundEntryPoints.DirectSoundCreate = DummyDirectSoundCreate; + + dswDSoundEntryPoints.DirectSoundEnumerateW = + (HRESULT (WINAPI *)(LPDSENUMCALLBACKW, LPVOID)) + GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundEnumerateW" ); + if( dswDSoundEntryPoints.DirectSoundEnumerateW == NULL ) + dswDSoundEntryPoints.DirectSoundEnumerateW = DummyDirectSoundEnumerateW; + + dswDSoundEntryPoints.DirectSoundEnumerateA = + (HRESULT (WINAPI *)(LPDSENUMCALLBACKA, LPVOID)) + GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundEnumerateA" ); + if( dswDSoundEntryPoints.DirectSoundEnumerateA == NULL ) + dswDSoundEntryPoints.DirectSoundEnumerateA = DummyDirectSoundEnumerateA; + + dswDSoundEntryPoints.DirectSoundCaptureCreate = + (HRESULT (WINAPI *)(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN)) + GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundCaptureCreate" ); + if( dswDSoundEntryPoints.DirectSoundCaptureCreate == NULL ) + dswDSoundEntryPoints.DirectSoundCaptureCreate = DummyDirectSoundCaptureCreate; + + dswDSoundEntryPoints.DirectSoundCaptureEnumerateW = + (HRESULT (WINAPI *)(LPDSENUMCALLBACKW, LPVOID)) + GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundCaptureEnumerateW" ); + if( dswDSoundEntryPoints.DirectSoundCaptureEnumerateW == NULL ) + dswDSoundEntryPoints.DirectSoundCaptureEnumerateW = DummyDirectSoundCaptureEnumerateW; + + dswDSoundEntryPoints.DirectSoundCaptureEnumerateA = + (HRESULT (WINAPI *)(LPDSENUMCALLBACKA, LPVOID)) + GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundCaptureEnumerateA" ); + if( dswDSoundEntryPoints.DirectSoundCaptureEnumerateA == NULL ) + dswDSoundEntryPoints.DirectSoundCaptureEnumerateA = DummyDirectSoundCaptureEnumerateA; + } + else + { + /* initialize with dummy entry points to make live easy when ds isn't present */ + dswDSoundEntryPoints.DirectSoundCreate = DummyDirectSoundCreate; + dswDSoundEntryPoints.DirectSoundEnumerateW = DummyDirectSoundEnumerateW; + dswDSoundEntryPoints.DirectSoundEnumerateA = DummyDirectSoundEnumerateA; + dswDSoundEntryPoints.DirectSoundCaptureCreate = DummyDirectSoundCaptureCreate; + dswDSoundEntryPoints.DirectSoundCaptureEnumerateW = DummyDirectSoundCaptureEnumerateW; + dswDSoundEntryPoints.DirectSoundCaptureEnumerateA = DummyDirectSoundCaptureEnumerateA; + } +} +/************************************************************************************/ +void DSW_TerminateDSoundEntryPoints(void) +{ + if( dswDSoundEntryPoints.hInstance_ != NULL ) + { + FreeLibrary( dswDSoundEntryPoints.hInstance_ ); + dswDSoundEntryPoints.hInstance_ = NULL; + /* ensure that we crash reliably if the entry points arent initialised */ + dswDSoundEntryPoints.DirectSoundCreate = 0; + dswDSoundEntryPoints.DirectSoundEnumerateW = 0; + dswDSoundEntryPoints.DirectSoundEnumerateA = 0; + dswDSoundEntryPoints.DirectSoundCaptureCreate = 0; + dswDSoundEntryPoints.DirectSoundCaptureEnumerateW = 0; + dswDSoundEntryPoints.DirectSoundCaptureEnumerateA = 0; + } +} +/************************************************************************************/ +void DSW_Term( DSoundWrapper *dsw ) +{ + // Cleanup the sound buffers + if (dsw->dsw_OutputBuffer) + { + IDirectSoundBuffer_Stop( dsw->dsw_OutputBuffer ); + IDirectSoundBuffer_Release( dsw->dsw_OutputBuffer ); + dsw->dsw_OutputBuffer = NULL; + } + + if (dsw->dsw_InputBuffer) + { + IDirectSoundCaptureBuffer_Stop( dsw->dsw_InputBuffer ); + IDirectSoundCaptureBuffer_Release( dsw->dsw_InputBuffer ); + dsw->dsw_InputBuffer = NULL; + } + + if (dsw->dsw_pDirectSoundCapture) + { + IDirectSoundCapture_Release( dsw->dsw_pDirectSoundCapture ); + dsw->dsw_pDirectSoundCapture = NULL; + } + + if (dsw->dsw_pDirectSound) + { + IDirectSound_Release( dsw->dsw_pDirectSound ); + dsw->dsw_pDirectSound = NULL; + } +} +/************************************************************************************/ +HRESULT DSW_Init( DSoundWrapper *dsw ) +{ + memset( dsw, 0, sizeof(DSoundWrapper) ); + return 0; +} +/************************************************************************************/ +HRESULT DSW_InitOutputDevice( DSoundWrapper *dsw, LPGUID lpGUID ) +{ + // Create the DS object + HRESULT hr = dswDSoundEntryPoints.DirectSoundCreate( lpGUID, &dsw->dsw_pDirectSound, NULL ); + if( hr != DS_OK ) return hr; + return hr; +} + +/************************************************************************************/ +HRESULT DSW_InitOutputBuffer( DSoundWrapper *dsw, unsigned long nFrameRate, WORD nChannels, int bytesPerBuffer ) +{ + DWORD dwDataLen; + DWORD playCursor; + HRESULT result; + LPDIRECTSOUNDBUFFER pPrimaryBuffer; + HWND hWnd; + HRESULT hr; + WAVEFORMATEX wfFormat; + DSBUFFERDESC primaryDesc; + DSBUFFERDESC secondaryDesc; + unsigned char* pDSBuffData; + LARGE_INTEGER counterFrequency; + + dsw->dsw_OutputSize = bytesPerBuffer; + dsw->dsw_OutputRunning = FALSE; + dsw->dsw_OutputUnderflows = 0; + dsw->dsw_FramesWritten = 0; + dsw->dsw_BytesPerOutputFrame = nChannels * sizeof(short); + + // We were using getForegroundWindow() but sometimes the ForegroundWindow may not be the + // applications's window. Also if that window is closed before the Buffer is closed + // then DirectSound can crash. (Thanks for Scott Patterson for reporting this.) + // So we will use GetDesktopWindow() which was suggested by Miller Puckette. + // hWnd = GetForegroundWindow(); + // + // FIXME: The example code I have on the net creates a hidden window that + // is managed by our code - I think we should do that - one hidden + // window for the whole of Pa_DS + // + hWnd = GetDesktopWindow(); + + // Set cooperative level to DSSCL_EXCLUSIVE so that we can get 16 bit output, 44.1 KHz. + // Exclusize also prevents unexpected sounds from other apps during a performance. + if ((hr = IDirectSound_SetCooperativeLevel( dsw->dsw_pDirectSound, + hWnd, DSSCL_EXCLUSIVE)) != DS_OK) + { + return hr; + } + + // ----------------------------------------------------------------------- + // Create primary buffer and set format just so we can specify our custom format. + // Otherwise we would be stuck with the default which might be 8 bit or 22050 Hz. + // Setup the primary buffer description + ZeroMemory(&primaryDesc, sizeof(DSBUFFERDESC)); + primaryDesc.dwSize = sizeof(DSBUFFERDESC); + primaryDesc.dwFlags = DSBCAPS_PRIMARYBUFFER; // all panning, mixing, etc done by synth + primaryDesc.dwBufferBytes = 0; + primaryDesc.lpwfxFormat = NULL; + // Create the buffer + if ((result = IDirectSound_CreateSoundBuffer( dsw->dsw_pDirectSound, + &primaryDesc, &pPrimaryBuffer, NULL)) != DS_OK) return result; + // Define the buffer format + wfFormat.wFormatTag = WAVE_FORMAT_PCM; + wfFormat.nChannels = nChannels; + wfFormat.nSamplesPerSec = nFrameRate; + wfFormat.wBitsPerSample = 8 * sizeof(short); + wfFormat.nBlockAlign = (WORD)(wfFormat.nChannels * (wfFormat.wBitsPerSample / 8)); + wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign; + wfFormat.cbSize = 0; /* No extended format info. */ + // Set the primary buffer's format + if((result = IDirectSoundBuffer_SetFormat( pPrimaryBuffer, &wfFormat)) != DS_OK) return result; + + // ---------------------------------------------------------------------- + // Setup the secondary buffer description + ZeroMemory(&secondaryDesc, sizeof(DSBUFFERDESC)); + secondaryDesc.dwSize = sizeof(DSBUFFERDESC); + secondaryDesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2; + secondaryDesc.dwBufferBytes = bytesPerBuffer; + secondaryDesc.lpwfxFormat = &wfFormat; + // Create the secondary buffer + if ((result = IDirectSound_CreateSoundBuffer( dsw->dsw_pDirectSound, + &secondaryDesc, &dsw->dsw_OutputBuffer, NULL)) != DS_OK) return result; + // Lock the DS buffer + if ((result = IDirectSoundBuffer_Lock( dsw->dsw_OutputBuffer, 0, dsw->dsw_OutputSize, (LPVOID*)&pDSBuffData, + &dwDataLen, NULL, 0, 0)) != DS_OK) return result; + // Zero the DS buffer + ZeroMemory(pDSBuffData, dwDataLen); + // Unlock the DS buffer + if ((result = IDirectSoundBuffer_Unlock( dsw->dsw_OutputBuffer, pDSBuffData, dwDataLen, NULL, 0)) != DS_OK) return result; + if( QueryPerformanceFrequency( &counterFrequency ) ) + { + int framesInBuffer = bytesPerBuffer / (nChannels * sizeof(short)); + dsw->dsw_CounterTicksPerBuffer.QuadPart = (counterFrequency.QuadPart * framesInBuffer) / nFrameRate; + } + else + { + dsw->dsw_CounterTicksPerBuffer.QuadPart = 0; + } + // Let DSound set the starting write position because if we set it to zero, it looks like the + // buffer is full to begin with. This causes a long pause before sound starts when using large buffers. + hr = IDirectSoundBuffer_GetCurrentPosition( dsw->dsw_OutputBuffer, &playCursor, &dsw->dsw_WriteOffset ); + if( hr != DS_OK ) + { + return hr; + } + dsw->dsw_FramesWritten = dsw->dsw_WriteOffset / dsw->dsw_BytesPerOutputFrame; + /* printf("DSW_InitOutputBuffer: playCursor = %d, writeCursor = %d\n", playCursor, dsw->dsw_WriteOffset ); */ + return DS_OK; +} + +/************************************************************************************/ +HRESULT DSW_StartOutput( DSoundWrapper *dsw ) +{ + HRESULT hr; + QueryPerformanceCounter( &dsw->dsw_LastPlayTime ); + dsw->dsw_LastPlayCursor = 0; + dsw->dsw_FramesPlayed = 0; + hr = IDirectSoundBuffer_SetCurrentPosition( dsw->dsw_OutputBuffer, 0 ); + if( hr != DS_OK ) + { + return hr; + } + // Start the buffer playback in a loop. + if( dsw->dsw_OutputBuffer != NULL ) + { + hr = IDirectSoundBuffer_Play( dsw->dsw_OutputBuffer, 0, 0, DSBPLAY_LOOPING ); + if( hr != DS_OK ) + { + return hr; + } + dsw->dsw_OutputRunning = TRUE; + } + + return 0; +} +/************************************************************************************/ +HRESULT DSW_StopOutput( DSoundWrapper *dsw ) +{ + // Stop the buffer playback + if( dsw->dsw_OutputBuffer != NULL ) + { + dsw->dsw_OutputRunning = FALSE; + return IDirectSoundBuffer_Stop( dsw->dsw_OutputBuffer ); + } + else return 0; +} + +/************************************************************************************/ +HRESULT DSW_QueryOutputFilled( DSoundWrapper *dsw, long *bytesFilledPtr ) +{ + HRESULT hr; + DWORD playCursor; + DWORD writeCursor; + long bytesFilled; + // Query to see where play position is. + // We don't need the writeCursor but sometimes DirectSound doesn't handle NULLS correctly + // so let's pass a pointer just to be safe. + hr = IDirectSoundBuffer_GetCurrentPosition( dsw->dsw_OutputBuffer, &playCursor, &writeCursor ); + if( hr != DS_OK ) + { + return hr; + } + bytesFilled = dsw->dsw_WriteOffset - playCursor; + if( bytesFilled < 0 ) bytesFilled += dsw->dsw_OutputSize; // unwrap offset + *bytesFilledPtr = bytesFilled; + return hr; +} + +/************************************************************************************ + * Determine how much space can be safely written to in DS buffer. + * Detect underflows and overflows. + * Does not allow writing into safety gap maintained by DirectSound. + */ +HRESULT DSW_QueryOutputSpace( DSoundWrapper *dsw, long *bytesEmpty ) +{ + HRESULT hr; + DWORD playCursor; + DWORD writeCursor; + long numBytesEmpty; + long playWriteGap; + // Query to see how much room is in buffer. + hr = IDirectSoundBuffer_GetCurrentPosition( dsw->dsw_OutputBuffer, &playCursor, &writeCursor ); + if( hr != DS_OK ) + { + return hr; + } + // Determine size of gap between playIndex and WriteIndex that we cannot write into. + playWriteGap = writeCursor - playCursor; + if( playWriteGap < 0 ) playWriteGap += dsw->dsw_OutputSize; // unwrap + /* DirectSound doesn't have a large enough playCursor so we cannot detect wrap-around. */ + /* Attempt to detect playCursor wrap-around and correct it. */ + if( dsw->dsw_OutputRunning && (dsw->dsw_CounterTicksPerBuffer.QuadPart != 0) ) + { + /* How much time has elapsed since last check. */ + LARGE_INTEGER currentTime; + LARGE_INTEGER elapsedTime; + long bytesPlayed; + long bytesExpected; + long buffersWrapped; + QueryPerformanceCounter( ¤tTime ); + elapsedTime.QuadPart = currentTime.QuadPart - dsw->dsw_LastPlayTime.QuadPart; + dsw->dsw_LastPlayTime = currentTime; + /* How many bytes does DirectSound say have been played. */ + bytesPlayed = playCursor - dsw->dsw_LastPlayCursor; + if( bytesPlayed < 0 ) bytesPlayed += dsw->dsw_OutputSize; // unwrap + dsw->dsw_LastPlayCursor = playCursor; + /* Calculate how many bytes we would have expected to been played by now. */ + bytesExpected = (long) ((elapsedTime.QuadPart * dsw->dsw_OutputSize) / dsw->dsw_CounterTicksPerBuffer.QuadPart); + buffersWrapped = (bytesExpected - bytesPlayed) / dsw->dsw_OutputSize; + if( buffersWrapped > 0 ) + { + playCursor += (buffersWrapped * dsw->dsw_OutputSize); + bytesPlayed += (buffersWrapped * dsw->dsw_OutputSize); + } + /* Maintain frame output cursor. */ + dsw->dsw_FramesPlayed += (bytesPlayed / dsw->dsw_BytesPerOutputFrame); + } + numBytesEmpty = playCursor - dsw->dsw_WriteOffset; + if( numBytesEmpty < 0 ) numBytesEmpty += dsw->dsw_OutputSize; // unwrap offset + /* Have we underflowed? */ + if( numBytesEmpty > (dsw->dsw_OutputSize - playWriteGap) ) + { + if( dsw->dsw_OutputRunning ) + { + dsw->dsw_OutputUnderflows += 1; + } + dsw->dsw_WriteOffset = writeCursor; + numBytesEmpty = dsw->dsw_OutputSize - playWriteGap; + } + *bytesEmpty = numBytesEmpty; + return hr; +} + +/************************************************************************************/ +HRESULT DSW_ZeroEmptySpace( DSoundWrapper *dsw ) +{ + HRESULT hr; + LPBYTE lpbuf1 = NULL; + LPBYTE lpbuf2 = NULL; + DWORD dwsize1 = 0; + DWORD dwsize2 = 0; + long bytesEmpty; + hr = DSW_QueryOutputSpace( dsw, &bytesEmpty ); // updates dsw_FramesPlayed + if (hr != DS_OK) return hr; + if( bytesEmpty == 0 ) return DS_OK; + // Lock free space in the DS + hr = IDirectSoundBuffer_Lock( dsw->dsw_OutputBuffer, dsw->dsw_WriteOffset, bytesEmpty, (void **) &lpbuf1, &dwsize1, + (void **) &lpbuf2, &dwsize2, 0); + if (hr == DS_OK) + { + // Copy the buffer into the DS + ZeroMemory(lpbuf1, dwsize1); + if(lpbuf2 != NULL) + { + ZeroMemory(lpbuf2, dwsize2); + } + // Update our buffer offset and unlock sound buffer + dsw->dsw_WriteOffset = (dsw->dsw_WriteOffset + dwsize1 + dwsize2) % dsw->dsw_OutputSize; + IDirectSoundBuffer_Unlock( dsw->dsw_OutputBuffer, lpbuf1, dwsize1, lpbuf2, dwsize2); + dsw->dsw_FramesWritten += bytesEmpty / dsw->dsw_BytesPerOutputFrame; + } + return hr; +} + +/************************************************************************************/ +HRESULT DSW_WriteBlock( DSoundWrapper *dsw, char *buf, long numBytes ) +{ + HRESULT hr; + LPBYTE lpbuf1 = NULL; + LPBYTE lpbuf2 = NULL; + DWORD dwsize1 = 0; + DWORD dwsize2 = 0; + // Lock free space in the DS + hr = IDirectSoundBuffer_Lock( dsw->dsw_OutputBuffer, dsw->dsw_WriteOffset, numBytes, (void **) &lpbuf1, &dwsize1, + (void **) &lpbuf2, &dwsize2, 0); + if (hr == DS_OK) + { + // Copy the buffer into the DS + CopyMemory(lpbuf1, buf, dwsize1); + if(lpbuf2 != NULL) + { + CopyMemory(lpbuf2, buf+dwsize1, dwsize2); + } + // Update our buffer offset and unlock sound buffer + dsw->dsw_WriteOffset = (dsw->dsw_WriteOffset + dwsize1 + dwsize2) % dsw->dsw_OutputSize; + IDirectSoundBuffer_Unlock( dsw->dsw_OutputBuffer, lpbuf1, dwsize1, lpbuf2, dwsize2); + dsw->dsw_FramesWritten += numBytes / dsw->dsw_BytesPerOutputFrame; + } + return hr; +} + +/************************************************************************************/ +DWORD DSW_GetOutputStatus( DSoundWrapper *dsw ) +{ + DWORD status; + if (IDirectSoundBuffer_GetStatus( dsw->dsw_OutputBuffer, &status ) != DS_OK) + return( DSERR_INVALIDPARAM ); + else + return( status ); +} + +/* These routines are used to support audio input. + * Do NOT compile these calls when using NT4 because it does + * not support the entry points. + */ +/************************************************************************************/ +HRESULT DSW_InitInputDevice( DSoundWrapper *dsw, LPGUID lpGUID ) +{ + HRESULT hr = dswDSoundEntryPoints.DirectSoundCaptureCreate( lpGUID, &dsw->dsw_pDirectSoundCapture, NULL ); + if( hr != DS_OK ) return hr; + return hr; +} +/************************************************************************************/ +HRESULT DSW_InitInputBuffer( DSoundWrapper *dsw, unsigned long nFrameRate, WORD nChannels, int bytesPerBuffer ) +{ + DSCBUFFERDESC captureDesc; + WAVEFORMATEX wfFormat; + HRESULT result; + + dsw->dsw_BytesPerInputFrame = nChannels * sizeof(short); + + // Define the buffer format + wfFormat.wFormatTag = WAVE_FORMAT_PCM; + wfFormat.nChannels = nChannels; + wfFormat.nSamplesPerSec = nFrameRate; + wfFormat.wBitsPerSample = 8 * sizeof(short); + wfFormat.nBlockAlign = (WORD)(wfFormat.nChannels * (wfFormat.wBitsPerSample / 8)); + wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign; + wfFormat.cbSize = 0; /* No extended format info. */ + dsw->dsw_InputSize = bytesPerBuffer; + // ---------------------------------------------------------------------- + // Setup the secondary buffer description + ZeroMemory(&captureDesc, sizeof(DSCBUFFERDESC)); + captureDesc.dwSize = sizeof(DSCBUFFERDESC); + captureDesc.dwFlags = 0; + captureDesc.dwBufferBytes = bytesPerBuffer; + captureDesc.lpwfxFormat = &wfFormat; + // Create the capture buffer + if ((result = IDirectSoundCapture_CreateCaptureBuffer( dsw->dsw_pDirectSoundCapture, + &captureDesc, &dsw->dsw_InputBuffer, NULL)) != DS_OK) return result; + dsw->dsw_ReadOffset = 0; // reset last read position to start of buffer + return DS_OK; +} + +/************************************************************************************/ +HRESULT DSW_StartInput( DSoundWrapper *dsw ) +{ + // Start the buffer playback + if( dsw->dsw_InputBuffer != NULL ) + { + return IDirectSoundCaptureBuffer_Start( dsw->dsw_InputBuffer, DSCBSTART_LOOPING ); + } + else return 0; +} + +/************************************************************************************/ +HRESULT DSW_StopInput( DSoundWrapper *dsw ) +{ + // Stop the buffer playback + if( dsw->dsw_InputBuffer != NULL ) + { + return IDirectSoundCaptureBuffer_Stop( dsw->dsw_InputBuffer ); + } + else return 0; +} + +/************************************************************************************/ +HRESULT DSW_QueryInputFilled( DSoundWrapper *dsw, long *bytesFilled ) +{ + HRESULT hr; + DWORD capturePos; + DWORD readPos; + long filled; + // Query to see how much data is in buffer. + // We don't need the capture position but sometimes DirectSound doesn't handle NULLS correctly + // so let's pass a pointer just to be safe. + hr = IDirectSoundCaptureBuffer_GetCurrentPosition( dsw->dsw_InputBuffer, &capturePos, &readPos ); + if( hr != DS_OK ) + { + return hr; + } + filled = readPos - dsw->dsw_ReadOffset; + if( filled < 0 ) filled += dsw->dsw_InputSize; // unwrap offset + *bytesFilled = filled; + return hr; +} + +/************************************************************************************/ +HRESULT DSW_ReadBlock( DSoundWrapper *dsw, char *buf, long numBytes ) +{ + HRESULT hr; + LPBYTE lpbuf1 = NULL; + LPBYTE lpbuf2 = NULL; + DWORD dwsize1 = 0; + DWORD dwsize2 = 0; + // Lock free space in the DS + hr = IDirectSoundCaptureBuffer_Lock ( dsw->dsw_InputBuffer, dsw->dsw_ReadOffset, numBytes, (void **) &lpbuf1, &dwsize1, + (void **) &lpbuf2, &dwsize2, 0); + if (hr == DS_OK) + { + // Copy from DS to the buffer + CopyMemory( buf, lpbuf1, dwsize1); + if(lpbuf2 != NULL) + { + CopyMemory( buf+dwsize1, lpbuf2, dwsize2); + } + // Update our buffer offset and unlock sound buffer + dsw->dsw_ReadOffset = (dsw->dsw_ReadOffset + dwsize1 + dwsize2) % dsw->dsw_InputSize; + IDirectSoundCaptureBuffer_Unlock ( dsw->dsw_InputBuffer, lpbuf1, dwsize1, lpbuf2, dwsize2); + } + return hr; +} + diff --git a/portaudio-v19/pa_win_ds/dsound_wrapper.h b/portaudio-v19/pa_win_ds/dsound_wrapper.h new file mode 100644 index 000000000..713f4a71d --- /dev/null +++ b/portaudio-v19/pa_win_ds/dsound_wrapper.h @@ -0,0 +1,130 @@ +#ifndef __DSOUND_WRAPPER_H +#define __DSOUND_WRAPPER_H +/* + * $Id$ + * Simplified DirectSound interface. + * + * Author: Phil Burk & Robert Marsanyi + * + * For PortAudio Portable Real-Time Audio Library + * For more information see: http://www.softsynth.com/portaudio/ + * DirectSound Implementation + * Copyright (c) 1999-2000 Phil Burk & Robert Marsanyi + * + * 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. + * + * 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. + * + * 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. + * + */ + +/* on Borland compilers, WIN32 doesn't seem to be defined by default, which + breaks DSound.h. Adding the define here fixes the problem. - rossb. */ +#ifdef __BORLANDC__ +#if !defined(WIN32) +#define WIN32 +#endif +#endif + +/* + We are only using DX3 in here, no need to polute the namespace - davidv +*/ +#define DIRECTSOUND_VERSION 0x0300 + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +typedef struct +{ + HINSTANCE hInstance_; + + HRESULT (WINAPI *DirectSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN); + HRESULT (WINAPI *DirectSoundEnumerateW)(LPDSENUMCALLBACKW, LPVOID); + HRESULT (WINAPI *DirectSoundEnumerateA)(LPDSENUMCALLBACKA, LPVOID); + + HRESULT (WINAPI *DirectSoundCaptureCreate)(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN); + HRESULT (WINAPI *DirectSoundCaptureEnumerateW)(LPDSENUMCALLBACKW, LPVOID); + HRESULT (WINAPI *DirectSoundCaptureEnumerateA)(LPDSENUMCALLBACKA, LPVOID); +}DSoundEntryPoints; + +extern DSoundEntryPoints dswDSoundEntryPoints; + +void DSW_InitializeDSoundEntryPoints(void); +void DSW_TerminateDSoundEntryPoints(void); + +#define DSW_NUM_POSITIONS (4) +#define DSW_NUM_EVENTS (5) +#define DSW_TERMINATION_EVENT (DSW_NUM_POSITIONS) + +typedef struct +{ +/* Output */ + LPDIRECTSOUND dsw_pDirectSound; + LPDIRECTSOUNDBUFFER dsw_OutputBuffer; + DWORD dsw_WriteOffset; /* last write position */ + INT dsw_OutputSize; + INT dsw_BytesPerOutputFrame; + /* Try to detect play buffer underflows. */ + LARGE_INTEGER dsw_CounterTicksPerBuffer; /* counter ticks it should take to play a full buffer */ + LARGE_INTEGER dsw_LastPlayTime; + UINT dsw_LastPlayCursor; + UINT dsw_OutputUnderflows; + BOOL dsw_OutputRunning; + /* use double which lets us can play for several thousand years with enough precision */ + double dsw_FramesWritten; + double dsw_FramesPlayed; +/* Input */ + INT dsw_BytesPerInputFrame; + LPDIRECTSOUNDCAPTURE dsw_pDirectSoundCapture; + LPDIRECTSOUNDCAPTUREBUFFER dsw_InputBuffer; + UINT dsw_ReadOffset; /* last read position */ + UINT dsw_InputSize; +} DSoundWrapper; + +HRESULT DSW_Init( DSoundWrapper *dsw ); +void DSW_Term( DSoundWrapper *dsw ); +HRESULT DSW_InitOutputBuffer( DSoundWrapper *dsw, unsigned long nFrameRate, + WORD nChannels, int bufSize ); +HRESULT DSW_StartOutput( DSoundWrapper *dsw ); +HRESULT DSW_StopOutput( DSoundWrapper *dsw ); +DWORD DSW_GetOutputStatus( DSoundWrapper *dsw ); +HRESULT DSW_WriteBlock( DSoundWrapper *dsw, char *buf, long numBytes ); +HRESULT DSW_ZeroEmptySpace( DSoundWrapper *dsw ); +HRESULT DSW_QueryOutputSpace( DSoundWrapper *dsw, long *bytesEmpty ); +HRESULT DSW_Enumerate( DSoundWrapper *dsw ); + +HRESULT DSW_InitInputBuffer( DSoundWrapper *dsw, unsigned long nFrameRate, + WORD nChannels, int bufSize ); +HRESULT DSW_StartInput( DSoundWrapper *dsw ); +HRESULT DSW_StopInput( DSoundWrapper *dsw ); +HRESULT DSW_ReadBlock( DSoundWrapper *dsw, char *buf, long numBytes ); +HRESULT DSW_QueryInputFilled( DSoundWrapper *dsw, long *bytesFilled ); +HRESULT DSW_QueryOutputFilled( DSoundWrapper *dsw, long *bytesFilled ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* __DSOUND_WRAPPER_H */ diff --git a/portaudio-v19/pa_win_ds/pa_win_ds.c b/portaudio-v19/pa_win_ds/pa_win_ds.c new file mode 100644 index 000000000..10f19f22b --- /dev/null +++ b/portaudio-v19/pa_win_ds/pa_win_ds.c @@ -0,0 +1,1857 @@ +/* + * $Id$ + * Portable Audio I/O Library DirectSound implementation + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + + @todo implement paInputOverflow callback status flag + + @todo implement paNeverDropInput. + + @todo implement host api specific extension to set i/o buffer sizes in frames + + @todo implement initialisation of PaDeviceInfo default*Latency fields (currently set to 0.) + + @todo implement ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable + + @todo audit handling of DirectSound result codes - in many cases we could convert a HRESULT into + a native portaudio error code. Standard DirectSound result codes are documented at msdn. + + @todo implement IsFormatSupported + + @todo check that CoInitialize() CoUninitialize() are always correctly + paired, even in error cases. + + @todo call PaUtil_SetLastHostErrorInfo with a specific error string (currently just "DSound error"). + + @todo make sure all buffers have been played before stopping the stream + when the stream callback returns paComplete + + old TODOs from phil, need to work out if these have been done: + O- fix "patest_stop.c" +*/ + +#include +#include /* strlen() */ + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + +#include "dsound_wrapper.h" + +#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ +#pragma comment( lib, "dsound.lib" ) +#pragma comment( lib, "winmm.lib" ) +#endif + + +#define PRINT(x) PA_DEBUG(x); +#define ERR_RPT(x) PRINT(x) +#define DBUG(x) PRINT(x) +#define DBUGX(x) PRINT(x) + +#define PA_USE_HIGH_LATENCY (0) +#if PA_USE_HIGH_LATENCY +#define PA_WIN_9X_LATENCY (500) +#define PA_WIN_NT_LATENCY (600) +#else +#define PA_WIN_9X_LATENCY (140) +#define PA_WIN_NT_LATENCY (280) +#endif + +#define PA_WIN_WDM_LATENCY (120) + +#define SECONDS_PER_MSEC (0.001) +#define MSEC_PER_SECOND (1000) + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaWinDs_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + + +/* FIXME: should convert hr to a string */ +#define PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ) \ + PaUtil_SetLastHostErrorInfo( paDirectSound, hr, "DirectSound error" ) + +/************************************************* DX Prototypes **********/ +static BOOL CALLBACK CollectGUIDsProc(LPGUID lpGUID, + LPCTSTR lpszDesc, + LPCTSTR lpszDrvName, + LPVOID lpContext ); + +/************************************************************************************/ +/********************** Structures **************************************************/ +/************************************************************************************/ +/* PaWinDsHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct PaWinDsDeviceInfo +{ + GUID guid; + GUID *lpGUID; + double sampleRates[3]; +} PaWinDsDeviceInfo; + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ + PaWinDsDeviceInfo *winDsDeviceInfos; + +} PaWinDsHostApiRepresentation; + +/* PaWinDsStream - a stream data structure specifically for this implementation */ + +typedef struct PaWinDsStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + +/* DirectSound specific data. */ + DSoundWrapper directSoundWrapper; + MMRESULT timerID; + BOOL ifInsideCallback; /* Test for reentrancy. */ + int framesPerDSBuffer; + double framesWritten; + double secondsPerHostByte; /* Used to optimize latency calculation for outTime */ + + PaStreamCallbackFlags callbackFlags; + +/* FIXME - move all below to PaUtilStreamRepresentation */ + volatile int isStarted; + volatile int isActive; + volatile int stopProcessing; /* stop thread once existing buffers have been returned */ + volatile int abortProcessing; /* stop thread immediately */ +} PaWinDsStream; + + +/************************************************************************************ +** Duplicate the input string using the allocations allocator. +** A NULL string is converted to a zero length string. +** If memory cannot be allocated, NULL is returned. +**/ +static char *DuplicateDeviceNameString( PaUtilAllocationGroup *allocations, const char* src ) +{ + char *result = 0; + + if( src != NULL ) + { + size_t len = strlen(src); + result = (char*)PaUtil_GroupAllocateMemory( allocations, (long)(len + 1) ); + if( result ) + memcpy( (void *) result, src, len+1 ); + } + else + { + result = (char*)PaUtil_GroupAllocateMemory( allocations, 1 ); + if( result ) + result[0] = '\0'; + } + + return result; +} + +/************************************************************************************ +** DSDeviceNameAndGUID, DSDeviceNameAndGUIDVector used for collecting preliminary +** information during device enumeration. +*/ +typedef struct DSDeviceNameAndGUID{ + char *name; // allocated from parent's allocations, never deleted by this structure + GUID guid; + LPGUID lpGUID; +} DSDeviceNameAndGUID; + +typedef struct DSDeviceNameAndGUIDVector{ + PaUtilAllocationGroup *allocations; + PaError enumerationError; + + int count; + int free; + DSDeviceNameAndGUID *items; // Allocated using LocalAlloc() +} DSDeviceNameAndGUIDVector; + +static PaError InitializeDSDeviceNameAndGUIDVector( + DSDeviceNameAndGUIDVector *guidVector, PaUtilAllocationGroup *allocations ) +{ + PaError result = paNoError; + + guidVector->allocations = allocations; + guidVector->enumerationError = paNoError; + + guidVector->count = 0; + guidVector->free = 8; + guidVector->items = (DSDeviceNameAndGUID*)LocalAlloc( LMEM_FIXED, sizeof(DSDeviceNameAndGUID) * guidVector->free ); + if( guidVector->items == NULL ) + result = paInsufficientMemory; + + return result; +} + +static PaError ExpandDSDeviceNameAndGUIDVector( DSDeviceNameAndGUIDVector *guidVector ) +{ + PaError result = paNoError; + DSDeviceNameAndGUID *newItems; + int i; + + /* double size of vector */ + int size = guidVector->count + guidVector->free; + guidVector->free += size; + + newItems = (DSDeviceNameAndGUID*)LocalAlloc( LMEM_FIXED, sizeof(DSDeviceNameAndGUID) * size * 2 ); + if( newItems == NULL ) + { + result = paInsufficientMemory; + } + else + { + for( i=0; i < guidVector->count; ++i ) + { + newItems[i].name = guidVector->items[i].name; + if( guidVector->items[i].lpGUID == NULL ) + { + newItems[i].lpGUID = NULL; + } + else + { + newItems[i].lpGUID = &newItems[i].guid; + memcpy( &newItems[i].guid, guidVector->items[i].lpGUID, sizeof(GUID) );; + } + } + + LocalFree( guidVector->items ); + guidVector->items = newItems; + } + + return result; +} + +/* + it's safe to call DSDeviceNameAndGUIDVector multiple times +*/ +static PaError TerminateDSDeviceNameAndGUIDVector( DSDeviceNameAndGUIDVector *guidVector ) +{ + PaError result = paNoError; + + if( guidVector->items != NULL ) + { + if( LocalFree( guidVector->items ) != NULL ) + result = paInsufficientMemory; /** @todo this isn't the correct error to return from a deallocation failure */ + + guidVector->items = NULL; + } + + return result; +} + +/************************************************************************************ +** Collect preliminary device information during DirectSound enumeration +*/ +static BOOL CALLBACK CollectGUIDsProc(LPGUID lpGUID, + LPCTSTR lpszDesc, + LPCTSTR lpszDrvName, + LPVOID lpContext ) +{ + DSDeviceNameAndGUIDVector *namesAndGUIDs = (DSDeviceNameAndGUIDVector*)lpContext; + PaError error; + + (void) lpszDrvName; /* unused variable */ + + if( namesAndGUIDs->free == 0 ) + { + error = ExpandDSDeviceNameAndGUIDVector( namesAndGUIDs ); + if( error != paNoError ) + { + namesAndGUIDs->enumerationError = error; + return FALSE; + } + } + + /* Set GUID pointer, copy GUID to storage in DSDeviceNameAndGUIDVector. */ + if( lpGUID == NULL ) + { + namesAndGUIDs->items[namesAndGUIDs->count].lpGUID = NULL; + } + else + { + namesAndGUIDs->items[namesAndGUIDs->count].lpGUID = + &namesAndGUIDs->items[namesAndGUIDs->count].guid; + + memcpy( &namesAndGUIDs->items[namesAndGUIDs->count].guid, lpGUID, sizeof(GUID) ); + } + + namesAndGUIDs->items[namesAndGUIDs->count].name = + DuplicateDeviceNameString( namesAndGUIDs->allocations, lpszDesc ); + if( namesAndGUIDs->items[namesAndGUIDs->count].name == NULL ) + { + namesAndGUIDs->enumerationError = paInsufficientMemory; + return FALSE; + } + + ++namesAndGUIDs->count; + --namesAndGUIDs->free; + + return TRUE; +} + + +/* + GUIDs for emulated devices which we blacklist below. + are there more than two of them?? +*/ + +GUID IID_IRolandVSCEmulated1 = {0xc2ad1800, 0xb243, 0x11ce, 0xa8, 0xa4, 0x00, 0xaa, 0x00, 0x6c, 0x45, 0x01}; +GUID IID_IRolandVSCEmulated2 = {0xc2ad1800, 0xb243, 0x11ce, 0xa8, 0xa4, 0x00, 0xaa, 0x00, 0x6c, 0x45, 0x02}; + + +#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ (13) /* must match array length below */ +static double defaultSampleRateSearchOrder_[] = + { 44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, 192000.0, + 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 }; + + +/************************************************************************************ +** Extract capabilities from an output device, and add it to the device info list +** if successful. This function assumes that there is enough room in the +** device info list to accomodate all entries. +** +** The device will not be added to the device list if any errors are encountered. +*/ +static PaError AddOutputDeviceInfoFromDirectSound( + PaWinDsHostApiRepresentation *winDsHostApi, char *name, LPGUID lpGUID ) +{ + PaUtilHostApiRepresentation *hostApi = &winDsHostApi->inheritedHostApiRep; + PaDeviceInfo *deviceInfo = hostApi->deviceInfos[hostApi->info.deviceCount]; + PaWinDsDeviceInfo *winDsDeviceInfo = &winDsHostApi->winDsDeviceInfos[hostApi->info.deviceCount]; + HRESULT hr; + LPDIRECTSOUND lpDirectSound; + DSCAPS caps; + int deviceOK = TRUE; + PaError result = paNoError; + int i; + + /* Copy GUID to the device info structure. Set pointer. */ + if( lpGUID == NULL ) + { + winDsDeviceInfo->lpGUID = NULL; + } + else + { + memcpy( &winDsDeviceInfo->guid, lpGUID, sizeof(GUID) ); + winDsDeviceInfo->lpGUID = &winDsDeviceInfo->guid; + } + + + if( lpGUID ) + { + if (IsEqualGUID (&IID_IRolandVSCEmulated1,lpGUID) || + IsEqualGUID (&IID_IRolandVSCEmulated2,lpGUID) ) + { + PA_DEBUG(("BLACKLISTED: %s \n",name)); + return paNoError; + } + } + + /* Create a DirectSound object for the specified GUID + Note that using CoCreateInstance doesn't work on windows CE. + */ + hr = dswDSoundEntryPoints.DirectSoundCreate( lpGUID, &lpDirectSound, NULL ); + + /** try using CoCreateInstance because DirectSoundCreate was hanging under + some circumstances - note this was probably related to the + #define BOOL short bug which has now been fixed + @todo delete this comment and the following code once we've ensured + there is no bug. + */ + /* + hr = CoCreateInstance( &CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectSound, (void**)&lpDirectSound ); + + if( hr == S_OK ) + { + hr = IDirectSound_Initialize( lpDirectSound, lpGUID ); + } + */ + + if( hr != DS_OK ) + { + if (hr == DSERR_ALLOCATED) + PA_DEBUG(("AddOutputDeviceInfoFromDirectSound %s DSERR_ALLOCATED\n",name)); + DBUG(("Cannot create DirectSound for %s. Result = 0x%x\n", name, hr )); + DBUG(("%s's GUID: {0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x, 0x%x} \n", + name, + lpGUID->Data1, + lpGUID->Data2, + lpGUID->Data3, + lpGUID->Data4[0], + lpGUID->Data4[1], + lpGUID->Data4[2], + lpGUID->Data4[3], + lpGUID->Data4[4], + lpGUID->Data4[5], + lpGUID->Data4[6], + lpGUID->Data4[7])); + + deviceOK = FALSE; + } + else + { + /* Query device characteristics. */ + memset( &caps, 0, sizeof(caps) ); + caps.dwSize = sizeof(caps); + hr = IDirectSound_GetCaps( lpDirectSound, &caps ); + if( hr != DS_OK ) + { + DBUG(("Cannot GetCaps() for DirectSound device %s. Result = 0x%x\n", name, hr )); + deviceOK = FALSE; + } + else + { + +#ifndef PA_NO_WMME + if( caps.dwFlags & DSCAPS_EMULDRIVER ) + { + /* If WMME supported, then reject Emulated drivers because they are lousy. */ + deviceOK = FALSE; + } +#endif + + if( deviceOK ) + { + deviceInfo->maxInputChannels = 0; + /* Mono or stereo device? */ + deviceInfo->maxOutputChannels = ( caps.dwFlags & DSCAPS_PRIMARYSTEREO ) ? 2 : 1; + + deviceInfo->defaultLowInputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultLowOutputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultHighInputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultHighOutputLatency = 0.; /** @todo IMPLEMENT ME */ + + /* initialize defaultSampleRate */ + + if( caps.dwFlags & DSCAPS_CONTINUOUSRATE ) + { + /* initialize to caps.dwMaxSecondarySampleRate incase none of the standard rates match */ + deviceInfo->defaultSampleRate = caps.dwMaxSecondarySampleRate; + + for( i = 0; i < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++i ) + { + if( defaultSampleRateSearchOrder_[i] >= caps.dwMinSecondarySampleRate + && defaultSampleRateSearchOrder_[i] <= caps.dwMaxSecondarySampleRate ){ + + deviceInfo->defaultSampleRate = defaultSampleRateSearchOrder_[i]; + break; + } + } + } + else if( caps.dwMinSecondarySampleRate == caps.dwMaxSecondarySampleRate ) + { + if( caps.dwMinSecondarySampleRate == 0 ) + { + /* + ** On my Thinkpad 380Z, DirectSoundV6 returns min-max=0 !! + ** But it supports continuous sampling. + ** So fake range of rates, and hope it really supports it. + */ + deviceInfo->defaultSampleRate = 44100.0f; + + DBUG(("PA - Reported rates both zero. Setting to fake values for device #%s\n", name )); + } + else + { + deviceInfo->defaultSampleRate = caps.dwMaxSecondarySampleRate; + } + } + else if( (caps.dwMinSecondarySampleRate < 1000.0) && (caps.dwMaxSecondarySampleRate > 50000.0) ) + { + /* The EWS88MT drivers lie, lie, lie. The say they only support two rates, 100 & 100000. + ** But we know that they really support a range of rates! + ** So when we see a ridiculous set of rates, assume it is a range. + */ + deviceInfo->defaultSampleRate = 44100.0f; + DBUG(("PA - Sample rate range used instead of two odd values for device #%s\n", name )); + } + else deviceInfo->defaultSampleRate = caps.dwMaxSecondarySampleRate; + + + //printf( "min %d max %d\n", caps.dwMinSecondarySampleRate, caps.dwMaxSecondarySampleRate ); + // dwFlags | DSCAPS_CONTINUOUSRATE + } + } + + IDirectSound_Release( lpDirectSound ); + } + + if( deviceOK ) + { + deviceInfo->name = name; + + if( lpGUID == NULL ) + hostApi->info.defaultOutputDevice = hostApi->info.deviceCount; + + hostApi->info.deviceCount++; + } + + return result; +} + + +/************************************************************************************ +** Extract capabilities from an input device, and add it to the device info list +** if successful. This function assumes that there is enough room in the +** device info list to accomodate all entries. +** +** The device will not be added to the device list if any errors are encountered. +*/ +static PaError AddInputDeviceInfoFromDirectSoundCapture( + PaWinDsHostApiRepresentation *winDsHostApi, char *name, LPGUID lpGUID ) +{ + PaUtilHostApiRepresentation *hostApi = &winDsHostApi->inheritedHostApiRep; + PaDeviceInfo *deviceInfo = hostApi->deviceInfos[hostApi->info.deviceCount]; + PaWinDsDeviceInfo *winDsDeviceInfo = &winDsHostApi->winDsDeviceInfos[hostApi->info.deviceCount]; + HRESULT hr; + LPDIRECTSOUNDCAPTURE lpDirectSoundCapture; + DSCCAPS caps; + int deviceOK = TRUE; + PaError result = paNoError; + + /* Copy GUID to the device info structure. Set pointer. */ + if( lpGUID == NULL ) + { + winDsDeviceInfo->lpGUID = NULL; + } + else + { + winDsDeviceInfo->lpGUID = &winDsDeviceInfo->guid; + memcpy( &winDsDeviceInfo->guid, lpGUID, sizeof(GUID) ); + } + + + hr = dswDSoundEntryPoints.DirectSoundCaptureCreate( lpGUID, &lpDirectSoundCapture, NULL ); + + /** try using CoCreateInstance because DirectSoundCreate was hanging under + some circumstances - note this was probably related to the + #define BOOL short bug which has now been fixed + @todo delete this comment and the following code once we've ensured + there is no bug. + */ + /* + hr = CoCreateInstance( &CLSID_DirectSoundCapture, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectSoundCapture, (void**)&lpDirectSoundCapture ); + */ + if( hr != DS_OK ) + { + DBUG(("Cannot create Capture for %s. Result = 0x%x\n", name, hr )); + deviceOK = FALSE; + } + else + { + /* Query device characteristics. */ + memset( &caps, 0, sizeof(caps) ); + caps.dwSize = sizeof(caps); + hr = IDirectSoundCapture_GetCaps( lpDirectSoundCapture, &caps ); + if( hr != DS_OK ) + { + DBUG(("Cannot GetCaps() for Capture device %s. Result = 0x%x\n", name, hr )); + deviceOK = FALSE; + } + else + { +#ifndef PA_NO_WMME + if( caps.dwFlags & DSCAPS_EMULDRIVER ) + { + /* If WMME supported, then reject Emulated drivers because they are lousy. */ + deviceOK = FALSE; + } +#endif + + if( deviceOK ) + { + deviceInfo->maxInputChannels = caps.dwChannels; + deviceInfo->maxOutputChannels = 0; + + deviceInfo->defaultLowInputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultLowOutputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultHighInputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultHighOutputLatency = 0.; /** @todo IMPLEMENT ME */ + +/* constants from a WINE patch by Francois Gouget, see: + http://www.winehq.com/hypermail/wine-patches/2003/01/0290.html + + --- + Date: Fri, 14 May 2004 10:38:12 +0200 (CEST) + From: Francois Gouget + To: Ross Bencina + Subject: Re: Permission to use wine 48/96 wave patch in BSD licensed library + + [snip] + + I give you permission to use the patch below under the BSD license. + http://www.winehq.com/hypermail/wine-patches/2003/01/0290.html + + [snip] +*/ +#ifndef WAVE_FORMAT_48M08 +#define WAVE_FORMAT_48M08 0x00001000 /* 48 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_48S08 0x00002000 /* 48 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_48M16 0x00004000 /* 48 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_48S16 0x00008000 /* 48 kHz, Stereo, 16-bit */ +#define WAVE_FORMAT_96M08 0x00010000 /* 96 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_96S08 0x00020000 /* 96 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_96M16 0x00040000 /* 96 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_96S16 0x00080000 /* 96 kHz, Stereo, 16-bit */ +#endif + + /* defaultSampleRate */ + if( caps.dwChannels == 2 ) + { + if( caps.dwFormats & WAVE_FORMAT_4S16 ) + deviceInfo->defaultSampleRate = 44100.0; + else if( caps.dwFormats & WAVE_FORMAT_48S16 ) + deviceInfo->defaultSampleRate = 48000.0; + else if( caps.dwFormats & WAVE_FORMAT_2S16 ) + deviceInfo->defaultSampleRate = 22050.0; + else if( caps.dwFormats & WAVE_FORMAT_1S16 ) + deviceInfo->defaultSampleRate = 11025.0; + else if( caps.dwFormats & WAVE_FORMAT_96S16 ) + deviceInfo->defaultSampleRate = 96000.0; + else + deviceInfo->defaultSampleRate = 0.; + } + else if( caps.dwChannels == 1 ) + { + if( caps.dwFormats & WAVE_FORMAT_4M16 ) + deviceInfo->defaultSampleRate = 44100.0; + else if( caps.dwFormats & WAVE_FORMAT_48M16 ) + deviceInfo->defaultSampleRate = 48000.0; + else if( caps.dwFormats & WAVE_FORMAT_2M16 ) + deviceInfo->defaultSampleRate = 22050.0; + else if( caps.dwFormats & WAVE_FORMAT_1M16 ) + deviceInfo->defaultSampleRate = 11025.0; + else if( caps.dwFormats & WAVE_FORMAT_96M16 ) + deviceInfo->defaultSampleRate = 96000.0; + else + deviceInfo->defaultSampleRate = 0.; + } + else deviceInfo->defaultSampleRate = 0.; + } + } + + IDirectSoundCapture_Release( lpDirectSoundCapture ); + } + + if( deviceOK ) + { + deviceInfo->name = name; + + if( lpGUID == NULL ) + hostApi->info.defaultInputDevice = hostApi->info.deviceCount; + + hostApi->info.deviceCount++; + } + + return result; +} + + +/***********************************************************************************/ +PaError PaWinDs_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i, deviceCount; + PaWinDsHostApiRepresentation *winDsHostApi; + DSDeviceNameAndGUIDVector inputNamesAndGUIDs, outputNamesAndGUIDs; + PaDeviceInfo *deviceInfoArray; + + HRESULT hr = CoInitialize(NULL); /** @todo: should uninitialize too */ + if( FAILED(hr) ){ + return paUnanticipatedHostError; + } + + /* initialise guid vectors so they can be safely deleted on error */ + inputNamesAndGUIDs.items = NULL; + outputNamesAndGUIDs.items = NULL; + + DSW_InitializeDSoundEntryPoints(); + + winDsHostApi = (PaWinDsHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinDsHostApiRepresentation) ); + if( !winDsHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + winDsHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !winDsHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + *hostApi = &winDsHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paDirectSound; + (*hostApi)->info.name = "Windows DirectSound"; + + (*hostApi)->info.deviceCount = 0; + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + + +/* DSound - enumerate devices to count them and to gather their GUIDs */ + + + result = InitializeDSDeviceNameAndGUIDVector( &inputNamesAndGUIDs, winDsHostApi->allocations ); + if( result != paNoError ) + goto error; + + result = InitializeDSDeviceNameAndGUIDVector( &outputNamesAndGUIDs, winDsHostApi->allocations ); + if( result != paNoError ) + goto error; + + dswDSoundEntryPoints.DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK)CollectGUIDsProc, (void *)&inputNamesAndGUIDs ); + + dswDSoundEntryPoints.DirectSoundEnumerate( (LPDSENUMCALLBACK)CollectGUIDsProc, (void *)&outputNamesAndGUIDs ); + + if( inputNamesAndGUIDs.enumerationError != paNoError ) + { + result = inputNamesAndGUIDs.enumerationError; + goto error; + } + + if( outputNamesAndGUIDs.enumerationError != paNoError ) + { + result = outputNamesAndGUIDs.enumerationError; + goto error; + } + + deviceCount = inputNamesAndGUIDs.count + outputNamesAndGUIDs.count; + + if( deviceCount > 0 ) + { + /* allocate array for pointers to PaDeviceInfo structs */ + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + winDsHostApi->allocations, sizeof(PaDeviceInfo*) * deviceCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all PaDeviceInfo structs in a contiguous block */ + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + winDsHostApi->allocations, sizeof(PaDeviceInfo) * deviceCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all DSound specific info structs in a contiguous block */ + winDsHostApi->winDsDeviceInfos = (PaWinDsDeviceInfo*)PaUtil_GroupAllocateMemory( + winDsHostApi->allocations, sizeof(PaWinDsDeviceInfo) * deviceCount ); + if( !winDsHostApi->winDsDeviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < deviceCount; ++i ) + { + PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + deviceInfo->name = 0; + (*hostApi)->deviceInfos[i] = deviceInfo; + } + + for( i=0; i< inputNamesAndGUIDs.count; ++i ) + { + result = AddInputDeviceInfoFromDirectSoundCapture( winDsHostApi, + inputNamesAndGUIDs.items[i].name, + inputNamesAndGUIDs.items[i].lpGUID ); + if( result != paNoError ) + goto error; + } + + for( i=0; i< outputNamesAndGUIDs.count; ++i ) + { + result = AddOutputDeviceInfoFromDirectSound( winDsHostApi, + outputNamesAndGUIDs.items[i].name, + outputNamesAndGUIDs.items[i].lpGUID ); + if( result != paNoError ) + goto error; + } + } + + result = TerminateDSDeviceNameAndGUIDVector( &inputNamesAndGUIDs ); + if( result != paNoError ) + goto error; + + result = TerminateDSDeviceNameAndGUIDVector( &outputNamesAndGUIDs ); + if( result != paNoError ) + goto error; + + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &winDsHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &winDsHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( winDsHostApi ) + { + if( winDsHostApi->allocations ) + { + PaUtil_FreeAllAllocations( winDsHostApi->allocations ); + PaUtil_DestroyAllocationGroup( winDsHostApi->allocations ); + } + + PaUtil_FreeMemory( winDsHostApi ); + } + + TerminateDSDeviceNameAndGUIDVector( &inputNamesAndGUIDs ); + TerminateDSDeviceNameAndGUIDVector( &outputNamesAndGUIDs ); + + return result; +} + + +/***********************************************************************************/ +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaWinDsHostApiRepresentation *winDsHostApi = (PaWinDsHostApiRepresentation*)hostApi; + + /* + IMPLEMENT ME: + - clean up any resources not handled by the allocation group + */ + + if( winDsHostApi->allocations ) + { + PaUtil_FreeAllAllocations( winDsHostApi->allocations ); + PaUtil_DestroyAllocationGroup( winDsHostApi->allocations ); + } + + PaUtil_FreeMemory( winDsHostApi ); + + DSW_TerminateDSoundEntryPoints(); + + CoUninitialize(); +} + + +/* Set minimal latency based on whether NT or Win95. + * NT has higher latency. + */ +static int PaWinDS_GetMinSystemLatency( void ) +{ + int minLatencyMsec; + /* Set minimal latency based on whether NT or other OS. + * NT has higher latency. + */ + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize = sizeof( osvi ); + GetVersionEx( &osvi ); + DBUG(("PA - PlatformId = 0x%x\n", osvi.dwPlatformId )); + DBUG(("PA - MajorVersion = 0x%x\n", osvi.dwMajorVersion )); + DBUG(("PA - MinorVersion = 0x%x\n", osvi.dwMinorVersion )); + /* Check for NT */ + if( (osvi.dwMajorVersion == 4) && (osvi.dwPlatformId == 2) ) + { + minLatencyMsec = PA_WIN_NT_LATENCY; + } + else if(osvi.dwMajorVersion >= 5) + { + minLatencyMsec = PA_WIN_WDM_LATENCY; + } + else + { + minLatencyMsec = PA_WIN_9X_LATENCY; + } + return minLatencyMsec; +} + +/***********************************************************************************/ +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + /* + IMPLEMENT ME: + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported if necessary + + - check that the device supports sampleRate + + Because the buffer adapter handles conversion between all standard + sample formats, the following checks are only required if paCustomFormat + is implemented, or under some other unusual conditions. + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + */ + + return paFormatIsSupported; +} + + +/************************************************************************* +** Determine minimum number of buffers required for this host based +** on minimum latency. Latency can be optionally set by user by setting +** an environment variable. For example, to set latency to 200 msec, put: +** +** set PA_MIN_LATENCY_MSEC=200 +** +** in the AUTOEXEC.BAT file and reboot. +** If the environment variable is not set, then the latency will be determined +** based on the OS. Windows NT has higher latency than Win95. +*/ +#define PA_LATENCY_ENV_NAME ("PA_MIN_LATENCY_MSEC") +#define PA_ENV_BUF_SIZE (32) + +static int PaWinDs_GetMinLatencyFrames( double sampleRate ) +{ + char envbuf[PA_ENV_BUF_SIZE]; + DWORD hresult; + int minLatencyMsec = 0; + + /* Let user determine minimal latency by setting environment variable. */ + hresult = GetEnvironmentVariable( PA_LATENCY_ENV_NAME, envbuf, PA_ENV_BUF_SIZE ); + if( (hresult > 0) && (hresult < PA_ENV_BUF_SIZE) ) + { + minLatencyMsec = atoi( envbuf ); + } + else + { + minLatencyMsec = PaWinDS_GetMinSystemLatency(); +#if PA_USE_HIGH_LATENCY + PRINT(("PA - Minimum Latency set to %d msec!\n", minLatencyMsec )); +#endif + + } + + return (int) (minLatencyMsec * sampleRate * SECONDS_PER_MSEC); +} + +/***********************************************************************************/ +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaWinDsHostApiRepresentation *winDsHostApi = (PaWinDsHostApiRepresentation*)hostApi; + PaWinDsStream *stream = 0; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + unsigned long suggestedInputLatencyFrames, suggestedOutputLatencyFrames; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + suggestedInputLatencyFrames = (unsigned long)(inputParameters->suggestedLatency * sampleRate); + + /* IDEA: the following 3 checks could be performed by default by pa_front + unless some flag indicated otherwise */ + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate hostApiSpecificStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + suggestedInputLatencyFrames = 0; + } + + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + suggestedOutputLatencyFrames = (unsigned long)(outputParameters->suggestedLatency * sampleRate); + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate hostApiSpecificStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + suggestedOutputLatencyFrames = 0; + } + + + /* + IMPLEMENT ME: + + ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() ) + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + - alter sampleRate to a close allowable rate if possible / necessary + + - validate suggestedInputLatency and suggestedOutputLatency parameters, + use default values where necessary + */ + + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + + stream = (PaWinDsStream*)PaUtil_AllocateMemory( sizeof(PaWinDsStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &winDsHostApi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &winDsHostApi->blockingStreamInterface, streamCallback, userData ); + } + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + if( inputParameters ) + { + /* IMPLEMENT ME - establish which host formats are available */ + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, inputParameters->sampleFormat ); + } + + if( outputParameters ) + { + /* IMPLEMENT ME - establish which host formats are available */ + hostOutputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, outputParameters->sampleFormat ); + } + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerBuffer, /* ignored in paUtilVariableHostBufferSizePartialUsageAllowed mode. */ + /* This next mode is required because DS can split the host buffer when it wraps around. */ + paUtilVariableHostBufferSizePartialUsageAllowed, + streamCallback, userData ); + if( result != paNoError ) + goto error; + + + stream->streamRepresentation.streamInfo.inputLatency = + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor); /* FIXME: not initialised anywhere else */ + stream->streamRepresentation.streamInfo.outputLatency = + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor); /* FIXME: not initialised anywhere else */ + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + +/* DirectSound specific initialization */ + { + HRESULT hr; + int bytesPerDirectSoundBuffer; + DSoundWrapper *dsw; + int userLatencyFrames; + int minLatencyFrames; + + stream->timerID = 0; + dsw = &stream->directSoundWrapper; + DSW_Init( dsw ); + + /* Get system minimum latency. */ + minLatencyFrames = PaWinDs_GetMinLatencyFrames( sampleRate ); + + /* Let user override latency by passing latency parameter. */ + userLatencyFrames = (suggestedInputLatencyFrames > suggestedOutputLatencyFrames) + ? suggestedInputLatencyFrames + : suggestedOutputLatencyFrames; + if( userLatencyFrames > 0 ) minLatencyFrames = userLatencyFrames; + + /* Calculate stream->framesPerDSBuffer depending on framesPerBuffer */ + if( framesPerBuffer == paFramesPerBufferUnspecified ) + { + /* App support variable framesPerBuffer */ + stream->framesPerDSBuffer = minLatencyFrames; + + stream->streamRepresentation.streamInfo.outputLatency = (double)(minLatencyFrames - 1) / sampleRate; + } + else + { + /* Round up to number of buffers needed to guarantee that latency. */ + int numUserBuffers = (minLatencyFrames + framesPerBuffer - 1) / framesPerBuffer; + if( numUserBuffers < 1 ) numUserBuffers = 1; + numUserBuffers += 1; /* So we have latency worth of buffers ahead of current buffer. */ + stream->framesPerDSBuffer = framesPerBuffer * numUserBuffers; + + stream->streamRepresentation.streamInfo.outputLatency = (double)(framesPerBuffer * (numUserBuffers-1)) / sampleRate; + } + + { + /** @todo REVIEW: this calculation seems incorrect to me - rossb. */ + int msecLatency = (int) ((stream->framesPerDSBuffer * MSEC_PER_SECOND) / sampleRate); + PRINT(("PortAudio on DirectSound - Latency = %d frames, %d msec\n", stream->framesPerDSBuffer, msecLatency )); + } + + + /* ------------------ OUTPUT */ + if( outputParameters ) + { + /* + PaDeviceInfo *deviceInfo = hostApi->deviceInfos[ outputParameters->device ]; + DBUG(("PaHost_OpenStream: deviceID = 0x%x\n", outputParameters->device)); + */ + + bytesPerDirectSoundBuffer = stream->framesPerDSBuffer * outputParameters->channelCount * sizeof(short); + if( bytesPerDirectSoundBuffer < DSBSIZE_MIN ) + { + result = paBufferTooSmall; + goto error; + } + else if( bytesPerDirectSoundBuffer > DSBSIZE_MAX ) + { + result = paBufferTooBig; + goto error; + } + + + hr = dswDSoundEntryPoints.DirectSoundCreate( winDsHostApi->winDsDeviceInfos[outputParameters->device].lpGUID, + &dsw->dsw_pDirectSound, NULL ); + if( hr != DS_OK ) + { + ERR_RPT(("PortAudio: DirectSoundCreate() failed!\n")); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + hr = DSW_InitOutputBuffer( dsw, + (unsigned long) (sampleRate + 0.5), + (WORD)outputParameters->channelCount, bytesPerDirectSoundBuffer ); + DBUG(("DSW_InitOutputBuffer() returns %x\n", hr)); + if( hr != DS_OK ) + { + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + /* Calculate value used in latency calculation to avoid real-time divides. */ + stream->secondsPerHostByte = 1.0 / + (stream->bufferProcessor.bytesPerHostOutputSample * + outputChannelCount * sampleRate); + } + + /* ------------------ INPUT */ + if( inputParameters ) + { + /* + PaDeviceInfo *deviceInfo = hostApi->deviceInfos[ inputParameters->device ]; + DBUG(("PaHost_OpenStream: deviceID = 0x%x\n", inputParameters->device)); + */ + + bytesPerDirectSoundBuffer = stream->framesPerDSBuffer * inputParameters->channelCount * sizeof(short); + if( bytesPerDirectSoundBuffer < DSBSIZE_MIN ) + { + result = paBufferTooSmall; + goto error; + } + else if( bytesPerDirectSoundBuffer > DSBSIZE_MAX ) + { + result = paBufferTooBig; + goto error; + } + + hr = dswDSoundEntryPoints.DirectSoundCaptureCreate( winDsHostApi->winDsDeviceInfos[inputParameters->device].lpGUID, + &dsw->dsw_pDirectSoundCapture, NULL ); + if( hr != DS_OK ) + { + ERR_RPT(("PortAudio: DirectSoundCaptureCreate() failed!\n")); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + hr = DSW_InitInputBuffer( dsw, + (unsigned long) (sampleRate + 0.5), + (WORD)inputParameters->channelCount, bytesPerDirectSoundBuffer ); + DBUG(("DSW_InitInputBuffer() returns %x\n", hr)); + if( hr != DS_OK ) + { + ERR_RPT(("PortAudio: DSW_InitInputBuffer() returns %x\n", hr)); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + } + + } + + *s = (PaStream*)stream; + + return result; + +error: + if( stream ) + PaUtil_FreeMemory( stream ); + + return result; +} + + +/***********************************************************************************/ +static PaError Pa_TimeSlice( PaWinDsStream *stream ) +{ + PaError result = 0; /* FIXME: this should be declared int and this function should also return that type (same as stream callback return type)*/ + DSoundWrapper *dsw; + long numFrames = 0; + long bytesEmpty = 0; + long bytesFilled = 0; + long bytesToXfer = 0; + long framesToXfer = 0; + long numInFramesReady = 0; + long numOutFramesReady = 0; + long bytesProcessed; + HRESULT hresult; + double outputLatency = 0; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /** @todo implement inputBufferAdcTime */ + +/* Input */ + LPBYTE lpInBuf1 = NULL; + LPBYTE lpInBuf2 = NULL; + DWORD dwInSize1 = 0; + DWORD dwInSize2 = 0; +/* Output */ + LPBYTE lpOutBuf1 = NULL; + LPBYTE lpOutBuf2 = NULL; + DWORD dwOutSize1 = 0; + DWORD dwOutSize2 = 0; + + dsw = &stream->directSoundWrapper; + + /* How much input data is available? */ + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + DSW_QueryInputFilled( dsw, &bytesFilled ); + framesToXfer = numInFramesReady = bytesFilled / dsw->dsw_BytesPerInputFrame; + outputLatency = ((double)bytesFilled) * stream->secondsPerHostByte; + + /** @todo Check for overflow */ + } + + /* How much output room is available? */ + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + UINT previousUnderflowCount = dsw->dsw_OutputUnderflows; + DSW_QueryOutputSpace( dsw, &bytesEmpty ); + framesToXfer = numOutFramesReady = bytesEmpty / dsw->dsw_BytesPerOutputFrame; + + /* Check for underflow */ + if( dsw->dsw_OutputUnderflows != previousUnderflowCount ) + stream->callbackFlags |= paOutputUnderflow; + } + + if( (numInFramesReady > 0) && (numOutFramesReady > 0) ) + { + framesToXfer = (numOutFramesReady < numInFramesReady) ? numOutFramesReady : numInFramesReady; + } + + if( framesToXfer > 0 ) + { + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + /* The outputBufferDacTime parameter should indicates the time at which + the first sample of the output buffer is heard at the DACs. */ + timeInfo.currentTime = PaUtil_GetTime(); + timeInfo.outputBufferDacTime = timeInfo.currentTime + outputLatency; + + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, stream->callbackFlags ); + stream->callbackFlags = 0; + + /* Input */ + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + bytesToXfer = framesToXfer * dsw->dsw_BytesPerInputFrame; + hresult = IDirectSoundCaptureBuffer_Lock ( dsw->dsw_InputBuffer, + dsw->dsw_ReadOffset, bytesToXfer, + (void **) &lpInBuf1, &dwInSize1, + (void **) &lpInBuf2, &dwInSize2, 0); + if (hresult != DS_OK) + { + ERR_RPT(("DirectSound IDirectSoundCaptureBuffer_Lock failed, hresult = 0x%x\n",hresult)); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hresult ); + goto error2; + } + + numFrames = dwInSize1 / dsw->dsw_BytesPerInputFrame; + PaUtil_SetInputFrameCount( &stream->bufferProcessor, numFrames ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, lpInBuf1, 0 ); + /* Is input split into two regions. */ + if( dwInSize2 > 0 ) + { + numFrames = dwInSize2 / dsw->dsw_BytesPerInputFrame; + PaUtil_Set2ndInputFrameCount( &stream->bufferProcessor, numFrames ); + PaUtil_Set2ndInterleavedInputChannels( &stream->bufferProcessor, 0, lpInBuf2, 0 ); + } + } + + /* Output */ + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + bytesToXfer = framesToXfer * dsw->dsw_BytesPerOutputFrame; + hresult = IDirectSoundBuffer_Lock ( dsw->dsw_OutputBuffer, + dsw->dsw_WriteOffset, bytesToXfer, + (void **) &lpOutBuf1, &dwOutSize1, + (void **) &lpOutBuf2, &dwOutSize2, 0); + if (hresult != DS_OK) + { + ERR_RPT(("DirectSound IDirectSoundBuffer_Lock failed, hresult = 0x%x\n",hresult)); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hresult ); + goto error1; + } + + numFrames = dwOutSize1 / dsw->dsw_BytesPerOutputFrame; + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, numFrames ); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, lpOutBuf1, 0 ); + + /* Is output split into two regions. */ + if( dwOutSize2 > 0 ) + { + numFrames = dwOutSize2 / dsw->dsw_BytesPerOutputFrame; + PaUtil_Set2ndOutputFrameCount( &stream->bufferProcessor, numFrames ); + PaUtil_Set2ndInterleavedOutputChannels( &stream->bufferProcessor, 0, lpOutBuf2, 0 ); + } + } + + result = paContinue; + numFrames = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &result ); + stream->framesWritten += numFrames; + + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + /* FIXME: an underflow could happen here */ + + /* Update our buffer offset and unlock sound buffer */ + bytesProcessed = numFrames * dsw->dsw_BytesPerOutputFrame; + dsw->dsw_WriteOffset = (dsw->dsw_WriteOffset + bytesProcessed) % dsw->dsw_OutputSize; + IDirectSoundBuffer_Unlock( dsw->dsw_OutputBuffer, lpOutBuf1, dwOutSize1, lpOutBuf2, dwOutSize2); + dsw->dsw_FramesWritten += numFrames; + } + +error1: + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + /* FIXME: an overflow could happen here */ + + /* Update our buffer offset and unlock sound buffer */ + bytesProcessed = numFrames * dsw->dsw_BytesPerInputFrame; + dsw->dsw_ReadOffset = (dsw->dsw_ReadOffset + bytesProcessed) % dsw->dsw_InputSize; + IDirectSoundCaptureBuffer_Unlock( dsw->dsw_InputBuffer, lpInBuf1, dwInSize1, lpInBuf2, dwInSize2); + } +error2: + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, numFrames ); + + } + + return result; +} +/*******************************************************************/ +static void CALLBACK Pa_TimerCallback(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) +{ + PaWinDsStream *stream; + + /* suppress unused variable warnings */ + (void) uID; + (void) uMsg; + (void) dw1; + (void) dw2; + + stream = (PaWinDsStream *) dwUser; + if( stream == NULL ) return; + + if( stream->isActive ) + { + if( stream->abortProcessing ) + { + stream->isActive = 0; + } + else if( stream->stopProcessing ) + { + DSoundWrapper *dsw = &stream->directSoundWrapper; + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + DSW_ZeroEmptySpace( dsw ); + /* clear isActive when all sound played */ + if( dsw->dsw_FramesPlayed >= stream->framesWritten ) + { + stream->isActive = 0; + } + } + else + { + stream->isActive = 0; + } + } + else + { + if( Pa_TimeSlice( stream ) != 0) /* Call time slice independant of timing method. */ + { + /* FIXME implement handling of paComplete and paAbort if possible */ + stream->stopProcessing = 1; + } + } + + if( !stream->isActive ){ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + } +} + +/*********************************************************************************** + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaWinDsStream *stream = (PaWinDsStream*)s; + + DSW_Term( &stream->directSoundWrapper ); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); + + return result; +} + +/***********************************************************************************/ +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinDsStream *stream = (PaWinDsStream*)s; + HRESULT hr; + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + hr = DSW_StartInput( &stream->directSoundWrapper ); + DBUG(("StartStream: DSW_StartInput returned = 0x%X.\n", hr)); + if( hr != DS_OK ) + { + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + } + + stream->framesWritten = 0; + stream->callbackFlags = 0; + + stream->abortProcessing = 0; + stream->stopProcessing = 0; + stream->isActive = 1; + + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + /* Give user callback a chance to pre-fill buffer. REVIEW - i thought we weren't pre-filling, rb. */ + result = Pa_TimeSlice( stream ); + if( result != paNoError ) return result; // FIXME - what if finished? + + hr = DSW_StartOutput( &stream->directSoundWrapper ); + DBUG(("PaHost_StartOutput: DSW_StartOutput returned = 0x%X.\n", hr)); + if( hr != DS_OK ) + { + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + } + + + /* Create timer that will wake us up so we can fill the DSound buffer. */ + { + int resolution; + int framesPerWakeup = stream->framesPerDSBuffer / 4; + int msecPerWakeup = MSEC_PER_SECOND * framesPerWakeup / (int) stream->streamRepresentation.streamInfo.sampleRate; + if( msecPerWakeup < 10 ) msecPerWakeup = 10; + else if( msecPerWakeup > 100 ) msecPerWakeup = 100; + resolution = msecPerWakeup/4; + stream->timerID = timeSetEvent( msecPerWakeup, resolution, (LPTIMECALLBACK) Pa_TimerCallback, + (DWORD) stream, TIME_PERIODIC ); + } + if( stream->timerID == 0 ) + { + stream->isActive = 0; + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + + stream->isStarted = TRUE; + +error: + return result; +} + + +/***********************************************************************************/ +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinDsStream *stream = (PaWinDsStream*)s; + HRESULT hr; + int timeoutMsec; + + stream->stopProcessing = 1; + /* Set timeout at 20% beyond maximum time we might wait. */ + timeoutMsec = (int) (1200.0 * stream->framesPerDSBuffer / stream->streamRepresentation.streamInfo.sampleRate); + while( stream->isActive && (timeoutMsec > 0) ) + { + Sleep(10); + timeoutMsec -= 10; + } + if( stream->timerID != 0 ) + { + timeKillEvent(stream->timerID); /* Stop callback timer. */ + stream->timerID = 0; + } + + + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + hr = DSW_StopOutput( &stream->directSoundWrapper ); + } + + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + hr = DSW_StopInput( &stream->directSoundWrapper ); + } + + stream->isStarted = FALSE; + + return result; +} + + +/***********************************************************************************/ +static PaError AbortStream( PaStream *s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + stream->abortProcessing = 1; + return StopStream( s ); +} + + +/***********************************************************************************/ +static PaError IsStreamStopped( PaStream *s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + return !stream->isStarted; +} + + +/***********************************************************************************/ +static PaError IsStreamActive( PaStream *s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + return stream->isActive; +} + +/***********************************************************************************/ +static PaTime GetStreamTime( PaStream *s ) +{ + /* suppress unused variable warnings */ + (void) s; + + +/* + new behavior for GetStreamTime is to return a stream based seconds clock + used for the outTime parameter to the callback. + FIXME: delete this comment when the other unnecessary related code has + been cleaned from this file. + + PaWinDsStream *stream = (PaWinDsStream*)s; + DSoundWrapper *dsw; + dsw = &stream->directSoundWrapper; + return dsw->dsw_FramesPlayed; +*/ + return PaUtil_GetTime(); +} + + +/***********************************************************************************/ +static double GetStreamCpuLoad( PaStream* s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + + +/*********************************************************************************** + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +/***********************************************************************************/ +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +/***********************************************************************************/ +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + +/***********************************************************************************/ +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + + diff --git a/portaudio-v19/pa_win_wdmks/pa_win_wdmks.c b/portaudio-v19/pa_win_wdmks/pa_win_wdmks.c new file mode 100644 index 000000000..34d0ee6e6 --- /dev/null +++ b/portaudio-v19/pa_win_wdmks/pa_win_wdmks.c @@ -0,0 +1,3269 @@ +/* + * $Id$ + * PortAudio Windows WDM-KS interface + * + * Author: Andrew Baldwin + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2004 Andrew Baldwin, Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Portaudio WDM-KS host API. + + @note This is the implementation of the Portaudio host API using the + Windows WDM/Kernel Streaming API in order to enable very low latency + playback and recording on all modern Windows platforms (e.g. 2K, XP) + Note: This API accesses the device drivers below the usual KMIXER + component which is normally used to enable multi-client mixing and + format conversion. That means that it will lock out all other users + of a device for the duration of active stream using those devices +*/ + +#include + +/* Debugging/tracing support */ + +#define PA_LOGE_ +#define PA_LOGL_ + +#ifdef __GNUC__ + #include + #define _WIN32_WINNT 0x0501 + #define WINVER 0x0501 +#endif + +#include /* strlen() */ +#include + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" +#include "portaudio.h" + +#include +#include + + +#ifdef __GNUC__ + #undef PA_LOGE_ + #define PA_LOGE_ PA_DEBUG(("%s {\n",__FUNCTION__)) + #undef PA_LOGL_ + #define PA_LOGL_ PA_DEBUG(("} %s\n",__FUNCTION__)) + /* These defines are set in order to allow the WIndows DirectX + * headers to compile with a GCC compiler such as MinGW + * NOTE: The headers may generate a few warning in GCC, but + * they should compile */ + #define _INC_MMSYSTEM + #define _INC_MMREG + #define _NTRTL_ /* Turn off default definition of DEFINE_GUIDEX */ + #define DEFINE_GUID_THUNK(name,guid) DEFINE_GUID(name,guid) + #define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK( n, STATIC_##n ) + #if !defined( DEFINE_WAVEFORMATEX_GUID ) + #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 + #endif + #define WAVE_FORMAT_ADPCM 0x0002 + #define WAVE_FORMAT_IEEE_FLOAT 0x0003 + #define WAVE_FORMAT_ALAW 0x0006 + #define WAVE_FORMAT_MULAW 0x0007 + #define WAVE_FORMAT_MPEG 0x0050 + #define WAVE_FORMAT_DRM 0x0009 + #define DYNAMIC_GUID_THUNK(l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + #define DYNAMIC_GUID(data) DYNAMIC_GUID_THUNK(data) +#endif + +#ifdef _MSC_VER + #define DYNAMIC_GUID(data) {data} + #define _INC_MMREG + #define _NTRTL_ /* Turn off default definition of DEFINE_GUIDEX */ + #undef DEFINE_GUID + #define DEFINE_GUID(n,data) EXTERN_C const GUID n = {data} + #define DEFINE_GUID_THUNK(n,data) DEFINE_GUID(n,data) + #define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK(n, STATIC_##n) + #if !defined( DEFINE_WAVEFORMATEX_GUID ) + #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 + #endif + #define WAVE_FORMAT_ADPCM 0x0002 + #define WAVE_FORMAT_IEEE_FLOAT 0x0003 + #define WAVE_FORMAT_ALAW 0x0006 + #define WAVE_FORMAT_MULAW 0x0007 + #define WAVE_FORMAT_MPEG 0x0050 + #define WAVE_FORMAT_DRM 0x0009 +#endif + +#include +#include +#include +#include +#include + +/* These next definitions allow the use of the KSUSER DLL */ +typedef KSDDKAPI DWORD WINAPI KSCREATEPIN(HANDLE, PKSPIN_CONNECT, ACCESS_MASK, PHANDLE); +extern HMODULE DllKsUser; +extern KSCREATEPIN* FunctionKsCreatePin; + +/* Forward definition to break circular type reference between pin and filter */ +struct __PaWinWdmFilter; +typedef struct __PaWinWdmFilter PaWinWdmFilter; + +/* The Pin structure + * A pin is an input or output node, e.g. for audio flow */ +typedef struct __PaWinWdmPin +{ + HANDLE handle; + PaWinWdmFilter* parentFilter; + unsigned long pinId; + KSPIN_CONNECT* pinConnect; + unsigned long pinConnectSize; + KSDATAFORMAT_WAVEFORMATEX* ksDataFormatWfx; + KSPIN_COMMUNICATION communication; + KSDATARANGE* dataRanges; + KSMULTIPLE_ITEM* dataRangesItem; + KSPIN_DATAFLOW dataFlow; + KSPIN_CINSTANCES instances; + unsigned long frameSize; + int maxChannels; + unsigned long formats; + int bestSampleRate; +} +PaWinWdmPin; + +/* The Filter structure + * A filter has a number of pins and a "friendly name" */ +struct __PaWinWdmFilter +{ + HANDLE handle; + int pinCount; + PaWinWdmPin** pins; + TCHAR filterName[MAX_PATH]; + TCHAR friendlyName[MAX_PATH]; + int maxInputChannels; + int maxOutputChannels; + unsigned long formats; + int usageCount; + int bestSampleRate; +}; + +/* PaWinWdmHostApiRepresentation - host api datastructure specific to this implementation */ +typedef struct __PaWinWdmHostApiRepresentation +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup* allocations; + PaWinWdmFilter** filters; + int filterCount; +} +PaWinWdmHostApiRepresentation; + +typedef struct __PaWinWdmDeviceInfo +{ + PaDeviceInfo inheritedDeviceInfo; + PaWinWdmFilter* filter; +} +PaWinWdmDeviceInfo; + +typedef struct __DATAPACKET +{ + KSSTREAM_HEADER Header; + OVERLAPPED Signal; +} DATAPACKET; + +/* PaWinWdmStream - a stream data structure specifically for this implementation */ +typedef struct __PaWinWdmStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + PaWinWdmPin* recordingPin; + PaWinWdmPin* playbackPin; + char* hostBuffer; + unsigned long framesPerHostIBuffer; + unsigned long framesPerHostOBuffer; + int bytesPerInputFrame; + int bytesPerOutputFrame; + int streamStarted; + int streamActive; + int streamStop; + int streamAbort; + int oldProcessPriority; + HANDLE streamThread; + HANDLE events[5]; /* 2 play + 2 record packets + abort events */ + DATAPACKET packets[4]; /* 2 play + 2 record */ + PaStreamFlags streamFlags; + /* These values handle the case where the user wants to use fewer + * channels than the device has */ + int userInputChannels; + int deviceInputChannels; + int userOutputChannels; + int deviceOutputChannels; + int inputSampleSize; + int outputSampleSize; +} +PaWinWdmStream; + +#include + +HMODULE DllKsUser = NULL; +KSCREATEPIN* FunctionKsCreatePin = NULL; + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaWinWdm_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/* Low level I/O functions */ +static PaError WdmSyncIoctl(HANDLE handle, + unsigned long ioctlNumber, + void* inBuffer, + unsigned long inBufferCount, + void* outBuffer, + unsigned long outBufferCount, + unsigned long* bytesReturned); +static PaError WdmGetPropertySimple(HANDLE handle, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount, + void* instance, + unsigned long instanceCount); +static PaError WdmSetPropertySimple(HANDLE handle, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount, + void* instance, + unsigned long instanceCount); +static PaError WdmGetPinPropertySimple(HANDLE handle, + unsigned long pinId, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount); +static PaError WdmGetPinPropertyMulti(HANDLE handle, + unsigned long pinId, + const GUID* const guidPropertySet, + unsigned long property, + KSMULTIPLE_ITEM** ksMultipleItem); + +/** Pin management functions */ +static PaWinWdmPin* PinNew(PaWinWdmFilter* parentFilter, unsigned long pinId, PaError* error); +static void PinFree(PaWinWdmPin* pin); +static void PinClose(PaWinWdmPin* pin); +static PaError PinInstantiate(PaWinWdmPin* pin); +/*static PaError PinGetState(PaWinWdmPin* pin, KSSTATE* state); NOT USED */ +static PaError PinSetState(PaWinWdmPin* pin, KSSTATE state); +static PaError PinSetFormat(PaWinWdmPin* pin, const WAVEFORMATEX* format); +static PaError PinIsFormatSupported(PaWinWdmPin* pin, const WAVEFORMATEX* format); + +/* Filter management functions */ +static PaWinWdmFilter* FilterNew( + TCHAR* filterName, + TCHAR* friendlyName, + PaError* error); +static void FilterFree(PaWinWdmFilter* filter); +static PaWinWdmPin* FilterCreateRenderPin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error); +static PaWinWdmPin* FilterFindViableRenderPin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error); +static PaError FilterCanCreateRenderPin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex); +static PaWinWdmPin* FilterCreateCapturePin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error); +static PaWinWdmPin* FilterFindViableCapturePin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error); +static PaError FilterCanCreateCapturePin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* pwfx); +static PaError FilterUse( + PaWinWdmFilter* filter); +static void FilterRelease( + PaWinWdmFilter* filter); + +/* Interface functions */ +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( + struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( + struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( + PaStream* stream, + void *buffer, + unsigned long frames ); +static PaError WriteStream( + PaStream* stream, + const void *buffer, + unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + +/* Utility functions */ +static unsigned long GetWfexSize(const WAVEFORMATEX* wfex); +static PaError BuildFilterList(PaWinWdmHostApiRepresentation* wdmHostApi); +static BOOL PinWrite(HANDLE h, DATAPACKET* p); +static BOOL PinRead(HANDLE h, DATAPACKET* p); +static void DuplicateFirstChannelInt16(void* buffer, int channels, int samples); +static void DuplicateFirstChannelInt24(void* buffer, int channels, int samples); +static DWORD WINAPI ProcessingThread(LPVOID pParam); + +/* Function bodies */ + +static unsigned long GetWfexSize(const WAVEFORMATEX* wfex) +{ + if( wfex->wFormatTag == WAVE_FORMAT_PCM ) + { + return sizeof( WAVEFORMATEX ); + } + else + { + return (sizeof( WAVEFORMATEX ) + wfex->cbSize); + } +} + +/* +Low level pin/filter access functions +*/ +static PaError WdmSyncIoctl( + HANDLE handle, + unsigned long ioctlNumber, + void* inBuffer, + unsigned long inBufferCount, + void* outBuffer, + unsigned long outBufferCount, + unsigned long* bytesReturned) +{ + PaError result = paNoError; + OVERLAPPED overlapped; + int boolResult; + unsigned long dummyBytesReturned; + unsigned long error; + + if( !bytesReturned ) + { + /* User a dummy as the caller hasn't supplied one */ + bytesReturned = &dummyBytesReturned; + } + + FillMemory((void *)&overlapped,sizeof(overlapped),0); + overlapped.hEvent = CreateEvent(NULL,FALSE,FALSE,NULL); + if( !overlapped.hEvent ) + { + result = paInsufficientMemory; + goto error; + } + overlapped.hEvent = (HANDLE)((DWORD_PTR)overlapped.hEvent | 0x1); + + boolResult = DeviceIoControl(handle, ioctlNumber, inBuffer, inBufferCount, + outBuffer, outBufferCount, bytesReturned, &overlapped); + if( !boolResult ) + { + error = GetLastError(); + if( error == ERROR_IO_PENDING ) + { + error = WaitForSingleObject(overlapped.hEvent,INFINITE); + if( error != WAIT_OBJECT_0 ) + { + result = paUnanticipatedHostError; + goto error; + } + } + else if((( error == ERROR_INSUFFICIENT_BUFFER ) || + ( error == ERROR_MORE_DATA )) && + ( ioctlNumber == IOCTL_KS_PROPERTY ) && + ( outBufferCount == 0 )) + { + boolResult = TRUE; + } + else + { + result = paUnanticipatedHostError; + } + } + if( !boolResult ) + *bytesReturned = 0; + +error: + if( overlapped.hEvent ) + { + CloseHandle( overlapped.hEvent ); + } + return result; +} + +static PaError WdmGetPropertySimple(HANDLE handle, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount, + void* instance, + unsigned long instanceCount) +{ + PaError result; + KSPROPERTY* ksProperty; + unsigned long propertyCount; + + propertyCount = sizeof(KSPROPERTY) + instanceCount; + ksProperty = (KSPROPERTY*)PaUtil_AllocateMemory( propertyCount ); + if( !ksProperty ) + { + return paInsufficientMemory; + } + + FillMemory((void*)ksProperty,sizeof(ksProperty),0); + ksProperty->Set = *guidPropertySet; + ksProperty->Id = property; + ksProperty->Flags = KSPROPERTY_TYPE_GET; + + if( instance ) + { + memcpy( (void*)(((char*)ksProperty)+sizeof(KSPROPERTY)), instance, instanceCount ); + } + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + ksProperty, + propertyCount, + value, + valueCount, + NULL); + + PaUtil_FreeMemory( ksProperty ); + return result; +} + +static PaError WdmSetPropertySimple( + HANDLE handle, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount, + void* instance, + unsigned long instanceCount) +{ + PaError result; + KSPROPERTY* ksProperty; + unsigned long propertyCount = 0; + + propertyCount = sizeof(KSPROPERTY) + instanceCount; + ksProperty = (KSPROPERTY*)PaUtil_AllocateMemory( propertyCount ); + if( !ksProperty ) + { + return paInsufficientMemory; + } + + ksProperty->Set = *guidPropertySet; + ksProperty->Id = property; + ksProperty->Flags = KSPROPERTY_TYPE_SET; + + if( instance ) + { + memcpy((void*)((char*)ksProperty + sizeof(KSPROPERTY)), instance, instanceCount); + } + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + ksProperty, + propertyCount, + value, + valueCount, + NULL); + + PaUtil_FreeMemory( ksProperty ); + return result; +} + +static PaError WdmGetPinPropertySimple( + HANDLE handle, + unsigned long pinId, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount) +{ + PaError result; + + KSP_PIN ksPProp; + ksPProp.Property.Set = *guidPropertySet; + ksPProp.Property.Id = property; + ksPProp.Property.Flags = KSPROPERTY_TYPE_GET; + ksPProp.PinId = pinId; + ksPProp.Reserved = 0; + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + &ksPProp, + sizeof(KSP_PIN), + value, + valueCount, + NULL); + + return result; +} + +static PaError WdmGetPinPropertyMulti( + HANDLE handle, + unsigned long pinId, + const GUID* const guidPropertySet, + unsigned long property, + KSMULTIPLE_ITEM** ksMultipleItem) +{ + PaError result; + unsigned long multipleItemSize = 0; + KSP_PIN ksPProp; + + ksPProp.Property.Set = *guidPropertySet; + ksPProp.Property.Id = property; + ksPProp.Property.Flags = KSPROPERTY_TYPE_GET; + ksPProp.PinId = pinId; + ksPProp.Reserved = 0; + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + &ksPProp.Property, + sizeof(KSP_PIN), + NULL, + 0, + &multipleItemSize); + if( result != paNoError ) + { + return result; + } + + *ksMultipleItem = (KSMULTIPLE_ITEM*)PaUtil_AllocateMemory( multipleItemSize ); + if( !*ksMultipleItem ) + { + return paInsufficientMemory; + } + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + &ksPProp, + sizeof(KSP_PIN), + (void*)*ksMultipleItem, + multipleItemSize, + NULL); + + if( result != paNoError ) + { + PaUtil_FreeMemory( ksMultipleItem ); + } + + return result; +} + + +/* +Create a new pin object belonging to a filter +The pin object holds all the configuration information about the pin +before it is opened, and then the handle of the pin after is opened +*/ +static PaWinWdmPin* PinNew(PaWinWdmFilter* parentFilter, unsigned long pinId, PaError* error) +{ + PaWinWdmPin* pin; + PaError result; + unsigned long i; + KSMULTIPLE_ITEM* item = NULL; + KSIDENTIFIER* identifier; + KSDATARANGE* dataRange; + + PA_LOGE_; + PA_DEBUG(("Creating pin %d:\n",pinId)); + + /* Allocate the new PIN object */ + pin = (PaWinWdmPin*)PaUtil_AllocateMemory( sizeof(PaWinWdmPin) ); + if( !pin ) + { + result = paInsufficientMemory; + goto error; + } + + /* Zero the pin object */ + /* memset( (void*)pin, 0, sizeof(PaWinWdmPin) ); */ + + pin->parentFilter = parentFilter; + pin->pinId = pinId; + + /* Allocate a connect structure */ + pin->pinConnectSize = sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT_WAVEFORMATEX); + pin->pinConnect = (KSPIN_CONNECT*)PaUtil_AllocateMemory( pin->pinConnectSize ); + if( !pin->pinConnect ) + { + result = paInsufficientMemory; + goto error; + } + + /* Configure the connect structure with default values */ + pin->pinConnect->Interface.Set = KSINTERFACESETID_Standard; + pin->pinConnect->Interface.Id = KSINTERFACE_STANDARD_STREAMING; + pin->pinConnect->Interface.Flags = 0; + pin->pinConnect->Medium.Set = KSMEDIUMSETID_Standard; + pin->pinConnect->Medium.Id = KSMEDIUM_TYPE_ANYINSTANCE; + pin->pinConnect->Medium.Flags = 0; + pin->pinConnect->PinId = pinId; + pin->pinConnect->PinToHandle = NULL; + pin->pinConnect->Priority.PriorityClass = KSPRIORITY_NORMAL; + pin->pinConnect->Priority.PrioritySubClass = 1; + pin->ksDataFormatWfx = (KSDATAFORMAT_WAVEFORMATEX*)(pin->pinConnect + 1); + pin->ksDataFormatWfx->DataFormat.FormatSize = sizeof(KSDATAFORMAT_WAVEFORMATEX); + pin->ksDataFormatWfx->DataFormat.Flags = 0; + pin->ksDataFormatWfx->DataFormat.Reserved = 0; + pin->ksDataFormatWfx->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO; + pin->ksDataFormatWfx->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + pin->ksDataFormatWfx->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX; + + pin->frameSize = 0; /* Unknown until we instantiate pin */ + + /* Get the COMMUNICATION property */ + result = WdmGetPinPropertySimple( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_COMMUNICATION, + &pin->communication, + sizeof(KSPIN_COMMUNICATION)); + if( result != paNoError ) + goto error; + + if( /*(pin->communication != KSPIN_COMMUNICATION_SOURCE) &&*/ + (pin->communication != KSPIN_COMMUNICATION_SINK) && + (pin->communication != KSPIN_COMMUNICATION_BOTH) ) + { + PA_DEBUG(("Not source/sink\n")); + result = paInvalidDevice; + goto error; + } + + /* Get dataflow information */ + result = WdmGetPinPropertySimple( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_DATAFLOW, + &pin->dataFlow, + sizeof(KSPIN_DATAFLOW)); + + if( result != paNoError ) + goto error; + + /* Get the INTERFACE property list */ + result = WdmGetPinPropertyMulti( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_INTERFACES, + &item); + + if( result != paNoError ) + goto error; + + identifier = (KSIDENTIFIER*)(item+1); + + /* Check that at least one interface is STANDARD_STREAMING */ + result = paUnanticipatedHostError; + for( i = 0; i < item->Count; i++ ) + { + if( !memcmp( (void*)&identifier[i].Set, (void*)&KSINTERFACESETID_Standard, sizeof( GUID ) ) && + ( identifier[i].Id == KSINTERFACE_STANDARD_STREAMING ) ) + { + result = paNoError; + break; + } + } + + if( result != paNoError ) + { + PA_DEBUG(("No standard streaming\n")); + goto error; + } + + /* Don't need interfaces any more */ + PaUtil_FreeMemory( item ); + item = NULL; + + /* Get the MEDIUM properties list */ + result = WdmGetPinPropertyMulti( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_MEDIUMS, + &item); + + if( result != paNoError ) + goto error; + + identifier = (KSIDENTIFIER*)(item+1); /* Not actually necessary... */ + + /* Check that at least one medium is STANDARD_DEVIO */ + result = paUnanticipatedHostError; + for( i = 0; i < item->Count; i++ ) + { + if( !memcmp( (void*)&identifier[i].Set, (void*)&KSMEDIUMSETID_Standard, sizeof( GUID ) ) && + ( identifier[i].Id == KSMEDIUM_STANDARD_DEVIO ) ) + { + result = paNoError; + break; + } + } + + if( result != paNoError ) + { + PA_DEBUG(("No standard devio\n")); + goto error; + } + /* Don't need mediums any more */ + PaUtil_FreeMemory( item ); + item = NULL; + + /* Get DATARANGES */ + result = WdmGetPinPropertyMulti( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_DATARANGES, + &pin->dataRangesItem); + + if( result != paNoError ) + goto error; + + pin->dataRanges = (KSDATARANGE*)(pin->dataRangesItem +1); + + /* Check that at least one datarange supports audio */ + result = paUnanticipatedHostError; + dataRange = pin->dataRanges; + pin->maxChannels = 0; + pin->bestSampleRate = 0; + pin->formats = 0; + for( i = 0; i dataRangesItem->Count; i++) + { + PA_DEBUG(("DR major format %x\n",*(unsigned long*)(&(dataRange->MajorFormat)))); + /* Check that subformat is WAVEFORMATEX, PCM or WILDCARD */ + if( IS_VALID_WAVEFORMATEX_GUID(&dataRange->SubFormat) || + !memcmp((void*)&dataRange->SubFormat, (void*)&KSDATAFORMAT_SUBTYPE_PCM, sizeof ( GUID ) ) || + ( !memcmp((void*)&dataRange->SubFormat, (void*)&KSDATAFORMAT_SUBTYPE_WILDCARD, sizeof ( GUID ) ) && + ( !memcmp((void*)&dataRange->MajorFormat, (void*)&KSDATAFORMAT_TYPE_AUDIO, sizeof ( GUID ) ) ) ) ) + { + result = paNoError; + /* Record the maximum possible channels with this pin */ + PA_DEBUG(("MaxChannel: %d\n",pin->maxChannels)); + if( (int)((KSDATARANGE_AUDIO*)dataRange)->MaximumChannels > pin->maxChannels ) + { + pin->maxChannels = ((KSDATARANGE_AUDIO*)dataRange)->MaximumChannels; + /*PA_DEBUG(("MaxChannel: %d\n",pin->maxChannels));*/ + } + /* Record the formats (bit depths) that are supported */ + if( ((KSDATARANGE_AUDIO*)dataRange)->MinimumBitsPerSample <= 16 ) + { + pin->formats |= paInt16; + PA_DEBUG(("Format 16 bit supported\n")); + } + if( ((KSDATARANGE_AUDIO*)dataRange)->MaximumBitsPerSample >= 24 ) + { + pin->formats |= paInt24; + PA_DEBUG(("Format 24 bit supported\n")); + } + if( ( pin->bestSampleRate != 48000) && + (((KSDATARANGE_AUDIO*)dataRange)->MaximumSampleFrequency >= 48000) && + (((KSDATARANGE_AUDIO*)dataRange)->MinimumSampleFrequency <= 48000) ) + { + pin->bestSampleRate = 48000; + PA_DEBUG(("48kHz supported\n")); + } + else if(( pin->bestSampleRate != 48000) && ( pin->bestSampleRate != 44100 ) && + (((KSDATARANGE_AUDIO*)dataRange)->MaximumSampleFrequency >= 44100) && + (((KSDATARANGE_AUDIO*)dataRange)->MinimumSampleFrequency <= 44100) ) + { + pin->bestSampleRate = 44100; + PA_DEBUG(("44.1kHz supported\n")); + } + else + { + pin->bestSampleRate = ((KSDATARANGE_AUDIO*)dataRange)->MaximumSampleFrequency; + } + } + dataRange = (KSDATARANGE*)( ((char*)dataRange) + dataRange->FormatSize); + } + + if( result != paNoError ) + goto error; + + /* Get instance information */ + result = WdmGetPinPropertySimple( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_CINSTANCES, + &pin->instances, + sizeof(KSPIN_CINSTANCES)); + + if( result != paNoError ) + goto error; + + /* Success */ + *error = paNoError; + PA_DEBUG(("Pin created successfully\n")); + PA_LOGL_; + return pin; + +error: + /* + Error cleanup + */ + PaUtil_FreeMemory( item ); + if( pin ) + { + PaUtil_FreeMemory( pin->pinConnect ); + PaUtil_FreeMemory( pin->dataRangesItem ); + PaUtil_FreeMemory( pin ); + } + *error = result; + PA_LOGL_; + return NULL; +} + +/* +Safely free all resources associated with the pin +*/ +static void PinFree(PaWinWdmPin* pin) +{ + PA_LOGE_; + if( pin ) + { + PinClose(pin); + if( pin->pinConnect ) + { + PaUtil_FreeMemory( pin->pinConnect ); + } + if( pin->dataRangesItem ) + { + PaUtil_FreeMemory( pin->dataRangesItem ); + } + PaUtil_FreeMemory( pin ); + } + PA_LOGL_; +} + +/* +If the pin handle is open, close it +*/ +static void PinClose(PaWinWdmPin* pin) +{ + PA_LOGE_; + if( pin == NULL ) + { + PA_DEBUG(("Closing NULL pin!")); + PA_LOGL_; + return; + } + if( pin->handle != NULL ) + { + PinSetState( pin, KSSTATE_PAUSE ); + PinSetState( pin, KSSTATE_STOP ); + CloseHandle( pin->handle ); + pin->handle = NULL; + FilterRelease(pin->parentFilter); + } + PA_LOGL_; +} + +/* +Set the state of this (instantiated) pin +*/ +static PaError PinSetState(PaWinWdmPin* pin, KSSTATE state) +{ + PaError result; + + PA_LOGE_; + if( pin == NULL ) + return paInternalError; + if( pin->handle == NULL ) + return paInternalError; + + result = WdmSetPropertySimple( + pin->handle, + &KSPROPSETID_Connection, + KSPROPERTY_CONNECTION_STATE, + &state, + sizeof(state), + NULL, + 0); + PA_LOGL_; + return result; +} + +static PaError PinInstantiate(PaWinWdmPin* pin) +{ + PaError result; + unsigned long createResult; + KSALLOCATOR_FRAMING ksaf; + KSALLOCATOR_FRAMING_EX ksafex; + + PA_LOGE_; + + if( pin == NULL ) + return paInternalError; + if(!pin->pinConnect) + return paInternalError; + + FilterUse(pin->parentFilter); + + createResult = FunctionKsCreatePin( + pin->parentFilter->handle, + pin->pinConnect, + GENERIC_WRITE | GENERIC_READ, + &pin->handle + ); + + PA_DEBUG(("Pin create result = %x\n",createResult)); + if( createResult != ERROR_SUCCESS ) + { + FilterRelease(pin->parentFilter); + pin->handle = NULL; + return paInvalidDevice; + } + + result = WdmGetPropertySimple( + pin->handle, + &KSPROPSETID_Connection, + KSPROPERTY_CONNECTION_ALLOCATORFRAMING, + &ksaf, + sizeof(ksaf), + NULL, + 0); + + if( result != paNoError ) + { + result = WdmGetPropertySimple( + pin->handle, + &KSPROPSETID_Connection, + KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX, + &ksafex, + sizeof(ksafex), + NULL, + 0); + if( result == paNoError ) + { + pin->frameSize = ksafex.FramingItem[0].FramingRange.Range.MinFrameSize; + } + } + else + { + pin->frameSize = ksaf.FrameSize; + } + + PA_LOGL_; + + return paNoError; +} + +/* NOT USED +static PaError PinGetState(PaWinWdmPin* pin, KSSTATE* state) +{ + PaError result; + + if( state == NULL ) + return paInternalError; + if( pin == NULL ) + return paInternalError; + if( pin->handle == NULL ) + return paInternalError; + + result = WdmGetPropertySimple( + pin->handle, + KSPROPSETID_Connection, + KSPROPERTY_CONNECTION_STATE, + state, + sizeof(KSSTATE), + NULL, + 0); + + return result; +} +*/ +static PaError PinSetFormat(PaWinWdmPin* pin, const WAVEFORMATEX* format) +{ + unsigned long size; + void* newConnect; + + PA_LOGE_; + + if( pin == NULL ) + return paInternalError; + if( format == NULL ) + return paInternalError; + + size = GetWfexSize(format) + sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT_WAVEFORMATEX) - sizeof(WAVEFORMATEX); + + if( pin->pinConnectSize != size ) + { + newConnect = PaUtil_AllocateMemory( size ); + if( newConnect == NULL ) + return paInsufficientMemory; + memcpy( newConnect, (void*)pin->pinConnect, min(pin->pinConnectSize,size) ); + PaUtil_FreeMemory( pin->pinConnect ); + pin->pinConnect = (KSPIN_CONNECT*)newConnect; + pin->pinConnectSize = size; + pin->ksDataFormatWfx = (KSDATAFORMAT_WAVEFORMATEX*)((KSPIN_CONNECT*)newConnect + 1); + pin->ksDataFormatWfx->DataFormat.FormatSize = size - sizeof(KSPIN_CONNECT); + } + + memcpy( (void*)&(pin->ksDataFormatWfx->WaveFormatEx), format, GetWfexSize(format) ); + pin->ksDataFormatWfx->DataFormat.SampleSize = (unsigned short)(format->nChannels * (format->wBitsPerSample / 8)); + + PA_LOGL_; + + return paNoError; +} + +static PaError PinIsFormatSupported(PaWinWdmPin* pin, const WAVEFORMATEX* format) +{ + KSDATARANGE_AUDIO* dataRange; + unsigned long count; + GUID guid = DYNAMIC_GUID( DEFINE_WAVEFORMATEX_GUID(format->wFormatTag) ); + PaError result = paInvalidDevice; + + PA_LOGE_; + + if( format->wFormatTag == WAVE_FORMAT_EXTENSIBLE ) + { + guid = ((WAVEFORMATEXTENSIBLE*)format)->SubFormat; + } + dataRange = (KSDATARANGE_AUDIO*)pin->dataRanges; + for(count = 0; countdataRangesItem->Count; count++) + { + if(( !memcmp(&(dataRange->DataRange.MajorFormat),&KSDATAFORMAT_TYPE_AUDIO,sizeof(GUID)) ) || + ( !memcmp(&(dataRange->DataRange.MajorFormat),&KSDATAFORMAT_TYPE_WILDCARD,sizeof(GUID)) )) + { + /* This is an audio or wildcard datarange... */ + if(( !memcmp(&(dataRange->DataRange.SubFormat),&KSDATAFORMAT_SUBTYPE_WILDCARD,sizeof(GUID)) ) || + ( !memcmp(&(dataRange->DataRange.SubFormat),&guid,sizeof(GUID)) )) + { + if(( !memcmp(&(dataRange->DataRange.Specifier),&KSDATAFORMAT_SPECIFIER_WILDCARD,sizeof(GUID)) ) || + ( !memcmp(&(dataRange->DataRange.Specifier),&KSDATAFORMAT_SPECIFIER_WAVEFORMATEX,sizeof(GUID) ))) + { + + PA_DEBUG(("Pin:%x, DataRange:%d\n",(void*)pin,count)); + PA_DEBUG(("\tFormatSize:%d, SampleSize:%d\n",dataRange->DataRange.FormatSize,dataRange->DataRange.SampleSize)); + PA_DEBUG(("\tMaxChannels:%d\n",dataRange->MaximumChannels)); + PA_DEBUG(("\tBits:%d-%d\n",dataRange->MinimumBitsPerSample,dataRange->MaximumBitsPerSample)); + PA_DEBUG(("\tSampleRate:%d-%d\n",dataRange->MinimumSampleFrequency,dataRange->MaximumSampleFrequency)); + + if( dataRange->MaximumChannels < format->nChannels ) + { + result = paInvalidChannelCount; + continue; + } + if( dataRange->MinimumBitsPerSample > format->wBitsPerSample ) + { + result = paSampleFormatNotSupported; + continue; + } + if( dataRange->MaximumBitsPerSample < format->wBitsPerSample ) + { + result = paSampleFormatNotSupported; + continue; + } + if( dataRange->MinimumSampleFrequency > format->nSamplesPerSec ) + { + result = paInvalidSampleRate; + continue; + } + if( dataRange->MaximumSampleFrequency < format->nSamplesPerSec ) + { + result = paInvalidSampleRate; + continue; + } + /* Success! */ + PA_LOGL_; + return paNoError; + } + } + } + dataRange = (KSDATARANGE_AUDIO*)( ((char*)dataRange) + dataRange->DataRange.FormatSize); + } + + PA_LOGL_; + + return result; +} + +/** + * Create a new filter object + */ +static PaWinWdmFilter* FilterNew(TCHAR* filterName, TCHAR* friendlyName, PaError* error) +{ + PaWinWdmFilter* filter; + PaError result; + int pinId; + int valid; + + + /* Allocate the new filter object */ + filter = (PaWinWdmFilter*)PaUtil_AllocateMemory( sizeof(PaWinWdmFilter) ); + if( !filter ) + { + result = paInsufficientMemory; + goto error; + } + + /* Zero the filter object - done by AllocateMemory */ + /* memset( (void*)filter, 0, sizeof(PaWinWdmFilter) ); */ + + /* Copy the filter name */ + _tcsncpy(filter->filterName, filterName, MAX_PATH); + + /* Copy the friendly name */ + _tcsncpy(filter->friendlyName, friendlyName, MAX_PATH); + + /* Open the filter handle */ + result = FilterUse(filter); + if( result != paNoError ) + { + goto error; + } + + /* Get pin count */ + result = WdmGetPinPropertySimple + ( + filter->handle, + 0, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_CTYPES, + &filter->pinCount, + sizeof(filter->pinCount) + ); + + if( result != paNoError) + { + goto error; + } + + /* Allocate pointer array to hold the pins */ + filter->pins = (PaWinWdmPin**)PaUtil_AllocateMemory( sizeof(PaWinWdmPin*) * filter->pinCount ); + if( !filter->pins ) + { + result = paInsufficientMemory; + goto error; + } + + /* Create all the pins we can */ + filter->maxInputChannels = 0; + filter->maxOutputChannels = 0; + filter->bestSampleRate = 0; + + valid = 0; + for(pinId = 0; pinId < filter->pinCount; pinId++) + { + /* Create the pin with this Id */ + PaWinWdmPin* newPin; + newPin = PinNew(filter, pinId, &result); + if( result == paInsufficientMemory ) + goto error; + if( newPin != NULL ) + { + filter->pins[pinId] = newPin; + valid = 1; + + /* Get the max output channel count */ + if(( newPin->dataFlow == KSPIN_DATAFLOW_IN ) && + (( newPin->communication == KSPIN_COMMUNICATION_SINK) || + ( newPin->communication == KSPIN_COMMUNICATION_BOTH))) + { + if(newPin->maxChannels > filter->maxOutputChannels) + filter->maxOutputChannels = newPin->maxChannels; + filter->formats |= newPin->formats; + } + /* Get the max input channel count */ + if(( newPin->dataFlow == KSPIN_DATAFLOW_OUT ) && + (( newPin->communication == KSPIN_COMMUNICATION_SINK) || + ( newPin->communication == KSPIN_COMMUNICATION_BOTH))) + { + if(newPin->maxChannels > filter->maxInputChannels) + filter->maxInputChannels = newPin->maxChannels; + filter->formats |= newPin->formats; + } + + if(newPin->bestSampleRate > filter->bestSampleRate) + { + filter->bestSampleRate = newPin->bestSampleRate; + } + } + } + + if(( filter->maxInputChannels == 0) && ( filter->maxOutputChannels == 0)) + { + /* No input or output... not valid */ + valid = 0; + } + + if( !valid ) + { + /* No valid pin was found on this filter so we destroy it */ + result = paDeviceUnavailable; + goto error; + } + + /* Close the filter handle for now + * It will be opened later when needed */ + FilterRelease(filter); + + *error = paNoError; + return filter; + +error: + /* + Error cleanup + */ + if( filter ) + { + for( pinId = 0; pinId < filter->pinCount; pinId++ ) + PinFree(filter->pins[pinId]); + PaUtil_FreeMemory( filter->pins ); + if( filter->handle ) + CloseHandle( filter->handle ); + PaUtil_FreeMemory( filter ); + } + *error = result; + return NULL; +} + +/** + * Free a previously created filter + */ +static void FilterFree(PaWinWdmFilter* filter) +{ + int pinId; + PA_LOGL_; + if( filter ) + { + for( pinId = 0; pinId < filter->pinCount; pinId++ ) + PinFree(filter->pins[pinId]); + PaUtil_FreeMemory( filter->pins ); + if( filter->handle ) + CloseHandle( filter->handle ); + PaUtil_FreeMemory( filter ); + } + PA_LOGE_; +} + +/** + * Reopen the filter handle if necessary so it can be used + **/ +static PaError FilterUse(PaWinWdmFilter* filter) +{ + assert( filter ); + + PA_LOGE_; + if( filter->handle == NULL ) + { + /* Open the filter */ + filter->handle = CreateFile( + filter->filterName, + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + NULL); + + if( filter->handle == NULL ) + { + return paDeviceUnavailable; + } + } + filter->usageCount++; + PA_LOGL_; + return paNoError; +} + +/** + * Release the filter handle if nobody is using it + **/ +static void FilterRelease(PaWinWdmFilter* filter) +{ + assert( filter ); + assert( filter->usageCount > 0 ); + + PA_LOGE_; + filter->usageCount--; + if( filter->usageCount == 0 ) + { + if( filter->handle != NULL ) + { + CloseHandle( filter->handle ); + filter->handle = NULL; + } + } + PA_LOGL_; +} + +/** + * Create a render (playback) Pin using the supplied format + **/ +static PaWinWdmPin* FilterCreateRenderPin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error) +{ + PaError result; + PaWinWdmPin* pin; + + assert( filter ); + + pin = FilterFindViableRenderPin(filter,wfex,&result); + if(!pin) + { + goto error; + } + result = PinSetFormat(pin,wfex); + if( result != paNoError ) + { + goto error; + } + result = PinInstantiate(pin); + if( result != paNoError ) + { + goto error; + } + + *error = paNoError; + return pin; + +error: + *error = result; + return NULL; +} + +/** + * Find a pin that supports the given format + **/ +static PaWinWdmPin* FilterFindViableRenderPin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error) +{ + int pinId; + PaWinWdmPin* pin; + PaError result = paDeviceUnavailable; + *error = paNoError; + + assert( filter ); + + for( pinId = 0; pinIdpinCount; pinId++ ) + { + pin = filter->pins[pinId]; + if( pin != NULL ) + { + if(( pin->dataFlow == KSPIN_DATAFLOW_IN ) && + (( pin->communication == KSPIN_COMMUNICATION_SINK) || + ( pin->communication == KSPIN_COMMUNICATION_BOTH))) + { + result = PinIsFormatSupported( pin, wfex ); + if( result == paNoError ) + { + return pin; + } + } + } + } + + *error = result; + return NULL; +} + +/** + * Check if there is a pin that should playback + * with the supplied format + **/ +static PaError FilterCanCreateRenderPin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex) +{ + PaWinWdmPin* pin; + PaError result; + + assert ( filter ); + + pin = FilterFindViableRenderPin(filter,wfex,&result); + /* result will be paNoError if pin found + * or else an error code indicating what is wrong with the format + **/ + return result; +} + +/** + * Create a capture (record) Pin using the supplied format + **/ +static PaWinWdmPin* FilterCreateCapturePin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error) +{ + PaError result; + PaWinWdmPin* pin; + + assert( filter ); + + pin = FilterFindViableCapturePin(filter,wfex,&result); + if(!pin) + { + goto error; + } + + result = PinSetFormat(pin,wfex); + if( result != paNoError ) + { + goto error; + } + + result = PinInstantiate(pin); + if( result != paNoError ) + { + goto error; + } + + *error = paNoError; + return pin; + +error: + *error = result; + return NULL; +} + +/** + * Find a capture pin that supports the given format + **/ +static PaWinWdmPin* FilterFindViableCapturePin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error) +{ + int pinId; + PaWinWdmPin* pin; + PaError result = paDeviceUnavailable; + *error = paNoError; + + assert( filter ); + + for( pinId = 0; pinIdpinCount; pinId++ ) + { + pin = filter->pins[pinId]; + if( pin != NULL ) + { + if(( pin->dataFlow == KSPIN_DATAFLOW_OUT ) && + (( pin->communication == KSPIN_COMMUNICATION_SINK) || + ( pin->communication == KSPIN_COMMUNICATION_BOTH))) + { + result = PinIsFormatSupported( pin, wfex ); + if( result == paNoError ) + { + return pin; + } + } + } + } + + *error = result; + return NULL; +} + +/** + * Check if there is a pin that should playback + * with the supplied format + **/ +static PaError FilterCanCreateCapturePin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex) +{ + PaWinWdmPin* pin; + PaError result; + + assert ( filter ); + + pin = FilterFindViableCapturePin(filter,wfex,&result); + /* result will be paNoError if pin found + * or else an error code indicating what is wrong with the format + **/ + return result; +} + +/** + * Build the list of available filters + */ +static PaError BuildFilterList(PaWinWdmHostApiRepresentation* wdmHostApi) +{ + PaError result = paNoError; + HDEVINFO handle = NULL; + int device; + int invalidDevices; + int slot; + SP_DEVICE_INTERFACE_DATA interfaceData; + SP_DEVICE_INTERFACE_DATA aliasData; + SP_DEVINFO_DATA devInfoData; + int noError; + const int sizeInterface = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + (MAX_PATH * sizeof(WCHAR)); + unsigned char interfaceDetailsArray[sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + (MAX_PATH * sizeof(WCHAR))]; + SP_DEVICE_INTERFACE_DETAIL_DATA* devInterfaceDetails = (SP_DEVICE_INTERFACE_DETAIL_DATA*)interfaceDetailsArray; + TCHAR friendlyName[MAX_PATH]; + HKEY hkey; + DWORD sizeFriendlyName; + DWORD type; + PaWinWdmFilter* newFilter; + GUID* category = (GUID*)&KSCATEGORY_AUDIO; + GUID* alias_render = (GUID*)&KSCATEGORY_RENDER; + GUID* alias_capture = (GUID*)&KSCATEGORY_CAPTURE; + DWORD hasAlias; + + PA_LOGE_; + + devInterfaceDetails->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); + + /* Open a handle to search for devices (filters) */ + handle = SetupDiGetClassDevs(category,NULL,NULL,DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); + if( handle == NULL ) + { + return paUnanticipatedHostError; + } + PA_DEBUG(("Setup called\n")); + + /* First let's count the number of devices so we can allocate a list */ + invalidDevices = 0; + for( device = 0;;device++ ) + { + interfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + interfaceData.Reserved = 0; + aliasData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + aliasData.Reserved = 0; + noError = SetupDiEnumDeviceInterfaces(handle,NULL,category,device,&interfaceData); + PA_DEBUG(("Enum called\n")); + if( !noError ) + break; /* No more devices */ + + /* Check this one has the render or capture alias */ + hasAlias = 0; + noError = SetupDiGetDeviceInterfaceAlias(handle,&interfaceData,alias_render,&aliasData); + PA_DEBUG(("noError = %d\n",noError)); + if(noError) + { + if(aliasData.Flags && (!(aliasData.Flags & SPINT_REMOVED))) + { + PA_DEBUG(("Device %d has render alias\n",device)); + hasAlias |= 1; /* Has render alias */ + } + else + { + PA_DEBUG(("Device %d has no render alias\n",device)); + } + } + noError = SetupDiGetDeviceInterfaceAlias(handle,&interfaceData,alias_capture,&aliasData); + if(noError) + { + if(aliasData.Flags && (!(aliasData.Flags & SPINT_REMOVED))) + { + PA_DEBUG(("Device %d has capture alias\n",device)); + hasAlias |= 2; /* Has capture alias */ + } + else + { + PA_DEBUG(("Device %d has no capture alias\n",device)); + } + } + if(!hasAlias) + invalidDevices++; /* This was not a valid capture or render audio device */ + + } + /* Remember how many there are */ + wdmHostApi->filterCount = device-invalidDevices; + + PA_DEBUG(("Interfaces found: %d\n",device-invalidDevices)); + + /* Now allocate the list of pointers to devices */ + wdmHostApi->filters = (PaWinWdmFilter**)PaUtil_AllocateMemory( sizeof(PaWinWdmFilter*) * device ); + if( !wdmHostApi->filters ) + { + if(handle != NULL) + SetupDiDestroyDeviceInfoList(handle); + return paInsufficientMemory; + } + + /* Now create filter objects for each interface found */ + slot = 0; + for( device = 0;;device++ ) + { + interfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + interfaceData.Reserved = 0; + aliasData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + aliasData.Reserved = 0; + devInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + devInfoData.Reserved = 0; + + noError = SetupDiEnumDeviceInterfaces(handle,NULL,category,device,&interfaceData); + if( !noError ) + break; /* No more devices */ + + /* Check this one has the render or capture alias */ + hasAlias = 0; + noError = SetupDiGetDeviceInterfaceAlias(handle,&interfaceData,alias_render,&aliasData); + if(noError) + { + if(aliasData.Flags && (!(aliasData.Flags & SPINT_REMOVED))) + { + PA_DEBUG(("Device %d has render alias\n",device)); + hasAlias |= 1; /* Has render alias */ + } + } + noError = SetupDiGetDeviceInterfaceAlias(handle,&interfaceData,alias_capture,&aliasData); + if(noError) + { + if(aliasData.Flags && (!(aliasData.Flags & SPINT_REMOVED))) + { + PA_DEBUG(("Device %d has capture alias\n",device)); + hasAlias |= 2; /* Has capture alias */ + } + } + if(!hasAlias) + continue; /* This was not a valid capture or render audio device */ + + noError = SetupDiGetDeviceInterfaceDetail(handle,&interfaceData,devInterfaceDetails,sizeInterface,NULL,&devInfoData); + if( noError ) + { + /* Try to get the "friendly name" for this interface */ + sizeFriendlyName = sizeof(friendlyName); + /* Fix contributed by Ben Allison + * Removed KEY_SET_VALUE from flags on following call + * as its causes failure when running without admin rights + * and it was not required */ + hkey=SetupDiOpenDeviceInterfaceRegKey(handle,&interfaceData,0,KEY_QUERY_VALUE); + if(hkey!=INVALID_HANDLE_VALUE) + { + noError = RegQueryValueEx(hkey,TEXT("FriendlyName"),0,&type,(BYTE*)friendlyName,&sizeFriendlyName); + if( noError == ERROR_SUCCESS ) + { + PA_DEBUG(("Interface %d, Name: %s\n",device,friendlyName)); + RegCloseKey(hkey); + } + else + { + friendlyName[0] = 0; + } + } + newFilter = FilterNew(devInterfaceDetails->DevicePath,friendlyName,&result); + if( result == paNoError ) + { + PA_DEBUG(("Filter created\n")); + wdmHostApi->filters[slot] = newFilter; + slot++; + } + else + { + PA_DEBUG(("Filter NOT created\n")); + /* As there are now less filters than we initially thought + * we must reduce the count by one */ + wdmHostApi->filterCount--; + } + } + } + + /* Clean up */ + if(handle != NULL) + SetupDiDestroyDeviceInfoList(handle); + + return paNoError; +} + +PaError PaWinWdm_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i, deviceCount; + PaWinWdmHostApiRepresentation *wdmHostApi; + PaWinWdmDeviceInfo *deviceInfoArray; + PaWinWdmFilter* pFilter; + PaWinWdmDeviceInfo *wdmDeviceInfo; + PaDeviceInfo *deviceInfo; + + PA_LOGE_; + + /* + Attempt to load the KSUSER.DLL without which we cannot create pins + We will unload this on termination + */ + if(DllKsUser == NULL) + { + DllKsUser = LoadLibrary(TEXT("ksuser.dll")); + if(DllKsUser == NULL) + goto error; + } + + FunctionKsCreatePin = (KSCREATEPIN*)GetProcAddress(DllKsUser, "KsCreatePin"); + if(FunctionKsCreatePin == NULL) + goto error; + + wdmHostApi = (PaWinWdmHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinWdmHostApiRepresentation) ); + if( !wdmHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + wdmHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !wdmHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + result = BuildFilterList( wdmHostApi ); + if( result != paNoError ) + { + goto error; + } + deviceCount = wdmHostApi->filterCount; + + *hostApi = &wdmHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paWDMKS; + (*hostApi)->info.name = "Windows WDM-KS"; + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + + if( deviceCount > 0 ) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + wdmHostApi->allocations, sizeof(PaWinWdmDeviceInfo*) * deviceCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaWinWdmDeviceInfo*)PaUtil_GroupAllocateMemory( + wdmHostApi->allocations, sizeof(PaWinWdmDeviceInfo) * deviceCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < deviceCount; ++i ) + { + wdmDeviceInfo = &deviceInfoArray[i]; + deviceInfo = &wdmDeviceInfo->inheritedDeviceInfo; + pFilter = wdmHostApi->filters[i]; + if( pFilter == NULL ) + continue; + wdmDeviceInfo->filter = pFilter; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + deviceInfo->name = (char*)pFilter->friendlyName; + PA_DEBUG(("Device found name: %s\n",(char*)pFilter->friendlyName)); + deviceInfo->maxInputChannels = pFilter->maxInputChannels; + if(deviceInfo->maxInputChannels > 0) + { + /* Set the default input device to the first device we find with + * more than zero input channels + **/ + if((*hostApi)->info.defaultInputDevice == paNoDevice) + { + (*hostApi)->info.defaultInputDevice = i; + } + } + + deviceInfo->maxOutputChannels = pFilter->maxOutputChannels; + if(deviceInfo->maxOutputChannels > 0) + { + /* Set the default output device to the first device we find with + * more than zero output channels + **/ + if((*hostApi)->info.defaultOutputDevice == paNoDevice) + { + (*hostApi)->info.defaultOutputDevice = i; + } + } + + /* These low values are not very useful because + * a) The lowest latency we end up with can depend on many factors such + * as the device buffer sizes/granularities, sample rate, channels and format + * b) We cannot know the device buffer sizes until we try to open/use it at + * a particular setting + * So: we give 512x48000Hz frames as the default low input latency + **/ + deviceInfo->defaultLowInputLatency = (512.0/48000.0); + deviceInfo->defaultLowOutputLatency = (512.0/48000.0); + deviceInfo->defaultHighInputLatency = (4096.0/48000.0); + deviceInfo->defaultHighOutputLatency = (4096.0/48000.0); + deviceInfo->defaultSampleRate = (double)(pFilter->bestSampleRate); + + (*hostApi)->deviceInfos[i] = deviceInfo; + } + } + + (*hostApi)->info.deviceCount = deviceCount; + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &wdmHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &wdmHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + PA_LOGL_; + return result; + +error: + if( DllKsUser != NULL ) + { + FreeLibrary( DllKsUser ); + DllKsUser = NULL; + } + + if( wdmHostApi ) + { + PaUtil_FreeMemory( wdmHostApi->filters ); + if( wdmHostApi->allocations ) + { + PaUtil_FreeAllAllocations( wdmHostApi->allocations ); + PaUtil_DestroyAllocationGroup( wdmHostApi->allocations ); + } + PaUtil_FreeMemory( wdmHostApi ); + } + PA_LOGL_; + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaWinWdmHostApiRepresentation *wdmHostApi = (PaWinWdmHostApiRepresentation*)hostApi; + int i; + PA_LOGE_; + + if( wdmHostApi->filters ) + { + for( i=0; ifilterCount; i++) + { + if( wdmHostApi->filters[i] != NULL ) + { + FilterFree( wdmHostApi->filters[i] ); + wdmHostApi->filters[i] = NULL; + } + } + } + PaUtil_FreeMemory( wdmHostApi->filters ); + if( wdmHostApi->allocations ) + { + PaUtil_FreeAllAllocations( wdmHostApi->allocations ); + PaUtil_DestroyAllocationGroup( wdmHostApi->allocations ); + } + PaUtil_FreeMemory( wdmHostApi ); + PA_LOGL_; +} + +static void FillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount) +{ + PA_LOGE_; + PA_DEBUG(( "sampleFormat = %lx\n" , sampleFormat )); + PA_DEBUG(( "sampleRate = %f\n" , sampleRate )); + PA_DEBUG(( "chanelCount = %d\n", channelCount )); + + pwfext->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + pwfext->Format.nChannels = channelCount; + pwfext->Format.nSamplesPerSec = (int)sampleRate; + if(channelCount == 1) + pwfext->dwChannelMask = KSAUDIO_SPEAKER_DIRECTOUT; + else + pwfext->dwChannelMask = KSAUDIO_SPEAKER_STEREO; + if(sampleFormat == paFloat32) + { + pwfext->Format.nBlockAlign = channelCount * 4; + pwfext->Format.wBitsPerSample = 32; + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 32; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + } + else if(sampleFormat == paInt32) + { + pwfext->Format.nBlockAlign = channelCount * 4; + pwfext->Format.wBitsPerSample = 32; + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 32; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + } + else if(sampleFormat == paInt24) + { + pwfext->Format.nBlockAlign = channelCount * 3; + pwfext->Format.wBitsPerSample = 24; + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 24; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + } + else if(sampleFormat == paInt16) + { + pwfext->Format.nBlockAlign = channelCount * 2; + pwfext->Format.wBitsPerSample = 16; + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 16; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + } + pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign; + + PA_LOGL_; +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaWinWdmHostApiRepresentation *wdmHostApi = (PaWinWdmHostApiRepresentation*)hostApi; + PaWinWdmFilter* pFilter; + int result = paFormatIsSupported; + WAVEFORMATEXTENSIBLE wfx; + + PA_LOGE_; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + /* Check that the input format is supported */ + FillWFEXT(&wfx,paInt16,sampleRate,inputChannelCount); + + pFilter = wdmHostApi->filters[inputParameters->device]; + result = FilterCanCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx); + if( result != paNoError ) + { + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + result = FilterCanCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx); + if( result != paNoError ) + return result; + } + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support outputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + /* Check that the output format is supported */ + FillWFEXT(&wfx,paInt16,sampleRate,outputChannelCount); + + pFilter = wdmHostApi->filters[outputParameters->device]; + result = FilterCanCreateRenderPin(pFilter,(const WAVEFORMATEX*)&wfx); + if( result != paNoError ) + { + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + result = FilterCanCreateRenderPin(pFilter,(const WAVEFORMATEX*)&wfx); + if( result != paNoError ) + return result; + } + + } + else + { + outputChannelCount = 0; + } + + /* + IMPLEMENT ME: + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported if necessary + + - check that the device supports sampleRate + + Because the buffer adapter handles conversion between all standard + sample formats, the following checks are only required if paCustomFormat + is implemented, or under some other unusual conditions. + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from inputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + */ + if((inputChannelCount == 0)&&(outputChannelCount == 0)) + result = paSampleFormatNotSupported; /* Not right error */ + + PA_LOGL_; + return result; +} + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaWinWdmHostApiRepresentation *wdmHostApi = (PaWinWdmHostApiRepresentation*)hostApi; + PaWinWdmStream *stream = 0; + /* unsigned long framesPerHostBuffer; these may not be equivalent for all implementations */ + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + int userInputChannels,userOutputChannels; + int size; + PaWinWdmFilter* pFilter; + WAVEFORMATEXTENSIBLE wfx; + + PA_LOGE_; + PA_DEBUG(("OpenStream:sampleRate = %f\n",sampleRate)); + PA_DEBUG(("OpenStream:framesPerBuffer = %lu\n",framesPerBuffer)); + + if( inputParameters ) + { + userInputChannels = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support stream->userInputChannels */ + if( userInputChannels > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + } + else + { + userInputChannels = 0; + inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ + } + + if( outputParameters ) + { + userOutputChannels = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support stream->userInputChannels */ + if( userOutputChannels > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + } + else + { + userOutputChannels = 0; + outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ + } + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + stream = (PaWinWdmStream*)PaUtil_AllocateMemory( sizeof(PaWinWdmStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + /* Zero the stream object */ + /* memset((void*)stream,0,sizeof(PaWinWdmStream)); */ + + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &wdmHostApi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &wdmHostApi->blockingStreamInterface, streamCallback, userData ); + } + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + /* Instantiate the input pin if necessary */ + if(userInputChannels > 0) + { + result = paSampleFormatNotSupported; + pFilter = wdmHostApi->filters[inputParameters->device]; + stream->userInputChannels = userInputChannels; + + if(((inputSampleFormat & ~paNonInterleaved) & pFilter->formats) != 0) + { /* inputSampleFormat is supported, so try to use it */ + hostInputSampleFormat = inputSampleFormat; + FillWFEXT(&wfx, hostInputSampleFormat, sampleRate, stream->userInputChannels); + stream->bytesPerInputFrame = wfx.Format.nBlockAlign; + stream->recordingPin = FilterCreateCapturePin(pFilter, (const WAVEFORMATEX*)&wfx, &result); + stream->deviceInputChannels = stream->userInputChannels; + } + + if(result != paNoError) + { /* Search through all PaSampleFormats to find one that works */ + hostInputSampleFormat = paFloat32; + + do { + FillWFEXT(&wfx, hostInputSampleFormat, sampleRate, stream->userInputChannels); + stream->bytesPerInputFrame = wfx.Format.nBlockAlign; + stream->recordingPin = FilterCreateCapturePin(pFilter, (const WAVEFORMATEX*)&wfx, &result); + stream->deviceInputChannels = stream->userInputChannels; + + if(stream->recordingPin == NULL) result = paSampleFormatNotSupported; + if(result != paNoError) hostInputSampleFormat <<= 1; + } + while(result != paNoError && hostInputSampleFormat <= paUInt8); + } + + if(result != paNoError) + { /* None of the PaSampleFormats worked. Set the hostInputSampleFormat to the best fit + * and try a PCM format. + **/ + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat( pFilter->formats, inputSampleFormat ); + + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + stream->recordingPin = FilterCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + if(stream->recordingPin == NULL) result = paSampleFormatNotSupported; + } + + if( result != paNoError ) + { + /* Some or all KS devices can only handle the exact number of channels + * they specify. But PortAudio clients expect to be able to + * at least specify mono I/O on a multi-channel device + * If this is the case, then we will do the channel mapping internally + **/ + if( stream->userInputChannels < pFilter->maxInputChannels ) + { + FillWFEXT(&wfx,hostInputSampleFormat,sampleRate,pFilter->maxInputChannels); + stream->bytesPerInputFrame = wfx.Format.nBlockAlign; + stream->recordingPin = FilterCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + stream->deviceInputChannels = pFilter->maxInputChannels; + + if( result != paNoError ) + { + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + stream->recordingPin = FilterCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + } + } + } + + if(stream->recordingPin == NULL) + { + goto error; + } + + switch(hostInputSampleFormat) + { + case paInt16: stream->inputSampleSize = 2; break; + case paInt24: stream->inputSampleSize = 3; break; + case paInt32: + case paFloat32: stream->inputSampleSize = 4; break; + } + + stream->recordingPin->frameSize /= stream->bytesPerInputFrame; + PA_DEBUG(("Pin output frames: %d\n",stream->recordingPin->frameSize)); + } + else + { + stream->recordingPin = NULL; + stream->bytesPerInputFrame = 0; + } + + /* Instantiate the output pin if necessary */ + if(userOutputChannels > 0) + { + result = paSampleFormatNotSupported; + pFilter = wdmHostApi->filters[outputParameters->device]; + stream->userOutputChannels = userOutputChannels; + + if(((outputSampleFormat & ~paNonInterleaved) & pFilter->formats) != 0) + { + hostOutputSampleFormat = outputSampleFormat; + FillWFEXT(&wfx,hostOutputSampleFormat,sampleRate,stream->userOutputChannels); + stream->bytesPerOutputFrame = wfx.Format.nBlockAlign; + stream->playbackPin = FilterCreateRenderPin(pFilter,(WAVEFORMATEX*)&wfx,&result); + stream->deviceOutputChannels = stream->userOutputChannels; + } + + if(result != paNoError) + { + hostOutputSampleFormat = paFloat32; + + do { + FillWFEXT(&wfx,hostOutputSampleFormat,sampleRate,stream->userOutputChannels); + stream->bytesPerOutputFrame = wfx.Format.nBlockAlign; + stream->playbackPin = FilterCreateRenderPin(pFilter,(WAVEFORMATEX*)&wfx,&result); + stream->deviceOutputChannels = stream->userOutputChannels; + + if(stream->playbackPin == NULL) result = paSampleFormatNotSupported; + if(result != paNoError) hostOutputSampleFormat <<= 1; + } + while(result != paNoError && hostOutputSampleFormat <= paUInt8); + } + + if(result != paNoError) + { + hostOutputSampleFormat = + PaUtil_SelectClosestAvailableFormat( pFilter->formats, outputSampleFormat ); + + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + stream->playbackPin = FilterCreateRenderPin(pFilter,(WAVEFORMATEX*)&wfx,&result); + if(stream->playbackPin == NULL) result = paSampleFormatNotSupported; + } + + if( result != paNoError ) + { + /* Some or all KS devices can only handle the exact number of channels + * they specify. But PortAudio clients expect to be able to + * at least specify mono I/O on a multi-channel device + * If this is the case, then we will do the channel mapping internally + **/ + if( stream->userOutputChannels < pFilter->maxOutputChannels ) + { + FillWFEXT(&wfx,hostOutputSampleFormat,sampleRate,pFilter->maxOutputChannels); + stream->bytesPerOutputFrame = wfx.Format.nBlockAlign; + stream->playbackPin = FilterCreateRenderPin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + stream->deviceOutputChannels = pFilter->maxOutputChannels; + if( result != paNoError ) + { + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + stream->playbackPin = FilterCreateRenderPin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + } + } + } + + if(stream->playbackPin == NULL) + { + goto error; + } + + switch(hostOutputSampleFormat) + { + case paInt16: stream->outputSampleSize = 2; break; + case paInt24: stream->outputSampleSize = 3; break; + case paInt32: + case paFloat32: stream->outputSampleSize = 4; break; + } + + stream->playbackPin->frameSize /= stream->bytesPerOutputFrame; + PA_DEBUG(("Pin output frames: %d\n",stream->playbackPin->frameSize)); + } + else + { + stream->playbackPin = NULL; + stream->bytesPerOutputFrame = 0; + } + + /* Calculate the framesPerHostXxxxBuffer size based upon the suggested latency values */ + + /* Record the buffer length */ + if(inputParameters) + { + /* Calculate the frames from the user's value - add a bit to round up */ + stream->framesPerHostIBuffer = (unsigned long)((inputParameters->suggestedLatency*sampleRate)+0.0001); + if(stream->framesPerHostIBuffer > (unsigned long)sampleRate) + { /* Upper limit is 1 second */ + stream->framesPerHostIBuffer = (unsigned long)sampleRate; + } + else if(stream->framesPerHostIBuffer < stream->recordingPin->frameSize) + { + stream->framesPerHostIBuffer = stream->recordingPin->frameSize; + } + PA_DEBUG(("Input frames chosen:%ld\n",stream->framesPerHostIBuffer)); + } + + if(outputParameters) + { + /* Calculate the frames from the user's value - add a bit to round up */ + stream->framesPerHostOBuffer = (unsigned long)((outputParameters->suggestedLatency*sampleRate)+0.0001); + if(stream->framesPerHostOBuffer > (unsigned long)sampleRate) + { /* Upper limit is 1 second */ + stream->framesPerHostOBuffer = (unsigned long)sampleRate; + } + else if(stream->framesPerHostOBuffer < stream->playbackPin->frameSize) + { + stream->framesPerHostOBuffer = stream->playbackPin->frameSize; + } + PA_DEBUG(("Output frames chosen:%ld\n",stream->framesPerHostOBuffer)); + } + + /* Host buffer size is bounded to the largest of the input and output + frame sizes */ + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + stream->userInputChannels, inputSampleFormat, hostInputSampleFormat, + stream->userOutputChannels, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + max(stream->framesPerHostOBuffer,stream->framesPerHostIBuffer), + paUtilBoundedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ) + goto error; + + stream->streamRepresentation.streamInfo.inputLatency = + ((double)stream->framesPerHostIBuffer) / sampleRate; + stream->streamRepresentation.streamInfo.outputLatency = + ((double)stream->framesPerHostOBuffer) / sampleRate; + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + PA_DEBUG(("BytesPerInputFrame = %d\n",stream->bytesPerInputFrame)); + PA_DEBUG(("BytesPerOutputFrame = %d\n",stream->bytesPerOutputFrame)); + + /* Allocate all the buffers for host I/O */ + size = 2 * (stream->framesPerHostIBuffer*stream->bytesPerInputFrame + stream->framesPerHostOBuffer*stream->bytesPerOutputFrame); + PA_DEBUG(("Buffer size = %d\n",size)); + stream->hostBuffer = (char*)PaUtil_AllocateMemory(size); + PA_DEBUG(("Buffer allocated\n")); + if( !stream->hostBuffer ) + { + PA_DEBUG(("Cannot allocate host buffer!\n")); + result = paInsufficientMemory; + goto error; + } + PA_DEBUG(("Buffer start = %p\n",stream->hostBuffer)); + /* memset(stream->hostBuffer,0,size); */ + + /* Set up the packets */ + stream->events[0] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[0]); /* Record buffer 1 */ + stream->events[1] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[1]); /* Record buffer 2 */ + stream->events[2] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[2]); /* Play buffer 1 */ + stream->events[3] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[3]); /* Play buffer 2 */ + stream->events[4] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[4]); /* Abort event */ + if(stream->userInputChannels > 0) + { + DATAPACKET *p = &(stream->packets[0]); + p->Signal.hEvent = stream->events[0]; + p->Header.Data = stream->hostBuffer; + p->Header.FrameExtent = stream->framesPerHostIBuffer*stream->bytesPerInputFrame; + p->Header.DataUsed = 0; + p->Header.Size = sizeof(p->Header); + p->Header.PresentationTime.Numerator = 1; + p->Header.PresentationTime.Denominator = 1; + + p = &(stream->packets[1]); + p->Signal.hEvent = stream->events[1]; + p->Header.Data = stream->hostBuffer + stream->framesPerHostIBuffer*stream->bytesPerInputFrame; + p->Header.FrameExtent = stream->framesPerHostIBuffer*stream->bytesPerInputFrame; + p->Header.DataUsed = 0; + p->Header.Size = sizeof(p->Header); + p->Header.PresentationTime.Numerator = 1; + p->Header.PresentationTime.Denominator = 1; + } + if(stream->userOutputChannels > 0) + { + DATAPACKET *p = &(stream->packets[2]); + p->Signal.hEvent = stream->events[2]; + p->Header.Data = stream->hostBuffer + 2*stream->framesPerHostIBuffer*stream->bytesPerInputFrame; + p->Header.FrameExtent = stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.DataUsed = stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.Size = sizeof(p->Header); + p->Header.PresentationTime.Numerator = 1; + p->Header.PresentationTime.Denominator = 1; + + p = &(stream->packets[3]); + p->Signal.hEvent = stream->events[3]; + p->Header.Data = stream->hostBuffer + 2*stream->framesPerHostIBuffer*stream->bytesPerInputFrame + stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.FrameExtent = stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.DataUsed = stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.Size = sizeof(p->Header); + p->Header.PresentationTime.Numerator = 1; + p->Header.PresentationTime.Denominator = 1; + } + + stream->streamStarted = 0; + stream->streamActive = 0; + stream->streamStop = 0; + stream->streamAbort = 0; + stream->streamFlags = streamFlags; + stream->oldProcessPriority = REALTIME_PRIORITY_CLASS; + + *s = (PaStream*)stream; + + PA_LOGL_; + return result; + +error: + size = 5; + while(size--) + { + if(stream->events[size] != NULL) + { + CloseHandle(stream->events[size]); + stream->events[size] = NULL; + } + } + if(stream->hostBuffer) + PaUtil_FreeMemory( stream->hostBuffer ); + + if(stream->playbackPin) + PinClose(stream->playbackPin); + if(stream->recordingPin) + PinClose(stream->recordingPin); + + if( stream ) + PaUtil_FreeMemory( stream ); + + PA_LOGL_; + return result; +} + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int size; + + PA_LOGE_; + + assert(!stream->streamStarted); + assert(!stream->streamActive); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + size = 5; + while(size--) + { + if(stream->events[size] != NULL) + { + CloseHandle(stream->events[size]); + stream->events[size] = NULL; + } + } + if(stream->hostBuffer) + PaUtil_FreeMemory( stream->hostBuffer ); + + if(stream->playbackPin) + PinClose(stream->playbackPin); + if(stream->recordingPin) + PinClose(stream->recordingPin); + + PaUtil_FreeMemory( stream ); + + PA_LOGL_; + return result; +} + +/* +Write the supplied packet to the pin +Asynchronous +Should return false on success +*/ +static BOOL PinWrite(HANDLE h, DATAPACKET* p) +{ + unsigned long cbReturned = 0; + return DeviceIoControl(h,IOCTL_KS_WRITE_STREAM,NULL,0, + &p->Header,p->Header.Size,&cbReturned,&p->Signal); +} + +/* +Read to the supplied packet from the pin +Asynchronous +Should return false on success +*/ +static BOOL PinRead(HANDLE h, DATAPACKET* p) +{ + unsigned long cbReturned = 0; + return DeviceIoControl(h,IOCTL_KS_READ_STREAM,NULL,0, + &p->Header,p->Header.Size,&cbReturned,&p->Signal); +} + +/* +Copy the first interleaved channel of 16 bit data to the other channels +*/ +static void DuplicateFirstChannelInt16(void* buffer, int channels, int samples) +{ + unsigned short* data = (unsigned short*)buffer; + int channel; + unsigned short sourceSample; + while( samples-- ) + { + sourceSample = *data++; + channel = channels-1; + while( channel-- ) + { + *data++ = sourceSample; + } + } +} + +/* +Copy the first interleaved channel of 24 bit data to the other channels +*/ +static void DuplicateFirstChannelInt24(void* buffer, int channels, int samples) +{ + unsigned char* data = (unsigned char*)buffer; + int channel; + unsigned char sourceSample[3]; + while( samples-- ) + { + sourceSample[0] = data[0]; + sourceSample[1] = data[1]; + sourceSample[2] = data[2]; + data += 3; + channel = channels-1; + while( channel-- ) + { + data[0] = sourceSample[0]; + data[1] = sourceSample[1]; + data[2] = sourceSample[2]; + data += 3; + } + } +} + +/* +Copy the first interleaved channel of 32 bit data to the other channels +*/ +static void DuplicateFirstChannelInt32(void* buffer, int channels, int samples) +{ + unsigned long* data = (unsigned long*)buffer; + int channel; + unsigned long sourceSample; + while( samples-- ) + { + sourceSample = *data++; + channel = channels-1; + while( channel-- ) + { + *data++ = sourceSample; + } + } +} + +static DWORD WINAPI ProcessingThread(LPVOID pParam) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)pParam; + PaStreamCallbackTimeInfo ti; + int cbResult = paContinue; + int inbuf = 0; + int outbuf = 0; + int pending = 0; + PaError result; + unsigned long wait; + unsigned long eventSignaled; + int fillPlaybuf = 0; + int emptyRecordbuf = 0; + int framesProcessed; + unsigned long timeout; + int i; + int doChannelCopy; + int priming = 0; + PaStreamCallbackFlags underover = 0; + + PA_LOGE_; + + ti.inputBufferAdcTime = 0.0; + ti.currentTime = 0.0; + ti.outputBufferDacTime = 0.0; + + /* Get double buffering going */ + + /* Submit buffers */ + if(stream->playbackPin) + { + result = PinSetState(stream->playbackPin, KSSTATE_RUN); + + PA_DEBUG(("play state run = %d;",(int)result)); + SetEvent(stream->events[outbuf+2]); + outbuf = (outbuf+1)&1; + SetEvent(stream->events[outbuf+2]); + outbuf = (outbuf+1)&1; + pending += 2; + priming += 4; + } + if(stream->recordingPin) + { + result = PinSetState(stream->recordingPin, KSSTATE_RUN); + + PA_DEBUG(("recording state run = %d;",(int)result)); + PinRead(stream->recordingPin->handle,&stream->packets[inbuf]); + inbuf = (inbuf+1)&1; /* Increment and wrap */ + PinRead(stream->recordingPin->handle,&stream->packets[inbuf]); + inbuf = (inbuf+1)&1; /* Increment and wrap */ + /* FIXME - do error checking */ + pending += 2; + } + PA_DEBUG(("Out buffer len:%f\n",(2000*stream->framesPerHostOBuffer) / stream->streamRepresentation.streamInfo.sampleRate)); + PA_DEBUG(("In buffer len:%f\n",(2000*stream->framesPerHostIBuffer) / stream->streamRepresentation.streamInfo.sampleRate)); + timeout = max( + ((2000*(DWORD)stream->framesPerHostOBuffer) / (DWORD)stream->streamRepresentation.streamInfo.sampleRate), + ((2000*(DWORD)stream->framesPerHostIBuffer) / (DWORD)stream->streamRepresentation.streamInfo.sampleRate)); + timeout = max(timeout,1); + PA_DEBUG(("Timeout = %ld\n",timeout)); + + while(!stream->streamAbort) + { + fillPlaybuf = 0; + emptyRecordbuf = 0; + + /* Wait for next input or output buffer to be finished with*/ + assert(pending>0); + + if(stream->streamStop) + { + PA_DEBUG(("ss1:pending=%d ",pending)); + } + wait = WaitForMultipleObjects(5, stream->events, FALSE, 0); + if( wait == WAIT_TIMEOUT ) + { + /* No (under|over)flow has ocurred */ + wait = WaitForMultipleObjects(5, stream->events, FALSE, timeout); + eventSignaled = wait - WAIT_OBJECT_0; + } + else + { + eventSignaled = wait - WAIT_OBJECT_0; + if( eventSignaled < 2 ) + { + underover |= paInputOverflow; + PA_DEBUG(("Input overflow\n")); + } + else if(( eventSignaled < 4 )&&(!priming)) + { + underover |= paOutputUnderflow; + PA_DEBUG(("Output underflow\n")); + } + } + + if(stream->streamStop) + { + PA_DEBUG(("ss2:wait=%ld",wait)); + } + if(wait == WAIT_FAILED) + { + PA_DEBUG(("Wait fail = %ld! ",wait)); + break; + } + if(wait == WAIT_TIMEOUT) + { + continue; + } + + if(eventSignaled < 2) + { /* Recording input buffer has been filled */ + if(stream->playbackPin) + { + /* First check if also the next playback buffer has been signaled */ + wait = WaitForSingleObject(stream->events[outbuf+2],0); + if(wait == WAIT_OBJECT_0) + { + /* Yes, so do both buffers at same time */ + fillPlaybuf = 1; + pending--; + /* Was this an underflow situation? */ + if( underover ) + underover |= paOutputUnderflow; /* Yes! */ + } + } + emptyRecordbuf = 1; + pending--; + } + else if(eventSignaled < 4) + { /* Playback output buffer has been emptied */ + if(stream->recordingPin) + { + /* First check if also the next recording buffer has been signaled */ + wait = WaitForSingleObject(stream->events[inbuf],0); + if(wait == WAIT_OBJECT_0) + { /* Yes, so do both buffers at same time */ + emptyRecordbuf = 1; + pending--; + /* Was this an overflow situation? */ + if( underover ) + underover |= paInputOverflow; /* Yes! */ + } + } + fillPlaybuf = 1; + pending--; + } + else + { + /* Abort event! */ + assert(stream->streamAbort); /* Should have been set */ + PA_DEBUG(("ABORTING ")); + break; + } + ResetEvent(stream->events[eventSignaled]); + + if(stream->streamStop) + { + PA_DEBUG(("Stream stop! pending=%d",pending)); + cbResult = paComplete; /* Stop, but play remaining buffers */ + } + + /* Do necessary buffer processing (which will invoke user callback if necessary */ + doChannelCopy = 0; + if(cbResult==paContinue) + { + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + if((stream->bufferProcessor.hostInputFrameCount[0] + stream->bufferProcessor.hostInputFrameCount[1]) == + (stream->bufferProcessor.hostOutputFrameCount[0] + stream->bufferProcessor.hostOutputFrameCount[1]) ) + PaUtil_BeginBufferProcessing(&stream->bufferProcessor,&ti,underover); + underover = 0; /* Reset the (under|over)flow status */ + if(fillPlaybuf) + { + PaUtil_SetOutputFrameCount(&stream->bufferProcessor,0); + if( stream->userOutputChannels == 1 ) + { + /* Write the single user channel to the first interleaved block */ + PaUtil_SetOutputChannel(&stream->bufferProcessor,0,stream->packets[outbuf+2].Header.Data,stream->deviceOutputChannels); + /* We will do a copy to the other channels after the data has been written */ + doChannelCopy = 1; + } + else + { + for(i=0;iuserOutputChannels;i++) + { + /* Only write the user output channels. Leave the rest blank */ + PaUtil_SetOutputChannel(&stream->bufferProcessor,i,((unsigned char*)(stream->packets[outbuf+2].Header.Data))+(i*stream->outputSampleSize),stream->deviceOutputChannels); + } + } + } + if(emptyRecordbuf) + { + PaUtil_SetInputFrameCount(&stream->bufferProcessor,stream->packets[inbuf].Header.DataUsed/stream->bytesPerInputFrame); + for(i=0;iuserInputChannels;i++) + { + /* Only read as many channels as the user wants */ + PaUtil_SetInputChannel(&stream->bufferProcessor,i,((unsigned char*)(stream->packets[inbuf].Header.Data))+(i*stream->inputSampleSize),stream->deviceInputChannels); + } + } + /* Only call the EndBufferProcessing function is the total input frames == total output frames */ + if((stream->bufferProcessor.hostInputFrameCount[0] + stream->bufferProcessor.hostInputFrameCount[1]) == + (stream->bufferProcessor.hostOutputFrameCount[0] + stream->bufferProcessor.hostOutputFrameCount[1]) ) + framesProcessed = PaUtil_EndBufferProcessing(&stream->bufferProcessor,&cbResult); + else framesProcessed = 0; + if( doChannelCopy ) + { + /* Copy the first output channel to the other channels */ + switch(stream->outputSampleSize) + { + case 2: + DuplicateFirstChannelInt16(stream->packets[outbuf+2].Header.Data,stream->deviceOutputChannels,stream->framesPerHostOBuffer); + break; + case 3: + DuplicateFirstChannelInt24(stream->packets[outbuf+2].Header.Data,stream->deviceOutputChannels,stream->framesPerHostOBuffer); + break; + case 4: + DuplicateFirstChannelInt32(stream->packets[outbuf+2].Header.Data,stream->deviceOutputChannels,stream->framesPerHostOBuffer); + break; + default: + assert(0); /* Unsupported format! */ + break; + } + } + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + } + else + { + fillPlaybuf = 0; + emptyRecordbuf = 0; + } + + /* + if(cbResult != paContinue) + { + PA_DEBUG(("cbResult=%d, pending=%d:",cbResult,pending)); + } + */ + /* Submit buffers */ + if((fillPlaybuf)&&(cbResult!=paAbort)) + { + if(!PinWrite(stream->playbackPin->handle,&stream->packets[outbuf+2])) + outbuf = (outbuf+1)&1; /* Increment and wrap */ + pending++; + if( priming ) + priming--; /* Have to prime twice */ + } + if((emptyRecordbuf)&&(cbResult==paContinue)) + { + stream->packets[inbuf].Header.DataUsed = 0; /* Reset for reuse */ + PinRead(stream->recordingPin->handle,&stream->packets[inbuf]); + inbuf = (inbuf+1)&1; /* Increment and wrap */ + pending++; + } + if(pending==0) + { + PA_DEBUG(("pending==0 finished...;")); + break; + } + if((!stream->playbackPin)&&(cbResult!=paContinue)) + { + PA_DEBUG(("record only cbResult=%d...;",cbResult)); + break; + } + } + + PA_DEBUG(("Finished thread")); + + /* Finished, either normally or aborted */ + if(stream->playbackPin) + { + result = PinSetState(stream->playbackPin, KSSTATE_PAUSE); + result = PinSetState(stream->playbackPin, KSSTATE_STOP); + } + if(stream->recordingPin) + { + result = PinSetState(stream->recordingPin, KSSTATE_PAUSE); + result = PinSetState(stream->recordingPin, KSSTATE_STOP); + } + + stream->streamActive = 0; + + if((!stream->streamStop)&&(!stream->streamAbort)) + { + /* Invoke the user stream finished callback */ + /* Only do it from here if not being stopped/aborted by user */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + stream->streamStop = 0; + stream->streamAbort = 0; + + /* Reset process priority if necessary */ + if(stream->oldProcessPriority != REALTIME_PRIORITY_CLASS) + { + SetPriorityClass(GetCurrentProcess(),stream->oldProcessPriority); + stream->oldProcessPriority = REALTIME_PRIORITY_CLASS; + } + + PA_LOGL_; + ExitThread(0); + return 0; +} + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinWdmStream *stream = (PaWinWdmStream*)s; + DWORD dwID; + BOOL ret; + int size; + + PA_LOGE_; + + stream->streamStop = 0; + stream->streamAbort = 0; + size = 5; + while(size--) + { + if(stream->events[size] != NULL) + { + ResetEvent(stream->events[size]); + } + } + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + stream->oldProcessPriority = GetPriorityClass(GetCurrentProcess()); + /* Uncomment the following line to enable dynamic boosting of the process + * priority to real time for best low latency support + * Disabled by default because RT processes can easily block the OS */ + /*ret = SetPriorityClass(GetCurrentProcess(),REALTIME_PRIORITY_CLASS); + PA_DEBUG(("Class ret = %d;",ret));*/ + + stream->streamStarted = 1; + stream->streamThread = CreateThread(NULL, 0, ProcessingThread, stream, 0, &dwID); + if(stream->streamThread == NULL) + { + stream->streamStarted = 0; + result = paInsufficientMemory; + goto end; + } + ret = SetThreadPriority(stream->streamThread,THREAD_PRIORITY_TIME_CRITICAL); + PA_DEBUG(("Priority ret = %d;",ret)); + /* Make the stream active */ + stream->streamActive = 1; + +end: + PA_LOGL_; + return result; +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int doCb = 0; + + PA_LOGE_; + + if(stream->streamActive) + { + doCb = 1; + stream->streamStop = 1; + while(stream->streamActive) + { + PA_DEBUG(("W.")); + Sleep(10); /* Let thread sleep for 10 msec */ + } + } + + PA_DEBUG(("Terminating thread")); + if(stream->streamStarted && stream->streamThread) + { + TerminateThread(stream->streamThread,0); + stream->streamThread = NULL; + } + + stream->streamStarted = 0; + + if(stream->oldProcessPriority != REALTIME_PRIORITY_CLASS) + { + SetPriorityClass(GetCurrentProcess(),stream->oldProcessPriority); + stream->oldProcessPriority = REALTIME_PRIORITY_CLASS; + } + + if(doCb) + { + /* Do user callback now after all state has been reset */ + /* This means it should be safe for the called function */ + /* to invoke e.g. StartStream */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + + PA_LOGL_; + return result; +} + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int doCb = 0; + + PA_LOGE_; + + if(stream->streamActive) + { + doCb = 1; + stream->streamAbort = 1; + SetEvent(stream->events[4]); /* Signal immediately */ + while(stream->streamActive) + { + Sleep(10); + } + } + + if(stream->streamStarted && stream->streamThread) + { + TerminateThread(stream->streamThread,0); + stream->streamThread = NULL; + } + + stream->streamStarted = 0; + + if(stream->oldProcessPriority != REALTIME_PRIORITY_CLASS) + { + SetPriorityClass(GetCurrentProcess(),stream->oldProcessPriority); + stream->oldProcessPriority = REALTIME_PRIORITY_CLASS; + } + + if(doCb) + { + /* Do user callback now after all state has been reset */ + /* This means it should be safe for the called function */ + /* to invoke e.g. StartStream */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + + stream->streamActive = 0; + stream->streamStarted = 0; + + PA_LOGL_; + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int result = 0; + + PA_LOGE_; + + if(!stream->streamStarted) + result = 1; + + PA_LOGL_; + return result; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int result = 0; + + PA_LOGE_; + + if(stream->streamActive) + result = 1; + + PA_LOGL_; + return result; +} + + +static PaTime GetStreamTime( PaStream* s ) +{ + PA_LOGE_; + PA_LOGL_; + (void)s; + return PaUtil_GetTime(); +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + double result; + PA_LOGE_; + result = PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); + PA_LOGL_; + return result; +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + + PA_LOGE_; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + PA_LOGL_; + return paNoError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + + PA_LOGE_; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + PA_LOGL_; + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + + PA_LOGE_; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + PA_LOGL_; + return 0; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + + PA_LOGE_; + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + PA_LOGL_; + return 0; +} \ No newline at end of file diff --git a/portaudio-v19/pa_win_wdmks/readme.txt b/portaudio-v19/pa_win_wdmks/readme.txt new file mode 100644 index 000000000..1a381fe79 --- /dev/null +++ b/portaudio-v19/pa_win_wdmks/readme.txt @@ -0,0 +1,82 @@ +Notes about WDM-KS host API +--------------------------- + +Status history +-------------- +10th November 2005: +Made following changes: + * OpenStream: Try all PaSampleFormats internally if the the chosen + format is not supported natively. This fixed several problems + with soundcards that soundcards that did not take kindly to + using 24-bit 3-byte formats. + * OpenStream: Make the minimum framesPerHostIBuffer (and framesPerHostOBuffer) + the default frameSize for the playback/recording pin. + * ProcessingThread: Added a switch to only call PaUtil_EndBufferProcessing + if the total input frames equals the total output frames + +5th September 2004: +This is the first public version of the code. It should be considered +an alpha release with zero guarantee not to crash on any particular +system. So far it has only been tested in the author's development +environment, which means a Win2k/SP2 PIII laptop with integrated +SoundMAX driver and USB Tascam US-428 compiled with both MinGW +(GCC 3.3) and MSVC++6 using the MS DirectX 9 SDK. +It has been most widely tested with the MinGW build, with most of the +test programs (particularly paqa_devs and paqa_errs) passing. +There are some notable failures: patest_out_underflow and both of the +blocking I/O tests (as blocking I/O is not implemented). +At this point the code needs to be tested with a much wider variety +of configurations and feedback provided from testers regarding +both working and failing cases. + +What is the WDM-KS host API? +---------------------------- +PortAudio for Windows currently has 3 functional host implementations. +MME uses the oldest Windows audio API which does not offer good +play/record latency. +DirectX improves this, but still imposes a penalty +of 10s of milliseconds due to the system mixing of streams from +multiple applications. +ASIO offers very good latency, but requires special drivers which are +not always available for cheaper audio hardware. Also, when ASIO +drivers are available, they are not always so robust because they +bypass all of the standardised Windows device driver architecture +and hit the hardware their own way. +Alternatively there are a couple of free (but closed source) ASIO +implementations which connect to the lower level Windows +"Kernel Streaming" API, but again these require special installation +by the user, and can be limited in functionality or difficult to use. + +This is where the PortAudio "WDM-KS" host implementation comes in. +It directly connects PortAudio to the same Kernel Streaming API which +those ASIO bridges use. This avoids the mixing penatly of DirectX, +giving at least as good latency as any ASIO driver, but it has the +advantage of working with ANY Windows audio hardware which is available +through the normal MME/DirectX routes without the user requiring +any additional device drivers to be installed, and allowing all +device selection to be done through the normal PortAudio API. + +Note that in general you should only be using this host API if your +application has a real requirement for very low latency audio (<20ms), +either because you are generating sounds in real-time based upon +user input, or you a processing recorded audio in real time. + +The only thing to be aware of is that using the KS interface will +block that device from being used by the rest of system through +the higher level APIs, or conversely, if the system is using +a device, the KS API will not be able to use it. MS recommend that +you should keep the device open only when your application has focus. +In PortAudio terms, this means having a stream Open on a WDMKS device. + +Usage +----- +To add the WDMKS backend to your program which is already using +PortAudio, you must undefine PA_NO_WDMKS from your build file, +and include the pa_win_wdmks\pa_win_wdmks.c into your build. +The file should compile in both C and C++. +You will need a DirectX SDK installed on your system for the +ks.h and ksmedia.h header files. +You will need to link to the system "setupapi" library. +Note that if you use MinGW, you will get more warnings from +the DX header files when using GCC(C), and still a few warnings +with G++(CPP). \ No newline at end of file diff --git a/portaudio-v19/pa_win_wmme/pa_win_wmme.c b/portaudio-v19/pa_win_wmme/pa_win_wmme.c new file mode 100644 index 000000000..86b6cdf14 --- /dev/null +++ b/portaudio-v19/pa_win_wmme/pa_win_wmme.c @@ -0,0 +1,3623 @@ +/* + * $Id$ + * pa_win_wmme.c + * Implementation of PortAudio for Windows MultiMedia Extensions (WMME) + * + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * + * Authors: Ross Bencina and Phil Burk + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +/* Modification History: + PLB = Phil Burk + JM = Julien Maillard + RDB = Ross Bencina + PLB20010402 - sDevicePtrs now allocates based on sizeof(pointer) + PLB20010413 - check for excessive numbers of channels + PLB20010422 - apply Mike Berry's changes for CodeWarrior on PC + including conditional inclusion of memory.h, + and explicit typecasting on memory allocation + PLB20010802 - use GlobalAlloc for sDevicesPtr instead of PaHost_AllocFastMemory + PLB20010816 - pass process instead of thread to SetPriorityClass() + PLB20010927 - use number of frames instead of real-time for CPULoad calculation. + JM20020118 - prevent hung thread when buffers underflow. + PLB20020321 - detect Win XP versus NT, 9x; fix DBUG typo; removed init of CurrentCount + RDB20020411 - various renaming cleanups, factored streamData alloc and cpu usage init + RDB20020417 - stopped counting WAVE_MAPPER when there were no real devices + refactoring, renaming and fixed a few edge case bugs + RDB20020531 - converted to V19 framework + ** NOTE maintanance history is now stored in CVS ** +*/ + +/** @file + + @todo Fix buffer catch up code, can sometimes get stuck (perhaps fixed now, + needs to be reviewed and tested.) + + @todo implement paInputUnderflow, paOutputOverflow streamCallback statusFlags, paNeverDropInput. + + @todo BUG: PA_MME_SET_LAST_WAVEIN/OUT_ERROR is used in functions which may + be called asynchronously from the callback thread. this is bad. + + @todo implement inputBufferAdcTime in callback thread + + @todo review/fix error recovery and cleanup in marked functions + + @todo implement timeInfo for stream priming + + @todo handle the case where the callback returns paAbort or paComplete during stream priming. + + @todo review input overflow and output underflow handling in ReadStream and WriteStream + +Non-critical stuff for the future: + + @todo Investigate supporting host buffer formats > 16 bits + + @todo define UNICODE and _UNICODE in the project settings and see what breaks + +*/ + +/* + How it works: + + For both callback and blocking read/write streams we open the MME devices + in CALLBACK_EVENT mode. In this mode, MME signals an Event object whenever + it has finished with a buffer (either filled it for input, or played it + for output). Where necessary we block waiting for Event objects using + WaitMultipleObjects(). + + When implementing a PA callback stream, we set up a high priority thread + which waits on the MME buffer Events and drains/fills the buffers when + they are ready. + + When implementing a PA blocking read/write stream, we simply wait on these + Events (when necessary) inside the ReadStream() and WriteStream() functions. +*/ + +#include +#include +#include +#include +#include +#include +#include +/* PLB20010422 - "memory.h" doesn't work on CodeWarrior for PC. Thanks Mike Berry for the mod. */ +#ifndef __MWERKS__ +#include +#include +#endif /* __MWERKS__ */ + +#include "portaudio.h" +#include "pa_trace.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + +#include "pa_win_wmme.h" + +#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ +#pragma comment(lib, "winmm.lib") +#endif + +/************************************************* Constants ********/ + +#define PA_MME_USE_HIGH_DEFAULT_LATENCY_ (0) /* For debugging glitches. */ + +#if PA_MME_USE_HIGH_DEFAULT_LATENCY_ + #define PA_MME_WIN_9X_DEFAULT_LATENCY_ (0.4) + #define PA_MME_MIN_HOST_OUTPUT_BUFFER_COUNT_ (4) + #define PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_ (4) + #define PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_HALF_DUPLEX_ (4) + #define PA_MME_MIN_HOST_BUFFER_FRAMES_WHEN_UNSPECIFIED_ (16) + #define PA_MME_MAX_HOST_BUFFER_SECS_ (0.3) /* Do not exceed unless user buffer exceeds */ + #define PA_MME_MAX_HOST_BUFFER_BYTES_ (32 * 1024) /* Has precedence over PA_MME_MAX_HOST_BUFFER_SECS_, some drivers are known to crash with buffer sizes > 32k */ +#else + #define PA_MME_WIN_9X_DEFAULT_LATENCY_ (0.2) + #define PA_MME_MIN_HOST_OUTPUT_BUFFER_COUNT_ (2) + #define PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_ (3) + #define PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_HALF_DUPLEX_ (2) + #define PA_MME_MIN_HOST_BUFFER_FRAMES_WHEN_UNSPECIFIED_ (16) + #define PA_MME_MAX_HOST_BUFFER_SECS_ (0.1) /* Do not exceed unless user buffer exceeds */ + #define PA_MME_MAX_HOST_BUFFER_BYTES_ (32 * 1024) /* Has precedence over PA_MME_MAX_HOST_BUFFER_SECS_, some drivers are known to crash with buffer sizes > 32k */ +#endif + +/* Use higher latency for NT because it is even worse at real-time + operation than Win9x. +*/ +#define PA_MME_WIN_NT_DEFAULT_LATENCY_ (PA_MME_WIN_9X_DEFAULT_LATENCY_ * 2) +#define PA_MME_WIN_WDM_DEFAULT_LATENCY_ (PA_MME_WIN_9X_DEFAULT_LATENCY_) + + +#define PA_MME_MIN_TIMEOUT_MSEC_ (1000) + +static const char constInputMapperSuffix_[] = " - Input"; +static const char constOutputMapperSuffix_[] = " - Output"; + +/********************************************************************/ + +typedef struct PaWinMmeStream PaWinMmeStream; /* forward declaration */ + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + + +/* macros for setting last host error information */ + +#ifdef UNICODE + +#define PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ) \ + { \ + wchar_t mmeErrorTextWide[ MAXERRORLENGTH ]; \ + char mmeErrorText[ MAXERRORLENGTH ]; \ + waveInGetErrorText( mmresult, mmeErrorTextWide, MAXERRORLENGTH ); \ + WideCharToMultiByte( CP_ACP, WC_COMPOSITECHECK | WC_DEFAULTCHAR,\ + mmeErrorTextWide, -1, mmeErrorText, MAXERRORLENGTH, NULL, NULL ); \ + PaUtil_SetLastHostErrorInfo( paMME, mmresult, mmeErrorText ); \ + } + +#define PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ) \ + { \ + wchar_t mmeErrorTextWide[ MAXERRORLENGTH ]; \ + char mmeErrorText[ MAXERRORLENGTH ]; \ + waveOutGetErrorText( mmresult, mmeErrorTextWide, MAXERRORLENGTH ); \ + WideCharToMultiByte( CP_ACP, WC_COMPOSITECHECK | WC_DEFAULTCHAR,\ + mmeErrorTextWide, -1, mmeErrorText, MAXERRORLENGTH, NULL, NULL ); \ + PaUtil_SetLastHostErrorInfo( paMME, mmresult, mmeErrorText ); \ + } + +#else /* !UNICODE */ + +#define PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ) \ + { \ + char mmeErrorText[ MAXERRORLENGTH ]; \ + waveInGetErrorText( mmresult, mmeErrorText, MAXERRORLENGTH ); \ + PaUtil_SetLastHostErrorInfo( paMME, mmresult, mmeErrorText ); \ + } + +#define PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ) \ + { \ + char mmeErrorText[ MAXERRORLENGTH ]; \ + waveOutGetErrorText( mmresult, mmeErrorText, MAXERRORLENGTH ); \ + PaUtil_SetLastHostErrorInfo( paMME, mmresult, mmeErrorText ); \ + } + +#endif /* UNICODE */ + + +static void PaMme_SetLastSystemError( DWORD errorCode ) +{ + char *lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + errorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + PaUtil_SetLastHostErrorInfo( paMME, errorCode, lpMsgBuf ); + LocalFree( lpMsgBuf ); +} + +#define PA_MME_SET_LAST_SYSTEM_ERROR( errorCode ) \ + PaMme_SetLastSystemError( errorCode ) + + +/* PaError returning wrappers for some commonly used win32 functions + note that we allow passing a null ptr to have no effect. +*/ + +static PaError CreateEventWithPaError( HANDLE *handle, + LPSECURITY_ATTRIBUTES lpEventAttributes, + BOOL bManualReset, + BOOL bInitialState, + LPCTSTR lpName ) +{ + PaError result = paNoError; + + *handle = NULL; + + *handle = CreateEvent( lpEventAttributes, bManualReset, bInitialState, lpName ); + if( *handle == NULL ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + + return result; +} + + +static PaError ResetEventWithPaError( HANDLE handle ) +{ + PaError result = paNoError; + + if( handle ) + { + if( ResetEvent( handle ) == 0 ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + } + + return result; +} + + +static PaError CloseHandleWithPaError( HANDLE handle ) +{ + PaError result = paNoError; + + if( handle ) + { + if( CloseHandle( handle ) == 0 ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + } + + return result; +} + + +/* PaWinMmeHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + int inputDeviceCount, outputDeviceCount; + + /** winMmeDeviceIds is an array of WinMme device ids. + fields in the range [0, inputDeviceCount) are input device ids, + and [inputDeviceCount, inputDeviceCount + outputDeviceCount) are output + device ids. + */ + UINT *winMmeDeviceIds; +} +PaWinMmeHostApiRepresentation; + + +typedef struct +{ + PaDeviceInfo inheritedDeviceInfo; + DWORD dwFormats; /**<< standard formats bitmask from the WAVEINCAPS and WAVEOUTCAPS structures */ +} +PaWinMmeDeviceInfo; + + +/************************************************************************* + * Returns recommended device ID. + * On the PC, the recommended device can be specified by the user by + * setting an environment variable. For example, to use device #1. + * + * set PA_RECOMMENDED_OUTPUT_DEVICE=1 + * + * The user should first determine the available device ID by using + * the supplied application "pa_devs". + */ +#define PA_ENV_BUF_SIZE_ (32) +#define PA_REC_IN_DEV_ENV_NAME_ ("PA_RECOMMENDED_INPUT_DEVICE") +#define PA_REC_OUT_DEV_ENV_NAME_ ("PA_RECOMMENDED_OUTPUT_DEVICE") +static PaDeviceIndex GetEnvDefaultDeviceID( char *envName ) +{ + PaDeviceIndex recommendedIndex = paNoDevice; + DWORD hresult; + char envbuf[PA_ENV_BUF_SIZE_]; + +#ifndef WIN32_PLATFORM_PSPC /* no GetEnvironmentVariable on PocketPC */ + + /* Let user determine default device by setting environment variable. */ + hresult = GetEnvironmentVariable( envName, envbuf, PA_ENV_BUF_SIZE_ ); + if( (hresult > 0) && (hresult < PA_ENV_BUF_SIZE_) ) + { + recommendedIndex = atoi( envbuf ); + } +#endif + + return recommendedIndex; +} + + +static void InitializeDefaultDeviceIdsFromEnv( PaWinMmeHostApiRepresentation *hostApi ) +{ + PaDeviceIndex device; + + /* input */ + device = GetEnvDefaultDeviceID( PA_REC_IN_DEV_ENV_NAME_ ); + if( device != paNoDevice && + ( device >= 0 && device < hostApi->inheritedHostApiRep.info.deviceCount ) && + hostApi->inheritedHostApiRep.deviceInfos[ device ]->maxInputChannels > 0 ) + { + hostApi->inheritedHostApiRep.info.defaultInputDevice = device; + } + + /* output */ + device = GetEnvDefaultDeviceID( PA_REC_OUT_DEV_ENV_NAME_ ); + if( device != paNoDevice && + ( device >= 0 && device < hostApi->inheritedHostApiRep.info.deviceCount ) && + hostApi->inheritedHostApiRep.deviceInfos[ device ]->maxOutputChannels > 0 ) + { + hostApi->inheritedHostApiRep.info.defaultOutputDevice = device; + } +} + + +/** Convert external PA ID to a windows multimedia device ID +*/ +static UINT LocalDeviceIndexToWinMmeDeviceId( PaWinMmeHostApiRepresentation *hostApi, PaDeviceIndex device ) +{ + assert( device >= 0 && device < hostApi->inputDeviceCount + hostApi->outputDeviceCount ); + + return hostApi->winMmeDeviceIds[ device ]; +} + + +static PaError QueryInputWaveFormatEx( int deviceId, WAVEFORMATEX *waveFormatEx ) +{ + MMRESULT mmresult; + + switch( mmresult = waveInOpen( NULL, deviceId, waveFormatEx, 0, 0, WAVE_FORMAT_QUERY ) ) + { + case MMSYSERR_NOERROR: + return paNoError; + case MMSYSERR_ALLOCATED: /* Specified resource is already allocated. */ + return paDeviceUnavailable; + case MMSYSERR_NODRIVER: /* No device driver is present. */ + return paDeviceUnavailable; + case MMSYSERR_NOMEM: /* Unable to allocate or lock memory. */ + return paInsufficientMemory; + case WAVERR_BADFORMAT: /* Attempted to open with an unsupported waveform-audio format. */ + return paSampleFormatNotSupported; + + case MMSYSERR_BADDEVICEID: /* Specified device identifier is out of range. */ + /* falls through */ + default: + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + return paUnanticipatedHostError; + } +} + + +static PaError QueryOutputWaveFormatEx( int deviceId, WAVEFORMATEX *waveFormatEx ) +{ + MMRESULT mmresult; + + switch( mmresult = waveOutOpen( NULL, deviceId, waveFormatEx, 0, 0, WAVE_FORMAT_QUERY ) ) + { + case MMSYSERR_NOERROR: + return paNoError; + case MMSYSERR_ALLOCATED: /* Specified resource is already allocated. */ + return paDeviceUnavailable; + case MMSYSERR_NODRIVER: /* No device driver is present. */ + return paDeviceUnavailable; + case MMSYSERR_NOMEM: /* Unable to allocate or lock memory. */ + return paInsufficientMemory; + case WAVERR_BADFORMAT: /* Attempted to open with an unsupported waveform-audio format. */ + return paSampleFormatNotSupported; + + case MMSYSERR_BADDEVICEID: /* Specified device identifier is out of range. */ + /* falls through */ + default: + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + return paUnanticipatedHostError; + } +} + + +static PaError QueryFormatSupported( PaDeviceInfo *deviceInfo, + PaError (*waveFormatExQueryFunction)(int, WAVEFORMATEX*), + int winMmeDeviceId, int channels, double sampleRate ) +{ + PaWinMmeDeviceInfo *winMmeDeviceInfo = (PaWinMmeDeviceInfo*)deviceInfo; + WAVEFORMATEX waveFormatEx; + + if( sampleRate == 11025.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1S16)) ) ){ + + return paNoError; + } + + if( sampleRate == 22050.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2S16)) ) ){ + + return paNoError; + } + + if( sampleRate == 44100.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4S16)) ) ){ + + return paNoError; + } + + waveFormatEx.wFormatTag = WAVE_FORMAT_PCM; + waveFormatEx.nChannels = (WORD)channels; + waveFormatEx.nSamplesPerSec = (DWORD)sampleRate; + waveFormatEx.nAvgBytesPerSec = waveFormatEx.nSamplesPerSec * channels * sizeof(short); + waveFormatEx.nBlockAlign = (WORD)(channels * sizeof(short)); + waveFormatEx.wBitsPerSample = 16; + waveFormatEx.cbSize = 0; + + return waveFormatExQueryFunction( winMmeDeviceId, &waveFormatEx ); +} + + +#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ (13) /* must match array length below */ +static double defaultSampleRateSearchOrder_[] = + { 44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, 192000.0, + 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 }; + +static void DetectDefaultSampleRate( PaWinMmeDeviceInfo *winMmeDeviceInfo, int winMmeDeviceId, + PaError (*waveFormatExQueryFunction)(int, WAVEFORMATEX*), int maxChannels ) +{ + PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; + int i; + + deviceInfo->defaultSampleRate = 0.; + + for( i=0; i < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++i ) + { + double sampleRate = defaultSampleRateSearchOrder_[ i ]; + PaError paerror = QueryFormatSupported( deviceInfo, waveFormatExQueryFunction, winMmeDeviceId, maxChannels, sampleRate ); + if( paerror == paNoError ) + { + deviceInfo->defaultSampleRate = sampleRate; + break; + } + } +} + + +static PaError InitializeInputDeviceInfo( PaWinMmeHostApiRepresentation *winMmeHostApi, + PaWinMmeDeviceInfo *winMmeDeviceInfo, UINT winMmeInputDeviceId, int *success ) +{ + PaError result = paNoError; + char *deviceName; /* non-const ptr */ + MMRESULT mmresult; + WAVEINCAPS wic; + PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; + + *success = 0; + + mmresult = waveInGetDevCaps( winMmeInputDeviceId, &wic, sizeof( WAVEINCAPS ) ); + if( mmresult == MMSYSERR_NOMEM ) + { + result = paInsufficientMemory; + goto error; + } + else if( mmresult != MMSYSERR_NOERROR ) + { + /* instead of returning paUnanticipatedHostError we return + paNoError, but leave success set as 0. This allows + Pa_Initialize to just ignore this device, without failing + the entire initialisation process. + */ + return paNoError; + } + + if( winMmeInputDeviceId == WAVE_MAPPER ) + { + /* Append I/O suffix to WAVE_MAPPER device. */ + deviceName = (char *)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, strlen( wic.szPname ) + 1 + sizeof(constInputMapperSuffix_) ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, wic.szPname ); + strcat( deviceName, constInputMapperSuffix_ ); + } + else + { + deviceName = (char*)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, strlen( wic.szPname ) + 1 ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, wic.szPname ); + } + deviceInfo->name = deviceName; + + deviceInfo->maxInputChannels = wic.wChannels; + /* Sometimes a device can return a rediculously large number of channels. + * This happened with an SBLive card on a Windows ME box. + * If that happens, then force it to 2 channels. PLB20010413 + */ + if( (deviceInfo->maxInputChannels < 1) || (deviceInfo->maxInputChannels > 256) ) + { + PA_DEBUG(("Pa_GetDeviceInfo: Num input channels reported as %d! Changed to 2.\n", deviceInfo->maxInputChannels )); + deviceInfo->maxInputChannels = 2; + } + + winMmeDeviceInfo->dwFormats = wic.dwFormats; + + DetectDefaultSampleRate( winMmeDeviceInfo, winMmeInputDeviceId, + QueryInputWaveFormatEx, deviceInfo->maxInputChannels ); + + *success = 1; + +error: + return result; +} + + +static PaError InitializeOutputDeviceInfo( PaWinMmeHostApiRepresentation *winMmeHostApi, + PaWinMmeDeviceInfo *winMmeDeviceInfo, UINT winMmeOutputDeviceId, int *success ) +{ + PaError result = paNoError; + char *deviceName; /* non-const ptr */ + MMRESULT mmresult; + WAVEOUTCAPS woc; + PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; + + *success = 0; + + mmresult = waveOutGetDevCaps( winMmeOutputDeviceId, &woc, sizeof( WAVEOUTCAPS ) ); + if( mmresult == MMSYSERR_NOMEM ) + { + result = paInsufficientMemory; + goto error; + } + else if( mmresult != MMSYSERR_NOERROR ) + { + /* instead of returning paUnanticipatedHostError we return + paNoError, but leave success set as 0. This allows + Pa_Initialize to just ignore this device, without failing + the entire initialisation process. + */ + return paNoError; + } + + if( winMmeOutputDeviceId == WAVE_MAPPER ) + { + /* Append I/O suffix to WAVE_MAPPER device. */ + deviceName = (char *)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, strlen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, woc.szPname ); + strcat( deviceName, constOutputMapperSuffix_ ); + } + else + { + deviceName = (char*)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, strlen( woc.szPname ) + 1 ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, woc.szPname ); + } + deviceInfo->name = deviceName; + + deviceInfo->maxOutputChannels = woc.wChannels; + /* Sometimes a device can return a rediculously large number of channels. + * This happened with an SBLive card on a Windows ME box. + * It also happens on Win XP! + */ + if( (deviceInfo->maxOutputChannels < 1) || (deviceInfo->maxOutputChannels > 256) ) + { + PA_DEBUG(("Pa_GetDeviceInfo: Num output channels reported as %d! Changed to 2.\n", deviceInfo->maxOutputChannels )); + deviceInfo->maxOutputChannels = 2; + } + + winMmeDeviceInfo->dwFormats = woc.dwFormats; + + DetectDefaultSampleRate( winMmeDeviceInfo, winMmeOutputDeviceId, + QueryOutputWaveFormatEx, deviceInfo->maxOutputChannels ); + + *success = 1; + +error: + return result; +} + + +static void GetDefaultLatencies( PaTime *defaultLowLatency, PaTime *defaultHighLatency ) +{ + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize = sizeof( osvi ); + GetVersionEx( &osvi ); + + /* Check for NT */ + if( (osvi.dwMajorVersion == 4) && (osvi.dwPlatformId == 2) ) + { + *defaultLowLatency = PA_MME_WIN_NT_DEFAULT_LATENCY_; + } + else if(osvi.dwMajorVersion >= 5) + { + *defaultLowLatency = PA_MME_WIN_WDM_DEFAULT_LATENCY_; + } + else + { + *defaultLowLatency = PA_MME_WIN_9X_DEFAULT_LATENCY_; + } + + *defaultHighLatency = *defaultLowLatency * 2; +} + + +PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i; + PaWinMmeHostApiRepresentation *winMmeHostApi; + int inputDeviceCount, outputDeviceCount, maximumPossibleDeviceCount; + PaWinMmeDeviceInfo *deviceInfoArray; + int deviceInfoInitializationSucceeded; + PaTime defaultLowLatency, defaultHighLatency; + + winMmeHostApi = (PaWinMmeHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinMmeHostApiRepresentation) ); + if( !winMmeHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + winMmeHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !winMmeHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + *hostApi = &winMmeHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paMME; + (*hostApi)->info.name = "MME"; + + + /* initialise device counts and default devices under the assumption that + there are no devices. These values are incremented below if and when + devices are successfully initialized. + */ + (*hostApi)->info.deviceCount = 0; + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + winMmeHostApi->inputDeviceCount = 0; + winMmeHostApi->outputDeviceCount = 0; + + + maximumPossibleDeviceCount = 0; + + inputDeviceCount = waveInGetNumDevs(); + if( inputDeviceCount > 0 ) + maximumPossibleDeviceCount += inputDeviceCount + 1; /* assume there is a WAVE_MAPPER */ + + outputDeviceCount = waveOutGetNumDevs(); + if( outputDeviceCount > 0 ) + maximumPossibleDeviceCount += outputDeviceCount + 1; /* assume there is a WAVE_MAPPER */ + + + if( maximumPossibleDeviceCount > 0 ){ + + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, sizeof(PaDeviceInfo*) * maximumPossibleDeviceCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaWinMmeDeviceInfo*)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, sizeof(PaWinMmeDeviceInfo) * maximumPossibleDeviceCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + winMmeHostApi->winMmeDeviceIds = (UINT*)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, sizeof(int) * maximumPossibleDeviceCount ); + if( !winMmeHostApi->winMmeDeviceIds ) + { + result = paInsufficientMemory; + goto error; + } + + GetDefaultLatencies( &defaultLowLatency, &defaultHighLatency ); + + if( inputDeviceCount > 0 ){ + /* -1 is the WAVE_MAPPER */ + for( i = -1; i < inputDeviceCount; ++i ){ + UINT winMmeDeviceId = (UINT)((i==-1) ? WAVE_MAPPER : i); + PaWinMmeDeviceInfo *wmmeDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ]; + PaDeviceInfo *deviceInfo = &wmmeDeviceInfo->inheritedDeviceInfo; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + deviceInfo->maxInputChannels = 0; + deviceInfo->maxOutputChannels = 0; + + deviceInfo->defaultLowInputLatency = defaultLowLatency; + deviceInfo->defaultLowOutputLatency = defaultLowLatency; + deviceInfo->defaultHighInputLatency = defaultHighLatency; + deviceInfo->defaultHighOutputLatency = defaultHighLatency; + + result = InitializeInputDeviceInfo( winMmeHostApi, wmmeDeviceInfo, + winMmeDeviceId, &deviceInfoInitializationSucceeded ); + if( result != paNoError ) + goto error; + + if( deviceInfoInitializationSucceeded ){ + if( (*hostApi)->info.defaultInputDevice == paNoDevice ) + (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; + + winMmeHostApi->winMmeDeviceIds[ (*hostApi)->info.deviceCount ] = winMmeDeviceId; + (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo; + + winMmeHostApi->inputDeviceCount++; + (*hostApi)->info.deviceCount++; + } + } + } + + if( outputDeviceCount > 0 ){ + /* -1 is the WAVE_MAPPER */ + for( i = -1; i < outputDeviceCount; ++i ){ + UINT winMmeDeviceId = (UINT)((i==-1) ? WAVE_MAPPER : i); + PaWinMmeDeviceInfo *wmmeDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ]; + PaDeviceInfo *deviceInfo = &wmmeDeviceInfo->inheritedDeviceInfo; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + deviceInfo->maxInputChannels = 0; + deviceInfo->maxOutputChannels = 0; + + deviceInfo->defaultLowInputLatency = defaultLowLatency; + deviceInfo->defaultLowOutputLatency = defaultLowLatency; + deviceInfo->defaultHighInputLatency = defaultHighLatency; + deviceInfo->defaultHighOutputLatency = defaultHighLatency; + + result = InitializeOutputDeviceInfo( winMmeHostApi, wmmeDeviceInfo, + winMmeDeviceId, &deviceInfoInitializationSucceeded ); + if( result != paNoError ) + goto error; + + if( deviceInfoInitializationSucceeded ){ + if( (*hostApi)->info.defaultOutputDevice == paNoDevice ) + (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount; + + winMmeHostApi->winMmeDeviceIds[ (*hostApi)->info.deviceCount ] = winMmeDeviceId; + (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo; + + winMmeHostApi->outputDeviceCount++; + (*hostApi)->info.deviceCount++; + } + } + } + } + + + InitializeDefaultDeviceIdsFromEnv( winMmeHostApi ); + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &winMmeHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &winMmeHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( winMmeHostApi ) + { + if( winMmeHostApi->allocations ) + { + PaUtil_FreeAllAllocations( winMmeHostApi->allocations ); + PaUtil_DestroyAllocationGroup( winMmeHostApi->allocations ); + } + + PaUtil_FreeMemory( winMmeHostApi ); + } + + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaWinMmeHostApiRepresentation *winMmeHostApi = (PaWinMmeHostApiRepresentation*)hostApi; + + if( winMmeHostApi->allocations ) + { + PaUtil_FreeAllAllocations( winMmeHostApi->allocations ); + PaUtil_DestroyAllocationGroup( winMmeHostApi->allocations ); + } + + PaUtil_FreeMemory( winMmeHostApi ); +} + + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaWinMmeHostApiRepresentation *winMmeHostApi = (PaWinMmeHostApiRepresentation*)hostApi; + PaDeviceInfo *inputDeviceInfo, *outputDeviceInfo; + int inputChannelCount, outputChannelCount; + int inputMultipleDeviceChannelCount, outputMultipleDeviceChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaWinMmeStreamInfo *inputStreamInfo, *outputStreamInfo; + UINT winMmeInputDeviceId, winMmeOutputDeviceId; + unsigned int i; + PaError paerror; + + /* The calls to QueryFormatSupported below are intended to detect invalid + sample rates. If we assume that the channel count and format are OK, + then the only thing that could fail is the sample rate. This isn't + strictly true, but I can't think of a better way to test that the + sample rate is valid. + */ + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + inputStreamInfo = inputParameters->hostApiSpecificStreamInfo; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification + && inputStreamInfo && (inputStreamInfo->flags & paWinMmeUseMultipleDevices) ) + { + inputMultipleDeviceChannelCount = 0; + for( i=0; i< inputStreamInfo->deviceCount; ++i ) + { + inputMultipleDeviceChannelCount += inputStreamInfo->devices[i].channelCount; + + inputDeviceInfo = hostApi->deviceInfos[ inputStreamInfo->devices[i].device ]; + + /* check that input device can support inputChannelCount */ + if( inputStreamInfo->devices[i].channelCount <= 0 + || inputStreamInfo->devices[i].channelCount > inputDeviceInfo->maxInputChannels ) + return paInvalidChannelCount; + + /* test for valid sample rate, see comment above */ + winMmeInputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, inputStreamInfo->devices[i].device ); + paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, winMmeInputDeviceId, inputStreamInfo->devices[i].channelCount, sampleRate ); + if( paerror != paNoError ) + return paInvalidSampleRate; + } + + if( inputMultipleDeviceChannelCount != inputChannelCount ) + return paIncompatibleHostApiSpecificStreamInfo; + } + else + { + if( inputStreamInfo && (inputStreamInfo->flags & paWinMmeUseMultipleDevices) ) + return paIncompatibleHostApiSpecificStreamInfo; /* paUseHostApiSpecificDeviceSpecification was not supplied as the input device */ + + inputDeviceInfo = hostApi->deviceInfos[ inputParameters->device ]; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > inputDeviceInfo->maxInputChannels ) + return paInvalidChannelCount; + + /* test for valid sample rate, see comment above */ + winMmeInputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, inputParameters->device ); + paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, winMmeInputDeviceId, inputChannelCount, sampleRate ); + if( paerror != paNoError ) + return paInvalidSampleRate; + } + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + outputStreamInfo = outputParameters->hostApiSpecificStreamInfo; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification + && outputStreamInfo && (outputStreamInfo->flags & paWinMmeUseMultipleDevices) ) + { + outputMultipleDeviceChannelCount = 0; + for( i=0; i< outputStreamInfo->deviceCount; ++i ) + { + outputMultipleDeviceChannelCount += outputStreamInfo->devices[i].channelCount; + + outputDeviceInfo = hostApi->deviceInfos[ outputStreamInfo->devices[i].device ]; + + /* check that output device can support outputChannelCount */ + if( outputStreamInfo->devices[i].channelCount <= 0 + || outputStreamInfo->devices[i].channelCount > outputDeviceInfo->maxOutputChannels ) + return paInvalidChannelCount; + + /* test for valid sample rate, see comment above */ + winMmeOutputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, outputStreamInfo->devices[i].device ); + paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, winMmeOutputDeviceId, outputStreamInfo->devices[i].channelCount, sampleRate ); + if( paerror != paNoError ) + return paInvalidSampleRate; + } + + if( outputMultipleDeviceChannelCount != outputChannelCount ) + return paIncompatibleHostApiSpecificStreamInfo; + } + else + { + if( outputStreamInfo && (outputStreamInfo->flags & paWinMmeUseMultipleDevices) ) + return paIncompatibleHostApiSpecificStreamInfo; /* paUseHostApiSpecificDeviceSpecification was not supplied as the output device */ + + outputDeviceInfo = hostApi->deviceInfos[ outputParameters->device ]; + + /* check that output device can support outputChannelCount */ + if( outputChannelCount > outputDeviceInfo->maxOutputChannels ) + return paInvalidChannelCount; + + /* test for valid sample rate, see comment above */ + winMmeOutputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, outputParameters->device ); + paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, winMmeOutputDeviceId, outputChannelCount, sampleRate ); + if( paerror != paNoError ) + return paInvalidSampleRate; + } + } + + /* + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + for mme all we can do is test that the input and output devices + support the requested sample rate and number of channels. we + cannot test for full duplex compatibility. + */ + + return paFormatIsSupported; +} + + + +static void SelectBufferSizeAndCount( unsigned long baseBufferSize, + unsigned long requestedLatency, + unsigned long baseBufferCount, unsigned long minimumBufferCount, + unsigned long maximumBufferSize, unsigned long *hostBufferSize, + unsigned long *hostBufferCount ) +{ + unsigned long sizeMultiplier, bufferCount, latency; + unsigned long nextLatency, nextBufferSize; + int baseBufferSizeIsPowerOfTwo; + + sizeMultiplier = 1; + bufferCount = baseBufferCount; + + /* count-1 below because latency is always determined by one less + than the total number of buffers. + */ + latency = (baseBufferSize * sizeMultiplier) * (bufferCount-1); + + if( latency > requestedLatency ) + { + + /* reduce number of buffers without falling below suggested latency */ + + nextLatency = (baseBufferSize * sizeMultiplier) * (bufferCount-2); + while( bufferCount > minimumBufferCount && nextLatency >= requestedLatency ) + { + --bufferCount; + nextLatency = (baseBufferSize * sizeMultiplier) * (bufferCount-2); + } + + }else if( latency < requestedLatency ){ + + baseBufferSizeIsPowerOfTwo = (! (baseBufferSize & (baseBufferSize - 1))); + if( baseBufferSizeIsPowerOfTwo ){ + + /* double size of buffers without exceeding requestedLatency */ + + nextBufferSize = (baseBufferSize * (sizeMultiplier*2)); + nextLatency = nextBufferSize * (bufferCount-1); + while( nextBufferSize <= maximumBufferSize + && nextLatency < requestedLatency ) + { + sizeMultiplier *= 2; + nextBufferSize = (baseBufferSize * (sizeMultiplier*2)); + nextLatency = nextBufferSize * (bufferCount-1); + } + + }else{ + + /* increase size of buffers upto first excess of requestedLatency */ + + nextBufferSize = (baseBufferSize * (sizeMultiplier+1)); + nextLatency = nextBufferSize * (bufferCount-1); + while( nextBufferSize <= maximumBufferSize + && nextLatency < requestedLatency ) + { + ++sizeMultiplier; + nextBufferSize = (baseBufferSize * (sizeMultiplier+1)); + nextLatency = nextBufferSize * (bufferCount-1); + } + + if( nextLatency < requestedLatency ) + ++sizeMultiplier; + } + + /* increase number of buffers until requestedLatency is reached */ + + latency = (baseBufferSize * sizeMultiplier) * (bufferCount-1); + while( latency < requestedLatency ) + { + ++bufferCount; + latency = (baseBufferSize * sizeMultiplier) * (bufferCount-1); + } + } + + *hostBufferSize = baseBufferSize * sizeMultiplier; + *hostBufferCount = bufferCount; +} + + +static void ReselectBufferCount( unsigned long bufferSize, + unsigned long requestedLatency, + unsigned long baseBufferCount, unsigned long minimumBufferCount, + unsigned long *hostBufferCount ) +{ + unsigned long bufferCount, latency; + unsigned long nextLatency; + + bufferCount = baseBufferCount; + + /* count-1 below because latency is always determined by one less + than the total number of buffers. + */ + latency = bufferSize * (bufferCount-1); + + if( latency > requestedLatency ) + { + /* reduce number of buffers without falling below suggested latency */ + + nextLatency = bufferSize * (bufferCount-2); + while( bufferCount > minimumBufferCount && nextLatency >= requestedLatency ) + { + --bufferCount; + nextLatency = bufferSize * (bufferCount-2); + } + + }else if( latency < requestedLatency ){ + + /* increase number of buffers until requestedLatency is reached */ + + latency = bufferSize * (bufferCount-1); + while( latency < requestedLatency ) + { + ++bufferCount; + latency = bufferSize * (bufferCount-1); + } + } + + *hostBufferCount = bufferCount; +} + + +/* CalculateBufferSettings() fills the framesPerHostInputBuffer, hostInputBufferCount, + framesPerHostOutputBuffer and hostOutputBufferCount parameters based on the values + of the other parameters. +*/ + +static PaError CalculateBufferSettings( + unsigned long *framesPerHostInputBuffer, unsigned long *hostInputBufferCount, + unsigned long *framesPerHostOutputBuffer, unsigned long *hostOutputBufferCount, + int inputChannelCount, PaSampleFormat hostInputSampleFormat, + PaTime suggestedInputLatency, PaWinMmeStreamInfo *inputStreamInfo, + int outputChannelCount, PaSampleFormat hostOutputSampleFormat, + PaTime suggestedOutputLatency, PaWinMmeStreamInfo *outputStreamInfo, + double sampleRate, unsigned long framesPerBuffer ) +{ + PaError result = paNoError; + int effectiveInputChannelCount, effectiveOutputChannelCount; + int hostInputFrameSize = 0; + unsigned int i; + + if( inputChannelCount > 0 ) + { + int hostInputSampleSize = Pa_GetSampleSize( hostInputSampleFormat ); + if( hostInputSampleSize < 0 ) + { + result = hostInputSampleSize; + goto error; + } + + if( inputStreamInfo + && ( inputStreamInfo->flags & paWinMmeUseMultipleDevices ) ) + { + /* set effectiveInputChannelCount to the largest number of + channels on any one device. + */ + effectiveInputChannelCount = 0; + for( i=0; i< inputStreamInfo->deviceCount; ++i ) + { + if( inputStreamInfo->devices[i].channelCount > effectiveInputChannelCount ) + effectiveInputChannelCount = inputStreamInfo->devices[i].channelCount; + } + } + else + { + effectiveInputChannelCount = inputChannelCount; + } + + hostInputFrameSize = hostInputSampleSize * effectiveInputChannelCount; + + if( inputStreamInfo + && ( inputStreamInfo->flags & paWinMmeUseLowLevelLatencyParameters ) ) + { + if( inputStreamInfo->bufferCount <= 0 + || inputStreamInfo->framesPerBuffer <= 0 ) + { + result = paIncompatibleHostApiSpecificStreamInfo; + goto error; + } + + *framesPerHostInputBuffer = inputStreamInfo->framesPerBuffer; + *hostInputBufferCount = inputStreamInfo->bufferCount; + } + else + { + unsigned long hostBufferSizeBytes, hostBufferCount; + unsigned long minimumBufferCount = (outputChannelCount > 0) + ? PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_ + : PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_HALF_DUPLEX_; + + unsigned long maximumBufferSize = (long) ((PA_MME_MAX_HOST_BUFFER_SECS_ * sampleRate) * hostInputFrameSize); + if( maximumBufferSize > PA_MME_MAX_HOST_BUFFER_BYTES_ ) + maximumBufferSize = PA_MME_MAX_HOST_BUFFER_BYTES_; + + /* compute the following in bytes, then convert back to frames */ + + SelectBufferSizeAndCount( + ((framesPerBuffer == paFramesPerBufferUnspecified) + ? PA_MME_MIN_HOST_BUFFER_FRAMES_WHEN_UNSPECIFIED_ + : framesPerBuffer ) * hostInputFrameSize, /* baseBufferSize */ + ((unsigned long)(suggestedInputLatency * sampleRate)) * hostInputFrameSize, /* suggestedLatency */ + 4, /* baseBufferCount */ + minimumBufferCount, maximumBufferSize, + &hostBufferSizeBytes, &hostBufferCount ); + + *framesPerHostInputBuffer = hostBufferSizeBytes / hostInputFrameSize; + *hostInputBufferCount = hostBufferCount; + } + } + else + { + *framesPerHostInputBuffer = 0; + *hostInputBufferCount = 0; + } + + if( outputChannelCount > 0 ) + { + if( outputStreamInfo + && ( outputStreamInfo->flags & paWinMmeUseLowLevelLatencyParameters ) ) + { + if( outputStreamInfo->bufferCount <= 0 + || outputStreamInfo->framesPerBuffer <= 0 ) + { + result = paIncompatibleHostApiSpecificStreamInfo; + goto error; + } + + *framesPerHostOutputBuffer = outputStreamInfo->framesPerBuffer; + *hostOutputBufferCount = outputStreamInfo->bufferCount; + + + if( inputChannelCount > 0 ) /* full duplex */ + { + if( *framesPerHostInputBuffer != *framesPerHostOutputBuffer ) + { + if( inputStreamInfo + && ( inputStreamInfo->flags & paWinMmeUseLowLevelLatencyParameters ) ) + { + /* a custom StreamInfo was used for specifying both input + and output buffer sizes, the larger buffer size + must be a multiple of the smaller buffer size */ + + if( *framesPerHostInputBuffer < *framesPerHostOutputBuffer ) + { + if( *framesPerHostOutputBuffer % *framesPerHostInputBuffer != 0 ) + { + result = paIncompatibleHostApiSpecificStreamInfo; + goto error; + } + } + else + { + assert( *framesPerHostInputBuffer > *framesPerHostOutputBuffer ); + if( *framesPerHostInputBuffer % *framesPerHostOutputBuffer != 0 ) + { + result = paIncompatibleHostApiSpecificStreamInfo; + goto error; + } + } + } + else + { + /* a custom StreamInfo was not used for specifying the input buffer size, + so use the output buffer size, and approximately the same latency. */ + + *framesPerHostInputBuffer = *framesPerHostOutputBuffer; + *hostInputBufferCount = (((unsigned long)(suggestedInputLatency * sampleRate)) / *framesPerHostInputBuffer) + 1; + + if( *hostInputBufferCount < PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_ ) + *hostInputBufferCount = PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_; + } + } + } + } + else + { + unsigned long hostBufferSizeBytes, hostBufferCount; + unsigned long minimumBufferCount = PA_MME_MIN_HOST_OUTPUT_BUFFER_COUNT_; + unsigned long maximumBufferSize; + int hostOutputFrameSize; + int hostOutputSampleSize; + + hostOutputSampleSize = Pa_GetSampleSize( hostOutputSampleFormat ); + if( hostOutputSampleSize < 0 ) + { + result = hostOutputSampleSize; + goto error; + } + + if( outputStreamInfo + && ( outputStreamInfo->flags & paWinMmeUseMultipleDevices ) ) + { + /* set effectiveOutputChannelCount to the largest number of + channels on any one device. + */ + effectiveOutputChannelCount = 0; + for( i=0; i< outputStreamInfo->deviceCount; ++i ) + { + if( outputStreamInfo->devices[i].channelCount > effectiveOutputChannelCount ) + effectiveOutputChannelCount = outputStreamInfo->devices[i].channelCount; + } + } + else + { + effectiveOutputChannelCount = outputChannelCount; + } + + hostOutputFrameSize = hostOutputSampleSize * effectiveOutputChannelCount; + + maximumBufferSize = (long) ((PA_MME_MAX_HOST_BUFFER_SECS_ * sampleRate) * hostOutputFrameSize); + if( maximumBufferSize > PA_MME_MAX_HOST_BUFFER_BYTES_ ) + maximumBufferSize = PA_MME_MAX_HOST_BUFFER_BYTES_; + + + /* compute the following in bytes, then convert back to frames */ + + SelectBufferSizeAndCount( + ((framesPerBuffer == paFramesPerBufferUnspecified) + ? PA_MME_MIN_HOST_BUFFER_FRAMES_WHEN_UNSPECIFIED_ + : framesPerBuffer ) * hostOutputFrameSize, /* baseBufferSize */ + ((unsigned long)(suggestedOutputLatency * sampleRate)) * hostOutputFrameSize, /* suggestedLatency */ + 4, /* baseBufferCount */ + minimumBufferCount, + maximumBufferSize, + &hostBufferSizeBytes, &hostBufferCount ); + + *framesPerHostOutputBuffer = hostBufferSizeBytes / hostOutputFrameSize; + *hostOutputBufferCount = hostBufferCount; + + + if( inputChannelCount > 0 ) + { + /* ensure that both input and output buffer sizes are the same. + if they don't match at this stage, choose the smallest one + and use that for input and output + */ + + if( *framesPerHostOutputBuffer != *framesPerHostInputBuffer ) + { + if( framesPerHostInputBuffer < framesPerHostOutputBuffer ) + { + unsigned long framesPerHostBuffer = *framesPerHostInputBuffer; + + minimumBufferCount = PA_MME_MIN_HOST_OUTPUT_BUFFER_COUNT_; + ReselectBufferCount( + framesPerHostBuffer * hostOutputFrameSize, /* bufferSize */ + ((unsigned long)(suggestedOutputLatency * sampleRate)) * hostOutputFrameSize, /* suggestedLatency */ + 4, /* baseBufferCount */ + minimumBufferCount, + &hostBufferCount ); + + *framesPerHostOutputBuffer = framesPerHostBuffer; + *hostOutputBufferCount = hostBufferCount; + } + else + { + unsigned long framesPerHostBuffer = *framesPerHostOutputBuffer; + + minimumBufferCount = PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_; + ReselectBufferCount( + framesPerHostBuffer * hostInputFrameSize, /* bufferSize */ + ((unsigned long)(suggestedInputLatency * sampleRate)) * hostInputFrameSize, /* suggestedLatency */ + 4, /* baseBufferCount */ + minimumBufferCount, + &hostBufferCount ); + + *framesPerHostInputBuffer = framesPerHostBuffer; + *hostInputBufferCount = hostBufferCount; + } + } + } + } + } + else + { + *framesPerHostOutputBuffer = 0; + *hostOutputBufferCount = 0; + } + +error: + return result; +} + + +typedef struct +{ + HANDLE bufferEvent; + void *waveHandles; + unsigned int deviceCount; + /* unsigned int channelCount; */ + WAVEHDR **waveHeaders; /* waveHeaders[device][buffer] */ + unsigned int bufferCount; + unsigned int currentBufferIndex; + unsigned int framesPerBuffer; + unsigned int framesUsedInCurrentBuffer; +}PaWinMmeSingleDirectionHandlesAndBuffers; + +/* prototypes for functions operating on PaWinMmeSingleDirectionHandlesAndBuffers */ + +static void InitializeSingleDirectionHandlesAndBuffers( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ); +static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostApi, + PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long bytesPerHostSample, + double sampleRate, PaWinMmeDeviceAndChannelCount *devices, + unsigned int deviceCount, int isInput ); +static PaError TerminateWaveHandles( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, int isInput, int currentlyProcessingAnError ); +static PaError InitializeWaveHeaders( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long hostBufferCount, + PaSampleFormat hostSampleFormat, + unsigned long framesPerHostBuffer, + PaWinMmeDeviceAndChannelCount *devices, + int isInput ); +static void TerminateWaveHeaders( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, int isInput ); + + +static void InitializeSingleDirectionHandlesAndBuffers( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ) +{ + handlesAndBuffers->bufferEvent = 0; + handlesAndBuffers->waveHandles = 0; + handlesAndBuffers->deviceCount = 0; + handlesAndBuffers->waveHeaders = 0; + handlesAndBuffers->bufferCount = 0; +} + +static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostApi, + PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long bytesPerHostSample, + double sampleRate, PaWinMmeDeviceAndChannelCount *devices, + unsigned int deviceCount, int isInput ) +{ + PaError result; + MMRESULT mmresult; + unsigned long bytesPerFrame; + WAVEFORMATEX wfx; + signed int i; + + /* for error cleanup we expect that InitializeSingleDirectionHandlesAndBuffers() + has already been called to zero some fields */ + + result = CreateEventWithPaError( &handlesAndBuffers->bufferEvent, NULL, FALSE, FALSE, NULL ); + if( result != paNoError ) goto error; + + if( isInput ) + handlesAndBuffers->waveHandles = (void*)PaUtil_AllocateMemory( sizeof(HWAVEIN) * deviceCount ); + else + handlesAndBuffers->waveHandles = (void*)PaUtil_AllocateMemory( sizeof(HWAVEOUT) * deviceCount ); + if( !handlesAndBuffers->waveHandles ) + { + result = paInsufficientMemory; + goto error; + } + + handlesAndBuffers->deviceCount = deviceCount; + + for( i = 0; i < (signed int)deviceCount; ++i ) + { + if( isInput ) + ((HWAVEIN*)handlesAndBuffers->waveHandles)[i] = 0; + else + ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i] = 0; + } + + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nSamplesPerSec = (DWORD) sampleRate; + wfx.cbSize = 0; + + for( i = 0; i < (signed int)deviceCount; ++i ) + { + UINT winMmeDeviceId; + + winMmeDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, devices[i].device ); + wfx.nChannels = (WORD)devices[i].channelCount; + + bytesPerFrame = wfx.nChannels * bytesPerHostSample; + + wfx.nAvgBytesPerSec = (DWORD)(bytesPerFrame * sampleRate); + wfx.nBlockAlign = (WORD)bytesPerFrame; + wfx.wBitsPerSample = (WORD)((bytesPerFrame/wfx.nChannels) * 8); + + /* REVIEW: consider not firing an event for input when a full duplex + stream is being used. this would probably depend on the + neverDropInput flag. */ + + if( isInput ) + mmresult = waveInOpen( &((HWAVEIN*)handlesAndBuffers->waveHandles)[i], winMmeDeviceId, &wfx, + (DWORD)handlesAndBuffers->bufferEvent, (DWORD)0, CALLBACK_EVENT ); + else + mmresult = waveOutOpen( &((HWAVEOUT*)handlesAndBuffers->waveHandles)[i], winMmeDeviceId, &wfx, + (DWORD)handlesAndBuffers->bufferEvent, (DWORD)0, CALLBACK_EVENT ); + + if( mmresult != MMSYSERR_NOERROR ) + { + switch( mmresult ) + { + case MMSYSERR_ALLOCATED: /* Specified resource is already allocated. */ + result = paDeviceUnavailable; + break; + case MMSYSERR_NODRIVER: /* No device driver is present. */ + result = paDeviceUnavailable; + break; + case MMSYSERR_NOMEM: /* Unable to allocate or lock memory. */ + result = paInsufficientMemory; + break; + + case MMSYSERR_BADDEVICEID: /* Specified device identifier is out of range. */ + /* falls through */ + case WAVERR_BADFORMAT: /* Attempted to open with an unsupported waveform-audio format. */ + /* falls through */ + default: + result = paUnanticipatedHostError; + if( isInput ) + { + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + } + else + { + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + } + } + goto error; + } + } + + return result; + +error: + TerminateWaveHandles( handlesAndBuffers, isInput, 1 /* currentlyProcessingAnError */ ); + + return result; +} + + +static PaError TerminateWaveHandles( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, int isInput, int currentlyProcessingAnError ) +{ + PaError result = paNoError; + MMRESULT mmresult; + signed int i; + + if( handlesAndBuffers->waveHandles ) + { + for( i = handlesAndBuffers->deviceCount-1; i >= 0; --i ) + { + if( isInput ) + { + if( ((HWAVEIN*)handlesAndBuffers->waveHandles)[i] ) + mmresult = waveInClose( ((HWAVEIN*)handlesAndBuffers->waveHandles)[i] ); + } + else + { + if( ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i] ) + mmresult = waveOutClose( ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i] ); + } + + if( mmresult != MMSYSERR_NOERROR && + !currentlyProcessingAnError ) /* don't update the error state if we're already processing an error */ + { + result = paUnanticipatedHostError; + if( isInput ) + { + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + } + else + { + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + } + /* note that we don't break here, we try to continue closing devices */ + } + } + + PaUtil_FreeMemory( handlesAndBuffers->waveHandles ); + handlesAndBuffers->waveHandles = 0; + } + + if( handlesAndBuffers->bufferEvent ) + { + result = CloseHandleWithPaError( handlesAndBuffers->bufferEvent ); + handlesAndBuffers->bufferEvent = 0; + } + + return result; +} + + +static PaError InitializeWaveHeaders( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long hostBufferCount, + PaSampleFormat hostSampleFormat, + unsigned long framesPerHostBuffer, + PaWinMmeDeviceAndChannelCount *devices, + int isInput ) +{ + PaError result = paNoError; + MMRESULT mmresult; + WAVEHDR *deviceWaveHeaders; + signed int i, j; + + /* for error cleanup we expect that InitializeSingleDirectionHandlesAndBuffers() + has already been called to zero some fields */ + + + /* allocate an array of pointers to arrays of wave headers, one array of + wave headers per device */ + handlesAndBuffers->waveHeaders = (WAVEHDR**)PaUtil_AllocateMemory( sizeof(WAVEHDR*) * handlesAndBuffers->deviceCount ); + if( !handlesAndBuffers->waveHeaders ) + { + result = paInsufficientMemory; + goto error; + } + + for( i = 0; i < (signed int)handlesAndBuffers->deviceCount; ++i ) + handlesAndBuffers->waveHeaders[i] = 0; + + handlesAndBuffers->bufferCount = hostBufferCount; + + for( i = 0; i < (signed int)handlesAndBuffers->deviceCount; ++i ) + { + int bufferBytes = Pa_GetSampleSize( hostSampleFormat ) * + framesPerHostBuffer * devices[i].channelCount; + if( bufferBytes < 0 ) + { + result = paInternalError; + goto error; + } + + /* Allocate an array of wave headers for device i */ + deviceWaveHeaders = (WAVEHDR *) PaUtil_AllocateMemory( sizeof(WAVEHDR)*hostBufferCount ); + if( !deviceWaveHeaders ) + { + result = paInsufficientMemory; + goto error; + } + + for( j=0; j < (signed int)hostBufferCount; ++j ) + deviceWaveHeaders[j].lpData = 0; + + handlesAndBuffers->waveHeaders[i] = deviceWaveHeaders; + + /* Allocate a buffer for each wave header */ + for( j=0; j < (signed int)hostBufferCount; ++j ) + { + deviceWaveHeaders[j].lpData = (char *)PaUtil_AllocateMemory( bufferBytes ); + if( !deviceWaveHeaders[j].lpData ) + { + result = paInsufficientMemory; + goto error; + } + deviceWaveHeaders[j].dwBufferLength = bufferBytes; + deviceWaveHeaders[j].dwUser = 0xFFFFFFFF; /* indicates that *PrepareHeader() has not yet been called, for error clean up code */ + + if( isInput ) + { + mmresult = waveInPrepareHeader( ((HWAVEIN*)handlesAndBuffers->waveHandles)[i], &deviceWaveHeaders[j], sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + goto error; + } + } + else /* output */ + { + mmresult = waveOutPrepareHeader( ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i], &deviceWaveHeaders[j], sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + goto error; + } + } + deviceWaveHeaders[j].dwUser = devices[i].channelCount; + } + } + + return result; + +error: + TerminateWaveHeaders( handlesAndBuffers, isInput ); + + return result; +} + + +static void TerminateWaveHeaders( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, int isInput ) +{ + signed int i, j; + WAVEHDR *deviceWaveHeaders; + + if( handlesAndBuffers->waveHeaders ) + { + for( i = handlesAndBuffers->deviceCount-1; i >= 0 ; --i ) + { + deviceWaveHeaders = handlesAndBuffers->waveHeaders[i]; /* wave headers for device i */ + if( deviceWaveHeaders ) + { + for( j = handlesAndBuffers->bufferCount-1; j >= 0; --j ) + { + if( deviceWaveHeaders[j].lpData ) + { + if( deviceWaveHeaders[j].dwUser != 0xFFFFFFFF ) + { + if( isInput ) + waveInUnprepareHeader( ((HWAVEIN*)handlesAndBuffers->waveHandles)[i], &deviceWaveHeaders[j], sizeof(WAVEHDR) ); + else + waveOutUnprepareHeader( ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i], &deviceWaveHeaders[j], sizeof(WAVEHDR) ); + } + + PaUtil_FreeMemory( deviceWaveHeaders[j].lpData ); + } + } + + PaUtil_FreeMemory( deviceWaveHeaders ); + } + } + + PaUtil_FreeMemory( handlesAndBuffers->waveHeaders ); + handlesAndBuffers->waveHeaders = 0; + } +} + + + +/* PaWinMmeStream - a stream data structure specifically for this implementation */ +/* note that struct PaWinMmeStream is typedeffed to PaWinMmeStream above. */ +struct PaWinMmeStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + int primeStreamUsingCallback; + + PaWinMmeSingleDirectionHandlesAndBuffers input; + PaWinMmeSingleDirectionHandlesAndBuffers output; + + /* Processing thread management -------------- */ + HANDLE abortEvent; + HANDLE processingThread; + DWORD processingThreadId; + + char throttleProcessingThreadOnOverload; /* 0 -> don't throtte, non-0 -> throttle */ + int processingThreadPriority; + int highThreadPriority; + int throttledThreadPriority; + unsigned long throttledSleepMsecs; + + int isStopped; + volatile int isActive; + volatile int stopProcessing; /* stop thread once existing buffers have been returned */ + volatile int abortProcessing; /* stop thread immediately */ + + DWORD allBuffersDurationMs; /* used to calculate timeouts */ +}; + +/* updates deviceCount if PaWinMmeUseMultipleDevices is used */ + +static PaError ValidateWinMmeSpecificStreamInfo( + const PaStreamParameters *streamParameters, + const PaWinMmeStreamInfo *streamInfo, + char *throttleProcessingThreadOnOverload, + unsigned long *deviceCount ) +{ + if( streamInfo ) + { + if( streamInfo->size != sizeof( PaWinMmeStreamInfo ) + || streamInfo->version != 1 ) + { + return paIncompatibleHostApiSpecificStreamInfo; + } + + if( streamInfo->flags & paWinMmeDontThrottleOverloadedProcessingThread ) + *throttleProcessingThreadOnOverload = 0; + + if( streamInfo->flags & paWinMmeUseMultipleDevices ) + { + if( streamParameters->device != paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + *deviceCount = streamInfo->deviceCount; + } + } + + return paNoError; +} + +static PaError RetrieveDevicesFromStreamParameters( + struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *streamParameters, + const PaWinMmeStreamInfo *streamInfo, + PaWinMmeDeviceAndChannelCount *devices, + unsigned long deviceCount ) +{ + PaError result = paNoError; + unsigned int i; + int totalChannelCount; + PaDeviceIndex hostApiDevice; + + if( streamInfo && streamInfo->flags & paWinMmeUseMultipleDevices ) + { + totalChannelCount = 0; + for( i=0; i < deviceCount; ++i ) + { + /* validate that the device number is within range */ + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, + streamInfo->devices[i].device, hostApi ); + if( result != paNoError ) + return result; + + devices[i].device = hostApiDevice; + devices[i].channelCount = streamInfo->devices[i].channelCount; + + totalChannelCount += devices[i].channelCount; + } + + if( totalChannelCount != streamParameters->channelCount ) + { + /* channelCount must match total channels specified by multiple devices */ + return paInvalidChannelCount; /* REVIEW use of this error code */ + } + } + else + { + devices[0].device = streamParameters->device; + devices[0].channelCount = streamParameters->channelCount; + } + + return result; +} + +static PaError ValidateInputChannelCounts( + struct PaUtilHostApiRepresentation *hostApi, + PaWinMmeDeviceAndChannelCount *devices, + unsigned long deviceCount ) +{ + unsigned int i; + + for( i=0; i < deviceCount; ++i ) + { + if( devices[i].channelCount < 1 || devices[i].channelCount + > hostApi->deviceInfos[ devices[i].device ]->maxInputChannels ) + return paInvalidChannelCount; + } + + return paNoError; +} + +static PaError ValidateOutputChannelCounts( + struct PaUtilHostApiRepresentation *hostApi, + PaWinMmeDeviceAndChannelCount *devices, + unsigned long deviceCount ) +{ + unsigned int i; + + for( i=0; i < deviceCount; ++i ) + { + if( devices[i].channelCount < 1 || devices[i].channelCount + > hostApi->deviceInfos[ devices[i].device ]->maxOutputChannels ) + return paInvalidChannelCount; + } + + return paNoError; +} + + +/* the following macros are intended to improve the readability of the following code */ +#define PA_IS_INPUT_STREAM_( stream ) ( stream ->input.waveHandles ) +#define PA_IS_OUTPUT_STREAM_( stream ) ( stream ->output.waveHandles ) +#define PA_IS_FULL_DUPLEX_STREAM_( stream ) ( stream ->input.waveHandles && stream ->output.waveHandles ) +#define PA_IS_HALF_DUPLEX_STREAM_( stream ) ( !(stream ->input.waveHandles && stream ->output.waveHandles) ) + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result; + PaWinMmeHostApiRepresentation *winMmeHostApi = (PaWinMmeHostApiRepresentation*)hostApi; + PaWinMmeStream *stream = 0; + int bufferProcessorIsInitialized = 0; + int streamRepresentationIsInitialized = 0; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + double suggestedInputLatency, suggestedOutputLatency; + PaWinMmeStreamInfo *inputStreamInfo, *outputStreamInfo; + unsigned long framesPerHostInputBuffer; + unsigned long hostInputBufferCount; + unsigned long framesPerHostOutputBuffer; + unsigned long hostOutputBufferCount; + unsigned long framesPerBufferProcessorCall; + PaWinMmeDeviceAndChannelCount *inputDevices = 0; /* contains all devices and channel counts as local host api ids, even when PaWinMmeUseMultipleDevices is not used */ + unsigned long inputDeviceCount = 0; + PaWinMmeDeviceAndChannelCount *outputDevices = 0; + unsigned long outputDeviceCount = 0; /* contains all devices and channel counts as local host api ids, even when PaWinMmeUseMultipleDevices is not used */ + char throttleProcessingThreadOnOverload = 1; + + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + suggestedInputLatency = inputParameters->suggestedLatency; + + inputDeviceCount = 1; + + /* validate input hostApiSpecificStreamInfo */ + inputStreamInfo = (PaWinMmeStreamInfo*)inputParameters->hostApiSpecificStreamInfo; + result = ValidateWinMmeSpecificStreamInfo( inputParameters, inputStreamInfo, + &throttleProcessingThreadOnOverload, + &inputDeviceCount ); + if( result != paNoError ) return result; + + inputDevices = (PaWinMmeDeviceAndChannelCount*)alloca( sizeof(PaWinMmeDeviceAndChannelCount) * inputDeviceCount ); + if( !inputDevices ) return paInsufficientMemory; + + result = RetrieveDevicesFromStreamParameters( hostApi, inputParameters, inputStreamInfo, inputDevices, inputDeviceCount ); + if( result != paNoError ) return result; + + result = ValidateInputChannelCounts( hostApi, inputDevices, inputDeviceCount ); + if( result != paNoError ) return result; + + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, inputSampleFormat ); + } + else + { + inputChannelCount = 0; + inputSampleFormat = 0; + suggestedInputLatency = 0.; + inputStreamInfo = 0; + hostInputSampleFormat = 0; + } + + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + suggestedOutputLatency = outputParameters->suggestedLatency; + + outputDeviceCount = 1; + + /* validate output hostApiSpecificStreamInfo */ + outputStreamInfo = (PaWinMmeStreamInfo*)outputParameters->hostApiSpecificStreamInfo; + result = ValidateWinMmeSpecificStreamInfo( outputParameters, outputStreamInfo, + &throttleProcessingThreadOnOverload, + &outputDeviceCount ); + if( result != paNoError ) return result; + + outputDevices = (PaWinMmeDeviceAndChannelCount*)alloca( sizeof(PaWinMmeDeviceAndChannelCount) * outputDeviceCount ); + if( !outputDevices ) return paInsufficientMemory; + + result = RetrieveDevicesFromStreamParameters( hostApi, outputParameters, outputStreamInfo, outputDevices, outputDeviceCount ); + if( result != paNoError ) return result; + + result = ValidateOutputChannelCounts( hostApi, outputDevices, outputDeviceCount ); + if( result != paNoError ) return result; + + hostOutputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, outputSampleFormat ); + } + else + { + outputChannelCount = 0; + outputSampleFormat = 0; + outputStreamInfo = 0; + hostOutputSampleFormat = 0; + suggestedOutputLatency = 0.; + } + + + /* + IMPLEMENT ME: + - alter sampleRate to a close allowable rate if possible / necessary + */ + + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + + result = CalculateBufferSettings( &framesPerHostInputBuffer, &hostInputBufferCount, + &framesPerHostOutputBuffer, &hostOutputBufferCount, + inputChannelCount, hostInputSampleFormat, suggestedInputLatency, inputStreamInfo, + outputChannelCount, hostOutputSampleFormat, suggestedOutputLatency, outputStreamInfo, + sampleRate, framesPerBuffer ); + if( result != paNoError ) goto error; + + + stream = (PaWinMmeStream*)PaUtil_AllocateMemory( sizeof(PaWinMmeStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + + InitializeSingleDirectionHandlesAndBuffers( &stream->input ); + InitializeSingleDirectionHandlesAndBuffers( &stream->output ); + + stream->abortEvent = 0; + stream->processingThread = 0; + + stream->throttleProcessingThreadOnOverload = throttleProcessingThreadOnOverload; + + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + ( (streamCallback) + ? &winMmeHostApi->callbackStreamInterface + : &winMmeHostApi->blockingStreamInterface ), + streamCallback, userData ); + streamRepresentationIsInitialized = 1; + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + if( inputParameters && outputParameters ) /* full duplex */ + { + if( framesPerHostInputBuffer < framesPerHostOutputBuffer ) + { + assert( (framesPerHostOutputBuffer % framesPerHostInputBuffer) == 0 ); /* CalculateBufferSettings() should guarantee this condition */ + + framesPerBufferProcessorCall = framesPerHostInputBuffer; + } + else + { + assert( (framesPerHostInputBuffer % framesPerHostOutputBuffer) == 0 ); /* CalculateBufferSettings() should guarantee this condition */ + + framesPerBufferProcessorCall = framesPerHostOutputBuffer; + } + } + else if( inputParameters ) + { + framesPerBufferProcessorCall = framesPerHostInputBuffer; + } + else if( outputParameters ) + { + framesPerBufferProcessorCall = framesPerHostOutputBuffer; + } + + stream->input.framesPerBuffer = framesPerHostInputBuffer; + stream->output.framesPerBuffer = framesPerHostOutputBuffer; + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerBufferProcessorCall, paUtilFixedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ) goto error; + + bufferProcessorIsInitialized = 1; + + stream->streamRepresentation.streamInfo.inputLatency = + (double)(PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) + +(framesPerHostInputBuffer * (hostInputBufferCount-1))) / sampleRate; + stream->streamRepresentation.streamInfo.outputLatency = + (double)(PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) + +(framesPerHostOutputBuffer * (hostOutputBufferCount-1))) / sampleRate; + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + stream->primeStreamUsingCallback = ( (streamFlags&paPrimeOutputBuffersUsingStreamCallback) && streamCallback ) ? 1 : 0; + + /* time to sleep when throttling due to >100% cpu usage. + -a quater of a buffer's duration */ + stream->throttledSleepMsecs = + (unsigned long)(stream->bufferProcessor.framesPerHostBuffer * + stream->bufferProcessor.samplePeriod * .25 * 1000); + + stream->isStopped = 1; + stream->isActive = 0; + + + /* for maximum compatibility with multi-device multichannel drivers, + we first open all devices, then we prepare all buffers, finally + we start all devices ( in StartStream() ). teardown in reverse order. + */ + + if( inputParameters ) + { + result = InitializeWaveHandles( winMmeHostApi, &stream->input, + stream->bufferProcessor.bytesPerHostInputSample, sampleRate, + inputDevices, inputDeviceCount, 1 /* isInput */ ); + if( result != paNoError ) goto error; + } + + if( outputParameters ) + { + result = InitializeWaveHandles( winMmeHostApi, &stream->output, + stream->bufferProcessor.bytesPerHostOutputSample, sampleRate, + outputDevices, outputDeviceCount, 0 /* isInput */ ); + if( result != paNoError ) goto error; + } + + if( inputParameters ) + { + result = InitializeWaveHeaders( &stream->input, hostInputBufferCount, + hostInputSampleFormat, framesPerHostInputBuffer, inputDevices, 1 /* isInput */ ); + if( result != paNoError ) goto error; + } + + if( outputParameters ) + { + result = InitializeWaveHeaders( &stream->output, hostOutputBufferCount, + hostOutputSampleFormat, framesPerHostOutputBuffer, outputDevices, 0 /* not isInput */ ); + if( result != paNoError ) goto error; + + stream->allBuffersDurationMs = (DWORD) (1000.0 * (framesPerHostOutputBuffer * stream->output.bufferCount) / sampleRate); + } + else + { + stream->allBuffersDurationMs = (DWORD) (1000.0 * (framesPerHostInputBuffer * stream->input.bufferCount) / sampleRate); + } + + + if( streamCallback ) + { + /* abort event is only needed for callback streams */ + result = CreateEventWithPaError( &stream->abortEvent, NULL, TRUE, FALSE, NULL ); + if( result != paNoError ) goto error; + } + + *s = (PaStream*)stream; + + return result; + +error: + + if( stream ) + { + if( stream->abortEvent ) + CloseHandle( stream->abortEvent ); + + TerminateWaveHeaders( &stream->output, 0 /* not isInput */ ); + TerminateWaveHeaders( &stream->input, 1 /* isInput */ ); + + TerminateWaveHandles( &stream->output, 0 /* not isInput */, 1 /* currentlyProcessingAnError */ ); + TerminateWaveHandles( &stream->input, 1 /* isInput */, 1 /* currentlyProcessingAnError */ ); + + if( bufferProcessorIsInitialized ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + + if( streamRepresentationIsInitialized ) + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + + PaUtil_FreeMemory( stream ); + } + + return result; +} + + +/* return non-zero if all current buffers are done */ +static int BuffersAreDone( WAVEHDR **waveHeaders, unsigned int deviceCount, int bufferIndex ) +{ + unsigned int i; + + for( i=0; i < deviceCount; ++i ) + { + if( !(waveHeaders[i][ bufferIndex ].dwFlags & WHDR_DONE) ) + { + return 0; + } + } + + return 1; +} + +static int CurrentInputBuffersAreDone( PaWinMmeStream *stream ) +{ + return BuffersAreDone( stream->input.waveHeaders, stream->input.deviceCount, stream->input.currentBufferIndex ); +} + +static int CurrentOutputBuffersAreDone( PaWinMmeStream *stream ) +{ + return BuffersAreDone( stream->output.waveHeaders, stream->output.deviceCount, stream->output.currentBufferIndex ); +} + + +/* return non-zero if any buffers are queued */ +static int NoBuffersAreQueued( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ) +{ + unsigned int i, j; + + if( handlesAndBuffers->waveHandles ) + { + for( i=0; i < handlesAndBuffers->bufferCount; ++i ) + { + for( j=0; j < handlesAndBuffers->deviceCount; ++j ) + { + if( !( handlesAndBuffers->waveHeaders[ j ][ i ].dwFlags & WHDR_DONE) ) + { + return 0; + } + } + } + } + + return 1; +} + + +#define PA_CIRCULAR_INCREMENT_( current, max )\ + ( (((current) + 1) >= (max)) ? (0) : (current+1) ) + +#define PA_CIRCULAR_DECREMENT_( current, max )\ + ( ((current) == 0) ? ((max)-1) : (current-1) ) + + +static signed long GetAvailableFrames( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ) +{ + signed long result = 0; + unsigned int i; + + if( BuffersAreDone( handlesAndBuffers->waveHeaders, handlesAndBuffers->deviceCount, handlesAndBuffers->currentBufferIndex ) ) + { + /* we could calculate the following in O(1) if we kept track of the + last done buffer */ + result = handlesAndBuffers->framesPerBuffer - handlesAndBuffers->framesUsedInCurrentBuffer; + + i = PA_CIRCULAR_INCREMENT_( handlesAndBuffers->currentBufferIndex, handlesAndBuffers->bufferCount ); + while( i != handlesAndBuffers->currentBufferIndex ) + { + if( BuffersAreDone( handlesAndBuffers->waveHeaders, handlesAndBuffers->deviceCount, i ) ) + { + result += handlesAndBuffers->framesPerBuffer; + i = PA_CIRCULAR_INCREMENT_( i, handlesAndBuffers->bufferCount ); + } + else + break; + } + } + + return result; +} + + +static PaError AdvanceToNextInputBuffer( PaWinMmeStream *stream ) +{ + PaError result = paNoError; + MMRESULT mmresult; + unsigned int i; + + for( i=0; i < stream->input.deviceCount; ++i ) + { + mmresult = waveInAddBuffer( ((HWAVEIN*)stream->input.waveHandles)[i], + &stream->input.waveHeaders[i][ stream->input.currentBufferIndex ], + sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + } + } + + stream->input.currentBufferIndex = + PA_CIRCULAR_INCREMENT_( stream->input.currentBufferIndex, stream->input.bufferCount ); + + stream->input.framesUsedInCurrentBuffer = 0; + + return result; +} + + +static PaError AdvanceToNextOutputBuffer( PaWinMmeStream *stream ) +{ + PaError result = paNoError; + MMRESULT mmresult; + unsigned int i; + + for( i=0; i < stream->output.deviceCount; ++i ) + { + mmresult = waveOutWrite( ((HWAVEOUT*)stream->output.waveHandles)[i], + &stream->output.waveHeaders[i][ stream->output.currentBufferIndex ], + sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + } + } + + stream->output.currentBufferIndex = + PA_CIRCULAR_INCREMENT_( stream->output.currentBufferIndex, stream->output.bufferCount ); + + stream->output.framesUsedInCurrentBuffer = 0; + + return result; +} + + +/* requeue all but the most recent input with the driver. Used for catching + up after a total input buffer underrun */ +static PaError CatchUpInputBuffers( PaWinMmeStream *stream ) +{ + PaError result = paNoError; + unsigned int i; + + for( i=0; i < stream->input.bufferCount - 1; ++i ) + { + result = AdvanceToNextInputBuffer( stream ); + if( result != paNoError ) + break; + } + + return result; +} + + +/* take the most recent output and duplicate it to all other output buffers + and requeue them. Used for catching up after a total output buffer underrun. +*/ +static PaError CatchUpOutputBuffers( PaWinMmeStream *stream ) +{ + PaError result = paNoError; + unsigned int i, j; + unsigned int previousBufferIndex = + PA_CIRCULAR_DECREMENT_( stream->output.currentBufferIndex, stream->output.bufferCount ); + + for( i=0; i < stream->output.bufferCount - 1; ++i ) + { + for( j=0; j < stream->output.deviceCount; ++j ) + { + if( stream->output.waveHeaders[j][ stream->output.currentBufferIndex ].lpData + != stream->output.waveHeaders[j][ previousBufferIndex ].lpData ) + { + CopyMemory( stream->output.waveHeaders[j][ stream->output.currentBufferIndex ].lpData, + stream->output.waveHeaders[j][ previousBufferIndex ].lpData, + stream->output.waveHeaders[j][ stream->output.currentBufferIndex ].dwBufferLength ); + } + } + + result = AdvanceToNextOutputBuffer( stream ); + if( result != paNoError ) + break; + } + + return result; +} + + +static DWORD WINAPI ProcessingThreadProc( void *pArg ) +{ + PaWinMmeStream *stream = (PaWinMmeStream *)pArg; + HANDLE events[3]; + int eventCount = 0; + DWORD result = paNoError; + DWORD waitResult; + DWORD timeout = (unsigned long)(stream->allBuffersDurationMs * 0.5); + int hostBuffersAvailable; + signed int hostInputBufferIndex, hostOutputBufferIndex; + PaStreamCallbackFlags statusFlags; + int callbackResult; + int done = 0; + unsigned int channel, i; + unsigned long framesProcessed; + + /* prepare event array for call to WaitForMultipleObjects() */ + if( stream->input.bufferEvent ) + events[eventCount++] = stream->input.bufferEvent; + if( stream->output.bufferEvent ) + events[eventCount++] = stream->output.bufferEvent; + events[eventCount++] = stream->abortEvent; + + statusFlags = 0; /** @todo support paInputUnderflow, paOutputOverflow and paNeverDropInput */ + + /* loop until something causes us to stop */ + do{ + /* wait for MME to signal that a buffer is available, or for + the PA abort event to be signaled. + + When this indicates that one or more buffers are available + NoBuffersAreQueued() and Current*BuffersAreDone are used below to + poll for additional done buffers. NoBuffersAreQueued() will fail + to identify an underrun/overflow if the driver doesn't mark all done + buffers prior to signalling the event. Some drivers do this + (eg RME Digi96, and others don't eg VIA PC 97 input). This isn't a + huge problem, it just means that we won't always be able to detect + underflow/overflow. + */ + waitResult = WaitForMultipleObjects( eventCount, events, FALSE /* wait all = FALSE */, timeout ); + if( waitResult == WAIT_FAILED ) + { + result = paUnanticipatedHostError; + /** @todo FIXME/REVIEW: can't return host error info from an asyncronous thread */ + done = 1; + } + else if( waitResult == WAIT_TIMEOUT ) + { + /* if a timeout is encountered, continue */ + } + + if( stream->abortProcessing ) + { + /* Pa_AbortStream() has been called, stop processing immediately */ + done = 1; + } + else if( stream->stopProcessing ) + { + /* Pa_StopStream() has been called or the user callback returned + non-zero, processing will continue until all output buffers + are marked as done. The stream will stop immediately if it + is input-only. + */ + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + if( NoBuffersAreQueued( &stream->output ) ) + done = 1; /* Will cause thread to return. */ + } + else + { + /* input only stream */ + done = 1; /* Will cause thread to return. */ + } + } + else + { + hostBuffersAvailable = 1; + + /* process all available host buffers */ + do + { + hostInputBufferIndex = -1; + hostOutputBufferIndex = -1; + + if( PA_IS_INPUT_STREAM_(stream) ) + { + if( CurrentInputBuffersAreDone( stream ) ) + { + if( NoBuffersAreQueued( &stream->input ) ) + { + /** @todo + if all of the other buffers are also ready then + we discard all but the most recent. This is an + input buffer overflow. FIXME: these buffers should + be passed to the callback in a paNeverDropInput + stream. + + note that it is also possible for an input overflow + to happen while the callback is processing a buffer. + that is handled further down. + */ + result = CatchUpInputBuffers( stream ); + if( result != paNoError ) + done = 1; + + statusFlags |= paInputOverflow; + } + + hostInputBufferIndex = stream->input.currentBufferIndex; + } + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + if( CurrentOutputBuffersAreDone( stream ) ) + { + /* ok, we have an output buffer */ + + if( NoBuffersAreQueued( &stream->output ) ) + { + /* + if all of the other buffers are also ready, catch up by copying + the most recently generated buffer into all but one of the output + buffers. + + note that this catch up code only handles the case where all + buffers have been played out due to this thread not having + woken up at all. a more common case occurs when this thread + is woken up, processes one buffer, but takes too long, and as + a result all the other buffers have become un-queued. that + case is handled further down. + */ + + result = CatchUpOutputBuffers( stream ); + if( result != paNoError ) + done = 1; + + statusFlags |= paOutputUnderflow; + } + + hostOutputBufferIndex = stream->output.currentBufferIndex; + } + } + + + if( (PA_IS_FULL_DUPLEX_STREAM_(stream) && hostInputBufferIndex != -1 && hostOutputBufferIndex != -1) || + (PA_IS_HALF_DUPLEX_STREAM_(stream) && ( hostInputBufferIndex != -1 || hostOutputBufferIndex != -1 ) ) ) + { + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /** @todo implement inputBufferAdcTime */ + + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + /* set timeInfo.currentTime and calculate timeInfo.outputBufferDacTime + from the current wave out position */ + MMTIME mmtime; + double timeBeforeGetPosition, timeAfterGetPosition; + double time; + long framesInBufferRing; + long writePosition; + long playbackPosition; + HWAVEOUT firstWaveOutDevice = ((HWAVEOUT*)stream->output.waveHandles)[0]; + + mmtime.wType = TIME_SAMPLES; + timeBeforeGetPosition = PaUtil_GetTime(); + waveOutGetPosition( firstWaveOutDevice, &mmtime, sizeof(MMTIME) ); + timeAfterGetPosition = PaUtil_GetTime(); + + timeInfo.currentTime = timeAfterGetPosition; + + /* approximate time at which wave out position was measured + as half way between timeBeforeGetPosition and timeAfterGetPosition */ + time = timeBeforeGetPosition + (timeAfterGetPosition - timeBeforeGetPosition) * .5; + + framesInBufferRing = stream->output.bufferCount * stream->bufferProcessor.framesPerHostBuffer; + playbackPosition = mmtime.u.sample % framesInBufferRing; + + writePosition = stream->output.currentBufferIndex * stream->bufferProcessor.framesPerHostBuffer + + stream->output.framesUsedInCurrentBuffer; + + if( playbackPosition >= writePosition ){ + timeInfo.outputBufferDacTime = + time + ((double)( writePosition + (framesInBufferRing - playbackPosition) ) * stream->bufferProcessor.samplePeriod ); + }else{ + timeInfo.outputBufferDacTime = + time + ((double)( writePosition - playbackPosition ) * stream->bufferProcessor.samplePeriod ); + } + } + + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, statusFlags ); + + /* reset status flags once they have been passed to the buffer processor */ + statusFlags = 0; + + if( PA_IS_INPUT_STREAM_(stream) ) + { + PaUtil_SetInputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + + channel = 0; + for( i=0; iinput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->input.waveHeaders[i][ hostInputBufferIndex ].dwUser; + + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, channel, + stream->input.waveHeaders[i][ hostInputBufferIndex ].lpData + + stream->input.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostInputSample, + channelCount ); + + + channel += channelCount; + } + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + + channel = 0; + for( i=0; ioutput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->output.waveHeaders[i][ hostOutputBufferIndex ].dwUser; + + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, channel, + stream->output.waveHeaders[i][ hostOutputBufferIndex ].lpData + + stream->output.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostOutputSample, + channelCount ); + + channel += channelCount; + } + } + + callbackResult = paContinue; + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + + stream->input.framesUsedInCurrentBuffer += framesProcessed; + stream->output.framesUsedInCurrentBuffer += framesProcessed; + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + if( callbackResult == paContinue ) + { + /* nothing special to do */ + } + else if( callbackResult == paAbort ) + { + stream->abortProcessing = 1; + done = 1; + /** @todo FIXME: should probably reset the output device immediately once the callback returns paAbort */ + result = paNoError; + } + else + { + /* User callback has asked us to stop with paComplete or other non-zero value */ + stream->stopProcessing = 1; /* stop once currently queued audio has finished */ + result = paNoError; + } + + + if( PA_IS_INPUT_STREAM_(stream) + && stream->stopProcessing == 0 && stream->abortProcessing == 0 + && stream->input.framesUsedInCurrentBuffer == stream->input.framesPerBuffer ) + { + if( NoBuffersAreQueued( &stream->input ) ) + { + /** @todo need to handle PaNeverDropInput here where necessary */ + result = CatchUpInputBuffers( stream ); + if( result != paNoError ) + done = 1; + + statusFlags |= paInputOverflow; + } + + result = AdvanceToNextInputBuffer( stream ); + if( result != paNoError ) + done = 1; + } + + + if( PA_IS_OUTPUT_STREAM_(stream) && !stream->abortProcessing ) + { + if( stream->stopProcessing && + stream->output.framesUsedInCurrentBuffer < stream->output.framesPerBuffer ) + { + /* zero remaining samples in output output buffer and flush */ + + stream->output.framesUsedInCurrentBuffer += PaUtil_ZeroOutput( &stream->bufferProcessor, + stream->output.framesPerBuffer - stream->output.framesUsedInCurrentBuffer ); + + /* we send the entire buffer to the output devices, but we could + just send a partial buffer, rather than zeroing the unused + samples. + */ + } + + if( stream->output.framesUsedInCurrentBuffer == stream->output.framesPerBuffer ) + { + /* check for underflow before enquing the just-generated buffer, + but recover from underflow after enquing it. This ensures + that the most recent audio segment is repeated */ + int outputUnderflow = NoBuffersAreQueued( &stream->output ); + + result = AdvanceToNextOutputBuffer( stream ); + if( result != paNoError ) + done = 1; + + if( outputUnderflow && !done && !stream->stopProcessing ) + { + /* Recover from underflow in the case where the + underflow occured while processing the buffer + we just finished */ + + result = CatchUpOutputBuffers( stream ); + if( result != paNoError ) + done = 1; + + statusFlags |= paOutputUnderflow; + } + } + } + + if( stream->throttleProcessingThreadOnOverload != 0 ) + { + if( stream->stopProcessing || stream->abortProcessing ) + { + if( stream->processingThreadPriority != stream->highThreadPriority ) + { + SetThreadPriority( stream->processingThread, stream->highThreadPriority ); + stream->processingThreadPriority = stream->highThreadPriority; + } + } + else if( PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ) > 1. ) + { + if( stream->processingThreadPriority != stream->throttledThreadPriority ) + { + SetThreadPriority( stream->processingThread, stream->throttledThreadPriority ); + stream->processingThreadPriority = stream->throttledThreadPriority; + } + + /* sleep to give other processes a go */ + Sleep( stream->throttledSleepMsecs ); + } + else + { + if( stream->processingThreadPriority != stream->highThreadPriority ) + { + SetThreadPriority( stream->processingThread, stream->highThreadPriority ); + stream->processingThreadPriority = stream->highThreadPriority; + } + } + } + } + else + { + hostBuffersAvailable = 0; + } + } + while( hostBuffersAvailable && + stream->stopProcessing == 0 && + stream->abortProcessing == 0 && + !done ); + } + } + while( !done ); + + stream->isActive = 0; + + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + return result; +} + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + result = CloseHandleWithPaError( stream->abortEvent ); + if( result != paNoError ) goto error; + + TerminateWaveHeaders( &stream->output, 0 /* not isInput */ ); + TerminateWaveHeaders( &stream->input, 1 /* isInput */ ); + + TerminateWaveHandles( &stream->output, 0 /* not isInput */, 0 /* not currentlyProcessingAnError */ ); + TerminateWaveHandles( &stream->input, 1 /* isInput */, 0 /* not currentlyProcessingAnError */ ); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); + +error: + /** @todo REVIEW: what is the best way to clean up a stream if an error is detected? */ + return result; +} + + +static PaError StartStream( PaStream *s ) +{ + PaError result; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + MMRESULT mmresult; + unsigned int i, j; + int callbackResult; + unsigned int channel; + unsigned long framesProcessed; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /** @todo implement this for stream priming */ + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + if( PA_IS_INPUT_STREAM_(stream) ) + { + for( i=0; iinput.bufferCount; ++i ) + { + for( j=0; jinput.deviceCount; ++j ) + { + mmresult = waveInAddBuffer( ((HWAVEIN*)stream->input.waveHandles)[j], &stream->input.waveHeaders[j][i], sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + goto error; + } + } + } + stream->input.currentBufferIndex = 0; + stream->input.framesUsedInCurrentBuffer = 0; + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + for( i=0; ioutput.deviceCount; ++i ) + { + if( (mmresult = waveOutPause( ((HWAVEOUT*)stream->output.waveHandles)[i] )) != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + goto error; + } + } + + for( i=0; ioutput.bufferCount; ++i ) + { + if( stream->primeStreamUsingCallback ) + { + + stream->output.framesUsedInCurrentBuffer = 0; + do{ + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, + &timeInfo, + paPrimingOutput | ((stream->input.bufferCount > 0 ) ? paInputUnderflow : 0)); + + if( stream->input.bufferCount > 0 ) + PaUtil_SetNoInput( &stream->bufferProcessor ); + + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + + channel = 0; + for( j=0; joutput.deviceCount; ++j ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->output.waveHeaders[j][i].dwUser; + + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, channel, + stream->output.waveHeaders[j][i].lpData + + stream->output.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostOutputSample, + channelCount ); + + /* we have stored the number of channels in the buffer in dwUser */ + channel += channelCount; + } + + callbackResult = paContinue; + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + stream->output.framesUsedInCurrentBuffer += framesProcessed; + + if( callbackResult != paContinue ) + { + /** @todo fix this, what do we do if callback result is non-zero during stream + priming? + + for complete: play out primed waveHeaders as usual + for abort: clean up immediately. + */ + } + + }while( stream->output.framesUsedInCurrentBuffer != stream->output.framesPerBuffer ); + + } + else + { + for( j=0; joutput.deviceCount; ++j ) + { + ZeroMemory( stream->output.waveHeaders[j][i].lpData, stream->output.waveHeaders[j][i].dwBufferLength ); + } + } + + /* we queue all channels of a single buffer frame (accross all + devices, because some multidevice multichannel drivers work + better this way */ + for( j=0; joutput.deviceCount; ++j ) + { + mmresult = waveOutWrite( ((HWAVEOUT*)stream->output.waveHandles)[j], &stream->output.waveHeaders[j][i], sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + goto error; + } + } + } + stream->output.currentBufferIndex = 0; + stream->output.framesUsedInCurrentBuffer = 0; + } + + + stream->isStopped = 0; + stream->isActive = 1; + stream->stopProcessing = 0; + stream->abortProcessing = 0; + + result = ResetEventWithPaError( stream->input.bufferEvent ); + if( result != paNoError ) goto error; + + result = ResetEventWithPaError( stream->output.bufferEvent ); + if( result != paNoError ) goto error; + + + if( stream->streamRepresentation.streamCallback ) + { + /* callback stream */ + + result = ResetEventWithPaError( stream->abortEvent ); + if( result != paNoError ) goto error; + + /* Create thread that waits for audio buffers to be ready for processing. */ + stream->processingThread = CreateThread( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ); + if( !stream->processingThread ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + goto error; + } + + /** @todo could have mme specific stream parameters to allow the user + to set the callback thread priorities */ + stream->highThreadPriority = THREAD_PRIORITY_TIME_CRITICAL; + stream->throttledThreadPriority = THREAD_PRIORITY_NORMAL; + + if( !SetThreadPriority( stream->processingThread, stream->highThreadPriority ) ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + goto error; + } + stream->processingThreadPriority = stream->highThreadPriority; + } + else + { + /* blocking read/write stream */ + + } + + if( PA_IS_INPUT_STREAM_(stream) ) + { + for( i=0; i < stream->input.deviceCount; ++i ) + { + mmresult = waveInStart( ((HWAVEIN*)stream->input.waveHandles)[i] ); + PA_DEBUG(("Pa_StartStream: waveInStart returned = 0x%X.\n", mmresult)); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + goto error; + } + } + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + for( i=0; i < stream->output.deviceCount; ++i ) + { + if( (mmresult = waveOutRestart( ((HWAVEOUT*)stream->output.waveHandles)[i] )) != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + goto error; + } + } + } + + return result; + +error: + /** @todo FIXME: implement recovery as best we can + This should involve rolling back to a state as-if this function had never been called + */ + return result; +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + int timeout; + DWORD waitResult; + MMRESULT mmresult; + signed int hostOutputBufferIndex; + unsigned int channel, waitCount, i; + + /** @todo + REVIEW: the error checking in this function needs review. the basic + idea is to return from this function in a known state - for example + there is no point avoiding calling waveInReset just because + the thread times out. + */ + + if( stream->processingThread ) + { + /* callback stream */ + + /* Tell processing thread to stop generating more data and to let current data play out. */ + stream->stopProcessing = 1; + + /* Calculate timeOut longer than longest time it could take to return all buffers. */ + timeout = (int)(stream->allBuffersDurationMs * 1.5); + if( timeout < PA_MME_MIN_TIMEOUT_MSEC_ ) + timeout = PA_MME_MIN_TIMEOUT_MSEC_; + + PA_DEBUG(("WinMME StopStream: waiting for background thread.\n")); + + waitResult = WaitForSingleObject( stream->processingThread, timeout ); + if( waitResult == WAIT_TIMEOUT ) + { + /* try to abort */ + stream->abortProcessing = 1; + SetEvent( stream->abortEvent ); + waitResult = WaitForSingleObject( stream->processingThread, timeout ); + if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WinMME StopStream: timed out while waiting for background thread to finish.\n")); + result = paTimedOut; + } + } + + CloseHandle( stream->processingThread ); + stream->processingThread = NULL; + } + else + { + /* blocking read / write stream */ + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + if( stream->output.framesUsedInCurrentBuffer > 0 ) + { + /* there are still unqueued frames in the current buffer, so flush them */ + + hostOutputBufferIndex = stream->output.currentBufferIndex; + + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, + stream->output.framesPerBuffer - stream->output.framesUsedInCurrentBuffer ); + + channel = 0; + for( i=0; ioutput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->output.waveHeaders[i][ hostOutputBufferIndex ].dwUser; + + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, channel, + stream->output.waveHeaders[i][ hostOutputBufferIndex ].lpData + + stream->output.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostOutputSample, + channelCount ); + + channel += channelCount; + } + + PaUtil_ZeroOutput( &stream->bufferProcessor, + stream->output.framesPerBuffer - stream->output.framesUsedInCurrentBuffer ); + + /* we send the entire buffer to the output devices, but we could + just send a partial buffer, rather than zeroing the unused + samples. + */ + AdvanceToNextOutputBuffer( stream ); + } + + + timeout = (stream->allBuffersDurationMs / stream->output.bufferCount) + 1; + if( timeout < PA_MME_MIN_TIMEOUT_MSEC_ ) + timeout = PA_MME_MIN_TIMEOUT_MSEC_; + + waitCount = 0; + while( !NoBuffersAreQueued( &stream->output ) && waitCount <= stream->output.bufferCount ) + { + /* wait for MME to signal that a buffer is available */ + waitResult = WaitForSingleObject( stream->output.bufferEvent, timeout ); + if( waitResult == WAIT_FAILED ) + { + break; + } + else if( waitResult == WAIT_TIMEOUT ) + { + /* keep waiting */ + } + + ++waitCount; + } + } + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + for( i =0; i < stream->output.deviceCount; ++i ) + { + mmresult = waveOutReset( ((HWAVEOUT*)stream->output.waveHandles)[i] ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + } + } + } + + if( PA_IS_INPUT_STREAM_(stream) ) + { + for( i=0; i < stream->input.deviceCount; ++i ) + { + mmresult = waveInReset( ((HWAVEIN*)stream->input.waveHandles)[i] ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + } + } + } + + stream->isStopped = 1; + stream->isActive = 0; + + return result; +} + + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + int timeout; + DWORD waitResult; + MMRESULT mmresult; + unsigned int i; + + /** @todo + REVIEW: the error checking in this function needs review. the basic + idea is to return from this function in a known state - for example + there is no point avoiding calling waveInReset just because + the thread times out. + */ + + if( stream->processingThread ) + { + /* callback stream */ + + /* Tell processing thread to abort immediately */ + stream->abortProcessing = 1; + SetEvent( stream->abortEvent ); + } + + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + for( i =0; i < stream->output.deviceCount; ++i ) + { + mmresult = waveOutReset( ((HWAVEOUT*)stream->output.waveHandles)[i] ); + if( mmresult != MMSYSERR_NOERROR ) + { + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + return paUnanticipatedHostError; + } + } + } + + if( PA_IS_INPUT_STREAM_(stream) ) + { + for( i=0; i < stream->input.deviceCount; ++i ) + { + mmresult = waveInReset( ((HWAVEIN*)stream->input.waveHandles)[i] ); + if( mmresult != MMSYSERR_NOERROR ) + { + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + return paUnanticipatedHostError; + } + } + } + + + if( stream->processingThread ) + { + /* callback stream */ + + PA_DEBUG(("WinMME AbortStream: waiting for background thread.\n")); + + /* Calculate timeOut longer than longest time it could take to return all buffers. */ + timeout = (int)(stream->allBuffersDurationMs * 1.5); + if( timeout < PA_MME_MIN_TIMEOUT_MSEC_ ) + timeout = PA_MME_MIN_TIMEOUT_MSEC_; + + waitResult = WaitForSingleObject( stream->processingThread, timeout ); + if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WinMME AbortStream: timed out while waiting for background thread to finish.\n")); + return paTimedOut; + } + + CloseHandle( stream->processingThread ); + stream->processingThread = NULL; + } + + stream->isStopped = 1; + stream->isActive = 0; + + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + return stream->isStopped; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + return stream->isActive; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + (void) s; /* unused parameter */ + + return PaUtil_GetTime(); +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaError result = paNoError; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + void *userBuffer; + unsigned long framesRead = 0; + unsigned long framesProcessed; + signed int hostInputBufferIndex; + DWORD waitResult; + DWORD timeout = (unsigned long)(stream->allBuffersDurationMs * 0.5); + unsigned int channel, i; + + if( PA_IS_INPUT_STREAM_(stream) ) + { + /* make a local copy of the user buffer pointer(s). this is necessary + because PaUtil_CopyInput() advances these pointers every time + it is called. + */ + if( stream->bufferProcessor.userInputIsInterleaved ) + { + userBuffer = buffer; + } + else + { + userBuffer = alloca( sizeof(void*) * stream->bufferProcessor.inputChannelCount ); + if( !userBuffer ) + return paInsufficientMemory; + for( i = 0; ibufferProcessor.inputChannelCount; ++i ) + ((void**)userBuffer)[i] = ((void**)buffer)[i]; + } + + do{ + if( CurrentInputBuffersAreDone( stream ) ) + { + if( NoBuffersAreQueued( &stream->input ) ) + { + /** @todo REVIEW: consider what to do if the input overflows. + do we requeue all of the buffers? should we be running + a thread to make sure they are always queued? */ + + result = paInputOverflowed; + } + + hostInputBufferIndex = stream->input.currentBufferIndex; + + PaUtil_SetInputFrameCount( &stream->bufferProcessor, + stream->input.framesPerBuffer - stream->input.framesUsedInCurrentBuffer ); + + channel = 0; + for( i=0; iinput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->input.waveHeaders[i][ hostInputBufferIndex ].dwUser; + + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, channel, + stream->input.waveHeaders[i][ hostInputBufferIndex ].lpData + + stream->input.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostInputSample, + channelCount ); + + channel += channelCount; + } + + framesProcessed = PaUtil_CopyInput( &stream->bufferProcessor, &userBuffer, frames - framesRead ); + + stream->input.framesUsedInCurrentBuffer += framesProcessed; + if( stream->input.framesUsedInCurrentBuffer == stream->input.framesPerBuffer ) + { + result = AdvanceToNextInputBuffer( stream ); + if( result != paNoError ) + break; + } + + framesRead += framesProcessed; + + }else{ + /* wait for MME to signal that a buffer is available */ + waitResult = WaitForSingleObject( stream->input.bufferEvent, timeout ); + if( waitResult == WAIT_FAILED ) + { + result = paUnanticipatedHostError; + break; + } + else if( waitResult == WAIT_TIMEOUT ) + { + /* if a timeout is encountered, continue, + perhaps we should give up eventually + */ + } + } + }while( framesRead < frames ); + } + else + { + result = paCanNotReadFromAnOutputOnlyStream; + } + + return result; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaError result = paNoError; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + const void *userBuffer; + unsigned long framesWritten = 0; + unsigned long framesProcessed; + signed int hostOutputBufferIndex; + DWORD waitResult; + DWORD timeout = (unsigned long)(stream->allBuffersDurationMs * 0.5); + unsigned int channel, i; + + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + /* make a local copy of the user buffer pointer(s). this is necessary + because PaUtil_CopyOutput() advances these pointers every time + it is called. + */ + if( stream->bufferProcessor.userOutputIsInterleaved ) + { + userBuffer = buffer; + } + else + { + userBuffer = alloca( sizeof(void*) * stream->bufferProcessor.outputChannelCount ); + if( !userBuffer ) + return paInsufficientMemory; + for( i = 0; ibufferProcessor.outputChannelCount; ++i ) + ((const void**)userBuffer)[i] = ((const void**)buffer)[i]; + } + + do{ + if( CurrentOutputBuffersAreDone( stream ) ) + { + if( NoBuffersAreQueued( &stream->output ) ) + { + /** @todo REVIEW: consider what to do if the output + underflows. do we requeue all the existing buffers with + zeros? should we run a separate thread to keep the buffers + enqueued at all times? */ + + result = paOutputUnderflowed; + } + + hostOutputBufferIndex = stream->output.currentBufferIndex; + + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, + stream->output.framesPerBuffer - stream->output.framesUsedInCurrentBuffer ); + + channel = 0; + for( i=0; ioutput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->output.waveHeaders[i][ hostOutputBufferIndex ].dwUser; + + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, channel, + stream->output.waveHeaders[i][ hostOutputBufferIndex ].lpData + + stream->output.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostOutputSample, + channelCount ); + + channel += channelCount; + } + + framesProcessed = PaUtil_CopyOutput( &stream->bufferProcessor, &userBuffer, frames - framesWritten ); + + stream->output.framesUsedInCurrentBuffer += framesProcessed; + if( stream->output.framesUsedInCurrentBuffer == stream->output.framesPerBuffer ) + { + result = AdvanceToNextOutputBuffer( stream ); + if( result != paNoError ) + break; + } + + framesWritten += framesProcessed; + } + else + { + /* wait for MME to signal that a buffer is available */ + waitResult = WaitForSingleObject( stream->output.bufferEvent, timeout ); + if( waitResult == WAIT_FAILED ) + { + result = paUnanticipatedHostError; + break; + } + else if( waitResult == WAIT_TIMEOUT ) + { + /* if a timeout is encountered, continue, + perhaps we should give up eventually + */ + } + } + }while( framesWritten < frames ); + } + else + { + result = paCanNotWriteToAnInputOnlyStream; + } + + return result; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + if( PA_IS_INPUT_STREAM_(stream) ) + return GetAvailableFrames( &stream->input ); + else + return paCanNotReadFromAnOutputOnlyStream; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + if( PA_IS_OUTPUT_STREAM_(stream) ) + return GetAvailableFrames( &stream->output ); + else + return paCanNotWriteToAnInputOnlyStream; +} + + +/* NOTE: the following functions are MME-stream specific, and are called directly + by client code. We need to check for many more error conditions here because + we don't have the benefit of pa_front.c's parameter checking. +*/ + +static PaError GetWinMMEStreamPointer( PaWinMmeStream **stream, PaStream *s ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaWinMmeHostApiRepresentation *winMmeHostApi; + + result = PaUtil_ValidateStreamPointer( s ); + if( result != paNoError ) + return result; + + result = PaUtil_GetHostApiRepresentation( &hostApi, paMME ); + if( result != paNoError ) + return result; + + winMmeHostApi = (PaWinMmeHostApiRepresentation*)hostApi; + + /* note, the following would be easier if there was a generic way of testing + that a stream belongs to a specific host API */ + + if( PA_STREAM_REP( s )->streamInterface == &winMmeHostApi->callbackStreamInterface + || PA_STREAM_REP( s )->streamInterface == &winMmeHostApi->blockingStreamInterface ) + { + /* s is a WinMME stream */ + *stream = (PaWinMmeStream *)s; + return paNoError; + } + else + { + return paIncompatibleStreamHostApi; + } +} + + +int PaWinMME_GetStreamInputHandleCount( PaStream* s ) +{ + PaWinMmeStream *stream; + PaError result = GetWinMMEStreamPointer( &stream, s ); + + if( result == paNoError ) + return (PA_IS_INPUT_STREAM_(stream)) ? stream->input.deviceCount : 0; + else + return result; +} + + +HWAVEIN PaWinMME_GetStreamInputHandle( PaStream* s, int handleIndex ) +{ + PaWinMmeStream *stream; + PaError result = GetWinMMEStreamPointer( &stream, s ); + + if( result == paNoError + && PA_IS_INPUT_STREAM_(stream) + && handleIndex >= 0 + && (unsigned int)handleIndex < stream->input.deviceCount ) + return ((HWAVEIN*)stream->input.waveHandles)[handleIndex]; + else + return 0; +} + + +int PaWinMME_GetStreamOutputHandleCount( PaStream* s) +{ + PaWinMmeStream *stream; + PaError result = GetWinMMEStreamPointer( &stream, s ); + + if( result == paNoError ) + return (PA_IS_OUTPUT_STREAM_(stream)) ? stream->output.deviceCount : 0; + else + return result; +} + + +HWAVEOUT PaWinMME_GetStreamOutputHandle( PaStream* s, int handleIndex ) +{ + PaWinMmeStream *stream; + PaError result = GetWinMMEStreamPointer( &stream, s ); + + if( result == paNoError + && PA_IS_OUTPUT_STREAM_(stream) + && handleIndex >= 0 + && (unsigned int)handleIndex < stream->output.deviceCount ) + return ((HWAVEOUT*)stream->output.waveHandles)[handleIndex]; + else + return 0; +} + + + + + diff --git a/portaudio-v19/pa_win_wmme/pa_win_wmme.h b/portaudio-v19/pa_win_wmme/pa_win_wmme.h new file mode 100644 index 000000000..458f88f99 --- /dev/null +++ b/portaudio-v19/pa_win_wmme/pa_win_wmme.h @@ -0,0 +1,160 @@ +#ifndef PA_WIN_WMME_H +#define PA_WIN_WMME_H +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * MME specific extensions + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +/** @file + @brief WMME-specific PortAudio API extension header file. +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +#define paWinMmeUseLowLevelLatencyParameters (0x01) +#define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */ + + +/* By default, the mme implementation drops the processing thread's priority + to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100% + This flag disables any priority throttling. The processing thread will always + run at THREAD_PRIORITY_TIME_CRITICAL. +*/ +#define paWinMmeDontThrottleOverloadedProcessingThread (0x08) + + +typedef struct PaWinMmeDeviceAndChannelCount{ + PaDeviceIndex device; + int channelCount; +}PaWinMmeDeviceAndChannelCount; + + +typedef struct PaWinMmeStreamInfo{ + unsigned long size; /**< sizeof(PaWinMmeStreamInfo) */ + PaHostApiTypeId hostApiType; /**< paMME */ + unsigned long version; /**< 1 */ + + unsigned long flags; + + /* low-level latency setting support + These settings control the number and size of host buffers in order + to set latency. They will be used instead of the generic parameters + to Pa_OpenStream() if flags contains the PaWinMmeUseLowLevelLatencyParameters + flag. + + If PaWinMmeStreamInfo structures with PaWinMmeUseLowLevelLatencyParameters + are supplied for both input and output in a full duplex stream, then the + input and output framesPerBuffer must be the same, or the larger of the + two must be a multiple of the smaller, otherwise a + paIncompatibleHostApiSpecificStreamInfo error will be returned from + Pa_OpenStream(). + */ + unsigned long framesPerBuffer; + unsigned long bufferCount; /* formerly numBuffers */ + + /* multiple devices per direction support + If flags contains the PaWinMmeUseMultipleDevices flag, + this functionality will be used, otherwise the device parameter to + Pa_OpenStream() will be used instead. + If devices are specified here, the corresponding device parameter + to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpecification, + otherwise an paInvalidDevice error will result. + The total number of channels accross all specified devices + must agree with the corresponding channelCount parameter to + Pa_OpenStream() otherwise a paInvalidChannelCount error will result. + */ + PaWinMmeDeviceAndChannelCount *devices; + unsigned long deviceCount; + +}PaWinMmeStreamInfo; + + +/** Retrieve the number of wave in handles used by a PortAudio WinMME stream. + Returns zero if the stream is output only. + + @return A non-negative value indicating the number of wave in handles + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + @see PaWinMME_GetStreamInputHandle +*/ +int PaWinMME_GetStreamInputHandleCount( PaStream* stream ); + + +/** Retrieve a wave in handle used by a PortAudio WinMME stream. + + @param stream The stream to query. + @param handleIndex The zero based index of the wave in handle to retrieve. This + should be in the range [0, PaWinMME_GetStreamInputHandle(stream)-1]. + + @return A valid wave in handle, or NULL if an error occurred. + + @see PaWinMME_GetStreamInputHandle +*/ +HWAVEIN PaWinMME_GetStreamInputHandle( PaStream* stream, int handleIndex ); + + +/** Retrieve the number of wave out handles used by a PortAudio WinMME stream. + Returns zero if the stream is input only. + + @return A non-negative value indicating the number of wave out handles + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + @see PaWinMME_GetStreamOutputHandle +*/ +int PaWinMME_GetStreamOutputHandleCount( PaStream* stream ); + + +/** Retrieve a wave out handle used by a PortAudio WinMME stream. + + @param stream The stream to query. + @param handleIndex The zero based index of the wave out handle to retrieve. + This should be in the range [0, PaWinMME_GetStreamOutputHandleCount(stream)-1]. + + @return A valid wave out handle, or NULL if an error occurred. + + @see PaWinMME_GetStreamOutputHandleCount +*/ +HWAVEOUT PaWinMME_GetStreamOutputHandle( PaStream* stream, int handleIndex ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* PA_WIN_WMME_H */ diff --git a/portaudio-v19/pablio/README.txt b/portaudio-v19/pablio/README.txt new file mode 100644 index 000000000..99c7d146e --- /dev/null +++ b/portaudio-v19/pablio/README.txt @@ -0,0 +1,39 @@ +README for PABLIO +Portable Audio Blocking I/O Library +Author: Phil Burk + +PABLIO is a simplified interface to PortAudio that provide +read/write style blocking I/O. + +Please see the .DOC file for documentation. + +/* + * More information on PortAudio at: http://www.portaudio.com + * Copyright (c) 1999-2000 Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + + diff --git a/portaudio-v19/pablio/pablio.c b/portaudio-v19/pablio/pablio.c new file mode 100644 index 000000000..452eccc4d --- /dev/null +++ b/portaudio-v19/pablio/pablio.c @@ -0,0 +1,307 @@ +/* + * $Id$ + * pablio.c + * Portable Audio Blocking Input/Output utility. + * + * Author: Phil Burk, http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +#include "ringbuffer.h" +#include "pablio.h" +#include + +/************************************************************************/ +/******** Constants *****************************************************/ +/************************************************************************/ + +#define FRAMES_PER_BUFFER (256) + +/************************************************************************/ +/******** Prototypes ****************************************************/ +/************************************************************************/ + +static int blockingIOCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ); +static PaError PABLIO_InitFIFO( RingBuffer *rbuf, long numFrames, long bytesPerFrame ); +static PaError PABLIO_TermFIFO( RingBuffer *rbuf ); + +/************************************************************************/ +/******** Functions *****************************************************/ +/************************************************************************/ + +/* Called from PortAudio. + * Read and write data only if there is room in FIFOs. + */ +static int blockingIOCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + PABLIO_Stream *data = (PABLIO_Stream*)userData; + long numBytes = data->bytesPerFrame * framesPerBuffer; + (void) outTime; + + /* This may get called with NULL inputBuffer during initial setup. */ + if( inputBuffer != NULL ) + { + RingBuffer_Write( &data->inFIFO, inputBuffer, numBytes ); + } + if( outputBuffer != NULL ) + { + int i; + int numRead = RingBuffer_Read( &data->outFIFO, outputBuffer, numBytes ); + /* Zero out remainder of buffer if we run out of data. */ + for( i=numRead; ibuffer ) free( rbuf->buffer ); + rbuf->buffer = NULL; + return paNoError; +} + +/************************************************************ + * Write data to ring buffer. + * Will not return until all the data has been written. + */ +long WriteAudioStream( PABLIO_Stream *aStream, void *data, long numFrames ) +{ + long bytesWritten; + char *p = (char *) data; + long numBytes = aStream->bytesPerFrame * numFrames; + while( numBytes > 0) + { + bytesWritten = RingBuffer_Write( &aStream->outFIFO, p, numBytes ); + numBytes -= bytesWritten; + p += bytesWritten; + if( numBytes > 0) Pa_Sleep(10); + } + return numFrames; +} + +/************************************************************ + * Read data from ring buffer. + * Will not return until all the data has been read. + */ +long ReadAudioStream( PABLIO_Stream *aStream, void *data, long numFrames ) +{ + long bytesRead; + char *p = (char *) data; + long numBytes = aStream->bytesPerFrame * numFrames; + while( numBytes > 0) + { + bytesRead = RingBuffer_Read( &aStream->inFIFO, p, numBytes ); + numBytes -= bytesRead; + p += bytesRead; + if( numBytes > 0) Pa_Sleep(10); + } + return numFrames; +} + +/************************************************************ + * Return the number of frames that could be written to the stream without + * having to wait. + */ +long GetAudioStreamWriteable( PABLIO_Stream *aStream ) +{ + int bytesEmpty = RingBuffer_GetWriteAvailable( &aStream->outFIFO ); + return bytesEmpty / aStream->bytesPerFrame; +} + +/************************************************************ + * Return the number of frames that are available to be read from the + * stream without having to wait. + */ +long GetAudioStreamReadable( PABLIO_Stream *aStream ) +{ + int bytesFull = RingBuffer_GetReadAvailable( &aStream->inFIFO ); + return bytesFull / aStream->bytesPerFrame; +} + +/************************************************************/ +static unsigned long RoundUpToNextPowerOf2( unsigned long n ) +{ + long numBits = 0; + if( ((n-1) & n) == 0) return n; /* Already Power of two. */ + while( n > 0 ) + { + n= n>>1; + numBits++; + } + return (1<samplesPerFrame = ((flags&PABLIO_MONO) != 0) ? 1 : 2; + aStream->bytesPerFrame = bytesPerSample * aStream->samplesPerFrame; + + /* Initialize PortAudio */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + /* Warning: numFrames must be larger than amount of data processed per interrupt + * inside PA to prevent glitches. Just to be safe, adjust size upwards. + */ + minNumBuffers = 2 * Pa_GetMinNumBuffers( FRAMES_PER_BUFFER, sampleRate ); + numFrames = minNumBuffers * FRAMES_PER_BUFFER; + numFrames = RoundUpToNextPowerOf2( numFrames ); + + /* Initialize Ring Buffers */ + doRead = ((flags & PABLIO_READ) != 0); + doWrite = ((flags & PABLIO_WRITE) != 0); + if(doRead) + { + err = PABLIO_InitFIFO( &aStream->inFIFO, numFrames, aStream->bytesPerFrame ); + if( err != paNoError ) goto error; + } + if(doWrite) + { + long numBytes; + err = PABLIO_InitFIFO( &aStream->outFIFO, numFrames, aStream->bytesPerFrame ); + if( err != paNoError ) goto error; + /* Make Write FIFO appear full initially. */ + numBytes = RingBuffer_GetWriteAvailable( &aStream->outFIFO ); + RingBuffer_AdvanceWriteIndex( &aStream->outFIFO, numBytes ); + } + + /* Open a PortAudio stream that we will use to communicate with the underlying + * audio drivers. */ + err = Pa_OpenStream( + &aStream->stream, + (doRead ? Pa_GetDefaultInputDeviceID() : paNoDevice), + (doRead ? aStream->samplesPerFrame : 0 ), + format, + NULL, + (doWrite ? Pa_GetDefaultOutputDeviceID() : paNoDevice), + (doWrite ? aStream->samplesPerFrame : 0 ), + format, + NULL, + sampleRate, + FRAMES_PER_BUFFER, + minNumBuffers, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + blockingIOCallback, + aStream ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( aStream->stream ); + if( err != paNoError ) goto error; + + *rwblPtr = aStream; + return paNoError; + +error: + CloseAudioStream( aStream ); + *rwblPtr = NULL; + return err; +} + +/************************************************************/ +PaError CloseAudioStream( PABLIO_Stream *aStream ) +{ + PaError err; + int bytesEmpty; + int byteSize = aStream->outFIFO.bufferSize; + + /* If we are writing data, make sure we play everything written. */ + if( byteSize > 0 ) + { + bytesEmpty = RingBuffer_GetWriteAvailable( &aStream->outFIFO ); + while( bytesEmpty < byteSize ) + { + Pa_Sleep( 10 ); + bytesEmpty = RingBuffer_GetWriteAvailable( &aStream->outFIFO ); + } + } + + err = Pa_StopStream( aStream->stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( aStream->stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + +error: + PABLIO_TermFIFO( &aStream->inFIFO ); + PABLIO_TermFIFO( &aStream->outFIFO ); + free( aStream ); + return err; +} diff --git a/portaudio-v19/pablio/pablio.def b/portaudio-v19/pablio/pablio.def new file mode 100644 index 000000000..a10f95291 --- /dev/null +++ b/portaudio-v19/pablio/pablio.def @@ -0,0 +1,35 @@ +LIBRARY PABLIO +DESCRIPTION 'PABLIO Portable Audio Blocking I/O' + +EXPORTS + ; Explicit exports can go here + Pa_Initialize @1 + Pa_Terminate @2 + Pa_GetHostError @3 + Pa_GetErrorText @4 + Pa_CountDevices @5 + Pa_GetDefaultInputDeviceID @6 + Pa_GetDefaultOutputDeviceID @7 + Pa_GetDeviceInfo @8 + Pa_OpenStream @9 + Pa_OpenDefaultStream @10 + Pa_CloseStream @11 + Pa_StartStream @12 + Pa_StopStream @13 + Pa_StreamActive @14 + Pa_StreamTime @15 + Pa_GetCPULoad @16 + Pa_GetMinNumBuffers @17 + Pa_Sleep @18 + + OpenAudioStream @19 + CloseAudioStream @20 + WriteAudioStream @21 + ReadAudioStream @22 + + Pa_GetSampleSize @23 + + ;123456789012345678901234567890123456 + ;000000000111111111122222222223333333 + + diff --git a/portaudio-v19/pablio/pablio.h b/portaudio-v19/pablio/pablio.h new file mode 100644 index 000000000..c1ad84a83 --- /dev/null +++ b/portaudio-v19/pablio/pablio.h @@ -0,0 +1,109 @@ +#ifndef _PABLIO_H +#define _PABLIO_H + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/* + * $Id$ + * PABLIO.h + * Portable Audio Blocking read/write utility. + * + * Author: Phil Burk, http://www.softsynth.com/portaudio/ + * + * Include file for PABLIO, the Portable Audio Blocking I/O Library. + * PABLIO is built on top of PortAudio, the Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +#include "ringbuffer.h" +#include + +typedef struct +{ + RingBuffer inFIFO; + RingBuffer outFIFO; + PortAudioStream *stream; + int bytesPerFrame; + int samplesPerFrame; +} +PABLIO_Stream; + +/* Values for flags for OpenAudioStream(). */ +#define PABLIO_READ (1<<0) +#define PABLIO_WRITE (1<<1) +#define PABLIO_READ_WRITE (PABLIO_READ|PABLIO_WRITE) +#define PABLIO_MONO (1<<2) +#define PABLIO_STEREO (1<<3) + +/************************************************************ + * Write data to ring buffer. + * Will not return until all the data has been written. + */ +long WriteAudioStream( PABLIO_Stream *aStream, void *data, long numFrames ); + +/************************************************************ + * Read data from ring buffer. + * Will not return until all the data has been read. + */ +long ReadAudioStream( PABLIO_Stream *aStream, void *data, long numFrames ); + +/************************************************************ + * Return the number of frames that could be written to the stream without + * having to wait. + */ +long GetAudioStreamWriteable( PABLIO_Stream *aStream ); + +/************************************************************ + * Return the number of frames that are available to be read from the + * stream without having to wait. + */ +long GetAudioStreamReadable( PABLIO_Stream *aStream ); + +/************************************************************ + * Opens a PortAudio stream with default characteristics. + * Allocates PABLIO_Stream structure. + * + * flags parameter can be an ORed combination of: + * PABLIO_READ, PABLIO_WRITE, or PABLIO_READ_WRITE, + * and either PABLIO_MONO or PABLIO_STEREO + */ +PaError OpenAudioStream( PABLIO_Stream **aStreamPtr, double sampleRate, + PaSampleFormat format, long flags ); + +PaError CloseAudioStream( PABLIO_Stream *aStream ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* _PABLIO_H */ diff --git a/portaudio-v19/pablio/ringbuffer.c b/portaudio-v19/pablio/ringbuffer.c new file mode 100644 index 000000000..16031fef6 --- /dev/null +++ b/portaudio-v19/pablio/ringbuffer.c @@ -0,0 +1,199 @@ +/* + * $Id$ + * ringbuffer.c + * Ring Buffer utility.. + * + * Author: Phil Burk, http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "ringbuffer.h" +#include + +/*************************************************************************** + * Initialize FIFO. + * numBytes must be power of 2, returns -1 if not. + */ +long RingBuffer_Init( RingBuffer *rbuf, long numBytes, void *dataPtr ) +{ + if( ((numBytes-1) & numBytes) != 0) return -1; /* Not Power of two. */ + rbuf->bufferSize = numBytes; + rbuf->buffer = (char *)dataPtr; + RingBuffer_Flush( rbuf ); + rbuf->bigMask = (numBytes*2)-1; + rbuf->smallMask = (numBytes)-1; + return 0; +} +/*************************************************************************** +** Return number of bytes available for reading. */ +long RingBuffer_GetReadAvailable( RingBuffer *rbuf ) +{ + return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask ); +} +/*************************************************************************** +** Return number of bytes available for writing. */ +long RingBuffer_GetWriteAvailable( RingBuffer *rbuf ) +{ + return ( rbuf->bufferSize - RingBuffer_GetReadAvailable(rbuf)); +} + +/*************************************************************************** +** Clear buffer. Should only be called when buffer is NOT being read. */ +void RingBuffer_Flush( RingBuffer *rbuf ) +{ + rbuf->writeIndex = rbuf->readIndex = 0; +} + +/*************************************************************************** +** Get address of region(s) to which we can write data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetWriteRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ) +{ + long index; + long available = RingBuffer_GetWriteAvailable( rbuf ); + if( numBytes > available ) numBytes = available; + /* Check to see if write is not contiguous. */ + index = rbuf->writeIndex & rbuf->smallMask; + if( (index + numBytes) > rbuf->bufferSize ) + { + /* Write data in two blocks that wrap the buffer. */ + long firstHalf = rbuf->bufferSize - index; + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = firstHalf; + *dataPtr2 = &rbuf->buffer[0]; + *sizePtr2 = numBytes - firstHalf; + } + else + { + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = numBytes; + *dataPtr2 = NULL; + *sizePtr2 = 0; + } + return numBytes; +} + + +/*************************************************************************** +*/ +long RingBuffer_AdvanceWriteIndex( RingBuffer *rbuf, long numBytes ) +{ + return rbuf->writeIndex = (rbuf->writeIndex + numBytes) & rbuf->bigMask; +} + +/*************************************************************************** +** Get address of region(s) from which we can read data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetReadRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ) +{ + long index; + long available = RingBuffer_GetReadAvailable( rbuf ); + if( numBytes > available ) numBytes = available; + /* Check to see if read is not contiguous. */ + index = rbuf->readIndex & rbuf->smallMask; + if( (index + numBytes) > rbuf->bufferSize ) + { + /* Write data in two blocks that wrap the buffer. */ + long firstHalf = rbuf->bufferSize - index; + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = firstHalf; + *dataPtr2 = &rbuf->buffer[0]; + *sizePtr2 = numBytes - firstHalf; + } + else + { + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = numBytes; + *dataPtr2 = NULL; + *sizePtr2 = 0; + } + return numBytes; +} +/*************************************************************************** +*/ +long RingBuffer_AdvanceReadIndex( RingBuffer *rbuf, long numBytes ) +{ + return rbuf->readIndex = (rbuf->readIndex + numBytes) & rbuf->bigMask; +} + +/*************************************************************************** +** Return bytes written. */ +long RingBuffer_Write( RingBuffer *rbuf, void *data, long numBytes ) +{ + long size1, size2, numWritten; + void *data1, *data2; + numWritten = RingBuffer_GetWriteRegions( rbuf, numBytes, &data1, &size1, &data2, &size2 ); + if( size2 > 0 ) + { + + memcpy( data1, data, size1 ); + data = ((char *)data) + size1; + memcpy( data2, data, size2 ); + } + else + { + memcpy( data1, data, size1 ); + } + RingBuffer_AdvanceWriteIndex( rbuf, numWritten ); + return numWritten; +} + +/*************************************************************************** +** Return bytes read. */ +long RingBuffer_Read( RingBuffer *rbuf, void *data, long numBytes ) +{ + long size1, size2, numRead; + void *data1, *data2; + numRead = RingBuffer_GetReadRegions( rbuf, numBytes, &data1, &size1, &data2, &size2 ); + if( size2 > 0 ) + { + memcpy( data, data1, size1 ); + data = ((char *)data) + size1; + memcpy( data, data2, size2 ); + } + else + { + memcpy( data, data1, size1 ); + } + RingBuffer_AdvanceReadIndex( rbuf, numRead ); + return numRead; +} diff --git a/portaudio-v19/pablio/ringbuffer.h b/portaudio-v19/pablio/ringbuffer.h new file mode 100644 index 000000000..dd769bee6 --- /dev/null +++ b/portaudio-v19/pablio/ringbuffer.h @@ -0,0 +1,101 @@ +#ifndef _RINGBUFFER_H +#define _RINGBUFFER_H +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/* + * $Id$ + * ringbuffer.h + * Ring Buffer utility.. + * + * Author: Phil Burk, http://www.softsynth.com + * + * This program is distributed with the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "ringbuffer.h" +#include + +typedef struct +{ + long bufferSize; /* Number of bytes in FIFO. Power of 2. Set by RingBuffer_Init. */ + long writeIndex; /* Index of next writable byte. Set by RingBuffer_AdvanceWriteIndex. */ + long readIndex; /* Index of next readable byte. Set by RingBuffer_AdvanceReadIndex. */ + long bigMask; /* Used for wrapping indices with extra bit to distinguish full/empty. */ + long smallMask; /* Used for fitting indices to buffer. */ + char *buffer; +} +RingBuffer; +/* + * Initialize Ring Buffer. + * numBytes must be power of 2, returns -1 if not. + */ +long RingBuffer_Init( RingBuffer *rbuf, long numBytes, void *dataPtr ); + +/* Clear buffer. Should only be called when buffer is NOT being read. */ +void RingBuffer_Flush( RingBuffer *rbuf ); + +/* Return number of bytes available for writing. */ +long RingBuffer_GetWriteAvailable( RingBuffer *rbuf ); +/* Return number of bytes available for read. */ +long RingBuffer_GetReadAvailable( RingBuffer *rbuf ); +/* Return bytes written. */ +long RingBuffer_Write( RingBuffer *rbuf, void *data, long numBytes ); +/* Return bytes read. */ +long RingBuffer_Read( RingBuffer *rbuf, void *data, long numBytes ); + +/* Get address of region(s) to which we can write data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetWriteRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ); +long RingBuffer_AdvanceWriteIndex( RingBuffer *rbuf, long numBytes ); + +/* Get address of region(s) from which we can read data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetReadRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ); + +long RingBuffer_AdvanceReadIndex( RingBuffer *rbuf, long numBytes ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* _RINGBUFFER_H */ diff --git a/portaudio-v19/pablio/test_rw.c b/portaudio-v19/pablio/test_rw.c new file mode 100644 index 000000000..7f7e886ac --- /dev/null +++ b/portaudio-v19/pablio/test_rw.c @@ -0,0 +1,99 @@ +/* + * $Id$ + * test_rw.c + * Read input from one stream and write it to another. + * + * Author: Phil Burk, http://www.softsynth.com/portaudio/ + * + * This program uses PABLIO, the Portable Audio Blocking I/O Library. + * PABLIO is built on top of PortAudio, the Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "pablio.h" + +/* +** Note that many of the older ISA sound cards on PCs do NOT support +** full duplex audio (simultaneous record and playback). +** And some only support full duplex at lower sample rates. +*/ +#define SAMPLE_RATE (44100) +#define NUM_SECONDS (5) +#define SAMPLES_PER_FRAME (2) +#define FRAMES_PER_BLOCK (64) + +/* Select whether we will use floats or shorts. */ +#if 1 +#define SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#else +#define SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#endif + +/*******************************************************************/ +int main(void); +int main(void) +{ + int i; + SAMPLE samples[SAMPLES_PER_FRAME * FRAMES_PER_BLOCK]; + PaError err; + PABLIO_Stream *aStream; + + printf("Full duplex sound test using PortAudio and RingBuffers\n"); + fflush(stdout); + + /* Open simplified blocking I/O layer on top of PortAudio. */ + err = OpenAudioStream( &aStream, SAMPLE_RATE, SAMPLE_TYPE, + (PABLIO_READ_WRITE | PABLIO_STEREO) ); + if( err != paNoError ) goto error; + + /* Process samples in the foreground. */ + for( i=0; i<(NUM_SECONDS * SAMPLE_RATE); i += FRAMES_PER_BLOCK ) + { + /* Read one block of data into sample array from audio input. */ + ReadAudioStream( aStream, samples, FRAMES_PER_BLOCK ); + /* Write that same block of data to output. */ + WriteAudioStream( aStream, samples, FRAMES_PER_BLOCK ); + } + + CloseAudioStream( aStream ); + + printf("Full duplex sound test complete.\n" ); + fflush(stdout); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return -1; +} diff --git a/portaudio-v19/pablio/test_rw_echo.c b/portaudio-v19/pablio/test_rw_echo.c new file mode 100644 index 000000000..9ba8c8d12 --- /dev/null +++ b/portaudio-v19/pablio/test_rw_echo.c @@ -0,0 +1,123 @@ +/* + * $Id$ + * test_rw_echo.c + * Echo delayed input to output. + * + * Author: Phil Burk, http://www.softsynth.com/portaudio/ + * + * This program uses PABLIO, the Portable Audio Blocking I/O Library. + * PABLIO is built on top of PortAudio, the Portable Audio Library. + * + * Note that if you need low latency, you should not use PABLIO. + * Use the PA_OpenStream callback technique which is lower level + * than PABLIO. + * + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include +#include "pablio.h" +#include + +/* +** Note that many of the older ISA sound cards on PCs do NOT support +** full duplex audio (simultaneous record and playback). +** And some only support full duplex at lower sample rates. +*/ +#define SAMPLE_RATE (22050) +#define NUM_SECONDS (20) +#define SAMPLES_PER_FRAME (2) + +/* Select whether we will use floats or shorts. */ +#if 1 +#define SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#else +#define SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#endif + +#define NUM_ECHO_FRAMES (2*SAMPLE_RATE) +SAMPLE samples[NUM_ECHO_FRAMES][SAMPLES_PER_FRAME] = {0.0}; + +/*******************************************************************/ +int main(void); +int main(void) +{ + int i; + PaError err; + PABLIO_Stream *aInStream; + PABLIO_Stream *aOutStream; + int index; + + printf("Full duplex sound test using PABLIO\n"); + fflush(stdout); + + /* Open simplified blocking I/O layer on top of PortAudio. */ + /* Open input first so it can start to fill buffers. */ + err = OpenAudioStream( &aInStream, SAMPLE_RATE, SAMPLE_TYPE, + (PABLIO_READ | PABLIO_STEREO) ); + if( err != paNoError ) goto error; + /* printf("opened input\n"); fflush(stdout); /**/ + + err = OpenAudioStream( &aOutStream, SAMPLE_RATE, SAMPLE_TYPE, + (PABLIO_WRITE | PABLIO_STEREO) ); + if( err != paNoError ) goto error; + /* printf("opened output\n"); fflush(stdout); /**/ + + /* Process samples in the foreground. */ + index = 0; + for( i=0; i<(NUM_SECONDS * SAMPLE_RATE); i++ ) + { + /* Write old frame of data to output. */ + /* samples[index][1] = (i&256) * (1.0f/256.0f); /* sawtooth */ + WriteAudioStream( aOutStream, &samples[index][0], 1 ); + + /* Read one frame of data into sample array for later output. */ + ReadAudioStream( aInStream, &samples[index][0], 1 ); + index += 1; + if( index >= NUM_ECHO_FRAMES ) index = 0; + + if( (i & 0xFFFF) == 0 ) printf("i = %d\n", i ); fflush(stdout); /**/ + } + + CloseAudioStream( aOutStream ); + CloseAudioStream( aInStream ); + + printf("R/W echo sound test complete.\n" ); + fflush(stdout); + return 0; + +error: + fprintf( stderr, "An error occured while using PortAudio\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return -1; +} diff --git a/portaudio-v19/pablio/test_w_saw.c b/portaudio-v19/pablio/test_w_saw.c new file mode 100644 index 000000000..d5d4e9be5 --- /dev/null +++ b/portaudio-v19/pablio/test_w_saw.c @@ -0,0 +1,108 @@ +/* + * $Id$ + * test_w_saw.c + * Generate stereo sawtooth waveforms. + * + * Author: Phil Burk, http://www.softsynth.com + * + * This program uses PABLIO, the Portable Audio Blocking I/O Library. + * PABLIO is built on top of PortAudio, the Portable Audio Library. + * + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include +#include "pablio.h" +#include + +#define SAMPLE_RATE (44100) +#define NUM_SECONDS (6) +#define SAMPLES_PER_FRAME (2) + +#define FREQUENCY (220.0f) +#define PHASE_INCREMENT (2.0f * FREQUENCY / SAMPLE_RATE) +#define FRAMES_PER_BLOCK (100) + +float samples[FRAMES_PER_BLOCK][SAMPLES_PER_FRAME]; +float phases[SAMPLES_PER_FRAME]; + +/*******************************************************************/ +int main(void); +int main(void) +{ + int i,j; + PaError err; + PABLIO_Stream *aOutStream; + + printf("Generate sawtooth waves using PABLIO.\n"); + fflush(stdout); + + /* Open simplified blocking I/O layer on top of PortAudio. */ + err = OpenAudioStream( &aOutStream, SAMPLE_RATE, paFloat32, + (PABLIO_WRITE | PABLIO_STEREO) ); + if( err != paNoError ) goto error; + + /* Initialize oscillator phases. */ + phases[0] = 0.0; + phases[1] = 0.0; + + for( i=0; i<(NUM_SECONDS * SAMPLE_RATE); i += FRAMES_PER_BLOCK ) + { + /* Generate sawtooth waveforms in a block for efficiency. */ + for( j=0; j 1.0f ) phases[0] -= 2.0f; + samples[j][0] = phases[0]; + + /* On the second channel, generate a sawtooth wave a fifth higher. */ + phases[1] += PHASE_INCREMENT * (3.0f / 2.0f); + if( phases[1] > 1.0f ) phases[1] -= 2.0f; + samples[j][1] = phases[1]; + } + + /* Write samples to output. */ + WriteAudioStream( aOutStream, samples, FRAMES_PER_BLOCK ); + } + + CloseAudioStream( aOutStream ); + + printf("Sawtooth sound test complete.\n" ); + fflush(stdout); + return 0; + +error: + fprintf( stderr, "An error occured while using PABLIO\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return -1; +} diff --git a/portaudio-v19/pablio/test_w_saw8.c b/portaudio-v19/pablio/test_w_saw8.c new file mode 100644 index 000000000..0a9d05abd --- /dev/null +++ b/portaudio-v19/pablio/test_w_saw8.c @@ -0,0 +1,106 @@ +/* + * $Id$ + * test_w_saw8.c + * Generate stereo 8 bit sawtooth waveforms. + * + * Author: Phil Burk, http://www.softsynth.com + * + * This program uses PABLIO, the Portable Audio Blocking I/O Library. + * PABLIO is built on top of PortAudio, the Portable Audio Library. + * + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include +#include "pablio.h" +#include + +#define SAMPLE_RATE (22050) +#define NUM_SECONDS (6) +#define SAMPLES_PER_FRAME (2) + + +#define FRAMES_PER_BLOCK (100) + +unsigned char samples[FRAMES_PER_BLOCK][SAMPLES_PER_FRAME]; +unsigned char phases[SAMPLES_PER_FRAME]; + +/*******************************************************************/ +int main(void); +int main(void) +{ + int i,j; + PaError err; + PABLIO_Stream *aOutStream; + + printf("Generate unsigned 8 bit sawtooth waves using PABLIO.\n"); + fflush(stdout); + + /* Open simplified blocking I/O layer on top of PortAudio. */ + err = OpenAudioStream( &aOutStream, SAMPLE_RATE, paUInt8, + (PABLIO_WRITE | PABLIO_STEREO) ); + if( err != paNoError ) goto error; + + /* Initialize oscillator phases to "ground" level for paUInt8. */ + phases[0] = 128; + phases[1] = 128; + + for( i=0; i<(NUM_SECONDS * SAMPLE_RATE); i += FRAMES_PER_BLOCK ) + { + /* Generate sawtooth waveforms in a block for efficiency. */ + for( j=0; j Date: Thu, 6 Jul 2006 13:44:34 +0000 Subject: [PATCH 130/811] - Cleaned up portaudio-v19 compile/clean a bit - Fixed more missing merges, start_threads needs to pass PttPort, devin_name devout_name - start_oss.c needs to use devin_name, devout_name git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@190 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 11 +++++++++-- audio_init.F90 | 2 +- configure | 14 ++++++++++---- configure.ac | 3 +++ portaudio-v19/config.status | 2 +- start_oss.c | 36 ++++++++++++++++++++---------------- 6 files changed, 44 insertions(+), 24 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6e972d920..4ee345e89 100644 --- a/Makefile.in +++ b/Makefile.in @@ -86,15 +86,22 @@ OBJS2C = ${SRCS2C:.c=.o} # and mostly sorted # --db # +# @NEEDPORTAUDIO@ will be filled in with libportaudio.a if portaudio is used +# SRCS3C = ptt_unix.c igray.c wrapkarn.c cutil.c OBJS3C = ${SRCS3C:.c=.o} AUDIOSRCS = @AUDIO@ all: wsjt6 + JT65code: $(OBJS1) $(FC) -o JT65code $(OBJS1) -wsjt6: Audio.so #wsjt.spec +portaudio-v19/lib/libportaudio.a: + (cd portaudio-v19;./configure --with-jack=no) + (cd portaudio-v19;${MAKE}) + +wsjt6: @NEEDPORTAUDIO@ Audio.so #wsjt.spec # ${PYTHON} c:\python23\installer\Build.py wsjt.spec # ${RM} wsjt6 @@ -116,4 +123,4 @@ wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py .PHONY : clean clean: ${RM} -f *.o *.so *~ JT65code wsjt6 - + (cd portaudio-v19;${MAKE} clean) diff --git a/audio_init.F90 b/audio_init.F90 index ff6cd46b0..92bbb7c1e 100644 --- a/audio_init.F90 +++ b/audio_init.F90 @@ -70,7 +70,7 @@ subroutine audio_init(ndin,ndout) ! print*,'Audio INIT called.' ierr=start_threads(ndevin,ndevout,y1,y2,nmax,iwrite,iwave,nwave, & 11025,NSPB,TRPeriod,TxOK,ndebug,Transmitting, & - Tsec,ngo,nmode,tbuf,ibuf,ndsec) + Tsec,ngo,nmode,tbuf,ibuf,ndsec,PttPort,devin_name,devout_name) #endif diff --git a/configure b/configure index f9c47fc8c..f0e4329a0 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 185 2006-07-05 03:49:02Z va3db $ +# $Id: configure.ac 187 2006-07-05 15:32:17Z va3db $ # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -311,7 +311,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT F77 FFLAGS ac_ct_F77 CPP EGREP SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RM CP MV LN SED AR LD TEST PYTHON F2PY G95 GFORTRAN OS CLOBBER FC_LIB_PATH FC AUDIO LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT F77 FFLAGS ac_ct_F77 CPP EGREP SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RM CP MV LN SED AR LD TEST PYTHON F2PY G95 GFORTRAN OS CLOBBER FC_LIB_PATH FC AUDIO NEEDPORTAUDIO LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -977,7 +977,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 185 2006-07-05 03:49:02Z va3db $ +$Id: configure.ac 187 2006-07-05 15:32:17Z va3db $ _ACEOF exit 0 fi @@ -6749,7 +6749,12 @@ _ACEOF AUDIO="a2d.f90 jtaudio.c start_portaudio.c" - LDFLAGS="-Lportaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" + NEEDPORTAUDIO="portaudio-v19/lib/libportaudio.a" + + LDFLAGS="portaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" +else + NEEDPORTAUDIO="" + fi if test "$jack" = yes; then @@ -7517,6 +7522,7 @@ s,@CLOBBER@,$CLOBBER,;t t s,@FC_LIB_PATH@,$FC_LIB_PATH,;t t s,@FC@,$FC,;t t s,@AUDIO@,$AUDIO,;t t +s,@NEEDPORTAUDIO@,$NEEDPORTAUDIO,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF diff --git a/configure.ac b/configure.ac index a83829d62..c7fb69c62 100644 --- a/configure.ac +++ b/configure.ac @@ -314,7 +314,10 @@ fi if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c") + AC_SUBST(NEEDPORTAUDIO, "portaudio-v19/lib/libportaudio.a") LDFLAGS="-Lportaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" +else + AC_SUBST(NEEDPORTAUDIO, "") fi if test "$jack" = yes; then diff --git a/portaudio-v19/config.status b/portaudio-v19/config.status index 9ca00d332..d2b8f073e 100755 --- a/portaudio-v19/config.status +++ b/portaudio-v19/config.status @@ -35,7 +35,7 @@ sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g; s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF /^[ ]*VPATH[ ]*=[^:]*$/d -s%@SHELL@%/usr/local/bin/bash%g +s%@SHELL@%/bin/sh%g s%@CFLAGS@%-g -O2 -Wall -pedantic -pipe -fPIC -DPA_LITTLE_ENDIAN%g s%@CPPFLAGS@%%g s%@CXXFLAGS@%%g diff --git a/start_oss.c b/start_oss.c index c241829e3..6009be2fc 100644 --- a/start_oss.c +++ b/start_oss.c @@ -80,7 +80,8 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int *nwave, int *nfsample, int *nsamperbuf, int *TRPeriod, int *TxOK, int *ndebug, int *Transmitting, double *Tsec, int *ngo, int *nmode, - double tbuf[], int *ibuf, int *ndsec) + double tbuf[], int *ibuf, int *ndsec, + char *PttPort, char *devin_name, char *devout_name) { pthread_t thread1,thread2; int iret1,iret2; @@ -90,14 +91,19 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int format; int channels; double dnfs; + int i; + char *p; + + p = strchr(devin_name, ' '); + if(p != NULL) + *p = '\0'; + + p = strchr(devin_name, '/'); + if(p != NULL) + snprintf(dsp_in, MAXDSPNAME, "%s", devin_name); /* assume /dev/... */ + else + snprintf(dsp_in, MAXDSPNAME, "/dev/%s", devin_name); - /* XXX OSS device is decoded from ndevin and ndevout - * This is not strictly speaking the way to do it and is - * probably specific to FreeBSD for now. - * i.e. the .0 addition is a vchan; I'll add configure magic later. --db - */ - snprintf(dsp_in, MAXDSPNAME, - "/dev/dsp%d.0", *ndevin); dsp_in[MAXDSPNAME] = '\0'; data.fd_in = open (dsp_in, O_RDWR, 0); @@ -107,15 +113,13 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], exit(-1); } - if (*ndevin == *ndevout) { - data.fd_out = data.fd_in; - strncpy(dsp_out, dsp_in, sizeof(dsp_out)); - dsp_out[sizeof(dsp_out)] = '\0'; + data.fd_out = data.fd_in; + strncpy(dsp_out, dsp_in, sizeof(dsp_out)); + dsp_out[sizeof(dsp_out)] = '\0'; - if (ioctl(data.fd_in, SNDCTL_DSP_SETDUPLEX, 0) < 0) { - fprintf(stderr, "Cannot use %s for full duplex.\n", dsp_in); - exit(-1); - } + if (ioctl(data.fd_in, SNDCTL_DSP_SETDUPLEX, 0) < 0) { + fprintf(stderr, "Cannot use %s for full duplex.\n", dsp_in); + return(-1); } data.Tsec = Tsec; From f788c5cfa7f93f54a39bcb2da1d4d40ef22854b0 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Thu, 6 Jul 2006 13:54:56 +0000 Subject: [PATCH 131/811] - fixed typo that prevented WSJT from going into transmit git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@191 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- fivehz.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fivehz.F90 b/fivehz.F90 index 2e25971ed..c18e70a1b 100644 --- a/fivehz.F90 +++ b/fivehz.F90 @@ -108,7 +108,7 @@ subroutine fivehz if(.not.txtime .or. mute.eq.1) TxOK=0 !Lower TxOK else if(mantx.eq.1 .and. iptt.eq.0 .and. & - mute.eq.0) i2=ptt(nport,1,pttport,iptt) !Raise PTT + mute.eq.0) i2=ptt(nport,pttport,1,iptt) !Raise PTT if(mantx.eq.0 .or. mute.eq.1) TxOK=0 !Lower TxOK endif From f67ddfba36d283896985573513734b6480c4f6a1 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Thu, 6 Jul 2006 20:52:38 +0000 Subject: [PATCH 132/811] - Missing line broke start_oss.c on transmit git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@192 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/start_oss.c b/start_oss.c index 6009be2fc..513d4ce69 100644 --- a/start_oss.c +++ b/start_oss.c @@ -258,7 +258,8 @@ oss_loop(int *iarg) *(data.Tsec) = stime; if(*(data.TxOK) && (!TxOKz)) { - n=nsec/(*(data.trperiod)); + nsec = (int)stime; + n = nsec/(*(data.trperiod)); ic = (int)(stime - *(data.trperiod)*n) * data.nfs; ic = ic % *(data.nwave); } @@ -266,7 +267,7 @@ oss_loop(int *iarg) TxOKz = *(data.TxOK); *(data.Transmitting) = *(data.TxOK); wptr = (int16_t *)tx_buf; /* XXX */ - if(*(data.TxOK)) { + if(*(data.TxOK)) { for(i=0 ; i Date: Thu, 6 Jul 2006 20:54:51 +0000 Subject: [PATCH 133/811] - simple cleanup of style, no code changes git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@193 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/start_oss.c b/start_oss.c index 513d4ce69..c257e960d 100644 --- a/start_oss.c +++ b/start_oss.c @@ -94,10 +94,12 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int i; char *p; + /* Remove space if present */ p = strchr(devin_name, ' '); if(p != NULL) *p = '\0'; + /* If there is a '/' in the name assume it is /dev/name */ p = strchr(devin_name, '/'); if(p != NULL) snprintf(dsp_in, MAXDSPNAME, "%s", devin_name); /* assume /dev/... */ @@ -106,9 +108,9 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], dsp_in[MAXDSPNAME] = '\0'; - data.fd_in = open (dsp_in, O_RDWR, 0); + data.fd_in = open(dsp_in, O_RDWR, 0); - if (data.fd_in < 0) { + if(data.fd_in < 0) { fprintf(stderr, "Cannot open %s for input.\n", dsp_in); exit(-1); } @@ -117,7 +119,7 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], strncpy(dsp_out, dsp_in, sizeof(dsp_out)); dsp_out[sizeof(dsp_out)] = '\0'; - if (ioctl(data.fd_in, SNDCTL_DSP_SETDUPLEX, 0) < 0) { + if(ioctl(data.fd_in, SNDCTL_DSP_SETDUPLEX, 0) < 0) { fprintf(stderr, "Cannot use %s for full duplex.\n", dsp_in); return(-1); } @@ -142,23 +144,23 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], dnfs=(double)*nfsample; channels = 2; - if (ioctl (data.fd_in, SNDCTL_DSP_CHANNELS, &channels) == -1) { + if(ioctl (data.fd_in, SNDCTL_DSP_CHANNELS, &channels) == -1) { fprintf (stderr, "Unable to set 2 channels for input.\n"); exit (-1); } - if (channels != 2) { + if(channels != 2) { fprintf (stderr, "Unable to set 2 channels.\n"); exit (-1); } format = AFMT_S16_NE; - if (ioctl (data.fd_in, SNDCTL_DSP_SETFMT, &format) == -1) { + if(ioctl (data.fd_in, SNDCTL_DSP_SETFMT, &format) == -1) { fprintf (stderr, "Unable to set format for input.\n"); exit (-1); } - if (ioctl (data.fd_in, SNDCTL_DSP_SPEED, &rate) == -1) { + if(ioctl (data.fd_in, SNDCTL_DSP_SPEED, &rate) == -1) { fprintf (stderr, "Unable to set rate for input\n"); exit (-1); } @@ -213,14 +215,14 @@ oss_loop(int *iarg) FD_SET(data.fd_out, &writefds); timeout.tv_usec = TIMEOUT; - if (select(FD_SETSIZE, &readfds, &writefds, NULL, &timeout) > 0) { - if (FD_ISSET(data.fd_in, &readfds)) { + if(select(FD_SETSIZE, &readfds, &writefds, NULL, &timeout) > 0) { + if(FD_ISSET(data.fd_in, &readfds)) { nread = read (data.fd_in, rcv_buf, AUDIOBUFSIZE); - if (nread <= 0) { + if(nread <= 0) { fprintf(stderr, "Read error %d\n", nread); return; } - if (nread == AUDIOBUFSIZE) { + if(nread == AUDIOBUFSIZE) { /* Get System time */ gettimeofday(&tv, NULL); stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + @@ -250,25 +252,25 @@ oss_loop(int *iarg) fivehz_(); /* Call fortran routine */ } } - if (FD_ISSET(data.fd_in, &writefds)) { + if(FD_ISSET(data.fd_in, &writefds)) { /* Get System time */ gettimeofday(&tv, NULL); stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + *(data.ndsec) * 0.1; *(data.Tsec) = stime; - if(*(data.TxOK) && (!TxOKz)) { + if(*(data.TxOK) && (!TxOKz)) { nsec = (int)stime; - n = nsec/(*(data.trperiod)); - ic = (int)(stime - *(data.trperiod)*n) * data.nfs; + n = nsec / *(data.trperiod); + ic = (int)(stime - *(data.trperiod) * n) * data.nfs; ic = ic % *(data.nwave); } TxOKz = *(data.TxOK); *(data.Transmitting) = *(data.TxOK); wptr = (int16_t *)tx_buf; /* XXX */ - if(*(data.TxOK)) { - for(i=0 ; i Date: Thu, 6 Jul 2006 21:23:58 +0000 Subject: [PATCH 134/811] - All other 'c' functions include both and might as well be consistent. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@194 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_portaudio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/start_portaudio.c b/start_portaudio.c index 1904e526f..ff6c87434 100644 --- a/start_portaudio.c +++ b/start_portaudio.c @@ -3,6 +3,7 @@ #include #include #include +#include extern void decode1_(int *iarg); extern void a2d_(int *iarg); From 91cae5bd11b3e3cbaf3b16376c810a45f6483b14 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 9 Jul 2006 03:12:26 +0000 Subject: [PATCH 135/811] - Fixed compile for linux git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@195 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_unix.c | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/ptt_unix.c b/ptt_unix.c index afcb99130..ba5578263 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -50,11 +50,11 @@ #ifdef HAVE_DEV_PPBUS_PPI_H # include # include +#endif int lp_reset (int fd); int lp_ptt (int fd, int onoff); -#endif #ifdef HAVE_SYS_STAT_H # include #endif @@ -82,11 +82,13 @@ char nm[MAXPATHLEN]; * * generic unix PTT routine called from Fortran * - * unused - Unused, to satisfy old windows calling convention - * ptt_port - device name serial or parallel - * ntx - pointer to fortran command on or off - * iptt - pointer to fortran command status on or off - */ + * Inputs + * unused Unused, to satisfy old windows calling convention + * ptt_port device name serial or parallel + * ntx pointer to fortran command on or off + * iptt pointer to fortran command status on or off + * Returns - non 0 if error +*/ /* Tiny state machine */ #define STATE_PORT_CLOSED 0 @@ -166,8 +168,6 @@ ptt_serial(int fd, int *ntx, int *iptt) /* parport functions */ -int lp_reset (int fd); -int lp_ptt (int fd, int onoff); /* * dev_is_parport(name): check to see whether 'name' is a parallel @@ -183,21 +183,22 @@ dev_is_parport(const char *fname) { struct stat st; int fd; + int m; snprintf(nm, sizeof(nm), "/dev/%s", fname); if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) - return (-1); + return(-1); if (fstat(fd, &st) == -1) goto out; if ((st.st_mode & S_IFMT) != S_IFCHR) goto out; if (ioctl(fd, PPGETMODE, &m) == -1) goto out; - return (fd); + return(fd); out: close(fd); - return (-1); + return(-1); } #elif defined(HAVE_DEV_PPBUS_PPI_H) /* FreeBSD (ppbus/ppi) */ @@ -216,17 +217,17 @@ dev_is_parport(const char *fname) snprintf(nm, sizeof(nm), "/dev/%s", fname); if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) - return (-1); + return(-1); if (fstat(fd, &st) == -1) goto out; if ((st.st_mode & S_IFMT) != S_IFCHR) goto out; if (ioctl(fd, PPISSTATUS, &c) == -1) goto out; - return (fd); + return(fd); out: close(fd); - return (-1); + return(-1); } #else /* Fallback (nothing) */ @@ -234,7 +235,7 @@ out: int dev_is_parport(const char *fname) { - return (-1); + return(-1); } #endif @@ -294,21 +295,21 @@ lp_init (int fd) { fprintf(stderr, "Setting parallel port mode"); close (fd); - exit (1); + return(-1); } if (ioctl (fd, PPEXCL, NULL) == -1) { - fprintf(stderr, "Parallel port %s is already in use", dev->desc); + fprintf(stderr, "Parallel port is already in use.\n"); close (fd); - exit (1); + return(-1); } if (ioctl (fd, PPCLAIM, NULL) == -1) { - fprintf(stderr, "Claiming parallel port %s", dev->desc); - debug ("HINT: did you unload the lp kernel module?"); + fprintf(stderr, "Claiming parallel port.\n"); + fprintf(stderr, "HINT: did you unload the lp kernel module?"); close (fd); - exit (1); + return(-1); } /* Enable CW & PTT - /STROBE bit (pin 1) */ @@ -318,7 +319,7 @@ lp_init (int fd) parport_control (fd, STROBE, STROBE); #endif lp_reset (fd); - return 0; + return(0); } /* release ppdev and close port */ @@ -338,7 +339,7 @@ lp_free (int fd) parport_control (fd, STROBE, 0); #endif close (fd); - return 0; + return(0); } /* set to a known state */ @@ -348,7 +349,7 @@ lp_reset (int fd) #if defined (HAVE_LINUX_PPDEV_H) || defined (HAVE_DEV_PPBUS_PPI_H) lp_ptt (fd, 0); #endif - return 0; + return(0); } /* SSB PTT keying - /INIT bit (pin 16) (inverted) */ @@ -369,7 +370,7 @@ lp_ptt (int fd, int onoff) else parport_control (fd, nINIT, 0); #endif - return 0; + return(0); } /* From 1d7a6a6c7adf9f20d99253e9c0f61482c34147ba Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 9 Jul 2006 15:54:37 +0000 Subject: [PATCH 136/811] - remove CRLF git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@196 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- WSJT_Source_Code.txt | 566 +++++++++++++++++++++---------------------- 1 file changed, 283 insertions(+), 283 deletions(-) diff --git a/WSJT_Source_Code.txt b/WSJT_Source_Code.txt index fa0a2d0a0..4b962f3f2 100755 --- a/WSJT_Source_Code.txt +++ b/WSJT_Source_Code.txt @@ -1,283 +1,283 @@ - WSJT DEVELOPMENT OVERVIEW - ------------------------- - -1 Introduction ----------------------------------------------------------------------- -WSJT is a computer program designed to facilitate Amateur Radio -communication under extreme weak-signal conditions. Three very -different coding and modulation methods are provided: one for -communication by "meteor scatter" techniques on the VHF bands; one for -meteor and ionospheric scatter, primarily on the 6 meter band; and one -for the very challenging EME (Earth-Moon-Earth) path. - - -2 Program Overview ----------------------------------------------------------------------- -WSJT's user interface is written in Python. The major Python -source-code files include: - -1. wsjt.py Defines the main-screen GUI for user interactions; - acts as "traffic cop" for orchestrating all - event-driven and time-shared activities. - -2. specjt.py Provides real-time display of received signals as - two-dimensional "waterfall" spectra. - -3. options.py Provides entry fields for user-defined parameters. - -4. astro.py Displays astronomical data for sun, moon, sky - temperature, etc. - -Smaller Python files serve various utility purposes. - -Both wsjt.py and specjt.py make calls to external procedures compiled -from Fortran and C. A variety of global data is shared among modules -through common blocks defined in Fortran. The Python code runs in a -single thread, although timers make the functions of the several main -modules appear concurrent. Fortran routines create additional threads -to be used for soundcard I/O and the decoding of received messages. - -As a small part of its overall task, the decoder for JT65 invokes an -external program named KVASD.EXE or KVASD, located in the main -WSJT directory. If this program is present it uses information on -received 64-FSK symbols and attempts to decipher it according to a -Reed Solomon (63,12) code, using the algebraic soft-decision algorithm -of Koetter and Vardy. If KVASD is not present, WSJT uses its own -internal hard-decision Reed Solomon decoder instead. Interprocess -communication between WSJT and KVASD takes place through a shared disk -file. KVASD is not an integral part of WSJT. Its algorithm is -patented, and the source code is the property of CodeVector -Technologies, LLC. However, compiled versions of KVASD may be freely -used in conjunction with WSJT for the purposes of amateur radio -weak-signal communication. - - -3 Some Functional Details ----------------------------------------------------------------------- -WSJT execution starts at the top of Python file wsjt.py. The -other Python modules are loaded and executed as needed. Fortran -routines are called to start a high-priority thread to handle -continuous A/D and D/A streams, and a background thread to decode -received or previously recorded signals. The top-level Python -code determines the overall state of program operation, e.g., -Idle, Monitoring, or Transmitting. In normal usage the operator -puts the program into Auto mode, resulting in a timed sequence of -alternating transmission and reception intervals. - - -4 Other Open-Source Software used in WSJT ----------------------------------------------------------------------- -WSJT 5.9 uses the following open source libraries: - - 1. FFTW, by Matteo Frigo and Steven Johnson, for computing Fourier - transforms - - 2. PortAudio, by Ross Bencina and Phil Burk, for audio I/O - - 3. "Secret Rabbit Code" or "libsamplerate", by Erik de Castro, for - accomplishing band-limited resampling of data - - 4. RS, by Phil Karn, KA9Q, for Reed Solomon encoding and - hard-decision decoding. - - -5 Platform-Dependent Notes ----------------------------------------------------------------------- -The Python code should run on any supported Python platform. Most of -the remaining code can be compiled for Linux, FreeBSD, unix, or OS/X, -as well as Windows. Platform-dependent versions of FFTW, PortAudio, -and libsamplerate may need to be installed. - -Methods are provided for creating additional threads and setting their -runtime priorities in Windows, Linux, and FreeBSD. - - -6 Partial List of Functions and Subroutines, and their purposes ----------------------------------------------------------------------- - Routines for audio startup, decoding, display computations - blanker.f90 Noise blanker - fivehz.f90 Called by PortAudio callback - flat2.f Flatten the spectrum for waterfall display - pix2d65.f90 Computes pixels for waterfall display - pix2d.f90 Computes pixels for waterfall display - runqqq.f90 Executes another process - - wsjtgen.f90 Generates Tx waveforms - abc441.f90 Part of FSK441 generator - gen65.f Generate JT65 waveform - chkmsg.f Check a JT65 message for presence of 'OOO' - encode65.f Encode a JT65 message - getpfx1.f Handle extra DXCC prefixes - getpfx2.f ... - graycode.f Convert binary to/from Gray code - nchar.f Convert number, letter, space to 0-36 - packcall.f Routines for JT65 source encoding - packdxcc.f ... - packgrid.f ... - packmsg.f ... - packtext.f ... - pfx.f ... - gen6m.f Generate JT6M waveform - gentone.f Generate tone for JT6M message - gencw.f Generate CW waveform - morse.f Convert ascii to morse dits - gencwid.f Generate a CW ID message - grid2k.f Convert grid locator to integer - interleave63.f Interleave JT65 symbols - - gcom1.f90 Global commons for sharing data among Fortran routines - gcom2.f90 and between Fortran and Python - gcom3.f90 - gcom4.f90 - - makedate.f90 Gererates makedate_sub.f90 - - Astronomical calculations: - - astro.f Computes Az, El, Doppler for Sun, Moon, etc. - astropak.f "Includes" for astro supoport routines - azdist.f Computes azimuth, distance, etc., between two locators - coord.f Spherical trig utility - dcoord.f Spherical trig utility in double precision - deg2grid.f Convert lat/long (degrees) to grid locator - dot.f Compute dot product - ftsky.f Get sky temperature from data file - geocentric.f Convert geodetic to geocentric coords - GeoDist.f Compute azimuth and distance between two locators - grid2deg.f Convert grid locator to lat/long - moon2.f Compute moon location at specified date and time - MoonDop.f Compute lunar doppler shift and related quantities - sun.f Compure sun location at specified date and time - toxyz.f Convert between polar and cartesian coords - - Utilities: - db.f Compute decibels from ratio - gasdev.f Generate Gaussian random numbers - igray.f Gray code - indexx.f Sort routine - set.f Move, add, zero, ... - pctile.f Sort an array and get specified percentile - ran1.f Uniform random numbers - rfile2.f Read a binary file (Linux) - sort.f Sort an array - - FFTs: - fftw3.f Fortran definitions for FFTW - four2a.f Wrapper to make FFTW look like four2 - four2.f FFT in Fortran (a;ternative to using FFTW) - ps.f Compute power spectrum - xfft.f Real to complex FFT wrapper - - - Routines for Decoding: - wsjt1.f Top-level decoding routine; handles FSK441 especially - avesp2.f Computes average spectrum - bzap.f Find and remove birdies - detect.f Measure power in FSK441 tones - flatten.f Flatten the spectrum - longx.f Decode normal FSK441 messages - lpf1.f Quick-and-dirty lowpass filter - mtdecode.f Multi-tone decoding - ping.f Find pings - s2shape.f Flatten the 2d spectrum - smooth.f Smooth by boxcar averaging - spec2d.f Compute 2d spectrum for FSK441 - stdecode.f Decode FSK441 shorthand messages - sync.f Synchronize FSK441 data - - wsjt65.f JT65 decoder - afc65.f AFC for JT65 - avemsg65.f Decode average message - decode65.f Decode JT65 message - deep65.f Deep search decoder - demod64a.f Compute probabilities of transmitted symbols - extract.f Extract message from JT65 symbol probabilities - flat1.f Flatten the passband - getsnr.f Compute snr or shorthand message - k2grid.f Convert integer to 4-digit grid locator - limit.f Clipper for JT65 - peakup.f Interpolate to find fractional-bin peak - setup65.f Initialize pseudorandom sync vector - short65.f Detect JT65 shorthand messages - slope.f Remove a straight-line slope - spec2d65.f Compute 2d spectrum for JT65 - spec441.f Compute spectra for FSK441 decoding - sync65.f Synchronize a JT65 signal - unpackcall.f Unpack JT65 message parts ... - unpackgrid.f ... - unpackmsg.f ... - unpacktext.f ... - xcor.f Compute cross-correlation for JT65 sync - - decode6m.f Decode JT65 signal - syncf0.f First frequency sync - syncf1.f Second freq sync - synct.f First time sync - avemsg6m.f Get average JT65 message - - JT65code.f Program to illustrate and test JT65 coding - - Hard-Decision Reed Solomon Codec - decode_rs.c Decoder - encode_rs.c Encoder - init_rs.c Initialization routine - wrapkarn.c Wapper for Fortran - - cutil.c Fortran wrappers for some basic C functions - jtaudio.c Audio I/O, calls PortAudio routines - padevsub.c Select desired audio device - ptt.c PTT via serial port DTR/RTS - ptt_linux.c Ditto for Linux (dummy at present) - resample.c Wrapper for resample routine - start_threads.c Start audio and decoder threads - - -7 Compiling Instructions ----------------------------------------------------------------------- -Scripts are provided for compiling WSJT in both Windows and Linux. -They are presently set up to use Compaq Visual Fortran (v6.6) and -Microsoft C (v6.0) in Windows, and g95 and gcc in Linux. My -installation has Python 2.3. Additional tools include f2py, which -compiles Fortran and C to make Python extensions; the Python Imaging -Library; Numeric Python; and the SciPy distribution utilities. - -Linux Windows Function -------------------------------------------------------------------- - g0 g0.bat Compiles the hard-decision Reed Solomon Decoder - Needs to be done only once. - g1 g1.bat Compiles the remaining Fortran and C to produce Python - extension module audio.pyd (Windows) or audio.so - (Linux). - g2 g2.bat Uses McMillan Installer to create an f2py specification - file, wsjt.spec - g3 g3.bat Uses Installer to produce a distributable file WSJT6.EXE - (Windows). - g99 g99.bat Runs all of the g[0-3] scripts. - -These steps produce a distributable file WSJT6.EXE (Windows) or wsjt6 -(Linux) that contains all necessary software components, so that the -end user does not need to install Python or any of its other -extensions, or the compilers. - -A configuration script and Makefile facility is also provided. -Assuming that all of the pre-requisites are properly installed, WSJT -can now be compiled in Windows as follows: - - C> copy Makefile.win Makefile - C> nmake - -In Linux or FreeBSD, do the following: - - $ ./configure --enable-portaudio (or --enable-alsa or --enable-oss) - $ make - - -8 Present status (January 17, 2006) ----------------------------------------------------------------------- - -WSJT version 5.9.2 (built from SVN revision 115) has been released for -Windows. It is is fully functional in Linux and BSD, as well, but -presently need to be compiled locally. In due course we plan to -provide distributions for standard *nix distributions. - - + WSJT DEVELOPMENT OVERVIEW + ------------------------- + +1 Introduction +---------------------------------------------------------------------- +WSJT is a computer program designed to facilitate Amateur Radio +communication under extreme weak-signal conditions. Three very +different coding and modulation methods are provided: one for +communication by "meteor scatter" techniques on the VHF bands; one for +meteor and ionospheric scatter, primarily on the 6 meter band; and one +for the very challenging EME (Earth-Moon-Earth) path. + + +2 Program Overview +---------------------------------------------------------------------- +WSJT's user interface is written in Python. The major Python +source-code files include: + +1. wsjt.py Defines the main-screen GUI for user interactions; + acts as "traffic cop" for orchestrating all + event-driven and time-shared activities. + +2. specjt.py Provides real-time display of received signals as + two-dimensional "waterfall" spectra. + +3. options.py Provides entry fields for user-defined parameters. + +4. astro.py Displays astronomical data for sun, moon, sky + temperature, etc. + +Smaller Python files serve various utility purposes. + +Both wsjt.py and specjt.py make calls to external procedures compiled +from Fortran and C. A variety of global data is shared among modules +through common blocks defined in Fortran. The Python code runs in a +single thread, although timers make the functions of the several main +modules appear concurrent. Fortran routines create additional threads +to be used for soundcard I/O and the decoding of received messages. + +As a small part of its overall task, the decoder for JT65 invokes an +external program named KVASD.EXE or KVASD, located in the main +WSJT directory. If this program is present it uses information on +received 64-FSK symbols and attempts to decipher it according to a +Reed Solomon (63,12) code, using the algebraic soft-decision algorithm +of Koetter and Vardy. If KVASD is not present, WSJT uses its own +internal hard-decision Reed Solomon decoder instead. Interprocess +communication between WSJT and KVASD takes place through a shared disk +file. KVASD is not an integral part of WSJT. Its algorithm is +patented, and the source code is the property of CodeVector +Technologies, LLC. However, compiled versions of KVASD may be freely +used in conjunction with WSJT for the purposes of amateur radio +weak-signal communication. + + +3 Some Functional Details +---------------------------------------------------------------------- +WSJT execution starts at the top of Python file wsjt.py. The +other Python modules are loaded and executed as needed. Fortran +routines are called to start a high-priority thread to handle +continuous A/D and D/A streams, and a background thread to decode +received or previously recorded signals. The top-level Python +code determines the overall state of program operation, e.g., +Idle, Monitoring, or Transmitting. In normal usage the operator +puts the program into Auto mode, resulting in a timed sequence of +alternating transmission and reception intervals. + + +4 Other Open-Source Software used in WSJT +---------------------------------------------------------------------- +WSJT 5.9 uses the following open source libraries: + + 1. FFTW, by Matteo Frigo and Steven Johnson, for computing Fourier + transforms + + 2. PortAudio, by Ross Bencina and Phil Burk, for audio I/O + + 3. "Secret Rabbit Code" or "libsamplerate", by Erik de Castro, for + accomplishing band-limited resampling of data + + 4. RS, by Phil Karn, KA9Q, for Reed Solomon encoding and + hard-decision decoding. + + +5 Platform-Dependent Notes +---------------------------------------------------------------------- +The Python code should run on any supported Python platform. Most of +the remaining code can be compiled for Linux, FreeBSD, unix, or OS/X, +as well as Windows. Platform-dependent versions of FFTW, PortAudio, +and libsamplerate may need to be installed. + +Methods are provided for creating additional threads and setting their +runtime priorities in Windows, Linux, and FreeBSD. + + +6 Partial List of Functions and Subroutines, and their purposes +---------------------------------------------------------------------- + Routines for audio startup, decoding, display computations + blanker.f90 Noise blanker + fivehz.f90 Called by PortAudio callback + flat2.f Flatten the spectrum for waterfall display + pix2d65.f90 Computes pixels for waterfall display + pix2d.f90 Computes pixels for waterfall display + runqqq.f90 Executes another process + + wsjtgen.f90 Generates Tx waveforms + abc441.f90 Part of FSK441 generator + gen65.f Generate JT65 waveform + chkmsg.f Check a JT65 message for presence of 'OOO' + encode65.f Encode a JT65 message + getpfx1.f Handle extra DXCC prefixes + getpfx2.f ... + graycode.f Convert binary to/from Gray code + nchar.f Convert number, letter, space to 0-36 + packcall.f Routines for JT65 source encoding + packdxcc.f ... + packgrid.f ... + packmsg.f ... + packtext.f ... + pfx.f ... + gen6m.f Generate JT6M waveform + gentone.f Generate tone for JT6M message + gencw.f Generate CW waveform + morse.f Convert ascii to morse dits + gencwid.f Generate a CW ID message + grid2k.f Convert grid locator to integer + interleave63.f Interleave JT65 symbols + + gcom1.f90 Global commons for sharing data among Fortran routines + gcom2.f90 and between Fortran and Python + gcom3.f90 + gcom4.f90 + + makedate.f90 Gererates makedate_sub.f90 + + Astronomical calculations: + + astro.f Computes Az, El, Doppler for Sun, Moon, etc. + astropak.f "Includes" for astro supoport routines + azdist.f Computes azimuth, distance, etc., between two locators + coord.f Spherical trig utility + dcoord.f Spherical trig utility in double precision + deg2grid.f Convert lat/long (degrees) to grid locator + dot.f Compute dot product + ftsky.f Get sky temperature from data file + geocentric.f Convert geodetic to geocentric coords + GeoDist.f Compute azimuth and distance between two locators + grid2deg.f Convert grid locator to lat/long + moon2.f Compute moon location at specified date and time + MoonDop.f Compute lunar doppler shift and related quantities + sun.f Compure sun location at specified date and time + toxyz.f Convert between polar and cartesian coords + + Utilities: + db.f Compute decibels from ratio + gasdev.f Generate Gaussian random numbers + igray.f Gray code + indexx.f Sort routine + set.f Move, add, zero, ... + pctile.f Sort an array and get specified percentile + ran1.f Uniform random numbers + rfile2.f Read a binary file (Linux) + sort.f Sort an array + + FFTs: + fftw3.f Fortran definitions for FFTW + four2a.f Wrapper to make FFTW look like four2 + four2.f FFT in Fortran (a;ternative to using FFTW) + ps.f Compute power spectrum + xfft.f Real to complex FFT wrapper + + + Routines for Decoding: + wsjt1.f Top-level decoding routine; handles FSK441 especially + avesp2.f Computes average spectrum + bzap.f Find and remove birdies + detect.f Measure power in FSK441 tones + flatten.f Flatten the spectrum + longx.f Decode normal FSK441 messages + lpf1.f Quick-and-dirty lowpass filter + mtdecode.f Multi-tone decoding + ping.f Find pings + s2shape.f Flatten the 2d spectrum + smooth.f Smooth by boxcar averaging + spec2d.f Compute 2d spectrum for FSK441 + stdecode.f Decode FSK441 shorthand messages + sync.f Synchronize FSK441 data + + wsjt65.f JT65 decoder + afc65.f AFC for JT65 + avemsg65.f Decode average message + decode65.f Decode JT65 message + deep65.f Deep search decoder + demod64a.f Compute probabilities of transmitted symbols + extract.f Extract message from JT65 symbol probabilities + flat1.f Flatten the passband + getsnr.f Compute snr or shorthand message + k2grid.f Convert integer to 4-digit grid locator + limit.f Clipper for JT65 + peakup.f Interpolate to find fractional-bin peak + setup65.f Initialize pseudorandom sync vector + short65.f Detect JT65 shorthand messages + slope.f Remove a straight-line slope + spec2d65.f Compute 2d spectrum for JT65 + spec441.f Compute spectra for FSK441 decoding + sync65.f Synchronize a JT65 signal + unpackcall.f Unpack JT65 message parts ... + unpackgrid.f ... + unpackmsg.f ... + unpacktext.f ... + xcor.f Compute cross-correlation for JT65 sync + + decode6m.f Decode JT65 signal + syncf0.f First frequency sync + syncf1.f Second freq sync + synct.f First time sync + avemsg6m.f Get average JT65 message + + JT65code.f Program to illustrate and test JT65 coding + + Hard-Decision Reed Solomon Codec + decode_rs.c Decoder + encode_rs.c Encoder + init_rs.c Initialization routine + wrapkarn.c Wapper for Fortran + + cutil.c Fortran wrappers for some basic C functions + jtaudio.c Audio I/O, calls PortAudio routines + padevsub.c Select desired audio device + ptt.c PTT via serial port DTR/RTS + ptt_linux.c Ditto for Linux (dummy at present) + resample.c Wrapper for resample routine + start_threads.c Start audio and decoder threads + + +7 Compiling Instructions +---------------------------------------------------------------------- +Scripts are provided for compiling WSJT in both Windows and Linux. +They are presently set up to use Compaq Visual Fortran (v6.6) and +Microsoft C (v6.0) in Windows, and g95 and gcc in Linux. My +installation has Python 2.3. Additional tools include f2py, which +compiles Fortran and C to make Python extensions; the Python Imaging +Library; Numeric Python; and the SciPy distribution utilities. + +Linux Windows Function +------------------------------------------------------------------- + g0 g0.bat Compiles the hard-decision Reed Solomon Decoder + Needs to be done only once. + g1 g1.bat Compiles the remaining Fortran and C to produce Python + extension module audio.pyd (Windows) or audio.so + (Linux). + g2 g2.bat Uses McMillan Installer to create an f2py specification + file, wsjt.spec + g3 g3.bat Uses Installer to produce a distributable file WSJT6.EXE + (Windows). + g99 g99.bat Runs all of the g[0-3] scripts. + +These steps produce a distributable file WSJT6.EXE (Windows) or wsjt6 +(Linux) that contains all necessary software components, so that the +end user does not need to install Python or any of its other +extensions, or the compilers. + +A configuration script and Makefile facility is also provided. +Assuming that all of the pre-requisites are properly installed, WSJT +can now be compiled in Windows as follows: + + C> copy Makefile.win Makefile + C> nmake + +In Linux or FreeBSD, do the following: + + $ ./configure --enable-portaudio (or --enable-alsa or --enable-oss) + $ make + + +8 Present status (January 17, 2006) +---------------------------------------------------------------------- + +WSJT version 5.9.2 (built from SVN revision 115) has been released for +Windows. It is is fully functional in Linux and BSD, as well, but +presently need to be compiled locally. In due course we plan to +provide distributions for standard *nix distributions. + + From e7e7077bfa5d9b332224315fd66ae7d922980a17 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 21 Jul 2006 20:09:23 +0000 Subject: [PATCH 139/811] Improved calculation of reference level in deep65.F. Incremented version to 5.9.5. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@199 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- deep65.F | 41 +++++++++++++++++++++++++++++++---------- wsjt.py | 4 ++-- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/deep65.F b/deep65.F index e0d71acd7..9e9e8830b 100644 --- a/deep65.F +++ b/deep65.F @@ -3,6 +3,7 @@ parameter (MAXCALLS=7000,MAXRPT=63) real s3(64,63) + real pp(2*MAXCALLS + 2 + MAXRPT) character callsign*12,grid*4,message*22,hisgrid*6,c*1,ceme*3 character*12 mycall,hiscall character*22 decoded,deepmsg @@ -72,7 +73,7 @@ callgrid(icall)=callsign(1:j2) mz=1 - if(n.eq.1) mz=MAXRPT+1 + if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1) mz=MAXRPT+1 do m=1,mz if(m.gt.1) grid=rpt(m-1) if(j3.lt.1 .and.j4.lt.1) @@ -100,6 +101,7 @@ p1=-1.e30 ip1=0 + n=0 do k=1,ntot C If sync=OOO, no CQ messages if(flip.lt.0.0 .and. testmsg(k)(1:3).eq.'CQ ') go to 30 @@ -114,27 +116,46 @@ C If sync=OOO, no CQ messages nhard=nhard+1 endif enddo - sum=sum/ref - if(sum.gt.p1) then - p1=sum + p=sum/ref +! p=sum/ref0 + n=n+1 + pp(n)=p + if(p.gt.p1) then + p1=p ip1=k + sum1=sum ref1=ref nhard1=nhard endif 30 enddo - qual=100.0*(p1-0.405) - if(mode65.eq.1) qual=100.0*(p1-0.335) - if(mode65.eq.4) qual=100.0*(p1-0.505) - if(qual.lt.0.) qual=0. - if(qual.gt.10.) qual=10. + ntot=n + call sort(ntot,pp) + do i=1,100 + if(pp(ntot-i).ne.pp(ntot)) go to 40 + enddo + 40 iref=min(ntot-i,nint(0.68*ntot)) + pbias=1.04*pp(ntot-i) +! pbias=1.40*pp(iref) + qual=50.0*(p1-pbias) +! if(mode65.eq.1) qual=100.0*(p1-0.335) +! if(mode65.eq.4) qual=100.0*(p1-0.505) decoded=' ' c=' ' - if(qual.gt.0.0) then + + if(qual.gt.1.0) then if(qual.lt.4.0) c='?' decoded=testmsg(ip1) endif decoded(22:22)=c +! write(71,1010) mycall,qual,nhard1,p1,p1/pp(ntot-i), +! + p1/pp(iref),nint(sum1),nint(ref0),nint(ref1),i,decoded +! write(*,1010) mycall,qual,nhard1,p1,p1/pp(ntot-i), +! + p1/pp(iref),nint(sum1),nint(ref0),nint(ref1),i,decoded +! 1010 format(a6,f6.1,i3,f6.3,2f6.2,4i5,1x,a22) + if(qual.lt.0.) qual=0. + if(qual.gt.10.) qual=10. + return end diff --git a/wsjt.py b/wsjt.py index 7cb6f2e19..fe59afdeb 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw @@ -15,7 +15,7 @@ from types import * import array root = Tk() -Version="5.9.4 r" + "$Rev$"[6:-1] +Version="5.9.5 r" + "$Rev$"[6:-1] print "******************************************************************" print "WSJT Version " + Version + ", by K1JT" print "Revision date: " + \ From c8afc2da11209694c94fe89eea33cce7436cf734 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 24 Jul 2006 14:30:15 +0000 Subject: [PATCH 140/811] fivehz.F90: Added function gran() wsjt1.F: Option to intentionally degrade SNR for test purposes deep65.F: Tweaked parameters for computing qual git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@200 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- deep65.F | 17 ++++++----------- fivehz.F90 | 17 +++++++++++++---- wsjt.py | 2 +- wsjt1.F | 18 +++++++++++++++++- 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/deep65.F b/deep65.F index 9e9e8830b..69a1cb5bf 100644 --- a/deep65.F +++ b/deep65.F @@ -73,7 +73,8 @@ callgrid(icall)=callsign(1:j2) mz=1 - if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1) mz=MAXRPT+1 + if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1 .and. + + flip.gt.0.0) mz=MAXRPT+1 do m=1,mz if(m.gt.1) grid=rpt(m-1) if(j3.lt.1 .and.j4.lt.1) @@ -135,25 +136,19 @@ C If sync=OOO, no CQ messages if(pp(ntot-i).ne.pp(ntot)) go to 40 enddo 40 iref=min(ntot-i,nint(0.68*ntot)) - pbias=1.04*pp(ntot-i) -! pbias=1.40*pp(iref) - qual=50.0*(p1-pbias) + pbias=1.08*pp(ntot-i) + qual=100.0*(p1-pbias) + ! if(mode65.eq.1) qual=100.0*(p1-0.335) ! if(mode65.eq.4) qual=100.0*(p1-0.505) decoded=' ' c=' ' if(qual.gt.1.0) then - if(qual.lt.4.0) c='?' + if(qual.lt.6.0) c='?' decoded=testmsg(ip1) endif decoded(22:22)=c - -! write(71,1010) mycall,qual,nhard1,p1,p1/pp(ntot-i), -! + p1/pp(iref),nint(sum1),nint(ref0),nint(ref1),i,decoded -! write(*,1010) mycall,qual,nhard1,p1,p1/pp(ntot-i), -! + p1/pp(iref),nint(sum1),nint(ref0),nint(ref1),i,decoded -! 1010 format(a6,f6.1,i3,f6.3,2f6.2,4i5,1x,a22) if(qual.lt.0.) qual=0. if(qual.gt.10.) qual=10. diff --git a/fivehz.F90 b/fivehz.F90 index c18e70a1b..2fd15acc3 100644 --- a/fivehz.F90 +++ b/fivehz.F90 @@ -212,9 +212,9 @@ end subroutine fivehztx subroutine addnoise(n) integer*2 n - real r(12) real*8 txsnrdb0 include 'gcom1.f90' + data idum/0/ save if(txsnrdb.gt.40.0) return @@ -224,9 +224,7 @@ subroutine addnoise(n) if(snr.gt.1.0) fac=3000.0/snr txsnrdb0=txsnrdb endif - call random_number(r) - x=sum(r)-6.0 - i=fac*(x + n*snr/32768.0) + i=fac*(gran(idum) + n*snr/32768.0) if(i>32767) i=32767; if(i<-32767) i=-32767; n=i @@ -234,3 +232,14 @@ subroutine addnoise(n) return end subroutine addnoise +real function gran(idum) + real r(12) + integer nseed(1) + data nseed/714478811/ + if(idum.lt.0) then + call random_seed(PUT=nseed) + idum=0 + endif + call random_number(r) + gran=sum(r)-6.0 +end function gran diff --git a/wsjt.py b/wsjt.py index fe59afdeb..d258710eb 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/wsjt1.F b/wsjt1.F index 9f8d6e210..f5e6c3d8a 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -90,7 +90,7 @@ if(mode.eq.4 .and. jz.gt.330750) jz=330750 !### Fix this! sum=0. - do j=1,jz !Convert raw data from byte to real, remove DC + do j=1,jz !Convert raw data from i*2 to real, remove DC dat(j)=0.1*d(j) sum=sum + dat(j) enddo @@ -112,6 +112,21 @@ endif + if(ndiag.ne.0 .and. nclip.lt.0) then +C Intentionally degrade SNR by -nclip dB. + sq=0. + do i=1,jz + sq=sq + dat(i)**2 + enddo + p0=sq/jz + p1=p0*10.0**(-0.1*nclip) + dnoise=sqrt(p1-p0) + idum=-1 + do i=1,jz + dat(i)=dat(i) + dnoise*gran(idum) + enddo + endif + if(mode.ne.2 .and. nzap.ne.0) then if(jz.gt.100000) call avesp2(dat,jz,2,f0a,NFreeze,MouseDF, + DFTolerance,fzap) @@ -306,3 +321,4 @@ C Now the multi-tone decoding return end + From b18438a6eb13e0a91603df9635468cfea60379b9 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 24 Jul 2006 17:20:27 +0000 Subject: [PATCH 141/811] Fixed format of WAV files written by savedata.F90 in *nix. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@201 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- portaudio-v19/config.log | 3 --- portaudio-v19/config.status | 16 ++++++++-------- savedata.F90 | 10 +++++++--- wsjt.py | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/portaudio-v19/config.log b/portaudio-v19/config.log index 8f29e67d0..7b24b68d9 100644 --- a/portaudio-v19/config.log +++ b/portaudio-v19/config.log @@ -14,9 +14,6 @@ configure:991: checking whether byte ordering is bigendian configure:1083: checking for snd_pcm_open in -lasound configure:1131: checking host system type configure:1159: checking for pkg-config -configure:1203: checking for jack -configure:1210: checking JACK_CFLAGS -configure:1215: checking JACK_LIBS configure:1244: checking size of short configure:1283: checking size of int configure:1322: checking size of long diff --git a/portaudio-v19/config.status b/portaudio-v19/config.status index d2b8f073e..d06450081 100755 --- a/portaudio-v19/config.status +++ b/portaudio-v19/config.status @@ -2,7 +2,7 @@ # Generated automatically by configure. # Run this file to recreate the current configuration. # This directory was configured as follows, -# on host night.db.net: +# on host phy-joe.Princeton.EDU: # # ./configure --with-jack=no # @@ -64,14 +64,14 @@ s%@INSTALL_PROGRAM@%${INSTALL}%g s%@INSTALL_SCRIPT@%${INSTALL_PROGRAM}%g s%@INSTALL_DATA@%${INSTALL} -m 644%g s%@AR@%/usr/bin/ar%g -s%@host@%i386-unknown-freebsd7.0%g -s%@host_alias@%i386-unknown-freebsd7.0%g -s%@host_cpu@%i386%g -s%@host_vendor@%unknown%g -s%@host_os@%freebsd7.0%g +s%@host@%i686-pc-linux-gnu%g +s%@host_alias@%i686-pc-linux-gnu%g +s%@host_cpu@%i686%g +s%@host_vendor@%pc%g +s%@host_os@%linux-gnu%g s%@PKG_CONFIG@%/usr/local/bin/pkg-config%g -s%@JACK_CFLAGS@%-I/usr/local/include %g -s%@JACK_LIBS@%-pthread -L/usr/local/lib -ljack %g +s%@JACK_CFLAGS@%%g +s%@JACK_LIBS@%%g s%@OTHER_OBJS@% pa_unix_oss/pa_unix_oss.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o%g s%@PADLL@%libportaudio.so%g s%@SHARED_FLAGS@%-shared -fPIC%g diff --git a/savedata.F90 b/savedata.F90 index c6006b97d..851310981 100644 --- a/savedata.F90 +++ b/savedata.F90 @@ -107,12 +107,16 @@ subroutine savedata #ifdef Win32 open(17,file=longname,status='unknown',form='binary',err=20) -#else - open(17,file=longname,status='unknown',form='unformatted',err=20) -#endif write(17) ariff,nchunk,awave,afmt,lenfmt,nfmt2,nchan2,nsamrate, & nbytesec,nbytesam2,nbitsam2,adata,ndata,(d2a(j),j=1,jza) close(17) +#else + open(17,file=longname,status='unknown',form='unformatted', & + access='direct',recl=nbytes,err=20) + write(17,rec=1) ariff,nchunk,awave,afmt,lenfmt,nfmt2,nchan2,nsamrate, & + nbytesec,nbytesam2,nbitsam2,adata,ndata,(d2a(j),j=1,jza) + close(17) +#endif filetokillb=filetokilla filetokilla=longname go to 30 diff --git a/wsjt.py b/wsjt.py index d258710eb..fe59afdeb 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw From d594c24d412299ee4f710bfda6f27190119be356 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 24 Jul 2006 17:24:47 +0000 Subject: [PATCH 142/811] Fixed save/restore of PttPort in WSJT.INI git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@202 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wsjt.py b/wsjt.py index fe59afdeb..2a8bcfa7e 100644 --- a/wsjt.py +++ b/wsjt.py @@ -2016,12 +2016,15 @@ try: # elif key == 'RxDelay': options.RxDelay.set(value) # elif key == 'TxDelay': options.TxDelay.set(value) elif key == 'IDinterval': options.IDinterval.set(value) - elif key == 'ComPort': + elif key == 'PttPort': try: - options.ComPort.set(value) - Audio.gcom2.nport=options.ComPort.get() + options.PttPort.set(value) + try: + Audio.gcom2.nport=int(options.PttPort.get()) + except: + Audio.gcom2.nport=0 except: - options.ComPort.set(0) + options.PttPort.set("/dev/cuad0") Audio.gcom2.nport=0 Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] elif key == 'Mileskm': options.mileskm.set(value) @@ -2132,7 +2135,7 @@ f.write("HisGrid " + t + "\n") #f.write("RxDelay " + str(options.RxDelay.get()) + "\n") #f.write("TxDelay " + str(options.TxDelay.get()) + "\n") f.write("IDinterval " + str(options.IDinterval.get()) + "\n") -f.write("ComPort " + str(options.PttPort.get()) + "\n") +f.write("PttPort " + str(options.PttPort.get()) + "\n") f.write("Mileskm " + str(options.mileskm.get()) + "\n") f.write("MsgStyle " + str(options.ireport.get()) + "\n") f.write("Region " + str(options.iregion.get()) + "\n") From 2f6400492416e6ad94a6e57f058c5af56d0972be Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 24 Jul 2006 19:20:07 +0000 Subject: [PATCH 143/811] - Give user a chance to fix from wjst, don't just exit. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@203 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_oss.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/start_oss.c b/start_oss.c index c257e960d..2a3335aaa 100644 --- a/start_oss.c +++ b/start_oss.c @@ -112,7 +112,7 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], if(data.fd_in < 0) { fprintf(stderr, "Cannot open %s for input.\n", dsp_in); - exit(-1); + return (-1); } data.fd_out = data.fd_in; @@ -146,23 +146,23 @@ start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], channels = 2; if(ioctl (data.fd_in, SNDCTL_DSP_CHANNELS, &channels) == -1) { fprintf (stderr, "Unable to set 2 channels for input.\n"); - exit (-1); + return (-1); } if(channels != 2) { fprintf (stderr, "Unable to set 2 channels.\n"); - exit (-1); + return (-1); } format = AFMT_S16_NE; if(ioctl (data.fd_in, SNDCTL_DSP_SETFMT, &format) == -1) { fprintf (stderr, "Unable to set format for input.\n"); - exit (-1); + return (-1); } if(ioctl (data.fd_in, SNDCTL_DSP_SPEED, &rate) == -1) { fprintf (stderr, "Unable to set rate for input\n"); - exit (-1); + return (-1); } printf("Audio OSS streams running normally.\n"); From dedbd91143f87140f3ce5f31b5c770c2471f6cad Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Mon, 24 Jul 2006 19:23:12 +0000 Subject: [PATCH 144/811] - Make prototype match that of windows, even though unused *isn't* used. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@204 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ptt_unix.c b/ptt_unix.c index ba5578263..1b98180e5 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -96,7 +96,7 @@ char nm[MAXPATHLEN]; #define STATE_PORT_OPEN_SERIAL 2 int -ptt_(int unused, char *ptt_port, int *ntx, int *iptt) +ptt_(int *unused, char *ptt_port, int *ntx, int *iptt) { static int state=0; char *p; From a735577197e7db27bccb7457a2bc5cfafb40a3a8 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 24 Jul 2006 20:48:02 +0000 Subject: [PATCH 145/811] Tweak deep65 params for modes JT65A, JT65C. Increase range of optional SNR degradation. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@205 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CALL3.TXT | 9466 +++++++++++++++++++++++++++-------------------------- deep65.F | 6 +- sync65.f | 2 +- wsjt.py | 2 +- wsjt1.F | 2 +- 5 files changed, 4740 insertions(+), 4738 deletions(-) diff --git a/CALL3.TXT b/CALL3.TXT index 37d499f4e..77cea156c 100644 --- a/CALL3.TXT +++ b/CALL3.TXT @@ -1,4732 +1,4734 @@ -//CALL3.TXT agreed format for WSJT-PROGRAM by K1JT -//User-Version 2.14 02/05 WSJT-Excerpt of VHF-DATABASE © by DL8EBW -//(excluding extensions in calls eg. /p /a or exp.calls!) -2M0EXD,IO88FO,,,,,,04/04 -3B9C,MH10QG,EME,,,,,2003 -3V8BB,JM56ER,EME,,Clubstation,,,06/02 -4J1FS,KP40,,,,,,1990 -4K6D,LN40VK,EME,,vladimir,,,1994 -4N7AX,KN05PC,,,Zvezdan ""Zele",,144: 200 W 2x10el 9BVtx1500/rx3000lpm DSP,08/00 -4O4AR,JN94AS,,,Zdravko,,144: TR9130 250W 10el PA0MS-ant PreampUHER 15,11/02 -4O4D,JN94BR,,,,,144: 300W 11el,05/97 -4U1ITU,JN36BF,EME,,Clubstation,,144: 8el 600W,11/00 -4X1IF,KM72KA,EME,,Ralph,,,2004 -4X4IF,KM72KD,EME,,Ralph,,,05/00 -4X6UJ,KM72,EME,,,,,2000 -4Z5AO,KM72MW,,,Leonid ""Leo",,,07/04 -4Z5BS,KM71JW,,,Oded,,,07/95 -5B4AGY,KM64EV,,,Iain,,FT-726R plus 1kW Linears and head amplifiers,01/05 -5B8AD,KM64TV,EME,,Alex,,,01/05 -5B8AV,KM64FT,,,Norman,,,05/04 -5C8M,IM64PD,EME,,BCC-Club,,144: IC706 MKIIG PA 1KW preamp. 2x 3WL yagis,10/00 -5T5JC,IL30AM,EME,,erich,,,1994 -5T5SN,IK28AC,EME,,nicolas,,,01/05 -5X1D,KJ60EM,EME,,"Gus"" Ragge,,300W- 17el,03/97 -6Y4A,FK18AA,EME,,OP: W3CMP,,144: 2x 2MXP28 cross pol ant. 1KW,10/00 -7J0AAD,PM97OS,EME,,Angela,,144: 1KW 4x19el 2x18el MGF1801.043.250,01/00 -7J6CCU,PL36VI,EME,,Eric,,50: TS570 or IC821,04/02 -7K1MFR,PM95SP,,,,,,2003 -7K3LGC,QM06,EME,,,,,10/97 -7L1RLL,PM95SO,,,,,,2003 -7M2PDT,QM05EK,EME,,Umezawa,,432: 16x14el 1-5KW,03/00 -7W0AD,JM16JR,,,,,,11/04 -7X0AD,JM16JR,,,Enrique,,144: 9el 200W,11/04 -7X2LS,JM16MT,,,Seghir,,,08/02 -7X2VV,JM16WJ,,,,,,07/02 -8S4BX,JO79SD,EME,,OP SM4IVE,,,10/99 -9A1AAX,JN65TF,,,,,144: 16el 500W,04/01 -9A1CAL,JN86EL,,,Clubstation,,144: IC271 FT736 FT225RD 4CX1500A 2x17el,11/04 -9A1CBE,JN86BE,,,,,,96 -9A1CCB,JN85LN,,,9a7w@9a0tcp.ampr.org,,,03/01 -9A1CCY,JN85OO,EME,,Clubstation Jan Hus,,122,08/01 -9A1CDD,JN85LW,,,,,,1991 -9A1CEU,JN75RO,EME,,OP 9A3ZA,,144: 80W 2x18el 5.5wl 4x11el - 432: 10W 38el,01/99 -9A1CHI,JN95JG,,,,,,94 -9A1CHL,JN83,,,,,,03/98 -9A1CMS,JN86EL,,,,,,07/02 -9A1DFG,JN85EL,,,OP 9A3PA,,,07/96 -9A1EZA,JN86HG,EME,,OP 9A3AG Sasha,,IC271E 144: 2x4CX250b MGF1302 10mM2.087 3000,11/01 -9A1KDE,JN95FQ,,,,,,1994 -9A1RGC,JN75XT,,,,,,2003 -9A1Z,JN86FJ,,,Lucijan,,IC706 DB6NT 1W ON 3CMMSDSP,01/05 -9A2AE,JN86HF,,,Zvonko,,144: 8x24el 1KW,01/02 -9A2AT,JN86LL,,,,,,2003 -9A2DI,JN95,,,,,,06/95 -9A2EU,JN85JO,,,,,,07/96 -9A2GH,JN75IE,,,,,,2003 -9A2KK,JN85KV,,,Dusko,,,11/01 -9A2MK,JN75XU,EME,,branimir,,,1994 -9A2PT,JN86,EME,,,,,11/01 -9A2RD,JN65TF,,,Mario,,144: 2x16el 1KW,05/04 -9A2SB,JN95GM,,,,,,06/99 -9A2TE,JN85KK,,,,,,06/03 -9A2U,JN75RO,EME,,OP 9A3ZA,,144: 80W 2x18el 5.5wl 4x11el.082.215,01/99 -9A2VR,JN95,,,,,,08/99 -9A3DF,JN86HG,,,,,,04/03 -9A3JH,JN75AD,,,Andrea ""Andy",,,11/03 -9A3JI,JN86FJ,,,Filip /Bob/ Vadlja,,50: FT-101ZD+FTV650- IC706mk2g 7ele M2,05/02 -9A3MR,JN83FM,,,Roland,,only SSB-MS,08/00 -9A3PA,JN85EG,EME,,Mate,,FT736r - 50: 10W 5el - 144: 8x13el 800W M,08/04 -9A3TF,JN85,,,,,,08/96 -9A3TU,JN95EH,,,,,,11/01 -9A3W,JN74OC,,,Radio Club Jadera,,IC706,09/02 -9A3ZA,JN75RO,,,Davor,,144: 100W 12el.082.215,08/00 -9A4C,JN85LN,,,OP: 9A7W,,,03/01 -9A4CK,JN86,,,,,,08/96 -9A4EW,JN95KG,EME,,Hrvoje,,144: 250W 10el- GaAsFet1200lpm,11/02 -9A4FW,JN95JG,EME,,Zeljko,,144: 600W 4x17el F9FT MGF1302DTR 1200lpm,08/00 -9A4K,JN86FJ,,,Filip /Bob/ Vadlja,,50: FT-101ZD+FTV650- IC706mk2g 7ele M2,05/02 -9A4NF,JN73VS,,,Damir,,144: 300W LNA 2x16el yagis2500lpm,01/01 -9A4VM,JN85VS,,,,,,11/02 -9A4WY,JN74,,,,,144: 50W,08/98 -9A5D,JN92BP,,,,,,08/99 -9A5WA,JN85LN,,,Max,,,06/96 -9A5Y,JN85OO,,,Ops of 9A1CCY,,144: 800W 16x5el,10/99 -9A6WW,JN86EL,,,Zvonko,,144: IC271 FT736 FT225RD 4CX1500A 2x17el,12/99 -9A7W,JN85LN,,,Ogi,,,01/02 -9A90CBD,JN85OO,EME,,Clubstation Jan Hus,,.122 1200lpm,07/97 -9A9B,JN75XU,,,,,,2003 -9H1BN,JM75GU,EME,,Mark,,,09/99 -9H1BT,JM75EU,EME,,Paul,,,1994 -9H1CD,JM75FV,EME,,Henry G.,,144: TS850 LT2S 1KW 2x4.4lb DJ9BV MGF1302,01/01 -9H1CG,JM75,,,Joe,,144: FT902DM FTV250 100W 17el.132,11/01 -9H1ES,JM75FV,EME,,Fortunato,,,09/99 -9H1GB,JM75FU,EME,,Mantsueto ""Mans",,144: TS780 100W 19elDTR 3000lpm,08/03 -9H1PA,JM75FV,EME,,Philip,,144: TS711 4x10el (3wl) crossed yagi GS35bMSD,01/01 -9H1PI,JM75FU,,,Ivan,,50: 100W 5el,03/03 -9H1TX,JM75FU,,,David,,50: 8el yagi 100W - 144: 150 W 2x4wl xpol310,12/04 -9H1XT,JM75GV,,,John,,,08/02 -9H3LF,JM76,,,,,,1991 -9H3ZZ,JM76CB,EME,,OPs DL5MAE-DL6RAI,,,1993 -9M2BV,OJ30UD,EME,,mart,,,1994 -A22BW,KG38SU,EME,,lothar,,,1994 -AA0BR,DN70KN,,,,,,2003 -AA0BW,EM29PS,,,,,,04/03 -AA0DQ,EN12,,,,,,2003 -AA0EN,EM29,,,,,,2003 -AA0P,DM79,,,,,,2003 -AA1OV,FN43GE,,,Mark,,,04/03 -AA1VL,FN42HN,,,Chris,,,04/03 -AA1YN,FN43GC,EME,,Lee,,,2004 -AA2GF,FN02,,,,,,2003 -AA3NM,FM19JE,,,Steve,,,2003 -AA4FQ,EM67LQ,EME,,JEFF,,1500W,01/05 -AA5C,EM13SE,,,,,,2003 -AA5CH,EM35GK,,,,,,2003 -AA5IB,EM12,,,,,,2003 -AA5WL,EM32,,,,,,2003 -AA5WQ,EM26BC,,,,,,2003 -AA6GS,DM12,,,,,,2003 -AA6HA,DM43CN,,,John,,144: 500W 9el M2,01/01 -AA6IW,CM97VI,,,,,,2003 -AA6WI,CM97,,,,,,2003 -AA7A,DM43AO,EME,,Ned,,144: 8877 1-5KW 6x13el (DJ9BV),01/05 -AA8BC,EN90FE,,,,,,2003 -AA8HS,EN81,,,,,,2003 -AA9D,EN52,,,Dave,,,01/01 -AA9IL,EN62AI,,,,,,2003 -AA9MY,EN50FM,EME,,Bob,,Yaesu 847 IC910H IC706MKIIG,02/05 -AB0SD,EN30LL,,,,,,2003 -AB0TJ,DN60FN,,,Alex,,,2003 -AB3BK,FN10,,,,,,02/05 -AB4CR,EM77,,,,,,2003 -AB4OO,EM81,,,Vance,,,1998 -AB5F,EM46FG,,,Paul,,,2004 -AB5IG,EM12,,,,,,2003 -AB9FN,EN53,,,,,,2003 -AC1H,FN33XJ,,,Ken,,144: 300W 13dbD yagi,01/01 -AC1T,FN32,,,,,,2003 -AC3A,EM28QV,EME,,Scott E.,,144: 4x 9el M2 8877 1-5KW,05/03 -AC4TO,EM70,,,,,,02/05 -AC5OG,EM10,,,,,,2003 -AD4EB,EM65NS,,,Jim,,,2003 -AD4TJ,FM08LE,,,David,,10el Quagi 160Watt,01/04 -AD6A,CM97AG,,,,,,2003 -AD6FP,CM87WI,EME,,,,,2004 -AD6P,EM18,,,,,,2003 -AE0G,EN10PS,,,,,,2003 -AE0W,DM78,,,,,,2003 -AE4RO,EL97TG,,,Tom,,,09/01 -AE5K,EM36PC,,,,,,2003 -AF1T,FN43ED,EME,,DALE,,,01705 -AF4O,EM55LK,,,,,,2003 -AF6O,DM14EJ,,,,,,2003 -AF9R,EN52XB,,,Dan,,,2003 -AG2A,FN30FR,,,Tom,,,2003 -AG4QE,FM04KX,,,Timothy,,,2003 -AG9Y,EN40,,,Joe,,144: 160W 13el,01/01 -AH6EZ,EN51SW,,,Dick,,,12/01 -AH6LE,CN85NK,,,,,,2003 -AH8A,AH45OP,,,,,,2003 -AI1K,FN41IL,,,,,,2003 -AI3W,FM19PW,,,Rick,,,2004 -AI8Z,DM79,,,,,,2003 -AJ0E,EM29RD,,,,,,2003 -AJ6T,CM87XG,,,Walter E. ""Walt",,144: 200W 10el,08/03 -AL7EB,BP40IQ,EME,,Edward R.,,144: 4xpol-20el M2 170w,01/05 -AM25DXU,JN11CM,EME,,Op Jose Maria,,,1992 -AN6SA,JM19IR,EME,,Josep,,144: FT847 2x4CX250 2x17el - 432: 4x33el,01/01 -BY1QH,ON80DA,,,,,,2003 -C31MS,JN02UN,,,DC9KZ- DF7KF- DL8EBW,,144: 2Stn a´ 800W 2x17el or 11el.119 DTR,05/97 -C31RC,JN02SK,EME,,,,,1989 -C31TLT,JN02TL,EME,,OP I5WBE EA3BB,,144: 4x24el 2x4CX250 900W,08/01 -C4N,KM64tv,EME,, -CN8KD,IM63KX,,,,,144: 10W 11el,06/03 -CN8LI,IM63NX,,,Said,,50: IC706 6el Mast Mount 20db preamp- 144: 2,08/04 -CN8ST,IM64NA,EME,,Tarrik,,,06/98 -CO2OJ,EL83TD,,,OP: Oscar,,50: 100W 4el - 144: 110W 9el,08/01 -CQ14HZE,IM57NH,,,Joachim ""Joe",,,02/04 -CS0DIZ,IM69,,,,,,1989 -CS1GDX,IM59IB,,,OP: CT1EKD,,144: IC706MK II G 200W 12el,11/03 -CS6ARC,IM59RX,,,OP CT1FOH,,,11/01 -CT1ANO,IN51RE,,,Pinto,,144: TS2000 250Watt 2x10el MGF1302 - 432: TS,02/05 -CT1DHM,IN61CC,,,Jose,,,05/02 -CT1DIZ,IM58KP,,,Alex,,,06/03 -CT1DMK,IN50QP,EME,,Luis,,144: 1-5KW 4x11el DL6WUDTR,03/99 -CT1DNF,IN50QP,,,Pedro Filipe,,144: IC821H 200Watts 2x12ele DL6WU Preamp,12/04 -CT1DYX,IN51QD,,,Pedro Miguel,,IC970H 50: 100W 4el - 144: 100W 17el MGF1302,06/03 -CT1EKD,IM59IB,,,Pedro,,144: IC706 MK II G 200W 12el,11/03 -CT1EPS,IM57XC,,,Joe,,144: FT480 2x17el 200W MGF1302only SSB-MS.,04/03 -CT1FAK,IN50QO,EME,,Rui,,144: FT1000D FT736R 200W 4x13el DL6WU MGF,05/03 -CT1FOH,IN50RA,,,Paulo,,50: 6el - 144: 200W 4x 12el MGF1302120 MSDSP,04/04 -CT1HZE,IM57NH,,,Joachim ""Joe",,,02/04 -CT1WW,IN61GE,,,Tiago,,,11/96 -CT2FEY,IN61NS,,,Paulo,,,11/03 -CT2HSN,IN61CC,,,Carlos,,,08/01 -CT2HSO,IN61CC,,,Luis,,,08/01 -CT2IET,IN60GD,,,Frederico,,FT100D,11/02 -CT2IWG,IN51OJ,,,Sergio,,144: IC706 100W 9el,02/05 -CT4KQ,IN60BP,,,Serafim,,DTR+,03/98 -CU2IJ,HM77ES,,,,,,04/04 -CX9BT,GF15WK,,,,,,2003 -CY9SS,FN97WE,EME,,,,144: 400W single yagi,01/05 -DA0BV,JN58VF,,,clubstation,,DTR,1994 -DA0NRW,JO41GV,,,Clubstation,,144: 3CX400A7 4x14el or 17el,12/96 -DA0WAE,JO41GU,,,OP DK3EE,,,12/04 -DA4RG,JO31FG,,,Reg,,,11/95 -DB1OMA,JO42RK,,,Joerg,,,01/03 -DB1PB,JO30UE,,,,,,12/01 -DB2WD,JN39VV,EME,,Jens,,SSB only.280,04/96 -DB3BW,JO42AC,,,Hans-Jürgen,,HF: TS520 - 144/432: FT726r,04/04 -DB3LA,JO31JK,,,,,,07/02 -DB4ET,JO31,,,Klaus,,,11/02 -DB4LL,JO54SM,,,Nikolausi,,144: FT221 20W 4el.010.300,08/01 -DB4VQ,JN39MF,,,Günther,,,1994 -DB5ML,JN58OI,,,Michael,,only SSB-MS,09/03 -DB5WC,JN49EJ,,,Gerd,,60W 11el Preamp.250,12/03 -DB6BX,JO32OK,,,,,,11/96 -DB6NT,JO50UI,,,,,,2003 -DB6RO,JN58QB,,,Gerd,,,12/03 -DB7OB,JO52IJ,,,Gerd,,144: FT221 100W 11elonly SSB-MS,08/00 -DB8AT,JO51CP,,,,,,05/04 -DB8WK,JO33XN,,,Hinni,,144: 200W 13el - 432: 200W 20el,01/03 -DB8YL,JO41EV,,,Sabine,,,12/99 -DC1ECD,JO31MH,,,,,,10/04 -DC1MUS,JN69EP,,,,,,11/02 -DC2JR,JO64CA,,,Klaus,,,11/01 -DC3QB,JO41IV,,,,,,01/05 -DC3VM,JN39KK,,,Alfred,,,12/99 -DC3VW,JN39KJ,,,Guenther,,only SSB-MS,10/04 -DC3ZR,JN68CV,,,,,,01/03 -DC6DY,JO31OK,,,anton,,only SSB-MS,1994 -DC6GF,JN48OC,,,Christoph,,IC 706 MKIIG PreAmp,01/05 -DC6KI,JO30IL,,,Wolfgang,,DTR,04/03 -DC6RN,JN59WK,,,Norbert,,144: 2x12el 160W,04/03 -DC7OH,JO62OK,,,Eric,,DTR 2000lpm,01/01 -DC7UT,JO31NJ,EME,,Horst,,144: 4x17el 500WDTR,03/01 -DC9KZ,JO30JW,,,Angelo,,only SSB-MS,09/01 -DC9YC,JO31PJ,,,Dieter,,,05/03 -DD0VF,JO61WB,,,Steffen,,144: 550W 4x7el MGF1303 (JO61WA: 100W 5el BF9,03/04 -DD1JN,JO50DJ,,,Karsten,,144: 600W 11el Preamp - 432: 21el 200W VV - 1,04/02 -DD1WKS,JN39KK,,,Wolfgang,,,01/01 -DD2UJ,JO61WD,,,,,,10/04 -DD3DX,JO31TN,,,Christian,,only SSB-MS,07/01 -DD3SP,JO72EN,,,Sandro,,50: 5el - 144: FT847 4CX250 17el F9FT MGF1,02/04 -DD5DX,JO61CA,,,Alexander,,144: 180Watt 2x17el Preamp333,07/04 -DD6UBS,JO41AH,,,Stefan,,144: TM255 MGF1302 180W 11El F9FT - 432: TM45,10/04 -DD9SQ,JN59BH,,,Martin,,,07/98 -DF0AK,JN49EA,,,,,,07/97 -DF0BV,JN68AH,EME,,BCC,,144: 2x17el 750WDTR,12/99 -DF0CI,JO51CH,,,Cubstation,,,11/03 -DF0EME,JO40,,,,,,2003 -DF0LBO,JO53CT,,,Clubstation OP:DK1KO,,,05/02 -DF0MMO,JN49JX,,,OP DH4FAJ- Matthias,,144: 200W 11el,11/00 -DF0MTL,JO61JF,,,Clubstation,,,12/98 -DF0SAX,JO61VC,,,Clubstation,,144: 20W 13el,12/98 -DF0WD,JO42FD,,,Clubstation,,144: 8874 250W 2x9el - 432: 3CX800 4x18elDTR,05/03 -DF0WF,JO62VT,,,,,,01/05 -DF1AN,JO63SX,,,,,,01/00 -DF1BN,JO31GD,,,Paul-Eduard ""Paulus",,144: IC821 HLV-300 300Watts MGF 1302 2x17e,07/01 -DF1CF,JN57FP,EME,,Jürgen,,144: CF300 3CX800 4x13el (3lb)133 1500lpm38,12/04 -DF1GL,JN47CO,,,Joachim,,144: IC 910 100W 9 el,11/04 -DF1HF,JO43VL,,,Andreas,,144: 2x6el,02/00 -DF1IAZ,JN49LD,,,Ralf,,50: 3 el - 144: 150W 2x10el MGF1302154 300,07/01 -DF1OC,JO52,,,T.,,,1993 -DF1SO,JN48PO,,,Dieter,,144: homemade 200WDTR,08/98 -DF1VB,JO31RM,,,Jochen,,,05/04 -DF1ZE,JN49,EME,,Michael,,,1994 -DF2CQ,JN58SE,,,,,,10/04 -DF2OOO,JO41RF,,,OP DL3ZBA,,IC820H 144: 250W 2x11el- 432: 130W 2x23el Pr,09/99 -DF2UJ,JO61QH,,,,,,02/02 -DF2ZC,JO30RN,EME,,Bernd J.,,144: TS2000 LT2S 2xGU74b 750W MGF1302 4x2M18X,12/04 -DF3FJ,JO40CC,,,,,,1993 -DF3RU,JN59VL,EME,,Karl,,,1993 -DF4LY,JO44SM,EME,,Manfred,,144: 160el Col. 4CX2501000lpm,12/96 -DF4MAA,JN58WH,EME,,Wolfgang,,,05/97 -DF4UE,JN48RR,,,John,,432: 4x27el 600W,09/03 -DF5BN,JN49GU,,,Walter,,,08/99 -DF5DE,JO40CX,,,K.O.,,,10/04 -DF5JJ,JO43XO,,,Peter,,432: 700W 19el - 1296: 500W 26el - 10368: 20,03/04 -DF5NK,JN59PM,,,Frank,,50: FT857 4el - 144: 600W 11el - 432: 500W 19,02/04 -DF6HT,JO53AH,,,,,,2003 -DF6LO,JO52CE,,,matthias,,,1993 -DF6NA,JN49XS,,,Rainer,,432: 2x3CX800 4x30elDTR rx1500tx2000lpm,10/01 -DF6OB,JO42,,,Matthias,,,07/97 -DF6VW,JO42KH,,,Ralf,,,07/97 -DF6YL,JO31WS,EME,,Peter,,,10/04 -DF7DJ,JO31UO,,,Herbert,,.153,06/97 -DF7IF,JN48DN,,,,,,2003 -DF7IT,JN49IN,,,Volker,,,10704 -DF7KF,JO30GU,EME,,Dithmar,,144: 16x18el EME PwrDTR+ 3000lpm,12/04 -DF7OG,JO52BN,,,Klaus,,144: TS770E 4x150 16el,04/04 -DF7RG,JN68HG,EME,,Georg (Op DK0OG),,DTR+ 3000lpm,01/05 -DF8AA,JO60XX,,,Wolfgang,,144: 100W 17el.132,12/99 -DF8AE,JO41GX,,,rudi,,,10/04 -DF8IK,JO30JT,,,Hans-Peter ""Peter",,144: 300W 11el 432: 400W 27elDTR 2500lpm,01/04 -DF8LC,JO53GX,EME,,Lothar,,,08/99 -DF9CY,JO54AL,EME,,Christoph,,144: IC820 9el DK7ZB D200 550W Preamp,11/04 -DF9IJ,JN48CX,,,,,,2003 -DF9KT,JO30GU,,,,,.167 DTR+.167,11/95 -DF9KX,JO30FQ,EME,,Rolf,,FT1000 144: LT2S 3CX800A7 Preamp 2x17ele M2,03/04 -DF9PX,JN47QT,,,Horst,,144: IC706 180W 2x10el Preamprx2000tx1200lpm,07/01 -DF9QT,JO30OR,,,Klaus,,144: 700W 11el MGF1302DTR 2000lpm,01/05 -DF9QX,JO42HD,EME,,matthias,,,1994 -DF9YF,JO42GE,,,Uli,,,12/03 -DG0CAL,JO31,,,Ullrich,,,06/00 -DG0FE,JO62UN,EME,,Lothar,,FT 736r 144: 100W 4x17el - 432: 2x21el - 129,07/03 -DG0KU,JO64AC,,,,,,01/03 -DG0KW,JO64MH,EME,,Klaus,,144: 2x 13el,01/05 -DG0OPK,JO50GG,,,Michael,,50: 5W - 144: 150W - 432: 100W - 1296: 35W -,12/04 -DG0TU,JO61TU,,,Op LZ1DP,,,08/97 -DG0WJ,JO60CV,,,,,,11/02 -DG1BA,JO43LB,,,Dieter,,only SSB-MS.383,01/00 -DG1CMZ,JO60DS,,,Michael,,,08/01 -DG1IU,JN49FA,,,,,only SSB-MS,08/96 -DG1LY,JO44RK,,,,,,03/04 -DG1TA,JN69GH,,,,,,02/01 -DG1VL,JO61WC,,,Henry,,144: 150W 17el MGF1302388,04/04 -DG1YBO,JO32RG,,,Michael,,144: FT225RD 80W 9el,09/04 -DG2BCP,JO43DC,,,Peter,,144: 4x 3.6wl DJ9BV+GS35 Pa - 432: 4x 11wl DJ,01/04 -DG2DAA,JO62GU,,,Friedhelm,,,06/02 -DG2GEP,JN48DL,,,Markus,,144: 200W 9ele Yagi,04/03 -DG2KBC,JN58MI,,,Ansgar,,144: FT847 2x2wl BVO 300W LNA,01/05 -DG2NBN,JN59NR,,,Dieter,,FT847 144: 200W 2x3wl 9BV MGF1302 - 432: 300W,08/01 -DG2NZM,JN59IV,,,Matthias,,,06/03 -DG2SRL,JO61HN,,,,,144: 2x17el 300W,10/01 -DG2VC,JO61VC,,,,,,01/04 -DG3FK,JO41PG,,,Thomas ""Tom",,TS850+TV TS790 144: 17el 150W - 432: 4x17el,09/03 -DG3JO,JO31JK,,,Bert,,TR-2000- TM-D700- DSPCOM,04/03 -DG3XA,JO43WJ,,,Andreas,,144: 200W 7el - 432: 2x20el 300Wonly SSB-MS,05/04 -DG4BH,JO30RX,,,,,,01/03 -DG4EK,JO31NI,,,,,,2003 -DG4EKE,JO31NI,,,Kai,,144: IC820h- SP2000- 17/11el- QQE06-40.088 D,01/97 -DG5AAG,JO51,,,,,,07/01 -DG5CST,JO60DS,,,Sebastian,,144: FT847 4x9el GU74 750W - 432: 23el 50WM,06/04 -DG5HV,JO43XQ,,,Michael,,,01/99 -DG5NEX,JN49WS,,,,,,93 -DG5OAF,JO51EP,,,Karlheinz,,144: FT736 400W 2x17el B2 MGF1302DTR + JUDS,11/99 -DG5SMY,JN49QA,EME,,Marc,,144: 4x 17ele 432: 4x 23ele,08/04 -DG6JF,JO31,,,Günter,,,10/01 -DG6LS,JO54AK,,,Söhnke,,144:TS790 8877 4x17el - 432: 8x33el DJ9BV 3CX,12/96 -DG6MBS,JO41AH,,,Mareike,,144: TM255 MGF1302 180W 11El-F9FT - 432: TM-4,08/02 -DG6MGP,JN58WH,,,,,,1995 -DG6SYL,JO53QP,,,Anne,,144: 150W 11el 6WU Preamp - 432: 150W 23el Pr,03/02 -DG7MHR,JN57DR,,,Dieter,,,03/03 -DG7OV,JO42VX,,,,,,10/04 -DG7RBV,JN59UM,,,,,only SSB-MS, -DG7SF,JN48RR,,,Günther,,144: FT736 300W 2x7elDTR,06/01 -DG7SFL,JN49XF,,,Michael,,144: 300 W + 10El. - 432: 150W + 2*21El.,01/04 -DG7TG,JO43TX,,,,,,01/03 -DG8NCO,JO50VH,,,Uwe,,750W 6x9el MGF1302300,01/04 -DG8NCY,JO50HA,,,,,,07/02 -DG8UAW,JN48BR,,,Stephan,,FT-847: 144MHz: 50W 7el Preamp - 432MHz: 30,09/01 -DG8YHH,JO32QI,,,Alfons,,,01/04 -DG9BEM,JO43CD,,,Thomas,,144: 350W 17el VV - 432: 300W 4x20el VV - 129,01/03 -DG9DAZ,JO31XB,,,Tino,,144: TM255,11/01 -DG9GLA,JO40,,,,,,12/01 -DG9MAQ,JN58LJ,,,Raimund,,144: IC251 200W 9el Preamp. - 432: TS811 10,11/03 -DG9NCX,JN59BT,,,Hubert,,.126,11/99 -DG9NFM,JO50QG,,,Chris,,,1/94 -DG9YIH,JO32QI,,,Helmut,,144: 500W 17el,12/04 -DH0AAI,JO51AR,,,Harald,,144: FT225rd PA 200W SP2000 4xDL7KM,08/02 -DH0GHU,JN38VN,,,Ulrich,,144: TS850 LT2S HLV300 300W 11elDTR 3000lpm,09/01 -DH0LS,JO61II,,,Jens,,144: 4CX350 500W 2x17el Preamp - 432: 150W 21,12/03 -DH0MBH,JN58JD,,,,,,01/02 -DH0OAH,JO42OB,,,,,,2003 -DH0YAZ,JO41GG,,,,,,2003 -DH1DCN,JO41BD,,,Marc,,144: IC706MK2 11el 100W137 DTR 5000lpm,08/03 -DH1FM,JO61UD,,,Tilo,,144: 90W 10el - 1296: 1W 30el.050,08/02 -DH1KBB,JO20XX,,,jörg,,,1993 -DH1NAD,JN49,,,werner,,,1993 -DH1NSP,JN59JX,,,Phil,,,01/01 -DH1TW,JN48QM,EME,,Tobias ""Toby",,144: 600W 10el,04/01 -DH2FAF,JO40,,,j.,,,1993 -DH2OAA,JO42TU,,,Michael,,144: IC275E 4x11el 6WU 500W1800lpm,03/04 -DH2RS,JN47TT,,,Ralph,,144: 75W 11el MGF1302.140.250,01/98 -DH2UAK,JO71FU,,,Klaus,,IC910+Preamps - 144: 13el - 432: 29el - 1296:,04/04 -DH3DP,JO31,,,,,,07/96 -DH3IAJ,JN48HD,,,Ralf,,50: 10W 4el - 144: 100W 10el /p JN48GD 10GHz,04/07 -DH3NAN,JO50NC,EME,,Matthias,,,12/97 -DH3VE,JN39LL,EME,,Bernd ""Erni",,FT847 144: 500W MGF1402b 4x10el - 432: 300W M,07/03 -DH3YAK,JO31RS,EME,,Winfried,,144: 12el M2 750W135 DTR 3000lpm,12/04 -DH4FAJ,JN49LW,,,Matthias,,IC821h 144: 11ele 200w - 432: 19ele 40w,05/02 -DH5FS,JO61UA,,,Fred,,144: 9el 120W - 432: 4x21el,11/00 -DH5HS,JO31FF,,,Heiko,,FT847,11/02 -DH5HV,JO31AS,EME,,Jochen,,144: FT1000+LT2S or IC910 750W MGF1302 - 432,03/04 -DH5LAN,JO44TN,,,,,,05/97 -DH5MK,JO41IV,,,Michael ""Mike",,144: 100W 6el MGF1302222,08/04 -DH6ICE,JO61XU,,,,,,07/04 -DH6JL,JO31MI,,,Mike,,50: IC-746 4ele HB9CVDTR 3000lpm,06/00 -DH7FB,JO62SM,,,Frank,,144: FT847 GS35b 2x9el DK7ZB148 2500lpm JUD,02/04 -DH8BQA,JO73CF,,,Olli,,144: FT726r 300W 2x10el PreampDTR 3000lpm,02/02 -DH8GV,JO33RL,,,Thomas,,,07/01 -DH8IAB,JO30NO,,,Werner,,,05/04 -DH8IAT,JN49GC,,,Thomas,,,05/02 -DH8YHR,JO41GV,,,,,,2003 -DH9FAG,JN49LX,,,,,,2003 -DH9GCD,JN38VF,,,Christoph,,144: 11el 100W MGF1302.127 DTR 2500lpm,05/02 -DH9KAE,JO30BW,,,detlef,,,1993 -DH9NBB,JN49WS,,,Martin,,,01/99 -DH9NFM,JO50RF,EME,,Christian ""Chris",,144: 2x17el M2 750W - 432: 2x8el M2 750W - 12,03/04 -DH9OK,JO51AS,,,Edgar,,,06/04 -DH9OY,JO51AQ,,,Edgar (Eddy),,DTR 2000lpm,05/00 -DJ0QZ,JN49LM,EME,,Frank,,144: IC746 8877 2x18el M2 MGF1302,11/01 -DJ0RU,JO31KM,,,,,,07/02 -DJ1JD,JO52CK,EME,,Uschi,,DTR,08/00 -DJ1LP,JO64,,,d.,,,1993 -DJ1OJ,JN58SE,,,Heijo,,144: 100W 2x11el SP2000DTR,10/00 -DJ1SHF,JO73AM,,,Andre,,144: TS711 120W 2x10el- PreampDTR,11/96 -DJ1TU,JN48TR,,,Klaus,,,08/02 -DJ2IA,JO71AO,,,Dieter,,144: FT736R 100Watt 9-ele-Yagi,08/02 -DJ2IE,JN48HV,,,,,,07/02 -DJ2JA,JO40IM,EME,,Roland,,DTR,04/04 -DJ2JS,JO31SL,,,Volker,,,04/04 -DJ2QV,JO31PF,,,Maik,,144: TS850S Trvt 200Watts 9el OZ5HF - 432:,12/04 -DJ2XS,JO53AK,,,matthias,,,1995 -DJ3FI,JO31DI,EME,,Hubert,,,08/00 -DJ3HW,JO42LH,,,Joerg,,144: IC-910H 600W 12elM2 MGF1302 - 432: 280W,08/04 -DJ3LE,JO44TN,,,Hans-Juergen,,50: 25WERP 5el - 144: 2x17el 600W - 432: 2x21,02/04 -DJ3MY,JN58QD,EME,,Christian,,144: 600W 4x17elDTR,08/99 -DJ3RU,JN58,,,kurt,,,1995 -DJ3ST,JN48,,,,,,2003 -DJ3TF,JN59WK,,,Wolfgang,,,06/00 -DJ3VI,JO51BS,,,Siegfried,,144: FT736r 2x11el 750W3000lpm,01/01 -DJ4SO,JO44WG,,,Klaus-Dieter,,DTR,11/99 -DJ4UF,JO30BR,,,Eckart K.W.,,144: 300W 2x 8el MGF1302138 DTR 3000lpm,09/04 -DJ5BV,JO30KI,,,Gerhard ""Gerd",,144: 600W 11el MGF1302 - 432: 400W 20el - 12,07/02 -DJ5CL,JN58WH,,,Ingo,,,08/00 -DJ5DT,JN49IV,,,,,,05/02 -DJ5HG,JO53IU,,,Klaus,,,06/04 -DJ5MN,JN58WH,EME,,Bernhard,,,06/96 -DJ5MS,JN68KS,,,Peter,,,10/99 -DJ5NV,JN59KN,EME,,Günther,,,12/01 -DJ5RE,JN59WK,EME,,Thomas,,144: GS35b 250W 2x12el M2DTR+ 3000lpm,03/04 -DJ5SQ,JN37UW,,,Ivo,,144: TS870 LT2S 600W 11elDTR 2000lpm,12/97 -DJ6JJ,JO31LG,,,Heino,,,12/01 -DJ6MB,JO30,EME,,uwe,,,1994 -DJ6OL,JO52AP,,,,,,10/04 -DJ6TN,JO54CF,,,Gunter,,DTR,09/96 -DJ6WD,JO40AT,,,Karl-Heinz,,DTR 4000lpm,03/99 -DJ6XV,JO31LQ,,,Peter,,,04/04 -DJ7AL,JO61VC,EME,,Jürgen,,144: IC910 VLA 200 4el F9FT,11/04 -DJ7FJ,JN48AG,EME,,josef,,,1994 -DJ7OF,JO51HQ,EME,,Klaus,,144: 6x17el CC 17B2 MGF1302 EME Pwr090 250,09/04 -DJ7OQ,JO42WJ,,,Erik,,144: TS 850 LT2S PA 2x 4CX250 Preap .5 dB,05/03 -DJ7RI,JO54CH,,,,,,12/03 -DJ8ES,JO43SX,,,Wolfgang,,144: 300W 17el - 432: 300W 24el - 1296: 100,08/03 -DJ8MS,JO63CT,,,Toralf ""Tor",,144: 100W 2x11el 6WU Preamp3000lpm MSDSP,08/04 -DJ8OG,JO40MF,,,Matthias,,IC 275H 8el DK7ZB,04/04 -DJ8PB,JO44MC,,,,,,1993 -DJ9BV,JO43XN,EME,,Rainer,,,07/00 -DJ9CS,JO54DG,,,Bodo,,FT-847 200W PA 50: 3 el 144: 9el,09/04 -DJ9CZ,JO31BC,EME,,Karl-Heinz,,FT847 4x15el 4CX1000A,02/04 -DJ9FG,JO52TD,,,Rolf,,HF: FT757GXII 10m Longwire - 50: 25W IRF610,05/04 -DJ9JY,JO31JM,,,Wolfgang,,only SSB-MS,01/01 -DJ9KV,JN68OK,,,hans,,only SSB-MS,06/95 -DJ9MG,JO52TC,,,Peter,,144: 2x 4CX250b 17el Tonna2000lpm,02/05 -DJ9YE,JO43HV,,,Klaus,,144: 400Watt 15el MGF1302,12/04 -DJ9YW,JO42QA,EME,,Heinrich F.,,144: 2x10el 500W - 1296: 3.5 and 4.5m dish 3,02/01 -DK0AK,JO30NQ,,,Clubstation,,,05/04 -DK0ALK,JN38TD,,,Clubstation,,,06/96 -DK0BN,JN39VX,EME,,Contestgruppe Bingen,,144: 700W 3x 9el F9FT + 2x 11elF9FT030275,09/03 -DK0EP,JO31TS,,,,,,11/04 -DK0IG,JN58SE,,,Clubstation,,144: 350W 2x11el,12/96 -DK0NHF,JO62JR,EME,,clubstation,,,1994 -DK0OG,JN68GI,EME,,Clubstation,,144: 700W 8x17elDTR,12/04 -DK0PX,JN48JC,,,Clubstation,,144: 350W 2x17el157,11/03 -DK0TU,JO62PM,EME,,clubstation,,DTR,1993 -DK0TX,JO50HK,,,,,,03/02 -DK0UB,JO31PK,,,Clubstation Ruhruni,,,08/97 -DK0VV,JO61WB,,,OP DD0VF,,144: 550W 4x7el MGF1303131 3000lpm DTR157,03/04 -DK1CM,JO40LG,EME,,Oliver,,144: FT990 LT2S 700W YL1050 18el MGF1302 - 43,04/01 -DK1CO,JO63SX,EME,,Hartmut,,144: TS790 4x17el 3CX800A7 Preamp.086 DTR,04/00 -DK1EJP,JO31DD,,,,,,03/03 -DK1KO,JO53CT,EME,,Reinhard,,144: 8877 4X17el F9FT-full elevation MGF13,12/04 -DK1MAX,JN58SP,,,Max,,,05/02 -DK1MZ,JO42XP,EME,,Stamen ""Stan",,144: EME Pwr 13el MGF1302DTR,11/03 -DK1PZ,JO41TH,EME,,heinz,,,1994 -DK1VI,JN49HH,,,Ernst,,144: 650W 16 el.- 432: 100W 21 el.- 1296: 120,07/01 -DK2AM,JO43AK,,,Dieter,,144: 450W 4x14el MGF1302DTR,12/01 -DK2BJ,JO30BS,,,Ulrich,,,04/04 -DK2FT,JO42KC,,,,,,2003 -DK2UO,JO30,,,heijo,,,1993 -DK2YCT,JO32RG,,,Chris,,,12/03 -DK3BU,JO33NO,EME,,Harm,,50: 25 W ERP 5el - 144: 749W 4x12el Pream,05/02 -DK3DUA,JO61TC,,,Thomas Rudolph,,144: FT847 1000Watts ERPDTR 3000lpm,04/00 -DK3EE,JO41GV,EME,,Thomas,,144: 8877 9el F9FT,08/04 -DK3FB,JO31UC,EME,,Rüdiger,,432: 750W 4x23el - 1296: 150W 37el - 2300: 5W,03/01 -DK3IK,JN39JF,,,Volker,,800lpm,04/97 -DK3MU,JO72GK,,,,,,10/20 -DK3QZ,JO31LP,,,Detlef,,,07/02 -DK3RV,JO31,,,walter,,,07/96 -DK3SE,JN37VP,EME,,Salvo,,,01/05 -DK3WG,JO72GI,EME,,Jürgen,,144: EME-PWR 6x 14el 5wl MGF1302 432: 1KW 8,05/04 -DK3XM,JO43XL,,,Thorsten,,144: 700w 2x2wl 60m asl,09/04 -DK3XT,JN49FE,,,Bernd,,,10/04 -DK4JN,JO31,EME,,a.,,,1994 -DK4OG,JN68GI,,,,,,2003 -DK4TG,JO31LB,EME,,Lothar,,117.180,01/05 -DK4WN,JN49EP,,,Wolfgang,,,11/03 -DK4XI,JN39NG,,,,,,2003 -DK5AI,JO51GO,EME,,Wolfgang ""Wolf",,,01/04 -DK5DC,JO31SL,,,Peter,,,07/02 -DK5DQ,JO31PG,,,Nicolas ""Nico",,144: 300W 2x10elDTR + 3000lpm,03/04 -DK5IT,JN49FB,,,,,,2003 -DK5KK,JO63EX,,,Matthias,,DTR,01/01 -DK5LA,JO44TR,EME,,Reinhard,,,08/02 -DK5MV,JN58WH,,,,,,08/97 -DK5PD,JN39VV,EME,,Lothar,,.040.280,03/00 -DK5TE,JN58BG,,,Stephan,,144: IC746 HLV600/8877 2x13el 432: IC475H 2x2,05/02 -DK5WO,JO30AS,,,Norbert,,,09/01 -DK5YA,JN49NX,EME,,Udo,,50: 4el - 144: GS35b 4x9elM2 PHEMT 0.3db -,07/04 -DK6AS,JO52,EME,,andreas,,,02/01 -DK7BY,JO33RJ,EME,,Karsten ""Sten",,750W,03/04 -DK7LH,JO43BB,,,Maik,,144: IC271 400W 2x3.6wl 9BV - 432: IC471H 100,12/01 -DK7LZ,JO30,,,,,,12/01 -DK8EL,JO31LJ,,,Thorsten (Tom),,144: 100W 9el MGF1302.162 2000lpm.162,12/04 -DK8KX,JO30,,,,,,05/04 -DK8VS,JN39NF,EME,,Werner,,,07/01 -DK8ZJ,JO54AG,EME,,Martin,,144: 550W 4x12el,10/02 -DK9OY,JO52CK,EME,,Detlef (Det),,DTR,10/01 -DK9RL,JN69BB,,,,,,01/97 -DK9TF,JO31NF,,,Jürgen,,FT726r- 17el,05/03 -DK9TU,JN48MF,,,Manfred,,144: 500W 13el DJ9BV,04/03 -DK9ZY,JO40BE,EME,,Wolf-Dietmar,,144: TS850 Trvt YL1052 MGF1302 4x10el 2.2,11/99 -DL0AO,JN59WI,EME,,Clubstation OP DJ3TF,,,02/03 -DL0AVH,JO52,EME,,OP DL7AWO,,144: 700W 2x2M18XXX,07/01 -DL0BWS,JO61,,,OP: Normen,,144: IC-910 100W 2x9el - 432: IC910 4x19el,01/03 -DL0DBR,JO54WC,EME,,Clubstation,,,06/99 -DL0DET,JO52CK,EME,,Clubstation OP DK9OY,,DTR,1994 -DL0EF,JO30IM,,,,,,2003 -DL0FTG,JO53FM,,,Clubstation,,,04/01 -DL0GER,JN49CC,,,,,,08/00 -DL0HES,JO41RF,,,Clubstation,,IC820H 144: 250W 2x11el - 432: 130W 2x23el P,07/01 -DL0LAU,JO61JF,,,,,,05/02 -DL0LN,JO31RS,,,Clubstation N29,,,10/04 -DL0LSW,JO61XU,,,Clubstation,,144: 17el 750W,12/99 -DL0PO,JO43CD,,,Clubstation,,,08/96 -DL0SHF,JO54BH,,,,,,2003 -DL0UL,JN48XK,,,OP DL6SAQ- DL5EBT,,144: 11el 400W 3CX800,04/01 -DL0UMK,JN68BC,EME,,Clubstation,,144: TS790S 4CX1000 4x17el 5WL.123 1500lpm.3,1995 -DL0VV,JO64AD,,,Clubstation- DL5CC,,144: 600W 17B2 Ant 9A4GLDTR 2500lpm,12/04 -DL0WAE,JO42DC,EME,,Teuto Contest Group,,750w and lots of aluminium!,05/04 -DL0WH,JN49HN,EME,,Clubstation OP DF7IT,,,1992 -DL0WX,JO30FQ,,,Clubstation,,,07/96 -DL1AAH,JO52EF,,,Dirk,,IC910H IC703 144: 17el - 432: 21el,08/03 -DL1AOQ,JO50IW,,,Dietmar ""Dean",,,05/02 -DL1BKY,JO33RL,,,,,,2003 -DL1DAX,JO31RM,,,Rüdiger,,144: IC251E 100W 11el - 432: FT780R 30W,04/07 -DL1DSB,JO61,,,r.,,,1993 -DL1DUR,JO70KV,EME,,Jürgen,,144: IC275H 700W 4x11el S3030DTR,08/00 -DL1DWI,JO61VC,EME,,Gerhard,,,10/04 -DL1EAP,JO31IK,,,Wolfgang,,144: 12el 750W172 DTR 2500lpm272 / 363,02/04 -DL1EEX,JO31MA,,,Peter,,144: 750W 10db ant.DTR+ 3000lpm,09/00 -DL1EFJ,JO31GM,,,Norbert,,,09/01 -DL1EL,JO41RF,,,Ralf,,IC820H 144: 250W 2x11el - 432: 130W 2x23el P,09/01 -DL1ELY,JO31IO,,,Stefan,,144: FT225rd Mutek 17el 150W.181 5000lpm JUD,01/01 -DL1GBF,JN48NJ,EME,,Peter,,,02/97 -DL1GBM,JN48FD,,,Michael,,50: 7W - 144: 400W- 432: 100W- 1296: 200W222,07/02 -DL1GGT,JN58AO,EME,,Tom,,144: 8877 2x 12el elev. 10368: 5W 60cm4000l,12/04 -DL1GI,JN49FG,,,Ralf,,,12/03 -DL1GNM,JN38WB,,,Michael,,DTR,10/02 -DL1HTT,JO61FR,,,,,,11/99 -DL1HYZ,JO62,EME,,Uli,,,03/01 -DL1JJ,JO31IA,,,Ulli,,,08/02 -DL1KDA,JO30FQ,EME,,Alex (Sternchen),,FT1000 144: LT2S 3CX800A7 Preamp 2x17ele M2,03/04 -DL1MAJ,JN68AH,,,Alex,,144: 2x17el 750WDTR,12/99 -DL1NEO,JN59KV,,,Markus,,144: IC275H SP2000 Beko HLV600 (max. 600 W),09/99 -DL1NFI,JN59KV,,,Matthias,,144: IC746 100W 12el M2,01/02 -DL1NUX,JN59LG,,,Attila,,IC706MK2G FT847 (/p JO50KI),06/02 -DL1OJ,JO42QI,,,Henning,,144: Elecraft K2 LT2S Beko HLV600 2x9el 50,03/01 -DL1RNW,JO62GH,,,Ronny,,144: 150W 12-5db Yagi,01/05 -DL1RTL,JO62PH,,,Heiko,,144: 13el 100W MGF1302,07/01 -DL1SDN,JN48PP,,,Dieter,,144: 2x11el 500WDTR 2000lpm,07/99 -DL1SFK,JN48PR,,,Oliver,,DTR,06/02 -DL1SUN,JO53PN,,,Norbert,,,04/00 -DL1SUZ,JO53UN,,,Uwe,,50: IC706 3el - 144: IC821 GS35 2x11el Prea,01/05 -DL1UU,JO62SP,,,Wolfgang,,144: 300W 2x9el135 DTR.220,03/04 -DL1YMK,JO31QX,EME,,Michael,,,02/05 -DL2AKT,JO50NV,,,Jens,,IC746 IC706MKII - 144: 700W 9el333,03/02 -DL2ALF,JO50IW,,,,,144: 100W 9elMSDSP,08/02 -DL2ARD,JO60AR,,,Oliver,,144: IC275E 350W 4x17el.149 DTR 3000lpm,08/04 -DL2CJ,JO50,EME,,alfred,,,1994 -DL2DAO,JO31PH,,,Harry,,144: 600W 24el,11/02 -DL2DXA,JO61VC,,,Bernd,,144: 150W 11el.117,01/97 -DL2EAA,JO31KL,,,Dirk,,,07/98 -DL2FDL,JO40LN,,,Michael ""Mike",,FT736R 50: 5el - 144: 150W 9el - 432: 19el 2,08/03 -DL2IAN,JN49BC,EME,,Thomas ""Tom",,144: 1 KW 2x9eltx1500 rx2000lpm,07/01 -DL2IE,JN48,,,dr. r.,,,1993 -DL2JA,JN58,,,,,,02/04 -DL2LAC,JO44MR,EME,,Ernst,,144: 18 dBd GS35b 432: 20 dBd GS35b 1,01/05 -DL2LAH,JO44QS,EME,,Karsten,,144: 750W,11/02 -DL2MHS,JN58,EME,,Thomas,,,03/00 -DL2NFX,JN59IV,,,Michael,,144: IC746 100W3000lpm,04/01 -DL2NUD,JO63LE,,,Hermann,,,05/04 -DL2NWK,JO63SP,EME,,wolfgang,,,1993 -DL2OCB,JN49IS,,,Stefan,,FT726,01/03 -DL2OM,JO30SN,EME,,Roland,,,08/01 -DL2RMC,JN68GI,,,,,,11/97 -DL2RSX,JO62SH,EME,,Olaf,,144: 19 dBd MGF 1302 DSP 1-2KW,12/03 -DL2RUG,JO62,,,,,,01/03 -DL2SDQ,JN49OC,,,Thaddeus (Tadek),,.238.238,08/01 -DL2UX,JO61VA,,,Mario,,144: TR751E 5el 25W - /p JO61VC: 100W 13,08/02 -DL2YDS,JO32,,,Stefan,,,08/97 -DL3AAL,JO52,,,b.,,,1993 -DL3AZI,JO51ME,,,,,,01/97 -DL3BUE,JO72FH,,,Joerg,,,08/02 -DL3BWG,JO62TQ,,,,,,1995 -DL3DTS,JO61UA,,,sylve,,,1993 -DL3FBJ,JO40,,,,,,11/01 -DL3GN,JN37VX,,,Udo,,,07/01 -DL3HRT,JO61AB,,,Karsten,,144: 10el 2.3wl 100W GaAsFet DSP-NRDTR,07/02 -DL3IAE,JN49DE,EME,,Daniel,,50: TS120 trvt 6el - 144: 3CX800 750W 2x10el,07/99 -DL3IAS,JN49EJ,,,Nino,,144: 20W 10el DK7ZB - 432: 3W 23el DK7ZB - 12,08/03 -DL3JAN,JO60KT,,,Jan,,144: 9el 300W,03/01 -DL3JIN,JO60LX,,,Peter,,,04/03 -DL3LBK,JO54AH,,,Kai,,144: 250Watt 11el.082 DTR.382,07/96 -DL3LST,JO61FI,,,Ray,,,01/05 -DL3MBG,JN68,,,Christian,,,01/96 -DL3MGL,JN58QD,,,Carlos,,DTR,12/01 -DL3NAW,JN59KV,,,Wolfgang,,144: 500W 2x11elDTR tx1200lpm,08/03 -DL3NCR,JN48QX,,,Georg,,50: IC736 3el Yagi - 144: IC275E 11el DL6WU 8,01/04 -DL3RBH,JN68HJ,,,Robert,,,05/99 -DL3RU,JN49FG,,,,,,2003 -DL3SAS,JN48OR,EME,,Hartmut,,,04/96 -DL3TN,JO31LC,,,,,,12/01 -DL3TW,JO44SK,,,Thorsten,,144: FT1000 LT2S 6x6el 600W,01/03 -DL3WW,JO60FL,,,,,,08/04 -DL3XT,JN49FT,,,bernie,,,1993 -DL3YBP,JO42,EME,,heiko,,,1993 -DL3YEE,JO42GE,EME,,Klaus,,,01/05 -DL3YEL,JO41EV,,,Ulrich (Ulli),,144: 9el 3CX8002500lpm DTR,07/02 -DL4ABJ,JO42XP,,,,,,2003 -DL4ALI,JO50JW,,,Steffen,,,07/99 -DL4ANT,JN49LF,,,Jörg,,,09/01 -DL4AO,JO42NX,,,Heinz,,144: 150W 11el,07/04 -DL4DTU,JO60TS,EME,,Norbert,,DTR,01/02 -DL4DWA,JO61QH,,,Uwe,,144: 120w 13ele 432: 35w 19ele370,01/05 -DL4EA,JO31,,,Frank,,,09/96 -DL4EBY,JO62PM,EME,,Klaus,,DTR,12/03 -DL4IB,JO64CC,,,Manfred,,144: 11el 300WMSDSP,12/98 -DL4KG,JN48OU,EME,,Gerald,,TS2000 - 50: dipole - 144: 10el DJ9BV 100W,05/04 -DL4MEA,JN58RI,EME,,Guenter,,144: GS35b 15el MGF1302 432: GS35b 6x33el,09/04 -DL4MP,JN48NV,,,Manfred (Manne),,50: 100W 5el.095.195,01/01 -DL4NAA,JN49NX,,,Christian ""Chris",,144: hm 750W 2x15el.144 2000lpm,04/01 -DL4SUN,JO63CT,,,,,,10/04 -DL4XX,JO43XK,,,,,,07/97 -DL4YAO,JN58,,,,,,05/02 -DL4YBM,JO42DC,,,joe,,,1995 -DL5AG,JO41,,,,,,01/03 -DL5BAC,JO43LG,,,hans-jürgen,,DTR,01/96 -DL5BBW,JO32NH,,,,,,01/01 -DL5CC,JO64AD,,,Manfred,,144: 17el 600W2500lpm DTR,12/04 -DL5DAV,JO31,,,Uwe,,,1994 -DL5DTA,JO61SD,EME,,Arnfried ""Andy",,144: 4x11el EME Pwr GaasFet DSP59.134 DT,08/99 -DL5EBS,JO31LH,,,Juergen,,144: FT847 150 W 13 el Yagi,08/03 -DL5FDP,JN49LP,,,Stefan,,,11/02 -DL5GAC,JN47UT,,,Robert,,144: 400W 15el CueDee CF300DTR,08/04 -DL5IO,JN49NI,,,,,,01/97 -DL5LF,JO54,EME,,Frank,,432: 1KW 4x9el 9BV 8.5lb - 1296: 20W 23el.010,08/00 -DL5MAE,JN58VF,EME,,Wolfgang,,144: 8x17el 700WDTR,01/05 -DL5MAM,JN58UB,,,Karl,,144: 100W 10el,07/04 -DL5MCG,JN58KH,,,Wilhelm,,144: 11el 500W3000lpm,01/05 -DL5ME,JO52SD,,,Mario ""Mao",,144: 100W 18el3000lpm,04/04 -DL5MEL,JN58,,,Sigi,,144: 600W 11el,03/00 -DL5NEN,JN59MO,,,Thomas,,144: 12el GS35b MGF1302 - 432: 28el GS35b - 1,12/97 -DL5OAU,JO52GW,,,Ulrich,,,01/03 -DL5QQ,JO32KB,EME,,Thorsten,,.060.330,04/96 -DL5RBW,JN58VF,,,,,,2003 -DL5RDO,JN59VN,,,,,,1992 -DL5ROB,JN68HG,,,Robert,,144: 300W 16el BF981MSDSP,08/02 -DL5WG,JO52VK,,,Rolf ""Roy",,50: 20W 4el - 144: 300W 2x11el144 DTR 250,05/04 -DL5XV,JO53AP,,,Bernd,,144: 2x15el 600W.128.228,07/01 -DL5YAS,JO31WS,,,,,,12/01 -DL5YET,JO41EV,,,Markus,,144: 750W 13el - 432: 750W2000lpm DTR,04/02 -DL5ZA,JO51HK,,,Reinhard,,144: IC706 100W 14el F9FT,01/04 -DL6BF,JO32QI,,,Heinz,,144: 250W 13el - 432: 150W 4x11elDTR 2500l,05/03 -DL6EAT,JO43VR,,,Andreas,,,01/97 -DL6KR,JO30NQ,,,Martin,,,05/04 -DL6LAU,JO53CF,EME,,Carsten,,,07/03 -DL6MFK,JN67,,,Robert,,,05/03 -DL6NAA,JO50VF,EME,,Reinhold,,,10/00 -DL6NCI,JO50VI,,,lorenz,,,1993 -DL6RDR,JN68BM,,,Stephan,,.065,10/95 -DL6UAL,JO61XU,,,,,144: 750W 2x BigWheel,12/00 -DL6WT,JN39VV,EME,,Jürgen,,.030.260,04/96 -DL6WU,JN49HT,EME,,Günter,,,02/04 -DL6YCY,JO41,,,Maik,,,12/99 -DL6YEH,JO32VA,EME,,Andreas ""Andy",,144: IC730 LT2S 749W 2x2.2wl 9BV - 432: IC7,03/02 -DL6YFB,JO31KM,,,reinhard,,,01/96 -DL6ZAU,JO40JF,,,Gerd,,FT736+MHP145 144: 350W 2x12el M2145 3000 DTR,09/03 -DL6ZBN,JO40ED,,,Joerg ""Joe",,144: TS700S 80W 11el MGF1302DTR 3500lpm,05/02 -DL7AJA,JO40AQ,,,Friedhelm ""Fred",,144: IC-706MKIIG 3CX1500A7 MGF1302 17el. T,11/04 -DL7AKA,JO62QO,EME,,HansJürgen ""Hajo",,144: TR7 Trvt 2x4CX250b 15el DJ9BV.144 25,01/01 -DL7APV,JO62,EME,,Bernd,,,08/00 -DL7ARM,JO62RJ,,,Christian,,,12/95 -DL7AUK,JO62,,,,,,2003 -DL7DCU,JO41BC,,,Jan,,144: FT767 100W 4x11el MGF1302only SSB-MS,03/99 -DL7FF,JO62TJ,EME,,Bernd,,HF 100W FD4 - 144: 4x11el 1KW.063 DSP.370,05/02 -DL7QY,JN59BD,,,Claus,,,01/97 -DL7TX,JN49IV,,,Peter,,144: 50W 6el - 432: 17el 100W,11/01 -DL7UAE,JO62PH,EME,,Thomas,,FT736R 50: PA Tonna20505 - 144: GS35 4x3wl (,01/05 -DL7UDA,JO62TK,EME,,Dietmar,,144: IC275H GS35b 17el F9FT 432: IC475H GS3,12/04 -DL7UGB,JO62,,,,,,05/97 -DL7ULE,JO62,,,,,,12/95 -DL7ULM,JO62SN,,,,,,05/01 -DL7UME,JO62SN,,,,,,2003 -DL7YC,JO62PK,,,Manfred,,HF: 400W - 50: 10W - 144: 200W - 432: 750W -,09/03 -DL7YW,JO62RK,EME,,Jürgen,,.320,01/02 -DL8AKI,JO51,,,Sigi,,,11/95 -DL8BBL,JO42,,,,,,04/04 -DL8BDU,JO43AA,,,Klaus,,144: 600W 15el,08/04 -DL8CMM,JO52VM,,,Günter,,.137,05/04 -DL8DAT,JO31,EME,,manfred,,,1993 -DL8DUL,JO61,,,,,,08/04 -DL8EBW,JO31NF,EME,,Guido ""Guy",,144: TS2000 12el M2-10°elev GU74b SSB-Preamp,02/05 -DL8FBD,JO40,,,g.,,,1993 -DL8GAM,JN37,,,Urs,,144: TS870 600W 11elDTR,12/97 -DL8GP,JN39LH,EME,,Hans W.,,144: SE400/Icom 761/LT2S 750W 4xCrossyagis (,08/04 -DL8HCZ,JO53AP,,,Joachim,,DTR,11/00 -DL8LAQ,JO43XU,,,Norbert,,144: TS850 LT2S 350Watts Preamp 17el Tonn,01/01 -DL8NBN,JN58,,,a.,,,1993 -DL8OBU,JO42XI,EME,,Jürgen,,432MHz: 750W 4x33el - 1296MHz: 150W 67el1881,11/01 -DL8SCL,JN48RM,EME,,georg,,,03/01 -DL8SCQ,JN48RV,,,Eberhard,,DTR,07/99 -DL8UCC,JO71EQ,EME,,Helge,,144: 500W 2x11el or 2x17el,07/04 -DL8YE,JO31MH,,,Christian,,144: FT221r 17el M2 350W,07/04 -DL8YET,JO31MH,,,,,,01/05 -DL8YHR,JO41GV,EME,,Frank,,50: LT6S 2x9el M2 - 144: 24el M2 750WDTR tx,01/05 -DL9AN,JO62RE,,,Bernd,,50: 10W 5el - 144: FT736r 750W GS35b 2x12el,08/04 -DL9BDM,JO33RL,,,eilert,,,1993 -DL9DBJ,JO31VH,,,,,,12/94 -DL9EBF,JO31FH,,,,,,2003 -DL9EBL,JO31,EME,,karl,,,1994 -DL9GBH,JN48RW,,,,,,12/01 -DL9GRE,JO64PA,,,Stefan,,,08/02 -DL9GS,JO31OM,EME,,Alfred,,DTR,03/01 -DL9IM,JO31,,,,,,07/04 -DL9KR,JO40DE,EME,,Jan,,,09/02 -DL9MCC,JN58UA,,,Johann (Hans),,144: 4x 2-4wl 700W MGF1302 - 432: 2x 7wl 700W,08/03 -DL9MS,JO54WC,EME,,Joachim,,144: 4x17el GS35b MGF1302160 DTR 3500lpm360,11/04 -DL9NDD,JN59KN,,,,,,2003 -DL9OA,JO64EB,,,Bernd,,144: IC821 100W 9el/2.5wl CF300MSDSP,03/02 -DL9OBD,JO42QN,EME,,Thomas ""Tom",,IC7400 144: 4x11el 750W BF981 - 50: 5el 25,10/03 -DL9RCI,JN68,,,,,,07/95 -DL9USA,JO71EN,,,Andreas,,144: 10el DL6WU 300W RXAmpl3000lpm MSDSP,09/03 -DL9YEY,JO41GV,,,,,,2003 -DM1CG,JO31IC,,,Carsten ""Gaby",,50: TenTec 526 10W 4ele 144: TS 850 LT2SMK,01/05 -DM1HD,JO31GD,,,Herbert,,144: TS850S LT2S HLV600 600Watt 17 EL M2only,08/02 -DM2BHG,JO51MW,EME,,Heinz,,144: 4x17el 2xGS35b MGF1302,02/01 -DM2DXG,JO51MV,,,Bernhard,,,06/02 -DM2ECM,JO62GJ,,,,,,11/01 -DM2GS,JO42HJ,,,Günther,,,12/04 -DM2PG,JO51,,,,,,04/03 -DM3FG,JN49LT,,,Frederico,,,04/03 -DM3FM,JO40MF,,,Matthias,,144: IC275H 8el 7ZH,06/02 -DM4KA,JO64II,,,Stephan,,,03/03 -DN1FC,JO41RF,,,OP DL3ZBA,,IC820H 144: 250W 2x11el- 432: 130W 2x23el Pr,07/01 -DN1MA,JN58VF,,,OP: DN1MA- DL5MAE,,144: 8x17el 700WDTR,12/00 -DN2MS,JO31OM,,,OP DJ2QV,,144: C5400 HG51 400W 9el MGF1302DTR,12/98 -DO1CTL,JO60LT,,,Frank,,,08/01 -DO1EDK,JO31RL,,,Dirk,,,05/04 -DO1EL,JO31JL,,,,,,06/02 -DO1ERS,JO31JC,,,Ruediger,,144 : FT 221R 10Watt 4el Yagi WIMO RX-PA06,01/04 -DO1NF,JN69,,,,,,08/01 -DO1YDS,JO42HJ,,,Daniel,,,04/04 -DO3MT,JN67,,,Tom,,FT817,01/03 -DO5AN,JO31,,,,,,04/02 -DO9ST,JN49VW,,,Thomas,,,03/01 -EA1ABZ,IN71QO,EME,,Ramiro (Rami),,144: 4x12el or 11el DL6WU 1500W (4CX250+GS35B,10/02 -EA1AIB,IN82TK,,,,,,08/95 -EA1BFZ,IN81SS,,,,,,04/04 -EA1BLA,IN53UM,,,Manel,,50: 100W 5el - 144: 1kw 12el MGF1302 - 432,10/02 -EA1CRK,IN73DM,,,Carlos,,Kenwood ts-790e or Icom 706 MkII 50: 100W 7,01/04 -EA1CYE,IN83,,,p.,,,1993 -EA1DDU,IN73FM,,,Domingo Alvar ""Domi",,50: 10W 5el - 144: 170W 16el CF300 - 432: 120,08/03 -EA1DOD,IN73AN,EME,,alfredo,,,1993 -EA1EBJ,IN73FF,,,Santurio,,50: IC729 10W 4el - 144: IC260 80W 17el - 432,04/01 -EA1EW,IM79WS,,,Miguel A.,,,07/95 -EA1JK,IN72RA,,,EA1JK,,only SSB-MS,01/01 -EA1KV,IN52PF,,,Andres,,,1993 -EA1OD,IN73EM,,,j.c.,,,1990 -EA1RX,IN52PF,,,Enrique,,IC706 MKIIG,06/03 -EA1SH,IN63GA,,,Manuel,,144: 17B2 170W GaAs-Fet - 432: 31el 180W GaAs,05/04 -EA1YV,IN52OC,EME,,Agustin,,50: IC706 2x5el - 144: TS790e GS35b 2x17elB2,10/02 -EA2AF,IN92,,,,,,1990 -EA2AGZ,IN91DV,EME,,Nicolas,,FT1000MP- FT736 144: 4CX1500b 4x17B2CC MGF140,07/04 -EA2AJX,IN83,,,Inaki,,50: 10W Dipol - 144: 100W 6el Quadonly SSB-MS,08/02 -EA2ARD,IN93,,,,,,08/02 -EA2AVY,IN92DS,,,,,,2003 -EA2KP,IN83MG,,,Miguel ""Mixtel",,144: TR751E 2M18XXX 200W Preamp - 432: 100W 2,04/04 -EA2LU,IN92ET,EME,,Jorge,,144: 4x9el 1KW MGF1302.127 DTR,10/02 -EA2LY,IN93AH,,,Enrique Gil,,144: TS790 4CX1500 LNA144 2x18elDTR,08/98 -EA2RCF,IN82,,,,,,08/02 -EA3ADW,JN11CQ,EME,,J.Miguel (John),,,10/02 -EA3AEL,JN01,,,,,,1993 -EA3AIR,JN11,,,j.i.,,,1993 -EA3AQJ,JN11BJ,,,ramon,,,1987 -EA3AXV,JN01TJ,,,Joaquim ""Quim",,144: FT920+trsv GS35b 17B2,07/03 -EA3BB,JN01VS,,,Pau,,144: 20el M2 400W MGF1302,01/00 -EA3BEW,JN01SG,,,,,,12/95 -EA3BTZ,JN11BI,EME,,Enric,,144: 100W 16el 0.8db preamp,09/02 -EA3CN,JN11BI,,,Manuel,,,03/96 -EA3DUY,JN12LD,,,Tony,,144: 4x17el 800W - 50: 6 el 500W - 432: 21el,08/02 -EA3DXU,JN11CM,EME,,Jose Maria (Josep),,144: 2 x 17 El M2 + 4CX1500B - 432: 2 x 38 E,01/05 -EA3ECE,JN01LT,,,,,only SSB-MS,11/97 -EA3EHQ,JN11HR,EME,,Jose m.,,,03/96 -EA3FLN,JN11KT,,,Jordi,,144: IC275H 450Watts GaAsFET preamp 0.6dB,04/04 -EA3GAW,JN11BI,,,,,,2003 -EA3GCJ,JN11EM,,,Amadeo,,Yaesu FT-107M,04/04 -EA3GFB,JN11,,,,,,12/95 -EA3GIQ,JN01ND,,,Ramon,,,07/95 -EA3IH,JN11BJ,,,rafael,,,1987 -EA3KU,JN00JV,,,Fernando,,144: IC275H 2x4CX250 16el- preamp.113 DTR,07/03 -EA3MD,JN11,,,,,,1994 -EA3MM,JN01WH,EME,,Radioclub,,,1993 -EA3PL,JN11PL,EME,,vicente,,,1994 -EA3TI,JN11JT,,,Ramon,,144: 17el 5lambda Yagi 400Wonly SSB-MS227,01/05 -EA3UM,JN01,EME,,magin c.,,,1994 -EA3URC,JN11,,,OP EB3GCP EB3FYM,,YAESU FT-100 ICOM IC-706MKII - 144: 50W 14el,05/03 -EA3WH,JN01,,,j.g.,,,1993 -EA4AMX,IM89AT,,,Jose Luis,,only SSB-MS,07/01 -EA4BAS,IN80HL,EME,,Miguel,,FT847 144: 17el 180W MGF1302 - 432: 35el 100W,09/02 -EA4ED,IM79FW,EME,,,,,1994 -EA4EHI,IM68TV,,,Jose Luis,,144: IC275H 1500W 4x17B22500lpm,07/01 -EA4EOZ,IN80CI,,,Miguel Angel,,144: TM255 9el 40WDTR 3000lpm,01/02 -EA4LU,IM68TV,,,Paco,,144: FT726r 400W 17el (17B2).080 1500lpm,04/03 -EA4SV,IM68MU,,,Roberto,,,04/04 -EA5AAJ,IM99SL,,,Manuel ""Dom",,144: IC-706MK2G 100W 9el,04/04 -EA5CJ,IM99TL,EME,,jacinto,,,1994 -EA5EMM,IM99,,,j.,,,1993 -EA5GIY,IM98XD,EME,,Eric,,,01/99 -EA5HM,IM99,,,p.r.,,,1993 -EA5IC,IM98,,,mario,,,1994 -EA5NO,IM98FV,,,,,,08/97 -EA5SE,IM98IL,EME,,,,,11/04 -EA5ZF,IM99VT,EME,,Javier Oliver,,50: 50 W 3 el - 144: 800Watt 17el LNA145 -,08/03 -EA6ADW,JM19LU,EME,,Peter,,50: 20dbd- 144: 40W- 10el- up: div. Spiegel,07/97 -EA6DD,JM19JK,,,Biel,,144: IC706MKIIG 17elB2 100W,05/03 -EA6FB,JM08PV,EME,,Jose,,085 MSDSP,08/02 -EA6IB,JM09SB,,,OP EA6FB-6QB-EB6AOK,,144: IC251E 150W 15elYagi076 2000lpm MSDSP,04/02 -EA6NP,JM19MQ,,,juan miguel,,,1993 -EA6QB,JM08PV,,,Bartolome ""Bartolo",,144: 2x15el 4CX400MSDSP,05/03 -EA6SA,JM19IR,EME,,Josep,,144: FT847 2x4CX250 2x17el - 432: 4x33el,08/02 -EA6VQ,JM19HN,EME,,Gabriel,,144: 1.5KW MGF1302 8x17el M2 432: 21el,01/05 -EA7AJ,IM87CS,,,Juan,,144: 300W 2x 19el,08/04 -EA7DBH,IM76GD,,,miguel angel,,,1994 -EA7EYX,IM87CS,,,,,,12/04 -EA7HG,IM87CS,,,Uge,,,01/04 -EA7IT,IM87XI,,,John,,144: 14el 100W.147 1200lpm,10/00 -EA7OC,IM77OV,,,Luis R.,,144: IC820 250W 17el.330,03/01 -EA7RM,IM87CS,,,Manuel Abian (Nino),,144: TR9130 240W 17B2 OH5IY2000lpm,07/02 -EA7TL,IM76GC,,,juan lucas,,,05/96 -EA7TN,IM66VP,,,Nacho,,TS2000 144: 100 W 2.5 wl,10/04 -EA8FF,IL28,EME,,Mark,,,02/01 -EA9AI,IM75IV,,,Francisco Javier,,144: 100W 9el.070,06/03 -EA9MH,IM85NG,,,Manuel,,only SSB-MS.400,05/00 -EB1BKG,IN62BH,EME,,Pily,,,11/01 -EB1DNK,IN62CI,EME,,Jose Manuel,,144: IC706 4x17el 500 Watt MGF1302 - 432: 7,01/05 -EB1EFC,IN52OF,,,alfonso,,,1993 -EB1EHO,IN73DM,,,Luis,,144: 17el 200W - 432: 21el 50W130280,07/04 -EB1EUW,IN82TK,,,,,,1995 -EB1IHY,IN52PM,,,Julian,,144: 17el 160W,07/04 -EB1ISN,IN71SW,,,Juanjo,,Icom 275H 16el Arake,12/04 -EB1IVY,IN53SJ,,,Gonzalo ""Zalo",,,07/02 -EB2AYV,IN83MG,,,George,,144: 250W 2M18XXX,01/04 -EB2DTP,IN82NS,,,Inigo,,FT847 IC746 FT816 17el 1000W,08/03 -EB3BAP,JN11CJ,,,Patxi,,144: FT736r 200W 17elonly SSB-MS,01/01 -EB3CNX,JN11DI,,,,,,1993 -EB3EPR,JN01ND,,,,,,2003 -EB3GHU,JN11CJ,,,Ramon,,,04/04 -EB3WH,JN01WN,,,Juanjo,,,1993 -EB4DF,IM79QQ,,,Juan,,TS-790 FT-817 144: 500W 17el - 432: 500W 21,06/04 -EB4EQZ,IN80DK,,,,,only SSB-MS,08/96 -EB4ERS,IN80BH,,,Juan Carlos,,FT736 144: 140W 9el GaAs-Fetonly SSB-MS.385,01/00 -EB4EUB,IN80DJ,EME,,Toni,,50: 6el 100W - 144: 17el 1KW MGF1302 - 432: 2,08/00 -EB4FXD,IM78BX,,,Manolo,,144: 150W 17el,02/04 -EB4GIA,IN80CG,,,Pedro,,144: IC821 IC706 TS790 240W 17el - 432: 100W,02/98 -EB4TT,IN70XJ,,,Miguel,,.183 DTR,05/00 -EB5AYG,IM99TN,,,Paco,,144 FT902DM Trvt 4cx350 4x11el F9FT,05/03 -EB5AZO,IM99RA,,,Paul,,,11/04 -EB5EEO,IM98PG,EME,,Vicente,,144: FT736 2x17el 4CX1500 DSP - 432: FT736 4x,09/99 -EB5EHX,IM99,,,x.-a.,,,1993 -EB6AOK,JM09RB,,,Enrique,,144: 70W 9el,04/03 -EB7BQI,IM76SR,,,,,,06/03 -EB7COL,IM77AG,,,Jose,,,05/04 -EB7EFA,IM67XI,,,mairena,,,1995 -EB8ANY,IL18,EME,,Marc,,144: 500W 4x 7el,12/04 -EB8BTV,IL18QI,,,Fernando,,only SSB-MS,05/03 -ED1GSR,IM79WS,,,,,,1994 -ED4RKF,IM79WS,,,OP EB4GIA,,144: 240W 13el1500lpm,03/97 -ED5TOR,IN90XP,,,Op. DL3MGL,,,1993 -ED6EIG,JM19IM,,,,,only SSB-MS.243,08/99 -EG3TVC,JN11BI,,,OP EA3DXU,,144: 400W 17el M2.115,12/99 -EH1RX,IN52IN,,,Enrique,,IC706 MKIIG,03/02 -EH3AXV,JN01TJ,,,Joaquim ""Quim",,50: FT920+trsv GS35b 6elYagi150,07/02 -EH5RM,IM98,,,,,,07/02 -EH7RM,IM76QM,,,,,,2003 -EH9LS,IM75IV,,,,,,2003 -EI2CA,IO62,,,Paul,,only SSB-MS,1988 -EI2FSB,IO51DN,,,Tony,,144: 100W 2x9el,05/02 -EI2VPX,IO53IQ,,,,,,1991 -EI3GE,IO63XD,,,Jim,,only SSB-MS,08/00 -EI4DQ,IO51WU,EME,,Tom,,144: TS711 4CX1500b MGF1302 4x14el or 13el500,08/02 -EI4VBE,IO42,,,OP DF1ZE,,,1988 -EI4VBS,IO42,,,,,,1990 -EI4VWY,IO54,,,,,,08/01 -EI4VWZ,IO55,,,,,,08/01 -EI5FK,IO51RT,EME,,Charles,,144: FT847 150W 9elMSDSP,05/04 -EI5HN,IO41UT,,,OP DF6NA,,,1995 -EI6CPB,IO63WE,,,Hugh,,50: IC706 - 144: IC821.310,06/03 -EI6GF,IO62RG,,,,,,02/98 -EI7IX,IO53FT,,,Dermont,,TS2000,08/04 -EI7RCG,IO62,,,,,144: 27el,08/96 -EI7RSD,IO62WX,,,OP EI2CA,,144: 27el 400Wattsonly SSB-MS.225,07/96 -EI9HW,IO63MP,,,John,,,10/93 -EJ4VNX,IO43,,,,,,1993 -EJ6O,IO43MM,,,,,,1994 -EM1U,FC74US,,,,,,2003 -ER1AN,KN46KX,,,Sergei,,144: FT857 200W 2x10el,12/04 -ER2RM,KN46KA,,,,,,11/05 -ER5AA,KN45CW,,,Vasilij,,,06/00 -ER5AL,KN45CW,,,,,,07/02 -ER5OIW,KN46KX,,,,,,01/05 -ER5OK,KN46KA,,,,,,01/05 -ES0Q,KO17AV,,,Tom,,,06/04 -ES0X,KO18,EME,,OP ES2RJ,,,07/99 -ES1CW,KO29HK,,,Arvo,,,05/98 -ES1RF,KO29IJ,EME,,Gennadi ""Gene",,FT1000MP/FT847/FT736 Preamps 50: 2x5el 500W,02/04 -ES2CM,KO29DJ,,,Aimar,,ICOM-706 mkIIG,01/03 -ES2NA,KO29JL,,,Andrus ""Andy",,144: IC706MKII 300W 9el137,04/02 -ES2QH,KO29LL,,,Aarne,,144 : FT847 700Watts 9ele Preamp - 432: IC82,08/01 -ES2RJ,KO29JM,,,Toomas ""Tom",,144: TS790 350W 9el.177 DTR 3000lpm.210,05/03 -ES2RQ,KO28WA,,,,,,01/05 -ES2WX,KO29JN,,,,,,05/03 -ES3BR,KO28JS,,,,,,05/04 -ES3GZ,KO28,,,jaan,,,1993 -ES5KJ,KO38IJ,,,Tom,,,01/05 -ES5MC,KO38JJ,,,,,,12/95 -ES5MG,KO38IJ,,,Guido,,,1/94 -ES5PC,KO38IK,,,,,,08/98 -ES5RE,KO38,,,,,,1994 -ES5RN,KO38,,,,,,1994 -ES5RY,KO38JI,,,Toomas,,,11/02 -ES5WE,KO38JJ,,,,,,1994 -ES6DO,KO27WX,,,Neil,,IC706MKII + Preamp 50: 4el - 144: 15el 3,09/03 -ES6LBN,KO37AW,,,Rein,,144: 170W 11el366,07/04 -ES6RQ,KO28WA,EME,,Ants,,TS2000 FT736 FT847 144: 1KW 4x18el 9BV,08/04 -ES8AS,KO28FJ,,,,,,04/04 -ES8X,KO18XC,EME,,OP ES2RJ,,144: TS790E+PA 300W 2x9 el or FT 847+ PA 30,07/02 -EU1AA,KO33SJ,,,,,,01/05 -EU1AB,KO33SU,,,George,,,01/96 -EU6MS,KO45IN,,,Victor,,144: 16el 700W MGF1302.178 2000lpm.300,09/01 -EV2AA,KO33PM,,,,,,2003 -EV2AAB,KO33ST,,,,,,2003 -EV2OEU,KO52IK,,,,,,2003 -EV5M,KO43KB,,,OP DL5BAC- DJ9YE,,,1994 -EV5N,KO42RX,,,OP DL5BAC- DJ9YE,,,1994 -EW1RZ,KO33SV,,,Sergej,,,10/01 -EW6AL,KO46KB,,,Aleksej,,.178 3000lpm,08/98 -EW6DX,KO45JL,,,Igor,,144: 100W 9el.087 800lpm,08/97 -EW6FS,KO35LB,,,Anton,,144: 20W 2x16el F9FT Preamponly SSB-MS.300,01/03 -EW6GB,KO45CN,,,Andy,,144: 200W 10elMSDSP.300,08/02 -EW7IM,KO53,,,anatoly,,,1992 -EW7IN,KO53,,,,,,1994 -EW7IW,KO53DR,,,,,,2003 -EW8DD,KO42QA,,,Valentin,,144: 4x16el F9FT- 50W,12/98 -EY8MM,MM48FI,EME,,,,144: 200W 2 yagi,10/04 -F0DBD,JN08XW,,,Frederick,,FT726R 10W 10el Preamp,01/02 -F0EJW,IN78,,,,,,12/04 -F1AFJ,JN06HT,EME,,Jean-Pierre ""John",,144: 4x11el F9FT 1500 W 0.4dB2000lpm WINDSP,11/04 -F1AKK,JN39CC,,,Oli,,only SSB-MS,07/01 -F1AOE,IN93RS,,,,,,04/04 -F1CCM,IN93MP,,,,,,1993 -F1CNE,JN28,EME,,denis,,,1994 -F1DLZ,JN19FH,,,,,,05/04 -F1DUZ,IN97NJ,,,Philippe,,144: FT225RD 2x 4CX250R 700W 2 x 11el pre,12/04 -F1EBK,JN18BW,EME,,Patrick,,144: TS790A 300W 4x10el DK7ZB,11/04 -F1EBN,JN18JR,,,,,,08/02 -F1ELL,JN18EX,EME,,robert,,,1994 -F1FEN,JN25JC,EME,,gilles,,,1994 -F1FHI,IN97GD,,,,,,2003 -F1FIH,JN23GS,,,Michel,,,04/03 -F1FLA,JN26KU,EME,,Jena-Jacques,,144: 4x25el Xpol 7.6lb 1KW MGF1302.022.270,10/99 -F1FVP,IN95XA,,,,,,2003 -F1GHP,IN96LE,,,,,,2003 -F1GTR,IN96JE,,,,,,2003 -F1GTU,JN05IF,,,,,,07/98 -F1HAR,JN18DT,,,marc,,,1993 -F1IHP,IN88,,,,,,07/02 -F1ISJ,IN97QM,,,Eric,,FT847,05/02 -F1IXQ,JN15MQ,,,Jim,,,12/01 -F1JG,JN23HQ,,,,,,08/02 -F1JOE,JN05IF,,,francois,,,1993 -F1JRD,JN13WO,,,Lionel,,144: TR751 GS35b 2x11el F9FT5000lpm,12/04 -F1MBM,JN38CQ,,,Alex,,FT225RD 144: 8877 4CX250 MGF1302 16el F9FT,12/02 -F1MOZ,JN27MH,,,Bruno,,,01/04 -F1MPQ,JN09SG,,,Bruno,,144: 2x9el 2KW - 432: 80W 26el doublequad,02/04 -F1NGP,JN39CC,,,Yann,,,04/97 -F1NNI,IN88,,,,,,04/02 -F1NSR,JN33JK,,,Yannick,,144: IC275h 17B2 2x24CX250,01/04 -F1ODA,JN13FO,,,,,144: 400W115215,10/02 -F1PUX,JN16XL,,,Denis,,TS690S 144: LT2S 200W 20el - 50: 5elonly S,01/99 -F1PYR,JN19DA,,,,,,04/02 -F1PYW,JN38UP,,,Eric,,144: 120W 9el or 2x11el - 432: 17el or Helix,03/99 -F1RAD,JN25WF,,,Yvan,,50: 5W 1/4wl. - 144: TR751e 25/200W.300,05/02 -F1RHS,JN03PV,,,,,only SSB-MS,11/01 -F1VJQ,IN95OL,,,OP G8APZ G4FUF,,,07/04 -F2TU,JN38LG,EME,,Philip,,,11/01 -F3VS,JN38LF,EME,,Claude,,24x20el (6wl) & 8x20el (6wl) DJ9BVs,03/99 -F4ALP,JO10OP,,,,,,12/01 -F4APX,JN23XL,EME,,Fred,,144: 4*18EL - 432: 4*21EL 2*4CX250,01/04 -F4ARU,IN94VT,,,Jeremie,,144: 4x3.6wl 1KW 8877,11/01 -F4AZF,JN38IW,,,Damien,,144: IC275h 500W 8874 4x 4.4wl DJ9BV Preampo,08/03 -F4BKV,IN95PT,,,Vincent,,144: TS700 150W 9el - 432: TS440S TRV 70W 21,04/02 -F4CIB,JN03,,,Franck,,144: 250W 9el.241,05/02 -F4CYZ,JN38SF,EME,,Florent,,144: FT897D 150W 9el Yagi,01/05 -F4DDX,JN23QG,,,Claude,,TM255E,11/04 -F4DSD,JN23JO,EME,,Emmanuel,,,01/05 -F4DXX,IN97LH,,,BRUNO,,,11/03 -F4JRC,JN23JW,EME,,Tempier,,144: 4x10el,01/01 -F4JVG,JN16UM,,,,,,07/02 -F5ANT,JN24RJ,,,Rene,,only SSB-MS,04/96 -F5AQC,JN05PU,,,,,,2003 -F5BUU,JN03BO,,,Jean-Claude,,,01/05 -F5DE,JN05DP,,,Bernard,,50: 50W 5el - 144: 100W 16el076 DTR 2000lpm,01/05 -F5EAN,JN06CP,EME,,jean michel,,,1994 -F5FEN,JN25JC,,,,,,2003 -F5FHI,IN97GD,EME,,jean pierre,,,1994 -F5FLN,IN94SR,,,Michel,,144: 300W 17el800lpm,08/99 -F5FVP,IN95WB,,,Jean Yves,,144: 4x17el 1KWonly SSB-MS,07/00 -F5GHP,IN96LE,,,Jean-Pierre,,144: IC745 700W 14el 9BV CF3002500lpm MSDSP,07/02 -F5HRY,JN18EQ,EME,,Herve,,144: 1KW 4x11el.077 DTR,11/02 -F5IVP,JN23,,,,,,08/02 -F5JNX,JN37PV,,,Jean-Marc,,,01/04 -F5JRX,JN25AW,,,bruno,,,1994 -F5KCR,JN26IX,,,OP: F1RXC- F1JLD,,,08/96 -F5KDK,JN23VF,,,,,,2003 -F5KPO,JN24,,,,,,12/01 -F5LEN,JN38BO,,,Pascal,,144: IC275A 250W 17elB2054 MSDSP.254,10/01 -F5LKW,JN23SJ,,,Roger,,144: TS700 60W 13el2000lpm,04/03 -F5LRL,JN26MV,,,Mike,,144: 400W 4x10el,05/02 -F5LUW,JO10MP,EME,,Francois,,,11/95 -F5MGD,JN07AW,,,Stephane,,FT102 + tvtr2500lpm,05/04 -F5MSL,JN26JS,EME,,Eric,,144: 8877 4x11el (or 4x10el) MGF1302.090.220,02/99 -F5MZN,IN87BU,EME,,Oliver,,,08/96 -F5NWK,IN97EJ,,,Tanguy,,144: 9el 200W,05/04 -F5OIH,JN06,,,Vincent,,,08/03 -F5PAU,IN88CB,,,,,144: 4x11el 150W,07/02 -F5RRS,JN36EB,,,Damien,,144: 200W 10el Quad,11/04 -F5SDD,JN23RF,EME,,Dave,,FT901 IC211,01/04 -F5SE,JN29BG,,,,,,06/03 -F5SJE,JN13,,,,,,12/95 -F5SJP,JN13VQ,,,Stephan,,144: TS790 180W 17B2TX1200 RX 5000lpm,01/02 -F5TMJ,JN03VP,,,Laurent,,IC706 MK2G,12/04 -F5VBW,JN03,,,,,,06/95 -F5VHX,JN04FT,EME,,Graham,,130,06/03 -F6ANQ,IN94RT,,,Christian,,DTR,07/96 -F6AOI,JN33NQ,,,,,,08/02 -F6BAZ,JN39EF,,,Henri,,,06/02 -F6BEE,JN08FU,,,,,,2003 -F6CBH,JN19BH,,,christian,,,1994 -F6CGJ,IN78RK,EME,,Louis,,144: 4x11el 400W,04/00 -F6CIO,JN26JH,,,,,,09/98 -F6CJG,JN15,EME,,g.,,,1993 -F6CKZ,JN09LH,,,,,,01/97 -F6CRP,IN96KE,,,Denis,,144: 300W 2x11el - 432: 100W 2x21el MGF1302-,12/04 -F6CTW,JN18,EME,,rene,,,1993 -F6DHI,JN23RK,,,Chris,,144: 200W 9el MGF1302370280,04/04 -F6DKW,JN18CS,,,,,,02/01 -F6DRO,JN03TJ,,,Dominique (Dom),,2500Watt 18el BF981081 3000lpm DTR231,03/04 -F6DWG,JN19DL,,,m.,,,1994 -F6DWH,JN19,,,,,,1995 -F6EAS,IN98,,,,,DTR,08/01 -F6EMT,IN98FG,EME,,jean p.,,,1994 -F6EYM,IN99,EME,,guy,,.070,12/95 -F6FHP,IN94TR,EME,,Joel,,144: 1KW 4x6 wl5000lpm DTR,01/05 -F6FLV,JN18AT,,,Jean-Pierre,,,02/96 -F6FTN,JN08XS,,,Bernard,,144: 4x9el 300W,01/04 -F6GPT,IN94SW,,,John-Marc,,144: 11el 400Wonly SSB-MS,05/04 -F6GRB,JN25KP,,,Philippe,,,01/05 -F6HVK,JN27LH,EME,,Andre,,144: 300W 17el or 4x17el M21000lpm DTR,07/99 -F6HYE,JN36DG,EME,,patrick,,,1994 -F6IFX,JN07CX,,,Bertrand,,,07/02 -F6IZZ,JN18GR,,,,,,2003 -F6JXR,IN98HW,,,,,,09/98 -F6KHM,IN78RJ,EME,,Clubstation,,only SSB-MS,06/02 -F6KRK,JN18AS,,,Clubstation,,144: 17el 120W,02/01 -F6KSX,JN18,,,,,,2003 -F8BKD,JN38LG,EME,,Didier,,144: TS-2000 4X11 el 1000W,01/03 -F8CS,JN27UR,,,,,,08/98 -F8DNX,IN93FJ,,,Thierry,,FT 847 - 144: 2x9el 170W,07/04 -F8DO,JN26IF,EME,,Marius,,50: TS680S 5el - 144: FT225 4CX1000 2x11el MG,01/05 -F8IPS,JO00SQ,,,Carnello,,,07/00 -F8KFR,JN09RG,,,OP F1MPQ,,144: 2x9el 1-8KW - 432: 80W 26el doublequad,04/03 -F8OP,JN26MM,EME,,Georges,,50: TS690 100W 6el - 144: FT225RD Mutek 2x4CX,02/05 -F8PKC,JN38MG,EME,,,,FT726,04/01 -F9HS,JN23AT,EME,,Claude,,144: 4xBVO3WL 8877 CFX13059 MSDSP285,03/04 -F9IE,IN86WW,,,Bernard,,only SSB-MS,05/04 -FA1APX,JN23XL,EME,,Fred,,144: IC970 4 x 22 el DJ9BV 2 x 4CX350F,04/00 -FC1DUZ,IN97NB,,,,,,2003 -FF6KBF,JN18BW,,,,,,2003 -FK8HA,RG37FR,,,,,,2003 -FM5CS,FK94LI,,,,,,2003 -FO4NK,BH52,EME,,alaine,,,1994 -FO5RK,BH52,,,,,,2003 -FR5DN,LG78SS,EME,,Philippe,,,03/99 -FS5UQ,FK88LC,,,,,,2003 -FY5DG,GJ35QD,EME,,,,,2003 -G0AEI,JO01GO,,,,,,1991 -G0AFH,JO01EI,,,,,,08/01 -G0BPU,JO02,EME,,michael,,,1994 -G0CHI,IO90PS,,,kevin,,,1993 -G0CUH,IO70LG,,,Steve,,,07/04 -G0CUZ,IO82WM,,,Colin,,FT726r 50: 50W 2el - 144: MGF1302 2x3CX40,07/02 -G0EVT,IO93GR,,,John,,144: IC202S 250Watts 3wl DJ9BV,07/01 -G0FIG,IO90UU,,,Alec,,50: IC575h 6el 400W - 144: IC275h 400W 10el M,05/00 -G0GMB,IO92NB,,,Martyn,,,03/04 -G0GMS,IO82XT,,,Tony,,144: IC746 IC756pro Demi TVRT GS35b 0.25db p,01/05 -G0HYP,IO84FN,,,Kenneth,,FT847 IC1271E 144: 1.5KW 2x17el - 432: 2x21e,04/03 -G0ISW,IO84OQ,,,Philip,,FT847 Yagis + Create Log Periodic370,03/04 -G0JDL,JO02UK,,,John,,,01/96 -G0JUR,IO92WT,,,Neill,,,08/99 -G0KAS,IO91UI,,,Mike,,144: IC275h 2x4CX250b 17el Preamp.111 DTR,01/00 -G0KPW,JO02OD,,,Bob,,144: 400W 2x17B2only SSB-MS,04/03 -G0KUX,IO91WP,,,,,,11/01 -G0KZG,IO80,,,Andy,,DTR 1800lpm,10/02 -G0LBK,IO93JK,,,dave,,,1993 -G0MGA,JO00DT,,,simon,,,1993 -G0MJW,IO91JO,,,Mike,,50: 100W 5el - 70: 160W 4el - 144: 2x4CX250b,1997 -G0NFA,IO91NE,,,Derek,,144: IC271A.056.285,04/01 -G0PES,IO83LS,,,,,,11/99 -G0RRJ,IO91FE,,,Dave,,1296: 100W 55el,04/04 -G0RUZ,IO93FR,EME,,Conrad,,144: IC746 GS35b 6x 4.6wl. 32JXX X-Pole MG,10/02 -G0TPH,IO92IO,,,,,,12/01 -G0UWK,IO83VC,,,Ian,,FT1000mp 144: TV144/28 GS31b 400W 5WL 432:,10/04 -G0XDI,IO91RP,,,,,,11/01 -G1EMJ,IO82WM,,,neil,,,1993 -G1GEY,IO94FW,EME,,don,,,1994 -G1HWY,IO90UV,,,Mike,,144: TS790e 150W 13elDTR 6000lpm,08/03 -G1OGY,JO01GR,,,David,,,09/04 -G1SWH,IO83QO,,,Gerry,,,10/04 -G1WPF,IO91RP,,,Matthew,,144: IC275E Tempo2002 3CX800 9elonly SSB-M,08/99 -G1XRL,EN35,,,,,,2003 -G1YJI,IO91WP,,,,,,11/01 -G3BW,IO84,,,w.h.,,,1993 -G3FPQ,IO91vc,EME,, -G3JHM,IO91LC,,,Don,,50: 100W 5el - 144: 400W 2x13elonly SSB-MS,05/01 -G3LQR,JO02QF,EME,,simon,,,1994 -G3NAQ,IO91HL,,,Geoff,,50: 400W 3el - 4: 100W 2el - 144: 400W 17el -,08/03 -G3UTS,IO94CU,,,Reg,,144: 400W 9el M2 BF981171370,02/04 -G3WCS,IO83RH,,,Ken,,144: TS430S HB Transverter HB Amp 2x4CX250B,01/05 -G3WZT,IO90UX,,,John,,IC756PRO 50: 7el 400W - 144: 2x9el 400W - 4,08/03 -G3YNN,JO00EU,,,,,50: 2-5W 5el - 144: FT736 100W 14el - 432: F,05/04 -G4AEP,IO91NJ,EME,,Bill,,144: 400Watt 17el ATF53045rx2000 tx1200,01/05 -G4AFJ,IO92HO,,,Geoff,,144: 150W 10el500lpm,09/01 -G4ALY,IO70UL,,,,,,12/03 -G4AOA,IO83TD,,,tony,,,1993 -G4APA,IO83VI,,,Tony,,144: FT726R 200Watts 9ele BF981.160.260,01/01 -G4APJ,IO83UP,,,Ken,,FT736 FT817,08/03 -G4ASR,IO81MX,EME,,David,,144: FT221GTi 2x3CX400 17el (4x17el)2500 DT,02/04 -G4BRK,IO91DP,,,Neil,,144: 80W 9el1000lpm,03/02 -G4CBW,IO83UB,,,Paul,,144: TS2000 IC756PROII 2x 9el 180W,09/04 -G4CJG,IO94CR,,,jerry,,,1993 -G4CLA,IO92JL,,,Pete,,,09/03 -G4DBL,IO91JJ,,,Tim,,144: IC746PRO 4CX350 300W 17el,11/04 -G4DHF,IO92UU,EME,,David,,028215,09/04 -G4DOL,IO80SP,,,p.,,,04/99 -G4DZU,IO93ES,EME,,Doug,,1296: 800W 3m. Dish,08/01 -G4ERG,IO93SR,EME,,Peter,,144: 16x10el- 2x3CX800- MGF1302,02/99 -G4ERP,IO81XW,,,,,,2003 -G4FDX,EN60VL,,,,,,2003 -G4FRE,JO01KK,EME,,dave,,,1994 -G4FUF,JO01GN,EME,,Keith,,,01/05 -G4HGI,IO83PL,,,Richard,,144: TS780 GS35b 400W 17el2000lpm DTR,08/04 -G4HGT,IO83,,,j.,,,1993 -G4IGO,IO80NW,EME,,Kenneth ""Ken",,50: IC706 300W 6el - 144: IC706,02/05 -G4JCC,IO90MS,,,,,,01/03 -G4KLX,IO93FB,,,Jonathan,,,03/04 -G4KUX,IO94BO,EME,,nick,,,08/03 -G4KWQ,IO92AQ,,,Andrew,,144: FT847 400W Preamp 16el Tonna,04/03 -G4LOH,IO70JC,EME,,Tim,,.255,02/04 -G4ODA,IO92WS,,,Keith B.,,,01/05 -G4PBP,IO82WO,,,,,,07/01 -G4PCI,IO91AL,,,George,,IC756PRO,01/03 -G4PIQ,JO01MU,EME,,Andy,,144: 2x3CX800 ATF10136 4x15el CueDee2500lpm,10/04 -G4RGK,IO91ON,,,Dave,,144: 300Watt 17el MGF1302 - 432: 400Watt 8x2,03/01 -G4RKV,JO01OI,,,Lee,,144: IC275E EME Pwr 2x9el MGF1302.075 DTR,01/01 -G4RNL,IO83,EME,,don,,,1994 -G4RRA,IO80BS,,,Paul,,144: 4x10el 400WDTR,08/03 -G4SHC,IO83VO,,,r.,,,1993 -G4SSO,IO91TO,,,,,,08/94 -G4SWX,JO02PB,EME,,John,,,01/01 -G4UPS,IO80JV,,,,,,01/97 -G4VIX,JO01PU,EME,,dave,,,1994 -G4VPD,IO92BJ,,,,,only SSB-MS, -G4VXE,IO91QL,,,Tim,,,03/01 -G4WQE,JO01CJ,,,,,,2003 -G4XBF,IO91QE,,,Mike,,DTR,04/99 -G4XUM,IO83,EME,,Martin,,,10/02 -G4YTL,IO92MB,EME,,David,,144: IC275 1KW 4x5lb DJ9BV.095,05/03 -G4ZFJ,JO01HO,,,Colin,,,07/04 -G4ZHI,IO91KN,EME,,Bryn,,432: TS790 1KW 4x3wl 9BV SSB Preamp2000lpm,05/03 -G4ZTR,JO01KW,EME,,John,,144: FT1000MP LT2S 2x4CX250B MGF1302 CC17,04/02 -G6DER,IO93GN,,,Keith,,,01/97 -G6HKM,JO01FT,,,Ela,,,1994 -G6RAF,IO92QP,,,op GW8VHI,,,10/95 -G6TEL,IO90AR,,,,,,05/04 -G6XRK,IO90RN,,,Mike,,144: IC820H Henry2002 Mutek 15el M2,1998 -G6XVV,IO93,,,h.,,,11/95 -G6YAY,IO80EL,,,,,,2003 -G6YIN,IO93ET,,,,,only SSB-MS,01/99 -G6ZTU,IO93HN,EME,,conrad,,,1993 -G7KQW,IO93,,,,,,2003 -G7LIJ,JO01GG,,,brian,,,1995 -G7RAU,IO90IR,,,Dave,,144: FT757 Mutek 2x9el 400Wonly SSB-MS.380,05/02 -G8BHH,IO82WO,,,Russ,,,07/01 -G8CLZ,JO00EU,,,,,50: 2-5W 5el - 144: FT736 25W 9el - 432: FT7,09/01 -G8DSL,IO90FW,,,,,,2003 -G8ECI,JO03AK,,,Derek,,50: 5el 300W - 70: 5el 160W - 144: 10el 3,01/01 -G8GTD,IO93,,,,,,11/01 -G8IZY,IO91VC,,,Steve,,144: TS700G BF981 4CX250b 250W 9el M2only SSB,01/01 -G8LZG,IO93SR,,,Graham,,FT847 or FT100,11/01 -G8MYK,IO92BJ,,,Alan,,IC275H- 100W- 17el.350,07/02 -G8OPR,IO91FE,,,,,,2003 -G8PYP,IO90AS,,,steve,,,1993 -G8ROU,IO92,,,dave,,,1993 -G8RWG,JO01BN,EME,,Niels,,144: FT1000MP DEM144/28 2x8874 MGF1302 9el fu,05/02 -G8T,IN79JX,,,,,only SSB-MS,06/02 -G8TIC,IO82VF,,,Mike,,50: 6el 400W - 144: JST245 trx 10el 3CX800,12/01 -G8TOK,JO01BI,,,Derek,,,04/02 -G8UUR,IO92ET,,,Phil,,144: 80Watts 3ele@10mtrs,07/00 -G8VHI,IO92FM,,,Reg,,50: 100W 4el - 70: 10W 4el - 144: 9el 200W -,07/04 -G8VR,JO01DJ,,,Ken,,50: 3el 100W1000lpm,05/03 -G8VYK,JO01,,,,,,10/04 -G8XVJ,IO83RJ,,,Erik,,144. LT2S 8877 17el M2only SSB-MS.185,08/99 -GB2LBN,IO85,EME,,OP MM0CCC,,144: 17el 100W,08/00 -GB2WQ,IO66,,,,,,1992 -GB4IOM,IO74PB,EME,,,,,05/04 -GB4SPT,IO74PB,EME,,,,,05/04 -GB4VR,IO57,,,,,,1990 -GB4XS,IO78HA,,,OP GW4VVX- GM0CLN,,50: IC746 100W 4el - TR9130 - 70: 150W 6el -,08/00 -GD0WKX,IO74SD,,,Graham,,,10/95 -GD4IOM,IO74QD,EME,,Andy,,50: 400W 4x7el - 144: 400W 8x9el - 432: 400,08/01 -GD4UFD,IO74,,,,,,1988 -GD7HEJ,IO74SD,,,Graham,,,10/95 -GI0OTC,IO65QE,,,Alan,,,12/00 -GI1JUS,IO74,,,i.,,,1993 -GI4KSO,IO64XK,,,Darrell,,70: 100W 3el - 144: 300W 8el,07/03 -GI6ATZ,IO74AJ,,,Gordon,,144: IC251E Mutek FE 300W 13el.270,03/01 -GI8YDZ,IO65,,,a.,,,1988 -GJ0JSY,IN89XE,,,,,,12/01 -GJ0RUZ,IN89,EME,,,,,03/02 -GJ4ICD,IN89WE,,,Geoff,,,10/98 -GM0BQM,IO85CE,,,Mike J.,,144: 200W 2x17elDTR tx850lpm,03/02 -GM0CLN,IO85HV,,,Colin R.,,50: 20W indoor ant - 144: TR751E 100W 14elon,03/02 -GM0EWX,IO67UL,,,,,144: 12el 8874,05/02 -GM0GMD,IO86AE,,,Tom,,,07/00 -GM0HUO,IO86OI,,,Arlen,,FT736r 50: 100W 3el - 144: 180W 12eltx1200,08/99 -GM0JOL,IO78VM,,,j.,,,1993 -GM0ONN,IO87,EME,,Ian,,,10/00 -GM0WDD,IO85JV,,,Gavin,,TS690 - 144: Trvt 9el OZ5HF 200WDTR,08/99 -GM0WDF,IO75PW,,,John,,144:TS940 Trsv IC271E 400W 17el,09/01 -GM3POI,IO88OW,,,c. s.,,,10/01 -GM3SBC,IO85IX,,,,,,05/03 -GM3UCN,IO85RV,,,,,,04/04 -GM4AFF,IO86ST,,,Stewart,,144: 14el Tonna EME-Pwr MGF1302only SSB-MS,08/03 -GM4CXM,IO75TW,EME,,Ray,,144: TS700 3cx800A7 9el Mutek,06/03 -GM4ILS,IO87IP,,,,,,07/01 -GM4ISM,IO85AR,,,,,,09/02 -GM4JJJ,IO86GB,EME,,David,,144: 4x3wl XPOL 8877,05/01 -GM4OGM,IO85,,,s.,,,1988 -GM4VVX,IO78TA,,,Clive,,50: TR751E 5W Dipol.222,08/03 -GM4YXI,IO87WJ,,,Keeth,,1500lpm,04/00 -GM5RP,IO66,,,,,HCSW,08/01 -GM6VIU,IO85,,,,,144: TR851E 25W 24el,11/99 -GM6VXB,IO97AQ,,,,,,02/04 -GM7ASN,IO78TA,,,,,,06/95 -GM7LVJ,IO85,,,gavin,,,1994 -GM7PBB,IO68UM,,,John,,50: IC756,10/04 -GM8OEG,IO86LL,,,Andy,,,02/04 -GU7DHI,IN89RL,,,,,,12/01 -GW0KZG,IO82,,,Andy,,DTR 2500lpm,12/98 -GW0PZT,IO72PT,,,edward,,,1993 -GW0VWD,IO81EM,,,Allan,,only SSB-MS,07/96 -GW3HWR,IO71XN,,,Heath,,FT847 - 144: 350W 9el Preamp,04/03 -GW3LEW,IO71PS,,,,,,04/03 -GW3XYW,IO71,EME,,,,,01/05 -GW4DGU,IO71SV,EME,,Chris,,144: 600W 15.6dbi ant,03/04 -GW4HDF,IO81JO,,,Vic,,,04/02 -GW4LXO,IO81,,,Jonathan,,,08/98 -GW4UWR,IO81LP,,,,,only SSB-MS,08/99 -GW4VEQ,IO73SG,,,Tony W.,,,10/02 -GW4VVX,IO81JP,,,,,,06/95 -GW4ZQV,IO81LQ,,,,,only SSB-MS,08/97 -GW6YAY,IO81LM,,,David,,144: IC821H 300Watts 17ele CConly SSB-MS,08/03 -GW7SMV,IO81LN,,,Jamie,,144: 400W Commander2 3cx800a7 12ele M22000,04/04 -GW8ASA,IO81EM,,,Gordon,,FT847 IC706 Linears - 144: 220W 9elonly SSB-,02/04 -GW8IZR,IO73TI,EME,,Paul,,144: 2x 9el GS35 .23 dbrx - 432: 4x21Y 35,01/05 -GW8OQV,IO81QR,,,Denis,,144: FT225-Mutek 2x4CX250b 4x10el DL6WU or,07/98 -GX4NOK,IO93FR,,,,,,2003 -GX4WWR,IO91LL,,,,,,2003 -HA0HO,KN07SU,,,Gyula,,only SSB-MS,03/01 -HA1AG,JN87TQ,,,,,,10/04 -HA1BC,JN87PU,,,Alex,,144: 3CX800A7 2x17elDTR,12/00 -HA1FV,JN87JJ,,,Pista,,144: FT290R 300W 12el - 432: 30W 25el143 20,07/04 -HA1KVM,JN87AL,,,,,,2003 -HA1KYA,JN87HF,,,Clubstation,,144: 8x13el DL6WU 200W2000lpm MSDSP,11/98 -HA1VHF,JN87GF,EME,,Clubstation,,,10/98 -HA1VQ,JN87GJ,,,Joska,,,08/99 -HA1W,JN87GF,,,,,,2003 -HA1YA,JN87GF,EME,,Gabi,,144: 8x13el & 8x14el - 432: 16x32el,09/03 -HA2A,JN87,,,,,,12/99 -HA2NP,JN97EO,,,Robert,,,05/01 -HA2RD,JN87WB,,,andy,,,1993 -HA2RX,JN87,,,,,,12/98 -HA2SX,JN87VC,,,Peter,,144: IC821H 600Watts 11ele,12/98 -HA2VH,JN87WG,,,,,,03/03 -HA3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 -HA3UU,JN96JO,,,Janos,,144: TS711A GS35B 5.5wl 4wl 2wl MGF1100,09/04 -HA4A,JN96JO,,,Janos,,144: TS711A GS35B 5.5wl 4wl 2wl MGF1100,05/04 -HA4KYB,JN97DI,,,Clubstation,,,1994 -HA4WQ,JN97IF,,,,,,06/03 -HA4XT,JN96JO,,,,,,01/05 -HA5BSW,JN97JD,,,Tibor,,,03/03 -HA5CAR,JN97,,,,,,07/01 -HA5CBA,JN97OM,,,Laszlo,,144: HF trsv+conv3500lpm,04/04 -HA5CRQ,JN97,,,,,,08/02 -HA5CRX,JN97KO,,,Janos (Jani),,144: FDK Multi 2700 250W CF300 13B2.140 D,01/01 -HA5CW,JN97PM,,,Joska,,144: FT225RD/Mutech B1016 GS35B 800W 10el,08/03 -HA5IW,JN97LN,,,,,,08/01 -HA5KDQ,JN97LN,EME,,Clubstation,,DTR,07/03 -HA5LV,JN97ML,,,Victor,,144: 9el 50W,04/04 -HA5OV,JN97NJ,,,Peter,,144: FT920+Trnv GS35 1-5KW 13el DL6WU MGF,12/03 -HA5PT,JN97MK,,,Tamas,,,08/04 -HA5RL,JN97PL,,,Attila,,,12/04 -HA5TS,JN97LL,,,Ivan,,144: IC-706MKII 8ele,07/04 -HA5UK,JN97OM,,,Gyuri,,,08/02 -HA6NA,JN98VC,,,Sandor ""Sanyi",,144: 250W F9FT,08/01 -HA6NN,JN98VC,,,Andras ""Andy",,144: FT290 7el 150W,05/04 -HA6NQ,JN98WA,,,Sandor (Sanyi),,144: 700Watts CF300 DJ9BV 3.2wl086 2000lpm38,01/05 -HA6NY,JN98WC,,,Gyuszi ""Julius",,144: 1000W MHP145 17el full el - 432: 40W LNA,01/05 -HA6OQ,JN98JC,,,,,,08/98 -HA6VV,JN97WS,,,Laszlo,,,07/01 -HA6ZB,JN97,,,,,,01/05 -HA6ZV,JN97WH,,,,,,09/04 -HA7JJS,JN97OG,,,,,,10/95 -HA7KPL,JN97OG,,,Clubstation,,,12/95 -HA7NK,KN07CM,,,Misi,,144: 200W 4x15el 9BV Preamp,06/00 -HA7PL,JN97OG,,,Laszlo,,.166,08/98 -HA7RF,JN97NP,,,Jozsef,,IC 735 +conv3500lpm,04/03 -HA7UL,JN97KK,,,Ferenc ""Feri",,HF: DM-100 - 144: FT726 or IC202 130W CF300 1,05/02 -HA8AR,KN06NQ,,,Pali,,,06/04 -HA8CE,KN06EN,,,Istvan ""Pista",,144: GS35b 400W 16 el. DJ9BV CF3001200lpm,05/04 -HA8CS,KN06BD,,,,,,2003 -HA8ET,KN06,EME,,g.,,,1993 -HA8KCP,KN08DQ,,,,,,2003 -HA8V,KN06HT,,,Gabor ""Gabi",,TM255E GS35B 900W 4X11el. TR851E 2XTP5040 80,07/04 -HA8VF,JN96UW,,,,,,10/97 -HA9MCQ,KN08JC,,,Istvan,,144: 150W 14el CF300.140.190,06/98 -HA9MDP,KN08DF,,,Peter,,144: 150W 14el CF300.190,07/00 -HA9RC,KN08NB,,,,,,1994 -HAM3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 -HAM3UU,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 -HAM7JJS,JN97OG,,,,,,07/96 -HAM7KPL,JN97OG,,,Clubstation,,,07/96 -HAM7PL,JN97OG,,,Laszlo,,.166,07/96 -HAM8CE,KN06EN,EME,,Kovacs,,,11/96 -HB2FAP,JN47CE,,,Fabio,,144: 16el 1KW,12/00 -HB3YIT,JN46JE,,,Nick,,Kenwood TS-790E,01/05 -HB5OK,JN46LA,,,OP HB9SUL,,144: FT847 8877 17el MGF 1302DTR,12/98 -HB9AOF,JN36LM,,,,,,01/97 -HB9BBD,JN47EE,,,,,,2003 -HB9BQU,JN37VD,,,Hans,,50: 10W - 144: 200W 17elDTR rx5000 tx1500lpm,08/99 -HB9BZA,JN36BE,,,Robert,,50: FT-847 V-2000 - 144: 3CX800 11Y - 432:,01/04 -HB9CVD,JN36CD,EME,,philippe,,,1994 -HB9CYN,JN36RX,,,Martin,,144: 30W 7el 10db Gaas,01/99 -HB9DBM,JN47BE,,,Mark,,,03/99 -HB9DDS,JN47IK,,,,,,05/02 -HB9DFG,JN37SM,EME,,Christian ""Chris",,144: TS850S + LT2S MKII 400Watt 4x9el MGF1,12/04 -HB9DKM,JN37SL,EME,,Martin,,50: 3el vertical - 144: 150W 2x11el Flexa MG,03/02 -HB9DLU,JN45LU,,,,,,2003 -HB9DUR,JN46ME,EME,,Andrea,,144: 1KW 17el SP2 - 432: 700WDTR 2000lpm,12/03 -HB9FAP,JN47GJ,,,Fabio,,144: TR751l 600W 18el M2 or 4x4 vertikal067,08/04 -HB9HLI,JN37JB,EME,,Dominique,,,01/05 -HB9HLM,JN36KW,EME,,Andre,,,01/04 -HB9JAW,JN47CE,EME,,Michel,,144: FT726r 15el or 8x28el 8877 MGF1302DTR 2,10/02 -HB9LU,JN46EW,,,Clubstation,,,06/96 -HB9MM,JN36HP,,,,,,08/02 -HB9MS,JN47PH,EME,,OP HB9SUL,,144: 8877DTR 2000lpm,12/99 -HB9OCW,JN46LA,EME,,Donald,,50: 4el 10W - 144: 4x13B2 1KW - 432: 2x29el 1,10/99 -HB9PJT,JN47FG,,,,,,05/02 -HB9Q,JN47CG,EME,,OP HB9CRQ- HB9DBM,,50: 10W 11el - 144: 15mPb 8x19el 1KW - 432: 1,05/02 -HB9QQ,JN47,EME,,Pierre,,.138 DTR,01/01 -HB9RUZ,JN47JM,,,Peter,,,12/96 -HB9SJV,JN36BK,,,Benoit ""Ben",,50: 5 el & 5/8 vert. 144: 350W 7elonly SSB-M,02/04 -HB9SLO,JN36LT,,,Bertrand,,144: FT736r 1KW 18el LY,04/03 -HB9SNR,JN36MQ,,,Gerard,,144: FT736r 800W 12el M2,11/01 -HB9STI,JN47GJ,,,f.,,,1993 -HB9STY,JN36IP,,,Bernard,,FT690R 50: 150W vert & 5el - 144: 300W 2x15e,07/98 -HB9SUL,JN46LA,,,,,,2003 -HB9SV,JN45LV,EME,,Enrico,,,08/00 -HB9WAH,JN47FD,,,Bruno,,50: 10W - 144: 2x 11El 1kW MGF1302 - 432:,04/04 -HC5K,FI07NB,,,,,,2003 -HF75PZK,JO93AC,EME,,,,,01/05 -HG1DLZ,JN87HF,,,Zoli,,144: 8x13el 200W MGF1402only SSB-MS,12/98 -HG2EAD,JN97,,,i.,,,1993 -HG2KNP,JN97,,,,,,1993 -HG2NP,JN97,,,R.,,,1/95 -HG3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,08/98 -HG3O,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,08/98 -HG4XG,JN96,,,g.,,,1993 -HG5CYT,JN97,,,Tibor,,144: FT290r 50W 5el - 432: 25W 11el,01/01 -HG5PT,JN97MT,,,dr. holman,,,1993 -HG6KNB,JN98,,,,,,1993 -HG6KVB,KN07,,,,,,1993 -HG6NQ,JN98WA,,,sanyi,,3,1995 -HG7AJ,JN97,,,a.,,,1993 -HG7JAL,JN97KK,,,Pista,,,07/02 -HG7P,JN97KW,,,Clubstation,,,04/97 -HG7WJ,JN97MP,,,sandor,,,1993 -HG9MET,KN08DF,,,Tom,,144: 150W 14el CF300.190,07/00 -HG9OZD,KN08DF,,,OP HG9MDP- MET,,144: TR9130 150W 14el CF300.060.190,07/00 -HG9SM,KN08HF,,,,,,07/04 -HG9VHF,KN08EB,,,OP HG9MDP- MET,,144: TR9130 150W 14el CF300.140.190,07/00 -HGM3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 -HGM3O,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 -HI8ROX,FK58AL,,,,,,2003 -HL5XF,PM45OH,,,,,,2003 -HS2CRU,OK03LE,,,,,,2003 -HV0A,JN61FV,,,,,,01/05 -HV4NAC,JN61,,,Clubstation,,,06/99 -I0EMV,JN62BK,,,,,,1992 -I0UZF,JN63,,,Francesco,,,06/00 -I1ANP,JN44VC,EME,,Mario,,IC735+L4B - 144: TS700 4x4cx250b MGF1302 4x,03/01 -I1BSN,JN34,,,franco,,,1993 -I1CPM,JN34VI,,,,,,01/03 -I1CPN,JN34VH,,,,,,02/04 -I1DMP,JN35UB,,,Paolo,,144: 350W 20el LY.131 DTR,01/01 -I1JTQ,JN35UB,EME,,Mario,,144: 2x18el 900W MGF1801127227,08/01 -I1KTC,JN45HK,EME,,Alberto,,.085 DTR,11/96 -I1PIK,JN44TG,EME,,Pietro,,FT736R 50: 3el - 144: 64el GS35 Preamp - 432:,01/01 -I1TXD,JN45,,,rossi,,,1993 -I2COR,JN55BB,EME,,luigi,,,1994 -I2FAK,JN45OB,EME,,Franco,,144: 24x19el LLY YL1056DTR 2500lpm,12/04 -I2FHW,JN45,,,franco,,,1993 -I2ODL,JN45KL,EME,,OP IK2OFO,,144: 4x17el 8877 - 432: 8x21el 3CX800A7 - 129,09/00 -I2OKW,JN45OO,,,,,,08/02 -I2PHD,JN45SL,EME,,Alberto,,,12/00 -I2RV,JN45PL,EME,,,,,01/05 -I2SVA,JN45,,,,,,01/02 -I2UZV,JN45,,,,,,08/02 -I3DLI,JN65,EME,,Paolo,,6x19el 8877 CF379.018,11/00 -I3LDS,JN55SR,,,,,,1990 -I3LGP,JN55WJ,,,Giuliano,,144: IC746 100W 17el BF960.141 DTR 3000lpm,01/04 -I3LLH,JN65BM,,,,,,04/00 -I4BXN,JN54,,,g.,,,1993 -I4LCK,JN54RK,,,Franco,,432: FT736 3CX800 Preamp 4x25el LY @ 950m asl,05/04 -I4RHP,JN54QL,,,Rodolfo,,144: TS711+PA500W 17EL,07/04 -I4TTZ,JN54VJ,,,,,,2003 -I4VXH,JN64EJ,,,l.,,,1993 -I4XCC,JN63GV,EME,,Claudio,,144: 4x17el F9FT 3CX800A7 preamp 1db075,01/04 -I4YNO,JN54KP,,,Alessandro ""Alex",,144: FT-736R MuTek MGF1302 3CX800 20el Shark1,08/03 -I5CTE,JN53XG,EME,,Piero,,,02/01 -I5JUX,JN53CW,EME,,Giacomo,,,08/96 -I5MPK,JN53,EME,,piero,,,1994 -I5MXX,JN53JU,,,Marzio,,144: 4x4el & 4x9el,10/00 -I5MZY,JN53OT,EME,,Massimo ""Max",,144: 800W 4x10el BF998117,10/04 -I5PPD,JN53PS,EME,,Pietro,,10368: 3m Dish 20W,10/00 -I5PPE,JN53NS,,,,,,2003 -I5TDJ,JN53,EME,,Piero,,,11/00 -I5WBE,JN53JR,EME,,Enrico,,144: FT736R 4x17el 8877 MGF1302 432: Yeasu,11/04 -I5YDI,JN54BB,EME,,Luigi,,144: FT736 3cx800 2x17el or 4x15el.100,04/02 -I6BQI,JN72BK,,,Angelo,,,09/02 -I6PNN,JN72GL,EME,,marco,,,1994 -I6QGA,JN63,EME,,gabriele,,,1994 -I6QON,JN63RL,,,,,,1994 -I6WJB,JN72CK,EME,,Pierluigi,,144: single 3wl yagi 1 Kw MGF1302,05/04 -I6YPK,JN72,,,bruno,,,1995 -I7CSB,JN71QQ,,,,,,09/96 -I7FNW,JN81GD,EME,,n.,,,1994 -I7HCB,JN71VT,,,Andrea,,144: 150W 13el,12/01 -I7RNI,JN80,,,n.,,,1993 -I8MPO,JN70FP,,,Lucio,,only SSB-MS.383,11/04 -I8REK,JN70,,,Archimede,,,1993 -I8TUS,JM89DE,,,Salvatore,,,10/04 -I8UZA,JN70AU,,,Pino,,144: FT847 150W 10el BVO3wl.250,09/02 -I8WES,JN70,,,r.,,,1993 -IC8CQF,JN70CN,,,Pasqual ""Lino",,50: 100W 4el Yagi - 144: 300W 10el093 300,08/03 -IC8EGJ,JN70CN,,,,,,1989 -IC8FAX,JN70CN,,,Giacobbe (Jakob),,144: FT736r 300W 20el083 DTR437,03/04 -IH9YMC,JM56XT,,,Raf,,,08/04 -II0W,JN51,,,,,,06/03 -IK0BZY,JN61GW,EME,,,,,07/01 -IK0FEC,JN63,,,l.,,,1993 -IK0FIY,JN61GW,EME,,Wife of Enrico,,FT736r 144: 6el 800W MGF1302 - 432: 33el 600W,01/00 -IK0FTA,JN61GV,,,Sergio,,50: TS680 GaasFet 6el100lpm !,05/02 -IK0IXI,JN52,,,,,,1994 -IK0IXO,JN52WA,EME,,,,,1993 -IK0OKY,JN61GT,,,Emilio ""Emile",,50: 4el 10W - 144: 25W 13el,04/02 -IK0OZK,JN52VC,EME,,Renato,,350W- 2x17el- Preamp,12/99 -IK0PCJ,JN63CL,,,,,,2003 -IK0RNL,JN61GW,,,,,,2003 -IK0SMG,JN61FS,EME,,Pino,,,1/95 -IK0SOI,JN62HN,,,Sergio,,,06/02 -IK0VKL,JN61GV,,,flavio,,,1995 -IK0WGF,JN52VC,,,Francessco,,144: 2x11el 200W,03/04 -IK1EFM,JN44JK,,,antonio,,,1993 -IK1EGC,JN35UF,,,Daniele ""Dan",,50: FT650 3-500z 6el 1wl- 144: IC275 16el 4.4,07/02 -IK1FJI,JN44LL,EME,,Walter,,4x19xxx 5-72wl 8877 mgf1302 ic275H,12/00 -IK1GYZ,JN35TB,,,Sergio,,,11/95 -IK1HJQ,JN33,,,,,,1990 -IK1HWG,JN44DS,EME,,maurizio,,,1994 -IK1JXY,JN44WC,EME,,Mark,,,08/04 -IK1LBW,JN44VC,,,,,,08/98 -IK1LGV,JN44JK,,,Gabriele,,144: GS31 MGF1302 15el QD1200lpm DTR MSDSP,08/00 -IK1LUT,JN34TW,,,marcello,,,1993 -IK1MTZ,JN35UB,EME,,diego,,,08/01 -IK1PAG,JN35SB,,,Roberto (Roby),,144: IC275h 1KW 2x17el F9FT MGF1302.136,01/01 -IK1RQT,JN34VP,,,,,,12/01 -IK1SLI,JN35UI,,,gianni,,,1993 -IK1SPR,JN34TQ,,,Flavio,,144: Braun SE400 500W MGF1302 2x 13elMSDSP,08/04 -IK1UWL,JN33VT,EME,,,,,01/05 -IK1YWB,JN34UX,,,,,,04/02 -IK2CDI,JN55GN,EME,,Marinella,,144: IC275H 3CX800A7 MGF1302 4x18el8000lpm M,01/00 -IK2CFR,JN54,,,Marco,,,03/01 -IK2DDR,JN55GN,EME,,Francesco,,144: IC275H 8877 MGF1302 4x18el8000lpm MSD,07/01 -IK2EAD,JN55EJ,EME,,romeo,,,1994 -IK2EAE,JN45LL,,,Fabio,,144: FT480r 100W 17elonly SSB-MS.300,11/01 -IK2FIL,JN45OM,,,Enrico,,144: IC275H 9 el. F9FT + SP2000 50W,11/04 -IK2GSO,JN45NP,EME,,Enrico,,IC7400 FT857 50: 1KW 10el 144: 14el DJ9BV,11/04 -IK2JUB,JN45ON,,,Stefano,,,03/03 -IK2LHP,JN45SP,,,Angelo,,144: TS790 200W 15el - 432: 100W 31el,07/01 -IK2MMB,JN45,EME,,Sergio,,,01/01 -IK2OFO,JN45KL,EME,,Roberto,,144: 4x17el 8877 - 432: 8x21el 3CX800A7 - 129,09/00 -IK2RTI,JN55AD,,,,,,2003 -IK2TPX,JN45LL,EME,,dario,,,1993 -IK2XRL,JN45NR,,,Mauro,,144: FT736r 150W 17el PreampDTR 2000lpm,01/01 -IK2YXK,JN45OP,,,Maurizio ""Mau",,144: IC275h 4CX250 12elM2 DSP59,05/02 -IK3MAC,JN55SH,EME,,Graziano,,144: 30x19el 8877,08/00 -IK3TPP,JN65EP,,,Fabio,,,12/04 -IK3VZO,JN55XA,,,Giovanni,,144: 16el 200W,02/98 -IK4DCO,JN64GB,EME,,paolo,,,1994 -IK4DCX,JN64GA,EME,,Marco,,144: 4x20el 2.5KW,04/01 -IK4DRY,JN64BL,,,Steve,,1000lpm,04/01 -IK4FMT,JN54WG,,,Marco,,144: TS790 2M5WL 4CX250 MGF1302 20dBMSDSP,01/00 -IK4JOC,JN54WN,EME,,claudio,,,1994 -IK4NMF,JN54SM,EME,,fausto,,,1994 -IK4PLU,JN64FC,EME,,Ermes,,only SSB-MS,08/99 -IK4PMB,JN54LL,,,Antonio ""Anto",,50: X-Verter 10W Dipole - 144: FT225RD MUTEK,01/05 -IK4WLV,JN54XK,EME,,Massimo,,,02/98 -IK5AMB,JN53FU,,,Iacopo,,only SSB-MS,11/98 -IK5EHR,JN53FU,EME,,Lele,,,01/97 -IK5JWQ,JN52NS,EME,,Guiseppe,,,08/98 -IK5OEA,JN53PG,,,,,,12/04 -IK5OIY,JN52NT,,,Massimo,,,03/96 -IK5QLO,JN53FU,,,Andrea,,50: LY - 144: 250W 10el CF300 - 432: 900W,07/04 -IK5UBM,JN53GT,EME,,Luca,,144: 8877 2x15el MGF1303.023 1000lpm.280,07/98 -IK5WJD,JN53PS,EME,,Alessandro,,10368: 3m Dish 20W,10/00 -IK5ZUI,JN53RD,,,Mike,,144: TS700G 11el 250W BF981only SSB-MS,07/97 -IK6EIW,JN63RJ,EME,,Stefano,,,10/95 -IK6FHF,JN63,,,a.,,,1993 -IK6IHM,JN72,,,,,,95 -IK6MLI,JN62UT,,,Pino,,144: FT736 4x11el KLM Booster 8930.060 200,07/99 -IK6MMJ,JN63RL,,,Fabricio,,.115,10/95 -IK7EZN,JN90DG,EME,,Ermanno,,144: 4x16 (jxx) 1 KW,04/04 -IK7UXY,JN90DC,EME,,Gianni,,144: FT1000MP+LT2S 0.2db 1KW 20el or 4x12elD,05/02 -IK8ETN,JM89CH,,,Pietro,,144: ic275e 4x150 17f9ft,01/04 -IK8IUQ,JN70MM,,,,,,2003 -IK8MKK,JN71DC,,,michele,,,1995 -IK8TOY,JM89CH,,,,,,08/04 -IN3AGI,JN56,,,,,,2003 -IN3ATM,JN56NK,,,,,,01/02 -IN3DOV,JN65WS,,,kurt,,,1993 -IN3HER,JN56,EME,,raimund,,,1994 -IN3KLQ,JN56RG,EME,,Giuliano,,144: 180W 17el.110,04/00 -IN3TWX,JN56NQ,EME,,Wolfgang,,144: 3CX800 Preamp 4x11ele DL6WU full eleva,08/03 -IS0AGY,JM49OF,,,Ampelio,,144: IC211E 4CX350b 17el Gaas.280,01/99 -IS0BDB,JN40GT,,,Vannino,,,05/04 -IS0CAK,JM49,,,,,,01/04 -IS0GQX,JM49,,,,,,05/02 -IS0SWW,JN40GR,,,Walter,,,02/04 -IT9BLB,JM68QE,,,Giuseppe (Joe),,144: 2x15el 2x4cx250r MGF1302.129.389,11/96 -IT9CJC,JM76GS,,,,,,1989 -IT9GSF,JM67SS,,,Flavio,,,1994 -IT9GSV,JM77LH,,,Andrea,,,04/01 -IT9IPQ,JM78SG,EME,,Paolo,,ic756pro ic275 ic475 transvonly SSB-MS,04/02 -IT9LCY,JM77NO,,,giuseppe,,,1993 -IT9VDQ,JM68QC,,,Joe (Giuseppe),,144: TS850 3CX800A7 17el Preamp.153 DTR tx1,12/04 -IV3BBR,JN65,,,,,,11/98 -IV3DXW,JN65QQ,,,Claudio,,144: 4CX250 - 16JXX2 4.5WL,08/03 -IV3GBO,JN66OA,EME,,g.,,DTR,01/02 -IV3GTH,JN65ST,,,Gigi,,50: IC706 4 el Quad - 144 MHz: FT221 Mutek,08/03 -IV3HWT,JN65ST,EME,,Lucio,,144: FT101zd Trvt 8877 4x18el 4x20el.116 DT,08/04 -IV3KTY,JN65,,,,,,08/02 -IV3MPI,JN65SV,,,Edi,,IC746 IC271E Mutek FT736R PHEMT144 PHEMT,03/04 -IV3NDC,JN65RV,,,Massimo,,144: 300W BF981 2x15el 3.3wl176 2000lpm DTR,08/03 -IV3VFP,JN66HD,EME,,erminio,,,1993 -IV3ZCX,JN65QS,EME,,Maurizio,,144: Icom 275 PA 600Watts MGF1302 4x24el10522, -IW0AKA,JN61FS,,,,,,1990 -IW0AYO,JN61IU,,,Morris,,144: 16elonly SSB-MS,07/96 -IW0BFZ,JN61,,,b.,,,1993 -IW0BTS,JN61GU,,,,,only SSB-MS,1988 -IW0CUT,JN61TP,EME,,arnaldo,,,1993 -IW0CVK,JN61GV,,,,,,01/05 -IW0DJB,JN61,,,,,,04/02 -IW0DVG,JN61KK,,,max,,,1993 -IW0FFK,JN61FS,,,,,,10/04 -IW0GDC,JN61HX,,,,,,10/98 -IW0GPN,JN62FB,,,Alessandro ""Alex",,FT736 144: 200W 16el 4.8wlonly SSB-MS212,10/04 -IW0QNX,JN62,,,,,,01/97 -IW0QO,JN63EC,,,,,,1993 -IW0RBS,JN63FD,,,freddy,,,1993 -IW0RLC,JN63FD,,,Dario,,only SSB-MS,06/00 -IW0UEI,JN40GR,EME,,Antonio,,144: 2x9el 150W,04/04 -IW1ARB,JN44CV,EME,,Paolo,,144: 4x4.4Wl lt2s 3cx1500,03/01 -IW1AZJ,JN35UB,,,Silvio,,144: 200W 3.8wl DJ9BV2000lpm,06/00 -IW1BCV,JN44FS,,,Carlo,,144: IC275H 8930 2x18el MGF1302DTR 3000l,08/98 -IW1CCH,JN35TB,,,,,,01/05 -IW1CGB,JN35VG,EME,,Steve,,50: 3el PA - 144: 4x17el 2x4cx250b MGF130,06/97 -IW1CHX,JN35TH,,,Nicola,,144: C58 13el DJ9BV MGF1302 170W.100 150,04/02 -IW1DIM,JN35TC,,,,,only SSB-MS,07/01 -IW1DJS,JN35SA,,,,,,08/01 -IW1FTY,JN35UA,,,,,,2003 -IW2BNA,JN45ON,,,Walter,,144: IC275H 3CX800 4x11el - 432: IC475H,01/04 -IW2BSQ,JN45UJ,,,Jo,,144: IC746 !7el,04/03 -IW2BZY,JN45NN,,,Lorenzo,,144: 500Watts 2x12ele Flexaonly SSB-MS,08/01 -IW2DAL,JN45NN,,,Emilio,,144: FT736R 4x19LLY 4CX1000a - 432: FT736R,04/04 -IW2DMN,JN45KL,,,Ivano,,144: 100W 15el,10/02 -IW2DUA,JN45LL,EME,,dario,,,1993 -IW2HAJ,JN45NO,,,Claudio,,50: IC706 6el - 144: 400W 20ele Preamp,04/02 -IW2HUS,JN45NO,,,,,,04/02 -IW2HWQ,JN55GK,,,Francesco,,144: FT736r 80W 21elonly SSB-MS,10/96 -IW2LC,JN45OL,,,Luigi,,ICOM-756 YAESU FT-897 ICOM275H KENWOOD TS-790,05/04 -IW2LLA,JN55AM,,,Andrea,,144: 2x17el 100Wonly SSB-MS,08/96 -IW2MYV,JN45JN,,,Marco,,144: TS711E 4CX250 GaAs 4x7el + elv.only S,01/02 -IW2NEF,JN46QD,,,Flavio,,144: FT847 12elXY,11/02 -IW2NOR,JN45ON,,,Gaetano,,ICOM IC275H KENWOOD TS 2000 144: 100W 2x17,06/04 -IW3BKQ,JN56NH,,,,,,07/02 -IW3QTG,JN65PT,,,Paolo,,144: IC746 2x 17FT,08/04 -IW3RI,JN65RU,,,Claudio,,50: 6el/HyGain 144: 4x17el 432: 4x21el.155.,03/01 -IW3SGT,JN65,,,,,,07/02 -IW3SNU,JN65OT,,,Dany,,,11/04 -IW4ADT,JN54,EME,,augusta,,,1994 -IW4AR,JN64FD,,,,,,2003 -IW4ARD,JN64FD,,,Gianni,,144: 20el 300W,01/05 -IW4BET,JN54QL,,,Carlo,,,08/02 -IW4BLG,JN54VF,,,,,,2003 -IW4BTJ,JN54QL,,,,,,2003 -IW4CB,JN54XK,,,Andrea,,,02/01 -IW4DJE,JN64,,,,,,01/95 -IW4DLA,JN64CE,,,giacomo,,,1994 -IW4DMH,JN64CJ,,,Gabriel,,only SSB-MS,11/98 -IW4DQY,JN64AG,,,Joe,,,03/04 -IW4EHV,JN64AE,,,Fabio,,FT817 30W Amp 50: 5el - 144: 11el - 432: 2,09/03 -IW4EHZ,JN54ML,EME,,FAUSTO,,IC706MKIIG 20EL70CM 12EL2MT 6EL6MT,01/05 -IW5ACZ,JN53HP,,,ALESSANDRO,,50: TS2000 HB9CV 144: TR751E 4CX250 250 WAT,10/04 -IW5AVM,JN52NS,,,,,,2003 -IW5BLG,JN54VF,,,,,,2003 -IW5BML,JN52JW,EME,,A.,,,04/99 -IW5BPE,JN52NT,,,massimo,,,1993 -IW5CNS,JN53CX,EME,,Daniele,,144: IC275H 4x10el 2.2wl 9BV 8877 MGF130,12/99 -IW5DAN,JN53GU,EME,,Luigi,,144: 4x10el DJ9BV 8877 TS790e MGF1302.177,02/01 -IW5DHN,JN53gi,EME,,Matteo,,TS2000,04/02 -IW5DNZ,JN53,,,,,,05/02 -IW5EKJ,JN54AA,,,Roberto ""Roby",,144: 4-5ld 300W,10/04 -IW6AEG,JN63RO,,,Fabio,,,10/93 -IW6BLH,JN63RO,,,Franco,,,12/00 -IW6BNO,JN63RL,,,,,,11/95 -IW7DEC,JN81GF,,,Roberto,,144: 12db yagi 100W Preamp,08/04 -IW8QOT,JM88BR,,,,,,2003 -IW9CER,JM78QF,,,Tony,,only SSB-MS,10/02 -IW9ELR,JM68PD,,,Rosario ""Roy",,,11/02 -IW9FRA,JM68GA,,,Sal,,,01/05 -IZ0ARL,JN61IU,,,Maurizio (Morris),,144: 200W 16elonly SSB-MS,10/96 -IZ0AYB,JN52VC,EME,,Daniele,,IC-910H 144: 4x12JXX - 432: 2x19 Tonna,05/04 -IZ0CVK,JN61GV,,,Fabrizio ""Fab",,Yaesu FT767 mgf1801 11eleF9Ft 20ele DJ9BV5,06/04 -IZ1DXS,JN35UA,,,George,,ICOM IC-7400 (746 PRO) - 50: 6el - 144: 14e,11/02 -IZ1EGT,JN44LK,,,Fabio,,IC910,11/04 -IZ1ESM,JN45FB,,,Paolo,,KWD TS850 + LT2S MK2 + 4.4wl BVonly SSB-MS,09/02 -IZ2AAJ,JN45,,,,,,12/99 -IZ2DJP,JN55FO,,,Adelio,,,05/04 -IZ2EEQ,JN45,,,,,,07/02 -IZ2FOB,JN45MQ,,,Roberto,,50: IC706 dipole - 144: IC821h 150Watt 2x9F9F,08/03 -IZ4AIK,JN63HV,,,Marco,,50: 100W 5el - 144: TS790 3CX800A7 TS850 & T,07/01 -IZ4BEH,JN54WL,,,Roberto,,144: 1KW 2x16el MGF2407 - 432: 2x21el 300W,10/02 -IZ4BEJ,JN64CE,,,Enrico,,144: 2x13el gd Pwronly SSB-MS,11/97 -IZ5BXF,JN53GV,EME,,Michele,,300W- 4x11el 2.2wl- 0.3dbNF2500lpm,01/01 -IZ5EME,JN52NS,EME,,Marco,,144: 4x20el 8877 - 432: 4x25el 3CX800 - 1296:,04/01 -IZ8AZB,JN70EP,EME,,Lucio,,144: 4x11el 8930(400W)DTR,01/02 -IZ8DWL,JM88BR,,,Primo,,144: IC-746 PA 4CX250 16JXX LY MGF1302,04/04 -J45M,KM46CF,EME,,OP: PE1LWT- PA2CHR,,144: FT100 FT847 IC706 DSP59/Datong audiofilt,06/01 -J48XG,KN20GR,,,,,144: 8el DK7ZB 60W,05/04 -J79MY,FK95,EME,,OP K6MYC,,4x Yagi- 1.5KW,06/98 -JA0BLU,PM97OS,EME,,Masa,,144: 1KW 4x19el 2x18el MGF1801.043.250,01/00 -JA0VI,PM95,EME,,,,,2003 -JA1DXA,PM95VU,,,,,,2003 -JA1VZV,PM95QL,,,,,,2003 -JA2HMO,PM85IH,,,,,,2003 -JA2JRJ,PM84MW,EME,,,,,89 -JA2KRW,PM85NE,EME,,,,,2003 -JA2TY,PM84GS,EME,,,,,2003 -JA3BXC,PM74SU,,,,,,2003 -JA3IAF,PM74,EME,,,,,2003 -JA3SGR,PM74TU,EME,,,,,2003 -JA4BLC,PM65NM,EME,,,,,89 -JA4CMZ,PM65MI,EME,,,,,2003 -JA4KLX,PM95RI,,,,,,2003 -JA5NNS,PM63,EME,,,,,2003 -JA5OVU,PM74FC,EME,,,,,2003 -JA5YJS,PM63,EME,,,,,2003 -JA6AHB,PM53CP,EME,,,,,2003 -JA6CZD,PM53FM,EME,,,,,2003 -JA6DZI,PM53GM,EME,,,,,2003 -JA6XED,PM53,EME,,,,,2003 -JA6ZHR,PM53,EME,,,,,2003 -JA7BJP,QM07GN,,,,,,2003 -JA7BMB,PM97WM,EME,,,,,2003 -JA8ERE,QN02QX,EME,,,,,2003 -JA8IAD,QN03,EME,,,,,2003 -JA8PL,QN03,EME,,,,,2003 -JA9BOH,PM86FA,EME,,,,,2003 -JF3HUC,PM74UX,EME,,,,,2003 -JF3IPR,PM74,,,,,,2003 -JH0ISW,PM97LO,,,,,,2003 -JH0QBI,PM97FF,,,,,,2003 -JH0WJF,PM86,EME,,,,,03/01 -JH0YSI,PM85VJ,EME,,,,,89 -JH1EFA,PM96UB,EME,,,,,2003 -JH1KRC,QM06AW,EME,,,,,2004 -JH1OFX,PM85SM,EME,,,,,2003 -JH1OQW,PM95UX,,,,,,2003 -JH1SWD,QM06HN,,,,,,2003 -JH1XUJ,PM95UR,EME,,,,,2003 -JH2COZ,PM94mx,EME,,Yasu,,4x14el 1-5KW,03/99 -JH2OJS,PM85LD,,,,,,2003 -JH3EAO,PM74KR,EME,,,,,2003 -JH3VJV,PM74LP,,,,,,2003 -JH4JLV,PM54LA,EME,,,,,2003 -JH5FOQ,PM63JS,EME,,,,,02/01 -JH5LUZ,PM63FK,EME,,,,,2003 -JH6RTO,PM53FA,,,,,,2003 -JH7PAV,QM07DI,EME,,,,,2003 -JH7SIA,QM09EN,,,,,,2003 -JH9TJT,PM86HK,,,,,,2003 -JI1FLB,PM95WS,,,,,,2003 -JI1NJC,QM06FL,,,,,,2003 -JI3GER,PM75XA,EME,,,,,2003 -JI4POR,PM65NK,,,,,,2003 -JJ1NNJ,QM06GH,EME,,,,,2003 -JJ1VOM,PM95,,,,,,2003 -JK1HIX,PM95WH,EME,,Tomio,,4x17el 8877,03/99 -JK1LYP,PM95,,,,,,2003 -JK1XDX,PM95,,,,,,2003 -JK7IKU,QM09BR,,,,,,2003 -JL1ZCG,PM59UM,EME,,OP JR4ENY- 7K3LGC,,TS790 4CX1500A 16x2.5WL V-POL YAGIS,03/99 -JM1GSH,QM06IS,EME,,,,,12/04 -JM1LQW,PM96QA,,,,,,2003 -JM1MQE,PM95RP,,,,,,2003 -JN1BMX,QM06FM,,,,,,2003 -JN1CSO,PM95SW,,,,,,2003 -JO1LVZ,PM95TR,,,,,,2003 -JO3JJN,PM85AC,EME,,,,,2003 -JO3RNL,PM74TT,EME,,,,,2003 -JR1EDE,PM95TG,EME,,Kohjin,,10368: 1.8m Dish 40W,02/01 -JR1EUX,PM95TO,EME,,,,,2003 -JR1RCH,PM96SI,EME,,,,,2003 -JR3REX,PM74LQ,,,,,,2003 -JR4AEP,PM65RH,EME,,,,,2003 -JR4BRS,PM65,EME,,,,,2003 -JR5JXV,PM86XG,,,,,,2003 -JR5UOY,PM64XF,,,,,,2003 -JR7VXF,QM09AK,,,,,,2003 -JR9NWC,PM85BW,EME,,,,,2003 -JS3SIM,PM74VW,EME,,,,,2003 -JX7DFA,IQ50OV,EME,,Per Einar,,TS2000.161 DTR.161,08/00 -K0AWU,EN37ED,,,,,,2003 -K0AZ,EM37CD,,,Mike,,144: 800Watts 17B2,09/01 -K0BLR,EN25UO,,,BEN,,,2003 -K0CB,EM27,,,,,,2003 -K0CIO,EM07,,,,,,2003 -K0CJ,EN34IS,,,,,,2003 -K0CQ,EN32EC,,,,,,2003 -K0CXJ,EN26,,,,,,2003 -K0DAS,EN42,EME,,,,,89 -K0FF,EM49HO,,,George,,50: 1-5KW 7el or 4x6el - 144: 1-5KW 2x17el M,01/01 -K0FQA,EN35FE,,,,,,2003 -K0FZG,EN36,,,,,,2003 -K0GCJ,EN43,,,,,,2003 -K0GEI,EM49,,,,,,2003 -K0GRM,DN96OT,,,,,,2003 -K0GU,DN70MQ,EME,,Jay,,144: FT1000DEM 8877 4x17elB2 SSB Preamp,01/01 -K0HH,EM48,,,,,,2003 -K0HU,EN10,,,,,,09/99 -K0HWE,EN41BX,,,,,,2003 -K0IDC,EN12TL,,,Robert,,,2004 -K0IDT,EN10PS,,,Ron,,,2003 -K0IK,EN34JR,,,Brian,,,2004 -K0ILC,EN36,,,,,,2003 -K0IR,EN25,,,,,,2003 -K0JO,EN34,,,,,,2003 -K0KE,DM79,,,,,,2003 -K0KFC,EN34,,,,,,2003 -K0KJX,EM48,,,,,,2003 -K0KP,EN36VW,,,Rex,,50: 7el 100W - 144: 13el 100W,08/03 -K0KQY,DM98,,,,,,08/00 -K0LGI,EN42,,,,,,2003 -K0LLS,EM29,,,,,,2003 -K0MQS,EN31UH,,,,,,2003 -K0NG,EN10,,,,,,2003 -K0NL,EM48MK,,,,,,2003 -K0NY,EN44DB,,,,,,2003 -K0OG,EM47CW,,,Joseph,,,2004 -K0PFX,EM48SR,,,,,,2003 -K0PG,EN61AU,,,,,,2003 -K0PJ,EN34,,,,,,2003 -K0PS,DM59VG,,,Paul,,,2004 -K0PW,EN34CV,EME,,John,,144: 1.5KW 2x17el 5lb MGF1302.098.175,09/01 -K0RDF,EM29,,,,,,2003 -K0RI,DM78PX,,,Larry,,,2003 -K0RL,EM49HU,,,,,,2003 -K0RP,DM88AD,,,Bill,,50: 150W - 144: 150W - 222: 110W - 432: 110W,01/01 -K0RRY,EN36,,,,,,2003 -K0RZ,DM79JX,,,,,,2003 -K0SDH,EN34JS,,,,,,2003 -K0SE,EN34,,,,,,2003 -K0SHF,EN34JV,,,,,,2003 -K0SM,EN10RT,,,Andy,,144: 160W Preamp 13B2,01/01 -K0SQ,EN35,,,,,,2003 -K0TAR,EN34,,,,,,2003 -K0UO,EM07,,,,,,2003 -K0VM,EN42,,,,,,2003 -K0VSV,EN41LK,,,Tom,,50: 8W 5el - 144: 170W 12el,1998 -K0WLU,EN13XS,,,,,,2003 -K0XP,FN31,,,Steve,,144: 350W 3219 - 222: 450W KLM16,01/02 -K0XXX,EM46FF,,,,,,2003 -K0YW,DM67ED,EME,,,,,2003 -K0ZPO,EM15,,,,,,2003 -K1AE,FN42EJ,,,John,,,11/01 -K1CA,FN42mm,EME,,,,,2003 -K1FO,FN31QJ,EME,,,,,2003 -K1IM,FN31WX,,,Tom,,,2003 -K1JT,FN20QI,EME,,Dr. Joseph ""Joe",,50: 200 - 144: 11el 160W - 222: 120W - 432:,12/04 -K1MS,FN42,,,Ivan,,144: 1KW 2x M2 5wl,01/01 -K1OR,EN42IR,EME,,,,,2003 -K1OYB,FN43TP,,,,,,2003 -K1POP,FN51,,,,,,2003 -K1RC,FN42HQ,,,,,,2003 -K1RO,FN31,,,,,,2003 -K1RQG,FN54LM,EME,,,,,2003 -K1RZ,FM19JH,,,,,,2003 -K1TEO,FN31,,,Jeff,,144: 800W 4x12el - 222: 500W 2x23el,01/01 -K1UHF,FN31FH,EME,,Del,,144: 1-5KW 4x12el - 222: 500W.100 10000lpm,01/01 -K1VOW,DM25VF,,,,,,2003 -K1ZE,FN41,,,Ed,,144: 300W 2x4218 - 222: 60W 220B - 432: 400W,1998 -K2AAX,FN12CS,,,Mark,,,01/01 -K2AH,FN20,EME,,,,,2003 -K2AXX,FN12CS,EME,,Mark,,144: TS-930S Transverters - 432: TS-830S,02/05 -K2BLA,EL99IA,EME,,Albert,,,01/05 -K2DH,FN13FB,EME,,,,,2003 -K2DRH,EN41VR,,,Bob,,,07/03 -K2EVW,EM96SS,,,,,,2003 -K2GAL,FM29PH,EME,,,,,1998 -K2JT,EM20QI,,,Dr. Joseph ""Joe",,144: 11el 160W,03/00 -K2LME,FN31UI,EME,,Dave,,,10/98 -K2OS,FN13CD,EME,,,,,12/00 -K2OVS,FN30,,,Jay,,50: 250W 6el - 144: 200W single yagi - 432: 6,01/01 -K2PGB,FN20,,,Chris,,50: TS680S 10W 3el - 144: IC251A 80W 13B2,01/01 -K2STO,EL88PH,,,,,,2003 -K2TXB,FM29PT,,,Russ,,,07/01 -K2UYH,FN20QG,EME,,,,,89 -K2VEE,EM79WP,,,,,,2003 -K2WKA,FN20RF,,,Fred,,,2003 -K2YAZ,EN74AV,,,,,,2003 -K3ACE,FM29DR,,,Norm,,,2003 -K3AX,FN20,EME,,,,,2000 -K3BFA,FN10XI,,,Charlie,,144: 1-5KW 4x15el,01/01 -K3DJC,FM19LL,,,,,,2003 -K3EAR,FM19HX,,,South Mountain Conte,,,2003 -K3FOR,FM19SB,EME,,Skip,,,2003 -K3FU,FM18,,,,,,2003 -K3GNC,FM29KX,,,Jerome,,,01/97 -K3HZO,FN20AG,,,Harry,,50: 350W 5el - 144: 350W 17el - 432: 100W 24e,1998 -K3IB,FN20HK,,,Phil,,50: 200W 6M5XX - 144: 1-5KW FO12 - 222: 300W,09/01 -K3JT,EM99XO,,,,,,2003 -K3LFO,FM19,EME,,,,,2003 -K3LOW,EN91BK,,,Henry,,,2003 -K3MF,FM19XP,EME,,Wayne,,,01/05 -K3ROJ,FM19SH,,,,,,2003 -K3SIW,EN52,,,,,,2003 -K3TKJ,FM28EM,,,,,,2003 -K3TUF,FN10WE,,,Philip,,,2004 -K3TV,FN20EP,,,,,,2003 -K3UZY,FN20,,,,,,2003 -K3VLQ,EM92,,,,,,2003 -K4AR,EM76,EME,,Bert,,432: 8x28el (9lb) Yagis 1-5KW 0.25db,01/00 -K4CSO,EM73,,,,,,2003 -K4DD,EM60NP,,,Richard,,,2004 -K4DRF,EM74QA,,,,,,2003 -K4EJQ,EM86,,,,,,2003 -K4EME,FM08KF,EME,,,,,2003 -K4HJE,EM96,,,Ed,,,01/01 -K4JAF,EM70EK,,,,,,2003 -K4KAE,FM02AT,,,,,,2003 -K4KO,EM66UD,,,Greg,,,2004 -K4MRW,EM64PW,,,Robert,,,01/01 -K4QF,EM64,,,,,,2003 -K4QI,FM06,EME,,,,,07/01 -K4QXX,EL87RM,,,Burch,,,2003 -K4RF,EM84DJ,,,Steve,,,01/01 -K4SDI,EM56TQ,,,Mark,,,2003 -K4SSO,EM48SR,,,Colin,,144: 160W 16el,01/02 -K4SSP,EM47,,,,,,09/99 -K4TAX,EL96WF,,,,,,2003 -K4VJ,EL96LX,,,,,,2003 -K4WRI,EL98LM,,,Robert,,,2003 -K4YA,EM25,,,,,,2003 -K4YNT,EM74KW,EME,,Bob,,,02/05 -K4ZFY,EL18,,,,,,2003 -K5AIH,EL09TK,EME,,,,,1998 -K5APM,EM10BL,,,,,,2003 -K5AZU,EM40SN,EME,,,,,2003 -K5BYS,EM13,,,,,,2003 -K5CBL,EM15,,,,,,2003 -K5CFM,EM15,,,,,,2003 -K5CPZ,EM15,,,,,,2003 -K5EGW,EM30,,,,,,2003 -K5EWS,EM10,,,,,,2003 -K5FA,EM44,,,,,,2003 -K5GE,EL09,,,,,,2003 -K5GNA,EM20,,,,,,2003 -K5GW,EM13PA,EME,,,,48x10el,10/98 -K5IS,DM96,,,,,,2003 -K5IUA,EL29CD,,,John,,,01/01 -K5JL,EM15DQ,EME,,,,,01/05 -K5LZO,EM20,,,,,,2003 -K5MAT,DM65,,,,,,2003 -K5MQ,EM31WQ,,,,,,2003 -K5OGE,EM20UX,,,,,,01/01 -K5PHD,EM-12,,,,,,2003 -K5PHF,DM61,,,,,,2003 -K5PJR,EM37KA,,,,,,2003 -K5QQ,DM65SB,,,,,,2003 -K5QXJ,EM30XA,,,,,,2003 -K5RFI,EM16,,,,,,2003 -K5RHR,DM65UV,,,,,,2003 -K5RUS,EM32VM,,,RUSSELL,,,2003 -K5SXK,EM12,,,,,,2003 -K5TN,EM15,,,,,,2003 -K5TNP,EM32,,,,,,2003 -K5TTT,EM26CH,,,Charlie,,only SSB-MS,01/02 -K5UHF,EM10DJ,,,,,,2003 -K5UJC,EM20VB,,,Earl,,,2004 -K5VH,EM00XE,,,,,,2003 -K5WO,EM12,,,,,,2003 -K5WXN,DM61,EME,,,,,89 -K5YPV,EM54MR,,,,,,2003 -K5YY,EM26,,,San,,144: 1KW 13el,89 -K5ZMJ,EM12,,,,,,2003 -K5ZMS,EL09,,,,,,2003 -K5ZSJ,EM12,,,,,,2003 -K5ZXE,EM14KL,,,,,,2003 -K6AAW,CN80TE,EME,,Larry,,144: 4x15el 3wl 1.2KW MGF1302,01/00 -K6ALF,CM97BH,,,,,,2003 -K6CYS,DM12KT,,,,,,2003 -K6DV,DM13NI,EME,,,,,2003 -K6HLH,DM14CP,,,,,,2003 -K6IAH,DM12,,,,,,2003 -K6IBY,DM13,EME,,,,,2003 -K6JEY,DM03WT,EME,,Doug,,144: 4x25el K1FOs 500W <0.4db,08/00 -K6KL,CM97,,,,,,2003 -K6LEW,FM18LT,EME,,Owen,,,11/00 -K6MBY,DM13LD,,,Bob,,,2003 -K6MXI,CM88QL,,,,,,2003 -K6MYC,CM97AA,EME,,,,,10/96 -K6PF,DM13AR,,,Robert J.,,144: FT726r 175W 4xM 2MXP20,01/01 -K6SUE,CM98AK,,,Sue,,144: 650W 2x17el- 222: 120W 7wl- 432: 175W 2x,11/99 -K6UCY,CM87UN,,,Vic,,,2004 -K6UIY,DM14,,,Cap,,144: FT726r 1KW 2Yagis,01/97 -K6UM,CM88,,,,,,2003 -K6ZX,CN82GM,,,Doug,,144: 160W 2x2M9,01/97 -K7BV,FN31VI,EME,,,,,01/05 -K7CA,DM26JE,EME,,Al,,144: 1KW 42´homebrew yagi,01/01 -K7CAI,DN27KF,,,,,,2003 -K7IEY,CN88,,,,,,03/98 -K7JA,DM03XS,,,Chip,,144: 190W 19el,1998 -K7KX,DN55,,,,,,2003 -K7LNP,DN30,EME,,,,,09/99 -K7MAC,DN13SN,EME,,Mac,,,01/05 -K7MDL,CN87XT,EME,,,,,04/04 -K7ND,CN87QF,,,Jim,,144: 1KW 2x5wl M2,01/01 -K7NEP,DN53NF,,,John,,FT1000MP 144: HM 1KW PA 13el,1998 -K7OO,DM04,,,,,,2003 -K7PVT,CN88SA,,,,,,2003 -K7TRM,DM33VP,,,Tom,,,2003 -K7UOP,DM33XN,,,Bill,,,01/01 -K7UV,DN31XM,,,Ron,,,2003 -K7WUP,DM49IG,EME,,,,,2003 -K7XC,DM09OL,EME,,Tim,,50: IC746 KW 6el - 144: IC746 500W 18xxx- 222,03/03 -K7XD,CN85,EME,,Derek,,144: 400W 2x23el,01/97 -K7XQ,CM97QI,EME,,Jeff,,144: 4x2MPX18 Xpol 3lb 450W MGF1302,10/99 -K7XW,CN96XI,EME,,Mark,,50: 1-5KW 5el - 144: 600W 2x3.5wL - 222: 50W,01/01 -K7YVZ,DN13TL,,,Jerry,,144: 1-5KW 4x18XXX 2x13el Quagi Preamp - 432,01/01 -K7ZL,CN84JC,,,Tom,,144: 150W 36foot yagi,1998 -K8BHZ,EN75DB,,,Brian,,144: 1-5KW 4x17B2,1998 -K8DGY,EN63WW,,,,,,2003 -K8EME,EN72EH,EME,,Luis,,144: FT847- 4x11el 2.2lb- 8877 (1-5KW),03/00 -K8IE,EN52,,,,,,2003 -K8ISK,FM18DV,EME,,,,,2003 -K8MM,EN83IB,,,Ian,,,2004 -K8ROX,EN80LO,,,,,,2003 -K8SD,EN12,,,,,,2003 -K8UC,EM99EG,EME,,,,,2003 -K8UK,EN82LK,EME,,,,,2003 -K8VEB,EN72NN,,,,,,2003 -K8VP,EN91,EME,,Bill,,200,07/01 -K8XK,EN42,,,,,,2003 -K9AKS,EN41,,,,,,2003 -K9AM,EN52,,,,,,2003 -K9BCT,EL96UE,EME,,,,,2003 -K9BMB,EM69OG,,,Homer,,,2003 -K9CA,EN61ML,,,,,,2003 -K9CFA,EN52,,,,,,2003 -K9DQ,EN62,,,,,,2003 -K9DTB,EM89,,,Phil,,, -K9EA,EN94CB,,,Dan,,,09/01 -K9EK,EM79BF,,,,,,2003 -K9FYV,EN41,,,,,,2003 -K9HJZ,EN50ES,,,Jeff,,,2003 -K9HMB,EN52VI,EME,,,,,12/00 -K9HSK,EN51,,,,,,2003 -K9IJ,EN52,,,,,,2003 -K9ILT,EN61AU,,,,,,2003 -K9IMM,EN52,,,,,,2003 -K9IMX,EM38,,,,,,2003 -K9IZV,EN53,,,,,,2003 -K9JK,EN52XC,,,,,,2003 -K9KFR,EN71GG,EME,,,,,2003 -K9KHW,EN63AD,,,,,,2003 -K9KL,EN64,,,,,,2003 -K9KNW,EL96EC,EME,,Joe,,,01/05 -K9MB,EM57,,,,,,2003 -K9MRI,EN70IU,EME,,Joe L.,,144: 8xm2 yagis and 1.2kw,01/05 -K9NS,EN52QK,,,,,,2003 -K9OQN,EN52,,,,,,2003 -K9PO,EN52VF,,,,,,2003 -K9PW,EN52,,,,,,2003 -K9SLQ,EN70KK,EME,,Wayne,,432: 16x FO22 1.5 KW,08/02 -K9SQL,EM69RF,,,Robert,,,2004 -K9TI,EN51,EME,,Russ,,144: 4x K1FO 12 el PA 8877,02/01 -K9VHF,EN53,,,,,,2003 -K9VNM,EN63,,,,,,2003 -K9VS,EN52,,,,,,2003 -K9XI,EN61,,,,,,2003 -K9YR,EN52,,,,,,2003 -K9ZZH,EN61,EME,,,,,2003 -KA0EWM,EN30,,,,,,2003 -KA0KCI,EM17,,,,,,2003 -KA0KUY,EM07XD,,,,,,2003 -KA0MOW,EM17,,,,,,2003 -KA0MR,EM18GE,,,,,,2003 -KA0MWA,DM79LL,,,,,,2003 -KA0NNO,EM24TL,,,Lisa,,,01/97 -KA0OGU,EM29,,,,,,2003 -KA0PQW,EN33,,,Matt,,,11/01 -KA0RYT,EN34DW,EME,,Ron,,,01/02 -KA0UZZ,EN34,,,,,,2003 -KA0Y,EN41,EME,,,,,08/00 -KA0YSQ,EN42,,,,,,2003 -KA0ZOZ,EN23,,,,,,2003 -KA1JBG,FN42,,,,,,2003 -KA1LEX,FN34KL,,,Randall,,,2003 -KA1OTP,FN41,EME,,,,,2003 -KA2DRH,EM64KT,,,,,,2003 -KA2HZO,FM29US,,,,,,2003 -KA2KQM,EM74QA,,,,,,2003 -KA3HED,FM27,,,,,,2003 -KA3WSZ,FM29GK,EME,,,,,2003 -KA4WJA,EL89WE,,,,,,2003 -KA5AAE,EM06,,,,,,2003 -KA5AIH,EL29NW,EME,,,,,10/96 -KA5DWI,EM12JU,,,,,,2003 -KA5PVB,EM13,,,,,,2003 -KA5TQY,EM43,,,,,,2003 -KA5UEL,EM12,,,,,,2003 -KA5UEV,DM93,,,,,,2003 -KA5ULI,EM30,,,,,,2003 -KA5WMJ,DM96,,,,,,2003 -KA5WRG,EM15,,,,,,2003 -KA5YJJ,EM44NN,,,Thomas,,,2003 -KA6NBC,CM98,,,,,,2003 -KA7V,DN14MA,,,Barry,,144: 13B2 1500W,11/03 -KA8EDE,EM79,,,,,,2003 -KA8HQL,EM89VU,,,Jeffrey,,,2003 -KA8SFP,EM12,,,Stan,,,01/01 -KA8SSB,EM79,,,,,,2003 -KA8TER,DN43AL,,,,,,2003 -KA9CFD,EN40OM,,,Jay,,,11/04 -KA9LDS,EN51,,,,,,2003 -KA9LLF,EM71,,,,,,2003 -KA9LNP,DN30,,,Pat,,144: 800W KLM13LBA,01/01 -KA9MGR,EN41,,,,,,2003 -KA9OIL,EN62,,,,,,2003 -KA9UVY,EM58NG,,,,,,2003 -KA9YCB,EM57QQ,,,,,,2003 -KB0BFI,29EMLL,,,Clarence,,,2003 -KB0BVR,EN26AH,,,,,,2003 -KB0CY,DM79,,,,,,2003 -KB0EMR,EN31,,,,,,2003 -KB0FHP,FN20GE,,,Donald,,,2003 -KB0FRX,EN10,,,,,,2003 -KB0G,DM79PA,,,,,,2003 -KB0GL,EN35,,,,,,2003 -KB0GR,EM29,,,,,,2003 -KB0GU,EM28TW,,,Gene,,,2004 -KB0HH,EM07QD,EME,,,,,89 -KB0IKP,EN25UQ,,,,,,2003 -KB0LRI,DM79,,,,,,2003 -KB0LXX,DN96,,,,,,2003 -KB0MNK,EN34IW,,,,,,2003 -KB0NR,EN35OG,,,,,,2003 -KB0OBT,EN35KB,,,,,,2003 -KB0OZN,EN34,,,,,,2003 -KB0PYO,EN24GP,,,Mark,,,01/97 -KB0THN,EN44DB,,,,,,2003 -KB0TZA,EN35ID,,,,,,2003 -KB0USF,DM79LR,,,,,,2003 -KB0VUK,EN34PK,,,Matt,,,09/01 -KB1CJ,FN42JG,,,Joe,,IC746 50: 100W 2el - 144: 100W 13el,09/03 -KB1DFE,FN42ES,,,,,,2003 -KB1HGB,FN53EU,,,,,,2003 -KB2AH,FN20,,,,,,2003 -KB2M,FM29PE,,,,,,2003 -KB3EDF,FM18RH,,,Ron,,,2003 -KB3HWO,FN10UB,,,Mark,,,2003 -KB3PD,FM29,EME,,,,,89 -KB4BSA,EM73,,,,,,2003 -KB4FQ,FM04GR,,,,,,2003 -KB4RSM,EM66OG,,,,,,2003 -KB4WM,EM63,EME,,,,,2003 -KB4ZGO,FM06BQ,,,Anthony,,,2004 -KB5DAK,DM96,,,,,,2003 -KB5EK,EM15,,,,,,2003 -KB5MR,EM26,,,,,,2003 -KB5MY,DM13NC,,,,,,2003 -KB5UBE,EM12LQ,,,,,,2003 -KB5ULP,EM15,,,,,,2003 -KB5VL,DM73RK,,,,,,2003 -KB5VQQ,EM15,,,,,,2003 -KB5WII,EM15,,,,,,2003 -KB5WMY,EM32,,,Carl,,,1998 -KB5YAJ,EM14,,,,,,2003 -KB5YUA,EM44,,,,,,2003 -KB5ZMY,EM12,,,,,,2003 -KB5ZUD,EM26,,,,,,2003 -KB6IGC,DM15DO,,,,,,2003 -KB7FUV,DN44,,,,,,1993 -KB7XO,DN41AB,,,,,,2003 -KB8GC,EN74HD,,,,,,2003 -KB8JVH,EN80,,,,,,2003 -KB8O,EN82JJ,,,Albert L. ""Al",,,03/00 -KB8RQ,EM79SV,EME,,Gary L.,,144: 8 x 19el M2.038,01/05 -KB8VAO,EN91PB,,,,,,2003 -KB8ZUZ,EN83JL,,,,,,2003 -KB8ZW,EN91IJ,,,,,,2003 -KB9GPW,EN61,,,,,,2003 -KB9II,EN52WA,,,,,,2003 -KB9KCJ,EN52,,,,,,2003 -KB9MLA,EN61CX,EME,,,,18el- 160W,10/98 -KB9NLM,EN53UO,,,,,,2003 -KB9PCL,EN41,,,,,,2003 -KB9PJL,EN44GT,,,,,,2003 -KB9Q,EN52VV,,,,,,2003 -KB9TLV,EN45MW,,,,,,2003 -KB9UMT,EN50DP,,,Don,,,2003 -KB9VQC,EN53,,,,,,2003 -KB9VUG,EN52,,,,,,2003 -KB9YXF,EN61,,,,,,2003 -KB9ZK,EN62,,,,,,2003 -KC0AKJ,EN42,,,,,,2003 -KC0AMG,DM98GK,,,,,,2003 -KC0CHW,EN41IN,,,,,,2003 -KC0CRE,DM28,,,,,,2003 -KC0FTQ,DM79OB,,,,,,2003 -KC0FXY,EN34,,,,,,2003 -KC0HTB,EN34JT,,,,,,2003 -KC0LBT,EN35IB,,,,,,01/05 -KC0LMS,EN34IW,,,,,,2003 -KC0MLS,EM19QU,,,Myron,,,2003 -KC0OG,EN10,,,,,,2003 -KC0P,EN34SB,,,,,,2003 -KC0QR,EN10,,,,,,2003 -KC0Y,DM79,,,,,,2003 -KC2TN,FM29NS,,,Joe,,,2003 -KC3AK,FM19UU,,,Terry,,,2004 -KC3RE,FM18DB,EME,,Martin,,144: 160 W .5 db 18 el (no elev) - 432:,02/05 -KC4VI,EL88SD,,,,,,2003 -KC5BQS,EL29,,,,,,2003 -KC5BRO,EM15,,,,,,2003 -KC5LOW,EM22,,,,,,2003 -KC5NOA,EL08,,,Bart,,50: 150W 5el - 144: 100W 10el - 432: 20W 19el,01/01 -KC5NOB,EL07,,,John,,50: 10W 5el - 144: 170W 8el - 432: 10W 19el,01/01 -KC5UOO,EM26,,,,,,2003 -KC5WX,EM13LB,,,,,,2003 -KC5YKX,EL17HS,,,Reid,,Icom 746 w/ DEM 22 and 432 xverters 50: 5el,05/02 -KC5ZXE,EM45AM,,,,,,2003 -KC6A,DM03,EME,,,,,2003 -KC6TEU,CM98MQ,,,,,,2003 -KC6WFS,DM04RK,,,Dave,,50: 100W 5el - 144: 100W 2x12el - 432: 50W 2x,08/01 -KC6ZWT,CM98,,,Alexander,,144: 350W 17el M2 - 222: 250W 15el - 432:,05/03 -KC7MRP,CN88,,,Brad,,,01/97 -KC7OTV,CN84KA,,,Brian,,,2003 -KC8CCD,EM79VM,,,,,,2003 -KC8DLL,EN66,,,Mike,,50: 150W M25 - 144: 200W 2x13B2 - 432: 100W K,1998 -KC8GYW,EM79,,,,,,2003 -KC8NST,EN91QB,,,,,,2003 -KC8OIT,EN83,,,,,,07/01 -KC9AAX,EN52,,,,,,2003 -KC9AER,EN52,,,,,,2003 -KC9AYO,EN52,,,,,,2003 -KC9BTW,EN52,,,,,,2003 -KC9CMT,EN63LA,,,Michael,,,2004 -KD0BT,EN41,,,,,,2003 -KD0DW,DN70LF,,,,,,2003 -KD0HE,EN00,,,,,,2003 -KD0LO,EM48,,,,,,2003 -KD0PY,EN41UX,,,Darryl,,144: IC275A 2516g 150W 13el - 432: IC471H 70W,01/01 -KD0SU,DM78,,,,,,2003 -KD1DU,FN31FH,EME,,,,,2003 -KD3UY,FM19LG,EME,,Bob,,,01/05 -KD4ESV,EL87RH,,,Samuel C.,,,01/01 -KD4FNB,FM17TD,,,,,,2003 -KD4LT,EM81CG,EME,,,,,2003 -KD4MZM,EL87RG,EME,,Eric,,50: FT107m - 144: FT726r 170W 19el.125.200,07/01 -KD4NOQ,EM55BE,,,,,,2003 -KD4NUD,EM91HB,,,,,,2003 -KD4TJN,EM55CE,,,,,,2003 -KD5FFW,EM12,,,,,,2003 -KD5FZX,EM12MP,EME,,,,,2003 -KD5HIO,DM65UV,EME,,Glen,,,2003 -KD5KJD,EL29IR,,,Luis,,,2004 -KD5LDQ,EM26IH,,,Dwayne,,,2003 -KD5LWU,DM66AU,,,Johnny,,,2003 -KD5OMJ,EM04UO,,,Boyd,,,2003 -KD5OUG,EM12,,,,,,2003 -KD5QQU,EM12QX,,,,,,2003 -KD5QWO,EM15AJ,,,David,,Yaesu ft-847,01/04 -KD5XB,DM84,,,Earl,,,01/97 -KD7ETC,DM54AH,,,Roland,,,2004 -KD9KX,EN42,,,,,,2003 -KD9PW,EN54,,,,,,2003 -KE0MO,EN41,,,,,,2003 -KE0UQ,EM29,,,,,,2003 -KE1AF,,,,ABEL,,,2003 -KE2N,FM18EW,EME,,KEN,,432: 16x28 el 1KW,01/05 -KE3PL,FN20PM,,,,,,2003 -KE3UY,,,,mark,,,2003 -KE4ENX,EM84GM,,,,,,2003 -KE4IKM,EM73,,,,,,2003 -KE4KDB,EM55,,,,,,2003 -KE4MKW,EM84DJ,,,,,,2003 -KE4VUN,EM67MS,,,,,,2003 -KE4YH,EL88OA,,,Stew,,,01/01 -KE4YYD,EL97RV,,,David,,,09/01 -KE5CO,EL29,,,,,,2003 -KE5ML,EM15,,,,,,2003 -KE6NDG,CN90QJ,,,Jim,,,2003 -KE6PT,CM88UE,,,,,,2003 -KE7CX,CN85LJ,,,,,,2003 -KE7NR,DM33WM,EME,,,,,12/04 -KE7NS,DN41AF,,,Mark,,,01/02 -KE7OI,DN13SU,EME,,Dan,,,01/01 -KE7V,CN88JB,,,John,,,2004 -KF0AU,EN31HI,,,,,,2003 -KF0CK,EM38JC,,,,,,2003 -KF0DS,DM41,,,,,,2003 -KF0FE,EN41,,,,,,2003 -KF0M,EM17HO,EME,,John,,,01/01 -KF0OA,DM79,,,,,,2003 -KF0Q,EN44EA,,,,,,2003 -KF4HOU,EM86VE,,,,,,2003 -KF4JU,EL87,,,,,,2003 -KF5AL,EM13,,,,,,2003 -KF5IU,EM31WR,,,,,,2003 -KF5PE,EM12,,,,,,2003 -KF6BXH,CM87VQ,,,,,,2003 -KF6HQC,DM14ED,,,,,,2003 -KF7CN,DN16LV,,,Kevin,,,01/01 -KF7IS,DN41AC,,,Jim,,,2004 -KF7VY,DN17IQ,,,,,,2003 -KF8QL,EN72,,,,,,2003 -KF9CY,EM59,,,,,,2003 -KF9YR,EN54,,,George,,144: 170W 13B2,01/97 -KG0MW,EN13,,,Chad,,,02/01 -KG0SV,DM79,,,,,,2003 -KG4BMH,EM76JK,,,Jason,,144: 1000 Watts sp144vdg GasFet 40 Element,05/02 -KG4CHX,EM95LL,,,,,,2003 -KG4FET,EM90FH,,,Sandor,,,07/01 -KG4KAK,EL96VG,,,Leo,,,2005 -KG4MLA,EL88OA,,,Joe,,,2003 -KG5RK,EM12,,,,,,2003 -KG5SF,EM44,,,,,,2003 -KG5UN,EM02,,,,,,2003 -KG6DX,QK23KL,EME,,,,,01/05 -KG6ENA,DM04DK,,,,,,2003 -KG7CN,DN23BF,,,,,,2003 -KG7FU,CN83KA,,,James S.,,144: 2x11el 1KW.190.240,01/01 -KH7K,AL08UJ,,,,,,2003 -KI0LE,EM36US,EME,,Bryce,,,12/04 -KI4BYV,FM15CX,,,John,,,2004 -KI4M,EM95AQ,,,Shane,,144: 800W M2 18XXX,01/01 -KI6FF,DM13AR,,,,,,2003 -KI7JA,CN85RL,,,Bruce,,,2004 -KI7WB,DN62,,,Ed,,144: 200W 10el,01/01 -KJ5EY,DM65XA,,,,,,2003 -KJ5Q,EM15,,,,,,2003 -KJ7A,DM03,EME,,Chip,,432: FT-817 8 x 25 ele,11/00 -KJ7F,DN13VO,EME,,,,,2004 -KJ7OG,DM42MH,EME,,,,,2003 -KJ9I,EN53QC,EME,,David,,,01/05 -KK4NO,EM92,,,,,,2003 -KK5WA,EM45,,,,,,2003 -KK7B,EN57RB,,,,,,2003 -KK7LK,CN88SS,,,,,,2003 -KK8O,EN80OR,,,Richard,,,2004 -KL6M,BP51DC,EME,,Mike,,9.2m dish,01/05 -KL7FB,BP51HO,EME,,,,,2003 -KL7HFQ,BP51,EME,,,,,2003 -KL7IZW,EM13SE,EME,,,,,12/04 -KL7X,BP51AE,EME,,,,,02/01 -KM0A,EM48UT,,,Mark,,,01/01 -KM0T,EN13VB,,,Mike,,,07/01 -KM1H,FN42,,,Carl,,144: 1-5KW 2x4218XL,01/01 -KM4ID,EM93WA,,,,,,2003 -KM5ES,EM25DI,,,John,,144: TR751 200W 30el,08/01 -KM5OL,EM13RB,,,,,,2003 -KM5PO,EM23WK,EME,,Jim ""Mac",,144: 13KW ERP,12/04 -KM6WC,CM97OP,,,Jim,,FT100,09/02 -KN4SM,FN16QT,,,Jerry,,144 : 1-5KW M2 5wl,01/01 -KN6DD,DM03,EME,,,,,2003 -KO0Z,EM48,,,,,,2003 -KO2R,EN52,,,,,,2003 -KO4FR,FM16UV,,,Robert,,,2005 -KO4QR,FM26,,,,,,1998 -KO7N,CN84IA,EME,,Richard,,432.050144.240,08/01 -KQ0Z,EM37,,,,,,2003 -KQ6JI,CM87UJ,,,,,,2003 -KQ6UH,DM14BC,,,,,,2003 -KR5E,EL29JN,,,,,,2003 -KR5V,EM13,EME,,,,,01/02 -KR5Vex,EM13SD,,,,,,2003 -KR7O,CM97,,,Robert,,HTX100 144: Trvt 1KW 2M5wl - 222: Trvt 450,01/01 -KR8L,DN43AL,,,,,,2003 -KS0F,EM48SL,,,Mike,,,01/97 -KT4HA,FM15BH,,,Joe,,,2003 -KT8O,EN34IV,,,Eric,,,2003 -KT8U,EN80OR,,,Reed,,,2003 -KU0KU,EM28QV,,,,,,2003 -KU3T,FN20,EME,,,,,04/98 -KU4F,EL99AF,EME,,,,,2003 -KU4R,EM86SK,EME,,Bob,,144: 2x18XXX 200W,01/01 -KU7Z,DN41AF,,,Mark,,,2004 -KV4EB,EM66FL,,,Willie,,144: 7el 14el,11/01 -KV6J,BK29AQ,,,,,,2003 -KW0A,EM48RI,,,Ken,,144: 1KW 24el,08/01 -KW0T,EM19WF,,,,,,2003 -KX7V,DM42,,,,,,2003 -KX9X,EN60AC,,,Sean,,IC706MKII - 50: 100W 3el - 144: 100W 11el,09/01 -KY7B,DM43,,,,,,2003 -KZ2S,FN20XD,,,,,,2003 -LA0BY,JO59FW,,,Stefan,,144: 180W 9el - /p JO59ix: 144: 180W 2x9el,10/01 -LA0FX,JP40LM,,,,,,11/95 -LA1BEA,JO29XB,,,,,,1991 -LA1K,JP53EK,EME,,OP: LA8UGA Asgeir,,144: 2x4CX250b MGF1402 preamp 4x17el1000lp,01/95 -LA1KHA,JO49SE,,,kjell,,,1993 -LA1TV,JO49TQ,,,,,,01/04 -LA2AB,JO59FV,EME,,Clubstation,,,07/02 -LA2PHA,JO38IB,,,"Stein",,144: 100W 10el,07/02 -LA2RZ,JP20ON,,,Dave,,144: 160W 17el,05/02 -LA2YMA,JP32LK,,,,,144: 40W 9el,02/04 -LA3BO,JO59CD,,,Svein,,,04/04 -LA3EU,JP32BG,,,per,,,1993 -LA3WU,JP20QH,EME,,ingebrigt,,,1993 -LA4DL,JP32EL,,,,,,03/04 -LA4XGA,JP33VC,,,Geir,,144: 17el 1000W or 150W117 DTR 3000lpm,11/04 -LA4YGA,JO48AE,,,Jerzy,,IC821 144: 150W 9el - 432: 2x17el 100WDTR,12/04 -LA5IH,JP20NK,,,,,,1993 -LA5KJA,JP50IV,,,Kjell,,.070,01/98 -LA5KO,JO59FH,,,Roy,,144: 300W 17el MGF1302165 1500lpm165,12/04 -LA5PH,JO49XA,,,,,,1992 -LA5SAA,JO29SE,,,michael,,.144,1993 -LA5TFA,JP99LQ,,,Aasmund ""Birger",,IC751-IC706-FT736r-FT225rd - 50: 2x5el HL166,02/02 -LA6CU,JP20QL,,,Per,,144: TS790e 150W 16el MGF1302.145 DTR 150,09/99 -LA6HL,JO28TW,EME,,Johannes,,,01/02 -LA6I,JP41,,,,,,1993 -LA6K,JP33VC,,,Clubstation,,,05/03 -LA6LU,JO28,,,,,DTR,07/96 -LA6MV,JO59FJ,,,Helge,,,08/02 -LA6QBA,JP61BJ,,,Frans,,50: 100W 2x5el - 144: 600W 4x11el1500lpm,07/04 -LA6VBA,JO48,EME,,tarald,,,1993 -LA7DFA,JP53,EME,,Per-Einar,,111 DTR,10/03 -LA7KK,JP50,EME,,p.,,,1993 -LA8AE,JO59CC,EME,,ote,,,1994 -LA8AJA,JP50HQ,,,Andreas,,only SSB-MS,01/99 -LA8AK,JO38XC,,,Jan Martin,,144: 200W 2x9el BFT66DTR,08/00 -LA8G,JP53EJ,,,,,,01/05 -LA8GKA,JO59FS,,,Rune,,,12/03 -LA8KV,JP52QQ,EME,,Kjetil,,DTR,03/04 -LA8LF,JO59BR,EME,,Anders,,,01/05 -LA8OW,JP50NC,,,Arvid,,3000lpm,05/02 -LA9BM,JP40CM,,,l.,,,03/98 -LA9DL,JO59KE,EME,,,,,04/04 -LA9IY,JP53,,,,,,2003 -LA9NEA,JO59DX,EME,,Viggo Magnus,,144: 4x 19el K1FO 1-5KW,02/05 -LB7FA,JO59CR,,,,,,08/04 -LC1OCT,JP32,,,,,,06/03 -LC1PAT,JP78,,,,,,2003 -LU4HO,FF78RA,,,,,,2003 -LU6DW,GF05SF,EME,,,,,2003 -LU6KK,FG73ie,EME,, -LU7DZ,FF78RA,EME,,Eduardo van,,144: 1KW 4xDJ9BV,04/00 -LU8EDR,GF05TF,EME,,Dany,,,11/02 -LU9AWH,GM04SO,,,Edgardo,,,2003 -LX1DB,JN29,,,Willy,,,07/99 -LX1GR,JN39,,,gilbert,,,1993 -LX2DX,JN29WO,,,Jean,,,10/02 -LX2SM,JN39,,,,,,07/04 -LY2AAM,KO06VB,EME,,,,183383,05/03 -LY2BAW,KO25KA,,,Tadas,,FT-736R+home made PA - 144: 24el 2M8WL M2 - 4,05/03 -LY2BIL,KO24PQ,,,Rytis,,144: FT736r 30el 1KW188 DTR 3000lpm188,08/02 -LY2BUU,KO15XH,,,,,,04/04 -LY2BW,KO24,,,Algis,,,1/95 -LY2CI,KO14WV,,,Raimundas ""Ray",,TS-790A- 144: 150W 11el - 432: 25el yagi - 1,08/03 -LY2FE,KO05NQ,,,Vytas,,144: FT736r 300W 13elMSDSP,10/02 -LY2FR,KO15VR,,,Paulius,,,07/04 -LY2GC,KO25KA,EME,,Giedrius,,,10/04 -LY2MW,KO24PS,,,Remigijus (Remi),,IC746 + PAs 50: 100W 6el - 144: 100Watt 1,08/04 -LY2SA,KO14LL,,,Vidas,,144: IC821H 300W 16el MGF1502 - 432: 175W,01/04 -LY2WR,KO24OQ,,,Clubstation,,144: FT736r 11el 600W - 432: 800W 24el - 1,01/00 -LY3BF,KO24OR,,,Arvydas,,,01/96 -LY3GM,KO14LL,,,,,,12/97 -LY8X,KO24PQ,,,OP LY2MW,,,08/99 -LZ1AG,KN22ID,EME,,Angel,,144: 14el 100W,12/99 -LZ1BB,KN12SS,,,Harry,,,08/04 -LZ1DP,KN22TR,EME,,Christo,,144: 4x5 WL DJ9BV cross+MGF1302 FT-736R PA 1,01/05 -LZ1DX,KN22,,,net,,,1993 -LZ1JH,KN32FR,,,Ruben,,,06/99 -LZ1KDP,KN12SP,EME,,OP LZ2HM,,.172 1200lpm,01/98 -LZ1KDZ,KN32,EME,,radio,,,1993 -LZ1KG,KN31CS,,,Dimitar,,50: 4el transv. 10W - 144: 2x16 F9FT IC275e,09/03 -LZ1KJ,KN31CS,,,Ivan,,50: FT987 4el 15W - 144: FT987 250W 2x8el G,09/03 -LZ1KQ,KN22TK,,,Veso (OP LZ1KWT),,,12/96 -LZ1KRB,KN32,,,radio,,,1993 -LZ1KSN,KN32SL,,,,,,1993 -LZ1KSW,KN31CS,,,Clubstation,,,12/95 -LZ1KU,KN32,,,s.,,,1993 -LZ1KWT,KN22TK,,,Clubstation,,144: FT736 1KW 2x16el F9FT GaAsFet 3SK129r,11/03 -LZ1NO,KN12,,,,,,12/01 -LZ1QI,KN12,,,Bebko,,,11/01 -LZ1QM,KN12,,,s.,,,1993 -LZ1R,KN42AA,,,,,,1993 -LZ1UB,KN22TK,,,,,,1994 -LZ1UK,KN22ID,,,Savko ""Savi",,144: 60W 8el Quagi,11/03 -LZ1V,KN12QQ,,,,,,1990 -LZ1ZP,KN22ID,,,George,,144: 150W 14el DJ9BV1000lpm,05/03 -LZ1ZX,KN32IO,,,mitko,,,12/99 -LZ2AR,KN13SF,EME,,boris,,,1994 -LZ2FO,KN13KX,,,Shecko,,144: 500W 15el 9BV.138 2000lpm,07/04 -LZ2FR,KN13IU,,,,,,12/98 -LZ2HM,KN12QP,EME,,Andre ""Andy",,144: FT847 17el yagi172 1200lpm,07/03 -LZ2HV,KN23UB,,,Christo,,144: 600W 12el Quad.145 2000lpm,12/98 -LZ2JF,KN23,,,n.,,,1993 -LZ2KRU,KN33FL,,,Clubstation,,144: 500W 17el.191 1000lpm,08/97 -LZ2KZ,KN33FC,,,Zlatko,,144: 15el 100W,12/01 -LZ2PP,KN33,,,v.,,,1993 -LZ2US,KN13RJ,EME,,"Marko"" Nikolov,,144: 4x KLM17LBX 2x 4CX800A 2KW FSC11LF.,08/00 -LZ2UU,KN12QP,,,Jordan (Dany),,.172 1200,08/96 -LZ3BD,KN12QQ,,,Bogdan,,432: 250W 32el GaasFet2000lpm.325,12/99 -LZ3CQ,KN12PQ,,,,,,01/03 -LZ3GM,KN32RL,,,Ivan,,144: IC735 20W 13elBVO MGF1302.148.300,05/03 -LZ3YH,KN22,,,Dora,,,12/95 -LZ5GM,KN32QL,,,Iilian,,144: IC-720 50W 13eleFT MGF1302292,04/03 -LZ5N,KN21JX,,,,,,1995 -LZ5UV,KN12PR,,,Evengi,,144: FT847 IC271 4cx250 PA 17el DJ9BV.174,11/02 -LZ5Z,KN12PR,,,LZ1JK- LZ2HM- LZ5UV,,144: 2x15el 1KW,12/99 -LZ6T,KN22IS,,,,,,12/99 -LZ7A,KN43HL,,,,,,1994 -LZ7P,KN22,,,,,,12/96 -LZ7Y,KN41AX,,,OP LZ3GM,,DTR,08/99 -LZ9M,KN32RL,,,OP: LZ3GM,,,12/03 -LZ9W,KN12MO,,,LZ Contest Team,,IC-746 FT-847,01/05 -M0BPQ,IO91WP,,,Steve,,50: 400W 7el 144: 2x5el 400W 432: 2x21el,11/04 -M0CQZ,IN69UW,,,Ops DH5FS- DH0LS...,,.188,09/00 -M0CTP,IO93,,,,,,03/02 -M0EME,IO93GF,EME,,Paul,,FT847 4x FO20 100W,01/05 -M0VHF,IO82VF,,,Mike,,FT847 JST245 3CX800 8877 - 50: 5el - 144:,10/02 -M1DRK,IO93US,,,Andy,,50: TS60 5el 90W130-150,01/02 -M1GSM,IO94BU,,,Stuart,,144: 150W 8elMSDSP,08/03 -M5FUN,JO00DX,,,Jonathan ""Jono",,144: TR751E 100W 12el225 only SSB-MS310,03/04 -M5MUF,IO92JP,,,Mike,,IC202 IC706 various transverters,09/03 -MI0AYR,IO64VQ,,,Paul,,144: TR9130 150W 19el,02/04 -MM0BQI,IO85KX,,,Jim,,50: 100W 5el - 144: 13el.045.345,03/00 -MM0CCC,IO85MW,,,John,,144: FT1000MP TVVF144A 17el 100W,05/04 -MM0CEZ,IO75XU,,,Peter,,IC910 IC775DSP Transverter,03/04 -MM0DQP,IO88KI,,,Erik,,100W,05/04 -MM0KOS,IO85CR,,,Chris,,ICOM 290D MK2,05/04 -MM1BXF,IO76PA,,,,,,01/03 -MM5AJW,IO88KI,,,Don,,,09/04 -MM5DWW,IO89ID,,,David,,KENWOOD TR751/TS690 100W 11el,04/04 -MS0FNR,IO88KK,,,Erik,,,12/04 -N0AB,EM28,,,,,,2003 -N0AE,EN51,,,,,,2003 -N0AJU,EN11,,,,,,2003 -N0AKC,EN44GU,,,Charles,,144: 1-2KW 17el - 222: 350W 16el,01/01 -N0ATV,EN34JX,,,,,,2003 -N0BTN,EN21,,,,,,2003 -N0CIH,EN42,,,,,,2003 -N0CKK,EN34,,,,,,2003 -N0DAG,EM29QF,,,,,,2003 -N0DQS,EN22GD,,,Gene,,,07/01 -N0DY,EN42FA,,,,,,2003 -N0EC,DN70LF,,,Ron,,50: 1KW - 144: 1-5KW - 222: 120W - 432: 1KW -,01/01 -N0ECI,EM37,,,,,,2003 -N0EKT,EN21,,,,,,2003 -N0EOQ,EM24,,,,,,2003 -N0FFO,EM17,,,,,,2003 -N0FQW,EM39,,,,,,2003 -N0GPH,EM48,,,,,,2003 -N0GXA,EN13QH,,,Kevin,,144: 1KW preamp 18el,1998 -N0GXN,EM48,,,,,,2003 -N0HJZ,EN34FV,,,Rich,,144: TS700S 200W preamp 12el,01/01 -N0HKT,EM17,,,,,,2003 -N0HZ,EN34,,,,,,2003 -N0ICV,EN52XA,,,TONY,,,2004 -N0IDT,EN10,,,,,,2003 -N0IS,EM48,,,,,,2003 -N0IT,EM48RN,,,Dave,,144: 170W,01/01 -N0JCF,EN35,,,,,,2003 -N0JEQ,EM27,,,,,,2003 -N0JK,EM17,,,,,,2003 -N0KE,DM69,,,,,,2003 -N0KEV,EM17,,,,,,2003 -N0KIS,EN10QT,,,,,,2003 -N0KM,DM67VR,,,Dave,,,01/97 -N0KN,EM28,,,,,,2003 -N0KQY,DM98GK,EME,,Gary,,144: 15/19dbd antenna 1KW,02/01 -N0LIK,EM48,,,,,,2003 -N0LL,EM09,,,Larry,,,01/01 -N0LNO,EN42,,,,,,2003 -N0LRJ,DM78,,,,,,2003 -N0NAS,EN35,,,,,,2003 -N0NEG,EM29,,,,,,2003 -N0NHS,DN70LF,,,,,,2003 -N0OIB,EN35,,,,,,2003 -N0OYQ,EN25,,,,,,2003 -N0PB,EM39WO,,,Phil,,,11/01 -N0PJU,EN41,,,,,,2003 -N0POH,DM79OP,,,Wayne,,,01/01 -N0QBF,EM48SR,,,,,,2003 -N0REN,EN34,,,,,,2003 -N0RHL,EN10RT,,,,,,2003 -N0SBU,EN35,,,,,,2003 -N0SHR,EN26,,,,,,2003 -N0SRQ,EN18,,,,,,2003 -N0SWV,DM79,,,Jesse J.,,144: 170W 2x16el - 432: 35W 2x18el - 1296: 60,05/98 -N0TOU,EM29,,,,,,2003 -N0UGY,DM79,,,,,,2003 -N0UK,EN34JV,,,Chris,,50: 10W KLM661 - 144: TS930/DEM Tvtr 300W K1F,07/01 -N0US,EN10,,,,,,2003 -N0UU,EM18,,,,,,2003 -N0VSB,DM79RJ,,,Brian,,50: 1KW 7el - 144: 1.5KW 18el MGF- 222: 200W,01/02 -N0WJY,EN10QT,,,,,,2003 -N0WVU,DM79HV,,,,,,2003 -N0WX,EN34,,,,,,2003 -N0XKS,EM29,,,,,,2003 -N0XPI,EM29,,,,,,2003 -N0YGM,DM78OV,,,,,,2003 -N0YNP,DN81CW,,,,,,2003 -N0ZEB,DM79,,,,,,2003 -N0ZKK,EM29,,,,,,2003 -N1BUG,FN55MF,EME,,Paul,,50: 400W 5el 144: 1500W 20el Yagi 222: 500W,11/04 -N1CPE,FN42QH,,,,,,2003 -N1EKV,FN42JK,,,,,,2003 -N1GMV,FM05TU,,,John,,,2004 -N1GOD,FN41VQ,,,Lou,,,2003 -N1KTM,FN41SR,,,Clint,,144: 1kw- 2x2M9,01/97 -N1LDY,FN41JR,,,Tony,,IC-746 IC-910 DEMI-222 DEMI-903,01/04 -N1NCO,FN42GL,,,John,,,2003 -N1RWY,FN54NO,,,Jason,,50: 100W 3el CC - 144: 800W 18el - 222: 350W,01/01 -N1RZ,FN44EI,,,Tim,,.090,07/01 -N1SZ,DM79NP,,,James,,,2003 -N1VQR,FN42JJ,,,,,,2003 -N2CEI,FN20,,,,,,2003 -N2FKF,FN30BR,,,Bill,,,2004 -N2HLT,FN12LN,EME,,,,,2003 -N2IQ,FN13TD,EME,,,,,2003 -N2IQU,FN13,,,,,,2003 -N2JMH,FN13AF,,,James,,,2003 -N2JQR,FN13,,,Jeff,,50: 500W 5el,01/01 -N2JR,FM18CP,,,Richard,,50: 100W 5el,09/01 -N2KW,FN03XE,,,,,,2003 -N2MB,FN30CO,,,Barry,,,2003 -N2MCY,FN30AR,,,Ray,,,2003 -N2MKT,FN13LK,,,Jeff,,,2003 -N2MSS,FN31AA,,,,,,2003 -N2NEP,FN13EB,,,,,,2003 -N2NZI,FN32,,,,,,2003 -N2OLA,FN12MM,,,,,,2003 -N2OTO,FN30CR,,,Rupert,,144: TS850 LT2SMKII 200W 4el,01/01 -N2PC,DM78QX,,,,,,2003 -N2UO,FN20QF,EME,,,,,2003 -N2VR,FN12SK,EME,,Mike,,144: 4x13B2,08/01 -N2WK,FN03XE,EME,,Wayne F.,,144: 1-5kw 4x2.2 wl full elv. MGF1302.111,10/00 -N2WLS,FN02RQ,,,,,,2003 -N2XK,FN20RF,,,Fred,,,2003 -N3AHF,FN20SF,,,,,,2003 -N3AJX,EN71KC,,,,,,2003 -N3FA,FN21,EME,,Bob,,144: LT2S 8877 700W 4x12el M2 - 432: FT736 SP,10/99 -N3FZ,EN90xh,EME,, -N3JNP,EN91,,,,,,2003 -N3KKM,EM28,,,,,,2003 -N3OPM,FM19PH,,,Daniel F.,,,01/01 -N3RN,FN11WH,,,Bob,,144: 500W 16el KLM,07/01 -N3WT,FM19EJ,,,John,,,2004 -N3WXW,FN20CE,,,,,,2003 -N3XI,EN90XJ,,,Frank,,,2003 -N3YGA,FN20BI,,,Craig,,50: 160W 4el - 144: 170W 14el,1998 -N4CAG,EM86PI,,,,,,2003 -N4EQT,EM77,,,,,,2003 -N4FRE,EL06LL,,,,,,2003 -N4GJV,EM95PS,EME,,,,,89 -N4GKO,EM65LO,,,Bryn,,144: FT736r 350W 2M18XXX,01/01 -N4HY,FN20RG,,,Bob,,,2004 -N4IP,EM73WV,,,,,,2003 -N4IPB,EM66,,,,,,2003 -N4IS,EL96UB,,,Jose,,FT1000MP+Trsv 144: 350W 18el M2.120.200,06/01 -N4KWX,FM08WF,,,Ray,,,01/97 -N4KZ,EM77GT,,,Dave,,,09/01 -N4LXB,EM83VL,,,Paul,,,2003 -N4MW,FM17KN,EME,,,,,2003 -N4OYS,EM65,,,,,,2003 -N4PZ,EN52,EME,,,,,04/97 -N4SC,EN72,,,Roman,,,11/04 -N4TWX,EL89TW,,,Terry,,50: 5el 75W - 144: 15el 150W Preamp,01/01 -N4UK,EM84XP,EME,,Ken,,144: 1KW 13/13el - 222: 750W 23elM2 - 432: 75,01/97 -N4WI,FM14IL,,,Fred,,,2004 -N4XD,FM05,,,,,144: TS700SP 160W,01/01 -N4ZKR,EM65,,,,,,2003 -N4ZRW,EM17KN,,,,,,2003 -N5AF,EM20,,,,,,2003 -N5AHD,EL17,,,,,,2003 -N5AMA,EL29,,,,,,2003 -N5ARS,EM26,,,,,,2003 -N5AXJ,EM86,,,,,,2003 -N5BA,EL29FX,,,Brian,,144: 1500W 4x5wl,08/03 -N5BHO,EM31,,,,,,2003 -N5BHX,EL09,,,,,,2003 -N5BHZ,EM22,,,,,,2003 -N5BLZ,EL29EW,EME,,Ed,,144: 4 X 28 XPOL 8877,11/02 -N5DL,EM36,,,,,,2003 -N5EM,EL29,,,,,,2003 -N5FV,EM03,,,,,,2003 -N5HHS,EL29,,,,,,2003 -N5IS,DM96,,,,,,2003 -N5JM,EL49,,,,,,2003 -N5KDA,EM41HM,,,Gary,,,09/01 -N5KWB,EM32QB,,,,,,2003 -N5MP,EM12,,,,,,2003 -N5MWS,EM13,,,,,,2003 -N5MYH,EM32,,,,,,2003 -N5NDV,EM15,,,,,,2003 -N5NSH,EM14,,,,,,2003 -N5OCP,EM15,,,,,,2003 -N5OSK,EM25FI,,,Jerry,,,10/02 -N5QGH,EM13QC,,,,,,2003 -N5QS,EM45,,,,,,2003 -N5QT,EM45,,,,,,2003 -N5RZ,DM81XW,,,,,,2003 -N5SAL,EM28,,,,,,2003 -N5SIX,EM42XI,EME,,Bruce,,,02/05 -N5TML,EM14,,,,,,2003 -N5TQB,EM31PJ,,,,,,2003 -N5TX,EL09,,,,,,2003 -N5WS,EL09RU,,,W. Russ,,,01/01 -N5XCX,EL09,,,,,,2003 -N5XU,EM10DG,,,Kenneth,,,01/01 -N5YLS,EM54,,,,,,2003 -N5YSM,EM15,,,,,,2003 -N5ZLU,DM95,,,,,,2003 -N5ZWO,EM32,,,,,,2003 -N6CL,EM26,,,,,,2003 -N6CV,DM04UF,,,,,,2003 -N6DHN,CM98,,,Frank,,50: 150W 4el - 144: 150W 22el - 432: 100W,1998 -N6ENU,DM04,,,John L.,,144: 270W 13el Yagi - 50: 100W 7el,01/01 -N6HV,DM04,,,,,,2003 -N6KBX,CM98,,,Don,,50: 400W 2x5el - 144: 350W 4x17el - 432: 17,01/97 -N6KMR,CM97MO,,,Jim,,,2003 -N6NB,DM05,,,,,,2003 -N6OVP,CM87,EME,,,,,2003 -N6PYI,DM05KJ,,,,,,2003 -N6RA,CM87SR,,,Thomas,,,2003 -N6RJM,DM14CP,,,Pat,,50: 1KW 9el - 144: 1-5KW 4x18el - 222: 350W,01/01 -N6RMJ,DM14CP,,,,,,2003 -N6RPM,DM04UA,,,,,,2003 -N6RZ,CM87WB,,,Dave,,144: 1KW 17B2,01/01 -N6SPP,CM87WQ,,,,,,2003 -N6TQS,CM87UU,,,,,,2003 -N6TX,FN11LH,EME,,,,,2003 -N6VHF,DM13,,,Neil,,,01/01 -N6YM,CM88XF,,,Ed,,,01/01 -N6ZE,DM04NE,EME,,Peter S. ""Pete",,IC756 PRO II 50: 100W 5el - 144: 8930Amp 2M5,08/03 -N7AM,CN87QN,EME,,,,,89 -N7AMA,DM33,,,,,,2003 -N7ART,CN87,EME,,,,,89 -N7AVK,CN84,,,,,,2003 -N7BSN,CN87QQ,,,,,,2003 -N7CZ,DN47HM,,,Bob,,FT736 IC706,01/02 -N7DMA,DM42NL,,,Karl,,,2003 -N7EMD,DM26JE,,,,,,2003 -N7EY,CN96QO,,,Sean,,,2003 -N7IJ,DN44GB,,,,,,2003 -N7LQ,DN01FA,EME,,Shawn,,432: 1.5KW 4 x FO-25's,06/00 -N7MWV,CN87VQ,,,John,,144: 250W CC3219only SSB-MS,01/01 -N7QJP,DM33VM,,,Stu,,,1998 -N7SKT,DM33SN,,,Bob,,,01/01 -N7WNX,CN83OW,EME,,,,,12/04 -N7WS,DM42JH,,,Wes,,144: 8877 17el GaAs,01/01 -N7YAG,CN85,,,Arnold,,144: FT736r 300W 11el KLM,1998 -N7YAP,DN07HJ,,,Gregory E.,,.125,08/01 -N8AIA,EN82KL,,,,,,2003 -N8ASB,EM89,,,,,,2003 -N8AXA,EM79UP,EME,,,,,2003 -N8BSG,EN82,,,,,,2003 -N8BXP,EN81,,,,,,2003 -N8CGY,EN74OH,,,Ken,,,01/01 -N8CQ,FM05OT,EME,,,,,2004 -N8DJB,EN81FJ,EME,,,,,2003 -N8ITP,EN81XF,,,,,,2003 -N8JMK,EN90,,,,,,2003 -N8KWX,EN62AD,,,,,,2003 -N8LCU,EN72,,,,,,2003 -N8NPX,EM79XR,,,,,,2003 -N8OC,EN83AO,EME,,Dave,,50: 100Watts 6ele KMA - 144: 1500Watts 17ele,08/03 -N8PUM,EN66DL,,,Branton T.,,144: 200W 2x17B2,1998 -N8PVT,EN64,,,,,,2003 -N8QOD,EN79,,,,,,2003 -N8TDL,EN90BN,,,Greg,,,2003 -N8VES,EM79VT,,,,,,2003 -N8ZAT,EM79,EME,,,,,2000 -N8ZAW,EM79,,,,,,2003 -N8ZM,EM79,,,,,,2003 -N9AB,EN52XG,EME,,,,,01/05 -N9AQ,EN51,,,,,,2003 -N9AU,EN62BX,,,,,,2003 -N9AZC,EM68,,,,,,2003 -N9AZZ,EM57MV,,,,,,2003 -N9BD,EM28,,,,,,2003 -N9BJG,EM57,,,,,,2003 -N9BMH,EN62,,,,,,2003 -N9CIQ,EN44,,,Jay,,,01/01 -N9DCA,EN71GG,,,,,,2003 -N9DG,EN53BJ,,,,,,2003 -N9EGT,EN70,EME,,,,,02/05 -N9EMC,EN52UI,,,,,,2003 -N9ESH,EN52XB,,,,,,2003 -N9FH,EN63,,,,,,2003 -N9FTC,EL79EQ,,,,,,2003 -N9GVF,EN62,,,,,,2003 -N9HF,EN52,,,,,,2003 -N9IJ,EN52XI,,,Leonard,,,2003 -N9JIM,CM87XI,,,Jim,,50: 9el 150W - 144: 16el 700W - 432: 21el 50W,11/03 -N9KC,EN52,EME,,,,,2003 -N9LAG,EM57,,,,,,2003 -N9LHD,EN62BA,,,,,,2003 -N9LR,EN50DU,EME,,Larry,,,02/05 -N9MEH,EN44,,,,,,2003 -N9MSG,EN50ES,,,John,,,2003 -N9MYK,EN-53W,,,,,,2003 -N9NHC,EN61DU,,,,,,2003 -N9NJY,EM58AM,,,,,,2003 -N9NOQ,EN51,,,,,,2003 -N9OO,EN62,,,,,,2003 -N9PXI,EN61CU,,,,,,2003 -N9RLA,EM78CQ,,,,,,2003 -N9ROX,EN54,,,,,,2003 -N9SBV,EN61UQ,,,,,,2003 -N9TZL,EN52SH,,,,,,2003 -N9UDO,EN53DL,,,,,,2003 -N9UUR,EN63,,,,,,2003 -N9VSV,EN63,,,,,,2003 -N9WWR,EN62CS,,,John,,,2003 -N9XG,EN60WL,EME,,,,144: 4x 17el 1KW,01/05 -N9XIX,EN53,,,,,,2003 -N9YKE,EN62,,,,,,2003 -NA0IA,EN42FB,,,,,,2003 -NA3T,FM05LW,EME,,Joe,,,10/97 -NA4AL,EM63OF,,,Bryan,,IC746 FT817,08/01 -NA4M,EM10DP,,,Phil,,,2003 -NA4N,FM18,EME,,,,,2003 -NA6E,CN82,EME,,,,,2003 -NA7D,DM43AS,,,,,,2003 -NB2V,FN30,,,,,,2003 -NC1I,FN32OB,EME,,,,,01/05 -NC1T,FN32,,,,,,2003 -ND2X,EL09,,,,,,2003 -NE0P,EM04,,,John,,,09/01 -NE1H,EM84AC,,,,,,2003 -NE7O,FN53HX,,,chet,,,2005 -NE8I,EN82JM,,,,,,06/04 -NF0Q,EM48,,,,,,2003 -NF5B,EL29,,,,,,2003 -NF7P,DM09GH,EME,,,,,2003 -NG9R,EN40LA,,,,,,2003 -NI4Z,EL98HJ,,,,,,2003 -NI6G,DM06,,,,,,2003 -NJ0C,DM78,,,,,,2003 -NJ0U,EN71IB,EME,,,,2x 17el 500W,01/05 -NJ0X,EM29,,,,,,2003 -NJ2L,FN13,,,,,,2003 -NJ7A,DN30XP,,,Dave,,144: 170W 16LBX Preamp - 222: 120W 5wL,01/01 -NK5F,DM65,,,,,,2003 -NK7J,DM33,,,Bob,,,01/01 -NK8Q,FN20KL,,,Mark,,144: 170W 13el - 50: 7W 5el,01/01 -NL7F,BP64DV,EME,,,,,2003 -NL7Z,BP51EN,EME,,Kevin,,FT920,02/05 -NM1A,EL96VF,,,,,,2003 -NM5BB,DM65UV,,,,,,2003 -NM5X,EM26,,,,,,2003 -NM9H,EM59CD,,,,,,2003 -NN5DX,DM80NV,,,,,,2003 -NN6RF,CM87UW,,,,,,2003 -NN7J,CN85,,,Dan,,,01/05 -NN9K,EN41,,,Pete,,,1998 -NP4B,FK67,EME,,,,,2003 -NQ2O,FN13,EME,,WALTER G ""Wastl",,,05/01 -NR5A,DN84LC,,,,,,2003 -NR6E,CM88,,,,,,2003 -NS4W,EM76VC,,,Bert,,500: 1KW - 144: 1kw 2.5wl - 222: 400W - 432:,01/01 -NS7K,DN31XC,,,Richard,,,2004 -NS7N,CN87,,,,,,2003 -NT0V,EN08OC,,,,,,2003 -NT0Z,FN31,,,,,,2003 -NT4P,EM95KF,,,Scott,,,2004 -NU5O,EM55,,,,,,2003 -NU7Z,CN87RT,,,,,,1993 -NU8I,DM43AN,,,Alf,,144: IC706 1KW,01/99 -NV3Z,FM15,,,,,,2003 -NW0X,EM40,,,,,,2003 -NW7O,DM26,,,,,,2003 -NX2Q,FN20WV,,,Al,,,2003 -NX7U,DM43DI,,,,,,2003 -NX8M,EM79PE,,,Bob,,,01/01 -NY1E,FN43QP,,,,,,2003 -NZ5P,DM95,,,,,,2003 -OD5NJ,KM73TW,,,,,,2003 -OD5RAK,KM74WH,,,Clubstation,,50: 6el - 144: 17el+ PADTR,05/98 -OE1MSB,JN88DF,,,Michael,,,10/03 -OE1SOW,JN88FF,EME,,Othmar,,HF:100/600W 4el FD4 vertical- 50: 100W 5el -,09/03 -OE1XVC,JN88ED,,,OP OE3KLU,,144: 2x11el- 432: 2x21el gd Pwr.145.370,03/98 -OE3CEW,JN88,,,e.,,,1988 -OE3FVU,JN78VE,EME,,Franz,,144: 2x14el 5WL 1KW MGF1302 - 432 MHz 1x13W,09/03 -OE3HHB,JN87AQ,,,Harald,,FT847 50: 100W 5el - 144: 50W 17el GaAs - 432,07/99 -OE3JPC,JN87EW,EME,,Johannes,,144: 200W 2x15el CF300 - 432: 500W 4x24el (,08/02 -OE3JTB,JN78QN,,,,,144: 15el,03/04 -OE3MWS,JN88DC,,,Manfred (Fred),,50: 100W 7el - 144: TR751 1-2KW 2x17el MGF1,01/05 -OE3NFC,JN88,,,n.,,,1993 -OE3OBC,JN88,EME,,othmar,,,1994 -OE3OKS,JN87AR,,,Wolfgang,,,12/98 -OE3R,JN88FD,,,via OE3KLU,,.180.320,01/96 -OE3SJA,JN88GH,,,Johan,,,04/04 -OE3UP,JN87CT,EME,,hans peter,,,1993 -OE3XAC,JN88FD,,,via OE3KLU,,.180.320,11/96 -OE3XMU,JN78XD,,,Clubstation,,144: 150W 15el,06/02 -OE4KLU,JN87KS,,,Karl,,,01/96 -OE5EFM,JN78,EME,,wolfgang,,,1994 -OE5EYM,JN68SK,EME,,,,,08/98 -OE5FD,JN68SC,,,,,,2003 -OE5FDM,JN68SC,,,Daniel,,50: FT-847 5el-Yagi 100W - 144: FT-847 9el 10,08/02 -OE5JFL,JN68RL,EME,,hannes,,,1994 -OE5KE,JN78,,,Adolf,,,05/02 -OE5MPL,JN78CJ,EME,,Peter,,FT-847 - 50: 2xGI7BT 100W 5el 144: 2x,01/05 -OE5VHL,JN68SI,EME,,walter,,,1994 -OE5VRL,JN78DK,,,,,,01/97 -OE6AHD,JN76RS,,,Freddy,,,12/95 -OE6BMG,JN77JE,,,Manfred,,,07/00 -OE6IWG,JN77PK,EME,,A.Walter ""Walt",,144: GS35b 4x10el (2-2wl) MGF1302087 4000 D,01/05 -OE6JGD,JN77QC,,,Josef,,,12/95 -OE6KDG,JN77JF,,,,,,03/07 -OE6NLD,JN76SS,,,norbert,,,1993 -OE6XHF,JN76RS,EME,,clubstation,,,1994 -OE75SOW,JN88FF,EME,,Othmar,,50: IC736 100W 5el - 144: IC821H 300W 2x13el,03/01 -OE8CIQ,JN76FU,,,,,,08/02 -OE8HBQ,JN76KP,,,Harry,,,05/04 -OE8HWQ,JN76,,,helmut,,,03/00 -OE8OLK,JN76DM,,,Schoash,,144: FT817 30W 6el,07/04 -OE9ERC,JN47VL,EME,,Erich,,,02/05 -OE9HHV,JN47,EME,,hubert,,,1994 -OE9XXI,JN47UL,,,,,,2003 -OF8UV,KP34VJ,EME,,Markku,,144: Ft225RD 130W 2x14el BF981.122 DTR,11/97 -OG6MAZ,KP21IG,,,Hannu,,144: FT767GX 4CX350 200W 15el.147 DTR,01/00 -OG8HDL,KP34VJ,,,Tanja,,144: 130W 2x14el BF981.121.300,01/00 -OG8UV,KP34VJ,EME,,Markku,,144: FT225RD 130W 2x14el BF981.121 DTR.30,01/00 -OH0BT,KO09KW,,,,,,1992 -OH0JFB,JP90XI,,,Peter,,144: 2x17el 800W,04/04 -OH0LIZ,KO09KW,,,OP OH5YW- OH5LIZ,,144: 180W 2x23el.127 1500lpm DTR,05/98 -OH0N,KP00,,,OP: DK5DQ DJ2QV...,,,07/01 -OH0V,KP00,,,OP: DK5DQ DJ2QV...,,,07/01 -OH1AK,KP01TE,,,OP: OH1HJN,,,12/03 -OH1AYQ,KP12JB,,,,,,08/98 -OH1BAP,KP12AA,,,,,,1991 -OH1CF,KP00TC,,,,,,1994 -OH1FA,KP10PL,EME,,Kai,,,10/02 -OH1HSC,KP10CM,,,Olavi,,144: TR9130 60W MGF1302 17elonly SSB MS,01/01 -OH1JCS,KP10AE,EME,,Jojje,,144: 15el 20W,01/05 -OH1JJC,KP10DK,,,Matti,,,01/04 -OH1LEU,KP01UE,,,Tuomo,,50: 150W 8el,09/03 -OH1LSQ,KP03SD,,,Paul,,144: 100W ant-3WL,01/02 -OH1MDR,KP01VJ,,,Timo,,144: IC-706 100W 15el,01/04 -OH1QC,KP10MU,,,,,,1989 -OH1XT,KP01UK,,,Jari,,FT736r 50: 8el 150W - 144: 300W 2x15el MG,11/01 -OH1XTK,KP01UK,,,,,,2003 -OH1ZAA,KP01,,,jan,,,1995 -OH2AUK,KO19TX,,,jan anders,,,1994 -OH2AV,KP20JD,,,yussi,,,1994 -OH2AXH,KP20OK,EME,,OP: OH2AUE,,,08/00 -OH2BAP,KP20PP,EME,,jyrki,,.138,1993 -OH2BNH,KP20LG,EME,,Pasi,,,05/00 -OH2BYJ,KP20MG,,,Jari,,144: IC821h 4x15el3000lpm,07/00 -OH2DG,KP30CK,EME,,eino,,,1994 -OH2JRR,KP10WE,,,,,,10/03 -OH2KKP,KP20MH,,,Tuomas,,,11/95 -OH2LAK,KP10XL,,,Erik,,50: FT847 FT817.130,11/01 -OH2MFE,KP20JE,,,Markus,,IC-575H IC-275E 170W FT-817 100W FT-73,04/02 -OH2MOH,KP30CR,,,,,,05/04 -OH2MPH,KP20KD,,,Antti,,,01/04 -OH2NHP,KP20IF,,,Timo,,144: IC970E 3CX800 MGF1302 preamp 2x15elrx,01/01 -OH2NY,KP20CM,,,Juha,,144: IC202 RE035XB 320W Preamp 4x9el,04/03 -OH2PO,KP10XH,EME,,Matti,,,11/97 -OH2TI,KP20KE,EME,,Clubstation,,,01/01 -OH2Z,KP30CR,,,OP: OH1JJC,,,08/04 -OH3AWW,KP11VJ,EME,,Matti,,144: 150W 9el.137 2000lpm,09/04 -OH3BHL,KP10RR,,,Raimo ""Rami",,IC746+ACOM1000 144: 100W 4x5el - 50: 200W,08/03 -OH3BZY,KP10XP,,,,,,1992 -OH3EX,KP20JR,,,,,,1994 -OH3KLJ,KP21PI,,,Mika,,144: 15el 100WMSDSP,01/04 -OH3KLT,KP21PI,,,,,,12/01 -OH3LPW,KP11WK,EME,,ari,,,1994 -OH3NWQ,KP11WL,,,Vesa,,50: FT847 100W220 2000lpm,08/02 -OH3VJ,KP21,,,,,,1994 -OH3XR,KP11TH,,,Marko,,IC746,08/04 -OH4EA,KP32MG,,,Vesa,,144: FT225RD 4CX250b 2x19el MGF1302/ATF10136M,11/04 -OH4GGW,KP31PQ,,,Kimmo,,,12/04 -OH4HXK,KP21UM,,,Seppo,,,05/02 -OH5A,KP53NE,,,OP OH5LZY,,,09/99 -OH5AG,KP31,,,,,,02/98 -OH5HCJ,KP41EC,,,Matti,,,11/04 -OH5IY,KP30HV,EME,,Ilkka,,144: 1KW 4x15el - 432: 750W 8x21elDTR+ 3000l,12/03 -OH5KJQ,KP41JC,,,Matti,,FT847 144: 19el yagi 160W - 50: 4el 100WDTR,10/98 -OH5LID,KP41KL,,,Janne,,144: IC706 150W 2x19el120 2000 DTR.300,04/02 -OH5LIZ,KP30HW,,,OP OH5YW,,144: 180W- 2x23el.127 DTR,08/01 -OH5LK,KP30ON,EME,,Jussi,,144: 1KW 4x15el,04/04 -OH5YW,KP30FU,,,Kari,,,05/98 -OH6AA,KP03TC,,,Club OP OH6GDX,,144: 2x12el,06/03 -OH6AAO,KP14,,,,,,1993 -OH6AI,KP13MW,,,Clubstation,,only SSB-MS,11/00 -OH6AW,KP03,,,,,3000lpm,06/02 -OH6DD,KP22,EME,,jukka,,,1994 -OH6GDX,KP02QU,,,Patrik,,144: 60W 2x12el CueDee,08/03 -OH6HFX,KP14RA,,,Johannes,,FT847 400W 2x12el172224,02/03 -OH6JKW,KP02RN,,,Kurt,,FT847,01/05 -OH6JW,KP12AJ,EME,,Aulis,,FT847 IC7400 600WMSDSP DTR,09/03 -OH6KTL,KP02OJ,,,Lasse,,50: 6el 150W - 144: FT847+GI46B 4x15el 100WM,12/04 -OH6LRL,KP13,,,,,only SSB-MS,11/00 -OH6M,KP12KR,,,,,,06/04 -OH6MAZ,KP21IG,EME,,Hannu,,144: FT847 4CX350 250W 2x15el MGF1302155 3000,12/04 -OH6MPC,KP12AJ,,,Aulis,,FT847 50: 200W - 144: 2KW - 432: 250W4000lpm,01/02 -OH6MRD,KP12EP,,,,,,12/02 -OH6MSZ,KP21XU,,,,,,08/99 -OH6NDD,KP23VH,,,Taavi,,,1994 -OH6NVQ,KP13IP,EME,,tomas,,,01/97 -OH6PA,KP02PL,,,Ben,,,08/04 -OH6QU,KP03SD,,,Jari,,RX: FT-1000MP DB6NT transverter TR 144 H pre,07/04 -OH6UW,KP22WH,,,,,,01/05 -OH6XX,KP22VE,,,Juha,,144: FT1000MP LT2S 120W 15el MGF1302.147,11/01 -OH6YF,KP02VL,,,Harry,,50: FT-847 PA 7el - 144: FT-847 PA 4x12el300,03/04 -OH6ZZ,KP12BO,EME,,Juho ""Jussi",,TS790E,02/04 -OH7AXB,KP32WM,,,,,,11/02 -OH7EU,KP33MQ,,,Jorma,,,95 -OH7HXH,KP53HG,,,Kari,,144: 50W,04/04 -OH7LIX,KP43JQ,,,Raija,,only SSB-MS,09/95 -OH7MA,KP52EL,,,Dan,,144: 4 x 10el1000lpm,11/99 -OH7PI,KP32XG,EME,,Toivo,,,01/05 -OH7RJ,KP32TV,,,Pena,,,08/02 -OH7TE,KP20IE,,,Juhani ""Yussi",,50: 200W - 144: 4el 300W - 1296: 10W - 5600:,12/04 -OH7TX,KP32TR,,,Jorma,,144: FT847 50W 20el365,04/04 -OH7UV,KP33MQ,,,Markku,,.121 DTR.300,07/95 -OH8GEJ,KP25QC,,,,,,05/02 -OH8HDL,KP34VJ,,,Tanja,,144: 130W 2x14el BF981.121.300,08/99 -OH8K,KP44HE,EME,,Sotkamo Clubstation,,IC7400 gd power 15el 16el 37el loop147 50,05/04 -OH8LRB,KP24HQ,,,Tomi,,144: 200W 8el,11/04 -OH8MFH,KP34UG,,,Kari,,144: TR751A 15el 6WUonly SSB-MS,01/00 -OH8N,KP34VJ,,,OP DH3YAK- 8UV- 8HDL,,,12/98 -OH8NW,KP24SX,,,Kaar,,,1985 -OH8NXE,KP25SB,,,Antti,,144: TM255E Preamp 160W 2x14el,01/02 -OH8SW,KP22UP,,,Hannu,,,11/04 -OH8UV,KP34VJ,EME,,Markku,,144: FT225RD 350W 4CX250R 2x14el BF981121,12/03 -OH8VJ,KP22UN,,,Pentti,,,11/04 -OH9AB,KP46BI,,,Clubstation,,,1994 -OH9AEM,KN08AJ,,,,,,1993 -OH9MNO,KP46BI,,,,,,1991 -OH9MTE,KP46BI,,,Yussi,,,07/99 -OH9MTY,KP46BI,,,Erkki,,FT847 - 144: 700W 6x9el136 3000lpm MSDSP,06/04 -OH9NDD,KP26UM,,,Taavi,,FT847 144: 150W 4x15el preamp,08/03 -OH9NMS,KP36GA,EME,,,,,1994 -OH9O,KP12BO,EME,,Sotkamo Clubstation,,IC7400 gd power 15el 16el 37el loop147 50,05/04 -OH9SCL,KP46BI,EME,,Clubstation,,TR751/FT847 144: 6x9el LY 700W.136,06/01 -OI7UV,KP33MQ,,,Markku,,,12/95 -OI8UV,KP34VJ,EME,,Markku,,144: Ft225RD 130W 2x14el BF981.122 DTR,01/97 -OK1AXH,JO70UR,,,,,,01/97 -OK1CA,JO70GM,EME,,f.,,,1994 -OK1CDJ,JO70VA,,,Ondrej ""Ondra",,144: 250W 17el MGF1302.115 4000lpm.300,01/00 -OK1CT,JN69TR,,,Milos,,144: 250W 2x16el CF300 - 50: 20W 5el.139,05/00 -OK1DCF,JO80BJ,,,Lada,,,04/02 -OK1DDO,JO60JD,,,Jirka ""Jiri",,IC706- 144: 150W 7el- 50: 100W 5el1000lpm,06/02 -OK1DFC,JN79GW,EME,,Zdenek ""Zdeno",,144: 750W 18elM2 10m dish - 432: 750W 38elM2,01/05 -OK1DIG,JO60XJ,EME,,Daniel ""Dan",,144: 4x17el M2 GS35 1.5KW MGF1302177377,04/02 -OK1DKZ,JN69XP,,,Vlada,,144: IC275H 100W MGF1302 11el4000lpm MSDSP,11/01 -OK1DQA,JO60TC,,,,,,08/99 -OK1DRY,JN79OW,,,,,,07/02 -OK1DTC,JO60TO,,,Tony,,,08/03 -OK1DUO,JO80CA,,,Jaroslav ""Jarda",,HF: TS120S 500W 3el - 144: IC746 PA0MS ant,08/01 -OK1FAV,JO60CK,,,,,,01/97 -OK1FF,JN78GR,EME,,,,,1995 -OK1FFD,JO60CF,,,Vasek,,50: 5el QUAD- 144: 350W 10el Quagi,08/02 -OK1FID,JO80CH,,,Jiri,,144: Racom R2-CW 100Watts 13ele DL6WU050.30,08/01 -OK1FM,JN69QQ,,,Milan,,144: 250W 17el MGF1302DTR 3000lpm,11/02 -OK1FXX,JO70WL,,,Beda,,144: TS790E 2xGI7B 3KW 4x17el F9FT 0-4db NF -, -OK1FZA,JO70FC,,,,,,1992 -OK1HAG,JN79,,,,,,01/97 -OK1IBL,JO60CG,,,,,,1991 -OK1KEI,JO60JL,,,,,,01/97 -OK1KF,JO60TG,EME,,Vaclav,,TS790 FT847 144: 1KW 2x17el M2 or 4xKLM16LBX.,08/02 -OK1KHI,JO70ED,,,S.,,,05/02 -OK1KIR,JN79,EME,,clubstation,,,1994 -OK1KJB,JN79IO,,,Clubstation,,,08/99 -OK1KKH,JN79,,,,,,1993 -OK1KRQ,JN69QR,EME,,OP OK1MZM- OK1XST,,144: 400W 17el M2 CF300,10/99 -OK1KRY,JN69TR,,,Clubstation Rokycany,,50: 20W 5el - 144: 250W 2x16el CF300.139,05/00 -OK1KT,JO70WE,,,Vrata,,FT 847 - 50: 20W 5 el - 144: 600 W 15 el Cu,06/04 -OK1MAC,JN79IO,,,Jan,,,01/03 -OK1MDK,JN79PX,,,J.,,,08/02 -OK1MZM,JN69PR,,,Milos,,144: 300W 9el 360m asl,06/04 -OK1NH,JN69UH,,,,,144: 10el 20W,05/04 -OK1TEH,JO70FD,,,Matej,,144: FT847 100W 6el - 432: 50W 22el K1FO,11/04 -OK1UAK,JO70MB,,,Petr,,144: 100W 10el preamp160 4000 MSDSP.160,01/05 -OK1UGA,JO80DD,,,Clubstation,,IC821H 144: 100W 7el Quad - 432: DJ9BV Ant,12/03 -OK1UND,JO60XA,EME,,Petr,,TS515 FT221 144: 16el 100W Preamp,11/04 -OK1UWA,JN69QT,EME,,Josef,,1296: par 2.4m 180W 0-45db NF,08/00 -OK1VBN,JN78,,,,,,01/97 -OK1VEI,JO70UR,,,,,,01/97 -OK1VHF,JO70EB,,,Miloslav ""Milan",,144: 10ml M2 1200W - 432: 6m Tonna 600W - 129,01/04 -OK1VHH,JO70CK,,,,,144: 20W,04/02 -OK1VKC,JN79OW,,,Josef,,,05/02 -OK1VSC,JN79OW,,,Josef,,144: 100W 7el Quad,03/02 -OK1VT,JN79IX,,,,,,07/01 -OK1WCF,JO80BJ,,,Martin,,144: R2CW PA 100W 2x 16el F9FT300 / 370,04/04 -OK1WN,JN69LK,,,Standa,,144: 100W 16el CF300,10/01 -OK1XXT,JO70GA,,,Roman,,,04/02 -OK1YA,JN79IO,,,Premysl ""Mek",,144: 1000Watt 4x13ele4000lpm,10/01 -OK1YK,JN78GX,EME,,Jaromir ""Mira",,FT 847 144: 1kW 13el MGF1302 - 432: 1kW 5m,12/04 -OK2AB,JN89TI,,,,,,12/03 -OK2BON,JO70,,,,,,07/02 -OK2BRD,JN99ET,,,Jirka,,IC706MKIIG,08/03 -OK2BXE,JN89SJ,,,Draho,,144: FT847 100W 16el MGF1302 - 10368: 1.5W Di,07/01 -OK2DL,JN89AO,EME,,Mark,,,06/02 -OK2KET,JN89JN,,,,,,03/01 -OK2KUB,JN89,,,,,,1993 -OK2KZR,JN89BO,EME,,rudi,,,1993 -OK2MWR,JN99HQ,,,Alex,,144: IC706 100W 14el PBM1200lpm,08/00 -OK2PM,JN99AO,,,Karel,,IC706 FT736,08/03 -OK2PMG,JN89SJ,,,Milos,,144: FT847 100W 16el MGF1302 - 10368: 1.5W Di,07/01 -OK2PMS,JN89WW,,,Jirka,,BMT226 13el F9FT,01/03 -OK2PMX,JN88IW,,,Petr,,IC706,04/04 -OK2POI,JN99bl,EME,, -OK2PTC,JN89MM,,,,,,08/04 -OK2PWY,JN89IW,,,,,,11/04 -OK2PZW,JN89HI,,,,,,2003 -OK2QI,JO80OC,,,,,,1995 -OK2SBL,JN99HQ,,,Josef,,1200lpm,08/00 -OK2SGY,JN89SS,,,,,,08/96 -OK2SLC,JN89ED,,,Slavek,,,03/04 -OK2UGG,JN89EN,,,Jirka,,,12/01 -OK2VMD,JN89HI,,,,,,1994 -OK2WO,JN89IH,,,,,,04/04 -OK2XPJ,JN89,,,,,,04/02 -OK2YT,JN88IW,,,Radek,,,04/04 -OK2ZAW,JN89BI,EME,,Jan,,,08/04 -OK2ZW,JN89HI,,,Zdeno,,,08/02 -OK2ZZ,JN89DF,,,Rudi,,,08/96 -OK5ACR,JO60NX,,,Vita,,,05/00 -OK8BXF,JO70VA,,,Gavin,,,06/04 -OL2O,JN79IO,,,,,4000lpm,12/01 -OL5MS,JN69MJ,,,,,,08/99 -OM2TW,JN88UG,,,Richard,,144: IC746 17el LY.050.300,07/01 -OM3AU,KN08OR,,,Andrej,,,1993 -OM3KDX,KN19DB,,,,,144: IC-746 GS35b 4x6 el. 18el. M2 - 10368,06/04 -OM3KMY,JN88MK,,,Clubstation,,,1994 -OM3LQ,JN88MK,,,palo,,,08/01 -OM3TZZ,JN88,,,,,,08/02 -OM3WBC,JN98VG,,,Joe,,,08/02 -OM4EX,JN98HS,,,,,,07/04 -OM5CM,JN98DF,,,Palo,,IC-910H 144 MHz: 100W 9el - 432 MHz: 70W 18e,04/04 -OM5KM,JN98AH,,,Milan,,only SSB-MS,01/02 -OM5UM,JN98EO,,,,,,04/02 -OM7AC,JN98NN,,,Igor,,FT225RD FT780 Transverter home made 145/28,01/03 -OM7AQ,JN98UI,EME,,Zoltan (Zoli),,144: FT290r 450W 13el F9FT MGF1302 - 432:,08/03 -OM7CM,JN98NR,,,Milan,,,08/04 -OM7JG,JN98TI,,,Julo,,,01/02 -OM9AAW,JN98EP,,,DF8AA,,,07/95 -OM9M,KN18AM,,,OP: OM7AQ- OK1CDJ...,,,08/99 -ON1AEN,JO10UV,,,,,,2003 -ON1AFN,JO20SW,,,Filip,,144: FT290r 150W,09/98 -ON1ALJ,JO10SS,,,Jo,,144: TS790E 3CX800 MGF1302 10el 9BV - 432:,11/01 -ON1DDC,JO21UD,,,,,144: 16el 800W1000lpm,08/97 -ON1DSQ,JO21KH,,,Dave,,144: TS700G 50W 8el Quad Preamp.300,04/03 -ON1RR,JO11XA,,,Frank,,FT100.150,09/01 -ON2MRT,JO21MB,,,Thierry,,,07/03 -ON4ADC,JO21FA,,,Marc,,,09/03 -ON4AMX,JO20KV,,,Marc,,144: FT736r 17el 3CX800 BF981DTR 6000lpm,07/01 -ON4ARF,JO10MV,,,,,,05/02 -ON4ASL,JO21,,,Luc,,,1994 -ON4AVJ,JO11UB,,,Jacques,,144: IC275HE 3CX800A7 17el MGF1302165 2000,10/04 -ON4BBD,JO21NA,,,Marc,,FT736 TS440S,01/04 -ON4BG,JO10WM,,,,,,12/01 -ON4CHP,JO21JD,,,Willy,,144: 150W B5016G 11el FX224 SP2000,07/00 -ON4CJU,JO20,,,,,,11/01 -ON4DPX,JO10NT,EME,,Kenny,,FT736 FT847 144: 14el DK7ZB - 432: 2x 26el,09/03 -ON4FI,JO20IV,,,Karel,,144: 3CX800 600W 13el MGF13026000lpm DTR + MS,12/99 -ON4GG,JO20AR,EME,,Geert,,50: 9el mgf13025000lpm MSDSP,08/04 -ON4IMM,JO11UB,,,Dirk,,144: TS440S + LT2S MK2 Preamp PA3BIY design,09/03 -ON4IQ,JO20AR,EME,,Johan,,50: FT1000 TRSV 4x9el 200W MGF1302 - 144:,01/05 -ON4KHG,JO10XO,,,Gaetan,,144: TS440 300W 11el MGF1302 - 1296: 10W 35 e,03/04 -ON4KNG,JO20DU,EME,,Peter,,,01/04 -ON4KST,JO20HI,,,Alain,,,05/04 -ON4LDP,JO10UM,,,Oliver,,50: HM tsvter 2m/6m 30W GP - 144: 150W 13el M,06/02 -ON4LN,JO20IV,,,Eric,,144: TS711E GS35b 7ele M2 MGF1302155 2000l,11/04 -ON4LUC,JO20TM,EME,,Luc,,144: ft1000mp transverter 800w hf max ampli,01/04 -ON4MU,JO20SS,EME,,Denis,,Ft847 150W 0.5dB 3wl,08/03 -ON4PS,JO20KQ,,,Pierre,,144: 400W 9elonly SSB-MS,06/01 -ON4QQ,JO20FS,,,,,,07/95 -ON5AEN,JO10VW,,,Hans,,FT225RD TS770e,01/04 -ON5GS,JO21VD,,,Dirk,,144: IC821 600W 15el,03/02 -ON5LGS,JO10OS,,,Edmond,,only SSB-MS,09/03 -ON5UE,JO11LF,,,Dan,,TS2000DX,01/04 -ON6AB,JO21EC,,,Bruno,,TS930S,03/04 -ON6NL,JO21UE,,,Anton,,144: 120W 13el 6WU088 5000lpm MSDSP288,09/04 -ON6OD,JO20HW,,,franz,,,1993 -ON7CL,JO20JU,,,Rudi,,FT100D 144: FT847 17el high pwr300,09/03 -ON7EH,JO20FV,EME,,michel,,,08/04 -ON7RB,JO11VA,EME,,Roland,,144: 8x13el hor. & 8x12e vert. Full Az/El 1K,11/03 -ON7UC,JO11ND,EME,,Johan,,144: 3CX800A7 2x16el 4.2wlDTR,02/05 -OQ1AEN,JO10VW,,,Hans,,FT225RD TS770E,11/01 -OX2K,GP47TA,EME,,,,144: 4x5wl - 432: 4x28el - 1296: 32m dish,05/00 -OY4TN,IP62NB,,,Trygvi,,,05/04 -OY9JD,IP62OA,,,Jon,,,01/04 -OZ0JX,JO54VU,,,Soeren,,IC761 IC756 50: 5el F9FT,01/03 -OZ1ALS,JO44WX,,,OP OZ1DSK,,144: 2x9el 1KW2500lpm,04/02 -OZ1CDE,JO65CO,,,Jan,,50: FT847 6el 850W,02/02 -OZ1CLL,JO65GQ,,,John,,,08/96 -OZ1CTZ,JO46OE,,,,,,01/02 -OZ1DJJ,JO65GP,,,,,,12/04 -OZ1DPR,JO45IG,,,Bernd ""Ben",,50: Yaesu FT-920 GS35b 1000W 5el,08/03 -OZ1FDH,JO65CS,,,Claus,,1200lpm,07/99 -OZ1FF,JO45BO,,,Kjeld,,432: 200W 2x23el LNA435 - 1296: 40W 2x44el SP,04/04 -OZ1FTU,JO55WW,,,Soeren,,,1993 -OZ1GEH,JO65AL,EME,,peter,,,1993 -OZ1HNE,JO57,EME,,Jorgen,,144: 4x18el crossyagi 8877.022,06/99 -OZ1HTB,JO75,,,Bent,,,11/96 -OZ1IEP,JO55XU,EME,,Carl Jan,,50: 100W 6el - 144: FT736 1KW 2x11el - 432:,01/05 -OZ1IPU,JO57JH,,,J.,,,1993 -OZ1JVX,JO46DS,,,A.,,,01/96 -OZ1LPR,JO44UW,EME,,Peter,,144: FT101ZD LT2MK2 YL1050 ampl 1KW 13el MG,01705 -OZ1PIF,JO65AN,EME,,Peter,,FT847 50: 100W 4el - 144: 350W 13el Preamp150,08/04 -OZ2EEZ,JO45,,,,,,2003 -OZ2ELA,JO65,,,Michael,,,01/97 -OZ2M,JO65FR,,,Bo,,50: HB9CV 100W 70: 25W 5el 144: 15el 1 k,08/04 -OZ2TF,JO46PE,EME,,Ole,,144: IC271h 750W 4x9el Preamp,10/02 -OZ3K,JO45TL,,,Erik,,TS2000,08/02 -OZ3TT,JO66CB,EME,,Bent,,144: ICOM 275H Amp. CS31 M2 18 el MGF1303,12/04 -OZ4MM,JO55GH,EME,,Stig,,10m dish,10/02 -OZ4VV,JO46QU,,,Finn,,50:1000w 9el - 144:1000 Watt 15el MGF1302,03/04 -OZ5AGJ,JO56DG,,,Benny,,144: ICOM 100w 7Elem on 144,01/04 -OZ5QF,JO45VB,,,Jens,,,10/95 -OZ6ABA,JO57DJ,,,Leif,,144: FT736r Mutek Preamp 1KW 15el DJ9BVMS,08/03 -OZ6EI,JO45TT,,,,,,08/01 -OZ6OL,JO65DJ,,,,,,09/01 -OZ6OM,JO55EJ,,,Bjørn ""Matt",,,11/04 -OZ7LE,JO45,,,Hans-Juergen,,144: 9el 400WDTR 4000lpm,03/01 -OZ7U,JO45RL,,,Birger,,TS940S FT847,03/03 -OZ7Z,JO45WA,,,Allan,,144: FT847 1KW 2x9el Yagi,09/01 -OZ8FR,JO55SK,EME,,,,,01/05 -OZ8ZS,JO55RT,EME,,Henrik,,144: IC706 GS31b 1KW 4x8el,08/04 -OZ9AAR,JO45TS,EME,,Carsten,,8x15el Crossyagis- 1KW,12/99 -OZ9FW,JO65CO,,,Frede,,,09/03 -PA0AVS,JO22,EME,,a.n.,,,1994 -PA0BAT,JO31FX,EME,,Gerard,,,01/03 -PA0C,JO22FD,EME,,Henk,,Ft 847 QBL 5/3500 0.4 dB NF 2x 17 el,01/05 -PA0HIP,JO21JO,,,willem,,,1993 -PA0JMV,JO21PM,EME,,Joop,,144: 2x16 el 2x 3CX800A7 0.18dB NF,02/05 -PA0LPE,JO20WW,,,Bert L.,,50: FT847 7el - 144: IC202 400W 2x11el,01/01 -PA0O,JO33HG,,,Jaap,,,08/03 -PA0PVW,JO22VA,,,Peter,,144: 18el M2 3CX800,07/02 -PA0RDY,JO22KJ,,,Robert,,144: 500W 15el MGF1302DTR 3000lpm,10/99 -PA0RLS,JO22,,,R.L.,,,1993 -PA0V,JO33II,EME,,Nanko,,144: 6 x DJ9BV 4 WL Xpol 8 BLF278 Mos fet PA,09/03 -PA0WWM,JO22FE,,,Wim,,144: 160W 9el MGF1302,04/01 -PA0ZN,DM04,,,,,,01/05 -PA1BVM,JO21RI,,,Rick,,50: IC202 Transv. dipol - 144: FT-225 IC 746,05/03 -PA1GYS,JO22WW,EME,,,,144: TS850 LT2S 2 x 2M5WL,01/04 -PA1LA,JO32LS,,,Roel,,144: TS700 16el 60W,01/05 -PA1T,JO33JF,EME,,Timon K.,,144: TS850 LT2S 400W 8877 4x17el M2- 50: 1y.,08/03 -PA2CHR,JO22XA,EME,,Chris,,144: 400W 4x28el Xpol - 432: 400W 2x35el.142,01/05 -PA2DW,JO22GD,EME,,Dick W.,,144: TenTec Trvt 400W(2x4CX250b) 10el.082,09/04 -PA2GER,JO21EW,EME,,Ger,,,09/99 -PA2KW,JO22SB,,,Evert,,144: 1x16el KLM 1.2KW MGF1302,10/04 -PA2M,JO21IP,,,Frank,,FT847 144: 2x blf278 9el 432: 16 el,11/04 -PA2TAB,JO32GF,,,,,,01/05 -PA2V,JO22IM,EME,,Peter,,,08/03 -PA3BAS,JO21PG,,,,,,01/05 -PA3BGM,JO33CE,,,,,,08/99 -PA3BIY,JO22EB,,,Peter,,144: 400W 2x9el,03/02 -PA3BXH,JO22WW,,,,,,01/05 -PA3BZL,JO22SB,,,,,,01/05 -PA3BZO,JO21RS,EME,,Piet,,,08/03 -PA3C,JO33FD,,,Aart,,,08/04 -PA3CEE,JO33JI,EME,,Eltje,,144: 600W 2x16el MGF1302165375,01/05 -PA3CMC,JO21WI,EME,,Lins,,,07/04 -PA3CMG,JO21IV,,,,,,01/05 -PA3COB,JO32MF,EME,,Harry,,144: 15el QD 3CX8003000lpm,03/04 -PA3CSG,JO21WD,EME,,Geert,,,08/04 -PA3CWI,JO11TK,EME,,Kees,,144: FT736 6x12 el M2 MGF1302 8877,08/03 -PA3DOL,JO22MT,,,Sjoerd,,144: 400W 17el4000lpm,09/03 -PA3DRL,JO21PS,,,,,144: 30W 10el,04/04 -PA3DUU,JO21IU,,,arie,,,1993 -PA3DYS,JO21JP,,,,,,01/05 -PA3DZL,JO21HM,EME,,Jac,,144: 4x17el 3.6ld MGF1302 EME Pwr - 432: 2x2,01/05 -PA3ECU,JO32CF,,,Rudy,,50: FT726R 5el 175W - 144: FT847 17el 400W -,12/04 -PA3EON,JO21,,,c.,,,1993 -PA3EPX,JO22RC,,,peter,,,1993 -PA3EQS,JO22TI,,,kees,,,1993 -PA3FBN,JO33IF,,,,,,01/05 -PA3FJY,JO32EH,,,,,,01/05 -PA3FOC,JO21FW,EME,,Rene,,144: TenTec Paragon LT2S 17el (2x17el) PA,06/03 -PA3FPQ,JO22XE,EME,,Johan,,FT100 500W single yagi,08/04 -PA3FSA,JO23RF,,,,,,08/01 -PA3FVE,JO21WG,,,wim,,,1993 -PA3FXW,JO22QD,,,robert,,,1993 -PA3FYF,JO22DB,,,peter,,,1993 -PA3GBR,JO32LH,,,johan,,,1993 -PA3GVC,JO22MU,,,Norbert,,,12/04 -PA3HJG,JO32BG,,,Pascal,,TS2000 50: Dipol - 144: 13el1300lpm,08/03 -PA4VHF,JO32EH,EME,,Dick,,50: 100W 5el - 144: TS850 LT2S 400W 2x16el,04/01 -PA5DD,JO22IC,,,Uffe,,144: GS35b 15ele CUE DEE,01/05 -PA5KM,JO11WL,,,Coen,,144: TS790E 9el 400W,05/04 -PA5M,JO21BS,,,Michael,,,08/03 -PA5MS,JO21QJ,EME,,John,,144: 11el GS35b 400W MGF1302132 4000 DTR,11/02 -PA60SHB,JO21OS,,,OP: PE1AHX,,,12/04 -PA6BN,JO13OF,,,OP: BIY- BZL- FOC,,,07/98 -PA6MS,JO32QF,,,OP PA2TAB- PA3FJY,,DTR,10/96 -PA6T,JO32GF,,,OP PA2TAB Arie,,DTR 3000lpm,12/98 -PA7AL,JO23VG,,,,,,12/04 -PA7C,JO32GF,,,Arie,,50: 100W 6el - 144: R2CW GS31b 400W 14el MGF1,09/03 -PA7FE,JO22OC,,,Frank,,50: 6el leg pwr,03/99 -PA7FM,JO21,,,Dennis,,,08/00 -PA7PYR,JO21UQ,,,Rien,,TS450SAT HF: FB33 - 144: 25W 2x17el Tonna -,09/03 -PA7RP,JO22EC,,,Ruud,,144: 13el 400W GS35B,07/04 -PA7WM,JO23TA,,,l.,,,03/99 -PA9RX,JO32MT,,,Theo,,144: FT847 4x17el 200W370,08/02 -PB0ALS,JO21RV,,,tjeerd,,,1993 -PB1TT,JO22FF,,,Peter,,144: 100W 10el CueDee2000lpm DTR,09/01 -PD0ANQ,JO31EW,,,Wilfred,,,11/01 -PD0HCV,JO31FW,,,Gert,,IC821 144: 15el M2 432: 18el M2,11/04 -PD0ORT,JO23RE,,,Willem,,,04/04 -PD0PYR,JO21UQ,,,,,,01/05 -PD0RFU,JO32LS,,,Rene,,144: FT225RD 2x19el Cushcraft - 432: TS811E,08/04 -PD1AIQ,JO22RM,,,Jan,,144: 25W 4x9el,04/03 -PD1ALD,JO32FI,,,Rene,,Yaesu FT897- Kenwood TR9130- Yaesu FT817,06/03 -PD2GCM,JO21ET,,,Gerard,,FT847,11/04 -PD2VDV,JO23RF,,,,,,08/04 -PE1AHX,JO21OS,,,Catharinus,,DTR +,10/03 -PE1BVM,JO21RI,,,,,,01/05 -PE1DCD,JO21FU,,,,,,05/03 -PE1GBT,JO33BC,,,,,,01/05 -PE1GNP,JO31IX,,,,,,05/03 -PE1GUR,JO22TH,,,,,,06/03 -PE1HWO,JO21GV,,,Andre,,144: FT101ZD + TRV 4CX250b 400Watt 17el MGF1,12/03 -PE1IKX,JO11TL,,,Marco,,144: 300W 15el Quedee,03/04 -PE1ITR,JO21QK,EME,,Rob,,144: 100W 2x10el 3SK97 432: 60W 2x 28el GS,01/05 -PE1L,JO23WF,EME,,Rene,,144: 400W 4yagis DJ9BVDTR,12/04 -PE1LCH,JO23WF,,,,,,01/05 -PE1LWT,JO22VA,EME,,Jurgen,,144: 800W 2x3wl-Xpol,08/03 -PE1M,JO23XE,,,Kees,,,08/03 -PE1MVJ,JO21FV,,,jJ,,,11/96 -PE1OGF,JO21QJ,,,,,,01/05 -PE1OPK,JO23UE,,,Bram,,IC821,09/03 -PE1PQX,JO32LS,,,Andre,,,07/04 -PE1RBG,JO21,,,,,,11/01 -PE1RLF,JO32CG,,,Eric,,144: TS850 LT2S 4CX250F 10el370,01/04 -PE1RWS,JO32BM,,,,,,01/05 -PE2KP,JO22XE,,,Adriaan,,144: 6el Quad 50W.144 2000 lpm.350,01/01 -PE2PE,JO21LU,,,Freek,,144: 400W 15el Quedee,11/03 -PE2RMI,JO23MH,,,Eddy,,,01/02 -PE2SVN,JO21WR,EME,,Sjoerd,,FT1000 LT2s 3CX800 400W 10el,11/04 -PE9DX,JO33MD,,,Johan,,144: TS711 400W 17el SP2,07/04 -PE9GG,JO33NA,,,,,only SSB-MS,11/00 -PE9HNE,JO22FB,EME,,Hans,,TS711,09/03 -PI4NYV,JO32EH,,,Clubstation,,144: 400W 9el or 17el (/p JO32FI),12/96 -PP2KR,GH53IG,EME,,Kleibe,,TR9130,02/05 -PT9FH,GH11EA,EME,,Tony,,144: 4x12el 2x4CX250,04/00 -PY1EPU,GG88PO,EME,,Franco,,144: 4x 16el 160W FT 1000 Mark V Field + Tran,02/05 -PY1IAM,GG87,EME,,LUIZ ALBERTO,,,04/04 -PY1RO,GG87LB,EME,,Rolf,,IC706MKIIg 1000W 8 over 8 el,08/03 -PY2CLL,GG66RF,EME,,Marcus,,144: Kachina 505DSP Trvt 4x18el M2 LNA 300W,01/00 -PY2NI,GG66RK,EME,,Horta,,.100.220,07/01 -PY2PD,GG66RF,EME,,Jose Carlos,,MP1000- LT2S- 4xM2XP28- 3CX800 0-4db,03/99 -PY2PLL,GG66RF,EME,,Marcus,,144: 750W 16el or 2x15el - TS790A xverters,03/01 -PY2SRB,GG48bc,EME,, -PY3CRX,GG66RF,,,Marcus,,144: 750W 16el or 2x15el,08/00 -PY4EPU,GG88PO,EME,,LUIZ ALBERTO,,YAGI FULL SIZE FOR 14 21 28 50 144 220,09/03 -PY5ZBU,GG54,EME,,,,,2000 -R1MVA,KP40GP,EME,,OP RU1AA- OH5LZY ...,,144: 150W,07/99 -R1MVZ,KP40GP,EME,,OP: RU1AA,,144: 4x14el 1.2KW.072,10/99 -R3VHF,LO16XG,,,Clubstation,,.143,01/96 -RA0FCA,QN16IV,EME,,,,,12/04 -RA1ASA,KP50FB,,,,,,1976 -RA1AY,KP50EA,,,Serge,,TS450SAT Icom 706MKiiG,11/04 -RA1QA,KO99WF,,,Alexander ""Alex",,144: 100W 14el 9BV.140 rx1000/2000lpm,05/02 -RA1QAX,LO09CC,,,,,144: IC706 10el PA,10/04 -RA1TC,KO58ON,,,alex,,,1992 -RA1TL,KO67,,,,,,05/04 -RA1TM,KO67PX,,,Alex,,IC746,11/04 -RA1WL,KO47EV,,,Mikhail ""Mischa",,,06/04 -RA1ZC,KP59JK,EME,,Anatoly y.,,IC706MK2 144: 2x10el DJ9BV 1KW2000lpm,11/01 -RA1ZK,KP68MV,,,,,,11/04 -RA3AGS,KO85UU,,,,,,1990 -RA3AQ,KO85SP,EME,,Dmitry,,144: FT736r 250W 13B2,06/04 -RA3DHK,KO95JH,EME,,,,144: FT-736R Toshiba NB 170W 1x2M12MSDSP,01/05 -RA3DQ,KO85US,,,Victor,,144: IC746 100W 16el,09/01 -RA3DQT,KO95HK,,,Vladimir L.,,144: FT-736R Toshiba NB 170W 1x2M12MSDSP,08/02 -RA3DRC,KO95AP,,,Nick,,144: FT-847 50Wtts 17el DJ9BV 9.2 m long200,03/04 -RA3EL,KO82AX,,,Nikolaj,,144: 50W 16el,03/04 -RA3FO,KO86SI,,,Nicolai,,.080,1995 -RA3GES,KO92SO,,,,,,11/04 -RA3IM,KO56UM,,,Leo,,,06/04 -RA3IS,KO76WT,EME,,Sergey G.,,144: 1000W 2x19el SM2CEW 5wl crossyagi142 MS,01/05 -RA3LBK,KO65QA,,,Viktor,,144: 200W 17el1500lpm,01/00 -RA3LE,KO64AR,EME,,Valeri,,,04/01 -RA3LW,KO54MQ,,,Mikhail K. ""Misha",,144: KT931 BF981 2x10el - 432: KT930 KT3101,06/04 -RA3QTT,LO01GQ,,,Nickolaj,,144: GS35 0.5KW 4 x 3.3wl 9BV 0.35db.167,11/03 -RA3TES,LO15WJ,,,Andy,,,11/95 -RA3WDK,KO81BR,,,Ivan,,144: 60W 11el,04/04 -RA3YCR,KO73DH,EME,,viktor,,.090,1994 -RA4AOR,LN29LA,EME,,Yuri,,144: 4x 14elX-Yagi 1-5KW,11/03 -RA4HCN,LO43SL,EME,,Sergey,,,01/05 -RA6AAB,KN94UR,EME,,vladimir,,,1992 -RA6DA,KN96sa,EME,, -RA6HHT,LN05XB,,,nikolaj,,,1992 -RA9FMT,LO87BW,,,vladimir,,,1992 -RA9SO,LO71NS,,,,,,08/96 -RB4EE,KN78WM,,,,,,01/05 -RB5AG,KO60KT,,,,,,01/05 -RB5EU,KN78RI,,,,,,01/05 -RB5GD,KN66HP,,,,,,01/05 -RB5GO,KN66HP,,,,,,01/05 -RB5GZ,KN66HP,,,,,,01/05 -RK1B,KO69AK,,,,,,01/05 -RK1NA,KP71ET,EME,,Konstantin,,144: FT847 100W 14el circular,04/04 -RK2FWA,KO04FT,EME,,Clubstation,,080,04/04 -RK3AF,KO85QR,,,Dmitriy ""Dima",,144: IC746 2xGI7B 450W 16el F9FT177 MSDSP285,12/03 -RK3PWJ,KO83XC,,,OP: 3PF 3PNO,,,05/04 -RK3WWF,KO72QI,,,,,,06/04 -RK9CC,MO06RT,EME,,Stepan,,6x4lb 9BV GS35b,03/04 -RL1P,KO49VW,,,Igor,,144: TR-751 300w 16el DJ9BV,05/03 -RL1X,KO59EW,,,,,,05/03 -RM3T,LO16XG,,,Clubstation,,.143,08/97 -RN3QQ,LO00BK,,,,,144: 15el DJ9BV 100W1500lpm,06/99 -RN6BN,KN95LC,EME,,Alexandr ""Sam",,144: FT736 16x17el 1KW,11/04 -RN6HW,LN16AB,,,,,,08/03 -RN6MT,KN97LN,EME,,Gena,,144: 2.3KW 4xYagis.132,11/03 -RU1A,KP40HK,EME,,Clubstation,,144: 6x16el 1KW,01/05 -RU1AA,KP40XD,EME,,Alex,,144: >2KW GU93b 4x15el Crossyagi140 4000 DTR3,07/04 -RU1AC,KP50EJ,,,,,,07/04 -RU1AS,KO59,,,Alexander,,,05/03 -RU1R,KO82BW,,,OP RB5AL-R3VHF,,,1993 -RU1U,KO72XW,,,OP RB5AL- R3VHF,,,1993 -RU3ACE,KO85SM,EME,,Maxim ""Max",,,01/05 -RU3GX,KO92SO,,,Igor,,,06/04 -RU3ZD,KO81VG,,,Victor,,144: 16el 200W,1/96 -RU4HU,LO43OM,,,Andy,,144: FT290R 2x10el 50W,04/04 -RV1AO,KP50,,,,,,08/04 -RV3AO,KO85RR,,,Vladimir,,144: 4x12el 1500W,07/03 -RV3APM,KO85RU,,,Sergey,,IC910H,03/04 -RV3IG,KO87OT,EME,,Andrey ""Andy",,144: 500W 4x15el.125 1000lpm,01/00 -RV3ZR,KO80CL,,,Alex,,144: 500W YU0B KT939A.150.300,11/03 -RV4AQ,LN28GM,EME,,,,432: 4x4.2ld BV 2xGI7B 500W,10/99 -RV6YY,LN04BH,,,Larry,,,08/04 -RV9AX,LO93LK,,,Oleg,,144: 600W 17el preamp - 50: 100W- 6el.050,10/96 -RV9JD,MP80GW,EME,,,,,01/05 -RW1AW,KP50DA,EME,,Alexander ""Alex",,144: FT736r 2.4KW 2x19el MGF1302 - 432: 12x1,02/05 -RW1Q,KO99WJ,,,Oleg(R3VHF),,.143,12/95 -RW2F,KO04PT,,,OP: DK8LV- DL8UD,,,12/97 -RW3AC,KO86SH,,,Evgeny,,IC910H,01/05 -RW3AZ,KO85TT,,,Alex V.,,,08/03 -RW3DMQ,KO86RI,,,,,,08/04 -RW3PF,KO93CD,,,Peter,,144: 1500W 4x10el GS35 BVO 3wl Preamp - 432:,11/03 -RW3TJ,LO16XG,,,Oleg I.,,.143.243,11/03 -RW3TU,LO25BR,,,Sergej ""Serge",,144:1000Watt 2x13el MGF1302 - 432: 200Watt 2x,09/03 -RW3WR,KO71IM,,,Yuri,,,07/04 -RW4AK,LO20RC,,,Alex,,,01/96 -RW4WE,LO66PU,,,,,,11/04 -RW9FT,LO89TD,,,Eugen,,,11/04 -RW9MD,MO64RX,EME,,,,,06/01 -RX1AS,KO59FX,EME,,Sergej,,144: 4x21el LY GS35b linear.120 1000lpm,05/04 -RX1AX,KO59EW,,,Anton,,,12/20 -RX3PX,KO84SD,EME,,Gennady V.,,144: 2x11el 210W MGF1302 - 432: 2x23el 180W,06/99 -RX3QFM,KO91FM,EME,,Vladimir ""Vlad",,144: 2xBVO4wl yagi 0.4 dB LNA PWR 1.5 KW (2xG,08/04 -RX6AKO,KN84PV,,,Gennady,,,06/96 -RX9CHW,LO99SE,EME,,,,,01/05 -RX9SA,LO71NS,,,,,IC910H,08/04 -RY3E,KN75,,,OP UT5EC,,,1993 -RY5I,KP51BM,,,,,,1992 -RZ1AP,KO49VW,,,Igor,,144: TR-751 300w 16el DJ9BV,05/04 -RZ1AWR,KO59DX,,,Clubstation,,144: 16el DJ9BV 50Watt.120 tx2500 1500lpm,08/98 -RZ1AWT,KP40XD,,,Yuri,,144: 20W 9el.170 1000lpm,06/98 -RZ1QZZ,LO09BC,,,,,,07/04 -RZ1ZZZ,KP76EQ,,,,,,08/04 -RZ2FWA,KO04FT,,,,,,2003 -RZ3AF,KO85CO,,,,,144: MGF 1302 2x14 el GI-7B,12/02 -RZ3QD,KO91OO,,,,,144: 4wl 1KW LNA6000lpm,08/02 -RZ3QS,KO91SS,,,,,144: 2wl 100W LNA1000lpm,08/02 -RZ3ZZ,KO80GP,,,Nikolaj ""Nick",,144: IC-910H 4x 10el A144S10 - 432: 1 A43,11/04 -RZ4HF,LO43QM,,,Igor,,144: IC-910 IC-970 2x13el 1500W,04/04 -RZ6BU,KN84PV,,,Gennadij,,IC706 144: 200W 10el Preamp KT610073 4000lpm,11/03 -RZ6BY,KN84PV,,,,,,06/97 -S50C,JN76JG,,,Clubstation,,50: 5el 100W - 144: IC275h 2x15el 700WMSDSP,08/01 -S51AT,JN75GW,,,Boris,,144: 400W 16el LY2000lpm MSDSP,12/04 -S51BA,JN75IX,,,,,,2003 -S51DI,JN76VL,,,,,,09/03 -S51DX,JN75CC,,,Janez,,144: IC275H 100W 2x17el F9FT,11/01 -S51MQ,JN75NT,,,Boris,,50: 50W 6el - 144: TH328 500W 4x7el MGF13021,01/04 -S51S,JN75GV,,,,,,08/96 -S51SLO,JN76GB,,,,,DTR,03/01 -S51TE,JN76BI,,,,,,11/99 -S51WV,JN76SN,,,,,,2003 -S51WX,JN75OS,,,Dusan,,144: 2x11el 350W,09/04 -S51ZO,JN86DR,EME,,Joze,,144: 1-5KW 4x14el 9BV - 432: 800W 8x33el 9,01/00 -S52CW,JN76CI,EME,,Uros,,,01/01 -S52EZ,JN86DT,,,,,,08/01 -S52LM,JN65TX,EME,,Milos,,144: 4X17M2 5WL FT 1000MP JAVORNIK 144/14,01/05 -S53AC,JN76GB,,,Tili,,IC-746 M2-8wl 600W IC-746 17elDTR MSDSP,08/03 -S53CAB,JN76JG,,,Clubstation,,,08/97 -S53J,JN75EV,EME,,Joze,,144: FT847 4x5wl GS35 ATF43154320,12/04 -S53T,JN75GV,,,Clubstation,,,06/01 -S53VV,JN65UM,EME,,Stane,,144: 250W 16el MutekDTR 3500lpm,01/05 -S53X,JN65WS,,,,,,11/99 -S54AA,JN76EG,,,Franc ""Lane",,144: IC275H 2x4CX250b (650W) 18el DJ9BV,01/01 -S54M,JN86CL,,,Maki,,FT847 PA060210,05/02 -S55AW,JN75DS,,,Stanko,,144: FT1000MP XVRT GS35b 1KW 2x15elMSDSP.3,05/04 -S55M,JN65XM,,,Adi,,144: 8x3el 1KW,11/01 -S55OO,JN76HD,,,Goran,,50: IC735 40W 5el - 144: IC275H 100W 15QD,06/04 -S57A,JN65TW,,,,,,11/99 -S57C,JN76HD,,,Branko,,144: 700W 17el - 432: 400W 8x21DTR,07/96 -S57EA,JN76HE,,,Miran,,144: IC202E 150W 4x6 loop (full elv.) MGF1,01/05 -S57JA,JN76GB,,,,,,11/99 -S57LM,JN76HD,,,Lojze,,.300,04/03 -S57M,JN76PO,EME,,Bojan,,,03/02 -S57MSU,JN76EF,,,Uros,,144: TM255E 500W 2x13el (2.1L) 5°El 15dbon,08/01 -S57QM,JN76,EME,,tone,,,1994 -S57RA,JN75FO,EME,,Paul,,432: 4x 8.5wl dj9bv- 0.3db preamp atf35176- g,08/00 -S57S,JN76JB,,,Aleksander,,144: TS850SAT h.m. transv MGF1302 preamp 3,11/00 -S57TW,JN75EX,EME,,Bojan,,144: IC275H 1500W MGF1302 4x2M28XP085 DTR,08/03 -S57UUU,JN76EC,,,,,,2003 -S58J,JN76EG,,,Janez,,50: IC756 5el,11/99 -S59A,JN76XP,,,Drago,,,11/95 -S59AX,JN65UU,,,janko,,,1993 -S59DCD,JN76NL,,,,,,2003 -S59EA,JN75,,,,,DTR,95 -S59F,JN65TX,,,Ivo,,50: 350w 6el - 70: 50w 5el - 144: 500w,04/03 -S59UN,JN76XP,,,,,,2003 -S9TX,JJ30,,,,,,2003 -SK0AR,JO99BT,,,,,,1993 -SK0CC,JO99BD,,,,,,07/02 -SK0UX,JO99BM,EME,,Clubstation,,,01/05 -SK3AH,JP82XO,,,Clubstation,,,10/02 -SK3JR,JP62WK,,,,,,1992 -SK3LH,JP93IH,,,,,,1994 -SK3MF,JP92FW,,,Clubstation,,144: 6x15el 1KW,07/02 -SK3SN,JP80IO,,,Clubstation,,,1994 -SK4BZ,JP61QM,,,,,,1994 -SK4EA,JO79CO,,,clubstation,,,1993 -SK6HD,JO68SD,,,OP Fredy (SM6FKF),,144: 150W 2x15el1500lpm,09/04 -SK6YH,JO58,,,,,,08/96 -SK7AX,JO77DS,,,Clubstation,,,07/01 -SK7CY,JO65SN,,,OP SM7MRL SM7NYC,,144:TS850 transverter 130 1000W MGF1302300,05/02 -SK7JC,JO76KF,,,Clubstation,,,08/99 -SL4BP,JP70TO,EME,,OP SM4HFI,,144: 800W 4x9el MGF1302,03/02 -SM0EJY,JO89SC,,,Andrew ""Andy",,144: 500W 10 over 10el Preamp1000 lpm,12/99 -SM0EPO,JO89XM,,,Per Olof,,144: 50W 2x6el,12/03 -SM0EPX,JO89SJ,,,Michael ""Mike",,144:1000 Watt 4CX1500 15el X-Y MGF1802,04/04 -SM0FFS,JO99AG,,,,,,1994 -SM0FZH,JO89TG,,,,,,01/97 -SM0HAX,JO99,EME,,Peter,,144: 6x9el (3.5lb) GS35b 1KW 2SK571 0.35dbN,01/01 -SM0IKR,JO99CC,,,Göran,,FT847,02/05 -SM0KAK,JO89XK,,,Lasse,,50: 100W 6el - 144: 180W 17el1600lpmtx 1000lp,08/03 -SM0LCB,JO99,,,Ulf,,,04/04 -SM0LQB,JO89XK,,,Stellan ""Stan",,144: 15el 130W - 432: 4W 21el,04/04 -SM0MXR,JO89WE,,,,,,2003 -SM0NKZ,JO99IQ,,,johan,,,03/02 -SM0OUG,JO89VG,,,Lasse,,,10/96 -SM0PYP,JO89XG,EME,,paul,,,1994 -SM0TSC,JO99CF,,,Johan,,FT817,11/04 -SM1BSA,JO97DP,,,Arne,,144: FT736r 500W 2x9elDTR,05/04 -SM1HPV,JO97HO,,,Karl-Gunnar,,144: 200Watts 2x15ele,01/02 -SM1SBI,JO97FK,EME,,Pontus,,144: 2x17el 800W315,05/02 -SM2AZG,KP03,,,,,,03/02 -SM2BLY,KP05RJ,,,,,,1993 -SM2BYA,KP07DU,EME,,Gudmund,,144: FT1000 4x3.2wl CueDee 3CX1000A7 MGF110,08/00 -SM2CEW,KP15CR,EME,,Peter,,144: 6x19el 1KW120 1200lpm,01/05 -SM2CKR,KP03DQ,EME,,Mats,,,07/99 -SM2ECL,KP05RH,,,Anders ""Anti",,144: 200W 4x15el 60m asl150lpm,07/03 -SM2EKM,KP05UW,EME,,Jan Erik ""Jim",,,04/03 -SM2GCR,JP93TK,,,,,,07/00 -SM2GGF,KP05DV,,,,,,1984 -SM2ILF,KP04,,,S.,,,12/04 -SM2IUE,JP85,,,Enfried,,,1993 -SM2IZV,JP84,,,peter,,,1993 -SM2LKW,KP15BO,,,,,,1994 -SM2LTA,JP94CW,,,Assar,,DTR+,04/98 -SM2ODB,KP03EU,,,Peter,,144: 100W 15el1200lpm,03/02 -SM2VBK,KP15BO,,,Mikael,,,08/02 -SM3AKW,JP92AO,EME,,Carl G.,,144: 2x17LB 1KW - 432: 16x21el 1KW - 1296 4x2,04/00 -SM3AZV,JP83,,,Thorsten,,,1993 -SM3BEI,JP81NG,,,Lennart,,144: 100W 432: 500W 1296: 130W 2320: 120,12/04 -SM3BIU,JP73ST,,,Bas,,,01/97 -SM3BYA,JP81NX,EME,,Gudmund,,432: 450W 8x21el MGF1412,12/00 -SM3COL,JP82,,,Rolf,,,11/96 -SM3GHB,JP72,,,Bentgerik,,,1993 -SM3GHD,JP62,,,lars,,,1993 -SM3IEK,JP82MO,,,Kenneth,,144: 100Watt 15el,01/03 -SM3JBO,JP93IH,,,,,,03/04 -SM3JGG,JP71WJ,,,Staffan,,,07/02 -SM3JLA,JP93LH,,,Mikael,,144: 250W 15eltx1500 3000lpm,06/99 -SM3KJO,JP92DX,,,,,only SSB-MS,08/97 -SM3KYH,JP82NL,,,Lars,,,04/04 -SM3LBN,JP80IO,,,Hakan,,,08/03 -SM3LGO,JP83VB,,,Mats,,144: 1KW 80el Colineartx2000 rx1500lpm,01/99 -SM3MXR,JP80GR,EME,,Einar,,144: 4x17el M2 emepwr5000lpm,08/01 -SM3PWM,JP81GF,EME,,Sverker,,,12/99 -SM3PXO,JP73GI,,,Petter,,144: 400W 17el 5wl - 50: 50W 9el 2wl,04/03 -SM3RLJ,JP93OI,,,Mikael,,144: 100W 15el1500lpm,07/97 -SM3RPQ,JP74BT,,,Leif,,,04/03 -SM3RWZ,JP82MI,,,Tony,,ICOM IC-275H 200W 9 ele,10/04 -SM3TFR,JP93IG,EME,,goeran,,,1994 -SM3VAC,JP83VA,,,Magnus,,144: 2x17el 1KWMSDSP,08/01 -SM3VEE,JP81VI,,,Anders,,,03/98 -SM3XGV,JP81OF,,,Anders,,TS2000,08/04 -SM4ANQ,JP70OC,,,Ulf,,,02/02 -SM4DHN,JP60VQ,EME,,Lars Bertil,,,01/01 -SM4FXR,JO79OF,,,Christer,,,01/05 -SM4IVE,JO79SD,EME,,Lars,,,08/00 -SM4KYN,JO79,,,anders,,,1993 -SM4POB,JP70FK,,,per,,,1995 -SM4RPQ,JO79HH,,,Leif ""Alf",,TS2000,07/04 -SM4VQP,JO79NB,EME,,Lars,,144: 4x17el eme-pwr,01/02 -SM5BSZ,JO89IJ,EME,,Leif,,,07/99 -SM5CBN,JO78NH,,,len,,,1993 -SM5CFS,JO99IQ,EME,,Bjorn,,144: 4x16el QBL5/3500 1.5KW,11/01 -SM5CUI,JO89WW,EME,,Rune,,,01/05 -SM5DCX,JO89OI,,,Lars,,,01/01 -SM5DIC,JO89JT,,,Ragge ""Gus",,144: 13el 400W MGF1302,07/04 -SM5DRV,JO77MV,,,Lars,,144: IC-275H 100W 13el yagi2000lpm,07/04 -SM5FRH,JO88BW,EME,,Torbjoern ""Tobben",,144: 32x19el horz. or 32x10el vert..017,10/00 -SM5GEP,JO77IP,,,,,,2003 -SM5IOT,JO99,EME,,Christer,,144: 8x9el vargarda GS35b MGF1801,10/00 -SM5TSP,JP90CE,EME,,Lars,,144: 4x15el 750W2500lpm,07/03 -SM6AEK,JO66,,,goran,,,1993 -SM6AFH,JO66LQ,,,thomas,,DTR,1994 -SM6CEN,JO57XO,,,Hank,,,03/02 -SM6CKU,JO67,EME,,Bengt-Arne,,,10/00 -SM6CMU,JO57XK,,,Ingemar ""Ingo",,IC706MkIIg 50: 100 Watt 6el - 144: 9el NE7,05/04 -SM6CWM,JO67,EME,,ingemar,,,1994 -SM6EAN,JO57WQ,,,Mats,,144: 600W 10elDTR tx 3000lpm,01/01 -SM6EUP,JO57XQ,EME,,hans,,,1994 -SM6FKF,JO68SD,,,Fredy,,,04/04 -SM6FUD,JO68JV,,,,,,12/04 -SM6KJX,JO67CK,,,Janne,,FT736DTR,07/04 -SM6NET,JO68SD,,,Tony,,144: 100Watt 17el - 432: 50Watt 21el,01/05 -SM6TZX,JO67EE,,,CHRISTER,,,05/02 -SM6U,JO67AT,,,OP SM6USS,,144: FT290 9el 25W,05/00 -SM6UMO,JO68DH,,,Mikael,,144: TR751 170W 2x13el SP2000rx3000 tx1200,1994 -SM6USS,JO67AT,,,Dennis,,144: FT290 9el 25Wonly SSB-MS.290,07/97 -SM7AED,JO65NI,,,Arne,,144: 50W 5el.170 rx1000lpm,03/02 -SM7BAE,JO65,EME,,K.,,144: 24x20el,10/98 -SM7CMV,JO65AM,,,Ken,,50: IC735 25W 5el,01/97 -SM7EAN,JO86,,,,,,07/99 -SM7EOI,JO86FP,,,Toby,,IC7400,01/04 -SM7FJE,JO65ML,EME,,Bob,,,01/05 -SM7FMX,JO65KN,,,,,,08/04 -SM7FWZ,JO78,,,Ronny,,,03/03 -SM7GVF,JO76JV,EME,,Kjell,,,03/02 -SM7IWG,JO77IP,,,Carl,,,04/04 -SM7JUQ,JO65WX,,,Harald,,50: 100W 5el - 144: 750W 9el - 432: 50W 19el5,08/04 -SM7KNK,JO75,,,K.,,,1993 -SM7MRL,JO65NP,,,Ingvar,,144: TS850 transverter 130 1000W MGF1302300,03/03 -SM7MXO,JO77,,,,,,07/04 -SM7NNJ,JO86DQ,,,Sven Ake,,50: IC290 - 144: FT726R 100W 15el MGF1302255,01/02 -SM7OYP,JO66JA,,,Lars,,50: 100W 5el,09/01 -SM7SCJ,JO65QJ,EME,,Richard ""Ric",,,10/02 -SM7THS,JO76WR,,,Sverker,,144: 15el 170W MGF1302DTR,11/99 -SM7TJC,JO67SH,EME,,Anders,,144: FT-225RD 2xGi7b (800W) - 432: FT-757GX,05/02 -SM7TUG,JO65OT,,,Hans,,144: 2x4CX250b 17el MGF1302DTR,08/98 -SM7WSJ,JO67WI,EME,,Hakan,,144: 2x M2 28XP 1KW MGF1302 - 432: 18el hom,04/03 -SM7WT,JO65QQ,,,Sten,,,06/01 -SO4DFC,KO13AX,,,,,,1992 -SO4TEC,KO13CW,EME,,,,183383,06/02 -SO5AS,KO02JD,,,Stephen ""Steve",,50:100Watt 3el 144:130Watt 14el105 2500lpm MS,08/04 -SO9AN,JO84NG,,,,,.133,05/00 -SO9FB,JO84NG,,,,,.122,05/00 -SP1JVG,JO84LL,,,Miroslaw,,only SSB-MS,02/01 -SP1NQE,JO84LL,,,Bogdan ""Bodo",,TS746 TS811E,04/04 -SP2CHY,JO94GO,,,Wojtek,,,02/05 -SP2FAX,JO83VA,,,,,144: 2KW 6x17el,08/03 -SP2HAX,JO83,,,,,,12/ 9 -SP2HNF,JO94FK,,,,,,01/99 -SP2IQW,JO94GM,,,Michal ""Mike",,50: FT690S 5el - 144: 100W 2M5WL305/360,09/04 -SP2JAN,JO94,,,,,,09/94 -SP2JYR,JO92QP,,,Ryszard,,,04/04 -SP2MKI,JO93AC,,,Darek,,,03/02 -SP2MKO,JO93CB,,,,,,05/04 -SP2MSL,JO92NM,,,Andrzej,,only SSB-MS,01/97 -SP2NJI,JO92MP,,,Wieslaw,,50: IC736 100W 5el - 144: IC271 150W 21el - 4,10/99 -SP2OFW,JO93AC,EME,,Wojtek,,144: 2xGS35b 2x15el,01/05 -SP2SGZ,JO82UU,,,,,,7/96 -SP3EPX,JO83ID,,,,,,11/01 -SP3FSM,JO81GU,,,,,,08/02 -SP3MFI,JO91,,,st.,,only SSB-MS,1993 -SP3RNW,JO81GQ,,,Leszek,,50: 100W -144: 200W 11el MGF1302 - 432: 100W,08/03 -SP3RNZ,JO92DF,EME,,,,IC746 7el TAGI245,09/03 -SP3SUX,JO72OR,,,Irek,,144: 80W 14el BF981,12/96 -SP3VSC,JO92DF,,,Jack,,144: IC746 2X13B2 PA GS35B,01/04 -SP4BY,KO13OD,,,,,,07/04 -SP4DGN,KO13OD,,,,,,1988 -SP4JCQ,KO13NC,,,Gene,,FT920 IC910H 144: 100W 17el,02/05 -SP4MPB,KO03HT,EME,,Marek,,144: IC746 GS35b MGF1302 - 10GHZ: 5W 120cm,02/04 -SP5CCC,KO02NF,,,Tomasz ""Tom",,,10/02 -SP5CJT,KO02OD,EME,,mike,,,1994 -SP5EFO,KO02,EME,,leszek,,,04/97 -SP5HEJ,KO02,,,Marek,,,01/97 -SP5KVW,KO03SB,,,,,,1989 -SP5LJX,KO03,,,,,,08/02 -SP5QWB,KO02NF,,,Bart,,50: 400W 7el - 144: 1KW 17el - 432: 50W 26el,05/04 -SP5XMU,KO02LG,,,Tomasz ""Tom",,50: 100W 6el 144: 170W 13el 432: 50W 21el,08/04 -SP6A,JO81NG,EME,,Zbigniew,,,11/03 -SP6ASD,JO81LC,,,Tadek,,180lpm,05/02 -SP6AZT,JO81NG,,,,,,2003 -SP6CPH,JO81,,,,,,09/01 -SP6GVU,JO81LC,,,Andrzej (Andy),,144: 17el F9FT 200W MGF1302.073.273,02/01 -SP6GWB,JO80HK,EME,,Staszek ""Stan",,50: FT847 1 kW 9 el (2 lambda) - 144: FT8,02/05 -SP6GZZ,JO80FX,,,Roman,,3000lpm MSDSP200,10/04 -SP6IWQ,JO80HK,,,Bogdan,,TR751e FT757gxII Trnsv 100W Pas,11/04 -SP7BUZ,KO00HU,,,Marcin,,,04/04 -SP7DCS,JO91RT,EME,,Krzysztov ""Chris",,144: FT736r DSP GS35vb (21el.horz.+ 21el.ver,01/01 -SP7EBM,JO91QR,,,Wiktor,,.070.350.,01/02 -SP7JSG,KO01BW,,,,,,03/02 -SP7OGP,KO01AM,,,Piotr,,50: 100W - 144: IC706MKIIG 14el 9BV 50W BF9,01/05 -SP7VC,JO91SS,,,,,,10/04 -SP8AOV,KO11GG,,,Zbigniew ""Zbig",,144: FT480r 100W 2x10el1000lpm,03/00 -SP8NCJ,KO12NA,,,A.,,,11/95 -SP8RHP,KO10FF,,,Robert,,144: 200W 10el DJ9BV122 2000lpm379,12/04 -SP8SN,KO11GG,,,Robert,,,07/04 -SP8UFT,KO11JI,,,,,,01/02 -SP9COO,JO90GA,,,Grzegorz ""Greg",,144: IC251 + PA 100Watt 44el YU0B MGF13020,04/04 -SP9EWO,JN99HW,,,Janusz,,.423.423,12/99 -SP9EWU,JO90NH,EME,,Wojciech,,,07/03 -SP9KUR,KO00MA,,,,,,1993 -SP9LCV,JO90KF,,,Michal,,,05/02 -SP9MRT,JO90KG,,,Sebastian,,.080,12/95 -SP9PRO,JN99,,,Clubstation,,,03/97 -SP9PZU,JO90,,,,,,07/96 -SP9QMP,JO90FB,,,,,,08/02 -SP9TCE,JO90,,,Jurek,,DTR,08/98 -SP9TTG,JO90NU,,,Peter,,144: 100W LY,05/04 -SP9UX,KO00XA,,,,,,07/04 -SQ7DQX,JO91RR,,,Mateusz,,144: 13el 50W,11/04 -SQ8GUP,KN09VQ,,,Waclaw,,,04/01 -SQ9PM,JN99MT,,,Maciek,,FT847 50: 6el - 144: 14el - 432: 29elM,08/03 -SQ9PV,JO90KF,,,Jacek,,,01/03 -SQ9W,JO90NH,EME,,Wojciech,,,07/03 -ST2RS,KK65GN,EME,,Bob,,50: 6el 1KW 144: 4x 8el 140W,01/05 -SV0EC,KN10CJ,EME,,Hardy,,144: TS770 700W 20el Gruppeonly SSB-MS,02/99 -SV1AAF,KM17VX,EME,,,,,1992 -SV1AB,KM18,,,l.,,,1993 -SV1BTR,KM18NO,EME,,Dimitris ""Jimmy",,144: FT847 4x17el. (F9FT) 1.5KW - 432: 8x 3,01/05 -SV1WE,KM18VA,,,Teo,,144: 500W 17el1000lpm,07/98 -SV2DCD,KN00NF,,,,,,10/04 -SV2EVS,KN10KP,,,Spiros,,,04/02 -SV2JL,KN10LO,,,Fotis,,,06/04 -SV3KH,KM07PQ,EME,,Nikos,,144: 100W 12elonly SSB-MS,12/04 -SV5BY,KM46CG,,,,,,2003 -SV5BYR,KM46CG,,,Mike,,144: FT847 2x13el 1KW MGF1302,05/04 -SV8CS,KM07JS,,,Spiros,,144: IC821 + TS2000 17el or 9el Cross 300W,01/05 -T33C,RI49XC,,,,,,2003 -T49C,FL11SG,,,OP Oscar CO2OJ,,50: 4el 100W - 144: 9el 120W - 432: 17el 100W,11/97 -T77WI,JN63FW,,,OP DL3YEL- DJ2QV,,144: 350W 9el 11el,06/98 -T90M,JN82TW,,,,,,08/96 -T90N,JN82TW,,,,,,08/96 -T94KU,JN94JF,,,Esho,,144: FT480r 6el 50Wonly SSB-MS,01/00 -T94ZQ,JN94FP,,,,,only SSB-MS,07/99 -T98CHR,JN84AX,EME,,OP: PA2CHR- PE1LWT,,,04/99 -T98GTH,JN84UU,,,Gigi,,,01/05 -T98LWT,JN84AX,EME,,OP: PA2CHR- PE1LWT,,,04/99 -T9SO,JN94IM,,,Zel,,144: FT480r 8el 150Wonly SSB-MS,08/98 -TF3EJ,HP84,,,Jakob,,,10/95 -TF8ITT,HP94CD,,,Jonas,,144: 1KW ERP,08/02 -TK1DX,JN42RM,,,OP TK5GF,,144: 8el 200W,01/99 -TK5EP,JN41IW,,,Patrick,,144: 400W 9el or 16el 900m.asl.,11/01 -TK5JJ,JN41JW,,,Jan Jacques ""JJ",,144: 3CX800a7 2x 10el DJ9BV MGF1302090,04/03 -TM1E,JN13,,,OP F5SJP- F1JRD,,144: TS790 180W 17B2TX1200 RX 5000lpm,12/99 -TM6OLW,JN37,,,,,,01/05 -TO4E,LG07EQ,,,,,,2003 -TS7N,JM54NQ,,,OP DL6SAQ- 1GGT uva,,144: IC275 HLV600 2x7el FX213MSDSP,11/00 -TV6YGS,IN86,,,,,,1987 -UA1AFA,KO59EV,,,,,,08/02 -UA1ARX,KO48VR,,,OP at RU1AA,,,08/04 -UA1C,KO58BR,,,OP R3VHF,,,1993 -UA1CEA,KO69,,,Roman,,,04/99 -UA1MC,KO59DW,,,Slava,,,08/04 -UA1NAN,KP71ES,,,Eugen,,IC260,01/03 -UA1OLJ,LP03DC,EME,,Vladimir,,144: 150W 9el,12/99 -UA1QV,LO08IW,,,,,144: 300W,06/99 -UA1UM,KO68WJ,,,,,,1988 -UA1WER,KO47EU,,,Igor,,144: 50W 4x17el QSL via DL9USA,01/02 -UA1ZCG,KP59JK,,,,,,2003 -UA1ZCL,KP78TX,EME,,Alex p.,,,1992 -UA2FF,KO04,,,,,,12/04 -UA2FL,KO04FQ,,,slava,,,06/97 -UA3AOG,KO85SQ,,,Igor,,144: IC706 100W 11el1000lpm,07/00 -UA3ARC,KO85SO,,,Alexander,,144 :IC-275H GS-35B MGF1302 2M18XXX,07/04 -UA3DHC,KO96CB,,,Alexandr ""Alex",,,04/04 -UA3DJG,KO95CN,,,,,144: 11el 800W,07/03 -UA3GA,KO92GO,,,Edward,,,11/04 -UA3IAG,KO77FN,,,Boris A.,,,09/99 -UA3IDQ,KO66JF,,,Victor,,,06/00 -UA3MAS,KO97ST,,,,,,1994 -UA3MBJ,KO88SA,EME,,"Nick",,,01/05 -UA3MEE,KO97XN,,,Victor,,,03/01 -UA3MHJ,KO87SR,,,,,,2003 -UA3OG,LO07KS,,,Serge,,,1992 -UA3PBR,KO93BD,,,,,,1986 -UA3PBT,KO84UF,,,,,,1982 -UA3PC,KO84PC,,,Valery,,,08/04 -UA3PTW,KO93BS,EME,,Dima,,144: 16el DJ9BV 1KW - 432: 8 yagis 200W,04/01 -UA3QHS,KO91QR,,,,,,1981 -UA3QR,KO92KA,,,Viktor,,,1992 -UA3RBO,LO03NG,,,,,,11/03 -UA3RFS,LO02SW,,,,,,1980 -UA3T,LO16GM,,,Clubstation,,.143.243,07/03 -UA3TCF,LO26IU,EME,,Alexander,,144: 300W,01/00 -UA3TDB,LO16,,,,,,1979 -UA3TIE,LO16,,,,,,01/97 -UA3UBD,LO06GU,,,,,,1980 -UA3UES,LO07MF,,,alex a.,,,1992 -UA3WM,KO72QI,,,,,,07/04 -UA3XEH,KO73FU,,,,,,08/98 -UA3XFA,KO73DU,,,,,,01/96 -UA3YOZ,KO63QQ,,,Eugine,,144: 150w 10el 2wl bf998355,08/04 -UA3ZAT,KO80,,,,,,1991 -UA4AAV,LO21FC,EME,,Victor,,,04/99 -UA4ALU,LN29LA,EME,,nick,,,1992 -UA4API,LO20QC,EME,,Victor,,,12/99 -UA4AQL,LO20QB,EME,,Aleksandr ""Al",,144: 4x13el DJ9BV Preamp 0.8db 1.2kW(EME),06/03 -UA4CDT,LO41AX,,,,,,1983 -UA4NM,LO48UP,,,Vladimir,,,03/04 -UA4SF,LO36WP,,,,,,1986 -UA4UK,LO14MA,,,Eugeny,,,11/03 -UA6LGH,KN97LF,EME,,Victor,,,07/96 -UA9CGP,MO06RT,,,,,,2003 -UA9CS,MO06FU,EME,,igor,,,1992 -UA9FAD,LO88DA,EME,,Victor,,144: 1KW 4x16el - 432: 1KW 8x15el.037,01/05 -UA9SL,LO71NS,EME,,Vladimir,,,11/04 -UA9XQ,LP63UM,,,,,,01/97 -UA9YLU,MO92EO,EME,,,,,11/04 -UB0QF,KN77NU,,,,,,1988 -UB2GA,KN77AB,,,,,,1990 -UE1TWO,KO67PW,,,,,,07/04 -UL7LU,MO13TD,EME,,victor,,,1992 -UL7TZ,MN52,EME,,,,,1992 -UN7LU,MO13TD,,,,,,2003 -UN7TQ,MN52VV,EME,,Pavel,,,09/98 -UN8AG,LN53PH,,,Alex,,,07/96 -UN8BA,MO51RD,EME,,anatoly,,,1992 -UR3EE,KN88DC,EME,,Artur N.,,,11/02 -UR3EP,KN78WR,,,,,,01/96 -UR4EWF,KN67OW,,,Clubstation,,,07/03 -UR4LL,KO70XG,,,Alex,,,10/00 -UR5BAE,KN29SM,,,Anatoly,,,07/01 -UR5LLW,KN89EQ,,,,,,06/03 -UR5LX,KO70WK,EME,,Sergej Leonidov,,144: 800W 13el BF981.076 DTR 2000,01/05 -UR5M,KN99FD,,,OP UT5EC-UT4EQ,,,94 -UR5RCP,KO51OM,,,vladimir,,,1992 -UR5SKB,KN28IW,,,Vik,,FT847,05/04 -UR7GN,KN66HP,,,Sergey,,,06/96 -UR8IDX,KN87TC,,,Victor,,,07/04 -US0WA,KN29XT,,,n.k.,,,07/95 -US1VQ,KN58XA,,,,,,08/95 -US5CCO,KN59XG,,,Vlad,,,05/02 -US5II,KN88WA,,,Serge,,,08/04 -US5WU,KO20DI,,,boris,,.125,06/02 -UT1E,KN57XX,EME,,Clubstation,,.077,08/03 -UT1EA,KN68RA,EME,,Clubstation,,.077,08/03 -UT1EWA,KN68RA,,,,,,2003 -UT1PA,KO21FC,EME,,Alexander,,,06/98 -UT1Q,KN77,,,,,,08/95 -UT2CO,KN58CR,,,jan,,,1992 -UT2HN,KN79OI,,,Nick,,144: 100W 16el.140 1000lpm,11/03 -UT3BW,KN29UA,,,Igor b.,,,05/99 -UT3LL,KO80AC,,,,,,2003 -UT4EQ,KN78MK,EME,,Nick,,,06/98 -UT5AO,KO61XQ,EME,,vlad,,,1994 -UT5BN,KO40,,,,,,1981 -UT5CO,KN58CQ,,,,,.140,1995 -UT5DL,KN18EP,EME,,w.p. Slava,,,07/02 -UT5EC,KN78MN,EME,,Valery,,,11/99 -UT5EG,KN78GJ,EME,,alex,,,1994 -UT5ER,KN78ER,EME,,Arkady,,144: 4x4.4L DJ9BV 1KW MGF1302.117 DTR 30,01/05 -UT5GU,KN68,,,alex,,,1994 -UT5JAX,KN64RQ,,,vlad,,,1994 -UT5JCW,KN64SN,,,Serge,,50: ic-706mk2 ft-100160,11/03 -UT5UBB,KO50,,,,,,01/04 -UT5UCP,KO50DG,,,Eugen,,,07/01 -UT5VD,KN68MT,,,Anatoly,,,10/04 -UT7GA,KN66HP,,,Alex,,144: 1KW 16el F9FT1000lpm,09/99 -UT7VF,KN68MQ,EME,,Victor,,,06/96 -UT8AL,KO61WP,EME,,aleksandr.,,DTR,08/99 -UU1AA,KN74BV,,,,,,08/04 -UU1DX,KN74BW,,,Oleg,,144: 500W,07/04 -UU5JJ,KN74AV,,,,,,2003 -UW9AH,LO93KK,,,Yuri e.,,,1992 -UX0FF,KN45NI,,,Nikolay,,,07/04 -UX1AS,KO59FX,,,,,,2003 -UX5UL,KO50FL,,,Oleg,,144: IC910H 100W310,07/04 -UY5HF,KN66HP,,,Anatoli,,,06/96 -UY5OE,KO80AB,,,,,,1994 -UZ1OVW,KP94VN,,,anatoly v.,,,1992 -UZ3DD,KO86JH,EME,,,,,1993 -V47YC,FK87,EME,,,,,07/96 -VA2CST,FN35BP,,,Claude,,,2003 -VA2MGL,FN74UQ,,,Marc,,50: 25W 3el,11/01 -VA2PRC,FN46,,,Yves,,50: deltaloop 144: IC706 13el,1998 -VA3LK,FN14TO,,,,,,2003 -VA3NFA,FN25BH,,,Tom,,,2003 -VA5VHF,DO70FJ,,,Michael David,,,2003 -VA6DX,DO33IM,,,Barry,,144: 1KW 4x 2M9,01/01 -VA7MM,CN89OG,EME,,,,,2004 -VE1ALQ,FN65VH,EME,,,,,10/02 -VE1GRT,FN84IQ,,,,,,2003 -VE1KG,FN84CM,EME,,Serge,,4x17el,10/00 -VE1MQ,FN65,,,,,,2003 -VE1RG,FN65,,,Chuck,,144: 170W longyagi,12/00 -VE1SKY,FN74,,,Roger,,50: FT620B 3el,01/01 -VE1TAY,FN66,,,Wade,,,01/01 -VE1XYL,FN65VH,,,,,,2003 -VE1ZJ,FN96UC,EME,,,,144: 1.8KW 6x18el,12/01 -VE2BKL,FN48DJ,,,Roger,,50: 1000W 6el - 144: 150W 19el,04/02 -VE2CST,FN35BP,,,,,,2003 -VE2DIV,FN35BP,,,,,,2003 -VE2PEP,FN46IB,,,Germain,,,08/03 -VE2PIJ,FN35QI,,,Pierre,,50: 6el 40W - 144: 17el 25W - 432: 24el 25,08/04 -VE2UG,FN35,,,,,,2003 -VE2WHZ,FN08WN,,,,,,2003 -VE2YAG,FN19ES,,,,,,2003 -VE3AX,FN02CW,,,Peter,,1.5KW 50-432 multiple Yagi arays.200.200,01/02 -VE3BDR,EN98,,,,,,2003 -VE3BFM,FN04AE,,,,,,2003 -VE3CF,FN03,,,,,,2003 -VE3CVG,FN25HM,,,,,,2003 -VE3DBP,EN94EE,,,,,,2003 -VE3DEW,FN04,EME,,,,,2003 -VE3DIR,FN03,,,,,,2003 -VE3DSS,FN03FQ,EME,,Dana,,.200,07/01 -VE3FAC,FN03IS,EME,,,,,2003 -VE3FAL,EN58DF,,,Fred,,,10/01 -VE3FOD,EN76,,,,,,2003 -VE3JJX,EN29SS,,,,,,2003 -VE3KH,FN03CL,EME,,Kevin D.,,144: 6 x 2MXP28 AzEl 8877 LNA145 LT2S FT1000D,09/99 -VE3KHH,FN03CL,,,,,,2003 -VE3KRP,EN58IJ,EME,,Ed,,,02/05 -VE3NE,FN03FQ,,,Lajos,,,2003 -VE3OQC,FN03,,,,,,2003 -VE3SCP,EN93WV,,,,,,2003 -VE3STZ,EN82,,,,,,2003 -VE3WMD,EN92JN,,,,,,2003 -VE4AAZ,EN19,,,,,,2003 -VE4ACX,EN19,,,,,,2003 -VE4AJB,EO00,,,,,,2003 -VE4AP,EN19,,,,,,2003 -VE4AQ,EN19OR,,,Jim,,144: 1KW 4218XL,01/01 -VE4CCW,EN19,,,,,,2003 -VE4CT,EN19OW,,,,,,2003 -VE4DK,EN19,,,,,,2003 -VE4FV,EN19,,,,,,2003 -VE4GHR,EN19,,,,,,2003 -VE4GLS,EN19,,,,,,2003 -VE4HAY,EN19,,,,,,2003 -VE4JX,EO00,,,,,,2003 -VE4KQ,EN19,,,,,,2003 -VE4KU,EN19,,,,,,2003 -VE4LAR,EN19,,,,,,2003 -VE4MA,EN19LU,EME,,,,,2003 -VE4MBQ,EN19,,,,,,2003 -VE4MHZ,EN19,,,,,,2003 -VE4MX,EN19,,,,,,2003 -VE4OV,EN19,,,,,,2003 -VE4PQ,EN19,,,,,,2003 -VE4RCJ,EN19,,,,,,2003 -VE4RE,EN19,,,,,,2003 -VE4TOM,EN-19,,,,,,2003 -VE4TV,EN19CX,,,,,,2003 -VE4UD,EN19,,,,,,2003 -VE4ZI,EN19,,,,,,2003 -VE4ZK,EN19,,,,,,2003 -VE4ZV,EO10IH,,,,,,2003 -VE5UF,DO61OV,,,Doug,,50: 600W 6el quad - 144: 325W 2x 2M126000lpm,07/01 -VE6AFO,DO21,EME,,,,,2003 -VE6BPR,DO32BG,,,Al,,50: 150W 5el - 144: 250W 16el crossyagi,01/01 -VE6LR,DO21,,,,,,2003 -VE6NA,DO20,EME,,,,,2003 -VE6NTT,DO31,,,Don,,144: 170W 17el,1998 -VE6PY,DO20WW,,,,,,2003 -VE6TA,DO33GS,EME,,Grant,,432: 5m dish 800W,08/00 -VE6XT,DO,,,,,,2003 -VE7BBG,CN88,EME,,,,,12/00 -VE7BEE,DN09HG,,,,,,2003 -VE7BQH,CN89KI,EME,,Lionel,,384el Collininar,03/00 -VE7CFT,CN79ST,,,Russ,,,2003 -VE7CLD,CN89LD,EME,,,,,2003 -VE7DXG,CN88DT,,,Gabor,,50: 150W 5el - 144: 150W 15el,05/03 -VE7FYC,CN89,,,,,,2003 -VE7KPB,DN29CM,,,Ken,,144: 1KW 5wl M2,06/01 -VE7MDL,CN89,,,Erik,,only SSB-MS,1998 -VE7RJ,DN09LL,,,,,,2003 -VE7SKA,CN88GT,,,Mike,,4000lpm,01/01 -VE7US,CN88IG,,,Reg,,,2003 -VE7VVW,DO00IF,,,Ron,,144: 160W KLM2m22c - 432: 100W MBM88,01/02 -VE7ZD,CN89LG,,,,,,2003 -VE9AA,FN65RS,,,Michael,,,01/02 -VE9PA,FN65SU,,,,,,2003 -VK1VP,QF44NR,EME,,,,,89 -VK2ALU,QF55KN,EME,,,,,2003 -VK2BE,QF56NC,EME,,,,,2003 -VK2CZ,QF56NH,,,David,,,2003 -VK2DJG,QF59VK,,,Gordon,,,2004 -VK2FLR,QF56OD,,,,,,2003 -VK2JKK,QF69LO,,,Wayne,,,2003 -VK2KU,QF55AI,EME,,Guy,,144: 400W 4x 12el,01/05 -VK2XCI,QF27WD,,,Norm,,,2003 -VK3AMZ,QF22IC,EME,,arie,,,1993 -VK3AXH,QF12WJ,,,Ian,,,2003 -VK3CY,QF13,EME,,,,,04/00 -VK3HY,QF22PD,,,Gavin,,,2003 -VK3HZ,QF22ME,,,David,,,2003 -VK3OT,QF12AG,EME,,steve,,,1994 -VK3UM,QF22RO,EME,,,,,2003 -VK4AFL,QG62OJ,EME,,,,,2003 -VK4APG,QG62LP,EME,,peter,,,1994 -VK4CDI,QG52XH,,,Phil,,144: 10el 170W,01/05 -VK4JSR,QG62NM,,,Scott,,50: 100W 8el - 144: 400W 12el - 432: 100W 28e,10/00 -VK4KAZ,QG63KQ,EME,,,,,2003 -VK5DK,QF02JE,,,Colin,,,2003 -VK5MC,QF02EJ,EME,,,,,89 -VK5OA,QF02JE,,,Kevin,,,2003 -VK6KDD,OG99HP,EME,,Ron,,LT2S LT6S TS850,01/05 -VK7MO,QE37PC,EME,,,,,12/04 -VK9CD,NH87JU,,,,,,2003 -VK9XW,OH29TI,,,,,,2003 -VP2EC,FK88LD,,,,,,2003 -VP2MIS,FK86UV,EME,,,,,11/00 -VP2MR,FK86VS,,,,,,2003 -VP5JM,FL31VS,,,,,,2003 -VQ9LA,MI62,EME,,,,,09/02 -VS6BI,OL72CG,,,,,,2003 -VT3AT,RJ38UR,,,,,,2003 -W0AH,DM78LX,EME,,Doug,,,01/01 -W0AUS,EN35KA,,,,,,2003 -W0BJ,DN91OD,,,,,,2003 -W0DB,EN11VD,,,Joe,,144: 50W 2x 8el,09/01 -W0DEN,EN41,,,,,,2003 -W0DFK,EM47LX,,,,,,2003 -W0DJM,EN25XK,,,,,,2003 -W0DQY,EM48RS,,,Glenn ""Smitty",,144: 350W 4x8el - 432: 175W 2x88el - 1296: 10,01/01 -W0EKZ,EM17,,,,,,2003 -W0ETT,DM79,,,,,,2003 -W0FMS,EN42EB,,,,,,2003 -W0FY,EM48,,,,,,2003 -W0GAJ,EN11,,,,,,2003 -W0GC,EN14SQ,,,Gary,,,2003 -W0GHZ,EN34,,,,,,2003 -W0GN,EN42,,,,,,2003 -W0GR,EM38AX,,,,,,2003 -W0HHE,DM79,EME,,,,,2003 -W0HL,EM27,,,,,,2003 -W0HRG,EM39,,,,,,2003 -W0IC,DM79MR,,,,,,2003 -W0IOH,DM78OU,,,Bill,,,01/01 -W0IPL,DN62UU,EME,,,,,2004 -W0ITB,DM79,,,,,,2003 -W0IZ,EN41,,,,,,2003 -W0JRP,EM27RB,,,,,,2003 -W0KFG,DN96OT,,,Dick,,,09/01 -W0KJY,DN71,EME,,,,,89 -W0KRX,EN34LM,,,,,,2003 -W0LD,DM78,,,Lauren D.,,144: 1KW 2x16el,04/01 -W0LER,EN35IE,,,John,,,01/01 -W0LMD,DM79,,,,,,2003 -W0MD,EN36,,,,,,2003 -W0MXY,DM78,,,,,,2003 -W0NKN,EN42,,,,,,2003 -W0OF,EM12,,,,,,2003 -W0OHP,EN10,,,,,,2003 -W0OHU,EN34OA,,,,,,2003 -W0OZI,EN35,,,,,,2003 -W0OZL,DN60FM,,,,,,2003 -W0PEC,EN34,,,,,,2003 -W0PHD,EN18OE,,,Wally,,144: 190W 16lbx,09/01 -W0PPF,EN41,,,,,,2003 -W0PT,EM28OD,EME,,Bill,,144: 4X 19XXX and 1.2kw,12/00 -W0PW,EM26TW,,,,,,2003 -W0QIN,EN34,,,,,,2003 -W0RAP,EN42EB,,,,,,2003 -W0RGU,EN35,,,,,,2003 -W0RKP,EN31,,,,,,2003 -W0RRY,EM26BX,EME,,Charlie,,144: 700W 9elM2 0.6db Preamp,01/01 -W0RSJ,FN20JQ,,,,,,2003 -W0RTZ,DM79,,,,,,2003 -W0RWH,EM39SX,EME,,Donald,,144: 16x19elonly SSB-MS,10/98 -W0SD,EN13GQ,EME,,,,,89 -W0SII,DN71,,,,,,2003 -W0TJ,EN10,,,,,,2003 -W0UC,EN35,,,,,,2003 -W0UHF,EN32,,,,,,2003 -W0UN,EL07FV,,,,,,2003 -W0UT,EM17,,,,,,2003 -W0VB,EN34SB,,,Terry,,,01/01 -W0VD,EM27UD,EME,,Dan,,144: TS790A 8877 (1-5KW) 18elM2,01/01 -W0VX,EM12,,,,,,2003 -W0WGZ,EN42,,,,,,2003 -W0WTG,EM48,,,,,,2003 -W0XG,EN34QX,,,,,,2003 -W0YPT,EN43,,,,,,2003 -W0ZJY,EM28,,,,,,2003 -W0ZQ,EN34IU,,,,,,2003 -W0ZZQ,EM26,,,,,,2003 -W1CDO,CN87XF,,,John,,,2004 -W1COT,FN31ST,,,Bob,,,2004 -W1CQD,FN34MR,,,Clair,,,2004 -W1FIG,FN41GV,EME,,Maarten,,50: 1KW 2x7el - 144: 9el M2 1KW 0.8db - 22,01/01 -W1FM,FN42,,,,,,2003 -W1GHZ,FN42,,,Paul,,,01/01 -W1HY,FN41HV,,,Paul,,,2003 -W1IPL,DN62UU,EME,,,,,02/05 -W1JR,FN42HN,EME,,,,,89 -W1LP,FN41SR,,,Clint,,144: 1KW 2x2M9,01/01 -W1QC,FN42HU,EME,,,,,2003 -W1REZ,FN55,,,,,,10/00 -W1RZF,FN42FC,,,arthur,,,2004 -W1TE,FN42EN,,,Charley,,50: 1KW 7el - 144: 1KW 22el - 432: 44el,08/01 -W1UHE,FN41,,,,,,2003 -W1VT,FN33KE,,,,,,2003 -W1XE,DM79GW,,,,,,2003 -W1XR,FN42HW,,,,,,2003 -W1ZC,FN42DR,,,Dick,,144: 1KW - 432: 36el,01/02 -W1ZX,FM18LG,,,,,,2003 -W2AXU,FN20OG,,,,,,2003 -W2BZY,EL98HR,,,Bob,,50: 700W 7el - 144: 160W 17el - 222: 120W 23e,09/01 -W2CRS,DM78,,,,,,2003 -W2DRZ,FN02LA,EME,,,,,01/01 -W2ETI,FN21,EME,,,,,2003 -W2HBA,FN31TC,,,GEORGE,,,2003 -W2MPK,FN23BA,EME,,Don,,,10/99 -W2SZ,FN22,,,,,,2003 -W2UHI,EN73AH,EME,,,,,2003 -W2VU,FN20,,,,,,2003 -W2WD,FN20TP,EME,,Warren,,432: 20ft portable dish 1KW,08/00 -W3ARS,FK88LC,,,,,,2003 -W3BDP,FM29,,,,,,2003 -W3BW,FN30AS,,,,,,2003 -W3EME,CN85BE,EME,,Brian,,144: Icom 746 MGF2430A MGF1302 4x14el X-P,01/05 -W3HQT,FN54,,,,,,2003 -W3IKE,FM18SW,,,,,,2003 -W3IOA,EM00,,,,,,2003 -W3IWI,FM19ME,,,,,,2003 -W3KJ,FN20HG,,,Joseph,,,2003 -W3MRG,FN10UB,,,,,,2003 -W3RY,FN10LL,,,,,,2003 -W3SDZ,FN11,,,,,,2003 -W3SE,DM03WW,,,Wes,,50: 50W 5el - 144: 150W 12el,04/02 -W3SZ,FN20AH,,,Roger,,144: 150W 9el - 432: 100W 9wl. - 1296: 10W 4x,01/01 -W3TMZ,EL88SU,,,,,,2003 -W3TWO,FM28CA,,,Daniel C.,,144: 400W M2,07/01 -W3UUM,EL29PW,,,Matt,,144: 170W 12el,01/02 -W3VH,FN32HG,EME,,,,,2003 -W3WJR,FN20LL,,,,,,2003 -W3XO,EM00KD,,,,,,2003 -W3XS,FN10,EME,,,,,2000 -W3ZZ,FM19JD,,,Gene,,50: 1-5kw 8el 144: 1-5kw 17 el - 432: 1Kw 33e,07/01 -W4ABC,EL87PT,,,Jon,,50: 100W 7el qubical quad,01/01 -W4AD,FM18IP,EME,,Jack,,,07/01 -W4AME,EM75FG,,,,,,2003 -W4CHA,EL88QA,,,Chuck,,50: 150W 9el M2 - 144: 1-5KW 2M18xxx - 432: 5,01/01 -W4CN,EM17JP,,,Mike,,,09/01 -W4DEX,EM95,EME,,,,,2003 -W4ET,EM56TP,,,RON,,,2004 -W4FJ,FM17,,,,,,2003 -W4GHW,EM81EQ,,,Greg,,,2004 -W4HTB,EM66,,,,,,2003 -W4KXY,EM84,,,James,,,01/01 -W4LNG,EM73VK,,,,,,2003 -W4MOP,EM78,,,,,,2003 -W4OZK,EM73,,,,,,2003 -W4PJV,EM65SU,,,,,,2003 -W4PZA,EM66NC,,,,,,2003 -W4RBO,EL99KF,,,John,,,2003 -W4RDI,EL96BQ,EME,,,,,2003 -W4REB,EM78,,,,,,2003 -W4RFR,EM65,,,,,,2003 -W4SM,FM08QA,EME,,,,,2004 -W4SW,FM18IW,EME,,,,,06/00 -W4TAS,EL87UW,,,,,,2003 -W4TJ,FM08,EME,,,,,06/00 -W4TNV,FM05XD,,,,,,2003 -W4UDH,EM52AG,,,Smitty,,,01/01 -W4UDQ,EM55DB,,,,,,2003 -W4UE,EM90GC,,,john,,,12/97 -W4VHF,EM95,,,,,,2003 -W4WD,DN40AM,,,,,,2003 -W4WDH,EM83,,,,,,2003 -W4WHN,EL94HP,,,Dean,,,09/01 -W4WSR,EL85CB,,,Ott,,,01/01 -W4WTA,EM83XJ,,,Ace,,144: 160W 18el,11/01 -W4XP,FM18EW,EME,,Chuck,,.100.200,08/01 -W4ZD,EL79HH,EME,,bev,,,1993 -W4ZPG,EM73WU,,,,,,2003 -W4ZRZ,EM63SS,,,,,,2003 -W5AK,EL29,,,,,,2003 -W5AL,DM95XB,,,Len,,50: 150W - 144: 1KW 18el M2 - 222: 130W - 432,01/01 -W5CTV,EL49WU,,,,,,2003 -W5DBY,EM12,,,,,,2003 -W5DID,EL29,,,,,,2003 -W5DKE,EM12LL,,,,,,2003 -W5DS,EM15,,,,,,2003 -W5ETG,EM12LS,,,,,,2003 -W5FR,EM12KX,,,Harold,,,2003 -W5FYZ,EM32,,,,,,2003 -W5GDL,EM15GM,,,,,,2003 -W5GEL,EL17,,,,,,2003 -W5GG,EM12,,,,,,2003 -W5GKO,EM35,,,,,,2003 -W5GNB,DM73VB,,,Gary,,,2003 -W5GVE,EM01,,,,,,2003 -W5HES,EM12HQ,,,,,,2003 -W5HPT,EM12,,,,,,2003 -W5HTZ,EM16,,,,,,2003 -W5HUQ,EM35BC,,,John,,,07/01 -W5ITI,EM32,,,,,,2003 -W5IU,EM12HP,,,,,,2003 -W5IXR,DM76,,,,,,2003 -W5JBP,EM12,,,,,,2003 -W5KI,FM29PU,,,,,,2003 -W5KLF,EM31PJ,,,Keith,,,2003 -W5KQJ,EM12BS,,,,,,2003 -W5LBT,EM40KV,EME,,R.A. Bob,,,08/01 -W5LUA,EM13QC,EME,,,,,2003 -W5LUU,EL09QO,EME,,Derwin,,144: FT736r 1.5KW 4x5wl - 432: 1.5KW 1x5wl,08/01 -W5MRF,EM12,,,,,,2003 -W5NFC,EM10,,,,,,2003 -W5PIC,EM16LJ,,,,,,2003 -W5PLN,EM12,,,,,,2003 -W5RCI,EM44UF,EME,,,,,89 -W5SNX,EM73WT,,,Dick,,50: 150Watts 6M7JHV @65ft - 144MHz : 500Wat,01/02 -W5SXD,EL29,,,,,,2003 -W5TCD,EM 12,,,,,,2003 -W5TVG,EM26,,,,,,2003 -W5UC,EM21PI,EME,,Mike,,,01/05 -W5UMB,EL17AX,,,,,,2003 -W5UN,EM23MG,EME,,Dave,,144: 32x 2M5WL129,12/04 -W5UPR,EL29,,,,,,2003 -W5UWB,EL17AX,EME,,John,,50: 1000W 6el - 144: 1500W 17el - 222: 17el 1,02/05 -W5VUY,EM40,,,,,,2003 -W5WJP,EM12HO,,,,,,2003 -W5YUO,EM12,,,,,,2003 -W5ZN,EM45DH,EME,,Joel,,,12/00 -W6CAP,DM14,,,Cap,,144: FT726r 1KW 2yagis,01/01 -W6CPL,DM04,,,,,,2003 -W6FC,DM03,,,,,,2003 -W6HD,CM98PF,EME,,,,,2003 -W6IZU,CM98NO,,,,,,2003 -W6KH,CM97,,,,,,2003 -W6MT,CM87XH,,,,,,2003 -W6NQ,DM13,,,,,,2003 -W6OMF,CM98AK,,,Larry,,144: 650W 2x17el - 222: 120W 7wl - 432: 17,01/01 -W6OYJ,DM12,,,,,,2003 -W6QT,CM87,,,,,,2003 -W6TE,DM06CT,EME,,,,,2003 -W6US,DM13JA,,,,,,2003 -W6WE,CM95RD,EME,,mike,,,11/03 -W6YLZ,DM04RF,,,Mike,,50: 80W 4el - 144: 150W 14el,01/01 -W6YX,CM87WJ,EME,,,,,2004 -W7ALW,DN36AT,EME,,Barrie,,50: 8877 9el - 144: 400W 2x18xxx - 432: 200W,01/01 -W7AMI,DN13VO,EME,,Terry,,4x 28el 750W,01/05 -W7ANF,DM43AS,,,Jim,,144: 15W Vertical,07/01 -W7AV,CN96QN,,,,,,2003 -W7BBM,DM42MB,EME,,,,,2003 -W7CI,DM41UN,EME,,,,,89 -W7CNK,EM15FI,,,,,,2003 -W7CQ,CN83JX,,,Jimmy,,,2003 -W7CS,DM42OO,EME,,Chuck,,50: 1.5KW 7el - 144: 500W 4x13el - 432: 500W,08/01 -W7DHH,DM48LL,,,,,,2003 -W7DWW,CN87,,,,,,2003 -W7EME,CN85BE,EME,,Jeremy,,144: FT736r Mutek DSP Preamp 8877 8x8 wl,01/05 -W7EW,CN84LV,,,Lew,,FT1000MP 144: 1-5KW,08/03 -W7FG,EM26BQ,EME,,Gary,,50: 100W 6el - 144: 1.5KW 80el MGF1302,09/02 -W7FN,CN88SA,EME,,,,,89 -W7GBI,DM43AN,EME,,,,,2003 -W7GJ,DN27UB,EME,,Lance,,50: 4x 9el 1.5KW 144: 16x 17el 1.5KW MGF1,11/04 -W7GTM,CN87VU,,,Grant,,,2003 -W7GZ,DM42NF,,,,,,2003 -W7ID,DN13UN,EME,,,,,89 -W7IUV,DM07DG,EME,,Larry,,,01/05 -W7IXL,DM03US,,,,,,2003 -W7JF,DN55RS,,,,,,2003 -W7JW,EN82HJ,,,,,,2003 -W7KK,DM18,EME,,OP: N7MSD NS9E,,144: 2 x 18XXX at 40'/50' KW Output FT847,04/01 -W7LD,DM78OV,,,,,,2003 -W7MEM,DN17NT,EME,,Mark,,50: 600W 9el - 144: FT726r 2002A 800W 4x5wl,09/01 -W7NS,DM33WP,,,,,,2003 -W7NTF,CN87TB,,,Gary,,50: 160W 6el - 144: 160W 13elMSDSP 10000lpm,01/01 -W7OJT,DM26KB,,,Dave,,,2005 -W7PW,DM09JI,,,,,,2003 -W7QX,DM44AR,EME,,Jerry,,1296: 10 1/2Dish 75Watt,03/04 -W7SZ,CN85UO,EME,,Larry,,432: 4x32el X-pol 1.5KW - 1296: 3m dish 500W,01/00 -W7TVF,DM26,EME,,,,,2003 -W7VQQ,DM19,EME,,,,,2003 -W7VX,DM03TV,,,,,,2003 -W7XU,EN13LM,,,Arliss,,144: 1-5KW,08/03 -W7ZRC,DN13,EME,,,,,2003 -W8ATH,EN80,EME,,,,,2003 -W8BYA,EN70JT,EME,,Gedas,,144: 2x 17elB2 650W Preamp,02/05 -W8CM,EM13,,,Mike,,50: IC575H 800W 7el - 144: IC275H 800W 4x9el,01/02 -W8CRZ,EN80TB,,,Rob,,,2004 -W8DQ,EM79NC,,,Robert,,,2004 -W8HOM,EN71LA,,,,,,2003 -W8IDU,EN83,EME,,,,,89 -W8KSE,EM80,,,,,,2003 -W8LON,EN73JB,EME,,Lon,,,02/05 -W8MGJ,EM79,,,,,,2003 -W8MM,EM79SD,,,,,,2003 -W8MQW,EN72UR,EME,,,,,2003 -W8OUD,EM79RJ,,,,,,2003 -W8PAT,EN81VG,EME,,,,,12/04 -W8SCA,EM79UN,,,Phillip,,,2004 -W8TAH,EN91CD,,,Timothy,,,2003 -W8TL,FM09BM,,,Burt,,50: FT767 1KW 11el - 144: FT736 1KW 17B2,01/01 -W8TN,EM98AK,EME,,Clark,,,07/01 -W8VHF,EN64,,,,,,2003 -W8WN,EM77BQ,EME,,Shelby,,50: 600W 4el - 144: 1-2KW 4x16el KLM - 432: 1,07/01 -W9BLI,EN64DK,,,,,,2003 -W9BN,EM34TT,,,,,,2003 -W9CGI,EN60WC,,,Dave,,,2003 -W9DWP,EN52,,,,,,2003 -W9EME,EN54AL,,,,,,2003 -W9EQI,EM49,,,,,,2003 -W9FX,EM57MX,,,Brad,,144: 1KW 17el,07/01 -W9FY,EN52,,,,,,2003 -W9FZ,EN43,,,,,,2003 -W9GIR,EN44OG,,,,,,2003 -W9GM,EN43JU,,,Ken,,50: 100W 6el - 144: 100W 13el,05/02 -W9HLY,EN70NT,,,,,,2003 -W9IIX,EN61DR,,,,,,2003 -W9IP,FN24KO,,,,,,2003 -W9JMS,EM69,,,,,,2003 -W9JN,EN54DN,,,John,,50: 1KW 6el - 144: 1KW 2x17B2 - 222: 150W 7wL,01/02 -W9JUV,EN52,,,,,,2003 -W9KFB,EN60,,,,,,2003 -W9KHH,EN63AH,,,,,,2003 -W9LT,EN52XG,,,Thomas,,,2004 -W9NHE,EN53,,,,,,2003 -W9NLP,EN52WN,,,,,,2003 -W9NTP,EM79,,,,,,2003 -W9NWR,EN55FW,,,Charles,,,2004 -W9RVG,EM57RN,EME,,Marshall,,IC746 IC910H FT736,02/05 -W9VA,EN62,,,,,,2003 -W9VNE,EM79,,,,,,2003 -W9XA,EN51,,,,,,2003 -W9XT,EN53,,,Gary,,,1998 -W9ZIH,EN51NV,,,,,,2003 -WA0AUQ,EN41,,,,,,2003 -WA0BWE,EN34LX,,,Gary,,,1998 -WA0CQG,EN34,,,,,,2003 -WA0DXZ,EN41,,,Bob,,,01/97 -WA0ETH,EM38PH,,,,,,2003 -WA0JDU,EN34,,,,,,2003 -WA0JMP,EN34,,,,,,2003 -WA0JYF,EN42,,,,,,2003 -WA0MWW,EN30VX,,,Ron,,,2004 -WA0NOK,EM28,,,,,,2003 -WA0QII,CM97,,,,,,2003 -WA0RDX,EM17,,,,,,2003 -WA0RJT,EN41,,,,,,2003 -WA0SJR,EM56,,,,,,2003 -WA0TAQ,EN61QU,,,Jonathan,,,2004 -WA0VSL,DM79OB,,,Doug,,50W,08/04 -WA0WPJ,EM29,,,,,,2003 -WA0WQI,EM55AA,,,,,,2003 -WA0WRI,EN10,,,,,,2003 -WA1FVJ,FN31QS,,,Ed,,144: 13B2 40W,08/04 -WA1HOG,FN42AS,,,Dennis,,144: 100W,01/01 -WA1JOF,FN44XV,EME,,,,,2003 -WA1JXN,DN27UB,,,,,,2003 -WA1MBA,FN32SL,,,,,,2003 -WA1MEK,FN42,,,,,,2003 -WA1MKE,EN70GH,,,,,,2003 -WA1OFR,FN42MA,,,Bob,,,01/01 -WA1TMQ,FN31OJ,,,john,,,2003 -WA2ALV,FN33,,,,,,2003 -WA2FGK,FN21ML,EME,,Herb,,144: 4x17B2 Ant.,01/01 -WA2FUZ,FN22XJ,,,,,,2003 -WA2GFP,FN20,,,,,,2003 -WA2JGY,DM79,,,,,,2003 -WA2LSE,FN20,,,,,,2003 -WA2LTM,FN20,,,,,,2003 -WA2VOI,EN35JA,,,,,,2003 -WA2YJF,FN30FR,,,,,,2003 -WA3BZT,FM29EP,EME,,Ed,,144: IC746 8877 1-5KW 4x2MXP28,07/01 -WA3FFC,FN01,EME,,,,,2003 -WA3KQA,EM98LL,,,,,,2003 -WA3RQD,FM19QK,,,Jim,,,2003 -WA3SIX,FN10UB,,,,,,2003 -WA3USG,FN10LL,,,,,,2003 -WA4ALJ,EM63,,,,,,2003 -WA4CHA,EL88QA,,,,,,2003 -WA4DFS,EM96,,,,,,2003 -WA4EWA,EM63LL,,,,,,2003 -WA4HEI,EN65UX,,,,,,2003 -WA4HFN,EM55AB,,,Damon,,,09/01 -WA4JQS,EM77TA,,,Anthony ""Tony",,144: 2x33el 2.5WL50.10050.125,08/01 -WA4LBT,EM95,EME,,,,,2003 -WA4OFS,EL98,EME,,,,,2003 -WA4PCS,EM78,,,,,,2003 -WA4PGJ,EM55,,,,,,2003 -WA4PGM,FM07TI,,,Kyle,,144. 170W 17el,1998 -WA4VWR,EM55,,,,,,2003 -WA4YRK,EM75WV,,,Dave,,IC910 IC756,05/02 -WA4ZTK,EM85,EME,,,,,2003 -WA5CJG,EM15,,,,,,2003 -WA5DJJ,DM62PH,,,,,,2003 -WA5ETV,EM15,EME,,,,,2003 -WA5ICW,EM26,EME,,,,,2003 -WA5IYX,EL09,,,,,,2003 -WA5JAT,EM12ET,,,,,,2003 -WA5JCI,EM21,,,Pete,,,01/01 -WA5KBH,EM30HL,,,,,,2003 -WA5NFC,EM45,,,,,,2003 -WA5TKU,EM13II,,,,,,2003 -WA5TNY,EM12,,,,,,2003 -WA5UAJ,EM32,,,,,,2003 -WA5UFH,EL19,,,,,,09/01 -WA5VKS,EM13PA,,,,,,2003 -WA5WCP,EM12,,,,,,2003 -WA5YOU,EM53EE,,,,,,2003 -WA5YWC,EM13OB,,,,,,2003 -WA5ZIB,EL29,,,,,,2003 -WA6BJE,DM13,EME,,,,,2003 -WA6BYA,CM86,,,,,,2003 -WA6EIW,EM15DI,,,,,,2003 -WA6ERB,DM79,,,,,,2003 -WA6GXF,DM06DX,,,,,,2003 -WA6IJZ,DM44KM,,,,,,2003 -WA6KBL,CM97AG,EME,,,,,2003 -WA6KOU,DN17,,,,,,2003 -WA6LHD,CM88XF,,,Ed,,,01/97 -WA6OWM,DM03TU,,,Ray,,50: 100W Loop - 144: 100W 15el155 3000 MSDSP.,09/01 -WA6PY,DM13LA,EME,,Paul,,2x20el VE7BQH 700W,01/05 -WA6TTY,DM78,,,,,,2003 -WA6UCT,DM34,,,,,,2003 -WA6YGB,DM04WA,,,Howard,,,2003 -WA6ZKY,CM98,EME,,,,,2003 -WA7ADK,DN31WD,EME,,Jerry,,,01/05 -WA7BJU,CN85,,,,,,01/05 -WA7CJO,DM33XL,EME,,,,,2003 -WA7EPU,DM62,,,,,,2003 -WA7GSK,DN13SO,,,Al,,144: 300W 2x16el,01/02 -WA7HQD,DN31XA,,,Lee E.,,,1998 -WA7KHO,DN47,,,,,,2003 -WA7TZY,CN87,EME,,,,,12/00 -WA8CLT,EN80LA,EME,,John,,144: 1500W 4x9M2,08/03 -WA8EUU,EN82,,,,,,2003 -WA8MIL,EN63,,,,,,2003 -WA8NLC,EM73,,,,,,2003 -WA8OGS,EM79,,,,,,2003 -WA8RJF,EN91IQ,,,Tony,,,12/96 -WA8VPD,EN82,EME,,,,,2003 -WA8WZG,EN81OM,EME,,Tom,,.144,01/01 -WA8YTB,EN72JH,,,,,,2003 -WA9BTT,EN40,,,,,,2003 -WA9BVS,EM69WV,,,,,,2003 -WA9ENA,EN42,,,,,,2003 -WA9FWD,EN53,EME,,,,,2003 -WA9HCZ,EN43JV,,,,,,2003 -WA9HIR,EN61CU,,,,,,2003 -WA9HUV,EN51,,,,,,2003 -WA9JML,EN51PW,,,Steve,,,01/01 -WA9NBU,DM14JG,,,Bob,,,2004 -WA9NRB,EM48,,,,,,2003 -WA9O,EN62BX,,,,,,2003 -WA9OUU,EM89,EME,,,,,2003 -WA9PAM,EN44,,,,,,2003 -WA9PSI,EN51,,,,,,2003 -WA9PZL,EM32DN,,,,,,2003 -WB0CLL,EM28,,,,,,2003 -WB0CQO,EN31,,,,,,2003 -WB0DBS,EM17,,,,,,2003 -WB0DGF,EN10PT,,,,,,2003 -WB0DRL,EM18CT,EME,,,,,89 -WB0GAZ,DM79,,,,,,2003 -WB0GGM,EN34,EME,,,,,89 -WB0HXY,EN10,,,,,,2003 -WB0ITA,EM29,,,,,,2003 -WB0IUT,EN10,,,,,,2003 -WB0LJC,EN34JV,,,,,,2003 -WB0MLL,EN35,,,,,,2003 -WB0NCR,EN42,,,,,,2003 -WB0OOL,EM48,,,,,,2003 -WB0QGH,EM84,,,,,,2003 -WB0QIY,EN10,,,,,,2003 -WB0QQS,EN10,,,,,,2003 -WB0SIP,EN10,,,,,,2003 -WB0TEM,EN12RT,EME,,,,,89 -WB0VGI,EN34LL,,,,,,2003 -WB0YFL,EN42,,,,,,2003 -WB0YRQ,EN12,,,,,,2003 -WB0ZJP,EM48,,,,,,2003 -WB1FLD,FN42IW,,,David W.,,,01/02 -WB1GQR,FN33KL,,,Mitch,,,2004 -WB2BYP,FN13FF,EME,,,,144: 4x 9el 8877,01/05 -WB2LSP,FM29DP,,,,,,2003 -WB2OYC,FM29NN,,,,,,2003 -WB2QLP,EL96DE,,,Jordan,,50: 400W- 144: 400W- 432: 170W,01/01 -WB2SEB,FN31DD,,,,,144: 175W 13el - 222: 100W 10el,03/02 -WB2VVV,FN21,EME,,,,,2000 -WB4AXQ,EM64,,,,,,2003 -WB4BKC,EL96,EME,,,,,89 -WB4ECR,EM66QF,,,Michael,,,2004 -WB4EFZ,EM94,,,,,,2003 -WB4GTB,EM73VW,,,john,,,2003 -WB4JEM,EL89QU,,,Jon,,50: 6elQuad 500W - 144: 16x10el preamp 1-5KW,01/01 -WB4KMH,EM75RV,,,Phil,,,01/01 -WB4LHD,EM55DB,EME,,Randy,,,02/05 -WB4NFS,FM18HP,,,Jack,,144: 400W,01/97 -WB4UNA,EM93LV,,,Randy,,ft-736Rr FT847 50: 400W 617 - 144: 250W 17B2,01/05 -WB5AFY,EM04ID,EME,,Dan,,,02/05 -WB5APD,EM84AK,,,Bob,,144: 1.5kw 17 el,01/01 -WB5DSH,EM15,,,,,,2003 -WB5IPM,EM12,,,,,,2003 -WB5KDC,EM15,,,,,,2003 -WB5KYK,EM51JQ,,,,,,2003 -WB5LBT,EM40LK,EME,,R.A. Bob,,,01/01 -WB5NIF,EM42AM,,,,,,2003 -WB5ROR,EM23,,,,,,2003 -WB5TBL,EM12,,,,,,2003 -WB5TCO,EN64,,,,,,2003 -WB5VPC,EM12,,,,,,2003 -WB6WLR,DM13AT,,,Wayne,,144: 8877 2x17B2 - 432: 8938 2xFO33,01/01 -WB7OSE,CN87XT,,,,,,2003 -WB8AGV,EN34,,,,,,2003 -WB8IFM,EM79WS,,,,,,2003 -WB8NUT,EM79UB,,,Duffy,,,2003 -WB8SKP,EN66UC,,,DENIS,,,2004 -WB8TFV,FM19AL,,,,,,2003 -WB8WTB,EN72,,,,,,2003 -WB8XX,EM79,,,Kevin,,,12/00 -WB9BWP,EN52,,,,,,2003 -WB9GKA,EM58,,,,,,2003 -WB9HLM,EN52IW,,,,,,2003 -WB9IHS,EM69,,,,,,2003 -WB9IIV,EM69UL,,,Harry,,,2004 -WB9OGM,EN61,,,,,,2003 -WB9OWN,EN52,,,,,,2003 -WB9SNR,EN62AC,,,,,,2003 -WB9SPT,EN71AS,,,,,,2003 -WB9USX,EM79,,,,,,2003 -WB9UWA,EN50KK,EME,,Jim,,144: 4x UWA12's 18.5 dbd low temperature MC2,10/00 -WB9ZAI,EN61GM,,,,,,2003 -WC9C,EM69HH,,,,,,2003 -WD0AAD,DM79,,,,,,2003 -WD0ALN,EM32,,,,,,2003 -WD0APF,EN10,,,,,,2003 -WD0BQM,DN81CW,,,,,,2003 -WD0CJM,EN25FH,,,,,,2003 -WD0EDO,EN10TL,,,,,,2003 -WD0FCH,EM48,,,,,,2003 -WD0GML,EM48,,,,,,2003 -WD0HOJ,EN41,,,,,,2003 -WD0L,EM17IH,,,,,,2003 -WD0M,DM67KG,,,Joe,,,2004 -WD4ECK,CN82,,,,,,2003 -WD4FAB,EL98HP,,,,,,2003 -WD4KPD,FM15MM,,,David Michael,,,05/02 -WD4MUO,DM79GX,,,,,,2003 -WD4OZN,EM55LK,,,,,,2003 -WD5AGO,EM26BD,EME,,Tommy,,,03/00 -WD5CAN,EM36,,,,,,2003 -WD5CAP,EM36,,,,,,2003 -WD5DJT,EM12OO,,,,,,2003 -WD5EWD,EM22,,,,,,2003 -WD5G,EM05,,,,,,2003 -WD6BXE,DM22,,,,,,2003 -WD8BYA,FM18IP,,,,,,2003 -WD8SDL,EM79,,,,,,2003 -WD9BGA,EN53BA,,,,,,2003 -WD9EGE,EN64,,,,,,2003 -WD9EXD,EN61,,,,,,2003 -WD9FBL,EN61BV,,,,,,2003 -WD9IIX,EN61,,,,,,2003 -WE2Y,FN02SR,EME,,,,,2003 -WE4K,EM77BQ,,,,,,2003 -WE7L,DM41,,,,,,2003 -WE7P,DN13RP,EME,,,,,2003 -WE9D,EN52,,,,,,2003 -WE9Y,EN82EW,EME,,,,,02/05 -WF1F,FN42,,,,,,2003 -WF1R,FN32,,,,,,2003 -WF4R,FM16TS,,,,,,2003 -WF9M,EM79,,,,,,2003 -WH6LR,EM04LL,,,,,,2003 -WJ6T,DM05,,,Bob,,,1998 -WK9E,EN53,,,,,,2003 -WL7M,BO49IR,,,,,,2003 -WL7U,BP51,EME,,Mike,,50: 150W 5el - 144: 300W 2x10el - 432: 900W-,1998 -WM2Z,FN31SA,,,Warren,,,2004 -WM5Y,EN31,,,,,,2003 -WN4BML,EL89LL,,,,,,2003 -WN4KKN,EM10,,,,,,2003 -WN4M,EM66,,,Greg,,100W,01/04 -WO9S,EN61ET,,,,,,2003 -WP4G,FK68VG,EME,,Angel,,144: 1KW 2x2MX28P,10/00 -WP4O,FK68,,,Ed,,144: FT736r 400W 18ft langyagi preamp,01/01 -WQ0P,EM19VF,,,Greg,,,09/01 -WQ5S,EM13RC,EME,,Brad,,144: 12el 50W,02/05 -WQ5W,EM12FW,,,George,,,2004 -WR0F,EM29TC,,,,,,2003 -WR0I,EM17,,,,,,2003 -WR6S,DM14CP,,,,,,2003 -WR9W,EM68FA,,,,,,2003 -WS5R,DM95,,,,,,2003 -WT0W,EN34,,,,,,2003 -WV0K,EN13,,,,,,2003 -WV1K,FN41WR,,,Matt,,,2005 -WV2C,FN30,,,Tony,,144: IC706 180W 15el,1998 -WW2R,EM13QD,,,,,,2003 -WW4T,EM83,,,,,,2003 -WW8M,EN72,,,,,,2003 -WX9M,EN54FL,,,,,,2003 -WY0C,EM17IT,,,,,,2003 -WY0V,EN12,,,Gary,,,1998 -WY3G,EM55,,,,,,2003 -WZ1V,FN31MP,,,Ron,,144: 1kw 2x14el - 222: 500W FO16,01/01 -WZ8D,EM79UG,,,John A.,,50: 1-5KW 6el - 144: 1-5KW 18el,01/01 -WZ9D,EN51,,,,,,2003 -XE1AVM,DK79UA,,,,,,2003 -XE1GE,EK08,,,,,,2003 -XE1GRR,DL80IP,EME,,Tony,,FT736,11/04 -XE1XA,EK09,EME,,,,,2003 -XE2AT,DL81,,,Leon,,144: IC820 200W 13elonly SSB-MS,11/01 -YB0US,OI33JU,,,,,,2003 -YL1A,KO07UN,,,,,,05/03 -YL2GUI,KO06MM,,,Egils,,144: TS-570+FTV-250 9el 30W,03/04 -YL2HA,KO26CV,,,,,,05/04 -YL2KA,KO26AX,,,Jack,,,03/02 -YL2LW,KO26CW,,,,,,11/04 -YL2OK,KO37AS,,,,,,11/04 -YL2OW,KO26WL,,,Janis,,FT736R IC706MKIIG,01/05 -YL3DW,KO26CW,,,,,,11/02 -YL3GDF,KO26XM,,,Vilis,,,05/04 -YL3GDJ,KO26AX,,,,,,01/05 -YM3XC,KN30FC,,,OP: HB9DUR,,,11/02 -YO0IS,KN05PS,,,,,,1993 -YO2AMU,KN06OC,EME,,Doru,,144: 4x16el MGF1302 1KW,02/00 -YO2BBT,KN05WG,,,,,,06/04 -YO2IS,KN05PS,EME,,Suli I. ""Szigy",,144: 4CX250B 10el BF981 - 432: 4X150D 17el 3,06/02 -YO2LEA,KN06WK,,,Nelu,,144: IC-211 lin.Mirage B 215G - 6m and 70,03/01 -YO3DMU,KN34BJ,,,Codrut,,144: TS870 +Trsv 1KW MGF1302 16el.165,02/02 -YO3FFF,KN34CJ,EME,,Cristian ""Cristi",,144: TS450 Trvtr 100W B-310G GaAs Preamp 16el,01/05 -YO3IZI,KN34BK,EME,,Ciprian,,TS2000,01/04 -YO3JW,KN34CK,,,Stefan ""Pit",,144: 400W 16el F9FT 3P602A-2.088.222,04/00 -YO3KWJ,KN24,,,Op YO3JW,,,1993 -YO4AUL,KN44HE,,,Cornelius,,144: FT290r 200W 2x12el MGF1302.150 2000lpm,01/01 -YO4BZC,KN45AK,,,Dorucc,,IC 706 5 el delta loop HM PA 70W,10/04 -YO4FNG,KN44HE,,,Liviu,,144: 350W 6el LY,11/04 -YO4RFV,KN45AK,,,EUGEN,,,08/02 -YO4RXX,KN45AK,,,,,,07/03 -YO5AVN,KN34,,,I.,,,1993 -YO5BIM,KN07XB,,,Puiu,,,05/04 -YO5BWD,KN27GD,,,Aurel,,,08/00 -YO5DJM,KN17,EME,,josif,,,1993 -YO5KAI,KN16TE,EME,,Clubstation,,.149 DTR,06/99 -YO5KAV,KN16TS,EME,,Ion (Nelu),,.149.449,06/99 -YO5TE,KN16TS,EME,,Ion (Nelu),,144: 1KW 4x10el MGF1302.149,01/02 -YO5TP,KN16SS,,,Bela,,144: 40W 16el,11/04 -YO7CGS,KN15OA,,,,,1000lpm,08/97 -YO7CKQ,KN15OA,,,nimara,,,05/01 -YO7IV,KN24MT,,,Ion,,144: TS850 + Tcvr 2x4CX250b 800W 15el 9BV,05/03 -YO7VS,KN14VH,,,Dietmar A. ""Dick",,50: 2XQB3/300 2xBF981 5el LY J-Pol crossdipol,10/98 -YO8BSE,KN36EW,,,Costi,,.075,10/95 -YO8CYN,KN36LW,,,Mihai,,,08/01 -YP0A,KN27GD,,,OP YO5TE,,,1992 -YR0A,KN16TS,EME,,Ion (Nelu),,.149.449,06/99 -YR5A,KN16TS,EME,,Ion (Nelu),,.149.449,06/99 -YR99E,KN34,,,OP YO3JW,,,08/99 -YT1VP,JN94WG,,,Vlada,,TS440 FT225,10/04 -YT1VV,JN94US,,,Vasa,,.135.185,07/00 -YT1W,JN91,,,,,,1990 -YT4D,JN94CP,,,,,144: 250W 11el,08/00 -YT7AC,JN95,,,Stanko,,only SSB-MS,03/97 -YT7W,KN14CF,,,OP YU7AU,,,1993 -YT7WA,KN05EJ,,,OP: YU7MS YZ7UN,,144: 1KW 4x4el Loop 11el WU MGF1302.121,12/01 -YU1ADN,KN03KN,,,m.,,,06/96 -YU1AFS,KN04FT,,,,,,1992 -YU1AZK,KN04,,,,,144: 25W 2x11elonly SSB-MS,10/98 -YU1BT,KN03KN,,,,,.148,10/95 -YU1BW,KN04GT,,,Joco,,,04/02 -YU1CF,KN03QN,EME,,Goran,,144: FT736R IC746PRO 1500W 4x7el,01/05 -YU1EU,KN04DW,,,,,,08/98 -YU1EV,KN04CN,,,Moma,,,05/04 -YU1EXY,KN04FT,,,OP Zoran,,144: FT225rd 350W 16el F9FT MGF13022000lpm,01/02 -YU1HFG,KN02XX,,,,,,12/95 -YU1IO,KN04IQ,,,Milenko,,144: 600W 4x17el,11/97 -YU1L,KN02XX,,,,,,12/95 -YU1LA,KN04FR,,,Ivan,,144: IC746 17B2,04/03 -YU1OO,KN02XX,,,,,,1993 -YU1OS,KN04FS,,,,,144: FT225rd 100W 2x9el MGF1302only SSB-MS,11/99 -YU1S,JN94US,,,Mico 1HQR- Vasa 1VG,,144: 17el 400W.147 1000lpm,11/97 -YU1WP,JN94OM,,,Miroslav (Miro),,.420,07/96 -YU1ZF,KN03IR,,,,,,1991 -YU4AR,JN94AS,,,Zdravko,,144: TR9130 250W 10el PA0MS-ant PreampUHER 15,11/02 -YU7AA,JN95NS,EME,,,,,01/05 -YU7AAA,KN05FJ,,,RadioClub,,144: GS35B 4x10+2x10 el BVO 3WL,11/04 -YU7ACO,KN05QC,,,,,144: FT221r PA 200W 2x 10el. DJ9BV1500lpm,08/00 -YU7AJH,JN95WF,,,,,,1990 -YU7AR,KN05BW,,,Teodor ""Teo",,IC745- FT225RD- 144: 4x5wl MGF1412 YL1056,12/01 -YU7AU,KN04HV,,,ljubisa ""Ljube",,144: 250W 2x11el.093,12/01 -YU7AZX,KN04AX,,,Branislav,,,08/03 -YU7BCL,KN05FW,,,Nesa,,,12/97 -YU7BCX,KN05HP,,,,,,08/96 -YU7CV,JN95WK,,,,,,1995 -YU7EF,KN04HV,EME,,Popa,,FT847,07/04 -YU7EW,KN05HP,,,Istvan ""Pista",,144:500Watt 4x10el MGF1302109 2000lpm MSDSP,04/03 -YU7FF,KN05EP,,,,,,1994 -YU7FU,KN04HV,,,Nesa,,,08/04 -YU7KB,JN94XX,,,Branislav (Bane),,144: IC202 2x11el 800W Preamp (MGF1302).141,02/04 -YU7MS,KN05EF,,,Mihalj ""Miska",,144: 400/1KW 2x11el WU MGF13027000 lpm385,02/05 -YU7ON,KN04AX,,,Zoran,,144. TR751 4x11el 25W1000lpm.442,08/00 -YU7PS,KN05FJ,,,Pal ""Pali",,144: 400/1KW 2x11el WU MGF13027000lpm385,02/05 -YU7VA,KN05EJ,,,Voislav - Voja,,144: 100Watt 11el BFT 66.080 1000lpm.180,05/00 -YU8DM,KN02OQ,,,,,,01/05 -YV5ZZ,FK60SM,EME,,,,,01/05 -YZ1DO,KN04ER,,,,,only SSB-MS,08/99 -YZ1KU,KN04EU,,,Boza,,144: 10W 9el F9FTonly SSB-MS,05/03 -YZ7MON,JN95XA,,,Ilija,,144: TR751E 25W 2x11elonly SSB-MS.383,07/98 -YZ7UN,KN05EI,,,Ivanko,,144: 4x6el Loop 100W,01/01 -Z30B,KN01PA,EME,,Clubstation,,144: 1-5KW 4xYU0B (17-5db) MGF1302.142 150,08/00 -Z31DX,KN11GD,,,George ""Joe",,,06/99 -Z32UC,KN11CR,,,,,,01/05 -Z35Z,KN11CR,EME,,Dimitar ""Dime",,144: IC202 350W 4x4el Loop MGF1302 432: 15,12/04 -Z37CEF,KN01QA,,,Clubstation,,,11/99 -ZA0DXC,KN01,,,OP HG3DXC,,,1991 -ZB0W,IM76HE,,,,,,1993 -ZL1PE,RF74DG,,,,,,2003 -ZL1RS,RF73HD,,,,,,2003 -ZL3AAD,RE66GR,EME,,Graham,,,2003 -ZL3NW,RE66ho,EME,, -ZL3TY,RE57OM,EME,,Bob,,,01/05 -ZP4KFX,GG15LV,,,Giuseppe ""Pino",,,03/01 -ZR1ADI,JF95KU,,,Gilbert,,,01/02 -ZR1AEE,JF96IA,,,Peter,,,01/02 -ZR1EV,JF96IC,,,Shawn,,50: FT690r 200W 4el.200.200,11/96 -ZR1L,JF96HD,,,Chris,,,10/02 -ZR1TRD,JF96HC,,,Andre,,,01/02 -ZR1WZ,KF05QP,,,Werner,,,2004 -ZR2DX,KF26,,,Barry,,,02/02 -ZR5ADQ,KG50IA,,,Mike,,,01/02 -ZR6ABU,KG33XV,,,Craig,,,2003 -ZR6CRW,KG33,,,Craig,,,10/02 -ZR6DXB,KG33XX,,,Barry,,,10/02 -ZR6GE,KG43AR,,,Gavin,,,10/02 -ZR6KHJ,KG43CU,,,Ken,,,02/02 -ZS1EK,JF95FU,,,Bill,,,01/02 -ZS2ACP,KF26SA,,,Andre,,,02/02 -ZS2BWB,KF26TD,,,Ken,,,02/02 -ZS4KB,KG32,,,Johan,,,10/02 -ZS4NS,KG32IA,,,Nico ""Nick",,50: IC551D 6el 80W - QSL via N7RO,02/01 -ZS4TX,KG30BW,,,Bernie,,,01/02 -ZS5AV,KF69GX,,,,,,2003 -ZS5DJ,KG59AA,,,Dave,,,01/02 -ZS5LEE,KG50JF,EME,,Lee,,IC821 706MKIIG,01/05 -ZS5Y,JF59JR,EME,,Derek,,,02/05 -ZS6AVP,KG44OD,,,Clive,,,05/02 -ZS6AXT,KG33VV,EME,,Ivo,,,02/00 -ZS6BTE,KG33XV,,,Ian,,,10/02 -ZS6DTS,KG43AR,,,Dickie,,,10/02 -ZS6EGB,KG43BQ,,,Emil,,,10/02 -ZS6GER,KG33,,,Paul,,,02/02 -ZS6GPM,KG33XU,,,Graham,,,10/02 -ZS6HS,KG33XR,,,Bert,,,01/02 -ZS6JON,KG33VV,,,John,,,10/02 -ZS6NK,KG46RC,,,Paul,,,02/02 -ZS6OB,KG44DE,,,Pine,,,01/02 -ZS6RAD,KG44CA,,,Rad,,,10/02 -ZS6UT,KG44EF,,,Ed,,,01/02 -ZS6WAB,KG46RC,EME,,,,,01/05 -ZS6WB,KG44EE,,,Hal,,,05/02 -ZS6WI,KG46RC,,,Will,,,2003 -ZS6Y,KG33WU,,,Etienne,,,02/02 -ZZZZZZ,End-of-Database,VHF-MS-DATABASE-Viewer © 2002/2005 by DG0KW +//CALL3.TXT agreed format for WSJT-PROGRAM by K1JT +//User-Version 2.14 02/05 WSJT-Excerpt of VHF-DATABASE © by DL8EBW +//(excluding extensions in calls eg. /p /a or exp.calls!) +2M0EXD,IO88FO,,,,,,04/04 +3B9C,MH10QG,EME,,,,,2003 +3V8BB,JM56ER,EME,,Clubstation,,,06/02 +4J1FS,KP40,,,,,,1990 +4K6D,LN40VK,EME,,vladimir,,,1994 +4N7AX,KN05PC,,,Zvezdan ""Zele",,144: 200 W 2x10el 9BVtx1500/rx3000lpm DSP,08/00 +4O4AR,JN94AS,,,Zdravko,,144: TR9130 250W 10el PA0MS-ant PreampUHER 15,11/02 +4O4D,JN94BR,,,,,144: 300W 11el,05/97 +4U1ITU,JN36BF,EME,,Clubstation,,144: 8el 600W,11/00 +4X1IF,KM72KA,EME,,Ralph,,,2004 +4X4IF,KM72KD,EME,,Ralph,,,05/00 +4X6UJ,KM72,EME,,,,,2000 +4Z5AO,KM72MW,,,Leonid ""Leo",,,07/04 +4Z5BS,KM71JW,,,Oded,,,07/95 +5B4AGY,KM64EV,,,Iain,,FT-726R plus 1kW Linears and head amplifiers,01/05 +5B8AD,KM64TV,EME,,Alex,,,01/05 +5B8AV,KM64FT,,,Norman,,,05/04 +5C8M,IM64PD,EME,,BCC-Club,,144: IC706 MKIIG PA 1KW preamp. 2x 3WL yagis,10/00 +5T5JC,IL30AM,EME,,erich,,,1994 +5T5SN,IK28AC,EME,,nicolas,,,01/05 +5X1D,KJ60EM,EME,,"Gus"" Ragge,,300W- 17el,03/97 +6Y4A,FK18AA,EME,,OP: W3CMP,,144: 2x 2MXP28 cross pol ant. 1KW,10/00 +7J0AAD,PM97OS,EME,,Angela,,144: 1KW 4x19el 2x18el MGF1801.043.250,01/00 +7J6CCU,PL36VI,EME,,Eric,,50: TS570 or IC821,04/02 +7K1MFR,PM95SP,,,,,,2003 +7K3LGC,QM06,EME,,,,,10/97 +7L1RLL,PM95SO,,,,,,2003 +7M2PDT,QM05EK,EME,,Umezawa,,432: 16x14el 1-5KW,03/00 +7W0AD,JM16JR,,,,,,11/04 +7X0AD,JM16JR,,,Enrique,,144: 9el 200W,11/04 +7X2LS,JM16MT,,,Seghir,,,08/02 +7X2VV,JM16WJ,,,,,,07/02 +8S4BX,JO79SD,EME,,OP SM4IVE,,,10/99 +9A1AAX,JN65TF,,,,,144: 16el 500W,04/01 +9A1CAL,JN86EL,,,Clubstation,,144: IC271 FT736 FT225RD 4CX1500A 2x17el,11/04 +9A1CBE,JN86BE,,,,,,96 +9A1CCB,JN85LN,,,9a7w@9a0tcp.ampr.org,,,03/01 +9A1CCY,JN85OO,EME,,Clubstation Jan Hus,,122,08/01 +9A1CDD,JN85LW,,,,,,1991 +9A1CEU,JN75RO,EME,,OP 9A3ZA,,144: 80W 2x18el 5.5wl 4x11el - 432: 10W 38el,01/99 +9A1CHI,JN95JG,,,,,,94 +9A1CHL,JN83,,,,,,03/98 +9A1CMS,JN86EL,,,,,,07/02 +9A1DFG,JN85EL,,,OP 9A3PA,,,07/96 +9A1EZA,JN86HG,EME,,OP 9A3AG Sasha,,IC271E 144: 2x4CX250b MGF1302 10mM2.087 3000,11/01 +9A1KDE,JN95FQ,,,,,,1994 +9A1RGC,JN75XT,,,,,,2003 +9A1Z,JN86FJ,,,Lucijan,,IC706 DB6NT 1W ON 3CMMSDSP,01/05 +9A2AE,JN86HF,,,Zvonko,,144: 8x24el 1KW,01/02 +9A2AT,JN86LL,,,,,,2003 +9A2DI,JN95,,,,,,06/95 +9A2EU,JN85JO,,,,,,07/96 +9A2GH,JN75IE,,,,,,2003 +9A2KK,JN85KV,,,Dusko,,,11/01 +9A2MK,JN75XU,EME,,branimir,,,1994 +9A2PT,JN86,EME,,,,,11/01 +9A2RD,JN65TF,,,Mario,,144: 2x16el 1KW,05/04 +9A2SB,JN95GM,,,,,,06/99 +9A2TE,JN85KK,,,,,,06/03 +9A2U,JN75RO,EME,,OP 9A3ZA,,144: 80W 2x18el 5.5wl 4x11el.082.215,01/99 +9A2VR,JN95,,,,,,08/99 +9A3DF,JN86HG,,,,,,04/03 +9A3JH,JN75AD,,,Andrea ""Andy",,,11/03 +9A3JI,JN86FJ,,,Filip /Bob/ Vadlja,,50: FT-101ZD+FTV650- IC706mk2g 7ele M2,05/02 +9A3MR,JN83FM,,,Roland,,only SSB-MS,08/00 +9A3PA,JN85EG,EME,,Mate,,FT736r - 50: 10W 5el - 144: 8x13el 800W M,08/04 +9A3TF,JN85,,,,,,08/96 +9A3TU,JN95EH,,,,,,11/01 +9A3W,JN74OC,,,Radio Club Jadera,,IC706,09/02 +9A3ZA,JN75RO,,,Davor,,144: 100W 12el.082.215,08/00 +9A4C,JN85LN,,,OP: 9A7W,,,03/01 +9A4CK,JN86,,,,,,08/96 +9A4EW,JN95KG,EME,,Hrvoje,,144: 250W 10el- GaAsFet1200lpm,11/02 +9A4FW,JN95JG,EME,,Zeljko,,144: 600W 4x17el F9FT MGF1302DTR 1200lpm,08/00 +9A4K,JN86FJ,,,Filip /Bob/ Vadlja,,50: FT-101ZD+FTV650- IC706mk2g 7ele M2,05/02 +9A4NF,JN73VS,,,Damir,,144: 300W LNA 2x16el yagis2500lpm,01/01 +9A4VM,JN85VS,,,,,,11/02 +9A4WY,JN74,,,,,144: 50W,08/98 +9A5D,JN92BP,,,,,,08/99 +9A5WA,JN85LN,,,Max,,,06/96 +9A5Y,JN85OO,,,Ops of 9A1CCY,,144: 800W 16x5el,10/99 +9A6WW,JN86EL,,,Zvonko,,144: IC271 FT736 FT225RD 4CX1500A 2x17el,12/99 +9A7W,JN85LN,,,Ogi,,,01/02 +9A90CBD,JN85OO,EME,,Clubstation Jan Hus,,.122 1200lpm,07/97 +9A9B,JN75XU,,,,,,2003 +9H1BN,JM75GU,EME,,Mark,,,09/99 +9H1BT,JM75EU,EME,,Paul,,,1994 +9H1CD,JM75FV,EME,,Henry G.,,144: TS850 LT2S 1KW 2x4.4lb DJ9BV MGF1302,01/01 +9H1CG,JM75,,,Joe,,144: FT902DM FTV250 100W 17el.132,11/01 +9H1ES,JM75FV,EME,,Fortunato,,,09/99 +9H1GB,JM75FU,EME,,Mantsueto ""Mans",,144: TS780 100W 19elDTR 3000lpm,08/03 +9H1PA,JM75FV,EME,,Philip,,144: TS711 4x10el (3wl) crossed yagi GS35bMSD,01/01 +9H1PI,JM75FU,,,Ivan,,50: 100W 5el,03/03 +9H1TX,JM75FU,,,David,,50: 8el yagi 100W - 144: 150 W 2x4wl xpol310,12/04 +9H1XT,JM75GV,,,John,,,08/02 +9H3LF,JM76,,,,,,1991 +9H3ZZ,JM76CB,EME,,OPs DL5MAE-DL6RAI,,,1993 +9M2BV,OJ30UD,EME,,mart,,,1994 +A22BW,KG38SU,EME,,lothar,,,1994 +AA0BR,DN70KN,,,,,,2003 +AA0BW,EM29PS,,,,,,04/03 +AA0DQ,EN12,,,,,,2003 +AA0EN,EM29,,,,,,2003 +AA0P,DM79,,,,,,2003 +AA1OV,FN43GE,,,Mark,,,04/03 +AA1VL,FN42HN,,,Chris,,,04/03 +AA1YN,FN43GC,EME,,Lee,,,2004 +AA2GF,FN02,,,,,,2003 +AA3NM,FM19JE,,,Steve,,,2003 +AA4FQ,EM67LQ,EME,,JEFF,,1500W,01/05 +AA5C,EM13SE,,,,,,2003 +AA5CH,EM35GK,,,,,,2003 +AA5IB,EM12,,,,,,2003 +AA5WL,EM32,,,,,,2003 +AA5WQ,EM26BC,,,,,,2003 +AA6GS,DM12,,,,,,2003 +AA6HA,DM43CN,,,John,,144: 500W 9el M2,01/01 +AA6IW,CM97VI,,,,,,2003 +AA6WI,CM97,,,,,,2003 +AA7A,DM43AO,EME,,Ned,,144: 8877 1-5KW 6x13el (DJ9BV),01/05 +AA8BC,EN90FE,,,,,,2003 +AA8HS,EN81,,,,,,2003 +AA9D,EN52,,,Dave,,,01/01 +AA9IL,EN62AI,,,,,,2003 +AA9MY,EN50FM,EME,,Bob,,Yaesu 847 IC910H IC706MKIIG,02/05 +AB0SD,EN30LL,,,,,,2003 +AB0TJ,DN60FN,,,Alex,,,2003 +AB3BK,FN10,,,,,,02/05 +AB4CR,EM77,,,,,,2003 +AB4OO,EM81,,,Vance,,,1998 +AB5F,EM46FG,,,Paul,,,2004 +AB5IG,EM12,,,,,,2003 +AB9FN,EN53,,,,,,2003 +AC1H,FN33XJ,,,Ken,,144: 300W 13dbD yagi,01/01 +AC1T,FN32,,,,,,2003 +AC3A,EM28QV,EME,,Scott E.,,144: 4x 9el M2 8877 1-5KW,05/03 +AC4TO,EM70,,,,,,02/05 +AC5OG,EM10,,,,,,2003 +AD4EB,EM65NS,,,Jim,,,2003 +AD4TJ,FM08LE,,,David,,10el Quagi 160Watt,01/04 +AD6A,CM97AG,,,,,,2003 +AD6FP,CM87WI,EME,,,,,2004 +AD6P,EM18,,,,,,2003 +AE0G,EN10PS,,,,,,2003 +AE0W,DM78,,,,,,2003 +AE4RO,EL97TG,,,Tom,,,09/01 +AE5K,EM36PC,,,,,,2003 +AF1T,FN43ED,EME,,DALE,,,01705 +AF4O,EM55LK,,,,,,2003 +AF6O,DM14EJ,,,,,,2003 +AF9R,EN52XB,,,Dan,,,2003 +AG2A,FN30FR,,,Tom,,,2003 +AG4QE,FM04KX,,,Timothy,,,2003 +AG9Y,EN40,,,Joe,,144: 160W 13el,01/01 +AH6EZ,EN51SW,,,Dick,,,12/01 +AH6LE,CN85NK,,,,,,2003 +AH8A,AH45OP,,,,,,2003 +AI1K,FN41IL,,,,,,2003 +AI3W,FM19PW,,,Rick,,,2004 +AI8Z,DM79,,,,,,2003 +AJ0E,EM29RD,,,,,,2003 +AJ6T,CM87XG,,,Walter E. ""Walt",,144: 200W 10el,08/03 +AL7EB,BP40IQ,EME,,Edward R.,,144: 4xpol-20el M2 170w,01/05 +AM25DXU,JN11CM,EME,,Op Jose Maria,,,1992 +AN6SA,JM19IR,EME,,Josep,,144: FT847 2x4CX250 2x17el - 432: 4x33el,01/01 +BY1QH,ON80DA,,,,,,2003 +C31MS,JN02UN,,,DC9KZ- DF7KF- DL8EBW,,144: 2Stn a´ 800W 2x17el or 11el.119 DTR,05/97 +C31RC,JN02SK,EME,,,,,1989 +C31TLT,JN02TL,EME,,OP I5WBE EA3BB,,144: 4x24el 2x4CX250 900W,08/01 +C4N,KM64tv,EME,, +CN8KD,IM63KX,,,,,144: 10W 11el,06/03 +CN8LI,IM63NX,,,Said,,50: IC706 6el Mast Mount 20db preamp- 144: 2,08/04 +CN8ST,IM64NA,EME,,Tarrik,,,06/98 +CO2OJ,EL83TD,,,OP: Oscar,,50: 100W 4el - 144: 110W 9el,08/01 +CQ14HZE,IM57NH,,,Joachim ""Joe",,,02/04 +CS0DIZ,IM69,,,,,,1989 +CS1GDX,IM59IB,,,OP: CT1EKD,,144: IC706MK II G 200W 12el,11/03 +CS6ARC,IM59RX,,,OP CT1FOH,,,11/01 +CT1ANO,IN51RE,,,Pinto,,144: TS2000 250Watt 2x10el MGF1302 - 432: TS,02/05 +CT1DHM,IN61CC,,,Jose,,,05/02 +CT1DIZ,IM58KP,,,Alex,,,06/03 +CT1DMK,IN50QP,EME,,Luis,,144: 1-5KW 4x11el DL6WUDTR,03/99 +CT1DNF,IN50QP,,,Pedro Filipe,,144: IC821H 200Watts 2x12ele DL6WU Preamp,12/04 +CT1DYX,IN51QD,,,Pedro Miguel,,IC970H 50: 100W 4el - 144: 100W 17el MGF1302,06/03 +CT1EKD,IM59IB,,,Pedro,,144: IC706 MK II G 200W 12el,11/03 +CT1EPS,IM57XC,,,Joe,,144: FT480 2x17el 200W MGF1302only SSB-MS.,04/03 +CT1FAK,IN50QO,EME,,Rui,,144: FT1000D FT736R 200W 4x13el DL6WU MGF,05/03 +CT1FOH,IN50RA,,,Paulo,,50: 6el - 144: 200W 4x 12el MGF1302120 MSDSP,04/04 +CT1HZE,IM57NH,,,Joachim ""Joe",,,02/04 +CT1WW,IN61GE,,,Tiago,,,11/96 +CT2FEY,IN61NS,,,Paulo,,,11/03 +CT2HSN,IN61CC,,,Carlos,,,08/01 +CT2HSO,IN61CC,,,Luis,,,08/01 +CT2IET,IN60GD,,,Frederico,,FT100D,11/02 +CT2IWG,IN51OJ,,,Sergio,,144: IC706 100W 9el,02/05 +CT4KQ,IN60BP,,,Serafim,,DTR+,03/98 +CU2IJ,HM77ES,,,,,,04/04 +CX9BT,GF15WK,,,,,,2003 +CY9SS,FN97WE,EME,,,,144: 400W single yagi,01/05 +DA0BV,JN58VF,,,clubstation,,DTR,1994 +DA0NRW,JO41GV,,,Clubstation,,144: 3CX400A7 4x14el or 17el,12/96 +DA0WAE,JO41GU,,,OP DK3EE,,,12/04 +DA4RG,JO31FG,,,Reg,,,11/95 +DB1OMA,JO42RK,,,Joerg,,,01/03 +DB1PB,JO30UE,,,,,,12/01 +DB2WD,JN39VV,EME,,Jens,,SSB only.280,04/96 +DB3BW,JO42AC,,,Hans-Jürgen,,HF: TS520 - 144/432: FT726r,04/04 +DB3LA,JO31JK,,,,,,07/02 +DB4ET,JO31,,,Klaus,,,11/02 +DB4LL,JO54SM,,,Nikolausi,,144: FT221 20W 4el.010.300,08/01 +DB4VQ,JN39MF,,,Günther,,,1994 +DB5ML,JN58OI,,,Michael,,only SSB-MS,09/03 +DB5WC,JN49EJ,,,Gerd,,60W 11el Preamp.250,12/03 +DB6BX,JO32OK,,,,,,11/96 +DB6NT,JO50UI,,,,,,2003 +DB6RO,JN58QB,,,Gerd,,,12/03 +DB7OB,JO52IJ,,,Gerd,,144: FT221 100W 11elonly SSB-MS,08/00 +DB8AT,JO51CP,,,,,,05/04 +DB8WK,JO33XN,,,Hinni,,144: 200W 13el - 432: 200W 20el,01/03 +DB8YL,JO41EV,,,Sabine,,,12/99 +DC1ECD,JO31MH,,,,,,10/04 +DC1MUS,JN69EP,,,,,,11/02 +DC2JR,JO64CA,,,Klaus,,,11/01 +DC3QB,JO41IV,,,,,,01/05 +DC3VM,JN39KK,,,Alfred,,,12/99 +DC3VW,JN39KJ,,,Guenther,,only SSB-MS,10/04 +DC3ZR,JN68CV,,,,,,01/03 +DC6DY,JO31OK,,,anton,,only SSB-MS,1994 +DC6GF,JN48OC,,,Christoph,,IC 706 MKIIG PreAmp,01/05 +DC6KI,JO30IL,,,Wolfgang,,DTR,04/03 +DC6RN,JN59WK,,,Norbert,,144: 2x12el 160W,04/03 +DC7OH,JO62OK,,,Eric,,DTR 2000lpm,01/01 +DC7UT,JO31NJ,EME,,Horst,,144: 4x17el 500WDTR,03/01 +DC9KZ,JO30JW,,,Angelo,,only SSB-MS,09/01 +DC9YC,JO31PJ,,,Dieter,,,05/03 +DD0VF,JO61WB,,,Steffen,,144: 550W 4x7el MGF1303 (JO61WA: 100W 5el BF9,03/04 +DD1JN,JO50DJ,,,Karsten,,144: 600W 11el Preamp - 432: 21el 200W VV - 1,04/02 +DD1WKS,JN39KK,,,Wolfgang,,,01/01 +DD2UJ,JO61WD,,,,,,10/04 +DD3DX,JO31TN,,,Christian,,only SSB-MS,07/01 +DD3SP,JO72EN,,,Sandro,,50: 5el - 144: FT847 4CX250 17el F9FT MGF1,02/04 +DD5DX,JO61CA,,,Alexander,,144: 180Watt 2x17el Preamp333,07/04 +DD6UBS,JO41AH,,,Stefan,,144: TM255 MGF1302 180W 11El F9FT - 432: TM45,10/04 +DD9SQ,JN59BH,,,Martin,,,07/98 +DF0AK,JN49EA,,,,,,07/97 +DF0BV,JN68AH,EME,,BCC,,144: 2x17el 750WDTR,12/99 +DF0CI,JO51CH,,,Cubstation,,,11/03 +DF0EME,JO40,,,,,,2003 +DF0LBO,JO53CT,,,Clubstation OP:DK1KO,,,05/02 +DF0MMO,JN49JX,,,OP DH4FAJ- Matthias,,144: 200W 11el,11/00 +DF0MTL,JO61JF,,,Clubstation,,,12/98 +DF0SAX,JO61VC,,,Clubstation,,144: 20W 13el,12/98 +DF0WD,JO42FD,,,Clubstation,,144: 8874 250W 2x9el - 432: 3CX800 4x18elDTR,05/03 +DF0WF,JO62VT,,,,,,01/05 +DF1AN,JO63SX,,,,,,01/00 +DF1BN,JO31GD,,,Paul-Eduard ""Paulus",,144: IC821 HLV-300 300Watts MGF 1302 2x17e,07/01 +DF1CF,JN57FP,EME,,Jürgen,,144: CF300 3CX800 4x13el (3lb)133 1500lpm38,12/04 +DF1GL,JN47CO,,,Joachim,,144: IC 910 100W 9 el,11/04 +DF1HF,JO43VL,,,Andreas,,144: 2x6el,02/00 +DF1IAZ,JN49LD,,,Ralf,,50: 3 el - 144: 150W 2x10el MGF1302154 300,07/01 +DF1OC,JO52,,,T.,,,1993 +DF1SO,JN48PO,,,Dieter,,144: homemade 200WDTR,08/98 +DF1VB,JO31RM,,,Jochen,,,05/04 +DF1ZE,JN49,EME,,Michael,,,1994 +DF2CQ,JN58SE,,,,,,10/04 +DF2OOO,JO41RF,,,OP DL3ZBA,,IC820H 144: 250W 2x11el- 432: 130W 2x23el Pr,09/99 +DF2UJ,JO61QH,,,,,,02/02 +DF2ZC,JO30RN,EME,,Bernd J.,,144: TS2000 LT2S 2xGU74b 750W MGF1302 4x2M18X,12/04 +DF3FJ,JO40CC,,,,,,1993 +DF3RU,JN59VL,EME,,Karl,,,1993 +DF4LY,JO44SM,EME,,Manfred,,144: 160el Col. 4CX2501000lpm,12/96 +DF4MAA,JN58WH,EME,,Wolfgang,,,05/97 +DF4UE,JN48RR,,,John,,432: 4x27el 600W,09/03 +DF5BN,JN49GU,,,Walter,,,08/99 +DF5DE,JO40CX,,,K.O.,,,10/04 +DF5JJ,JO43XO,,,Peter,,432: 700W 19el - 1296: 500W 26el - 10368: 20,03/04 +DF5NK,JN59PM,,,Frank,,50: FT857 4el - 144: 600W 11el - 432: 500W 19,02/04 +DF6HT,JO53AH,,,,,,2003 +DF6LO,JO52CE,,,matthias,,,1993 +DF6NA,JN49XS,,,Rainer,,432: 2x3CX800 4x30elDTR rx1500tx2000lpm,10/01 +DF6OB,JO42,,,Matthias,,,07/97 +DF6VW,JO42KH,,,Ralf,,,07/97 +DF6YL,JO31WS,EME,,Peter,,,10/04 +DF7DJ,JO31UO,,,Herbert,,.153,06/97 +DF7IF,JN48DN,,,,,,2003 +DF7IT,JN49IN,,,Volker,,,10704 +DF7KF,JO30GU,EME,,Dithmar,,144: 16x18el EME PwrDTR+ 3000lpm,12/04 +DF7OG,JO52BN,,,Klaus,,144: TS770E 4x150 16el,04/04 +DF7RG,JN68HG,EME,,Georg (Op DK0OG),,DTR+ 3000lpm,01/05 +DF8AA,JO60XX,,,Wolfgang,,144: 100W 17el.132,12/99 +DF8AE,JO41GX,,,rudi,,,10/04 +DF8IK,JO30JT,,,Hans-Peter ""Peter",,144: 300W 11el 432: 400W 27elDTR 2500lpm,01/04 +DF8LC,JO53GX,EME,,Lothar,,,08/99 +DF9CY,JO54AL,EME,,Christoph,,144: IC820 9el DK7ZB D200 550W Preamp,11/04 +DF9IJ,JN48CX,,,,,,2003 +DF9KT,JO30GU,,,,,.167 DTR+.167,11/95 +DF9KX,JO30FQ,EME,,Rolf,,FT1000 144: LT2S 3CX800A7 Preamp 2x17ele M2,03/04 +DF9PX,JN47QT,,,Horst,,144: IC706 180W 2x10el Preamprx2000tx1200lpm,07/01 +DF9QT,JO30OR,,,Klaus,,144: 700W 11el MGF1302DTR 2000lpm,01/05 +DF9QX,JO42HD,EME,,matthias,,,1994 +DF9YF,JO42GE,,,Uli,,,12/03 +DG0CAL,JO31,,,Ullrich,,,06/00 +DG0FE,JO62UN,EME,,Lothar,,FT 736r 144: 100W 4x17el - 432: 2x21el - 129,07/03 +DG0KU,JO64AC,,,,,,01/03 +DG0KW,JO64MH,EME,,Klaus,,144: 2x 13el,01/05 +DG0OPK,JO50GG,,,Michael,,50: 5W - 144: 150W - 432: 100W - 1296: 35W -,12/04 +DG0TU,JO61TU,,,Op LZ1DP,,,08/97 +DG0WJ,JO60CV,,,,,,11/02 +DG1BA,JO43LB,,,Dieter,,only SSB-MS.383,01/00 +DG1CMZ,JO60DS,,,Michael,,,08/01 +DG1IU,JN49FA,,,,,only SSB-MS,08/96 +DG1LY,JO44RK,,,,,,03/04 +DG1TA,JN69GH,,,,,,02/01 +DG1VL,JO61WC,,,Henry,,144: 150W 17el MGF1302388,04/04 +DG1YBO,JO32RG,,,Michael,,144: FT225RD 80W 9el,09/04 +DG2BCP,JO43DC,,,Peter,,144: 4x 3.6wl DJ9BV+GS35 Pa - 432: 4x 11wl DJ,01/04 +DG2DAA,JO62GU,,,Friedhelm,,,06/02 +DG2GEP,JN48DL,,,Markus,,144: 200W 9ele Yagi,04/03 +DG2KBC,JN58MI,,,Ansgar,,144: FT847 2x2wl BVO 300W LNA,01/05 +DG2NBN,JN59NR,,,Dieter,,FT847 144: 200W 2x3wl 9BV MGF1302 - 432: 300W,08/01 +DG2NZM,JN59IV,,,Matthias,,,06/03 +DG2SRL,JO61HN,,,,,144: 2x17el 300W,10/01 +DG2VC,JO61VC,,,,,,01/04 +DG3FK,JO41PG,,,Thomas ""Tom",,TS850+TV TS790 144: 17el 150W - 432: 4x17el,09/03 +DG3JO,JO31JK,,,Bert,,TR-2000- TM-D700- DSPCOM,04/03 +DG3XA,JO43WJ,,,Andreas,,144: 200W 7el - 432: 2x20el 300Wonly SSB-MS,05/04 +DG4BH,JO30RX,,,,,,01/03 +DG4EK,JO31NI,,,,,,2003 +DG4EKE,JO31NI,,,Kai,,144: IC820h- SP2000- 17/11el- QQE06-40.088 D,01/97 +DG5AAG,JO51,,,,,,07/01 +DG5CST,JO60DS,,,Sebastian,,144: FT847 4x9el GU74 750W - 432: 23el 50WM,06/04 +DG5HV,JO43XQ,,,Michael,,,01/99 +DG5NEX,JN49WS,,,,,,93 +DG5OAF,JO51EP,,,Karlheinz,,144: FT736 400W 2x17el B2 MGF1302DTR + JUDS,11/99 +DG5SMY,JN49QA,EME,,Marc,,144: 4x 17ele 432: 4x 23ele,08/04 +DG6JF,JO31,,,Günter,,,10/01 +DG6LS,JO54AK,,,Söhnke,,144:TS790 8877 4x17el - 432: 8x33el DJ9BV 3CX,12/96 +DG6MBS,JO41AH,,,Mareike,,144: TM255 MGF1302 180W 11El-F9FT - 432: TM-4,08/02 +DG6MGP,JN58WH,,,,,,1995 +DG6SYL,JO53QP,,,Anne,,144: 150W 11el 6WU Preamp - 432: 150W 23el Pr,03/02 +DG7MHR,JN57DR,,,Dieter,,,03/03 +DG7OV,JO42VX,,,,,,10/04 +DG7RBV,JN59UM,,,,,only SSB-MS, +DG7SF,JN48RR,,,Günther,,144: FT736 300W 2x7elDTR,06/01 +DG7SFL,JN49XF,,,Michael,,144: 300 W + 10El. - 432: 150W + 2*21El.,01/04 +DG7TG,JO43TX,,,,,,01/03 +DG8NCO,JO50VH,,,Uwe,,750W 6x9el MGF1302300,01/04 +DG8NCY,JO50HA,,,,,,07/02 +DG8UAW,JN48BR,,,Stephan,,FT-847: 144MHz: 50W 7el Preamp - 432MHz: 30,09/01 +DG8YHH,JO32QI,,,Alfons,,,01/04 +DG9BEM,JO43CD,,,Thomas,,144: 350W 17el VV - 432: 300W 4x20el VV - 129,01/03 +DG9DAZ,JO31XB,,,Tino,,144: TM255,11/01 +DG9GLA,JO40,,,,,,12/01 +DG9MAQ,JN58LJ,,,Raimund,,144: IC251 200W 9el Preamp. - 432: TS811 10,11/03 +DG9NCX,JN59BT,,,Hubert,,.126,11/99 +DG9NFM,JO50QG,,,Chris,,,1/94 +DG9YIH,JO32QI,,,Helmut,,144: 500W 17el,12/04 +DH0AAI,JO51AR,,,Harald,,144: FT225rd PA 200W SP2000 4xDL7KM,08/02 +DH0GHU,JN38VN,,,Ulrich,,144: TS850 LT2S HLV300 300W 11elDTR 3000lpm,09/01 +DH0LS,JO61II,,,Jens,,144: 4CX350 500W 2x17el Preamp - 432: 150W 21,12/03 +DH0MBH,JN58JD,,,,,,01/02 +DH0OAH,JO42OB,,,,,,2003 +DH0YAZ,JO41GG,,,,,,2003 +DH1DCN,JO41BD,,,Marc,,144: IC706MK2 11el 100W137 DTR 5000lpm,08/03 +DH1FM,JO61UD,,,Tilo,,144: 90W 10el - 1296: 1W 30el.050,08/02 +DH1KBB,JO20XX,,,jörg,,,1993 +DH1NAD,JN49,,,werner,,,1993 +DH1NSP,JN59JX,,,Phil,,,01/01 +DH1TW,JN48QM,EME,,Tobias ""Toby",,144: 600W 10el,04/01 +DH2FAF,JO40,,,j.,,,1993 +DH2OAA,JO42TU,,,Michael,,144: IC275E 4x11el 6WU 500W1800lpm,03/04 +DH2RS,JN47TT,,,Ralph,,144: 75W 11el MGF1302.140.250,01/98 +DH2UAK,JO71FU,,,Klaus,,IC910+Preamps - 144: 13el - 432: 29el - 1296:,04/04 +DH3DP,JO31,,,,,,07/96 +DH3IAJ,JN48HD,,,Ralf,,50: 10W 4el - 144: 100W 10el /p JN48GD 10GHz,04/07 +DH3NAN,JO50NC,EME,,Matthias,,,12/97 +DH3VE,JN39LL,EME,,Bernd ""Erni",,FT847 144: 500W MGF1402b 4x10el - 432: 300W M,07/03 +DH3YAK,JO31RS,EME,,Winfried,,144: 12el M2 750W135 DTR 3000lpm,12/04 +DH4FAJ,JN49LW,,,Matthias,,IC821h 144: 11ele 200w - 432: 19ele 40w,05/02 +DH5FS,JO61UA,,,Fred,,144: 9el 120W - 432: 4x21el,11/00 +DH5HS,JO31FF,,,Heiko,,FT847,11/02 +DH5HV,JO31AS,EME,,Jochen,,144: FT1000+LT2S or IC910 750W MGF1302 - 432,03/04 +DH5LAN,JO44TN,,,,,,05/97 +DH5MK,JO41IV,,,Michael ""Mike",,144: 100W 6el MGF1302222,08/04 +DH6ICE,JO61XU,,,,,,07/04 +DH6JL,JO31MI,,,Mike,,50: IC-746 4ele HB9CVDTR 3000lpm,06/00 +DH7FB,JO62SM,,,Frank,,144: FT847 GS35b 2x9el DK7ZB148 2500lpm JUD,02/04 +DH8BQA,JO73CF,,,Olli,,144: FT726r 300W 2x10el PreampDTR 3000lpm,02/02 +DH8GV,JO33RL,,,Thomas,,,07/01 +DH8IAB,JO30NO,,,Werner,,,05/04 +DH8IAT,JN49GC,,,Thomas,,,05/02 +DH8YHR,JO41GV,,,,,,2003 +DH9FAG,JN49LX,,,,,,2003 +DH9GCD,JN38VF,,,Christoph,,144: 11el 100W MGF1302.127 DTR 2500lpm,05/02 +DH9KAE,JO30BW,,,detlef,,,1993 +DH9NBB,JN49WS,,,Martin,,,01/99 +DH9NFM,JO50RF,EME,,Christian ""Chris",,144: 2x17el M2 750W - 432: 2x8el M2 750W - 12,03/04 +DH9OK,JO51AS,,,Edgar,,,06/04 +DH9OY,JO51AQ,,,Edgar (Eddy),,DTR 2000lpm,05/00 +DJ0QZ,JN49LM,EME,,Frank,,144: IC746 8877 2x18el M2 MGF1302,11/01 +DJ0RU,JO31KM,,,,,,07/02 +DJ1JD,JO52CK,EME,,Uschi,,DTR,08/00 +DJ1LP,JO64,,,d.,,,1993 +DJ1OJ,JN58SE,,,Heijo,,144: 100W 2x11el SP2000DTR,10/00 +DJ1SHF,JO73AM,,,Andre,,144: TS711 120W 2x10el- PreampDTR,11/96 +DJ1TU,JN48TR,,,Klaus,,,08/02 +DJ2IA,JO71AO,,,Dieter,,144: FT736R 100Watt 9-ele-Yagi,08/02 +DJ2IE,JN48HV,,,,,,07/02 +DJ2JA,JO40IM,EME,,Roland,,DTR,04/04 +DJ2JS,JO31SL,,,Volker,,,04/04 +DJ2QV,JO31PF,,,Maik,,144: TS850S Trvt 200Watts 9el OZ5HF - 432:,12/04 +DJ2XS,JO53AK,,,matthias,,,1995 +DJ3FI,JO31DI,EME,,Hubert,,,08/00 +DJ3HW,JO42LH,,,Joerg,,144: IC-910H 600W 12elM2 MGF1302 - 432: 280W,08/04 +DJ3LE,JO44TN,,,Hans-Juergen,,50: 25WERP 5el - 144: 2x17el 600W - 432: 2x21,02/04 +DJ3MY,JN58QD,EME,,Christian,,144: 600W 4x17elDTR,08/99 +DJ3RU,JN58,,,kurt,,,1995 +DJ3ST,JN48,,,,,,2003 +DJ3TF,JN59WK,,,Wolfgang,,,06/00 +DJ3VI,JO51BS,,,Siegfried,,144: FT736r 2x11el 750W3000lpm,01/01 +DJ4SO,JO44WG,,,Klaus-Dieter,,DTR,11/99 +DJ4UF,JO30BR,,,Eckart K.W.,,144: 300W 2x 8el MGF1302138 DTR 3000lpm,09/04 +DJ5BV,JO30KI,,,Gerhard ""Gerd",,144: 600W 11el MGF1302 - 432: 400W 20el - 12,07/02 +DJ5CL,JN58WH,,,Ingo,,,08/00 +DJ5DT,JN49IV,,,,,,05/02 +DJ5HG,JO53IU,,,Klaus,,,06/04 +DJ5MN,JN58WH,EME,,Bernhard,,,06/96 +DJ5MS,JN68KS,,,Peter,,,10/99 +DJ5NV,JN59KN,EME,,Günther,,,12/01 +DJ5RE,JN59WK,EME,,Thomas,,144: GS35b 250W 2x12el M2DTR+ 3000lpm,03/04 +DJ5SQ,JN37UW,,,Ivo,,144: TS870 LT2S 600W 11elDTR 2000lpm,12/97 +DJ6JJ,JO31LG,,,Heino,,,12/01 +DJ6MB,JO30,EME,,uwe,,,1994 +DJ6OL,JO52AP,,,,,,10/04 +DJ6TN,JO54CF,,,Gunter,,DTR,09/96 +DJ6WD,JO40AT,,,Karl-Heinz,,DTR 4000lpm,03/99 +DJ6XV,JO31LQ,,,Peter,,,04/04 +DJ7AL,JO61VC,EME,,Jürgen,,144: IC910 VLA 200 4el F9FT,11/04 +DJ7FJ,JN48AG,EME,,josef,,,1994 +DJ7OF,JO51HQ,EME,,Klaus,,144: 6x17el CC 17B2 MGF1302 EME Pwr090 250,09/04 +DJ7OQ,JO42WJ,,,Erik,,144: TS 850 LT2S PA 2x 4CX250 Preap .5 dB,05/03 +DJ7RI,JO54CH,,,,,,12/03 +DJ8ES,JO43SX,,,Wolfgang,,144: 300W 17el - 432: 300W 24el - 1296: 100,08/03 +DJ8MS,JO63CT,,,Toralf ""Tor",,144: 100W 2x11el 6WU Preamp3000lpm MSDSP,08/04 +DJ8OG,JO40MF,,,Matthias,,IC 275H 8el DK7ZB,04/04 +DJ8PB,JO44MC,,,,,,1993 +DJ9BV,JO43XN,EME,,Rainer,,,07/00 +DJ9CS,JO54DG,,,Bodo,,FT-847 200W PA 50: 3 el 144: 9el,09/04 +DJ9CZ,JO31BC,EME,,Karl-Heinz,,FT847 4x15el 4CX1000A,02/04 +DJ9FG,JO52TD,,,Rolf,,HF: FT757GXII 10m Longwire - 50: 25W IRF610,05/04 +DJ9JY,JO31JM,,,Wolfgang,,only SSB-MS,01/01 +DJ9KV,JN68OK,,,hans,,only SSB-MS,06/95 +DJ9MG,JO52TC,,,Peter,,144: 2x 4CX250b 17el Tonna2000lpm,02/05 +DJ9YE,JO43HV,,,Klaus,,144: 400Watt 15el MGF1302,12/04 +DJ9YW,JO42QA,EME,,Heinrich F.,,144: 2x10el 500W - 1296: 3.5 and 4.5m dish 3,02/01 +DK0AK,JO30NQ,,,Clubstation,,,05/04 +DK0ALK,JN38TD,,,Clubstation,,,06/96 +DK0BN,JN39VX,EME,,Contestgruppe Bingen,,144: 700W 3x 9el F9FT + 2x 11elF9FT030275,09/03 +DK0EP,JO31TS,,,,,,11/04 +DK0IG,JN58SE,,,Clubstation,,144: 350W 2x11el,12/96 +DK0NHF,JO62JR,EME,,clubstation,,,1994 +DK0OG,JN68GI,EME,,Clubstation,,144: 700W 8x17elDTR,12/04 +DK0PX,JN48JC,,,Clubstation,,144: 350W 2x17el157,11/03 +DK0TU,JO62PM,EME,,clubstation,,DTR,1993 +DK0TX,JO50HK,,,,,,03/02 +DK0UB,JO31PK,,,Clubstation Ruhruni,,,08/97 +DK0VV,JO61WB,,,OP DD0VF,,144: 550W 4x7el MGF1303131 3000lpm DTR157,03/04 +DK1CM,JO40LG,EME,,Oliver,,144: FT990 LT2S 700W YL1050 18el MGF1302 - 43,04/01 +DK1CO,JO63SX,EME,,Hartmut,,144: TS790 4x17el 3CX800A7 Preamp.086 DTR,04/00 +DK1EJP,JO31DD,,,,,,03/03 +DK1KO,JO53CT,EME,,Reinhard,,144: 8877 4X17el F9FT-full elevation MGF13,12/04 +DK1MAX,JN58SP,,,Max,,,05/02 +DK1MZ,JO42XP,EME,,Stamen ""Stan",,144: EME Pwr 13el MGF1302DTR,11/03 +DK1PZ,JO41TH,EME,,heinz,,,1994 +DK1VI,JN49HH,,,Ernst,,144: 650W 16 el.- 432: 100W 21 el.- 1296: 120,07/01 +DK2AM,JO43AK,,,Dieter,,144: 450W 4x14el MGF1302DTR,12/01 +DK2BJ,JO30BS,,,Ulrich,,,04/04 +DK2FT,JO42KC,,,,,,2003 +DK2UO,JO30,,,heijo,,,1993 +DK2YCT,JO32RG,,,Chris,,,12/03 +DK3BU,JO33NO,EME,,Harm,,50: 25 W ERP 5el - 144: 749W 4x12el Pream,05/02 +DK3DUA,JO61TC,,,Thomas Rudolph,,144: FT847 1000Watts ERPDTR 3000lpm,04/00 +DK3EE,JO41GV,EME,,Thomas,,144: 8877 9el F9FT,08/04 +DK3FB,JO31UC,EME,,Rüdiger,,432: 750W 4x23el - 1296: 150W 37el - 2300: 5W,03/01 +DK3IK,JN39JF,,,Volker,,800lpm,04/97 +DK3MU,JO72GK,,,,,,10/20 +DK3QZ,JO31LP,,,Detlef,,,07/02 +DK3RV,JO31,,,walter,,,07/96 +DK3SE,JN37VP,EME,,Salvo,,,01/05 +DK3WG,JO72GI,EME,,Jürgen,,144: EME-PWR 6x 14el 5wl MGF1302 432: 1KW 8,05/04 +DK3XM,JO43XL,,,Thorsten,,144: 700w 2x2wl 60m asl,09/04 +DK3XT,JN49FE,,,Bernd,,,10/04 +DK4JN,JO31,EME,,a.,,,1994 +DK4OG,JN68GI,,,,,,2003 +DK4TG,JO31LB,EME,,Lothar,,117.180,01/05 +DK4WN,JN49EP,,,Wolfgang,,,11/03 +DK4XI,JN39NG,,,,,,2003 +DK5AI,JO51GO,EME,,Wolfgang ""Wolf",,,01/04 +DK5DC,JO31SL,,,Peter,,,07/02 +DK5DQ,JO31PG,,,Nicolas ""Nico",,144: 300W 2x10elDTR + 3000lpm,03/04 +DK5IT,JN49FB,,,,,,2003 +DK5KK,JO63EX,,,Matthias,,DTR,01/01 +DK5LA,JO44TR,EME,,Reinhard,,,08/02 +DK5MV,JN58WH,,,,,,08/97 +DK5PD,JN39VV,EME,,Lothar,,.040.280,03/00 +DK5TE,JN58BG,,,Stephan,,144: IC746 HLV600/8877 2x13el 432: IC475H 2x2,05/02 +DK5WO,JO30AS,,,Norbert,,,09/01 +DK5YA,JN49NX,EME,,Udo,,50: 4el - 144: GS35b 4x9elM2 PHEMT 0.3db -,07/04 +DK6AS,JO52,EME,,andreas,,,02/01 +DK7BY,JO33RJ,EME,,Karsten ""Sten",,750W,03/04 +DK7LH,JO43BB,,,Maik,,144: IC271 400W 2x3.6wl 9BV - 432: IC471H 100,12/01 +DK7LZ,JO30,,,,,,12/01 +DK8EL,JO31LJ,,,Thorsten (Tom),,144: 100W 9el MGF1302.162 2000lpm.162,12/04 +DK8KX,JO30,,,,,,05/04 +DK8VS,JN39NF,EME,,Werner,,,07/01 +DK8ZJ,JO54AG,EME,,Martin,,144: 550W 4x12el,10/02 +DK9OY,JO52CK,EME,,Detlef (Det),,DTR,10/01 +DK9RL,JN69BB,,,,,,01/97 +DK9TF,JO31NF,,,Jürgen,,FT726r- 17el,05/03 +DK9TU,JN48MF,,,Manfred,,144: 500W 13el DJ9BV,04/03 +DK9ZY,JO40BE,EME,,Wolf-Dietmar,,144: TS850 Trvt YL1052 MGF1302 4x10el 2.2,11/99 +DL0AO,JN59WI,EME,,Clubstation OP DJ3TF,,,02/03 +DL0AVH,JO52,EME,,OP DL7AWO,,144: 700W 2x2M18XXX,07/01 +DL0BWS,JO61,,,OP: Normen,,144: IC-910 100W 2x9el - 432: IC910 4x19el,01/03 +DL0DBR,JO54WC,EME,,Clubstation,,,06/99 +DL0DET,JO52CK,EME,,Clubstation OP DK9OY,,DTR,1994 +DL0EF,JO30IM,,,,,,2003 +DL0FTG,JO53FM,,,Clubstation,,,04/01 +DL0GER,JN49CC,,,,,,08/00 +DL0HES,JO41RF,,,Clubstation,,IC820H 144: 250W 2x11el - 432: 130W 2x23el P,07/01 +DL0LAU,JO61JF,,,,,,05/02 +DL0LN,JO31RS,,,Clubstation N29,,,10/04 +DL0LSW,JO61XU,,,Clubstation,,144: 17el 750W,12/99 +DL0PO,JO43CD,,,Clubstation,,,08/96 +DL0SHF,JO54BH,,,,,,2003 +DL0UL,JN48XK,,,OP DL6SAQ- DL5EBT,,144: 11el 400W 3CX800,04/01 +DL0UMK,JN68BC,EME,,Clubstation,,144: TS790S 4CX1000 4x17el 5WL.123 1500lpm.3,1995 +DL0VV,JO64AD,,,Clubstation- DL5CC,,144: 600W 17B2 Ant 9A4GLDTR 2500lpm,12/04 +DL0WAE,JO42DC,EME,,Teuto Contest Group,,750w and lots of aluminium!,05/04 +DL0WH,JN49HN,EME,,Clubstation OP DF7IT,,,1992 +DL0WX,JO30FQ,,,Clubstation,,,07/96 +DL1AAH,JO52EF,,,Dirk,,IC910H IC703 144: 17el - 432: 21el,08/03 +DL1AOQ,JO50IW,,,Dietmar ""Dean",,,05/02 +DL1BKY,JO33RL,,,,,,2003 +DL1DAX,JO31RM,,,Rüdiger,,144: IC251E 100W 11el - 432: FT780R 30W,04/07 +DL1DSB,JO61,,,r.,,,1993 +DL1DUR,JO70KV,EME,,Jürgen,,144: IC275H 700W 4x11el S3030DTR,08/00 +DL1DWI,JO61VC,EME,,Gerhard,,,10/04 +DL1EAP,JO31IK,,,Wolfgang,,144: 12el 750W172 DTR 2500lpm272 / 363,02/04 +DL1EEX,JO31MA,,,Peter,,144: 750W 10db ant.DTR+ 3000lpm,09/00 +DL1EFJ,JO31GM,,,Norbert,,,09/01 +DL1EL,JO41RF,,,Ralf,,IC820H 144: 250W 2x11el - 432: 130W 2x23el P,09/01 +DL1ELY,JO31IO,,,Stefan,,144: FT225rd Mutek 17el 150W.181 5000lpm JUD,01/01 +DL1GBF,JN48NJ,EME,,Peter,,,02/97 +DL1GBM,JN48FD,,,Michael,,50: 7W - 144: 400W- 432: 100W- 1296: 200W222,07/02 +DL1GGT,JN58AO,EME,,Tom,,144: 8877 2x 12el elev. 10368: 5W 60cm4000l,12/04 +DL1GI,JN49FG,,,Ralf,,,12/03 +DL1GNM,JN38WB,,,Michael,,DTR,10/02 +DL1HTT,JO61FR,,,,,,11/99 +DL1HYZ,JO62,EME,,Uli,,,03/01 +DL1JJ,JO31IA,,,Ulli,,,08/02 +DL1KDA,JO30FQ,EME,,Alex (Sternchen),,FT1000 144: LT2S 3CX800A7 Preamp 2x17ele M2,03/04 +DL1MAJ,JN68AH,,,Alex,,144: 2x17el 750WDTR,12/99 +DL1NEO,JN59KV,,,Markus,,144: IC275H SP2000 Beko HLV600 (max. 600 W),09/99 +DL1NFI,JN59KV,,,Matthias,,144: IC746 100W 12el M2,01/02 +DL1NUX,JN59LG,,,Attila,,IC706MK2G FT847 (/p JO50KI),06/02 +DL1OJ,JO42QI,,,Henning,,144: Elecraft K2 LT2S Beko HLV600 2x9el 50,03/01 +DL1RNW,JO62GH,,,Ronny,,144: 150W 12-5db Yagi,01/05 +DL1RTL,JO62PH,,,Heiko,,144: 13el 100W MGF1302,07/01 +DL1SDN,JN48PP,,,Dieter,,144: 2x11el 500WDTR 2000lpm,07/99 +DL1SFK,JN48PR,,,Oliver,,DTR,06/02 +DL1SUN,JO53PN,,,Norbert,,,04/00 +DL1SUZ,JO53UN,,,Uwe,,50: IC706 3el - 144: IC821 GS35 2x11el Prea,01/05 +DL1UU,JO62SP,,,Wolfgang,,144: 300W 2x9el135 DTR.220,03/04 +DL1YMK,JO31QX,EME,,Michael,,,02/05 +DL2AKT,JO50NV,,,Jens,,IC746 IC706MKII - 144: 700W 9el333,03/02 +DL2ALF,JO50IW,,,,,144: 100W 9elMSDSP,08/02 +DL2ARD,JO60AR,,,Oliver,,144: IC275E 350W 4x17el.149 DTR 3000lpm,08/04 +DL2CJ,JO50,EME,,alfred,,,1994 +DL2DAO,JO31PH,,,Harry,,144: 600W 24el,11/02 +DL2DXA,JO61VC,,,Bernd,,144: 150W 11el.117,01/97 +DL2EAA,JO31KL,,,Dirk,,,07/98 +DL2FDL,JO40LN,,,Michael ""Mike",,FT736R 50: 5el - 144: 150W 9el - 432: 19el 2,08/03 +DL2IAN,JN49BC,EME,,Thomas ""Tom",,144: 1 KW 2x9eltx1500 rx2000lpm,07/01 +DL2IE,JN48,,,dr. r.,,,1993 +DL2JA,JN58,,,,,,02/04 +DL2LAC,JO44MR,EME,,Ernst,,144: 18 dBd GS35b 432: 20 dBd GS35b 1,01/05 +DL2LAH,JO44QS,EME,,Karsten,,144: 750W,11/02 +DL2MHS,JN58,EME,,Thomas,,,03/00 +DL2NFX,JN59IV,,,Michael,,144: IC746 100W3000lpm,04/01 +DL2NUD,JO63LE,,,Hermann,,,05/04 +DL2NWK,JO63SP,EME,,wolfgang,,,1993 +DL2OCB,JN49IS,,,Stefan,,FT726,01/03 +DL2OM,JO30SN,EME,,Roland,,,08/01 +DL2RMC,JN68GI,,,,,,11/97 +DL2RSX,JO62SH,EME,,Olaf,,144: 19 dBd MGF 1302 DSP 1-2KW,12/03 +DL2RUG,JO62,,,,,,01/03 +DL2SDQ,JN49OC,,,Thaddeus (Tadek),,.238.238,08/01 +DL2UX,JO61VA,,,Mario,,144: TR751E 5el 25W - /p JO61VC: 100W 13,08/02 +DL2YDS,JO32,,,Stefan,,,08/97 +DL3AAL,JO52,,,b.,,,1993 +DL3AZI,JO51ME,,,,,,01/97 +DL3BUE,JO72FH,,,Joerg,,,08/02 +DL3BWG,JO62TQ,,,,,,1995 +DL3DTS,JO61UA,,,sylve,,,1993 +DL3FBJ,JO40,,,,,,11/01 +DL3GN,JN37VX,,,Udo,,,07/01 +DL3HRT,JO61AB,,,Karsten,,144: 10el 2.3wl 100W GaAsFet DSP-NRDTR,07/02 +DL3IAE,JN49DE,EME,,Daniel,,50: TS120 trvt 6el - 144: 3CX800 750W 2x10el,07/99 +DL3IAS,JN49EJ,,,Nino,,144: 20W 10el DK7ZB - 432: 3W 23el DK7ZB - 12,08/03 +DL3JAN,JO60KT,,,Jan,,144: 9el 300W,03/01 +DL3JIN,JO60LX,,,Peter,,,04/03 +DL3LBK,JO54AH,,,Kai,,144: 250Watt 11el.082 DTR.382,07/96 +DL3LST,JO61FI,,,Ray,,,01/05 +DL3MBG,JN68,,,Christian,,,01/96 +DL3MGL,JN58QD,,,Carlos,,DTR,12/01 +DL3NAW,JN59KV,,,Wolfgang,,144: 500W 2x11elDTR tx1200lpm,08/03 +DL3NCR,JN48QX,,,Georg,,50: IC736 3el Yagi - 144: IC275E 11el DL6WU 8,01/04 +DL3RBH,JN68HJ,,,Robert,,,05/99 +DL3RU,JN49FG,,,,,,2003 +DL3SAS,JN48OR,EME,,Hartmut,,,04/96 +DL3TN,JO31LC,,,,,,12/01 +DL3TW,JO44SK,,,Thorsten,,144: FT1000 LT2S 6x6el 600W,01/03 +DL3WW,JO60FL,,,,,,08/04 +DL3XT,JN49FT,,,bernie,,,1993 +DL3YBP,JO42,EME,,heiko,,,1993 +DL3YEE,JO42GE,EME,,Klaus,,,01/05 +DL3YEL,JO41EV,,,Ulrich (Ulli),,144: 9el 3CX8002500lpm DTR,07/02 +DL4ABJ,JO42XP,,,,,,2003 +DL4ALI,JO50JW,,,Steffen,,,07/99 +DL4ANT,JN49LF,,,Jörg,,,09/01 +DL4AO,JO42NX,,,Heinz,,144: 150W 11el,07/04 +DL4DTU,JO60TS,EME,,Norbert,,DTR,01/02 +DL4DWA,JO61QH,,,Uwe,,144: 120w 13ele 432: 35w 19ele370,01/05 +DL4EA,JO31,,,Frank,,,09/96 +DL4EBY,JO62PM,EME,,Klaus,,DTR,12/03 +DL4IB,JO64CC,,,Manfred,,144: 11el 300WMSDSP,12/98 +DL4KG,JN48OU,EME,,Gerald,,TS2000 - 50: dipole - 144: 10el DJ9BV 100W,05/04 +DL4MEA,JN58RI,EME,,Guenter,,144: GS35b 15el MGF1302 432: GS35b 6x33el,09/04 +DL4MP,JN48NV,,,Manfred (Manne),,50: 100W 5el.095.195,01/01 +DL4NAA,JN49NX,,,Christian ""Chris",,144: hm 750W 2x15el.144 2000lpm,04/01 +DL4SUN,JO63CT,,,,,,10/04 +DL4XX,JO43XK,,,,,,07/97 +DL4YAO,JN58,,,,,,05/02 +DL4YBM,JO42DC,,,joe,,,1995 +DL5AG,JO41,,,,,,01/03 +DL5BAC,JO43LG,,,hans-jürgen,,DTR,01/96 +DL5BBW,JO32NH,,,,,,01/01 +DL5CC,JO64AD,,,Manfred,,144: 17el 600W2500lpm DTR,12/04 +DL5DAV,JO31,,,Uwe,,,1994 +DL5DTA,JO61SD,EME,,Arnfried ""Andy",,144: 4x11el EME Pwr GaasFet DSP59.134 DT,08/99 +DL5EBS,JO31LH,,,Juergen,,144: FT847 150 W 13 el Yagi,08/03 +DL5FDP,JN49LP,,,Stefan,,,11/02 +DL5GAC,JN47UT,,,Robert,,144: 400W 15el CueDee CF300DTR,08/04 +DL5IO,JN49NI,,,,,,01/97 +DL5LF,JO54,EME,,Frank,,432: 1KW 4x9el 9BV 8.5lb - 1296: 20W 23el.010,08/00 +DL5MAE,JN58VF,EME,,Wolfgang,,144: 8x17el 700WDTR,01/05 +DL5MAM,JN58UB,,,Karl,,144: 100W 10el,07/04 +DL5MCG,JN58KH,,,Wilhelm,,144: 11el 500W3000lpm,01/05 +DL5ME,JO52SD,,,Mario ""Mao",,144: 100W 18el3000lpm,04/04 +DL5MEL,JN58,,,Sigi,,144: 600W 11el,03/00 +DL5NEN,JN59MO,,,Thomas,,144: 12el GS35b MGF1302 - 432: 28el GS35b - 1,12/97 +DL5OAU,JO52GW,,,Ulrich,,,01/03 +DL5QQ,JO32KB,EME,,Thorsten,,.060.330,04/96 +DL5RBW,JN58VF,,,,,,2003 +DL5RDO,JN59VN,,,,,,1992 +DL5ROB,JN68HG,,,Robert,,144: 300W 16el BF981MSDSP,08/02 +DL5WG,JO52VK,,,Rolf ""Roy",,50: 20W 4el - 144: 300W 2x11el144 DTR 250,05/04 +DL5XV,JO53AP,,,Bernd,,144: 2x15el 600W.128.228,07/01 +DL5YAS,JO31WS,,,,,,12/01 +DL5YET,JO41EV,,,Markus,,144: 750W 13el - 432: 750W2000lpm DTR,04/02 +DL5ZA,JO51HK,,,Reinhard,,144: IC706 100W 14el F9FT,01/04 +DL6BF,JO32QI,,,Heinz,,144: 250W 13el - 432: 150W 4x11elDTR 2500l,05/03 +DL6EAT,JO43VR,,,Andreas,,,01/97 +DL6KR,JO30NQ,,,Martin,,,05/04 +DL6LAU,JO53CF,EME,,Carsten,,,07/03 +DL6MFK,JN67,,,Robert,,,05/03 +DL6NAA,JO50VF,EME,,Reinhold,,,10/00 +DL6NCI,JO50VI,,,lorenz,,,1993 +DL6RDR,JN68BM,,,Stephan,,.065,10/95 +DL6UAL,JO61XU,,,,,144: 750W 2x BigWheel,12/00 +DL6WT,JN39VV,EME,,Jürgen,,.030.260,04/96 +DL6WU,JN49HT,EME,,Günter,,,02/04 +DL6YCY,JO41,,,Maik,,,12/99 +DL6YEH,JO32VA,EME,,Andreas ""Andy",,144: IC730 LT2S 749W 2x2.2wl 9BV - 432: IC7,03/02 +DL6YFB,JO31KM,,,reinhard,,,01/96 +DL6ZAU,JO40JF,,,Gerd,,FT736+MHP145 144: 350W 2x12el M2145 3000 DTR,09/03 +DL6ZBN,JO40ED,,,Joerg ""Joe",,144: TS700S 80W 11el MGF1302DTR 3500lpm,05/02 +DL7AJA,JO40AQ,,,Friedhelm ""Fred",,144: IC-706MKIIG 3CX1500A7 MGF1302 17el. T,11/04 +DL7AKA,JO62QO,EME,,HansJürgen ""Hajo",,144: TR7 Trvt 2x4CX250b 15el DJ9BV.144 25,01/01 +DL7APV,JO62,EME,,Bernd,,,08/00 +DL7ARM,JO62RJ,,,Christian,,,12/95 +DL7AUK,JO62,,,,,,2003 +DL7DCU,JO41BC,,,Jan,,144: FT767 100W 4x11el MGF1302only SSB-MS,03/99 +DL7FF,JO62TJ,EME,,Bernd,,HF 100W FD4 - 144: 4x11el 1KW.063 DSP.370,05/02 +DL7QY,JN59BD,,,Claus,,,01/97 +DL7TX,JN49IV,,,Peter,,144: 50W 6el - 432: 17el 100W,11/01 +DL7UAE,JO62PH,EME,,Thomas,,FT736R 50: PA Tonna20505 - 144: GS35 4x3wl (,01/05 +DL7UDA,JO62TK,EME,,Dietmar,,144: IC275H GS35b 17el F9FT 432: IC475H GS3,12/04 +DL7UGB,JO62,,,,,,05/97 +DL7ULE,JO62,,,,,,12/95 +DL7ULM,JO62SN,,,,,,05/01 +DL7UME,JO62SN,,,,,,2003 +DL7YC,JO62PK,,,Manfred,,HF: 400W - 50: 10W - 144: 200W - 432: 750W -,09/03 +DL7YW,JO62RK,EME,,Jürgen,,.320,01/02 +DL8AKI,JO51,,,Sigi,,,11/95 +DL8BBL,JO42,,,,,,04/04 +DL8BDU,JO43AA,,,Klaus,,144: 600W 15el,08/04 +DL8CMM,JO52VM,,,Günter,,.137,05/04 +DL8DAT,JO31,EME,,manfred,,,1993 +DL8DUL,JO61,,,,,,08/04 +DL8EBW,JO31NF,EME,,Guido ""Guy",,144: TS2000 12el M2-10°elev GU74b SSB-Preamp,02/05 +DL8FBD,JO40,,,g.,,,1993 +DL8GAM,JN37,,,Urs,,144: TS870 600W 11elDTR,12/97 +DL8GP,JN39LH,EME,,Hans W.,,144: SE400/Icom 761/LT2S 750W 4xCrossyagis (,08/04 +DL8HCZ,JO53AP,,,Joachim,,DTR,11/00 +DL8LAQ,JO43XU,,,Norbert,,144: TS850 LT2S 350Watts Preamp 17el Tonn,01/01 +DL8NBN,JN58,,,a.,,,1993 +DL8OBU,JO42XI,EME,,Jürgen,,432MHz: 750W 4x33el - 1296MHz: 150W 67el1881,11/01 +DL8SCL,JN48RM,EME,,georg,,,03/01 +DL8SCQ,JN48RV,,,Eberhard,,DTR,07/99 +DL8UCC,JO71EQ,EME,,Helge,,144: 500W 2x11el or 2x17el,07/04 +DL8YE,JO31MH,,,Christian,,144: FT221r 17el M2 350W,07/04 +DL8YET,JO31MH,,,,,,01/05 +DL8YHR,JO41GV,EME,,Frank,,50: LT6S 2x9el M2 - 144: 24el M2 750WDTR tx,01/05 +DL9AN,JO62RE,,,Bernd,,50: 10W 5el - 144: FT736r 750W GS35b 2x12el,08/04 +DL9BDM,JO33RL,,,eilert,,,1993 +DL9DBJ,JO31VH,,,,,,12/94 +DL9EBF,JO31FH,,,,,,2003 +DL9EBL,JO31,EME,,karl,,,1994 +DL9GBH,JN48RW,,,,,,12/01 +DL9GRE,JO64PA,,,Stefan,,,08/02 +DL9GS,JO31OM,EME,,Alfred,,DTR,03/01 +DL9IM,JO31,,,,,,07/04 +DL9KR,JO40DE,EME,,Jan,,,09/02 +DL9MCC,JN58UA,,,Johann (Hans),,144: 4x 2-4wl 700W MGF1302 - 432: 2x 7wl 700W,08/03 +DL9MS,JO54WC,EME,,Joachim,,144: 4x17el GS35b MGF1302160 DTR 3500lpm360,11/04 +DL9NDD,JN59KN,,,,,,2003 +DL9OA,JO64EB,,,Bernd,,144: IC821 100W 9el/2.5wl CF300MSDSP,03/02 +DL9OBD,JO42QN,EME,,Thomas ""Tom",,IC7400 144: 4x11el 750W BF981 - 50: 5el 25,10/03 +DL9RCI,JN68,,,,,,07/95 +DL9USA,JO71EN,,,Andreas,,144: 10el DL6WU 300W RXAmpl3000lpm MSDSP,09/03 +DL9YEY,JO41GV,,,,,,2003 +DM1CG,JO31IC,,,Carsten ""Gaby",,50: TenTec 526 10W 4ele 144: TS 850 LT2SMK,01/05 +DM1HD,JO31GD,,,Herbert,,144: TS850S LT2S HLV600 600Watt 17 EL M2only,08/02 +DM2BHG,JO51MW,EME,,Heinz,,144: 4x17el 2xGS35b MGF1302,02/01 +DM2DXG,JO51MV,,,Bernhard,,,06/02 +DM2ECM,JO62GJ,,,,,,11/01 +DM2GS,JO42HJ,,,Günther,,,12/04 +DM2PG,JO51,,,,,,04/03 +DM3FG,JN49LT,,,Frederico,,,04/03 +DM3FM,JO40MF,,,Matthias,,144: IC275H 8el 7ZH,06/02 +DM4KA,JO64II,,,Stephan,,,03/03 +DN1FC,JO41RF,,,OP DL3ZBA,,IC820H 144: 250W 2x11el- 432: 130W 2x23el Pr,07/01 +DN1MA,JN58VF,,,OP: DN1MA- DL5MAE,,144: 8x17el 700WDTR,12/00 +DN2MS,JO31OM,,,OP DJ2QV,,144: C5400 HG51 400W 9el MGF1302DTR,12/98 +DO1CTL,JO60LT,,,Frank,,,08/01 +DO1EDK,JO31RL,,,Dirk,,,05/04 +DO1EL,JO31JL,,,,,,06/02 +DO1ERS,JO31JC,,,Ruediger,,144 : FT 221R 10Watt 4el Yagi WIMO RX-PA06,01/04 +DO1NF,JN69,,,,,,08/01 +DO1YDS,JO42HJ,,,Daniel,,,04/04 +DO3MT,JN67,,,Tom,,FT817,01/03 +DO5AN,JO31,,,,,,04/02 +DO9ST,JN49VW,,,Thomas,,,03/01 +EA1ABZ,IN71QO,EME,,Ramiro (Rami),,144: 4x12el or 11el DL6WU 1500W (4CX250+GS35B,10/02 +EA1AIB,IN82TK,,,,,,08/95 +EA1BFZ,IN81SS,,,,,,04/04 +EA1BLA,IN53UM,,,Manel,,50: 100W 5el - 144: 1kw 12el MGF1302 - 432,10/02 +EA1CRK,IN73DM,,,Carlos,,Kenwood ts-790e or Icom 706 MkII 50: 100W 7,01/04 +EA1CYE,IN83,,,p.,,,1993 +EA1DDU,IN73FM,,,Domingo Alvar ""Domi",,50: 10W 5el - 144: 170W 16el CF300 - 432: 120,08/03 +EA1DOD,IN73AN,EME,,alfredo,,,1993 +EA1EBJ,IN73FF,,,Santurio,,50: IC729 10W 4el - 144: IC260 80W 17el - 432,04/01 +EA1EW,IM79WS,,,Miguel A.,,,07/95 +EA1JK,IN72RA,,,EA1JK,,only SSB-MS,01/01 +EA1KV,IN52PF,,,Andres,,,1993 +EA1OD,IN73EM,,,j.c.,,,1990 +EA1RX,IN52PF,,,Enrique,,IC706 MKIIG,06/03 +EA1SH,IN63GA,,,Manuel,,144: 17B2 170W GaAs-Fet - 432: 31el 180W GaAs,05/04 +EA1YV,IN52OC,EME,,Agustin,,50: IC706 2x5el - 144: TS790e GS35b 2x17elB2,10/02 +EA2AF,IN92,,,,,,1990 +EA2AGZ,IN91DV,EME,,Nicolas,,FT1000MP- FT736 144: 4CX1500b 4x17B2CC MGF140,07/04 +EA2AJX,IN83,,,Inaki,,50: 10W Dipol - 144: 100W 6el Quadonly SSB-MS,08/02 +EA2ARD,IN93,,,,,,08/02 +EA2AVY,IN92DS,,,,,,2003 +EA2KP,IN83MG,,,Miguel ""Mixtel",,144: TR751E 2M18XXX 200W Preamp - 432: 100W 2,04/04 +EA2LU,IN92ET,EME,,Jorge,,144: 4x9el 1KW MGF1302.127 DTR,10/02 +EA2LY,IN93AH,,,Enrique Gil,,144: TS790 4CX1500 LNA144 2x18elDTR,08/98 +EA2RCF,IN82,,,,,,08/02 +EA3ADW,JN11CQ,EME,,J.Miguel (John),,,10/02 +EA3AEL,JN01,,,,,,1993 +EA3AIR,JN11,,,j.i.,,,1993 +EA3AQJ,JN11BJ,,,ramon,,,1987 +EA3AXV,JN01TJ,,,Joaquim ""Quim",,144: FT920+trsv GS35b 17B2,07/03 +EA3BB,JN01VS,,,Pau,,144: 20el M2 400W MGF1302,01/00 +EA3BEW,JN01SG,,,,,,12/95 +EA3BTZ,JN11BI,EME,,Enric,,144: 100W 16el 0.8db preamp,09/02 +EA3CN,JN11BI,,,Manuel,,,03/96 +EA3DUY,JN12LD,,,Tony,,144: 4x17el 800W - 50: 6 el 500W - 432: 21el,08/02 +EA3DXU,JN11CM,EME,,Jose Maria (Josep),,144: 2 x 17 El M2 + 4CX1500B - 432: 2 x 38 E,01/05 +EA3ECE,JN01LT,,,,,only SSB-MS,11/97 +EA3EHQ,JN11HR,EME,,Jose m.,,,03/96 +EA3FLN,JN11KT,,,Jordi,,144: IC275H 450Watts GaAsFET preamp 0.6dB,04/04 +EA3GAW,JN11BI,,,,,,2003 +EA3GCJ,JN11EM,,,Amadeo,,Yaesu FT-107M,04/04 +EA3GFB,JN11,,,,,,12/95 +EA3GIQ,JN01ND,,,Ramon,,,07/95 +EA3IH,JN11BJ,,,rafael,,,1987 +EA3KU,JN00JV,,,Fernando,,144: IC275H 2x4CX250 16el- preamp.113 DTR,07/03 +EA3MD,JN11,,,,,,1994 +EA3MM,JN01WH,EME,,Radioclub,,,1993 +EA3PL,JN11PL,EME,,vicente,,,1994 +EA3TI,JN11JT,,,Ramon,,144: 17el 5lambda Yagi 400Wonly SSB-MS227,01/05 +EA3UM,JN01,EME,,magin c.,,,1994 +EA3URC,JN11,,,OP EB3GCP EB3FYM,,YAESU FT-100 ICOM IC-706MKII - 144: 50W 14el,05/03 +EA3WH,JN01,,,j.g.,,,1993 +EA4AMX,IM89AT,,,Jose Luis,,only SSB-MS,07/01 +EA4BAS,IN80HL,EME,,Miguel,,FT847 144: 17el 180W MGF1302 - 432: 35el 100W,09/02 +EA4ED,IM79FW,EME,,,,,1994 +EA4EHI,IM68TV,,,Jose Luis,,144: IC275H 1500W 4x17B22500lpm,07/01 +EA4EOZ,IN80CI,,,Miguel Angel,,144: TM255 9el 40WDTR 3000lpm,01/02 +EA4LU,IM68TV,,,Paco,,144: FT726r 400W 17el (17B2).080 1500lpm,04/03 +EA4SV,IM68MU,,,Roberto,,,04/04 +EA5AAJ,IM99SL,,,Manuel ""Dom",,144: IC-706MK2G 100W 9el,04/04 +EA5CJ,IM99TL,EME,,jacinto,,,1994 +EA5EMM,IM99,,,j.,,,1993 +EA5GIY,IM98XD,EME,,Eric,,,01/99 +EA5HM,IM99,,,p.r.,,,1993 +EA5IC,IM98,,,mario,,,1994 +EA5NO,IM98FV,,,,,,08/97 +EA5SE,IM98IL,EME,,,,,11/04 +EA5ZF,IM99VT,EME,,Javier Oliver,,50: 50 W 3 el - 144: 800Watt 17el LNA145 -,08/03 +EA6ADW,JM19LU,EME,,Peter,,50: 20dbd- 144: 40W- 10el- up: div. Spiegel,07/97 +EA6DD,JM19JK,,,Biel,,144: IC706MKIIG 17elB2 100W,05/03 +EA6FB,JM08PV,EME,,Jose,,085 MSDSP,08/02 +EA6IB,JM09SB,,,OP EA6FB-6QB-EB6AOK,,144: IC251E 150W 15elYagi076 2000lpm MSDSP,04/02 +EA6NP,JM19MQ,,,juan miguel,,,1993 +EA6QB,JM08PV,,,Bartolome ""Bartolo",,144: 2x15el 4CX400MSDSP,05/03 +EA6SA,JM19IR,EME,,Josep,,144: FT847 2x4CX250 2x17el - 432: 4x33el,08/02 +EA6VQ,JM19HN,EME,,Gabriel,,144: 1.5KW MGF1302 8x17el M2 432: 21el,01/05 +EA7AJ,IM87CS,,,Juan,,144: 300W 2x 19el,08/04 +EA7DBH,IM76GD,,,miguel angel,,,1994 +EA7EYX,IM87CS,,,,,,12/04 +EA7HG,IM87CS,,,Uge,,,01/04 +EA7IT,IM87XI,,,John,,144: 14el 100W.147 1200lpm,10/00 +EA7OC,IM77OV,,,Luis R.,,144: IC820 250W 17el.330,03/01 +EA7RM,IM87CS,,,Manuel Abian (Nino),,144: TR9130 240W 17B2 OH5IY2000lpm,07/02 +EA7TL,IM76GC,,,juan lucas,,,05/96 +EA7TN,IM66VP,,,Nacho,,TS2000 144: 100 W 2.5 wl,10/04 +EA8FF,IL28,EME,,Mark,,,02/01 +EA9AI,IM75IV,,,Francisco Javier,,144: 100W 9el.070,06/03 +EA9MH,IM85NG,,,Manuel,,only SSB-MS.400,05/00 +EB1BKG,IN62BH,EME,,Pily,,,11/01 +EB1DNK,IN62CI,EME,,Jose Manuel,,144: IC706 4x17el 500 Watt MGF1302 - 432: 7,01/05 +EB1EFC,IN52OF,,,alfonso,,,1993 +EB1EHO,IN73DM,,,Luis,,144: 17el 200W - 432: 21el 50W130280,07/04 +EB1EUW,IN82TK,,,,,,1995 +EB1IHY,IN52PM,,,Julian,,144: 17el 160W,07/04 +EB1ISN,IN71SW,,,Juanjo,,Icom 275H 16el Arake,12/04 +EB1IVY,IN53SJ,,,Gonzalo ""Zalo",,,07/02 +EB2AYV,IN83MG,,,George,,144: 250W 2M18XXX,01/04 +EB2DTP,IN82NS,,,Inigo,,FT847 IC746 FT816 17el 1000W,08/03 +EB3BAP,JN11CJ,,,Patxi,,144: FT736r 200W 17elonly SSB-MS,01/01 +EB3CNX,JN11DI,,,,,,1993 +EB3EPR,JN01ND,,,,,,2003 +EB3GHU,JN11CJ,,,Ramon,,,04/04 +EB3WH,JN01WN,,,Juanjo,,,1993 +EB4DF,IM79QQ,,,Juan,,TS-790 FT-817 144: 500W 17el - 432: 500W 21,06/04 +EB4EQZ,IN80DK,,,,,only SSB-MS,08/96 +EB4ERS,IN80BH,,,Juan Carlos,,FT736 144: 140W 9el GaAs-Fetonly SSB-MS.385,01/00 +EB4EUB,IN80DJ,EME,,Toni,,50: 6el 100W - 144: 17el 1KW MGF1302 - 432: 2,08/00 +EB4FXD,IM78BX,,,Manolo,,144: 150W 17el,02/04 +EB4GIA,IN80CG,,,Pedro,,144: IC821 IC706 TS790 240W 17el - 432: 100W,02/98 +EB4TT,IN70XJ,,,Miguel,,.183 DTR,05/00 +EB5AYG,IM99TN,,,Paco,,144 FT902DM Trvt 4cx350 4x11el F9FT,05/03 +EB5AZO,IM99RA,,,Paul,,,11/04 +EB5EEO,IM98PG,EME,,Vicente,,144: FT736 2x17el 4CX1500 DSP - 432: FT736 4x,09/99 +EB5EHX,IM99,,,x.-a.,,,1993 +EB6AOK,JM09RB,,,Enrique,,144: 70W 9el,04/03 +EB7BQI,IM76SR,,,,,,06/03 +EB7COL,IM77AG,,,Jose,,,05/04 +EB7EFA,IM67XI,,,mairena,,,1995 +EB8ANY,IL18,EME,,Marc,,144: 500W 4x 7el,12/04 +EB8BTV,IL18QI,,,Fernando,,only SSB-MS,05/03 +ED1GSR,IM79WS,,,,,,1994 +ED4RKF,IM79WS,,,OP EB4GIA,,144: 240W 13el1500lpm,03/97 +ED5TOR,IN90XP,,,Op. DL3MGL,,,1993 +ED6EIG,JM19IM,,,,,only SSB-MS.243,08/99 +EG3TVC,JN11BI,,,OP EA3DXU,,144: 400W 17el M2.115,12/99 +EH1RX,IN52IN,,,Enrique,,IC706 MKIIG,03/02 +EH3AXV,JN01TJ,,,Joaquim ""Quim",,50: FT920+trsv GS35b 6elYagi150,07/02 +EH5RM,IM98,,,,,,07/02 +EH7RM,IM76QM,,,,,,2003 +EH9LS,IM75IV,,,,,,2003 +EI2CA,IO62,,,Paul,,only SSB-MS,1988 +EI2FSB,IO51DN,,,Tony,,144: 100W 2x9el,05/02 +EI2VPX,IO53IQ,,,,,,1991 +EI3GE,IO63XD,,,Jim,,only SSB-MS,08/00 +EI4DQ,IO51WU,EME,,Tom,,144: TS711 4CX1500b MGF1302 4x14el or 13el500,08/02 +EI4VBE,IO42,,,OP DF1ZE,,,1988 +EI4VBS,IO42,,,,,,1990 +EI4VWY,IO54,,,,,,08/01 +EI4VWZ,IO55,,,,,,08/01 +EI5FK,IO51RT,EME,,Charles,,144: FT847 150W 9elMSDSP,05/04 +EI5HN,IO41UT,,,OP DF6NA,,,1995 +EI6CPB,IO63WE,,,Hugh,,50: IC706 - 144: IC821.310,06/03 +EI6GF,IO62RG,,,,,,02/98 +EI7IX,IO53FT,,,Dermont,,TS2000,08/04 +EI7RCG,IO62,,,,,144: 27el,08/96 +EI7RSD,IO62WX,,,OP EI2CA,,144: 27el 400Wattsonly SSB-MS.225,07/96 +EI9HW,IO63MP,,,John,,,10/93 +EJ4VNX,IO43,,,,,,1993 +EJ6O,IO43MM,,,,,,1994 +EM1U,FC74US,,,,,,2003 +ER1AN,KN46KX,,,Sergei,,144: FT857 200W 2x10el,12/04 +ER2RM,KN46KA,,,,,,11/05 +ER5AA,KN45CW,,,Vasilij,,,06/00 +ER5AL,KN45CW,,,,,,07/02 +ER5OIW,KN46KX,,,,,,01/05 +ER5OK,KN46KA,,,,,,01/05 +ES0Q,KO17AV,,,Tom,,,06/04 +ES0X,KO18,EME,,OP ES2RJ,,,07/99 +ES1CW,KO29HK,,,Arvo,,,05/98 +ES1RF,KO29IJ,EME,,Gennadi ""Gene",,FT1000MP/FT847/FT736 Preamps 50: 2x5el 500W,02/04 +ES2CM,KO29DJ,,,Aimar,,ICOM-706 mkIIG,01/03 +ES2NA,KO29JL,,,Andrus ""Andy",,144: IC706MKII 300W 9el137,04/02 +ES2QH,KO29LL,,,Aarne,,144 : FT847 700Watts 9ele Preamp - 432: IC82,08/01 +ES2RJ,KO29JM,,,Toomas ""Tom",,144: TS790 350W 9el.177 DTR 3000lpm.210,05/03 +ES2RQ,KO28WA,,,,,,01/05 +ES2WX,KO29JN,,,,,,05/03 +ES3BR,KO28JS,,,,,,05/04 +ES3GZ,KO28,,,jaan,,,1993 +ES5KJ,KO38IJ,,,Tom,,,01/05 +ES5MC,KO38JJ,,,,,,12/95 +ES5MG,KO38IJ,,,Guido,,,1/94 +ES5PC,KO38IK,,,,,,08/98 +ES5RE,KO38,,,,,,1994 +ES5RN,KO38,,,,,,1994 +ES5RY,KO38JI,,,Toomas,,,11/02 +ES5WE,KO38JJ,,,,,,1994 +ES6DO,KO27WX,,,Neil,,IC706MKII + Preamp 50: 4el - 144: 15el 3,09/03 +ES6LBN,KO37AW,,,Rein,,144: 170W 11el366,07/04 +ES6RQ,KO28WA,EME,,Ants,,TS2000 FT736 FT847 144: 1KW 4x18el 9BV,08/04 +ES8AS,KO28FJ,,,,,,04/04 +ES8X,KO18XC,EME,,OP ES2RJ,,144: TS790E+PA 300W 2x9 el or FT 847+ PA 30,07/02 +EU1AA,KO33SJ,,,,,,01/05 +EU1AB,KO33SU,,,George,,,01/96 +EU6MS,KO45IN,,,Victor,,144: 16el 700W MGF1302.178 2000lpm.300,09/01 +EV2AA,KO33PM,,,,,,2003 +EV2AAB,KO33ST,,,,,,2003 +EV2OEU,KO52IK,,,,,,2003 +EV5M,KO43KB,,,OP DL5BAC- DJ9YE,,,1994 +EV5N,KO42RX,,,OP DL5BAC- DJ9YE,,,1994 +EW1RZ,KO33SV,,,Sergej,,,10/01 +EW6AL,KO46KB,,,Aleksej,,.178 3000lpm,08/98 +EW6DX,KO45JL,,,Igor,,144: 100W 9el.087 800lpm,08/97 +EW6FS,KO35LB,,,Anton,,144: 20W 2x16el F9FT Preamponly SSB-MS.300,01/03 +EW6GB,KO45CN,,,Andy,,144: 200W 10elMSDSP.300,08/02 +EW7IM,KO53,,,anatoly,,,1992 +EW7IN,KO53,,,,,,1994 +EW7IW,KO53DR,,,,,,2003 +EW8DD,KO42QA,,,Valentin,,144: 4x16el F9FT- 50W,12/98 +EY8MM,MM48FI,EME,,,,144: 200W 2 yagi,10/04 +F0DBD,JN08XW,,,Frederick,,FT726R 10W 10el Preamp,01/02 +F0EJW,IN78,,,,,,12/04 +F1AFJ,JN06HT,EME,,Jean-Pierre ""John",,144: 4x11el F9FT 1500 W 0.4dB2000lpm WINDSP,11/04 +F1AKK,JN39CC,,,Oli,,only SSB-MS,07/01 +F1AOE,IN93RS,,,,,,04/04 +F1CCM,IN93MP,,,,,,1993 +F1CNE,JN28,EME,,denis,,,1994 +F1DLZ,JN19FH,,,,,,05/04 +F1DUZ,IN97NJ,,,Philippe,,144: FT225RD 2x 4CX250R 700W 2 x 11el pre,12/04 +F1EBK,JN18BW,EME,,Patrick,,144: TS790A 300W 4x10el DK7ZB,11/04 +F1EBN,JN18JR,,,,,,08/02 +F1ELL,JN18EX,EME,,robert,,,1994 +F1FEN,JN25JC,EME,,gilles,,,1994 +F1FHI,IN97GD,,,,,,2003 +F1FIH,JN23GS,,,Michel,,,04/03 +F1FLA,JN26KU,EME,,Jena-Jacques,,144: 4x25el Xpol 7.6lb 1KW MGF1302.022.270,10/99 +F1FVP,IN95XA,,,,,,2003 +F1GHP,IN96LE,,,,,,2003 +F1GTR,IN96JE,,,,,,2003 +F1GTU,JN05IF,,,,,,07/98 +F1HAR,JN18DT,,,marc,,,1993 +F1IHP,IN88,,,,,,07/02 +F1ISJ,IN97QM,,,Eric,,FT847,05/02 +F1IXQ,JN15MQ,,,Jim,,,12/01 +F1JG,JN23HQ,,,,,,08/02 +F1JOE,JN05IF,,,francois,,,1993 +F1JRD,JN13WO,,,Lionel,,144: TR751 GS35b 2x11el F9FT5000lpm,12/04 +F1MBM,JN38CQ,,,Alex,,FT225RD 144: 8877 4CX250 MGF1302 16el F9FT,12/02 +F1MOZ,JN27MH,,,Bruno,,,01/04 +F1MPQ,JN09SG,,,Bruno,,144: 2x9el 2KW - 432: 80W 26el doublequad,02/04 +F1NGP,JN39CC,,,Yann,,,04/97 +F1NNI,IN88,,,,,,04/02 +F1NSR,JN33JK,,,Yannick,,144: IC275h 17B2 2x24CX250,01/04 +F1ODA,JN13FO,,,,,144: 400W115215,10/02 +F1PUX,JN16XL,,,Denis,,TS690S 144: LT2S 200W 20el - 50: 5elonly S,01/99 +F1PYR,JN19DA,,,,,,04/02 +F1PYW,JN38UP,,,Eric,,144: 120W 9el or 2x11el - 432: 17el or Helix,03/99 +F1RAD,JN25WF,,,Yvan,,50: 5W 1/4wl. - 144: TR751e 25/200W.300,05/02 +F1RHS,JN03PV,,,,,only SSB-MS,11/01 +F1VJQ,IN95OL,,,OP G8APZ G4FUF,,,07/04 +F2TU,JN38LG,EME,,Philip,,,11/01 +F3VS,JN38LF,EME,,Claude,,24x20el (6wl) & 8x20el (6wl) DJ9BVs,03/99 +F4ALP,JO10OP,,,,,,12/01 +F4APX,JN23XL,EME,,Fred,,144: 4*18EL - 432: 4*21EL 2*4CX250,01/04 +F4ARU,IN94VT,,,Jeremie,,144: 4x3.6wl 1KW 8877,11/01 +F4AZF,JN38IW,,,Damien,,144: IC275h 500W 8874 4x 4.4wl DJ9BV Preampo,08/03 +F4BKV,IN95PT,,,Vincent,,144: TS700 150W 9el - 432: TS440S TRV 70W 21,04/02 +F4CIB,JN03,,,Franck,,144: 250W 9el.241,05/02 +F4CYZ,JN38SF,EME,,Florent,,144: FT897D 150W 9el Yagi,01/05 +F4DDX,JN23QG,,,Claude,,TM255E,11/04 +F4DSD,JN23JO,EME,,Emmanuel,,,01/05 +F4DXX,IN97LH,,,BRUNO,,,11/03 +F4JRC,JN23JW,EME,,Tempier,,144: 4x10el,01/01 +F4JVG,JN16UM,,,,,,07/02 +F5ANT,JN24RJ,,,Rene,,only SSB-MS,04/96 +F5AQC,JN05PU,,,,,,2003 +F5BUU,JN03BO,,,Jean-Claude,,,01/05 +F5DE,JN05DP,,,Bernard,,50: 50W 5el - 144: 100W 16el076 DTR 2000lpm,01/05 +F5EAN,JN06CP,EME,,jean michel,,,1994 +F5FEN,JN25JC,,,,,,2003 +F5FHI,IN97GD,EME,,jean pierre,,,1994 +F5FLN,IN94SR,,,Michel,,144: 300W 17el800lpm,08/99 +F5FVP,IN95WB,,,Jean Yves,,144: 4x17el 1KWonly SSB-MS,07/00 +F5GHP,IN96LE,,,Jean-Pierre,,144: IC745 700W 14el 9BV CF3002500lpm MSDSP,07/02 +F5HRY,JN18EQ,EME,,Herve,,144: 1KW 4x11el.077 DTR,11/02 +F5IVP,JN23,,,,,,08/02 +F5JNX,JN37PV,,,Jean-Marc,,,01/04 +F5JRX,JN25AW,,,bruno,,,1994 +F5KCR,JN26IX,,,OP: F1RXC- F1JLD,,,08/96 +F5KDK,JN23VF,,,,,,2003 +F5KPO,JN24,,,,,,12/01 +F5LEN,JN38BO,,,Pascal,,144: IC275A 250W 17elB2054 MSDSP.254,10/01 +F5LKW,JN23SJ,,,Roger,,144: TS700 60W 13el2000lpm,04/03 +F5LRL,JN26MV,,,Mike,,144: 400W 4x10el,05/02 +F5LUW,JO10MP,EME,,Francois,,,11/95 +F5MGD,JN07AW,,,Stephane,,FT102 + tvtr2500lpm,05/04 +F5MSL,JN26JS,EME,,Eric,,144: 8877 4x11el (or 4x10el) MGF1302.090.220,02/99 +F5MZN,IN87BU,EME,,Oliver,,,08/96 +F5NWK,IN97EJ,,,Tanguy,,144: 9el 200W,05/04 +F5OIH,JN06,,,Vincent,,,08/03 +F5PAU,IN88CB,,,,,144: 4x11el 150W,07/02 +F5RRS,JN36EB,,,Damien,,144: 200W 10el Quad,11/04 +F5SDD,JN23RF,EME,,Dave,,FT901 IC211,01/04 +F5SE,JN29BG,,,,,,06/03 +F5SJE,JN13,,,,,,12/95 +F5SJP,JN13VQ,,,Stephan,,144: TS790 180W 17B2TX1200 RX 5000lpm,01/02 +F5TMJ,JN03VP,,,Laurent,,IC706 MK2G,12/04 +F5VBW,JN03,,,,,,06/95 +F5VHX,JN04FT,EME,,Graham,,130,06/03 +F6ANQ,IN94RT,,,Christian,,DTR,07/96 +F6AOI,JN33NQ,,,,,,08/02 +F6BAZ,JN39EF,,,Henri,,,06/02 +F6BEE,JN08FU,,,,,,2003 +F6CBH,JN19BH,,,christian,,,1994 +F6CGJ,IN78RK,EME,,Louis,,144: 4x11el 400W,04/00 +F6CIO,JN26JH,,,,,,09/98 +F6CJG,JN15,EME,,g.,,,1993 +F6CKZ,JN09LH,,,,,,01/97 +F6CRP,IN96KE,,,Denis,,144: 300W 2x11el - 432: 100W 2x21el MGF1302-,12/04 +F6CTW,JN18,EME,,rene,,,1993 +F6DHI,JN23RK,,,Chris,,144: 200W 9el MGF1302370280,04/04 +F6DKW,JN18CS,,,,,,02/01 +F6DRO,JN03TJ,,,Dominique (Dom),,2500Watt 18el BF981081 3000lpm DTR231,03/04 +F6DWG,JN19DL,,,m.,,,1994 +F6DWH,JN19,,,,,,1995 +F6EAS,IN98,,,,,DTR,08/01 +F6EMT,IN98FG,EME,,jean p.,,,1994 +F6EYM,IN99,EME,,guy,,.070,12/95 +F6FHP,IN94TR,EME,,Joel,,144: 1KW 4x6 wl5000lpm DTR,01/05 +F6FLV,JN18AT,,,Jean-Pierre,,,02/96 +F6FTN,JN08XS,,,Bernard,,144: 4x9el 300W,01/04 +F6GPT,IN94SW,,,John-Marc,,144: 11el 400Wonly SSB-MS,05/04 +F6GRB,JN25KP,,,Philippe,,,01/05 +F6HVK,JN27LH,EME,,Andre,,144: 300W 17el or 4x17el M21000lpm DTR,07/99 +F6HYE,JN36DG,EME,,patrick,,,1994 +F6IFX,JN07CX,,,Bertrand,,,07/02 +F6IZZ,JN18GR,,,,,,2003 +F6JXR,IN98HW,,,,,,09/98 +F6KHM,IN78RJ,EME,,Clubstation,,only SSB-MS,06/02 +F6KRK,JN18AS,,,Clubstation,,144: 17el 120W,02/01 +F6KSX,JN18,,,,,,2003 +F8BKD,JN38LG,EME,,Didier,,144: TS-2000 4X11 el 1000W,01/03 +F8CS,JN27UR,,,,,,08/98 +F8DNX,IN93FJ,,,Thierry,,FT 847 - 144: 2x9el 170W,07/04 +F8DO,JN26IF,EME,,Marius,,50: TS680S 5el - 144: FT225 4CX1000 2x11el MG,01/05 +F8IPS,JO00SQ,,,Carnello,,,07/00 +F8KFR,JN09RG,,,OP F1MPQ,,144: 2x9el 1-8KW - 432: 80W 26el doublequad,04/03 +F8OP,JN26MM,EME,,Georges,,50: TS690 100W 6el - 144: FT225RD Mutek 2x4CX,02/05 +F8PKC,JN38MG,EME,,,,FT726,04/01 +F9HS,JN23AT,EME,,Claude,,144: 4xBVO3WL 8877 CFX13059 MSDSP285,03/04 +F9IE,IN86WW,,,Bernard,,only SSB-MS,05/04 +FA1APX,JN23XL,EME,,Fred,,144: IC970 4 x 22 el DJ9BV 2 x 4CX350F,04/00 +FC1DUZ,IN97NB,,,,,,2003 +FF6KBF,JN18BW,,,,,,2003 +FK8HA,RG37FR,,,,,,2003 +FM5CS,FK94LI,,,,,,2003 +FO4NK,BH52,EME,,alaine,,,1994 +FO5RK,BH52,,,,,,2003 +FR5DN,LG78SS,EME,,Philippe,,,03/99 +FS5UQ,FK88LC,,,,,,2003 +FY5DG,GJ35QD,EME,,,,,2003 +G0AEI,JO01GO,,,,,,1991 +G0AFH,JO01EI,,,,,,08/01 +G0BPU,JO02,EME,,michael,,,1994 +G0CHI,IO90PS,,,kevin,,,1993 +G0CUH,IO70LG,,,Steve,,,07/04 +G0CUZ,IO82WM,,,Colin,,FT726r 50: 50W 2el - 144: MGF1302 2x3CX40,07/02 +G0EVT,IO93GR,,,John,,144: IC202S 250Watts 3wl DJ9BV,07/01 +G0FIG,IO90UU,,,Alec,,50: IC575h 6el 400W - 144: IC275h 400W 10el M,05/00 +G0GMB,IO92NB,,,Martyn,,,03/04 +G0GMS,IO82XT,,,Tony,,144: IC746 IC756pro Demi TVRT GS35b 0.25db p,01/05 +G0HYP,IO84FN,,,Kenneth,,FT847 IC1271E 144: 1.5KW 2x17el - 432: 2x21e,04/03 +G0ISW,IO84OQ,,,Philip,,FT847 Yagis + Create Log Periodic370,03/04 +G0JDL,JO02UK,,,John,,,01/96 +G0JUR,IO92WT,,,Neill,,,08/99 +G0KAS,IO91UI,,,Mike,,144: IC275h 2x4CX250b 17el Preamp.111 DTR,01/00 +G0KPW,JO02OD,,,Bob,,144: 400W 2x17B2only SSB-MS,04/03 +G0KUX,IO91WP,,,,,,11/01 +G0KZG,IO80,,,Andy,,DTR 1800lpm,10/02 +G0LBK,IO93JK,,,dave,,,1993 +G0MGA,JO00DT,,,simon,,,1993 +G0MJW,IO91JO,,,Mike,,50: 100W 5el - 70: 160W 4el - 144: 2x4CX250b,1997 +G0NFA,IO91NE,,,Derek,,144: IC271A.056.285,04/01 +G0PES,IO83LS,,,,,,11/99 +G0RRJ,IO91FE,,,Dave,,1296: 100W 55el,04/04 +G0RUZ,IO93FR,EME,,Conrad,,144: IC746 GS35b 6x 4.6wl. 32JXX X-Pole MG,10/02 +G0TPH,IO92IO,,,,,,12/01 +G0UWK,IO83VC,,,Ian,,FT1000mp 144: TV144/28 GS31b 400W 5WL 432:,10/04 +G0XDI,IO91RP,,,,,,11/01 +G1EMJ,IO82WM,,,neil,,,1993 +G1GEY,IO94FW,EME,,don,,,1994 +G1HWY,IO90UV,,,Mike,,144: TS790e 150W 13elDTR 6000lpm,08/03 +G1OGY,JO01GR,,,David,,,09/04 +G1SWH,IO83QO,,,Gerry,,,10/04 +G1WPF,IO91RP,,,Matthew,,144: IC275E Tempo2002 3CX800 9elonly SSB-M,08/99 +G1XRL,EN35,,,,,,2003 +G1YJI,IO91WP,,,,,,11/01 +G3BW,IO84,,,w.h.,,,1993 +G3FPQ,IO91vc,EME,, +G3JHM,IO91LC,,,Don,,50: 100W 5el - 144: 400W 2x13elonly SSB-MS,05/01 +G3LQR,JO02QF,EME,,simon,,,1994 +G3NAQ,IO91HL,,,Geoff,,50: 400W 3el - 4: 100W 2el - 144: 400W 17el -,08/03 +G3UTS,IO94CU,,,Reg,,144: 400W 9el M2 BF981171370,02/04 +G3WCS,IO83RH,,,Ken,,144: TS430S HB Transverter HB Amp 2x4CX250B,01/05 +G3WZT,IO90UX,,,John,,IC756PRO 50: 7el 400W - 144: 2x9el 400W - 4,08/03 +G3YNN,JO00EU,,,,,50: 2-5W 5el - 144: FT736 100W 14el - 432: F,05/04 +G4AEP,IO91NJ,EME,,Bill,,144: 400Watt 17el ATF53045rx2000 tx1200,01/05 +G4AFJ,IO92HO,,,Geoff,,144: 150W 10el500lpm,09/01 +G4ALY,IO70UL,,,,,,12/03 +G4AOA,IO83TD,,,tony,,,1993 +G4APA,IO83VI,,,Tony,,144: FT726R 200Watts 9ele BF981.160.260,01/01 +G4APJ,IO83UP,,,Ken,,FT736 FT817,08/03 +G4ASR,IO81MX,EME,,David,,144: FT221GTi 2x3CX400 17el (4x17el)2500 DT,02/04 +G4BRK,IO91DP,,,Neil,,144: 80W 9el1000lpm,03/02 +G4CBW,IO83UB,,,Paul,,144: TS2000 IC756PROII 2x 9el 180W,09/04 +G4CCH,IO93ql,EME,, +G4CJG,IO94CR,,,jerry,,,1993 +G4CLA,IO92JL,,,Pete,,,09/03 +G4DBL,IO91JJ,,,Tim,,144: IC746PRO 4CX350 300W 17el,11/04 +G4DHF,IO92UU,EME,,David,,028215,09/04 +G4DOL,IO80SP,,,p.,,,04/99 +G4DZU,IO93ES,EME,,Doug,,1296: 800W 3m. Dish,08/01 +G4ERG,IO93SR,EME,,Peter,,144: 16x10el- 2x3CX800- MGF1302,02/99 +G4ERP,IO81XW,,,,,,2003 +G4FDX,EN60VL,,,,,,2003 +G4FRE,JO01KK,EME,,dave,,,1994 +G4FUF,JO01GN,EME,,Keith,,,01/05 +G4HGI,IO83PL,,,Richard,,144: TS780 GS35b 400W 17el2000lpm DTR,08/04 +G4HGT,IO83,,,j.,,,1993 +G4IGO,IO80NW,EME,,Kenneth ""Ken",,50: IC706 300W 6el - 144: IC706,02/05 +G4JCC,IO90MS,,,,,,01/03 +G4KLX,IO93FB,,,Jonathan,,,03/04 +G4KUX,IO94BO,EME,,nick,,,08/03 +G4KWQ,IO92AQ,,,Andrew,,144: FT847 400W Preamp 16el Tonna,04/03 +G4LOH,IO70JC,EME,,Tim,,.255,02/04 +G4ODA,IO92WS,,,Keith B.,,,01/05 +G4PBP,IO82WO,,,,,,07/01 +G4PCI,IO91AL,,,George,,IC756PRO,01/03 +G4PIQ,JO01MU,EME,,Andy,,144: 2x3CX800 ATF10136 4x15el CueDee2500lpm,10/04 +G4RGK,IO91ON,,,Dave,,144: 300Watt 17el MGF1302 - 432: 400Watt 8x2,03/01 +G4RKV,JO01OI,,,Lee,,144: IC275E EME Pwr 2x9el MGF1302.075 DTR,01/01 +G4RNL,IO83,EME,,don,,,1994 +G4RRA,IO80BS,,,Paul,,144: 4x10el 400WDTR,08/03 +G4SHC,IO83VO,,,r.,,,1993 +G4SSO,IO91TO,,,,,,08/94 +G4SWX,JO02PB,EME,,John,,,01/01 +G4UPS,IO80JV,,,,,,01/97 +G4VIX,JO01PU,EME,,dave,,,1994 +G4VPD,IO92BJ,,,,,only SSB-MS, +G4VXE,IO91QL,,,Tim,,,03/01 +G4WQE,JO01CJ,,,,,,2003 +G4XBF,IO91QE,,,Mike,,DTR,04/99 +G4XUM,IO83,EME,,Martin,,,10/02 +G4YTL,IO92MB,EME,,David,,144: IC275 1KW 4x5lb DJ9BV.095,05/03 +G4ZFJ,JO01HO,,,Colin,,,07/04 +G4ZHI,IO91KN,EME,,Bryn,,432: TS790 1KW 4x3wl 9BV SSB Preamp2000lpm,05/03 +G4ZTR,JO01KW,EME,,John,,144: FT1000MP LT2S 2x4CX250B MGF1302 CC17,04/02 +G6DER,IO93GN,,,Keith,,,01/97 +G6HKM,JO01FT,,,Ela,,,1994 +G6RAF,IO92QP,,,op GW8VHI,,,10/95 +G6TEL,IO90AR,,,,,,05/04 +G6XRK,IO90RN,,,Mike,,144: IC820H Henry2002 Mutek 15el M2,1998 +G6XVV,IO93,,,h.,,,11/95 +G6YAY,IO80EL,,,,,,2003 +G6YIN,IO93ET,,,,,only SSB-MS,01/99 +G6ZTU,IO93HN,EME,,conrad,,,1993 +G7KQW,IO93,,,,,,2003 +G7LIJ,JO01GG,,,brian,,,1995 +G7RAU,IO90IR,,,Dave,,144: FT757 Mutek 2x9el 400Wonly SSB-MS.380,05/02 +G8BHH,IO82WO,,,Russ,,,07/01 +G8CLZ,JO00EU,,,,,50: 2-5W 5el - 144: FT736 25W 9el - 432: FT7,09/01 +G8DSL,IO90FW,,,,,,2003 +G8ECI,JO03AK,,,Derek,,50: 5el 300W - 70: 5el 160W - 144: 10el 3,01/01 +G8GTD,IO93,,,,,,11/01 +G8IZY,IO91VC,,,Steve,,144: TS700G BF981 4CX250b 250W 9el M2only SSB,01/01 +G8LZG,IO93SR,,,Graham,,FT847 or FT100,11/01 +G8MYK,IO92BJ,,,Alan,,IC275H- 100W- 17el.350,07/02 +G8OPR,IO91FE,,,,,,2003 +G8PYP,IO90AS,,,steve,,,1993 +G8ROU,IO92,,,dave,,,1993 +G8RWG,JO01BN,EME,,Niels,,144: FT1000MP DEM144/28 2x8874 MGF1302 9el fu,05/02 +G8T,IN79JX,,,,,only SSB-MS,06/02 +G8TIC,IO82VF,,,Mike,,50: 6el 400W - 144: JST245 trx 10el 3CX800,12/01 +G8TOK,JO01BI,,,Derek,,,04/02 +G8UUR,IO92ET,,,Phil,,144: 80Watts 3ele@10mtrs,07/00 +G8VHI,IO92FM,,,Reg,,50: 100W 4el - 70: 10W 4el - 144: 9el 200W -,07/04 +G8VR,JO01DJ,,,Ken,,50: 3el 100W1000lpm,05/03 +G8VYK,JO01,,,,,,10/04 +G8XVJ,IO83RJ,,,Erik,,144. LT2S 8877 17el M2only SSB-MS.185,08/99 +GB2LBN,IO85,EME,,OP MM0CCC,,144: 17el 100W,08/00 +GB2WQ,IO66,,,,,,1992 +GB4IOM,IO74PB,EME,,,,,05/04 +GB4SPT,IO74PB,EME,,,,,05/04 +GB4VR,IO57,,,,,,1990 +GB4XS,IO78HA,,,OP GW4VVX- GM0CLN,,50: IC746 100W 4el - TR9130 - 70: 150W 6el -,08/00 +GD0WKX,IO74SD,,,Graham,,,10/95 +GD4IOM,IO74QD,EME,,Andy,,50: 400W 4x7el - 144: 400W 8x9el - 432: 400,08/01 +GD4UFD,IO74,,,,,,1988 +GD7HEJ,IO74SD,,,Graham,,,10/95 +GI0OTC,IO65QE,,,Alan,,,12/00 +GI1JUS,IO74,,,i.,,,1993 +GI4KSO,IO64XK,,,Darrell,,70: 100W 3el - 144: 300W 8el,07/03 +GI6ATZ,IO74AJ,,,Gordon,,144: IC251E Mutek FE 300W 13el.270,03/01 +GI8YDZ,IO65,,,a.,,,1988 +GJ0JSY,IN89XE,,,,,,12/01 +GJ0RUZ,IN89,EME,,,,,03/02 +GJ4ICD,IN89WE,,,Geoff,,,10/98 +GM0BQM,IO85CE,,,Mike J.,,144: 200W 2x17elDTR tx850lpm,03/02 +GM0CLN,IO85HV,,,Colin R.,,50: 20W indoor ant - 144: TR751E 100W 14elon,03/02 +GM0EWX,IO67UL,,,,,144: 12el 8874,05/02 +GM0GMD,IO86AE,,,Tom,,,07/00 +GM0HUO,IO86OI,,,Arlen,,FT736r 50: 100W 3el - 144: 180W 12eltx1200,08/99 +GM0JOL,IO78VM,,,j.,,,1993 +GM0ONN,IO87,EME,,Ian,,,10/00 +GM0WDD,IO85JV,,,Gavin,,TS690 - 144: Trvt 9el OZ5HF 200WDTR,08/99 +GM0WDF,IO75PW,,,John,,144:TS940 Trsv IC271E 400W 17el,09/01 +GM3POI,IO88OW,,,c. s.,,,10/01 +GM3SBC,IO85IX,,,,,,05/03 +GM3UCN,IO85RV,,,,,,04/04 +GM4AFF,IO86ST,,,Stewart,,144: 14el Tonna EME-Pwr MGF1302only SSB-MS,08/03 +GM4CXM,IO75TW,EME,,Ray,,144: TS700 3cx800A7 9el Mutek,06/03 +GM4ILS,IO87IP,,,,,,07/01 +GM4ISM,IO85AR,,,,,,09/02 +GM4JJJ,IO86GB,EME,,David,,144: 4x3wl XPOL 8877,05/01 +GM4OGM,IO85,,,s.,,,1988 +GM4VVX,IO78TA,,,Clive,,50: TR751E 5W Dipol.222,08/03 +GM4YXI,IO87WJ,,,Keeth,,1500lpm,04/00 +GM5RP,IO66,,,,,HCSW,08/01 +GM6VIU,IO85,,,,,144: TR851E 25W 24el,11/99 +GM6VXB,IO97AQ,,,,,,02/04 +GM7ASN,IO78TA,,,,,,06/95 +GM7LVJ,IO85,,,gavin,,,1994 +GM7PBB,IO68UM,,,John,,50: IC756,10/04 +GM8OEG,IO86LL,,,Andy,,,02/04 +GU7DHI,IN89RL,,,,,,12/01 +GW0KZG,IO82,,,Andy,,DTR 2500lpm,12/98 +GW0PZT,IO72PT,,,edward,,,1993 +GW0VWD,IO81EM,,,Allan,,only SSB-MS,07/96 +GW3HWR,IO71XN,,,Heath,,FT847 - 144: 350W 9el Preamp,04/03 +GW3LEW,IO71PS,,,,,,04/03 +GW3XYW,IO71,EME,,,,,01/05 +GW4DGU,IO71SV,EME,,Chris,,144: 600W 15.6dbi ant,03/04 +GW4HDF,IO81JO,,,Vic,,,04/02 +GW4LXO,IO81,,,Jonathan,,,08/98 +GW4UWR,IO81LP,,,,,only SSB-MS,08/99 +GW4VEQ,IO73SG,,,Tony W.,,,10/02 +GW4VVX,IO81JP,,,,,,06/95 +GW4ZQV,IO81LQ,,,,,only SSB-MS,08/97 +GW6YAY,IO81LM,,,David,,144: IC821H 300Watts 17ele CConly SSB-MS,08/03 +GW7SMV,IO81LN,,,Jamie,,144: 400W Commander2 3cx800a7 12ele M22000,04/04 +GW8ASA,IO81EM,,,Gordon,,FT847 IC706 Linears - 144: 220W 9elonly SSB-,02/04 +GW8IZR,IO73TI,EME,,Paul,,144: 2x 9el GS35 .23 dbrx - 432: 4x21Y 35,01/05 +GW8OQV,IO81QR,,,Denis,,144: FT225-Mutek 2x4CX250b 4x10el DL6WU or,07/98 +GX4NOK,IO93FR,,,,,,2003 +GX4WWR,IO91LL,,,,,,2003 +HA0HO,KN07SU,,,Gyula,,only SSB-MS,03/01 +HA1AG,JN87TQ,,,,,,10/04 +HA1BC,JN87PU,,,Alex,,144: 3CX800A7 2x17elDTR,12/00 +HA1FV,JN87JJ,,,Pista,,144: FT290R 300W 12el - 432: 30W 25el143 20,07/04 +HA1KVM,JN87AL,,,,,,2003 +HA1KYA,JN87HF,,,Clubstation,,144: 8x13el DL6WU 200W2000lpm MSDSP,11/98 +HA1VHF,JN87GF,EME,,Clubstation,,,10/98 +HA1VQ,JN87GJ,,,Joska,,,08/99 +HA1W,JN87GF,,,,,,2003 +HA1YA,JN87GF,EME,,Gabi,,144: 8x13el & 8x14el - 432: 16x32el,09/03 +HA2A,JN87,,,,,,12/99 +HA2NP,JN97EO,,,Robert,,,05/01 +HA2RD,JN87WB,,,andy,,,1993 +HA2RX,JN87,,,,,,12/98 +HA2SX,JN87VC,,,Peter,,144: IC821H 600Watts 11ele,12/98 +HA2VH,JN87WG,,,,,,03/03 +HA3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 +HA3UU,JN96JO,,,Janos,,144: TS711A GS35B 5.5wl 4wl 2wl MGF1100,09/04 +HA4A,JN96JO,,,Janos,,144: TS711A GS35B 5.5wl 4wl 2wl MGF1100,05/04 +HA4KYB,JN97DI,,,Clubstation,,,1994 +HA4WQ,JN97IF,,,,,,06/03 +HA4XT,JN96JO,,,,,,01/05 +HA5BSW,JN97JD,,,Tibor,,,03/03 +HA5CAR,JN97,,,,,,07/01 +HA5CBA,JN97OM,,,Laszlo,,144: HF trsv+conv3500lpm,04/04 +HA5CRQ,JN97,,,,,,08/02 +HA5CRX,JN97KO,,,Janos (Jani),,144: FDK Multi 2700 250W CF300 13B2.140 D,01/01 +HA5CW,JN97PM,,,Joska,,144: FT225RD/Mutech B1016 GS35B 800W 10el,08/03 +HA5IW,JN97LN,,,,,,08/01 +HA5KDQ,JN97LN,EME,,Clubstation,,DTR,07/03 +HA5LV,JN97ML,,,Victor,,144: 9el 50W,04/04 +HA5OV,JN97NJ,,,Peter,,144: FT920+Trnv GS35 1-5KW 13el DL6WU MGF,12/03 +HA5PT,JN97MK,,,Tamas,,,08/04 +HA5RL,JN97PL,,,Attila,,,12/04 +HA5TS,JN97LL,,,Ivan,,144: IC-706MKII 8ele,07/04 +HA5UK,JN97OM,,,Gyuri,,,08/02 +HA6NA,JN98VC,,,Sandor ""Sanyi",,144: 250W F9FT,08/01 +HA6NN,JN98VC,,,Andras ""Andy",,144: FT290 7el 150W,05/04 +HA6NQ,JN98WA,,,Sandor (Sanyi),,144: 700Watts CF300 DJ9BV 3.2wl086 2000lpm38,01/05 +HA6NY,JN98WC,,,Gyuszi ""Julius",,144: 1000W MHP145 17el full el - 432: 40W LNA,01/05 +HA6OQ,JN98JC,,,,,,08/98 +HA6VV,JN97WS,,,Laszlo,,,07/01 +HA6ZB,JN97,,,,,,01/05 +HA6ZV,JN97WH,,,,,,09/04 +HA7JJS,JN97OG,,,,,,10/95 +HA7KPL,JN97OG,,,Clubstation,,,12/95 +HA7NK,KN07CM,,,Misi,,144: 200W 4x15el 9BV Preamp,06/00 +HA7PL,JN97OG,,,Laszlo,,.166,08/98 +HA7RF,JN97NP,,,Jozsef,,IC 735 +conv3500lpm,04/03 +HA7UL,JN97KK,,,Ferenc ""Feri",,HF: DM-100 - 144: FT726 or IC202 130W CF300 1,05/02 +HA8AR,KN06NQ,,,Pali,,,06/04 +HA8CE,KN06EN,,,Istvan ""Pista",,144: GS35b 400W 16 el. DJ9BV CF3001200lpm,05/04 +HA8CS,KN06BD,,,,,,2003 +HA8ET,KN06,EME,,g.,,,1993 +HA8KCP,KN08DQ,,,,,,2003 +HA8V,KN06HT,,,Gabor ""Gabi",,TM255E GS35B 900W 4X11el. TR851E 2XTP5040 80,07/04 +HA8VF,JN96UW,,,,,,10/97 +HA9MCQ,KN08JC,,,Istvan,,144: 150W 14el CF300.140.190,06/98 +HA9MDP,KN08DF,,,Peter,,144: 150W 14el CF300.190,07/00 +HA9RC,KN08NB,,,,,,1994 +HAM3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 +HAM3UU,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 +HAM7JJS,JN97OG,,,,,,07/96 +HAM7KPL,JN97OG,,,Clubstation,,,07/96 +HAM7PL,JN97OG,,,Laszlo,,.166,07/96 +HAM8CE,KN06EN,EME,,Kovacs,,,11/96 +HB2FAP,JN47CE,,,Fabio,,144: 16el 1KW,12/00 +HB3YIT,JN46JE,,,Nick,,Kenwood TS-790E,01/05 +HB5OK,JN46LA,,,OP HB9SUL,,144: FT847 8877 17el MGF 1302DTR,12/98 +HB9AOF,JN36LM,,,,,,01/97 +HB9BBD,JN47EE,,,,,,2003 +HB9BQU,JN37VD,,,Hans,,50: 10W - 144: 200W 17elDTR rx5000 tx1500lpm,08/99 +HB9BZA,JN36BE,,,Robert,,50: FT-847 V-2000 - 144: 3CX800 11Y - 432:,01/04 +HB9CVD,JN36CD,EME,,philippe,,,1994 +HB9CYN,JN36RX,,,Martin,,144: 30W 7el 10db Gaas,01/99 +HB9DBM,JN47BE,,,Mark,,,03/99 +HB9DDS,JN47IK,,,,,,05/02 +HB9DFG,JN37SM,EME,,Christian ""Chris",,144: TS850S + LT2S MKII 400Watt 4x9el MGF1,12/04 +HB9DKM,JN37SL,EME,,Martin,,50: 3el vertical - 144: 150W 2x11el Flexa MG,03/02 +HB9DLU,JN45LU,,,,,,2003 +HB9DUR,JN46ME,EME,,Andrea,,144: 1KW 17el SP2 - 432: 700WDTR 2000lpm,12/03 +HB9FAP,JN47GJ,,,Fabio,,144: TR751l 600W 18el M2 or 4x4 vertikal067,08/04 +HB9HLI,JN37JB,EME,,Dominique,,,01/05 +HB9HLM,JN36KW,EME,,Andre,,,01/04 +HB9JAW,JN47CE,EME,,Michel,,144: FT726r 15el or 8x28el 8877 MGF1302DTR 2,10/02 +HB9LU,JN46EW,,,Clubstation,,,06/96 +HB9MM,JN36HP,,,,,,08/02 +HB9MS,JN47PH,EME,,OP HB9SUL,,144: 8877DTR 2000lpm,12/99 +HB9OCW,JN46LA,EME,,Donald,,50: 4el 10W - 144: 4x13B2 1KW - 432: 2x29el 1,10/99 +HB9PJT,JN47FG,,,,,,05/02 +HB9Q,JN47CG,EME,,OP HB9CRQ- HB9DBM,,50: 10W 11el - 144: 15mPb 8x19el 1KW - 432: 1,05/02 +HB9QQ,JN47,EME,,Pierre,,.138 DTR,01/01 +HB9RUZ,JN47JM,,,Peter,,,12/96 +HB9SJV,JN36BK,,,Benoit ""Ben",,50: 5 el & 5/8 vert. 144: 350W 7elonly SSB-M,02/04 +HB9SLO,JN36LT,,,Bertrand,,144: FT736r 1KW 18el LY,04/03 +HB9SNR,JN36MQ,,,Gerard,,144: FT736r 800W 12el M2,11/01 +HB9STI,JN47GJ,,,f.,,,1993 +HB9STY,JN36IP,,,Bernard,,FT690R 50: 150W vert & 5el - 144: 300W 2x15e,07/98 +HB9SUL,JN46LA,,,,,,2003 +HB9SV,JN45LV,EME,,Enrico,,,08/00 +HB9WAH,JN47FD,,,Bruno,,50: 10W - 144: 2x 11El 1kW MGF1302 - 432:,04/04 +HC5K,FI07NB,,,,,,2003 +HF75PZK,JO93AC,EME,,,,,01/05 +HG1DLZ,JN87HF,,,Zoli,,144: 8x13el 200W MGF1402only SSB-MS,12/98 +HG2EAD,JN97,,,i.,,,1993 +HG2KNP,JN97,,,,,,1993 +HG2NP,JN97,,,R.,,,1/95 +HG3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,08/98 +HG3O,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,08/98 +HG4XG,JN96,,,g.,,,1993 +HG5CYT,JN97,,,Tibor,,144: FT290r 50W 5el - 432: 25W 11el,01/01 +HG5PT,JN97MT,,,dr. holman,,,1993 +HG6KNB,JN98,,,,,,1993 +HG6KVB,KN07,,,,,,1993 +HG6NQ,JN98WA,,,sanyi,,3,1995 +HG7AJ,JN97,,,a.,,,1993 +HG7JAL,JN97KK,,,Pista,,,07/02 +HG7P,JN97KW,,,Clubstation,,,04/97 +HG7WJ,JN97MP,,,sandor,,,1993 +HG9MET,KN08DF,,,Tom,,144: 150W 14el CF300.190,07/00 +HG9OZD,KN08DF,,,OP HG9MDP- MET,,144: TR9130 150W 14el CF300.060.190,07/00 +HG9SM,KN08HF,,,,,,07/04 +HG9VHF,KN08EB,,,OP HG9MDP- MET,,144: TR9130 150W 14el CF300.140.190,07/00 +HGM3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 +HGM3O,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 +HI8ROX,FK58AL,,,,,,2003 +HL5XF,PM45OH,,,,,,2003 +HS2CRU,OK03LE,,,,,,2003 +HV0A,JN61FV,,,,,,01/05 +HV4NAC,JN61,,,Clubstation,,,06/99 +I0EMV,JN62BK,,,,,,1992 +I0UZF,JN63,,,Francesco,,,06/00 +I1ANP,JN44VC,EME,,Mario,,IC735+L4B - 144: TS700 4x4cx250b MGF1302 4x,03/01 +I1BSN,JN34,,,franco,,,1993 +I1CPM,JN34VI,,,,,,01/03 +I1CPN,JN34VH,,,,,,02/04 +I1DMP,JN35UB,,,Paolo,,144: 350W 20el LY.131 DTR,01/01 +I1JTQ,JN35UB,EME,,Mario,,144: 2x18el 900W MGF1801127227,08/01 +I1KTC,JN45HK,EME,,Alberto,,.085 DTR,11/96 +I1PIK,JN44TG,EME,,Pietro,,FT736R 50: 3el - 144: 64el GS35 Preamp - 432:,01/01 +I1TXD,JN45,,,rossi,,,1993 +I2COR,JN55BB,EME,,luigi,,,1994 +I2FAK,JN45OB,EME,,Franco,,144: 24x19el LLY YL1056DTR 2500lpm,12/04 +I2FHW,JN45,,,franco,,,1993 +I2ODL,JN45KL,EME,,OP IK2OFO,,144: 4x17el 8877 - 432: 8x21el 3CX800A7 - 129,09/00 +I2OKW,JN45OO,,,,,,08/02 +I2PHD,JN45SL,EME,,Alberto,,,12/00 +I2RV,JN45PL,EME,,,,,01/05 +I2SVA,JN45,,,,,,01/02 +I2UZV,JN45,,,,,,08/02 +I3DLI,JN65,EME,,Paolo,,6x19el 8877 CF379.018,11/00 +I3LDS,JN55SR,,,,,,1990 +I3LGP,JN55WJ,,,Giuliano,,144: IC746 100W 17el BF960.141 DTR 3000lpm,01/04 +I3LLH,JN65BM,,,,,,04/00 +I4BXN,JN54,,,g.,,,1993 +I4LCK,JN54RK,,,Franco,,432: FT736 3CX800 Preamp 4x25el LY @ 950m asl,05/04 +I4RHP,JN54QL,,,Rodolfo,,144: TS711+PA500W 17EL,07/04 +I4TTZ,JN54VJ,,,,,,2003 +I4VXH,JN64EJ,,,l.,,,1993 +I4XCC,JN63GV,EME,,Claudio,,144: 4x17el F9FT 3CX800A7 preamp 1db075,01/04 +I4YNO,JN54KP,,,Alessandro ""Alex",,144: FT-736R MuTek MGF1302 3CX800 20el Shark1,08/03 +I5CTE,JN53XG,EME,,Piero,,,02/01 +I5JUX,JN53CW,EME,,Giacomo,,,08/96 +I5MPK,JN53,EME,,piero,,,1994 +I5MXX,JN53JU,,,Marzio,,144: 4x4el & 4x9el,10/00 +I5MZY,JN53OT,EME,,Massimo ""Max",,144: 800W 4x10el BF998117,10/04 +I5PPD,JN53PS,EME,,Pietro,,10368: 3m Dish 20W,10/00 +I5PPE,JN53NS,,,,,,2003 +I5TDJ,JN53,EME,,Piero,,,11/00 +I5WBE,JN53JR,EME,,Enrico,,144: FT736R 4x17el 8877 MGF1302 432: Yeasu,11/04 +I5YDI,JN54BB,EME,,Luigi,,144: FT736 3cx800 2x17el or 4x15el.100,04/02 +I6BQI,JN72BK,,,Angelo,,,09/02 +I6PNN,JN72GL,EME,,marco,,,1994 +I6QGA,JN63,EME,,gabriele,,,1994 +I6QON,JN63RL,,,,,,1994 +I6WJB,JN72CK,EME,,Pierluigi,,144: single 3wl yagi 1 Kw MGF1302,05/04 +I6YPK,JN72,,,bruno,,,1995 +I7CSB,JN71QQ,,,,,,09/96 +I7FNW,JN81GD,EME,,n.,,,1994 +I7HCB,JN71VT,,,Andrea,,144: 150W 13el,12/01 +I7RNI,JN80,,,n.,,,1993 +I8MPO,JN70FP,,,Lucio,,only SSB-MS.383,11/04 +I8REK,JN70,,,Archimede,,,1993 +I8TUS,JM89DE,,,Salvatore,,,10/04 +I8UZA,JN70AU,,,Pino,,144: FT847 150W 10el BVO3wl.250,09/02 +I8WES,JN70,,,r.,,,1993 +IC8CQF,JN70CN,,,Pasqual ""Lino",,50: 100W 4el Yagi - 144: 300W 10el093 300,08/03 +IC8EGJ,JN70CN,,,,,,1989 +IC8FAX,JN70CN,,,Giacobbe (Jakob),,144: FT736r 300W 20el083 DTR437,03/04 +IH9YMC,JM56XT,,,Raf,,,08/04 +II0W,JN51,,,,,,06/03 +IK0BZY,JN61GW,EME,,,,,07/01 +IK0FEC,JN63,,,l.,,,1993 +IK0FIY,JN61GW,EME,,Wife of Enrico,,FT736r 144: 6el 800W MGF1302 - 432: 33el 600W,01/00 +IK0FTA,JN61GV,,,Sergio,,50: TS680 GaasFet 6el100lpm !,05/02 +IK0IXI,JN52,,,,,,1994 +IK0IXO,JN52WA,EME,,,,,1993 +IK0OKY,JN61GT,,,Emilio ""Emile",,50: 4el 10W - 144: 25W 13el,04/02 +IK0OZK,JN52VC,EME,,Renato,,350W- 2x17el- Preamp,12/99 +IK0PCJ,JN63CL,,,,,,2003 +IK0RNL,JN61GW,,,,,,2003 +IK0SMG,JN61FS,EME,,Pino,,,1/95 +IK0SOI,JN62HN,,,Sergio,,,06/02 +IK0VKL,JN61GV,,,flavio,,,1995 +IK0WGF,JN52VC,,,Francessco,,144: 2x11el 200W,03/04 +IK1EFM,JN44JK,,,antonio,,,1993 +IK1EGC,JN35UF,,,Daniele ""Dan",,50: FT650 3-500z 6el 1wl- 144: IC275 16el 4.4,07/02 +IK1FJI,JN44LL,EME,,Walter,,4x19xxx 5-72wl 8877 mgf1302 ic275H,12/00 +IK1GYZ,JN35TB,,,Sergio,,,11/95 +IK1HJQ,JN33,,,,,,1990 +IK1HWG,JN44DS,EME,,maurizio,,,1994 +IK1JXY,JN44WC,EME,,Mark,,,08/04 +IK1LBW,JN44VC,,,,,,08/98 +IK1LGV,JN44JK,,,Gabriele,,144: GS31 MGF1302 15el QD1200lpm DTR MSDSP,08/00 +IK1LUT,JN34TW,,,marcello,,,1993 +IK1MTZ,JN35UB,EME,,diego,,,08/01 +IK1PAG,JN35SB,,,Roberto (Roby),,144: IC275h 1KW 2x17el F9FT MGF1302.136,01/01 +IK1RQT,JN34VP,,,,,,12/01 +IK1SLI,JN35UI,,,gianni,,,1993 +IK1SPR,JN34TQ,,,Flavio,,144: Braun SE400 500W MGF1302 2x 13elMSDSP,08/04 +IK1UWL,JN33VT,EME,,,,,01/05 +IK1YWB,JN34UX,,,,,,04/02 +IK2CDI,JN55GN,EME,,Marinella,,144: IC275H 3CX800A7 MGF1302 4x18el8000lpm M,01/00 +IK2CFR,JN54,,,Marco,,,03/01 +IK2DDR,JN55GN,EME,,Francesco,,144: IC275H 8877 MGF1302 4x18el8000lpm MSD,07/01 +IK2EAD,JN55EJ,EME,,romeo,,,1994 +IK2EAE,JN45LL,,,Fabio,,144: FT480r 100W 17elonly SSB-MS.300,11/01 +IK2FIL,JN45OM,,,Enrico,,144: IC275H 9 el. F9FT + SP2000 50W,11/04 +IK2GSO,JN45NP,EME,,Enrico,,IC7400 FT857 50: 1KW 10el 144: 14el DJ9BV,11/04 +IK2JUB,JN45ON,,,Stefano,,,03/03 +IK2LHP,JN45SP,,,Angelo,,144: TS790 200W 15el - 432: 100W 31el,07/01 +IK2MMB,JN45,EME,,Sergio,,,01/01 +IK2OFO,JN45KL,EME,,Roberto,,144: 4x17el 8877 - 432: 8x21el 3CX800A7 - 129,09/00 +IK2RTI,JN55AD,,,,,,2003 +IK2TPX,JN45LL,EME,,dario,,,1993 +IK2XRL,JN45NR,,,Mauro,,144: FT736r 150W 17el PreampDTR 2000lpm,01/01 +IK2YXK,JN45OP,,,Maurizio ""Mau",,144: IC275h 4CX250 12elM2 DSP59,05/02 +IK3MAC,JN55SH,EME,,Graziano,,144: 30x19el 8877,08/00 +IK3TPP,JN65EP,,,Fabio,,,12/04 +IK3VZO,JN55XA,,,Giovanni,,144: 16el 200W,02/98 +IK4DCO,JN64GB,EME,,paolo,,,1994 +IK4DCX,JN64GA,EME,,Marco,,144: 4x20el 2.5KW,04/01 +IK4DRY,JN64BL,,,Steve,,1000lpm,04/01 +IK4FMT,JN54WG,,,Marco,,144: TS790 2M5WL 4CX250 MGF1302 20dBMSDSP,01/00 +IK4JOC,JN54WN,EME,,claudio,,,1994 +IK4NMF,JN54SM,EME,,fausto,,,1994 +IK4PLU,JN64FC,EME,,Ermes,,only SSB-MS,08/99 +IK4PMB,JN54LL,,,Antonio ""Anto",,50: X-Verter 10W Dipole - 144: FT225RD MUTEK,01/05 +IK4WLV,JN54XK,EME,,Massimo,,,02/98 +IK5AMB,JN53FU,,,Iacopo,,only SSB-MS,11/98 +IK5EHR,JN53FU,EME,,Lele,,,01/97 +IK5JWQ,JN52NS,EME,,Guiseppe,,,08/98 +IK5OEA,JN53PG,,,,,,12/04 +IK5OIY,JN52NT,,,Massimo,,,03/96 +IK5QLO,JN53FU,,,Andrea,,50: LY - 144: 250W 10el CF300 - 432: 900W,07/04 +IK5UBM,JN53GT,EME,,Luca,,144: 8877 2x15el MGF1303.023 1000lpm.280,07/98 +IK5WJD,JN53PS,EME,,Alessandro,,10368: 3m Dish 20W,10/00 +IK5ZUI,JN53RD,,,Mike,,144: TS700G 11el 250W BF981only SSB-MS,07/97 +IK6EIW,JN63RJ,EME,,Stefano,,,10/95 +IK6FHF,JN63,,,a.,,,1993 +IK6IHM,JN72,,,,,,95 +IK6MLI,JN62UT,,,Pino,,144: FT736 4x11el KLM Booster 8930.060 200,07/99 +IK6MMJ,JN63RL,,,Fabricio,,.115,10/95 +IK7EZN,JN90DG,EME,,Ermanno,,144: 4x16 (jxx) 1 KW,04/04 +IK7UXY,JN90DC,EME,,Gianni,,144: FT1000MP+LT2S 0.2db 1KW 20el or 4x12elD,05/02 +IK8ETN,JM89CH,,,Pietro,,144: ic275e 4x150 17f9ft,01/04 +IK8IUQ,JN70MM,,,,,,2003 +IK8MKK,JN71DC,,,michele,,,1995 +IK8TOY,JM89CH,,,,,,08/04 +IN3AGI,JN56,,,,,,2003 +IN3ATM,JN56NK,,,,,,01/02 +IN3DOV,JN65WS,,,kurt,,,1993 +IN3HER,JN56,EME,,raimund,,,1994 +IN3KLQ,JN56RG,EME,,Giuliano,,144: 180W 17el.110,04/00 +IN3TWX,JN56NQ,EME,,Wolfgang,,144: 3CX800 Preamp 4x11ele DL6WU full eleva,08/03 +IS0AGY,JM49OF,,,Ampelio,,144: IC211E 4CX350b 17el Gaas.280,01/99 +IS0BDB,JN40GT,,,Vannino,,,05/04 +IS0CAK,JM49,,,,,,01/04 +IS0GQX,JM49,,,,,,05/02 +IS0SWW,JN40GR,,,Walter,,,02/04 +IT9BLB,JM68QE,,,Giuseppe (Joe),,144: 2x15el 2x4cx250r MGF1302.129.389,11/96 +IT9CJC,JM76GS,,,,,,1989 +IT9GSF,JM67SS,,,Flavio,,,1994 +IT9GSV,JM77LH,,,Andrea,,,04/01 +IT9IPQ,JM78SG,EME,,Paolo,,ic756pro ic275 ic475 transvonly SSB-MS,04/02 +IT9LCY,JM77NO,,,giuseppe,,,1993 +IT9VDQ,JM68QC,,,Joe (Giuseppe),,144: TS850 3CX800A7 17el Preamp.153 DTR tx1,12/04 +IV3BBR,JN65,,,,,,11/98 +IV3DXW,JN65QQ,,,Claudio,,144: 4CX250 - 16JXX2 4.5WL,08/03 +IV3GBO,JN66OA,EME,,g.,,DTR,01/02 +IV3GTH,JN65ST,,,Gigi,,50: IC706 4 el Quad - 144 MHz: FT221 Mutek,08/03 +IV3HWT,JN65ST,EME,,Lucio,,144: FT101zd Trvt 8877 4x18el 4x20el.116 DT,08/04 +IV3KTY,JN65,,,,,,08/02 +IV3MPI,JN65SV,,,Edi,,IC746 IC271E Mutek FT736R PHEMT144 PHEMT,03/04 +IV3NDC,JN65RV,,,Massimo,,144: 300W BF981 2x15el 3.3wl176 2000lpm DTR,08/03 +IV3VFP,JN66HD,EME,,erminio,,,1993 +IV3ZCX,JN65QS,EME,,Maurizio,,144: Icom 275 PA 600Watts MGF1302 4x24el10522, +IW0AKA,JN61FS,,,,,,1990 +IW0AYO,JN61IU,,,Morris,,144: 16elonly SSB-MS,07/96 +IW0BFZ,JN61,,,b.,,,1993 +IW0BTS,JN61GU,,,,,only SSB-MS,1988 +IW0CUT,JN61TP,EME,,arnaldo,,,1993 +IW0CVK,JN61GV,,,,,,01/05 +IW0DJB,JN61,,,,,,04/02 +IW0DVG,JN61KK,,,max,,,1993 +IW0FFK,JN61FS,,,,,,10/04 +IW0GDC,JN61HX,,,,,,10/98 +IW0GPN,JN62FB,,,Alessandro ""Alex",,FT736 144: 200W 16el 4.8wlonly SSB-MS212,10/04 +IW0QNX,JN62,,,,,,01/97 +IW0QO,JN63EC,,,,,,1993 +IW0RBS,JN63FD,,,freddy,,,1993 +IW0RLC,JN63FD,,,Dario,,only SSB-MS,06/00 +IW0UEI,JN40GR,EME,,Antonio,,144: 2x9el 150W,04/04 +IW1ARB,JN44CV,EME,,Paolo,,144: 4x4.4Wl lt2s 3cx1500,03/01 +IW1AZJ,JN35UB,,,Silvio,,144: 200W 3.8wl DJ9BV2000lpm,06/00 +IW1BCV,JN44FS,,,Carlo,,144: IC275H 8930 2x18el MGF1302DTR 3000l,08/98 +IW1CCH,JN35TB,,,,,,01/05 +IW1CGB,JN35VG,EME,,Steve,,50: 3el PA - 144: 4x17el 2x4cx250b MGF130,06/97 +IW1CHX,JN35TH,,,Nicola,,144: C58 13el DJ9BV MGF1302 170W.100 150,04/02 +IW1DIM,JN35TC,,,,,only SSB-MS,07/01 +IW1DJS,JN35SA,,,,,,08/01 +IW1FTY,JN35UA,,,,,,2003 +IW2BNA,JN45ON,,,Walter,,144: IC275H 3CX800 4x11el - 432: IC475H,01/04 +IW2BSQ,JN45UJ,,,Jo,,144: IC746 !7el,04/03 +IW2BZY,JN45NN,,,Lorenzo,,144: 500Watts 2x12ele Flexaonly SSB-MS,08/01 +IW2DAL,JN45NN,,,Emilio,,144: FT736R 4x19LLY 4CX1000a - 432: FT736R,04/04 +IW2DMN,JN45KL,,,Ivano,,144: 100W 15el,10/02 +IW2DUA,JN45LL,EME,,dario,,,1993 +IW2HAJ,JN45NO,,,Claudio,,50: IC706 6el - 144: 400W 20ele Preamp,04/02 +IW2HUS,JN45NO,,,,,,04/02 +IW2HWQ,JN55GK,,,Francesco,,144: FT736r 80W 21elonly SSB-MS,10/96 +IW2LC,JN45OL,,,Luigi,,ICOM-756 YAESU FT-897 ICOM275H KENWOOD TS-790,05/04 +IW2LLA,JN55AM,,,Andrea,,144: 2x17el 100Wonly SSB-MS,08/96 +IW2MYV,JN45JN,,,Marco,,144: TS711E 4CX250 GaAs 4x7el + elv.only S,01/02 +IW2NEF,JN46QD,,,Flavio,,144: FT847 12elXY,11/02 +IW2NOR,JN45ON,,,Gaetano,,ICOM IC275H KENWOOD TS 2000 144: 100W 2x17,06/04 +IW3BKQ,JN56NH,,,,,,07/02 +IW3QTG,JN65PT,,,Paolo,,144: IC746 2x 17FT,08/04 +IW3RI,JN65RU,,,Claudio,,50: 6el/HyGain 144: 4x17el 432: 4x21el.155.,03/01 +IW3SGT,JN65,,,,,,07/02 +IW3SNU,JN65OT,,,Dany,,,11/04 +IW4ADT,JN54,EME,,augusta,,,1994 +IW4AR,JN64FD,,,,,,2003 +IW4ARD,JN64FD,,,Gianni,,144: 20el 300W,01/05 +IW4BET,JN54QL,,,Carlo,,,08/02 +IW4BLG,JN54VF,,,,,,2003 +IW4BTJ,JN54QL,,,,,,2003 +IW4CB,JN54XK,,,Andrea,,,02/01 +IW4DJE,JN64,,,,,,01/95 +IW4DLA,JN64CE,,,giacomo,,,1994 +IW4DMH,JN64CJ,,,Gabriel,,only SSB-MS,11/98 +IW4DQY,JN64AG,,,Joe,,,03/04 +IW4EHV,JN64AE,,,Fabio,,FT817 30W Amp 50: 5el - 144: 11el - 432: 2,09/03 +IW4EHZ,JN54ML,EME,,FAUSTO,,IC706MKIIG 20EL70CM 12EL2MT 6EL6MT,01/05 +IW5ACZ,JN53HP,,,ALESSANDRO,,50: TS2000 HB9CV 144: TR751E 4CX250 250 WAT,10/04 +IW5AVM,JN52NS,,,,,,2003 +IW5BLG,JN54VF,,,,,,2003 +IW5BML,JN52JW,EME,,A.,,,04/99 +IW5BPE,JN52NT,,,massimo,,,1993 +IW5CNS,JN53CX,EME,,Daniele,,144: IC275H 4x10el 2.2wl 9BV 8877 MGF130,12/99 +IW5DAN,JN53GU,EME,,Luigi,,144: 4x10el DJ9BV 8877 TS790e MGF1302.177,02/01 +IW5DHN,JN53gi,EME,,Matteo,,TS2000,04/02 +IW5DNZ,JN53,,,,,,05/02 +IW5EKJ,JN54AA,,,Roberto ""Roby",,144: 4-5ld 300W,10/04 +IW6AEG,JN63RO,,,Fabio,,,10/93 +IW6BLH,JN63RO,,,Franco,,,12/00 +IW6BNO,JN63RL,,,,,,11/95 +IW7DEC,JN81GF,,,Roberto,,144: 12db yagi 100W Preamp,08/04 +IW8QOT,JM88BR,,,,,,2003 +IW9CER,JM78QF,,,Tony,,only SSB-MS,10/02 +IW9ELR,JM68PD,,,Rosario ""Roy",,,11/02 +IW9FRA,JM68GA,,,Sal,,,01/05 +IZ0ARL,JN61IU,,,Maurizio (Morris),,144: 200W 16elonly SSB-MS,10/96 +IZ0AYB,JN52VC,EME,,Daniele,,IC-910H 144: 4x12JXX - 432: 2x19 Tonna,05/04 +IZ0CVK,JN61GV,,,Fabrizio ""Fab",,Yaesu FT767 mgf1801 11eleF9Ft 20ele DJ9BV5,06/04 +IZ1DXS,JN35UA,,,George,,ICOM IC-7400 (746 PRO) - 50: 6el - 144: 14e,11/02 +IZ1EGT,JN44LK,,,Fabio,,IC910,11/04 +IZ1ESM,JN45FB,,,Paolo,,KWD TS850 + LT2S MK2 + 4.4wl BVonly SSB-MS,09/02 +IZ2AAJ,JN45,,,,,,12/99 +IZ2DJP,JN55FO,,,Adelio,,,05/04 +IZ2EEQ,JN45,,,,,,07/02 +IZ2FOB,JN45MQ,,,Roberto,,50: IC706 dipole - 144: IC821h 150Watt 2x9F9F,08/03 +IZ4AIK,JN63HV,,,Marco,,50: 100W 5el - 144: TS790 3CX800A7 TS850 & T,07/01 +IZ4BEH,JN54WL,,,Roberto,,144: 1KW 2x16el MGF2407 - 432: 2x21el 300W,10/02 +IZ4BEJ,JN64CE,,,Enrico,,144: 2x13el gd Pwronly SSB-MS,11/97 +IZ5BXF,JN53GV,EME,,Michele,,300W- 4x11el 2.2wl- 0.3dbNF2500lpm,01/01 +IZ5EME,JN52NS,EME,,Marco,,144: 4x20el 8877 - 432: 4x25el 3CX800 - 1296:,04/01 +IZ8AZB,JN70EP,EME,,Lucio,,144: 4x11el 8930(400W)DTR,01/02 +IZ8DWL,JM88BR,,,Primo,,144: IC-746 PA 4CX250 16JXX LY MGF1302,04/04 +J45M,KM46CF,EME,,OP: PE1LWT- PA2CHR,,144: FT100 FT847 IC706 DSP59/Datong audiofilt,06/01 +J48XG,KN20GR,,,,,144: 8el DK7ZB 60W,05/04 +J79MY,FK95,EME,,OP K6MYC,,4x Yagi- 1.5KW,06/98 +JA0BLU,PM97OS,EME,,Masa,,144: 1KW 4x19el 2x18el MGF1801.043.250,01/00 +JA0VI,PM95,EME,,,,,2003 +JA1DXA,PM95VU,,,,,,2003 +JA1VZV,PM95QL,,,,,,2003 +JA2HMO,PM85IH,,,,,,2003 +JA2JRJ,PM84MW,EME,,,,,89 +JA2KRW,PM85NE,EME,,,,,2003 +JA2TY,PM84GS,EME,,,,,2003 +JA3BXC,PM74SU,,,,,,2003 +JA3IAF,PM74,EME,,,,,2003 +JA3SGR,PM74TU,EME,,,,,2003 +JA4BLC,PM65NM,EME,,,,,89 +JA4CMZ,PM65MI,EME,,,,,2003 +JA4KLX,PM95RI,,,,,,2003 +JA5NNS,PM63,EME,,,,,2003 +JA5OVU,PM74FC,EME,,,,,2003 +JA5YJS,PM63,EME,,,,,2003 +JA6AHB,PM53CP,EME,,,,,2003 +JA6CZD,PM53FM,EME,,,,,2003 +JA6DZI,PM53GM,EME,,,,,2003 +JA6XED,PM53,EME,,,,,2003 +JA6ZHR,PM53,EME,,,,,2003 +JA7BJP,QM07GN,,,,,,2003 +JA7BMB,PM97WM,EME,,,,,2003 +JA8ERE,QN02QX,EME,,,,,2003 +JA8IAD,QN03,EME,,,,,2003 +JA8PL,QN03,EME,,,,,2003 +JA9BOH,PM86FA,EME,,,,,2003 +JF3HUC,PM74UX,EME,,,,,2003 +JF3IPR,PM74,,,,,,2003 +JH0ISW,PM97LO,,,,,,2003 +JH0QBI,PM97FF,,,,,,2003 +JH0WJF,PM86,EME,,,,,03/01 +JH0YSI,PM85VJ,EME,,,,,89 +JH1EFA,PM96UB,EME,,,,,2003 +JH1KRC,QM06AW,EME,,,,,2004 +JH1OFX,PM85SM,EME,,,,,2003 +JH1OQW,PM95UX,,,,,,2003 +JH1SWD,QM06HN,,,,,,2003 +JH1XUJ,PM95UR,EME,,,,,2003 +JH2COZ,PM94mx,EME,,Yasu,,4x14el 1-5KW,03/99 +JH2OJS,PM85LD,,,,,,2003 +JH3EAO,PM74KR,EME,,,,,2003 +JH3VJV,PM74LP,,,,,,2003 +JH4JLV,PM54LA,EME,,,,,2003 +JH5FOQ,PM63JS,EME,,,,,02/01 +JH5LUZ,PM63FK,EME,,,,,2003 +JH6RTO,PM53FA,,,,,,2003 +JH7PAV,QM07DI,EME,,,,,2003 +JH7SIA,QM09EN,,,,,,2003 +JH9TJT,PM86HK,,,,,,2003 +JI1FLB,PM95WS,,,,,,2003 +JI1NJC,QM06FL,,,,,,2003 +JI3GER,PM75XA,EME,,,,,2003 +JI4POR,PM65NK,,,,,,2003 +JJ1NNJ,QM06GH,EME,,,,,2003 +JJ1VOM,PM95,,,,,,2003 +JK1HIX,PM95WH,EME,,Tomio,,4x17el 8877,03/99 +JK1LYP,PM95,,,,,,2003 +JK1XDX,PM95,,,,,,2003 +JK7IKU,QM09BR,,,,,,2003 +JL1ZCG,PM59UM,EME,,OP JR4ENY- 7K3LGC,,TS790 4CX1500A 16x2.5WL V-POL YAGIS,03/99 +JM1GSH,QM06IS,EME,,,,,12/04 +JM1LQW,PM96QA,,,,,,2003 +JM1MQE,PM95RP,,,,,,2003 +JN1BMX,QM06FM,,,,,,2003 +JN1CSO,PM95SW,,,,,,2003 +JO1LVZ,PM95TR,,,,,,2003 +JO3JJN,PM85AC,EME,,,,,2003 +JO3RNL,PM74TT,EME,,,,,2003 +JR1EDE,PM95TG,EME,,Kohjin,,10368: 1.8m Dish 40W,02/01 +JR1EUX,PM95TO,EME,,,,,2003 +JR1RCH,PM96SI,EME,,,,,2003 +JR3REX,PM74LQ,,,,,,2003 +JR4AEP,PM65RH,EME,,,,,2003 +JR4BRS,PM65,EME,,,,,2003 +JR5JXV,PM86XG,,,,,,2003 +JR5UOY,PM64XF,,,,,,2003 +JR7VXF,QM09AK,,,,,,2003 +JR9NWC,PM85BW,EME,,,,,2003 +JS3SIM,PM74VW,EME,,,,,2003 +JX7DFA,IQ50OV,EME,,Per Einar,,TS2000.161 DTR.161,08/00 +K0AWU,EN37ED,,,,,,2003 +K0AZ,EM37CD,,,Mike,,144: 800Watts 17B2,09/01 +K0BLR,EN25UO,,,BEN,,,2003 +K0CB,EM27,,,,,,2003 +K0CIO,EM07,,,,,,2003 +K0CJ,EN34IS,,,,,,2003 +K0CQ,EN32EC,,,,,,2003 +K0CXJ,EN26,,,,,,2003 +K0DAS,EN42,EME,,,,,89 +K0FF,EM49HO,,,George,,50: 1-5KW 7el or 4x6el - 144: 1-5KW 2x17el M,01/01 +K0FQA,EN35FE,,,,,,2003 +K0FZG,EN36,,,,,,2003 +K0GCJ,EN43,,,,,,2003 +K0GEI,EM49,,,,,,2003 +K0GRM,DN96OT,,,,,,2003 +K0GU,DN70MQ,EME,,Jay,,144: FT1000DEM 8877 4x17elB2 SSB Preamp,01/01 +K0HH,EM48,,,,,,2003 +K0HU,EN10,,,,,,09/99 +K0HWE,EN41BX,,,,,,2003 +K0IDC,EN12TL,,,Robert,,,2004 +K0IDT,EN10PS,,,Ron,,,2003 +K0IK,EN34JR,,,Brian,,,2004 +K0ILC,EN36,,,,,,2003 +K0IR,EN25,,,,,,2003 +K0JO,EN34,,,,,,2003 +K0KE,DM79,,,,,,2003 +K0KFC,EN34,,,,,,2003 +K0KJX,EM48,,,,,,2003 +K0KP,EN36VW,,,Rex,,50: 7el 100W - 144: 13el 100W,08/03 +K0KQY,DM98,,,,,,08/00 +K0LGI,EN42,,,,,,2003 +K0LLS,EM29,,,,,,2003 +K0MQS,EN31UH,,,,,,2003 +K0NG,EN10,,,,,,2003 +K0NL,EM48MK,,,,,,2003 +K0NY,EN44DB,,,,,,2003 +K0OG,EM47CW,,,Joseph,,,2004 +K0PFX,EM48SR,,,,,,2003 +K0PG,EN61AU,,,,,,2003 +K0PJ,EN34,,,,,,2003 +K0PS,DM59VG,,,Paul,,,2004 +K0PW,EN34CV,EME,,John,,144: 1.5KW 2x17el 5lb MGF1302.098.175,09/01 +K0RDF,EM29,,,,,,2003 +K0RI,DM78PX,,,Larry,,,2003 +K0RL,EM49HU,,,,,,2003 +K0RP,DM88AD,,,Bill,,50: 150W - 144: 150W - 222: 110W - 432: 110W,01/01 +K0RRY,EN36,,,,,,2003 +K0RZ,DM79JX,,,,,,2003 +K0SDH,EN34JS,,,,,,2003 +K0SE,EN34,,,,,,2003 +K0SHF,EN34JV,,,,,,2003 +K0SM,EN10RT,,,Andy,,144: 160W Preamp 13B2,01/01 +K0SQ,EN35,,,,,,2003 +K0TAR,EN34,,,,,,2003 +K0UO,EM07,,,,,,2003 +K0VM,EN42,,,,,,2003 +K0VSV,EN41LK,,,Tom,,50: 8W 5el - 144: 170W 12el,1998 +K0WLU,EN13XS,,,,,,2003 +K0XP,FN31,,,Steve,,144: 350W 3219 - 222: 450W KLM16,01/02 +K0XXX,EM46FF,,,,,,2003 +K0YW,DM67ED,EME,,,,,2003 +K0ZPO,EM15,,,,,,2003 +K1AE,FN42EJ,,,John,,,11/01 +K1CA,FN42mm,EME,,,,,2003 +K1FO,FN31QJ,EME,,,,,2003 +K1IM,FN31WX,,,Tom,,,2003 +K1JT,FN20QI,EME,,Dr. Joseph ""Joe",,50: 200 - 144: 11el 160W - 222: 120W - 432:,12/04 +K1MS,FN42,,,Ivan,,144: 1KW 2x M2 5wl,01/01 +K1OR,EN42IR,EME,,,,,2003 +K1OYB,FN43TP,,,,,,2003 +K1POP,FN51,,,,,,2003 +K1RC,FN42HQ,,,,,,2003 +K1RO,FN31,,,,,,2003 +K1RQG,FN54LM,EME,,,,,2003 +K1RZ,FM19JH,,,,,,2003 +K1TEO,FN31,,,Jeff,,144: 800W 4x12el - 222: 500W 2x23el,01/01 +K1UHF,FN31FH,EME,,Del,,144: 1-5KW 4x12el - 222: 500W.100 10000lpm,01/01 +K1VOW,DM25VF,,,,,,2003 +K1ZE,FN41,,,Ed,,144: 300W 2x4218 - 222: 60W 220B - 432: 400W,1998 +K2AAX,FN12CS,,,Mark,,,01/01 +K2AH,FN20,EME,,,,,2003 +K2AXX,FN12CS,EME,,Mark,,144: TS-930S Transverters - 432: TS-830S,02/05 +K2BLA,EL99IA,EME,,Albert,,,01/05 +K2DH,FN13FB,EME,,,,,2003 +K2DRH,EN41VR,,,Bob,,,07/03 +K2EVW,EM96SS,,,,,,2003 +K2GAL,FM29PH,EME,,,,,1998 +K2JT,EM20QI,,,Dr. Joseph ""Joe",,144: 11el 160W,03/00 +K2LME,FN31UI,EME,,Dave,,,10/98 +K2OS,FN13CD,EME,,,,,12/00 +K2OVS,FN30,,,Jay,,50: 250W 6el - 144: 200W single yagi - 432: 6,01/01 +K2PGB,FN20,,,Chris,,50: TS680S 10W 3el - 144: IC251A 80W 13B2,01/01 +K2STO,EL88PH,,,,,,2003 +K2TXB,FM29PT,,,Russ,,,07/01 +K2UYH,FN20QG,EME,,,,,89 +K2VEE,EM79WP,,,,,,2003 +K2WKA,FN20RF,,,Fred,,,2003 +K2YAZ,EN74AV,,,,,,2003 +K3ACE,FM29DR,,,Norm,,,2003 +K3AX,FN20,EME,,,,,2000 +K3BFA,FN10XI,,,Charlie,,144: 1-5KW 4x15el,01/01 +K3DJC,FM19LL,,,,,,2003 +K3EAR,FM19HX,,,South Mountain Conte,,,2003 +K3FOR,FM19SB,EME,,Skip,,,2003 +K3FU,FM18,,,,,,2003 +K3GNC,FM29KX,,,Jerome,,,01/97 +K3HZO,FN20AG,,,Harry,,50: 350W 5el - 144: 350W 17el - 432: 100W 24e,1998 +K3IB,FN20HK,,,Phil,,50: 200W 6M5XX - 144: 1-5KW FO12 - 222: 300W,09/01 +K3JT,EM99XO,,,,,,2003 +K3LFO,FM19,EME,,,,,2003 +K3LOW,EN91BK,,,Henry,,,2003 +K3MF,FM19XP,EME,,Wayne,,,01/05 +K3ROJ,FM19SH,,,,,,2003 +K3SIW,EN52,,,,,,2003 +K3TKJ,FM28EM,,,,,,2003 +K3TUF,FN10WE,,,Philip,,,2004 +K3TV,FN20EP,,,,,,2003 +K3UZY,FN20,,,,,,2003 +K3VLQ,EM92,,,,,,2003 +K4AR,EM76,EME,,Bert,,432: 8x28el (9lb) Yagis 1-5KW 0.25db,01/00 +K4CSO,EM73,,,,,,2003 +K4DD,EM60NP,,,Richard,,,2004 +K4DRF,EM74QA,,,,,,2003 +K4EJQ,EM86,,,,,,2003 +K4EME,FM08KF,EME,,,,,2003 +K4HJE,EM96,,,Ed,,,01/01 +K4JAF,EM70EK,,,,,,2003 +K4KAE,FM02AT,,,,,,2003 +K4KO,EM66UD,,,Greg,,,2004 +K4MRW,EM64PW,,,Robert,,,01/01 +K4QF,EM64,,,,,,2003 +K4QI,FM06,EME,,,,,07/01 +K4QXX,EL87RM,,,Burch,,,2003 +K4RF,EM84DJ,,,Steve,,,01/01 +K4SDI,EM56TQ,,,Mark,,,2003 +K4SSO,EM48SR,,,Colin,,144: 160W 16el,01/02 +K4SSP,EM47,,,,,,09/99 +K4TAX,EL96WF,,,,,,2003 +K4VJ,EL96LX,,,,,,2003 +K4WRI,EL98LM,,,Robert,,,2003 +K4YA,EM25,,,,,,2003 +K4YNT,EM74KW,EME,,Bob,,,02/05 +K4ZFY,EL18,,,,,,2003 +K5AIH,EL09TK,EME,,,,,1998 +K5APM,EM10BL,,,,,,2003 +K5AZU,EM40SN,EME,,,,,2003 +K5BYS,EM13,,,,,,2003 +K5CBL,EM15,,,,,,2003 +K5CFM,EM15,,,,,,2003 +K5CPZ,EM15,,,,,,2003 +K5EGW,EM30,,,,,,2003 +K5EWS,EM10,,,,,,2003 +K5FA,EM44,,,,,,2003 +K5GE,EL09,,,,,,2003 +K5GNA,EM20,,,,,,2003 +K5GW,EM13PA,EME,,,,48x10el,10/98 +K5IS,DM96,,,,,,2003 +K5IUA,EL29CD,,,John,,,01/01 +K5JL,EM15DQ,EME,,,,,01/05 +K5LZO,EM20,,,,,,2003 +K5MAT,DM65,,,,,,2003 +K5MQ,EM31WQ,,,,,,2003 +K5OGE,EM20UX,,,,,,01/01 +K5PHD,EM-12,,,,,,2003 +K5PHF,DM61,,,,,,2003 +K5PJR,EM37KA,,,,,,2003 +K5QQ,DM65SB,,,,,,2003 +K5QXJ,EM30XA,,,,,,2003 +K5RFI,EM16,,,,,,2003 +K5RHR,DM65UV,,,,,,2003 +K5RUS,EM32VM,,,RUSSELL,,,2003 +K5SXK,EM12,,,,,,2003 +K5TN,EM15,,,,,,2003 +K5TNP,EM32,,,,,,2003 +K5TTT,EM26CH,,,Charlie,,only SSB-MS,01/02 +K5UHF,EM10DJ,,,,,,2003 +K5UJC,EM20VB,,,Earl,,,2004 +K5VH,EM00XE,,,,,,2003 +K5WO,EM12,,,,,,2003 +K5WXN,DM61,EME,,,,,89 +K5YPV,EM54MR,,,,,,2003 +K5YY,EM26,,,San,,144: 1KW 13el,89 +K5ZMJ,EM12,,,,,,2003 +K5ZMS,EL09,,,,,,2003 +K5ZSJ,EM12,,,,,,2003 +K5ZXE,EM14KL,,,,,,2003 +K6AAW,CN80TE,EME,,Larry,,144: 4x15el 3wl 1.2KW MGF1302,01/00 +K6ALF,CM97BH,,,,,,2003 +K6CYS,DM12KT,,,,,,2003 +K6DV,DM13NI,EME,,,,,2003 +K6HLH,DM14CP,,,,,,2003 +K6IAH,DM12,,,,,,2003 +K6IBY,DM13,EME,,,,,2003 +K6JEY,DM03WT,EME,,Doug,,144: 4x25el K1FOs 500W <0.4db,08/00 +K6KL,CM97,,,,,,2003 +K6LEW,FM18LT,EME,,Owen,,,11/00 +K6MBY,DM13LD,,,Bob,,,2003 +K6MXI,CM88QL,,,,,,2003 +K6MYC,CM97AA,EME,,,,,10/96 +K6PF,DM13AR,,,Robert J.,,144: FT726r 175W 4xM 2MXP20,01/01 +K6SUE,CM98AK,,,Sue,,144: 650W 2x17el- 222: 120W 7wl- 432: 175W 2x,11/99 +K6UCY,CM87UN,,,Vic,,,2004 +K6UIY,DM14,,,Cap,,144: FT726r 1KW 2Yagis,01/97 +K6UM,CM88,,,,,,2003 +K6ZX,CN82GM,,,Doug,,144: 160W 2x2M9,01/97 +K7BV,FN31VI,EME,,,,,01/05 +K7CA,DM26JE,EME,,Al,,144: 1KW 42´homebrew yagi,01/01 +K7CAI,DN27KF,,,,,,2003 +K7IEY,CN88,,,,,,03/98 +K7JA,DM03XS,,,Chip,,144: 190W 19el,1998 +K7KX,DN55,,,,,,2003 +K7LNP,DN30,EME,,,,,09/99 +K7MAC,DN13SN,EME,,Mac,,,01/05 +K7MDL,CN87XT,EME,,,,,04/04 +K7ND,CN87QF,,,Jim,,144: 1KW 2x5wl M2,01/01 +K7NEP,DN53NF,,,John,,FT1000MP 144: HM 1KW PA 13el,1998 +K7OO,DM04,,,,,,2003 +K7PVT,CN88SA,,,,,,2003 +K7TRM,DM33VP,,,Tom,,,2003 +K7UOP,DM33XN,,,Bill,,,01/01 +K7UV,DN31XM,,,Ron,,,2003 +K7WUP,DM49IG,EME,,,,,2003 +K7XC,DM09OL,EME,,Tim,,50: IC746 KW 6el - 144: IC746 500W 18xxx- 222,03/03 +K7XD,CN85,EME,,Derek,,144: 400W 2x23el,01/97 +K7XQ,CM97QI,EME,,Jeff,,144: 4x2MPX18 Xpol 3lb 450W MGF1302,10/99 +K7XW,CN96XI,EME,,Mark,,50: 1-5KW 5el - 144: 600W 2x3.5wL - 222: 50W,01/01 +K7YVZ,DN13TL,,,Jerry,,144: 1-5KW 4x18XXX 2x13el Quagi Preamp - 432,01/01 +K7ZL,CN84JC,,,Tom,,144: 150W 36foot yagi,1998 +K8BHZ,EN75DB,,,Brian,,144: 1-5KW 4x17B2,1998 +K8DGY,EN63WW,,,,,,2003 +K8EME,EN72EH,EME,,Luis,,144: FT847- 4x11el 2.2lb- 8877 (1-5KW),03/00 +K8IE,EN52,,,,,,2003 +K8ISK,FM18DV,EME,,,,,2003 +K8MM,EN83IB,,,Ian,,,2004 +K8ROX,EN80LO,,,,,,2003 +K8SD,EN12,,,,,,2003 +K8UC,EM99EG,EME,,,,,2003 +K8UK,EN82LK,EME,,,,,2003 +K8VEB,EN72NN,,,,,,2003 +K8VP,EN91,EME,,Bill,,200,07/01 +K8XK,EN42,,,,,,2003 +K9AKS,EN41,,,,,,2003 +K9AM,EN52,,,,,,2003 +K9BCT,EL96UE,EME,,,,,2003 +K9BMB,EM69OG,,,Homer,,,2003 +K9CA,EN61ML,,,,,,2003 +K9CFA,EN52,,,,,,2003 +K9DQ,EN62,,,,,,2003 +K9DTB,EM89,,,Phil,,, +K9EA,EN94CB,,,Dan,,,09/01 +K9EK,EM79BF,,,,,,2003 +K9FYV,EN41,,,,,,2003 +K9HJZ,EN50ES,,,Jeff,,,2003 +K9HMB,EN52VI,EME,,,,,12/00 +K9HSK,EN51,,,,,,2003 +K9IJ,EN52,,,,,,2003 +K9ILT,EN61AU,,,,,,2003 +K9IMM,EN52,,,,,,2003 +K9IMX,EM38,,,,,,2003 +K9IZV,EN53,,,,,,2003 +K9JK,EN52XC,,,,,,2003 +K9KFR,EN71GG,EME,,,,,2003 +K9KHW,EN63AD,,,,,,2003 +K9KL,EN64,,,,,,2003 +K9KNW,EL96EC,EME,,Joe,,,01/05 +K9MB,EM57,,,,,,2003 +K9MRI,EN70IU,EME,,Joe L.,,144: 8xm2 yagis and 1.2kw,01/05 +K9NS,EN52QK,,,,,,2003 +K9OQN,EN52,,,,,,2003 +K9PO,EN52VF,,,,,,2003 +K9PW,EN52,,,,,,2003 +K9SLQ,EN70KK,EME,,Wayne,,432: 16x FO22 1.5 KW,08/02 +K9SQL,EM69RF,,,Robert,,,2004 +K9TI,EN51,EME,,Russ,,144: 4x K1FO 12 el PA 8877,02/01 +K9VHF,EN53,,,,,,2003 +K9VNM,EN63,,,,,,2003 +K9VS,EN52,,,,,,2003 +K9XI,EN61,,,,,,2003 +K9YR,EN52,,,,,,2003 +K9ZZH,EN61,EME,,,,,2003 +KA0EWM,EN30,,,,,,2003 +KA0KCI,EM17,,,,,,2003 +KA0KUY,EM07XD,,,,,,2003 +KA0MOW,EM17,,,,,,2003 +KA0MR,EM18GE,,,,,,2003 +KA0MWA,DM79LL,,,,,,2003 +KA0NNO,EM24TL,,,Lisa,,,01/97 +KA0OGU,EM29,,,,,,2003 +KA0PQW,EN33,,,Matt,,,11/01 +KA0RYT,EN34DW,EME,,Ron,,,01/02 +KA0UZZ,EN34,,,,,,2003 +KA0Y,EN41,EME,,,,,08/00 +KA0YSQ,EN42,,,,,,2003 +KA0ZOZ,EN23,,,,,,2003 +KA1JBG,FN42,,,,,,2003 +KA1LEX,FN34KL,,,Randall,,,2003 +KA1OTP,FN41,EME,,,,,2003 +KA2DRH,EM64KT,,,,,,2003 +KA2HZO,FM29US,,,,,,2003 +KA2KQM,EM74QA,,,,,,2003 +KA3HED,FM27,,,,,,2003 +KA3WSZ,FM29GK,EME,,,,,2003 +KA4WJA,EL89WE,,,,,,2003 +KA5AAE,EM06,,,,,,2003 +KA5AIH,EL29NW,EME,,,,,10/96 +KA5DWI,EM12JU,,,,,,2003 +KA5PVB,EM13,,,,,,2003 +KA5TQY,EM43,,,,,,2003 +KA5UEL,EM12,,,,,,2003 +KA5UEV,DM93,,,,,,2003 +KA5ULI,EM30,,,,,,2003 +KA5WMJ,DM96,,,,,,2003 +KA5WRG,EM15,,,,,,2003 +KA5YJJ,EM44NN,,,Thomas,,,2003 +KA6NBC,CM98,,,,,,2003 +KA7V,DN14MA,,,Barry,,144: 13B2 1500W,11/03 +KA8EDE,EM79,,,,,,2003 +KA8HQL,EM89VU,,,Jeffrey,,,2003 +KA8SFP,EM12,,,Stan,,,01/01 +KA8SSB,EM79,,,,,,2003 +KA8TER,DN43AL,,,,,,2003 +KA9CFD,EN40OM,,,Jay,,,11/04 +KA9LDS,EN51,,,,,,2003 +KA9LLF,EM71,,,,,,2003 +KA9LNP,DN30,,,Pat,,144: 800W KLM13LBA,01/01 +KA9MGR,EN41,,,,,,2003 +KA9OIL,EN62,,,,,,2003 +KA9UVY,EM58NG,,,,,,2003 +KA9YCB,EM57QQ,,,,,,2003 +KB0BFI,29EMLL,,,Clarence,,,2003 +KB0BVR,EN26AH,,,,,,2003 +KB0CY,DM79,,,,,,2003 +KB0EMR,EN31,,,,,,2003 +KB0FHP,FN20GE,,,Donald,,,2003 +KB0FRX,EN10,,,,,,2003 +KB0G,DM79PA,,,,,,2003 +KB0GL,EN35,,,,,,2003 +KB0GR,EM29,,,,,,2003 +KB0GU,EM28TW,,,Gene,,,2004 +KB0HH,EM07QD,EME,,,,,89 +KB0IKP,EN25UQ,,,,,,2003 +KB0LRI,DM79,,,,,,2003 +KB0LXX,DN96,,,,,,2003 +KB0MNK,EN34IW,,,,,,2003 +KB0NR,EN35OG,,,,,,2003 +KB0OBT,EN35KB,,,,,,2003 +KB0OZN,EN34,,,,,,2003 +KB0PYO,EN24GP,,,Mark,,,01/97 +KB0THN,EN44DB,,,,,,2003 +KB0TZA,EN35ID,,,,,,2003 +KB0USF,DM79LR,,,,,,2003 +KB0VUK,EN34PK,,,Matt,,,09/01 +KB1CJ,FN42JG,,,Joe,,IC746 50: 100W 2el - 144: 100W 13el,09/03 +KB1DFE,FN42ES,,,,,,2003 +KB1HGB,FN53EU,,,,,,2003 +KB2AH,FN20,,,,,,2003 +KB2M,FM29PE,,,,,,2003 +KB3EDF,FM18RH,,,Ron,,,2003 +KB3HWO,FN10UB,,,Mark,,,2003 +KB3PD,FM29,EME,,,,,89 +KB4BSA,EM73,,,,,,2003 +KB4FQ,FM04GR,,,,,,2003 +KB4RSM,EM66OG,,,,,,2003 +KB4WM,EM63,EME,,,,,2003 +KB4ZGO,FM06BQ,,,Anthony,,,2004 +KB5DAK,DM96,,,,,,2003 +KB5EK,EM15,,,,,,2003 +KB5MR,EM26,,,,,,2003 +KB5MY,DM13NC,,,,,,2003 +KB5UBE,EM12LQ,,,,,,2003 +KB5ULP,EM15,,,,,,2003 +KB5VL,DM73RK,,,,,,2003 +KB5VQQ,EM15,,,,,,2003 +KB5WII,EM15,,,,,,2003 +KB5WMY,EM32,,,Carl,,,1998 +KB5YAJ,EM14,,,,,,2003 +KB5YUA,EM44,,,,,,2003 +KB5ZMY,EM12,,,,,,2003 +KB5ZUD,EM26,,,,,,2003 +KB6IGC,DM15DO,,,,,,2003 +KB7FUV,DN44,,,,,,1993 +KB7XO,DN41AB,,,,,,2003 +KB8GC,EN74HD,,,,,,2003 +KB8JVH,EN80,,,,,,2003 +KB8O,EN82JJ,,,Albert L. ""Al",,,03/00 +KB8RQ,EM79SV,EME,,Gary L.,,144: 8 x 19el M2.038,01/05 +KB8VAO,EN91PB,,,,,,2003 +KB8ZUZ,EN83JL,,,,,,2003 +KB8ZW,EN91IJ,,,,,,2003 +KB9GPW,EN61,,,,,,2003 +KB9II,EN52WA,,,,,,2003 +KB9KCJ,EN52,,,,,,2003 +KB9MLA,EN61CX,EME,,,,18el- 160W,10/98 +KB9NLM,EN53UO,,,,,,2003 +KB9PCL,EN41,,,,,,2003 +KB9PJL,EN44GT,,,,,,2003 +KB9Q,EN52VV,,,,,,2003 +KB9TLV,EN45MW,,,,,,2003 +KB9UMT,EN50DP,,,Don,,,2003 +KB9VQC,EN53,,,,,,2003 +KB9VUG,EN52,,,,,,2003 +KB9YXF,EN61,,,,,,2003 +KB9ZK,EN62,,,,,,2003 +KC0AKJ,EN42,,,,,,2003 +KC0AMG,DM98GK,,,,,,2003 +KC0CHW,EN41IN,,,,,,2003 +KC0CRE,DM28,,,,,,2003 +KC0FTQ,DM79OB,,,,,,2003 +KC0FXY,EN34,,,,,,2003 +KC0HTB,EN34JT,,,,,,2003 +KC0LBT,EN35IB,,,,,,01/05 +KC0LMS,EN34IW,,,,,,2003 +KC0MLS,EM19QU,,,Myron,,,2003 +KC0OG,EN10,,,,,,2003 +KC0P,EN34SB,,,,,,2003 +KC0QR,EN10,,,,,,2003 +KC0Y,DM79,,,,,,2003 +KC2TN,FM29NS,,,Joe,,,2003 +KC3AK,FM19UU,,,Terry,,,2004 +KC3RE,FM18DB,EME,,Martin,,144: 160 W .5 db 18 el (no elev) - 432:,02/05 +KC4VI,EL88SD,,,,,,2003 +KC5BQS,EL29,,,,,,2003 +KC5BRO,EM15,,,,,,2003 +KC5LOW,EM22,,,,,,2003 +KC5NOA,EL08,,,Bart,,50: 150W 5el - 144: 100W 10el - 432: 20W 19el,01/01 +KC5NOB,EL07,,,John,,50: 10W 5el - 144: 170W 8el - 432: 10W 19el,01/01 +KC5UOO,EM26,,,,,,2003 +KC5WX,EM13LB,,,,,,2003 +KC5YKX,EL17HS,,,Reid,,Icom 746 w/ DEM 22 and 432 xverters 50: 5el,05/02 +KC5ZXE,EM45AM,,,,,,2003 +KC6A,DM03,EME,,,,,2003 +KC6TEU,CM98MQ,,,,,,2003 +KC6WFS,DM04RK,,,Dave,,50: 100W 5el - 144: 100W 2x12el - 432: 50W 2x,08/01 +KC6ZWT,CM98,,,Alexander,,144: 350W 17el M2 - 222: 250W 15el - 432:,05/03 +KC7MRP,CN88,,,Brad,,,01/97 +KC7OTV,CN84KA,,,Brian,,,2003 +KC8CCD,EM79VM,,,,,,2003 +KC8DLL,EN66,,,Mike,,50: 150W M25 - 144: 200W 2x13B2 - 432: 100W K,1998 +KC8GYW,EM79,,,,,,2003 +KC8NST,EN91QB,,,,,,2003 +KC8OIT,EN83,,,,,,07/01 +KC9AAX,EN52,,,,,,2003 +KC9AER,EN52,,,,,,2003 +KC9AYO,EN52,,,,,,2003 +KC9BTW,EN52,,,,,,2003 +KC9CMT,EN63LA,,,Michael,,,2004 +KD0BT,EN41,,,,,,2003 +KD0DW,DN70LF,,,,,,2003 +KD0HE,EN00,,,,,,2003 +KD0LO,EM48,,,,,,2003 +KD0PY,EN41UX,,,Darryl,,144: IC275A 2516g 150W 13el - 432: IC471H 70W,01/01 +KD0SU,DM78,,,,,,2003 +KD1DU,FN31FH,EME,,,,,2003 +KD3UY,FM19LG,EME,,Bob,,,01/05 +KD4ESV,EL87RH,,,Samuel C.,,,01/01 +KD4FNB,FM17TD,,,,,,2003 +KD4LT,EM81CG,EME,,,,,2003 +KD4MZM,EL87RG,EME,,Eric,,50: FT107m - 144: FT726r 170W 19el.125.200,07/01 +KD4NOQ,EM55BE,,,,,,2003 +KD4NUD,EM91HB,,,,,,2003 +KD4TJN,EM55CE,,,,,,2003 +KD5FFW,EM12,,,,,,2003 +KD5FZX,EM12MP,EME,,,,,2003 +KD5HIO,DM65UV,EME,,Glen,,,2003 +KD5KJD,EL29IR,,,Luis,,,2004 +KD5LDQ,EM26IH,,,Dwayne,,,2003 +KD5LWU,DM66AU,,,Johnny,,,2003 +KD5OMJ,EM04UO,,,Boyd,,,2003 +KD5OUG,EM12,,,,,,2003 +KD5QQU,EM12QX,,,,,,2003 +KD5QWO,EM15AJ,,,David,,Yaesu ft-847,01/04 +KD5XB,DM84,,,Earl,,,01/97 +KD7ETC,DM54AH,,,Roland,,,2004 +KD9KX,EN42,,,,,,2003 +KD9PW,EN54,,,,,,2003 +KE0MO,EN41,,,,,,2003 +KE0UQ,EM29,,,,,,2003 +KE1AF,,,,ABEL,,,2003 +KE2N,FM18EW,EME,,KEN,,432: 16x28 el 1KW,01/05 +KE3PL,FN20PM,,,,,,2003 +KE3UY,,,,mark,,,2003 +KE4ENX,EM84GM,,,,,,2003 +KE4IKM,EM73,,,,,,2003 +KE4KDB,EM55,,,,,,2003 +KE4MKW,EM84DJ,,,,,,2003 +KE4VUN,EM67MS,,,,,,2003 +KE4YH,EL88OA,,,Stew,,,01/01 +KE4YYD,EL97RV,,,David,,,09/01 +KE5CO,EL29,,,,,,2003 +KE5ML,EM15,,,,,,2003 +KE6NDG,CN90QJ,,,Jim,,,2003 +KE6PT,CM88UE,,,,,,2003 +KE7CX,CN85LJ,,,,,,2003 +KE7NR,DM33WM,EME,,,,,12/04 +KE7NS,DN41AF,,,Mark,,,01/02 +KE7OI,DN13SU,EME,,Dan,,,01/01 +KE7V,CN88JB,,,John,,,2004 +KF0AU,EN31HI,,,,,,2003 +KF0CK,EM38JC,,,,,,2003 +KF0DS,DM41,,,,,,2003 +KF0FE,EN41,,,,,,2003 +KF0M,EM17HO,EME,,John,,,01/01 +KF0OA,DM79,,,,,,2003 +KF0Q,EN44EA,,,,,,2003 +KF4HOU,EM86VE,,,,,,2003 +KF4JU,EL87,,,,,,2003 +KF5AL,EM13,,,,,,2003 +KF5IU,EM31WR,,,,,,2003 +KF5PE,EM12,,,,,,2003 +KF6BXH,CM87VQ,,,,,,2003 +KF6HQC,DM14ED,,,,,,2003 +KF7CN,DN16LV,,,Kevin,,,01/01 +KF7IS,DN41AC,,,Jim,,,2004 +KF7VY,DN17IQ,,,,,,2003 +KF8QL,EN72,,,,,,2003 +KF9CY,EM59,,,,,,2003 +KF9YR,EN54,,,George,,144: 170W 13B2,01/97 +KG0MW,EN13,,,Chad,,,02/01 +KG0SV,DM79,,,,,,2003 +KG4BMH,EM76JK,,,Jason,,144: 1000 Watts sp144vdg GasFet 40 Element,05/02 +KG4CHX,EM95LL,,,,,,2003 +KG4FET,EM90FH,,,Sandor,,,07/01 +KG4KAK,EL96VG,,,Leo,,,2005 +KG4MLA,EL88OA,,,Joe,,,2003 +KG5RK,EM12,,,,,,2003 +KG5SF,EM44,,,,,,2003 +KG5UN,EM02,,,,,,2003 +KG6DX,QK23KL,EME,,,,,01/05 +KG6ENA,DM04DK,,,,,,2003 +KG7CN,DN23BF,,,,,,2003 +KG7FU,CN83KA,,,James S.,,144: 2x11el 1KW.190.240,01/01 +KH7K,AL08UJ,,,,,,2003 +KI0LE,EM36US,EME,,Bryce,,,12/04 +KI4BYV,FM15CX,,,John,,,2004 +KI4M,EM95AQ,,,Shane,,144: 800W M2 18XXX,01/01 +KI6FF,DM13AR,,,,,,2003 +KI7JA,CN85RL,,,Bruce,,,2004 +KI7WB,DN62,,,Ed,,144: 200W 10el,01/01 +KJ5EY,DM65XA,,,,,,2003 +KJ5Q,EM15,,,,,,2003 +KJ7A,DM03,EME,,Chip,,432: FT-817 8 x 25 ele,11/00 +KJ7F,DN13VO,EME,,,,,2004 +KJ7OG,DM42MH,EME,,,,,2003 +KJ9I,EN53QC,EME,,David,,,01/05 +KK4NO,EM92,,,,,,2003 +KK5WA,EM45,,,,,,2003 +KK7B,EN57RB,,,,,,2003 +KK7LK,CN88SS,,,,,,2003 +KK8O,EN80OR,,,Richard,,,2004 +KL6M,BP51DC,EME,,Mike,,9.2m dish,01/05 +KL7FB,BP51HO,EME,,,,,2003 +KL7HFQ,BP51,EME,,,,,2003 +KL7IZW,EM13SE,EME,,,,,12/04 +KL7X,BP51AE,EME,,,,,02/01 +KM0A,EM48UT,,,Mark,,,01/01 +KM0T,EN13VB,,,Mike,,,07/01 +KM1H,FN42,,,Carl,,144: 1-5KW 2x4218XL,01/01 +KM4ID,EM93WA,,,,,,2003 +KM5ES,EM25DI,,,John,,144: TR751 200W 30el,08/01 +KM5OL,EM13RB,,,,,,2003 +KM5PO,EM23WK,EME,,Jim ""Mac",,144: 13KW ERP,12/04 +KM6WC,CM97OP,,,Jim,,FT100,09/02 +KN4SM,FN16QT,,,Jerry,,144 : 1-5KW M2 5wl,01/01 +KN6DD,DM03,EME,,,,,2003 +KO0Z,EM48,,,,,,2003 +KO2R,EN52,,,,,,2003 +KO4FR,FM16UV,,,Robert,,,2005 +KO4QR,FM26,,,,,,1998 +KO7N,CN84IA,EME,,Richard,,432.050144.240,08/01 +KQ0Z,EM37,,,,,,2003 +KQ6JI,CM87UJ,,,,,,2003 +KQ6UH,DM14BC,,,,,,2003 +KR5E,EL29JN,,,,,,2003 +KR5V,EM13,EME,,,,,01/02 +KR5Vex,EM13SD,,,,,,2003 +KR7O,CM97,,,Robert,,HTX100 144: Trvt 1KW 2M5wl - 222: Trvt 450,01/01 +KR8L,DN43AL,,,,,,2003 +KS0F,EM48SL,,,Mike,,,01/97 +KT4HA,FM15BH,,,Joe,,,2003 +KT8O,EN34IV,,,Eric,,,2003 +KT8U,EN80OR,,,Reed,,,2003 +KU0KU,EM28QV,,,,,,2003 +KU3T,FN20,EME,,,,,04/98 +KU4F,EL99AF,EME,,,,,2003 +KU4R,EM86SK,EME,,Bob,,144: 2x18XXX 200W,01/01 +KU7Z,DN41AF,,,Mark,,,2004 +KV4EB,EM66FL,,,Willie,,144: 7el 14el,11/01 +KV6J,BK29AQ,,,,,,2003 +KW0A,EM48RI,,,Ken,,144: 1KW 24el,08/01 +KW0T,EM19WF,,,,,,2003 +KX7V,DM42,,,,,,2003 +KX9X,EN60AC,,,Sean,,IC706MKII - 50: 100W 3el - 144: 100W 11el,09/01 +KY7B,DM43,,,,,,2003 +KZ2S,FN20XD,,,,,,2003 +LA0BY,JO59FW,,,Stefan,,144: 180W 9el - /p JO59ix: 144: 180W 2x9el,10/01 +LA0FX,JP40LM,,,,,,11/95 +LA1BEA,JO29XB,,,,,,1991 +LA1K,JP53EK,EME,,OP: LA8UGA Asgeir,,144: 2x4CX250b MGF1402 preamp 4x17el1000lp,01/95 +LA1KHA,JO49SE,,,kjell,,,1993 +LA1TV,JO49TQ,,,,,,01/04 +LA2AB,JO59FV,EME,,Clubstation,,,07/02 +LA2PHA,JO38IB,,,"Stein",,144: 100W 10el,07/02 +LA2RZ,JP20ON,,,Dave,,144: 160W 17el,05/02 +LA2YMA,JP32LK,,,,,144: 40W 9el,02/04 +LA3BO,JO59CD,,,Svein,,,04/04 +LA3EU,JP32BG,,,per,,,1993 +LA3WU,JP20QH,EME,,ingebrigt,,,1993 +LA4DL,JP32EL,,,,,,03/04 +LA4XGA,JP33VC,,,Geir,,144: 17el 1000W or 150W117 DTR 3000lpm,11/04 +LA4YGA,JO48AE,,,Jerzy,,IC821 144: 150W 9el - 432: 2x17el 100WDTR,12/04 +LA5IH,JP20NK,,,,,,1993 +LA5KJA,JP50IV,,,Kjell,,.070,01/98 +LA5KO,JO59FH,,,Roy,,144: 300W 17el MGF1302165 1500lpm165,12/04 +LA5PH,JO49XA,,,,,,1992 +LA5SAA,JO29SE,,,michael,,.144,1993 +LA5TFA,JP99LQ,,,Aasmund ""Birger",,IC751-IC706-FT736r-FT225rd - 50: 2x5el HL166,02/02 +LA6CU,JP20QL,,,Per,,144: TS790e 150W 16el MGF1302.145 DTR 150,09/99 +LA6HL,JO28TW,EME,,Johannes,,,01/02 +LA6I,JP41,,,,,,1993 +LA6K,JP33VC,,,Clubstation,,,05/03 +LA6LU,JO28,,,,,DTR,07/96 +LA6MV,JO59FJ,,,Helge,,,08/02 +LA6QBA,JP61BJ,,,Frans,,50: 100W 2x5el - 144: 600W 4x11el1500lpm,07/04 +LA6VBA,JO48,EME,,tarald,,,1993 +LA7DFA,JP53,EME,,Per-Einar,,111 DTR,10/03 +LA7KK,JP50,EME,,p.,,,1993 +LA8AE,JO59CC,EME,,ote,,,1994 +LA8AJA,JP50HQ,,,Andreas,,only SSB-MS,01/99 +LA8AK,JO38XC,,,Jan Martin,,144: 200W 2x9el BFT66DTR,08/00 +LA8G,JP53EJ,,,,,,01/05 +LA8GKA,JO59FS,,,Rune,,,12/03 +LA8KV,JP52QQ,EME,,Kjetil,,DTR,03/04 +LA8LF,JO59BR,EME,,Anders,,,01/05 +LA8OW,JP50NC,,,Arvid,,3000lpm,05/02 +LA9BM,JP40CM,,,l.,,,03/98 +LA9DL,JO59KE,EME,,,,,04/04 +LA9IY,JP53,,,,,,2003 +LA9NEA,JO59DX,EME,,Viggo Magnus,,144: 4x 19el K1FO 1-5KW,02/05 +LB7FA,JO59CR,,,,,,08/04 +LC1OCT,JP32,,,,,,06/03 +LC1PAT,JP78,,,,,,2003 +LU4HO,FF78RA,,,,,,2003 +LU6DW,GF05SF,EME,,,,,2003 +LU6KK,FG73ie,EME,, +LU7DZ,FF78RA,EME,,Eduardo van,,144: 1KW 4xDJ9BV,04/00 +LU8EDR,GF05TF,EME,,Dany,,,11/02 +LU9AWH,GM04SO,,,Edgardo,,,2003 +LX1DB,JN29,,,Willy,,,07/99 +LX1GR,JN39,,,gilbert,,,1993 +LX2DX,JN29WO,,,Jean,,,10/02 +LX2SM,JN39,,,,,,07/04 +LY2AAM,KO06VB,EME,,,,183383,05/03 +LY2BAW,KO25KA,,,Tadas,,FT-736R+home made PA - 144: 24el 2M8WL M2 - 4,05/03 +LY2BIL,KO24PQ,,,Rytis,,144: FT736r 30el 1KW188 DTR 3000lpm188,08/02 +LY2BUU,KO15XH,,,,,,04/04 +LY2BW,KO24,,,Algis,,,1/95 +LY2CI,KO14WV,,,Raimundas ""Ray",,TS-790A- 144: 150W 11el - 432: 25el yagi - 1,08/03 +LY2FE,KO05NQ,,,Vytas,,144: FT736r 300W 13elMSDSP,10/02 +LY2FR,KO15VR,,,Paulius,,,07/04 +LY2GC,KO25KA,EME,,Giedrius,,,10/04 +LY2MW,KO24PS,,,Remigijus (Remi),,IC746 + PAs 50: 100W 6el - 144: 100Watt 1,08/04 +LY2SA,KO14LL,,,Vidas,,144: IC821H 300W 16el MGF1502 - 432: 175W,01/04 +LY2WR,KO24OQ,,,Clubstation,,144: FT736r 11el 600W - 432: 800W 24el - 1,01/00 +LY3BF,KO24OR,,,Arvydas,,,01/96 +LY3GM,KO14LL,,,,,,12/97 +LY8X,KO24PQ,,,OP LY2MW,,,08/99 +LZ1AG,KN22ID,EME,,Angel,,144: 14el 100W,12/99 +LZ1BB,KN12SS,,,Harry,,,08/04 +LZ1DP,KN22TR,EME,,Christo,,144: 4x5 WL DJ9BV cross+MGF1302 FT-736R PA 1,01/05 +LZ1DX,KN22,,,net,,,1993 +LZ1JH,KN32FR,,,Ruben,,,06/99 +LZ1KDP,KN12SP,EME,,OP LZ2HM,,.172 1200lpm,01/98 +LZ1KDZ,KN32,EME,,radio,,,1993 +LZ1KG,KN31CS,,,Dimitar,,50: 4el transv. 10W - 144: 2x16 F9FT IC275e,09/03 +LZ1KJ,KN31CS,,,Ivan,,50: FT987 4el 15W - 144: FT987 250W 2x8el G,09/03 +LZ1KQ,KN22TK,,,Veso (OP LZ1KWT),,,12/96 +LZ1KRB,KN32,,,radio,,,1993 +LZ1KSN,KN32SL,,,,,,1993 +LZ1KSW,KN31CS,,,Clubstation,,,12/95 +LZ1KU,KN32,,,s.,,,1993 +LZ1KWT,KN22TK,,,Clubstation,,144: FT736 1KW 2x16el F9FT GaAsFet 3SK129r,11/03 +LZ1NO,KN12,,,,,,12/01 +LZ1QI,KN12,,,Bebko,,,11/01 +LZ1QM,KN12,,,s.,,,1993 +LZ1R,KN42AA,,,,,,1993 +LZ1UB,KN22TK,,,,,,1994 +LZ1UK,KN22ID,,,Savko ""Savi",,144: 60W 8el Quagi,11/03 +LZ1V,KN12QQ,,,,,,1990 +LZ1ZP,KN22ID,,,George,,144: 150W 14el DJ9BV1000lpm,05/03 +LZ1ZX,KN32IO,,,mitko,,,12/99 +LZ2AR,KN13SF,EME,,boris,,,1994 +LZ2FO,KN13KX,,,Shecko,,144: 500W 15el 9BV.138 2000lpm,07/04 +LZ2FR,KN13IU,,,,,,12/98 +LZ2HM,KN12QP,EME,,Andre ""Andy",,144: FT847 17el yagi172 1200lpm,07/03 +LZ2HV,KN23UB,,,Christo,,144: 600W 12el Quad.145 2000lpm,12/98 +LZ2JF,KN23,,,n.,,,1993 +LZ2KRU,KN33FL,,,Clubstation,,144: 500W 17el.191 1000lpm,08/97 +LZ2KZ,KN33FC,,,Zlatko,,144: 15el 100W,12/01 +LZ2PP,KN33,,,v.,,,1993 +LZ2US,KN13RJ,EME,,"Marko"" Nikolov,,144: 4x KLM17LBX 2x 4CX800A 2KW FSC11LF.,08/00 +LZ2UU,KN12QP,,,Jordan (Dany),,.172 1200,08/96 +LZ3BD,KN12QQ,,,Bogdan,,432: 250W 32el GaasFet2000lpm.325,12/99 +LZ3CQ,KN12PQ,,,,,,01/03 +LZ3GM,KN32RL,,,Ivan,,144: IC735 20W 13elBVO MGF1302.148.300,05/03 +LZ3YH,KN22,,,Dora,,,12/95 +LZ5GM,KN32QL,,,Iilian,,144: IC-720 50W 13eleFT MGF1302292,04/03 +LZ5N,KN21JX,,,,,,1995 +LZ5UV,KN12PR,,,Evengi,,144: FT847 IC271 4cx250 PA 17el DJ9BV.174,11/02 +LZ5Z,KN12PR,,,LZ1JK- LZ2HM- LZ5UV,,144: 2x15el 1KW,12/99 +LZ6T,KN22IS,,,,,,12/99 +LZ7A,KN43HL,,,,,,1994 +LZ7P,KN22,,,,,,12/96 +LZ7Y,KN41AX,,,OP LZ3GM,,DTR,08/99 +LZ9M,KN32RL,,,OP: LZ3GM,,,12/03 +LZ9W,KN12MO,,,LZ Contest Team,,IC-746 FT-847,01/05 +M0BPQ,IO91WP,,,Steve,,50: 400W 7el 144: 2x5el 400W 432: 2x21el,11/04 +M0CQZ,IN69UW,,,Ops DH5FS- DH0LS...,,.188,09/00 +M0CTP,IO93,,,,,,03/02 +M0EME,IO93GF,EME,,Paul,,FT847 4x FO20 100W,01/05 +M0VHF,IO82VF,,,Mike,,FT847 JST245 3CX800 8877 - 50: 5el - 144:,10/02 +M1DRK,IO93US,,,Andy,,50: TS60 5el 90W130-150,01/02 +M1GSM,IO94BU,,,Stuart,,144: 150W 8elMSDSP,08/03 +M5FUN,JO00DX,,,Jonathan ""Jono",,144: TR751E 100W 12el225 only SSB-MS310,03/04 +M5MUF,IO92JP,,,Mike,,IC202 IC706 various transverters,09/03 +MI0AYR,IO64VQ,,,Paul,,144: TR9130 150W 19el,02/04 +MM0BQI,IO85KX,,,Jim,,50: 100W 5el - 144: 13el.045.345,03/00 +MM0CCC,IO85MW,,,John,,144: FT1000MP TVVF144A 17el 100W,05/04 +MM0CEZ,IO75XU,,,Peter,,IC910 IC775DSP Transverter,03/04 +MM0DQP,IO88KI,,,Erik,,100W,05/04 +MM0KOS,IO85CR,,,Chris,,ICOM 290D MK2,05/04 +MM1BXF,IO76PA,,,,,,01/03 +MM5AJW,IO88KI,,,Don,,,09/04 +MM5DWW,IO89ID,,,David,,KENWOOD TR751/TS690 100W 11el,04/04 +MS0FNR,IO88KK,,,Erik,,,12/04 +N0AB,EM28,,,,,,2003 +N0AE,EN51,,,,,,2003 +N0AJU,EN11,,,,,,2003 +N0AKC,EN44GU,,,Charles,,144: 1-2KW 17el - 222: 350W 16el,01/01 +N0ATV,EN34JX,,,,,,2003 +N0BTN,EN21,,,,,,2003 +N0CIH,EN42,,,,,,2003 +N0CKK,EN34,,,,,,2003 +N0DAG,EM29QF,,,,,,2003 +N0DQS,EN22GD,,,Gene,,,07/01 +N0DY,EN42FA,,,,,,2003 +N0EC,DN70LF,,,Ron,,50: 1KW - 144: 1-5KW - 222: 120W - 432: 1KW -,01/01 +N0ECI,EM37,,,,,,2003 +N0EKT,EN21,,,,,,2003 +N0EOQ,EM24,,,,,,2003 +N0FFO,EM17,,,,,,2003 +N0FQW,EM39,,,,,,2003 +N0GPH,EM48,,,,,,2003 +N0GXA,EN13QH,,,Kevin,,144: 1KW preamp 18el,1998 +N0GXN,EM48,,,,,,2003 +N0HJZ,EN34FV,,,Rich,,144: TS700S 200W preamp 12el,01/01 +N0HKT,EM17,,,,,,2003 +N0HZ,EN34,,,,,,2003 +N0ICV,EN52XA,,,TONY,,,2004 +N0IDT,EN10,,,,,,2003 +N0IS,EM48,,,,,,2003 +N0IT,EM48RN,,,Dave,,144: 170W,01/01 +N0JCF,EN35,,,,,,2003 +N0JEQ,EM27,,,,,,2003 +N0JK,EM17,,,,,,2003 +N0KE,DM69,,,,,,2003 +N0KEV,EM17,,,,,,2003 +N0KIS,EN10QT,,,,,,2003 +N0KM,DM67VR,,,Dave,,,01/97 +N0KN,EM28,,,,,,2003 +N0KQY,DM98GK,EME,,Gary,,144: 15/19dbd antenna 1KW,02/01 +N0LIK,EM48,,,,,,2003 +N0LL,EM09,,,Larry,,,01/01 +N0LNO,EN42,,,,,,2003 +N0LRJ,DM78,,,,,,2003 +N0NAS,EN35,,,,,,2003 +N0NEG,EM29,,,,,,2003 +N0NHS,DN70LF,,,,,,2003 +N0OIB,EN35,,,,,,2003 +N0OYQ,EN25,,,,,,2003 +N0PB,EM39WO,,,Phil,,,11/01 +N0PJU,EN41,,,,,,2003 +N0POH,DM79OP,,,Wayne,,,01/01 +N0QBF,EM48SR,,,,,,2003 +N0REN,EN34,,,,,,2003 +N0RHL,EN10RT,,,,,,2003 +N0SBU,EN35,,,,,,2003 +N0SHR,EN26,,,,,,2003 +N0SRQ,EN18,,,,,,2003 +N0SWV,DM79,,,Jesse J.,,144: 170W 2x16el - 432: 35W 2x18el - 1296: 60,05/98 +N0TOU,EM29,,,,,,2003 +N0UGY,DM79,,,,,,2003 +N0UK,EN34JV,,,Chris,,50: 10W KLM661 - 144: TS930/DEM Tvtr 300W K1F,07/01 +N0US,EN10,,,,,,2003 +N0UU,EM18,,,,,,2003 +N0VSB,DM79RJ,,,Brian,,50: 1KW 7el - 144: 1.5KW 18el MGF- 222: 200W,01/02 +N0WJY,EN10QT,,,,,,2003 +N0WVU,DM79HV,,,,,,2003 +N0WX,EN34,,,,,,2003 +N0XKS,EM29,,,,,,2003 +N0XPI,EM29,,,,,,2003 +N0YGM,DM78OV,,,,,,2003 +N0YNP,DN81CW,,,,,,2003 +N0ZEB,DM79,,,,,,2003 +N0ZKK,EM29,,,,,,2003 +N1BUG,FN55MF,EME,,Paul,,50: 400W 5el 144: 1500W 20el Yagi 222: 500W,11/04 +N1CPE,FN42QH,,,,,,2003 +N1EKV,FN42JK,,,,,,2003 +N1GMV,FM05TU,,,John,,,2004 +N1GOD,FN41VQ,,,Lou,,,2003 +N1KTM,FN41SR,,,Clint,,144: 1kw- 2x2M9,01/97 +N1LDY,FN41JR,,,Tony,,IC-746 IC-910 DEMI-222 DEMI-903,01/04 +N1NCO,FN42GL,,,John,,,2003 +N1RWY,FN54NO,,,Jason,,50: 100W 3el CC - 144: 800W 18el - 222: 350W,01/01 +N1RZ,FN44EI,,,Tim,,.090,07/01 +N1SZ,DM79NP,,,James,,,2003 +N1VQR,FN42JJ,,,,,,2003 +N2CEI,FN20,,,,,,2003 +N2FKF,FN30BR,,,Bill,,,2004 +N2HLT,FN12LN,EME,,,,,2003 +N2IQ,FN13TD,EME,,,,,2003 +N2IQU,FN13,,,,,,2003 +N2JMH,FN13AF,,,James,,,2003 +N2JQR,FN13,,,Jeff,,50: 500W 5el,01/01 +N2JR,FM18CP,,,Richard,,50: 100W 5el,09/01 +N2KW,FN03XE,,,,,,2003 +N2MB,FN30CO,,,Barry,,,2003 +N2MCY,FN30AR,,,Ray,,,2003 +N2MKT,FN13LK,,,Jeff,,,2003 +N2MSS,FN31AA,,,,,,2003 +N2NEP,FN13EB,,,,,,2003 +N2NZI,FN32,,,,,,2003 +N2OLA,FN12MM,,,,,,2003 +N2OTO,FN30CR,,,Rupert,,144: TS850 LT2SMKII 200W 4el,01/01 +N2PC,DM78QX,,,,,,2003 +N2UO,FN20QF,EME,,,,,2003 +N2VR,FN12SK,EME,,Mike,,144: 4x13B2,08/01 +N2WK,FN03XE,EME,,Wayne F.,,144: 1-5kw 4x2.2 wl full elv. MGF1302.111,10/00 +N2WLS,FN02RQ,,,,,,2003 +N2XK,FN20RF,,,Fred,,,2003 +N3AHF,FN20SF,,,,,,2003 +N3AJX,EN71KC,,,,,,2003 +N3FA,FN21,EME,,Bob,,144: LT2S 8877 700W 4x12el M2 - 432: FT736 SP,10/99 +N3FZ,EN90xh,EME,, +N3JNP,EN91,,,,,,2003 +N3KKM,EM28,,,,,,2003 +N3OPM,FM19PH,,,Daniel F.,,,01/01 +N3RN,FN11WH,,,Bob,,144: 500W 16el KLM,07/01 +N3WT,FM19EJ,,,John,,,2004 +N3WXW,FN20CE,,,,,,2003 +N3XI,EN90XJ,,,Frank,,,2003 +N3YGA,FN20BI,,,Craig,,50: 160W 4el - 144: 170W 14el,1998 +N4CAG,EM86PI,,,,,,2003 +N4EQT,EM77,,,,,,2003 +N4FRE,EL06LL,,,,,,2003 +N4GJV,EM95PS,EME,,,,,89 +N4GKO,EM65LO,,,Bryn,,144: FT736r 350W 2M18XXX,01/01 +N4HY,FN20RG,,,Bob,,,2004 +N4IP,EM73WV,,,,,,2003 +N4IPB,EM66,,,,,,2003 +N4IS,EL96UB,,,Jose,,FT1000MP+Trsv 144: 350W 18el M2.120.200,06/01 +N4KWX,FM08WF,,,Ray,,,01/97 +N4KZ,EM77GT,,,Dave,,,09/01 +N4LXB,EM83VL,,,Paul,,,2003 +N4MW,FM17KN,EME,,,,,2003 +N4OYS,EM65,,,,,,2003 +N4PZ,EN52,EME,,,,,04/97 +N4SC,EN72,,,Roman,,,11/04 +N4TWX,EL89TW,,,Terry,,50: 5el 75W - 144: 15el 150W Preamp,01/01 +N4UK,EM84XP,EME,,Ken,,144: 1KW 13/13el - 222: 750W 23elM2 - 432: 75,01/97 +N4WI,FM14IL,,,Fred,,,2004 +N4XD,FM05,,,,,144: TS700SP 160W,01/01 +N4ZKR,EM65,,,,,,2003 +N4ZRW,EM17KN,,,,,,2003 +N5AF,EM20,,,,,,2003 +N5AHD,EL17,,,,,,2003 +N5AMA,EL29,,,,,,2003 +N5ARS,EM26,,,,,,2003 +N5AXJ,EM86,,,,,,2003 +N5BA,EL29FX,,,Brian,,144: 1500W 4x5wl,08/03 +N5BHO,EM31,,,,,,2003 +N5BHX,EL09,,,,,,2003 +N5BHZ,EM22,,,,,,2003 +N5BLZ,EL29EW,EME,,Ed,,144: 4 X 28 XPOL 8877,11/02 +N5DL,EM36,,,,,,2003 +N5EM,EL29,,,,,,2003 +N5FV,EM03,,,,,,2003 +N5HHS,EL29,,,,,,2003 +N5IS,DM96,,,,,,2003 +N5JM,EL49,,,,,,2003 +N5KDA,EM41HM,,,Gary,,,09/01 +N5KWB,EM32QB,,,,,,2003 +N5MP,EM12,,,,,,2003 +N5MWS,EM13,,,,,,2003 +N5MYH,EM32,,,,,,2003 +N5NDV,EM15,,,,,,2003 +N5NSH,EM14,,,,,,2003 +N5OCP,EM15,,,,,,2003 +N5OSK,EM25FI,,,Jerry,,,10/02 +N5QGH,EM13QC,,,,,,2003 +N5QS,EM45,,,,,,2003 +N5QT,EM45,,,,,,2003 +N5RZ,DM81XW,,,,,,2003 +N5SAL,EM28,,,,,,2003 +N5SIX,EM42XI,EME,,Bruce,,,02/05 +N5TML,EM14,,,,,,2003 +N5TQB,EM31PJ,,,,,,2003 +N5TX,EL09,,,,,,2003 +N5WS,EL09RU,,,W. Russ,,,01/01 +N5XCX,EL09,,,,,,2003 +N5XU,EM10DG,,,Kenneth,,,01/01 +N5YLS,EM54,,,,,,2003 +N5YSM,EM15,,,,,,2003 +N5ZLU,DM95,,,,,,2003 +N5ZWO,EM32,,,,,,2003 +N6CL,EM26,,,,,,2003 +N6CV,DM04UF,,,,,,2003 +N6DHN,CM98,,,Frank,,50: 150W 4el - 144: 150W 22el - 432: 100W,1998 +N6ENU,DM04,,,John L.,,144: 270W 13el Yagi - 50: 100W 7el,01/01 +N6HV,DM04,,,,,,2003 +N6KBX,CM98,,,Don,,50: 400W 2x5el - 144: 350W 4x17el - 432: 17,01/97 +N6KMR,CM97MO,,,Jim,,,2003 +N6NB,DM05,,,,,,2003 +N6OVP,CM87,EME,,,,,2003 +N6PYI,DM05KJ,,,,,,2003 +N6RA,CM87SR,,,Thomas,,,2003 +N6RJM,DM14CP,,,Pat,,50: 1KW 9el - 144: 1-5KW 4x18el - 222: 350W,01/01 +N6RMJ,DM14CP,,,,,,2003 +N6RPM,DM04UA,,,,,,2003 +N6RZ,CM87WB,,,Dave,,144: 1KW 17B2,01/01 +N6SPP,CM87WQ,,,,,,2003 +N6TQS,CM87UU,,,,,,2003 +N6TX,FN11LH,EME,,,,,2003 +N6VHF,DM13,,,Neil,,,01/01 +N6YM,CM88XF,,,Ed,,,01/01 +N6ZE,DM04NE,EME,,Peter S. ""Pete",,IC756 PRO II 50: 100W 5el - 144: 8930Amp 2M5,08/03 +N7AM,CN87QN,EME,,,,,89 +N7AMA,DM33,,,,,,2003 +N7ART,CN87,EME,,,,,89 +N7AVK,CN84,,,,,,2003 +N7BSN,CN87QQ,,,,,,2003 +N7CZ,DN47HM,,,Bob,,FT736 IC706,01/02 +N7DMA,DM42NL,,,Karl,,,2003 +N7EMD,DM26JE,,,,,,2003 +N7EY,CN96QO,,,Sean,,,2003 +N7IJ,DN44GB,,,,,,2003 +N7LQ,DN01FA,EME,,Shawn,,432: 1.5KW 4 x FO-25's,06/00 +N7MWV,CN87VQ,,,John,,144: 250W CC3219only SSB-MS,01/01 +N7QJP,DM33VM,,,Stu,,,1998 +N7SKT,DM33SN,,,Bob,,,01/01 +N7WNX,CN83OW,EME,,,,,12/04 +N7WS,DM42JH,,,Wes,,144: 8877 17el GaAs,01/01 +N7YAG,CN85,,,Arnold,,144: FT736r 300W 11el KLM,1998 +N7YAP,DN07HJ,,,Gregory E.,,.125,08/01 +N8AIA,EN82KL,,,,,,2003 +N8ASB,EM89,,,,,,2003 +N8AXA,EM79UP,EME,,,,,2003 +N8BSG,EN82,,,,,,2003 +N8BXP,EN81,,,,,,2003 +N8CGY,EN74OH,,,Ken,,,01/01 +N8CQ,FM05OT,EME,,,,,2004 +N8DJB,EN81FJ,EME,,,,,2003 +N8ITP,EN81XF,,,,,,2003 +N8JMK,EN90,,,,,,2003 +N8KWX,EN62AD,,,,,,2003 +N8LCU,EN72,,,,,,2003 +N8NPX,EM79XR,,,,,,2003 +N8OC,EN83AO,EME,,Dave,,50: 100Watts 6ele KMA - 144: 1500Watts 17ele,08/03 +N8PUM,EN66DL,,,Branton T.,,144: 200W 2x17B2,1998 +N8PVT,EN64,,,,,,2003 +N8QOD,EN79,,,,,,2003 +N8TDL,EN90BN,,,Greg,,,2003 +N8VES,EM79VT,,,,,,2003 +N8ZAT,EM79,EME,,,,,2000 +N8ZAW,EM79,,,,,,2003 +N8ZM,EM79,,,,,,2003 +N9AB,EN52XG,EME,,,,,01/05 +N9AQ,EN51,,,,,,2003 +N9AU,EN62BX,,,,,,2003 +N9AZC,EM68,,,,,,2003 +N9AZZ,EM57MV,,,,,,2003 +N9BD,EM28,,,,,,2003 +N9BJG,EM57,,,,,,2003 +N9BMH,EN62,,,,,,2003 +N9CIQ,EN44,,,Jay,,,01/01 +N9DCA,EN71GG,,,,,,2003 +N9DG,EN53BJ,,,,,,2003 +N9EGT,EN70,EME,,,,,02/05 +N9EMC,EN52UI,,,,,,2003 +N9ESH,EN52XB,,,,,,2003 +N9FH,EN63,,,,,,2003 +N9FTC,EL79EQ,,,,,,2003 +N9GVF,EN62,,,,,,2003 +N9HF,EN52,,,,,,2003 +N9IJ,EN52XI,,,Leonard,,,2003 +N9JIM,CM87XI,,,Jim,,50: 9el 150W - 144: 16el 700W - 432: 21el 50W,11/03 +N9KC,EN52,EME,,,,,2003 +N9LAG,EM57,,,,,,2003 +N9LHD,EN62BA,,,,,,2003 +N9LR,EN50DU,EME,,Larry,,,02/05 +N9MEH,EN44,,,,,,2003 +N9MSG,EN50ES,,,John,,,2003 +N9MYK,EN-53W,,,,,,2003 +N9NHC,EN61DU,,,,,,2003 +N9NJY,EM58AM,,,,,,2003 +N9NOQ,EN51,,,,,,2003 +N9OO,EN62,,,,,,2003 +N9PXI,EN61CU,,,,,,2003 +N9RLA,EM78CQ,,,,,,2003 +N9ROX,EN54,,,,,,2003 +N9SBV,EN61UQ,,,,,,2003 +N9TZL,EN52SH,,,,,,2003 +N9UDO,EN53DL,,,,,,2003 +N9UUR,EN63,,,,,,2003 +N9VSV,EN63,,,,,,2003 +N9WWR,EN62CS,,,John,,,2003 +N9XG,EN60WL,EME,,,,144: 4x 17el 1KW,01/05 +N9XIX,EN53,,,,,,2003 +N9YKE,EN62,,,,,,2003 +NA0IA,EN42FB,,,,,,2003 +NA3T,FM05LW,EME,,Joe,,,10/97 +NA4AL,EM63OF,,,Bryan,,IC746 FT817,08/01 +NA4M,EM10DP,,,Phil,,,2003 +NA4N,FM18,EME,,,,,2003 +NA6E,CN82,EME,,,,,2003 +NA7D,DM43AS,,,,,,2003 +NB2V,FN30,,,,,,2003 +NC1I,FN32OB,EME,,,,,01/05 +NC1T,FN32,,,,,,2003 +ND2X,EL09,,,,,,2003 +NE0P,EM04,,,John,,,09/01 +NE1H,EM84AC,,,,,,2003 +NE7O,FN53HX,,,chet,,,2005 +NE8I,EN82JM,,,,,,06/04 +NF0Q,EM48,,,,,,2003 +NF5B,EL29,,,,,,2003 +NF7P,DM09GH,EME,,,,,2003 +NG9R,EN40LA,,,,,,2003 +NI4Z,EL98HJ,,,,,,2003 +NI6G,DM06,,,,,,2003 +NJ0C,DM78,,,,,,2003 +NJ0U,EN71IB,EME,,,,2x 17el 500W,01/05 +NJ0X,EM29,,,,,,2003 +NJ2L,FN13,,,,,,2003 +NJ7A,DN30XP,,,Dave,,144: 170W 16LBX Preamp - 222: 120W 5wL,01/01 +NK5F,DM65,,,,,,2003 +NK7J,DM33,,,Bob,,,01/01 +NK8Q,FN20KL,,,Mark,,144: 170W 13el - 50: 7W 5el,01/01 +NL7F,BP64DV,EME,,,,,2003 +NL7Z,BP51EN,EME,,Kevin,,FT920,02/05 +NM1A,EL96VF,,,,,,2003 +NM5BB,DM65UV,,,,,,2003 +NM5X,EM26,,,,,,2003 +NM9H,EM59CD,,,,,,2003 +NN5DX,DM80NV,,,,,,2003 +NN6RF,CM87UW,,,,,,2003 +NN7J,CN85,,,Dan,,,01/05 +NN9K,EN41,,,Pete,,,1998 +NP4B,FK67,EME,,,,,2003 +NQ2O,FN13,EME,,WALTER G ""Wastl",,,05/01 +NR5A,DN84LC,,,,,,2003 +NR6E,CM88,,,,,,2003 +NS4W,EM76VC,,,Bert,,500: 1KW - 144: 1kw 2.5wl - 222: 400W - 432:,01/01 +NS7K,DN31XC,,,Richard,,,2004 +NS7N,CN87,,,,,,2003 +NT0V,EN08OC,,,,,,2003 +NT0Z,FN31,,,,,,2003 +NT4P,EM95KF,,,Scott,,,2004 +NU5O,EM55,,,,,,2003 +NU7Z,CN87RT,,,,,,1993 +NU8I,DM43AN,,,Alf,,144: IC706 1KW,01/99 +NV3Z,FM15,,,,,,2003 +NW0X,EM40,,,,,,2003 +NW7O,DM26,,,,,,2003 +NX2Q,FN20WV,,,Al,,,2003 +NX7U,DM43DI,,,,,,2003 +NX8M,EM79PE,,,Bob,,,01/01 +NY1E,FN43QP,,,,,,2003 +NZ5P,DM95,,,,,,2003 +OD5NJ,KM73TW,,,,,,2003 +OD5RAK,KM74WH,,,Clubstation,,50: 6el - 144: 17el+ PADTR,05/98 +OE1MSB,JN88DF,,,Michael,,,10/03 +OE1SOW,JN88FF,EME,,Othmar,,HF:100/600W 4el FD4 vertical- 50: 100W 5el -,09/03 +OE1XVC,JN88ED,,,OP OE3KLU,,144: 2x11el- 432: 2x21el gd Pwr.145.370,03/98 +OE3CEW,JN88,,,e.,,,1988 +OE3FVU,JN78VE,EME,,Franz,,144: 2x14el 5WL 1KW MGF1302 - 432 MHz 1x13W,09/03 +OE3HHB,JN87AQ,,,Harald,,FT847 50: 100W 5el - 144: 50W 17el GaAs - 432,07/99 +OE3JPC,JN87EW,EME,,Johannes,,144: 200W 2x15el CF300 - 432: 500W 4x24el (,08/02 +OE3JTB,JN78QN,,,,,144: 15el,03/04 +OE3MWS,JN88DC,,,Manfred (Fred),,50: 100W 7el - 144: TR751 1-2KW 2x17el MGF1,01/05 +OE3NFC,JN88,,,n.,,,1993 +OE3OBC,JN88,EME,,othmar,,,1994 +OE3OKS,JN87AR,,,Wolfgang,,,12/98 +OE3R,JN88FD,,,via OE3KLU,,.180.320,01/96 +OE3SJA,JN88GH,,,Johan,,,04/04 +OE3UP,JN87CT,EME,,hans peter,,,1993 +OE3XAC,JN88FD,,,via OE3KLU,,.180.320,11/96 +OE3XMU,JN78XD,,,Clubstation,,144: 150W 15el,06/02 +OE4KLU,JN87KS,,,Karl,,,01/96 +OE5EFM,JN78,EME,,wolfgang,,,1994 +OE5EYM,JN68SK,EME,,,,,08/98 +OE5FD,JN68SC,,,,,,2003 +OE5FDM,JN68SC,,,Daniel,,50: FT-847 5el-Yagi 100W - 144: FT-847 9el 10,08/02 +OE5JFL,JN68RL,EME,,hannes,,,1994 +OE5KE,JN78,,,Adolf,,,05/02 +OE5MPL,JN78CJ,EME,,Peter,,FT-847 - 50: 2xGI7BT 100W 5el 144: 2x,01/05 +OE5VHL,JN68SI,EME,,walter,,,1994 +OE5VRL,JN78DK,,,,,,01/97 +OE6AHD,JN76RS,,,Freddy,,,12/95 +OE6BMG,JN77JE,,,Manfred,,,07/00 +OE6IWG,JN77PK,EME,,A.Walter ""Walt",,144: GS35b 4x10el (2-2wl) MGF1302087 4000 D,01/05 +OE6JGD,JN77QC,,,Josef,,,12/95 +OE6KDG,JN77JF,,,,,,03/07 +OE6NLD,JN76SS,,,norbert,,,1993 +OE6XHF,JN76RS,EME,,clubstation,,,1994 +OE75SOW,JN88FF,EME,,Othmar,,50: IC736 100W 5el - 144: IC821H 300W 2x13el,03/01 +OE8CIQ,JN76FU,,,,,,08/02 +OE8HBQ,JN76KP,,,Harry,,,05/04 +OE8HWQ,JN76,,,helmut,,,03/00 +OE8OLK,JN76DM,,,Schoash,,144: FT817 30W 6el,07/04 +OE9ERC,JN47VL,EME,,Erich,,,02/05 +OE9HHV,JN47,EME,,hubert,,,1994 +OE9XXI,JN47UL,,,,,,2003 +OF8UV,KP34VJ,EME,,Markku,,144: Ft225RD 130W 2x14el BF981.122 DTR,11/97 +OG6MAZ,KP21IG,,,Hannu,,144: FT767GX 4CX350 200W 15el.147 DTR,01/00 +OG8HDL,KP34VJ,,,Tanja,,144: 130W 2x14el BF981.121.300,01/00 +OG8UV,KP34VJ,EME,,Markku,,144: FT225RD 130W 2x14el BF981.121 DTR.30,01/00 +OH0BT,KO09KW,,,,,,1992 +OH0JFB,JP90XI,,,Peter,,144: 2x17el 800W,04/04 +OH0LIZ,KO09KW,,,OP OH5YW- OH5LIZ,,144: 180W 2x23el.127 1500lpm DTR,05/98 +OH0N,KP00,,,OP: DK5DQ DJ2QV...,,,07/01 +OH0V,KP00,,,OP: DK5DQ DJ2QV...,,,07/01 +OH1AK,KP01TE,,,OP: OH1HJN,,,12/03 +OH1AYQ,KP12JB,,,,,,08/98 +OH1BAP,KP12AA,,,,,,1991 +OH1CF,KP00TC,,,,,,1994 +OH1FA,KP10PL,EME,,Kai,,,10/02 +OH1HSC,KP10CM,,,Olavi,,144: TR9130 60W MGF1302 17elonly SSB MS,01/01 +OH1JCS,KP10AE,EME,,Jojje,,144: 15el 20W,01/05 +OH1JJC,KP10DK,,,Matti,,,01/04 +OH1LEU,KP01UE,,,Tuomo,,50: 150W 8el,09/03 +OH1LSQ,KP03SD,,,Paul,,144: 100W ant-3WL,01/02 +OH1MDR,KP01VJ,,,Timo,,144: IC-706 100W 15el,01/04 +OH1QC,KP10MU,,,,,,1989 +OH1XT,KP01UK,,,Jari,,FT736r 50: 8el 150W - 144: 300W 2x15el MG,11/01 +OH1XTK,KP01UK,,,,,,2003 +OH1ZAA,KP01,,,jan,,,1995 +OH2AUK,KO19TX,,,jan anders,,,1994 +OH2AV,KP20JD,,,yussi,,,1994 +OH2AXH,KP20OK,EME,,OP: OH2AUE,,,08/00 +OH2BAP,KP20PP,EME,,jyrki,,.138,1993 +OH2BNH,KP20LG,EME,,Pasi,,,05/00 +OH2BYJ,KP20MG,,,Jari,,144: IC821h 4x15el3000lpm,07/00 +OH2DG,KP30CK,EME,,eino,,,1994 +OH2JRR,KP10WE,,,,,,10/03 +OH2KKP,KP20MH,,,Tuomas,,,11/95 +OH2LAK,KP10XL,,,Erik,,50: FT847 FT817.130,11/01 +OH2MFE,KP20JE,,,Markus,,IC-575H IC-275E 170W FT-817 100W FT-73,04/02 +OH2MOH,KP30CR,,,,,,05/04 +OH2MPH,KP20KD,,,Antti,,,01/04 +OH2NHP,KP20IF,,,Timo,,144: IC970E 3CX800 MGF1302 preamp 2x15elrx,01/01 +OH2NY,KP20CM,,,Juha,,144: IC202 RE035XB 320W Preamp 4x9el,04/03 +OH2PO,KP10XH,EME,,Matti,,,11/97 +OH2TI,KP20KE,EME,,Clubstation,,,01/01 +OH2Z,KP30CR,,,OP: OH1JJC,,,08/04 +OH3AWW,KP11VJ,EME,,Matti,,144: 150W 9el.137 2000lpm,09/04 +OH3BHL,KP10RR,,,Raimo ""Rami",,IC746+ACOM1000 144: 100W 4x5el - 50: 200W,08/03 +OH3BZY,KP10XP,,,,,,1992 +OH3EX,KP20JR,,,,,,1994 +OH3KLJ,KP21PI,,,Mika,,144: 15el 100WMSDSP,01/04 +OH3KLT,KP21PI,,,,,,12/01 +OH3LPW,KP11WK,EME,,ari,,,1994 +OH3NWQ,KP11WL,,,Vesa,,50: FT847 100W220 2000lpm,08/02 +OH3VJ,KP21,,,,,,1994 +OH3XR,KP11TH,,,Marko,,IC746,08/04 +OH4EA,KP32MG,,,Vesa,,144: FT225RD 4CX250b 2x19el MGF1302/ATF10136M,11/04 +OH4GGW,KP31PQ,,,Kimmo,,,12/04 +OH4HXK,KP21UM,,,Seppo,,,05/02 +OH5A,KP53NE,,,OP OH5LZY,,,09/99 +OH5AG,KP31,,,,,,02/98 +OH5HCJ,KP41EC,,,Matti,,,11/04 +OH5IY,KP30HV,EME,,Ilkka,,144: 1KW 4x15el - 432: 750W 8x21elDTR+ 3000l,12/03 +OH5KJQ,KP41JC,,,Matti,,FT847 144: 19el yagi 160W - 50: 4el 100WDTR,10/98 +OH5LID,KP41KL,,,Janne,,144: IC706 150W 2x19el120 2000 DTR.300,04/02 +OH5LIZ,KP30HW,,,OP OH5YW,,144: 180W- 2x23el.127 DTR,08/01 +OH5LK,KP30ON,EME,,Jussi,,144: 1KW 4x15el,04/04 +OH5YW,KP30FU,,,Kari,,,05/98 +OH6AA,KP03TC,,,Club OP OH6GDX,,144: 2x12el,06/03 +OH6AAO,KP14,,,,,,1993 +OH6AI,KP13MW,,,Clubstation,,only SSB-MS,11/00 +OH6AW,KP03,,,,,3000lpm,06/02 +OH6DD,KP22,EME,,jukka,,,1994 +OH6GDX,KP02QU,,,Patrik,,144: 60W 2x12el CueDee,08/03 +OH6HFX,KP14RA,,,Johannes,,FT847 400W 2x12el172224,02/03 +OH6JKW,KP02RN,,,Kurt,,FT847,01/05 +OH6JW,KP12AJ,EME,,Aulis,,FT847 IC7400 600WMSDSP DTR,09/03 +OH6KTL,KP02OJ,,,Lasse,,50: 6el 150W - 144: FT847+GI46B 4x15el 100WM,12/04 +OH6LRL,KP13,,,,,only SSB-MS,11/00 +OH6M,KP12KR,,,,,,06/04 +OH6MAZ,KP21IG,EME,,Hannu,,144: FT847 4CX350 250W 2x15el MGF1302155 3000,12/04 +OH6MPC,KP12AJ,,,Aulis,,FT847 50: 200W - 144: 2KW - 432: 250W4000lpm,01/02 +OH6MRD,KP12EP,,,,,,12/02 +OH6MSZ,KP21XU,,,,,,08/99 +OH6NDD,KP23VH,,,Taavi,,,1994 +OH6NVQ,KP13IP,EME,,tomas,,,01/97 +OH6PA,KP02PL,,,Ben,,,08/04 +OH6QU,KP03SD,,,Jari,,RX: FT-1000MP DB6NT transverter TR 144 H pre,07/04 +OH6UW,KP22WH,,,,,,01/05 +OH6XX,KP22VE,,,Juha,,144: FT1000MP LT2S 120W 15el MGF1302.147,11/01 +OH6YF,KP02VL,,,Harry,,50: FT-847 PA 7el - 144: FT-847 PA 4x12el300,03/04 +OH6ZZ,KP12BO,EME,,Juho ""Jussi",,TS790E,02/04 +OH7AXB,KP32WM,,,,,,11/02 +OH7EU,KP33MQ,,,Jorma,,,95 +OH7HXH,KP53HG,,,Kari,,144: 50W,04/04 +OH7LIX,KP43JQ,,,Raija,,only SSB-MS,09/95 +OH7MA,KP52EL,,,Dan,,144: 4 x 10el1000lpm,11/99 +OH7PI,KP32XG,EME,,Toivo,,,01/05 +OH7RJ,KP32TV,,,Pena,,,08/02 +OH7TE,KP20IE,,,Juhani ""Yussi",,50: 200W - 144: 4el 300W - 1296: 10W - 5600:,12/04 +OH7TX,KP32TR,,,Jorma,,144: FT847 50W 20el365,04/04 +OH7UV,KP33MQ,,,Markku,,.121 DTR.300,07/95 +OH8GEJ,KP25QC,,,,,,05/02 +OH8HDL,KP34VJ,,,Tanja,,144: 130W 2x14el BF981.121.300,08/99 +OH8K,KP44HE,EME,,Sotkamo Clubstation,,IC7400 gd power 15el 16el 37el loop147 50,05/04 +OH8LRB,KP24HQ,,,Tomi,,144: 200W 8el,11/04 +OH8MFH,KP34UG,,,Kari,,144: TR751A 15el 6WUonly SSB-MS,01/00 +OH8N,KP34VJ,,,OP DH3YAK- 8UV- 8HDL,,,12/98 +OH8NW,KP24SX,,,Kaar,,,1985 +OH8NXE,KP25SB,,,Antti,,144: TM255E Preamp 160W 2x14el,01/02 +OH8SW,KP22UP,,,Hannu,,,11/04 +OH8UV,KP34VJ,EME,,Markku,,144: FT225RD 350W 4CX250R 2x14el BF981121,12/03 +OH8VJ,KP22UN,,,Pentti,,,11/04 +OH9AB,KP46BI,,,Clubstation,,,1994 +OH9AEM,KN08AJ,,,,,,1993 +OH9MNO,KP46BI,,,,,,1991 +OH9MTE,KP46BI,,,Yussi,,,07/99 +OH9MTY,KP46BI,,,Erkki,,FT847 - 144: 700W 6x9el136 3000lpm MSDSP,06/04 +OH9NDD,KP26UM,,,Taavi,,FT847 144: 150W 4x15el preamp,08/03 +OH9NMS,KP36GA,EME,,,,,1994 +OH9O,KP12BO,EME,,Sotkamo Clubstation,,IC7400 gd power 15el 16el 37el loop147 50,05/04 +OH9SCL,KP46BI,EME,,Clubstation,,TR751/FT847 144: 6x9el LY 700W.136,06/01 +OI7UV,KP33MQ,,,Markku,,,12/95 +OI8UV,KP34VJ,EME,,Markku,,144: Ft225RD 130W 2x14el BF981.122 DTR,01/97 +OK1AXH,JO70UR,,,,,,01/97 +OK1CA,JO70GM,EME,,f.,,,1994 +OK1CDJ,JO70VA,,,Ondrej ""Ondra",,144: 250W 17el MGF1302.115 4000lpm.300,01/00 +OK1CT,JN69TR,,,Milos,,144: 250W 2x16el CF300 - 50: 20W 5el.139,05/00 +OK1DCF,JO80BJ,,,Lada,,,04/02 +OK1DDO,JO60JD,,,Jirka ""Jiri",,IC706- 144: 150W 7el- 50: 100W 5el1000lpm,06/02 +OK1DFC,JN79GW,EME,,Zdenek ""Zdeno",,144: 750W 18elM2 10m dish - 432: 750W 38elM2,01/05 +OK1DIG,JO60XJ,EME,,Daniel ""Dan",,144: 4x17el M2 GS35 1.5KW MGF1302177377,04/02 +OK1DKZ,JN69XP,,,Vlada,,144: IC275H 100W MGF1302 11el4000lpm MSDSP,11/01 +OK1DQA,JO60TC,,,,,,08/99 +OK1DRY,JN79OW,,,,,,07/02 +OK1DTC,JO60TO,,,Tony,,,08/03 +OK1DUO,JO80CA,,,Jaroslav ""Jarda",,HF: TS120S 500W 3el - 144: IC746 PA0MS ant,08/01 +OK1FAV,JO60CK,,,,,,01/97 +OK1FF,JN78GR,EME,,,,,1995 +OK1FFD,JO60CF,,,Vasek,,50: 5el QUAD- 144: 350W 10el Quagi,08/02 +OK1FID,JO80CH,,,Jiri,,144: Racom R2-CW 100Watts 13ele DL6WU050.30,08/01 +OK1FM,JN69QQ,,,Milan,,144: 250W 17el MGF1302DTR 3000lpm,11/02 +OK1FXX,JO70WL,,,Beda,,144: TS790E 2xGI7B 3KW 4x17el F9FT 0-4db NF -, +OK1FZA,JO70FC,,,,,,1992 +OK1HAG,JN79,,,,,,01/97 +OK1IBL,JO60CG,,,,,,1991 +OK1KEI,JO60JL,,,,,,01/97 +OK1KF,JO60TG,EME,,Vaclav,,TS790 FT847 144: 1KW 2x17el M2 or 4xKLM16LBX.,08/02 +OK1KHI,JO70ED,,,S.,,,05/02 +OK1KIR,JN79,EME,,clubstation,,,1994 +OK1KJB,JN79IO,,,Clubstation,,,08/99 +OK1KKH,JN79,,,,,,1993 +OK1KRQ,JN69QR,EME,,OP OK1MZM- OK1XST,,144: 400W 17el M2 CF300,10/99 +OK1KRY,JN69TR,,,Clubstation Rokycany,,50: 20W 5el - 144: 250W 2x16el CF300.139,05/00 +OK1KT,JO70WE,,,Vrata,,FT 847 - 50: 20W 5 el - 144: 600 W 15 el Cu,06/04 +OK1MAC,JN79IO,,,Jan,,,01/03 +OK1MDK,JN79PX,,,J.,,,08/02 +OK1MZM,JN69PR,,,Milos,,144: 300W 9el 360m asl,06/04 +OK1NH,JN69UH,,,,,144: 10el 20W,05/04 +OK1TEH,JO70FD,,,Matej,,144: FT847 100W 6el - 432: 50W 22el K1FO,11/04 +OK1UAK,JO70MB,,,Petr,,144: 100W 10el preamp160 4000 MSDSP.160,01/05 +OK1UGA,JO80DD,,,Clubstation,,IC821H 144: 100W 7el Quad - 432: DJ9BV Ant,12/03 +OK1UND,JO60XA,EME,,Petr,,TS515 FT221 144: 16el 100W Preamp,11/04 +OK1UWA,JN69QT,EME,,Josef,,1296: par 2.4m 180W 0-45db NF,08/00 +OK1VBN,JN78,,,,,,01/97 +OK1VEI,JO70UR,,,,,,01/97 +OK1VHF,JO70EB,,,Miloslav ""Milan",,144: 10ml M2 1200W - 432: 6m Tonna 600W - 129,01/04 +OK1VHH,JO70CK,,,,,144: 20W,04/02 +OK1VKC,JN79OW,,,Josef,,,05/02 +OK1VSC,JN79OW,,,Josef,,144: 100W 7el Quad,03/02 +OK1VT,JN79IX,,,,,,07/01 +OK1WCF,JO80BJ,,,Martin,,144: R2CW PA 100W 2x 16el F9FT300 / 370,04/04 +OK1WN,JN69LK,,,Standa,,144: 100W 16el CF300,10/01 +OK1XXT,JO70GA,,,Roman,,,04/02 +OK1YA,JN79IO,,,Premysl ""Mek",,144: 1000Watt 4x13ele4000lpm,10/01 +OK1YK,JN78GX,EME,,Jaromir ""Mira",,FT 847 144: 1kW 13el MGF1302 - 432: 1kW 5m,12/04 +OK2AB,JN89TI,,,,,,12/03 +OK2BON,JO70,,,,,,07/02 +OK2BRD,JN99ET,,,Jirka,,IC706MKIIG,08/03 +OK2BXE,JN89SJ,,,Draho,,144: FT847 100W 16el MGF1302 - 10368: 1.5W Di,07/01 +OK2DL,JN89AO,EME,,Mark,,,06/02 +OK2KET,JN89JN,,,,,,03/01 +OK2KUB,JN89,,,,,,1993 +OK2KZR,JN89BO,EME,,rudi,,,1993 +OK2MWR,JN99HQ,,,Alex,,144: IC706 100W 14el PBM1200lpm,08/00 +OK2PM,JN99AO,,,Karel,,IC706 FT736,08/03 +OK2PMG,JN89SJ,,,Milos,,144: FT847 100W 16el MGF1302 - 10368: 1.5W Di,07/01 +OK2PMS,JN89WW,,,Jirka,,BMT226 13el F9FT,01/03 +OK2PMX,JN88IW,,,Petr,,IC706,04/04 +OK2POI,JN99bl,EME,, +OK2PTC,JN89MM,,,,,,08/04 +OK2PWY,JN89IW,,,,,,11/04 +OK2PZW,JN89HI,,,,,,2003 +OK2QI,JO80OC,,,,,,1995 +OK2SBL,JN99HQ,,,Josef,,1200lpm,08/00 +OK2SGY,JN89SS,,,,,,08/96 +OK2SLC,JN89ED,,,Slavek,,,03/04 +OK2UGG,JN89EN,,,Jirka,,,12/01 +OK2VMD,JN89HI,,,,,,1994 +OK2WO,JN89IH,,,,,,04/04 +OK2XPJ,JN89,,,,,,04/02 +OK2YT,JN88IW,,,Radek,,,04/04 +OK2ZAW,JN89BI,EME,,Jan,,,08/04 +OK2ZW,JN89HI,,,Zdeno,,,08/02 +OK2ZZ,JN89DF,,,Rudi,,,08/96 +OK5ACR,JO60NX,,,Vita,,,05/00 +OK8BXF,JO70VA,,,Gavin,,,06/04 +OL2O,JN79IO,,,,,4000lpm,12/01 +OL5MS,JN69MJ,,,,,,08/99 +OM2TW,JN88UG,,,Richard,,144: IC746 17el LY.050.300,07/01 +OM3AU,KN08OR,,,Andrej,,,1993 +OM3KDX,KN19DB,,,,,144: IC-746 GS35b 4x6 el. 18el. M2 - 10368,06/04 +OM3KMY,JN88MK,,,Clubstation,,,1994 +OM3LQ,JN88MK,,,palo,,,08/01 +OM3TZZ,JN88,,,,,,08/02 +OM3WBC,JN98VG,,,Joe,,,08/02 +OM4EX,JN98HS,,,,,,07/04 +OM5CM,JN98DF,,,Palo,,IC-910H 144 MHz: 100W 9el - 432 MHz: 70W 18e,04/04 +OM5KM,JN98AH,,,Milan,,only SSB-MS,01/02 +OM5UM,JN98EO,,,,,,04/02 +OM7AC,JN98NN,,,Igor,,FT225RD FT780 Transverter home made 145/28,01/03 +OM7AQ,JN98UI,EME,,Zoltan (Zoli),,144: FT290r 450W 13el F9FT MGF1302 - 432:,08/03 +OM7CM,JN98NR,,,Milan,,,08/04 +OM7JG,JN98TI,,,Julo,,,01/02 +OM9AAW,JN98EP,,,DF8AA,,,07/95 +OM9M,KN18AM,,,OP: OM7AQ- OK1CDJ...,,,08/99 +ON1AEN,JO10UV,,,,,,2003 +ON1AFN,JO20SW,,,Filip,,144: FT290r 150W,09/98 +ON1ALJ,JO10SS,,,Jo,,144: TS790E 3CX800 MGF1302 10el 9BV - 432:,11/01 +ON1DDC,JO21UD,,,,,144: 16el 800W1000lpm,08/97 +ON1DSQ,JO21KH,,,Dave,,144: TS700G 50W 8el Quad Preamp.300,04/03 +ON1RR,JO11XA,,,Frank,,FT100.150,09/01 +ON2MRT,JO21MB,,,Thierry,,,07/03 +ON4ADC,JO21FA,,,Marc,,,09/03 +ON4AMX,JO20KV,,,Marc,,144: FT736r 17el 3CX800 BF981DTR 6000lpm,07/01 +ON4ARF,JO10MV,,,,,,05/02 +ON4ASL,JO21,,,Luc,,,1994 +ON4AVJ,JO11UB,,,Jacques,,144: IC275HE 3CX800A7 17el MGF1302165 2000,10/04 +ON4BBD,JO21NA,,,Marc,,FT736 TS440S,01/04 +ON4BG,JO10WM,,,,,,12/01 +ON4CHP,JO21JD,,,Willy,,144: 150W B5016G 11el FX224 SP2000,07/00 +ON4CJU,JO20,,,,,,11/01 +ON4DPX,JO10NT,EME,,Kenny,,FT736 FT847 144: 14el DK7ZB - 432: 2x 26el,09/03 +ON4FI,JO20IV,,,Karel,,144: 3CX800 600W 13el MGF13026000lpm DTR + MS,12/99 +ON4GG,JO20AR,EME,,Geert,,50: 9el mgf13025000lpm MSDSP,08/04 +ON4IMM,JO11UB,,,Dirk,,144: TS440S + LT2S MK2 Preamp PA3BIY design,09/03 +ON4IQ,JO20AR,EME,,Johan,,50: FT1000 TRSV 4x9el 200W MGF1302 - 144:,01/05 +ON4KHG,JO10XO,,,Gaetan,,144: TS440 300W 11el MGF1302 - 1296: 10W 35 e,03/04 +ON4KNG,JO20DU,EME,,Peter,,,01/04 +ON4KST,JO20HI,,,Alain,,,05/04 +ON4LDP,JO10UM,,,Oliver,,50: HM tsvter 2m/6m 30W GP - 144: 150W 13el M,06/02 +ON4LN,JO20IV,,,Eric,,144: TS711E GS35b 7ele M2 MGF1302155 2000l,11/04 +ON4LUC,JO20TM,EME,,Luc,,144: ft1000mp transverter 800w hf max ampli,01/04 +ON4MU,JO20SS,EME,,Denis,,Ft847 150W 0.5dB 3wl,08/03 +ON4PS,JO20KQ,,,Pierre,,144: 400W 9elonly SSB-MS,06/01 +ON4QQ,JO20FS,,,,,,07/95 +ON5AEN,JO10VW,,,Hans,,FT225RD TS770e,01/04 +ON5GS,JO21VD,,,Dirk,,144: IC821 600W 15el,03/02 +ON5LGS,JO10OS,,,Edmond,,only SSB-MS,09/03 +ON5UE,JO11LF,,,Dan,,TS2000DX,01/04 +ON6AB,JO21EC,,,Bruno,,TS930S,03/04 +ON6NL,JO21UE,,,Anton,,144: 120W 13el 6WU088 5000lpm MSDSP288,09/04 +ON6OD,JO20HW,,,franz,,,1993 +ON7CL,JO20JU,,,Rudi,,FT100D 144: FT847 17el high pwr300,09/03 +ON7EH,JO20FV,EME,,michel,,,08/04 +ON7RB,JO11VA,EME,,Roland,,144: 8x13el hor. & 8x12e vert. Full Az/El 1K,11/03 +ON7UC,JO11ND,EME,,Johan,,144: 3CX800A7 2x16el 4.2wlDTR,02/05 +OQ1AEN,JO10VW,,,Hans,,FT225RD TS770E,11/01 +OX2K,GP47TA,EME,,,,144: 4x5wl - 432: 4x28el - 1296: 32m dish,05/00 +OY4TN,IP62NB,,,Trygvi,,,05/04 +OY9JD,IP62OA,,,Jon,,,01/04 +OZ0JX,JO54VU,,,Soeren,,IC761 IC756 50: 5el F9FT,01/03 +OZ1ALS,JO44WX,,,OP OZ1DSK,,144: 2x9el 1KW2500lpm,04/02 +OZ1CDE,JO65CO,,,Jan,,50: FT847 6el 850W,02/02 +OZ1CLL,JO65GQ,,,John,,,08/96 +OZ1CTZ,JO46OE,,,,,,01/02 +OZ1DJJ,JO65GP,,,,,,12/04 +OZ1DPR,JO45IG,,,Bernd ""Ben",,50: Yaesu FT-920 GS35b 1000W 5el,08/03 +OZ1FDH,JO65CS,,,Claus,,1200lpm,07/99 +OZ1FF,JO45BO,,,Kjeld,,432: 200W 2x23el LNA435 - 1296: 40W 2x44el SP,04/04 +OZ1FTU,JO55WW,,,Soeren,,,1993 +OZ1GEH,JO65AL,EME,,peter,,,1993 +OZ1HNE,JO57,EME,,Jorgen,,144: 4x18el crossyagi 8877.022,06/99 +OZ1HTB,JO75,,,Bent,,,11/96 +OZ1IEP,JO55XU,EME,,Carl Jan,,50: 100W 6el - 144: FT736 1KW 2x11el - 432:,01/05 +OZ1IPU,JO57JH,,,J.,,,1993 +OZ1JVX,JO46DS,,,A.,,,01/96 +OZ1LPR,JO44UW,EME,,Peter,,144: FT101ZD LT2MK2 YL1050 ampl 1KW 13el MG,01705 +OZ1PIF,JO65AN,EME,,Peter,,FT847 50: 100W 4el - 144: 350W 13el Preamp150,08/04 +OZ2EEZ,JO45,,,,,,2003 +OZ2ELA,JO65,,,Michael,,,01/97 +OZ2M,JO65FR,,,Bo,,50: HB9CV 100W 70: 25W 5el 144: 15el 1 k,08/04 +OZ2TF,JO46PE,EME,,Ole,,144: IC271h 750W 4x9el Preamp,10/02 +OZ3K,JO45TL,,,Erik,,TS2000,08/02 +OZ3TT,JO66CB,EME,,Bent,,144: ICOM 275H Amp. CS31 M2 18 el MGF1303,12/04 +OZ4MM,JO55GH,EME,,Stig,,10m dish,10/02 +OZ4VV,JO46QU,,,Finn,,50:1000w 9el - 144:1000 Watt 15el MGF1302,03/04 +OZ5AGJ,JO56DG,,,Benny,,144: ICOM 100w 7Elem on 144,01/04 +OZ5QF,JO45VB,,,Jens,,,10/95 +OZ6ABA,JO57DJ,,,Leif,,144: FT736r Mutek Preamp 1KW 15el DJ9BVMS,08/03 +OZ6EI,JO45TT,,,,,,08/01 +OZ6OL,JO65DJ,,,,,,09/01 +OZ6OM,JO55EJ,,,Bjørn ""Matt",,,11/04 +OZ7LE,JO45,,,Hans-Juergen,,144: 9el 400WDTR 4000lpm,03/01 +OZ7U,JO45RL,,,Birger,,TS940S FT847,03/03 +OZ7Z,JO45WA,,,Allan,,144: FT847 1KW 2x9el Yagi,09/01 +OZ8FR,JO55SK,EME,,,,,01/05 +OZ8ZS,JO55RT,EME,,Henrik,,144: IC706 GS31b 1KW 4x8el,08/04 +OZ9AAR,JO45TS,EME,,Carsten,,8x15el Crossyagis- 1KW,12/99 +OZ9FW,JO65CO,,,Frede,,,09/03 +PA0AVS,JO22,EME,,a.n.,,,1994 +PA0BAT,JO31FX,EME,,Gerard,,,01/03 +PA0C,JO22FD,EME,,Henk,,Ft 847 QBL 5/3500 0.4 dB NF 2x 17 el,01/05 +PA0HIP,JO21JO,,,willem,,,1993 +PA0JMV,JO21PM,EME,,Joop,,144: 2x16 el 2x 3CX800A7 0.18dB NF,02/05 +PA0LPE,JO20WW,,,Bert L.,,50: FT847 7el - 144: IC202 400W 2x11el,01/01 +PA0O,JO33HG,,,Jaap,,,08/03 +PA0PVW,JO22VA,,,Peter,,144: 18el M2 3CX800,07/02 +PA0RDY,JO22KJ,,,Robert,,144: 500W 15el MGF1302DTR 3000lpm,10/99 +PA0RLS,JO22,,,R.L.,,,1993 +PA0V,JO33II,EME,,Nanko,,144: 6 x DJ9BV 4 WL Xpol 8 BLF278 Mos fet PA,09/03 +PA0WWM,JO22FE,,,Wim,,144: 160W 9el MGF1302,04/01 +PA0ZN,DM04,,,,,,01/05 +PA1BVM,JO21RI,,,Rick,,50: IC202 Transv. dipol - 144: FT-225 IC 746,05/03 +PA1GYS,JO22WW,EME,,,,144: TS850 LT2S 2 x 2M5WL,01/04 +PA1LA,JO32LS,,,Roel,,144: TS700 16el 60W,01/05 +PA1T,JO33JF,EME,,Timon K.,,144: TS850 LT2S 400W 8877 4x17el M2- 50: 1y.,08/03 +PA2CHR,JO22XA,EME,,Chris,,144: 400W 4x28el Xpol - 432: 400W 2x35el.142,01/05 +PA2DW,JO22GD,EME,,Dick W.,,144: TenTec Trvt 400W(2x4CX250b) 10el.082,09/04 +PA2GER,JO21EW,EME,,Ger,,,09/99 +PA2KW,JO22SB,,,Evert,,144: 1x16el KLM 1.2KW MGF1302,10/04 +PA2M,JO21IP,,,Frank,,FT847 144: 2x blf278 9el 432: 16 el,11/04 +PA2TAB,JO32GF,,,,,,01/05 +PA2V,JO22IM,EME,,Peter,,,08/03 +PA3BAS,JO21PG,,,,,,01/05 +PA3BGM,JO33CE,,,,,,08/99 +PA3BIY,JO22EB,,,Peter,,144: 400W 2x9el,03/02 +PA3BXH,JO22WW,,,,,,01/05 +PA3BZL,JO22SB,,,,,,01/05 +PA3BZO,JO21RS,EME,,Piet,,,08/03 +PA3C,JO33FD,,,Aart,,,08/04 +PA3CEE,JO33JI,EME,,Eltje,,144: 600W 2x16el MGF1302165375,01/05 +PA3CMC,JO21WI,EME,,Lins,,,07/04 +PA3CMG,JO21IV,,,,,,01/05 +PA3COB,JO32MF,EME,,Harry,,144: 15el QD 3CX8003000lpm,03/04 +PA3CSG,JO21WD,EME,,Geert,,,08/04 +PA3CWI,JO11TK,EME,,Kees,,144: FT736 6x12 el M2 MGF1302 8877,08/03 +PA3DOL,JO22MT,,,Sjoerd,,144: 400W 17el4000lpm,09/03 +PA3DRL,JO21PS,,,,,144: 30W 10el,04/04 +PA3DUU,JO21IU,,,arie,,,1993 +PA3DYS,JO21JP,,,,,,01/05 +PA3DZL,JO21HM,EME,,Jac,,144: 4x17el 3.6ld MGF1302 EME Pwr - 432: 2x2,01/05 +PA3ECU,JO32CF,,,Rudy,,50: FT726R 5el 175W - 144: FT847 17el 400W -,12/04 +PA3EON,JO21,,,c.,,,1993 +PA3EPX,JO22RC,,,peter,,,1993 +PA3EQS,JO22TI,,,kees,,,1993 +PA3FBN,JO33IF,,,,,,01/05 +PA3FJY,JO32EH,,,,,,01/05 +PA3FOC,JO21FW,EME,,Rene,,144: TenTec Paragon LT2S 17el (2x17el) PA,06/03 +PA3FPQ,JO22XE,EME,,Johan,,FT100 500W single yagi,08/04 +PA3FSA,JO23RF,,,,,,08/01 +PA3FVE,JO21WG,,,wim,,,1993 +PA3FXW,JO22QD,,,robert,,,1993 +PA3FYF,JO22DB,,,peter,,,1993 +PA3GBR,JO32LH,,,johan,,,1993 +PA3GVC,JO22MU,,,Norbert,,,12/04 +PA3HJG,JO32BG,,,Pascal,,TS2000 50: Dipol - 144: 13el1300lpm,08/03 +PA4VHF,JO32EH,EME,,Dick,,50: 100W 5el - 144: TS850 LT2S 400W 2x16el,04/01 +PA5DD,JO22IC,,,Uffe,,144: GS35b 15ele CUE DEE,01/05 +PA5KM,JO11WL,,,Coen,,144: TS790E 9el 400W,05/04 +PA5M,JO21BS,,,Michael,,,08/03 +PA5MS,JO21QJ,EME,,John,,144: 11el GS35b 400W MGF1302132 4000 DTR,11/02 +PA60SHB,JO21OS,,,OP: PE1AHX,,,12/04 +PA6BN,JO13OF,,,OP: BIY- BZL- FOC,,,07/98 +PA6MS,JO32QF,,,OP PA2TAB- PA3FJY,,DTR,10/96 +PA6T,JO32GF,,,OP PA2TAB Arie,,DTR 3000lpm,12/98 +PA7AL,JO23VG,,,,,,12/04 +PA7C,JO32GF,,,Arie,,50: 100W 6el - 144: R2CW GS31b 400W 14el MGF1,09/03 +PA7FE,JO22OC,,,Frank,,50: 6el leg pwr,03/99 +PA7FM,JO21,,,Dennis,,,08/00 +PA7PYR,JO21UQ,,,Rien,,TS450SAT HF: FB33 - 144: 25W 2x17el Tonna -,09/03 +PA7RP,JO22EC,,,Ruud,,144: 13el 400W GS35B,07/04 +PA7WM,JO23TA,,,l.,,,03/99 +PA9RX,JO32MT,,,Theo,,144: FT847 4x17el 200W370,08/02 +PB0ALS,JO21RV,,,tjeerd,,,1993 +PB1TT,JO22FF,,,Peter,,144: 100W 10el CueDee2000lpm DTR,09/01 +PD0ANQ,JO31EW,,,Wilfred,,,11/01 +PD0HCV,JO31FW,,,Gert,,IC821 144: 15el M2 432: 18el M2,11/04 +PD0ORT,JO23RE,,,Willem,,,04/04 +PD0PYR,JO21UQ,,,,,,01/05 +PD0RFU,JO32LS,,,Rene,,144: FT225RD 2x19el Cushcraft - 432: TS811E,08/04 +PD1AIQ,JO22RM,,,Jan,,144: 25W 4x9el,04/03 +PD1ALD,JO32FI,,,Rene,,Yaesu FT897- Kenwood TR9130- Yaesu FT817,06/03 +PD2GCM,JO21ET,,,Gerard,,FT847,11/04 +PD2VDV,JO23RF,,,,,,08/04 +PE1AHX,JO21OS,,,Catharinus,,DTR +,10/03 +PE1BVM,JO21RI,,,,,,01/05 +PE1DCD,JO21FU,,,,,,05/03 +PE1GBT,JO33BC,,,,,,01/05 +PE1GNP,JO31IX,,,,,,05/03 +PE1GUR,JO22TH,,,,,,06/03 +PE1HWO,JO21GV,,,Andre,,144: FT101ZD + TRV 4CX250b 400Watt 17el MGF1,12/03 +PE1IKX,JO11TL,,,Marco,,144: 300W 15el Quedee,03/04 +PE1ITR,JO21QK,EME,,Rob,,144: 100W 2x10el 3SK97 432: 60W 2x 28el GS,01/05 +PE1L,JO23WF,EME,,Rene,,144: 400W 4yagis DJ9BVDTR,12/04 +PE1LCH,JO23WF,,,,,,01/05 +PE1LWT,JO22VA,EME,,Jurgen,,144: 800W 2x3wl-Xpol,08/03 +PE1M,JO23XE,,,Kees,,,08/03 +PE1MVJ,JO21FV,,,jJ,,,11/96 +PE1OGF,JO21QJ,,,,,,01/05 +PE1OPK,JO23UE,,,Bram,,IC821,09/03 +PE1PQX,JO32LS,,,Andre,,,07/04 +PE1RBG,JO21,,,,,,11/01 +PE1RLF,JO32CG,,,Eric,,144: TS850 LT2S 4CX250F 10el370,01/04 +PE1RWS,JO32BM,,,,,,01/05 +PE2KP,JO22XE,,,Adriaan,,144: 6el Quad 50W.144 2000 lpm.350,01/01 +PE2PE,JO21LU,,,Freek,,144: 400W 15el Quedee,11/03 +PE2RMI,JO23MH,,,Eddy,,,01/02 +PE2SVN,JO21WR,EME,,Sjoerd,,FT1000 LT2s 3CX800 400W 10el,11/04 +PE9DX,JO33MD,,,Johan,,144: TS711 400W 17el SP2,07/04 +PE9GG,JO33NA,,,,,only SSB-MS,11/00 +PE9HNE,JO22FB,EME,,Hans,,TS711,09/03 +PI4NYV,JO32EH,,,Clubstation,,144: 400W 9el or 17el (/p JO32FI),12/96 +PP2KR,GH53IG,EME,,Kleibe,,TR9130,02/05 +PT9FH,GH11EA,EME,,Tony,,144: 4x12el 2x4CX250,04/00 +PY1EPU,GG88PO,EME,,Franco,,144: 4x 16el 160W FT 1000 Mark V Field + Tran,02/05 +PY1IAM,GG87,EME,,LUIZ ALBERTO,,,04/04 +PY1RO,GG87LB,EME,,Rolf,,IC706MKIIg 1000W 8 over 8 el,08/03 +PY2CLL,GG66RF,EME,,Marcus,,144: Kachina 505DSP Trvt 4x18el M2 LNA 300W,01/00 +PY2NI,GG66RK,EME,,Horta,,.100.220,07/01 +PY2PD,GG66RF,EME,,Jose Carlos,,MP1000- LT2S- 4xM2XP28- 3CX800 0-4db,03/99 +PY2PLL,GG66RF,EME,,Marcus,,144: 750W 16el or 2x15el - TS790A xverters,03/01 +PY2SRB,GG48bc,EME,, +PY3CRX,GG66RF,,,Marcus,,144: 750W 16el or 2x15el,08/00 +PY4EPU,GG88PO,EME,,LUIZ ALBERTO,,YAGI FULL SIZE FOR 14 21 28 50 144 220,09/03 +PY5ZBU,GG54,EME,,,,,2000 +R1MVA,KP40GP,EME,,OP RU1AA- OH5LZY ...,,144: 150W,07/99 +R1MVZ,KP40GP,EME,,OP: RU1AA,,144: 4x14el 1.2KW.072,10/99 +R3VHF,LO16XG,,,Clubstation,,.143,01/96 +RA0FCA,QN16IV,EME,,,,,12/04 +RA1ASA,KP50FB,,,,,,1976 +RA1AY,KP50EA,,,Serge,,TS450SAT Icom 706MKiiG,11/04 +RA1QA,KO99WF,,,Alexander ""Alex",,144: 100W 14el 9BV.140 rx1000/2000lpm,05/02 +RA1QAX,LO09CC,,,,,144: IC706 10el PA,10/04 +RA1TC,KO58ON,,,alex,,,1992 +RA1TL,KO67,,,,,,05/04 +RA1TM,KO67PX,,,Alex,,IC746,11/04 +RA1WL,KO47EV,,,Mikhail ""Mischa",,,06/04 +RA1ZC,KP59JK,EME,,Anatoly y.,,IC706MK2 144: 2x10el DJ9BV 1KW2000lpm,11/01 +RA1ZK,KP68MV,,,,,,11/04 +RA3AGS,KO85UU,,,,,,1990 +RA3AQ,KO85SP,EME,,Dmitry,,144: FT736r 250W 13B2,06/04 +RA3DHK,KO95JH,EME,,,,144: FT-736R Toshiba NB 170W 1x2M12MSDSP,01/05 +RA3DQ,KO85US,,,Victor,,144: IC746 100W 16el,09/01 +RA3DQT,KO95HK,,,Vladimir L.,,144: FT-736R Toshiba NB 170W 1x2M12MSDSP,08/02 +RA3DRC,KO95AP,,,Nick,,144: FT-847 50Wtts 17el DJ9BV 9.2 m long200,03/04 +RA3EL,KO82AX,,,Nikolaj,,144: 50W 16el,03/04 +RA3FO,KO86SI,,,Nicolai,,.080,1995 +RA3GES,KO92SO,,,,,,11/04 +RA3IM,KO56UM,,,Leo,,,06/04 +RA3IS,KO76WT,EME,,Sergey G.,,144: 1000W 2x19el SM2CEW 5wl crossyagi142 MS,01/05 +RA3LBK,KO65QA,,,Viktor,,144: 200W 17el1500lpm,01/00 +RA3LE,KO64AR,EME,,Valeri,,,04/01 +RA3LW,KO54MQ,,,Mikhail K. ""Misha",,144: KT931 BF981 2x10el - 432: KT930 KT3101,06/04 +RA3QTT,LO01GQ,,,Nickolaj,,144: GS35 0.5KW 4 x 3.3wl 9BV 0.35db.167,11/03 +RA3TES,LO15WJ,,,Andy,,,11/95 +RA3WDK,KO81BR,,,Ivan,,144: 60W 11el,04/04 +RA3YCR,KO73DH,EME,,viktor,,.090,1994 +RA4AOR,LN29LA,EME,,Yuri,,144: 4x 14elX-Yagi 1-5KW,11/03 +RA4HCN,LO43SL,EME,,Sergey,,,01/05 +RA6AAB,KN94UR,EME,,vladimir,,,1992 +RA6DA,KN96sa,EME,, +RA6HHT,LN05XB,,,nikolaj,,,1992 +RA9FMT,LO87BW,,,vladimir,,,1992 +RA9SO,LO71NS,,,,,,08/96 +RB4EE,KN78WM,,,,,,01/05 +RB5AG,KO60KT,,,,,,01/05 +RB5EU,KN78RI,,,,,,01/05 +RB5GD,KN66HP,,,,,,01/05 +RB5GO,KN66HP,,,,,,01/05 +RB5GZ,KN66HP,,,,,,01/05 +RK1B,KO69AK,,,,,,01/05 +RK1NA,KP71ET,EME,,Konstantin,,144: FT847 100W 14el circular,04/04 +RK2FWA,KO04FT,EME,,Clubstation,,080,04/04 +RK3AF,KO85QR,,,Dmitriy ""Dima",,144: IC746 2xGI7B 450W 16el F9FT177 MSDSP285,12/03 +RK3PWJ,KO83XC,,,OP: 3PF 3PNO,,,05/04 +RK3WWF,KO72QI,,,,,,06/04 +RK9CC,MO06RT,EME,,Stepan,,6x4lb 9BV GS35b,03/04 +RL1P,KO49VW,,,Igor,,144: TR-751 300w 16el DJ9BV,05/03 +RL1X,KO59EW,,,,,,05/03 +RM3T,LO16XG,,,Clubstation,,.143,08/97 +RN3QQ,LO00BK,,,,,144: 15el DJ9BV 100W1500lpm,06/99 +RN6BN,KN95LC,EME,,Alexandr ""Sam",,144: FT736 16x17el 1KW,11/04 +RN6HW,LN16AB,,,,,,08/03 +RN6MT,KN97LN,EME,,Gena,,144: 2.3KW 4xYagis.132,11/03 +RU1A,KP40HK,EME,,Clubstation,,144: 6x16el 1KW,01/05 +RU1AA,KP40XD,EME,,Alex,,144: >2KW GU93b 4x15el Crossyagi140 4000 DTR3,07/04 +RU1AC,KP50EJ,,,,,,07/04 +RU1AS,KO59,,,Alexander,,,05/03 +RU1R,KO82BW,,,OP RB5AL-R3VHF,,,1993 +RU1U,KO72XW,,,OP RB5AL- R3VHF,,,1993 +RU3ACE,KO85SM,EME,,Maxim ""Max",,,01/05 +RU3GX,KO92SO,,,Igor,,,06/04 +RU3ZD,KO81VG,,,Victor,,144: 16el 200W,1/96 +RU4HU,LO43OM,,,Andy,,144: FT290R 2x10el 50W,04/04 +RV1AO,KP50,,,,,,08/04 +RV3AO,KO85RR,,,Vladimir,,144: 4x12el 1500W,07/03 +RV3APM,KO85RU,,,Sergey,,IC910H,03/04 +RV3IG,KO87OT,EME,,Andrey ""Andy",,144: 500W 4x15el.125 1000lpm,01/00 +RV3ZR,KO80CL,,,Alex,,144: 500W YU0B KT939A.150.300,11/03 +RV4AQ,LN28GM,EME,,,,432: 4x4.2ld BV 2xGI7B 500W,10/99 +RV6YY,LN04BH,,,Larry,,,08/04 +RV9AX,LO93LK,,,Oleg,,144: 600W 17el preamp - 50: 100W- 6el.050,10/96 +RV9JD,MP80GW,EME,,,,,01/05 +RW1AW,KP50DA,EME,,Alexander ""Alex",,144: FT736r 2.4KW 2x19el MGF1302 - 432: 12x1,02/05 +RW1Q,KO99WJ,,,Oleg(R3VHF),,.143,12/95 +RW2F,KO04PT,,,OP: DK8LV- DL8UD,,,12/97 +RW3AC,KO86SH,,,Evgeny,,IC910H,01/05 +RW3AZ,KO85TT,,,Alex V.,,,08/03 +RW3DMQ,KO86RI,,,,,,08/04 +RW3PF,KO93CD,,,Peter,,144: 1500W 4x10el GS35 BVO 3wl Preamp - 432:,11/03 +RW3TJ,LO16XG,,,Oleg I.,,.143.243,11/03 +RW3TU,LO25BR,,,Sergej ""Serge",,144:1000Watt 2x13el MGF1302 - 432: 200Watt 2x,09/03 +RW3WR,KO71IM,,,Yuri,,,07/04 +RW4AK,LO20RC,,,Alex,,,01/96 +RW4WE,LO66PU,,,,,,11/04 +RW9FT,LO89TD,,,Eugen,,,11/04 +RW9MD,MO64RX,EME,,,,,06/01 +RX1AS,KO59FX,EME,,Sergej,,144: 4x21el LY GS35b linear.120 1000lpm,05/04 +RX1AX,KO59EW,,,Anton,,,12/20 +RX3PX,KO84SD,EME,,Gennady V.,,144: 2x11el 210W MGF1302 - 432: 2x23el 180W,06/99 +RX3QFM,KO91FM,EME,,Vladimir ""Vlad",,144: 2xBVO4wl yagi 0.4 dB LNA PWR 1.5 KW (2xG,08/04 +RX6AKO,KN84PV,,,Gennady,,,06/96 +RX9CHW,LO99SE,EME,,,,,01/05 +RX9SA,LO71NS,,,,,IC910H,08/04 +RY3E,KN75,,,OP UT5EC,,,1993 +RY5I,KP51BM,,,,,,1992 +RZ1AP,KO49VW,,,Igor,,144: TR-751 300w 16el DJ9BV,05/04 +RZ1AWR,KO59DX,,,Clubstation,,144: 16el DJ9BV 50Watt.120 tx2500 1500lpm,08/98 +RZ1AWT,KP40XD,,,Yuri,,144: 20W 9el.170 1000lpm,06/98 +RZ1QZZ,LO09BC,,,,,,07/04 +RZ1ZZZ,KP76EQ,,,,,,08/04 +RZ2FWA,KO04FT,,,,,,2003 +RZ3AF,KO85CO,,,,,144: MGF 1302 2x14 el GI-7B,12/02 +RZ3QD,KO91OO,,,,,144: 4wl 1KW LNA6000lpm,08/02 +RZ3QS,KO91SS,,,,,144: 2wl 100W LNA1000lpm,08/02 +RZ3ZZ,KO80GP,,,Nikolaj ""Nick",,144: IC-910H 4x 10el A144S10 - 432: 1 A43,11/04 +RZ4HF,LO43QM,,,Igor,,144: IC-910 IC-970 2x13el 1500W,04/04 +RZ6BU,KN84PV,,,Gennadij,,IC706 144: 200W 10el Preamp KT610073 4000lpm,11/03 +RZ6BY,KN84PV,,,,,,06/97 +S50C,JN76JG,,,Clubstation,,50: 5el 100W - 144: IC275h 2x15el 700WMSDSP,08/01 +S51AT,JN75GW,,,Boris,,144: 400W 16el LY2000lpm MSDSP,12/04 +S51BA,JN75IX,,,,,,2003 +S51DI,JN76VL,,,,,,09/03 +S51DX,JN75CC,,,Janez,,144: IC275H 100W 2x17el F9FT,11/01 +S51MQ,JN75NT,,,Boris,,50: 50W 6el - 144: TH328 500W 4x7el MGF13021,01/04 +S51S,JN75GV,,,,,,08/96 +S51SLO,JN76GB,,,,,DTR,03/01 +S51TE,JN76BI,,,,,,11/99 +S51WV,JN76SN,,,,,,2003 +S51WX,JN75OS,,,Dusan,,144: 2x11el 350W,09/04 +S51ZO,JN86DR,EME,,Joze,,144: 1-5KW 4x14el 9BV - 432: 800W 8x33el 9,01/00 +S52CW,JN76CI,EME,,Uros,,,01/01 +S52EZ,JN86DT,,,,,,08/01 +S52LM,JN65TX,EME,,Milos,,144: 4X17M2 5WL FT 1000MP JAVORNIK 144/14,01/05 +S53AC,JN76GB,,,Tili,,IC-746 M2-8wl 600W IC-746 17elDTR MSDSP,08/03 +S53CAB,JN76JG,,,Clubstation,,,08/97 +S53J,JN75EV,EME,,Joze,,144: FT847 4x5wl GS35 ATF43154320,12/04 +S53T,JN75GV,,,Clubstation,,,06/01 +S53VV,JN65UM,EME,,Stane,,144: 250W 16el MutekDTR 3500lpm,01/05 +S53X,JN65WS,,,,,,11/99 +S54AA,JN76EG,,,Franc ""Lane",,144: IC275H 2x4CX250b (650W) 18el DJ9BV,01/01 +S54M,JN86CL,,,Maki,,FT847 PA060210,05/02 +S55AW,JN75DS,,,Stanko,,144: FT1000MP XVRT GS35b 1KW 2x15elMSDSP.3,05/04 +S55M,JN65XM,,,Adi,,144: 8x3el 1KW,11/01 +S55OO,JN76HD,,,Goran,,50: IC735 40W 5el - 144: IC275H 100W 15QD,06/04 +S57A,JN65TW,,,,,,11/99 +S57C,JN76HD,,,Branko,,144: 700W 17el - 432: 400W 8x21DTR,07/96 +S57EA,JN76HE,,,Miran,,144: IC202E 150W 4x6 loop (full elv.) MGF1,01/05 +S57JA,JN76GB,,,,,,11/99 +S57LM,JN76HD,,,Lojze,,.300,04/03 +S57M,JN76PO,EME,,Bojan,,,03/02 +S57MSU,JN76EF,,,Uros,,144: TM255E 500W 2x13el (2.1L) 5°El 15dbon,08/01 +S57QM,JN76,EME,,tone,,,1994 +S57RA,JN75FO,EME,,Paul,,432: 4x 8.5wl dj9bv- 0.3db preamp atf35176- g,08/00 +S57S,JN76JB,,,Aleksander,,144: TS850SAT h.m. transv MGF1302 preamp 3,11/00 +S57TW,JN75EX,EME,,Bojan,,144: IC275H 1500W MGF1302 4x2M28XP085 DTR,08/03 +S57UUU,JN76EC,,,,,,2003 +S58J,JN76EG,,,Janez,,50: IC756 5el,11/99 +S59A,JN76XP,,,Drago,,,11/95 +S59AX,JN65UU,,,janko,,,1993 +S59DCD,JN76NL,,,,,,2003 +S59EA,JN75,,,,,DTR,95 +S59F,JN65TX,,,Ivo,,50: 350w 6el - 70: 50w 5el - 144: 500w,04/03 +S59UN,JN76XP,,,,,,2003 +S9TX,JJ30,,,,,,2003 +SK0AR,JO99BT,,,,,,1993 +SK0CC,JO99BD,,,,,,07/02 +SK0UX,JO99BM,EME,,Clubstation,,,01/05 +SK3AH,JP82XO,,,Clubstation,,,10/02 +SK3JR,JP62WK,,,,,,1992 +SK3LH,JP93IH,,,,,,1994 +SK3MF,JP92FW,,,Clubstation,,144: 6x15el 1KW,07/02 +SK3SN,JP80IO,,,Clubstation,,,1994 +SK4BZ,JP61QM,,,,,,1994 +SK4EA,JO79CO,,,clubstation,,,1993 +SK6HD,JO68SD,,,OP Fredy (SM6FKF),,144: 150W 2x15el1500lpm,09/04 +SK6YH,JO58,,,,,,08/96 +SK7AX,JO77DS,,,Clubstation,,,07/01 +SK7CY,JO65SN,,,OP SM7MRL SM7NYC,,144:TS850 transverter 130 1000W MGF1302300,05/02 +SK7JC,JO76KF,,,Clubstation,,,08/99 +SL4BP,JP70TO,EME,,OP SM4HFI,,144: 800W 4x9el MGF1302,03/02 +SM0EJY,JO89SC,,,Andrew ""Andy",,144: 500W 10 over 10el Preamp1000 lpm,12/99 +SM0EPO,JO89XM,,,Per Olof,,144: 50W 2x6el,12/03 +SM0EPX,JO89SJ,,,Michael ""Mike",,144:1000 Watt 4CX1500 15el X-Y MGF1802,04/04 +SM0FFS,JO99AG,,,,,,1994 +SM0FZH,JO89TG,,,,,,01/97 +SM0HAX,JO99,EME,,Peter,,144: 6x9el (3.5lb) GS35b 1KW 2SK571 0.35dbN,01/01 +SM0IKR,JO99CC,,,Göran,,FT847,02/05 +SM0KAK,JO89XK,,,Lasse,,50: 100W 6el - 144: 180W 17el1600lpmtx 1000lp,08/03 +SM0LCB,JO99,,,Ulf,,,04/04 +SM0LQB,JO89XK,,,Stellan ""Stan",,144: 15el 130W - 432: 4W 21el,04/04 +SM0MXR,JO89WE,,,,,,2003 +SM0NKZ,JO99IQ,,,johan,,,03/02 +SM0OUG,JO89VG,,,Lasse,,,10/96 +SM0PYP,JO89XG,EME,,paul,,,1994 +SM0TSC,JO99CF,,,Johan,,FT817,11/04 +SM1BSA,JO97DP,,,Arne,,144: FT736r 500W 2x9elDTR,05/04 +SM1HPV,JO97HO,,,Karl-Gunnar,,144: 200Watts 2x15ele,01/02 +SM1SBI,JO97FK,EME,,Pontus,,144: 2x17el 800W315,05/02 +SM2AZG,KP03,,,,,,03/02 +SM2BLY,KP05RJ,,,,,,1993 +SM2BYA,KP07DU,EME,,Gudmund,,144: FT1000 4x3.2wl CueDee 3CX1000A7 MGF110,08/00 +SM2CEW,KP15CR,EME,,Peter,,144: 6x19el 1KW120 1200lpm,01/05 +SM2CKR,KP03DQ,EME,,Mats,,,07/99 +SM2ECL,KP05RH,,,Anders ""Anti",,144: 200W 4x15el 60m asl150lpm,07/03 +SM2EKM,KP05UW,EME,,Jan Erik ""Jim",,,04/03 +SM2GCR,JP93TK,,,,,,07/00 +SM2GGF,KP05DV,,,,,,1984 +SM2ILF,KP04,,,S.,,,12/04 +SM2IUE,JP85,,,Enfried,,,1993 +SM2IZV,JP84,,,peter,,,1993 +SM2LKW,KP15BO,,,,,,1994 +SM2LTA,JP94CW,,,Assar,,DTR+,04/98 +SM2ODB,KP03EU,,,Peter,,144: 100W 15el1200lpm,03/02 +SM2VBK,KP15BO,,,Mikael,,,08/02 +SM3AKW,JP92AO,EME,,Carl G.,,144: 2x17LB 1KW - 432: 16x21el 1KW - 1296 4x2,04/00 +SM3AZV,JP83,,,Thorsten,,,1993 +SM3BEI,JP81NG,,,Lennart,,144: 100W 432: 500W 1296: 130W 2320: 120,12/04 +SM3BIU,JP73ST,,,Bas,,,01/97 +SM3BYA,JP81NX,EME,,Gudmund,,432: 450W 8x21el MGF1412,12/00 +SM3COL,JP82,,,Rolf,,,11/96 +SM3GHB,JP72,,,Bentgerik,,,1993 +SM3GHD,JP62,,,lars,,,1993 +SM3IEK,JP82MO,,,Kenneth,,144: 100Watt 15el,01/03 +SM3JBO,JP93IH,,,,,,03/04 +SM3JGG,JP71WJ,,,Staffan,,,07/02 +SM3JLA,JP93LH,,,Mikael,,144: 250W 15eltx1500 3000lpm,06/99 +SM3KJO,JP92DX,,,,,only SSB-MS,08/97 +SM3KYH,JP82NL,,,Lars,,,04/04 +SM3LBN,JP80IO,,,Hakan,,,08/03 +SM3LGO,JP83VB,,,Mats,,144: 1KW 80el Colineartx2000 rx1500lpm,01/99 +SM3MXR,JP80GR,EME,,Einar,,144: 4x17el M2 emepwr5000lpm,08/01 +SM3PWM,JP81GF,EME,,Sverker,,,12/99 +SM3PXO,JP73GI,,,Petter,,144: 400W 17el 5wl - 50: 50W 9el 2wl,04/03 +SM3RLJ,JP93OI,,,Mikael,,144: 100W 15el1500lpm,07/97 +SM3RPQ,JP74BT,,,Leif,,,04/03 +SM3RWZ,JP82MI,,,Tony,,ICOM IC-275H 200W 9 ele,10/04 +SM3TFR,JP93IG,EME,,goeran,,,1994 +SM3VAC,JP83VA,,,Magnus,,144: 2x17el 1KWMSDSP,08/01 +SM3VEE,JP81VI,,,Anders,,,03/98 +SM3XGV,JP81OF,,,Anders,,TS2000,08/04 +SM4ANQ,JP70OC,,,Ulf,,,02/02 +SM4DHN,JP60VQ,EME,,Lars Bertil,,,01/01 +SM4FXR,JO79OF,,,Christer,,,01/05 +SM4IVE,JO79SD,EME,,Lars,,,08/00 +SM4KYN,JO79,,,anders,,,1993 +SM4POB,JP70FK,,,per,,,1995 +SM4RPQ,JO79HH,,,Leif ""Alf",,TS2000,07/04 +SM4VQP,JO79NB,EME,,Lars,,144: 4x17el eme-pwr,01/02 +SM5BSZ,JO89IJ,EME,,Leif,,,07/99 +SM5CBN,JO78NH,,,len,,,1993 +SM5CFS,JO99IQ,EME,,Bjorn,,144: 4x16el QBL5/3500 1.5KW,11/01 +SM5CUI,JO89WW,EME,,Rune,,,01/05 +SM5DCX,JO89OI,,,Lars,,,01/01 +SM5DIC,JO89JT,,,Ragge ""Gus",,144: 13el 400W MGF1302,07/04 +SM5DRV,JO77MV,,,Lars,,144: IC-275H 100W 13el yagi2000lpm,07/04 +SM5FRH,JO88BW,EME,,Torbjoern ""Tobben",,144: 32x19el horz. or 32x10el vert..017,10/00 +SM5GEP,JO77IP,,,,,,2003 +SM5IOT,JO99,EME,,Christer,,144: 8x9el vargarda GS35b MGF1801,10/00 +SM5LE,JO99bd,EME,, +SM5TSP,JP90CE,EME,,Lars,,144: 4x15el 750W2500lpm,07/03 +SM6AEK,JO66,,,goran,,,1993 +SM6AFH,JO66LQ,,,thomas,,DTR,1994 +SM6CEN,JO57XO,,,Hank,,,03/02 +SM6CKU,JO67,EME,,Bengt-Arne,,,10/00 +SM6CMU,JO57XK,,,Ingemar ""Ingo",,IC706MkIIg 50: 100 Watt 6el - 144: 9el NE7,05/04 +SM6CWM,JO67,EME,,ingemar,,,1994 +SM6EAN,JO57WQ,,,Mats,,144: 600W 10elDTR tx 3000lpm,01/01 +SM6EUP,JO57XQ,EME,,hans,,,1994 +SM6FKF,JO68SD,,,Fredy,,,04/04 +SM6FUD,JO68JV,,,,,,12/04 +SM6KJX,JO67CK,,,Janne,,FT736DTR,07/04 +SM6NET,JO68SD,,,Tony,,144: 100Watt 17el - 432: 50Watt 21el,01/05 +SM6TZX,JO67EE,,,CHRISTER,,,05/02 +SM6U,JO67AT,,,OP SM6USS,,144: FT290 9el 25W,05/00 +SM6UMO,JO68DH,,,Mikael,,144: TR751 170W 2x13el SP2000rx3000 tx1200,1994 +SM6USS,JO67AT,,,Dennis,,144: FT290 9el 25Wonly SSB-MS.290,07/97 +SM7AED,JO65NI,,,Arne,,144: 50W 5el.170 rx1000lpm,03/02 +SM7BAE,JO65,EME,,K.,,144: 24x20el,10/98 +SM7CMV,JO65AM,,,Ken,,50: IC735 25W 5el,01/97 +SM7EAN,JO86,,,,,,07/99 +SM7EOI,JO86FP,,,Toby,,IC7400,01/04 +SM7FJE,JO65ML,EME,,Bob,,,01/05 +SM7FMX,JO65KN,,,,,,08/04 +SM7FWZ,JO78,,,Ronny,,,03/03 +SM7GVF,JO76JV,EME,,Kjell,,,03/02 +SM7IWG,JO77IP,,,Carl,,,04/04 +SM7JUQ,JO65WX,,,Harald,,50: 100W 5el - 144: 750W 9el - 432: 50W 19el5,08/04 +SM7KNK,JO75,,,K.,,,1993 +SM7MRL,JO65NP,,,Ingvar,,144: TS850 transverter 130 1000W MGF1302300,03/03 +SM7MXO,JO77,,,,,,07/04 +SM7NNJ,JO86DQ,,,Sven Ake,,50: IC290 - 144: FT726R 100W 15el MGF1302255,01/02 +SM7OYP,JO66JA,,,Lars,,50: 100W 5el,09/01 +SM7SCJ,JO65QJ,EME,,Richard ""Ric",,,10/02 +SM7THS,JO76WR,,,Sverker,,144: 15el 170W MGF1302DTR,11/99 +SM7TJC,JO67SH,EME,,Anders,,144: FT-225RD 2xGi7b (800W) - 432: FT-757GX,05/02 +SM7TUG,JO65OT,,,Hans,,144: 2x4CX250b 17el MGF1302DTR,08/98 +SM7WSJ,JO67WI,EME,,Hakan,,144: 2x M2 28XP 1KW MGF1302 - 432: 18el hom,04/03 +SM7WT,JO65QQ,,,Sten,,,06/01 +SO4DFC,KO13AX,,,,,,1992 +SO4TEC,KO13CW,EME,,,,183383,06/02 +SO5AS,KO02JD,,,Stephen ""Steve",,50:100Watt 3el 144:130Watt 14el105 2500lpm MS,08/04 +SO9AN,JO84NG,,,,,.133,05/00 +SO9FB,JO84NG,,,,,.122,05/00 +SP1JVG,JO84LL,,,Miroslaw,,only SSB-MS,02/01 +SP1NQE,JO84LL,,,Bogdan ""Bodo",,TS746 TS811E,04/04 +SP2CHY,JO94GO,,,Wojtek,,,02/05 +SP2FAX,JO83VA,,,,,144: 2KW 6x17el,08/03 +SP2HAX,JO83,,,,,,12/ 9 +SP2HNF,JO94FK,,,,,,01/99 +SP2IQW,JO94GM,,,Michal ""Mike",,50: FT690S 5el - 144: 100W 2M5WL305/360,09/04 +SP2JAN,JO94,,,,,,09/94 +SP2JYR,JO92QP,,,Ryszard,,,04/04 +SP2MKI,JO93AC,,,Darek,,,03/02 +SP2MKO,JO93CB,,,,,,05/04 +SP2MSL,JO92NM,,,Andrzej,,only SSB-MS,01/97 +SP2NJI,JO92MP,,,Wieslaw,,50: IC736 100W 5el - 144: IC271 150W 21el - 4,10/99 +SP2OFW,JO93AC,EME,,Wojtek,,144: 2xGS35b 2x15el,01/05 +SP2SGZ,JO82UU,,,,,,7/96 +SP3EPX,JO83ID,,,,,,11/01 +SP3FSM,JO81GU,,,,,,08/02 +SP3MFI,JO91,,,st.,,only SSB-MS,1993 +SP3RNW,JO81GQ,,,Leszek,,50: 100W -144: 200W 11el MGF1302 - 432: 100W,08/03 +SP3RNZ,JO92DF,EME,,,,IC746 7el TAGI245,09/03 +SP3SUX,JO72OR,,,Irek,,144: 80W 14el BF981,12/96 +SP3VSC,JO92DF,,,Jack,,144: IC746 2X13B2 PA GS35B,01/04 +SP4BY,KO13OD,,,,,,07/04 +SP4DGN,KO13OD,,,,,,1988 +SP4JCQ,KO13NC,,,Gene,,FT920 IC910H 144: 100W 17el,02/05 +SP4MPB,KO03HT,EME,,Marek,,144: IC746 GS35b MGF1302 - 10GHZ: 5W 120cm,02/04 +SP5CCC,KO02NF,,,Tomasz ""Tom",,,10/02 +SP5CJT,KO02OD,EME,,mike,,,1994 +SP5EFO,KO02,EME,,leszek,,,04/97 +SP5HEJ,KO02,,,Marek,,,01/97 +SP5KVW,KO03SB,,,,,,1989 +SP5LJX,KO03,,,,,,08/02 +SP5QWB,KO02NF,,,Bart,,50: 400W 7el - 144: 1KW 17el - 432: 50W 26el,05/04 +SP5XMU,KO02LG,,,Tomasz ""Tom",,50: 100W 6el 144: 170W 13el 432: 50W 21el,08/04 +SP6A,JO81NG,EME,,Zbigniew,,,11/03 +SP6ASD,JO81LC,,,Tadek,,180lpm,05/02 +SP6AZT,JO81NG,,,,,,2003 +SP6CPH,JO81,,,,,,09/01 +SP6GVU,JO81LC,,,Andrzej (Andy),,144: 17el F9FT 200W MGF1302.073.273,02/01 +SP6GWB,JO80HK,EME,,Staszek ""Stan",,50: FT847 1 kW 9 el (2 lambda) - 144: FT8,02/05 +SP6GZZ,JO80FX,,,Roman,,3000lpm MSDSP200,10/04 +SP6IWQ,JO80HK,,,Bogdan,,TR751e FT757gxII Trnsv 100W Pas,11/04 +SP7BUZ,KO00HU,,,Marcin,,,04/04 +SP7DCS,JO91RT,EME,,Krzysztov ""Chris",,144: FT736r DSP GS35vb (21el.horz.+ 21el.ver,01/01 +SP7EBM,JO91QR,,,Wiktor,,.070.350.,01/02 +SP7JSG,KO01BW,,,,,,03/02 +SP7OGP,KO01AM,,,Piotr,,50: 100W - 144: IC706MKIIG 14el 9BV 50W BF9,01/05 +SP7VC,JO91SS,,,,,,10/04 +SP8AOV,KO11GG,,,Zbigniew ""Zbig",,144: FT480r 100W 2x10el1000lpm,03/00 +SP8NCJ,KO12NA,,,A.,,,11/95 +SP8RHP,KO10FF,,,Robert,,144: 200W 10el DJ9BV122 2000lpm379,12/04 +SP8SN,KO11GG,,,Robert,,,07/04 +SP8UFT,KO11JI,,,,,,01/02 +SP9COO,JO90GA,,,Grzegorz ""Greg",,144: IC251 + PA 100Watt 44el YU0B MGF13020,04/04 +SP9EWO,JN99HW,,,Janusz,,.423.423,12/99 +SP9EWU,JO90NH,EME,,Wojciech,,,07/03 +SP9KUR,KO00MA,,,,,,1993 +SP9LCV,JO90KF,,,Michal,,,05/02 +SP9MRT,JO90KG,,,Sebastian,,.080,12/95 +SP9PRO,JN99,,,Clubstation,,,03/97 +SP9PZU,JO90,,,,,,07/96 +SP9QMP,JO90FB,,,,,,08/02 +SP9TCE,JO90,,,Jurek,,DTR,08/98 +SP9TTG,JO90NU,,,Peter,,144: 100W LY,05/04 +SP9UX,KO00XA,,,,,,07/04 +SQ7DQX,JO91RR,,,Mateusz,,144: 13el 50W,11/04 +SQ8GUP,KN09VQ,,,Waclaw,,,04/01 +SQ9PM,JN99MT,,,Maciek,,FT847 50: 6el - 144: 14el - 432: 29elM,08/03 +SQ9PV,JO90KF,,,Jacek,,,01/03 +SQ9W,JO90NH,EME,,Wojciech,,,07/03 +ST2RS,KK65GN,EME,,Bob,,50: 6el 1KW 144: 4x 8el 140W,01/05 +SV0EC,KN10CJ,EME,,Hardy,,144: TS770 700W 20el Gruppeonly SSB-MS,02/99 +SV1AAF,KM17VX,EME,,,,,1992 +SV1AB,KM18,,,l.,,,1993 +SV1BTR,KM18NO,EME,,Dimitris ""Jimmy",,144: FT847 4x17el. (F9FT) 1.5KW - 432: 8x 3,01/05 +SV1WE,KM18VA,,,Teo,,144: 500W 17el1000lpm,07/98 +SV2DCD,KN00NF,,,,,,10/04 +SV2EVS,KN10KP,,,Spiros,,,04/02 +SV2JL,KN10LO,,,Fotis,,,06/04 +SV3KH,KM07PQ,EME,,Nikos,,144: 100W 12elonly SSB-MS,12/04 +SV5BY,KM46CG,,,,,,2003 +SV5BYR,KM46CG,,,Mike,,144: FT847 2x13el 1KW MGF1302,05/04 +SV8CS,KM07JS,,,Spiros,,144: IC821 + TS2000 17el or 9el Cross 300W,01/05 +T33C,RI49XC,,,,,,2003 +T49C,FL11SG,,,OP Oscar CO2OJ,,50: 4el 100W - 144: 9el 120W - 432: 17el 100W,11/97 +T77WI,JN63FW,,,OP DL3YEL- DJ2QV,,144: 350W 9el 11el,06/98 +T90M,JN82TW,,,,,,08/96 +T90N,JN82TW,,,,,,08/96 +T94KU,JN94JF,,,Esho,,144: FT480r 6el 50Wonly SSB-MS,01/00 +T94ZQ,JN94FP,,,,,only SSB-MS,07/99 +T98CHR,JN84AX,EME,,OP: PA2CHR- PE1LWT,,,04/99 +T98GTH,JN84UU,,,Gigi,,,01/05 +T98LWT,JN84AX,EME,,OP: PA2CHR- PE1LWT,,,04/99 +T9SO,JN94IM,,,Zel,,144: FT480r 8el 150Wonly SSB-MS,08/98 +TF3EJ,HP84,,,Jakob,,,10/95 +TF8ITT,HP94CD,,,Jonas,,144: 1KW ERP,08/02 +TK1DX,JN42RM,,,OP TK5GF,,144: 8el 200W,01/99 +TK5EP,JN41IW,,,Patrick,,144: 400W 9el or 16el 900m.asl.,11/01 +TK5JJ,JN41JW,,,Jan Jacques ""JJ",,144: 3CX800a7 2x 10el DJ9BV MGF1302090,04/03 +TM1E,JN13,,,OP F5SJP- F1JRD,,144: TS790 180W 17B2TX1200 RX 5000lpm,12/99 +TM6OLW,JN37,,,,,,01/05 +TO4E,LG07EQ,,,,,,2003 +TS7N,JM54NQ,,,OP DL6SAQ- 1GGT uva,,144: IC275 HLV600 2x7el FX213MSDSP,11/00 +TV6YGS,IN86,,,,,,1987 +UA1AFA,KO59EV,,,,,,08/02 +UA1ARX,KO48VR,,,OP at RU1AA,,,08/04 +UA1C,KO58BR,,,OP R3VHF,,,1993 +UA1CEA,KO69,,,Roman,,,04/99 +UA1MC,KO59DW,,,Slava,,,08/04 +UA1NAN,KP71ES,,,Eugen,,IC260,01/03 +UA1OLJ,LP03DC,EME,,Vladimir,,144: 150W 9el,12/99 +UA1QV,LO08IW,,,,,144: 300W,06/99 +UA1UM,KO68WJ,,,,,,1988 +UA1WER,KO47EU,,,Igor,,144: 50W 4x17el QSL via DL9USA,01/02 +UA1ZCG,KP59JK,,,,,,2003 +UA1ZCL,KP78TX,EME,,Alex p.,,,1992 +UA2FF,KO04,,,,,,12/04 +UA2FL,KO04FQ,,,slava,,,06/97 +UA3AOG,KO85SQ,,,Igor,,144: IC706 100W 11el1000lpm,07/00 +UA3ARC,KO85SO,,,Alexander,,144 :IC-275H GS-35B MGF1302 2M18XXX,07/04 +UA3DHC,KO96CB,,,Alexandr ""Alex",,,04/04 +UA3DJG,KO95CN,,,,,144: 11el 800W,07/03 +UA3GA,KO92GO,,,Edward,,,11/04 +UA3IAG,KO77FN,,,Boris A.,,,09/99 +UA3IDQ,KO66JF,,,Victor,,,06/00 +UA3MAS,KO97ST,,,,,,1994 +UA3MBJ,KO88SA,EME,,"Nick",,,01/05 +UA3MEE,KO97XN,,,Victor,,,03/01 +UA3MHJ,KO87SR,,,,,,2003 +UA3OG,LO07KS,,,Serge,,,1992 +UA3PBR,KO93BD,,,,,,1986 +UA3PBT,KO84UF,,,,,,1982 +UA3PC,KO84PC,,,Valery,,,08/04 +UA3PTW,KO93BS,EME,,Dima,,144: 16el DJ9BV 1KW - 432: 8 yagis 200W,04/01 +UA3QHS,KO91QR,,,,,,1981 +UA3QR,KO92KA,,,Viktor,,,1992 +UA3RBO,LO03NG,,,,,,11/03 +UA3RFS,LO02SW,,,,,,1980 +UA3T,LO16GM,,,Clubstation,,.143.243,07/03 +UA3TCF,LO26IU,EME,,Alexander,,144: 300W,01/00 +UA3TDB,LO16,,,,,,1979 +UA3TIE,LO16,,,,,,01/97 +UA3UBD,LO06GU,,,,,,1980 +UA3UES,LO07MF,,,alex a.,,,1992 +UA3WM,KO72QI,,,,,,07/04 +UA3XEH,KO73FU,,,,,,08/98 +UA3XFA,KO73DU,,,,,,01/96 +UA3YOZ,KO63QQ,,,Eugine,,144: 150w 10el 2wl bf998355,08/04 +UA3ZAT,KO80,,,,,,1991 +UA4AAV,LO21FC,EME,,Victor,,,04/99 +UA4ALU,LN29LA,EME,,nick,,,1992 +UA4API,LO20QC,EME,,Victor,,,12/99 +UA4AQL,LO20QB,EME,,Aleksandr ""Al",,144: 4x13el DJ9BV Preamp 0.8db 1.2kW(EME),06/03 +UA4CDT,LO41AX,,,,,,1983 +UA4NM,LO48UP,,,Vladimir,,,03/04 +UA4SF,LO36WP,,,,,,1986 +UA4UK,LO14MA,,,Eugeny,,,11/03 +UA6LGH,KN97LF,EME,,Victor,,,07/96 +UA9CGP,MO06RT,,,,,,2003 +UA9CS,MO06FU,EME,,igor,,,1992 +UA9FAD,LO88DA,EME,,Victor,,144: 1KW 4x16el - 432: 1KW 8x15el.037,01/05 +UA9SL,LO71NS,EME,,Vladimir,,,11/04 +UA9XQ,LP63UM,,,,,,01/97 +UA9YLU,MO92EO,EME,,,,,11/04 +UB0QF,KN77NU,,,,,,1988 +UB2GA,KN77AB,,,,,,1990 +UE1TWO,KO67PW,,,,,,07/04 +UL7LU,MO13TD,EME,,victor,,,1992 +UL7TZ,MN52,EME,,,,,1992 +UN7LU,MO13TD,,,,,,2003 +UN7TQ,MN52VV,EME,,Pavel,,,09/98 +UN8AG,LN53PH,,,Alex,,,07/96 +UN8BA,MO51RD,EME,,anatoly,,,1992 +UR3EE,KN88DC,EME,,Artur N.,,,11/02 +UR3EP,KN78WR,,,,,,01/96 +UR4EWF,KN67OW,,,Clubstation,,,07/03 +UR4LL,KO70XG,,,Alex,,,10/00 +UR5BAE,KN29SM,,,Anatoly,,,07/01 +UR5LLW,KN89EQ,,,,,,06/03 +UR5LX,KO70WK,EME,,Sergej Leonidov,,144: 800W 13el BF981.076 DTR 2000,01/05 +UR5M,KN99FD,,,OP UT5EC-UT4EQ,,,94 +UR5RCP,KO51OM,,,vladimir,,,1992 +UR5SKB,KN28IW,,,Vik,,FT847,05/04 +UR7GN,KN66HP,,,Sergey,,,06/96 +UR8IDX,KN87TC,,,Victor,,,07/04 +US0WA,KN29XT,,,n.k.,,,07/95 +US1VQ,KN58XA,,,,,,08/95 +US5CCO,KN59XG,,,Vlad,,,05/02 +US5II,KN88WA,,,Serge,,,08/04 +US5WU,KO20DI,,,boris,,.125,06/02 +UT1E,KN57XX,EME,,Clubstation,,.077,08/03 +UT1EA,KN68RA,EME,,Clubstation,,.077,08/03 +UT1EWA,KN68RA,,,,,,2003 +UT1PA,KO21FC,EME,,Alexander,,,06/98 +UT1Q,KN77,,,,,,08/95 +UT2CO,KN58CR,,,jan,,,1992 +UT2HN,KN79OI,,,Nick,,144: 100W 16el.140 1000lpm,11/03 +UT3BW,KN29UA,,,Igor b.,,,05/99 +UT3LL,KO80AC,,,,,,2003 +UT4EQ,KN78MK,EME,,Nick,,,06/98 +UT5AO,KO61XQ,EME,,vlad,,,1994 +UT5BN,KO40,,,,,,1981 +UT5CO,KN58CQ,,,,,.140,1995 +UT5DL,KN18EP,EME,,w.p. Slava,,,07/02 +UT5EC,KN78MN,EME,,Valery,,,11/99 +UT5EG,KN78GJ,EME,,alex,,,1994 +UT5ER,KN78ER,EME,,Arkady,,144: 4x4.4L DJ9BV 1KW MGF1302.117 DTR 30,01/05 +UT5GU,KN68,,,alex,,,1994 +UT5JAX,KN64RQ,,,vlad,,,1994 +UT5JCW,KN64SN,,,Serge,,50: ic-706mk2 ft-100160,11/03 +UT5UBB,KO50,,,,,,01/04 +UT5UCP,KO50DG,,,Eugen,,,07/01 +UT5VD,KN68MT,,,Anatoly,,,10/04 +UT7GA,KN66HP,,,Alex,,144: 1KW 16el F9FT1000lpm,09/99 +UT7VF,KN68MQ,EME,,Victor,,,06/96 +UT8AL,KO61WP,EME,,aleksandr.,,DTR,08/99 +UU1AA,KN74BV,,,,,,08/04 +UU1DX,KN74BW,,,Oleg,,144: 500W,07/04 +UU5JJ,KN74AV,,,,,,2003 +UW9AH,LO93KK,,,Yuri e.,,,1992 +UX0FF,KN45NI,,,Nikolay,,,07/04 +UX1AS,KO59FX,,,,,,2003 +UX5UL,KO50FL,,,Oleg,,144: IC910H 100W310,07/04 +UY5HF,KN66HP,,,Anatoli,,,06/96 +UY5OE,KO80AB,,,,,,1994 +UZ1OVW,KP94VN,,,anatoly v.,,,1992 +UZ3DD,KO86JH,EME,,,,,1993 +V47YC,FK87,EME,,,,,07/96 +VA2CST,FN35BP,,,Claude,,,2003 +VA2MGL,FN74UQ,,,Marc,,50: 25W 3el,11/01 +VA2PRC,FN46,,,Yves,,50: deltaloop 144: IC706 13el,1998 +VA3LK,FN14TO,,,,,,2003 +VA3NFA,FN25BH,,,Tom,,,2003 +VA5VHF,DO70FJ,,,Michael David,,,2003 +VA6DX,DO33IM,,,Barry,,144: 1KW 4x 2M9,01/01 +VA7MM,CN89OG,EME,,,,,2004 +VE1ALQ,FN65VH,EME,,,,,10/02 +VE1GRT,FN84IQ,,,,,,2003 +VE1KG,FN84CM,EME,,Serge,,4x17el,10/00 +VE1MQ,FN65,,,,,,2003 +VE1RG,FN65,,,Chuck,,144: 170W longyagi,12/00 +VE1SKY,FN74,,,Roger,,50: FT620B 3el,01/01 +VE1TAY,FN66,,,Wade,,,01/01 +VE1XYL,FN65VH,,,,,,2003 +VE1ZJ,FN96UC,EME,,,,144: 1.8KW 6x18el,12/01 +VE2BKL,FN48DJ,,,Roger,,50: 1000W 6el - 144: 150W 19el,04/02 +VE2CST,FN35BP,,,,,,2003 +VE2DIV,FN35BP,,,,,,2003 +VE2PEP,FN46IB,,,Germain,,,08/03 +VE2PIJ,FN35QI,,,Pierre,,50: 6el 40W - 144: 17el 25W - 432: 24el 25,08/04 +VE2UG,FN35,,,,,,2003 +VE2WHZ,FN08WN,,,,,,2003 +VE2YAG,FN19ES,,,,,,2003 +VE3AX,FN02CW,,,Peter,,1.5KW 50-432 multiple Yagi arays.200.200,01/02 +VE3BDR,EN98,,,,,,2003 +VE3BFM,FN04AE,,,,,,2003 +VE3CF,FN03,,,,,,2003 +VE3CVG,FN25HM,,,,,,2003 +VE3DBP,EN94EE,,,,,,2003 +VE3DEW,FN04,EME,,,,,2003 +VE3DIR,FN03,,,,,,2003 +VE3DSS,FN03FQ,EME,,Dana,,.200,07/01 +VE3FAC,FN03IS,EME,,,,,2003 +VE3FAL,EN58DF,,,Fred,,,10/01 +VE3FOD,EN76,,,,,,2003 +VE3JJX,EN29SS,,,,,,2003 +VE3KH,FN03CL,EME,,Kevin D.,,144: 6 x 2MXP28 AzEl 8877 LNA145 LT2S FT1000D,09/99 +VE3KHH,FN03CL,,,,,,2003 +VE3KRP,EN58IJ,EME,,Ed,,,02/05 +VE3NE,FN03FQ,,,Lajos,,,2003 +VE3OQC,FN03,,,,,,2003 +VE3SCP,EN93WV,,,,,,2003 +VE3STZ,EN82,,,,,,2003 +VE3WMD,EN92JN,,,,,,2003 +VE4AAZ,EN19,,,,,,2003 +VE4ACX,EN19,,,,,,2003 +VE4AJB,EO00,,,,,,2003 +VE4AP,EN19,,,,,,2003 +VE4AQ,EN19OR,,,Jim,,144: 1KW 4218XL,01/01 +VE4CCW,EN19,,,,,,2003 +VE4CT,EN19OW,,,,,,2003 +VE4DK,EN19,,,,,,2003 +VE4FV,EN19,,,,,,2003 +VE4GHR,EN19,,,,,,2003 +VE4GLS,EN19,,,,,,2003 +VE4HAY,EN19,,,,,,2003 +VE4JX,EO00,,,,,,2003 +VE4KQ,EN19,,,,,,2003 +VE4KU,EN19,,,,,,2003 +VE4LAR,EN19,,,,,,2003 +VE4MA,EN19LU,EME,,,,,2003 +VE4MBQ,EN19,,,,,,2003 +VE4MHZ,EN19,,,,,,2003 +VE4MX,EN19,,,,,,2003 +VE4OV,EN19,,,,,,2003 +VE4PQ,EN19,,,,,,2003 +VE4RCJ,EN19,,,,,,2003 +VE4RE,EN19,,,,,,2003 +VE4TOM,EN-19,,,,,,2003 +VE4TV,EN19CX,,,,,,2003 +VE4UD,EN19,,,,,,2003 +VE4ZI,EN19,,,,,,2003 +VE4ZK,EN19,,,,,,2003 +VE4ZV,EO10IH,,,,,,2003 +VE5UF,DO61OV,,,Doug,,50: 600W 6el quad - 144: 325W 2x 2M126000lpm,07/01 +VE6AFO,DO21,EME,,,,,2003 +VE6BPR,DO32BG,,,Al,,50: 150W 5el - 144: 250W 16el crossyagi,01/01 +VE6LR,DO21,,,,,,2003 +VE6NA,DO20,EME,,,,,2003 +VE6NTT,DO31,,,Don,,144: 170W 17el,1998 +VE6PY,DO20WW,,,,,,2003 +VE6TA,DO33GS,EME,,Grant,,432: 5m dish 800W,08/00 +VE6XT,DO,,,,,,2003 +VE7BBG,CN88,EME,,,,,12/00 +VE7BEE,DN09HG,,,,,,2003 +VE7BQH,CN89KI,EME,,Lionel,,384el Collininar,03/00 +VE7CFT,CN79ST,,,Russ,,,2003 +VE7CLD,CN89LD,EME,,,,,2003 +VE7DXG,CN88DT,,,Gabor,,50: 150W 5el - 144: 150W 15el,05/03 +VE7FYC,CN89,,,,,,2003 +VE7KPB,DN29CM,,,Ken,,144: 1KW 5wl M2,06/01 +VE7MDL,CN89,,,Erik,,only SSB-MS,1998 +VE7RJ,DN09LL,,,,,,2003 +VE7SKA,CN88GT,,,Mike,,4000lpm,01/01 +VE7US,CN88IG,,,Reg,,,2003 +VE7VVW,DO00IF,,,Ron,,144: 160W KLM2m22c - 432: 100W MBM88,01/02 +VE7ZD,CN89LG,,,,,,2003 +VE9AA,FN65RS,,,Michael,,,01/02 +VE9PA,FN65SU,,,,,,2003 +VK1VP,QF44NR,EME,,,,,89 +VK2ALU,QF55KN,EME,,,,,2003 +VK2BE,QF56NC,EME,,,,,2003 +VK2CZ,QF56NH,,,David,,,2003 +VK2DJG,QF59VK,,,Gordon,,,2004 +VK2FLR,QF56OD,,,,,,2003 +VK2JKK,QF69LO,,,Wayne,,,2003 +VK2KU,QF55AI,EME,,Guy,,144: 400W 4x 12el,01/05 +VK2XCI,QF27WD,,,Norm,,,2003 +VK3AMZ,QF22IC,EME,,arie,,,1993 +VK3AXH,QF12WJ,,,Ian,,,2003 +VK3CY,QF13,EME,,,,,04/00 +VK3HY,QF22PD,,,Gavin,,,2003 +VK3HZ,QF22ME,,,David,,,2003 +VK3OT,QF12AG,EME,,steve,,,1994 +VK3UM,QF22RO,EME,,,,,2003 +VK4AFL,QG62OJ,EME,,,,,2003 +VK4APG,QG62LP,EME,,peter,,,1994 +VK4CDI,QG52XH,,,Phil,,144: 10el 170W,01/05 +VK4JSR,QG62NM,,,Scott,,50: 100W 8el - 144: 400W 12el - 432: 100W 28e,10/00 +VK4KAZ,QG63KQ,EME,,,,,2003 +VK5DK,QF02JE,,,Colin,,,2003 +VK5MC,QF02EJ,EME,,,,,89 +VK5OA,QF02JE,,,Kevin,,,2003 +VK6KDD,OG99HP,EME,,Ron,,LT2S LT6S TS850,01/05 +VK7MO,QE37PC,EME,,,,,12/04 +VK9CD,NH87JU,,,,,,2003 +VK9XW,OH29TI,,,,,,2003 +VP2EC,FK88LD,,,,,,2003 +VP2MIS,FK86UV,EME,,,,,11/00 +VP2MR,FK86VS,,,,,,2003 +VP5JM,FL31VS,,,,,,2003 +VQ9LA,MI62,EME,,,,,09/02 +VS6BI,OL72CG,,,,,,2003 +VT3AT,RJ38UR,,,,,,2003 +W0AH,DM78LX,EME,,Doug,,,01/01 +W0AUS,EN35KA,,,,,,2003 +W0BJ,DN91OD,,,,,,2003 +W0DB,EN11VD,,,Joe,,144: 50W 2x 8el,09/01 +W0DEN,EN41,,,,,,2003 +W0DFK,EM47LX,,,,,,2003 +W0DJM,EN25XK,,,,,,2003 +W0DQY,EM48RS,,,Glenn ""Smitty",,144: 350W 4x8el - 432: 175W 2x88el - 1296: 10,01/01 +W0EKZ,EM17,,,,,,2003 +W0ETT,DM79,,,,,,2003 +W0FMS,EN42EB,,,,,,2003 +W0FY,EM48,,,,,,2003 +W0GAJ,EN11,,,,,,2003 +W0GC,EN14SQ,,,Gary,,,2003 +W0GHZ,EN34,,,,,,2003 +W0GN,EN42,,,,,,2003 +W0GR,EM38AX,,,,,,2003 +W0HHE,DM79,EME,,,,,2003 +W0HL,EM27,,,,,,2003 +W0HRG,EM39,,,,,,2003 +W0IC,DM79MR,,,,,,2003 +W0IOH,DM78OU,,,Bill,,,01/01 +W0IPL,DN62UU,EME,,,,,2004 +W0ITB,DM79,,,,,,2003 +W0IZ,EN41,,,,,,2003 +W0JRP,EM27RB,,,,,,2003 +W0KFG,DN96OT,,,Dick,,,09/01 +W0KJY,DN71,EME,,,,,89 +W0KRX,EN34LM,,,,,,2003 +W0LD,DM78,,,Lauren D.,,144: 1KW 2x16el,04/01 +W0LER,EN35IE,,,John,,,01/01 +W0LMD,DM79,,,,,,2003 +W0MD,EN36,,,,,,2003 +W0MXY,DM78,,,,,,2003 +W0NKN,EN42,,,,,,2003 +W0OF,EM12,,,,,,2003 +W0OHP,EN10,,,,,,2003 +W0OHU,EN34OA,,,,,,2003 +W0OZI,EN35,,,,,,2003 +W0OZL,DN60FM,,,,,,2003 +W0PEC,EN34,,,,,,2003 +W0PHD,EN18OE,,,Wally,,144: 190W 16lbx,09/01 +W0PPF,EN41,,,,,,2003 +W0PT,EM28OD,EME,,Bill,,144: 4X 19XXX and 1.2kw,12/00 +W0PW,EM26TW,,,,,,2003 +W0QIN,EN34,,,,,,2003 +W0RAP,EN42EB,,,,,,2003 +W0RGU,EN35,,,,,,2003 +W0RKP,EN31,,,,,,2003 +W0RRY,EM26BX,EME,,Charlie,,144: 700W 9elM2 0.6db Preamp,01/01 +W0RSJ,FN20JQ,,,,,,2003 +W0RTZ,DM79,,,,,,2003 +W0RWH,EM39SX,EME,,Donald,,144: 16x19elonly SSB-MS,10/98 +W0SD,EN13GQ,EME,,,,,89 +W0SII,DN71,,,,,,2003 +W0TJ,EN10,,,,,,2003 +W0UC,EN35,,,,,,2003 +W0UHF,EN32,,,,,,2003 +W0UN,EL07FV,,,,,,2003 +W0UT,EM17,,,,,,2003 +W0VB,EN34SB,,,Terry,,,01/01 +W0VD,EM27UD,EME,,Dan,,144: TS790A 8877 (1-5KW) 18elM2,01/01 +W0VX,EM12,,,,,,2003 +W0WGZ,EN42,,,,,,2003 +W0WTG,EM48,,,,,,2003 +W0XG,EN34QX,,,,,,2003 +W0YPT,EN43,,,,,,2003 +W0ZJY,EM28,,,,,,2003 +W0ZQ,EN34IU,,,,,,2003 +W0ZZQ,EM26,,,,,,2003 +W1CDO,CN87XF,,,John,,,2004 +W1COT,FN31ST,,,Bob,,,2004 +W1CQD,FN34MR,,,Clair,,,2004 +W1FIG,FN41GV,EME,,Maarten,,50: 1KW 2x7el - 144: 9el M2 1KW 0.8db - 22,01/01 +W1FM,FN42,,,,,,2003 +W1GHZ,FN42,,,Paul,,,01/01 +W1HY,FN41HV,,,Paul,,,2003 +W1IPL,DN62UU,EME,,,,,02/05 +W1JR,FN42HN,EME,,,,,89 +W1LP,FN41SR,,,Clint,,144: 1KW 2x2M9,01/01 +W1QC,FN42HU,EME,,,,,2003 +W1REZ,FN55,,,,,,10/00 +W1RZF,FN42FC,,,arthur,,,2004 +W1TE,FN42EN,,,Charley,,50: 1KW 7el - 144: 1KW 22el - 432: 44el,08/01 +W1UHE,FN41,,,,,,2003 +W1VT,FN33KE,,,,,,2003 +W1XE,DM79GW,,,,,,2003 +W1XR,FN42HW,,,,,,2003 +W1ZC,FN42DR,,,Dick,,144: 1KW - 432: 36el,01/02 +W1ZX,FM18LG,,,,,,2003 +W2AXU,FN20OG,,,,,,2003 +W2BZY,EL98HR,,,Bob,,50: 700W 7el - 144: 160W 17el - 222: 120W 23e,09/01 +W2CRS,DM78,,,,,,2003 +W2DRZ,FN02LA,EME,,,,,01/01 +W2ETI,FN21,EME,,,,,2003 +W2HBA,FN31TC,,,GEORGE,,,2003 +W2MPK,FN23BA,EME,,Don,,,10/99 +W2SZ,FN22,,,,,,2003 +W2UHI,EN73AH,EME,,,,,2003 +W2VU,FN20,,,,,,2003 +W2WD,FN20TP,EME,,Warren,,432: 20ft portable dish 1KW,08/00 +W3ARS,FK88LC,,,,,,2003 +W3BDP,FM29,,,,,,2003 +W3BW,FN30AS,,,,,,2003 +W3EME,CN85BE,EME,,Brian,,144: Icom 746 MGF2430A MGF1302 4x14el X-P,01/05 +W3HQT,FN54,,,,,,2003 +W3IKE,FM18SW,,,,,,2003 +W3IOA,EM00,,,,,,2003 +W3IWI,FM19ME,,,,,,2003 +W3KJ,FN20HG,,,Joseph,,,2003 +W3MRG,FN10UB,,,,,,2003 +W3RY,FN10LL,,,,,,2003 +W3SDZ,FN11,,,,,,2003 +W3SE,DM03WW,,,Wes,,50: 50W 5el - 144: 150W 12el,04/02 +W3SZ,FN20AH,,,Roger,,144: 150W 9el - 432: 100W 9wl. - 1296: 10W 4x,01/01 +W3TMZ,EL88SU,,,,,,2003 +W3TWO,FM28CA,,,Daniel C.,,144: 400W M2,07/01 +W3UUM,EL29PW,,,Matt,,144: 170W 12el,01/02 +W3VH,FN32HG,EME,,,,,2003 +W3WJR,FN20LL,,,,,,2003 +W3XO,EM00KD,,,,,,2003 +W3XS,FN10,EME,,,,,2000 +W3ZZ,FM19JD,,,Gene,,50: 1-5kw 8el 144: 1-5kw 17 el - 432: 1Kw 33e,07/01 +W4ABC,EL87PT,,,Jon,,50: 100W 7el qubical quad,01/01 +W4AD,FM18IP,EME,,Jack,,,07/01 +W4AME,EM75FG,,,,,,2003 +W4CHA,EL88QA,,,Chuck,,50: 150W 9el M2 - 144: 1-5KW 2M18xxx - 432: 5,01/01 +W4CN,EM17JP,,,Mike,,,09/01 +W4DEX,EM95,EME,,,,,2003 +W4ET,EM56TP,,,RON,,,2004 +W4FJ,FM17,,,,,,2003 +W4GHW,EM81EQ,,,Greg,,,2004 +W4HTB,EM66,,,,,,2003 +W4KXY,EM84,,,James,,,01/01 +W4LNG,EM73VK,,,,,,2003 +W4MOP,EM78,,,,,,2003 +W4OZK,EM73,,,,,,2003 +W4PJV,EM65SU,,,,,,2003 +W4PZA,EM66NC,,,,,,2003 +W4RBO,EL99KF,,,John,,,2003 +W4RDI,EL96BQ,EME,,,,,2003 +W4REB,EM78,,,,,,2003 +W4RFR,EM65,,,,,,2003 +W4SM,FM08QA,EME,,,,,2004 +W4SW,FM18IW,EME,,,,,06/00 +W4TAS,EL87UW,,,,,,2003 +W4TJ,FM08,EME,,,,,06/00 +W4TNV,FM05XD,,,,,,2003 +W4UDH,EM52AG,,,Smitty,,,01/01 +W4UDQ,EM55DB,,,,,,2003 +W4UE,EM90GC,,,john,,,12/97 +W4VHF,EM95,,,,,,2003 +W4WD,DN40AM,,,,,,2003 +W4WDH,EM83,,,,,,2003 +W4WHN,EL94HP,,,Dean,,,09/01 +W4WSR,EL85CB,,,Ott,,,01/01 +W4WTA,EM83XJ,,,Ace,,144: 160W 18el,11/01 +W4XP,FM18EW,EME,,Chuck,,.100.200,08/01 +W4ZD,EL79HH,EME,,bev,,,1993 +W4ZPG,EM73WU,,,,,,2003 +W4ZRZ,EM63SS,,,,,,2003 +W5AK,EL29,,,,,,2003 +W5AL,DM95XB,,,Len,,50: 150W - 144: 1KW 18el M2 - 222: 130W - 432,01/01 +W5CTV,EL49WU,,,,,,2003 +W5DBY,EM12,,,,,,2003 +W5DID,EL29,,,,,,2003 +W5DKE,EM12LL,,,,,,2003 +W5DS,EM15,,,,,,2003 +W5ETG,EM12LS,,,,,,2003 +W5FR,EM12KX,,,Harold,,,2003 +W5FYZ,EM32,,,,,,2003 +W5GDL,EM15GM,,,,,,2003 +W5GEL,EL17,,,,,,2003 +W5GG,EM12,,,,,,2003 +W5GKO,EM35,,,,,,2003 +W5GNB,DM73VB,,,Gary,,,2003 +W5GVE,EM01,,,,,,2003 +W5HES,EM12HQ,,,,,,2003 +W5HPT,EM12,,,,,,2003 +W5HTZ,EM16,,,,,,2003 +W5HUQ,EM35BC,,,John,,,07/01 +W5ITI,EM32,,,,,,2003 +W5IU,EM12HP,,,,,,2003 +W5IXR,DM76,,,,,,2003 +W5JBP,EM12,,,,,,2003 +W5KI,FM29PU,,,,,,2003 +W5KLF,EM31PJ,,,Keith,,,2003 +W5KQJ,EM12BS,,,,,,2003 +W5LBT,EM40KV,EME,,R.A. Bob,,,08/01 +W5LUA,EM13QC,EME,,,,,2003 +W5LUU,EL09QO,EME,,Derwin,,144: FT736r 1.5KW 4x5wl - 432: 1.5KW 1x5wl,08/01 +W5MRF,EM12,,,,,,2003 +W5NFC,EM10,,,,,,2003 +W5PIC,EM16LJ,,,,,,2003 +W5PLN,EM12,,,,,,2003 +W5RCI,EM44UF,EME,,,,,89 +W5SNX,EM73WT,,,Dick,,50: 150Watts 6M7JHV @65ft - 144MHz : 500Wat,01/02 +W5SXD,EL29,,,,,,2003 +W5TCD,EM 12,,,,,,2003 +W5TVG,EM26,,,,,,2003 +W5UC,EM21PI,EME,,Mike,,,01/05 +W5UMB,EL17AX,,,,,,2003 +W5UN,EM23MG,EME,,Dave,,144: 32x 2M5WL129,12/04 +W5UPR,EL29,,,,,,2003 +W5UWB,EL17AX,EME,,John,,50: 1000W 6el - 144: 1500W 17el - 222: 17el 1,02/05 +W5VUY,EM40,,,,,,2003 +W5WJP,EM12HO,,,,,,2003 +W5YUO,EM12,,,,,,2003 +W5ZN,EM45DH,EME,,Joel,,,12/00 +W6CAP,DM14,,,Cap,,144: FT726r 1KW 2yagis,01/01 +W6CPL,DM04,,,,,,2003 +W6FC,DM03,,,,,,2003 +W6HD,CM98PF,EME,,,,,2003 +W6IZU,CM98NO,,,,,,2003 +W6KH,CM97,,,,,,2003 +W6MT,CM87XH,,,,,,2003 +W6NQ,DM13,,,,,,2003 +W6OMF,CM98AK,,,Larry,,144: 650W 2x17el - 222: 120W 7wl - 432: 17,01/01 +W6OYJ,DM12,,,,,,2003 +W6QT,CM87,,,,,,2003 +W6TE,DM06CT,EME,,,,,2003 +W6US,DM13JA,,,,,,2003 +W6WE,CM95RD,EME,,mike,,,11/03 +W6YLZ,DM04RF,,,Mike,,50: 80W 4el - 144: 150W 14el,01/01 +W6YX,CM87WJ,EME,,,,,2004 +W7ALW,DN36AT,EME,,Barrie,,50: 8877 9el - 144: 400W 2x18xxx - 432: 200W,01/01 +W7AMI,DN13VO,EME,,Terry,,4x 28el 750W,01/05 +W7ANF,DM43AS,,,Jim,,144: 15W Vertical,07/01 +W7AV,CN96QN,,,,,,2003 +W7BBM,DM42MB,EME,,,,,2003 +W7CI,DM41UN,EME,,,,,89 +W7CNK,EM15FI,,,,,,2003 +W7CQ,CN83JX,,,Jimmy,,,2003 +W7CS,DM42OO,EME,,Chuck,,50: 1.5KW 7el - 144: 500W 4x13el - 432: 500W,08/01 +W7DHH,DM48LL,,,,,,2003 +W7DWW,CN87,,,,,,2003 +W7EME,CN85BE,EME,,Jeremy,,144: FT736r Mutek DSP Preamp 8877 8x8 wl,01/05 +W7EW,CN84LV,,,Lew,,FT1000MP 144: 1-5KW,08/03 +W7FG,EM26BQ,EME,,Gary,,50: 100W 6el - 144: 1.5KW 80el MGF1302,09/02 +W7FN,CN88SA,EME,,,,,89 +W7GBI,DM43AN,EME,,,,,2003 +W7GJ,DN27UB,EME,,Lance,,50: 4x 9el 1.5KW 144: 16x 17el 1.5KW MGF1,11/04 +W7GTM,CN87VU,,,Grant,,,2003 +W7GZ,DM42NF,,,,,,2003 +W7ID,DN13UN,EME,,,,,89 +W7IUV,DM07DG,EME,,Larry,,,01/05 +W7IXL,DM03US,,,,,,2003 +W7JF,DN55RS,,,,,,2003 +W7JW,EN82HJ,,,,,,2003 +W7KK,DM18,EME,,OP: N7MSD NS9E,,144: 2 x 18XXX at 40'/50' KW Output FT847,04/01 +W7LD,DM78OV,,,,,,2003 +W7MEM,DN17NT,EME,,Mark,,50: 600W 9el - 144: FT726r 2002A 800W 4x5wl,09/01 +W7NS,DM33WP,,,,,,2003 +W7NTF,CN87TB,,,Gary,,50: 160W 6el - 144: 160W 13elMSDSP 10000lpm,01/01 +W7OJT,DM26KB,,,Dave,,,2005 +W7PW,DM09JI,,,,,,2003 +W7QX,DM44AR,EME,,Jerry,,1296: 10 1/2Dish 75Watt,03/04 +W7SZ,CN85UO,EME,,Larry,,432: 4x32el X-pol 1.5KW - 1296: 3m dish 500W,01/00 +W7TVF,DM26,EME,,,,,2003 +W7VQQ,DM19,EME,,,,,2003 +W7VX,DM03TV,,,,,,2003 +W7XU,EN13LM,,,Arliss,,144: 1-5KW,08/03 +W7ZRC,DN13,EME,,,,,2003 +W8ATH,EN80,EME,,,,,2003 +W8BYA,EN70JT,EME,,Gedas,,144: 2x 17elB2 650W Preamp,02/05 +W8CM,EM13,,,Mike,,50: IC575H 800W 7el - 144: IC275H 800W 4x9el,01/02 +W8CRZ,EN80TB,,,Rob,,,2004 +W8DQ,EM79NC,,,Robert,,,2004 +W8HOM,EN71LA,,,,,,2003 +W8IDU,EN83,EME,,,,,89 +W8KSE,EM80,,,,,,2003 +W8LON,EN73JB,EME,,Lon,,,02/05 +W8MGJ,EM79,,,,,,2003 +W8MM,EM79SD,,,,,,2003 +W8MQW,EN72UR,EME,,,,,2003 +W8OUD,EM79RJ,,,,,,2003 +W8PAT,EN81VG,EME,,,,,12/04 +W8SCA,EM79UN,,,Phillip,,,2004 +W8TAH,EN91CD,,,Timothy,,,2003 +W8TL,FM09BM,,,Burt,,50: FT767 1KW 11el - 144: FT736 1KW 17B2,01/01 +W8TN,EM98AK,EME,,Clark,,,07/01 +W8VHF,EN64,,,,,,2003 +W8WN,EM77BQ,EME,,Shelby,,50: 600W 4el - 144: 1-2KW 4x16el KLM - 432: 1,07/01 +W9BLI,EN64DK,,,,,,2003 +W9BN,EM34TT,,,,,,2003 +W9CGI,EN60WC,,,Dave,,,2003 +W9DWP,EN52,,,,,,2003 +W9EME,EN54AL,,,,,,2003 +W9EQI,EM49,,,,,,2003 +W9FX,EM57MX,,,Brad,,144: 1KW 17el,07/01 +W9FY,EN52,,,,,,2003 +W9FZ,EN43,,,,,,2003 +W9GIR,EN44OG,,,,,,2003 +W9GM,EN43JU,,,Ken,,50: 100W 6el - 144: 100W 13el,05/02 +W9HLY,EN70NT,,,,,,2003 +W9IIX,EN61DR,,,,,,2003 +W9IP,FN24KO,,,,,,2003 +W9JMS,EM69,,,,,,2003 +W9JN,EN54DN,,,John,,50: 1KW 6el - 144: 1KW 2x17B2 - 222: 150W 7wL,01/02 +W9JUV,EN52,,,,,,2003 +W9KFB,EN60,,,,,,2003 +W9KHH,EN63AH,,,,,,2003 +W9LT,EN52XG,,,Thomas,,,2004 +W9NHE,EN53,,,,,,2003 +W9NLP,EN52WN,,,,,,2003 +W9NTP,EM79,,,,,,2003 +W9NWR,EN55FW,,,Charles,,,2004 +W9RVG,EM57RN,EME,,Marshall,,IC746 IC910H FT736,02/05 +W9VA,EN62,,,,,,2003 +W9VNE,EM79,,,,,,2003 +W9XA,EN51,,,,,,2003 +W9XT,EN53,,,Gary,,,1998 +W9ZIH,EN51NV,,,,,,2003 +WA0AUQ,EN41,,,,,,2003 +WA0BWE,EN34LX,,,Gary,,,1998 +WA0CQG,EN34,,,,,,2003 +WA0DXZ,EN41,,,Bob,,,01/97 +WA0ETH,EM38PH,,,,,,2003 +WA0JDU,EN34,,,,,,2003 +WA0JMP,EN34,,,,,,2003 +WA0JYF,EN42,,,,,,2003 +WA0MWW,EN30VX,,,Ron,,,2004 +WA0NOK,EM28,,,,,,2003 +WA0QII,CM97,,,,,,2003 +WA0RDX,EM17,,,,,,2003 +WA0RJT,EN41,,,,,,2003 +WA0SJR,EM56,,,,,,2003 +WA0TAQ,EN61QU,,,Jonathan,,,2004 +WA0VSL,DM79OB,,,Doug,,50W,08/04 +WA0WPJ,EM29,,,,,,2003 +WA0WQI,EM55AA,,,,,,2003 +WA0WRI,EN10,,,,,,2003 +WA1FVJ,FN31QS,,,Ed,,144: 13B2 40W,08/04 +WA1HOG,FN42AS,,,Dennis,,144: 100W,01/01 +WA1JOF,FN44XV,EME,,,,,2003 +WA1JXN,DN27UB,,,,,,2003 +WA1MBA,FN32SL,,,,,,2003 +WA1MEK,FN42,,,,,,2003 +WA1MKE,EN70GH,,,,,,2003 +WA1OFR,FN42MA,,,Bob,,,01/01 +WA1TMQ,FN31OJ,,,john,,,2003 +WA2ALV,FN33,,,,,,2003 +WA2FGK,FN21ML,EME,,Herb,,144: 4x17B2 Ant.,01/01 +WA2FUZ,FN22XJ,,,,,,2003 +WA2GFP,FN20,,,,,,2003 +WA2JGY,DM79,,,,,,2003 +WA2LSE,FN20,,,,,,2003 +WA2LTM,FN20,,,,,,2003 +WA2VOI,EN35JA,,,,,,2003 +WA2YJF,FN30FR,,,,,,2003 +WA3BZT,FM29EP,EME,,Ed,,144: IC746 8877 1-5KW 4x2MXP28,07/01 +WA3FFC,FN01,EME,,,,,2003 +WA3KQA,EM98LL,,,,,,2003 +WA3RQD,FM19QK,,,Jim,,,2003 +WA3SIX,FN10UB,,,,,,2003 +WA3USG,FN10LL,,,,,,2003 +WA4ALJ,EM63,,,,,,2003 +WA4CHA,EL88QA,,,,,,2003 +WA4DFS,EM96,,,,,,2003 +WA4EWA,EM63LL,,,,,,2003 +WA4HEI,EN65UX,,,,,,2003 +WA4HFN,EM55AB,,,Damon,,,09/01 +WA4JQS,EM77TA,,,Anthony ""Tony",,144: 2x33el 2.5WL50.10050.125,08/01 +WA4LBT,EM95,EME,,,,,2003 +WA4OFS,EL98,EME,,,,,2003 +WA4PCS,EM78,,,,,,2003 +WA4PGJ,EM55,,,,,,2003 +WA4PGM,FM07TI,,,Kyle,,144. 170W 17el,1998 +WA4VWR,EM55,,,,,,2003 +WA4YRK,EM75WV,,,Dave,,IC910 IC756,05/02 +WA4ZTK,EM85,EME,,,,,2003 +WA5CJG,EM15,,,,,,2003 +WA5DJJ,DM62PH,,,,,,2003 +WA5ETV,EM15,EME,,,,,2003 +WA5ICW,EM26,EME,,,,,2003 +WA5IYX,EL09,,,,,,2003 +WA5JAT,EM12ET,,,,,,2003 +WA5JCI,EM21,,,Pete,,,01/01 +WA5KBH,EM30HL,,,,,,2003 +WA5NFC,EM45,,,,,,2003 +WA5TKU,EM13II,,,,,,2003 +WA5TNY,EM12,,,,,,2003 +WA5UAJ,EM32,,,,,,2003 +WA5UFH,EL19,,,,,,09/01 +WA5VKS,EM13PA,,,,,,2003 +WA5WCP,EM12,,,,,,2003 +WA5YOU,EM53EE,,,,,,2003 +WA5YWC,EM13OB,,,,,,2003 +WA5ZIB,EL29,,,,,,2003 +WA6BJE,DM13,EME,,,,,2003 +WA6BYA,CM86,,,,,,2003 +WA6EIW,EM15DI,,,,,,2003 +WA6ERB,DM79,,,,,,2003 +WA6GXF,DM06DX,,,,,,2003 +WA6IJZ,DM44KM,,,,,,2003 +WA6KBL,CM97AG,EME,,,,,2003 +WA6KOU,DN17,,,,,,2003 +WA6LHD,CM88XF,,,Ed,,,01/97 +WA6OWM,DM03TU,,,Ray,,50: 100W Loop - 144: 100W 15el155 3000 MSDSP.,09/01 +WA6PY,DM13LA,EME,,Paul,,2x20el VE7BQH 700W,01/05 +WA6TTY,DM78,,,,,,2003 +WA6UCT,DM34,,,,,,2003 +WA6YGB,DM04WA,,,Howard,,,2003 +WA6ZKY,CM98,EME,,,,,2003 +WA7ADK,DN31WD,EME,,Jerry,,,01/05 +WA7BJU,CN85,,,,,,01/05 +WA7CJO,DM33XL,EME,,,,,2003 +WA7EPU,DM62,,,,,,2003 +WA7GSK,DN13SO,,,Al,,144: 300W 2x16el,01/02 +WA7HQD,DN31XA,,,Lee E.,,,1998 +WA7KHO,DN47,,,,,,2003 +WA7TZY,CN87,EME,,,,,12/00 +WA8CLT,EN80LA,EME,,John,,144: 1500W 4x9M2,08/03 +WA8EUU,EN82,,,,,,2003 +WA8MIL,EN63,,,,,,2003 +WA8NLC,EM73,,,,,,2003 +WA8OGS,EM79,,,,,,2003 +WA8RJF,EN91IQ,,,Tony,,,12/96 +WA8VPD,EN82,EME,,,,,2003 +WA8WZG,EN81OM,EME,,Tom,,.144,01/01 +WA8YTB,EN72JH,,,,,,2003 +WA9BTT,EN40,,,,,,2003 +WA9BVS,EM69WV,,,,,,2003 +WA9ENA,EN42,,,,,,2003 +WA9FWD,EN53,EME,,,,,2003 +WA9HCZ,EN43JV,,,,,,2003 +WA9HIR,EN61CU,,,,,,2003 +WA9HUV,EN51,,,,,,2003 +WA9JML,EN51PW,,,Steve,,,01/01 +WA9NBU,DM14JG,,,Bob,,,2004 +WA9NRB,EM48,,,,,,2003 +WA9O,EN62BX,,,,,,2003 +WA9OUU,EM89,EME,,,,,2003 +WA9PAM,EN44,,,,,,2003 +WA9PSI,EN51,,,,,,2003 +WA9PZL,EM32DN,,,,,,2003 +WB0CLL,EM28,,,,,,2003 +WB0CQO,EN31,,,,,,2003 +WB0DBS,EM17,,,,,,2003 +WB0DGF,EN10PT,,,,,,2003 +WB0DRL,EM18CT,EME,,,,,89 +WB0GAZ,DM79,,,,,,2003 +WB0GGM,EN34,EME,,,,,89 +WB0HXY,EN10,,,,,,2003 +WB0ITA,EM29,,,,,,2003 +WB0IUT,EN10,,,,,,2003 +WB0LJC,EN34JV,,,,,,2003 +WB0MLL,EN35,,,,,,2003 +WB0NCR,EN42,,,,,,2003 +WB0OOL,EM48,,,,,,2003 +WB0QGH,EM84,,,,,,2003 +WB0QIY,EN10,,,,,,2003 +WB0QQS,EN10,,,,,,2003 +WB0SIP,EN10,,,,,,2003 +WB0TEM,EN12RT,EME,,,,,89 +WB0VGI,EN34LL,,,,,,2003 +WB0YFL,EN42,,,,,,2003 +WB0YRQ,EN12,,,,,,2003 +WB0ZJP,EM48,,,,,,2003 +WB1FLD,FN42IW,,,David W.,,,01/02 +WB1GQR,FN33KL,,,Mitch,,,2004 +WB2BYP,FN13FF,EME,,,,144: 4x 9el 8877,01/05 +WB2LSP,FM29DP,,,,,,2003 +WB2OYC,FM29NN,,,,,,2003 +WB2QLP,EL96DE,,,Jordan,,50: 400W- 144: 400W- 432: 170W,01/01 +WB2SEB,FN31DD,,,,,144: 175W 13el - 222: 100W 10el,03/02 +WB2VVV,FN21,EME,,,,,2000 +WB4AXQ,EM64,,,,,,2003 +WB4BKC,EL96,EME,,,,,89 +WB4ECR,EM66QF,,,Michael,,,2004 +WB4EFZ,EM94,,,,,,2003 +WB4GTB,EM73VW,,,john,,,2003 +WB4JEM,EL89QU,,,Jon,,50: 6elQuad 500W - 144: 16x10el preamp 1-5KW,01/01 +WB4KMH,EM75RV,,,Phil,,,01/01 +WB4LHD,EM55DB,EME,,Randy,,,02/05 +WB4NFS,FM18HP,,,Jack,,144: 400W,01/97 +WB4UNA,EM93LV,,,Randy,,ft-736Rr FT847 50: 400W 617 - 144: 250W 17B2,01/05 +WB5AFY,EM04ID,EME,,Dan,,,02/05 +WB5APD,EM84AK,,,Bob,,144: 1.5kw 17 el,01/01 +WB5DSH,EM15,,,,,,2003 +WB5IPM,EM12,,,,,,2003 +WB5KDC,EM15,,,,,,2003 +WB5KYK,EM51JQ,,,,,,2003 +WB5LBT,EM40LK,EME,,R.A. Bob,,,01/01 +WB5NIF,EM42AM,,,,,,2003 +WB5ROR,EM23,,,,,,2003 +WB5TBL,EM12,,,,,,2003 +WB5TCO,EN64,,,,,,2003 +WB5VPC,EM12,,,,,,2003 +WB6WLR,DM13AT,,,Wayne,,144: 8877 2x17B2 - 432: 8938 2xFO33,01/01 +WB7OSE,CN87XT,,,,,,2003 +WB8AGV,EN34,,,,,,2003 +WB8IFM,EM79WS,,,,,,2003 +WB8NUT,EM79UB,,,Duffy,,,2003 +WB8SKP,EN66UC,,,DENIS,,,2004 +WB8TFV,FM19AL,,,,,,2003 +WB8WTB,EN72,,,,,,2003 +WB8XX,EM79,,,Kevin,,,12/00 +WB9BWP,EN52,,,,,,2003 +WB9GKA,EM58,,,,,,2003 +WB9HLM,EN52IW,,,,,,2003 +WB9IHS,EM69,,,,,,2003 +WB9IIV,EM69UL,,,Harry,,,2004 +WB9OGM,EN61,,,,,,2003 +WB9OWN,EN52,,,,,,2003 +WB9SNR,EN62AC,,,,,,2003 +WB9SPT,EN71AS,,,,,,2003 +WB9USX,EM79,,,,,,2003 +WB9UWA,EN50KK,EME,,Jim,,144: 4x UWA12's 18.5 dbd low temperature MC2,10/00 +WB9ZAI,EN61GM,,,,,,2003 +WC9C,EM69HH,,,,,,2003 +WD0AAD,DM79,,,,,,2003 +WD0ALN,EM32,,,,,,2003 +WD0APF,EN10,,,,,,2003 +WD0BQM,DN81CW,,,,,,2003 +WD0CJM,EN25FH,,,,,,2003 +WD0EDO,EN10TL,,,,,,2003 +WD0FCH,EM48,,,,,,2003 +WD0GML,EM48,,,,,,2003 +WD0HOJ,EN41,,,,,,2003 +WD0L,EM17IH,,,,,,2003 +WD0M,DM67KG,,,Joe,,,2004 +WD4ECK,CN82,,,,,,2003 +WD4FAB,EL98HP,,,,,,2003 +WD4KPD,FM15MM,,,David Michael,,,05/02 +WD4MUO,DM79GX,,,,,,2003 +WD4OZN,EM55LK,,,,,,2003 +WD5AGO,EM26BD,EME,,Tommy,,,03/00 +WD5CAN,EM36,,,,,,2003 +WD5CAP,EM36,,,,,,2003 +WD5DJT,EM12OO,,,,,,2003 +WD5EWD,EM22,,,,,,2003 +WD5G,EM05,,,,,,2003 +WD6BXE,DM22,,,,,,2003 +WD8BYA,FM18IP,,,,,,2003 +WD8SDL,EM79,,,,,,2003 +WD9BGA,EN53BA,,,,,,2003 +WD9EGE,EN64,,,,,,2003 +WD9EXD,EN61,,,,,,2003 +WD9FBL,EN61BV,,,,,,2003 +WD9IIX,EN61,,,,,,2003 +WE2Y,FN02SR,EME,,,,,2003 +WE4K,EM77BQ,,,,,,2003 +WE7L,DM41,,,,,,2003 +WE7P,DN13RP,EME,,,,,2003 +WE9D,EN52,,,,,,2003 +WE9Y,EN82EW,EME,,,,,02/05 +WF1F,FN42,,,,,,2003 +WF1R,FN32,,,,,,2003 +WF4R,FM16TS,,,,,,2003 +WF9M,EM79,,,,,,2003 +WH6LR,EM04LL,,,,,,2003 +WJ6T,DM05,,,Bob,,,1998 +WK9E,EN53,,,,,,2003 +WL7M,BO49IR,,,,,,2003 +WL7U,BP51,EME,,Mike,,50: 150W 5el - 144: 300W 2x10el - 432: 900W-,1998 +WM2Z,FN31SA,,,Warren,,,2004 +WM5Y,EN31,,,,,,2003 +WN4BML,EL89LL,,,,,,2003 +WN4KKN,EM10,,,,,,2003 +WN4M,EM66,,,Greg,,100W,01/04 +WO9S,EN61ET,,,,,,2003 +WP4G,FK68VG,EME,,Angel,,144: 1KW 2x2MX28P,10/00 +WP4O,FK68,,,Ed,,144: FT736r 400W 18ft langyagi preamp,01/01 +WQ0P,EM19VF,,,Greg,,,09/01 +WQ5S,EM13RC,EME,,Brad,,144: 12el 50W,02/05 +WQ5W,EM12FW,,,George,,,2004 +WR0F,EM29TC,,,,,,2003 +WR0I,EM17,,,,,,2003 +WR6S,DM14CP,,,,,,2003 +WR9W,EM68FA,,,,,,2003 +WS5R,DM95,,,,,,2003 +WT0W,EN34,,,,,,2003 +WV0K,EN13,,,,,,2003 +WV1K,FN41WR,,,Matt,,,2005 +WV2C,FN30,,,Tony,,144: IC706 180W 15el,1998 +WW2R,EM13QD,,,,,,2003 +WW4T,EM83,,,,,,2003 +WW8M,EN72,,,,,,2003 +WX9M,EN54FL,,,,,,2003 +WY0C,EM17IT,,,,,,2003 +WY0V,EN12,,,Gary,,,1998 +WY3G,EM55,,,,,,2003 +WZ1V,FN31MP,,,Ron,,144: 1kw 2x14el - 222: 500W FO16,01/01 +WZ8D,EM79UG,,,John A.,,50: 1-5KW 6el - 144: 1-5KW 18el,01/01 +WZ9D,EN51,,,,,,2003 +XE1AVM,DK79UA,,,,,,2003 +XE1GE,EK08,,,,,,2003 +XE1GRR,DL80IP,EME,,Tony,,FT736,11/04 +XE1XA,EK09,EME,,,,,2003 +XE2AT,DL81,,,Leon,,144: IC820 200W 13elonly SSB-MS,11/01 +YB0US,OI33JU,,,,,,2003 +YL1A,KO07UN,,,,,,05/03 +YL2GUI,KO06MM,,,Egils,,144: TS-570+FTV-250 9el 30W,03/04 +YL2HA,KO26CV,,,,,,05/04 +YL2KA,KO26AX,,,Jack,,,03/02 +YL2LW,KO26CW,,,,,,11/04 +YL2OK,KO37AS,,,,,,11/04 +YL2OW,KO26WL,,,Janis,,FT736R IC706MKIIG,01/05 +YL3DW,KO26CW,,,,,,11/02 +YL3GDF,KO26XM,,,Vilis,,,05/04 +YL3GDJ,KO26AX,,,,,,01/05 +YM3XC,KN30FC,,,OP: HB9DUR,,,11/02 +YO0IS,KN05PS,,,,,,1993 +YO2AMU,KN06OC,EME,,Doru,,144: 4x16el MGF1302 1KW,02/00 +YO2BBT,KN05WG,,,,,,06/04 +YO2IS,KN05PS,EME,,Suli I. ""Szigy",,144: 4CX250B 10el BF981 - 432: 4X150D 17el 3,06/02 +YO2LEA,KN06WK,,,Nelu,,144: IC-211 lin.Mirage B 215G - 6m and 70,03/01 +YO3DMU,KN34BJ,,,Codrut,,144: TS870 +Trsv 1KW MGF1302 16el.165,02/02 +YO3FFF,KN34CJ,EME,,Cristian ""Cristi",,144: TS450 Trvtr 100W B-310G GaAs Preamp 16el,01/05 +YO3IZI,KN34BK,EME,,Ciprian,,TS2000,01/04 +YO3JW,KN34CK,,,Stefan ""Pit",,144: 400W 16el F9FT 3P602A-2.088.222,04/00 +YO3KWJ,KN24,,,Op YO3JW,,,1993 +YO4AUL,KN44HE,,,Cornelius,,144: FT290r 200W 2x12el MGF1302.150 2000lpm,01/01 +YO4BZC,KN45AK,,,Dorucc,,IC 706 5 el delta loop HM PA 70W,10/04 +YO4FNG,KN44HE,,,Liviu,,144: 350W 6el LY,11/04 +YO4RFV,KN45AK,,,EUGEN,,,08/02 +YO4RXX,KN45AK,,,,,,07/03 +YO5AVN,KN34,,,I.,,,1993 +YO5BIM,KN07XB,,,Puiu,,,05/04 +YO5BWD,KN27GD,,,Aurel,,,08/00 +YO5DJM,KN17,EME,,josif,,,1993 +YO5KAI,KN16TE,EME,,Clubstation,,.149 DTR,06/99 +YO5KAV,KN16TS,EME,,Ion (Nelu),,.149.449,06/99 +YO5TE,KN16TS,EME,,Ion (Nelu),,144: 1KW 4x10el MGF1302.149,01/02 +YO5TP,KN16SS,,,Bela,,144: 40W 16el,11/04 +YO7CGS,KN15OA,,,,,1000lpm,08/97 +YO7CKQ,KN15OA,,,nimara,,,05/01 +YO7IV,KN24MT,,,Ion,,144: TS850 + Tcvr 2x4CX250b 800W 15el 9BV,05/03 +YO7VS,KN14VH,,,Dietmar A. ""Dick",,50: 2XQB3/300 2xBF981 5el LY J-Pol crossdipol,10/98 +YO8BSE,KN36EW,,,Costi,,.075,10/95 +YO8CYN,KN36LW,,,Mihai,,,08/01 +YP0A,KN27GD,,,OP YO5TE,,,1992 +YR0A,KN16TS,EME,,Ion (Nelu),,.149.449,06/99 +YR5A,KN16TS,EME,,Ion (Nelu),,.149.449,06/99 +YR99E,KN34,,,OP YO3JW,,,08/99 +YT1VP,JN94WG,,,Vlada,,TS440 FT225,10/04 +YT1VV,JN94US,,,Vasa,,.135.185,07/00 +YT1W,JN91,,,,,,1990 +YT4D,JN94CP,,,,,144: 250W 11el,08/00 +YT7AC,JN95,,,Stanko,,only SSB-MS,03/97 +YT7W,KN14CF,,,OP YU7AU,,,1993 +YT7WA,KN05EJ,,,OP: YU7MS YZ7UN,,144: 1KW 4x4el Loop 11el WU MGF1302.121,12/01 +YU1ADN,KN03KN,,,m.,,,06/96 +YU1AFS,KN04FT,,,,,,1992 +YU1AZK,KN04,,,,,144: 25W 2x11elonly SSB-MS,10/98 +YU1BT,KN03KN,,,,,.148,10/95 +YU1BW,KN04GT,,,Joco,,,04/02 +YU1CF,KN03QN,EME,,Goran,,144: FT736R IC746PRO 1500W 4x7el,01/05 +YU1EU,KN04DW,,,,,,08/98 +YU1EV,KN04CN,,,Moma,,,05/04 +YU1EXY,KN04FT,,,OP Zoran,,144: FT225rd 350W 16el F9FT MGF13022000lpm,01/02 +YU1HFG,KN02XX,,,,,,12/95 +YU1IO,KN04IQ,,,Milenko,,144: 600W 4x17el,11/97 +YU1L,KN02XX,,,,,,12/95 +YU1LA,KN04FR,,,Ivan,,144: IC746 17B2,04/03 +YU1OO,KN02XX,,,,,,1993 +YU1OS,KN04FS,,,,,144: FT225rd 100W 2x9el MGF1302only SSB-MS,11/99 +YU1S,JN94US,,,Mico 1HQR- Vasa 1VG,,144: 17el 400W.147 1000lpm,11/97 +YU1WP,JN94OM,,,Miroslav (Miro),,.420,07/96 +YU1ZF,KN03IR,,,,,,1991 +YU4AR,JN94AS,,,Zdravko,,144: TR9130 250W 10el PA0MS-ant PreampUHER 15,11/02 +YU7AA,JN95NS,EME,,,,,01/05 +YU7AAA,KN05FJ,,,RadioClub,,144: GS35B 4x10+2x10 el BVO 3WL,11/04 +YU7ACO,KN05QC,,,,,144: FT221r PA 200W 2x 10el. DJ9BV1500lpm,08/00 +YU7AJH,JN95WF,,,,,,1990 +YU7AR,KN05BW,,,Teodor ""Teo",,IC745- FT225RD- 144: 4x5wl MGF1412 YL1056,12/01 +YU7AU,KN04HV,,,ljubisa ""Ljube",,144: 250W 2x11el.093,12/01 +YU7AZX,KN04AX,,,Branislav,,,08/03 +YU7BCL,KN05FW,,,Nesa,,,12/97 +YU7BCX,KN05HP,,,,,,08/96 +YU7CV,JN95WK,,,,,,1995 +YU7EF,KN04HV,EME,,Popa,,FT847,07/04 +YU7EW,KN05HP,,,Istvan ""Pista",,144:500Watt 4x10el MGF1302109 2000lpm MSDSP,04/03 +YU7FF,KN05EP,,,,,,1994 +YU7FU,KN04HV,,,Nesa,,,08/04 +YU7KB,JN94XX,,,Branislav (Bane),,144: IC202 2x11el 800W Preamp (MGF1302).141,02/04 +YU7MS,KN05EF,,,Mihalj ""Miska",,144: 400/1KW 2x11el WU MGF13027000 lpm385,02/05 +YU7ON,KN04AX,,,Zoran,,144. TR751 4x11el 25W1000lpm.442,08/00 +YU7PS,KN05FJ,,,Pal ""Pali",,144: 400/1KW 2x11el WU MGF13027000lpm385,02/05 +YU7VA,KN05EJ,,,Voislav - Voja,,144: 100Watt 11el BFT 66.080 1000lpm.180,05/00 +YU8DM,KN02OQ,,,,,,01/05 +YV5ZZ,FK60SM,EME,,,,,01/05 +YZ1DO,KN04ER,,,,,only SSB-MS,08/99 +YZ1KU,KN04EU,,,Boza,,144: 10W 9el F9FTonly SSB-MS,05/03 +YZ7MON,JN95XA,,,Ilija,,144: TR751E 25W 2x11elonly SSB-MS.383,07/98 +YZ7UN,KN05EI,,,Ivanko,,144: 4x6el Loop 100W,01/01 +Z30B,KN01PA,EME,,Clubstation,,144: 1-5KW 4xYU0B (17-5db) MGF1302.142 150,08/00 +Z31DX,KN11GD,,,George ""Joe",,,06/99 +Z32UC,KN11CR,,,,,,01/05 +Z35Z,KN11CR,EME,,Dimitar ""Dime",,144: IC202 350W 4x4el Loop MGF1302 432: 15,12/04 +Z37CEF,KN01QA,,,Clubstation,,,11/99 +ZA0DXC,KN01,,,OP HG3DXC,,,1991 +ZB0W,IM76HE,,,,,,1993 +ZL1PE,RF74DG,,,,,,2003 +ZL1RS,RF73HD,,,,,,2003 +ZL3AAD,RE66GR,EME,,Graham,,,2003 +ZL3NW,RE66ho,EME,, +ZL3TY,RE57OM,EME,,Bob,,,01/05 +ZP4KFX,GG15LV,,,Giuseppe ""Pino",,,03/01 +ZR1ADI,JF95KU,,,Gilbert,,,01/02 +ZR1AEE,JF96IA,,,Peter,,,01/02 +ZR1EV,JF96IC,,,Shawn,,50: FT690r 200W 4el.200.200,11/96 +ZR1L,JF96HD,,,Chris,,,10/02 +ZR1TRD,JF96HC,,,Andre,,,01/02 +ZR1WZ,KF05QP,,,Werner,,,2004 +ZR2DX,KF26,,,Barry,,,02/02 +ZR5ADQ,KG50IA,,,Mike,,,01/02 +ZR6ABU,KG33XV,,,Craig,,,2003 +ZR6CRW,KG33,,,Craig,,,10/02 +ZR6DXB,KG33XX,,,Barry,,,10/02 +ZR6GE,KG43AR,,,Gavin,,,10/02 +ZR6KHJ,KG43CU,,,Ken,,,02/02 +ZS1EK,JF95FU,,,Bill,,,01/02 +ZS2ACP,KF26SA,,,Andre,,,02/02 +ZS2BWB,KF26TD,,,Ken,,,02/02 +ZS4KB,KG32,,,Johan,,,10/02 +ZS4NS,KG32IA,,,Nico ""Nick",,50: IC551D 6el 80W - QSL via N7RO,02/01 +ZS4TX,KG30BW,,,Bernie,,,01/02 +ZS5AV,KF69GX,,,,,,2003 +ZS5DJ,KG59AA,,,Dave,,,01/02 +ZS5LEE,KG50JF,EME,,Lee,,IC821 706MKIIG,01/05 +ZS5Y,JF59JR,EME,,Derek,,,02/05 +ZS6AVP,KG44OD,,,Clive,,,05/02 +ZS6AXT,KG33VV,EME,,Ivo,,,02/00 +ZS6BTE,KG33XV,,,Ian,,,10/02 +ZS6DTS,KG43AR,,,Dickie,,,10/02 +ZS6EGB,KG43BQ,,,Emil,,,10/02 +ZS6GER,KG33,,,Paul,,,02/02 +ZS6GPM,KG33XU,,,Graham,,,10/02 +ZS6HS,KG33XR,,,Bert,,,01/02 +ZS6JON,KG33VV,,,John,,,10/02 +ZS6NK,KG46RC,,,Paul,,,02/02 +ZS6OB,KG44DE,,,Pine,,,01/02 +ZS6RAD,KG44CA,,,Rad,,,10/02 +ZS6UT,KG44EF,,,Ed,,,01/02 +ZS6WAB,KG46RC,EME,,,,,01/05 +ZS6WB,KG44EE,,,Hal,,,05/02 +ZS6WI,KG46RC,,,Will,,,2003 +ZS6Y,KG33WU,,,Etienne,,,02/02 +ZZZZZZ,End-of-Database,VHF-MS-DATABASE-Viewer © 2002/2005 by DG0KW diff --git a/deep65.F b/deep65.F index 69a1cb5bf..8bfa267a5 100644 --- a/deep65.F +++ b/deep65.F @@ -135,10 +135,10 @@ C If sync=OOO, no CQ messages do i=1,100 if(pp(ntot-i).ne.pp(ntot)) go to 40 enddo - 40 iref=min(ntot-i,nint(0.68*ntot)) - pbias=1.08*pp(ntot-i) - qual=100.0*(p1-pbias) + 40 qual=100.0*(p1-1.08*pp(ntot-i)) + if(mode65.eq.1) qual=100.0*(p1-1.12*pp(ntot-i)) + if(mode65.eq.4) qual=100.0*(p1-1.04*pp(ntot-i)) ! if(mode65.eq.1) qual=100.0*(p1-0.335) ! if(mode65.eq.4) qual=100.0*(p1-0.505) decoded=' ' diff --git a/sync65.f b/sync65.f index b122af494..1be81abf4 100644 --- a/sync65.f +++ b/sync65.f @@ -1,7 +1,7 @@ subroutine sync65(dat,jz,DFTolerance,NFreeze,NAFC,MouseDF, + dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width,ftrack) -C Synhronizes JT65 data, finding the best-fit DT and DF. +C Synchronizes JT65 data, finding the best-fit DT and DF. C NB: at this stage, submodes ABC are processed in the same way. parameter (NP2=60*11025) !Size of data array diff --git a/wsjt.py b/wsjt.py index 2a8bcfa7e..bb997220b 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/wsjt1.F b/wsjt1.F index f5e6c3d8a..5d5be9b5e 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -120,7 +120,7 @@ C Intentionally degrade SNR by -nclip dB. enddo p0=sq/jz p1=p0*10.0**(-0.1*nclip) - dnoise=sqrt(p1-p0) + dnoise=sqrt(4*(p1-p0)) idum=-1 do i=1,jz dat(i)=dat(i) + dnoise*gran(idum) From bc90f17349bedda3c982c7517b46c967a51fbedd Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 25 Jul 2006 01:27:01 +0000 Subject: [PATCH 146/811] Fix comment line in getpfx1.f Fix Windows PttPort assignment in wsjt.py git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@206 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- getpfx1.f | 3 ++- wsjt.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/getpfx1.f b/getpfx1.f index 99bd3ba2d..58f798df8 100644 --- a/getpfx1.f +++ b/getpfx1.f @@ -3,7 +3,8 @@ character callsign*12 character*8 c character addpfx*8 - common/gcom4/addpfx !Can't 'include' *.f90 in *.f +C Can't 'include' *.f90 in *.f + common/gcom4/addpfx include 'pfx.f' iz=index(callsign,' ') - 1 diff --git a/wsjt.py b/wsjt.py index bb997220b..e2a3a21af 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1512,7 +1512,7 @@ def update(): Audio.gcom2.nslim2=isync-4 if nosh441.get()==1 and mode.get()=='FSK441': Audio.gcom2.nslim2=99 try: - Audio.gcom2.nport=int(options.ComPort.get()) + Audio.gcom2.nport=int(options.PttPort.get()) except: Audio.gcom2.nport=0 From 9621999d5209482376b7801513876ee1d47d7318 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 25 Jul 2006 13:12:03 +0000 Subject: [PATCH 147/811] Another tweak to parameters in Deep Search algorithm. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@207 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- deep65.F | 13 ++++++------- wsjt.py | 2 +- wsjt65.f | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/deep65.F b/deep65.F index 8bfa267a5..4ec284660 100644 --- a/deep65.F +++ b/deep65.F @@ -136,21 +136,20 @@ C If sync=OOO, no CQ messages if(pp(ntot-i).ne.pp(ntot)) go to 40 enddo - 40 qual=100.0*(p1-1.08*pp(ntot-i)) - if(mode65.eq.1) qual=100.0*(p1-1.12*pp(ntot-i)) - if(mode65.eq.4) qual=100.0*(p1-1.04*pp(ntot-i)) -! if(mode65.eq.1) qual=100.0*(p1-0.335) -! if(mode65.eq.4) qual=100.0*(p1-0.505) + 40 if(mode65.eq.1) bias=max(1.12*pp(ntot-i),0.335) + if(mode65.eq.2) bias=max(1.08*pp(ntot-i),0.405) + if(mode65.eq.4) bias=max(1.04*pp(ntot-i),0.505) + qual=100.0*(p1-bias) decoded=' ' c=' ' if(qual.gt.1.0) then if(qual.lt.6.0) c='?' decoded=testmsg(ip1) + else + qual=0. endif decoded(22:22)=c - if(qual.lt.0.) qual=0. - if(qual.gt.10.) qual=10. return end diff --git a/wsjt.py b/wsjt.py index e2a3a21af..7b9ddc350 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/wsjt65.f b/wsjt65.f index 6f8cd14d2..738223f0e 100644 --- a/wsjt65.f +++ b/wsjt65.f @@ -149,7 +149,7 @@ C result from the Reed-Solomon decoder. 200 continue kvqual=0 if(ncount.ge.0) kvqual=1 - nqual=qbest + nqual=min(qbest,10.0) if(nqual.ge.nq1 .and.kvqual.eq.0) then dtx=dtbest dfx=dfbest From 7716b6fc31dec4f58b1a407da6d863eff45ba98a Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 26 Jul 2006 14:06:27 +0000 Subject: [PATCH 148/811] - misplaced indentation meant fortran copy of pttport never got set - reworked ptt_unix.c numerous things I did not like anyway. removed gotos's (from original cwdaemon; not my fault!) commented better what was happening refactored code to make it clearer, there was no need to try and do both the open and the parallel port test in one function (cwdaemon again) this just obsfuscated what was happening. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@208 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_unix.c | 115 +++++++++++++++++++++++++++++------------------------ wsjt.py | 2 +- 2 files changed, 64 insertions(+), 53 deletions(-) diff --git a/ptt_unix.c b/ptt_unix.c index 1b98180e5..9dcb8f8a2 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -68,15 +68,13 @@ int lp_ptt (int fd, int onoff); #include /* parport functions */ -int dev_is_parport(const char *fname); +char *get_dev_name(char *fname); +int dev_is_parport(int fd); int ptt_parallel(int fd, int *ntx, int *iptt); int ptt_serial(int fd, int *ntx, int *iptt); int fd=-1; /* Used for both serial and parallel */ - -char nm[MAXPATHLEN]; - /* * ptt_ * @@ -101,26 +99,39 @@ ptt_(int *unused, char *ptt_port, int *ntx, int *iptt) static int state=0; char *p; + /* In the very unlikely event of a NULL pointer, just return. + * Yes, I realise this should not be possible in WSJT. + */ + if (ptt_port == NULL) { + *iptt = *ntx; + return (0); + } + switch (state) { case STATE_PORT_CLOSED: + + /* Remove trailing ' ' */ if ((p = strchr(ptt_port, ' ')) != NULL) *p = '\0'; - if (p == NULL || *p == '\0') { + + /* If all that is left is a '\0' then also just return */ + if (*ptt_port == '\0') { *iptt = *ntx; return(0); } - if ((fd = dev_is_parport(ptt_port)) > 0) { + /* Get ptt_name back or ptt_name with "/dev/" prepended */ + ptt_port = get_dev_name(ptt_port); + if ((fd = open(ptt_port, O_RDWR | O_NDELAY)) < 0) { + fprintf(stderr, "Can't open %s.\n", ptt_port); + return (1); + } + + if (dev_is_parport(fd)) { state = STATE_PORT_OPEN_PARALLEL; lp_reset(fd); - } else { - if ((fd = open(nm, O_RDWR | O_NDELAY)) < 0) { - fprintf(stderr, "Can't open %s.\n", nm); - return(1); - } - else - state = STATE_PORT_OPEN_SERIAL; - } + } else + state = STATE_PORT_OPEN_SERIAL; break; case STATE_PORT_OPEN_PARALLEL: @@ -168,66 +179,66 @@ ptt_serial(int fd, int *ntx, int *iptt) /* parport functions */ +/* + * get_dev_name + * + * inputs - device name + * output - pointer to copy or original name or copy of original + * with "/dev/" prepended + * side effects - Uses local storage for result. + */ + +char * +get_dev_name(char *fname) +{ + static char nm[MAXPATHLEN]; + + if (strchr(fname, '/') != NULL) + strncpy(nm, fname, sizeof(nm)); /* Assume already has /dev/ */ + else + snprintf(nm, sizeof(nm), "/dev/%s", fname); + + return(fname); +} /* - * dev_is_parport(name): check to see whether 'name' is a parallel - * port type character device. Returns non-zero if the device is - * capable of use for a parallel port based keyer, and zero if it - * is not. Unfortunately, this is platform specific. + * dev_is_parport(fd): + * + * inputs - Already open fd + * output - 1 if parallel port, 0 if not + * side effects - Unfortunately, this is platform specific. */ #if defined(HAVE_LINUX_PPDEV_H) /* Linux (ppdev) */ int -dev_is_parport(const char *fname) +dev_is_parport(int fd) { struct stat st; - int fd; int m; - snprintf(nm, sizeof(nm), "/dev/%s", fname); + if ((fstat(fd, &st) == -1) || + ((st.st_mode & S_IFMT) != S_IFCHR) && + (ioctl(fd, PPGETMODE, &m) == -1)) + return(0); - if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) - return(-1); - if (fstat(fd, &st) == -1) - goto out; - if ((st.st_mode & S_IFMT) != S_IFCHR) - goto out; - if (ioctl(fd, PPGETMODE, &m) == -1) - goto out; - return(fd); -out: - close(fd); - return(-1); + return(1); } #elif defined(HAVE_DEV_PPBUS_PPI_H) /* FreeBSD (ppbus/ppi) */ int -dev_is_parport(const char *fname) +dev_is_parport(int fd) { struct stat st; unsigned char c; - int fd; - char *p; - if ((p = strchr(fname, '/')) != NULL) /* Look for /dev */ - snprintf(nm, sizeof(nm), "%s", fname); - else - snprintf(nm, sizeof(nm), "/dev/%s", fname); + if ((fstat(fd, &st) == -1) || + ((st.st_mode & S_IFMT) != S_IFCHR) && + (ioctl(fd, PPISSTATUS, &c) == -1)) + return(0); - if ((fd = open(nm, O_RDWR | O_NONBLOCK)) == -1) - return(-1); - if (fstat(fd, &st) == -1) - goto out; - if ((st.st_mode & S_IFMT) != S_IFCHR) - goto out; - if (ioctl(fd, PPISSTATUS, &c) == -1) - goto out; - return(fd); -out: - close(fd); - return(-1); + return(1); } #else /* Fallback (nothing) */ diff --git a/wsjt.py b/wsjt.py index 7b9ddc350..1d0e20114 100644 --- a/wsjt.py +++ b/wsjt.py @@ -2026,7 +2026,7 @@ try: except: options.PttPort.set("/dev/cuad0") Audio.gcom2.nport=0 - Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] + Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] elif key == 'Mileskm': options.mileskm.set(value) elif key == 'MsgStyle': options.ireport.set(value) elif key == 'Region': options.iregion.set(value) From 401b59aa4db40e1b89c58e1b091dc4bf1585d54c Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 26 Jul 2006 14:12:34 +0000 Subject: [PATCH 149/811] - Oops. missed the /* Fallback (nothing) */ case git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@209 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ptt_unix.c b/ptt_unix.c index 9dcb8f8a2..deeaced4d 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -244,9 +244,9 @@ dev_is_parport(int fd) #else /* Fallback (nothing) */ int -dev_is_parport(const char *fname) +dev_is_parport(int fd) { - return(-1); + return(0); } #endif From 6ff6159461ed40df2d64702f2ec04919608074b3 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 26 Jul 2006 14:24:27 +0000 Subject: [PATCH 150/811] - No, it should be || not && git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@210 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ptt_unix.c b/ptt_unix.c index deeaced4d..4f4adda3d 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -218,7 +218,7 @@ dev_is_parport(int fd) int m; if ((fstat(fd, &st) == -1) || - ((st.st_mode & S_IFMT) != S_IFCHR) && + ((st.st_mode & S_IFMT) != S_IFCHR) || (ioctl(fd, PPGETMODE, &m) == -1)) return(0); @@ -234,7 +234,7 @@ dev_is_parport(int fd) unsigned char c; if ((fstat(fd, &st) == -1) || - ((st.st_mode & S_IFMT) != S_IFCHR) && + ((st.st_mode & S_IFMT) != S_IFCHR) || (ioctl(fd, PPISSTATUS, &c) == -1)) return(0); From 47d59acb8f15e8173e7c20c7f26b1ff7e56fb579 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 29 Jul 2006 14:45:51 +0000 Subject: [PATCH 151/811] - Remove code to handle device names without /dev prepended - use standard open() defines git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@211 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_unix.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/ptt_unix.c b/ptt_unix.c index 4f4adda3d..98eae45a0 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -68,7 +68,6 @@ int lp_ptt (int fd, int onoff); #include /* parport functions */ -char *get_dev_name(char *fname); int dev_is_parport(int fd); int ptt_parallel(int fd, int *ntx, int *iptt); int ptt_serial(int fd, int *ntx, int *iptt); @@ -120,9 +119,7 @@ ptt_(int *unused, char *ptt_port, int *ntx, int *iptt) return(0); } - /* Get ptt_name back or ptt_name with "/dev/" prepended */ - ptt_port = get_dev_name(ptt_port); - if ((fd = open(ptt_port, O_RDWR | O_NDELAY)) < 0) { + if ((fd = open(ptt_port, O_RDWR|O_NONBLOCK)) < 0) { fprintf(stderr, "Can't open %s.\n", ptt_port); return (1); } @@ -179,28 +176,6 @@ ptt_serial(int fd, int *ntx, int *iptt) /* parport functions */ -/* - * get_dev_name - * - * inputs - device name - * output - pointer to copy or original name or copy of original - * with "/dev/" prepended - * side effects - Uses local storage for result. - */ - -char * -get_dev_name(char *fname) -{ - static char nm[MAXPATHLEN]; - - if (strchr(fname, '/') != NULL) - strncpy(nm, fname, sizeof(nm)); /* Assume already has /dev/ */ - else - snprintf(nm, sizeof(nm), "/dev/%s", fname); - - return(fname); -} - /* * dev_is_parport(fd): * @@ -291,7 +266,7 @@ parport_control (int fd, unsigned char controlbits, int values) } #endif -/* open port and setup ppdev */ +/* Initialise a parallel port, given open fd */ int lp_init (int fd) { From 5993b3952d85ffc229e42ba561be1111f78ad17a Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 29 Jul 2006 16:00:59 +0000 Subject: [PATCH 152/811] 1. New routine "ftpeak65" for peaking up in frequency and time, and for AFC. 2. Removed the "itry" loop in wsjt65, speeding up JT65 decodes. 3. A dded Deep Search to avemsg65. 4. Changed "Decoding" menu accordingly. Karn RS decoder used only if KV decoder not present. 5. Removed sort from deep65; find 1st and 2nd largest values directly. 6. Fixed Makefile.win. (Still need to fix *nix Makefile.) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@212 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.win | 3 +- avemsg65.f | 24 ++++++-- decode65.f | 28 ++++----- deep65.F | 29 +++++----- extract.f | 9 +-- fil651.f | 67 ++++++++++++++++++++++ fil652.f | 44 +++++++++++++++ fil653.f | 49 ++++++++++++++++ ftpeak65.f | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++ spec2d65.f | 11 +++- sync65.f | 13 +---- wsjt.py | 20 +++---- wsjt1.F | 2 +- wsjt65.f | 105 ++++++++++++++-------------------- 14 files changed, 433 insertions(+), 128 deletions(-) create mode 100644 fil651.f create mode 100644 fil652.f create mode 100644 fil653.f create mode 100644 ftpeak65.f diff --git a/Makefile.win b/Makefile.win index 980ac0286..a9158df9c 100644 --- a/Makefile.win +++ b/Makefile.win @@ -38,7 +38,8 @@ SRCS2F77 = wsjt1.f avesp2.f bzap.f spec441.f spec2d.f mtdecode.f \ sync65.f unpackcall.f unpackgrid.f unpackmsg.f unpacktext.f \ xcor.f xfft.f xfft2.f wsjt65.f astro.f azdist.f coord.f dcoord.f \ deg2grid.f dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f \ - moon2.f MoonDop.f sun.f toxyz.f pfxdump.f + moon2.f MoonDop.f sun.f toxyz.f pfxdump.f \ + ftpeak65.f fil651.f fil652.f fil653.f symsync65.f SRCS2C = resample.c ptt.c igray.c wrapkarn.c diff --git a/avemsg65.f b/avemsg65.f index 407a1e541..2229c2957 100644 --- a/avemsg65.f +++ b/avemsg65.f @@ -1,9 +1,12 @@ - subroutine avemsg65(mseg,mode65,ndepth,decoded,nused,ns,ncount) + subroutine avemsg65(mseg,mode65,ndepth,decoded,nused, + + nq1,nq2,neme,nsked,flip,mycall,hiscall,hisgrid,qual, + + ns,ncount) C Decodes averaged JT65 data for the specified segment (mseg=1 or 2). parameter (MAXAVE=120) !Max avg count is 120 - character decoded*22 + character decoded*22,deepmsg*22 + character mycall*12,hiscall*12,hisgrid*6 real s3(64,63) common/ave/ppsave(64,63,MAXAVE),nflag(MAXAVE),nsave,iseg(MAXAVE) @@ -12,6 +15,8 @@ C and the number of spectra flagged as good. nused=0 ns=0 + nqual=0 + deepmsg=' ' do i=1,nsave if(iseg(i).eq.mseg) then ns=ns+1 @@ -32,13 +37,24 @@ C Compute the average of all flagged spectra for this segment. nadd=nused*mode65 call extract(s3,nadd,ndepth,ncount,decoded) !Extract the message - 100 if(nused.lt.1.or.ncount.lt.0) decoded=' ' + if(ncount.lt.0) decoded=' ' + + nqual=0 +C Possibly should pass nadd=nused, also: + if(ndepth.ge.3) then + call deep65(s3,mode65,neme,nsked,flip, + + mycall,hiscall,hisgrid,deepmsg,qual) + nqual=qual + if(nqual.lt.nq1) deepmsg=' ' + if(nqual.ge.nq1 .and. nqual.lt.nq2) deepmsg(19:19)='?' + endif + if(ncount.lt.0) decoded=deepmsg C Suppress "birdie messages": if(decoded(1:7).eq.'000AAA ') decoded=' ' if(decoded(1:7).eq.'0L6MWK ') decoded=' ' -! print*,mseg,nused,' ',decoded + 100 if(nused.lt.1) decoded=' ' return end diff --git a/decode65.f b/decode65.f index 4c4eac0a5..7d4811114 100644 --- a/decode65.f +++ b/decode65.f @@ -1,5 +1,5 @@ subroutine decode65(dat,npts,dtx,dfx,flip,ndepth,neme,nsked, - + mycall,hiscall,hisgrid,mode65,lsave,ftrack,decoded,ncount, + + nsnr,mycall,hiscall,hisgrid,mode65,nafc,decoded,ncount, + deepmsg,qual) C Decodes JT65 data, assuming that DT and DF have already been determined. @@ -8,7 +8,6 @@ C Decodes JT65 data, assuming that DT and DF have already been determined. real s2(77,126) real s3(64,63) real ftrack(126) - logical lsave character decoded*22,deepmsg*22 character mycall*12,hiscall*12,hisgrid*6 include 'avecom.h' @@ -19,9 +18,9 @@ C Decodes JT65 data, assuming that DT and DF have already been determined. istart=nint(dtx/dt) !Start index for synced FFTs nsym=126 -C Compute FFTs of symbols +C Compute spectra of the channel symbols f0=1270.46 + dfx - call spec2d65(dat,npts,nsym,flip,istart,f0,ftrack,mode65,s2) + call spec2d65(dat,npts,nsym,flip,istart,f0,ftrack,nafc,mode65,s2) do j=1,63 k=mdat(j) !Points to data symbol @@ -33,9 +32,9 @@ C Compute FFTs of symbols nadd=mode65 call extract(s3,nadd,ndepth,ncount,decoded) !Extract the message -c if(lsave) call deep65(s3,mode65,neme,nsked,flip,mycall,hiscall,hisgrid, - call deep65(s3,mode65,neme,nsked,flip,mycall,hiscall,hisgrid, - + deepmsg,qual) + qual=0. + if(ndepth.ge.1) call deep65(s3,mode65,neme, + + nsked,flip,mycall,hiscall,hisgrid,deepmsg,qual) if(ncount.lt.0) decoded=' ' @@ -43,15 +42,12 @@ C Suppress "birdie messages": if(decoded(1:7).eq.'000AAA ') decoded=' ' if(decoded(1:7).eq.'0L6MWK ') decoded=' ' -C If ncount>=0 or if this is the "0,0" run, save spectrum in ppsave: -C Q: should ftrack be used here? - 100 if((ncount.ge.0 .or. lsave)) then - do j=1,63 - k=mdat(j) - if(flip.lt.0.0) k=mdat2(j) - call move(s2(8,k),ppsave(1,j,nsave),64) - enddo - endif +C Save symbol spectra for possible decoding of average. + do j=1,63 + k=mdat(j) + if(flip.lt.0.0) k=mdat2(j) + call move(s2(8,k),ppsave(1,j,nsave),64) + enddo return end diff --git a/deep65.F b/deep65.F index 4ec284660..d2c9dba97 100644 --- a/deep65.F +++ b/deep65.F @@ -3,7 +3,6 @@ parameter (MAXCALLS=7000,MAXRPT=63) real s3(64,63) - real pp(2*MAXCALLS + 2 + MAXRPT) character callsign*12,grid*4,message*22,hisgrid*6,c*1,ceme*3 character*12 mycall,hiscall character*22 decoded,deepmsg @@ -75,6 +74,7 @@ mz=1 if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1 .and. + flip.gt.0.0) mz=MAXRPT+1 +C Test for messages with MyCall + HisCall + report do m=1,mz if(m.gt.1) grid=rpt(m-1) if(j3.lt.1 .and.j4.lt.1) @@ -101,44 +101,41 @@ enddo p1=-1.e30 - ip1=0 + p2=-1.e30 n=0 do k=1,ntot C If sync=OOO, no CQ messages if(flip.lt.0.0 .and. testmsg(k)(1:3).eq.'CQ ') go to 30 sum=0. ref=ref0 - nhard=0 do j=1,63 i=ncode(j,k)+1 sum=sum + s3(i,j) if(i.eq.mrs(j)) then ref=ref - s3(i,j) + s3(mrs2(j),j) - nhard=nhard+1 endif enddo p=sum/ref -! p=sum/ref0 n=n+1 - pp(n)=p if(p.gt.p1) then + if(p1.gt.p2) then + p2=p1 + ip2=ip1 + endif p1=p ip1=k - sum1=sum - ref1=ref - nhard1=nhard + else if(p.gt.p2 .and. p.lt.p1) then + p2=p + ip2=k endif 30 enddo ntot=n - call sort(ntot,pp) - do i=1,100 - if(pp(ntot-i).ne.pp(ntot)) go to 40 - enddo - 40 if(mode65.eq.1) bias=max(1.12*pp(ntot-i),0.335) - if(mode65.eq.2) bias=max(1.08*pp(ntot-i),0.405) - if(mode65.eq.4) bias=max(1.04*pp(ntot-i),0.505) + 40 if(mode65.eq.1) bias=max(1.12*p2,0.335) + if(mode65.eq.2) bias=max(1.08*p2,0.405) + if(mode65.ge.4) bias=max(1.04*p2,0.505) + qual=100.0*(p1-bias) decoded=' ' c=' ' diff --git a/extract.f b/extract.f index ca9db6917..1bebeca9d 100644 --- a/extract.f +++ b/extract.f @@ -20,12 +20,13 @@ call interleave63(mrsym,-1) call interleave63(mrprob,-1) - ndec=0 + ndec=1 nemax=30 maxe=8 - if(ndepth.ge.2) ndec=1 - if(ndepth.eq.2) xlambda=13.0 - if(ndepth.eq.3) xlambda=15.0 +! if(ndepth.ge.2) ndec=1 +! if(ndepth.eq.2) xlambda=13.0 +! if(ndepth.eq.3) xlambda=15.0 + xlambda=15.0 if(ndec.eq.1) then call graycode(mr2sym,63,-1) diff --git a/fil651.f b/fil651.f new file mode 100644 index 000000000..90d3509ba --- /dev/null +++ b/fil651.f @@ -0,0 +1,67 @@ + subroutine fil651(d,n1,c,n2) + +C FIR lowpass mixing filter designed with ScopeFIR. Real in, complex out. + +C fsample = 5512.5 Hz +C Ntaps = 31 +C fc = 1000 Hz +C fstop = 1378.125 Hz +C Ripple = 0.5 dB +C Stop Atten = 50 dB +C fmix = 1378.125 Hz +C fout = 2706.25 Hz + + parameter (NTAPS=31) + parameter (NH=NTAPS/2) + parameter (NDOWN=2) !Downsample ratio + + real d(n1) + complex c(*) + + complex ck(-NH:NH) + data ck/ + + (-0.000000073578,-0.000859869243), + + ( 0.008518289457,-0.000000680308), + + ( 0.000000834309, 0.011250152594), + + (-0.001061705254, 0.000000072679), + + ( 0.000000875897, 0.013958392128), + + (-0.010047338711, 0.000000573160), + + ( 0.000000770320, 0.015003869984), + + (-0.025027880956, 0.000001142192), + + ( 0.000000285583, 0.007151700551), + + (-0.043634723888, 0.000001493512), + + (-0.000000478847,-0.016788108005), + + (-0.061886192046, 0.000001412144), + + (-0.000001258694,-0.073548459509), + + (-0.075261027462, 0.000000858668), + + (-0.000001749252,-0.306638863572), + + ( 0.419826269508, 0.000000000000), + + (-0.000001749252, 0.306638863572), + + (-0.075261027462,-0.000000858668), + + (-0.000001258694, 0.073548459509), + + (-0.061886192046,-0.000001412144), + + (-0.000000478847, 0.016788108005), + + (-0.043634723888,-0.000001493512), + + ( 0.000000285583,-0.007151700551), + + (-0.025027880956,-0.000001142192), + + ( 0.000000770320,-0.015003869984), + + (-0.010047338711,-0.000000573160), + + ( 0.000000875897,-0.013958392128), + + (-0.001061705254,-0.000000072679), + + ( 0.000000834309,-0.011250152594), + + ( 0.008518289457, 0.000000680308), + + (-0.000000073578, 0.000859869243)/ + + n2=(n1-NTAPS+NDOWN)/NDOWN + k0=NH-NDOWN+1 + + do i=1,n2 + c(i)=0. + k=k0 + NDOWN*i + do j=-NH,NH + c(i)=c(i) + d(j+k)*conjg(ck(j)) + enddo + enddo + + return + end diff --git a/fil652.f b/fil652.f new file mode 100644 index 000000000..90aafc15a --- /dev/null +++ b/fil652.f @@ -0,0 +1,44 @@ + subroutine fil652(c1,n1,c2,n2) + +C FIR lowpass filter designed using ScopeFIR + +C fsample = 2756.25 Hz +C Ntaps = 31 +C fc = 500 Hz +C fstop = 689.0625 Hz +C Ripple = 0.5 dB +C Stop Atten = 50 dB +C fout = 1378.125 Hz + + parameter (NTAPS=31) + parameter (NH=NTAPS/2) + parameter (NDOWN=2) !Downsample ratio + complex c1(n1) + complex c2(*) + +C Filter coefficients: + real a(-NH:NH) + data a/ + + -0.000859869246,-0.008518289484,-0.011250152625,-0.001061705256, + + 0.013958392156, 0.010047338728,-0.015003870003,-0.025027880982, + + 0.007151700557, 0.043634723913, 0.016788108012,-0.061886192062, + + -0.073548459520, 0.075261027466, 0.306638863577, 0.419826269508, + + 0.306638863577, 0.075261027466,-0.073548459520,-0.061886192062, + + 0.016788108012, 0.043634723913, 0.007151700557,-0.025027880982, + + -0.015003870003, 0.010047338728, 0.013958392156,-0.001061705256, + + -0.011250152625,-0.008518289484,-0.000859869246/ + + n2=(n1-NTAPS+NDOWN)/NDOWN + k0=NH-NDOWN+1 + +C Loop over all output samples + do i=1,n2 + c2(i)=0. + k=k0 + NDOWN*i + do j=-NH,NH + c2(i)=c2(i) + c1(j+k)*a(j) + enddo + enddo + + return + end diff --git a/fil653.f b/fil653.f new file mode 100644 index 000000000..b97b1fa77 --- /dev/null +++ b/fil653.f @@ -0,0 +1,49 @@ + subroutine fil653(c1,n1,c2,n2) + +C FIR lowpass filter designed using ScopeFIR + +C fsample = 1378.125 Hz +C Ntaps = 45 +C fc = 100 Hz +C fstop = 172.265625 Hz +C Ripple = 0.5 dB +C Stop Atten = 50 dB +C fout = 172.265625 Hz +C BW = 200 Hz + + parameter (NTAPS=45) + parameter (NH=NTAPS/2) + parameter (NDOWN=4) !Downsample ratio + complex c1(n1) + complex c2(*) + +C Filter coefficients: + real a(-NH:NH) + data a/ + + -0.000005569862,-0.002503777832,-0.004040335617,-0.005717910288, + + -0.006153385485,-0.004446125293,-0.000305215272, 0.005557289511, + + 0.011329120672, 0.014496551280, 0.012703875898, 0.004837591829, + + -0.008060363689,-0.022474422302,-0.032964876083,-0.033575486327, + + -0.019743889907, 0.009895672340, 0.052467109908, 0.101031155027, + + 0.146073001698, 0.177927966814, 0.189427119395, 0.177927966814, + + 0.146073001698, 0.101031155027, 0.052467109908, 0.009895672340, + + -0.019743889907,-0.033575486327,-0.032964876083,-0.022474422302, + + -0.008060363689, 0.004837591829, 0.012703875898, 0.014496551280, + + 0.011329120672, 0.005557289511,-0.000305215272,-0.004446125293, + + -0.006153385485,-0.005717910288,-0.004040335617,-0.002503777832, + + -0.000005569862/ + + n2=(n1-NTAPS+NDOWN)/NDOWN + k0=NH-NDOWN+1 + +C Loop over all output samples + do i=1,n2 + c2(i)=0. + k=k0 + NDOWN*i + do j=-NH,NH + c2(i)=c2(i) + c1(j+k)*a(j) + enddo + enddo + + return + end diff --git a/ftpeak65.f b/ftpeak65.f new file mode 100644 index 000000000..bdd3cbe93 --- /dev/null +++ b/ftpeak65.f @@ -0,0 +1,157 @@ + subroutine ftpeak65(dat,jz,istart,f0,flip,pr,nafc,ftrack) + +C Do the the JT65 "peakup" procedure in frequency and time; then +C compute ftrack. + + parameter (NMAX=30*11025) + parameter (NS=1024) + real dat(jz) + real pr(126) + real ftrack(126) + complex c2(NMAX/2) + complex c3(NMAX/4) + complex c4(NMAX/16) + complex c5(NMAX/64) + complex c6(NMAX/64) + complex z + real s(NMAX/64) + real ccf(-128:128) + real c(-50:50,8) + real*8 pha,dpha,twopi,dt,fsyncset + + twopi=8*datan(1.d0) + fsyncset=-300.d0 + dt=2.d0/11025.d0 !Input dt (WSJT has downsampled by 2) + call fil651(dat,jz,c2,n2) !Filter and complex mix; rate 1/2 + dt=2.d0*dt !We're now downsampled by 4 + + dpha=twopi*dt*(f0-fsyncset) !Put sync tone at fsyncset + pha=0. + do i=1,n2 + pha=pha+dpha + c2(i)=c2(i) * cmplx(cos(pha),-sin(pha)) + enddo + + call fil652(c2,n2,c3,n3) !Low-pass at +/- 500 Hz; rate 1/2 + dt=2.d0*dt !Down by 8 + + dpha=twopi*dt*fsyncset !Mix sync tone to f=0 + pha=0. + do i=1,n3 + pha=pha+dpha + c3(i)=c3(i) * cmplx(cos(pha),-sin(pha)) + enddo + + call fil653(c3,n3,c4,n4) !Low-pass at +/- 100 Hz; rate 1/4 + dt=4.d0*dt !Down by 32 + + call fil653(c4,n4,c5,n5) !Low-pass at +/- 25 Hz; rate 1/4 + dt=4.d0*dt !Down by 128 + +C Use f0 and istart (as found by sync65) and do CCFs against the +C pr(126) array to get improved symbol synchronization. +C NB: if istart is increased by 64, kpk will decrease by 1. + + k0=nint(istart/64.0 - 7.0) + call symsync65(c5,n5,k0,s,flip,pr,16,kpk,ccf,smax) + +C Fix up the value of istart. (The -1 is empirical.) + istart=istart + 64.0*(kpk-1.0) + +C OK, we have symbol synchronization. Now find peak ccf value as a +C function of DF, for each group of 16 symbols. + +C What about using filter fil657? + + df=0.25*11025.0/4096.0 !Oversample to get accurate peak + idfmax=50 + iz=n5-31 + do idf=-idfmax,idfmax + dpha=twopi*idf*df*dt + pha=0. + do i=1,iz + pha=pha+dpha + c6(i)=c5(i) * cmplx(cos(pha),-sin(pha)) + enddo + + z=0. + do i=1,32 + z=z + c6(i) + enddo + s(1)=real(z)*real(z) + aimag(z)*aimag(z) + do i=33,n5 + z=z + c6(i) - c6(i-32) + s(i-31)=real(z)*real(z) + aimag(z)*aimag(z) + enddo + + do n=1,8 + ia=nint((n-1)*126.0/8.0 + 1.0) + ib=ia+15 + sum=0. + do i=ia,ib + j=32*(i-1) + k0 + kpk + if(j.ge.1 .and. j.le.iz) sum=sum + flip*pr(i)*s(j) + enddo + c(idf,n)=sum/smax + enddo + enddo + +C Get drift rate and compute ftrack. +! call getfdot(c,nafc,ftrack) + + jmax=0 + if(nafc.eq.1) jmax=25 + ssmax=0. + do j=-jmax,jmax + do i=-25,25 + ss=0. + xj=j/7.0 + do n=1,8 + k=nint(i+(n-4.5)*xj) + ss=ss + c(k,n) + enddo + if(ss.gt.ssmax) then + ssmax=ss + ipk=i + jpk=j + endif + enddo + enddo + + df=0.25*11025.0/4096.0 + dfreq=ipk*df + fdot=jpk*df*60.0/(0.875*46.8) + + do i=1,126 + ftrack(i)=dfreq + fdot*(46.8/60.0)*(i-63.5)/126.0 + enddo + + pha=0. + i0=k0 + kpk + 2000 + do i=1,iz + k=nint(63.5 + (i-i0)/32.0) + if(k.lt.1) k=1 + if(k.gt.126) k=126 + dpha=twopi*dt*ftrack(k) + pha=pha+dpha + c6(i)=c5(i) * cmplx(cos(pha),-sin(pha)) + enddo + + z=0. + do i=1,32 + z=z + c6(i) + enddo + s(1)=real(z)*real(z) + aimag(z)*aimag(z) + do i=33,n5 + z=z + c6(i) - c6(i-32) + s(i-31)=real(z)*real(z) + aimag(z)*aimag(z) + enddo + + sum=0. + do i=1,126 + j=32*(i-1)+k0+kpk + if(j.ge.1 .and. j.le.iz) sum=sum + flip*pr(i)*s(j) + enddo + + return + end diff --git a/spec2d65.f b/spec2d65.f index 7ca972843..c37f55d8f 100644 --- a/spec2d65.f +++ b/spec2d65.f @@ -1,5 +1,5 @@ subroutine spec2d65(dat,jz,nsym,flip,istart,f0, - + ftrack,mode65,s2) + + ftrack,nafc,mode65,s2) C Computes the spectrum for each of 126 symbols. C NB: At this point, istart, f0, and ftrack are supposedly known. @@ -7,7 +7,7 @@ C The JT65 signal has Sync bin + 2 guard bins + 64 data bins = 67 bins. C We add 5 extra bins at top and bottom for drift, making 77 bins in all. parameter (NMAX=2048) !Max length of FFTs - real dat(jz) !Raw data + real dat(jz) !Raw data real s2(77,126) !Spectra of all symbols real s(77) real ref(77) @@ -22,12 +22,19 @@ c complex work(NMAX) data twopi/6.28318530718d0/ save +C Peak up in frequency and time, and compute ftrack. + call ftpeak65(dat,jz,istart,f0,flip,pr,nafc,ftrack) + nfft=2048/mode65 !Size of FFTs nh=nfft/2 dt=2.0/11025.0 df=0.5*11025.0/nfft call zero(ps,77) k=istart-nfft + +C NB: this could be done starting with array c3, in ftpeak65, instead +C of the dat() array. Would save some time this way ... + do j=1,nsym call zero(s,77) do m=1,mode65 diff --git a/sync65.f b/sync65.f index 1be81abf4..3e5738262 100644 --- a/sync65.f +++ b/sync65.f @@ -1,5 +1,5 @@ subroutine sync65(dat,jz,DFTolerance,NFreeze,NAFC,MouseDF, - + dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width,ftrack) + + dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width) C Synchronizes JT65 data, finding the best-fit DT and DF. C NB: at this stage, submodes ABC are processed in the same way. @@ -16,7 +16,6 @@ C NB: at this stage, submodes ABC are processed in the same way. real ccfred(-224:224) !Peak of ccfblue, as function of freq real tmp(450) integer itry(100) - real ftrack(126) save C Do FFTs of symbol length, stepped by half symbols. Note that we have @@ -95,15 +94,6 @@ C If we found nothing with snrx > -30 dB, take the best sync that *was* found. flippk=flippk2 endif -C Generate frequency-tracking information - if(NAFC.eq.1) then - call afc65(s2,ipk,lagpk,flippk,ftrack) - else - do j=1,126 - ftrack(j)=0. - enddo - endif - C Peak up in frequency to fraction of channel base=0.25*(psavg(ipk-3)+psavg(ipk-2)+psavg(ipk+2)+psavg(ipk+3)) ! call peakup(psavg(ipk-1),psavg(ipk),psavg(ipk+1),dx) @@ -177,4 +167,3 @@ C Compute width of sync tone to outermost -3 dB points return end - include 'afc65.f' diff --git a/wsjt.py b/wsjt.py index 1d0e20114..f9bacd87a 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw @@ -64,7 +64,6 @@ mode=StringVar() mode.set("") mrudir=os.getcwd() nafc=IntVar() -naggressive=IntVar() naz=0 ndepth=IntVar() nel=0 @@ -1500,7 +1499,6 @@ def update(): Audio.gcom2.neme=neme.get() Audio.gcom2.ndepth=ndepth.get() Audio.gcom2.nsked=nsked.get() - Audio.gcom2.naggressive=naggressive.get() try: Audio.gcom2.idinterval=options.IDinterval.get() except: @@ -1602,12 +1600,16 @@ decodemenu.FSK441=Menu(decodemenu,tearoff=0) decodemenu.FSK441.add_checkbutton(label='No shorthands',variable=nosh441) decodemenu.JT65=Menu(decodemenu,tearoff=0) decodemenu.JT65.add_checkbutton(label='Only EME calls',variable=neme) -decodemenu.JT65.add_checkbutton(label='Aggressive',variable=naggressive) decodemenu.JT65.add_checkbutton(label='No Shorthands if Tx 1',variable=noshjt65) decodemenu.JT65.add_separator() -decodemenu.JT65.add_radiobutton(label = 'Fast', variable=ndepth, value=1) -decodemenu.JT65.add_radiobutton(label = 'Normal', variable=ndepth, value=2) -decodemenu.JT65.add_radiobutton(label = 'Exhaustive', variable=ndepth, value=3) +decodemenu.JT65.add_radiobutton(label = 'No Deep Search', + variable=ndepth, value=0) +decodemenu.JT65.add_radiobutton(label = 'Normal Deep Search', + variable=ndepth, value=1) +decodemenu.JT65.add_radiobutton(label = 'Aggressive Deep Search', + variable=ndepth, value=2) +decodemenu.JT65.add_radiobutton(label ='Include Average in Aggressive Deep Search', + variable=ndepth, value=3) decodemenu.add_cascade(label = 'FSK441',menu=decodemenu.FSK441) decodemenu.add_cascade(label = 'JT65',menu=decodemenu.JT65) @@ -1965,7 +1967,7 @@ ldate.after(100,update) lauto=0 isync=1 ntx.set(1) -ndepth.set(2) +ndepth.set(1) import options options.defaults() @@ -2079,7 +2081,6 @@ try: elif key == 'Sked': nsked.set(value) elif key == 'NoSh441': nosh441.set(value) elif key == 'NoShJT65': noshjt65.set(value) - elif key == 'Aggressive': naggressive.set(value) elif key == 'NEME': neme.set(value) elif key == 'NDepth': ndepth.set(value) elif key == 'Debug': ndebug.set(value) @@ -2174,7 +2175,6 @@ f.write("NAFC " + str(nafc.get()) + "\n") f.write("Sked " + str(nsked.get()) + "\n") f.write("NoSh441 " + str(nosh441.get()) + "\n") f.write("NoShJT65 " + str(noshjt65.get()) + "\n") -f.write("Aggressive " + str(naggressive.get()) + "\n") f.write("NEME " + str(neme.get()) + "\n") f.write("NDepth " + str(ndepth.get()) + "\n") f.write("Debug " + str(ndebug.get()) + "\n") diff --git a/wsjt1.F b/wsjt1.F index 5d5be9b5e..1b3c367d8 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -198,7 +198,7 @@ C Intentionally degrade SNR by -nclip dB. ! Offset data by about 1 s. if(jz.ge.126*2048) call wsjt65(dat(4097),jz-4096,cfile6, + NClearAve,MinSigdB,DFTolerance,NFreeze,NAFC,mode65,Nseg, - + MouseDF,NAgain,naggressive,ndepth,neme,nsked, + + MouseDF,NAgain,ndepth,neme,nsked, + mycall,hiscall,hisgrid,lumsg,lcum,nspecial,ndf, + nstest,dfsh,iderrsh,idriftsh,snrsh, + NSyncOK,ccf,psavg,ndiag,nwsh) diff --git a/wsjt65.f b/wsjt65.f index 738223f0e..70489549c 100644 --- a/wsjt65.f +++ b/wsjt65.f @@ -1,6 +1,6 @@ subroutine wsjt65(dat,npts,cfile6,NClearAve,MinSigdB, + DFTolerance,NFreeze,NAFC,mode65,Nseg,MouseDF,NAgain, - + naggressive,ndepth,neme,nsked,mycall,hiscall,hisgrid, + + ndepth,neme,nsked,mycall,hiscall,hisgrid, + lumsg,lcum,nspecial,ndf,nstest,dfsh,iderrsh,idriftsh, + snrsh,NSyncOK,ccfblue,ccfred,ndiag,nwsh) @@ -37,6 +37,8 @@ C already been done. ave2=' ' endif + naggressive=0 + if(ndepth.ge.2) naggressive=1 nq1=3 nq2=6 if(naggressive.eq.1) nq1=1 @@ -55,10 +57,11 @@ C already been done. C Attempt to synchronize: look for sync tone, get DF and DT. call sync65(dat,npts,DFTolerance,NFreeze,NAFC,MouseDF, - + dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width,ftrack) + + dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width) f0=1270.46 + dfx csync=' ' decoded=' ' + deepmsg=' ' special=' ' cooo=' ' itry=0 @@ -66,7 +69,6 @@ C Attempt to synchronize: look for sync tone, get DF and DT. ncount1=-1 !Flag for RS Decode of ave1 ncount2=-1 !Flag for RS Decode of ave2 NSyncOK=0 - qbest=0. if(nsave.lt.MAXAVE .and. (NAgain.eq.0 .or. NClearAve.eq.1)) + nsave=nsave+1 @@ -110,51 +112,15 @@ C If we get here, we have achieved sync! cooo='O ?' endif -C Do a "peakup search" over DT, looking for successful -C result from the Reed-Solomon decoder. - itrymax=1 - if(ndepth.eq.2) itrymax=1 - if(ndepth.eq.3) itrymax=5 - - do itry=1,itrymax - idt=itf(1,itry) - idf=itf(2,itry) - dtxx=dtx + idt*0.036 !### Was 0.012 ### - dfxx=dfx + mode65*idf*1.346 - lmid=.false. - if(itry.eq.1) lmid=.true. - call decode65(dat,npts,dtxx,dfxx,flip,ndepth,neme,nsked, - + mycall,hiscall,hisgrid,mode65,lmid,ftrack,decoded, - + ncount,deepmsg,qual) - if(ncount.eq.-999) then - qbest=0 !Bad data - go to 200 - endif - if(qual.gt.qbest) then - qbest=qual - dtbest=dtxx - dfbest=dfxx - deepbest=deepmsg - itrybest=itry - endif - if(ncount.ge.0) then - dtx=dtxx !Successful decode - dfx=dfxx - go to 200 - endif - enddo - itry=itrybest - ncount=-1 - - 200 continue - kvqual=0 + call decode65(dat,npts,dtx,dfx,flip,ndepth,neme,nsked, + + nsnr,mycall,hiscall,hisgrid,mode65,nafc,decoded, + + ncount,deepmsg,qual) + if(ncount.eq.-999) qual=0 !Bad data + 200 kvqual=0 if(ncount.ge.0) kvqual=1 - nqual=min(qbest,10.0) - if(nqual.ge.nq1 .and.kvqual.eq.0) then - dtx=dtbest - dfx=dfbest - decoded=deepbest - endif + nqual=qual + if(ndiag.eq.0 .and. nqual.gt.10) nqual=10 + if(nqual.ge.nq1 .and.kvqual.eq.0) decoded=deepmsg ndf=nint(dfx) if(flip.lt.0.0 .and. (kvqual.eq.1 .or. nqual.ge.nq2)) cooo='OOO' @@ -165,8 +131,8 @@ C result from the Reed-Solomon decoder. if(c1.ge.'a' .and. c1.le.'z') decoded(i:i)=char(ichar(c1)-32) enddo write(line,1010) cfile6,nsync,nsnr,dtx-1.0,ndf, - + nint(width),csync,special,decoded(1:19),cooo,kvqual,nqual,itry - 1010 format(a6,i3,i5,f5.1,i5,i3,1x,a1,1x,a5,a19,1x,a3,i4,i3,i2) + + nint(width),csync,special,decoded(1:19),cooo,kvqual,nqual + 1010 format(a6,i3,i5,f5.1,i5,i3,1x,a1,1x,a5,a19,1x,a3,i4,i4) C Blank DT if shorthand message (### wrong logic? ###) if(special.ne.' ') then @@ -188,31 +154,46 @@ C Write decoded msg unless this is an "Exclude" request: if(MinSigdB.lt.99) write(lumsg,1011) line if(nsave.ge.1) call avemsg65(1,mode65,ndepth,avemsg1,nused1, - + ns1,ncount1) + + nq1,nq2,neme,nsked,flip,mycall,hiscall,hisgrid,qual1, + + ns1,ncount1) if(nsave.ge.1) call avemsg65(2,mode65,ndepth,avemsg2,nused2, - + ns2,ncount2) + + nq1,nq2,neme,nsked,flip,mycall,hiscall,hisgrid,qual2, + + ns2,ncount2) + nqual1=qual1 + nqual2=qual2 + if(ndiag.eq.0 .and. nqual1.gt.10) nqual1=10 + if(ndiag.eq.0 .and. nqual2.gt.10) nqual2=10 + nc1=0 + nc2=0 + if(ncount1.ge.0) nc1=1 + if(ncount2.ge.0) nc2=1 C Write the average line - if(ns1.ge.1 .and. ns1.ne.ns10) then - if(ns1.lt.10) write(ave1,1021) cfile6,1,nused1,ns1,avemsg1 - 1021 format(a6,i3,i4,'/',i1,20x,a19) +! if(ns1.ge.1 .and. ns1.ne.ns10) then + if(ns1.ge.1) then + if(ns1.lt.10) write(ave1,1021) cfile6,1,nused1,ns1,avemsg1, + + nc1,nqual1 + 1021 format(a6,i3,i4,'/',i1,20x,a19,i8,i4) if(ns1.ge.10 .and. nsave.le.99) write(ave1,1022) cfile6, - + 1,nused1,ns1,avemsg1 - 1022 format(a6,i3,i4,'/',i2,19x,a19) + + 1,nused1,ns1,avemsg1,nc1,nqual1 + 1022 format(a6,i3,i4,'/',i2,19x,a19,i8,i4) if(ns1.ge.100) write(ave1,1023) cfile6,1,nused1,ns1, - + avemsg1 - 1023 format(a6,i3,i4,'/',i3,18x,a19) + + avemsg1,nc1,nqual1 + 1023 format(a6,i3,i4,'/',i3,18x,a19,i8,i4) if(lcum .and. (avemsg1.ne.' ')) + write(21,1011) ave1(1:57)//' ' ns10=ns1 endif C If Monitor segment #2 is available, write that line also - if(ns2.ge.1 .and. ns2.ne.ns20) then - if(ns2.lt.10) write(ave2,1021) cfile6,2,nused2,ns2,avemsg2 +! if(ns2.ge.1 .and. ns2.ne.ns20) then !***Why the 2nd part?? *** + if(ns2.ge.1) then + if(ns2.lt.10) write(ave2,1021) cfile6,2,nused2,ns2,avemsg2, + + nc2,nqual2 if(ns2.ge.10 .and. nsave.le.99) write(ave2,1022) cfile6, - + 2,nused2,ns2,avemsg2 - if(ns2.ge.100) write(ave2,1023) cfile6,2,nused2,ns2,avemsg2 + + 2,nused2,ns2,avemsg2,nc2,nqual2 + if(ns2.ge.100) write(ave2,1023) cfile6,2,nused2,ns2,avemsg2, + + nc2,nqual2 if(lcum .and. (avemsg2.ne.' ')) + write(21,1011) ave2(1:57)//' ' ns20=ns2 From 02bd822a793d1da3eb8e84233c46bc7a098ec746 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 29 Jul 2006 16:10:39 +0000 Subject: [PATCH 153/811] Added missing routine symsync65.f. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@213 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- symsync65.f | 35 +++++++++++++++++++++++++++++++++++ wsjt.py | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 symsync65.f diff --git a/symsync65.f b/symsync65.f new file mode 100644 index 000000000..dbf04fe1c --- /dev/null +++ b/symsync65.f @@ -0,0 +1,35 @@ + subroutine symsync65(c5,n5,k0,s,flip,pr,kmax,kpk,ccf,smax) + + complex c5(n5) + real s(n5),pr(126),ccf(-128:128) + complex z + + z=0. + do i=1,32 + z=z + c5(i) + enddo + s(1)=real(z)*real(z) + aimag(z)*aimag(z) + smax=s(1) + do i=33,n5 + z=z + c5(i) - c5(i-32) + s(i-31)=real(z)*real(z) + aimag(z)*aimag(z) + smax=max(s(i-31),smax) + enddo + iz=n5-31 + + smax=0. + do k=-kmax,kmax + sum=0. + do i=1,126 + j=32*(i-1)+k+k0 + if(j.ge.1 .and. j.le.iz) sum=sum + flip*pr(i)*s(j) + enddo + ccf(k)=sum + if(sum.gt.smax) then + smax=sum + kpk=k + endif + enddo + + return + end diff --git a/wsjt.py b/wsjt.py index f9bacd87a..1e25b0839 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw From 2fafe108915a439f4d50c743867b34bfeef790b3 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 29 Jul 2006 16:15:45 +0000 Subject: [PATCH 154/811] Updated Makefile.in git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@214 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 4ee345e89..d994c488f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -64,7 +64,9 @@ SRCS2F77 = wsjt1.f astro.f azdist.f coord.f dcoord.f deg2grid.f \ interleave63.f k2grid.f limit.f lpf1.f deep65.f morse.f \ nchar.f packcall.f packgrid.f packmsg.f packtext.f setup65.f \ short65.f slope.f spec2d65.f sync65.f unpackcall.f \ - unpackgrid.f unpackmsg.f unpacktext.f xcor.f xfft.f xfft2.f wsjt65.f + unpackgrid.f unpackmsg.f unpacktext.f xcor.f xfft.f xfft2.f wsjt65.f \ + ftpeak65.f fil651.f fil652.f fil653.f symsync65.f + OBJS2F77 = ${SRCS2F77:.f=.o} SRCS2C = init_rs.c encode_rs.c decode_rs.c From 22803a7f1c39abec5834a8cde9a8731d90e9a788 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 29 Jul 2006 16:16:09 +0000 Subject: [PATCH 155/811] Dummy git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@215 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsjt.py b/wsjt.py index 1e25b0839..75a6f81c0 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#----------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From 694d24403d9c43081a1d68ab52e9203f1fb584e3 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 30 Jul 2006 04:50:24 +0000 Subject: [PATCH 156/811] - Do the actual ptt on/off after open. open + ptt control are done at the same time in wsjt; there is no separate ptt init. done. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@216 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_unix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ptt_unix.c b/ptt_unix.c index 98eae45a0..446443080 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -127,8 +127,11 @@ ptt_(int *unused, char *ptt_port, int *ntx, int *iptt) if (dev_is_parport(fd)) { state = STATE_PORT_OPEN_PARALLEL; lp_reset(fd); - } else + ptt_parallel(fd, ntx, iptt); + } else { state = STATE_PORT_OPEN_SERIAL; + ptt_serial(fd, ntx, iptt); + } break; case STATE_PORT_OPEN_PARALLEL: From b30d2e3e8cd5f60431be6ecf97e2903782ddce8e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 1 Aug 2006 15:55:52 +0000 Subject: [PATCH 157/811] deep65: corrected error in determining p2 sync65: added call to smooth for improved sync in mode JT65C. added +2 dB to SNR estimates for JT65C. wsjt65: cleaned up some display details of decoded lines short65: added calls to smooth for improved shorthand decodes in JT65C. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@217 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- deep65.F | 30 ++++++++++++++---------------- short65.f | 4 ++++ sync65.f | 4 +++- wsjt.py | 2 +- wsjt65.f | 23 +++++++++++++---------- 5 files changed, 35 insertions(+), 28 deletions(-) diff --git a/deep65.F b/deep65.F index d2c9dba97..ca969c9e2 100644 --- a/deep65.F +++ b/deep65.F @@ -11,7 +11,8 @@ character*180 line character*4 rpt(MAXRPT) logical first - integer ncode(63,2*MAXCALLS) + integer ncode(63,2*MAXCALLS + 2 + MAXRPT) + real pp(2*MAXCALLS + 2 + MAXRPT) common/tmp9/ mrs(63),mrs2(63) data neme0/-99/ @@ -73,7 +74,7 @@ mz=1 if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1 .and. - + flip.gt.0.0) mz=MAXRPT+1 + + flip.gt.0.0 .and. callsign(1:6).ne.' ') mz=MAXRPT+1 C Test for messages with MyCall + HisCall + report do m=1,mz if(m.gt.1) grid=rpt(m-1) @@ -83,7 +84,8 @@ C Test for messages with MyCall + HisCall + report k=k+1 testmsg(k)=message call encode65(message,ncode(1,k)) - if(m.eq.1) then +C Insert CQ message unless sync=OOO (flip=-1). + if(m.eq.1 .and. flip.gt.0.0) then message='CQ '//callgrid(icall) k=k+1 testmsg(k)=message @@ -102,10 +104,7 @@ C Test for messages with MyCall + HisCall + report p1=-1.e30 p2=-1.e30 - n=0 do k=1,ntot -C If sync=OOO, no CQ messages - if(flip.lt.0.0 .and. testmsg(k)(1:3).eq.'CQ ') go to 30 sum=0. ref=ref0 do j=1,63 @@ -116,26 +115,25 @@ C If sync=OOO, no CQ messages endif enddo p=sum/ref - n=n+1 + pp(k)=p if(p.gt.p1) then - if(p1.gt.p2) then - p2=p1 - ip2=ip1 - endif p1=p ip1=k - else if(p.gt.p2 .and. p.lt.p1) then - p2=p - ip2=k endif 30 enddo - ntot=n + p2=-1.e30 + do i=1,ntot + if(pp(i).gt.p2 .and. pp(i).ne.p1) p2=pp(i) + enddo - 40 if(mode65.eq.1) bias=max(1.12*p2,0.335) + if(mode65.eq.1) bias=max(1.12*p2,0.335) if(mode65.eq.2) bias=max(1.08*p2,0.405) if(mode65.ge.4) bias=max(1.04*p2,0.505) +C This is really weird, but do not remove the following statement! + rewind 23 + qual=100.0*(p1-bias) decoded=' ' c=' ' diff --git a/short65.f b/short65.f index ec176fa32..0ca04b3fc 100644 --- a/short65.f +++ b/short65.f @@ -34,6 +34,10 @@ C Do 16 k FFTs, stepped by 8k. (*** Maybe should step by 4k? ***) do j=1,nsteps k=(j-1)*NH + 1 call ps(data(k),NFFT,s2(1,j)) !Get power spectra + if(mode65.eq.4) then + call smooth(s2(1,j),NQ) + call smooth(s2(1,j),NQ) + endif call add(psavg,s2(1,j),psavg,NQ) enddo diff --git a/sync65.f b/sync65.f index 3e5738262..b4f53de23 100644 --- a/sync65.f +++ b/sync65.f @@ -1,5 +1,5 @@ subroutine sync65(dat,jz,DFTolerance,NFreeze,NAFC,MouseDF, - + dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width) + + mode65,dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width) C Synchronizes JT65 data, finding the best-fit DT and DF. C NB: at this stage, submodes ABC are processed in the same way. @@ -32,6 +32,7 @@ C Compute power spectrum for each step and get average k=(j-1)*nh + 1 call limit(dat(k),nfft) call ps(dat(k),nfft,s2(1,j)) + if(mode65.eq.4) call smooth(s2(1,j),nh) call add(psavg,s2(1,j),psavg,nh) enddo @@ -133,6 +134,7 @@ C Find rms of the CCF, without the main peak C Plus 3 dB because sync tone is on half the time. (Don't understand C why an additional +2 dB is needed ...) if(ppmax.gt.0.0001) snrx=db(ppmax*df/2500.0) + 5.0 !### + if(mode65.eq.4) snrx=snrx + 2.0 if(snrx.lt.-33.0) snrx=-33.0 C Compute width of sync tone to outermost -3 dB points diff --git a/wsjt.py b/wsjt.py index 75a6f81c0..1e25b0839 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#----------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/wsjt65.f b/wsjt65.f index 70489549c..7bb9fc27f 100644 --- a/wsjt65.f +++ b/wsjt65.f @@ -57,7 +57,7 @@ C already been done. C Attempt to synchronize: look for sync tone, get DF and DT. call sync65(dat,npts,DFTolerance,NFreeze,NAFC,MouseDF, - + dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width) + + mode65,dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width) f0=1270.46 + dfx csync=' ' decoded=' ' @@ -69,6 +69,8 @@ C Attempt to synchronize: look for sync tone, get DF and DT. ncount1=-1 !Flag for RS Decode of ave1 ncount2=-1 !Flag for RS Decode of ave2 NSyncOK=0 + nqual1=0 + nqual2=0 if(nsave.lt.MAXAVE .and. (NAgain.eq.0 .or. NClearAve.eq.1)) + nsave=nsave+1 @@ -134,19 +136,22 @@ C If we get here, we have achieved sync! + nint(width),csync,special,decoded(1:19),cooo,kvqual,nqual 1010 format(a6,i3,i5,f5.1,i5,i3,1x,a1,1x,a5,a19,1x,a3,i4,i4) +C Blank all end-of-line stuff if no decode + if(line(31:40).eq.' ') line=line(:30) + C Blank DT if shorthand message (### wrong logic? ###) if(special.ne.' ') then line(15:19)=' ' - ccfblue(-5)=-9999.0 - if(ndiag.gt.0) write(line(51:57),1012) iderrsh,idriftsh - 1012 format(i3,i4) + line=line(:35) + ccfblue(-5)=-9999.0 +! if(ndiag.gt.0) write(line(51:57),1012) iderrsh,idriftsh +! 1012 format(i3,i4) else nspecial=0 endif C Blank the end-of-line numbers - if(naggressive.eq.0 .and. ndiag.eq.0) line(58:67)=' ' - if(ndiag.eq.0) line(66:67)=' ' + if(naggressive.eq.0 .and. ndiag.eq.0) line(59:66)=' ' if(lcum) write(21,1011) line 1011 format(a67) @@ -199,10 +204,8 @@ C If Monitor segment #2 is available, write that line also ns20=ns2 endif - if(ndiag.eq.0) then - ave1(58:67)=' ' - ave2(58:67)=' ' - endif + if(ave1(31:40).eq.' ') ave1=ave1(:30) + if(ave2(31:40).eq.' ') ave2=ave2(:30) write(12,1011) ave1 write(12,1011) ave2 call flushqqq(12) From a6b724dec3f661be586feda619d34dc77765943e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 1 Aug 2006 16:08:36 +0000 Subject: [PATCH 158/811] Added flushqqq calls to wsjt1. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@218 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 2 +- wsjt1.F | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wsjt.py b/wsjt.py index 1e25b0839..f9bacd87a 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw diff --git a/wsjt1.F b/wsjt1.F index 1b3c367d8..3e863385c 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -295,7 +295,7 @@ C Now the multi-tone decoding + line(j)(29:31).eq.' ') goto 10 write(lumsg,1050) line(j) !Write to decoded.txt 1050 format(a79) - if(lcum) write(21,1050) line(j) !Write to decoded.cum + if(lcum) write(21,1050) line(j) !Write to ALL.TXT read(line(j),1060) sig,msg3 1060 format(16x,f3.0,9x,a3) if(sig.gt.smax) then @@ -315,9 +315,11 @@ C Now the multi-tone decoding 800 continue call s2shape(s2,nchan,nz,tbest) - 900 continue + 900 LDecoded = ((NSyncOK.gt.0) .or. npkept.gt.0) end file 11 - LDecoded = ((NSyncOK.gt.0) .or. npkept.gt.0) + call flushqqq(11) + call flushqqq(12) + call flushqqq(21) return end From 380aa4d889fa863d7480ded167d24893a675a729 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 1 Aug 2006 17:19:31 +0000 Subject: [PATCH 159/811] Added "flipx" to fix minor problem in deep search of average message. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@219 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- avemsg65.f | 4 ++-- wsjt.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/avemsg65.f b/avemsg65.f index 2229c2957..8372cb7c0 100644 --- a/avemsg65.f +++ b/avemsg65.f @@ -42,7 +42,8 @@ C Compute the average of all flagged spectra for this segment. nqual=0 C Possibly should pass nadd=nused, also: if(ndepth.ge.3) then - call deep65(s3,mode65,neme,nsked,flip, + flipx=1.0 !Normal flip not relevant for ave msg + call deep65(s3,mode65,neme,nsked,flipx, + mycall,hiscall,hisgrid,deepmsg,qual) nqual=qual if(nqual.lt.nq1) deepmsg=' ' @@ -55,6 +56,5 @@ C Suppress "birdie messages": if(decoded(1:7).eq.'0L6MWK ') decoded=' ' 100 if(nused.lt.1) decoded=' ' - return end diff --git a/wsjt.py b/wsjt.py index f9bacd87a..1e25b0839 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * import Pmw From 64cfe4815aff52464470e8895a19011c4f01c58e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 1 Aug 2006 17:28:50 +0000 Subject: [PATCH 160/811] Commented out all references to EME Echo mode. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@220 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/wsjt.py b/wsjt.py index 1e25b0839..0f7f13aa7 100644 --- a/wsjt.py +++ b/wsjt.py @@ -620,9 +620,9 @@ def ModeCW(event=NONE): erase() #------------------------------------------------------ ModeEcho -def ModeEcho(event=NONE): +#def ModeEcho(event=NONE): # mode.set("Echo") - stub() +# stub() #------------------------------------------------------ msgpos def msgpos(): @@ -642,11 +642,10 @@ def about(event=NONE): Label(about,text=t,font=(font1,16)).pack(padx=20,pady=5) t=""" WSJT is a weak signal communications program. It supports -five operating modes: FSK441, a fast mode for meteor scatter; +four operating modes: FSK441, a fast mode for meteor scatter; JT6M, specially optimized for meteor and ionospheric scatter on 50 MHz; JT65, an extremely sensitive mode for troposcatter -and EME; CW at 15 WPM with messages structured for EME; and -an EME Echo mode for measuring your own echoes from the moon. +and EME; and CW at 15 WPM with messages structured for EME. WSJT is Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, with contributions from additional authors. It is Open Source @@ -681,7 +680,6 @@ F8 Set JT65A mode Shift-F8 Set JT65B mode CTRL-F8 Set JT65C mode Shift-CTRL-F8 Set CW mode -F9 Set EME Echo mode F10 Toggle focus between WSJT screens Alt-1 to Alt-6 Tx1 to Tx6 Alt-A Toggle Auto On/Off @@ -1333,8 +1331,8 @@ def update(): msg2.configure(bg='#FF00FF') elif mode.get()=="CW": msg2.configure(bg='#00FF00') - elif mode.get()=="Echo": - msg2.configure(bg='#FF0000') +# elif mode.get()=="Echo": +# msg2.configure(bg='#FF0000') g.mode=mode.get() first=0 @@ -1588,8 +1586,8 @@ modemenu.add_radiobutton(label = 'JT65A', variable=mode, command = ModeJT65A) modemenu.add_radiobutton(label = 'JT65B', variable=mode, command = ModeJT65B) modemenu.add_radiobutton(label = 'JT65C', variable=mode, command = ModeJT65C) modemenu.add_radiobutton(label = 'CW', variable=mode, command = ModeCW) -modemenu.add_radiobutton(label = 'Echo', variable=mode, command = ModeEcho, - state=DISABLED) +#modemenu.add_radiobutton(label = 'Echo', variable=mode, command = ModeEcho, +# state=DISABLED) #------------------------------------------------------ Decode menu decodebutton = Menubutton(mbar, text = 'Decode', ) @@ -1705,7 +1703,7 @@ root.bind_all('', ModeJT65B) root.bind_all('', ModeJT65C) root.bind_all('', ModeJT6M) root.bind_all('', ModeCW) -root.bind_all('', ModeEcho) +#root.bind_all('', ModeEcho) root.bind_all('', showspecjt) root.bind_all('',btx1) From d782e29e3740696c24a2b5f855b778f37b10b900 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 1 Aug 2006 17:46:51 +0000 Subject: [PATCH 161/811] Display self doppler if HisGrid box is empty. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@221 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wsjt.py b/wsjt.py index 0f7f13aa7..7816d4d84 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1287,6 +1287,10 @@ def update(): options.auxra.get()+' '[:9], \ options.auxdec.get()+' '[:9]) + if len(HisGrid.get().strip())<4: + g.ndop=g.ndop00 + g.dfdt=g.dfdt0 + if mode.get()[:4]=='JT65' or mode.get()[:2]=='CW' : graph2.delete(ALL) g2font='Helvetica 16' From 4f196eb7500d3b1b8b9c6ef48eb67de09d7509e9 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 2 Aug 2006 00:13:52 +0000 Subject: [PATCH 162/811] - remove jack support for now git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@222 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 47 +----- configure.ac | 30 +--- start_jack.c | 393 --------------------------------------------------- wsjt.py | 2 +- 4 files changed, 11 insertions(+), 461 deletions(-) delete mode 100644 start_jack.c diff --git a/configure b/configure index f0e4329a0..4fe806622 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 187 2006-07-05 15:32:17Z va3db $ +# $Id: configure.ac 190 2006-07-06 13:44:34Z va3db $ # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -857,7 +857,6 @@ Optional Features: --enable-alsa Force ALSA SOUNDCARD usage. --enable-oss Force OSS SOUND usage. --enable-portaudio Force PORTAUDIO SOUND usage. - --enable-jack Force JACK usage. --enable-g95 Use G95 compiler if available. --enable-gfortran Use gfortran compiler if available. @@ -977,7 +976,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 187 2006-07-05 15:32:17Z va3db $ +$Id: configure.ac 190 2006-07-06 13:44:34Z va3db $ _ACEOF exit 0 fi @@ -2354,7 +2353,7 @@ fi # Provide some information about the compiler. -echo "$as_me:2357:" \ +echo "$as_me:2356:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -3657,8 +3656,8 @@ else echo "${ECHO_T}no" >&6 fi -# Extract the first word of "gfortran41", so it can be a program name with args. -set dummy gfortran41; ac_word=$2 +# Extract the first word of "gfortran42", so it can be a program name with args. +set dummy gfortran42; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GFORTRAN+set}" = set; then @@ -6638,15 +6637,6 @@ else fi; -# Check whether --enable-jack or --disable-jack was given. -if test "${enable_jack+set}" = set; then - enableval="$enable_jack" - jack=$enableval -else - jack=no -fi; - - # Check whether --enable-g95 or --disable-g95 was given. if test "${enable_g95+set}" = set; then enableval="$enable_g95" @@ -6710,7 +6700,7 @@ FC="${FC}" if test "$alsa" != yes -a "$oss" != yes -a \ - "$portaudio" != yes -a "$jack" != yes; then + "$portaudio" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then portaudio=yes; elif test $HAS_ASOUNDLIB_H -eq 1; then @@ -6751,23 +6741,12 @@ _ACEOF NEEDPORTAUDIO="portaudio-v19/lib/libportaudio.a" - LDFLAGS="portaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" + LDFLAGS="-Lportaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" else NEEDPORTAUDIO="" fi -if test "$jack" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_JACK 1 -_ACEOF - - AUDIO="start_jack.c" - - LDFLAGS="${LDFLAGS} -ljack" -fi - if test $HAS_ASOUNDLIB_H -eq 1; then cat >>confdefs.h <<\_ACEOF @@ -6821,14 +6800,6 @@ echo "$as_me: error: You need soundcard.h to use --enable-oss" >&2;} fi fi -if test "$jack" = yes; then - if test $HAS_JACK_H -eq 0; then - { { echo "$as_me:$LINENO: error: You need jack.h to use --enable-jack" >&5 -echo "$as_me: error: You need jack.h to use --enable-jack" >&2;} - { (exit 1); exit 1; }; } - fi -fi - if test "$portaudio" = yes; then if test $HAS_PORTAUDIO_H -eq 0; then { { echo "$as_me:$LINENO: error: You need portaudio.h to use --enable-portaudio" >&5 @@ -7818,10 +7789,6 @@ if test $oss == "yes"; then echo "Using oss."; fi -if test $jack == "yes"; then - echo "Using jack."; -fi - echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/configure.ac b/configure.ac index c7fb69c62..112eeadc4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,6 @@ dnl $Id$ dnl Process this file with autoconf to produce a configure script. - dnl AC_PREREQ(2.59) dnl Sneaky way to get an Id tag into the configure script @@ -87,10 +86,10 @@ G95_LIB_PATH=`${G95} -print-file-name=` AC_MSG_RESULT(${G95_LIB_PATH}) AC_PATH_PROG(GFORTRAN, gfortran) dnl -dnl FreeBSD currently installs gfortran as gfortran41, considered experimental +dnl FreeBSD currently installs gfortran as gfortran42 dnl See http://gcc.gnu.org/fortran/ dnl -AC_PATH_PROG(GFORTRAN, gfortran41) +AC_PATH_PROG(GFORTRAN, gfortran42) AC_MSG_CHECKING([gfortran lib path]) GFORTRAN_LIB_PATH=`${GFORTRAN} -print-file-name=` AC_MSG_RESULT(${GFORTRAN_LIB_PATH}) @@ -233,13 +232,6 @@ AC_ARG_ENABLE(portaudio, AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), [portaudio=$enableval], [portaudio=no]) -dnl jack soundsupport -dnl ================= - -AC_ARG_ENABLE(jack, -AC_HELP_STRING([--enable-jack],[Force JACK usage.]), -[jack=$enableval] , [jack=no]) - dnl pick gfortran or g95 dnl ==================== @@ -290,7 +282,7 @@ dnl set defaults dnl ============ if test "$alsa" != yes -a "$oss" != yes -a \ - "$portaudio" != yes -a "$jack" != yes; then + "$portaudio" != yes; then if test $HAS_PORTAUDIO_H -eq 1; then [portaudio=yes]; elif test $HAS_ASOUNDLIB_H -eq 1; then @@ -320,12 +312,6 @@ else AC_SUBST(NEEDPORTAUDIO, "") fi -if test "$jack" = yes; then - AC_DEFINE(USE_JACK, 1, [Define if you want JACK used.]) - AC_SUBST(AUDIO, "start_jack.c") - LDFLAGS="${LDFLAGS} -ljack" -fi - dnl set conf flags dnl ============== @@ -364,12 +350,6 @@ if test "$oss" = yes; then fi fi -if test "$jack" = yes; then - if test $HAS_JACK_H -eq 0; then - AC_MSG_ERROR([You need jack.h to use --enable-jack]) - fi -fi - if test "$portaudio" = yes; then if test $HAS_PORTAUDIO_H -eq 0; then AC_MSG_ERROR([You need portaudio.h to use --enable-portaudio]) @@ -416,10 +396,6 @@ if test $oss == "yes"; then echo "Using oss."; fi -if test $jack == "yes"; then - echo "Using jack."; -fi - echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/start_jack.c b/start_jack.c deleted file mode 100644 index b3c54f268..000000000 --- a/start_jack.c +++ /dev/null @@ -1,393 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define AUDIOBUFSIZE 4096 -#define FRAMESPERBUFFER 1024 - -char rcv_buf[AUDIOBUFSIZE]; /* XXX grab one from upper app later --db */ -char tx_buf[AUDIOBUFSIZE]; /* XXX grab one from upper app later --db */ - -/* - * Lots of pieces stolen directly from jack simple_client.c - */ -jack_port_t *input_port; -jack_port_t *output_port; -jack_client_t *client; -void jack_read(void); -void jack_write(void); - -/* a simple state machine for this client */ -volatile enum { - Init, - Run, - Exit -} client_state = Init; - -extern void decode1_(int *iarg); - -/* - * local state data referencing some gcom common fortran variables as well - */ -struct audio_data { - int fd_in; /* Audio fd in; used only locally in this function */ - int fd_out; /* Audio fd out; used only locally in this function */ - double *Tsec; /* Present time SoundIn,SoundOut */ - double *tbuf; /* Tsec at time of input callback SoundIn */ - int *iwrite; /* Write pointer to Rx ring buffer SoundIn */ - int *ibuf; /* Most recent input buffer# SoundIn */ - int *TxOK; /* OK to transmit? SoundIn */ - int *ndebug; /* Write debugging info? GUI */ - int *ndsec; /* Dsec in units of 0.1 s GUI */ - int *Transmitting; /* Actually transmitting? SoundOut */ - int *nwave; /* Number of samples in iwave SoundIn */ - int *nmode; /* Which WSJT mode? GUI */ - int *trperiod; /* Tx or Rx period in seconds GUI */ - int nbuflen; - int nfs; - int16_t *y1; /* Ring buffer for audio channel 0 SoundIn */ - int16_t *y2; /* Ring buffer for audio channel 1 SoundIn */ - short *iwave; -}data; - -/** - * The process callback for this JACK application is called in a - * special realtime thread once for each audio cycle. - * - * This client follows a simple rule: when the JACK transport is - * running, copy the input port to the output. When it stops, exit. - */ -int -process (jack_nframes_t nframes, void *arg) -{ - jack_default_audio_sample_t *in, *out; - jack_transport_state_t ts = jack_transport_query(client, NULL); - int i; - - if (ts == JackTransportRolling) { - if (client_state == Init) - client_state = Run; - in = jack_port_get_buffer (input_port, nframes); - /* First hack */ - if (nframes != 0) { - memcpy (rcv_buf, in, nframes); - jack_read(); - } - -#if 0 - out = jack_port_get_buffer (output_port, nframes); - memcpy (out, in, - sizeof (jack_default_audio_sample_t) * nframes); -#endif - - } else if (ts == JackTransportStopped) { - - if (client_state == Run) - client_state = Exit; - } - - return 0; -} - -/** - * JACK calls this shutdown_callback if the server ever shuts down or - * decides to disconnect the client. - */ -void -jack_shutdown (void *arg) -{ - return; -} - -/* - * start_threads() - * inputs - ndevin device number for input - * - ndevout device number for output - * - y1 short int array for channel 0 - * - y2 short int array for channel 1 - * - nmax - * - iwrite - * - iwave - * - nwave - * - rate - * - NSPB - * - TRPeriod - * - TxOK - * - ndebug debug output or not? - * - Transmitting - * - Tsec - * - ngo - * - nmode - * - tbuf - * - ibuf - * - ndsec - * output - ? - * side effects - Called from audio_init.f90 to start audio decode and - * OSS thread. - */ - -int -start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], - int *nbuflen, int *iwrite, short iwave[], - int *nwave, int *nfsample, int *nsamperbuf, - int *TRPeriod, int *TxOK, int *ndebug, - int *Transmitting, double *Tsec, int *ngo, int *nmode, - double tbuf[], int *ibuf, int *ndsec) -{ - pthread_t thread1,thread2; - int iret1,iret2; - int iarg1 = 1,iarg2 = 2; - int32_t rate=*nfsample; - double dnfs; - const char **ports; - const char *client_name; - jack_options_t options = JackNullOption; - jack_status_t status; - - data.Tsec = Tsec; - data.tbuf = tbuf; - data.iwrite = iwrite; - data.ibuf = ibuf; - data.TxOK = TxOK; - data.ndebug = ndebug; - data.ndsec = ndsec; - data.Transmitting = Transmitting; - data.y1 = y1; - data.y2 = y2; - data.nbuflen = *nbuflen; - data.nmode = nmode; - data.nwave = nwave; - data.iwave = iwave; - data.nfs = *nfsample; - data.trperiod = TRPeriod; - - dnfs=(double)*nfsample; - - /* open a client connection to the JACK server */ - - client = jack_client_open ("wsjt", options, &status, NULL); - if (client == NULL) { - fprintf (stderr, "jack_client_open() failed, " - "status = 0x%2.0x\n", status); - if (status & JackServerFailed) { - fprintf (stderr, "Unable to connect to JACK server\n"); - } - return(-1); - } - if (status & JackServerStarted) { - fprintf (stderr, "JACK server started\n"); - } - if (status & JackNameNotUnique) { - client_name = jack_get_client_name(client); - fprintf (stderr, "unique name `%s' assigned\n", client_name); - } - - /* tell the JACK server to call `process()' whenever - * there is work to be done. - */ - - jack_set_process_callback (client, process, 0); - - /* tell the JACK server to call `jack_shutdown()' if - * it ever shuts down, either entirely, or if it - * just decides to stop calling us. - */ - - jack_on_shutdown (client, jack_shutdown, 0); - - /* display the current sample rate. - */ - - printf ("engine sample rate: %" PRIu32 "\n", - jack_get_sample_rate (client)); - - /* create two ports */ - - input_port = jack_port_register (client, "input", - JACK_DEFAULT_AUDIO_TYPE, - JackPortIsInput, 0); - output_port = jack_port_register (client, "output", - JACK_DEFAULT_AUDIO_TYPE, - JackPortIsOutput, 0); - - if ((input_port == NULL) || (output_port == NULL)) { - fprintf(stderr, "no more JACK ports available\n"); - /* ZZZ close jack above */ - return(-1); - } - - /* Tell the JACK server that we are ready to roll. Our - * process() callback will start running now. - */ - - if (jack_activate (client)) { - fprintf (stderr, "cannot activate client"); - /* ZZZ close jack above */ - return(-1); - } - - /* Connect the ports. You can't do this before the client is - * activated, because we can't make connections to clients - * that aren't running. Note the confusing (but necessary) - * orientation of the driver backend ports: playback ports are - * "input" to the backend, and capture ports are "output" from - * it. - */ - - ports = jack_get_ports (client, NULL, NULL, - JackPortIsPhysical|JackPortIsOutput); - if (ports == NULL) { - fprintf(stderr, "no physical capture ports\n"); - /* ZZZ close jack above */ - return(-1); - } - - if (jack_connect (client, ports[0], jack_port_name (input_port))) { - fprintf (stderr, "cannot connect input ports\n"); - } - - free (ports); - - ports = jack_get_ports (client, NULL, NULL, - JackPortIsPhysical|JackPortIsInput); - if (ports == NULL) { - fprintf(stderr, "no physical playback ports\n"); - /* ZZZ close jack above */ - return(-1); - } - - if (jack_connect (client, jack_port_name (output_port), ports[0])) { - fprintf (stderr, "cannot connect output ports\n"); - } - - free (ports); - - - printf("Audio jack streams running normally.\n"); - printf("******************************************************************\n"); - - printf("start_threads: creating thread for decode1\n"); - // iret1 = pthread_create(&thread1, NULL, - // (void *(*)(void *))oss_loop, &iarg1); - // printf("start_threads: creating thread for decode1_\n"); - iret2 = pthread_create(&thread2, NULL, - (void *(*)(void *))decode1_,&iarg2); -/* keep running until the transport stops */ -#if 0 - jack_client_close (client); -#endif - return(0); -} - -/* - * jack_read - * - * inputs - none - * output - none - * side effects - - */ - -void -jack_read(void) -{ - struct timeval tv; - unsigned int i; - static int n=0; - static int n2=0; - static int ia=0; - static int ib=0; - static int ic=0; - static int16_t *in; - static int16_t *wptr; - static int TxOKz=0; - static int ncall=0; - static int nsec=0; - static double stime; - - /* Get System time */ - gettimeofday(&tv, NULL); - stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + - *(data.ndsec) * 0.1; - *(data.Tsec) = stime; - - ncall++; - - /* increment buffer pointers only if data available */ - ia=*(data.iwrite); - ib=*(data.ibuf); - data.tbuf[ib-1] = stime; /* convert to c index to store */ - ib++; - if(ib>FRAMESPERBUFFER) - ib=1; - *(data.ibuf) = ib; - in = (int16_t *)rcv_buf; /* XXX */ - for(i=0; i= data.nbuflen) - ia=0; //Wrap buffer pointer if necessary - *(data.iwrite) = ia; /* Save buffer pointer */ - fivehz_(); /* Call fortran routine */ -} - -void -jack_write(void) -{ - int i; - static int n=0; - static int ic=0; - struct timeval tv; - static int n2=0; - static int16_t *wptr; - static int TxOKz=0; - static int nsec=0; - static double stime; - - /* Get System time */ - gettimeofday(&tv, NULL); - stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) + - *(data.ndsec) * 0.1; - *(data.Tsec) = stime; - - if(*(data.TxOK) && (!TxOKz)) { - n=nsec/(*(data.trperiod)); - ic = (int)(stime - *(data.trperiod)*n) * data.nfs; - ic = ic % *(data.nwave); - } - - TxOKz = *(data.TxOK); - *(data.Transmitting) = *(data.TxOK); - wptr = (int16_t *)tx_buf; /* XXX */ - if(*(data.TxOK)) { - for(i=0 ; i= *(data.nwave)) { - ic = ic % *(data.nwave); /* Wrap buffer pointer if necessary */ - if(*(data.nmode) == 2) - *(data.TxOK) = 0; - } - } - } else { - memset(tx_buf, 0, AUDIOBUFSIZE); - } - - if (write(data.fd_out, tx_buf, AUDIOBUFSIZE) < 0) { - fprintf(stderr, "Can't write to soundcard.\n"); - return; - } - fivehztx_(); /* Call fortran routine */ -} diff --git a/wsjt.py b/wsjt.py index 7816d4d84..a18e1b7fc 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#----------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw From e669a96f27d5b026149892742346abb27a90d548 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 2 Aug 2006 02:05:58 +0000 Subject: [PATCH 163/811] Fixed selection of correct data slice when doing mouse-picked JT6M decodes from a recorded file. (Still need to test for decoding from real-time data.) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@223 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- decode2.f90 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/decode2.f90 b/decode2.f90 index 76d694173..3f8e6fe92 100644 --- a/decode2.f90 +++ b/decode2.f90 @@ -75,8 +75,16 @@ subroutine decode2 if(mousebutton.eq.0) istart=1 if(mousebutton.gt.0) then jzz=lenpick - if(mode(1:4).eq.'JT6M') jzz=4*11025 - istart=istart + 3300 - jzz/2 + +! This is a major kludge: + if(mode(1:4).eq.'JT6M') then + jzz=4*11025 + if(mousebutton.eq.3) jzz=10*11025 + istart=istart+11025 + else + istart=istart + 3300 - jzz/2 + endif + if(istart.lt.2) istart=2 if(istart+jzz.gt.jzc) istart=jzc-jzz endif From d2325ebde939518e8b0542f8f26982a3e39be51b Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 2 Aug 2006 02:07:47 +0000 Subject: [PATCH 164/811] Dummy git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@224 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wsjt.py b/wsjt.py index a18e1b7fc..b9769853d 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,8 @@ +<<<<<<< .mine +#------------------------------------------------------------------- WSJT +======= #----------------------------------------------------------------- WSJT +>>>>>>> .r223 from Tkinter import * from tkFileDialog import * import Pmw From 83507c6e2a7037b4cf39f439bc0e111a2c2a3ef0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 2 Aug 2006 02:10:01 +0000 Subject: [PATCH 165/811] Dummy git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@225 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 4395 +++++++++++++++++++++++++++---------------------------- 1 file changed, 2196 insertions(+), 2199 deletions(-) diff --git a/wsjt.py b/wsjt.py index b9769853d..942691d01 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,2199 +1,2196 @@ -<<<<<<< .mine -#------------------------------------------------------------------- WSJT -======= -#----------------------------------------------------------------- WSJT ->>>>>>> .r223 -from Tkinter import * -from tkFileDialog import * -import Pmw -from tkMessageBox import showwarning -import g,os,time -import Audio -from math import log10 -from Numeric import zeros -import dircache -import Image,ImageTk #, ImageDraw -from palettes import colormapblue, colormapgray0, colormapHot, \ - colormapAFMHot, colormapgray1, colormapLinrad, Colormap2Palette -from types import * -import array - -root = Tk() -Version="5.9.5 r" + "$Rev$"[6:-1] -print "******************************************************************" -print "WSJT Version " + Version + ", by K1JT" -print "Revision date: " + \ - "$Date$"[7:-1] -print "Run date: " + time.asctime(time.gmtime()) + " UTC" - -#See if we are running in Windows -g.Win32=0 -if sys.platform=="win32": - g.Win32=1 - try: - root.option_readfile('wsjtrc.win') - except: - pass -else: - try: - root.option_readfile('wsjtrc') - except: - pass -root_geom="" - - -#------------------------------------------------------ Global variables -appdir=os.getcwd() -isync=0 -isync441=2 -isync6m=-10 -isync65=1 -isync_save=0 -iclip=0 -itol=5 -ntol=(10,25,50,100,200,400) #List of available tolerances -idsec=0 -#irdsec=0 -lauto=0 -cmap0="Linrad" -fileopened="" -font1='Helvetica' -hiscall="" -hisgrid="" -isec0=-99 -k2txb=IntVar() -kb8rq=IntVar() -loopall=0 -mode=StringVar() -mode.set("") -mrudir=os.getcwd() -nafc=IntVar() -naz=0 -ndepth=IntVar() -nel=0 -nblank=IntVar() -ncall=0 -ncwtrperiod=120 -ndmiles=0 -ndkm=0 -ndebug=IntVar() -neme=IntVar() -nfreeze=IntVar() -nhotaz=0 -nhotabetter=0 -nopen=0 -nosh441=IntVar() -noshjt65=IntVar() -nsked=IntVar() -setseq=IntVar() -ShOK=IntVar() -slabel="Sync " -textheight=7 -txsnrdb=99. -TxFirst=IntVar() -green=zeros(500,'f') -im=Image.new('P',(500,120)) -im.putpalette(Colormap2Palette(colormapLinrad),"RGB") -pim=ImageTk.PhotoImage(im) -balloon=Pmw.Balloon(root) - -g.freeze_decode=0 -g.mode="" -g.ndevin=IntVar() -g.ndevout=IntVar() -g.DevinName=StringVar() -g.DevoutName=StringVar() -g.focus=0 -#------------------------------------------------------ showspecjt -def showspecjt(event=NONE): - if g.showspecjt>0: - if g.focus>=1: - root.focus_set() - g.focus=0 - else: - g.focus=2 - else: - g.showspecjt=1 - g.focus=2 - -#------------------------------------------------------ restart -def restart(): - Audio.gcom2.nrestart=1 - Audio.gcom2.mantx=1 - -#------------------------------------------------------ restart2 -def restart2(): - Audio.gcom2.shok=ShOK.get() - Audio.gcom2.nrestart=1 - -#------------------------------------------------------ toggle_freeze -def toggle_freeze(event=NONE): - nfreeze.set(1-nfreeze.get()) - -#------------------------------------------------------ toggle_zap -def toggle_zap(event=NONE): - nzap.set(1-nzap.get()) - -#------------------------------------------------------ btx (1-6) -def btx1(event=NONE): - ntx.set(1) - Audio.gcom2.txmsg=(tx1.get()+' ')[:28] - Audio.gcom2.ntxreq=1 - restart() -def btx2(event=NONE): - ntx.set(2) - Audio.gcom2.txmsg=(tx2.get()+' ')[:28] - Audio.gcom2.ntxreq=2 - restart() -def btx3(event=NONE): - ntx.set(3) - Audio.gcom2.txmsg=(tx3.get()+' ')[:28] - Audio.gcom2.ntxreq=3 - restart() -def btx4(event=NONE): - ntx.set(4) - Audio.gcom2.txmsg=(tx4.get()+' ')[:28] - Audio.gcom2.ntxreq=4 - restart() -def btx5(event=NONE): - ntx.set(5) - Audio.gcom2.txmsg=(tx5.get()+' ')[:28] - Audio.gcom2.ntxreq=5 - restart() -def btx6(event=NONE): - ntx.set(6) - Audio.gcom2.txmsg=(tx6.get()+' ')[:28] - Audio.gcom2.ntxreq=6 - restart() - -#------------------------------------------------------ quit -def quit(): - root.destroy() - -#------------------------------------------------------ testmsgs -def testmsgs(): - for m in (tx1, tx2, tx3, tx4, tx5, tx6): - m.delete(0,99) - tx1.insert(0,"@A") - tx2.insert(0,"@B") - tx3.insert(0,"@C") - tx4.insert(0,"@D") - tx5.insert(0,"@1000") - tx6.insert(0,"@2000") - - -#------------------------------------------------------ textsize -def textsize(): - global textheight - if textheight <= 9: - textheight=21 - else: - if mode.get()[:4]=='JT65': - textheight=7 - else: - textheight=9 - text.configure(height=textheight) - -#------------------------------------------------------ logqso -def logqso(event=NONE): - t=time.strftime("%Y-%b-%d,%H:%M",time.gmtime()) - t=t+","+hiscall+","+hisgrid+","+str(g.nfreq)+","+g.mode+"\n" - t2="Please confirm making the following entry in WSJT.LOG:\n\n" + t - msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t2) - msg.geometry(msgpos()) - if g.Win32: msg.iconbitmap("wsjt.ico") - msg.focus_set() - result=msg.activate() - if result == 'Yes': - f=open(appdir+'/WSJT.LOG','a') - f.write(t) - f.close() - -#------------------------------------------------------ monitor -def monitor(event=NONE): - bmonitor.configure(bg='green') - Audio.gcom2.monitoring=1 - -#------------------------------------------------------ stopmon -def stopmon(event=NONE): - global loopall - loopall=0 - bmonitor.configure(bg='gray85') - Audio.gcom2.monitoring=0 - -#------------------------------------------------------ dbl_click_text -def dbl_click_text(event): - t=text.get('1.0',END) #Entire contents of text box - t1=text.get('1.0',CURRENT) #Contents from start to mouse pointer - dbl_click_call(t,t1,event) -#------------------------------------------------------ dbl_click_ave -def dbl_click_ave(event): - t=avetext.get('1.0',END) #Entire contents of text box - t1=avetext.get('1.0',CURRENT) #Contents from start to mouse pointer - dbl_click_call(t,t1,event) -#------------------------------------------------------ dbl_click_call -def dbl_click_call(t,t1,event): - global hiscall - i=len(t1) #Length to mouse pointer - i1=t1.rfind(' ')+1 #index of preceding space - i2=i1+t[i1:].find(' ') #index of next space - hiscall=t[i1:i2] #selected word, assumed as callsign - ToRadio.delete(0,END) - ToRadio.insert(0,hiscall) - i3=t1.rfind('\n')+1 #start of selected line - if i>6 and i2>i1: - try: - nsec=60*int(t1[i3+2:i3+4]) + int(t1[i3+4:i3+6]) - except: - nsec=0 - if setseq.get(): TxFirst.set((nsec/Audio.gcom1.trperiod)%2) - lookup() - GenStdMsgs() - i3=t[:i1].strip().rfind(' ')+1 - if t[i3:i1].strip() == 'CQ': - ntx.set(1) - else: - ntx.set(2) - if event.num==3 and not lauto: toggleauto() - -#------------------------------------------------------ decode -def decode(event=NONE): - if Audio.gcom2.ndecoding==0: #If already busy, ignore request - Audio.gcom2.nagain=1 - Audio.gcom2.npingtime=0 #Decode whole record - n=1 - Audio.gcom2.mousebutton=0 - if Audio.gcom2.ndecoding0==4: n=4 - Audio.gcom2.ndecoding=n #Standard decode, full file (d2a) - -#------------------------------------------------------ decode_include -def decode_include(event=NONE): - global isync,isync_save - isync_save=isync - isync=-99 - Audio.gcom2.minsigdb=-99 - decode() - -#------------------------------------------------------ decode_exclude -def decode_exclude(event=NONE): - global isync,isync_save - isync_save=isync - isync=99 - Audio.gcom2.minsigdb=99 - decode() - -#------------------------------------------------------ openfile -def openfile(event=NONE): - global mrudir,fileopened,nopen - nopen=1 #Work-around for "click feedthrough" bug - try: - os.chdir(mrudir) - except: - pass - fname=askopenfilename(filetypes=[("Wave files","*.wav *.WAV")]) - if fname: - Audio.getfile(fname,len(fname)) - if Audio.gcom2.ierr: print 'Error ',Audio.gcom2.ierr, \ - 'when trying to read file',fname - mrudir=os.path.dirname(fname) - fileopened=os.path.basename(fname) - os.chdir(appdir) - -#------------------------------------------------------ opennext -def opennext(event=NONE): - global ncall,fileopened,loopall,mrudir - if fileopened=="" and ncall==0: - openfile() - ncall=1 - else: -# Make a list of *.wav files in mrudir - la=os.listdir(mrudir) - la.sort() - lb=[] - for i in range(len(la)): - j=la[i].find(".wav") + la[i].find(".WAV") - if j>0: lb.append(la[i]) - for i in range(len(lb)): - if lb[i]==fileopened: - break - if ihc1 and hchc1 and modified==0: - stmp.append(NewEntry+"\n") - try: - f=open(appdir+'/CALL3.TMP','w') - f.writelines(stmp) - f.close() - except: - print 'Error in opening or writing to CALL3.TMP' - - if modified: - if os.path.exists("CALL3.OLD"): os.remove("CALL3.OLD") - os.rename("CALL3.TXT","CALL3.OLD") - os.rename("CALL3.TMP","CALL3.TXT") - -#-------------------------------------------------------- clrToRadio -def clrToRadio(event): - ToRadio.delete(0,END) - HisGrid.delete(0,99) - ToRadio.focus_set() - if kb8rq.get(): ntx.set(6) - - -#------------------------------------------------------ whois -def whois(hiscall): - whodat="" - try: - f=open(appdir+'/CALL3.TXT','r') - s=f.readlines() - f.close() - except: - print 'Error when searching CALL3.TXT, or no such file present' - s="" - for i in range(len(s)): - if s[i][:2] != '//': - i1=s[i].find(',') - if s[i][:i1] == hiscall: - return s[i] - return "" - -#------------------------------------------------------ cleartext -def cleartext(): - f=open(appdir+'/decoded.txt',mode='w') - f.truncate(0) #Delete contents of decoded.txt - f.close() - f=open(appdir+'/decoded.ave',mode='w') - f.truncate(0) #Delete contents of decoded.ave - f.close() - -#------------------------------------------------------ ModeFSK441 -def ModeFSK441(event=NONE): - global slabel,isync,isync441,textheight,itol - if g.mode != "FSK441": - if lauto: toggleauto() - mode.set("FSK441") - cleartext() - Audio.gcom1.trperiod=30 - lab2.configure(text='FileID T Width dB Rpt DF') - lab1.configure(text='Time (s)',bg="green") - lab4.configure(fg='black') - lab5.configure(fg='black') - lab6.configure(bg="green") - isync=isync441 - slabel="S " - lsync.configure(text=slabel+str(isync)) - iframe4b.pack_forget() - textheight=9 - text.configure(height=textheight) - bclravg.configure(state=DISABLED) - binclude.configure(state=DISABLED) - bexclude.configure(state=DISABLED) - cbfreeze.configure(state=DISABLED) - cbafc.configure(state=DISABLED) - sked.configure(state=DISABLED) - report.configure(state=NORMAL) - shmsg.configure(state=NORMAL) - graph2.configure(bg='black') - itol=5 - inctol() - ntx.set(1) - GenStdMsgs() - erase() - -#------------------------------------------------------ ModeJT65 -def ModeJT65(): - global slabel,isync,isync65,textheight,itol - cleartext() - lab2.configure(text='FileID Sync dB DT DF W') - lab4.configure(fg='gray85') - lab5.configure(fg='gray85') - Audio.gcom1.trperiod=60 - iframe4b.pack(after=iframe4,expand=1, fill=X, padx=4) - textheight=7 - text.configure(height=textheight) - isync=isync65 - slabel="Sync " - lsync.configure(text=slabel+str(isync)) - bclravg.configure(state=NORMAL) - binclude.configure(state=NORMAL) - bexclude.configure(state=NORMAL) - cbfreeze.configure(state=NORMAL) - cbafc.configure(state=NORMAL) - sked.configure(state=NORMAL) - report.configure(state=DISABLED) - shmsg.configure(state=DISABLED) - graph2.configure(bg='#66FFFF') - itol=5 - inctol() - ntx.set(1) - GenStdMsgs() - erase() -# graph2.pack_forget() - -#------------------------------------------------------ ModeJT65A -def ModeJT65A(event=NONE): - if g.mode != "JT65A": - if lauto: toggleauto() - mode.set("JT65A") - ModeJT65() - -#------------------------------------------------------ ModeJT65B -def ModeJT65B(event=NONE): - if g.mode != "JT65B": - if lauto: toggleauto() - mode.set("JT65B") - ModeJT65() - -#------------------------------------------------------ ModeJT65C -def ModeJT65C(event=NONE): - if g.mode != "JT65C": - if lauto: toggleauto() - mode.set("JT65C") - ModeJT65() - -#------------------------------------------------------ ModeJT6M -def ModeJT6M(event=NONE): - global slabel,isync,isync6m,itol - if g.mode != "JT6M": - if lauto: toggleauto() - cleartext() - ModeFSK441() - lab2.configure(text='FileID T Width dB DF') - mode.set("JT6M") - isync=isync6m - lsync.configure(text=slabel+str(isync)) - shmsg.configure(state=DISABLED) - cbfreeze.configure(state=NORMAL) - itol=5 - inctol() - ntx.set(1) - GenStdMsgs() - erase() - - -#------------------------------------------------------ ModeCW -def ModeCW(event=NONE): - if g.mode != "CW": - if lauto: toggleauto() - cleartext() - mode.set("CW") - Audio.gcom1.trperiod=ncwtrperiod - iframe4b.pack_forget() - text.configure(height=9) - bclravg.configure(state=DISABLED) - binclude.configure(state=DISABLED) - bexclude.configure(state=DISABLED) - cbfreeze.configure(state=DISABLED) - cbafc.configure(state=DISABLED) - sked.configure(state=DISABLED) - report.configure(state=NORMAL) - ntx.set(1) - GenStdMsgs() - erase() - -#------------------------------------------------------ ModeEcho -#def ModeEcho(event=NONE): -# mode.set("Echo") -# stub() - -#------------------------------------------------------ msgpos -def msgpos(): - g=root_geom[root_geom.index("+"):] - t=g[1:] - x=int(t[:t.index("+")]) # + 70 - y=int(t[t.index("+")+1:]) # + 70 - return "+%d+%d" % (x,y) - -#------------------------------------------------------ about -def about(event=NONE): - global Version - about=Toplevel(root) - about.geometry(msgpos()) - if g.Win32: about.iconbitmap("wsjt.ico") - t="WSJT Version " + Version + ", by K1JT" - Label(about,text=t,font=(font1,16)).pack(padx=20,pady=5) - t=""" -WSJT is a weak signal communications program. It supports -four operating modes: FSK441, a fast mode for meteor scatter; -JT6M, specially optimized for meteor and ionospheric scatter -on 50 MHz; JT65, an extremely sensitive mode for troposcatter -and EME; and CW at 15 WPM with messages structured for EME. - -WSJT is Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, -with contributions from additional authors. It is Open Source -software, licensed under the GNU General Public License (GPL). -Source code and programming information may be found at -http://developer.berlios.de/projects/wsjt/. -""" - Label(about,text=t,justify=LEFT).pack(padx=20) - t="Revision date: " + \ - "$Date$"[7:-1] - Label(about,text=t,justify=LEFT).pack(padx=20) - about.focus_set() - -#------------------------------------------------------ shortcuts -def shortcuts(event=NONE): - scwid=Toplevel(root) - scwid.geometry(msgpos()) - if g.Win32: scwid.iconbitmap("wsjt.ico") - t=""" -F1 List keyboard shortcuts -Shift-F1 List special mouse commands -CTRL-F1 About WSJT -F2 Options -F3 Tx Mute -F4 Clear "To Radio" -F5 What message to send? -F6 Open next file in directory -Shift-F6 Decode all wave files in directory -F7 Set FSK441 mode -Shift-F7 Set JT6M mode -F8 Set JT65A mode -Shift-F8 Set JT65B mode -CTRL-F8 Set JT65C mode -Shift-CTRL-F8 Set CW mode -F10 Toggle focus between WSJT screens -Alt-1 to Alt-6 Tx1 to Tx6 -Alt-A Toggle Auto On/Off -Alt-D Decode -Alt-E Erase -Alt-F Toggle Freeze -Alt-G Generate Standard Messages -Alt-I Include -Alt-L Lookup -CTRL-L Lookup, then Generate Standard Messages -Alt-M Monitor -Alt-O Tx Stop -Alt-P Play -Alt-Q Log QSO -Alt-S Stop Monitoring or Decoding -Alt-V Save Last -Alt-X Exclude -Alt-Z Toggle Zap -Right/Left Arrow Increase/decrease Freeze DF -""" - Label(scwid,text=t,justify=LEFT).pack(padx=20) - scwid.focus_set() - -#------------------------------------------------------ mouse_commands -def mouse_commands(event=NONE): - scwid=Toplevel(root) - scwid.geometry(msgpos()) - if g.Win32: scwid.iconbitmap("wsjt.ico") - t=""" -Click on Action --------------------------------------------------------- -Waterfall FSK441/JT6M: click to decode ping - JT65: Click to set DF for Freeze - Double-click to Freeze and Decode - -Main screen, FSK441/JT6M: click to decode ping -graphics area JT65: Click to set DF for Freeze - Double-click to Freeze and Decode - -Main screen, Double-click puts callsign in Tx messages -text area Right-double-click also sets Auto ON - -Sync, Clip, Left/Right click to increase/decrease -Tol, ... -""" - Label(scwid,text=t,justify=LEFT).pack(padx=20) - scwid.focus_set() - -#------------------------------------------------------ what2send -def what2send(event=NONE): - screenf5=Toplevel(root) - screenf5.geometry(root_geom[root_geom.index("+"):]) - if g.Win32: screenf5.iconbitmap("wsjt.ico") - t=""" -To optimize your chances of completing a valid QSO using WSJT, -use the following standard procedures and *do not* exchange pertinent -information by other means (e.g., internet, telephone, ...) while the -QSO is in progress! - -FSK441 or JT6M: If you have received - ... less than both calls from the other station, send both calls. - ... both calls, send both calls and your signal report. - ... both calls and signal report, send R and your report. - ... R plus signal report, send RRR. - ... RRR, the QSO is complete. However, the other station may not -know this, so it is conventional to send 73 to signify that you are done. - -(Outside of North America, the customary procedures for FSK441 -and JT6M may be slightly different.) - - -JT65: If you have received - ... less than both calls, send both calls and your grid locator. - ... both calls, send both calls, your grid locator, and OOO. - ... both calls and OOO, send RO. - ... RO, send RRR. - ... RRR, the QSO is complete. However, the other station may not -know this, so it is conventional to send 73 to signify that you are done. - -(Sending grid locators is conventional in JT65, but numerical signal -reports may be substituted.) -""" - Label(screenf5,text=t,justify=LEFT).pack(padx=20) - screenf5.focus_set() - -#------------------------------------------------------ prefixes -def prefixes(event=NONE): - pfx=Toplevel(root) - pfx.geometry(msgpos()) - if g.Win32: pfx.iconbitmap("wsjt.ico") - f=open(appdir+'/prefixes.txt','r') - s=f.readlines() - t2="" - for i in range(4): - t2=t2+s[i] - t="" - for i in range(len(s)-4): - t=t+s[i+4] - t=t.split() - t.sort() - t1="" - n=0 - for i in range(len(t)): - t1=t1+t[i]+" " - n=n+len(t[i])+2 - if n>60: - t1=t1+"\n" - n=0 - t1=t1+"\n" - if options.addpfx.get().lstrip(): - t1=t1+"\nOptional prefix: "+(options.addpfx.get().lstrip()+' ')[:8] - t2=t2+"\n"+t1 - Label(pfx,text=t2,justify=LEFT).pack(padx=20) - pfx.focus_set() - -#------------------------------------------------------ azdist -def azdist(): - if len(HisGrid.get().strip())<4: - labAz.configure(text="") - labHotAB.configure(text="",bg='gray85') - labDist.configure(text="") - else: - if mode.get()[:4]=="JT65" or mode.get()[:2]=="CW": - labAz.configure(text="Az: %d" % (naz,)) - labHotAB.configure(text="",bg='gray85') - else: - labAz.configure(text="Az: %d El: %d" % (naz,nel)) - if nhotabetter: - labHotAB.configure(text="Hot A: "+str(nhotaz),bg='#FF9900') - else: - labHotAB.configure(text="Hot B: "+str(nhotaz),bg='#FF9900') - if options.mileskm.get()==0: - labDist.configure(text=str(ndmiles)+" mi") - else: - labDist.configure(text=str(int(1.609344*ndmiles))+" km") - -#------------------------------------------------------ incsync -def incsync(event): - global isync - if isync<10: - isync=isync+1 - lsync.configure(text=slabel+str(isync)) - -#------------------------------------------------------ decsync -def decsync(event): - global isync - if isync>-30: - isync=isync-1 - lsync.configure(text=slabel+str(isync)) - -#------------------------------------------------------ incclip -def incclip(event): - global iclip - if iclip<5: - iclip=iclip+1 - if iclip==5: iclip=99 - lclip.configure(text='Clip '+str(iclip)) - -#------------------------------------------------------ decclip -def decclip(event): - global iclip - if iclip>-5: - iclip=iclip-1 - if iclip==98: iclip=4 - lclip.configure(text='Clip '+str(iclip)) - -#------------------------------------------------------ inctol -def inctol(event=NONE): - global itol - if itol<5: itol=itol+1 - ltol.configure(text='Tol '+str(ntol[itol])) - -#------------------------------------------------------ dectol -def dectol(event): - global itol - if itol>0 : itol=itol-1 - ltol.configure(text='Tol '+str(ntol[itol])) - -#------------------------------------------------------ incdsec -def incdsec(event): - global idsec - idsec=idsec+5 - bg='red' - if idsec==0: bg='white' - ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg) - Audio.gcom1.ndsec=idsec - -#------------------------------------------------------ decdsec -def decdsec(event): - global idsec - idsec=idsec-5 - bg='red' - if idsec==0: bg='white' - ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg) - Audio.gcom1.ndsec=idsec - -###------------------------------------------------------ incrdsec -##def incrdsec(event): -## global irdsec -## irdsec=irdsec+5 -## bg='red' -## if irdsec==0: bg='white' -## lrdsec.configure(text='RDsec '+str(0.1*irdsec),bg=bg) -## -###------------------------------------------------------ decrdsec -##def decrdsec(event): -## global irdsec -## irdsec=irdsec-5 -## bg='red' -## if irdsec==0: bg='white' -## lrdsec.configure(text='RDsec '+str(0.1*irdsec),bg=bg) -## -#------------------------------------------------------ inctrperiod -def inctrperiod(event): - global ncwtrperiod - if mode.get()[:2]=="CW": - if ncwtrperiod==120: ncwtrperiod=150 - if ncwtrperiod==60: ncwtrperiod=120 - Audio.gcom1.trperiod=ncwtrperiod - -#------------------------------------------------------ dectrperiod -def dectrperiod(event): - global ncwtrperiod - if mode.get()[:2]=="CW": - if ncwtrperiod==120: ncwtrperiod=60 - if ncwtrperiod==150: ncwtrperiod=120 - Audio.gcom1.trperiod=ncwtrperiod - -#------------------------------------------------------ erase -def erase(event=NONE): - graph1.delete(ALL) - if mode.get()[:4]!="JT65" and mode.get()[:2]!="CW": graph2.delete(ALL) - text.configure(state=NORMAL) - text.delete('1.0',END) - text.configure(state=DISABLED) - avetext.configure(state=NORMAL) - avetext.delete('1.0',END) - avetext.configure(state=DISABLED) - lab3.configure(text=" ") - Audio.gcom2.decodedfile=" " -#------------------------------------------------------ clear_avg -def clear_avg(event=NONE): - avetext.configure(state=NORMAL) - avetext.delete('1.0',END) - avetext.configure(state=DISABLED) - f=open(appdir+'/decoded.ave',mode='w') - f.truncate(0) #Delete contents of decoded.ave - f.close() - Audio.gcom2.nclearave=1 - -#------------------------------------------------------ defaults -def defaults(): - global slabel,isync,iclip,itol,idsec - isync=1 - if g.mode=="FSK441": isync=2 - if g.mode=="JT6M": isync=-10 - lsync.configure(text=slabel+str(isync)) - iclip=0 - lclip.configure(text='Clip '+str(iclip)) - itol=5 - ltol.configure(text='Tol '+str(ntol[itol])) - -#------------------------------------------------------ delwav -def delwav(): - t="Are you sure you want to delete\nall *.WAV files in the RxWav directory?" - msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t) - msg.geometry(msgpos()) - if g.Win32: msg.iconbitmap("wsjt.ico") - msg.focus_set() - result=msg.activate() - if result == 'Yes': -# Make a list of *.wav files in RxWav - la=dircache.listdir(appdir+'/RxWav') - lb=[] - for i in range(len(la)): - j=la[i].find(".wav") + la[i].find(".WAV") - if j>0: lb.append(la[i]) -# Now delete them all. - for i in range(len(lb)): - fname=appdir+'/RxWav/'+lb[i] - os.remove(fname) - -#------------------------------------------------------ del_all -def del_all(): - Audio.gcom1.ns0=-999999 - -#------------------------------------------------------ toggleauto -def toggleauto(event=NONE): - global lauto - lauto=1-lauto - Audio.gcom2.lauto=lauto - if lauto: - monitor() - else: - Audio.gcom1.txok=0 - Audio.gcom2.mantx=0 - if lauto==0: auto.configure(text='Auto is OFF',bg='gray85',relief=RAISED) - if lauto==1: auto.configure(text='Auto is ON',bg='red',relief=SOLID) - -#----------------------------------------------------- dtdf_change -# Readout of graphical cursor location -def dtdf_change(event): - if mode.get()[:4]!="JT65": - t="%.1f" % (event.x*30.0/500.0,) - lab6.configure(text=t,bg='green') - else: - if event.y<40 and Audio.gcom2.nspecial==0: - lab1.configure(text='Time (s)',bg="#33FFFF") #light blue - t="%.1f" % (12.0*event.x/500.0-2.0,) - lab6.configure(text=t,bg="#33FFFF") - elif (event.y>=40 and event.y<95) or \ - (event.y<95 and Audio.gcom2.nspecial>0): - lab1.configure(text='DF (Hz)',bg='red') - t="%d" % int(1200.0*event.x/500.0-600.0,) - lab6.configure(text=t,bg="red") - else: - lab1.configure(text='Time (s)',bg='green') - t="%.1f" % (53.0*event.x/500.0,) - lab6.configure(text=t,bg="green") - -#---------------------------------------------------- mouse_click_g1 -def mouse_click_g1(event): - global nopen - if not nopen: - if mode.get()[:4]=="JT65": - Audio.gcom2.mousedf=int((event.x-250)*2.4) - else: - if Audio.gcom2.ndecoding==0: #If decoder is busy, ignore - Audio.gcom2.nagain=1 - Audio.gcom2.mousebutton=event.num #Left=1, Right=3 - Audio.gcom2.npingtime=int(195+60*event.x) #Time (ms) of mouse-picked ping - if Audio.gcom2.ndecoding0==4: - Audio.gcom2.ndecoding=4 #Decode from recorded file - elif Audio.gcom2.ndecoding0==1: - Audio.gcom2.ndecoding=5 #Decode data in main screen - nopen=0 - -#------------------------------------------------------ double-click_g1 -def double_click_g1(event): - if g.mode[:4]=='JT65' and Audio.gcom2.ndecoding==0: - g.freeze_decode=1 - -#------------------------------------------------------ mouse_up_g1 -def mouse_up_g1(event): -# print event.x - pass - -#------------------------------------------------------ right_arrow -def right_arrow(event=NONE): - n=5*int(Audio.gcom2.mousedf/5) + 5 - if n==Audio.gcom2.mousedf: n=n+5 - Audio.gcom2.mousedf=n - -#------------------------------------------------------ left_arrow -def left_arrow(event=NONE): - n=5*int(Audio.gcom2.mousedf/5) - if n==Audio.gcom2.mousedf: n=n-5 - Audio.gcom2.mousedf=n - -#------------------------------------------------------ GenStdMsgs -def GenStdMsgs(event=NONE): - t=ToRadio.get().upper().strip() - ToRadio.delete(0,99) - ToRadio.insert(0,t) - if k2txb.get()!=0: ntx.set(1) - Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] - for m in (tx1, tx2, tx3, tx4, tx5, tx6): - m.delete(0,99) - if mode.get()=="FSK441" or mode.get()=="JT6M": - r=report.get() - tx1.insert(0,setmsg(options.tx1.get(),r)) - tx2.insert(0,setmsg(options.tx2.get(),r)) - tx3.insert(0,setmsg(options.tx3.get(),r)) - tx4.insert(0,setmsg(options.tx4.get(),r)) - tx5.insert(0,setmsg(options.tx5.get(),r)) - tx6.insert(0,setmsg(options.tx6.get(),r)) - elif mode.get()[:4]=="JT65": - if ToRadio.get().find("/") == -1 and \ - options.MyCall.get().find("/") == -1: - t=ToRadio.get() + " "+options.MyCall.get() + " "+options.MyGrid.get()[:4] - tx1.insert(0,t.upper()) - else: - tx1.insert(0,ToRadio.get() + " "+options.MyCall.get()) - tx2.insert(0,tx1.get()+" OOO") - tx3.insert(0,"RO") - tx4.insert(0,"RRR") - tx5.insert(0,"73") - t="CQ " + options.MyCall.get()+ " "+options.MyGrid.get()[:4] - tx6.insert(0,t.upper()) - elif mode.get()[:2]=="CW": - tx1.insert(0,ToRadio.get() + " "+options.MyCall.get()) - tx2.insert(0,tx1.get()+" OOO") - tx3.insert(0,tx1.get()+" RO") - tx4.insert(0,tx1.get()+" RRR") - tx5.insert(0,tx1.get()+" 73") - tx6.insert(0,"CQ " + options.MyCall.get()) - -#------------------------------------------------------ setmsg -def setmsg(template,r): - msg="" - npct=0 - for i in range(len(template)): - if npct: - if template[i]=="M": msg=msg+options.MyCall.get().upper().strip() - if template[i]=="T": msg=msg+ToRadio.get().upper().strip() - if template[i]=="R": msg=msg+r - if template[i]=="G": msg=msg+options.MyGrid.get()[:4] - if template[i]=="L": msg=msg+options.MyGrid.get() - npct=0 - else: - npct=0 - if template[i]=="%": - npct=1 - else: - msg=msg+template[i] - return msg.upper() - -#------------------------------------------------------ plot_large -def plot_large(): - "Plot the green, red, and blue curves in JT65 mode." - graph1.delete(ALL) - y=[] - ngreen=Audio.gcom2.ngreen - if ngreen>0: - for i in range(ngreen): #Find ymax for green curve - green=Audio.gcom2.green[i] - y.append(green) - ymax=max(y) - if ymax<1: ymax=1 - yfac=4.0 - if ymax>75.0/yfac: yfac=75.0/ymax - xy=[] - for i in range(ngreen): #Make xy list for green curve - green=Audio.gcom2.green[i] - n=int(105.0-yfac*green) - xy.append(i) - xy.append(n) - graph1.create_line(xy,fill="green") - - if Audio.gcom2.nspecial==0: - y=[] - for i in range(446): #Find ymax for red curve - psavg=Audio.gcom2.psavg[i+1] - y.append(psavg) - ymax=max(y) - yfac=30.0 - if ymax>85.0/yfac: yfac=85.0/ymax - xy=[] - fac=500.0/446.0 - for i in range(446): #Make xy list for red curve - x=i*fac - psavg=Audio.gcom2.psavg[i+1] - n=int(90.0-yfac*psavg) - xy.append(x) - xy.append(n) - graph1.create_line(xy,fill="red") - else: - y1=[] - y2=[] - for i in range(446): #Find ymax for red curve - ss1=Audio.gcom2.ss1[i+1] - y1.append(ss1) - ss2=Audio.gcom2.ss2[i+1] - y2.append(ss2) - ymax=max(y1+y2) - yfac=30.0 - if ymax>85.0/yfac: yfac=85.0/ymax - xy1=[] - xy2=[] - fac=500.0/446.0 - for i in range(446): #Make xy list for red curve - x=i*fac - ss1=Audio.gcom2.ss1[i+1] - n=int(90.0-yfac*ss1) - xy1.append(x) - xy1.append(n) - ss2=Audio.gcom2.ss2[i+1] - n=int(90.0-yfac*ss2) - 20 - xy2.append(x) - xy2.append(n) - graph1.create_line(xy1,fill="magenta") - graph1.create_line(xy2,fill="orange") - - x1 = 250.0 + fac*Audio.gcom2.ndf/2.6916504 - x2 = x1 + Audio.gcom2.mode65*Audio.gcom2.nspecial*10*fac - graph1.create_line([x1,85,x1,95],fill="yellow") - graph1.create_line([x2,85,x2,95],fill="yellow") - t="RO" - if Audio.gcom2.nspecial==3: t="RRR" - if Audio.gcom2.nspecial==4: t="73" - graph1.create_text(x2+3,93,anchor=W,text=t,fill="yellow") - - if Audio.gcom2.ccf[0] != -9999.0: - y=[] - for i in range(65): #Find ymax for blue curve - ccf=Audio.gcom2.ccf[i] - y.append(ccf) - ymax=max(y) - yfac=40.0 - if ymax>55.0/yfac: yfac=55.0/ymax - xy2=[] - fac=500.0/64.6 - for i in range(65): #Make xy list for blue curve - x=(i+0.5)*fac - ccf=Audio.gcom2.ccf[i] - n=int(60.0-yfac*ccf) - xy2.append(x) - xy2.append(n) - graph1.create_line(xy2,fill='#33FFFF') - -# Put in the tick marks - for i in range(13): - x=int(i*41.667) - j2=115 - if i==1 or i==6 or i==11: j2=110 - graph1.create_line([x,j2,x,125],fill="red") - if Audio.gcom2.nspecial==0: -# x=int((i-0.8)*41.667) - j1=9 - if i==2 or i==7 or i==12: j1=14 - graph1.create_line([x,0,x,j1],fill="#33FFFF") #light blue - else: - graph1.create_line([x,0,x,125-j2],fill="red") - -#------------------------------------------------------ plot_small -def plot_small(): - graph2.delete(ALL) - xy=[] - xy2=[] - df=11025.0/256.0 - fac=150.0/3500.0 - for i in range(81): - x=int(i*df*fac) - xy.append(x) - psavg=Audio.gcom2.psavg[i] - if mode.get()=="JT6M": psavg=psavg + 27.959 - n=int(150.0-2*psavg) - xy.append(n) - if mode.get()=='FSK441': - ps0=Audio.gcom2.ps0[i] - n=int(150.0-2*ps0) - xy2.append(x) - xy2.append(n) - graph2.create_line(xy,fill="magenta") - if mode.get()=='JT6M': - plot_yellow() - elif mode.get()=='FSK441': - graph2.create_line(xy2,fill="red") - for i in range(4): - x=(i+2)*441*fac - graph2.create_line([x,0,x,20],fill="yellow") - for i in range(7): - x=i*500*fac - ytop=110 - if i%2: ytop=115 - graph2.create_line([x,120,x,ytop],fill="white") - -#------------------------------------------------------ plot_yellow -def plot_yellow(): - nz=int(Audio.gcom2.ps0[215]) - if nz>10: - y=[] - for i in range(nz): #Find ymax for yellow curve - n=Audio.gcom2.ps0[i] - y.append(n) - ymax=max(y) - fac=1.0 - if ymax>60: fac=60.0/ymax - xy2=[] - for i in range(nz): - x=int(2.34*i) - y=fac*Audio.gcom2.ps0[i] + 8 - n=int(85.0-y) - xy2.append(x) - xy2.append(n) - graph1.create_line(xy2,fill="yellow") - -#------------------------------------------------------ update -def update(): - global root_geom,isec0,naz,nel,ndmiles,ndkm,nhotaz,nhotabetter,nopen, \ - im,pim,cmap0,isync,isync441,isync6m,isync65,isync_save,idsec, \ - first,itol,txsnrdb - - utc=time.gmtime(time.time()+0.1*idsec) - isec=utc[5] - - if isec != isec0: #Do once per second - isec0=isec - t=time.strftime('%Y %b %d\n%H:%M:%S',utc) - Audio.gcom2.utcdate=t[:12] - ldate.configure(text=t) - root_geom=root.geometry() - utchours=utc[3]+utc[4]/60.0 + utc[5]/3600.0 - naz,nel,ndmiles,ndkm,nhotaz,nhotabetter=Audio.azdist0( \ - options.MyGrid.get().upper(),HisGrid.get().upper(),utchours) - azdist() - g.nfreq=nfreq.get() - - if Audio.gcom2.ndecoding==0: - g.AzSun,g.ElSun,g.AzMoon,g.ElMoon,g.AzMoonB,g.ElMoonB,g.ntsky, \ - g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \ - g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \ - g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \ - utchours,nfreq.get(),options.MyGrid.get().upper(), \ - options.auxra.get()+' '[:9], \ - options.auxdec.get()+' '[:9]) - - if len(HisGrid.get().strip())<4: - g.ndop=g.ndop00 - g.dfdt=g.dfdt0 - - if mode.get()[:4]=='JT65' or mode.get()[:2]=='CW' : - graph2.delete(ALL) - g2font='Helvetica 16' - graph2.create_text(75,13,anchor=CENTER,text="Moon",font=g2font) - graph2.create_text(26,37,anchor=W, text="Az: %8.2f" % g.AzMoon,font=g2font) - graph2.create_text(26,61,anchor=W, text="El: %8.2f" % g.ElMoon,font=g2font) - graph2.create_text(26,85,anchor=W, text="Dop: %6d" % g.ndop,font=g2font) - graph2.create_text(26,109,anchor=W,text="Dgrd:%8.1f" % g.Dgrd,font=g2font) - - if g.freeze_decode and mode.get()[:4]=='JT65': - itol=2 - ltol.configure(text='Tol '+str(50)) - Audio.gcom2.dftolerance=50 - nfreeze.set(1) - Audio.gcom2.nfreeze=1 - if Audio.gcom2.monitoring: - Audio.gcom2.ndecoding=1 - Audio.gcom2.nagain=0 - else: - Audio.gcom2.ndecoding=4 - Audio.gcom2.nagain=1 - g.freeze_decode=0 - - n=int(20.0*log10(g.rms/770.0+0.01)) - t="Rx noise:%3d dB" % (n,) - if n>=-10 and n<=10: - msg4.configure(text=t,bg='gray85') - else: - msg4.configure(text=t,bg='red') - - t=g.ftnstr(Audio.gcom2.decodedfile) -# i=t.rfind(".") - i=g.rfnd(t,".") - t=t[:i] - lab3.configure(text=t) - if mode.get() != g.mode or first: - if mode.get()=="FSK441": - msg2.configure(bg='yellow') - elif mode.get()=="JT65A" or mode.get()=="JT65B" or mode.get()=="JT65C": - msg2.configure(bg='#00FFFF') - elif mode.get()=="JT6M": - msg2.configure(bg='#FF00FF') - elif mode.get()=="CW": - msg2.configure(bg='#00FF00') -# elif mode.get()=="Echo": -# msg2.configure(bg='#FF0000') - g.mode=mode.get() - first=0 - - samfac_in=Audio.gcom1.mfsample/110250.0 - samfac_out=Audio.gcom1.mfsample2/110250.0 - xin=1 - xout=1 - try: - xin=samfac_in/options.samfacin.get() - xout=samfac_out/options.samfacout.get() - if xin<0.999 or xin>1.001 or xout<0.999 or xout>1.001: - lab8.configure(text="%6.4f %6.4f" \ - % (options.samfacin.get(),options.samfacout.get()), \ - fg='black',bg='red') - else: - lab8.configure(fg='gray85',bg='gray85') - except: - pass - - msg1.configure(text="%6.4f %6.4f" % (samfac_in,samfac_out)) - msg2.configure(text=mode.get()) - t="Freeze DF:%4d" % (int(Audio.gcom2.mousedf),) - msg3.configure(text=t) - bdecode.configure(bg='gray85') - if Audio.gcom2.ndecoding: #Set button bg=light_blue - bdecode.configure(bg='#66FFFF') #while decoding - if mode.get()[:2]=="CW": - msg5.configure(text="TR Period: %d s" % (Audio.gcom1.trperiod,), \ - bg='white') - else: - msg5.configure(text="TR Period: %d s" % (Audio.gcom1.trperiod,), \ - bg='gray85') - - tx1.configure(bg='white') - tx2.configure(bg='white') - tx3.configure(bg='white') - tx4.configure(bg='white') - tx5.configure(bg='white') - tx6.configure(bg='white') - if tx6.get()[:1]=='#': - try: - txsnrdb=float(tx6.get()[1:]) - if txsnrdb>-99.0 and txsnrdb<40.0: - Audio.gcom1.txsnrdb=txsnrdb - tx6.configure(bg='orange') - except: - txsnrdb=99.0 - else: - txsnrdb=99.0 - Audio.gcom1.txsnrdb=txsnrdb - if Audio.gcom2.monitoring and not Audio.gcom1.transmitting: - bmonitor.configure(bg='green') - else: - bmonitor.configure(bg='gray85') - if Audio.gcom1.transmitting: - nmsg=int(Audio.gcom2.nmsg) - t=g.ftnstr(Audio.gcom2.sending) - if t[:3]=="CQ ": nsked.set(0) - t="Txing: "+t[:nmsg] - bgcolor='yellow' - if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' #Shorthand (lt blue) - if Audio.gcom2.sendingsh==-1: bgcolor='red' #Plain Text - if Audio.gcom2.sendingsh==2: bgcolor='pink' #Test file - if txsnrdb<90.0: bgcolor='orange' #Simulation mode - if Audio.gcom2.ntxnow==1: tx1.configure(bg=bgcolor) - elif Audio.gcom2.ntxnow==2: tx2.configure(bg=bgcolor) - elif Audio.gcom2.ntxnow==3: tx3.configure(bg=bgcolor) - elif Audio.gcom2.ntxnow==4: tx4.configure(bg=bgcolor) - elif Audio.gcom2.ntxnow==5: tx5.configure(bg=bgcolor) - else: tx6.configure(bg=bgcolor) - else: - bgcolor='green' - t='Receiving' - msg7.configure(text=t,bg=bgcolor) - - if Audio.gcom2.ndecdone==1 or g.cmap != cmap0: - if Audio.gcom2.ndecdone==1: - if isync==-99 or isync==99: - isync=isync_save - Audio.gcom2.minsigdb=isync - try: - f=open(appdir+'/decoded.txt',mode='r') - lines=f.readlines() - f.close() - except: - lines="" - text.configure(state=NORMAL) - for i in range(len(lines)): - text.insert(END,lines[i]) - text.see(END) - text.configure(state=DISABLED) - - if mode.get()[:4]=='JT65': - try: - f=open(appdir+'/decoded.ave',mode='r') - lines=f.readlines() - f.close() - except: - lines[0]="" - lines[1]="" - avetext.configure(state=NORMAL) - avetext.delete('1.0',END) - if len(lines)>1: - avetext.insert(END,lines[0]) - avetext.insert(END,lines[1]) - avetext.configure(state=DISABLED) - Audio.gcom2.ndecdone=2 - - if g.cmap != cmap0: - im.putpalette(g.palette) - cmap0=g.cmap - - if mode.get()[:4]=='JT65': - plot_large() - else: - im.putdata(Audio.gcom2.b) - pim=ImageTk.PhotoImage(im) #Convert Image to PhotoImage - graph1.delete(ALL) -# NB: top two lines are probably invisible ... - graph1.create_image(0,0,anchor='nw',image=pim) - t=g.filetime(g.ftnstr(Audio.gcom2.decodedfile)) - graph1.create_text(100,80,anchor=W,text=t,fill="white") - plot_small() - if loopall: opennext() - nopen=0 - -# Save some parameters - g.mode=mode.get() - g.report=report.get() - if mode.get()=='FSK441': isync441=isync - elif mode.get()=='JT6M': isync6m=isync - elif mode.get()[:4]=='JT65': isync65=isync - Audio.gcom1.txfirst=TxFirst.get() - try: - Audio.gcom1.samfacin=options.samfacin.get() - except: - Audio.gcom1.samfacin=1.0 - try: - Audio.gcom1.samfacout=options.samfacout.get() - except: - Audio.gcom1.samfacout=1.0 -# if Audio.gcom1.samfacin>1.01: Audio.gcom1.samfacin=1.01 -# ... etc. - Audio.gcom2.mycall=(options.MyCall.get()+' ')[:12] - Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] - Audio.gcom2.hisgrid=(HisGrid.get()+' ')[:6] - Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] - Audio.gcom2.ntxreq=ntx.get() - tx=(tx1,tx2,tx3,tx4,tx5,tx6) - Audio.gcom2.txmsg=(tx[ntx.get()-1].get()+' ')[:28] - Audio.gcom2.mode=(mode.get()+' ')[:6] - Audio.gcom2.shok=ShOK.get() - Audio.gcom2.nsave=nsave.get() - Audio.gcom2.nzap=nzap.get() - Audio.gcom2.ndebug=ndebug.get() - Audio.gcom2.minsigdb=isync - Audio.gcom2.nclip=iclip - Audio.gcom2.nblank=nblank.get() - Audio.gcom2.nafc=nafc.get() - Audio.gcom2.nfreeze=nfreeze.get() - Audio.gcom2.dftolerance=ntol[itol] - Audio.gcom2.neme=neme.get() - Audio.gcom2.ndepth=ndepth.get() - Audio.gcom2.nsked=nsked.get() - try: - Audio.gcom2.idinterval=options.IDinterval.get() - except: - Audio.gcom2.idinterval=0 - Audio.gcom2.ntx2=0 -# Audio.gcom1.rxdelay=float('0'+options.RxDelay.get()) -# Audio.gcom1.txdelay=float('0'+options.TxDelay.get()) - if ntx.get()==1 and noshjt65.get()==1: Audio.gcom2.ntx2=1 - Audio.gcom2.nslim2=isync-4 - if nosh441.get()==1 and mode.get()=='FSK441': Audio.gcom2.nslim2=99 - try: - Audio.gcom2.nport=int(options.PttPort.get()) - except: - Audio.gcom2.nport=0 - -# print 'About to init Audio.gcom2.PttPort in save some parameters' - Audio.gcom2.pttport=(options.PttPort.get() + ' ')[:12] -# print Audio.gcom2.pttport - -# Queue up the next update - ldate.after(100,update) - -#------------------------------------------------------ Top level frame -frame = Frame(root) - -#------------------------------------------------------ Menu Bar -mbar = Frame(frame) -mbar.pack(fill = X) - -#------------------------------------------------------ File Menu -filebutton = Menubutton(mbar, text = 'File') -filebutton.pack(side = LEFT) -filemenu = Menu(filebutton, tearoff=0) -filebutton['menu'] = filemenu -filemenu.add('command', label = 'Open', command = openfile) -filemenu.add('command', label = 'Open next in directory', command = opennext) -filemenu.add('command', label = 'Decode remaining files in directory', \ - command = decodeall) -filemenu.add_separator() -filemenu.add('command', label = 'Delete all *.WAV files in RxWAV', \ - command = delwav) -filemenu.add_separator() -filemenu.add('command', label = 'Erase ALL.TXT', command = del_all) -filemenu.add_separator() -filemenu.add('command', label = 'Exit', command = quit) - -#------------------------------------------------------ Setup menu -setupbutton = Menubutton(mbar, text = 'Setup', ) -setupbutton.pack(side = LEFT) -setupmenu = Menu(setupbutton, tearoff=0) -setupbutton['menu'] = setupmenu -setupmenu.add('command', label = 'Options', command = options1) -setupmenu.add_separator() -setupmenu.add('command', label = 'Toggle size of text window', command=textsize) -setupmenu.add('command', label = 'Generate messages for test tones', command=testmsgs) -setupmenu.add_separator() -setupmenu.add_checkbutton(label = 'F4 sets Tx6',variable=kb8rq) -setupmenu.add_checkbutton(label = 'Double-click on callsign sets TxFirst', - variable=setseq) -setupmenu.add_checkbutton(label = 'GenStdMsgs sets Tx1',variable=k2txb) -setupmenu.add_separator() -setupmenu.add_checkbutton(label = 'Enable diagnostics',variable=ndebug) - -#------------------------------------------------------ View menu -viewbutton=Menubutton(mbar,text='View',) -viewbutton.pack(side=LEFT) -viewmenu=Menu(viewbutton,tearoff=0) -viewbutton['menu']=viewmenu -viewmenu.add('command', label = 'SpecJT', command = showspecjt) -viewmenu.add('command', label = 'Astronomical data', command = astro1) - -#------------------------------------------------------ Mode menu -modebutton = Menubutton(mbar, text = 'Mode', ) -modebutton.pack(side = LEFT) -modemenu = Menu(modebutton, tearoff=0) -modebutton['menu'] = modemenu -modemenu.add_radiobutton(label = 'FSK441', variable=mode, command = ModeFSK441, - state=NORMAL) - -# To enable menu item 0: -# modemenu.entryconfig(0,state=NORMAL) -# Can use the following to retrieve the state: -# state=modemenu.entrycget(0,"state") - -modemenu.add_radiobutton(label = 'JT6M', variable=mode, command = ModeJT6M) -modemenu.add_radiobutton(label = 'JT65A', variable=mode, command = ModeJT65A) -modemenu.add_radiobutton(label = 'JT65B', variable=mode, command = ModeJT65B) -modemenu.add_radiobutton(label = 'JT65C', variable=mode, command = ModeJT65C) -modemenu.add_radiobutton(label = 'CW', variable=mode, command = ModeCW) -#modemenu.add_radiobutton(label = 'Echo', variable=mode, command = ModeEcho, -# state=DISABLED) - -#------------------------------------------------------ Decode menu -decodebutton = Menubutton(mbar, text = 'Decode', ) -decodebutton.pack(side = LEFT) -decodemenu = Menu(decodebutton, tearoff=1) -decodebutton['menu'] = decodemenu -decodemenu.FSK441=Menu(decodemenu,tearoff=0) -decodemenu.FSK441.add_checkbutton(label='No shorthands',variable=nosh441) -decodemenu.JT65=Menu(decodemenu,tearoff=0) -decodemenu.JT65.add_checkbutton(label='Only EME calls',variable=neme) -decodemenu.JT65.add_checkbutton(label='No Shorthands if Tx 1',variable=noshjt65) -decodemenu.JT65.add_separator() -decodemenu.JT65.add_radiobutton(label = 'No Deep Search', - variable=ndepth, value=0) -decodemenu.JT65.add_radiobutton(label = 'Normal Deep Search', - variable=ndepth, value=1) -decodemenu.JT65.add_radiobutton(label = 'Aggressive Deep Search', - variable=ndepth, value=2) -decodemenu.JT65.add_radiobutton(label ='Include Average in Aggressive Deep Search', - variable=ndepth, value=3) -decodemenu.add_cascade(label = 'FSK441',menu=decodemenu.FSK441) -decodemenu.add_cascade(label = 'JT65',menu=decodemenu.JT65) - -#------------------------------------------------------ Save menu -savebutton = Menubutton(mbar, text = 'Save') -savebutton.pack(side = LEFT) -savemenu = Menu(savebutton, tearoff=1) -savebutton['menu'] = savemenu -nsave=IntVar() -savemenu.add_radiobutton(label = 'None', variable=nsave,value=0) -savemenu.add_radiobutton(label = 'Save decoded', variable=nsave,value=1) -savemenu.add_radiobutton(label = 'Save if Auto On', variable=nsave,value=2) -savemenu.add_radiobutton(label = 'Save all', variable=nsave,value=3) -nsave.set(0) - -#------------------------------------------------------ Band menu -bandbutton = Menubutton(mbar, text = 'Band') -bandbutton.pack(side = LEFT) -bandmenu = Menu(bandbutton, tearoff=1) -bandbutton['menu'] = bandmenu -nfreq=IntVar() -bandmenu.add_radiobutton(label = '50', variable=nfreq,value=50) -bandmenu.add_radiobutton(label = '144', variable=nfreq,value=144) -bandmenu.add_radiobutton(label = '222', variable=nfreq,value=222) -bandmenu.add_radiobutton(label = '432', variable=nfreq,value=432) -bandmenu.add_radiobutton(label = '1296', variable=nfreq,value=1296) -nfreq.set(144) -#------------------------------------------------------ Help menu -helpbutton = Menubutton(mbar, text = 'Help') -helpbutton.pack(side = LEFT) -helpmenu = Menu(helpbutton, tearoff=0) -helpbutton['menu'] = helpmenu -helpmenu.add('command', label = 'Keyboard shortcuts', command = shortcuts) -helpmenu.add('command', label = 'Special mouse commands', command = mouse_commands) -helpmenu.add('command', label = 'What message to send?', command = what2send) -helpmenu.add('command', label = 'Available suffixes and add-on prefixes', \ - command = prefixes) -helpmenu.add('command', label = 'About WSJT', command = about) - -#------------------------------------------------------ Graphics areas -iframe1 = Frame(frame, bd=1, relief=SUNKEN) -graph1=Canvas(iframe1, bg='black', width=500, height=120,cursor='crosshair') -Widget.bind(graph1,"",dtdf_change) -Widget.bind(graph1,"",mouse_click_g1) -Widget.bind(graph1,"",double_click_g1) -Widget.bind(graph1,"",mouse_up_g1) -Widget.bind(graph1,"",mouse_click_g1) -graph1.pack(side=LEFT) -graph2=Canvas(iframe1, bg='black', width=150, height=120,cursor='crosshair') -graph2.pack(side=LEFT) -iframe1.pack(expand=1, fill=X, padx=4) - -#------------------------------------------------------ Labels under graphics -iframe2a = Frame(frame, bd=1, relief=FLAT, height=15) -lab1=Label(iframe2a, text='Time (s)') -lab1.place(x=250, y=6, anchor=CENTER) -lab3=Label(iframe2a, text=' ') -lab3.place(x=400,y=6, anchor=CENTER) -lab4=Label(iframe2a, text='1 2 3') -lab4.place(x=593,y=6, anchor=CENTER) -iframe2a.pack(expand=1, fill=X, padx=1) -iframe2 = Frame(frame, bd=1, relief=FLAT,height=15) -lab2=Label(iframe2, text='FileID Sync dB DT DF W') -lab2.place(x=3,y=6, anchor='w') -lab5=Label(iframe2, text='Freq (kHz)') -lab5.place(x=580,y=6, anchor=CENTER) -lab6=Label(iframe2a,text='0.0',bg='green') -lab6.place(x=40,y=6, anchor=CENTER) -lab7=Label(iframe2a,text='F3',fg='gray85') -lab7.place(x=495,y=6, anchor=CENTER) -lab8=Label(iframe2a,text='1.0000 1.0000',fg='gray85') -lab8.place(x=135,y=6, anchor=CENTER) -iframe2.pack(expand=1, fill=X, padx=4) - -#-------------------------------------------------------- Decoded text -iframe4 = Frame(frame, bd=1, relief=SUNKEN) -text=Text(iframe4, height=6, width=80) -text.bind('',dbl_click_text) -text.bind('',dbl_click_text) - -root.bind_all('', shortcuts) -root.bind_all('', mouse_commands) -root.bind_all('', about) -root.bind_all('', options1) -root.bind_all('', txmute) -root.bind_all('', clrToRadio) -root.bind_all('', what2send) -root.bind_all('', opennext) -root.bind_all('', decodeall) -root.bind_all('', ModeFSK441) -root.bind_all('', ModeJT65A) -root.bind_all('', ModeJT65B) -root.bind_all('', ModeJT65C) -root.bind_all('', ModeJT6M) -root.bind_all('', ModeCW) -#root.bind_all('', ModeEcho) -root.bind_all('', showspecjt) - -root.bind_all('',btx1) -root.bind_all('',btx2) -root.bind_all('',btx3) -root.bind_all('',btx4) -root.bind_all('',btx5) -root.bind_all('',btx6) - -root.bind_all('',toggleauto) -root.bind_all('',toggleauto) -root.bind_all('',clear_avg) -root.bind_all('',clear_avg) -root.bind_all('',decode) -root.bind_all('',decode) -root.bind_all('',erase) -root.bind_all('',erase) -root.bind_all('',toggle_freeze) -root.bind_all('',toggle_freeze) -root.bind_all('',GenStdMsgs) -root.bind_all('',GenStdMsgs) -root.bind_all('',decode_include) -root.bind_all('',decode_include) -root.bind_all('',lookup) -root.bind_all('',lookup) -root.bind_all('',monitor) -root.bind_all('',monitor) -root.bind_all('',txstop) -root.bind_all('',txstop) -root.bind_all('',stub) -root.bind_all('',stub) -root.bind_all('',logqso) -root.bind_all('',logqso) -root.bind_all('',stopmon) -root.bind_all('',stopmon) -root.bind_all('',savelast) -root.bind_all('',savelast) -root.bind_all('',decode_exclude) -root.bind_all('',decode_exclude) -root.bind_all('',toggle_zap) -root.bind_all('',toggle_zap) -root.bind_all('',lookup_gen) -root.bind_all('',lookup_gen) -root.bind_all('',left_arrow) -root.bind_all('',right_arrow) - -text.pack(side=LEFT, fill=X, padx=1) -sb = Scrollbar(iframe4, orient=VERTICAL, command=text.yview) -sb.pack(side=RIGHT, fill=Y) -text.configure(yscrollcommand=sb.set) -iframe4.pack(expand=1, fill=X, padx=4) -iframe4b = Frame(frame, bd=1, relief=SUNKEN) -avetext=Text(iframe4b, height=2, width=80) -#avetext.bind('', lambda e: "break") -avetext.bind('',dbl_click_ave) -avetext.bind('',dbl_click_ave) -avetext.pack(side=LEFT, fill=X, padx=1) -iframe4b.pack(expand=1, fill=X, padx=4) - -#------------------------------------------------------- Button Bar -iframe4c = Frame(frame, bd=1, relief=SUNKEN) -blogqso=Button(iframe4c, text='Log QSO',underline=4,command=logqso, - padx=1,pady=1) -#bplay=Button(iframe4c, text='Play',underline=0,command=stub) -bstop=Button(iframe4c, text='Stop',underline=0,command=stopmon, - padx=1,pady=1) -bmonitor=Button(iframe4c, text='Monitor',underline=0,command=monitor, - padx=1,pady=1) -bsavelast=Button(iframe4c, text='Save',underline=3,command=savelast, - padx=1,pady=1) -bdecode=Button(iframe4c, text='Decode',underline=0,command=decode, - padx=1,pady=1) -berase=Button(iframe4c, text='Erase',underline=0,command=erase, - padx=1,pady=1) -bclravg=Button(iframe4c, text='Clear Avg',underline=0,command=clear_avg, - padx=1,pady=1) -binclude=Button(iframe4c, text='Include',underline=0, - command=decode_include,padx=1,pady=1) -bexclude=Button(iframe4c, text='Exclude',underline=1, - command=decode_exclude,padx=1,pady=1) -btxstop=Button(iframe4c,text='TxStop',underline=4,command=txstop, - padx=1,pady=1) - -blogqso.pack(side=LEFT,expand=1,fill=X) -#bplay.pack(side=LEFT,expand=1,fill=X) -bstop.pack(side=LEFT,expand=1,fill=X) -bmonitor.pack(side=LEFT,expand=1,fill=X) -bsavelast.pack(side=LEFT,expand=1,fill=X) -bdecode.pack(side=LEFT,expand=1,fill=X) -berase.pack(side=LEFT,expand=1,fill=X) -bclravg.pack(side=LEFT,expand=1,fill=X) -binclude.pack(side=LEFT,expand=1,fill=X) -bexclude.pack(side=LEFT,expand=1,fill=X) -btxstop.pack(side=LEFT,expand=1,fill=X) -iframe4c.pack(expand=1, fill=X, padx=4) - -#-----------------------------------------------------General control area -iframe5 = Frame(frame, bd=1, relief=FLAT,height=180) - -#------------------------------------------------------ "Other station" info -f5a=Frame(iframe5,height=170,bd=2,relief=GROOVE) -labToRadio=Label(f5a,text='To radio:', width=9, relief=FLAT) -labToRadio.grid(column=0,row=0) -ToRadio=Entry(f5a,width=9) -ToRadio.insert(0,'W8WN') -ToRadio.grid(column=1,row=0,pady=3) -bLookup=Button(f5a, text='Lookup',underline=0,command=lookup,padx=1,pady=1) -bLookup.grid(column=2,row=0,sticky='EW',padx=4) -labGrid=Label(f5a,text='Grid:', width=9, relief=FLAT) -labGrid.grid(column=0,row=1) -HisGrid=Entry(f5a,width=9) -HisGrid.grid(column=1,row=1,pady=1) -bAdd=Button(f5a, text='Add',command=addtodb,padx=1,pady=1) -bAdd.grid(column=2,row=1,sticky='EW',padx=4) -labAz=Label(f5a,text='Az 257 El 15',width=11,font=(font1,9)) -labAz.grid(column=1,row=2) -labHotAB=Label(f5a,bg='#FFCCFF',text='HotA: 247',font=(font1,9)) -labHotAB.grid(column=0,row=2,sticky='EW',padx=4,pady=3) -labDist=Label(f5a,text='16753 km',font=(font1,9)) -labDist.grid(column=2,row=2) - -#------------------------------------------------------ Date and Time -ldate=Label(f5a, bg='black', fg='yellow', width=11, bd=4, - text='2005 Apr 22\n01:23:45', relief=RIDGE, - justify=CENTER, font=(font1,16)) -ldate.grid(column=0,columnspan=3,row=3,rowspan=2,pady=2) -f5a.pack(side=LEFT,expand=1,fill=BOTH) - -#------------------------------------------------------ Receiving parameters -f5b=Frame(iframe5,bd=2,relief=GROOVE) -lsync=Label(f5b, bg='white', fg='black', text='Sync 1', width=8, relief=RIDGE) -lsync.grid(column=0,row=0,padx=2,pady=1,sticky='EW') -Widget.bind(lsync,'',incsync) -Widget.bind(lsync,'',decsync) -nzap=IntVar() -cbzap=Checkbutton(f5b,text='Zap',underline=0,variable=nzap) -cbzap.grid(column=1,row=0,padx=2,pady=1,sticky='W') -cbnb=Checkbutton(f5b,text='NB',variable=nblank) -cbnb.grid(column=1,row=1,padx=2,pady=1,sticky='W') -cbfreeze=Checkbutton(f5b,text='Freeze',underline=0,variable=nfreeze) -cbfreeze.grid(column=1,row=2,padx=2,sticky='W') -cbafc=Checkbutton(f5b,text='AFC',variable=nafc) -cbafc.grid(column=1,row=3,padx=2,pady=1,sticky='W') -lclip=Label(f5b, bg='white', fg='black', text='Clip 0', width=8, relief=RIDGE) -lclip.grid(column=0,row=1,padx=2,sticky='EW') -Widget.bind(lclip,'',incclip) -Widget.bind(lclip,'',decclip) -ltol=Label(f5b, bg='white', fg='black', text='Tol 400', width=8, relief=RIDGE) -ltol.grid(column=0,row=2,padx=2,pady=1,sticky='EW') -Widget.bind(ltol,'',inctol) -Widget.bind(ltol,'',dectol) -Button(f5b,text='Defaults',command=defaults,padx=1,pady=1).grid(column=0, - row=3,sticky='EW') -ldsec=Label(f5b, bg='white', fg='black', text='Dsec 0.0', width=8, relief=RIDGE) -ldsec.grid(column=0,row=4,ipadx=3,padx=2,pady=5,sticky='EW') -#lrdsec=Label(f5b, bg='white', fg='black', text='RDsec 0.0', width=8, relief=RIDGE) -#lrdsec.grid(column=1,row=4,ipadx=3,padx=2,pady=5,sticky='EW') -Widget.bind(ldsec,'',incdsec) -Widget.bind(ldsec,'',decdsec) -#Widget.bind(lrdsec,'',incrdsec) -#Widget.bind(lrdsec,'',decrdsec) -#Widget.bind(lrdsec,'',stub) -#Widget.bind(lrdsec,'',stub) - -f5b.pack(side=LEFT,expand=0,fill=BOTH) - -#------------------------------------------------------ Tx params and msgs -f5c=Frame(iframe5,bd=2,relief=GROOVE) -txfirst=Checkbutton(f5c,text='Tx First',justify=RIGHT,variable=TxFirst) -f5c2=Frame(f5c,bd=0) -labreport=Label(f5c2,text='Rpt',width=4) -report=Entry(f5c2, width=4) -report.insert(0,'26') -labreport.pack(side=RIGHT,expand=1,fill=BOTH) -report.pack(side=RIGHT,expand=1,fill=BOTH) -shmsg=Checkbutton(f5c,text='Sh Msg',justify=RIGHT,variable=ShOK, - command=restart2) -sked=Checkbutton(f5c,text='Sked',justify=RIGHT,variable=nsked) -genmsg=Button(f5c,text='GenStdMsgs',underline=0,command=GenStdMsgs, - padx=1,pady=1) -auto=Button(f5c,text='Auto is Off',underline=0,command=toggleauto, - padx=1,pady=1) -auto.focus_set() - -txfirst.grid(column=0,row=0,sticky='W',padx=4) -f5c2.grid(column=0,row=1,sticky='W',padx=4) -shmsg.grid(column=0,row=2,sticky='W',padx=4) -sked.grid(column=0,row=3,sticky='W',padx=4) -genmsg.grid(column=0,row=4,sticky='W',padx=4) -auto.grid(column=0,row=5,sticky='EW',padx=4) -#txstop.grid(column=0,row=6,sticky='EW',padx=4) - -ntx=IntVar() -tx1=Entry(f5c,width=24) -rb1=Radiobutton(f5c,value=1,variable=ntx) -b1=Button(f5c, text='Tx1',underline=2,command=btx1,padx=1,pady=1) -tx1.grid(column=1,row=0) -rb1.grid(column=2,row=0) -b1.grid(column=3,row=0) - -tx2=Entry(f5c,width=24) -rb2=Radiobutton(f5c,value=2,variable=ntx) -b2=Button(f5c, text='Tx2',underline=2,command=btx2,padx=1,pady=1) -tx2.grid(column=1,row=1) -rb2.grid(column=2,row=1) -b2.grid(column=3,row=1) - -tx3=Entry(f5c,width=24) -rb3=Radiobutton(f5c,value=3,variable=ntx) -b3=Button(f5c, text='Tx3',underline=2,command=btx3,padx=1,pady=1) -tx3.grid(column=1,row=2) -rb3.grid(column=2,row=2) -b3.grid(column=3,row=2) - -tx4=Entry(f5c,width=24) -rb4=Radiobutton(f5c,value=4,variable=ntx) -b4=Button(f5c, text='Tx4',underline=2,command=btx4,padx=1,pady=1) -tx4.grid(column=1,row=3) -rb4.grid(column=2,row=3) -b4.grid(column=3,row=3) - -tx5=Entry(f5c,width=24) -rb5=Radiobutton(f5c,value=5,variable=ntx) -b5=Button(f5c, text='Tx5',underline=2,command=btx5,padx=1,pady=1) -tx5.grid(column=1,row=4) -rb5.grid(column=2,row=4) -b5.grid(column=3,row=4) - -tx6=Entry(f5c,width=24) -rb6=Radiobutton(f5c,value=6,variable=ntx) -b6=Button(f5c, text='Tx6',underline=2,command=btx6,padx=1,pady=1) -tx6.grid(column=1,row=5) -rb6.grid(column=2,row=5) -b6.grid(column=3,row=5) - -f5c.pack(side=LEFT,fill=BOTH) -iframe5.pack(expand=1, fill=X, padx=4) - -#------------------------------------------------------------ Status Bar -iframe6 = Frame(frame, bd=1, relief=SUNKEN) -msg1=Message(iframe6, text=' ', width=300,relief=SUNKEN) -msg1.pack(side=LEFT, fill=X, padx=1) -msg2=Message(iframe6, text='Message #2', width=300,relief=SUNKEN) -msg2.pack(side=LEFT, fill=X, padx=1) -msg3=Message(iframe6,width=300,relief=SUNKEN) -msg3.pack(side=LEFT, fill=X, padx=1) -msg4=Message(iframe6, text='Message #4', width=300,relief=SUNKEN) -msg4.pack(side=LEFT, fill=X, padx=1) -msg5=Message(iframe6, text='Message #5', width=300,relief=SUNKEN) -msg5.pack(side=LEFT, fill=X, padx=1) -Widget.bind(msg5,'',inctrperiod) -Widget.bind(msg5,'',dectrperiod) -msg7=Message(iframe6, text=' ', width=300,relief=SUNKEN) -msg7.pack(side=RIGHT, fill=X, padx=1) -iframe6.pack(expand=1, fill=X, padx=4) -frame.pack() - -ldate.after(100,update) -lauto=0 -isync=1 -ntx.set(1) -ndepth.set(1) - -import options -options.defaults() -ModeFSK441() -lookup() -balloon.unbind(ToRadio) -g.astro_geom0="+0+0" -Audio.gcom1.mute=0 - -#---------------------------------------------------------- Process INI file -try: - f=open(appdir+'/WSJT.INI',mode='r') - params=f.readlines() -except: - params="" - -try: - for i in range(len(params)): - key,value=params[i].split() - if key == 'WSJTGeometry': root.geometry(value) - elif key == 'Mode': - mode.set(value) - if value=='FSK441': - ModeFSK441() - elif value=='JT65A': - ModeJT65A() - elif value=='JT65B': - ModeJT65B() - elif value=='JT65C': - ModeJT65C() - elif value=='JT6M': - ModeJT6M() - elif value=='CW': - ModeCW() - elif key == 'MyCall': options.MyCall.set(value) - elif key == 'MyGrid': options.MyGrid.set(value) - elif key == 'HisCall': - hiscall=value - if hiscall=="______": hiscall="" - ToRadio.delete(0,END) - ToRadio.insert(0,hiscall) - elif key == 'HisGrid': - hisgrid=value - if hisgrid == "XX00xx": - lookup() - HisGrid.delete(0,END) - HisGrid.insert(0,hisgrid) -# elif key == 'RxDelay': options.RxDelay.set(value) -# elif key == 'TxDelay': options.TxDelay.set(value) - elif key == 'IDinterval': options.IDinterval.set(value) - elif key == 'PttPort': - try: - options.PttPort.set(value) - try: - Audio.gcom2.nport=int(options.PttPort.get()) - except: - Audio.gcom2.nport=0 - except: - options.PttPort.set("/dev/cuad0") - Audio.gcom2.nport=0 - Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] - elif key == 'Mileskm': options.mileskm.set(value) - elif key == 'MsgStyle': options.ireport.set(value) - elif key == 'Region': options.iregion.set(value) - elif key == 'AudioIn': - try: - g.ndevin.set(value) - except: - g.ndevin.set(0) - g.DevinName.set(value) - options.DevinName.set(value) - Audio.gcom1.devin_name=(options.DevinName.get()+' ')[:12] - elif key == 'AudioOut': - try: - g.ndevout.set(value) - except: - g.ndevout.set(0) - g.DevoutName.set(value) - options.DevoutName.set(value) - Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12] - elif key == 'SamFacIn': options.samfacin.set(value) - elif key == 'SamFacOut': options.samfacout.set(value) - elif key == 'Template1': options.Template1.set(value.replace("_"," ")) - elif key == 'Template2': options.Template2.set(value.replace("_"," ")) - elif key == 'Template3': options.Template3.set(value.replace("_"," ")) - elif key == 'Template4': options.Template4.set(value.replace("_"," ")) - elif key == 'Template5': options.Template5.set(value.replace("_"," ")) - elif key == 'Template6': - options.Template6.set(value.replace("_"," ")) - if options.Template6.get()==" ": options.Template6.set("") - elif key == 'AddPrefix': options.addpfx.set(value.replace("_"," ").lstrip()) - elif key == 'AuxRA': options.auxra.set(value) - elif key == 'AuxDEC': options.auxdec.set(value) - elif key == 'TxFirst': TxFirst.set(value) - elif key == 'KB8RQ': kb8rq.set(value) - elif key == 'K2TXB': k2txb.set(value) - elif key == 'SetSeq': setseq.set(value) - elif key == 'Report': - report.delete(0,99) - report.insert(0,value) - elif key == 'ShOK': ShOK.set(value) - elif key == 'Nsave': nsave.set(value) - elif key == 'Band': nfreq.set(value) - elif key == 'S441': isync441=int(value) - elif key == 'S6m': isync6m=int(value) - elif key == 'Sync': isync65=int(value) - elif key == 'Clip': iclip=int(value) - elif key == 'Zap': nzap.set(value) - elif key == 'NB': nblank.set(value) - elif key == 'NAFC': nafc.set(value) - elif key == 'Sked': nsked.set(value) - elif key == 'NoSh441': nosh441.set(value) - elif key == 'NoShJT65': noshjt65.set(value) - elif key == 'NEME': neme.set(value) - elif key == 'NDepth': ndepth.set(value) - elif key == 'Debug': ndebug.set(value) - elif key == 'HisCall': - Audio.gcom2.hiscall=(value+' ')[:12] - ToRadio.delete(0,99) - ToRadio.insert(0,value) - lookup() #Maybe should save HisGrid, instead? - elif key == 'MRUDir': mrudir=value.replace("#"," ") - elif key == 'AstroGeometry': g.astro_geom0 =value - elif key == 'CWTRPeriod': - ncwtrperiod=int(value) - if mode.get()[:2]=="CW": Audio.gcom1.trperiod=ncwtrperiod - else: pass -except: - print 'Error reading WSJT.INI, continuing with defaults.' - print key,value - -g.mode=mode.get() -if mode.get()=='FSK441': isync=isync441 -elif mode.get()=='JT6M': isync=isync6m -elif mode.get()[:4]=='JT65': isync=isync65 -lsync.configure(text=slabel+str(isync)) -lclip.configure(text='Clip '+str(iclip)) -Audio.gcom2.appdir=(appdir+' ')[:80] -Audio.gcom2.ndepth=ndepth.get() -Audio.ftn_init() -GenStdMsgs() -Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] -stopmon() -first=1 -if g.Win32: root.iconbitmap("wsjt.ico") -root.title(' WSJT 6 by K1JT') -import astro -import specjt - -# SpecJT has a "mainloop", so does not return until it is terminated. -#root.mainloop() #Superseded by mainloop in SpecJT - -# Clean up and save user options before terminating -f=open(appdir+'/WSJT.INI',mode='a') -root_geom=root_geom[root_geom.index("+"):] -f.write("WSJTGeometry " + root_geom + "\n") -f.write("Mode " + g.mode + "\n") -f.write("MyCall " + options.MyCall.get() + "\n") -f.write("MyGrid " + options.MyGrid.get() + "\n") -t=g.ftnstr(Audio.gcom2.hiscall) -if t[:1]==" ": t="______" -f.write("HisCall " + t + "\n") -t=g.ftnstr(Audio.gcom2.hisgrid) -if t==" ": t="XX00xx" -f.write("HisGrid " + t + "\n") -#f.write("RxDelay " + str(options.RxDelay.get()) + "\n") -#f.write("TxDelay " + str(options.TxDelay.get()) + "\n") -f.write("IDinterval " + str(options.IDinterval.get()) + "\n") -f.write("PttPort " + str(options.PttPort.get()) + "\n") -f.write("Mileskm " + str(options.mileskm.get()) + "\n") -f.write("MsgStyle " + str(options.ireport.get()) + "\n") -f.write("Region " + str(options.iregion.get()) + "\n") -f.write("AudioIn " + options.DevinName.get() + "\n") -f.write("AudioOut " + options.DevoutName.get() + "\n") -f.write("SamFacIn " + str(options.samfacin.get()) + "\n") -f.write("SamFacOut " + str(options.samfacout.get()) + "\n") -if options.Template6.get()=="": options.Template6.set("_") -f.write("Template1 " + options.Template1.get().replace(" ","_") + "\n") -f.write("Template2 " + options.Template2.get().replace(" ","_") + "\n") -f.write("Template3 " + options.Template3.get().replace(" ","_") + "\n") -f.write("Template4 " + options.Template4.get().replace(" ","_") + "\n") -f.write("Template5 " + options.Template5.get().replace(" ","_") + "\n") -f.write("Template6 " + options.Template6.get().replace(" ","_") + "\n") -if options.addpfx.get().lstrip()=="": options.addpfx.set("_") -f.write("AddPrefix " + options.addpfx.get().lstrip() + "\n") -if options.auxra.get()=="": options.auxra.set("0") -if options.auxdec.get()=="": options.auxdec.set("0") -f.write("AuxRA " + options.auxra.get() + "\n") -f.write("AuxDEC " + options.auxdec.get() + "\n") -f.write("TxFirst " + str(TxFirst.get()) + "\n") -f.write("KB8RQ " + str(kb8rq.get()) + "\n") -f.write("K2TXB " + str(k2txb.get()) + "\n") -f.write("SetSeq " + str(setseq.get()) + "\n") -f.write("Report " + g.report + "\n") -f.write("ShOK " + str(ShOK.get()) + "\n") -f.write("Nsave " + str(nsave.get()) + "\n") -f.write("Band " + str(nfreq.get()) + "\n") -f.write("S441 " + str(isync441) + "\n") -f.write("S6m " + str(isync6m) + "\n") -f.write("Sync " + str(isync65) + "\n") -f.write("Clip " + str(iclip) + "\n") -f.write("Zap " + str(nzap.get()) + "\n") -f.write("NB " + str(nblank.get()) + "\n") -f.write("NAFC " + str(nafc.get()) + "\n") -f.write("Sked " + str(nsked.get()) + "\n") -f.write("NoSh441 " + str(nosh441.get()) + "\n") -f.write("NoShJT65 " + str(noshjt65.get()) + "\n") -f.write("NEME " + str(neme.get()) + "\n") -f.write("NDepth " + str(ndepth.get()) + "\n") -f.write("Debug " + str(ndebug.get()) + "\n") -#f.write("TRPeriod " + str(Audio.gcom1.trperiod) + "\n") -mrudir2=mrudir.replace(" ","#") -f.write("MRUDir " + mrudir2 + "\n") -if g.astro_geom[:7]=="200x200": g.astro_geom="268x423" + g.astro_geom[7:] -f.write("AstroGeometry " + g.astro_geom + "\n") -f.write("CWTRPeriod " + str(ncwtrperiod) + "\n") -f.close() - -Audio.ftn_quit() -Audio.gcom1.ngo=0 #Terminate audio streams -Audio.gcom2.lauto=0 -Audio.gcom1.txok=0 -time.sleep(0.5) +#------------------------------------------------------------------- WSJT + +from Tkinter import * +from tkFileDialog import * +import Pmw +from tkMessageBox import showwarning +import g,os,time +import Audio +from math import log10 +from Numeric import zeros +import dircache +import Image,ImageTk #, ImageDraw +from palettes import colormapblue, colormapgray0, colormapHot, \ + colormapAFMHot, colormapgray1, colormapLinrad, Colormap2Palette +from types import * +import array + +root = Tk() +Version="5.9.5 r" + "$Rev$"[6:-1] +print "******************************************************************" +print "WSJT Version " + Version + ", by K1JT" +print "Revision date: " + \ + "$Date$"[7:-1] +print "Run date: " + time.asctime(time.gmtime()) + " UTC" + +#See if we are running in Windows +g.Win32=0 +if sys.platform=="win32": + g.Win32=1 + try: + root.option_readfile('wsjtrc.win') + except: + pass +else: + try: + root.option_readfile('wsjtrc') + except: + pass +root_geom="" + + +#------------------------------------------------------ Global variables +appdir=os.getcwd() +isync=0 +isync441=2 +isync6m=-10 +isync65=1 +isync_save=0 +iclip=0 +itol=5 +ntol=(10,25,50,100,200,400) #List of available tolerances +idsec=0 +#irdsec=0 +lauto=0 +cmap0="Linrad" +fileopened="" +font1='Helvetica' +hiscall="" +hisgrid="" +isec0=-99 +k2txb=IntVar() +kb8rq=IntVar() +loopall=0 +mode=StringVar() +mode.set("") +mrudir=os.getcwd() +nafc=IntVar() +naz=0 +ndepth=IntVar() +nel=0 +nblank=IntVar() +ncall=0 +ncwtrperiod=120 +ndmiles=0 +ndkm=0 +ndebug=IntVar() +neme=IntVar() +nfreeze=IntVar() +nhotaz=0 +nhotabetter=0 +nopen=0 +nosh441=IntVar() +noshjt65=IntVar() +nsked=IntVar() +setseq=IntVar() +ShOK=IntVar() +slabel="Sync " +textheight=7 +txsnrdb=99. +TxFirst=IntVar() +green=zeros(500,'f') +im=Image.new('P',(500,120)) +im.putpalette(Colormap2Palette(colormapLinrad),"RGB") +pim=ImageTk.PhotoImage(im) +balloon=Pmw.Balloon(root) + +g.freeze_decode=0 +g.mode="" +g.ndevin=IntVar() +g.ndevout=IntVar() +g.DevinName=StringVar() +g.DevoutName=StringVar() +g.focus=0 +#------------------------------------------------------ showspecjt +def showspecjt(event=NONE): + if g.showspecjt>0: + if g.focus>=1: + root.focus_set() + g.focus=0 + else: + g.focus=2 + else: + g.showspecjt=1 + g.focus=2 + +#------------------------------------------------------ restart +def restart(): + Audio.gcom2.nrestart=1 + Audio.gcom2.mantx=1 + +#------------------------------------------------------ restart2 +def restart2(): + Audio.gcom2.shok=ShOK.get() + Audio.gcom2.nrestart=1 + +#------------------------------------------------------ toggle_freeze +def toggle_freeze(event=NONE): + nfreeze.set(1-nfreeze.get()) + +#------------------------------------------------------ toggle_zap +def toggle_zap(event=NONE): + nzap.set(1-nzap.get()) + +#------------------------------------------------------ btx (1-6) +def btx1(event=NONE): + ntx.set(1) + Audio.gcom2.txmsg=(tx1.get()+' ')[:28] + Audio.gcom2.ntxreq=1 + restart() +def btx2(event=NONE): + ntx.set(2) + Audio.gcom2.txmsg=(tx2.get()+' ')[:28] + Audio.gcom2.ntxreq=2 + restart() +def btx3(event=NONE): + ntx.set(3) + Audio.gcom2.txmsg=(tx3.get()+' ')[:28] + Audio.gcom2.ntxreq=3 + restart() +def btx4(event=NONE): + ntx.set(4) + Audio.gcom2.txmsg=(tx4.get()+' ')[:28] + Audio.gcom2.ntxreq=4 + restart() +def btx5(event=NONE): + ntx.set(5) + Audio.gcom2.txmsg=(tx5.get()+' ')[:28] + Audio.gcom2.ntxreq=5 + restart() +def btx6(event=NONE): + ntx.set(6) + Audio.gcom2.txmsg=(tx6.get()+' ')[:28] + Audio.gcom2.ntxreq=6 + restart() + +#------------------------------------------------------ quit +def quit(): + root.destroy() + +#------------------------------------------------------ testmsgs +def testmsgs(): + for m in (tx1, tx2, tx3, tx4, tx5, tx6): + m.delete(0,99) + tx1.insert(0,"@A") + tx2.insert(0,"@B") + tx3.insert(0,"@C") + tx4.insert(0,"@D") + tx5.insert(0,"@1000") + tx6.insert(0,"@2000") + + +#------------------------------------------------------ textsize +def textsize(): + global textheight + if textheight <= 9: + textheight=21 + else: + if mode.get()[:4]=='JT65': + textheight=7 + else: + textheight=9 + text.configure(height=textheight) + +#------------------------------------------------------ logqso +def logqso(event=NONE): + t=time.strftime("%Y-%b-%d,%H:%M",time.gmtime()) + t=t+","+hiscall+","+hisgrid+","+str(g.nfreq)+","+g.mode+"\n" + t2="Please confirm making the following entry in WSJT.LOG:\n\n" + t + msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t2) + msg.geometry(msgpos()) + if g.Win32: msg.iconbitmap("wsjt.ico") + msg.focus_set() + result=msg.activate() + if result == 'Yes': + f=open(appdir+'/WSJT.LOG','a') + f.write(t) + f.close() + +#------------------------------------------------------ monitor +def monitor(event=NONE): + bmonitor.configure(bg='green') + Audio.gcom2.monitoring=1 + +#------------------------------------------------------ stopmon +def stopmon(event=NONE): + global loopall + loopall=0 + bmonitor.configure(bg='gray85') + Audio.gcom2.monitoring=0 + +#------------------------------------------------------ dbl_click_text +def dbl_click_text(event): + t=text.get('1.0',END) #Entire contents of text box + t1=text.get('1.0',CURRENT) #Contents from start to mouse pointer + dbl_click_call(t,t1,event) +#------------------------------------------------------ dbl_click_ave +def dbl_click_ave(event): + t=avetext.get('1.0',END) #Entire contents of text box + t1=avetext.get('1.0',CURRENT) #Contents from start to mouse pointer + dbl_click_call(t,t1,event) +#------------------------------------------------------ dbl_click_call +def dbl_click_call(t,t1,event): + global hiscall + i=len(t1) #Length to mouse pointer + i1=t1.rfind(' ')+1 #index of preceding space + i2=i1+t[i1:].find(' ') #index of next space + hiscall=t[i1:i2] #selected word, assumed as callsign + ToRadio.delete(0,END) + ToRadio.insert(0,hiscall) + i3=t1.rfind('\n')+1 #start of selected line + if i>6 and i2>i1: + try: + nsec=60*int(t1[i3+2:i3+4]) + int(t1[i3+4:i3+6]) + except: + nsec=0 + if setseq.get(): TxFirst.set((nsec/Audio.gcom1.trperiod)%2) + lookup() + GenStdMsgs() + i3=t[:i1].strip().rfind(' ')+1 + if t[i3:i1].strip() == 'CQ': + ntx.set(1) + else: + ntx.set(2) + if event.num==3 and not lauto: toggleauto() + +#------------------------------------------------------ decode +def decode(event=NONE): + if Audio.gcom2.ndecoding==0: #If already busy, ignore request + Audio.gcom2.nagain=1 + Audio.gcom2.npingtime=0 #Decode whole record + n=1 + Audio.gcom2.mousebutton=0 + if Audio.gcom2.ndecoding0==4: n=4 + Audio.gcom2.ndecoding=n #Standard decode, full file (d2a) + +#------------------------------------------------------ decode_include +def decode_include(event=NONE): + global isync,isync_save + isync_save=isync + isync=-99 + Audio.gcom2.minsigdb=-99 + decode() + +#------------------------------------------------------ decode_exclude +def decode_exclude(event=NONE): + global isync,isync_save + isync_save=isync + isync=99 + Audio.gcom2.minsigdb=99 + decode() + +#------------------------------------------------------ openfile +def openfile(event=NONE): + global mrudir,fileopened,nopen + nopen=1 #Work-around for "click feedthrough" bug + try: + os.chdir(mrudir) + except: + pass + fname=askopenfilename(filetypes=[("Wave files","*.wav *.WAV")]) + if fname: + Audio.getfile(fname,len(fname)) + if Audio.gcom2.ierr: print 'Error ',Audio.gcom2.ierr, \ + 'when trying to read file',fname + mrudir=os.path.dirname(fname) + fileopened=os.path.basename(fname) + os.chdir(appdir) + +#------------------------------------------------------ opennext +def opennext(event=NONE): + global ncall,fileopened,loopall,mrudir + if fileopened=="" and ncall==0: + openfile() + ncall=1 + else: +# Make a list of *.wav files in mrudir + la=os.listdir(mrudir) + la.sort() + lb=[] + for i in range(len(la)): + j=la[i].find(".wav") + la[i].find(".WAV") + if j>0: lb.append(la[i]) + for i in range(len(lb)): + if lb[i]==fileopened: + break + if ihc1 and hchc1 and modified==0: + stmp.append(NewEntry+"\n") + try: + f=open(appdir+'/CALL3.TMP','w') + f.writelines(stmp) + f.close() + except: + print 'Error in opening or writing to CALL3.TMP' + + if modified: + if os.path.exists("CALL3.OLD"): os.remove("CALL3.OLD") + os.rename("CALL3.TXT","CALL3.OLD") + os.rename("CALL3.TMP","CALL3.TXT") + +#-------------------------------------------------------- clrToRadio +def clrToRadio(event): + ToRadio.delete(0,END) + HisGrid.delete(0,99) + ToRadio.focus_set() + if kb8rq.get(): ntx.set(6) + + +#------------------------------------------------------ whois +def whois(hiscall): + whodat="" + try: + f=open(appdir+'/CALL3.TXT','r') + s=f.readlines() + f.close() + except: + print 'Error when searching CALL3.TXT, or no such file present' + s="" + for i in range(len(s)): + if s[i][:2] != '//': + i1=s[i].find(',') + if s[i][:i1] == hiscall: + return s[i] + return "" + +#------------------------------------------------------ cleartext +def cleartext(): + f=open(appdir+'/decoded.txt',mode='w') + f.truncate(0) #Delete contents of decoded.txt + f.close() + f=open(appdir+'/decoded.ave',mode='w') + f.truncate(0) #Delete contents of decoded.ave + f.close() + +#------------------------------------------------------ ModeFSK441 +def ModeFSK441(event=NONE): + global slabel,isync,isync441,textheight,itol + if g.mode != "FSK441": + if lauto: toggleauto() + mode.set("FSK441") + cleartext() + Audio.gcom1.trperiod=30 + lab2.configure(text='FileID T Width dB Rpt DF') + lab1.configure(text='Time (s)',bg="green") + lab4.configure(fg='black') + lab5.configure(fg='black') + lab6.configure(bg="green") + isync=isync441 + slabel="S " + lsync.configure(text=slabel+str(isync)) + iframe4b.pack_forget() + textheight=9 + text.configure(height=textheight) + bclravg.configure(state=DISABLED) + binclude.configure(state=DISABLED) + bexclude.configure(state=DISABLED) + cbfreeze.configure(state=DISABLED) + cbafc.configure(state=DISABLED) + sked.configure(state=DISABLED) + report.configure(state=NORMAL) + shmsg.configure(state=NORMAL) + graph2.configure(bg='black') + itol=5 + inctol() + ntx.set(1) + GenStdMsgs() + erase() + +#------------------------------------------------------ ModeJT65 +def ModeJT65(): + global slabel,isync,isync65,textheight,itol + cleartext() + lab2.configure(text='FileID Sync dB DT DF W') + lab4.configure(fg='gray85') + lab5.configure(fg='gray85') + Audio.gcom1.trperiod=60 + iframe4b.pack(after=iframe4,expand=1, fill=X, padx=4) + textheight=7 + text.configure(height=textheight) + isync=isync65 + slabel="Sync " + lsync.configure(text=slabel+str(isync)) + bclravg.configure(state=NORMAL) + binclude.configure(state=NORMAL) + bexclude.configure(state=NORMAL) + cbfreeze.configure(state=NORMAL) + cbafc.configure(state=NORMAL) + sked.configure(state=NORMAL) + report.configure(state=DISABLED) + shmsg.configure(state=DISABLED) + graph2.configure(bg='#66FFFF') + itol=5 + inctol() + ntx.set(1) + GenStdMsgs() + erase() +# graph2.pack_forget() + +#------------------------------------------------------ ModeJT65A +def ModeJT65A(event=NONE): + if g.mode != "JT65A": + if lauto: toggleauto() + mode.set("JT65A") + ModeJT65() + +#------------------------------------------------------ ModeJT65B +def ModeJT65B(event=NONE): + if g.mode != "JT65B": + if lauto: toggleauto() + mode.set("JT65B") + ModeJT65() + +#------------------------------------------------------ ModeJT65C +def ModeJT65C(event=NONE): + if g.mode != "JT65C": + if lauto: toggleauto() + mode.set("JT65C") + ModeJT65() + +#------------------------------------------------------ ModeJT6M +def ModeJT6M(event=NONE): + global slabel,isync,isync6m,itol + if g.mode != "JT6M": + if lauto: toggleauto() + cleartext() + ModeFSK441() + lab2.configure(text='FileID T Width dB DF') + mode.set("JT6M") + isync=isync6m + lsync.configure(text=slabel+str(isync)) + shmsg.configure(state=DISABLED) + cbfreeze.configure(state=NORMAL) + itol=5 + inctol() + ntx.set(1) + GenStdMsgs() + erase() + + +#------------------------------------------------------ ModeCW +def ModeCW(event=NONE): + if g.mode != "CW": + if lauto: toggleauto() + cleartext() + mode.set("CW") + Audio.gcom1.trperiod=ncwtrperiod + iframe4b.pack_forget() + text.configure(height=9) + bclravg.configure(state=DISABLED) + binclude.configure(state=DISABLED) + bexclude.configure(state=DISABLED) + cbfreeze.configure(state=DISABLED) + cbafc.configure(state=DISABLED) + sked.configure(state=DISABLED) + report.configure(state=NORMAL) + ntx.set(1) + GenStdMsgs() + erase() + +#------------------------------------------------------ ModeEcho +#def ModeEcho(event=NONE): +# mode.set("Echo") +# stub() + +#------------------------------------------------------ msgpos +def msgpos(): + g=root_geom[root_geom.index("+"):] + t=g[1:] + x=int(t[:t.index("+")]) # + 70 + y=int(t[t.index("+")+1:]) # + 70 + return "+%d+%d" % (x,y) + +#------------------------------------------------------ about +def about(event=NONE): + global Version + about=Toplevel(root) + about.geometry(msgpos()) + if g.Win32: about.iconbitmap("wsjt.ico") + t="WSJT Version " + Version + ", by K1JT" + Label(about,text=t,font=(font1,16)).pack(padx=20,pady=5) + t=""" +WSJT is a weak signal communications program. It supports +four operating modes: FSK441, a fast mode for meteor scatter; +JT6M, specially optimized for meteor and ionospheric scatter +on 50 MHz; JT65, an extremely sensitive mode for troposcatter +and EME; and CW at 15 WPM with messages structured for EME. + +WSJT is Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, +with contributions from additional authors. It is Open Source +software, licensed under the GNU General Public License (GPL). +Source code and programming information may be found at +http://developer.berlios.de/projects/wsjt/. +""" + Label(about,text=t,justify=LEFT).pack(padx=20) + t="Revision date: " + \ + "$Date$"[7:-1] + Label(about,text=t,justify=LEFT).pack(padx=20) + about.focus_set() + +#------------------------------------------------------ shortcuts +def shortcuts(event=NONE): + scwid=Toplevel(root) + scwid.geometry(msgpos()) + if g.Win32: scwid.iconbitmap("wsjt.ico") + t=""" +F1 List keyboard shortcuts +Shift-F1 List special mouse commands +CTRL-F1 About WSJT +F2 Options +F3 Tx Mute +F4 Clear "To Radio" +F5 What message to send? +F6 Open next file in directory +Shift-F6 Decode all wave files in directory +F7 Set FSK441 mode +Shift-F7 Set JT6M mode +F8 Set JT65A mode +Shift-F8 Set JT65B mode +CTRL-F8 Set JT65C mode +Shift-CTRL-F8 Set CW mode +F10 Toggle focus between WSJT screens +Alt-1 to Alt-6 Tx1 to Tx6 +Alt-A Toggle Auto On/Off +Alt-D Decode +Alt-E Erase +Alt-F Toggle Freeze +Alt-G Generate Standard Messages +Alt-I Include +Alt-L Lookup +CTRL-L Lookup, then Generate Standard Messages +Alt-M Monitor +Alt-O Tx Stop +Alt-P Play +Alt-Q Log QSO +Alt-S Stop Monitoring or Decoding +Alt-V Save Last +Alt-X Exclude +Alt-Z Toggle Zap +Right/Left Arrow Increase/decrease Freeze DF +""" + Label(scwid,text=t,justify=LEFT).pack(padx=20) + scwid.focus_set() + +#------------------------------------------------------ mouse_commands +def mouse_commands(event=NONE): + scwid=Toplevel(root) + scwid.geometry(msgpos()) + if g.Win32: scwid.iconbitmap("wsjt.ico") + t=""" +Click on Action +-------------------------------------------------------- +Waterfall FSK441/JT6M: click to decode ping + JT65: Click to set DF for Freeze + Double-click to Freeze and Decode + +Main screen, FSK441/JT6M: click to decode ping +graphics area JT65: Click to set DF for Freeze + Double-click to Freeze and Decode + +Main screen, Double-click puts callsign in Tx messages +text area Right-double-click also sets Auto ON + +Sync, Clip, Left/Right click to increase/decrease +Tol, ... +""" + Label(scwid,text=t,justify=LEFT).pack(padx=20) + scwid.focus_set() + +#------------------------------------------------------ what2send +def what2send(event=NONE): + screenf5=Toplevel(root) + screenf5.geometry(root_geom[root_geom.index("+"):]) + if g.Win32: screenf5.iconbitmap("wsjt.ico") + t=""" +To optimize your chances of completing a valid QSO using WSJT, +use the following standard procedures and *do not* exchange pertinent +information by other means (e.g., internet, telephone, ...) while the +QSO is in progress! + +FSK441 or JT6M: If you have received + ... less than both calls from the other station, send both calls. + ... both calls, send both calls and your signal report. + ... both calls and signal report, send R and your report. + ... R plus signal report, send RRR. + ... RRR, the QSO is complete. However, the other station may not +know this, so it is conventional to send 73 to signify that you are done. + +(Outside of North America, the customary procedures for FSK441 +and JT6M may be slightly different.) + + +JT65: If you have received + ... less than both calls, send both calls and your grid locator. + ... both calls, send both calls, your grid locator, and OOO. + ... both calls and OOO, send RO. + ... RO, send RRR. + ... RRR, the QSO is complete. However, the other station may not +know this, so it is conventional to send 73 to signify that you are done. + +(Sending grid locators is conventional in JT65, but numerical signal +reports may be substituted.) +""" + Label(screenf5,text=t,justify=LEFT).pack(padx=20) + screenf5.focus_set() + +#------------------------------------------------------ prefixes +def prefixes(event=NONE): + pfx=Toplevel(root) + pfx.geometry(msgpos()) + if g.Win32: pfx.iconbitmap("wsjt.ico") + f=open(appdir+'/prefixes.txt','r') + s=f.readlines() + t2="" + for i in range(4): + t2=t2+s[i] + t="" + for i in range(len(s)-4): + t=t+s[i+4] + t=t.split() + t.sort() + t1="" + n=0 + for i in range(len(t)): + t1=t1+t[i]+" " + n=n+len(t[i])+2 + if n>60: + t1=t1+"\n" + n=0 + t1=t1+"\n" + if options.addpfx.get().lstrip(): + t1=t1+"\nOptional prefix: "+(options.addpfx.get().lstrip()+' ')[:8] + t2=t2+"\n"+t1 + Label(pfx,text=t2,justify=LEFT).pack(padx=20) + pfx.focus_set() + +#------------------------------------------------------ azdist +def azdist(): + if len(HisGrid.get().strip())<4: + labAz.configure(text="") + labHotAB.configure(text="",bg='gray85') + labDist.configure(text="") + else: + if mode.get()[:4]=="JT65" or mode.get()[:2]=="CW": + labAz.configure(text="Az: %d" % (naz,)) + labHotAB.configure(text="",bg='gray85') + else: + labAz.configure(text="Az: %d El: %d" % (naz,nel)) + if nhotabetter: + labHotAB.configure(text="Hot A: "+str(nhotaz),bg='#FF9900') + else: + labHotAB.configure(text="Hot B: "+str(nhotaz),bg='#FF9900') + if options.mileskm.get()==0: + labDist.configure(text=str(ndmiles)+" mi") + else: + labDist.configure(text=str(int(1.609344*ndmiles))+" km") + +#------------------------------------------------------ incsync +def incsync(event): + global isync + if isync<10: + isync=isync+1 + lsync.configure(text=slabel+str(isync)) + +#------------------------------------------------------ decsync +def decsync(event): + global isync + if isync>-30: + isync=isync-1 + lsync.configure(text=slabel+str(isync)) + +#------------------------------------------------------ incclip +def incclip(event): + global iclip + if iclip<5: + iclip=iclip+1 + if iclip==5: iclip=99 + lclip.configure(text='Clip '+str(iclip)) + +#------------------------------------------------------ decclip +def decclip(event): + global iclip + if iclip>-5: + iclip=iclip-1 + if iclip==98: iclip=4 + lclip.configure(text='Clip '+str(iclip)) + +#------------------------------------------------------ inctol +def inctol(event=NONE): + global itol + if itol<5: itol=itol+1 + ltol.configure(text='Tol '+str(ntol[itol])) + +#------------------------------------------------------ dectol +def dectol(event): + global itol + if itol>0 : itol=itol-1 + ltol.configure(text='Tol '+str(ntol[itol])) + +#------------------------------------------------------ incdsec +def incdsec(event): + global idsec + idsec=idsec+5 + bg='red' + if idsec==0: bg='white' + ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg) + Audio.gcom1.ndsec=idsec + +#------------------------------------------------------ decdsec +def decdsec(event): + global idsec + idsec=idsec-5 + bg='red' + if idsec==0: bg='white' + ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg) + Audio.gcom1.ndsec=idsec + +###------------------------------------------------------ incrdsec +##def incrdsec(event): +## global irdsec +## irdsec=irdsec+5 +## bg='red' +## if irdsec==0: bg='white' +## lrdsec.configure(text='RDsec '+str(0.1*irdsec),bg=bg) +## +###------------------------------------------------------ decrdsec +##def decrdsec(event): +## global irdsec +## irdsec=irdsec-5 +## bg='red' +## if irdsec==0: bg='white' +## lrdsec.configure(text='RDsec '+str(0.1*irdsec),bg=bg) +## +#------------------------------------------------------ inctrperiod +def inctrperiod(event): + global ncwtrperiod + if mode.get()[:2]=="CW": + if ncwtrperiod==120: ncwtrperiod=150 + if ncwtrperiod==60: ncwtrperiod=120 + Audio.gcom1.trperiod=ncwtrperiod + +#------------------------------------------------------ dectrperiod +def dectrperiod(event): + global ncwtrperiod + if mode.get()[:2]=="CW": + if ncwtrperiod==120: ncwtrperiod=60 + if ncwtrperiod==150: ncwtrperiod=120 + Audio.gcom1.trperiod=ncwtrperiod + +#------------------------------------------------------ erase +def erase(event=NONE): + graph1.delete(ALL) + if mode.get()[:4]!="JT65" and mode.get()[:2]!="CW": graph2.delete(ALL) + text.configure(state=NORMAL) + text.delete('1.0',END) + text.configure(state=DISABLED) + avetext.configure(state=NORMAL) + avetext.delete('1.0',END) + avetext.configure(state=DISABLED) + lab3.configure(text=" ") + Audio.gcom2.decodedfile=" " +#------------------------------------------------------ clear_avg +def clear_avg(event=NONE): + avetext.configure(state=NORMAL) + avetext.delete('1.0',END) + avetext.configure(state=DISABLED) + f=open(appdir+'/decoded.ave',mode='w') + f.truncate(0) #Delete contents of decoded.ave + f.close() + Audio.gcom2.nclearave=1 + +#------------------------------------------------------ defaults +def defaults(): + global slabel,isync,iclip,itol,idsec + isync=1 + if g.mode=="FSK441": isync=2 + if g.mode=="JT6M": isync=-10 + lsync.configure(text=slabel+str(isync)) + iclip=0 + lclip.configure(text='Clip '+str(iclip)) + itol=5 + ltol.configure(text='Tol '+str(ntol[itol])) + +#------------------------------------------------------ delwav +def delwav(): + t="Are you sure you want to delete\nall *.WAV files in the RxWav directory?" + msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t) + msg.geometry(msgpos()) + if g.Win32: msg.iconbitmap("wsjt.ico") + msg.focus_set() + result=msg.activate() + if result == 'Yes': +# Make a list of *.wav files in RxWav + la=dircache.listdir(appdir+'/RxWav') + lb=[] + for i in range(len(la)): + j=la[i].find(".wav") + la[i].find(".WAV") + if j>0: lb.append(la[i]) +# Now delete them all. + for i in range(len(lb)): + fname=appdir+'/RxWav/'+lb[i] + os.remove(fname) + +#------------------------------------------------------ del_all +def del_all(): + Audio.gcom1.ns0=-999999 + +#------------------------------------------------------ toggleauto +def toggleauto(event=NONE): + global lauto + lauto=1-lauto + Audio.gcom2.lauto=lauto + if lauto: + monitor() + else: + Audio.gcom1.txok=0 + Audio.gcom2.mantx=0 + if lauto==0: auto.configure(text='Auto is OFF',bg='gray85',relief=RAISED) + if lauto==1: auto.configure(text='Auto is ON',bg='red',relief=SOLID) + +#----------------------------------------------------- dtdf_change +# Readout of graphical cursor location +def dtdf_change(event): + if mode.get()[:4]!="JT65": + t="%.1f" % (event.x*30.0/500.0,) + lab6.configure(text=t,bg='green') + else: + if event.y<40 and Audio.gcom2.nspecial==0: + lab1.configure(text='Time (s)',bg="#33FFFF") #light blue + t="%.1f" % (12.0*event.x/500.0-2.0,) + lab6.configure(text=t,bg="#33FFFF") + elif (event.y>=40 and event.y<95) or \ + (event.y<95 and Audio.gcom2.nspecial>0): + lab1.configure(text='DF (Hz)',bg='red') + t="%d" % int(1200.0*event.x/500.0-600.0,) + lab6.configure(text=t,bg="red") + else: + lab1.configure(text='Time (s)',bg='green') + t="%.1f" % (53.0*event.x/500.0,) + lab6.configure(text=t,bg="green") + +#---------------------------------------------------- mouse_click_g1 +def mouse_click_g1(event): + global nopen + if not nopen: + if mode.get()[:4]=="JT65": + Audio.gcom2.mousedf=int((event.x-250)*2.4) + else: + if Audio.gcom2.ndecoding==0: #If decoder is busy, ignore + Audio.gcom2.nagain=1 + Audio.gcom2.mousebutton=event.num #Left=1, Right=3 + Audio.gcom2.npingtime=int(195+60*event.x) #Time (ms) of mouse-picked ping + if Audio.gcom2.ndecoding0==4: + Audio.gcom2.ndecoding=4 #Decode from recorded file + elif Audio.gcom2.ndecoding0==1: + Audio.gcom2.ndecoding=5 #Decode data in main screen + nopen=0 + +#------------------------------------------------------ double-click_g1 +def double_click_g1(event): + if g.mode[:4]=='JT65' and Audio.gcom2.ndecoding==0: + g.freeze_decode=1 + +#------------------------------------------------------ mouse_up_g1 +def mouse_up_g1(event): +# print event.x + pass + +#------------------------------------------------------ right_arrow +def right_arrow(event=NONE): + n=5*int(Audio.gcom2.mousedf/5) + 5 + if n==Audio.gcom2.mousedf: n=n+5 + Audio.gcom2.mousedf=n + +#------------------------------------------------------ left_arrow +def left_arrow(event=NONE): + n=5*int(Audio.gcom2.mousedf/5) + if n==Audio.gcom2.mousedf: n=n-5 + Audio.gcom2.mousedf=n + +#------------------------------------------------------ GenStdMsgs +def GenStdMsgs(event=NONE): + t=ToRadio.get().upper().strip() + ToRadio.delete(0,99) + ToRadio.insert(0,t) + if k2txb.get()!=0: ntx.set(1) + Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] + for m in (tx1, tx2, tx3, tx4, tx5, tx6): + m.delete(0,99) + if mode.get()=="FSK441" or mode.get()=="JT6M": + r=report.get() + tx1.insert(0,setmsg(options.tx1.get(),r)) + tx2.insert(0,setmsg(options.tx2.get(),r)) + tx3.insert(0,setmsg(options.tx3.get(),r)) + tx4.insert(0,setmsg(options.tx4.get(),r)) + tx5.insert(0,setmsg(options.tx5.get(),r)) + tx6.insert(0,setmsg(options.tx6.get(),r)) + elif mode.get()[:4]=="JT65": + if ToRadio.get().find("/") == -1 and \ + options.MyCall.get().find("/") == -1: + t=ToRadio.get() + " "+options.MyCall.get() + " "+options.MyGrid.get()[:4] + tx1.insert(0,t.upper()) + else: + tx1.insert(0,ToRadio.get() + " "+options.MyCall.get()) + tx2.insert(0,tx1.get()+" OOO") + tx3.insert(0,"RO") + tx4.insert(0,"RRR") + tx5.insert(0,"73") + t="CQ " + options.MyCall.get()+ " "+options.MyGrid.get()[:4] + tx6.insert(0,t.upper()) + elif mode.get()[:2]=="CW": + tx1.insert(0,ToRadio.get() + " "+options.MyCall.get()) + tx2.insert(0,tx1.get()+" OOO") + tx3.insert(0,tx1.get()+" RO") + tx4.insert(0,tx1.get()+" RRR") + tx5.insert(0,tx1.get()+" 73") + tx6.insert(0,"CQ " + options.MyCall.get()) + +#------------------------------------------------------ setmsg +def setmsg(template,r): + msg="" + npct=0 + for i in range(len(template)): + if npct: + if template[i]=="M": msg=msg+options.MyCall.get().upper().strip() + if template[i]=="T": msg=msg+ToRadio.get().upper().strip() + if template[i]=="R": msg=msg+r + if template[i]=="G": msg=msg+options.MyGrid.get()[:4] + if template[i]=="L": msg=msg+options.MyGrid.get() + npct=0 + else: + npct=0 + if template[i]=="%": + npct=1 + else: + msg=msg+template[i] + return msg.upper() + +#------------------------------------------------------ plot_large +def plot_large(): + "Plot the green, red, and blue curves in JT65 mode." + graph1.delete(ALL) + y=[] + ngreen=Audio.gcom2.ngreen + if ngreen>0: + for i in range(ngreen): #Find ymax for green curve + green=Audio.gcom2.green[i] + y.append(green) + ymax=max(y) + if ymax<1: ymax=1 + yfac=4.0 + if ymax>75.0/yfac: yfac=75.0/ymax + xy=[] + for i in range(ngreen): #Make xy list for green curve + green=Audio.gcom2.green[i] + n=int(105.0-yfac*green) + xy.append(i) + xy.append(n) + graph1.create_line(xy,fill="green") + + if Audio.gcom2.nspecial==0: + y=[] + for i in range(446): #Find ymax for red curve + psavg=Audio.gcom2.psavg[i+1] + y.append(psavg) + ymax=max(y) + yfac=30.0 + if ymax>85.0/yfac: yfac=85.0/ymax + xy=[] + fac=500.0/446.0 + for i in range(446): #Make xy list for red curve + x=i*fac + psavg=Audio.gcom2.psavg[i+1] + n=int(90.0-yfac*psavg) + xy.append(x) + xy.append(n) + graph1.create_line(xy,fill="red") + else: + y1=[] + y2=[] + for i in range(446): #Find ymax for red curve + ss1=Audio.gcom2.ss1[i+1] + y1.append(ss1) + ss2=Audio.gcom2.ss2[i+1] + y2.append(ss2) + ymax=max(y1+y2) + yfac=30.0 + if ymax>85.0/yfac: yfac=85.0/ymax + xy1=[] + xy2=[] + fac=500.0/446.0 + for i in range(446): #Make xy list for red curve + x=i*fac + ss1=Audio.gcom2.ss1[i+1] + n=int(90.0-yfac*ss1) + xy1.append(x) + xy1.append(n) + ss2=Audio.gcom2.ss2[i+1] + n=int(90.0-yfac*ss2) - 20 + xy2.append(x) + xy2.append(n) + graph1.create_line(xy1,fill="magenta") + graph1.create_line(xy2,fill="orange") + + x1 = 250.0 + fac*Audio.gcom2.ndf/2.6916504 + x2 = x1 + Audio.gcom2.mode65*Audio.gcom2.nspecial*10*fac + graph1.create_line([x1,85,x1,95],fill="yellow") + graph1.create_line([x2,85,x2,95],fill="yellow") + t="RO" + if Audio.gcom2.nspecial==3: t="RRR" + if Audio.gcom2.nspecial==4: t="73" + graph1.create_text(x2+3,93,anchor=W,text=t,fill="yellow") + + if Audio.gcom2.ccf[0] != -9999.0: + y=[] + for i in range(65): #Find ymax for blue curve + ccf=Audio.gcom2.ccf[i] + y.append(ccf) + ymax=max(y) + yfac=40.0 + if ymax>55.0/yfac: yfac=55.0/ymax + xy2=[] + fac=500.0/64.6 + for i in range(65): #Make xy list for blue curve + x=(i+0.5)*fac + ccf=Audio.gcom2.ccf[i] + n=int(60.0-yfac*ccf) + xy2.append(x) + xy2.append(n) + graph1.create_line(xy2,fill='#33FFFF') + +# Put in the tick marks + for i in range(13): + x=int(i*41.667) + j2=115 + if i==1 or i==6 or i==11: j2=110 + graph1.create_line([x,j2,x,125],fill="red") + if Audio.gcom2.nspecial==0: +# x=int((i-0.8)*41.667) + j1=9 + if i==2 or i==7 or i==12: j1=14 + graph1.create_line([x,0,x,j1],fill="#33FFFF") #light blue + else: + graph1.create_line([x,0,x,125-j2],fill="red") + +#------------------------------------------------------ plot_small +def plot_small(): + graph2.delete(ALL) + xy=[] + xy2=[] + df=11025.0/256.0 + fac=150.0/3500.0 + for i in range(81): + x=int(i*df*fac) + xy.append(x) + psavg=Audio.gcom2.psavg[i] + if mode.get()=="JT6M": psavg=psavg + 27.959 + n=int(150.0-2*psavg) + xy.append(n) + if mode.get()=='FSK441': + ps0=Audio.gcom2.ps0[i] + n=int(150.0-2*ps0) + xy2.append(x) + xy2.append(n) + graph2.create_line(xy,fill="magenta") + if mode.get()=='JT6M': + plot_yellow() + elif mode.get()=='FSK441': + graph2.create_line(xy2,fill="red") + for i in range(4): + x=(i+2)*441*fac + graph2.create_line([x,0,x,20],fill="yellow") + for i in range(7): + x=i*500*fac + ytop=110 + if i%2: ytop=115 + graph2.create_line([x,120,x,ytop],fill="white") + +#------------------------------------------------------ plot_yellow +def plot_yellow(): + nz=int(Audio.gcom2.ps0[215]) + if nz>10: + y=[] + for i in range(nz): #Find ymax for yellow curve + n=Audio.gcom2.ps0[i] + y.append(n) + ymax=max(y) + fac=1.0 + if ymax>60: fac=60.0/ymax + xy2=[] + for i in range(nz): + x=int(2.34*i) + y=fac*Audio.gcom2.ps0[i] + 8 + n=int(85.0-y) + xy2.append(x) + xy2.append(n) + graph1.create_line(xy2,fill="yellow") + +#------------------------------------------------------ update +def update(): + global root_geom,isec0,naz,nel,ndmiles,ndkm,nhotaz,nhotabetter,nopen, \ + im,pim,cmap0,isync,isync441,isync6m,isync65,isync_save,idsec, \ + first,itol,txsnrdb + + utc=time.gmtime(time.time()+0.1*idsec) + isec=utc[5] + + if isec != isec0: #Do once per second + isec0=isec + t=time.strftime('%Y %b %d\n%H:%M:%S',utc) + Audio.gcom2.utcdate=t[:12] + ldate.configure(text=t) + root_geom=root.geometry() + utchours=utc[3]+utc[4]/60.0 + utc[5]/3600.0 + naz,nel,ndmiles,ndkm,nhotaz,nhotabetter=Audio.azdist0( \ + options.MyGrid.get().upper(),HisGrid.get().upper(),utchours) + azdist() + g.nfreq=nfreq.get() + + if Audio.gcom2.ndecoding==0: + g.AzSun,g.ElSun,g.AzMoon,g.ElMoon,g.AzMoonB,g.ElMoonB,g.ntsky, \ + g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \ + g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \ + g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \ + utchours,nfreq.get(),options.MyGrid.get().upper(), \ + options.auxra.get()+' '[:9], \ + options.auxdec.get()+' '[:9]) + + if len(HisGrid.get().strip())<4: + g.ndop=g.ndop00 + g.dfdt=g.dfdt0 + + if mode.get()[:4]=='JT65' or mode.get()[:2]=='CW' : + graph2.delete(ALL) + g2font='Helvetica 16' + graph2.create_text(75,13,anchor=CENTER,text="Moon",font=g2font) + graph2.create_text(26,37,anchor=W, text="Az: %8.2f" % g.AzMoon,font=g2font) + graph2.create_text(26,61,anchor=W, text="El: %8.2f" % g.ElMoon,font=g2font) + graph2.create_text(26,85,anchor=W, text="Dop: %6d" % g.ndop,font=g2font) + graph2.create_text(26,109,anchor=W,text="Dgrd:%8.1f" % g.Dgrd,font=g2font) + + if g.freeze_decode and mode.get()[:4]=='JT65': + itol=2 + ltol.configure(text='Tol '+str(50)) + Audio.gcom2.dftolerance=50 + nfreeze.set(1) + Audio.gcom2.nfreeze=1 + if Audio.gcom2.monitoring: + Audio.gcom2.ndecoding=1 + Audio.gcom2.nagain=0 + else: + Audio.gcom2.ndecoding=4 + Audio.gcom2.nagain=1 + g.freeze_decode=0 + + n=int(20.0*log10(g.rms/770.0+0.01)) + t="Rx noise:%3d dB" % (n,) + if n>=-10 and n<=10: + msg4.configure(text=t,bg='gray85') + else: + msg4.configure(text=t,bg='red') + + t=g.ftnstr(Audio.gcom2.decodedfile) +# i=t.rfind(".") + i=g.rfnd(t,".") + t=t[:i] + lab3.configure(text=t) + if mode.get() != g.mode or first: + if mode.get()=="FSK441": + msg2.configure(bg='yellow') + elif mode.get()=="JT65A" or mode.get()=="JT65B" or mode.get()=="JT65C": + msg2.configure(bg='#00FFFF') + elif mode.get()=="JT6M": + msg2.configure(bg='#FF00FF') + elif mode.get()=="CW": + msg2.configure(bg='#00FF00') +# elif mode.get()=="Echo": +# msg2.configure(bg='#FF0000') + g.mode=mode.get() + first=0 + + samfac_in=Audio.gcom1.mfsample/110250.0 + samfac_out=Audio.gcom1.mfsample2/110250.0 + xin=1 + xout=1 + try: + xin=samfac_in/options.samfacin.get() + xout=samfac_out/options.samfacout.get() + if xin<0.999 or xin>1.001 or xout<0.999 or xout>1.001: + lab8.configure(text="%6.4f %6.4f" \ + % (options.samfacin.get(),options.samfacout.get()), \ + fg='black',bg='red') + else: + lab8.configure(fg='gray85',bg='gray85') + except: + pass + + msg1.configure(text="%6.4f %6.4f" % (samfac_in,samfac_out)) + msg2.configure(text=mode.get()) + t="Freeze DF:%4d" % (int(Audio.gcom2.mousedf),) + msg3.configure(text=t) + bdecode.configure(bg='gray85') + if Audio.gcom2.ndecoding: #Set button bg=light_blue + bdecode.configure(bg='#66FFFF') #while decoding + if mode.get()[:2]=="CW": + msg5.configure(text="TR Period: %d s" % (Audio.gcom1.trperiod,), \ + bg='white') + else: + msg5.configure(text="TR Period: %d s" % (Audio.gcom1.trperiod,), \ + bg='gray85') + + tx1.configure(bg='white') + tx2.configure(bg='white') + tx3.configure(bg='white') + tx4.configure(bg='white') + tx5.configure(bg='white') + tx6.configure(bg='white') + if tx6.get()[:1]=='#': + try: + txsnrdb=float(tx6.get()[1:]) + if txsnrdb>-99.0 and txsnrdb<40.0: + Audio.gcom1.txsnrdb=txsnrdb + tx6.configure(bg='orange') + except: + txsnrdb=99.0 + else: + txsnrdb=99.0 + Audio.gcom1.txsnrdb=txsnrdb + if Audio.gcom2.monitoring and not Audio.gcom1.transmitting: + bmonitor.configure(bg='green') + else: + bmonitor.configure(bg='gray85') + if Audio.gcom1.transmitting: + nmsg=int(Audio.gcom2.nmsg) + t=g.ftnstr(Audio.gcom2.sending) + if t[:3]=="CQ ": nsked.set(0) + t="Txing: "+t[:nmsg] + bgcolor='yellow' + if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' #Shorthand (lt blue) + if Audio.gcom2.sendingsh==-1: bgcolor='red' #Plain Text + if Audio.gcom2.sendingsh==2: bgcolor='pink' #Test file + if txsnrdb<90.0: bgcolor='orange' #Simulation mode + if Audio.gcom2.ntxnow==1: tx1.configure(bg=bgcolor) + elif Audio.gcom2.ntxnow==2: tx2.configure(bg=bgcolor) + elif Audio.gcom2.ntxnow==3: tx3.configure(bg=bgcolor) + elif Audio.gcom2.ntxnow==4: tx4.configure(bg=bgcolor) + elif Audio.gcom2.ntxnow==5: tx5.configure(bg=bgcolor) + else: tx6.configure(bg=bgcolor) + else: + bgcolor='green' + t='Receiving' + msg7.configure(text=t,bg=bgcolor) + + if Audio.gcom2.ndecdone==1 or g.cmap != cmap0: + if Audio.gcom2.ndecdone==1: + if isync==-99 or isync==99: + isync=isync_save + Audio.gcom2.minsigdb=isync + try: + f=open(appdir+'/decoded.txt',mode='r') + lines=f.readlines() + f.close() + except: + lines="" + text.configure(state=NORMAL) + for i in range(len(lines)): + text.insert(END,lines[i]) + text.see(END) + text.configure(state=DISABLED) + + if mode.get()[:4]=='JT65': + try: + f=open(appdir+'/decoded.ave',mode='r') + lines=f.readlines() + f.close() + except: + lines[0]="" + lines[1]="" + avetext.configure(state=NORMAL) + avetext.delete('1.0',END) + if len(lines)>1: + avetext.insert(END,lines[0]) + avetext.insert(END,lines[1]) + avetext.configure(state=DISABLED) + Audio.gcom2.ndecdone=2 + + if g.cmap != cmap0: + im.putpalette(g.palette) + cmap0=g.cmap + + if mode.get()[:4]=='JT65': + plot_large() + else: + im.putdata(Audio.gcom2.b) + pim=ImageTk.PhotoImage(im) #Convert Image to PhotoImage + graph1.delete(ALL) +# NB: top two lines are probably invisible ... + graph1.create_image(0,0,anchor='nw',image=pim) + t=g.filetime(g.ftnstr(Audio.gcom2.decodedfile)) + graph1.create_text(100,80,anchor=W,text=t,fill="white") + plot_small() + if loopall: opennext() + nopen=0 + +# Save some parameters + g.mode=mode.get() + g.report=report.get() + if mode.get()=='FSK441': isync441=isync + elif mode.get()=='JT6M': isync6m=isync + elif mode.get()[:4]=='JT65': isync65=isync + Audio.gcom1.txfirst=TxFirst.get() + try: + Audio.gcom1.samfacin=options.samfacin.get() + except: + Audio.gcom1.samfacin=1.0 + try: + Audio.gcom1.samfacout=options.samfacout.get() + except: + Audio.gcom1.samfacout=1.0 +# if Audio.gcom1.samfacin>1.01: Audio.gcom1.samfacin=1.01 +# ... etc. + Audio.gcom2.mycall=(options.MyCall.get()+' ')[:12] + Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] + Audio.gcom2.hisgrid=(HisGrid.get()+' ')[:6] + Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] + Audio.gcom2.ntxreq=ntx.get() + tx=(tx1,tx2,tx3,tx4,tx5,tx6) + Audio.gcom2.txmsg=(tx[ntx.get()-1].get()+' ')[:28] + Audio.gcom2.mode=(mode.get()+' ')[:6] + Audio.gcom2.shok=ShOK.get() + Audio.gcom2.nsave=nsave.get() + Audio.gcom2.nzap=nzap.get() + Audio.gcom2.ndebug=ndebug.get() + Audio.gcom2.minsigdb=isync + Audio.gcom2.nclip=iclip + Audio.gcom2.nblank=nblank.get() + Audio.gcom2.nafc=nafc.get() + Audio.gcom2.nfreeze=nfreeze.get() + Audio.gcom2.dftolerance=ntol[itol] + Audio.gcom2.neme=neme.get() + Audio.gcom2.ndepth=ndepth.get() + Audio.gcom2.nsked=nsked.get() + try: + Audio.gcom2.idinterval=options.IDinterval.get() + except: + Audio.gcom2.idinterval=0 + Audio.gcom2.ntx2=0 +# Audio.gcom1.rxdelay=float('0'+options.RxDelay.get()) +# Audio.gcom1.txdelay=float('0'+options.TxDelay.get()) + if ntx.get()==1 and noshjt65.get()==1: Audio.gcom2.ntx2=1 + Audio.gcom2.nslim2=isync-4 + if nosh441.get()==1 and mode.get()=='FSK441': Audio.gcom2.nslim2=99 + try: + Audio.gcom2.nport=int(options.PttPort.get()) + except: + Audio.gcom2.nport=0 + +# print 'About to init Audio.gcom2.PttPort in save some parameters' + Audio.gcom2.pttport=(options.PttPort.get() + ' ')[:12] +# print Audio.gcom2.pttport + +# Queue up the next update + ldate.after(100,update) + +#------------------------------------------------------ Top level frame +frame = Frame(root) + +#------------------------------------------------------ Menu Bar +mbar = Frame(frame) +mbar.pack(fill = X) + +#------------------------------------------------------ File Menu +filebutton = Menubutton(mbar, text = 'File') +filebutton.pack(side = LEFT) +filemenu = Menu(filebutton, tearoff=0) +filebutton['menu'] = filemenu +filemenu.add('command', label = 'Open', command = openfile) +filemenu.add('command', label = 'Open next in directory', command = opennext) +filemenu.add('command', label = 'Decode remaining files in directory', \ + command = decodeall) +filemenu.add_separator() +filemenu.add('command', label = 'Delete all *.WAV files in RxWAV', \ + command = delwav) +filemenu.add_separator() +filemenu.add('command', label = 'Erase ALL.TXT', command = del_all) +filemenu.add_separator() +filemenu.add('command', label = 'Exit', command = quit) + +#------------------------------------------------------ Setup menu +setupbutton = Menubutton(mbar, text = 'Setup', ) +setupbutton.pack(side = LEFT) +setupmenu = Menu(setupbutton, tearoff=0) +setupbutton['menu'] = setupmenu +setupmenu.add('command', label = 'Options', command = options1) +setupmenu.add_separator() +setupmenu.add('command', label = 'Toggle size of text window', command=textsize) +setupmenu.add('command', label = 'Generate messages for test tones', command=testmsgs) +setupmenu.add_separator() +setupmenu.add_checkbutton(label = 'F4 sets Tx6',variable=kb8rq) +setupmenu.add_checkbutton(label = 'Double-click on callsign sets TxFirst', + variable=setseq) +setupmenu.add_checkbutton(label = 'GenStdMsgs sets Tx1',variable=k2txb) +setupmenu.add_separator() +setupmenu.add_checkbutton(label = 'Enable diagnostics',variable=ndebug) + +#------------------------------------------------------ View menu +viewbutton=Menubutton(mbar,text='View',) +viewbutton.pack(side=LEFT) +viewmenu=Menu(viewbutton,tearoff=0) +viewbutton['menu']=viewmenu +viewmenu.add('command', label = 'SpecJT', command = showspecjt) +viewmenu.add('command', label = 'Astronomical data', command = astro1) + +#------------------------------------------------------ Mode menu +modebutton = Menubutton(mbar, text = 'Mode', ) +modebutton.pack(side = LEFT) +modemenu = Menu(modebutton, tearoff=0) +modebutton['menu'] = modemenu +modemenu.add_radiobutton(label = 'FSK441', variable=mode, command = ModeFSK441, + state=NORMAL) + +# To enable menu item 0: +# modemenu.entryconfig(0,state=NORMAL) +# Can use the following to retrieve the state: +# state=modemenu.entrycget(0,"state") + +modemenu.add_radiobutton(label = 'JT6M', variable=mode, command = ModeJT6M) +modemenu.add_radiobutton(label = 'JT65A', variable=mode, command = ModeJT65A) +modemenu.add_radiobutton(label = 'JT65B', variable=mode, command = ModeJT65B) +modemenu.add_radiobutton(label = 'JT65C', variable=mode, command = ModeJT65C) +modemenu.add_radiobutton(label = 'CW', variable=mode, command = ModeCW) +#modemenu.add_radiobutton(label = 'Echo', variable=mode, command = ModeEcho, +# state=DISABLED) + +#------------------------------------------------------ Decode menu +decodebutton = Menubutton(mbar, text = 'Decode', ) +decodebutton.pack(side = LEFT) +decodemenu = Menu(decodebutton, tearoff=1) +decodebutton['menu'] = decodemenu +decodemenu.FSK441=Menu(decodemenu,tearoff=0) +decodemenu.FSK441.add_checkbutton(label='No shorthands',variable=nosh441) +decodemenu.JT65=Menu(decodemenu,tearoff=0) +decodemenu.JT65.add_checkbutton(label='Only EME calls',variable=neme) +decodemenu.JT65.add_checkbutton(label='No Shorthands if Tx 1',variable=noshjt65) +decodemenu.JT65.add_separator() +decodemenu.JT65.add_radiobutton(label = 'No Deep Search', + variable=ndepth, value=0) +decodemenu.JT65.add_radiobutton(label = 'Normal Deep Search', + variable=ndepth, value=1) +decodemenu.JT65.add_radiobutton(label = 'Aggressive Deep Search', + variable=ndepth, value=2) +decodemenu.JT65.add_radiobutton(label ='Include Average in Aggressive Deep Search', + variable=ndepth, value=3) +decodemenu.add_cascade(label = 'FSK441',menu=decodemenu.FSK441) +decodemenu.add_cascade(label = 'JT65',menu=decodemenu.JT65) + +#------------------------------------------------------ Save menu +savebutton = Menubutton(mbar, text = 'Save') +savebutton.pack(side = LEFT) +savemenu = Menu(savebutton, tearoff=1) +savebutton['menu'] = savemenu +nsave=IntVar() +savemenu.add_radiobutton(label = 'None', variable=nsave,value=0) +savemenu.add_radiobutton(label = 'Save decoded', variable=nsave,value=1) +savemenu.add_radiobutton(label = 'Save if Auto On', variable=nsave,value=2) +savemenu.add_radiobutton(label = 'Save all', variable=nsave,value=3) +nsave.set(0) + +#------------------------------------------------------ Band menu +bandbutton = Menubutton(mbar, text = 'Band') +bandbutton.pack(side = LEFT) +bandmenu = Menu(bandbutton, tearoff=1) +bandbutton['menu'] = bandmenu +nfreq=IntVar() +bandmenu.add_radiobutton(label = '50', variable=nfreq,value=50) +bandmenu.add_radiobutton(label = '144', variable=nfreq,value=144) +bandmenu.add_radiobutton(label = '222', variable=nfreq,value=222) +bandmenu.add_radiobutton(label = '432', variable=nfreq,value=432) +bandmenu.add_radiobutton(label = '1296', variable=nfreq,value=1296) +nfreq.set(144) +#------------------------------------------------------ Help menu +helpbutton = Menubutton(mbar, text = 'Help') +helpbutton.pack(side = LEFT) +helpmenu = Menu(helpbutton, tearoff=0) +helpbutton['menu'] = helpmenu +helpmenu.add('command', label = 'Keyboard shortcuts', command = shortcuts) +helpmenu.add('command', label = 'Special mouse commands', command = mouse_commands) +helpmenu.add('command', label = 'What message to send?', command = what2send) +helpmenu.add('command', label = 'Available suffixes and add-on prefixes', \ + command = prefixes) +helpmenu.add('command', label = 'About WSJT', command = about) + +#------------------------------------------------------ Graphics areas +iframe1 = Frame(frame, bd=1, relief=SUNKEN) +graph1=Canvas(iframe1, bg='black', width=500, height=120,cursor='crosshair') +Widget.bind(graph1,"",dtdf_change) +Widget.bind(graph1,"",mouse_click_g1) +Widget.bind(graph1,"",double_click_g1) +Widget.bind(graph1,"",mouse_up_g1) +Widget.bind(graph1,"",mouse_click_g1) +graph1.pack(side=LEFT) +graph2=Canvas(iframe1, bg='black', width=150, height=120,cursor='crosshair') +graph2.pack(side=LEFT) +iframe1.pack(expand=1, fill=X, padx=4) + +#------------------------------------------------------ Labels under graphics +iframe2a = Frame(frame, bd=1, relief=FLAT, height=15) +lab1=Label(iframe2a, text='Time (s)') +lab1.place(x=250, y=6, anchor=CENTER) +lab3=Label(iframe2a, text=' ') +lab3.place(x=400,y=6, anchor=CENTER) +lab4=Label(iframe2a, text='1 2 3') +lab4.place(x=593,y=6, anchor=CENTER) +iframe2a.pack(expand=1, fill=X, padx=1) +iframe2 = Frame(frame, bd=1, relief=FLAT,height=15) +lab2=Label(iframe2, text='FileID Sync dB DT DF W') +lab2.place(x=3,y=6, anchor='w') +lab5=Label(iframe2, text='Freq (kHz)') +lab5.place(x=580,y=6, anchor=CENTER) +lab6=Label(iframe2a,text='0.0',bg='green') +lab6.place(x=40,y=6, anchor=CENTER) +lab7=Label(iframe2a,text='F3',fg='gray85') +lab7.place(x=495,y=6, anchor=CENTER) +lab8=Label(iframe2a,text='1.0000 1.0000',fg='gray85') +lab8.place(x=135,y=6, anchor=CENTER) +iframe2.pack(expand=1, fill=X, padx=4) + +#-------------------------------------------------------- Decoded text +iframe4 = Frame(frame, bd=1, relief=SUNKEN) +text=Text(iframe4, height=6, width=80) +text.bind('',dbl_click_text) +text.bind('',dbl_click_text) + +root.bind_all('', shortcuts) +root.bind_all('', mouse_commands) +root.bind_all('', about) +root.bind_all('', options1) +root.bind_all('', txmute) +root.bind_all('', clrToRadio) +root.bind_all('', what2send) +root.bind_all('', opennext) +root.bind_all('', decodeall) +root.bind_all('', ModeFSK441) +root.bind_all('', ModeJT65A) +root.bind_all('', ModeJT65B) +root.bind_all('', ModeJT65C) +root.bind_all('', ModeJT6M) +root.bind_all('', ModeCW) +#root.bind_all('', ModeEcho) +root.bind_all('', showspecjt) + +root.bind_all('',btx1) +root.bind_all('',btx2) +root.bind_all('',btx3) +root.bind_all('',btx4) +root.bind_all('',btx5) +root.bind_all('',btx6) + +root.bind_all('',toggleauto) +root.bind_all('',toggleauto) +root.bind_all('',clear_avg) +root.bind_all('',clear_avg) +root.bind_all('',decode) +root.bind_all('',decode) +root.bind_all('',erase) +root.bind_all('',erase) +root.bind_all('',toggle_freeze) +root.bind_all('',toggle_freeze) +root.bind_all('',GenStdMsgs) +root.bind_all('',GenStdMsgs) +root.bind_all('',decode_include) +root.bind_all('',decode_include) +root.bind_all('',lookup) +root.bind_all('',lookup) +root.bind_all('',monitor) +root.bind_all('',monitor) +root.bind_all('',txstop) +root.bind_all('',txstop) +root.bind_all('',stub) +root.bind_all('',stub) +root.bind_all('',logqso) +root.bind_all('',logqso) +root.bind_all('',stopmon) +root.bind_all('',stopmon) +root.bind_all('',savelast) +root.bind_all('',savelast) +root.bind_all('',decode_exclude) +root.bind_all('',decode_exclude) +root.bind_all('',toggle_zap) +root.bind_all('',toggle_zap) +root.bind_all('',lookup_gen) +root.bind_all('',lookup_gen) +root.bind_all('',left_arrow) +root.bind_all('',right_arrow) + +text.pack(side=LEFT, fill=X, padx=1) +sb = Scrollbar(iframe4, orient=VERTICAL, command=text.yview) +sb.pack(side=RIGHT, fill=Y) +text.configure(yscrollcommand=sb.set) +iframe4.pack(expand=1, fill=X, padx=4) +iframe4b = Frame(frame, bd=1, relief=SUNKEN) +avetext=Text(iframe4b, height=2, width=80) +#avetext.bind('', lambda e: "break") +avetext.bind('',dbl_click_ave) +avetext.bind('',dbl_click_ave) +avetext.pack(side=LEFT, fill=X, padx=1) +iframe4b.pack(expand=1, fill=X, padx=4) + +#------------------------------------------------------- Button Bar +iframe4c = Frame(frame, bd=1, relief=SUNKEN) +blogqso=Button(iframe4c, text='Log QSO',underline=4,command=logqso, + padx=1,pady=1) +#bplay=Button(iframe4c, text='Play',underline=0,command=stub) +bstop=Button(iframe4c, text='Stop',underline=0,command=stopmon, + padx=1,pady=1) +bmonitor=Button(iframe4c, text='Monitor',underline=0,command=monitor, + padx=1,pady=1) +bsavelast=Button(iframe4c, text='Save',underline=3,command=savelast, + padx=1,pady=1) +bdecode=Button(iframe4c, text='Decode',underline=0,command=decode, + padx=1,pady=1) +berase=Button(iframe4c, text='Erase',underline=0,command=erase, + padx=1,pady=1) +bclravg=Button(iframe4c, text='Clear Avg',underline=0,command=clear_avg, + padx=1,pady=1) +binclude=Button(iframe4c, text='Include',underline=0, + command=decode_include,padx=1,pady=1) +bexclude=Button(iframe4c, text='Exclude',underline=1, + command=decode_exclude,padx=1,pady=1) +btxstop=Button(iframe4c,text='TxStop',underline=4,command=txstop, + padx=1,pady=1) + +blogqso.pack(side=LEFT,expand=1,fill=X) +#bplay.pack(side=LEFT,expand=1,fill=X) +bstop.pack(side=LEFT,expand=1,fill=X) +bmonitor.pack(side=LEFT,expand=1,fill=X) +bsavelast.pack(side=LEFT,expand=1,fill=X) +bdecode.pack(side=LEFT,expand=1,fill=X) +berase.pack(side=LEFT,expand=1,fill=X) +bclravg.pack(side=LEFT,expand=1,fill=X) +binclude.pack(side=LEFT,expand=1,fill=X) +bexclude.pack(side=LEFT,expand=1,fill=X) +btxstop.pack(side=LEFT,expand=1,fill=X) +iframe4c.pack(expand=1, fill=X, padx=4) + +#-----------------------------------------------------General control area +iframe5 = Frame(frame, bd=1, relief=FLAT,height=180) + +#------------------------------------------------------ "Other station" info +f5a=Frame(iframe5,height=170,bd=2,relief=GROOVE) +labToRadio=Label(f5a,text='To radio:', width=9, relief=FLAT) +labToRadio.grid(column=0,row=0) +ToRadio=Entry(f5a,width=9) +ToRadio.insert(0,'W8WN') +ToRadio.grid(column=1,row=0,pady=3) +bLookup=Button(f5a, text='Lookup',underline=0,command=lookup,padx=1,pady=1) +bLookup.grid(column=2,row=0,sticky='EW',padx=4) +labGrid=Label(f5a,text='Grid:', width=9, relief=FLAT) +labGrid.grid(column=0,row=1) +HisGrid=Entry(f5a,width=9) +HisGrid.grid(column=1,row=1,pady=1) +bAdd=Button(f5a, text='Add',command=addtodb,padx=1,pady=1) +bAdd.grid(column=2,row=1,sticky='EW',padx=4) +labAz=Label(f5a,text='Az 257 El 15',width=11,font=(font1,9)) +labAz.grid(column=1,row=2) +labHotAB=Label(f5a,bg='#FFCCFF',text='HotA: 247',font=(font1,9)) +labHotAB.grid(column=0,row=2,sticky='EW',padx=4,pady=3) +labDist=Label(f5a,text='16753 km',font=(font1,9)) +labDist.grid(column=2,row=2) + +#------------------------------------------------------ Date and Time +ldate=Label(f5a, bg='black', fg='yellow', width=11, bd=4, + text='2005 Apr 22\n01:23:45', relief=RIDGE, + justify=CENTER, font=(font1,16)) +ldate.grid(column=0,columnspan=3,row=3,rowspan=2,pady=2) +f5a.pack(side=LEFT,expand=1,fill=BOTH) + +#------------------------------------------------------ Receiving parameters +f5b=Frame(iframe5,bd=2,relief=GROOVE) +lsync=Label(f5b, bg='white', fg='black', text='Sync 1', width=8, relief=RIDGE) +lsync.grid(column=0,row=0,padx=2,pady=1,sticky='EW') +Widget.bind(lsync,'',incsync) +Widget.bind(lsync,'',decsync) +nzap=IntVar() +cbzap=Checkbutton(f5b,text='Zap',underline=0,variable=nzap) +cbzap.grid(column=1,row=0,padx=2,pady=1,sticky='W') +cbnb=Checkbutton(f5b,text='NB',variable=nblank) +cbnb.grid(column=1,row=1,padx=2,pady=1,sticky='W') +cbfreeze=Checkbutton(f5b,text='Freeze',underline=0,variable=nfreeze) +cbfreeze.grid(column=1,row=2,padx=2,sticky='W') +cbafc=Checkbutton(f5b,text='AFC',variable=nafc) +cbafc.grid(column=1,row=3,padx=2,pady=1,sticky='W') +lclip=Label(f5b, bg='white', fg='black', text='Clip 0', width=8, relief=RIDGE) +lclip.grid(column=0,row=1,padx=2,sticky='EW') +Widget.bind(lclip,'',incclip) +Widget.bind(lclip,'',decclip) +ltol=Label(f5b, bg='white', fg='black', text='Tol 400', width=8, relief=RIDGE) +ltol.grid(column=0,row=2,padx=2,pady=1,sticky='EW') +Widget.bind(ltol,'',inctol) +Widget.bind(ltol,'',dectol) +Button(f5b,text='Defaults',command=defaults,padx=1,pady=1).grid(column=0, + row=3,sticky='EW') +ldsec=Label(f5b, bg='white', fg='black', text='Dsec 0.0', width=8, relief=RIDGE) +ldsec.grid(column=0,row=4,ipadx=3,padx=2,pady=5,sticky='EW') +#lrdsec=Label(f5b, bg='white', fg='black', text='RDsec 0.0', width=8, relief=RIDGE) +#lrdsec.grid(column=1,row=4,ipadx=3,padx=2,pady=5,sticky='EW') +Widget.bind(ldsec,'',incdsec) +Widget.bind(ldsec,'',decdsec) +#Widget.bind(lrdsec,'',incrdsec) +#Widget.bind(lrdsec,'',decrdsec) +#Widget.bind(lrdsec,'',stub) +#Widget.bind(lrdsec,'',stub) + +f5b.pack(side=LEFT,expand=0,fill=BOTH) + +#------------------------------------------------------ Tx params and msgs +f5c=Frame(iframe5,bd=2,relief=GROOVE) +txfirst=Checkbutton(f5c,text='Tx First',justify=RIGHT,variable=TxFirst) +f5c2=Frame(f5c,bd=0) +labreport=Label(f5c2,text='Rpt',width=4) +report=Entry(f5c2, width=4) +report.insert(0,'26') +labreport.pack(side=RIGHT,expand=1,fill=BOTH) +report.pack(side=RIGHT,expand=1,fill=BOTH) +shmsg=Checkbutton(f5c,text='Sh Msg',justify=RIGHT,variable=ShOK, + command=restart2) +sked=Checkbutton(f5c,text='Sked',justify=RIGHT,variable=nsked) +genmsg=Button(f5c,text='GenStdMsgs',underline=0,command=GenStdMsgs, + padx=1,pady=1) +auto=Button(f5c,text='Auto is Off',underline=0,command=toggleauto, + padx=1,pady=1) +auto.focus_set() + +txfirst.grid(column=0,row=0,sticky='W',padx=4) +f5c2.grid(column=0,row=1,sticky='W',padx=4) +shmsg.grid(column=0,row=2,sticky='W',padx=4) +sked.grid(column=0,row=3,sticky='W',padx=4) +genmsg.grid(column=0,row=4,sticky='W',padx=4) +auto.grid(column=0,row=5,sticky='EW',padx=4) +#txstop.grid(column=0,row=6,sticky='EW',padx=4) + +ntx=IntVar() +tx1=Entry(f5c,width=24) +rb1=Radiobutton(f5c,value=1,variable=ntx) +b1=Button(f5c, text='Tx1',underline=2,command=btx1,padx=1,pady=1) +tx1.grid(column=1,row=0) +rb1.grid(column=2,row=0) +b1.grid(column=3,row=0) + +tx2=Entry(f5c,width=24) +rb2=Radiobutton(f5c,value=2,variable=ntx) +b2=Button(f5c, text='Tx2',underline=2,command=btx2,padx=1,pady=1) +tx2.grid(column=1,row=1) +rb2.grid(column=2,row=1) +b2.grid(column=3,row=1) + +tx3=Entry(f5c,width=24) +rb3=Radiobutton(f5c,value=3,variable=ntx) +b3=Button(f5c, text='Tx3',underline=2,command=btx3,padx=1,pady=1) +tx3.grid(column=1,row=2) +rb3.grid(column=2,row=2) +b3.grid(column=3,row=2) + +tx4=Entry(f5c,width=24) +rb4=Radiobutton(f5c,value=4,variable=ntx) +b4=Button(f5c, text='Tx4',underline=2,command=btx4,padx=1,pady=1) +tx4.grid(column=1,row=3) +rb4.grid(column=2,row=3) +b4.grid(column=3,row=3) + +tx5=Entry(f5c,width=24) +rb5=Radiobutton(f5c,value=5,variable=ntx) +b5=Button(f5c, text='Tx5',underline=2,command=btx5,padx=1,pady=1) +tx5.grid(column=1,row=4) +rb5.grid(column=2,row=4) +b5.grid(column=3,row=4) + +tx6=Entry(f5c,width=24) +rb6=Radiobutton(f5c,value=6,variable=ntx) +b6=Button(f5c, text='Tx6',underline=2,command=btx6,padx=1,pady=1) +tx6.grid(column=1,row=5) +rb6.grid(column=2,row=5) +b6.grid(column=3,row=5) + +f5c.pack(side=LEFT,fill=BOTH) +iframe5.pack(expand=1, fill=X, padx=4) + +#------------------------------------------------------------ Status Bar +iframe6 = Frame(frame, bd=1, relief=SUNKEN) +msg1=Message(iframe6, text=' ', width=300,relief=SUNKEN) +msg1.pack(side=LEFT, fill=X, padx=1) +msg2=Message(iframe6, text='Message #2', width=300,relief=SUNKEN) +msg2.pack(side=LEFT, fill=X, padx=1) +msg3=Message(iframe6,width=300,relief=SUNKEN) +msg3.pack(side=LEFT, fill=X, padx=1) +msg4=Message(iframe6, text='Message #4', width=300,relief=SUNKEN) +msg4.pack(side=LEFT, fill=X, padx=1) +msg5=Message(iframe6, text='Message #5', width=300,relief=SUNKEN) +msg5.pack(side=LEFT, fill=X, padx=1) +Widget.bind(msg5,'',inctrperiod) +Widget.bind(msg5,'',dectrperiod) +msg7=Message(iframe6, text=' ', width=300,relief=SUNKEN) +msg7.pack(side=RIGHT, fill=X, padx=1) +iframe6.pack(expand=1, fill=X, padx=4) +frame.pack() + +ldate.after(100,update) +lauto=0 +isync=1 +ntx.set(1) +ndepth.set(1) + +import options +options.defaults() +ModeFSK441() +lookup() +balloon.unbind(ToRadio) +g.astro_geom0="+0+0" +Audio.gcom1.mute=0 + +#---------------------------------------------------------- Process INI file +try: + f=open(appdir+'/WSJT.INI',mode='r') + params=f.readlines() +except: + params="" + +try: + for i in range(len(params)): + key,value=params[i].split() + if key == 'WSJTGeometry': root.geometry(value) + elif key == 'Mode': + mode.set(value) + if value=='FSK441': + ModeFSK441() + elif value=='JT65A': + ModeJT65A() + elif value=='JT65B': + ModeJT65B() + elif value=='JT65C': + ModeJT65C() + elif value=='JT6M': + ModeJT6M() + elif value=='CW': + ModeCW() + elif key == 'MyCall': options.MyCall.set(value) + elif key == 'MyGrid': options.MyGrid.set(value) + elif key == 'HisCall': + hiscall=value + if hiscall=="______": hiscall="" + ToRadio.delete(0,END) + ToRadio.insert(0,hiscall) + elif key == 'HisGrid': + hisgrid=value + if hisgrid == "XX00xx": + lookup() + HisGrid.delete(0,END) + HisGrid.insert(0,hisgrid) +# elif key == 'RxDelay': options.RxDelay.set(value) +# elif key == 'TxDelay': options.TxDelay.set(value) + elif key == 'IDinterval': options.IDinterval.set(value) + elif key == 'PttPort': + try: + options.PttPort.set(value) + try: + Audio.gcom2.nport=int(options.PttPort.get()) + except: + Audio.gcom2.nport=0 + except: + options.PttPort.set("/dev/cuad0") + Audio.gcom2.nport=0 + Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] + elif key == 'Mileskm': options.mileskm.set(value) + elif key == 'MsgStyle': options.ireport.set(value) + elif key == 'Region': options.iregion.set(value) + elif key == 'AudioIn': + try: + g.ndevin.set(value) + except: + g.ndevin.set(0) + g.DevinName.set(value) + options.DevinName.set(value) + Audio.gcom1.devin_name=(options.DevinName.get()+' ')[:12] + elif key == 'AudioOut': + try: + g.ndevout.set(value) + except: + g.ndevout.set(0) + g.DevoutName.set(value) + options.DevoutName.set(value) + Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12] + elif key == 'SamFacIn': options.samfacin.set(value) + elif key == 'SamFacOut': options.samfacout.set(value) + elif key == 'Template1': options.Template1.set(value.replace("_"," ")) + elif key == 'Template2': options.Template2.set(value.replace("_"," ")) + elif key == 'Template3': options.Template3.set(value.replace("_"," ")) + elif key == 'Template4': options.Template4.set(value.replace("_"," ")) + elif key == 'Template5': options.Template5.set(value.replace("_"," ")) + elif key == 'Template6': + options.Template6.set(value.replace("_"," ")) + if options.Template6.get()==" ": options.Template6.set("") + elif key == 'AddPrefix': options.addpfx.set(value.replace("_"," ").lstrip()) + elif key == 'AuxRA': options.auxra.set(value) + elif key == 'AuxDEC': options.auxdec.set(value) + elif key == 'TxFirst': TxFirst.set(value) + elif key == 'KB8RQ': kb8rq.set(value) + elif key == 'K2TXB': k2txb.set(value) + elif key == 'SetSeq': setseq.set(value) + elif key == 'Report': + report.delete(0,99) + report.insert(0,value) + elif key == 'ShOK': ShOK.set(value) + elif key == 'Nsave': nsave.set(value) + elif key == 'Band': nfreq.set(value) + elif key == 'S441': isync441=int(value) + elif key == 'S6m': isync6m=int(value) + elif key == 'Sync': isync65=int(value) + elif key == 'Clip': iclip=int(value) + elif key == 'Zap': nzap.set(value) + elif key == 'NB': nblank.set(value) + elif key == 'NAFC': nafc.set(value) + elif key == 'Sked': nsked.set(value) + elif key == 'NoSh441': nosh441.set(value) + elif key == 'NoShJT65': noshjt65.set(value) + elif key == 'NEME': neme.set(value) + elif key == 'NDepth': ndepth.set(value) + elif key == 'Debug': ndebug.set(value) + elif key == 'HisCall': + Audio.gcom2.hiscall=(value+' ')[:12] + ToRadio.delete(0,99) + ToRadio.insert(0,value) + lookup() #Maybe should save HisGrid, instead? + elif key == 'MRUDir': mrudir=value.replace("#"," ") + elif key == 'AstroGeometry': g.astro_geom0 =value + elif key == 'CWTRPeriod': + ncwtrperiod=int(value) + if mode.get()[:2]=="CW": Audio.gcom1.trperiod=ncwtrperiod + else: pass +except: + print 'Error reading WSJT.INI, continuing with defaults.' + print key,value + +g.mode=mode.get() +if mode.get()=='FSK441': isync=isync441 +elif mode.get()=='JT6M': isync=isync6m +elif mode.get()[:4]=='JT65': isync=isync65 +lsync.configure(text=slabel+str(isync)) +lclip.configure(text='Clip '+str(iclip)) +Audio.gcom2.appdir=(appdir+' ')[:80] +Audio.gcom2.ndepth=ndepth.get() +Audio.ftn_init() +GenStdMsgs() +Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] +stopmon() +first=1 +if g.Win32: root.iconbitmap("wsjt.ico") +root.title(' WSJT 6 by K1JT') +import astro +import specjt + +# SpecJT has a "mainloop", so does not return until it is terminated. +#root.mainloop() #Superseded by mainloop in SpecJT + +# Clean up and save user options before terminating +f=open(appdir+'/WSJT.INI',mode='a') +root_geom=root_geom[root_geom.index("+"):] +f.write("WSJTGeometry " + root_geom + "\n") +f.write("Mode " + g.mode + "\n") +f.write("MyCall " + options.MyCall.get() + "\n") +f.write("MyGrid " + options.MyGrid.get() + "\n") +t=g.ftnstr(Audio.gcom2.hiscall) +if t[:1]==" ": t="______" +f.write("HisCall " + t + "\n") +t=g.ftnstr(Audio.gcom2.hisgrid) +if t==" ": t="XX00xx" +f.write("HisGrid " + t + "\n") +#f.write("RxDelay " + str(options.RxDelay.get()) + "\n") +#f.write("TxDelay " + str(options.TxDelay.get()) + "\n") +f.write("IDinterval " + str(options.IDinterval.get()) + "\n") +f.write("PttPort " + str(options.PttPort.get()) + "\n") +f.write("Mileskm " + str(options.mileskm.get()) + "\n") +f.write("MsgStyle " + str(options.ireport.get()) + "\n") +f.write("Region " + str(options.iregion.get()) + "\n") +f.write("AudioIn " + options.DevinName.get() + "\n") +f.write("AudioOut " + options.DevoutName.get() + "\n") +f.write("SamFacIn " + str(options.samfacin.get()) + "\n") +f.write("SamFacOut " + str(options.samfacout.get()) + "\n") +if options.Template6.get()=="": options.Template6.set("_") +f.write("Template1 " + options.Template1.get().replace(" ","_") + "\n") +f.write("Template2 " + options.Template2.get().replace(" ","_") + "\n") +f.write("Template3 " + options.Template3.get().replace(" ","_") + "\n") +f.write("Template4 " + options.Template4.get().replace(" ","_") + "\n") +f.write("Template5 " + options.Template5.get().replace(" ","_") + "\n") +f.write("Template6 " + options.Template6.get().replace(" ","_") + "\n") +if options.addpfx.get().lstrip()=="": options.addpfx.set("_") +f.write("AddPrefix " + options.addpfx.get().lstrip() + "\n") +if options.auxra.get()=="": options.auxra.set("0") +if options.auxdec.get()=="": options.auxdec.set("0") +f.write("AuxRA " + options.auxra.get() + "\n") +f.write("AuxDEC " + options.auxdec.get() + "\n") +f.write("TxFirst " + str(TxFirst.get()) + "\n") +f.write("KB8RQ " + str(kb8rq.get()) + "\n") +f.write("K2TXB " + str(k2txb.get()) + "\n") +f.write("SetSeq " + str(setseq.get()) + "\n") +f.write("Report " + g.report + "\n") +f.write("ShOK " + str(ShOK.get()) + "\n") +f.write("Nsave " + str(nsave.get()) + "\n") +f.write("Band " + str(nfreq.get()) + "\n") +f.write("S441 " + str(isync441) + "\n") +f.write("S6m " + str(isync6m) + "\n") +f.write("Sync " + str(isync65) + "\n") +f.write("Clip " + str(iclip) + "\n") +f.write("Zap " + str(nzap.get()) + "\n") +f.write("NB " + str(nblank.get()) + "\n") +f.write("NAFC " + str(nafc.get()) + "\n") +f.write("Sked " + str(nsked.get()) + "\n") +f.write("NoSh441 " + str(nosh441.get()) + "\n") +f.write("NoShJT65 " + str(noshjt65.get()) + "\n") +f.write("NEME " + str(neme.get()) + "\n") +f.write("NDepth " + str(ndepth.get()) + "\n") +f.write("Debug " + str(ndebug.get()) + "\n") +#f.write("TRPeriod " + str(Audio.gcom1.trperiod) + "\n") +mrudir2=mrudir.replace(" ","#") +f.write("MRUDir " + mrudir2 + "\n") +if g.astro_geom[:7]=="200x200": g.astro_geom="268x423" + g.astro_geom[7:] +f.write("AstroGeometry " + g.astro_geom + "\n") +f.write("CWTRPeriod " + str(ncwtrperiod) + "\n") +f.close() + +Audio.ftn_quit() +Audio.gcom1.ngo=0 #Terminate audio streams +Audio.gcom2.lauto=0 +Audio.gcom1.txok=0 +time.sleep(0.5) From 63fafd01370b0bad8903e5ab9f0dde7c894a4962 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 2 Aug 2006 03:47:38 +0000 Subject: [PATCH 166/811] - oops. stock gfortran is still gfortran41 I was experimenting with gfortran42 git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@226 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 8 ++++---- configure.ac | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 4fe806622..3acf58e7a 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 190 2006-07-06 13:44:34Z va3db $ +# $Id: configure.ac 222 2006-08-02 00:13:52Z va3db $ # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -976,7 +976,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 190 2006-07-06 13:44:34Z va3db $ +$Id: configure.ac 222 2006-08-02 00:13:52Z va3db $ _ACEOF exit 0 fi @@ -3656,8 +3656,8 @@ else echo "${ECHO_T}no" >&6 fi -# Extract the first word of "gfortran42", so it can be a program name with args. -set dummy gfortran42; ac_word=$2 +# Extract the first word of "gfortran41", so it can be a program name with args. +set dummy gfortran41; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GFORTRAN+set}" = set; then diff --git a/configure.ac b/configure.ac index 112eeadc4..32fd07297 100644 --- a/configure.ac +++ b/configure.ac @@ -86,10 +86,10 @@ G95_LIB_PATH=`${G95} -print-file-name=` AC_MSG_RESULT(${G95_LIB_PATH}) AC_PATH_PROG(GFORTRAN, gfortran) dnl -dnl FreeBSD currently installs gfortran as gfortran42 +dnl FreeBSD currently installs gfortran as gfortran41 dnl See http://gcc.gnu.org/fortran/ dnl -AC_PATH_PROG(GFORTRAN, gfortran42) +AC_PATH_PROG(GFORTRAN, gfortran41) AC_MSG_CHECKING([gfortran lib path]) GFORTRAN_LIB_PATH=`${GFORTRAN} -print-file-name=` AC_MSG_RESULT(${GFORTRAN_LIB_PATH}) From 76e85d911a1fa6d81e80122ce67426ddd86c44c8 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 2 Aug 2006 10:12:59 +0000 Subject: [PATCH 167/811] - Fixed typo that broke portaudio git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@227 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 6 +++--- configure.ac | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 3acf58e7a..c476c69e9 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 222 2006-08-02 00:13:52Z va3db $ +# $Id: configure.ac 226 2006-08-02 03:47:38Z va3db $ # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -976,7 +976,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 222 2006-08-02 00:13:52Z va3db $ +$Id: configure.ac 226 2006-08-02 03:47:38Z va3db $ _ACEOF exit 0 fi @@ -6741,7 +6741,7 @@ _ACEOF NEEDPORTAUDIO="portaudio-v19/lib/libportaudio.a" - LDFLAGS="-Lportaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" + LDFLAGS="portaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" else NEEDPORTAUDIO="" diff --git a/configure.ac b/configure.ac index 32fd07297..d021f3a8d 100644 --- a/configure.ac +++ b/configure.ac @@ -307,7 +307,7 @@ if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c") AC_SUBST(NEEDPORTAUDIO, "portaudio-v19/lib/libportaudio.a") - LDFLAGS="-Lportaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" + LDFLAGS="portaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" else AC_SUBST(NEEDPORTAUDIO, "") fi From e7712ed46e2034ef8b5807ca87f6e7387027eb17 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 2 Aug 2006 10:13:47 +0000 Subject: [PATCH 168/811] Dummy git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@228 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsjt.py b/wsjt.py index 942691d01..349b43557 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * From 5144ab0537e9516293e984d8a6ad4a6c84d8a26c Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 2 Aug 2006 13:36:39 +0000 Subject: [PATCH 169/811] wsjt1: improved logic for Zap (interference removal) for FSK441 and JT6M modes avesp2: ditto. In addition, dependence of Zap behavior on decoding history has been removed. wsjt.py: corrected default setting of PTTPort under Win32. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@229 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- avesp2.f | 19 ++++++++++++------- wsjt.py | 10 +++++++++- wsjt1.F | 6 ++++-- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/avesp2.f b/avesp2.f index 3802907b2..2bb635614 100644 --- a/avesp2.f +++ b/avesp2.f @@ -1,4 +1,4 @@ - subroutine avesp2(dat,jza,nadd,f0,NFreeze,MouseDF, + subroutine avesp2(dat,jza,nadd,f0,mode,NFreeze,MouseDF, + DFTolerance,fzap) real dat(jza) @@ -27,20 +27,25 @@ C Flatten s2 and get psa, ref, and birdie ia=300/df ib=2700/df n=0 + fmouse=0. + if(mode.eq.2) fmouse=1270.46+MouseDF + if(mode.eq.4) fmouse=1076.66+MouseDF + do i=ia,ib if(birdie(i)-ref(i).gt.3.0) then f=i*df + +C Don't zap unless Freeze is OFF or birdie is outside the "Tol" range. if(NFreeze.eq.0 .or. - + abs(f-1270.46-MouseDF).gt.float(DFTolerance)) then - if(abs(f-f0).gt.25.0) then + + abs(f-fmouse).gt.float(DFTolerance)) then if(n.lt.200 .and. variance(i-1).lt.2.5 .and. - + variance(i).lt.2.5 .and. variance(i+1).lt.2.5) then + + variance(i).lt.2.5.and.variance(i+1).lt.2.5) then n=n+1 - fzap(n)=i*df + fzap(n)=f endif endif - endif - endif + + endif enddo return diff --git a/wsjt.py b/wsjt.py index 349b43557..564d12efd 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1986,6 +1986,11 @@ try: params=f.readlines() except: params="" + if g.Win32: + options.PttPort.set("0") + else: + options.PttPort.set("/dev/cuad0") + Audio.gcom2.nport=0 try: for i in range(len(params)): @@ -2029,7 +2034,10 @@ try: except: Audio.gcom2.nport=0 except: - options.PttPort.set("/dev/cuad0") + if g.Win32: + options.PttPort.set("0") + else: + options.PttPort.set("/dev/cuad0") Audio.gcom2.nport=0 Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] elif key == 'Mileskm': options.mileskm.set(value) diff --git a/wsjt1.F b/wsjt1.F index 3e863385c..732132b24 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -128,7 +128,9 @@ C Intentionally degrade SNR by -nclip dB. endif if(mode.ne.2 .and. nzap.ne.0) then - if(jz.gt.100000) call avesp2(dat,jz,2,f0a,NFreeze,MouseDF, + nfrz=NFreeze + if(mode.eq.1) nfrz=0 + if(jz.gt.100000) call avesp2(dat,jz,2,f0a,mode,nfrz,MouseDF, + DFTolerance,fzap) nadd=1 call bzap(dat,jz,nadd,mode,fzap) @@ -184,7 +186,7 @@ C Intentionally degrade SNR by -nclip dB. jz=jz2 nadd=1 fzap(1)=0. - if(nzap.eq.1) call avesp2(dat,jz,nadd,f0a,NFreeze,MouseDF, + if(nzap.eq.1) call avesp2(dat,jz,nadd,f0a,mode,NFreeze,MouseDF, + DFTolerance,fzap) if(nzap.eq.1.and.nstest.eq.0) call bzap(dat,jz,nadd,mode,fzap) From 79875290a0e4bc37488491524358eb8eee3b522f Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 2 Aug 2006 18:51:08 +0000 Subject: [PATCH 170/811] get_fname: If entry in ToRadio is blank, use Mon_ as prefix of recorded file names. decode2: Corrected starting locations of mouse-picked decodes in JT6M mode decode3, pix2d: Put yellow tick marks at frequency of JT6M sync tone. wsjtgen: Remove diagnostic print statement associated with Tx of test files. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@230 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- decode2.f90 | 3 +-- decode3.F90 | 4 ++-- get_fname.F90 | 2 +- pix2d.f90 | 23 ++++++++++++++++++----- wsjt.py | 2 +- wsjtgen.F90 | 1 - 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/decode2.f90 b/decode2.f90 index 3f8e6fe92..2ba8dd9e7 100644 --- a/decode2.f90 +++ b/decode2.f90 @@ -28,6 +28,7 @@ subroutine decode2 endif istart=1.0 + 11025*0.001*npingtime - lenpick/2 + if(mode(1:4).eq.'JT6M') istart=istart+11025 if(istart.lt.2) istart=2 if(ndecoding.eq.1) then ! Normal decoding at end of Rx period (or at t=53s in JT65) @@ -80,7 +81,6 @@ subroutine decode2 if(mode(1:4).eq.'JT6M') then jzz=4*11025 if(mousebutton.eq.3) jzz=10*11025 - istart=istart+11025 else istart=istart + 3300 - jzz/2 endif @@ -97,7 +97,6 @@ subroutine decode2 if(istart+lenpick.gt.jza) istart=jza-lenpick call decode3(d2a(istart),lenpick,istart,fnamea) endif - fnameb=fnamea 999 return diff --git a/decode3.F90 b/decode3.F90 index 337dda67a..ff4279c5e 100644 --- a/decode3.F90 +++ b/decode3.F90 @@ -78,10 +78,10 @@ subroutine decode3(d2,jz,istart,filename) call pix2d65(d2d,jz) else if(mode.eq.'FSK441') then nz=s2(1,1) - call pix2d(d2d,jz,mousebutton,s2,64,nz,b) + call pix2d(d2d,jz,mousebutton,mode,s2,64,nz,b) else if(mode(1:4).eq.'JT6M' .and. mousebutton.eq.0) then nz=s2(1,1) - call pix2d(d2d,jz,mousebutton,s2,64,nz,b) + call pix2d(d2d,jz,mousebutton,mode,s2,64,nz,b) endif ! Compute red and magenta cutves for small plot area, FSK441/JT6M only diff --git a/get_fname.F90 b/get_fname.F90 index 0bff6b0b8..f33f5d44d 100644 --- a/get_fname.F90 +++ b/get_fname.F90 @@ -22,7 +22,7 @@ subroutine get_fname(hiscall,ntime,trperiod,lauto,fname) i=index(hiscall,'/') if(i.ge.5) tag=hiscall(1:i-1) if(i.ge.2.and.i.le.4) tag=hiscall(i+1:) - if(lauto.eq.0) tag='Mon' + if(hiscall(1:1).eq.' ' .or. lauto.eq.0) tag='Mon' i=index(tag,' ') fname=tag(1:i-1)//fname diff --git a/pix2d.f90 b/pix2d.f90 index e723416b9..04656038e 100644 --- a/pix2d.f90 +++ b/pix2d.f90 @@ -1,9 +1,10 @@ -subroutine pix2d(d2,jz,mousebutton,s2,nchan,nz,b) +subroutine pix2d(d2,jz,mousebutton,mode,s2,nchan,nz,b) ! Compute pixels to represent the 2-d spectrum s2(nchan,nz), and the ! green line. integer*2 d2(jz) !Raw input data + character*6 mode real s2(nchan,nz) !2-d spectrum integer*2 b(60000) !Pixels corresponding to 2-d spectrum data nx0/0/ @@ -89,16 +90,28 @@ subroutine pix2d(d2,jz,mousebutton,s2,nchan,nz,b) ng0=ng endif enddo + + if(mode.eq.'FSK441') then ! Insert yellow tick marks at frequencies of the FSK441 tones - do i=2,5 - f=441*i - ich=58-nint(f/43.066) + do i=2,5 + f=441*i + ich=58-nint(f/43.066) + do j=1,5 + b((ich-1)*500+j+2)=254 + b((ich-1)*500+j+248)=254 + b((ich-1)*500+j+495)=254 + enddo + enddo + else if(mode.eq.'JT6M') then +! Insert yellow tick marks at frequencies of the JT6M sync tone + f=1076.66 + ich=60-nint(f/43.066) !Why 58 for FSK441, above? do j=1,5 b((ich-1)*500+j+2)=254 b((ich-1)*500+j+248)=254 b((ich-1)*500+j+495)=254 enddo - enddo + endif ! Mark the best ping with a red tick if(tbest.gt.0.0) then diff --git a/wsjt.py b/wsjt.py index 564d12efd..62fa592d8 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * diff --git a/wsjtgen.F90 b/wsjtgen.F90 index 1b9082d24..f34bc4eb9 100644 --- a/wsjtgen.F90 +++ b/wsjtgen.F90 @@ -85,7 +85,6 @@ subroutine wsjtgen enddo #endif nwave=ndata/2 - print*,nwave do i=nwave,NTXMAX iwave(i)=0 enddo From ce018141889814ed395460d0bafadc8a72abe5df Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 2 Aug 2006 19:54:45 +0000 Subject: [PATCH 171/811] In JT6m mode, if Freeze is On, limit the search for synchronization to +/- DFTolerance around MouseDF, and place a small green tick at left of main screen at the MouseDF frequency. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@231 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- decode3.F90 | 4 ++-- pix2d.f90 | 10 +++++++++- wsjt.py | 2 +- wsjt1.F | 4 +++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/decode3.F90 b/decode3.F90 index ff4279c5e..a21872873 100644 --- a/decode3.F90 +++ b/decode3.F90 @@ -78,10 +78,10 @@ subroutine decode3(d2,jz,istart,filename) call pix2d65(d2d,jz) else if(mode.eq.'FSK441') then nz=s2(1,1) - call pix2d(d2d,jz,mousebutton,mode,s2,64,nz,b) + call pix2d(d2d,jz,mousebutton,MouseDF,NFreeze,mode,s2,64,nz,b) else if(mode(1:4).eq.'JT6M' .and. mousebutton.eq.0) then nz=s2(1,1) - call pix2d(d2d,jz,mousebutton,mode,s2,64,nz,b) + call pix2d(d2d,jz,mousebutton,MouseDF,NFreeze,mode,s2,64,nz,b) endif ! Compute red and magenta cutves for small plot area, FSK441/JT6M only diff --git a/pix2d.f90 b/pix2d.f90 index 04656038e..26d6eefbc 100644 --- a/pix2d.f90 +++ b/pix2d.f90 @@ -1,4 +1,4 @@ -subroutine pix2d(d2,jz,mousebutton,mode,s2,nchan,nz,b) +subroutine pix2d(d2,jz,mousebutton,mousedf,nfreeze,mode,s2,nchan,nz,b) ! Compute pixels to represent the 2-d spectrum s2(nchan,nz), and the ! green line. @@ -111,6 +111,14 @@ subroutine pix2d(d2,jz,mousebutton,mode,s2,nchan,nz,b) b((ich-1)*500+j+248)=254 b((ich-1)*500+j+495)=254 enddo +! Insert green tick at frequency indicated by MouseDF + if(NFreeze.gt.0) then + f=1076.66+mousedf + ich=60-nint(f/43.066) !Why 58 for FSK441, above? + do j=1,7 + b((ich-1)*500+j+2)=255 + enddo + endif endif ! Mark the best ping with a red tick diff --git a/wsjt.py b/wsjt.py index 62fa592d8..564d12efd 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * diff --git a/wsjt1.F b/wsjt1.F index 732132b24..a214c3b83 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -218,10 +218,12 @@ C Intentionally degrade SNR by -nclip dB. if(jz/11025.0.lt.3.9 .or. sigma.lt.0.0) go to 900 f0=1076.66 - if(NFreeze.eq.1) f0=1076.66+mousedf + if(NFreeze.eq.1) f0=1076.66 + MouseDF + f00=f0 call syncf0(dat,jz,NFreeze,DFTolerance,jstart,f0,smax) call synct(dat,jz,jstart,f0,smax) call syncf1(dat,jz,jstart,f0,NFreeze,DFTolerance,smax,red) + if(NFreeze.gt.0 .and. abs(f0-f00).gt.float(DFTolerance)) go to 800 f0a=f0 do i=1,512 From ca3f1c4e04266ec906a0ceef1454330718bc9692 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 2 Aug 2006 20:09:22 +0000 Subject: [PATCH 172/811] Default settings for JT6M mode are Tol=200, Freeze On, MouseDF=0. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@232 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wsjt.py b/wsjt.py index 564d12efd..488c9d8be 100644 --- a/wsjt.py +++ b/wsjt.py @@ -593,9 +593,12 @@ def ModeJT6M(event=NONE): lsync.configure(text=slabel+str(isync)) shmsg.configure(state=DISABLED) cbfreeze.configure(state=NORMAL) - itol=5 + itol=3 + ltol.configure(text='Tol '+str(ntol[itol])) inctol() + nfreeze.set(1) ntx.set(1) + Audio.gcom2.mousedf=0 GenStdMsgs() erase() @@ -936,12 +939,15 @@ def defaults(): global slabel,isync,iclip,itol,idsec isync=1 if g.mode=="FSK441": isync=2 - if g.mode=="JT6M": isync=-10 lsync.configure(text=slabel+str(isync)) iclip=0 lclip.configure(text='Clip '+str(iclip)) itol=5 ltol.configure(text='Tol '+str(ntol[itol])) + if g.mode=="JT6M": + isync=-10 + itol=4 + ltol.configure(text='Tol '+str(ntol[itol])) #------------------------------------------------------ delwav def delwav(): From 72ff4c5f1b06916b76d89a922034c898c3261e36 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 2 Aug 2006 21:11:50 +0000 Subject: [PATCH 173/811] Broke a long line into two, for g77/g95. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@233 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 2 +- wsjt1.F | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wsjt.py b/wsjt.py index 488c9d8be..9b1830848 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#------------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * diff --git a/wsjt1.F b/wsjt1.F index a214c3b83..71c4213d6 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -223,7 +223,8 @@ C Intentionally degrade SNR by -nclip dB. call syncf0(dat,jz,NFreeze,DFTolerance,jstart,f0,smax) call synct(dat,jz,jstart,f0,smax) call syncf1(dat,jz,jstart,f0,NFreeze,DFTolerance,smax,red) - if(NFreeze.gt.0 .and. abs(f0-f00).gt.float(DFTolerance)) go to 800 + if(NFreeze.gt.0 .and. abs(f0-f00).gt.float(DFTolerance)) + + go to 800 f0a=f0 do i=1,512 From aa934877b0577c4ee4b118fd51d4d1ea79419494 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 3 Aug 2006 01:19:42 +0000 Subject: [PATCH 174/811] Corrected default setting of "S" in JT6M; cleaned up "About" message. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@234 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/wsjt.py b/wsjt.py index 9b1830848..0f84a33ed 100644 --- a/wsjt.py +++ b/wsjt.py @@ -646,13 +646,15 @@ def about(event=NONE): Label(about,text=t,font=(font1,16)).pack(padx=20,pady=5) t=""" WSJT is a weak signal communications program. It supports -four operating modes: FSK441, a fast mode for meteor scatter; -JT6M, specially optimized for meteor and ionospheric scatter -on 50 MHz; JT65, an extremely sensitive mode for troposcatter -and EME; and CW at 15 WPM with messages structured for EME. +four operating modes: -WSJT is Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, -with contributions from additional authors. It is Open Source + 1. FSK441 - fast mode for meteor scatter + 2. JT6M - optimized for meteor and ionospheric scatter on 50 MHz + 3. JT65 - for EME and troposcatter + 4. CW - 15 WPM Morse code, messages structured for EME + +Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, with +contributions from additional authors. WSJT is Open Source software, licensed under the GNU General Public License (GPL). Source code and programming information may be found at http://developer.berlios.de/projects/wsjt/. @@ -939,7 +941,6 @@ def defaults(): global slabel,isync,iclip,itol,idsec isync=1 if g.mode=="FSK441": isync=2 - lsync.configure(text=slabel+str(isync)) iclip=0 lclip.configure(text='Clip '+str(iclip)) itol=5 @@ -948,6 +949,7 @@ def defaults(): isync=-10 itol=4 ltol.configure(text='Tol '+str(ntol[itol])) + lsync.configure(text=slabel+str(isync)) #------------------------------------------------------ delwav def delwav(): From 0436e8467ab4527e13be213a165a761c7c72b304 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 3 Aug 2006 01:52:58 +0000 Subject: [PATCH 175/811] Oops! Put if() in the wrong place for the JT6M DF test. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@235 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 2 +- wsjt1.F | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/wsjt.py b/wsjt.py index 0f84a33ed..a6844ddb3 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------- WSJT +#------------------------------------------------------------------ WSJT from Tkinter import * from tkFileDialog import * diff --git a/wsjt1.F b/wsjt1.F index 71c4213d6..05c0e62bd 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -223,8 +223,6 @@ C Intentionally degrade SNR by -nclip dB. call syncf0(dat,jz,NFreeze,DFTolerance,jstart,f0,smax) call synct(dat,jz,jstart,f0,smax) call syncf1(dat,jz,jstart,f0,NFreeze,DFTolerance,smax,red) - if(NFreeze.gt.0 .and. abs(f0-f00).gt.float(DFTolerance)) - + go to 800 f0a=f0 do i=1,512 @@ -247,8 +245,14 @@ C Intentionally degrade SNR by -nclip dB. jz=jz-jstart+1 nslim=MinSigdB NFixLen=0 - call decode6m(dat(jstart),jz,cfile6,nslim,istart, - + NFixLen,lcum,f0,lumsg,npkept,yellow) + +C Call the decoder if DF is in range or Freeze is off. + if(NFreeze.eq.0 .or. + + abs(f0-f00).lt.float(DFTolerance)) then + call decode6m(dat(jstart),jz,cfile6,nslim,istart, + + NFixLen,lcum,f0,lumsg,npkept,yellow) + endif + if(npkept.eq.0) f0a=0. if(pick) then From 212b8de2855c7914e59f34d46bd835e0aa6035a4 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 3 Aug 2006 13:17:25 +0000 Subject: [PATCH 176/811] Fixed so that mouse-picking does not save a file if "Save none" was checked. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@236 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- decode3.F90 | 2 -- wsjt.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/decode3.F90 b/decode3.F90 index a21872873..deab3a777 100644 --- a/decode3.F90 +++ b/decode3.F90 @@ -1,4 +1,3 @@ - !---------------------------------------------------- decode3 subroutine decode3(d2,jz,istart,filename) @@ -67,7 +66,6 @@ subroutine decode3(d2,jz,istart,filename) filetokilla='' filetokillb='' endif - if(mousebutton.ne.0) filetokilla='' if(nsavelast.eq.1) filetokillb='' nsavelast=0 ierr=unlink(filetokillb) diff --git a/wsjt.py b/wsjt.py index a6844ddb3..8042f1b72 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -#------------------------------------------------------------------ WSJT +#---------------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * From 684cb2520373b352623b1cf8ccb3747d64855850 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 3 Aug 2006 15:32:03 +0000 Subject: [PATCH 177/811] Committed the new version of UpdateHistory.txt. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@237 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- UpdateHistory.txt | 143 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 140 insertions(+), 3 deletions(-) diff --git a/UpdateHistory.txt b/UpdateHistory.txt index 1e128fda8..37ce2ad6c 100644 --- a/UpdateHistory.txt +++ b/UpdateHistory.txt @@ -1,3 +1,141 @@ +Changes in WSJT 5.9.5 (r236): August 3, 2006 +--------------------------------------------- + +WSJT v5.9.5 r236 contains some major improvements for JT65 and a +number of smaller enhancements affecting other modes. + +1. Changes to the JT65 Deep Search decoder have made it slightly more + sensitive, on average. More importantly, the number of false + decodes has been dramatically reduced. JT65 decoding can be as + much as 3 times faster than before. For these reasons alone, you + should be sure to upgrade if you use JT65. + +2. A more useful menu of JT65 decoding options is provided. You may + now select "No Deep Search", "Normal Deep Search", "Aggressive Deep + Search", or "Include Average in Aggressive Deep Search". + +3. The two end-of-line numbers (formerly displayed only if Aggressive + was checked) are now always displayed in JT65 mode. The first + number is 1 if the Koetter-Vardy decoder succeeded, 0 otherwise. + The second number is the confidence level of the Deep Search + decoding (if enabled) on a 0 to 10 scale. + +4. The JT65 AFC function has been rewritten. Drifting signals + (including Doppler-induced drifts at 1296 MHz) will usually decode + better with AFC turned on. + +5. Mode JT65C, which is used primarily at 1296 MHz, has been improved + in several ways. Synchronizing is better by about 1 "sync" unit, + and signal strengths are measured more reliably. Decoding of + shorthand messages is improved. + +6. When compiled for Linux and FreeBSD (see note below), WSJT now + allows use of parallel as well as serial ports for T/R control. + +7. Wave files are now saved correctly in Linux and FreeBSD versions. + +8. Support has been added for extra-long callsigns such as + VU4AN/VU3RYF. The full augmented callsign must be no longer than + 12 characters. Enter the special add-on DXCC prefix or callsign + (in this case, VU4AN) on the Setup | Options page. + +9. If the "Grid" box on main WSJT window is blank, displayed values of + Doppler and df/dt will be those of your own echoes. + +10. If the ToRadio box is blank, "Mon_" (rather than "_" is now used + as the naming prefix for recorded wave files. + +11. The birdie-killing "Zap" feature has been changed so that if + Freeze is ON, nothing is zapped within Tol of the Freeze DF. In + addition, the Zap behavior no longer depends on previous decoding + history. + +12. Bug fix: previously, if Freeze had been checked while operating in + another mode, Zap no longer worked correctly in FSK441 mode. This + has been fixed. + +13. The selection of data for mouse-picked decodes in JT6M mode has + been corrected. (In recent versions it was necessary to click a + few seconds to the right of a signal enhancement.) + +14. The logic that limits search for JT6M synchronization to a range + of frequencies (+/- Tol around FreezeDF) has been corrected. A + small green tick at the left edge of the main graphical area + indicates the FreezeDF frequency. The FreezeDF value is also + displayed digitally in the status bar. You can change FreezeDF + with the left/right keyboard arrows. Default settings for JT6M are + now Tol=200, Freeze On, MouseDF=0. + +15. If mouse-picked decoding was invoked, all wave files were + previously saved even if "Save none" was selected on the menu. + This has been fixed. + +16. On your first start-up with version 5.9.5, be sure to re-enter + your correct PTT port number on the Setup | Options page. Under + Linux or FreeBSD, enter the appropriate device name, for example + /dev/ttyS0. + +Special note to Linux and FreeBSD users +--------------------------------------- + +WSJT is now being used by a number of people on Linux or FreeBSD +systems. Appearance and operational behavior is essentially identical +to the Windows version. At present you must compile the yourself for +Linix or FreeBSD. Instructions are available, and others who have +succeeded will help you if help is needed. This is not necessarily a +trivial task, however. + +Packaged versions of WSJT for specific *nix distributions may be +provided if there is sufficient demand. + +For more information on WSJT for Linux and FreeBSD, or if you want to +try compiling the program for Mac OS/X, contact the WSJT development +team at wsjt-devel@lists.berlios.de. + +WSJT is Open Source software. The source code and related materials +can be found at http://developer.berlios.de/projects/wsjt/. + + +Changes in WSJT 5.9.4 (r159): April 11, 2006 +--------------------------------------------- + +This is a maintenance release. + +1. Problems exhibited on some computers with dual or "hyperthreading" +CPUs have been fixed (or at least reduced, see below). + +2. Problems with reading previously recorded files (such as the sample +files in the WSJT tutorial) have been fixed. + +3. Bad data could cause an error message "Error in KV decoder, or no +KV decoder present" in the console window. Fixed. + +4. The delay between PTT assertion and start of Tx Audio, and the +delay between end of Tx Audio and release of PTT, have been increased +by 0.2 s. In addition, a bug in the T/R timing logic was fixed. + +5. There was a minor bug in computing the position of the moon. (The +displayed Az and El of the "home station" were correct for a time 100 +seconds earlier than the actual time.) This has been fixed. In +addition, refraction adjustments are no longer made in the Sun and +Moon elevations. + +6. A minor bug when displaying large negative Doppler shifts in the +file azel.dat has been fixed. + +7. As an aid to future development of WSJT, the program is now capable +of transmitting "test files" with arbitrary audio content. + +NOTE: If you have a computer with multiple CPUs or a CPU with +hyperthreading, and if WSJT 5.9.4 does not run properly for you, +please reboot your machine, enter the BIOS Setup screen, disable +hyperthreading, and see if WSJT then runs properly. Then let me know +the results of this test. Note: you will probably notice very little +(if any) degradation in performance by leaving hyperthreading turned +off. For now, this is the recommended procedure if you have problems +with it turned on. + + Changes in WSJT 5.9.3: January 26, 2006 --------------------------------------- This is a minor maintenance release. @@ -8,9 +146,8 @@ This is a minor maintenance release. 2. The occasional error message about "images do not match" has been trapped and should no longer occur. -3. Code that required one's own grid locator to be entered with first - two letters in upper case, last two in lower case, has been made - case insensitive (as it should have been). +3. It is no longer necessary to enter one's own grid locator with the + first two letters in upper case and the last two in lower case. 4. Initialization of the PTT line to the "OFF" state has been fixed. From 567f025d7b1d9821b5bac82a746d5b1a2b0de7f1 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 4 Aug 2006 13:20:56 +0000 Subject: [PATCH 178/811] New CALL3.TXT file from DL8EBW. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@238 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CALL3.TXT | 6000 +++++++++++++++++++++++++++-------------------------- wsjt.py | 2 +- 2 files changed, 3047 insertions(+), 2955 deletions(-) diff --git a/CALL3.TXT b/CALL3.TXT index 77cea156c..60d214ba9 100644 --- a/CALL3.TXT +++ b/CALL3.TXT @@ -1,1700 +1,1686 @@ -//CALL3.TXT agreed format for WSJT-PROGRAM by K1JT -//User-Version 2.14 02/05 WSJT-Excerpt of VHF-DATABASE © by DL8EBW -//(excluding extensions in calls eg. /p /a or exp.calls!) +//ms225_WSJT_CALL3 > CALL3.TXT format for WSJT-PROGRAMM by K1JT +//MS-EME-WSJT-Version 2.25 - 05/06 Every UPDATE will be very welcome 73 de Guy DL8EBW 2M0EXD,IO88FO,,,,,,04/04 +3A/PA2CHR,JN33RR,EME,,Expedition,,HF: IC706 Dipole - 144: TS850 LT2S 100W 2x5el,03/06 3B9C,MH10QG,EME,,,,,2003 -3V8BB,JM56ER,EME,,Clubstation,,,06/02 -4J1FS,KP40,,,,,,1990 -4K6D,LN40VK,EME,,vladimir,,,1994 -4N7AX,KN05PC,,,Zvezdan ""Zele",,144: 200 W 2x10el 9BVtx1500/rx3000lpm DSP,08/00 -4O4AR,JN94AS,,,Zdravko,,144: TR9130 250W 10el PA0MS-ant PreampUHER 15,11/02 +3V8BB,JM56ER,EME,,,,,06/02 +3V8SS,JM55GX,EME,,Expedition,,144: 16JXX and 1kw,12/05 +3Y0X,EC41RE,EME,,Expedition,,144: 4x 9el 350W,02/06 +4J1FS,KP40,,,Expedition,,,1990 +4N7AX,KN05PC,,,,,144: 200 W 2x10el 9BVtx1500/rx3000lpm DSP,08/00 +4O4AR,JN94AS,,,=YU4AR,,144: TR9130 250W 10el PA0MS-ant PreampUHER 15,11/02 4O4D,JN94BR,,,,,144: 300W 11el,05/97 -4U1ITU,JN36BF,EME,,Clubstation,,144: 8el 600W,11/00 -4X1IF,KM72KA,EME,,Ralph,,,2004 -4X4IF,KM72KD,EME,,Ralph,,,05/00 +4U1ITU,JN36BF,EME,,div. Activities,,144: 8el 600W,11/00 +4X/ZL1RS,KM71OS,EME,,= ZL1RS,,,01/06 +4X1IF,KM72KA,EME,,,,,07/05 4X6UJ,KM72,EME,,,,,2000 -4Z5AO,KM72MW,,,Leonid ""Leo",,,07/04 -4Z5BS,KM71JW,,,Oded,,,07/95 -5B4AGY,KM64EV,,,Iain,,FT-726R plus 1kW Linears and head amplifiers,01/05 -5B8AD,KM64TV,EME,,Alex,,,01/05 -5B8AV,KM64FT,,,Norman,,,05/04 -5C8M,IM64PD,EME,,BCC-Club,,144: IC706 MKIIG PA 1KW preamp. 2x 3WL yagis,10/00 -5T5JC,IL30AM,EME,,erich,,,1994 -5T5SN,IK28AC,EME,,nicolas,,,01/05 -5X1D,KJ60EM,EME,,"Gus"" Ragge,,300W- 17el,03/97 -6Y4A,FK18AA,EME,,OP: W3CMP,,144: 2x 2MXP28 cross pol ant. 1KW,10/00 -7J0AAD,PM97OS,EME,,Angela,,144: 1KW 4x19el 2x18el MGF1801.043.250,01/00 -7J6CCU,PL36VI,EME,,Eric,,50: TS570 or IC821,04/02 +4Z5AO,KM72MW,,,ex UA1AKZ,,ft-857 ic-746,07/05 +4Z5BS,KM71JW,,,,,,07/95 +5A7A,JM62,EME,,Expedition,,144: 2x 10el 7ZB 1KW - 432: 9wl ant 200W,11/06 +5B4AGY,KM64EV,,,ex G3RSI 5A3CAD VO2AN,,FT-726R plus 1kW Linears and head amplifiers,01/05 +5B8AD,KM64TV,EME,,,,144: 2x16 el 14.3dB 230w,03/05 +5B8AV,KM64FT,,,ex 5B/G1JJE,,,05/04 +5C8M,IM64PD,EME,,Expedition,,144: IC706 MKIIG PA 1KW preamp. 2x 3WL yagis,10/00 +5T5SN,IK28AC,EME,,,,,09/05 +5Z4NU,KI88IP,,,,,144: 25W 9el,09/05 +7J6CCU,PL36VI,EME,,,,50: TS570 or IC821,04/02 7K1MFR,PM95SP,,,,,,2003 -7K3LGC,QM06,EME,,,,,10/97 7L1RLL,PM95SO,,,,,,2003 -7M2PDT,QM05EK,EME,,Umezawa,,432: 16x14el 1-5KW,03/00 +7M2PDT,QM05EK,EME,,,,432: 16x14el 1-5KW,11/05 +7Q7JE,KH65UX,EME,,= ZS6JDE,,144: 7el 350W,03/06 +7S2AT,KP03DU,,,= SK2AT,,,03/06 7W0AD,JM16JR,,,,,,11/04 -7X0AD,JM16JR,,,Enrique,,144: 9el 200W,11/04 -7X2LS,JM16MT,,,Seghir,,,08/02 +7X0AD,JM16JR,,,,,144: 9el 200W,11/04 +7X2LS,JM16MT,,,,,,08/02 7X2VV,JM16WJ,,,,,,07/02 -8S4BX,JO79SD,EME,,OP SM4IVE,,,10/99 9A1AAX,JN65TF,,,,,144: 16el 500W,04/01 -9A1CAL,JN86EL,,,Clubstation,,144: IC271 FT736 FT225RD 4CX1500A 2x17el,11/04 +9A1CAL,JN86EL,,,,,144: IC271 FT736 FT225RD 4CX1500A 2x17el,11/04 9A1CBE,JN86BE,,,,,,96 -9A1CCB,JN85LN,,,9a7w@9a0tcp.ampr.org,,,03/01 -9A1CCY,JN85OO,EME,,Clubstation Jan Hus,,122,08/01 +9A1CCB,JN85LN,,,ex YU2CCB- YT2C,,,03/01 +9A1CCY,JN85OO,EME,,ex YU2CCY,,122,08/01 9A1CDD,JN85LW,,,,,,1991 -9A1CEU,JN75RO,EME,,OP 9A3ZA,,144: 80W 2x18el 5.5wl 4x11el - 432: 10W 38el,01/99 -9A1CHI,JN95JG,,,,,,94 +9A1CEU,JN75RO,EME,,,,144: 80W 2x18el 5.5wl 4x11el - 432: 10W 38el,01/99 +9A1CHI,JN95JG,,,ex YU2CHI,,,94 9A1CHL,JN83,,,,,,03/98 9A1CMS,JN86EL,,,,,,07/02 -9A1DFG,JN85EL,,,OP 9A3PA,,,07/96 -9A1EZA,JN86HG,EME,,OP 9A3AG Sasha,,IC271E 144: 2x4CX250b MGF1302 10mM2.087 3000,11/01 +9A1DFG,JN85EL,,,,,,07/96 +9A1EZA,JN86HG,EME,,ex YU2EZA,,IC271E 144: 2x4CX250b MGF1302 10mM2.087 3000,11/01 9A1KDE,JN95FQ,,,,,,1994 9A1RGC,JN75XT,,,,,,2003 -9A1Z,JN86FJ,,,Lucijan,,IC706 DB6NT 1W ON 3CMMSDSP,01/05 -9A2AE,JN86HF,,,Zvonko,,144: 8x24el 1KW,01/02 +9A1Z,JN86FJ,,,ex YU2SOM YT2SOM 9A3HZ,,IC706 DB6NT 1W ON 3CMMSDSP,01/05 +9A2AE,JN86HF,,,,,144: 8x24el 1KW,01/02 9A2AT,JN86LL,,,,,,2003 9A2DI,JN95,,,,,,06/95 9A2EU,JN85JO,,,,,,07/96 9A2GH,JN75IE,,,,,,2003 -9A2KK,JN85KV,,,Dusko,,,11/01 -9A2MK,JN75XU,EME,,branimir,,,1994 +9A2KK,JN85KV,,,,,,11/01 +9A2MK,JN75XU,EME,,,,,1994 9A2PT,JN86,EME,,,,,11/01 -9A2RD,JN65TF,,,Mario,,144: 2x16el 1KW,05/04 -9A2SB,JN95GM,,,,,,06/99 -9A2TE,JN85KK,,,,,,06/03 -9A2U,JN75RO,EME,,OP 9A3ZA,,144: 80W 2x18el 5.5wl 4x11el.082.215,01/99 +9A2RD,JN65TF,,,,,144: 2x16el 1KW,05/04 +9A2SB,JN95GM,,,ex YU2SB,,,06/99 +9A2TE,JN85KK,,,,,144: ft225rd ts690s 100w,03/06 +9A2U,JN75RO,EME,,,,144: 80W 2x18el 5.5wl 4x11el.082.215,01/99 9A2VR,JN95,,,,,,08/99 9A3DF,JN86HG,,,,,,04/03 -9A3JH,JN75AD,,,Andrea ""Andy",,,11/03 -9A3JI,JN86FJ,,,Filip /Bob/ Vadlja,,50: FT-101ZD+FTV650- IC706mk2g 7ele M2,05/02 -9A3MR,JN83FM,,,Roland,,only SSB-MS,08/00 -9A3PA,JN85EG,EME,,Mate,,FT736r - 50: 10W 5el - 144: 8x13el 800W M,08/04 +9A3JH,JN75AD,EME,,,,,01/06 +9A3JI,JN86FJ,,,= 9A4K,,50: FT-101ZD+FTV650- IC706mk2g 7ele M2,05/02 +9A3MR,JN83FM,,,,,only SSB-MS,08/00 +9A3PA,JN85EG,EME,,,,FT736r - 50: 10W 5el - 144: 8x13el 800W M,08/04 9A3TF,JN85,,,,,,08/96 9A3TU,JN95EH,,,,,,11/01 -9A3W,JN74OC,,,Radio Club Jadera,,IC706,09/02 -9A3ZA,JN75RO,,,Davor,,144: 100W 12el.082.215,08/00 -9A4C,JN85LN,,,OP: 9A7W,,,03/01 +9A3W,JN74OC,,,ex 9A1RKV,,IC706,09/02 +9A3ZA,JN75RO,,,,,144: 100W 12el.082.215,08/00 +9A4C,JN85LN,,,,,,03/01 9A4CK,JN86,,,,,,08/96 -9A4EW,JN95KG,EME,,Hrvoje,,144: 250W 10el- GaAsFet1200lpm,11/02 -9A4FW,JN95JG,EME,,Zeljko,,144: 600W 4x17el F9FT MGF1302DTR 1200lpm,08/00 -9A4K,JN86FJ,,,Filip /Bob/ Vadlja,,50: FT-101ZD+FTV650- IC706mk2g 7ele M2,05/02 -9A4NF,JN73VS,,,Damir,,144: 300W LNA 2x16el yagis2500lpm,01/01 +9A4EW,JN95KG,EME,,,,144: FT-290R II preamp BF-966S pwr 250 watt,08/05 +9A4FW,JN95JG,EME,,,,144: 600W 4x17el F9FT MGF1302DTR 1200lpm,08/00 +9A4K,JN86FJ,,,= 9A3JI,,50: FT-101ZD+FTV650- IC706mk2g 7ele M2,05/02 +9A4NF,JN73VS,,,,,144: 300W LNA 2x16el yagis2500lpm,01/01 9A4VM,JN85VS,,,,,,11/02 9A4WY,JN74,,,,,144: 50W,08/98 -9A5D,JN92BP,,,,,,08/99 -9A5WA,JN85LN,,,Max,,,06/96 -9A5Y,JN85OO,,,Ops of 9A1CCY,,144: 800W 16x5el,10/99 -9A6WW,JN86EL,,,Zvonko,,144: IC271 FT736 FT225RD 4CX1500A 2x17el,12/99 -9A7W,JN85LN,,,Ogi,,,01/02 -9A90CBD,JN85OO,EME,,Clubstation Jan Hus,,.122 1200lpm,07/97 +9A5D,JN92BP,,,Expedition,,,08/99 +9A5WA,JN85LN,,,,,,06/96 +9A5Y,JN85OO,,,Specialcall,,144: 800W 16x5el,10/99 +9A6WW,JN86EL,,,,,144: IC271 FT736 FT225RD 4CX1500A 2x17el,12/99 +9A7W,JN85LN,,,ex YU2QS,,,01/02 +9A90CBD,JN85OO,EME,,Special Call,,.122 1200lpm,07/97 9A9B,JN75XU,,,,,,2003 -9H1BN,JM75GU,EME,,Mark,,,09/99 -9H1BT,JM75EU,EME,,Paul,,,1994 -9H1CD,JM75FV,EME,,Henry G.,,144: TS850 LT2S 1KW 2x4.4lb DJ9BV MGF1302,01/01 -9H1CG,JM75,,,Joe,,144: FT902DM FTV250 100W 17el.132,11/01 -9H1ES,JM75FV,EME,,Fortunato,,,09/99 -9H1GB,JM75FU,EME,,Mantsueto ""Mans",,144: TS780 100W 19elDTR 3000lpm,08/03 -9H1PA,JM75FV,EME,,Philip,,144: TS711 4x10el (3wl) crossed yagi GS35bMSD,01/01 -9H1PI,JM75FU,,,Ivan,,50: 100W 5el,03/03 -9H1TX,JM75FU,,,David,,50: 8el yagi 100W - 144: 150 W 2x4wl xpol310,12/04 -9H1XT,JM75GV,,,John,,,08/02 -9H3LF,JM76,,,,,,1991 -9H3ZZ,JM76CB,EME,,OPs DL5MAE-DL6RAI,,,1993 -9M2BV,OJ30UD,EME,,mart,,,1994 -A22BW,KG38SU,EME,,lothar,,,1994 +9H1BT,JM75EU,EME,,,,,1994 +9H1CD,JM75FV,EME,,NOT qrv MS nw (01/01),,144: TS850 LT2S 1KW 2x4.4lb DJ9BV MGF1302,01/01 +9H1CG,JM75,,,,,144: FT902DM FTV250 100W 17el.132,11/01 +9H1GB,JM75FU,EME,,,,144: TS780 100W 19elDTR 3000lpm,08/03 +9H1PA,JM75FV,EME,,,,144: TS711 4x10el (3wl) crossed yagi GS35bMSD,01/01 +9H1PI,JM75FU,,,ex 9H5PI,,50: 100W 5el,03/03 +9H1TX,JM75FU,EME,,,,50: 8el yagi 100W - 144: IC7400 GS35 1000 W 2,03/06 +9H1XT,JM75GV,,,,,,08/02 +9H3LF,JM76,,,Expedition,,,1991 +9H3ZZ,JM76CB,EME,,Expedition,,,1993 +9J2JD,KH46MM,EME,,Expedition,,144: 2M7 antenna,05/06 +A6/RV6LNA,LL75,EME,,QSL via UA6MF,,144: single yagi 200W,08/05 AA0BR,DN70KN,,,,,,2003 AA0BW,EM29PS,,,,,,04/03 AA0DQ,EN12,,,,,,2003 AA0EN,EM29,,,,,,2003 AA0P,DM79,,,,,,2003 -AA1OV,FN43GE,,,Mark,,,04/03 -AA1VL,FN42HN,,,Chris,,,04/03 -AA1YN,FN43GC,EME,,Lee,,,2004 +AA1OV,FN43GE,,,,,,04/03 +AA1VL,FN42HN,,,,,,04/03 +AA1YN,FN43GC,EME,,,,144: 4x 16el 400W,10/05 AA2GF,FN02,,,,,,2003 -AA3NM,FM19JE,,,Steve,,,2003 -AA4FQ,EM67LQ,EME,,JEFF,,1500W,01/05 +AA2WV,FN12BV,EME,,,,144: 4x 17el 350W,04/06 +AA3NM,FM19JE,,,,,,2003 +AA4FQ,EM67LQ,EME,,,,1500W,01/05 AA5C,EM13SE,,,,,,2003 AA5CH,EM35GK,,,,,,2003 AA5IB,EM12,,,,,,2003 AA5WL,EM32,,,,,,2003 AA5WQ,EM26BC,,,,,,2003 AA6GS,DM12,,,,,,2003 -AA6HA,DM43CN,,,John,,144: 500W 9el M2,01/01 +AA6HA,DM43CN,,,,,144: 500W 9el M2,01/01 AA6IW,CM97VI,,,,,,2003 AA6WI,CM97,,,,,,2003 -AA7A,DM43AO,EME,,Ned,,144: 8877 1-5KW 6x13el (DJ9BV),01/05 +AA7A,DM43AO,EME,,,,144: 8877 1.5KW 6x13el (DJ9BV),04/05 AA8BC,EN90FE,,,,,,2003 AA8HS,EN81,,,,,,2003 -AA9D,EN52,,,Dave,,,01/01 +AA9D,EN52,,,,,,01/01 AA9IL,EN62AI,,,,,,2003 -AA9MY,EN50FM,EME,,Bob,,Yaesu 847 IC910H IC706MKIIG,02/05 +AA9MY,EN50FM,EME,,,,144: Yaesu 847 IC910H IC706MKIIG 2x 18XXX M,11/05 AB0SD,EN30LL,,,,,,2003 -AB0TJ,DN60FN,,,Alex,,,2003 -AB3BK,FN10,,,,,,02/05 +AB0TJ,DN60FN,,,,,,2003 +AB3BK,FN10PD,EME,,,,144: 13b2 350W,04/06 AB4CR,EM77,,,,,,2003 -AB4OO,EM81,,,Vance,,,1998 -AB5F,EM46FG,,,Paul,,,2004 +AB4OO,EM81,,,,,,1998 +AB5F,EM46FG,,,,,,2004 AB5IG,EM12,,,,,,2003 AB9FN,EN53,,,,,,2003 -AC1H,FN33XJ,,,Ken,,144: 300W 13dbD yagi,01/01 +AC1H,FN33XJ,,,,,144: 300W 13dbD yagi,01/01 AC1T,FN32,,,,,,2003 -AC3A,EM28QV,EME,,Scott E.,,144: 4x 9el M2 8877 1-5KW,05/03 AC4TO,EM70,,,,,,02/05 -AC5OG,EM10,,,,,,2003 -AD4EB,EM65NS,,,Jim,,,2003 -AD4TJ,FM08LE,,,David,,10el Quagi 160Watt,01/04 +AC5OG,EM10,EME,,,,,03/05 +AC5TM,EM40LL,EME,,,,144: 2M5 400W,03/05 +AD4EB,EM65NS,,,,,,2003 +AD4TJ,FM08LE,EME,,,,IC706 144: 2x 12el K1FO 160Watt,03/06 AD6A,CM97AG,,,,,,2003 -AD6FP,CM87WI,EME,,,,,2004 AD6P,EM18,,,,,,2003 AE0G,EN10PS,,,,,,2003 AE0W,DM78,,,,,,2003 -AE4RO,EL97TG,,,Tom,,,09/01 +AE4RO,EL97TG,,,,,,09/01 AE5K,EM36PC,,,,,,2003 -AF1T,FN43ED,EME,,DALE,,,01705 AF4O,EM55LK,,,,,,2003 -AF6O,DM14EJ,,,,,,2003 -AF9R,EN52XB,,,Dan,,,2003 -AG2A,FN30FR,,,Tom,,,2003 -AG4QE,FM04KX,,,Timothy,,,2003 -AG9Y,EN40,,,Joe,,144: 160W 13el,01/01 -AH6EZ,EN51SW,,,Dick,,,12/01 +AF6O,DM14EJ,EME,,ex G3PRM,,144: 4x 2M12 800W - 432: 4x 9wl 1500W,01/06 +AF9R,EN52XB,,,,,,2003 +AG2A,FN30FR,,,,,,2003 +AG4QE,FM04KX,,,,,,2003 +AG9Y,EN40,,,,,144: 160W 13el,01/01 +AH6EZ,EN51SW,,,,,,12/01 AH6LE,CN85NK,,,,,,2003 AH8A,AH45OP,,,,,,2003 AI1K,FN41IL,,,,,,2003 -AI3W,FM19PW,,,Rick,,,2004 +AI3W,FM19PW,,,,,,2004 AI8Z,DM79,,,,,,2003 AJ0E,EM29RD,,,,,,2003 -AJ6T,CM87XG,,,Walter E. ""Walt",,144: 200W 10el,08/03 -AL7EB,BP40IQ,EME,,Edward R.,,144: 4xpol-20el M2 170w,01/05 -AM25DXU,JN11CM,EME,,Op Jose Maria,,,1992 -AN6SA,JM19IR,EME,,Josep,,144: FT847 2x4CX250 2x17el - 432: 4x33el,01/01 +AJ6T,CM87XG,,,,,144: 200W 10el,08/03 +AM25DXU,JN11CM,EME,,SpecialCall,,,1992 +AN6SA,JM19IR,EME,,SpecialCall,,144: FT847 2x4CX250 2x17el - 432: 4x33el,01/01 BY1QH,ON80DA,,,,,,2003 -C31MS,JN02UN,,,DC9KZ- DF7KF- DL8EBW,,144: 2Stn a´ 800W 2x17el or 11el.119 DTR,05/97 -C31RC,JN02SK,EME,,,,,1989 -C31TLT,JN02TL,EME,,OP I5WBE EA3BB,,144: 4x24el 2x4CX250 900W,08/01 -C4N,KM64tv,EME,, +C31MS,JN02UN,,,Expedition,,144: 2Stn a´ 800W 2x17el or 11el.119 DTR,05/97 +C31RC,JN02SK,EME,,Expedition,,,1989 +C4N,KM64TV,EME,,SpecialCall,,144: 2x16 el 14.3dB 230w,10/05 +C6AIE,FL16IQ,EME,,= WZ8D,,144: TS2000 250W 13el,03/06 CN8KD,IM63KX,,,,,144: 10W 11el,06/03 -CN8LI,IM63NX,,,Said,,50: IC706 6el Mast Mount 20db preamp- 144: 2,08/04 -CN8ST,IM64NA,EME,,Tarrik,,,06/98 -CO2OJ,EL83TD,,,OP: Oscar,,50: 100W 4el - 144: 110W 9el,08/01 -CQ14HZE,IM57NH,,,Joachim ""Joe",,,02/04 -CS0DIZ,IM69,,,,,,1989 -CS1GDX,IM59IB,,,OP: CT1EKD,,144: IC706MK II G 200W 12el,11/03 -CS6ARC,IM59RX,,,OP CT1FOH,,,11/01 -CT1ANO,IN51RE,,,Pinto,,144: TS2000 250Watt 2x10el MGF1302 - 432: TS,02/05 -CT1DHM,IN61CC,,,Jose,,,05/02 -CT1DIZ,IM58KP,,,Alex,,,06/03 -CT1DMK,IN50QP,EME,,Luis,,144: 1-5KW 4x11el DL6WUDTR,03/99 -CT1DNF,IN50QP,,,Pedro Filipe,,144: IC821H 200Watts 2x12ele DL6WU Preamp,12/04 -CT1DYX,IN51QD,,,Pedro Miguel,,IC970H 50: 100W 4el - 144: 100W 17el MGF1302,06/03 -CT1EKD,IM59IB,,,Pedro,,144: IC706 MK II G 200W 12el,11/03 -CT1EPS,IM57XC,,,Joe,,144: FT480 2x17el 200W MGF1302only SSB-MS.,04/03 -CT1FAK,IN50QO,EME,,Rui,,144: FT1000D FT736R 200W 4x13el DL6WU MGF,05/03 -CT1FOH,IN50RA,,,Paulo,,50: 6el - 144: 200W 4x 12el MGF1302120 MSDSP,04/04 -CT1HZE,IM57NH,,,Joachim ""Joe",,,02/04 -CT1WW,IN61GE,,,Tiago,,,11/96 -CT2FEY,IN61NS,,,Paulo,,,11/03 -CT2HSN,IN61CC,,,Carlos,,,08/01 -CT2HSO,IN61CC,,,Luis,,,08/01 -CT2IET,IN60GD,,,Frederico,,FT100D,11/02 -CT2IWG,IN51OJ,,,Sergio,,144: IC706 100W 9el,02/05 -CT4KQ,IN60BP,,,Serafim,,DTR+,03/98 +CN8LI,IM63NX,EME,,,,50: IC746 250W 6el Mast Mount 20db preamp- 14,04/06 +CN8ST,IM64NA,EME,,QRT (is nw PA....),,,06/98 +CN8TW,IM63EN,EME,,,,144: 4x 13el,01/06 +CO2OJ,EL83TD,,,,,50: 100W 4el - 144: 110W 9el,08/01 +CQ14HZE,IM57NH,,,Specialcall,,,02/04 +CS0DIZ,IM69,,,Specialcall,,,1989 +CS1GDX,IM59IB,,,SpecialCall,,144: IC706MK II G 200W 12el,11/03 +CS6ARC,IM59RX,,,SpecialCall,,,11/01 +CT1ANO,IN51RE,,,,,144: TS2000 250Watt 2x10el MGF1302 - 432: TS,02/05 +CT1DHM,IN61CC,,,,,,05/02 +CT1DIZ,IM58KP,,,,,,06/03 +CT1DMK,IN50QP,EME,,,,144: 1-5KW 4x11el DL6WUDTR,03/99 +CT1DNF,IN50QP,,,,,144: IC821H 200Watts 2x12ele DL6WU Preamp,12/04 +CT1EKD,IM59IB,,,,,144: IC706 MK II G 200W 12el,11/03 +CT1FAK,IN50QO,EME,,,,144: FT1000D FT736R 200W 4x13el DL6WU MGF,05/03 +CT1FFU,IM59KJ,EME,,,,,03/05 +CT1FOH,IN50RA,,,,,50: 6el - 144: 200W 4x 12el MGF1302120 MSDSP,04/04 +CT1HZE,IM57NH,,,= DL8HCZ,,,12/05 +CT1WW,IN61GE,,,Silent Key,,,11/96 +CT2FEY,IN61NS,,,,,,11/03 +CT2HSN,IN61CC,,,,,,08/01 +CT2HSO,IN61CC,,,,,,08/01 +CT2IET,IN60GD,,,,,FT100D,11/02 +CT2IWG,IN51OJ,,,,,144: IC706 100W 9el,02/05 +CT3/DL1YMK,IM12,EME,,Expedition,,,06/06 +CT3/SV8CS,IM12NT,EME,,Expedition,,144: TS2000 16el JXX 350W,10/05 +CT4KQ,IN60BP,,,,,DTR+,03/98 CU2IJ,HM77ES,,,,,,04/04 CX9BT,GF15WK,,,,,,2003 -CY9SS,FN97WE,EME,,,,144: 400W single yagi,01/05 -DA0BV,JN58VF,,,clubstation,,DTR,1994 -DA0NRW,JO41GV,,,Clubstation,,144: 3CX400A7 4x14el or 17el,12/96 -DA0WAE,JO41GU,,,OP DK3EE,,,12/04 -DA4RG,JO31FG,,,Reg,,,11/95 -DB1OMA,JO42RK,,,Joerg,,,01/03 +DA0BV,JN58VF,,,Specialcall,,DTR,1994 +DA0NRW,JO41GV,,,Specialcall,,144: 3CX400A7 4x14el or 17el,12/96 +DA0WAE,JO41GU,,,SpecialCall,,,12/04 +DA4RG,JO31FG,,,= GW8VHI,,,11/95 +DB1OMA,JO42RK,,,,,,01/03 DB1PB,JO30UE,,,,,,12/01 -DB2WD,JN39VV,EME,,Jens,,SSB only.280,04/96 -DB3BW,JO42AC,,,Hans-Jürgen,,HF: TS520 - 144/432: FT726r,04/04 +DB3BW,JO42AC,,,,,HF: TS520 - 144/432: FT726r,03/05 DB3LA,JO31JK,,,,,,07/02 -DB4ET,JO31,,,Klaus,,,11/02 -DB4LL,JO54SM,,,Nikolausi,,144: FT221 20W 4el.010.300,08/01 -DB4VQ,JN39MF,,,Günther,,,1994 -DB5ML,JN58OI,,,Michael,,only SSB-MS,09/03 -DB5WC,JN49EJ,,,Gerd,,60W 11el Preamp.250,12/03 -DB6BX,JO32OK,,,,,,11/96 +DB4ET,JO31,,,,,,11/02 +DB4LL,JO54SM,,,,,144: FT221 20W 4el.010.300,08/01 +DB4VQ,JN39MF,,,,,,1994 +DB5ML,JN58OI,,,,,only SSB-MS,09/03 +DB5WC,JN49EJ,,,,,60W 11el Preamp.250,12/03 +DB6BX,JO32OK,,,SilentKey,,,11/96 DB6NT,JO50UI,,,,,,2003 -DB6RO,JN58QB,,,Gerd,,,12/03 -DB7OB,JO52IJ,,,Gerd,,144: FT221 100W 11elonly SSB-MS,08/00 +DB6RO,JN58QB,,,,,,12/03 +DB7OB,JO52IJ,,,,,144: FT221 100W 11elonly SSB-MS,08/00 DB8AT,JO51CP,,,,,,05/04 -DB8WK,JO33XN,,,Hinni,,144: 200W 13el - 432: 200W 20el,01/03 -DB8YL,JO41EV,,,Sabine,,,12/99 +DB8WK,JO33XN,,,,,144: 200W 2x11El. - 432: 300W 2x23El.,03/06 +DB8YL,JO41EV,,,,,,12/99 DC1ECD,JO31MH,,,,,,10/04 DC1MUS,JN69EP,,,,,,11/02 -DC2JR,JO64CA,,,Klaus,,,11/01 -DC3QB,JO41IV,,,,,,01/05 -DC3VM,JN39KK,,,Alfred,,,12/99 -DC3VW,JN39KJ,,,Guenther,,only SSB-MS,10/04 +DC1MWB,JN58,,,,,,04/05 +DC2JR,JO64CA,,,,,,11/01 +DC3VM,JN39KK,,,,,,12/99 +DC3VW,JN39KJ,,,,,only SSB-MS,10/04 DC3ZR,JN68CV,,,,,,01/03 -DC6DY,JO31OK,,,anton,,only SSB-MS,1994 -DC6GF,JN48OC,,,Christoph,,IC 706 MKIIG PreAmp,01/05 -DC6KI,JO30IL,,,Wolfgang,,DTR,04/03 -DC6RN,JN59WK,,,Norbert,,144: 2x12el 160W,04/03 -DC7OH,JO62OK,,,Eric,,DTR 2000lpm,01/01 -DC7UT,JO31NJ,EME,,Horst,,144: 4x17el 500WDTR,03/01 -DC9KZ,JO30JW,,,Angelo,,only SSB-MS,09/01 -DC9YC,JO31PJ,,,Dieter,,,05/03 -DD0VF,JO61WB,,,Steffen,,144: 550W 4x7el MGF1303 (JO61WA: 100W 5el BF9,03/04 -DD1JN,JO50DJ,,,Karsten,,144: 600W 11el Preamp - 432: 21el 200W VV - 1,04/02 -DD1WKS,JN39KK,,,Wolfgang,,,01/01 +DC6DY,JO31OK,,,NOT qrv MS nw (01/01),,only SSB-MS,1994 +DC6GF,JN48OC,,,,,IC 706 MKIIG PreAmp,01/05 +DC6GF/P,JN47NX,,,,,IC 706 MKIIG PreAmp 2x17el (OP at DL0HEU),01/05 +DC6KI,JO30IL,,,NOT qrv MS nw (01/01),,DTR,04/05 +DC6RN,JN59WK,,,,,144: 2x12el 160W,04/03 +DC7OH,JO62OK,,,,,DTR 2000lpm,01/01 +DC7UT,JO31NJ,EME,,,,144: 4x17el 500WDTR,03/01 +DC9KZ,JO30JW,,,NOT qrv MS nw (01/01),,only SSB-MS,09/01 +DC9YC,JO31PJ,,,,,,05/03 +DD0VF,JO61WB,,,,,144: 550W 4x7el MGF1303 (JO61WA: 100W 5el BF9,03/04 +DD1JN,JO50DJ,,,,,144: 600W 11el Preamp - 432: 21el 200W VV - 1,04/02 +DD1WKS,JN39KK,,,,,,01/01 DD2UJ,JO61WD,,,,,,10/04 -DD3DX,JO31TN,,,Christian,,only SSB-MS,07/01 -DD3SP,JO72EN,,,Sandro,,50: 5el - 144: FT847 4CX250 17el F9FT MGF1,02/04 -DD5DX,JO61CA,,,Alexander,,144: 180Watt 2x17el Preamp333,07/04 -DD6UBS,JO41AH,,,Stefan,,144: TM255 MGF1302 180W 11El F9FT - 432: TM45,10/04 -DD9SQ,JN59BH,,,Martin,,,07/98 +DD3DX,JO31TN,,,,,only SSB-MS,07/01 +DD3SP,JO72EN,,,,,50: 5el - 144: FT847 4CX250 17el F9FT MGF1,02/04 +DD5DX,JO61CA,,,,,144: 180Watt 2x17el Preamp333,07/04 +DD6UBS,JO41AH,,,,,144: TM255 MGF1302 180W 11El F9FT - 432: TM45,10/04 +DD7PC,JN49AX,EME,,,,IC-275H PA D200s 200-500W 144: 11el 432: 1,04/06 +DD9SQ,JN59BH,,,,,,07/98 DF0AK,JN49EA,,,,,,07/97 -DF0BV,JN68AH,EME,,BCC,,144: 2x17el 750WDTR,12/99 -DF0CI,JO51CH,,,Cubstation,,,11/03 +DF0BV,JN68AH,EME,,,,144: 2x17el 750WDTR,04/05 +DF0CI,JO51CH,,,,,,11/03 +DF0CK,JO50AN,EME,,= DK0R,,144: 500Watt 2x11el,09/05 DF0EME,JO40,,,,,,2003 -DF0LBO,JO53CT,,,Clubstation OP:DK1KO,,,05/02 -DF0MMO,JN49JX,,,OP DH4FAJ- Matthias,,144: 200W 11el,11/00 -DF0MTL,JO61JF,,,Clubstation,,,12/98 -DF0SAX,JO61VC,,,Clubstation,,144: 20W 13el,12/98 -DF0WD,JO42FD,,,Clubstation,,144: 8874 250W 2x9el - 432: 3CX800 4x18elDTR,05/03 +DF0LBO,JO53CT,,,,,,05/02 +DF0MMO,JN49JX,,,,,144: 200W 11el,11/00 +DF0MTL,JO61JF,,,,,,07/05 +DF0SAX,JO61VC,,,,,144: 20W 13el,12/98 +DF0WD,JO42FD,,,,,144: 8874 250W 2x9el - 432: 3CX800 4x18elDTR,05/03 DF0WF,JO62VT,,,,,,01/05 -DF1AN,JO63SX,,,,,,01/00 -DF1BN,JO31GD,,,Paul-Eduard ""Paulus",,144: IC821 HLV-300 300Watts MGF 1302 2x17e,07/01 -DF1CF,JN57FP,EME,,Jürgen,,144: CF300 3CX800 4x13el (3lb)133 1500lpm38,12/04 -DF1GL,JN47CO,,,Joachim,,144: IC 910 100W 9 el,11/04 -DF1HF,JO43VL,,,Andreas,,144: 2x6el,02/00 -DF1IAZ,JN49LD,,,Ralf,,50: 3 el - 144: 150W 2x10el MGF1302154 300,07/01 -DF1OC,JO52,,,T.,,,1993 -DF1SO,JN48PO,,,Dieter,,144: homemade 200WDTR,08/98 -DF1VB,JO31RM,,,Jochen,,,05/04 -DF1ZE,JN49,EME,,Michael,,,1994 +DF1AN,JO63SX,,,ex DL1KUS,,,01/00 +DF1BN,JO31GD,,,,,144: IC821 HLV-300 300Watts MGF 1302 2x17e,07/01 +DF1CF,JN57FP,EME,,,,144: CF300 3CX800 4x13el (3lb)133 1500lpm38,12/04 +DF1GL,JN47CO,EME,,,,144: IC 910 700W 10el,03/06 +DF1HF,JO43VL,,,,,144: 2x6el,02/00 +DF1IAZ,JN49LD,,,,,50: 3 el - 144: 150W 2x10el MGF1302154 300,07/01 +DF1OC,JO52,,,,,,1993 +DF1SO,JN48PO,,,,,144: homemade 200WDTR,08/98 +DF1VB,JO31RM,,,,,,05/04 +DF1ZE,JN49,EME,,,,,1994 DF2CQ,JN58SE,,,,,,10/04 -DF2OOO,JO41RF,,,OP DL3ZBA,,IC820H 144: 250W 2x11el- 432: 130W 2x23el Pr,09/99 +DF2OOO,JO41RF,,,Special Call,,IC820H 144: 250W 2x11el- 432: 130W 2x23el Pr,09/99 DF2UJ,JO61QH,,,,,,02/02 -DF2ZC,JO30RN,EME,,Bernd J.,,144: TS2000 LT2S 2xGU74b 750W MGF1302 4x2M18X,12/04 +DF2ZC,JO30RN,EME,,,,144: TS2000 LT2S 2xGU74b 750W MGF1302 4x2M18X,08/05 DF3FJ,JO40CC,,,,,,1993 -DF3RU,JN59VL,EME,,Karl,,,1993 -DF4LY,JO44SM,EME,,Manfred,,144: 160el Col. 4CX2501000lpm,12/96 -DF4MAA,JN58WH,EME,,Wolfgang,,,05/97 -DF4UE,JN48RR,,,John,,432: 4x27el 600W,09/03 -DF5BN,JN49GU,,,Walter,,,08/99 -DF5DE,JO40CX,,,K.O.,,,10/04 -DF5JJ,JO43XO,,,Peter,,432: 700W 19el - 1296: 500W 26el - 10368: 20,03/04 -DF5NK,JN59PM,,,Frank,,50: FT857 4el - 144: 600W 11el - 432: 500W 19,02/04 +DF3RU,JN59UL,EME,,,,,03/05 +DF4LY,JO44SM,EME,,,,144: 160el Col. 4CX2501000lpm,12/96 +DF4MAA,JN58WH,EME,,,,,05/97 +DF4UE,JN48RR,,,,,432: 4x27el 600W,09/03 +DF5BN,JN49GU,,,,,,08/99 +DF5DE,JO40CX,,,,,,10/04 +DF5HC,JN49HT,EME,,,,144: 4x8Ele 500W - 432: 4x17Ele 50W,03/06 +DF5JJ,JO43XO,,,ex EA6/DF5JJ + ex EA6ADW,,432: 700W 19el - 1296: 500W 26el - 10368: 20,03/04 +DF5KB,JO72CM,,,ex DD6BKR,,FT847 - 144Mhz 750 wtts 17 el Tonna - 50Mhz,03/06 DF6HT,JO53AH,,,,,,2003 -DF6LO,JO52CE,,,matthias,,,1993 -DF6NA,JN49XS,,,Rainer,,432: 2x3CX800 4x30elDTR rx1500tx2000lpm,10/01 -DF6OB,JO42,,,Matthias,,,07/97 -DF6VW,JO42KH,,,Ralf,,,07/97 -DF6YL,JO31WS,EME,,Peter,,,10/04 -DF7DJ,JO31UO,,,Herbert,,.153,06/97 +DF6LO,JO52CE,,,,,,1993 +DF6NA,JN49XS,,,,,432: 2x3CX800 4x30elDTR rx1500tx2000lpm,10/01 +DF6OB,JO42,,,NOT qrv MS nw (01/01),,,07/97 +DF6VW,JO42KH,,,,,,07/97 +DF6YL,JO31WS,EME,,,,,10/04 +DF7DJ,JO31UO,,,,,.153,06/97 DF7IF,JN48DN,,,,,,2003 -DF7IT,JN49IN,,,Volker,,,10704 -DF7KF,JO30GU,EME,,Dithmar,,144: 16x18el EME PwrDTR+ 3000lpm,12/04 -DF7OG,JO52BN,,,Klaus,,144: TS770E 4x150 16el,04/04 -DF7RG,JN68HG,EME,,Georg (Op DK0OG),,DTR+ 3000lpm,01/05 -DF8AA,JO60XX,,,Wolfgang,,144: 100W 17el.132,12/99 -DF8AE,JO41GX,,,rudi,,,10/04 -DF8IK,JO30JT,,,Hans-Peter ""Peter",,144: 300W 11el 432: 400W 27elDTR 2500lpm,01/04 -DF8LC,JO53GX,EME,,Lothar,,,08/99 -DF9CY,JO54AL,EME,,Christoph,,144: IC820 9el DK7ZB D200 550W Preamp,11/04 +DF7IT,JN49IN,,,,,,10704 +DF7KF,JO30GU,EME,,,,144: 16x18el EME PwrDTR+ 3000lpm,12/04 +DF7OG,JO52BN,,,,,144: TS770E 4x150 16el,04/04 +DF7RG,JN68HG,EME,,,,DTR+ 3000lpm,01/05 +DF8AA,JO60XX,,,ex DL2VAA,,144: 100W 17el.132,12/99 +DF8AE,JO41GX,,,,,,10/04 +DF8IK,JO30JT,,,,,144: 300W 11el 432: 400W 27elDTR 2500lpm,01/05 +DF8LC,JO53GX,EME,,,,,08/99 +DF8PC,JO43RS,EME,,,,144: 100W 16el M2,03/06 +DF9CY,JO54AL,EME,,,,144: IC820 9el DK7ZB D200 550W Preamp,11/04 DF9IJ,JN48CX,,,,,,2003 DF9KT,JO30GU,,,,,.167 DTR+.167,11/95 -DF9KX,JO30FQ,EME,,Rolf,,FT1000 144: LT2S 3CX800A7 Preamp 2x17ele M2,03/04 -DF9PX,JN47QT,,,Horst,,144: IC706 180W 2x10el Preamprx2000tx1200lpm,07/01 -DF9QT,JO30OR,,,Klaus,,144: 700W 11el MGF1302DTR 2000lpm,01/05 -DF9QX,JO42HD,EME,,matthias,,,1994 -DF9YF,JO42GE,,,Uli,,,12/03 -DG0CAL,JO31,,,Ullrich,,,06/00 -DG0FE,JO62UN,EME,,Lothar,,FT 736r 144: 100W 4x17el - 432: 2x21el - 129,07/03 +DF9KX,JO30FQ,EME,,,,FT1000 144: LT2S 3CX800A7 Preamp 2x17ele M2,03/04 +DF9PX,JN47QT,,,,,144: IC706 180W 2x10el Preamprx2000tx1200lpm,07/01 +DF9QT,JO30OR,,,,,144: 700W 11el MGF1302DTR 2000lpm,07/05 +DF9QX,JO42HD,EME,,,,,1994 +DF9YF,JO42GE,,,,,,12/03 +DG0CAL,JO31,,,,,,06/00 DG0KU,JO64AC,,,,,,01/03 -DG0KW,JO64MH,EME,,Klaus,,144: 2x 13el,01/05 -DG0OPK,JO50GG,,,Michael,,50: 5W - 144: 150W - 432: 100W - 1296: 35W -,12/04 -DG0TU,JO61TU,,,Op LZ1DP,,,08/97 +DG0KW,JO64MH,EME,,,,144: 2x 13el,01/05 +DG0OPK,JO50GQ,EME,,,,50: 20W Dipol - 144: 500W 500Watt 7/13El BF98,04/06 +DG0TU,JO61TU,,,,,,08/97 DG0WJ,JO60CV,,,,,,11/02 -DG1BA,JO43LB,,,Dieter,,only SSB-MS.383,01/00 -DG1CMZ,JO60DS,,,Michael,,,08/01 +DG1BA,JO43LB,,,,,only SSB-MS.383,01/00 +DG1CMZ,JO60DS,,,,,,08/01 DG1IU,JN49FA,,,,,only SSB-MS,08/96 DG1LY,JO44RK,,,,,,03/04 DG1TA,JN69GH,,,,,,02/01 -DG1VL,JO61WC,,,Henry,,144: 150W 17el MGF1302388,04/04 -DG1YBO,JO32RG,,,Michael,,144: FT225RD 80W 9el,09/04 -DG2BCP,JO43DC,,,Peter,,144: 4x 3.6wl DJ9BV+GS35 Pa - 432: 4x 11wl DJ,01/04 -DG2DAA,JO62GU,,,Friedhelm,,,06/02 -DG2GEP,JN48DL,,,Markus,,144: 200W 9ele Yagi,04/03 -DG2KBC,JN58MI,,,Ansgar,,144: FT847 2x2wl BVO 300W LNA,01/05 -DG2NBN,JN59NR,,,Dieter,,FT847 144: 200W 2x3wl 9BV MGF1302 - 432: 300W,08/01 -DG2NZM,JN59IV,,,Matthias,,,06/03 -DG2SRL,JO61HN,,,,,144: 2x17el 300W,10/01 +DG1VL,JO61WC,,,,,144: 150W 17el MGF1302388,04/04 +DG1YBO,JO32RG,,,,,144: FT225RD 80W 9el,09/04 +DG2BCP,JO43DC,EME,,,,144: 4x 3.6l DJ9BV+GS35 Pa 432: 4x 11l DJ9BV1,03/06 +DG2DAA,JO62GU,,,,,,06/02 +DG2GEP,JN48DL,,,,,144: 200W 9ele Yagi,04/03 +DG2KBC,JN58MI,EME,,,,144: FT847 GS35b LNA 2x7ele full elevatio,07/05 +DG2NBN,JN59NR,,,,,FT847 144: 200W 2x3wl 9BV MGF1302 - 432: 300W,08/01 +DG2NZM,JN59IV,,,,,,06/03 +DG2SRL,JO61HN,EME,,,,144: Transv. LT2S 18el M2 500W,04/06 +DG2TOM,JO62BM,,,,,IC706 50: 4el Yagi - 144: 15el M2 100W,08/05 DG2VC,JO61VC,,,,,,01/04 -DG3FK,JO41PG,,,Thomas ""Tom",,TS850+TV TS790 144: 17el 150W - 432: 4x17el,09/03 -DG3JO,JO31JK,,,Bert,,TR-2000- TM-D700- DSPCOM,04/03 -DG3XA,JO43WJ,,,Andreas,,144: 200W 7el - 432: 2x20el 300Wonly SSB-MS,05/04 +DG3FK,JO41PG,,,,,TS850+TV TS790 144: 17el 150W - 432: 4x17el,09/03 +DG3JO,JO31JK,,,,,TR-2000- TM-D700- DSPCOM,04/03 +DG3XA,JO43WJ,,,,,144: 200W 7el - 432: 2x20el 300Wonly SSB-MS,05/04 DG4BH,JO30RX,,,,,,01/03 DG4EK,JO31NI,,,,,,2003 -DG4EKE,JO31NI,,,Kai,,144: IC820h- SP2000- 17/11el- QQE06-40.088 D,01/97 +DG4EKE,JO31NI,,,,,144: IC820h- SP2000- 17/11el- QQE06-40.088 D,01/97 DG5AAG,JO51,,,,,,07/01 -DG5CST,JO60DS,,,Sebastian,,144: FT847 4x9el GU74 750W - 432: 23el 50WM,06/04 -DG5HV,JO43XQ,,,Michael,,,01/99 +DG5CST,JO60DS,EME,,,,144: FT847 4x9el GU74 750W - 432: 23el 50WM,04/06 +DG5HV,JO43XQ,,,,,,01/99 DG5NEX,JN49WS,,,,,,93 -DG5OAF,JO51EP,,,Karlheinz,,144: FT736 400W 2x17el B2 MGF1302DTR + JUDS,11/99 -DG5SMY,JN49QA,EME,,Marc,,144: 4x 17ele 432: 4x 23ele,08/04 -DG6JF,JO31,,,Günter,,,10/01 -DG6LS,JO54AK,,,Söhnke,,144:TS790 8877 4x17el - 432: 8x33el DJ9BV 3CX,12/96 -DG6MBS,JO41AH,,,Mareike,,144: TM255 MGF1302 180W 11El-F9FT - 432: TM-4,08/02 +DG5OAF,JO51EP,,,,,144: FT736 400W 2x17el B2 MGF1302DTR + JUDS,11/99 +DG6JF,JO31,,,,,,10/01 +DG6JF/p,JO33QN,EME,,,,144: 300W 17el - 1296: 15W 4x43el,04/05 +DG6LS,JO54AK,,,,,144:TS790 8877 4x17el - 432: 8x33el DJ9BV 3CX,12/96 +DG6MBS,JO41AH,,,,,144: TM255 MGF1302 180W 11El-F9FT - 432: TM-4,08/02 DG6MGP,JN58WH,,,,,,1995 -DG6SYL,JO53QP,,,Anne,,144: 150W 11el 6WU Preamp - 432: 150W 23el Pr,03/02 -DG7MHR,JN57DR,,,Dieter,,,03/03 +DG6SYL,JO53QP,,,,,144: 150W 11el 6WU Preamp - 432: 150W 23el Pr,03/02 +DG7MHR,JN57DR,,,,,,03/03 DG7OV,JO42VX,,,,,,10/04 DG7RBV,JN59UM,,,,,only SSB-MS, -DG7SF,JN48RR,,,Günther,,144: FT736 300W 2x7elDTR,06/01 -DG7SFL,JN49XF,,,Michael,,144: 300 W + 10El. - 432: 150W + 2*21El.,01/04 -DG7TG,JO43TX,,,,,,01/03 -DG8NCO,JO50VH,,,Uwe,,750W 6x9el MGF1302300,01/04 +DG7SF,JN48RR,,,,,144: FT736 300W 2x7elDTR,06/01 +DG7SFL,JN49XF,,,,,144: 300 W + 10El. - 432: 150W + 2*21El.,01/04 +DG7TG,JO43SV,,,,,,06/05 +DG8NCO,JO50VH,,,,,750W 6x9el MGF1302300,01/04 DG8NCY,JO50HA,,,,,,07/02 -DG8UAW,JN48BR,,,Stephan,,FT-847: 144MHz: 50W 7el Preamp - 432MHz: 30,09/01 -DG8YHH,JO32QI,,,Alfons,,,01/04 -DG9BEM,JO43CD,,,Thomas,,144: 350W 17el VV - 432: 300W 4x20el VV - 129,01/03 -DG9DAZ,JO31XB,,,Tino,,144: TM255,11/01 +DG8UAW,JN48BR,,,,,FT-847: 144MHz: 50W 7el Preamp - 432MHz: 30,09/01 +DG8YFM,JO32MF,,,,,,03/06 +DG8YHH,JO32QI,,,,,,01/04 +DG9BEM,JO43CD,,,,,144: 350W 17el VV - 432: 300W 4x20el VV - 129,01/03 +DG9DAZ,JO31XB,,,,,144: TM255,11/01 DG9GLA,JO40,,,,,,12/01 -DG9MAQ,JN58LJ,,,Raimund,,144: IC251 200W 9el Preamp. - 432: TS811 10,11/03 -DG9NCX,JN59BT,,,Hubert,,.126,11/99 -DG9NFM,JO50QG,,,Chris,,,1/94 -DG9YIH,JO32QI,,,Helmut,,144: 500W 17el,12/04 -DH0AAI,JO51AR,,,Harald,,144: FT225rd PA 200W SP2000 4xDL7KM,08/02 -DH0GHU,JN38VN,,,Ulrich,,144: TS850 LT2S HLV300 300W 11elDTR 3000lpm,09/01 -DH0LS,JO61II,,,Jens,,144: 4CX350 500W 2x17el Preamp - 432: 150W 21,12/03 +DG9MAQ,JN58LJ,EME,,,,144: IC251 100W 9el Preamp - 432: TS811 100W,03/06 +DG9NCX,JN59BT,,,,,.126,11/99 +DG9NFM,JO50QG,,,,,,1/94 +DG9YIH,JO32QI,,,,,144: 500W 17el,12/04 +DH0AAI,JO51AR,,,,,144: FT225rd PA 200W SP2000 4xDL7KM,08/02 +DH0GHU,JN38VN,,,ex DG2GHU,,144: TS850 LT2S HLV300 300W 11elDTR 3000lpm,09/01 +DH0LS,JO61II,,,,,144: 4CX350 500W 2x17el Preamp - 432: 150W 21,12/03 DH0MBH,JN58JD,,,,,,01/02 DH0OAH,JO42OB,,,,,,2003 +DH0X,JN49DE,EME,,,,,08/05 DH0YAZ,JO41GG,,,,,,2003 -DH1DCN,JO41BD,,,Marc,,144: IC706MK2 11el 100W137 DTR 5000lpm,08/03 -DH1FM,JO61UD,,,Tilo,,144: 90W 10el - 1296: 1W 30el.050,08/02 -DH1KBB,JO20XX,,,jörg,,,1993 -DH1NAD,JN49,,,werner,,,1993 -DH1NSP,JN59JX,,,Phil,,,01/01 -DH1TW,JN48QM,EME,,Tobias ""Toby",,144: 600W 10el,04/01 -DH2FAF,JO40,,,j.,,,1993 -DH2OAA,JO42TU,,,Michael,,144: IC275E 4x11el 6WU 500W1800lpm,03/04 -DH2RS,JN47TT,,,Ralph,,144: 75W 11el MGF1302.140.250,01/98 -DH2UAK,JO71FU,,,Klaus,,IC910+Preamps - 144: 13el - 432: 29el - 1296:,04/04 +DH1FM,JO61UD,,,,,144: 90W 10el - 1296: 1W 30el.050,08/02 +DH1HC,JO53FF,,,,,144: 13el 500W,10/05 +DH1KBB,JO20XX,,,,,,1993 +DH1NAD,JN49,,,,,,1993 +DH1NSP,JN59JX,,,,,,01/01 +DH1TW,JN48QM,EME,,,,144: 600W 10el,04/01 +DH2FAF,JO40,,,,,,1993 +DH2OAA,JO42TU,,,,,144: IC275E 4x11el 6WU 500W1800lpm,03/04 +DH2RS,JN47TT,,,ex DG3GSR,,144: 75W 11el MGF1302.140.250,01/98 +DH2UAK,JO71FU,EME,,,,IC910+Preamps - 144: 4x 13el 500W - 432: 29el,10/05 DH3DP,JO31,,,,,,07/96 -DH3IAJ,JN48HD,,,Ralf,,50: 10W 4el - 144: 100W 10el /p JN48GD 10GHz,04/07 -DH3NAN,JO50NC,EME,,Matthias,,,12/97 -DH3VE,JN39LL,EME,,Bernd ""Erni",,FT847 144: 500W MGF1402b 4x10el - 432: 300W M,07/03 -DH3YAK,JO31RS,EME,,Winfried,,144: 12el M2 750W135 DTR 3000lpm,12/04 -DH4FAJ,JN49LW,,,Matthias,,IC821h 144: 11ele 200w - 432: 19ele 40w,05/02 -DH5FS,JO61UA,,,Fred,,144: 9el 120W - 432: 4x21el,11/00 -DH5HS,JO31FF,,,Heiko,,FT847,11/02 -DH5HV,JO31AS,EME,,Jochen,,144: FT1000+LT2S or IC910 750W MGF1302 - 432,03/04 +DH3IAJ,JN48HD,,,,,50: 10W 4el - 144: 100W 10el /p JN48GD 10GHz,07/04 +DH3VE,JN39LL,EME,,ex DB3VE,,FT847 144: 500W MGF1402b 4x10el - 432: 300W M,07/03 +DH3YAK,JO31RS,EME,,,,144: 4x 12el M2 750W135 DTR 3000lpm,07/05 +DH4FAJ,JN49EX,EME,,,,IC821h 144: 4x 9el 1KW - 432: 19ele 40w,01/06 +DH5FS,JO61UA,,,,,144: 9el 120W - 432: 4x21el,11/00 +DH5HS,JO31FF,,,,,FT847,11/02 +DH5HV,JO31AS,EME,,ex DB5VH,,144: FT1000+LT2S or IC910 750W MGF1302 - 432,03/04 DH5LAN,JO44TN,,,,,,05/97 -DH5MK,JO41IV,,,Michael ""Mike",,144: 100W 6el MGF1302222,08/04 +DH5MK,JO41IV,,,ex DC3QB,,144: 100W 6el MGF1302222,08/04 DH6ICE,JO61XU,,,,,,07/04 -DH6JL,JO31MI,,,Mike,,50: IC-746 4ele HB9CVDTR 3000lpm,06/00 -DH7FB,JO62SM,,,Frank,,144: FT847 GS35b 2x9el DK7ZB148 2500lpm JUD,02/04 -DH8BQA,JO73CF,,,Olli,,144: FT726r 300W 2x10el PreampDTR 3000lpm,02/02 -DH8GV,JO33RL,,,Thomas,,,07/01 -DH8IAB,JO30NO,,,Werner,,,05/04 -DH8IAT,JN49GC,,,Thomas,,,05/02 +DH7FB,JO62SM,,,ex DD6UFR,,144: FT847 GS35b 2x9el DK7ZB148 2500lpm JUD,08/05 +DH7FB/P,JO63SC,EME,,,,144: IC706MKII 4x 4wl Antennas (DK7ZB) GS35,08/05 +DH8BQA,JO73CF,,,,,144: FT726r 300W 2x10el PreampDTR 3000lpm,02/02 +DH8GV,JO33RL,,,ex DD3BI,,,07/01 +DH8IAB,JO30NO,EME,,,,144: 17el 750W,01/06 +DH8IAT,JN49GC,,,,,,05/02 DH8YHR,JO41GV,,,,,,2003 DH9FAG,JN49LX,,,,,,2003 -DH9GCD,JN38VF,,,Christoph,,144: 11el 100W MGF1302.127 DTR 2500lpm,05/02 -DH9KAE,JO30BW,,,detlef,,,1993 -DH9NBB,JN49WS,,,Martin,,,01/99 -DH9NFM,JO50RF,EME,,Christian ""Chris",,144: 2x17el M2 750W - 432: 2x8el M2 750W - 12,03/04 -DH9OK,JO51AS,,,Edgar,,,06/04 -DH9OY,JO51AQ,,,Edgar (Eddy),,DTR 2000lpm,05/00 -DJ0QZ,JN49LM,EME,,Frank,,144: IC746 8877 2x18el M2 MGF1302,11/01 +DH9GCD,JN38VF,,,ex DG9GCD,,144: 11el 100W MGF1302.127 DTR 2500lpm,05/02 +DH9KAE,JO30BW,,,,,,1993 +DH9NBB,JN49WS,,,ex DG9NBT,,,01/99 +DH9NFM,JO50RF,EME,,,,144: 2X17 M2 - 432: 2X38 M2 - 1296: 4x21 - 23,06/05 +DH9OK,JO51AS,,,,,,06/04 +DH9OY,JO51AQ,,,ex DG5OAA,,DTR 2000lpm,05/00 +DJ0QZ,JN49LM,EME,,,,144: IC746 8877 2x18el M2 MGF1302,11/01 DJ0RU,JO31KM,,,,,,07/02 -DJ1JD,JO52CK,EME,,Uschi,,DTR,08/00 -DJ1LP,JO64,,,d.,,,1993 -DJ1OJ,JN58SE,,,Heijo,,144: 100W 2x11el SP2000DTR,10/00 -DJ1SHF,JO73AM,,,Andre,,144: TS711 120W 2x10el- PreampDTR,11/96 -DJ1TU,JN48TR,,,Klaus,,,08/02 -DJ2IA,JO71AO,,,Dieter,,144: FT736R 100Watt 9-ele-Yagi,08/02 +DJ1JD,JO52CK,EME,,,,DTR,08/00 +DJ1LP,JO64,,,,,,1993 +DJ1MT/MM,DIVERSE,,,,,144: 11el 200W,01/05 +DJ1OJ,JN58SE,,,,,144: 100W 2x11el SP2000DTR,10/00 +DJ1SHF,JO73AM,,,,,144: TS711 120W 2x10el- PreampDTR,11/96 +DJ1TU,JN48TR,,,ex DL2SAD,,,08/02 +DJ2GM,JN58SC,,,,,,04/06 +DJ2IA,JO71AO,,,ex DM2BHF,,144: FT736R 100Watt 9-ele-Yagi,08/02 DJ2IE,JN48HV,,,,,,07/02 -DJ2JA,JO40IM,EME,,Roland,,DTR,04/04 -DJ2JS,JO31SL,,,Volker,,,04/04 -DJ2QV,JO31PF,,,Maik,,144: TS850S Trvt 200Watts 9el OZ5HF - 432:,12/04 -DJ2XS,JO53AK,,,matthias,,,1995 -DJ3FI,JO31DI,EME,,Hubert,,,08/00 -DJ3HW,JO42LH,,,Joerg,,144: IC-910H 600W 12elM2 MGF1302 - 432: 280W,08/04 -DJ3LE,JO44TN,,,Hans-Juergen,,50: 25WERP 5el - 144: 2x17el 600W - 432: 2x21,02/04 -DJ3MY,JN58QD,EME,,Christian,,144: 600W 4x17elDTR,08/99 -DJ3RU,JN58,,,kurt,,,1995 +DJ2JA,JO40IM,EME,,,,DTR,04/04 +DJ2JS,JO31SL,,,,,,04/04 +DJ2XS,JO53AK,,,,,,1995 +DJ3HW,JO42LH,,,ex DL9YEK,,144: IC-910H 600W 12elM2 MGF1302 - 432: 280W,08/04 +DJ3LE,JO44TN,,,= OZ7LE,,50: 25WERP 5el - 144: 2x17el 600W - 432: 2x21,02/04 +DJ3MY,JN58QD,EME,,,,144: 600W 4x17elDTR,08/99 +DJ3RU,JN58,,,,,,1995 DJ3ST,JN48,,,,,,2003 -DJ3TF,JN59WK,,,Wolfgang,,,06/00 -DJ3VI,JO51BS,,,Siegfried,,144: FT736r 2x11el 750W3000lpm,01/01 -DJ4SO,JO44WG,,,Klaus-Dieter,,DTR,11/99 -DJ4UF,JO30BR,,,Eckart K.W.,,144: 300W 2x 8el MGF1302138 DTR 3000lpm,09/04 -DJ5BV,JO30KI,,,Gerhard ""Gerd",,144: 600W 11el MGF1302 - 432: 400W 20el - 12,07/02 -DJ5CL,JN58WH,,,Ingo,,,08/00 +DJ3TF,JN59WK,,,,,,06/00 +DJ3VI,JO43VI,EME,,,,144: FT736r 2x11el 750W3000lpm,02/06 +DJ4SO,JO44WG,,,,,DTR,11/99 +DJ4TC,JO63PN,EME,,ex Y21TC DL1NTC,,144: 380W 2x 11el - 432: 460W 2x 26el homema,01/06 +DJ4UF,JO30BR,,,,,144: 300W 2x 8el MGF1302138 DTR 3000lpm,09/04 +DJ5BV,JO30KI,,,,,144: 600W 11el MGF1302 - 432: 400W 20el - 12,07/02 +DJ5CL,JN58WH,,,ex DG1MHY,,,08/00 DJ5DT,JN49IV,,,,,,05/02 -DJ5HG,JO53IU,,,Klaus,,,06/04 -DJ5MN,JN58WH,EME,,Bernhard,,,06/96 -DJ5MS,JN68KS,,,Peter,,,10/99 -DJ5NV,JN59KN,EME,,Günther,,,12/01 -DJ5RE,JN59WK,EME,,Thomas,,144: GS35b 250W 2x12el M2DTR+ 3000lpm,03/04 -DJ5SQ,JN37UW,,,Ivo,,144: TS870 LT2S 600W 11elDTR 2000lpm,12/97 -DJ6JJ,JO31LG,,,Heino,,,12/01 -DJ6MB,JO30,EME,,uwe,,,1994 +DJ5HG,JO53IU,,,,,,06/04 +DJ5MN,JN58WH,EME,,,,,06/96 +DJ5MS,JN68KS,,,SilentKey,,,10/99 +DJ5NV,JN59KN,EME,,ex DL9NDD,,,12/01 +DJ5RE,JN59WK,EME,,,,144: GS35b 250W 2x12el M2DTR+ 3000lpm,03/04 +DJ5SQ,JN37UW,,,,,144: TS870 LT2S 600W 11elDTR 2000lpm,12/97 +DJ6JJ,JO31LG,,,,,,12/01 DJ6OL,JO52AP,,,,,,10/04 -DJ6TN,JO54CF,,,Gunter,,DTR,09/96 -DJ6WD,JO40AT,,,Karl-Heinz,,DTR 4000lpm,03/99 -DJ6XV,JO31LQ,,,Peter,,,04/04 -DJ7AL,JO61VC,EME,,Jürgen,,144: IC910 VLA 200 4el F9FT,11/04 -DJ7FJ,JN48AG,EME,,josef,,,1994 -DJ7OF,JO51HQ,EME,,Klaus,,144: 6x17el CC 17B2 MGF1302 EME Pwr090 250,09/04 -DJ7OQ,JO42WJ,,,Erik,,144: TS 850 LT2S PA 2x 4CX250 Preap .5 dB,05/03 +DJ6TN,JO54CF,,,,,DTR,09/96 +DJ6WD,JO40AT,,,SilentKey,,DTR 4000lpm,03/99 +DJ6XV,JO31LQ,,,,,,04/04 +DJ7AL,JO61VC,EME,,,,144: IC910 VLA 200 4el F9FT,04/06 +DJ7OF,JO51HQ,EME,,ex DG5OAE,,144: 6x17el CC 17B2 MGF1302 EME Pwr090 250,04/05 +DJ7OQ,JO42WJ,,,,,144: TS 850 LT2S PA 2x 4CX250 Preap .5 dB,05/03 DJ7RI,JO54CH,,,,,,12/03 -DJ8ES,JO43SX,,,Wolfgang,,144: 300W 17el - 432: 300W 24el - 1296: 100,08/03 -DJ8MS,JO63CT,,,Toralf ""Tor",,144: 100W 2x11el 6WU Preamp3000lpm MSDSP,08/04 -DJ8OG,JO40MF,,,Matthias,,IC 275H 8el DK7ZB,04/04 -DJ8PB,JO44MC,,,,,,1993 -DJ9BV,JO43XN,EME,,Rainer,,,07/00 -DJ9CS,JO54DG,,,Bodo,,FT-847 200W PA 50: 3 el 144: 9el,09/04 -DJ9CZ,JO31BC,EME,,Karl-Heinz,,FT847 4x15el 4CX1000A,02/04 -DJ9FG,JO52TD,,,Rolf,,HF: FT757GXII 10m Longwire - 50: 25W IRF610,05/04 -DJ9JY,JO31JM,,,Wolfgang,,only SSB-MS,01/01 -DJ9KV,JN68OK,,,hans,,only SSB-MS,06/95 -DJ9MG,JO52TC,,,Peter,,144: 2x 4CX250b 17el Tonna2000lpm,02/05 -DJ9YE,JO43HV,,,Klaus,,144: 400Watt 15el MGF1302,12/04 -DJ9YW,JO42QA,EME,,Heinrich F.,,144: 2x10el 500W - 1296: 3.5 and 4.5m dish 3,02/01 -DK0AK,JO30NQ,,,Clubstation,,,05/04 -DK0ALK,JN38TD,,,Clubstation,,,06/96 -DK0BN,JN39VX,EME,,Contestgruppe Bingen,,144: 700W 3x 9el F9FT + 2x 11elF9FT030275,09/03 +DJ8ES,JO43SX,,,,,144: 300W 17el - 432: 300W 24el - 1296: 100,08/03 +DJ8MS,JO63CT,,,ex DG5TR,,144: 750W 11el 6WU Preamp 432: 300W 2x13el,08/05 +DJ8MS/P,JO53XU,,,ex DG5TR,,144: 150W 12el 9BV Preamp 432: 150W 23el 6WU,08/05 +DJ8OG,JO40MF,,,,,IC 275H 8el DK7ZB,04/04 +DJ8PB,JO44MC,,,Silent Key,,,1993 +DJ9BV,JO43XN,EME,,,,,07/00 +DJ9CS,JO54DG,,,,,FT-847 200W PA 50: 3 el 144: 9el,09/04 +DJ9CZ,JO31BC,EME,,,,FT847 4x15el 4CX1000A,02/04 +DJ9FG,JO52TD,,,ex DM2CFG Y23FG DL9ZFG,,HF: FT757GXII 10m Longwire - 50: 25W IRF610,05/04 +DJ9JY,JO31JM,,,ex DG1JY,,only SSB-MS,01/01 +DJ9KV,JN68OK,,,,,only SSB-MS,06/95 +DJ9MG,JO52TC,EME,,ex DM2BQG Y22QG DL8CME,,144: 2x 17el 500W2000lpm,04/06 +DJ9YE,JO43HV,,,,,144: 400Watt 15el MGF1302,12/04 +DK0AK,JO30NQ,,,,,,05/04 +DK0ALK,JN38TD,,,,,,06/96 DK0EP,JO31TS,,,,,,11/04 -DK0IG,JN58SE,,,Clubstation,,144: 350W 2x11el,12/96 -DK0NHF,JO62JR,EME,,clubstation,,,1994 -DK0OG,JN68GI,EME,,Clubstation,,144: 700W 8x17elDTR,12/04 -DK0PX,JN48JC,,,Clubstation,,144: 350W 2x17el157,11/03 -DK0TU,JO62PM,EME,,clubstation,,DTR,1993 +DK0IG,JN58SE,,,,,144: 350W 2x11el,12/96 +DK0OG,JN68GI,EME,,,,144: 700W 8x17elDTR,12/04 +DK0R,JO50AN,EME,,= DF0CK,,144: 500Watt 2x11el,09/05 +DK0TU,JO62PM,EME,,,,144: 4x 12el QRO,04/06 DK0TX,JO50HK,,,,,,03/02 -DK0UB,JO31PK,,,Clubstation Ruhruni,,,08/97 -DK0VV,JO61WB,,,OP DD0VF,,144: 550W 4x7el MGF1303131 3000lpm DTR157,03/04 -DK1CM,JO40LG,EME,,Oliver,,144: FT990 LT2S 700W YL1050 18el MGF1302 - 43,04/01 -DK1CO,JO63SX,EME,,Hartmut,,144: TS790 4x17el 3CX800A7 Preamp.086 DTR,04/00 +DK0UB,JO31PK,,,,,,08/97 +DK0VV,JO61WB,,,,,144: 550W 4x7el MGF1303131 3000lpm DTR157,03/04 +DK1CM,JO40LG,EME,,ex DL2FDX,,144: FT990 LT2S 700W YL1050 18el MGF1302 - 43,04/01 +DK1CO,JO63SX,EME,,ex DL9GKA,,144: TS790 4x 17el 750W Preamp086 DTR395,01/06 DK1EJP,JO31DD,,,,,,03/03 -DK1KO,JO53CT,EME,,Reinhard,,144: 8877 4X17el F9FT-full elevation MGF13,12/04 -DK1MAX,JN58SP,,,Max,,,05/02 -DK1MZ,JO42XP,EME,,Stamen ""Stan",,144: EME Pwr 13el MGF1302DTR,11/03 -DK1PZ,JO41TH,EME,,heinz,,,1994 -DK1VI,JN49HH,,,Ernst,,144: 650W 16 el.- 432: 100W 21 el.- 1296: 120,07/01 -DK2AM,JO43AK,,,Dieter,,144: 450W 4x14el MGF1302DTR,12/01 -DK2BJ,JO30BS,,,Ulrich,,,04/04 +DK1KO,JO53CT,EME,,,,144: 8877 4X17el F9FT-full elevation MGF13,12/04 +DK1MAX,JN58SP,,,ex DL4MDQ,,,05/02 +DK1MZ,JO42XP,EME,,ex LZ1KU DL4ABJ,,144: EME Pwr 13el MGF1302DTR,11/03 +DK1PZ,JO41TH,EME,,,,,1994 +DK1VI,JN49HH,,,,,144: 650W 16 el.- 432: 100W 21 el.- 1296: 120,07/01 +DK2AM,JO43AK,,,,,144: 450W 4x14el MGF1302DTR,12/01 +DK2BJ,JO30BS,,,,,,04/04 DK2FT,JO42KC,,,,,,2003 -DK2UO,JO30,,,heijo,,,1993 -DK2YCT,JO32RG,,,Chris,,,12/03 -DK3BU,JO33NO,EME,,Harm,,50: 25 W ERP 5el - 144: 749W 4x12el Pream,05/02 -DK3DUA,JO61TC,,,Thomas Rudolph,,144: FT847 1000Watts ERPDTR 3000lpm,04/00 -DK3EE,JO41GV,EME,,Thomas,,144: 8877 9el F9FT,08/04 -DK3FB,JO31UC,EME,,Rüdiger,,432: 750W 4x23el - 1296: 150W 37el - 2300: 5W,03/01 -DK3IK,JN39JF,,,Volker,,800lpm,04/97 +DK2UO,JO30,,,,,,1993 +DK2YCT,JO32RG,,,,,,12/03 +DK2ZF,JO33ON,EME,,,,,02/06 +DK3BU,JO33NO,EME,,,,50: 25 W ERP 5el - 144: 749W 4x12el Pream,04/05 +DK3DUA,JO61TC,,,ex DG0DU,,144: FT847 1000Watts ERPDTR 3000lpm,04/00 +DK3EE,JO41GV,EME,,=DK3T ex DL9YEY,,144: 8877 9el F9FT,08/04 +DK3EP,JO31TS,,,,,,06/05 +DK3IK,JN39JF,,,,,800lpm,04/97 DK3MU,JO72GK,,,,,,10/20 -DK3QZ,JO31LP,,,Detlef,,,07/02 -DK3RV,JO31,,,walter,,,07/96 -DK3SE,JN37VP,EME,,Salvo,,,01/05 -DK3WG,JO72GI,EME,,Jürgen,,144: EME-PWR 6x 14el 5wl MGF1302 432: 1KW 8,05/04 -DK3XM,JO43XL,,,Thorsten,,144: 700w 2x2wl 60m asl,09/04 -DK3XT,JN49FE,,,Bernd,,,10/04 -DK4JN,JO31,EME,,a.,,,1994 +DK3QZ,JO31LP,,,,,,07/02 +DK3RV,JO31,,,,,,07/96 +DK3SE,JN37VP,EME,,,,144: 50W 2x 12JXX,04/05 +DK3T,JO41GV,EME,,,,,08/05 +DK3WG,JO72GI,EME,,ex Y22ME,,144: 1KW GS35B 6x 14el 5wl MGF1302 - 432:,12/05 +DK3XM,JO43XL,,,,,144: 700w 2x2wl 60m asl,09/04 +DK3XT,JN49FE,,,= AB7IY,,,10/04 DK4OG,JN68GI,,,,,,2003 -DK4TG,JO31LB,EME,,Lothar,,117.180,01/05 -DK4WN,JN49EP,,,Wolfgang,,,11/03 +DK4TG,JO31LB,EME,,,,144: 17el 750W117180,04/05 +DK4WN,JN49EP,,,ex DC1PN,,,11/03 DK4XI,JN39NG,,,,,,2003 -DK5AI,JO51GO,EME,,Wolfgang ""Wolf",,,01/04 -DK5DC,JO31SL,,,Peter,,,07/02 -DK5DQ,JO31PG,,,Nicolas ""Nico",,144: 300W 2x10elDTR + 3000lpm,03/04 +DK5DC,JO31SL,,,,,,07/02 +DK5DQ,JO31PG,,,,,144: 300W 2x10elDTR + 3000lpm,03/04 +DK5E,JO42DC,EME,,,,,01/06 +DK5EW,JN47NX,EME,,ex DG3GAG,,144: IC706MKIIG ATF54143 HEMT 16x 7el 750,02/06 DK5IT,JN49FB,,,,,,2003 -DK5KK,JO63EX,,,Matthias,,DTR,01/01 -DK5LA,JO44TR,EME,,Reinhard,,,08/02 +DK5KK,JO63EX,,,ex DG0KK,,DTR,01/01 +DK5KMA,JO50IK,,,ex DO8KB,,,03/06 +DK5LA,JO44TR,EME,,,,144: 100W 20el,08/05 DK5MV,JN58WH,,,,,,08/97 -DK5PD,JN39VV,EME,,Lothar,,.040.280,03/00 -DK5TE,JN58BG,,,Stephan,,144: IC746 HLV600/8877 2x13el 432: IC475H 2x2,05/02 -DK5WO,JO30AS,,,Norbert,,,09/01 -DK5YA,JN49NX,EME,,Udo,,50: 4el - 144: GS35b 4x9elM2 PHEMT 0.3db -,07/04 -DK6AS,JO52,EME,,andreas,,,02/01 -DK7BY,JO33RJ,EME,,Karsten ""Sten",,750W,03/04 -DK7LH,JO43BB,,,Maik,,144: IC271 400W 2x3.6wl 9BV - 432: IC471H 100,12/01 +DK5TE,JN58BG,,,,,144: IC746 HLV600/8877 2x13el 432: IC475H 2x2,05/02 +DK5WL,JN39VW,,,,,144: 80w 11 Element Flexayagi,05/05 +DK5WO,JO30AS,,,,,YAESU FT-767GX LT23SWINDSP,07/05 +DK5YA,JN49NX,EME,,ex DH8NAA,,50: 4el - 144: GS35b 4x9elM2 PHEMT 0.3db -,07/04 +DK6AS,JO52,EME,,,,,02/01 +DK7BY,JO33RJ,EME,,,,750W,03/04 +DK7LH,JO43BB,,,ex DG8BCC,,144: IC271 400W 2x3.6wl 9BV - 432: IC471H 100,12/01 DK7LZ,JO30,,,,,,12/01 -DK8EL,JO31LJ,,,Thorsten (Tom),,144: 100W 9el MGF1302.162 2000lpm.162,12/04 +DK7T,JN48XK,,,ex DL0UL,,144: 11el 400W 3CX800,12/05 +DK8EL,JO31LJ,,,ex DH6JT,,144: 100W 9el MGF1302.162 2000lpm.162,12/04 DK8KX,JO30,,,,,,05/04 -DK8VS,JN39NF,EME,,Werner,,,07/01 -DK8ZJ,JO54AG,EME,,Martin,,144: 550W 4x12el,10/02 -DK9OY,JO52CK,EME,,Detlef (Det),,DTR,10/01 +DK8VS,JN39NF,EME,,,,,07/01 +DK8ZJ,JO54AG,EME,,,,144: 600W BEKO 4x 12el M2,09/05 +DK9OY,JO52CK,EME,,,,DTR,10/01 DK9RL,JN69BB,,,,,,01/97 -DK9TF,JO31NF,,,Jürgen,,FT726r- 17el,05/03 -DK9TU,JN48MF,,,Manfred,,144: 500W 13el DJ9BV,04/03 -DK9ZY,JO40BE,EME,,Wolf-Dietmar,,144: TS850 Trvt YL1052 MGF1302 4x10el 2.2,11/99 -DL0AO,JN59WI,EME,,Clubstation OP DJ3TF,,,02/03 -DL0AVH,JO52,EME,,OP DL7AWO,,144: 700W 2x2M18XXX,07/01 -DL0BWS,JO61,,,OP: Normen,,144: IC-910 100W 2x9el - 432: IC910 4x19el,01/03 -DL0DBR,JO54WC,EME,,Clubstation,,,06/99 -DL0DET,JO52CK,EME,,Clubstation OP DK9OY,,DTR,1994 +DK9TU,JN48MF,,,,,144: 500W 13el DJ9BV,04/03 +DK9ZY,JO40BE,EME,,,,144: TS850 Trvt YL1052 MGF1302 4x10el 2.2,11/99 +DL0AO,JN59WI,EME,,,,,02/03 +DL0BWS,JO61,,,,,144: IC-910 100W 2x9el - 432: IC910 4x19el,01/03 +DL0DBR,JO54WC,EME,,,,,06/99 +DL0DET,JO52CK,EME,,,,DTR,1994 DL0EF,JO30IM,,,,,,2003 -DL0FTG,JO53FM,,,Clubstation,,,04/01 +DL0FTG,JO53FM,,,,,,04/01 DL0GER,JN49CC,,,,,,08/00 -DL0HES,JO41RF,,,Clubstation,,IC820H 144: 250W 2x11el - 432: 130W 2x23el P,07/01 +DL0HES,JO41RF,,,,,IC820H 144: 250W 2x11el - 432: 130W 2x23el P,07/01 DL0LAU,JO61JF,,,,,,05/02 -DL0LN,JO31RS,,,Clubstation N29,,,10/04 -DL0LSW,JO61XU,,,Clubstation,,144: 17el 750W,12/99 -DL0PO,JO43CD,,,Clubstation,,,08/96 +DL0LN,JO31RS,,,,,,10/04 +DL0LSW,JO61XU,,,,,144: 17el 750W,12/99 +DL0PO,JO43CD,,,,,,08/96 DL0SHF,JO54BH,,,,,,2003 -DL0UL,JN48XK,,,OP DL6SAQ- DL5EBT,,144: 11el 400W 3CX800,04/01 -DL0UMK,JN68BC,EME,,Clubstation,,144: TS790S 4CX1000 4x17el 5WL.123 1500lpm.3,1995 -DL0VV,JO64AD,,,Clubstation- DL5CC,,144: 600W 17B2 Ant 9A4GLDTR 2500lpm,12/04 -DL0WAE,JO42DC,EME,,Teuto Contest Group,,750w and lots of aluminium!,05/04 -DL0WH,JN49HN,EME,,Clubstation OP DF7IT,,,1992 -DL0WX,JO30FQ,,,Clubstation,,,07/96 -DL1AAH,JO52EF,,,Dirk,,IC910H IC703 144: 17el - 432: 21el,08/03 -DL1AOQ,JO50IW,,,Dietmar ""Dean",,,05/02 +DL0UEM,JO73AR,,,,,,07/05 +DL0UL,JN48XK,,,= DK7T,,144: 11el 400W 3CX800,12/05 +DL0UMK,JN68BC,EME,,,,144: TS790S 4CX1000 4x17el 5WL.123 1500lpm.3,1995 +DL0VV,JO64AD,,,,,144: 600W 17B2 Ant 9A4GLDTR 2500lpm,12/04 +DL0WAE,JO42DC,EME,,,,750w and lots of aluminium!,05/04 +DL0WH,JN49HN,EME,,,,,1992 +DL0WX,JO30FQ,,,,,,07/96 +DL1AAH,JO52EF,,,,,IC910H IC703 144: 17el - 432: 21el,08/03 +DL1AOQ,JO50IW,,,,,,05/02 DL1BKY,JO33RL,,,,,,2003 -DL1DAX,JO31RM,,,Rüdiger,,144: IC251E 100W 11el - 432: FT780R 30W,04/07 -DL1DSB,JO61,,,r.,,,1993 -DL1DUR,JO70KV,EME,,Jürgen,,144: IC275H 700W 4x11el S3030DTR,08/00 -DL1DWI,JO61VC,EME,,Gerhard,,,10/04 -DL1EAP,JO31IK,,,Wolfgang,,144: 12el 750W172 DTR 2500lpm272 / 363,02/04 -DL1EEX,JO31MA,,,Peter,,144: 750W 10db ant.DTR+ 3000lpm,09/00 -DL1EFJ,JO31GM,,,Norbert,,,09/01 -DL1EL,JO41RF,,,Ralf,,IC820H 144: 250W 2x11el - 432: 130W 2x23el P,09/01 -DL1ELY,JO31IO,,,Stefan,,144: FT225rd Mutek 17el 150W.181 5000lpm JUD,01/01 -DL1GBF,JN48NJ,EME,,Peter,,,02/97 -DL1GBM,JN48FD,,,Michael,,50: 7W - 144: 400W- 432: 100W- 1296: 200W222,07/02 -DL1GGT,JN58AO,EME,,Tom,,144: 8877 2x 12el elev. 10368: 5W 60cm4000l,12/04 -DL1GI,JN49FG,,,Ralf,,,12/03 -DL1GNM,JN38WB,,,Michael,,DTR,10/02 +DL1DAX,JO31RM,,,,,144: IC251E 100W 11el - 432: FT780R 30W,07/05 +DL1DSB,JO61,,,ex Y28OL,,,1993 +DL1DUR,JO70KV,EME,,,,144: IC275H 700W 4x11el S3030DTR,08/00 +DL1DWI,JO61VC,EME,,,,,10/04 +DL1EAP,JO31IK,,,,,144: 12el 750W172 DTR 2500lpm272 / 363,02/05 +DL1EEX,JO31MA,,,,,144: 750W 10db ant.DTR+ 3000lpm,09/00 +DL1EFJ,JO31GM,,,NOT qrv MS nw (01/01),,,09/01 +DL1EL,JO41RF,,,ex DL3ZBA,,IC820H 144: 250W 2x11el - 432: 130W 2x23el P,09/01 +DL1ELY,JO31IO,,,,,144: FT225rd Mutek 17el 150W.181 5000lpm JUD,01/01 +DL1GBF,JN48NJ,EME,,,,,02/97 +DL1GBM,JN48FD,,,,,50: 7W - 144: 400W- 432: 100W- 1296: 200W222,07/02 +DL1GGT,JN58AO,EME,,,,144: 8877 2x 12el elev. 10368: 5W 60cm4000l,12/04 +DL1GI,JN49FG,,,ex DL1GJO,,,12/03 +DL1GNM,JN38WB,,,,,DTR,10/02 DL1HTT,JO61FR,,,,,,11/99 -DL1HYZ,JO62,EME,,Uli,,,03/01 -DL1JJ,JO31IA,,,Ulli,,,08/02 -DL1KDA,JO30FQ,EME,,Alex (Sternchen),,FT1000 144: LT2S 3CX800A7 Preamp 2x17ele M2,03/04 -DL1MAJ,JN68AH,,,Alex,,144: 2x17el 750WDTR,12/99 -DL1NEO,JN59KV,,,Markus,,144: IC275H SP2000 Beko HLV600 (max. 600 W),09/99 -DL1NFI,JN59KV,,,Matthias,,144: IC746 100W 12el M2,01/02 -DL1NUX,JN59LG,,,Attila,,IC706MK2G FT847 (/p JO50KI),06/02 -DL1OJ,JO42QI,,,Henning,,144: Elecraft K2 LT2S Beko HLV600 2x9el 50,03/01 -DL1RNW,JO62GH,,,Ronny,,144: 150W 12-5db Yagi,01/05 -DL1RTL,JO62PH,,,Heiko,,144: 13el 100W MGF1302,07/01 -DL1SDN,JN48PP,,,Dieter,,144: 2x11el 500WDTR 2000lpm,07/99 -DL1SFK,JN48PR,,,Oliver,,DTR,06/02 -DL1SUN,JO53PN,,,Norbert,,,04/00 -DL1SUZ,JO53UN,,,Uwe,,50: IC706 3el - 144: IC821 GS35 2x11el Prea,01/05 -DL1UU,JO62SP,,,Wolfgang,,144: 300W 2x9el135 DTR.220,03/04 -DL1YMK,JO31QX,EME,,Michael,,,02/05 -DL2AKT,JO50NV,,,Jens,,IC746 IC706MKII - 144: 700W 9el333,03/02 +DL1JJ,JO31IA,,,,,,08/02 +DL1KDA,JO30FQ,EME,,ex DG1KDA,,FT1000 144: LT2S 3CX800A7 Preamp 2x17ele M2,03/04 +DL1MAJ,JN68AH,,,=HA1BC,,144: 2x17el 750WDTR,12/99 +DL1NEO,JN59KV,,,,,144: IC275H SP2000 Beko HLV600 (max. 600 W),09/99 +DL1NFI,JN59KV,,,ex DG5NGC,,144: IC746 100W 12el M2,01/02 +DL1NUX,JN59LG,,,ex DO2NAK,,IC706MK2G FT847 (/p JO50KI),06/02 +DL1OJ,JO42QI,,,,,144: Elecraft K2 LT2S Beko HLV600 2x9el 50,03/01 +DL1RNW,JO62GH,,,,,144: 150W 12-5db Yagi,01/05 +DL1RTL,JO62PH,,,,,144: 13el 100W MGF1302,07/01 +DL1SDN,JN48PP,,,,,144: 2x11el 500WDTR 2000lpm,07/99 +DL1SFK,JN48PR,,,,,DTR,06/02 +DL1SUN,JO53PN,,,ex Y21NB,,,04/00 +DL1SUZ,JO53UN,,,ex Y24LB,,50: IC706 3el - 144: IC821 GS35 2x11el Prea,01/05 +DL1UU,JO62SP,,,ex DL7VBW,,144: 300W 2x9el135 DTR.220,04/06 +DL1YMK,JO31QX,EME,,ex DB1DI,,,04/06 +DL1YMK/P,JO33,,,ex DB1DI,,,02/05 +DL2AKT,JO50NV,,,,,IC746 IC706MKII - 144: 700W 9el333,03/02 DL2ALF,JO50IW,,,,,144: 100W 9elMSDSP,08/02 -DL2ARD,JO60AR,,,Oliver,,144: IC275E 350W 4x17el.149 DTR 3000lpm,08/04 -DL2CJ,JO50,EME,,alfred,,,1994 -DL2DAO,JO31PH,,,Harry,,144: 600W 24el,11/02 -DL2DXA,JO61VC,,,Bernd,,144: 150W 11el.117,01/97 -DL2EAA,JO31KL,,,Dirk,,,07/98 -DL2FDL,JO40LN,,,Michael ""Mike",,FT736R 50: 5el - 144: 150W 9el - 432: 19el 2,08/03 -DL2IAN,JN49BC,EME,,Thomas ""Tom",,144: 1 KW 2x9eltx1500 rx2000lpm,07/01 -DL2IE,JN48,,,dr. r.,,,1993 +DL2ARD,JO60AR,,,,,144: IC275E 350W 4x17el.149 DTR 3000lpm,02/05 +DL2DAO,JO31PH,,,,,144: 600W 24el,11/02 +DL2DBX,JO31OL,,,,,,07/05 +DL2DXA,JO61VC,,,,,144: 150W 11el.117,01/97 +DL2EAA,JO31KL,,,,,,07/98 +DL2FCN,JN49JU,EME,,,,50: 10W 2el BF981 - 144: 400W 11el MGF1302 -,03/06 +DL2FDL,JO40LN,,,,,FT736R 50: 5el - 144: 150W 9el - 432: 19el 2,08/03 +DL2IAN,JN49BC,EME,,,,144: 1 KW 2x9eltx1500 rx2000lpm,07/01 +DL2IE,JN48,,,,,,1993 DL2JA,JN58,,,,,,02/04 -DL2LAC,JO44MR,EME,,Ernst,,144: 18 dBd GS35b 432: 20 dBd GS35b 1,01/05 -DL2LAH,JO44QS,EME,,Karsten,,144: 750W,11/02 -DL2MHS,JN58,EME,,Thomas,,,03/00 -DL2NFX,JN59IV,,,Michael,,144: IC746 100W3000lpm,04/01 -DL2NUD,JO63LE,,,Hermann,,,05/04 -DL2NWK,JO63SP,EME,,wolfgang,,,1993 -DL2OCB,JN49IS,,,Stefan,,FT726,01/03 -DL2OM,JO30SN,EME,,Roland,,,08/01 +DL2LAC,JO44MR,EME,,,,144: 18 dBd GS35b 432: 20 dBd GS35b 1,03/05 +DL2LAH,JO44QS,EME,,,,144: 750W 4x 11ele 423: 300W 2x 21ele,04/06 +DL2MHS,JN58,EME,,,,,03/00 +DL2NFX,JN59IV,,,,,144: IC746 100W3000lpm,04/01 +DL2NUD,JO63MF,EME,,,,144: 4x 18el QRO,12/05 +DL2NWK,JO63SP,EME,,,,,1993 +DL2OCB,JN49IS,,,,,FT726,01/03 +DL2OM,JO30SN,EME,,,,,08/01 DL2RMC,JN68GI,,,,,,11/97 -DL2RSX,JO62SH,EME,,Olaf,,144: 19 dBd MGF 1302 DSP 1-2KW,12/03 +DL2RSX,JO62SH,EME,,,,144: 19 dBd MGF 1302 DSP 1-2KW,12/03 DL2RUG,JO62,,,,,,01/03 -DL2SDQ,JN49OC,,,Thaddeus (Tadek),,.238.238,08/01 -DL2UX,JO61VA,,,Mario,,144: TR751E 5el 25W - /p JO61VC: 100W 13,08/02 -DL2YDS,JO32,,,Stefan,,,08/97 -DL3AAL,JO52,,,b.,,,1993 +DL2SDQ,JN49OC,,,,,.238.238,08/01 +DL2UX,JO61VA,,,ex DO1USA,,144: TR751E 5el 25W - /p JO61VC: 100W 13,08/02 +DL2YDS,JO32,,,,,,08/97 +DL3AAL,JO52,,,,,,1993 DL3AZI,JO51ME,,,,,,01/97 -DL3BUE,JO72FH,,,Joerg,,,08/02 -DL3BWG,JO62TQ,,,,,,1995 -DL3DTS,JO61UA,,,sylve,,,1993 +DL3BUE,JO72FH,,,,,,08/02 +DL3BWG,JO62TQ,,,ex DM5DD Y26GE DR3R,,FT-847 11-ELE-F9FT130,03/06 +DL3DTS,JO61UA,,,,,,1993 DL3FBJ,JO40,,,,,,11/01 -DL3GN,JN37VX,,,Udo,,,07/01 -DL3HRT,JO61AB,,,Karsten,,144: 10el 2.3wl 100W GaAsFet DSP-NRDTR,07/02 -DL3IAE,JN49DE,EME,,Daniel,,50: TS120 trvt 6el - 144: 3CX800 750W 2x10el,07/99 -DL3IAS,JN49EJ,,,Nino,,144: 20W 10el DK7ZB - 432: 3W 23el DK7ZB - 12,08/03 -DL3JAN,JO60KT,,,Jan,,144: 9el 300W,03/01 -DL3JIN,JO60LX,,,Peter,,,04/03 -DL3LBK,JO54AH,,,Kai,,144: 250Watt 11el.082 DTR.382,07/96 -DL3LST,JO61FI,,,Ray,,,01/05 -DL3MBG,JN68,,,Christian,,,01/96 -DL3MGL,JN58QD,,,Carlos,,DTR,12/01 -DL3NAW,JN59KV,,,Wolfgang,,144: 500W 2x11elDTR tx1200lpm,08/03 -DL3NCR,JN48QX,,,Georg,,50: IC736 3el Yagi - 144: IC275E 11el DL6WU 8,01/04 -DL3RBH,JN68HJ,,,Robert,,,05/99 +DL3HRT,JO61AB,,,ex Y32MH,,144: 10el 2.3wl 100W GaAsFet DSP-NRDTR,07/02 +DL3IAE,JN49DE,EME,,,,50: TS120 trvt 6el - 144: 3CX800 750W 2x10el,08/05 +DL3IAS,JN49EJ,,,,,144: 20w 10el DK7ZB 432: 3w 23el DK7ZB 1296:,07/05 +DL3JAN,JO60KT,,,,,144: 9el 300W,03/01 +DL3JIN,JO60LX,,,,,,04/03 +DL3LBK,JO54AH,,,,,144: 250Watt 11el.082 DTR.382,07/96 +DL3LST,JO61FI,EME,,,,144: 9el,04/05 +DL3MBG,JN68,,,NOT qrv MS nw (01/01),,,12/05 +DL3MGL,JN58QD,,,=EA/DL3MGL,,DTR,12/01 +DL3NAW,JN59KV,,,zzT W3TWX,,144: 500W 2x11elDTR tx1200lpm,08/03 +DL3NCR,JN48QX,,,,,50: IC736 3el Yagi - 144: IC275E 11el DL6WU 8,01/04 +DL3RBH,JN68HJ,,,,,,05/99 DL3RU,JN49FG,,,,,,2003 -DL3SAS,JN48OR,EME,,Hartmut,,,04/96 +DL3SAS,JN48OR,EME,,,,,04/96 DL3TN,JO31LC,,,,,,12/01 -DL3TW,JO44SK,,,Thorsten,,144: FT1000 LT2S 6x6el 600W,01/03 +DL3TW,JO44SK,,,,,144: FT1000 LT2S 6x6el 600W,01/03 DL3WW,JO60FL,,,,,,08/04 -DL3XT,JN49FT,,,bernie,,,1993 -DL3YBP,JO42,EME,,heiko,,,1993 -DL3YEE,JO42GE,EME,,Klaus,,,01/05 -DL3YEL,JO41EV,,,Ulrich (Ulli),,144: 9el 3CX8002500lpm DTR,07/02 +DL3XT,JN49FT,,,,,,1993 +DL3YBP,JO42,EME,,,,,1993 +DL3YEE,JO42GE,EME,,,,144: 11el 100W 432: 4x 11el,08/05 +DL3YEL,JO41EV,,,,,144: 9el 3CX8002500lpm DTR,03/06 DL4ABJ,JO42XP,,,,,,2003 -DL4ALI,JO50JW,,,Steffen,,,07/99 -DL4ANT,JN49LF,,,Jörg,,,09/01 -DL4AO,JO42NX,,,Heinz,,144: 150W 11el,07/04 -DL4DTU,JO60TS,EME,,Norbert,,DTR,01/02 -DL4DWA,JO61QH,,,Uwe,,144: 120w 13ele 432: 35w 19ele370,01/05 -DL4EA,JO31,,,Frank,,,09/96 -DL4EBY,JO62PM,EME,,Klaus,,DTR,12/03 -DL4IB,JO64CC,,,Manfred,,144: 11el 300WMSDSP,12/98 -DL4KG,JN48OU,EME,,Gerald,,TS2000 - 50: dipole - 144: 10el DJ9BV 100W,05/04 -DL4MEA,JN58RI,EME,,Guenter,,144: GS35b 15el MGF1302 432: GS35b 6x33el,09/04 -DL4MP,JN48NV,,,Manfred (Manne),,50: 100W 5el.095.195,01/01 -DL4NAA,JN49NX,,,Christian ""Chris",,144: hm 750W 2x15el.144 2000lpm,04/01 +DL4ALI,JO50JW,,,,,,07/99 +DL4ANT,JN49LF,,,,,,09/01 +DL4AO,JO42NX,,,,,144: 150W 11el,07/04 +DL4DD,JO43OT,,,,,TS2000,07/05 +DL4DTU,JO60TS,EME,,,,1296: 200W 3.7m dish 0.4dbDTR,08/05 +DL4DWA,JO61QH,EME,,,,144: 600W 13ele 432: 35w 19ele370,12/05 +DL4EA,JO31,,,,,,09/96 +DL4EBY,JO62PM,EME,,,,DTR,12/03 +DL4IB,JO64CC,,,ex DL5KVA,,144: 11el 300WMSDSP,12/98 +DL4JM,JO31ED,EME,,,,144: 4el 100W,05/05 +DL4MEA,JN58RI,EME,,,,144: GS35b 15el MGF1302 432: GS35b 6x33el,04/06 +DL4MP,JN48NV,,,ex DL8SET,,50: 100W 5el.095.195,01/01 +DL4NAA,JN49NX,,,,,144: hm 750W 2x15el.144 2000lpm,04/01 DL4SUN,JO63CT,,,,,,10/04 +DL4WO,JO61WC,EME,,,,144: 17el 150W,04/05 DL4XX,JO43XK,,,,,,07/97 DL4YAO,JN58,,,,,,05/02 -DL4YBM,JO42DC,,,joe,,,1995 +DL4YBM,JO42DC,,,,,,1995 DL5AG,JO41,,,,,,01/03 -DL5BAC,JO43LG,,,hans-jürgen,,DTR,01/96 +DL5BAC,JO43LG,,,,,DTR,01/96 DL5BBW,JO32NH,,,,,,01/01 -DL5CC,JO64AD,,,Manfred,,144: 17el 600W2500lpm DTR,12/04 -DL5DAV,JO31,,,Uwe,,,1994 -DL5DTA,JO61SD,EME,,Arnfried ""Andy",,144: 4x11el EME Pwr GaasFet DSP59.134 DT,08/99 -DL5EBS,JO31LH,,,Juergen,,144: FT847 150 W 13 el Yagi,08/03 -DL5FDP,JN49LP,,,Stefan,,,11/02 -DL5GAC,JN47UT,,,Robert,,144: 400W 15el CueDee CF300DTR,08/04 +DL5CC,JO64AD,,,ex DL5KVD,,144: 17el 600W2500lpm DTR,12/04 +DL5DAV,JO31,,,,,,1994 +DL5DTA,JO61SD,EME,,,,144: 4x11el EME Pwr GaasFet DSP59.134 DT,08/99 +DL5EBS,JO31LH,,,,,144: FT847 150 W 13 el Yagi,08/03 +DL5FDP,JN49LP,,,,,,11/02 +DL5GAC,JN47UT,,,,,144: 400W 15el CueDee CF300DTR,08/04 DL5IO,JN49NI,,,,,,01/97 -DL5LF,JO54,EME,,Frank,,432: 1KW 4x9el 9BV 8.5lb - 1296: 20W 23el.010,08/00 -DL5MAE,JN58VF,EME,,Wolfgang,,144: 8x17el 700WDTR,01/05 -DL5MAM,JN58UB,,,Karl,,144: 100W 10el,07/04 -DL5MCG,JN58KH,,,Wilhelm,,144: 11el 500W3000lpm,01/05 -DL5ME,JO52SD,,,Mario ""Mao",,144: 100W 18el3000lpm,04/04 -DL5MEL,JN58,,,Sigi,,144: 600W 11el,03/00 -DL5NEN,JN59MO,,,Thomas,,144: 12el GS35b MGF1302 - 432: 28el GS35b - 1,12/97 -DL5OAU,JO52GW,,,Ulrich,,,01/03 -DL5QQ,JO32KB,EME,,Thorsten,,.060.330,04/96 +DL5MAE,JN58VF,EME,,,,144: 8x17el 700WDTR,07/05 +DL5MAM,JN58UB,,,,,144: 100W 10el,07/04 +DL5MCG,JN58KH,,,,,144: 11el 500W3000lpm,01/05 +DL5ME,JO52SD,,,ex DL6CIA,,144: 100W 18el3000lpm,04/04 +DL5MEL,JN58,,,,,144: 600W 11el,03/00 +DL5NEN,JN59MO,,,ex DH5NBE,,144: 12el GS35b MGF1302 - 432: 28el GS35b - 1,12/97 +DL5OAU,JO52GW,,,,,,01/03 +DL5QQ,JO32KB,EME,,,,.060.330,04/96 DL5RBW,JN58VF,,,,,,2003 DL5RDO,JN59VN,,,,,,1992 -DL5ROB,JN68HG,,,Robert,,144: 300W 16el BF981MSDSP,08/02 -DL5WG,JO52VK,,,Rolf ""Roy",,50: 20W 4el - 144: 300W 2x11el144 DTR 250,05/04 -DL5XV,JO53AP,,,Bernd,,144: 2x15el 600W.128.228,07/01 +DL5ROB,JN68HG,,,ex DG5CH,,144: 300W 16el BF981MSDSP,08/02 +DL5WG,JO52VK,,,ex Y52WG- DL6CRS,,50: 20W 4el - 144: 300W 2x11el144 DTR 250,05/04 +DL5XV,JO53AP,,,,,144: 2x15el 600W.128.228,07/01 DL5YAS,JO31WS,,,,,,12/01 -DL5YET,JO41EV,,,Markus,,144: 750W 13el - 432: 750W2000lpm DTR,04/02 -DL5ZA,JO51HK,,,Reinhard,,144: IC706 100W 14el F9FT,01/04 -DL6BF,JO32QI,,,Heinz,,144: 250W 13el - 432: 150W 4x11elDTR 2500l,05/03 -DL6EAT,JO43VR,,,Andreas,,,01/97 -DL6KR,JO30NQ,,,Martin,,,05/04 -DL6LAU,JO53CF,EME,,Carsten,,,07/03 -DL6MFK,JN67,,,Robert,,,05/03 -DL6NAA,JO50VF,EME,,Reinhold,,,10/00 -DL6NCI,JO50VI,,,lorenz,,,1993 -DL6RDR,JN68BM,,,Stephan,,.065,10/95 +DL5YET,JO41EV,,,,,144: 750W 13el - 432: 750W2000lpm DTR,04/02 +DL5ZA,JO51HK,,,,,144: IC706 100W 14el F9FT,01/04 +DL6BF,JO32QI,,,,,144: 250W 13el - 432: 150W 4x11elDTR 2500l,05/03 +DL6KR,JO30NQ,,,,,,10/05 +DL6LAU,JO53CF,EME,,,,,07/03 +DL6MFK,JN68JA,EME,,,,,01/06 +DL6NAA,JO50VF,EME,,,,,10/00 +DL6NCI,JO50VI,,,,,,1993 +DL6RDR,JN68BM,,,,,.065,10/95 DL6UAL,JO61XU,,,,,144: 750W 2x BigWheel,12/00 -DL6WT,JN39VV,EME,,Jürgen,,.030.260,04/96 -DL6WU,JN49HT,EME,,Günter,,,02/04 -DL6YCY,JO41,,,Maik,,,12/99 -DL6YEH,JO32VA,EME,,Andreas ""Andy",,144: IC730 LT2S 749W 2x2.2wl 9BV - 432: IC7,03/02 -DL6YFB,JO31KM,,,reinhard,,,01/96 -DL6ZAU,JO40JF,,,Gerd,,FT736+MHP145 144: 350W 2x12el M2145 3000 DTR,09/03 -DL6ZBN,JO40ED,,,Joerg ""Joe",,144: TS700S 80W 11el MGF1302DTR 3500lpm,05/02 -DL7AJA,JO40AQ,,,Friedhelm ""Fred",,144: IC-706MKIIG 3CX1500A7 MGF1302 17el. T,11/04 -DL7AKA,JO62QO,EME,,HansJürgen ""Hajo",,144: TR7 Trvt 2x4CX250b 15el DJ9BV.144 25,01/01 -DL7APV,JO62,EME,,Bernd,,,08/00 -DL7ARM,JO62RJ,,,Christian,,,12/95 +DL6WU,JN49HT,EME,,,,,02/04 +DL6YCY,JO41,,,,,,12/99 +DL6YEH,JO32VA,EME,,ex DG3YFB,,144: IC730 LT2S 749W 2x2.2wl 9BV - 432: IC7,03/02 +DL6YFB,JO31KM,,,ex DH4YAT,,,01/96 +DL6ZAU,JO40JF,,,,,FT736+MHP145 144: 350W 2x12el M2145 3000 DTR,09/03 +DL6ZBN,JO40ED,,,currently not active 01/04,,144: TS700S 80W 11el MGF1302DTR 3500lpm,05/02 +DL7AJA,JO40AQ,,,ex DC9PX,,144: IC-706MKIIG 3CX1500A7 MGF1302 17el. T,11/04 +DL7AKA,JO62QO,EME,,,,144: TR7 Trvt 2x4CX250b 15el DJ9BV.144 25,01/01 +DL7ARM,JO62RJ,,,,,,12/95 DL7AUK,JO62,,,,,,2003 -DL7DCU,JO41BC,,,Jan,,144: FT767 100W 4x11el MGF1302only SSB-MS,03/99 -DL7FF,JO62TJ,EME,,Bernd,,HF 100W FD4 - 144: 4x11el 1KW.063 DSP.370,05/02 -DL7QY,JN59BD,,,Claus,,,01/97 -DL7TX,JN49IV,,,Peter,,144: 50W 6el - 432: 17el 100W,11/01 -DL7UAE,JO62PH,EME,,Thomas,,FT736R 50: PA Tonna20505 - 144: GS35 4x3wl (,01/05 -DL7UDA,JO62TK,EME,,Dietmar,,144: IC275H GS35b 17el F9FT 432: IC475H GS3,12/04 +DL7DCU,JO41BC,,,ex DG7DCU,,144: FT767 100W 4x11el MGF1302only SSB-MS,03/99 +DL7FF,JO62TJ,EME,,ex DL7UTS,,HF 100W FD4 - 144: 4x11el 1KW.063 DSP.370,04/05 +DL7PP,JO30SE,,,,,FT920-6m Transverter 144: 2x 11el F9FT 50:,08/05 +DL7QY,JN59BD,,,,,,01/97 +DL7TX,JN49IV,,,ex DC7AP,,144: 50W 6el - 432: 17el 100W,11/01 +DL7UAE,JO62PH,EME,,,,FT736R 50: PA Tonna20505 - 144: GS35 4x3wl (,07/05 +DL7UDA,JO62TK,EME,,,,144: IC275H 2xGI7B 17 el F9FT (GS35B 2x10el D,08/05 DL7UGB,JO62,,,,,,05/97 DL7ULE,JO62,,,,,,12/95 DL7ULM,JO62SN,,,,,,05/01 DL7UME,JO62SN,,,,,,2003 -DL7YC,JO62PK,,,Manfred,,HF: 400W - 50: 10W - 144: 200W - 432: 750W -,09/03 -DL7YW,JO62RK,EME,,Jürgen,,.320,01/02 -DL8AKI,JO51,,,Sigi,,,11/95 +DL7YC,JO62PK,,,,,HF: 400W - 50: 10W - 144: 200W - 432: 750W -,09/03 +DL7YW,JO62RK,EME,,ex DC7OL,,.320,01/02 +DL8AKI,JO51,,,,,,11/95 DL8BBL,JO42,,,,,,04/04 -DL8BDU,JO43AA,,,Klaus,,144: 600W 15el,08/04 -DL8CMM,JO52VM,,,Günter,,.137,05/04 -DL8DAT,JO31,EME,,manfred,,,1993 +DL8BDU,JO43AA,,,,,144: 600W 15el,04/05 +DL8CMM,JO52VM,,,,,.137,05/04 +DL8DAT,JO31,EME,,,,,1993 +DL8DBU,JO30NP,,,ex DG8FCB DH6DAH,,TS2000,07/05 DL8DUL,JO61,,,,,,08/04 -DL8EBW,JO31NF,EME,,Guido ""Guy",,144: TS2000 12el M2-10°elev GU74b SSB-Preamp,02/05 -DL8FBD,JO40,,,g.,,,1993 -DL8GAM,JN37,,,Urs,,144: TS870 600W 11elDTR,12/97 -DL8GP,JN39LH,EME,,Hans W.,,144: SE400/Icom 761/LT2S 750W 4xCrossyagis (,08/04 -DL8HCZ,JO53AP,,,Joachim,,DTR,11/00 -DL8LAQ,JO43XU,,,Norbert,,144: TS850 LT2S 350Watts Preamp 17el Tonn,01/01 -DL8NBN,JN58,,,a.,,,1993 -DL8OBU,JO42XI,EME,,Jürgen,,432MHz: 750W 4x33el - 1296MHz: 150W 67el1881,11/01 -DL8SCL,JN48RM,EME,,georg,,,03/01 -DL8SCQ,JN48RV,,,Eberhard,,DTR,07/99 -DL8UCC,JO71EQ,EME,,Helge,,144: 500W 2x11el or 2x17el,07/04 -DL8YE,JO31MH,,,Christian,,144: FT221r 17el M2 350W,07/04 -DL8YET,JO31MH,,,,,,01/05 -DL8YHR,JO41GV,EME,,Frank,,50: LT6S 2x9el M2 - 144: 24el M2 750WDTR tx,01/05 -DL9AN,JO62RE,,,Bernd,,50: 10W 5el - 144: FT736r 750W GS35b 2x12el,08/04 -DL9BDM,JO33RL,,,eilert,,,1993 +DL8EBW,JO31NF,EME,,ex DD0EF,,TS2000 or IC275H 144: 2x 12el M2 full Elv 750,06/06 +DL8FBD,JO40,,,,,,1993 +DL8GAM,JN37,,,,,144: TS870 600W 11elDTR,12/97 +DL8GP,JN39LH,EME,,,,144: SE400 FT847 4cx250b GS35b 90mtr.coax,04/05 +DL8HCZ,JO53AP,,,= CT1HZE,,DTR,11/00 +DL8LAQ,JO43XU,,,,,144: TS850 LT2S 350Watts Preamp 17el Tonn,01/01 +DL8NBN,JN58,,,,,,1993 +DL8OBU,JO42XI,EME,,,,432MHz: 750W 4x33el - 1296MHz: 150W 67el1881,11/01 +DL8SCL,JN48RM,EME,,,,,03/01 +DL8SCQ,JN48RV,,,,,DTR,07/99 +DL8YE,JO31MH,,,ex DL8YET,,50: FT897D 3el 7ZB - 144: FT221r 17el M2 GS3,04/06 +DL8YHR,JO41GV,EME,,ex DH8YHR,,50: LT6S 2x9el M2 - 144: 24el M2 750WDTR tx,11/05 +DL9AN,JO62RE,,,ex DL7UME,,50: 10W 5el - 144: FT736r 750W GS35b 2x12el,08/04 +DL9BDM,JO33RL,,,,,,1993 DL9DBJ,JO31VH,,,,,,12/94 DL9EBF,JO31FH,,,,,,2003 -DL9EBL,JO31,EME,,karl,,,1994 DL9GBH,JN48RW,,,,,,12/01 -DL9GRE,JO64PA,,,Stefan,,,08/02 -DL9GS,JO31OM,EME,,Alfred,,DTR,03/01 +DL9GRE,JO64PA,,,,,,08/02 +DL9GS,JO31OM,EME,,,,DTR,03/01 DL9IM,JO31,,,,,,07/04 -DL9KR,JO40DE,EME,,Jan,,,09/02 -DL9MCC,JN58UA,,,Johann (Hans),,144: 4x 2-4wl 700W MGF1302 - 432: 2x 7wl 700W,08/03 -DL9MS,JO54WC,EME,,Joachim,,144: 4x17el GS35b MGF1302160 DTR 3500lpm360,11/04 +DL9MCC,JN58UA,,,,,144: 4x 2-4wl 700W MGF1302 - 432: 2x 7wl 700W,08/03 +DL9MS,JO54WC,EME,,ex DL9GJW,,144: 4x17el GS35b MGF1302160 DTR 3500lpm360,11/05 DL9NDD,JN59KN,,,,,,2003 -DL9OA,JO64EB,,,Bernd,,144: IC821 100W 9el/2.5wl CF300MSDSP,03/02 -DL9OBD,JO42QN,EME,,Thomas ""Tom",,IC7400 144: 4x11el 750W BF981 - 50: 5el 25,10/03 +DL9OA,JO64EB,,,,,144: IC821 100W 9el/2.5wl CF300MSDSP,03/02 +DL9OBD,JO42QN,EME,,,,IC7400 144: 4x11el 750W BF981 - 50: 5el 25,04/05 DL9RCI,JN68,,,,,,07/95 -DL9USA,JO71EN,,,Andreas,,144: 10el DL6WU 300W RXAmpl3000lpm MSDSP,09/03 +DL9USA,JO71EN,,,,,144: 10el DL6WU 300W RXAmpl3000lpm MSDSP,09/03 DL9YEY,JO41GV,,,,,,2003 -DM1CG,JO31IC,,,Carsten ""Gaby",,50: TenTec 526 10W 4ele 144: TS 850 LT2SMK,01/05 -DM1HD,JO31GD,,,Herbert,,144: TS850S LT2S HLV600 600Watt 17 EL M2only,08/02 -DM2BHG,JO51MW,EME,,Heinz,,144: 4x17el 2xGS35b MGF1302,02/01 -DM2DXG,JO51MV,,,Bernhard,,,06/02 +DM1CG,JO31IC,,,ex DG1ELE,,50: TS 850 LT6 4el - 144: TS 850 LT2S 6,09/05 +DM1HD,JO31GD,,,ex DC1JP,,144: TS850S LT2S HLV600 600Watt 17 EL M2only,08/02 +DM2BHG,JO51MW,EME,,ex HZ1AB- Y22HG,,144: 4x17el 2xGS35b MGF1302,04/05 +DM2DXG,JO51MV,,,,,,06/02 DM2ECM,JO62GJ,,,,,,11/01 -DM2GS,JO42HJ,,,Günther,,,12/04 +DM2GS,JO42HJ,,,,,,12/04 +DM2HB,JO41EQ,,,,,144: IC-706MK2G 50W 11el F9FT,04/06 DM2PG,JO51,,,,,,04/03 -DM3FG,JN49LT,,,Frederico,,,04/03 -DM3FM,JO40MF,,,Matthias,,144: IC275H 8el 7ZH,06/02 -DM4KA,JO64II,,,Stephan,,,03/03 -DN1FC,JO41RF,,,OP DL3ZBA,,IC820H 144: 250W 2x11el- 432: 130W 2x23el Pr,07/01 -DN1MA,JN58VF,,,OP: DN1MA- DL5MAE,,144: 8x17el 700WDTR,12/00 -DN2MS,JO31OM,,,OP DJ2QV,,144: C5400 HG51 400W 9el MGF1302DTR,12/98 -DO1CTL,JO60LT,,,Frank,,,08/01 -DO1EDK,JO31RL,,,Dirk,,,05/04 +DM2SR,JO53HR,EME,,ex DO4LSR,,144: IC-910 8874 450W PA 2M18XXX Yagi pre,10/05 +DM3FG,JN49LT,,,DO3FG,,,04/03 +DM3FM,JO40MF,,,,,144: IC275H 8el 7ZH,06/02 +DM4KA,JO64II,,,,,,03/03 +DN1FC,JO41RF,,,,,IC820H 144: 250W 2x11el- 432: 130W 2x23el Pr,07/01 +DN1MA,JN58VF,,,,,144: 8x17el 700WDTR,12/00 +DN2MS,JO31OM,,,Specialcall,,144: C5400 HG51 400W 9el MGF1302DTR,12/98 +DO1CTL,JO60LT,,,,,,08/01 +DO1EDK,JO31RL,,,,,Kenwood TR-751E,08/05 DO1EL,JO31JL,,,,,,06/02 -DO1ERS,JO31JC,,,Ruediger,,144 : FT 221R 10Watt 4el Yagi WIMO RX-PA06,01/04 DO1NF,JN69,,,,,,08/01 -DO1YDS,JO42HJ,,,Daniel,,,04/04 -DO3MT,JN67,,,Tom,,FT817,01/03 +DO1YDS,JO42HJ,,,,,,04/04 +DO2TC,JO73AO,,,,,,04/05 +DO3MT,JN67,,,,,FT817,01/03 DO5AN,JO31,,,,,,04/02 -DO9ST,JN49VW,,,Thomas,,,03/01 -EA1ABZ,IN71QO,EME,,Ramiro (Rami),,144: 4x12el or 11el DL6WU 1500W (4CX250+GS35B,10/02 +DO9ST,JN49VW,,,,,,03/01 +DP5G,JO31IC,,,Specialcall,,,04/06 +DQ2006E,JO53HR,EME,,SpecialCall,,,05/06 +DQ2006F,JN49EX,EME,,SpecialCall,,,05/06 +DQ2006P,JN47NX,EME,,SpecialCall,,,06/06 +DQ2006Q,JN39PN,,,SpecialCall,,144: hg70d pa 2x 8el Yagis,05/06 +DQ2006R,JO31NF,EME,,Specialcall,,IC275H or TS2000 144: 2x 12el M2 full elev 7,05/06 +DZ1JP,PK04NC,EME,,,,,03/20 +EA1ABZ,IN71QO,EME,,,,144: 4x12el or 11el DL6WU 1500W (4CX250+GS35B,10/02 EA1AIB,IN82TK,,,,,,08/95 +EA1BBE,IN62BH,EME,,,,,10/05 EA1BFZ,IN81SS,,,,,,04/04 -EA1BLA,IN53UM,,,Manel,,50: 100W 5el - 144: 1kw 12el MGF1302 - 432,10/02 -EA1CRK,IN73DM,,,Carlos,,Kenwood ts-790e or Icom 706 MkII 50: 100W 7,01/04 -EA1CYE,IN83,,,p.,,,1993 -EA1DDU,IN73FM,,,Domingo Alvar ""Domi",,50: 10W 5el - 144: 170W 16el CF300 - 432: 120,08/03 -EA1DOD,IN73AN,EME,,alfredo,,,1993 -EA1EBJ,IN73FF,,,Santurio,,50: IC729 10W 4el - 144: IC260 80W 17el - 432,04/01 -EA1EW,IM79WS,,,Miguel A.,,,07/95 -EA1JK,IN72RA,,,EA1JK,,only SSB-MS,01/01 -EA1KV,IN52PF,,,Andres,,,1993 -EA1OD,IN73EM,,,j.c.,,,1990 -EA1RX,IN52PF,,,Enrique,,IC706 MKIIG,06/03 -EA1SH,IN63GA,,,Manuel,,144: 17B2 170W GaAs-Fet - 432: 31el 180W GaAs,05/04 -EA1YV,IN52OC,EME,,Agustin,,50: IC706 2x5el - 144: TS790e GS35b 2x17elB2,10/02 +EA1BLA,IN53UM,,,,,50: 100W 5el - 144: 1kw 12el MGF1302 - 432,10/02 +EA1BLX,IN53VK,,,= EB1BXW,,,04/06 +EA1CRK,IN73DM,,,,,Kenwood ts-790e or Icom 706 MkII 50: 100W 7,01/04 +EA1CYE,IN83,,,,,,1993 +EA1DDO,IN53UI,,,,,144: 17B2 100W pHEMT 432: 50W 31el 1296: 1,07/05 +EA1DDU,IN73FM,,,,,50: 10W 5el - 144: 170W 16el CF300 - 432: 120,08/03 +EA1DOD,IN73AN,EME,,,,,1993 +EA1EBJ,IN73FL,,,,,50: IC729 BV6-1wl - 144: IC275H BV2-4wl - 4,03/06 +EA1EW,IM79WS,,,,,,07/95 +EA1JK,IN72RA,,,,,only SSB-MS,01/01 +EA1KV,IN52PF,,,,,,1993 +EA1OD,IN73EM,,,,,,1990 +EA1RX,IN52PF,,,ex EA1BSK,,IC706 MKIIG,06/03 +EA1SH,IN63GA,,,=EB1FIF,,144: 17B2 170W GaAs-Fet - 432: 31el 180W GaAs,05/04 +EA1YV,IN52OC,EME,,,,50: IC706 2x5el - 144: TS790e 1KW 4x 17el M2,01/06 EA2AF,IN92,,,,,,1990 -EA2AGZ,IN91DV,EME,,Nicolas,,FT1000MP- FT736 144: 4CX1500b 4x17B2CC MGF140,07/04 -EA2AJX,IN83,,,Inaki,,50: 10W Dipol - 144: 100W 6el Quadonly SSB-MS,08/02 +EA2AGZ,IN91DV,EME,,,,FT1000MP- FT736 144: 4CX1500b 4x17B2CC MGF140,07/04 EA2ARD,IN93,,,,,,08/02 EA2AVY,IN92DS,,,,,,2003 -EA2KP,IN83MG,,,Miguel ""Mixtel",,144: TR751E 2M18XXX 200W Preamp - 432: 100W 2,04/04 -EA2LU,IN92ET,EME,,Jorge,,144: 4x9el 1KW MGF1302.127 DTR,10/02 -EA2LY,IN93AH,,,Enrique Gil,,144: TS790 4CX1500 LNA144 2x18elDTR,08/98 +EA2KP,IN83MG,,,ex EA2AKP,,144: TR751E 2M18XXX 200W Preamp - 432: 100W 2,04/04 +EA2KP/7,IM97CF,,,,,144: 200W 8el Quad or 9el,01/06 +EA2LU,IN92ET,EME,,,,144: 8x9el 750 W MGF1302.127 DTR,01/06 +EA2LY,IN93AH,,,ex EA4LY,,144: TS790 4CX1500 LNA144 2x18elDTR,08/98 EA2RCF,IN82,,,,,,08/02 -EA3ADW,JN11CQ,EME,,J.Miguel (John),,,10/02 +EA2RL,IN83MG,,,ex EA2AJX,,50: 10W Dipol - 144: 100W 6el Quad,07/05 +EA3ADW,JN11CQ,EME,,,,,10/02 EA3AEL,JN01,,,,,,1993 -EA3AIR,JN11,,,j.i.,,,1993 -EA3AQJ,JN11BJ,,,ramon,,,1987 -EA3AXV,JN01TJ,,,Joaquim ""Quim",,144: FT920+trsv GS35b 17B2,07/03 -EA3BB,JN01VS,,,Pau,,144: 20el M2 400W MGF1302,01/00 +EA3AIR,JN11,,,,,,1993 +EA3AQJ,JN11BJ,,,,,,1987 +EA3AXV,JN01TJ,,,,,144: FT920+trsv GS35b 17B2,07/03 +EA3BB,JN01VS,,,ex EA3BBU,,144: 20el M2 400W MGF1302,01/00 EA3BEW,JN01SG,,,,,,12/95 -EA3BTZ,JN11BI,EME,,Enric,,144: 100W 16el 0.8db preamp,09/02 -EA3CN,JN11BI,,,Manuel,,,03/96 -EA3DUY,JN12LD,,,Tony,,144: 4x17el 800W - 50: 6 el 500W - 432: 21el,08/02 -EA3DXU,JN11CM,EME,,Jose Maria (Josep),,144: 2 x 17 El M2 + 4CX1500B - 432: 2 x 38 E,01/05 +EA3BTZ,JN11BI,EME,,,,144: 100W 16el 0.8db preamp,09/02 +EA3CN,JN11BI,,,ex EA3GAW,,,03/96 +EA3DUY,JN12LD,,,,,144: 4x17el 800W - 50: 6 el 500W - 432: 21el,08/02 +EA3DXU,JN11CM,EME,,,,144: 2x 17 El M2 + 4CX1500B - 432: 2 x 38 El,04/06 EA3ECE,JN01LT,,,,,only SSB-MS,11/97 -EA3EHQ,JN11HR,EME,,Jose m.,,,03/96 -EA3FLN,JN11KT,,,Jordi,,144: IC275H 450Watts GaAsFET preamp 0.6dB,04/04 +EA3EHQ,JN11HR,EME,,,,,03/96 +EA3ESE,JN01WR,,,,,144: TM-255 VLA200 SHF MVV144-VOX 13 el Y,04/06 +EA3FLN,JN11KT,,,,,144: IC275H 450Watts GaAsFET preamp 0.6dB,04/04 EA3GAW,JN11BI,,,,,,2003 -EA3GCJ,JN11EM,,,Amadeo,,Yaesu FT-107M,04/04 +EA3GCJ,JN11EM,,,,,Yaesu FT-107M,04/04 EA3GFB,JN11,,,,,,12/95 -EA3GIQ,JN01ND,,,Ramon,,,07/95 -EA3IH,JN11BJ,,,rafael,,,1987 -EA3KU,JN00JV,,,Fernando,,144: IC275H 2x4CX250 16el- preamp.113 DTR,07/03 +EA3GIQ,JN01ND,,,,,,07/95 +EA3IH,JN11BJ,,,,,,1987 +EA3KU,JN00JV,EME,,,,144: IC275H 2x4CX250 16el- preamp.113 DTR,04/05 EA3MD,JN11,,,,,,1994 -EA3MM,JN01WH,EME,,Radioclub,,,1993 -EA3PL,JN11PL,EME,,vicente,,,1994 -EA3TI,JN11JT,,,Ramon,,144: 17el 5lambda Yagi 400Wonly SSB-MS227,01/05 -EA3UM,JN01,EME,,magin c.,,,1994 -EA3URC,JN11,,,OP EB3GCP EB3FYM,,YAESU FT-100 ICOM IC-706MKII - 144: 50W 14el,05/03 -EA3WH,JN01,,,j.g.,,,1993 -EA4AMX,IM89AT,,,Jose Luis,,only SSB-MS,07/01 -EA4BAS,IN80HL,EME,,Miguel,,FT847 144: 17el 180W MGF1302 - 432: 35el 100W,09/02 +EA3MM,JN01WH,EME,,,,,1993 +EA3TI,JN11JT,,,,,144: 17el 5lambda Yagi 400Wonly SSB-MS227,01/05 +EA3UM,JN01,EME,,,,,1994 +EA3URC,JN11,,,SpecialCall,,YAESU FT-100 ICOM IC-706MKII - 144: 50W 14el,05/03 +EA3WH,JN01,,,,,,1993 +EA4AMX,IM89AT,,,,,only SSB-MS,07/01 +EA4BAS,IN80HL,EME,,,,FT847 144: 17el 180W MGF1302 - 432: 35el 100W,09/02 EA4ED,IM79FW,EME,,,,,1994 -EA4EHI,IM68TV,,,Jose Luis,,144: IC275H 1500W 4x17B22500lpm,07/01 -EA4EOZ,IN80CI,,,Miguel Angel,,144: TM255 9el 40WDTR 3000lpm,01/02 -EA4LU,IM68TV,,,Paco,,144: FT726r 400W 17el (17B2).080 1500lpm,04/03 -EA4SV,IM68MU,,,Roberto,,,04/04 -EA5AAJ,IM99SL,,,Manuel ""Dom",,144: IC-706MK2G 100W 9el,04/04 -EA5CJ,IM99TL,EME,,jacinto,,,1994 -EA5EMM,IM99,,,j.,,,1993 -EA5GIY,IM98XD,EME,,Eric,,,01/99 -EA5HM,IM99,,,p.r.,,,1993 -EA5IC,IM98,,,mario,,,1994 +EA4EHI,IM68TV,,,,,144: IC275H 1500W 4x17B22500lpm,07/01 +EA4EKH,IN80ND,EME,,,,144: 50Watt 9el,08/05 +EA4EOZ,IN80CI,,,,,144: TM255 9el 40WDTR 3000lpm,01/02 +EA4LU,IM68TV,,,ex EB4FQP,,144: FT726r 400W 17el (17B2).080 1500lpm,04/03 +EA4SV,IM68MU,,,ex EA4DQR,,,04/04 +EA5AAJ,IM99SL,,,,,144: IC-706MK2G 100W 9el,04/04 +EA5EMM,IM99,,,,,,1993 +EA5HM,IM99,,,,,,1993 +EA5IC,IM98,,,,,,1994 EA5NO,IM98FV,,,,,,08/97 -EA5SE,IM98IL,EME,,,,,11/04 -EA5ZF,IM99VT,EME,,Javier Oliver,,50: 50 W 3 el - 144: 800Watt 17el LNA145 -,08/03 -EA6ADW,JM19LU,EME,,Peter,,50: 20dbd- 144: 40W- 10el- up: div. Spiegel,07/97 -EA6DD,JM19JK,,,Biel,,144: IC706MKIIG 17elB2 100W,05/03 -EA6FB,JM08PV,EME,,Jose,,085 MSDSP,08/02 -EA6IB,JM09SB,,,OP EA6FB-6QB-EB6AOK,,144: IC251E 150W 15elYagi076 2000lpm MSDSP,04/02 -EA6NP,JM19MQ,,,juan miguel,,,1993 -EA6QB,JM08PV,,,Bartolome ""Bartolo",,144: 2x15el 4CX400MSDSP,05/03 -EA6SA,JM19IR,EME,,Josep,,144: FT847 2x4CX250 2x17el - 432: 4x33el,08/02 -EA6VQ,JM19HN,EME,,Gabriel,,144: 1.5KW MGF1302 8x17el M2 432: 21el,01/05 -EA7AJ,IM87CS,,,Juan,,144: 300W 2x 19el,08/04 -EA7DBH,IM76GD,,,miguel angel,,,1994 +EA5SE,IM98IL,EME,,,,144: 2x 17el 1.5K,04/06 +EA5ZF,IM99VT,EME,,ex EB5IFI,,144: 600W 2x 17el LNA145 432: 35W 2x 21e,09/05 +EA6DD,JM19JK,,,,,144: IC706MKIIG 17elB2 100W,05/03 +EA6FB,JM08PV,EME,,,,085 MSDSP,08/02 +EA6IB,JM09SB,,,,,144: IC251E 150W 15elYagi076 2000lpm MSDSP,04/02 +EA6NP,JM19MQ,,,,,,1993 +EA6QB,JM08PV,,,,,144: 2x15el 4CX400MSDSP,05/03 +EA6SA,JM19IR,EME,,,,144: FT847 2x4CX250 2x17el - 432: 4x33el,08/02 +EA6VQ,JM19HN,EME,,,,144: 2KW MGF1302 8x17el M2 432: 21el 11,04/05 +EA7AJ,IM87CS,,,,,144: 300W 2x 19el,08/04 +EA7DBH,IM76GD,,,,,,1994 +EA7DFH,IM87DD,,,,,FT-857 TS2000 17el 200w,03/06 EA7EYX,IM87CS,,,,,,12/04 -EA7HG,IM87CS,,,Uge,,,01/04 -EA7IT,IM87XI,,,John,,144: 14el 100W.147 1200lpm,10/00 -EA7OC,IM77OV,,,Luis R.,,144: IC820 250W 17el.330,03/01 -EA7RM,IM87CS,,,Manuel Abian (Nino),,144: TR9130 240W 17B2 OH5IY2000lpm,07/02 -EA7TL,IM76GC,,,juan lucas,,,05/96 -EA7TN,IM66VP,,,Nacho,,TS2000 144: 100 W 2.5 wl,10/04 -EA8FF,IL28,EME,,Mark,,,02/01 -EA9AI,IM75IV,,,Francisco Javier,,144: 100W 9el.070,06/03 -EA9MH,IM85NG,,,Manuel,,only SSB-MS.400,05/00 -EB1BKG,IN62BH,EME,,Pily,,,11/01 -EB1DNK,IN62CI,EME,,Jose Manuel,,144: IC706 4x17el 500 Watt MGF1302 - 432: 7,01/05 -EB1EFC,IN52OF,,,alfonso,,,1993 -EB1EHO,IN73DM,,,Luis,,144: 17el 200W - 432: 21el 50W130280,07/04 +EA7HG,IM87CS,EME,,,,144: 4x 9el 100w mgf1302,12/05 +EA7OC,IM77OV,,,,,144: IC820 250W 17el.330,03/01 +EA7RM,IM87CS,,,ex EA7GTF,,144: TR9130 240W 17B2 OH5IY2000lpm,07/02 +EA7TL,IM66VO,,,,,,05/05 +EA7TN,IM66VP,,,ex EA1AK/7,,TS2000 144: 100 W 2.5 wl,04/06 +EA9AI,IM75IV,,,,,144: 100W 9el.070,06/03 +EA9MH,IM85NG,,,,,only SSB-MS.400,05/00 +EB1BKG,IN62BH,EME,,,,,11/01 +EB1BXW,IN53VK,,,= EA1BLX,,,04/06 +EB1DNK,IN62CL,EME,,,,144: IC706 4x17el 500 Watt MGF1302 - 432: 7,04/06 +EB1EB,IN83BK,,,ex EB1IQC,,,08/05 +EB1EFC,IN52OF,,,,,,1993 +EB1EHO,IN73DM,,,,,144: 17el 200W - 432: 21el 50W130280,07/04 EB1EUW,IN82TK,,,,,,1995 -EB1IHY,IN52PM,,,Julian,,144: 17el 160W,07/04 -EB1ISN,IN71SW,,,Juanjo,,Icom 275H 16el Arake,12/04 -EB1IVY,IN53SJ,,,Gonzalo ""Zalo",,,07/02 -EB2AYV,IN83MG,,,George,,144: 250W 2M18XXX,01/04 -EB2DTP,IN82NS,,,Inigo,,FT847 IC746 FT816 17el 1000W,08/03 -EB3BAP,JN11CJ,,,Patxi,,144: FT736r 200W 17elonly SSB-MS,01/01 +EB1IHY,IN52PM,,,,,144: 17el 160W,07/04 +EB1ISN,IN71SW,,,,,Icom 275H 16el Arake,12/04 +EB1IVY,IN53SJ,,,,,,07/02 +EB2AYV,IN83MG,,,,,144: 250W 2M18XXX,01/04 +EB2DTP,IN82NS,,,,,FT847 IC746 FT816 17el 1000W,08/03 +EB2DVT,ÎN91MP,,,,,,03/06 +EB2FJN,IN83QE,,,,,144: 13B2 Ant 300W,04/06 +EB3BAP,JN11CJ,,,,,144: FT736r 200W 17elonly SSB-MS,01/01 EB3CNX,JN11DI,,,,,,1993 EB3EPR,JN01ND,,,,,,2003 -EB3GHU,JN11CJ,,,Ramon,,,04/04 -EB3WH,JN01WN,,,Juanjo,,,1993 -EB4DF,IM79QQ,,,Juan,,TS-790 FT-817 144: 500W 17el - 432: 500W 21,06/04 -EB4EQZ,IN80DK,,,,,only SSB-MS,08/96 -EB4ERS,IN80BH,,,Juan Carlos,,FT736 144: 140W 9el GaAs-Fetonly SSB-MS.385,01/00 -EB4EUB,IN80DJ,EME,,Toni,,50: 6el 100W - 144: 17el 1KW MGF1302 - 432: 2,08/00 -EB4FXD,IM78BX,,,Manolo,,144: 150W 17el,02/04 -EB4GIA,IN80CG,,,Pedro,,144: IC821 IC706 TS790 240W 17el - 432: 100W,02/98 -EB4TT,IN70XJ,,,Miguel,,.183 DTR,05/00 -EB5AYG,IM99TN,,,Paco,,144 FT902DM Trvt 4cx350 4x11el F9FT,05/03 -EB5AZO,IM99RA,,,Paul,,,11/04 -EB5EEO,IM98PG,EME,,Vicente,,144: FT736 2x17el 4CX1500 DSP - 432: FT736 4x,09/99 -EB5EHX,IM99,,,x.-a.,,,1993 -EB6AOK,JM09RB,,,Enrique,,144: 70W 9el,04/03 +EB3GHU,JN11CJ,,,,,,04/04 +EB3WH,JN01WN,,,,,,1993 +EB4DF,IM79QQ,,,,,TS-790 FT-817 144: 500W 17el - 432: 500W 21,06/04 +EB4EQZ,IN80EK,,,,,Yaesu ft-817 Yaesu FT-897only SSB-MS,08/05 +EB4ERS,IN80BH,,,,,FT736 144: 140W 9el GaAs-Fetonly SSB-MS.385,01/00 +EB4EUB,IN80DJ,EME,,,,50: 6el 100W - 144: 17el 1KW MGF1302 - 432: 2,08/00 +EB4FXD,IM78BX,,,,,144: 150W 17el,02/04 +EB4GIA,IN80CG,,,,,144: IC821 IC706 TS790 240W 17el - 432: 100W,02/98 +EB4TT,IN70XJ,,,ex EB4CXS,,.183 DTR,05/00 +EB5AYG,IM99TN,,,,,144 FT902DM Trvt 4cx350 4x11el F9FT,05/03 +EB5AZO,IM99RA,,,,,,11/04 +EB5EEO,IM98PG,EME,,,,144: FT736 2x17el 4CX1500 DSP - 432: FT736 4x,09/99 +EB5EHX,IM99,,,,,,1993 +EB6AOK,JM09RB,,,,,144: 70W 9el,04/03 EB7BQI,IM76SR,,,,,,06/03 -EB7COL,IM77AG,,,Jose,,,05/04 -EB7EFA,IM67XI,,,mairena,,,1995 -EB8ANY,IL18,EME,,Marc,,144: 500W 4x 7el,12/04 -EB8BTV,IL18QI,,,Fernando,,only SSB-MS,05/03 -ED1GSR,IM79WS,,,,,,1994 -ED4RKF,IM79WS,,,OP EB4GIA,,144: 240W 13el1500lpm,03/97 -ED5TOR,IN90XP,,,Op. DL3MGL,,,1993 -ED6EIG,JM19IM,,,,,only SSB-MS.243,08/99 -EG3TVC,JN11BI,,,OP EA3DXU,,144: 400W 17el M2.115,12/99 -EH1RX,IN52IN,,,Enrique,,IC706 MKIIG,03/02 -EH3AXV,JN01TJ,,,Joaquim ""Quim",,50: FT920+trsv GS35b 6elYagi150,07/02 +EB7COL,IM77AG,,,,,,05/04 +EB7EFA,IM67XI,,,,,,1995 +EB8ANY,IL18,EME,,,,144: 500W 4x 7el,12/04 +EB8BTV,IL18QI,,,,,only SSB-MS,05/03 +ED1GSR,IM79WS,,,Expedition,,,1994 +ED4RKF,IM79WS,,,Contestcall,,144: 240W 13el1500lpm,03/97 +ED5TOR,IN90XP,,,Expedition,,,1993 +ED6EIG,JM19IM,,,SpecialCall- QSL by EA6VC,,only SSB-MS.243,08/99 +EG3TVC,JN11BI,,,SpecialCall,,144: 400W 17el M2.115,12/99 +EH1RX,IN52IN,,,ex EH1BSK,,IC706 MKIIG,03/02 +EH3AXV,JN01TJ,,,,,50: FT920+trsv GS35b 6elYagi150,07/02 EH5RM,IM98,,,,,,07/02 EH7RM,IM76QM,,,,,,2003 EH9LS,IM75IV,,,,,,2003 -EI2CA,IO62,,,Paul,,only SSB-MS,1988 -EI2FSB,IO51DN,,,Tony,,144: 100W 2x9el,05/02 +EI/DL1YMK,IO41TU,EME,,Expedition,,,08/05 +EI/G0AFH/P,IO52AD,,,Expedition,,,01/06 +EI2CA,IO62,,,,,only SSB-MS,1988 +EI2FSB,IO51DN,,,,,144: 100W 2x9el,05/02 EI2VPX,IO53IQ,,,,,,1991 -EI3GE,IO63XD,,,Jim,,only SSB-MS,08/00 -EI4DQ,IO51WU,EME,,Tom,,144: TS711 4CX1500b MGF1302 4x14el or 13el500,08/02 -EI4VBE,IO42,,,OP DF1ZE,,,1988 -EI4VBS,IO42,,,,,,1990 -EI4VWY,IO54,,,,,,08/01 -EI4VWZ,IO55,,,,,,08/01 -EI5FK,IO51RT,EME,,Charles,,144: FT847 150W 9elMSDSP,05/04 -EI5HN,IO41UT,,,OP DF6NA,,,1995 -EI6CPB,IO63WE,,,Hugh,,50: IC706 - 144: IC821.310,06/03 +EI3GE,IO63XD,,,,,only SSB-MS,08/00 +EI4DQ,IO51WU,EME,,,,144: TS711 4CX1500b MGF1302 4x14el or 13el500,03/05 +EI4VBE,IO42,,,Expedition,,,1988 +EI4VBS,IO42,,,Expedition,,,1990 +EI4VWY,IO54,,,Expedition,,,08/01 +EI4VWZ,IO55,,,Expedition,,,08/01 +EI5FK,IO51RT,EME,,,,144: FT847 150W 9elMSDSP,03/05 +EI5HN,IO62,,,Expedition,,,05/06 +EI6CPB,IO63WE,,,,,50: IC706 - 144: IC821.310,06/03 EI6GF,IO62RG,,,,,,02/98 -EI7IX,IO53FT,,,Dermont,,TS2000,08/04 +EI7IX,IO53FT,,,,,TS2000,08/04 +EI7IX/p,IO43XW,,,Expedition,,TS2000,04/05 EI7RCG,IO62,,,,,144: 27el,08/96 -EI7RSD,IO62WX,,,OP EI2CA,,144: 27el 400Wattsonly SSB-MS.225,07/96 -EI9HW,IO63MP,,,John,,,10/93 -EJ4VNX,IO43,,,,,,1993 -EJ6O,IO43MM,,,,,,1994 +EI7RSD,IO62WX,,,,,144: 27el 400Wattsonly SSB-MS.225,07/96 +EI9HW,IO63MP,,,,,,10/93 +EJ4VNX,IO43,,,Specialcall,,,1993 +EJ6O,IO43MM,,,Specialcall,,,1994 EM1U,FC74US,,,,,,2003 -ER1AN,KN46KX,,,Sergei,,144: FT857 200W 2x10el,12/04 -ER2RM,KN46KA,,,,,,11/05 -ER5AA,KN45CW,,,Vasilij,,,06/00 +ER1AN,KN46KX,,,ex ER5OIW UO5OIW,,144: FT857 200W 2x10el,12/04 +ER2RM,KN46KA,,,ex ER5OK,,,11/05 +ER5AA,KN45CW,,,ex UO5OB,,,06/00 ER5AL,KN45CW,,,,,,07/02 -ER5OIW,KN46KX,,,,,,01/05 -ER5OK,KN46KA,,,,,,01/05 -ES0Q,KO17AV,,,Tom,,,06/04 -ES0X,KO18,EME,,OP ES2RJ,,,07/99 -ES1CW,KO29HK,,,Arvo,,,05/98 -ES1RF,KO29IJ,EME,,Gennadi ""Gene",,FT1000MP/FT847/FT736 Preamps 50: 2x5el 500W,02/04 -ES2CM,KO29DJ,,,Aimar,,ICOM-706 mkIIG,01/03 -ES2NA,KO29JL,,,Andrus ""Andy",,144: IC706MKII 300W 9el137,04/02 -ES2QH,KO29LL,,,Aarne,,144 : FT847 700Watts 9ele Preamp - 432: IC82,08/01 -ES2RJ,KO29JM,,,Toomas ""Tom",,144: TS790 350W 9el.177 DTR 3000lpm.210,05/03 -ES2RQ,KO28WA,,,,,,01/05 +ES/DK2ZF,KO08,EME,,Expedition,,,07/06 +ES0/DH8BQA,KO08XM,,,Expedition,,,07/05 +ES0Q,KO17AV,,,Specialcall,,,06/04 +ES0X,KO18,EME,,Expedition,,,07/99 +ES1CW,KO29HK,,,,,,05/98 +ES1RF,KO29IJ,EME,,ex UR2RGM,,FT1000MP/FT847/FT736/TS2000+Trans.+Preamps 5,04/06 +ES2CM,KO29DJ,EME,,,,ICOM-706 MKIIG 144: 4x 14el 600W,04/06 +ES2NA,KO29JL,,,,,144: IC706MKII 300W 9el137,04/02 +ES2QH,KO29LL,,,,,144 : FT847 700Watts 9ele Preamp - 432: IC82,08/01 +ES2RJ,KO29JM,EME,,,,144: TS790 350W 9el177 DTR 3000lpm210,01/06 ES2WX,KO29JN,,,,,,05/03 ES3BR,KO28JS,,,,,,05/04 -ES3GZ,KO28,,,jaan,,,1993 -ES5KJ,KO38IJ,,,Tom,,,01/05 +ES3GZ,KO28,,,,,,1993 +ES3RF,KO29IF,EME,,ex UR2RGM ES1RF/3,,FT1000MP/FT847/FT736 Preamps 50: 2x5el 500W,03/06 +ES4Q,KO39BD,,,Expedition,,,08/05 +ES5KJ,KO38IJ,,,,,,01/05 ES5MC,KO38JJ,,,,,,12/95 -ES5MG,KO38IJ,,,Guido,,,1/94 +ES5MG,KO38IJ,,,,,,1/94 ES5PC,KO38IK,,,,,,08/98 ES5RE,KO38,,,,,,1994 ES5RN,KO38,,,,,,1994 -ES5RY,KO38JI,,,Toomas,,,11/02 +ES5RY,KO38JI,,,,,,11/02 ES5WE,KO38JJ,,,,,,1994 -ES6DO,KO27WX,,,Neil,,IC706MKII + Preamp 50: 4el - 144: 15el 3,09/03 -ES6LBN,KO37AW,,,Rein,,144: 170W 11el366,07/04 -ES6RQ,KO28WA,EME,,Ants,,TS2000 FT736 FT847 144: 1KW 4x18el 9BV,08/04 +ES6DO,KO27WX,,,ex UR1RYY- UR2RDO,,IC706MKII + Preamp 50: 4el - 144: 15el 3,09/03 +ES6LBN,KO37AW,,,,,144: 170W 11el366,07/04 +ES6RQ,KO28WA,EME,,ex UR2RQT UR2RQ,,TS2000 FT736 FT847 144: 2KW 8x17el M2 + 1x 1,07/05 +ES7GN,KO28TI,,,,,144: 2x 14el 5wl,08/05 ES8AS,KO28FJ,,,,,,04/04 -ES8X,KO18XC,EME,,OP ES2RJ,,144: TS790E+PA 300W 2x9 el or FT 847+ PA 30,07/02 -EU1AA,KO33SJ,,,,,,01/05 -EU1AB,KO33SU,,,George,,,01/96 -EU6MS,KO45IN,,,Victor,,144: 16el 700W MGF1302.178 2000lpm.300,09/01 +ES8X,KO18XC,EME,,Expedition,,144: TS790E+PA 300W 2x9 el or FT 847+ PA 30,07/02 +EU1AB,KO33SU,,,ex UC2AAB,,,01/96 +EU6MS,KO45IN,,,ex RC2WBH,,144: 16el 700W MGF1302.178 2000lpm.300,09/01 EV2AA,KO33PM,,,,,,2003 EV2AAB,KO33ST,,,,,,2003 EV2OEU,KO52IK,,,,,,2003 -EV5M,KO43KB,,,OP DL5BAC- DJ9YE,,,1994 -EV5N,KO42RX,,,OP DL5BAC- DJ9YE,,,1994 -EW1RZ,KO33SV,,,Sergej,,,10/01 -EW6AL,KO46KB,,,Aleksej,,.178 3000lpm,08/98 -EW6DX,KO45JL,,,Igor,,144: 100W 9el.087 800lpm,08/97 -EW6FS,KO35LB,,,Anton,,144: 20W 2x16el F9FT Preamponly SSB-MS.300,01/03 -EW6GB,KO45CN,,,Andy,,144: 200W 10elMSDSP.300,08/02 -EW7IM,KO53,,,anatoly,,,1992 +EV5M,KO43KB,,,Expedition,,,1994 +EV5N,KO42RX,,,Expedition,,,1994 +EW1RZ,KO33SV,,,,,,10/01 +EW6AL,KO46KB,,,Expedition- QSL via EU6MS,,.178 3000lpm,08/98 +EW6DX,KO45JL,,,,,144: 100W 9el.087 800lpm,08/97 +EW6FS,KO35LB,,,,,144: 20W 2x16el F9FT Preamponly SSB-MS.300,01/03 +EW6GB,KO45CN,,,,,144: 200W 10elMSDSP.300,08/02 +EW7IM,KO53,,,ex UC2SMM,,,1992 EW7IN,KO53,,,,,,1994 EW7IW,KO53DR,,,,,,2003 -EW8DD,KO42QA,,,Valentin,,144: 4x16el F9FT- 50W,12/98 -EY8MM,MM48FI,EME,,,,144: 200W 2 yagi,10/04 -F0DBD,JN08XW,,,Frederick,,FT726R 10W 10el Preamp,01/02 +EW8DD,KO42QA,,,,,144: 4x16el F9FT- 50W,12/98 +EY8MM,MM48FI,EME,,,,144: 200W 2x 10el,06/05 +F/DL1GI,IN77UU,,,Expedition,,,06/06 +F0DBD,JN08XW,,,,,FT726R 10W 10el Preamp,01/02 F0EJW,IN78,,,,,,12/04 -F1AFJ,JN06HT,EME,,Jean-Pierre ""John",,144: 4x11el F9FT 1500 W 0.4dB2000lpm WINDSP,11/04 -F1AKK,JN39CC,,,Oli,,only SSB-MS,07/01 +F1AFJ,JN06HT,EME,,,,144: 4x11el F9FT 1500 W 0.4dB2000lpm WINDSP,11/04 +F1AKK,JN39CC,,,,,only SSB-MS,07/01 F1AOE,IN93RS,,,,,,04/04 F1CCM,IN93MP,,,,,,1993 -F1CNE,JN28,EME,,denis,,,1994 F1DLZ,JN19FH,,,,,,05/04 -F1DUZ,IN97NJ,,,Philippe,,144: FT225RD 2x 4CX250R 700W 2 x 11el pre,12/04 -F1EBK,JN18BW,EME,,Patrick,,144: TS790A 300W 4x10el DK7ZB,11/04 +F1DUZ,IN97NJ,EME,,,,144: FT897D 2x 4CX250R 600W 4x 11el LNA 9,04/06 +F1EBK,JN18BW,EME,,,,144: TS790A 300W 4x10el DK7ZB,11/04 F1EBN,JN18JR,,,,,,08/02 -F1ELL,JN18EX,EME,,robert,,,1994 -F1FEN,JN25JC,EME,,gilles,,,1994 F1FHI,IN97GD,,,,,,2003 -F1FIH,JN23GS,,,Michel,,,04/03 -F1FLA,JN26KU,EME,,Jena-Jacques,,144: 4x25el Xpol 7.6lb 1KW MGF1302.022.270,10/99 +F1FIH,JN23GS,,,,,,04/03 +F1FLA,JN26KU,EME,,,,144: 4x25el Xpol 7.6lb 1KW MGF1302.022.270,10/05 F1FVP,IN95XA,,,,,,2003 F1GHP,IN96LE,,,,,,2003 F1GTR,IN96JE,,,,,,2003 F1GTU,JN05IF,,,,,,07/98 -F1HAR,JN18DT,,,marc,,,1993 +F1HAR,JN18DT,,,,,,1993 F1IHP,IN88,,,,,,07/02 -F1ISJ,IN97QM,,,Eric,,FT847,05/02 -F1IXQ,JN15MQ,,,Jim,,,12/01 -F1JG,JN23HQ,,,,,,08/02 -F1JOE,JN05IF,,,francois,,,1993 -F1JRD,JN13WO,,,Lionel,,144: TR751 GS35b 2x11el F9FT5000lpm,12/04 -F1MBM,JN38CQ,,,Alex,,FT225RD 144: 8877 4CX250 MGF1302 16el F9FT,12/02 -F1MOZ,JN27MH,,,Bruno,,,01/04 -F1MPQ,JN09SG,,,Bruno,,144: 2x9el 2KW - 432: 80W 26el doublequad,02/04 -F1NGP,JN39CC,,,Yann,,,04/97 +F1ISJ,IN97QM,,,,,FT847,05/02 +F1IXQ,JN15MQ,,,,,,12/01 +F1JG,JN23HQ,,,ex FC1JG,,,08/02 +F1JOE,JN05IF,,,,,,1993 +F1JRD,JN13WO,,,ex FA1JRD,,144: TR751 GS35b 2x11el F9FT5000lpm,12/04 +F1MBM,JN38CQ,,,,,FT225RD 144: 8877 4CX250 MGF1302 16el F9FT,12/02 +F1MOZ,JN27MH,,,,,,01/04 +F1MPQ,JN09SG,,,,,144: 2x9el 2KW - 432: 80W 26el doublequad,02/04 +F1NGP,JN39CC,,,,,,04/97 F1NNI,IN88,,,,,,04/02 -F1NSR,JN33JK,,,Yannick,,144: IC275h 17B2 2x24CX250,01/04 +F1NSR,JN33JK,,,,,144: IC275h 17B2 2x24CX250,01/04 +F1NWZ,JN17CT,,,,,,10/05 F1ODA,JN13FO,,,,,144: 400W115215,10/02 -F1PUX,JN16XL,,,Denis,,TS690S 144: LT2S 200W 20el - 50: 5elonly S,01/99 +F1PUX,JN16XL,,,,,TS690S 144: LT2S 200W 20el - 50: 5elonly S,01/99 F1PYR,JN19DA,,,,,,04/02 -F1PYW,JN38UP,,,Eric,,144: 120W 9el or 2x11el - 432: 17el or Helix,03/99 -F1RAD,JN25WF,,,Yvan,,50: 5W 1/4wl. - 144: TR751e 25/200W.300,05/02 +F1PYW,JN38UP,,,,,144: 120W 9el or 2x11el - 432: 17el or Helix,03/99 +F1RAD,JN25WF,,,ex FC1RAD,,50: 5W 1/4wl. - 144: TR751e 25/200W.300,05/02 F1RHS,JN03PV,,,,,only SSB-MS,11/01 -F1VJQ,IN95OL,,,OP G8APZ G4FUF,,,07/04 -F2TU,JN38LG,EME,,Philip,,,11/01 -F3VS,JN38LF,EME,,Claude,,24x20el (6wl) & 8x20el (6wl) DJ9BVs,03/99 +F1TE,IN94,EME,,,,144: 4x 12el,12/05 +F1VJQ,IN95OL,,,Expedition,,,07/04 F4ALP,JO10OP,,,,,,12/01 -F4APX,JN23XL,EME,,Fred,,144: 4*18EL - 432: 4*21EL 2*4CX250,01/04 -F4ARU,IN94VT,,,Jeremie,,144: 4x3.6wl 1KW 8877,11/01 -F4AZF,JN38IW,,,Damien,,144: IC275h 500W 8874 4x 4.4wl DJ9BV Preampo,08/03 -F4BKV,IN95PT,,,Vincent,,144: TS700 150W 9el - 432: TS440S TRV 70W 21,04/02 -F4CIB,JN03,,,Franck,,144: 250W 9el.241,05/02 -F4CYZ,JN38SF,EME,,Florent,,144: FT897D 150W 9el Yagi,01/05 -F4DDX,JN23QG,,,Claude,,TM255E,11/04 -F4DSD,JN23JO,EME,,Emmanuel,,,01/05 -F4DXX,IN97LH,,,BRUNO,,,11/03 -F4JRC,JN23JW,EME,,Tempier,,144: 4x10el,01/01 +F4APX,JN23XL,EME,,,,144: 4*18EL - 432: 4*21EL 2*4CX250,01/04 +F4ARU,IN94VT,,,,,144: 4x3.6wl 1KW 8877,11/01 +F4AZF,JN39GG,EME,,,,144: IC275h 500W 8874 4x 15el280,04/06 +F4BKV,IN95PT,,,,,144: TS700 150W 9el - 432: TS440S TRV 70W 21,04/02 +F4CIB,JN03,,,,,144: 250W 9el.241,05/02 +F4CYZ,JN38SF,EME,,,,144: FT897D 400W 2x 9el Yagi,05/05 +F4DDX,JN23QG,,,,,TM255E,11/04 +F4DSD,JN23JO,EME,,,,,01/05 +F4DXX,IN97LH,EME,,,,144. 17el 200W,01/06 F4JVG,JN16UM,,,,,,07/02 -F5ANT,JN24RJ,,,Rene,,only SSB-MS,04/96 +F5ANT,JN24RJ,,,,,only SSB-MS,04/96 F5AQC,JN05PU,,,,,,2003 -F5BUU,JN03BO,,,Jean-Claude,,,01/05 -F5DE,JN05DP,,,Bernard,,50: 50W 5el - 144: 100W 16el076 DTR 2000lpm,01/05 -F5EAN,JN06CP,EME,,jean michel,,,1994 +F5BUU,JN03BO,,,,,,01/05 +F5DE,JN05DP,,,,,50: 50W 5el - 144: 100W 16el076 DTR 2000lpm,01/05 F5FEN,JN25JC,,,,,,2003 -F5FHI,IN97GD,EME,,jean pierre,,,1994 -F5FLN,IN94SR,,,Michel,,144: 300W 17el800lpm,08/99 -F5FVP,IN95WB,,,Jean Yves,,144: 4x17el 1KWonly SSB-MS,07/00 -F5GHP,IN96LE,,,Jean-Pierre,,144: IC745 700W 14el 9BV CF3002500lpm MSDSP,07/02 -F5HRY,JN18EQ,EME,,Herve,,144: 1KW 4x11el.077 DTR,11/02 +F5FHI,IN97GD,EME,,ex F1FHI,,,1994 +F5FLN,IN94SR,,,,,144: 300W 17el800lpm,08/99 +F5FVP,IN95WB,,,,,144: 4x17el 1KWonly SSB-MS,07/00 +F5GHP,IN96LE,,,ex F1GHP,,144: IC745 700W 14el 9BV CF3002500lpm MSDSP,07/02 +F5HRY,JN18EQ,EME,,,,144: 1KW 4x11el.077 DTR,11/02 F5IVP,JN23,,,,,,08/02 -F5JNX,JN37PV,,,Jean-Marc,,,01/04 -F5JRX,JN25AW,,,bruno,,,1994 -F5KCR,JN26IX,,,OP: F1RXC- F1JLD,,,08/96 +F5JNX,JN37PV,,,,,,01/04 +F5JRX,JN25AW,,,,,,1994 +F5KCR,JN26IX,,,,,,08/96 F5KDK,JN23VF,,,,,,2003 F5KPO,JN24,,,,,,12/01 -F5LEN,JN38BO,,,Pascal,,144: IC275A 250W 17elB2054 MSDSP.254,10/01 -F5LKW,JN23SJ,,,Roger,,144: TS700 60W 13el2000lpm,04/03 -F5LRL,JN26MV,,,Mike,,144: 400W 4x10el,05/02 -F5LUW,JO10MP,EME,,Francois,,,11/95 -F5MGD,JN07AW,,,Stephane,,FT102 + tvtr2500lpm,05/04 -F5MSL,JN26JS,EME,,Eric,,144: 8877 4x11el (or 4x10el) MGF1302.090.220,02/99 -F5MZN,IN87BU,EME,,Oliver,,,08/96 -F5NWK,IN97EJ,,,Tanguy,,144: 9el 200W,05/04 -F5OIH,JN06,,,Vincent,,,08/03 +F5LEN,JN38BO,,,,,144: IC275A 250W 17elB2054 MSDSP.254,06/05 +F5LKW,JN23SJ,,,,,144: TS700 60W 13el2000lpm,04/03 +F5LRL,JN26MV,,,,,144: 400W 4x10el,05/02 +F5LUW,JO10MP,EME,,ex F1LUW,,,11/95 +F5MGD,JN07AW,,,,,FT102 + tvtr2500lpm,05/04 +F5MSL,JN26JS,EME,,ex FC1MSL,,144: 8877 4x11el (or 4x10el) MGF1302.090.220,02/99 +F5MZN,IN87BU,EME,,,,,08/96 +F5NWK,IN97EJ,,,ex FD1NWK,,144: 9el 200W,05/04 +F5OIH,JN06,,,,,,08/03 +F5OWL,JN33CC,,,ex FC1OWL,,50w 2x9elts side by side with elevation,08/05 F5PAU,IN88CB,,,,,144: 4x11el 150W,07/02 -F5RRS,JN36EB,,,Damien,,144: 200W 10el Quad,11/04 -F5SDD,JN23RF,EME,,Dave,,FT901 IC211,01/04 +F5RRS,JN36EB,,,,,144: 200W 10el Quad,11/04 +F5SCL,JN29HP,,,,,FT225RD,04/06 +F5SDD,JN23RF,EME,,FD1SDD,,FT901 IC211,01/04 F5SE,JN29BG,,,,,,06/03 F5SJE,JN13,,,,,,12/95 -F5SJP,JN13VQ,,,Stephan,,144: TS790 180W 17B2TX1200 RX 5000lpm,01/02 -F5TMJ,JN03VP,,,Laurent,,IC706 MK2G,12/04 +F5SJP,JN13VQ,,,,,144: TS790 180W 17B2TX1200 RX 5000lpm,01/02 +F5TMJ,JN03VP,,,ex FD1MJK,,IC706 MK2G,12/04 F5VBW,JN03,,,,,,06/95 -F5VHX,JN04FT,EME,,Graham,,130,06/03 -F6ANQ,IN94RT,,,Christian,,DTR,07/96 +F5VHX,JN04FT,EME,,ex F/G8MBI,,130,06/03 +F6ANQ,IN94RT,,,,,DTR,07/96 F6AOI,JN33NQ,,,,,,08/02 -F6BAZ,JN39EF,,,Henri,,,06/02 +F6APE,IN97QI,EME,,,,144: 17el 200W,01/06 +F6BAZ,JN39EF,,,,,,06/02 F6BEE,JN08FU,,,,,,2003 -F6CBH,JN19BH,,,christian,,,1994 -F6CGJ,IN78RK,EME,,Louis,,144: 4x11el 400W,04/00 +F6BEG,JN25JS,EME,,,,144: 3wl Antenna 300W,09/05 +F6BKI,IN94,EME,,,,,12/05 +F6CBH,JN19BH,,,,,,1994 +F6CGJ,IN78RK,EME,,,,144: 4x11el 400W,04/00 F6CIO,JN26JH,,,,,,09/98 -F6CJG,JN15,EME,,g.,,,1993 +F6CJG,JN15,EME,,,,,1993 F6CKZ,JN09LH,,,,,,01/97 -F6CRP,IN96KE,,,Denis,,144: 300W 2x11el - 432: 100W 2x21el MGF1302-,12/04 -F6CTW,JN18,EME,,rene,,,1993 -F6DHI,JN23RK,,,Chris,,144: 200W 9el MGF1302370280,04/04 +F6CRP,IN96KE,,,,,144: 300W 2x11el - 432: 100W 2x21el MGF1302-,12/04 +F6CTW,JN18,EME,,,,,1993 +F6DHI,JN23RK,,,,,144: 200W 9el MGF1302370280,04/04 F6DKW,JN18CS,,,,,,02/01 -F6DRO,JN03TJ,,,Dominique (Dom),,2500Watt 18el BF981081 3000lpm DTR231,03/04 -F6DWG,JN19DL,,,m.,,,1994 +F6DRO,JN03TJ,,,,,2500Watt 18el BF981081 3000lpm DTR231,03/04 +F6DWG,JN19AJ,,,,,,04/05 F6DWH,JN19,,,,,,1995 F6EAS,IN98,,,,,DTR,08/01 -F6EMT,IN98FG,EME,,jean p.,,,1994 -F6EYM,IN99,EME,,guy,,.070,12/95 -F6FHP,IN94TR,EME,,Joel,,144: 1KW 4x6 wl5000lpm DTR,01/05 -F6FLV,JN18AT,,,Jean-Pierre,,,02/96 -F6FTN,JN08XS,,,Bernard,,144: 4x9el 300W,01/04 -F6GPT,IN94SW,,,John-Marc,,144: 11el 400Wonly SSB-MS,05/04 -F6GRB,JN25KP,,,Philippe,,,01/05 -F6HVK,JN27LH,EME,,Andre,,144: 300W 17el or 4x17el M21000lpm DTR,07/99 -F6HYE,JN36DG,EME,,patrick,,,1994 -F6IFX,JN07CX,,,Bertrand,,,07/02 +F6EYM,IN99,EME,,,,.070,12/95 +F6FHP,IN94TR,EME,,ex F1CYO,,144: 1KW 4x6 wl 432: 27el 800W5000lpm DTR,04/05 +F6FLV,JN18AT,,,,,,02/96 +F6FTN,JN08XS,,,,,TS2000X 144: 4x9el 300W,01/04 +F6GPT,IN94SW,,,,,144: 11el 400Wonly SSB-MS,05/06 +F6GRB,JN25KP,EME,,,,144: 3wl 600W,03/05 +F6GUU,JN05CU,,,,,FT857,04/06 +F6HVK,JN27LH,EME,,,,144: up to 1000W 4x17el M2 or single Yagi1000,04/06 +F6IFX,JN07CX,,,,,,07/02 F6IZZ,JN18GR,,,,,,2003 F6JXR,IN98HW,,,,,,09/98 -F6KHM,IN78RJ,EME,,Clubstation,,only SSB-MS,06/02 -F6KRK,JN18AS,,,Clubstation,,144: 17el 120W,02/01 +F6KHM,IN78RJ,EME,,,,only SSB-MS,06/02 +F6KRK,JN18AS,,,,,144: 17el 120W,02/01 F6KSX,JN18,,,,,,2003 -F8BKD,JN38LG,EME,,Didier,,144: TS-2000 4X11 el 1000W,01/03 F8CS,JN27UR,,,,,,08/98 -F8DNX,IN93FJ,,,Thierry,,FT 847 - 144: 2x9el 170W,07/04 -F8DO,JN26IF,EME,,Marius,,50: TS680S 5el - 144: FT225 4CX1000 2x11el MG,01/05 -F8IPS,JO00SQ,,,Carnello,,,07/00 -F8KFR,JN09RG,,,OP F1MPQ,,144: 2x9el 1-8KW - 432: 80W 26el doublequad,04/03 -F8OP,JN26MM,EME,,Georges,,50: TS690 100W 6el - 144: FT225RD Mutek 2x4CX,02/05 -F8PKC,JN38MG,EME,,,,FT726,04/01 -F9HS,JN23AT,EME,,Claude,,144: 4xBVO3WL 8877 CFX13059 MSDSP285,03/04 -F9IE,IN86WW,,,Bernard,,only SSB-MS,05/04 -FA1APX,JN23XL,EME,,Fred,,144: IC970 4 x 22 el DJ9BV 2 x 4CX350F,04/00 +F8DNX,IN93FJ,,,,,FT 847 - 144: 2x9el 170W,07/04 +F8DO,JN26IF,EME,,,,50: TS680S 5el - 144: FT225 4CX1000 2x11el MG,08/05 +F8IPS,JO00SQ,,,,,,07/00 +F8KFR,JN09RG,,,,,144: 2x9el 1-8KW - 432: 80W 26el doublequad,04/03 +F8OP,JN26MM,EME,,,,50: TS690 100W 6el - 144: FT225RD Mutek 2x4CX,02/05 +F8PKC,JN38MG,EME,,,,144: TS-2000 4x17b2 qro,04/06 +F9HS,JN23AT,EME,,,,144: 4xBVO3WL 8877 CFX13059 MSDSP285,03/04 +F9IE,IN86WW,,,,,only SSB-MS,05/04 +FA1APX,JN23XL,EME,,,,144: IC970 4 x 22 el DJ9BV 2 x 4CX350F,04/00 FC1DUZ,IN97NB,,,,,,2003 FF6KBF,JN18BW,,,,,,2003 FK8HA,RG37FR,,,,,,2003 -FM5CS,FK94LI,,,,,,2003 -FO4NK,BH52,EME,,alaine,,,1994 +FM5CS,FK94LI,EME,,,,144: 4x 17el B2 1.5KW 8877 LNA 0.5db,03/06 FO5RK,BH52,,,,,,2003 -FR5DN,LG78SS,EME,,Philippe,,,03/99 +FS/ON4QX,FK88,EME,,Expedition,,144: FT857 375W 17B2,09/05 FS5UQ,FK88LC,,,,,,2003 +FT5XO,ME40VK,EME,,,,,03/05 FY5DG,GJ35QD,EME,,,,,2003 G0AEI,JO01GO,,,,,,1991 G0AFH,JO01EI,,,,,,08/01 -G0BPU,JO02,EME,,michael,,,1994 -G0CHI,IO90PS,,,kevin,,,1993 -G0CUH,IO70LG,,,Steve,,,07/04 -G0CUZ,IO82WM,,,Colin,,FT726r 50: 50W 2el - 144: MGF1302 2x3CX40,07/02 -G0EVT,IO93GR,,,John,,144: IC202S 250Watts 3wl DJ9BV,07/01 -G0FIG,IO90UU,,,Alec,,50: IC575h 6el 400W - 144: IC275h 400W 10el M,05/00 -G0GMB,IO92NB,,,Martyn,,,03/04 -G0GMS,IO82XT,,,Tony,,144: IC746 IC756pro Demi TVRT GS35b 0.25db p,01/05 -G0HYP,IO84FN,,,Kenneth,,FT847 IC1271E 144: 1.5KW 2x17el - 432: 2x21e,04/03 -G0ISW,IO84OQ,,,Philip,,FT847 Yagis + Create Log Periodic370,03/04 -G0JDL,JO02UK,,,John,,,01/96 -G0JUR,IO92WT,,,Neill,,,08/99 -G0KAS,IO91UI,,,Mike,,144: IC275h 2x4CX250b 17el Preamp.111 DTR,01/00 -G0KPW,JO02OD,,,Bob,,144: 400W 2x17B2only SSB-MS,04/03 +G0CHE,IO90PS,,,,,50: 400W 70: 60W 144: 100W,10/05 +G0CUH,IO70LG,EME,,,,144: 500W 10el,04/05 +G0CUZ,IO82WM,,,,,FT726r 50: 50W 2el - 144: MGF1302 2x3CX40,07/02 +G0EVT,IO93GR,,,,,144: IC202S 250Watts 3wl DJ9BV,07/01 +G0FIG,IO90UU,,,,,50: IC575h 6el 400W - 144: IC275h 400W 10el M,05/00 +G0GMB,IO92NB,EME,,,,144: IC756PRO TR144H LNA GS35 PA,04/06 +G0GMS,IO82XT,,,,,50: IC746 & IC756pro GS35b pre-ampNo SSB,04/06 +G0HYP,IO84FN,,,,,FT847 IC1271E 144: 1.5KW 2x17el - 432: 2x21e,04/03 +G0ISW,IO84OQ,,,ex G1MOG,,FT847 Yagis + Create Log Periodic370,03/04 +G0JDL,JO02UK,,,,,,01/96 +G0JUR,IO92WT,,,,,,08/99 +G0KAD,IO91VC,,,,,144: FT857 Elecraft XV Transverter 9ele F9F,05/05 +G0KAS,IO91UI,,,,,144: IC275h 2x4CX250b 17el Preamp.111 DTR,01/00 +G0KPW,JO02RF,,,,,144: 400W 2x17B2,04/06 G0KUX,IO91WP,,,,,,11/01 -G0KZG,IO80,,,Andy,,DTR 1800lpm,10/02 -G0LBK,IO93JK,,,dave,,,1993 -G0MGA,JO00DT,,,simon,,,1993 -G0MJW,IO91JO,,,Mike,,50: 100W 5el - 70: 160W 4el - 144: 2x4CX250b,1997 -G0NFA,IO91NE,,,Derek,,144: IC271A.056.285,04/01 +G0KZG,IO80,,,,,DTR 1800lpm,10/02 +G0LBK,IO93JK,,,,,,1993 +G0MGA,JO00DT,,,,,,1993 +G0MJW,IO91JO,,,,,50: 100W 5el - 70: 160W 4el - 144: 2x4CX250b,1997 +G0NFA,IO91NE,,,,,144: IC271A.056.285,04/01 G0PES,IO83LS,,,,,,11/99 -G0RRJ,IO91FE,,,Dave,,1296: 100W 55el,04/04 -G0RUZ,IO93FR,EME,,Conrad,,144: IC746 GS35b 6x 4.6wl. 32JXX X-Pole MG,10/02 +G0RRJ,IO91FE,,,ex G8OPR,,1296: 100W 55el,04/04 +G0RUZ,IO93FR,EME,,ex G6ZTU,,144: IC746 GS35b 6x 4.6wl. 32JXX X-Pole MG,10/02 G0TPH,IO92IO,,,,,,12/01 -G0UWK,IO83VC,,,Ian,,FT1000mp 144: TV144/28 GS31b 400W 5WL 432:,10/04 +G0UWK,IO83VC,,,ex G1WEM,,FT1000mp 144: TV144/28 GS31b 400W 5WL 432:,10/04 G0XDI,IO91RP,,,,,,11/01 -G1EMJ,IO82WM,,,neil,,,1993 -G1GEY,IO94FW,EME,,don,,,1994 -G1HWY,IO90UV,,,Mike,,144: TS790e 150W 13elDTR 6000lpm,08/03 -G1OGY,JO01GR,,,David,,,09/04 -G1SWH,IO83QO,,,Gerry,,,10/04 -G1WPF,IO91RP,,,Matthew,,144: IC275E Tempo2002 3CX800 9elonly SSB-M,08/99 +G1EMJ,IO82WM,,,,,,1993 +G1GEY,IO94FW,EME,,,,,1994 +G1HWY,IO90UV,,,,,144: TS790e 150W 13elDTR 6000lpm,08/03 +G1OGY,JO01GR,,,,,,09/04 +G1SWH,IO83QO,,,,,,10/04 +G1WPF,IO91RP,,,,,144: IC275E Tempo2002 3CX800 9elonly SSB-M,08/99 G1XRL,EN35,,,,,,2003 G1YJI,IO91WP,,,,,,11/01 -G3BW,IO84,,,w.h.,,,1993 -G3FPQ,IO91vc,EME,, -G3JHM,IO91LC,,,Don,,50: 100W 5el - 144: 400W 2x13elonly SSB-MS,05/01 -G3LQR,JO02QF,EME,,simon,,,1994 -G3NAQ,IO91HL,,,Geoff,,50: 400W 3el - 4: 100W 2el - 144: 400W 17el -,08/03 -G3UTS,IO94CU,,,Reg,,144: 400W 9el M2 BF981171370,02/04 -G3WCS,IO83RH,,,Ken,,144: TS430S HB Transverter HB Amp 2x4CX250B,01/05 -G3WZT,IO90UX,,,John,,IC756PRO 50: 7el 400W - 144: 2x9el 400W - 4,08/03 +G1ZJP,IO92WV,,,= M1MHZ,,IC7400 IC1275e IC475H IC202s IC402 TS830,01/05 +G3BW,IO84,,,,,,1993 +G3JHM,IO91LC,,,= F0AKD EI4AW,,50: 100W 5el - 144: 400W 2x13elonly SSB-MS,05/01 +G3LTF,IO91GG,EME,,,,eme: 6m dish,03/06 +G3NAQ,IO91HL,,,,,50: 400W 3el - 4: 100W 2el - 144: 400W 17el -,08/05 +G3UTS,IO94CU,,,,,144: 400W 9el M2 BF981171370,02/04 +G3WCS,IO83RH,,,,,144: TS430S HB Transverter HB Amp 2x4CX250B,01/05 +G3WZT,IO90UX,EME,,,,IC756PRO 50: 7el 400W - 144: 2x9el 400W - 4,01/06 G3YNN,JO00EU,,,,,50: 2-5W 5el - 144: FT736 100W 14el - 432: F,05/04 -G4AEP,IO91NJ,EME,,Bill,,144: 400Watt 17el ATF53045rx2000 tx1200,01/05 -G4AFJ,IO92HO,,,Geoff,,144: 150W 10el500lpm,09/01 +G3YYD,IO91TR,,,,,FT1000MP Transverter 4CX400 400w to 3wl yagi,04/05 +G4AEP,IO91NJ,EME,,,,144: 400Watt 17el ATF53045rx2000 tx1200,01/05 +G4AFJ,IO92HO,,,,,144: 150W 10el500lpm,09/01 G4ALY,IO70UL,,,,,,12/03 -G4AOA,IO83TD,,,tony,,,1993 -G4APA,IO83VI,,,Tony,,144: FT726R 200Watts 9ele BF981.160.260,01/01 -G4APJ,IO83UP,,,Ken,,FT736 FT817,08/03 -G4ASR,IO81MX,EME,,David,,144: FT221GTi 2x3CX400 17el (4x17el)2500 DT,02/04 -G4BRK,IO91DP,,,Neil,,144: 80W 9el1000lpm,03/02 -G4CBW,IO83UB,,,Paul,,144: TS2000 IC756PROII 2x 9el 180W,09/04 -G4CCH,IO93ql,EME,, -G4CJG,IO94CR,,,jerry,,,1993 -G4CLA,IO92JL,,,Pete,,,09/03 -G4DBL,IO91JJ,,,Tim,,144: IC746PRO 4CX350 300W 17el,11/04 -G4DHF,IO92UU,EME,,David,,028215,09/04 -G4DOL,IO80SP,,,p.,,,04/99 -G4DZU,IO93ES,EME,,Doug,,1296: 800W 3m. Dish,08/01 -G4ERG,IO93SR,EME,,Peter,,144: 16x10el- 2x3CX800- MGF1302,02/99 +G4AOA,IO83TD,,,,,,1993 +G4APA,IO83VI,,,SilentKey,,144: FT726R 200Watts 9ele BF981.160.260,01/01 +G4APJ,IO83UP,,,,,FT736 FT817,08/03 +G4ASR,IO81MX,EME,,,,144: FT221GTi 2x3CX400 17el (4x17el)2500 DT,02/04 +G4BRK,IO91DP,,,,,144: 80W 9el1000lpm,03/02 +G4CBW,IO83UB,EME,,,,144: TS2000 IC756PROII 2x 9el 180W,01/06 +G4CJG,IO94CR,,,,,,1993 +G4CLA,IO92JL,,,,,,09/03 +G4DBL,IO91JJ,,,,,144: IC746PRO 4CX350 300W 17el,11/04 +G4DHF,IO92UU,EME,,,,144: K2 txvtr GS35B x4 or x8 or x16Yagis02821,03/06 +G4DOL,IO80SP,,,,,,04/99 G4ERP,IO81XW,,,,,,2003 G4FDX,EN60VL,,,,,,2003 -G4FRE,JO01KK,EME,,dave,,,1994 -G4FUF,JO01GN,EME,,Keith,,,01/05 -G4HGI,IO83PL,,,Richard,,144: TS780 GS35b 400W 17el2000lpm DTR,08/04 -G4HGT,IO83,,,j.,,,1993 -G4IGO,IO80NW,EME,,Kenneth ""Ken",,50: IC706 300W 6el - 144: IC706,02/05 +G4FUF,JO01GN,EME,,,,,04/05 +G4HGI,IO83PL,,,,,144: TS780 GS35b 400W 17el2000lpm DTR,08/04 +G4HGT,IO83,,,,,,1993 +G4IGO,IO80NW,EME,,,,50: IC706 300W 6el - 144: IC706 2x 17el 400W,04/05 G4JCC,IO90MS,,,,,,01/03 -G4KLX,IO93FB,,,Jonathan,,,03/04 -G4KUX,IO94BO,EME,,nick,,,08/03 -G4KWQ,IO92AQ,,,Andrew,,144: FT847 400W Preamp 16el Tonna,04/03 -G4LOH,IO70JC,EME,,Tim,,.255,02/04 -G4ODA,IO92WS,,,Keith B.,,,01/05 +G4KLX,IO93FB,,,,,,03/04 +G4KUX,IO94BO,EME,,,,,08/03 +G4KWQ,IO92AQ,,,,,144: FT847 400W Preamp 16el Tonna,04/03 +G4LOH,IO70JC,EME,,,,.255,02/04 +G4ODA,IO92WS,,,,,,01/05 G4PBP,IO82WO,,,,,,07/01 -G4PCI,IO91AL,,,George,,IC756PRO,01/03 -G4PIQ,JO01MU,EME,,Andy,,144: 2x3CX800 ATF10136 4x15el CueDee2500lpm,10/04 -G4RGK,IO91ON,,,Dave,,144: 300Watt 17el MGF1302 - 432: 400Watt 8x2,03/01 -G4RKV,JO01OI,,,Lee,,144: IC275E EME Pwr 2x9el MGF1302.075 DTR,01/01 -G4RNL,IO83,EME,,don,,,1994 -G4RRA,IO80BS,,,Paul,,144: 4x10el 400WDTR,08/03 -G4SHC,IO83VO,,,r.,,,1993 +G4PCI,IO91AL,,,,,IC756PRO,01/03 +G4PIQ,JO01MU,EME,,,,144: 2x3CX800 ATF10136 4x15el CueDee2500lpm,10/04 +G4RGK,IO91ON,,,,,144: 300Watt 17el MGF1302 - 432: 400Watt 8x2,03/01 +G4RKV,JO01OI,,,,,144: IC275E EME Pwr 2x9el MGF1302.075 DTR,01/01 +G4RNL,IO83,EME,,,,,1994 +G4RRA,IO80BS,,,,,144: 4x10el 400WDTR,08/03 +G4SHC,IO83VO,,,,,,1993 G4SSO,IO91TO,,,,,,08/94 -G4SWX,JO02PB,EME,,John,,,01/01 +G4SWX,JO02PB,EME,,,,,01/01 G4UPS,IO80JV,,,,,,01/97 -G4VIX,JO01PU,EME,,dave,,,1994 G4VPD,IO92BJ,,,,,only SSB-MS, -G4VXE,IO91QL,,,Tim,,,03/01 +G4VXE,IO91QL,,,,,,03/01 G4WQE,JO01CJ,,,,,,2003 -G4XBF,IO91QE,,,Mike,,DTR,04/99 -G4XUM,IO83,EME,,Martin,,,10/02 -G4YTL,IO92MB,EME,,David,,144: IC275 1KW 4x5lb DJ9BV.095,05/03 -G4ZFJ,JO01HO,,,Colin,,,07/04 -G4ZHI,IO91KN,EME,,Bryn,,432: TS790 1KW 4x3wl 9BV SSB Preamp2000lpm,05/03 -G4ZTR,JO01KW,EME,,John,,144: FT1000MP LT2S 2x4CX250B MGF1302 CC17,04/02 -G6DER,IO93GN,,,Keith,,,01/97 -G6HKM,JO01FT,,,Ela,,,1994 -G6RAF,IO92QP,,,op GW8VHI,,,10/95 +G4XBF,IO91QE,,,,,DTR,04/99 +G4XUM,IO83,EME,,,,,10/02 +G4YTL,IO92MB,EME,,,,144: IC275 1KW 4x 5wl DJ9BV.095,05/05 +G4ZFJ,JO01HO,,,,,,07/04 +G4ZHI,IO91KN,EME,,,,432: TS790 1KW 4x3wl 9BV SSB Preamp2000lpm,05/03 +G4ZTR,JO01KW,EME,,,,144: FT1000MP LT2S 2x4CX250B MGF1302 CC17,08/05 +G6DER,IO93GN,,,,,,01/97 +G6HKM,JO01FT,,,,,,1994 +G6RAF,IO92QP,,,,,,10/95 G6TEL,IO90AR,,,,,,05/04 -G6XRK,IO90RN,,,Mike,,144: IC820H Henry2002 Mutek 15el M2,1998 -G6XVV,IO93,,,h.,,,11/95 +G6XRK,IO90RN,,,,,144: IC820H Henry2002 Mutek 15el M2,1998 +G6XVV,IO93,,,,,,11/95 G6YAY,IO80EL,,,,,,2003 G6YIN,IO93ET,,,,,only SSB-MS,01/99 -G6ZTU,IO93HN,EME,,conrad,,,1993 +G6ZTU,IO93HN,EME,,,,,1993 G7KQW,IO93,,,,,,2003 -G7LIJ,JO01GG,,,brian,,,1995 -G7RAU,IO90IR,,,Dave,,144: FT757 Mutek 2x9el 400Wonly SSB-MS.380,05/02 -G8BHH,IO82WO,,,Russ,,,07/01 +G7LIJ,JO01GG,,,,,,1995 +G7NCF,IO81RE,,,,,FT847,05/05 +G7RAU,IO90IR,,,,,144: FT757 Mutek 2x9el 400Wonly SSB-MS.380,05/02 +G8BCG,IO70RK,EME,,= H44PT,,50: IC756POOII 400W 7el,09/05 +G8BHH,IO82WO,,,,,,07/01 G8CLZ,JO00EU,,,,,50: 2-5W 5el - 144: FT736 25W 9el - 432: FT7,09/01 G8DSL,IO90FW,,,,,,2003 -G8ECI,JO03AK,,,Derek,,50: 5el 300W - 70: 5el 160W - 144: 10el 3,01/01 +G8ECI,JO03AK,,,,,50: 5el 300W - 70: 5el 160W - 144: 10el 3,01/01 G8GTD,IO93,,,,,,11/01 -G8IZY,IO91VC,,,Steve,,144: TS700G BF981 4CX250b 250W 9el M2only SSB,01/01 -G8LZG,IO93SR,,,Graham,,FT847 or FT100,11/01 -G8MYK,IO92BJ,,,Alan,,IC275H- 100W- 17el.350,07/02 +G8IZY,IO91VC,,,,,144: TS700G BF981 4CX250b 250W 9el M2only SSB,01/01 +G8LZG,IO93SR,,,,,FT847 or FT100,11/01 +G8MYK,IO92BJ,,,,,IC275H- 100W- 17el.350,07/02 G8OPR,IO91FE,,,,,,2003 -G8PYP,IO90AS,,,steve,,,1993 -G8ROU,IO92,,,dave,,,1993 -G8RWG,JO01BN,EME,,Niels,,144: FT1000MP DEM144/28 2x8874 MGF1302 9el fu,05/02 +G8PYP,IO90AS,,,,,,1993 +G8ROU,IO92,,,,,,1993 +G8RWG,JO01BN,EME,,,,144: FT1000MP DEM144/28 2x8874 MGF1302 9el fu,05/02 G8T,IN79JX,,,,,only SSB-MS,06/02 -G8TIC,IO82VF,,,Mike,,50: 6el 400W - 144: JST245 trx 10el 3CX800,12/01 -G8TOK,JO01BI,,,Derek,,,04/02 -G8UUR,IO92ET,,,Phil,,144: 80Watts 3ele@10mtrs,07/00 -G8VHI,IO92FM,,,Reg,,50: 100W 4el - 70: 10W 4el - 144: 9el 200W -,07/04 -G8VR,JO01DJ,,,Ken,,50: 3el 100W1000lpm,05/03 -G8VYK,JO01,,,,,,10/04 -G8XVJ,IO83RJ,,,Erik,,144. LT2S 8877 17el M2only SSB-MS.185,08/99 -GB2LBN,IO85,EME,,OP MM0CCC,,144: 17el 100W,08/00 -GB2WQ,IO66,,,,,,1992 -GB4IOM,IO74PB,EME,,,,,05/04 -GB4SPT,IO74PB,EME,,,,,05/04 -GB4VR,IO57,,,,,,1990 -GB4XS,IO78HA,,,OP GW4VVX- GM0CLN,,50: IC746 100W 4el - TR9130 - 70: 150W 6el -,08/00 -GD0WKX,IO74SD,,,Graham,,,10/95 -GD4IOM,IO74QD,EME,,Andy,,50: 400W 4x7el - 144: 400W 8x9el - 432: 400,08/01 -GD4UFD,IO74,,,,,,1988 -GD7HEJ,IO74SD,,,Graham,,,10/95 -GI0OTC,IO65QE,,,Alan,,,12/00 -GI1JUS,IO74,,,i.,,,1993 -GI4KSO,IO64XK,,,Darrell,,70: 100W 3el - 144: 300W 8el,07/03 -GI6ATZ,IO74AJ,,,Gordon,,144: IC251E Mutek FE 300W 13el.270,03/01 -GI8YDZ,IO65,,,a.,,,1988 +G8TIC,IO82VF,,,,,50: 6el 400W - 144: JST245 trx 10el 3CX800,12/01 +G8TOK,JO01BI,,,,,,04/02 +G8UUR,IO92ET,,,,,144: 80Watts 3ele@10mtrs,07/00 +G8VHI,IO92FM,,,,,50: 100W 4el - 70: 10W 4el - 144: 9el 200W -,07/04 +G8VR,JO01DJ,,,,,50: 3el 100W1000lpm,05/03 +G8VYK,JO01FO,EME,,,,144: IC251E MGF1302 180Watts 15 ele Cue D,07/05 +G8XVJ,IO83RJ,,,,,144. LT2S 8877 17el M2only SSB-MS.185,08/99 +GB2LD,IN79JX,,,Expedition,,,08/05 +GB2WQ,IO66,,,Expedition,,,1992 +GB4VR,IO57,,,Expedition,,,1990 +GB4XS,IO78HA,,,Expedition,,50: IC746 100W 4el - TR9130 - 70: 150W 6el -,08/00 +GD0WKX,IO74SD,,,Expedition,,,10/95 +GD4IOM,IO74QD,EME,,,,50: 400W 4x7el - 144: 400W 8x9el - 432: 400,08/01 +GD4UFD,IO74,,,Expedition,,,1988 +GD7HEJ,IO74SD,,,,,,10/95 +GI0OTC,IO65QE,,,,,,12/00 +GI1JUS,IO74,,,,,,1993 +GI4KSO,IO64XK,,,,,70: 100W 3el - 144: 300W 8el,07/03 +GI6ATZ,IO74AJ,,,,,144: IC251E Mutek FE 300W 13el.270,03/01 +GI7UGV,IO74DO,,,= GM7UGV,,FT847 144: 200W 8el,04/06 +GI8YDZ,IO65,,,,,,1988 GJ0JSY,IN89XE,,,,,,12/01 -GJ0RUZ,IN89,EME,,,,,03/02 -GJ4ICD,IN89WE,,,Geoff,,,10/98 -GM0BQM,IO85CE,,,Mike J.,,144: 200W 2x17elDTR tx850lpm,03/02 -GM0CLN,IO85HV,,,Colin R.,,50: 20W indoor ant - 144: TR751E 100W 14elon,03/02 +GJ0RUZ,IN89,EME,,Expedition,,,03/02 +GJ4ICD,IN89WE,,,,,,10/98 +GJ8BCG/p,IN89,EME,,= H44PT,,50: IC756proII 3-500z 400w to 6M7JHV mast,05/05 +GM0BQM,IO85CE,,,,,144: 200W 2x17elDTR tx850lpm,03/02 +GM0CLN,IO85HV,,,,,50: 20W indoor ant - 144: TR751E 100W 14elon,03/02 GM0EWX,IO67UL,,,,,144: 12el 8874,05/02 -GM0GMD,IO86AE,,,Tom,,,07/00 -GM0HUO,IO86OI,,,Arlen,,FT736r 50: 100W 3el - 144: 180W 12eltx1200,08/99 -GM0JOL,IO78VM,,,j.,,,1993 -GM0ONN,IO87,EME,,Ian,,,10/00 -GM0WDD,IO85JV,,,Gavin,,TS690 - 144: Trvt 9el OZ5HF 200WDTR,08/99 -GM0WDF,IO75PW,,,John,,144:TS940 Trsv IC271E 400W 17el,09/01 -GM3POI,IO88OW,,,c. s.,,,10/01 -GM3SBC,IO85IX,,,,,,05/03 +GM0GMD,IO86AE,,,,,,07/00 +GM0HUO,IO86OI,,,,,FT736r 50: 100W 3el - 144: 180W 12eltx1200,08/99 +GM0JOL,IO78VM,,,,,,1993 +GM0WDD,IO85JV,,,not qrv MS nw! (02/01),,TS690 - 144: Trvt 9el OZ5HF 200WDTR,08/99 +GM0WDF,IO75PW,,,,,144:TS940 Trsv IC271E 400W 17el,09/01 +GM3POI,IO88OW,,,,,,10/01 +GM3SBC,IO85IX,EME,,,,144: 100W 11el,11/05 GM3UCN,IO85RV,,,,,,04/04 -GM4AFF,IO86ST,,,Stewart,,144: 14el Tonna EME-Pwr MGF1302only SSB-MS,08/03 -GM4CXM,IO75TW,EME,,Ray,,144: TS700 3cx800A7 9el Mutek,06/03 +GM4AFF,IO86ST,,,,,144: 14el Tonna EME-Pwr MGF1302only SSB-MS,08/03 +GM4CXM,IO75TW,,,,,144: TS790E 3cx800A7 9el @ 20m 432: 120w 2,09/05 GM4ILS,IO87IP,,,,,,07/01 -GM4ISM,IO85AR,,,,,,09/02 -GM4JJJ,IO86GB,EME,,David,,144: 4x3wl XPOL 8877,05/01 -GM4OGM,IO85,,,s.,,,1988 -GM4VVX,IO78TA,,,Clive,,50: TR751E 5W Dipol.222,08/03 -GM4YXI,IO87WJ,,,Keeth,,1500lpm,04/00 -GM5RP,IO66,,,,,HCSW,08/01 +GM4ISM,IO85AR,EME,,,,FT847,07/05 +GM4JJJ,IO86GB,EME,,,,144: 4x3wl XPOL 8877,05/01 +GM4OGM,IO85,,,,,,1988 +GM4SIV,IO57,,,Expedition,,,07/06 +GM4VVX,IO78TA,,,,,50: TR751E 5W Dipol.222,04/06 +GM4YXI,IO87WJ,,,,,1500lpm,04/00 +GM5RP,IO66,,,QSL via G3SEK,,HCSW,08/01 GM6VIU,IO85,,,,,144: TR851E 25W 24el,11/99 -GM6VXB,IO97AQ,,,,,,02/04 +GM6VXB,IO97AQ,,,,,,04/06 +GM6VXB/p,IO99,,,Expedition,,,05/06 GM7ASN,IO78TA,,,,,,06/95 -GM7LVJ,IO85,,,gavin,,,1994 -GM7PBB,IO68UM,,,John,,50: IC756,10/04 -GM8OEG,IO86LL,,,Andy,,,02/04 +GM7LVJ,IO85,,,,,,1994 +GM8OEG,IO86LL,,,,,,04/06 GU7DHI,IN89RL,,,,,,12/01 -GW0KZG,IO82,,,Andy,,DTR 2500lpm,12/98 -GW0PZT,IO72PT,,,edward,,,1993 -GW0VWD,IO81EM,,,Allan,,only SSB-MS,07/96 -GW3HWR,IO71XN,,,Heath,,FT847 - 144: 350W 9el Preamp,04/03 +GW0KZG,IO82,,,,,DTR 2500lpm,12/98 +GW0PZT,IO72PT,,,,,,1993 +GW0VWD,IO81EM,,,,,only SSB-MS,07/96 +GW3HWR,IO71XN,,,,,FT847 IC910 + Amps - 144: 350W 9el Preamp,08/05 GW3LEW,IO71PS,,,,,,04/03 -GW3XYW,IO71,EME,,,,,01/05 -GW4DGU,IO71SV,EME,,Chris,,144: 600W 15.6dbi ant,03/04 -GW4HDF,IO81JO,,,Vic,,,04/02 -GW4LXO,IO81,,,Jonathan,,,08/98 +GW3XYW,IO71XR,EME,,,,144: 4x 10el 400W,01/06 +GW4DGU,IO71SV,EME,,,,144: 15.6dBi yagi 750W SSPA 0.4dB HEMT 432: 2,04/05 +GW4HDF,IO81JO,,,,,,04/02 +GW4LXO,IO81,,,,,,08/98 GW4UWR,IO81LP,,,,,only SSB-MS,08/99 -GW4VEQ,IO73SG,,,Tony W.,,,10/02 +GW4VEQ,IO73SG,,,,,,10/02 GW4VVX,IO81JP,,,,,,06/95 GW4ZQV,IO81LQ,,,,,only SSB-MS,08/97 -GW6YAY,IO81LM,,,David,,144: IC821H 300Watts 17ele CConly SSB-MS,08/03 -GW7SMV,IO81LN,,,Jamie,,144: 400W Commander2 3cx800a7 12ele M22000,04/04 -GW8ASA,IO81EM,,,Gordon,,FT847 IC706 Linears - 144: 220W 9elonly SSB-,02/04 -GW8IZR,IO73TI,EME,,Paul,,144: 2x 9el GS35 .23 dbrx - 432: 4x21Y 35,01/05 -GW8OQV,IO81QR,,,Denis,,144: FT225-Mutek 2x4CX250b 4x10el DL6WU or,07/98 +GW6YAY,IO81LM,,,ex G6YAY,,144: IC821H 300Watts 17ele CConly SSB-MS,08/03 +GW7SMV,IO81LN,EME,,,,IC910H 144: 12eleM2 432: 19ele tonna 50: 3,04/06 +GW8ASA,IO81EM,,,,,FT847 IC706 Linears - 144: 220W 9elonly SSB-,02/04 +GW8IZR,IO73TI,EME,,ex G8IZR,,144: 2x 9el GS35 .23 dbrx - 432: 4x21Y 35,04/06 +GW8OQV,IO81QR,,,,,144: FT225-Mutek 2x4CX250b 4x10el DL6WU or,07/98 GX4NOK,IO93FR,,,,,,2003 GX4WWR,IO91LL,,,,,,2003 -HA0HO,KN07SU,,,Gyula,,only SSB-MS,03/01 +HA0HO,KN07SU,,,,,only SSB-MS,03/01 HA1AG,JN87TQ,,,,,,10/04 -HA1BC,JN87PU,,,Alex,,144: 3CX800A7 2x17elDTR,12/00 -HA1FV,JN87JJ,,,Pista,,144: FT290R 300W 12el - 432: 30W 25el143 20,07/04 +HA1BC,JN87PU,,,=DL1MAJ,,144: 3CX800A7 2x17elDTR,12/00 +HA1FV,JN87JJ,,,,,144: FT290R 300W 12el - 432: 30W 25el143 20,07/04 HA1KVM,JN87AL,,,,,,2003 -HA1KYA,JN87HF,,,Clubstation,,144: 8x13el DL6WU 200W2000lpm MSDSP,11/98 -HA1VHF,JN87GF,EME,,Clubstation,,,10/98 -HA1VQ,JN87GJ,,,Joska,,,08/99 +HA1KYA,JN87HF,,,,,144: 8x13el DL6WU 200W2000lpm MSDSP,11/98 +HA1VHF,JN87GF,EME,,ex HG1W,,,10/98 +HA1VQ,JN87GJ,,,,,,08/99 HA1W,JN87GF,,,,,,2003 -HA1YA,JN87GF,EME,,Gabi,,144: 8x13el & 8x14el - 432: 16x32el,09/03 +HA1YA,JN87GF,EME,,ex HG1YA,,144: 8x13el & 8x14el - 432: 16x32el - 23+13:1,06/05 HA2A,JN87,,,,,,12/99 -HA2NP,JN97EO,,,Robert,,,05/01 -HA2RD,JN87WB,,,andy,,,1993 +HA2NP,JN97EO,,,,,,05/01 +HA2RD,JN87WB,,,,,,1993 HA2RX,JN87,,,,,,12/98 -HA2SX,JN87VC,,,Peter,,144: IC821H 600Watts 11ele,12/98 +HA2SX,JN87VC,,,,,144: IC821H 600Watts 11ele,12/98 HA2VH,JN87WG,,,,,,03/03 -HA3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 -HA3UU,JN96JO,,,Janos,,144: TS711A GS35B 5.5wl 4wl 2wl MGF1100,09/04 -HA4A,JN96JO,,,Janos,,144: TS711A GS35B 5.5wl 4wl 2wl MGF1100,05/04 -HA4KYB,JN97DI,,,Clubstation,,,1994 +HA3DXC,JN96JO,,,,,144: 5.5WL 2x88771800lpm.373,07/96 +HA3UU,JN96JO,,,,,144: TS711A GS35B 5.5wl 4wl 2wl MGF1100,09/04 +HA4A,JN96JO,,,ex HA4XT,,144: TS711A GS35B 5.5wl 4wl 2wl MGF1100,05/04 +HA4KYB,JN97DI,,,ex HG4KYB,,,1994 HA4WQ,JN97IF,,,,,,06/03 +HA4XG,JN96LV,EME,,,,144: FT726R 60W 10el Yagi,03/05 HA4XT,JN96JO,,,,,,01/05 -HA5BSW,JN97JD,,,Tibor,,,03/03 +HA5BSW,JN97JD,,,ex HA3GK,,144: IC706MKII KNW TR751 300w 2x 13ele yag,07/05 HA5CAR,JN97,,,,,,07/01 -HA5CBA,JN97OM,,,Laszlo,,144: HF trsv+conv3500lpm,04/04 +HA5CBA,JN97OM,,,,,144: HF trsv+conv3500lpm,04/04 HA5CRQ,JN97,,,,,,08/02 -HA5CRX,JN97KO,,,Janos (Jani),,144: FDK Multi 2700 250W CF300 13B2.140 D,01/01 -HA5CW,JN97PM,,,Joska,,144: FT225RD/Mutech B1016 GS35B 800W 10el,08/03 +HA5CRX,JN97KO,EME,,,,144: IC-706MKIIG 200W SP2000 2wl 9BV140 D,04/06 +HA5CW,JN97PM,,,ex HG5CW,,144: FT225RD/Mutech B1016 GS35B 800W 10el,08/03 HA5IW,JN97LN,,,,,,08/01 -HA5KDQ,JN97LN,EME,,Clubstation,,DTR,07/03 -HA5LV,JN97ML,,,Victor,,144: 9el 50W,04/04 -HA5OV,JN97NJ,,,Peter,,144: FT920+Trnv GS35 1-5KW 13el DL6WU MGF,12/03 -HA5PT,JN97MK,,,Tamas,,,08/04 -HA5RL,JN97PL,,,Attila,,,12/04 -HA5TS,JN97LL,,,Ivan,,144: IC-706MKII 8ele,07/04 -HA5UK,JN97OM,,,Gyuri,,,08/02 -HA6NA,JN98VC,,,Sandor ""Sanyi",,144: 250W F9FT,08/01 -HA6NN,JN98VC,,,Andras ""Andy",,144: FT290 7el 150W,05/04 -HA6NQ,JN98WA,,,Sandor (Sanyi),,144: 700Watts CF300 DJ9BV 3.2wl086 2000lpm38,01/05 -HA6NY,JN98WC,,,Gyuszi ""Julius",,144: 1000W MHP145 17el full el - 432: 40W LNA,01/05 -HA6OQ,JN98JC,,,,,,08/98 -HA6VV,JN97WS,,,Laszlo,,,07/01 +HA5KDQ,JN97LN,EME,,,,DTR,07/03 +HA5LV,JN97ML,,,,,144: 300W 3wl DJ9BV,04/04 +HA5OV,JN97NJ,,,,,144: FT920+Trnv GS35 1-5KW 13el DL6WU MGF,12/03 +HA5PT,JN97MK,,,,,,08/04 +HA5RL,JN97PL,,,,,,12/04 +HA5TS,JN97LL,,,,,144: IC-706MKII 8ele,07/04 +HA5UK,JN97OM,,,,,,08/02 +HA6NA,JN98VC,,,,,144: 250W F9FT,08/01 +HA6NN,JN98VC,,,,,144: IC211E DL6WU Ant PA300,04/06 +HA6NQ,JN98WA,,,,,144: 700Watts CF300 DJ9BV 3.2wl086 2000lpm38,01/05 +HA6NY,JN98WC,,,,,144: 1000W MHP145 17el full el - 432: 40W LNA,01/05 +HA6OQ,JN98JC,,,ex HG6OQ,,,08/98 +HA6VV,JN97WS,,,,,,07/01 HA6ZB,JN97,,,,,,01/05 HA6ZV,JN97WH,,,,,,09/04 HA7JJS,JN97OG,,,,,,10/95 -HA7KPL,JN97OG,,,Clubstation,,,12/95 -HA7NK,KN07CM,,,Misi,,144: 200W 4x15el 9BV Preamp,06/00 -HA7PL,JN97OG,,,Laszlo,,.166,08/98 -HA7RF,JN97NP,,,Jozsef,,IC 735 +conv3500lpm,04/03 -HA7UL,JN97KK,,,Ferenc ""Feri",,HF: DM-100 - 144: FT726 or IC202 130W CF300 1,05/02 -HA8AR,KN06NQ,,,Pali,,,06/04 -HA8CE,KN06EN,,,Istvan ""Pista",,144: GS35b 400W 16 el. DJ9BV CF3001200lpm,05/04 +HA7KPL,JN97OG,,,ex HG7KPL,,,12/95 +HA7NK,KN07CM,,,,,144: 200W 4x15el 9BV Preamp,06/00 +HA7PL,JN97OG,,,ex HG7PL,,.166,08/98 +HA7RF,JN97NP,,,,,IC 735 +conv3500lpm,04/03 +HA7UL,JN97KK,,,,,HF: DM-100 - 144: FT726 or IC202 130W CF300 1,05/02 +HA8AR,KN06MQ,,,,,TS790A,05/05 +HA8CE,KN06EN,EME,,ex HG8CE,,144: GS35b 400W 16 el. DJ9BV CF3001200lpm,12/05 HA8CS,KN06BD,,,,,,2003 -HA8ET,KN06,EME,,g.,,,1993 +HA8ET,KN06,EME,,ex HG8ET,,,1993 HA8KCP,KN08DQ,,,,,,2003 -HA8V,KN06HT,,,Gabor ""Gabi",,TM255E GS35B 900W 4X11el. TR851E 2XTP5040 80,07/04 -HA8VF,JN96UW,,,,,,10/97 -HA9MCQ,KN08JC,,,Istvan,,144: 150W 14el CF300.140.190,06/98 -HA9MDP,KN08DF,,,Peter,,144: 150W 14el CF300.190,07/00 -HA9RC,KN08NB,,,,,,1994 -HAM3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 -HAM3UU,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 -HAM7JJS,JN97OG,,,,,,07/96 -HAM7KPL,JN97OG,,,Clubstation,,,07/96 -HAM7PL,JN97OG,,,Laszlo,,.166,07/96 -HAM8CE,KN06EN,EME,,Kovacs,,,11/96 -HB2FAP,JN47CE,,,Fabio,,144: 16el 1KW,12/00 -HB3YIT,JN46JE,,,Nick,,Kenwood TS-790E,01/05 -HB5OK,JN46LA,,,OP HB9SUL,,144: FT847 8877 17el MGF 1302DTR,12/98 +HA8V,KN06HT,EME,,,,TM255E GS35B 900W 4X11el. TR851E 2XTP5040 80,04/05 +HA8VF,JN96UW,,,ex HG8VF,,,10/97 +HA9KRL,KN07GT,,,,,,04/05 +HA9MCQ,KN08JC,,,,,144: 150W 14el CF300.140.190,06/98 +HA9MDP,KN08DF,,,ex HG9MDP,,144: 150W 14el CF300.190,07/00 +HA9OZD,KN08DF,,,ex HG9OZD,,144: TR9130 150W 14el CF300060190,04/06 +HA9RC,KN08NB,,,ex HG9RC,,,1994 +HAM3DXC,JN96JO,,,Specialcall,,144: 5.5WL 2x88771800lpm.373,07/96 +HAM3UU,JN96JO,,,Specialcall,,144: 5.5WL 2x88771800lpm.373,07/96 +HAM7JJS,JN97OG,,,Specialcall,,,07/96 +HAM7KPL,JN97OG,,,Specialcall,,,07/96 +HAM7PL,JN97OG,,,Specialcall,,.166,07/96 +HAM8CE,KN06EN,EME,,Specialcall,,,11/96 +HB0/PA6TUE,JN47TC,,,Expedition,,,08/05 +HB2FAP,JN47CE,,,,,144: 16el 1KW,12/00 +HB3YIT,JN46JE,,,ex HE9ZLE,,144: IC910H 13B2 antenna 25W,06/05 +HB5OK,JN46LA,,,Specialcall,,144: FT847 8877 17el MGF 1302DTR,12/98 HB9AOF,JN36LM,,,,,,01/97 HB9BBD,JN47EE,,,,,,2003 -HB9BQU,JN37VD,,,Hans,,50: 10W - 144: 200W 17elDTR rx5000 tx1500lpm,08/99 -HB9BZA,JN36BE,,,Robert,,50: FT-847 V-2000 - 144: 3CX800 11Y - 432:,01/04 -HB9CVD,JN36CD,EME,,philippe,,,1994 -HB9CYN,JN36RX,,,Martin,,144: 30W 7el 10db Gaas,01/99 -HB9DBM,JN47BE,,,Mark,,,03/99 +HB9BQU,JN37VD,,,,,50: 10W - 144: 200W 17elDTR rx5000 tx1500lpm,08/99 +HB9BZA,JN36BE,,,,,50: FT-847 V-2000 - 144: 3CX800 11Y - 432:,01/04 +HB9CYN,JN36RX,,,,,144: 30W 7el 10db Gaas,01/99 +HB9DBM,JN47BE,,,qrv at HB9Q,,,03/99 HB9DDS,JN47IK,,,,,,05/02 -HB9DFG,JN37SM,EME,,Christian ""Chris",,144: TS850S + LT2S MKII 400Watt 4x9el MGF1,12/04 -HB9DKM,JN37SL,EME,,Martin,,50: 3el vertical - 144: 150W 2x11el Flexa MG,03/02 +HB9DFG,JN37SM,EME,,,,144: TS850S + LT2S MKII 400Watt 7el MGF130,08/05 +HB9DKM,JN37SL,EME,,,,50: 3el vertical - 144: 150W 2x11el Flexa MG,03/02 HB9DLU,JN45LU,,,,,,2003 -HB9DUR,JN46ME,EME,,Andrea,,144: 1KW 17el SP2 - 432: 700WDTR 2000lpm,12/03 -HB9FAP,JN47GJ,,,Fabio,,144: TR751l 600W 18el M2 or 4x4 vertikal067,08/04 -HB9HLI,JN37JB,EME,,Dominique,,,01/05 -HB9HLM,JN36KW,EME,,Andre,,,01/04 -HB9JAW,JN47CE,EME,,Michel,,144: FT726r 15el or 8x28el 8877 MGF1302DTR 2,10/02 -HB9LU,JN46EW,,,Clubstation,,,06/96 +HB9DSU,JN36CG,EME,,ex IK2BHX K2BHX,,,07/05 +HB9DUR,JN46ME,EME,,ex HB9SUL,,144: 1KW 17el SP2 - 432: 700WDTR 2000lpm,12/03 +HB9FAP,JN47GJ,,,,,144: TR751l 600W 18el M2 or 4x4 vertikal067,08/04 +HB9LU,JN46EW,,,,,,06/96 HB9MM,JN36HP,,,,,,08/02 -HB9MS,JN47PH,EME,,OP HB9SUL,,144: 8877DTR 2000lpm,12/99 -HB9OCW,JN46LA,EME,,Donald,,50: 4el 10W - 144: 4x13B2 1KW - 432: 2x29el 1,10/99 +HB9MS,JN47PH,EME,,,,144: 8877DTR 2000lpm,12/99 +HB9OCW,JN46LA,EME,,,,50: 4el 10W - 144: 4x13B2 1KW - 432: 2x29el 1,10/99 HB9PJT,JN47FG,,,,,,05/02 -HB9Q,JN47CG,EME,,OP HB9CRQ- HB9DBM,,50: 10W 11el - 144: 15mPb 8x19el 1KW - 432: 1,05/02 -HB9QQ,JN47,EME,,Pierre,,.138 DTR,01/01 -HB9RUZ,JN47JM,,,Peter,,,12/96 -HB9SJV,JN36BK,,,Benoit ""Ben",,50: 5 el & 5/8 vert. 144: 350W 7elonly SSB-M,02/04 -HB9SLO,JN36LT,,,Bertrand,,144: FT736r 1KW 18el LY,04/03 -HB9SNR,JN36MQ,,,Gerard,,144: FT736r 800W 12el M2,11/01 -HB9STI,JN47GJ,,,f.,,,1993 -HB9STY,JN36IP,,,Bernard,,FT690R 50: 150W vert & 5el - 144: 300W 2x15e,07/98 +HB9Q,JN47CG,EME,,,,50: 10W 11el - 144: 15mPb 8x19el 1KW - 432: 1,09/05 +HB9QQ,JN47,EME,,,,50: 2x 5el 144: 17el QRO.138 DTR,10/05 +HB9RUZ,JN47JM,,,,,,12/96 +HB9SJV,JN36BK,,,,,50: 5 el & 5/8 vert. 144: 100W 11elonly SSB-,08/05 +HB9SLO,JN36LT,,,,,144: FT736r 1KW 18el LY,04/03 +HB9SNR,JN36MQ,,,,,144: FT736r 800W 12el M2,11/01 +HB9STI,JN47GJ,,,,,,1993 +HB9STY,JN36IP,,,,,FT690R 50: 150W vert & 5el - 144: 300W 2x15e,07/98 HB9SUL,JN46LA,,,,,,2003 -HB9SV,JN45LV,EME,,Enrico,,,08/00 -HB9WAH,JN47FD,,,Bruno,,50: 10W - 144: 2x 11El 1kW MGF1302 - 432:,04/04 +HB9WAH,JN47FD,,,,,50: 10W - 144: 2x 11El 1kW MGF1302 - 432:,04/04 HC5K,FI07NB,,,,,,2003 -HF75PZK,JO93AC,EME,,,,,01/05 -HG1DLZ,JN87HF,,,Zoli,,144: 8x13el 200W MGF1402only SSB-MS,12/98 -HG2EAD,JN97,,,i.,,,1993 +HF75PZK,JO93AC,EME,,SpecialCall,,,01/05 +HG1DLZ,JN87HF,,,,,144: 8x13el 200W MGF1402only SSB-MS,12/98 +HG2EAD,JN97,,,,,,1993 HG2KNP,JN97,,,,,,1993 -HG2NP,JN97,,,R.,,,1/95 -HG3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,08/98 -HG3O,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,08/98 -HG4XG,JN96,,,g.,,,1993 -HG5CYT,JN97,,,Tibor,,144: FT290r 50W 5el - 432: 25W 11el,01/01 -HG5PT,JN97MT,,,dr. holman,,,1993 +HG2NP,JN97,,,,,,1/95 +HG3DXC,JN96JO,,,,,144: 5.5WL 2x88771800lpm.373,08/98 +HG3O,JN96JO,,,,,144: 5.5WL 2x88771800lpm.373,08/98 +HG4XG,JN96,,,,,,1993 +HG5CYT,JN97,,,,,144: FT290r 50W 5el - 432: 25W 11el,01/01 +HG5PT,JN97MT,,,,,,1993 HG6KNB,JN98,,,,,,1993 HG6KVB,KN07,,,,,,1993 -HG6NQ,JN98WA,,,sanyi,,3,1995 -HG7AJ,JN97,,,a.,,,1993 -HG7JAL,JN97KK,,,Pista,,,07/02 -HG7P,JN97KW,,,Clubstation,,,04/97 -HG7WJ,JN97MP,,,sandor,,,1993 -HG9MET,KN08DF,,,Tom,,144: 150W 14el CF300.190,07/00 -HG9OZD,KN08DF,,,OP HG9MDP- MET,,144: TR9130 150W 14el CF300.060.190,07/00 +HG6NQ,JN98WA,,,,,3,1995 +HG7AJ,JN97,,,,,,1993 +HG7JAL,JN97KK,,,,,,07/02 +HG7P,JN97KW,,,ex HG7B/p,,,04/97 +HG7WJ,JN97MP,,,,,,1993 HG9SM,KN08HF,,,,,,07/04 -HG9VHF,KN08EB,,,OP HG9MDP- MET,,144: TR9130 150W 14el CF300.140.190,07/00 -HGM3DXC,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 -HGM3O,JN96JO,,,Clubstation,,144: 5.5WL 2x88771800lpm.373,07/96 +HG9VHF,KN08EB,,,,,144: TR9130 150W 14el CF300.140.190,07/00 +HGM3DXC,JN96JO,,,Specialcall,,144: 5.5WL 2x88771800lpm.373,07/96 +HGM3O,JN96JO,,,Specialcall,,144: 5.5WL 2x88771800lpm.373,07/96 +HI3TEJ,FK49,EME,,QSL via ON4IQ,,144: 17el 500W,06/05 HI8ROX,FK58AL,,,,,,2003 HL5XF,PM45OH,,,,,,2003 HS2CRU,OK03LE,,,,,,2003 HV0A,JN61FV,,,,,,01/05 -HV4NAC,JN61,,,Clubstation,,,06/99 +HV4NAC,JN61,,,Expedition,,,06/99 I0EMV,JN62BK,,,,,,1992 -I0UZF,JN63,,,Francesco,,,06/00 -I1ANP,JN44VC,EME,,Mario,,IC735+L4B - 144: TS700 4x4cx250b MGF1302 4x,03/01 -I1BSN,JN34,,,franco,,,1993 +I0NLK,JN62HB,,,,,FT736 200W 11el F9FT,03/06 +I0UZF,JN63,,,,,,06/00 +I1ANP,JN44VC,EME,,,,IC735+L4B - 144: TS700 4x4cx250b MGF1302 4x,03/01 +I1BSN,JN34,,,,,,1993 I1CPM,JN34VI,,,,,,01/03 I1CPN,JN34VH,,,,,,02/04 -I1DMP,JN35UB,,,Paolo,,144: 350W 20el LY.131 DTR,01/01 -I1JTQ,JN35UB,EME,,Mario,,144: 2x18el 900W MGF1801127227,08/01 -I1KTC,JN45HK,EME,,Alberto,,.085 DTR,11/96 -I1PIK,JN44TG,EME,,Pietro,,FT736R 50: 3el - 144: 64el GS35 Preamp - 432:,01/01 -I1TXD,JN45,,,rossi,,,1993 -I2COR,JN55BB,EME,,luigi,,,1994 -I2FAK,JN45OB,EME,,Franco,,144: 24x19el LLY YL1056DTR 2500lpm,12/04 -I2FHW,JN45,,,franco,,,1993 -I2ODL,JN45KL,EME,,OP IK2OFO,,144: 4x17el 8877 - 432: 8x21el 3CX800A7 - 129,09/00 +I1DMP,JN35UB,,,,,144: 350W 20el LY.131 DTR,01/01 +I1JTQ,JN35UB,EME,,,,144: 2x18el 900W MGF1801127227,08/01 +I1KTC,JN45HK,EME,,,,.085 DTR,11/96 +I1TXD,JN45,,,,,,1993 +I2FAK,JN45OB,EME,,,,144: 24x19el LLY YL1056DTR 2500lpm,12/04 +I2FHW,JN45,,,,,,1993 I2OKW,JN45OO,,,,,,08/02 -I2PHD,JN45SL,EME,,Alberto,,,12/00 -I2RV,JN45PL,EME,,,,,01/05 +I2RV,JN45PL,EME,,,,144: 4x 15el KLM,04/05 I2SVA,JN45,,,,,,01/02 I2UZV,JN45,,,,,,08/02 -I3DLI,JN65,EME,,Paolo,,6x19el 8877 CF379.018,11/00 I3LDS,JN55SR,,,,,,1990 -I3LGP,JN55WJ,,,Giuliano,,144: IC746 100W 17el BF960.141 DTR 3000lpm,01/04 +I3LGP,JN55WJ,,,,,144: IC746 100W 17el BF960.141 DTR 3000lpm,01/04 I3LLH,JN65BM,,,,,,04/00 -I4BXN,JN54,,,g.,,,1993 -I4LCK,JN54RK,,,Franco,,432: FT736 3CX800 Preamp 4x25el LY @ 950m asl,05/04 -I4RHP,JN54QL,,,Rodolfo,,144: TS711+PA500W 17EL,07/04 +I4LCK,JN54RK,,,,,432: FT736 3CX800 Preamp 4x25el LY @ 950m asl,05/04 +I4RHP,JN54QL,,,,,144: TS711+PA500W 17EL,07/04 I4TTZ,JN54VJ,,,,,,2003 -I4VXH,JN64EJ,,,l.,,,1993 -I4XCC,JN63GV,EME,,Claudio,,144: 4x17el F9FT 3CX800A7 preamp 1db075,01/04 -I4YNO,JN54KP,,,Alessandro ""Alex",,144: FT-736R MuTek MGF1302 3CX800 20el Shark1,08/03 -I5CTE,JN53XG,EME,,Piero,,,02/01 -I5JUX,JN53CW,EME,,Giacomo,,,08/96 -I5MPK,JN53,EME,,piero,,,1994 -I5MXX,JN53JU,,,Marzio,,144: 4x4el & 4x9el,10/00 -I5MZY,JN53OT,EME,,Massimo ""Max",,144: 800W 4x10el BF998117,10/04 -I5PPD,JN53PS,EME,,Pietro,,10368: 3m Dish 20W,10/00 +I4XCC,JN63GV,EME,,,,144: 4x17el F9FT 3CX800A7 preamp 1db075,01/04 +I4YNO,JN54KP,,,,,144: FT-736R MuTek MGF1302 3CX800 20el Shark1,08/03 +I5MXX,JN53JU,,,,,144: 4x4el & 4x9el,10/00 +I5MZY,JN53OT,EME,,,,144: 800W 4x10el BF998117,10/04 I5PPE,JN53NS,,,,,,2003 -I5TDJ,JN53,EME,,Piero,,,11/00 -I5WBE,JN53JR,EME,,Enrico,,144: FT736R 4x17el 8877 MGF1302 432: Yeasu,11/04 -I5YDI,JN54BB,EME,,Luigi,,144: FT736 3cx800 2x17el or 4x15el.100,04/02 -I6BQI,JN72BK,,,Angelo,,,09/02 -I6PNN,JN72GL,EME,,marco,,,1994 -I6QGA,JN63,EME,,gabriele,,,1994 +I5TWK/8,JN70FS,EME,,= I8TWK,,144: 400W 4CX250R PA IC271E MuTekDTR 3000,12/05 +I5WBE,JN53JR,EME,,,,144: FT736R 4x17el 8877 MGF1302 432: Yeasu,02/06 +I5WBE/IV3,JN66LL,,,Expedition,,375,07/05 +I5YDI,JN54BB,EME,,,,144: FT736 3cx800 2x17el or 4x15el.100,04/02 +I6BQI,JN72AK,EME,,,,144: 4x16jxx TS2000 8877PA,03/06 I6QON,JN63RL,,,,,,1994 -I6WJB,JN72CK,EME,,Pierluigi,,144: single 3wl yagi 1 Kw MGF1302,05/04 -I6YPK,JN72,,,bruno,,,1995 +I6WJB,JN72CK,EME,,,,144: 4x 16el 1 Kw MGF1302,05/05 +I6YPK,JN72,,,,,,1995 I7CSB,JN71QQ,,,,,,09/96 -I7FNW,JN81GD,EME,,n.,,,1994 -I7HCB,JN71VT,,,Andrea,,144: 150W 13el,12/01 -I7RNI,JN80,,,n.,,,1993 -I8MPO,JN70FP,,,Lucio,,only SSB-MS.383,11/04 -I8REK,JN70,,,Archimede,,,1993 -I8TUS,JM89DE,,,Salvatore,,,10/04 -I8UZA,JN70AU,,,Pino,,144: FT847 150W 10el BVO3wl.250,09/02 -I8WES,JN70,,,r.,,,1993 -IC8CQF,JN70CN,,,Pasqual ""Lino",,50: 100W 4el Yagi - 144: 300W 10el093 300,08/03 +I7FNW,JN81GD,EME,,,,,1994 +I7HCB,JN71VT,,,,,144: 150W 13el,12/01 +I7RNI,JN80,,,,,,1993 +I8/DF2ZC,JM79VP,,,Expedition,,,05/06 +I8/DH7FB,JM79VP,,,Expedition,,,05/06 +I8MPO,JN70FP,,,,,only SSB-MS.383,11/04 +I8REK,JN70,,,SilentKey,,,1993 +I8TUS,JM89DE,,,,,,10/04 +I8UZA,JN70AU,,,,,144: FT847 150W 10el BVO3wl.250,09/02 +I8WES,JN70,,,,,,1993 +IC8CQF,JN70CN,,,,,50: 100W 4el Yagi - 144: 300W 10el 3wl 9BV,08/05 IC8EGJ,JN70CN,,,,,,1989 -IC8FAX,JN70CN,,,Giacobbe (Jakob),,144: FT736r 300W 20el083 DTR437,03/04 -IH9YMC,JM56XT,,,Raf,,,08/04 -II0W,JN51,,,,,,06/03 -IK0BZY,JN61GW,EME,,,,,07/01 -IK0FEC,JN63,,,l.,,,1993 -IK0FIY,JN61GW,EME,,Wife of Enrico,,FT736r 144: 6el 800W MGF1302 - 432: 33el 600W,01/00 -IK0FTA,JN61GV,,,Sergio,,50: TS680 GaasFet 6el100lpm !,05/02 +IC8FAX,JN70CN,,,ex IW8BZN,,144: FT736r 300W 20el083 DTR437,03/04 +IH9/IT9BLB,JM66AS,,,Expedition,,only SSB-MS,07/05 +IH9YMC,JM56XT,,,,,,08/04 +II0W,JN51,,,QSL via IW0BET,,,06/03 +IK0FEC,JN63,,,,,,1993 +IK0FIY,JN61GW,EME,,,,FT736r 144: 6el 800W MGF1302 - 432: 33el 600W,01/00 +IK0FTA,JN61GV,,,,,50: TS680 GaasFet 6el100lpm !,05/02 IK0IXI,JN52,,,,,,1994 IK0IXO,JN52WA,EME,,,,,1993 -IK0OKY,JN61GT,,,Emilio ""Emile",,50: 4el 10W - 144: 25W 13el,04/02 -IK0OZK,JN52VC,EME,,Renato,,350W- 2x17el- Preamp,12/99 +IK0OKY,JN61GT,,,,,50: 4el 10W - 144: 25W 13el,04/02 IK0PCJ,JN63CL,,,,,,2003 IK0RNL,JN61GW,,,,,,2003 -IK0SMG,JN61FS,EME,,Pino,,,1/95 -IK0SOI,JN62HN,,,Sergio,,,06/02 -IK0VKL,JN61GV,,,flavio,,,1995 -IK0WGF,JN52VC,,,Francessco,,144: 2x11el 200W,03/04 -IK1EFM,JN44JK,,,antonio,,,1993 -IK1EGC,JN35UF,,,Daniele ""Dan",,50: FT650 3-500z 6el 1wl- 144: IC275 16el 4.4,07/02 -IK1FJI,JN44LL,EME,,Walter,,4x19xxx 5-72wl 8877 mgf1302 ic275H,12/00 -IK1GYZ,JN35TB,,,Sergio,,,11/95 +IK0SMG,JN61FS,EME,,,,,1/95 +IK0SOI,JN62HN,,,,,,06/02 +IK0VKL,JN61GV,,,,,,1995 +IK0WGF,JN52VC,,,ex IW0DAL,,144: 2x11el 200W,03/04 +IK1EFM,JN44JK,,,,,,1993 +IK1EGC,JN35UF,,,,,50: FT650 3-500z 6el 1wl- 144: IC275 16el 4.4,07/02 +IK1GYZ,JN35TB,,,,,,11/95 IK1HJQ,JN33,,,,,,1990 -IK1HWG,JN44DS,EME,,maurizio,,,1994 -IK1JXY,JN44WC,EME,,Mark,,,08/04 +IK1JXY,JN44WC,EME,,,,,08/04 IK1LBW,JN44VC,,,,,,08/98 -IK1LGV,JN44JK,,,Gabriele,,144: GS31 MGF1302 15el QD1200lpm DTR MSDSP,08/00 -IK1LUT,JN34TW,,,marcello,,,1993 -IK1MTZ,JN35UB,EME,,diego,,,08/01 -IK1PAG,JN35SB,,,Roberto (Roby),,144: IC275h 1KW 2x17el F9FT MGF1302.136,01/01 +IK1LGV,JN44JK,,,,,144: GS31 MGF1302 15el QD1200lpm DTR MSDSP,08/00 +IK1LUT,JN34TW,,,,,,1993 +IK1MTZ,JN35UB,EME,,,,,08/01 +IK1PAG,JN35SB,,,,,144: IC275h 1KW 2x17el F9FT MGF1302.136,01/01 IK1RQT,JN34VP,,,,,,12/01 -IK1SLI,JN35UI,,,gianni,,,1993 -IK1SPR,JN34TQ,,,Flavio,,144: Braun SE400 500W MGF1302 2x 13elMSDSP,08/04 -IK1UWL,JN33VT,EME,,,,,01/05 +IK1SLI,JN35UI,,,,,,1993 +IK1SPR,JN34TQ,,,,,144: Braun SE400 500W MGF1302 2x 13elMSDSP,08/05 +IK1UWL,JN33VT,EME,,,,144: 4x 14XPol 1000W,08/05 IK1YWB,JN34UX,,,,,,04/02 -IK2CDI,JN55GN,EME,,Marinella,,144: IC275H 3CX800A7 MGF1302 4x18el8000lpm M,01/00 -IK2CFR,JN54,,,Marco,,,03/01 -IK2DDR,JN55GN,EME,,Francesco,,144: IC275H 8877 MGF1302 4x18el8000lpm MSD,07/01 -IK2EAD,JN55EJ,EME,,romeo,,,1994 -IK2EAE,JN45LL,,,Fabio,,144: FT480r 100W 17elonly SSB-MS.300,11/01 -IK2FIL,JN45OM,,,Enrico,,144: IC275H 9 el. F9FT + SP2000 50W,11/04 -IK2GSO,JN45NP,EME,,Enrico,,IC7400 FT857 50: 1KW 10el 144: 14el DJ9BV,11/04 -IK2JUB,JN45ON,,,Stefano,,,03/03 -IK2LHP,JN45SP,,,Angelo,,144: TS790 200W 15el - 432: 100W 31el,07/01 -IK2MMB,JN45,EME,,Sergio,,,01/01 -IK2OFO,JN45KL,EME,,Roberto,,144: 4x17el 8877 - 432: 8x21el 3CX800A7 - 129,09/00 +IK2CDI,JN55GN,EME,,,,144: IC275H 3CX800A7 MGF1302 4x18el8000lpm M,01/00 +IK2CFR,JN54,,,,,,03/01 +IK2DDR,JN55GN,EME,,,,144: IC275H 8877 MGF1302 4x19el LY8000lpm,01/06 +IK2EAE,JN45LL,,,,,144: FT480r 100W 17elonly SSB-MS.300,11/01 +IK2FIL,JN45OM,,,,,144: IC275H 9 el. F9FT + SP2000 50W,11/04 +IK2GSO,JN45NP,EME,,ex K2GSO,,IC7400 FT857 50: 1KW 10el 144: 14el DJ9B,03/05 +IK2JUB,JN45ON,,,,,,03/05 +IK2LHP,JN45SP,,,,,144: TS790 200W 15el - 432: 100W 31el,07/01 +IK2MMB,JN45,EME,,,,,02/05 IK2RTI,JN55AD,,,,,,2003 -IK2TPX,JN45LL,EME,,dario,,,1993 -IK2XRL,JN45NR,,,Mauro,,144: FT736r 150W 17el PreampDTR 2000lpm,01/01 -IK2YXK,JN45OP,,,Maurizio ""Mau",,144: IC275h 4CX250 12elM2 DSP59,05/02 -IK3MAC,JN55SH,EME,,Graziano,,144: 30x19el 8877,08/00 -IK3TPP,JN65EP,,,Fabio,,,12/04 -IK3VZO,JN55XA,,,Giovanni,,144: 16el 200W,02/98 -IK4DCO,JN64GB,EME,,paolo,,,1994 -IK4DCX,JN64GA,EME,,Marco,,144: 4x20el 2.5KW,04/01 -IK4DRY,JN64BL,,,Steve,,1000lpm,04/01 -IK4FMT,JN54WG,,,Marco,,144: TS790 2M5WL 4CX250 MGF1302 20dBMSDSP,01/00 -IK4JOC,JN54WN,EME,,claudio,,,1994 -IK4NMF,JN54SM,EME,,fausto,,,1994 -IK4PLU,JN64FC,EME,,Ermes,,only SSB-MS,08/99 -IK4PMB,JN54LL,,,Antonio ""Anto",,50: X-Verter 10W Dipole - 144: FT225RD MUTEK,01/05 -IK4WLV,JN54XK,EME,,Massimo,,,02/98 -IK5AMB,JN53FU,,,Iacopo,,only SSB-MS,11/98 -IK5EHR,JN53FU,EME,,Lele,,,01/97 -IK5JWQ,JN52NS,EME,,Guiseppe,,,08/98 +IK2XRL,JN45NR,,,,,144: FT736r 150W 17el PreampDTR 2000lpm,01/01 +IK2YXK,JN45OP,,,,,144: IC275h 4CX250 12elM2 DSP59,05/02 +IK3MAC,JN55SH,EME,,,,144: 1100W 24 x 23el LLY + 24x 10el yagi Ve,09/05 +IK3TPP,JN65EP,,,,,,12/04 +IK3VZO,JN55XA,,,,,144: 16el 200W,02/98 +IK4DCO,JN64GB,EME,,,,,1994 +IK4DCX,JN64GA,EME,,,,144: 4x20el 2.5KW,04/01 +IK4DRY,JN64BL,,,,,1000lpm,04/01 +IK4FMT,JN54WG,,,,,144: TS790 2M5WL 4CX250 MGF1302 20dBMSDSP,01/00 +IK4PLU,JN64FC,EME,,,,only SSB-MS,08/99 +IK4PMB,JN54LL,EME,,,,50: X-Verter 10W Dipole - 144: FT225RD MUTEK,08/05 +IK4WLV,JN54XK,EME,,,,,02/98 +IK5AMB,JN53FU,,,,,only SSB-MS,11/98 +IK5JWQ,JN52NS,EME,,,,,08/98 IK5OEA,JN53PG,,,,,,12/04 -IK5OIY,JN52NT,,,Massimo,,,03/96 -IK5QLO,JN53FU,,,Andrea,,50: LY - 144: 250W 10el CF300 - 432: 900W,07/04 -IK5UBM,JN53GT,EME,,Luca,,144: 8877 2x15el MGF1303.023 1000lpm.280,07/98 -IK5WJD,JN53PS,EME,,Alessandro,,10368: 3m Dish 20W,10/00 -IK5ZUI,JN53RD,,,Mike,,144: TS700G 11el 250W BF981only SSB-MS,07/97 -IK6EIW,JN63RJ,EME,,Stefano,,,10/95 -IK6FHF,JN63,,,a.,,,1993 +IK5OIY,JN52NT,,,,,,03/96 +IK5QLO,JN53FU,,,,,50: LY - 144: 250W 10el CF300 - 432: 900W,07/04 +IK5ZUI,JN53RD,,,,,144: TS700G 11el 250W BF981only SSB-MS,07/97 +IK6FHF,JN63,,,,,,1993 IK6IHM,JN72,,,,,,95 -IK6MLI,JN62UT,,,Pino,,144: FT736 4x11el KLM Booster 8930.060 200,07/99 -IK6MMJ,JN63RL,,,Fabricio,,.115,10/95 -IK7EZN,JN90DG,EME,,Ermanno,,144: 4x16 (jxx) 1 KW,04/04 -IK7UXY,JN90DC,EME,,Gianni,,144: FT1000MP+LT2S 0.2db 1KW 20el or 4x12elD,05/02 -IK8ETN,JM89CH,,,Pietro,,144: ic275e 4x150 17f9ft,01/04 +IK6MLI,JN62UT,,,,,144: FT736 4x11el KLM Booster 8930.060 200,07/99 +IK6MMJ,JN63RL,,,,,.115,10/95 +IK7EZN,JN90DG,EME,,,,144: 4x 16el JXX 1 KW,04/05 +IK7UXY,JN90DC,EME,,,,144: FT1000MP+LT2S 0.2db 1KW 20el or 4x12elD,05/02 +IK7XLW,JN80FT,EME,,,,144: 16JXX 250W,03/06 +IK8ETN,JM89CH,,,,,144: ic275e 4x150 17f9ft,01/04 IK8IUQ,JN70MM,,,,,,2003 -IK8MKK,JN71DC,,,michele,,,1995 +IK8MKK,JN71DC,,,,,,1995 IK8TOY,JM89CH,,,,,,08/04 IN3AGI,JN56,,,,,,2003 IN3ATM,JN56NK,,,,,,01/02 -IN3DOV,JN65WS,,,kurt,,,1993 -IN3HER,JN56,EME,,raimund,,,1994 -IN3KLQ,JN56RG,EME,,Giuliano,,144: 180W 17el.110,04/00 -IN3TWX,JN56NQ,EME,,Wolfgang,,144: 3CX800 Preamp 4x11ele DL6WU full eleva,08/03 -IS0AGY,JM49OF,,,Ampelio,,144: IC211E 4CX350b 17el Gaas.280,01/99 -IS0BDB,JN40GT,,,Vannino,,,05/04 +IN3DOV,JN65WS,,,,,,1993 +IN3HER,JN56,EME,,,,,1994 +IN3KLQ,JN56RG,EME,,,,144: 180W 17el.110,04/00 +IN3TWX,JN56NQ,EME,,zzT W3TWX,,144: 3CX800 Preamp 4x11ele DL6WU full eleva,08/03 +IQ2CJ,JN45ON,,,,,IC 275H - GS35 - 2 x 13 DJ9BV,03/05 +IQ8BI/7,JM99AX,,,,,144: 10el 500W,07/05 +IS0/DL1RNW,JM48FX,,,Expedition,,,10/05 +IS0/I0JU,JN40DN,EME,,,,FT847 LNA 50 and 144 500W 5 el Yagi 50 m,04/06 +IS0AGY,JM49OF,,,,,144: IC211E 4CX350b 17el Gaas.280,07/05 +IS0BDB,JN40GT,,,,,,05/04 IS0CAK,JM49,,,,,,01/04 -IS0GQX,JM49,,,,,,05/02 -IS0SWW,JN40GR,,,Walter,,,02/04 -IT9BLB,JM68QE,,,Giuseppe (Joe),,144: 2x15el 2x4cx250r MGF1302.129.389,11/96 +IS0EBO,JN40GR,EME,,ex IW0UEI,,144: Icom gs35 3wl ant,03/06 +IS0GQX,JM49OH,,,,,,05/05 +IS0SWW,JN40GR,,,,,,02/04 +IT9BLB,JM68QE,,,,,144: 2x15el 2x4cx250r MGF1302.129.389,11/96 IT9CJC,JM76GS,,,,,,1989 -IT9GSF,JM67SS,,,Flavio,,,1994 -IT9GSV,JM77LH,,,Andrea,,,04/01 -IT9IPQ,JM78SG,EME,,Paolo,,ic756pro ic275 ic475 transvonly SSB-MS,04/02 -IT9LCY,JM77NO,,,giuseppe,,,1993 -IT9VDQ,JM68QC,,,Joe (Giuseppe),,144: TS850 3CX800A7 17el Preamp.153 DTR tx1,12/04 +IT9GSF,JM67SS,,,,,,1994 +IT9GSV,JM77LH,,,,,,04/01 +IT9IPQ,JM78SG,EME,,,,ic756pro ic275 ic475 transvonly SSB-MS,04/02 +IT9LCY,JM77NO,,,,,,1993 +IT9VDQ,JM68QC,,,,,144: TS850 3CX800A7 17el Preamp IC-7400153,10/05 IV3BBR,JN65,,,,,,11/98 -IV3DXW,JN65QQ,,,Claudio,,144: 4CX250 - 16JXX2 4.5WL,08/03 -IV3GBO,JN66OA,EME,,g.,,DTR,01/02 -IV3GTH,JN65ST,,,Gigi,,50: IC706 4 el Quad - 144 MHz: FT221 Mutek,08/03 -IV3HWT,JN65ST,EME,,Lucio,,144: FT101zd Trvt 8877 4x18el 4x20el.116 DT,08/04 +IV3DXW,JN65QQ,,,,,144: 4CX250 - 16JXX2 4.5WL,08/03 +IV3GBO,JN66OA,EME,,,,DTR,01/02 +IV3GTH,JN65ST,EME,,,,50: IC706 4 el Quad - 144 MHz: FT221 Mutek,04/05 +IV3HWT,JN65ST,EME,,,,144: FT101zd Trvt 8877 4x18el 4x20el.116 DT,08/04 IV3KTY,JN65,,,,,,08/02 -IV3MPI,JN65SV,,,Edi,,IC746 IC271E Mutek FT736R PHEMT144 PHEMT,03/04 -IV3NDC,JN65RV,,,Massimo,,144: 300W BF981 2x15el 3.3wl176 2000lpm DTR,08/03 -IV3VFP,JN66HD,EME,,erminio,,,1993 -IV3ZCX,JN65QS,EME,,Maurizio,,144: Icom 275 PA 600Watts MGF1302 4x24el10522, +IV3MPI,JN65SV,,,ex IW3QMB,,IC746 IC271E Mutek FT736R PHEMT144 PHEMT,03/06 +IV3NDC,JN65RV,,,,,144: 300W BF981 2x15el 3.3wl176 2000lpm DTR,08/03 +IV3VFP,JN66HD,EME,,,,,1993 IW0AKA,JN61FS,,,,,,1990 -IW0AYO,JN61IU,,,Morris,,144: 16elonly SSB-MS,07/96 -IW0BFZ,JN61,,,b.,,,1993 +IW0AYO,JN61IU,,,,,144: 16elonly SSB-MS,07/96 IW0BTS,JN61GU,,,,,only SSB-MS,1988 -IW0CUT,JN61TP,EME,,arnaldo,,,1993 IW0CVK,JN61GV,,,,,,01/05 IW0DJB,JN61,,,,,,04/02 -IW0DVG,JN61KK,,,max,,,1993 -IW0FFK,JN61FS,,,,,,10/04 +IW0DVG,JN61KK,,,,,,1993 +IW0FFK,JN61FS,,,,,,03/06 IW0GDC,JN61HX,,,,,,10/98 -IW0GPN,JN62FB,,,Alessandro ""Alex",,FT736 144: 200W 16el 4.8wlonly SSB-MS212,10/04 +IW0GPN,JN62FB,,,,,FT736 144: 200W 16el 4.8wlonly SSB-MS212,10/04 IW0QNX,JN62,,,,,,01/97 IW0QO,JN63EC,,,,,,1993 -IW0RBS,JN63FD,,,freddy,,,1993 -IW0RLC,JN63FD,,,Dario,,only SSB-MS,06/00 -IW0UEI,JN40GR,EME,,Antonio,,144: 2x9el 150W,04/04 -IW1ARB,JN44CV,EME,,Paolo,,144: 4x4.4Wl lt2s 3cx1500,03/01 -IW1AZJ,JN35UB,,,Silvio,,144: 200W 3.8wl DJ9BV2000lpm,06/00 -IW1BCV,JN44FS,,,Carlo,,144: IC275H 8930 2x18el MGF1302DTR 3000l,08/98 -IW1CCH,JN35TB,,,,,,01/05 -IW1CGB,JN35VG,EME,,Steve,,50: 3el PA - 144: 4x17el 2x4cx250b MGF130,06/97 -IW1CHX,JN35TH,,,Nicola,,144: C58 13el DJ9BV MGF1302 170W.100 150,04/02 +IW0RBS,JN63FD,,,,,,1993 +IW0RLC,JN63FD,,,,,only SSB-MS,06/00 +IW0UEI/MM,JN31XA,,,Expedition,,144: 7el 180W,08/05 +IW1AZJ,JN35UB,,,,,144: 200W 3.8wl DJ9BV2000lpm,06/00 +IW1BCV,JN44FS,,,,,144: IC275H 8930 2x18el MGF1302DTR 3000l,08/98 +IW1CGB,JN35VG,EME,,,,50: 3el PA - 144: 4x17el 2x4cx250b MGF130,06/97 +IW1CHX,JN35TH,,,,,144: C58 13el DJ9BV MGF1302 170W.100 150,04/02 IW1DIM,JN35TC,,,,,only SSB-MS,07/01 IW1DJS,JN35SA,,,,,,08/01 IW1FTY,JN35UA,,,,,,2003 -IW2BNA,JN45ON,,,Walter,,144: IC275H 3CX800 4x11el - 432: IC475H,01/04 -IW2BSQ,JN45UJ,,,Jo,,144: IC746 !7el,04/03 -IW2BZY,JN45NN,,,Lorenzo,,144: 500Watts 2x12ele Flexaonly SSB-MS,08/01 -IW2DAL,JN45NN,,,Emilio,,144: FT736R 4x19LLY 4CX1000a - 432: FT736R,04/04 -IW2DMN,JN45KL,,,Ivano,,144: 100W 15el,10/02 -IW2DUA,JN45LL,EME,,dario,,,1993 -IW2HAJ,JN45NO,,,Claudio,,50: IC706 6el - 144: 400W 20ele Preamp,04/02 +IW2BNA,JN45ON,,,,,144: IC275H 3CX800 4x11el - 432: IC475H,01/04 +IW2BSQ,JN45UJ,,,,,144: IC746 !7el,04/03 +IW2BZY,JN45NN,,,,,144: 500Watts 2x12ele Flexaonly SSB-MS,08/01 +IW2DAL,JN45NN,,,,,144: FT736R 4x19LLY 4CX1000a - 432: FT736R,04/04 +IW2DMN,JN45KL,,,,,144: 100W 15el,10/02 +IW2HAJ,JN45NO,,,,,50: IC706 6el - 144: 400W 20ele Preamp,04/02 IW2HUS,JN45NO,,,,,,04/02 -IW2HWQ,JN55GK,,,Francesco,,144: FT736r 80W 21elonly SSB-MS,10/96 -IW2LC,JN45OL,,,Luigi,,ICOM-756 YAESU FT-897 ICOM275H KENWOOD TS-790,05/04 -IW2LLA,JN55AM,,,Andrea,,144: 2x17el 100Wonly SSB-MS,08/96 -IW2MYV,JN45JN,,,Marco,,144: TS711E 4CX250 GaAs 4x7el + elv.only S,01/02 -IW2NEF,JN46QD,,,Flavio,,144: FT847 12elXY,11/02 -IW2NOR,JN45ON,,,Gaetano,,ICOM IC275H KENWOOD TS 2000 144: 100W 2x17,06/04 +IW2HWQ,JN55GK,,,,,144: FT736r 80W 21elonly SSB-MS,10/96 +IW2LLA,JN55AM,,,,,144: 2x17el 100Wonly SSB-MS,08/96 +IW2MYV,JN45JN,,,,,144: TS711E 4CX250 GaAs 4x7el + elv.only S,01/02 +IW2NEF,JN46QD,,,,,144: FT847 12elXY,11/02 +IW2NOR,JN45ON,,,,,ICOM IC275H KENWOOD TS 2000 144: 100W 2x17,06/04 IW3BKQ,JN56NH,,,,,,07/02 -IW3QTG,JN65PT,,,Paolo,,144: IC746 2x 17FT,08/04 -IW3RI,JN65RU,,,Claudio,,50: 6el/HyGain 144: 4x17el 432: 4x21el.155.,03/01 +IW3QTG,JN65PT,,,,,144: IC746 2x 17FT,08/04 +IW3RI,JN65RU,,,ex IW3QYG,,50: 6el/HyGain 144: 4x17el 432: 4x21el15529,03/06 IW3SGT,JN65,,,,,,07/02 -IW3SNU,JN65OT,,,Dany,,,11/04 -IW4ADT,JN54,EME,,augusta,,,1994 +IW3SNU,JN65OT,,,,,,11/04 IW4AR,JN64FD,,,,,,2003 -IW4ARD,JN64FD,,,Gianni,,144: 20el 300W,01/05 -IW4BET,JN54QL,,,Carlo,,,08/02 -IW4BLG,JN54VF,,,,,,2003 +IW4ARD,JN64FD,EME,,,,144: 2x16el 8877 432: 4x19el 400W,05/05 +IW4BET,JN54QL,,,,,,08/02 +IW4BLG,JN54VF,EME,,,,144: 4x10el k5gw 900w,2004 IW4BTJ,JN54QL,,,,,,2003 -IW4CB,JN54XK,,,Andrea,,,02/01 +IW4CB,JN54XK,,,,,,02/01 IW4DJE,JN64,,,,,,01/95 -IW4DLA,JN64CE,,,giacomo,,,1994 -IW4DMH,JN64CJ,,,Gabriel,,only SSB-MS,11/98 -IW4DQY,JN64AG,,,Joe,,,03/04 -IW4EHV,JN64AE,,,Fabio,,FT817 30W Amp 50: 5el - 144: 11el - 432: 2,09/03 -IW4EHZ,JN54ML,EME,,FAUSTO,,IC706MKIIG 20EL70CM 12EL2MT 6EL6MT,01/05 -IW5ACZ,JN53HP,,,ALESSANDRO,,50: TS2000 HB9CV 144: TR751E 4CX250 250 WAT,10/04 -IW5AVM,JN52NS,,,,,,2003 +IW4DLA,JN64CE,,,,,,1994 +IW4DMH,JN64CJ,,,,,only SSB-MS,11/98 +IW4DQY,JN64AG,,,,,,03/04 +IW4EHV,JN64AE,,,,,FT817 30W Amp 50: 5el - 144: 11el - 432: 2,09/03 +IW4EHZ,JN54ML,EME,,ex IW4BTE,,IC706MKIIG 20EL70CM 12EL2MT 6EL6MT,03/05 +IW5ACZ,JN53HP,,,,,50: TS2000 HB9CV 144: TR751E 4CX250 250 WAT,10/04 IW5BLG,JN54VF,,,,,,2003 -IW5BML,JN52JW,EME,,A.,,,04/99 -IW5BPE,JN52NT,,,massimo,,,1993 -IW5CNS,JN53CX,EME,,Daniele,,144: IC275H 4x10el 2.2wl 9BV 8877 MGF130,12/99 -IW5DAN,JN53GU,EME,,Luigi,,144: 4x10el DJ9BV 8877 TS790e MGF1302.177,02/01 -IW5DHN,JN53gi,EME,,Matteo,,TS2000,04/02 +IW5BML,JN52JW,EME,,,,,04/99 +IW5BPE,JN52NT,,,,,,1993 +IW5DHN,JN53GI,EME,,,,TS2000 4x 7el,04/06 IW5DNZ,JN53,,,,,,05/02 -IW5EKJ,JN54AA,,,Roberto ""Roby",,144: 4-5ld 300W,10/04 -IW6AEG,JN63RO,,,Fabio,,,10/93 -IW6BLH,JN63RO,,,Franco,,,12/00 +IW5EKJ,JN54AA,EME,,ex IW1CCH,,144: IC-756 PRO2 TRSV GS31 or 3CX800,04/06 +IW6AEG,JN63RO,,,,,,10/93 +IW6BLH,JN63RO,,,,,,12/00 IW6BNO,JN63RL,,,,,,11/95 -IW7DEC,JN81GF,,,Roberto,,144: 12db yagi 100W Preamp,08/04 +IW7DEC,JN81GF,,,,,144: 12db yagi 100W Preamp,08/04 IW8QOT,JM88BR,,,,,,2003 -IW9CER,JM78QF,,,Tony,,only SSB-MS,10/02 -IW9ELR,JM68PD,,,Rosario ""Roy",,,11/02 -IW9FRA,JM68GA,,,Sal,,,01/05 -IZ0ARL,JN61IU,,,Maurizio (Morris),,144: 200W 16elonly SSB-MS,10/96 -IZ0AYB,JN52VC,EME,,Daniele,,IC-910H 144: 4x12JXX - 432: 2x19 Tonna,05/04 -IZ0CVK,JN61GV,,,Fabrizio ""Fab",,Yaesu FT767 mgf1801 11eleF9Ft 20ele DJ9BV5,06/04 -IZ1DXS,JN35UA,,,George,,ICOM IC-7400 (746 PRO) - 50: 6el - 144: 14e,11/02 -IZ1EGT,JN44LK,,,Fabio,,IC910,11/04 -IZ1ESM,JN45FB,,,Paolo,,KWD TS850 + LT2S MK2 + 4.4wl BVonly SSB-MS,09/02 +IW9CER,JM78QF,,,,,only SSB-MS,04/05 +IW9ELR,JM68PD,,,,,,11/02 +IW9FRA,JM68GA,,,,,,01/05 +IZ0ARL,JN61IU,,,,,144: 200W 16elonly SSB-MS,10/96 +IZ0AYB,JN52VC,EME,,,,IC-910H 144: 4x12JXX - 432: 2x19 Tonna,05/04 +IZ0CVK,JN61GV,,,ex IW0CVK,,Yaesu FT767 mgf1801 11eleF9Ft 20ele DJ9BV5,06/04 +IZ1BPN,JN34OT,EME,,ex IW1CGB,,144: 150W 9el dj9bv MGF1801 50: TS680 3,03/06 +IZ1DXS,JN35UA,,,ex IW1FTY,,ICOM IC-7400 (746 PRO) - 50: 6el - 144: 14e,11/02 +IZ1EGT,JN44LK,,,ex IW1RDT,,IC910 100W 2.5 Wl ant,02/05 +IZ1ESM,JN45FB,,,ex IW1ESM,,KWD TS850 + LT2S MK2 + 4.4wl BVonly SSB-MS,09/02 IZ2AAJ,JN45,,,,,,12/99 -IZ2DJP,JN55FO,,,Adelio,,,05/04 +IZ2DJP,JN55FO,,,,,,05/04 IZ2EEQ,JN45,,,,,,07/02 -IZ2FOB,JN45MQ,,,Roberto,,50: IC706 dipole - 144: IC821h 150Watt 2x9F9F,08/03 -IZ4AIK,JN63HV,,,Marco,,50: 100W 5el - 144: TS790 3CX800A7 TS850 & T,07/01 -IZ4BEH,JN54WL,,,Roberto,,144: 1KW 2x16el MGF2407 - 432: 2x21el 300W,10/02 -IZ4BEJ,JN64CE,,,Enrico,,144: 2x13el gd Pwronly SSB-MS,11/97 -IZ5BXF,JN53GV,EME,,Michele,,300W- 4x11el 2.2wl- 0.3dbNF2500lpm,01/01 -IZ5EME,JN52NS,EME,,Marco,,144: 4x20el 8877 - 432: 4x25el 3CX800 - 1296:,04/01 -IZ8AZB,JN70EP,EME,,Lucio,,144: 4x11el 8930(400W)DTR,01/02 -IZ8DWL,JM88BR,,,Primo,,144: IC-746 PA 4CX250 16JXX LY MGF1302,04/04 -J45M,KM46CF,EME,,OP: PE1LWT- PA2CHR,,144: FT100 FT847 IC706 DSP59/Datong audiofilt,06/01 -J48XG,KN20GR,,,,,144: 8el DK7ZB 60W,05/04 -J79MY,FK95,EME,,OP K6MYC,,4x Yagi- 1.5KW,06/98 -JA0BLU,PM97OS,EME,,Masa,,144: 1KW 4x19el 2x18el MGF1801.043.250,01/00 +IZ2FOB,JN45MQ,,,ex IW2DVK,,50:5w dipole 144:150W 2x9ft MGF1302 432:4x21,05/05 +IZ2GOL,JN45OL,,,ex IW2LC,,ICOM IC-761 IC-756 IC-275H YAESU FT-897 FT-8,03/05 +IZ4AIK,JN63HV,,,ex IW4CYM,,50: 100W 5el - 144: TS790 3CX800A7 TS850 & T,07/01 +IZ4BEH,JN54WL,,,,,144: 1KW 2x16el MGF2407 - 432: 2x21el 300W,10/02 +IZ4BEJ,JN64CE,,,ex IW4DCT,,144: 2x13el gd Pwronly SSB-MS,11/97 +IZ5EME,JN52NS,EME,,ex IW5AVM,,144: 4x20el 8877 - 432: 4x25el 3CX800 - 1296:,04/01 +IZ8AZB,JN70EP,EME,,ex IW8CVV,,144: 4x11el 8930(400W)DTR,01/02 +IZ8DWL,JM88BR,,,ex IW8QOT,,144: IC-746 PA 4CX250 16JXX LY MGF1302,04/04 +J3/K5AND,FK92EF,EME,,Expedition,,144: 4x 9el QRO,06/05 +J45M,KM46CF,EME,,Expedition,,144: FT100 FT847 IC706 DSP59/Datong audiofilt,06/01 +J48XG,KN20GR,,,Expedition,,144: 8el DK7ZB 60W,05/04 JA0VI,PM95,EME,,,,,2003 JA1DXA,PM95VU,,,,,,2003 +JA1RJU,QM06CB,EME,,,,,04/05 JA1VZV,PM95QL,,,,,,2003 JA2HMO,PM85IH,,,,,,2003 JA2JRJ,PM84MW,EME,,,,,89 @@ -1703,41 +1689,44 @@ JA2TY,PM84GS,EME,,,,,2003 JA3BXC,PM74SU,,,,,,2003 JA3IAF,PM74,EME,,,,,2003 JA3SGR,PM74TU,EME,,,,,2003 -JA4BLC,PM65NM,EME,,,,,89 +JA4BLC,PM65NM,EME,,,,2320: 6m dish 300W,04/06 JA4CMZ,PM65MI,EME,,,,,2003 JA4KLX,PM95RI,,,,,,2003 JA5NNS,PM63,EME,,,,,2003 JA5OVU,PM74FC,EME,,,,,2003 JA5YJS,PM63,EME,,,,,2003 -JA6AHB,PM53CP,EME,,,,,2003 -JA6CZD,PM53FM,EME,,,,,2003 +JA6AHB,PM53CP,EME,,,,432: 7m Dish 1KW,11/05 +JA6CZD,PM53FM,EME,,,,2320: 5m dish 150W,04/06 JA6DZI,PM53GM,EME,,,,,2003 JA6XED,PM53,EME,,,,,2003 JA6ZHR,PM53,EME,,,,,2003 JA7BJP,QM07GN,,,,,,2003 JA7BMB,PM97WM,EME,,,,,2003 -JA8ERE,QN02QX,EME,,,,,2003 -JA8IAD,QN03,EME,,,,,2003 +JA8ERE,QN02QX,EME,,,,2320: 6m dish 180W,04/06 +JA8IAD,QN03,EME,,,,2320: 5m dish 180W,04/06 JA8PL,QN03,EME,,,,,2003 -JA9BOH,PM86FA,EME,,,,,2003 +JA9BOH,PM86FA,EME,,,,144: 4 x 2.8 mt,04/04 +JE1KFX,QM06IR,EME,,,,144: 4x 18el 500W,05/05 +JE2XBY,PM84MS,EME,,,,,03/05 JF3HUC,PM74UX,EME,,,,,2003 JF3IPR,PM74,,,,,,2003 +JF4TGO/8,QN02UT,EME,,,,144: 200W 2x 20el X-Pol,12/05 JH0ISW,PM97LO,,,,,,2003 +JH0MHE,PM96HI,EME,,,,144: 4x 18el M2 500W,12/05 JH0QBI,PM97FF,,,,,,2003 -JH0WJF,PM86,EME,,,,,03/01 JH0YSI,PM85VJ,EME,,,,,89 JH1EFA,PM96UB,EME,,,,,2003 -JH1KRC,QM06AW,EME,,,,,2004 +JH1KRC,QM06AW,EME,,,,PO 500 watts exc. 3cm 300 watts 4.4m dish,03/06 JH1OFX,PM85SM,EME,,,,,2003 JH1OQW,PM95UX,,,,,,2003 JH1SWD,QM06HN,,,,,,2003 JH1XUJ,PM95UR,EME,,,,,2003 -JH2COZ,PM94mx,EME,,Yasu,,4x14el 1-5KW,03/99 +JH2COZ,PM49NW,EME,,,,144: IC821 4x14el 3.6wl ITT-4651 tube 3SK129,04/05 JH2OJS,PM85LD,,,,,,2003 JH3EAO,PM74KR,EME,,,,,2003 JH3VJV,PM74LP,,,,,,2003 JH4JLV,PM54LA,EME,,,,,2003 -JH5FOQ,PM63JS,EME,,,,,02/01 +JH5FOQ,PM63JS,EME,,,,144: 4x28xpol 600w,02/05 JH5LUZ,PM63FK,EME,,,,,2003 JH6RTO,PM53FA,,,,,,2003 JH7PAV,QM07DI,EME,,,,,2003 @@ -1749,60 +1738,63 @@ JI3GER,PM75XA,EME,,,,,2003 JI4POR,PM65NK,,,,,,2003 JJ1NNJ,QM06GH,EME,,,,,2003 JJ1VOM,PM95,,,,,,2003 -JK1HIX,PM95WH,EME,,Tomio,,4x17el 8877,03/99 +JK1KTY,QM05DK,EME,,,,144: 2x15 2.75wl 200W,01/06 JK1LYP,PM95,,,,,,2003 JK1XDX,PM95,,,,,,2003 JK7IKU,QM09BR,,,,,,2003 -JL1ZCG,PM59UM,EME,,OP JR4ENY- 7K3LGC,,TS790 4CX1500A 16x2.5WL V-POL YAGIS,03/99 -JM1GSH,QM06IS,EME,,,,,12/04 +JL1ZCG,PM59UM,EME,,,,TS790 4CX1500A 16x 2.5WL V-POL YAGIS,03/99 +JM1GSH,QM06IS,EME,,,,144: 4x 11el 500w,04/05 JM1LQW,PM96QA,,,,,,2003 JM1MQE,PM95RP,,,,,,2003 +JM1SZY,PM95SO,EME,,,,,08/05 JN1BMX,QM06FM,,,,,,2003 -JN1CSO,PM95SW,,,,,,2003 +JN1CSO,PM95SW,EME,,,,144: 12x 15el H/V 2000W,2003 JO1LVZ,PM95TR,,,,,,2003 JO3JJN,PM85AC,EME,,,,,2003 JO3RNL,PM74TT,EME,,,,,2003 -JR1EDE,PM95TG,EME,,Kohjin,,10368: 1.8m Dish 40W,02/01 JR1EUX,PM95TO,EME,,,,,2003 JR1RCH,PM96SI,EME,,,,,2003 +JR2HCB,PM85NC,EME,,,,50: 2x 10el,04/05 JR3REX,PM74LQ,,,,,,2003 JR4AEP,PM65RH,EME,,,,,2003 JR4BRS,PM65,EME,,,,,2003 JR5JXV,PM86XG,,,,,,2003 JR5UOY,PM64XF,,,,,,2003 +JR6EXN,PM53GH,EME,,,,50: 2x 8el full elev. Homebrew 500W,08/05 JR7VXF,QM09AK,,,,,,2003 JR9NWC,PM85BW,EME,,,,,2003 +JS3CTQ,PM74UN,EME,,,,144: 2x 11el 500W,04/06 JS3SIM,PM74VW,EME,,,,,2003 -JX7DFA,IQ50OV,EME,,Per Einar,,TS2000.161 DTR.161,08/00 -K0AWU,EN37ED,,,,,,2003 -K0AZ,EM37CD,,,Mike,,144: 800Watts 17B2,09/01 -K0BLR,EN25UO,,,BEN,,,2003 +JX7DFA,IQ50OV,EME,,QSL via LA7DFA,,TS2000.161 DTR.161,08/00 +K0AWU,EN37ED,EME,,,,144: 800w 1x 4wl 13el Yagi,01/06 +K0AZ,EM37CD,,,,,144: 800Watts 17B2,09/01 +K0BLR,EN25UO,,,,,,2003 K0CB,EM27,,,,,,2003 K0CIO,EM07,,,,,,2003 K0CJ,EN34IS,,,,,,2003 K0CQ,EN32EC,,,,,,2003 K0CXJ,EN26,,,,,,2003 K0DAS,EN42,EME,,,,,89 -K0FF,EM49HO,,,George,,50: 1-5KW 7el or 4x6el - 144: 1-5KW 2x17el M,01/01 +K0FF,EM49HO,,,,,50: 1-5KW 7el or 4x6el - 144: 1-5KW 2x17el M,01/01 K0FQA,EN35FE,,,,,,2003 K0FZG,EN36,,,,,,2003 K0GCJ,EN43,,,,,,2003 K0GEI,EM49,,,,,,2003 K0GRM,DN96OT,,,,,,2003 -K0GU,DN70MQ,EME,,Jay,,144: FT1000DEM 8877 4x17elB2 SSB Preamp,01/01 +K0GU,DN70MQ,EME,,,,144: FT1000DEM 8877 4x17elB2 SSB Preamp,01/01 K0HH,EM48,,,,,,2003 K0HU,EN10,,,,,,09/99 K0HWE,EN41BX,,,,,,2003 -K0IDC,EN12TL,,,Robert,,,2004 -K0IDT,EN10PS,,,Ron,,,2003 -K0IK,EN34JR,,,Brian,,,2004 +K0IDC,EN12TL,,,,,,2004 +K0IDT,EN10PS,,,,,,2003 +K0IK,EN34JR,,,,,,2004 K0ILC,EN36,,,,,,2003 K0IR,EN25,,,,,,2003 K0JO,EN34,,,,,,2003 K0KE,DM79,,,,,,2003 K0KFC,EN34,,,,,,2003 K0KJX,EM48,,,,,,2003 -K0KP,EN36VW,,,Rex,,50: 7el 100W - 144: 13el 100W,08/03 +K0KP,EN36VW,EME,,,,50: 7el 100W - 144: 13el 1500W,04/06 K0KQY,DM98,,,,,,08/00 K0LGI,EN42,,,,,,2003 K0LLS,EM29,,,,,,2003 @@ -1810,128 +1802,128 @@ K0MQS,EN31UH,,,,,,2003 K0NG,EN10,,,,,,2003 K0NL,EM48MK,,,,,,2003 K0NY,EN44DB,,,,,,2003 -K0OG,EM47CW,,,Joseph,,,2004 +K0OG,EM47CW,,,,,,2004 K0PFX,EM48SR,,,,,,2003 K0PG,EN61AU,,,,,,2003 K0PJ,EN34,,,,,,2003 -K0PS,DM59VG,,,Paul,,,2004 -K0PW,EN34CV,EME,,John,,144: 1.5KW 2x17el 5lb MGF1302.098.175,09/01 +K0PS,DM59VG,,,,,,2004 +K0PW,EN34CV,EME,,ex NJ0M,,144: 1.5KW 2x17el 5lb MGF1302.098.175,09/01 K0RDF,EM29,,,,,,2003 -K0RI,DM78PX,,,Larry,,,2003 +K0RI,DM78PX,EME,,,,144: 1x 17el KW,06/05 K0RL,EM49HU,,,,,,2003 -K0RP,DM88AD,,,Bill,,50: 150W - 144: 150W - 222: 110W - 432: 110W,01/01 +K0RP,DM88AD,,,,,50: 150W - 144: 150W - 222: 110W - 432: 110W,01/01 K0RRY,EN36,,,,,,2003 K0RZ,DM79JX,,,,,,2003 K0SDH,EN34JS,,,,,,2003 K0SE,EN34,,,,,,2003 K0SHF,EN34JV,,,,,,2003 -K0SM,EN10RT,,,Andy,,144: 160W Preamp 13B2,01/01 +K0SM,EN10RT,,,,,144: 160W Preamp 13B2,01/01 K0SQ,EN35,,,,,,2003 K0TAR,EN34,,,,,,2003 -K0UO,EM07,,,,,,2003 K0VM,EN42,,,,,,2003 -K0VSV,EN41LK,,,Tom,,50: 8W 5el - 144: 170W 12el,1998 +K0VSV,EN41LK,,,,,50: 8W 5el - 144: 170W 12el,1998 K0WLU,EN13XS,,,,,,2003 -K0XP,FN31,,,Steve,,144: 350W 3219 - 222: 450W KLM16,01/02 +K0XP,FN31,,,ex KO0U/1,,144: 350W 3219 - 222: 450W KLM16,01/02 K0XXX,EM46FF,,,,,,2003 -K0YW,DM67ED,EME,,,,,2003 +K0YW,DM67ED,EME,,,,,03/06 K0ZPO,EM15,,,,,,2003 -K1AE,FN42EJ,,,John,,,11/01 -K1CA,FN42mm,EME,,,,,2003 +K1AE,FN42EJ,,,,,,11/01 +K1CA,FN42IV,EME,,,,144: 8 x 28 el X-POL & 8877,06/05 K1FO,FN31QJ,EME,,,,,2003 -K1IM,FN31WX,,,Tom,,,2003 -K1JT,FN20QI,EME,,Dr. Joseph ""Joe",,50: 200 - 144: 11el 160W - 222: 120W - 432:,12/04 -K1MS,FN42,,,Ivan,,144: 1KW 2x M2 5wl,01/01 +K1IM,FN31WX,,,,,,2003 +K1JT,FN20QI,EME,,,,50: 200 - 144: 11el 160W - 222: 120W - 432:,03/05 +K1MS,FN42,,,,,144: 1KW 2x M2 5wl,01/01 K1OR,EN42IR,EME,,,,,2003 K1OYB,FN43TP,,,,,,2003 K1POP,FN51,,,,,,2003 K1RC,FN42HQ,,,,,,2003 K1RO,FN31,,,,,,2003 -K1RQG,FN54LM,EME,,,,,2003 +K1RQG,FN54LM,EME,,,,,04/05 K1RZ,FM19JH,,,,,,2003 -K1TEO,FN31,,,Jeff,,144: 800W 4x12el - 222: 500W 2x23el,01/01 -K1UHF,FN31FH,EME,,Del,,144: 1-5KW 4x12el - 222: 500W.100 10000lpm,01/01 +K1SG,FN42,EME,,,,,08/05 +K1TEO,FN31,,,ex WA2TEO,,144: 800W 4x12el - 222: 500W 2x23el,01/01 +K1UHF,FN31FH,EME,,ex KD1DU,,144: 1-5KW 4x12el - 222: 500W.100 10000lpm,01/01 K1VOW,DM25VF,,,,,,2003 -K1ZE,FN41,,,Ed,,144: 300W 2x4218 - 222: 60W 220B - 432: 400W,1998 -K2AAX,FN12CS,,,Mark,,,01/01 +K1ZE,FN41,,,ex WA1HYN,,144: 300W 2x4218 - 222: 60W 220B - 432: 400W,1998 +K2AAX,FN12CS,EME,,ex KA2RDO,,144: 4x 9el 400,11/05 K2AH,FN20,EME,,,,,2003 -K2AXX,FN12CS,EME,,Mark,,144: TS-930S Transverters - 432: TS-830S,02/05 -K2BLA,EL99IA,EME,,Albert,,,01/05 +K2AXX,FN12CS,EME,,,,144: TS-930S Transverters 4x 9el 400W - 43,11/05 +K2BLA,EL99IA,EME,,,,144: 400W 8x 2.5WL,04/05 K2DH,FN13FB,EME,,,,,2003 -K2DRH,EN41VR,,,Bob,,,07/03 +K2DRH,EN41VR,EME,,ex KA2DRH,,144: 2x 18el 1KW,07/03 K2EVW,EM96SS,,,,,,2003 -K2GAL,FM29PH,EME,,,,,1998 -K2JT,EM20QI,,,Dr. Joseph ""Joe",,144: 11el 160W,03/00 -K2LME,FN31UI,EME,,Dave,,,10/98 K2OS,FN13CD,EME,,,,,12/00 -K2OVS,FN30,,,Jay,,50: 250W 6el - 144: 200W single yagi - 432: 6,01/01 -K2PGB,FN20,,,Chris,,50: TS680S 10W 3el - 144: IC251A 80W 13B2,01/01 +K2OVS,FN30,,,,,50: 250W 6el - 144: 200W single yagi - 432: 6,01/01 +K2PGB,FN20,,,,,50: TS680S 10W 3el - 144: IC251A 80W 13B2,01/01 K2STO,EL88PH,,,,,,2003 -K2TXB,FM29PT,,,Russ,,,07/01 -K2UYH,FN20QG,EME,,,,,89 +K2TXB,FM29PT,EME,,,,144: 2x KLM 16LBX 28,04/05 +K2UYH,FN20QG,EME,,,,432: 28 dish 1KW,09/05 K2VEE,EM79WP,,,,,,2003 -K2WKA,FN20RF,,,Fred,,,2003 +K2WKA,FN20RF,,,,,,2003 K2YAZ,EN74AV,,,,,,2003 -K3ACE,FM29DR,,,Norm,,,2003 +K3ACE,FM29DR,,,,,,2003 K3AX,FN20,EME,,,,,2000 -K3BFA,FN10XI,,,Charlie,,144: 1-5KW 4x15el,01/01 +K3BFA,FN10XI,,,,,144: 1-5KW 4x15el,01/01 K3DJC,FM19LL,,,,,,2003 -K3EAR,FM19HX,,,South Mountain Conte,,,2003 -K3FOR,FM19SB,EME,,Skip,,,2003 +K3EAR,FM19HX,,,,,,2003 +K3FOR,FM19SB,EME,,,,,2003 K3FU,FM18,,,,,,2003 -K3GNC,FM29KX,,,Jerome,,,01/97 -K3HZO,FN20AG,,,Harry,,50: 350W 5el - 144: 350W 17el - 432: 100W 24e,1998 -K3IB,FN20HK,,,Phil,,50: 200W 6M5XX - 144: 1-5KW FO12 - 222: 300W,09/01 +K3GNC,FM29KX,,,,,,01/97 +K3HZO,FN20AG,,,,,50: 350W 5el - 144: 350W 17el - 432: 100W 24e,1998 +K3IB,FN20HK,EME,,,,50: 200W 6M5XX - 144: 1-5KW FO12 - 222: 300W,03/05 K3JT,EM99XO,,,,,,2003 K3LFO,FM19,EME,,,,,2003 -K3LOW,EN91BK,,,Henry,,,2003 -K3MF,FM19XP,EME,,Wayne,,,01/05 +K3LOW,EN91BK,,,,,,2003 +K3MF,FM19XP,EME,,,,144: 2x 19el 1500W 432: 8x 25el RIW 800W,09/05 K3ROJ,FM19SH,,,,,,2003 K3SIW,EN52,,,,,,2003 K3TKJ,FM28EM,,,,,,2003 -K3TUF,FN10WE,,,Philip,,,2004 +K3TUF,FN10WE,,,,,,2004 K3TV,FN20EP,,,,,,2003 K3UZY,FN20,,,,,,2003 K3VLQ,EM92,,,,,,2003 -K4AR,EM76,EME,,Bert,,432: 8x28el (9lb) Yagis 1-5KW 0.25db,01/00 +K4AL,EM66QF,EME,,,,144: 15el 400W,05/05 +K4AR,EM76,EME,,,,432: 8x28el (9lb) Yagis 1-5KW 0.25db,01/00 K4CSO,EM73,,,,,,2003 -K4DD,EM60NP,,,Richard,,,2004 +K4DD,EM60NP,,,,,,2004 K4DRF,EM74QA,,,,,,2003 K4EJQ,EM86,,,,,,2003 -K4EME,FM08KF,EME,,,,,2003 -K4HJE,EM96,,,Ed,,,01/01 +K4EME,FM08JF,EME,,,,432: 8x 33el 800W,09/05 +K4HJE,EM96,,,,,,01/01 K4JAF,EM70EK,,,,,,2003 K4KAE,FM02AT,,,,,,2003 -K4KO,EM66UD,,,Greg,,,2004 -K4MRW,EM64PW,,,Robert,,,01/01 +K4KO,EM66UD,,,,,,2004 +K4MRW,EM64PW,,,ex WB4AXQ,,,01/01 K4QF,EM64,,,,,,2003 -K4QI,FM06,EME,,,,,07/01 -K4QXX,EL87RM,,,Burch,,,2003 -K4RF,EM84DJ,,,Steve,,,01/01 -K4SDI,EM56TQ,,,Mark,,,2003 -K4SSO,EM48SR,,,Colin,,144: 160W 16el,01/02 +K4QI,FM06,EME,,,,,08/05 +K4QXX,EL87RM,,,,,,2003 +K4RF,EM84DJ,,,ex WS4F,,,01/01 +K4SDI,EM56TQ,,,,,,2003 +K4SSO,EM48SR,,,,,144: 160W 16el,01/02 K4SSP,EM47,,,,,,09/99 K4TAX,EL96WF,,,,,,2003 K4VJ,EL96LX,,,,,,2003 -K4WRI,EL98LM,,,Robert,,,2003 +K4WRI,EL98LM,,,,,,2003 +K4XR,EM64NL,EME,,,,144: 2x 18el QRO,04/06 K4YA,EM25,,,,,,2003 -K4YNT,EM74KW,EME,,Bob,,,02/05 +K4YNT,EM74KW,EME,,,,,02/05 K4ZFY,EL18,,,,,,2003 -K5AIH,EL09TK,EME,,,,,1998 K5APM,EM10BL,,,,,,2003 K5AZU,EM40SN,EME,,,,,2003 K5BYS,EM13,,,,,,2003 K5CBL,EM15,,,,,,2003 K5CFM,EM15,,,,,,2003 K5CPZ,EM15,,,,,,2003 +K5DNL,EM15LJ,EME,,,,50: 7el,01/06 K5EGW,EM30,,,,,,2003 K5EWS,EM10,,,,,,2003 K5FA,EM44,,,,,,2003 K5GE,EL09,,,,,,2003 +K5GMX,FN31NU,EME,,,,144: 4x 13el 600W,04/05 K5GNA,EM20,,,,,,2003 -K5GW,EM13PA,EME,,,,48x10el,10/98 +K5GW,EM13PA,EME,,,,144: 48x10el,04/05 K5IS,DM96,,,,,,2003 -K5IUA,EL29CD,,,John,,,01/01 +K5IUA,EL29CD,,,ex KB5IUA,,,01/01 K5JL,EM15DQ,EME,,,,,01/05 K5LZO,EM20,,,,,,2003 K5MAT,DM65,,,,,,2003 @@ -1944,89 +1936,92 @@ K5QQ,DM65SB,,,,,,2003 K5QXJ,EM30XA,,,,,,2003 K5RFI,EM16,,,,,,2003 K5RHR,DM65UV,,,,,,2003 -K5RUS,EM32VM,,,RUSSELL,,,2003 +K5RUS,EM32VM,,,,,,2003 K5SXK,EM12,,,,,,2003 K5TN,EM15,,,,,,2003 K5TNP,EM32,,,,,,2003 -K5TTT,EM26CH,,,Charlie,,only SSB-MS,01/02 +K5TTT,EM26CH,,,ex KB5ZUD,,only SSB-MS,01/02 K5UHF,EM10DJ,,,,,,2003 -K5UJC,EM20VB,,,Earl,,,2004 +K5UJC,EM20VB,,,,,,2004 K5VH,EM00XE,,,,,,2003 K5WO,EM12,,,,,,2003 K5WXN,DM61,EME,,,,,89 K5YPV,EM54MR,,,,,,2003 -K5YY,EM26,,,San,,144: 1KW 13el,89 +K5YY,EM26,,,,,144: 1KW 13el,89 K5ZMJ,EM12,,,,,,2003 K5ZMS,EL09,,,,,,2003 K5ZSJ,EM12,,,,,,2003 K5ZXE,EM14KL,,,,,,2003 -K6AAW,CN80TE,EME,,Larry,,144: 4x15el 3wl 1.2KW MGF1302,01/00 K6ALF,CM97BH,,,,,,2003 K6CYS,DM12KT,,,,,,2003 K6DV,DM13NI,EME,,,,,2003 K6HLH,DM14CP,,,,,,2003 K6IAH,DM12,,,,,,2003 K6IBY,DM13,EME,,,,,2003 -K6JEY,DM03WT,EME,,Doug,,144: 4x25el K1FOs 500W <0.4db,08/00 +K6JEY,DM03WT,EME,,,,144: 4x25el K1FOs 500W <0.4db,08/00 K6KL,CM97,,,,,,2003 -K6LEW,FM18LT,EME,,Owen,,,11/00 -K6MBY,DM13LD,,,Bob,,,2003 +K6MBY,DM13LD,,,,,,2003 K6MXI,CM88QL,,,,,,2003 -K6MYC,CM97AA,EME,,,,,10/96 -K6PF,DM13AR,,,Robert J.,,144: FT726r 175W 4xM 2MXP20,01/01 -K6SUE,CM98AK,,,Sue,,144: 650W 2x17el- 222: 120W 7wl- 432: 175W 2x,11/99 -K6UCY,CM87UN,,,Vic,,,2004 -K6UIY,DM14,,,Cap,,144: FT726r 1KW 2Yagis,01/97 +K6MYC,DM07DB,EME,,,,144: 4x 9el M2 250W,04/06 +K6PF,DM13AR,,,,,144: FT726r 175W 4xM 2MXP20,01/01 +K6QXY,CM88QL,EME,,,,,10/05 +K6SUE,CM98AK,,,,,144: 650W 2x17el- 222: 120W 7wl- 432: 175W 2x,11/99 +K6UCY,CM87UN,,,,,,2004 +K6UIY,DM14,,,,,144: FT726r 1KW 2Yagis,01/97 K6UM,CM88,,,,,,2003 -K6ZX,CN82GM,,,Doug,,144: 160W 2x2M9,01/97 -K7BV,FN31VI,EME,,,,,01/05 -K7CA,DM26JE,EME,,Al,,144: 1KW 42´homebrew yagi,01/01 +K6ZX,CN82GM,,,,,144: 160W 2x2M9,01/97 +K7AD,DN06ID,EME,,,,144: 4x 14el 1kW,10/05 +K7BV,FN31VI,EME,,,,50: 1000w 4x7el,03/05 +K7BV/1,FN31,EME,,,,50: 1000W 28el110,01/05 +K7CA,DM37JO,EME,,,,144: 8x 16el 1500W,01/01 K7CAI,DN27KF,,,,,,2003 K7IEY,CN88,,,,,,03/98 -K7JA,DM03XS,,,Chip,,144: 190W 19el,1998 +K7JA,DM03XS,,,,,144: 190W 19el,1998 K7KX,DN55,,,,,,2003 K7LNP,DN30,EME,,,,,09/99 -K7MAC,DN13SN,EME,,Mac,,,01/05 -K7MDL,CN87XT,EME,,,,,04/04 -K7ND,CN87QF,,,Jim,,144: 1KW 2x5wl M2,01/01 -K7NEP,DN53NF,,,John,,FT1000MP 144: HM 1KW PA 13el,1998 +K7MAC,DN13SN,EME,,,,50: 7el 1000W 144: 4x 15el 1500W,09/05 +K7MDL,CN87XT,EME,,,,144: 2x 3wl 300W,04/05 +K7ND,CN87QF,,,,,144: 1KW 2x5wl M2,01/01 +K7NEP,DN53NF,,,ex N2NEP,,FT1000MP 144: HM 1KW PA 13el,1998 K7OO,DM04,,,,,,2003 K7PVT,CN88SA,,,,,,2003 -K7TRM,DM33VP,,,Tom,,,2003 -K7UOP,DM33XN,,,Bill,,,01/01 -K7UV,DN31XM,,,Ron,,,2003 +K7TRM,DM33VP,,,,,,2003 +K7UOP,DM33XN,,,,,,01/01 +K7UV,DN31XM,,,,,,2003 +K7WIA,CN87TR,EME,,,,,03/05 K7WUP,DM49IG,EME,,,,,2003 -K7XC,DM09OL,EME,,Tim,,50: IC746 KW 6el - 144: IC746 500W 18xxx- 222,03/03 -K7XD,CN85,EME,,Derek,,144: 400W 2x23el,01/97 -K7XQ,CM97QI,EME,,Jeff,,144: 4x2MPX18 Xpol 3lb 450W MGF1302,10/99 -K7XW,CN96XI,EME,,Mark,,50: 1-5KW 5el - 144: 600W 2x3.5wL - 222: 50W,01/01 -K7YVZ,DN13TL,,,Jerry,,144: 1-5KW 4x18XXX 2x13el Quagi Preamp - 432,01/01 -K7ZL,CN84JC,,,Tom,,144: 150W 36foot yagi,1998 -K8BHZ,EN75DB,,,Brian,,144: 1-5KW 4x17B2,1998 +K7XC,DM09OL,EME,,ex NC7K KD7DH A35WZ,,50: IC746 KW 6el - 144: IC746 500W 18xxx- 222,04/06 +K7XD,CN85,EME,,,,144: 400W 2x23el,01/97 +K7XQ,CM97QI,EME,,ex KO6RD,,50: 2x 7el 1KW - 144: 4x 2MPX18 Xpol 3lb GS35,04/06 +K7XW,CN96XI,EME,,,,50: 1-5KW 5el - 144: 600W 2x3.5wL - 222: 50W,01/01 +K7YVZ,DN13TL,,,ex KC7YVZ,,144: 1-5KW 4x18XXX 2x13el Quagi Preamp - 432,01/01 +K7ZL,CN84JC,,,,,144: 150W 36foot yagi,1998 +K8BHZ,EN75DB,,,,,144: 1-5KW 4x17B2,1998 K8DGY,EN63WW,,,,,,2003 -K8EME,EN72EH,EME,,Luis,,144: FT847- 4x11el 2.2lb- 8877 (1-5KW),03/00 +K8EB,EN73CB,EME,,,,144: 1500W 2x 18el,12/05 +K8GUN,FM09XH,EME,,,,,08/05 K8IE,EN52,,,,,,2003 K8ISK,FM18DV,EME,,,,,2003 -K8MM,EN83IB,,,Ian,,,2004 +K8MM,EN83IB,,,,,,2004 K8ROX,EN80LO,,,,,,2003 K8SD,EN12,,,,,,2003 K8UC,EM99EG,EME,,,,,2003 K8UK,EN82LK,EME,,,,,2003 K8VEB,EN72NN,,,,,,2003 -K8VP,EN91,EME,,Bill,,200,07/01 +K8VP,EN91,EME,,ex KB8ZW,,200,07/01 K8XK,EN42,,,,,,2003 K9AKS,EN41,,,,,,2003 K9AM,EN52,,,,,,2003 K9BCT,EL96UE,EME,,,,,2003 -K9BMB,EM69OG,,,Homer,,,2003 +K9BMB,EM69OG,,,,,,2003 K9CA,EN61ML,,,,,,2003 K9CFA,EN52,,,,,,2003 K9DQ,EN62,,,,,,2003 -K9DTB,EM89,,,Phil,,, -K9EA,EN94CB,,,Dan,,,09/01 +K9DTB,EM89,,,,,, +K9EA,EN94CB,,,,,,09/01 K9EK,EM79BF,,,,,,2003 K9FYV,EN41,,,,,,2003 -K9HJZ,EN50ES,,,Jeff,,,2003 +K9HJZ,EN50ES,,,,,,2003 K9HMB,EN52VI,EME,,,,,12/00 K9HSK,EN51,,,,,,2003 K9IJ,EN52,,,,,,2003 @@ -2037,18 +2032,19 @@ K9IZV,EN53,,,,,,2003 K9JK,EN52XC,,,,,,2003 K9KFR,EN71GG,EME,,,,,2003 K9KHW,EN63AD,,,,,,2003 -K9KL,EN64,,,,,,2003 -K9KNW,EL96EC,EME,,Joe,,,01/05 +K9KL,EN64,,,,,,04/06 +K9KNW,EL96EC,EME,,,,,03/05 K9MB,EM57,,,,,,2003 -K9MRI,EN70IU,EME,,Joe L.,,144: 8xm2 yagis and 1.2kw,01/05 +K9MRI,EN70IU,EME,,,,144: 8x m2 yagis and 1.2kw,04/05 +K9MU,EN44HW,EME,,ex KB9UZV,,,01/06 K9NS,EN52QK,,,,,,2003 K9OQN,EN52,,,,,,2003 K9PO,EN52VF,,,,,,2003 K9PW,EN52,,,,,,2003 -K9SLQ,EN70KK,EME,,Wayne,,432: 16x FO22 1.5 KW,08/02 -K9SQL,EM69RF,,,Robert,,,2004 -K9TI,EN51,EME,,Russ,,144: 4x K1FO 12 el PA 8877,02/01 -K9VHF,EN53,,,,,,2003 +K9SLQ,EN70KK,EME,,,,432: 16x FO22 1.5 KW,08/02 +K9SM,EM59EE,EME,,,,144: 4x 9el 500W,11/05 +K9SQL,EM69RF,,,,,,2004 +K9VHF,EN53,EME,,,,144: 17el 400W,05/05 K9VNM,EN63,,,,,,2003 K9VS,EN52,,,,,,2003 K9XI,EN61,,,,,,2003 @@ -2060,25 +2056,24 @@ KA0KUY,EM07XD,,,,,,2003 KA0MOW,EM17,,,,,,2003 KA0MR,EM18GE,,,,,,2003 KA0MWA,DM79LL,,,,,,2003 -KA0NNO,EM24TL,,,Lisa,,,01/97 +KA0NNO,EM24TL,,,,,,01/97 KA0OGU,EM29,,,,,,2003 -KA0PQW,EN33,,,Matt,,,11/01 -KA0RYT,EN34DW,EME,,Ron,,,01/02 +KA0PQW,EN33,,,,,,11/01 KA0UZZ,EN34,,,,,,2003 KA0Y,EN41,EME,,,,,08/00 KA0YSQ,EN42,,,,,,2003 KA0ZOZ,EN23,,,,,,2003 KA1JBG,FN42,,,,,,2003 -KA1LEX,FN34KL,,,Randall,,,2003 KA1OTP,FN41,EME,,,,,2003 +KA1VHF,EM89LL,EME,,,,144 2x 17el 1KW,11/05 KA2DRH,EM64KT,,,,,,2003 KA2HZO,FM29US,,,,,,2003 KA2KQM,EM74QA,,,,,,2003 +KA3DQD,FM29DO,,,ex N3ZWW,,Ten-Tec 526 ICOM 735,03/06 KA3HED,FM27,,,,,,2003 KA3WSZ,FM29GK,EME,,,,,2003 KA4WJA,EL89WE,,,,,,2003 KA5AAE,EM06,,,,,,2003 -KA5AIH,EL29NW,EME,,,,,10/96 KA5DWI,EM12JU,,,,,,2003 KA5PVB,EM13,,,,,,2003 KA5TQY,EM43,,,,,,2003 @@ -2087,32 +2082,32 @@ KA5UEV,DM93,,,,,,2003 KA5ULI,EM30,,,,,,2003 KA5WMJ,DM96,,,,,,2003 KA5WRG,EM15,,,,,,2003 -KA5YJJ,EM44NN,,,Thomas,,,2003 +KA5YJJ,EM44NN,,,,,,2003 KA6NBC,CM98,,,,,,2003 -KA7V,DN14MA,,,Barry,,144: 13B2 1500W,11/03 +KA7V,DN14MA,,,,,144: 13B2 1500W,11/03 KA8EDE,EM79,,,,,,2003 -KA8HQL,EM89VU,,,Jeffrey,,,2003 -KA8SFP,EM12,,,Stan,,,01/01 +KA8HQL,EM89VU,,,,,,2003 +KA8SFP,EM12,,,,,,01/01 KA8SSB,EM79,,,,,,2003 KA8TER,DN43AL,,,,,,2003 -KA9CFD,EN40OM,,,Jay,,,11/04 +KA9CFD,EN40OM,,,,,,08/05 KA9LDS,EN51,,,,,,2003 KA9LLF,EM71,,,,,,2003 -KA9LNP,DN30,,,Pat,,144: 800W KLM13LBA,01/01 +KA9LNP,DN30,,,,,144: 800W KLM13LBA,01/01 KA9MGR,EN41,,,,,,2003 KA9OIL,EN62,,,,,,2003 KA9UVY,EM58NG,,,,,,2003 KA9YCB,EM57QQ,,,,,,2003 -KB0BFI,29EMLL,,,Clarence,,,2003 +KB0BFI,29EMLL,,,,,,2003 KB0BVR,EN26AH,,,,,,2003 KB0CY,DM79,,,,,,2003 KB0EMR,EN31,,,,,,2003 -KB0FHP,FN20GE,,,Donald,,,2003 +KB0FHP,FN20GE,,,,,,2003 KB0FRX,EN10,,,,,,2003 KB0G,DM79PA,,,,,,2003 KB0GL,EN35,,,,,,2003 KB0GR,EM29,,,,,,2003 -KB0GU,EM28TW,,,Gene,,,2004 +KB0GU,EM28TW,,,,,,2004 KB0HH,EM07QD,EME,,,,,89 KB0IKP,EN25UQ,,,,,,2003 KB0LRI,DM79,,,,,,2003 @@ -2121,24 +2116,25 @@ KB0MNK,EN34IW,,,,,,2003 KB0NR,EN35OG,,,,,,2003 KB0OBT,EN35KB,,,,,,2003 KB0OZN,EN34,,,,,,2003 -KB0PYO,EN24GP,,,Mark,,,01/97 +KB0PYO,EN24GP,,,,,,01/97 KB0THN,EN44DB,,,,,,2003 KB0TZA,EN35ID,,,,,,2003 KB0USF,DM79LR,,,,,,2003 -KB0VUK,EN34PK,,,Matt,,,09/01 -KB1CJ,FN42JG,,,Joe,,IC746 50: 100W 2el - 144: 100W 13el,09/03 +KB0VUK,EN34PK,,,,,,09/01 +KB1CJ,FN42JG,,,,,IC746 50: 100W 2el - 144: 100W 13el,09/03 KB1DFE,FN42ES,,,,,,2003 KB1HGB,FN53EU,,,,,,2003 +KB1LKB,FN31RS,EME,,,,144: 2x 12el 300W,02/06 KB2AH,FN20,,,,,,2003 KB2M,FM29PE,,,,,,2003 -KB3EDF,FM18RH,,,Ron,,,2003 -KB3HWO,FN10UB,,,Mark,,,2003 +KB3EDF,FM18RH,,,,,,2003 +KB3HWO,FN10UB,,,,,,2003 KB3PD,FM29,EME,,,,,89 KB4BSA,EM73,,,,,,2003 KB4FQ,FM04GR,,,,,,2003 KB4RSM,EM66OG,,,,,,2003 KB4WM,EM63,EME,,,,,2003 -KB4ZGO,FM06BQ,,,Anthony,,,2004 +KB4ZGO,FM06BQ,EME,,,,144: 160W 13B2,08/05 KB5DAK,DM96,,,,,,2003 KB5EK,EM15,,,,,,2003 KB5MR,EM26,,,,,,2003 @@ -2148,7 +2144,7 @@ KB5ULP,EM15,,,,,,2003 KB5VL,DM73RK,,,,,,2003 KB5VQQ,EM15,,,,,,2003 KB5WII,EM15,,,,,,2003 -KB5WMY,EM32,,,Carl,,,1998 +KB5WMY,EM32,,,,,,1998 KB5YAJ,EM14,,,,,,2003 KB5YUA,EM44,,,,,,2003 KB5ZMY,EM12,,,,,,2003 @@ -2158,27 +2154,28 @@ KB7FUV,DN44,,,,,,1993 KB7XO,DN41AB,,,,,,2003 KB8GC,EN74HD,,,,,,2003 KB8JVH,EN80,,,,,,2003 -KB8O,EN82JJ,,,Albert L. ""Al",,,03/00 -KB8RQ,EM79SV,EME,,Gary L.,,144: 8 x 19el M2.038,01/05 +KB8O,EN82JJ,,,,,,03/00 +KB8RQ,EM79SV,EME,,,,144: 8x 19el M2127,03/05 +KB8U,EN71SW,EME,,,,,01/06 KB8VAO,EN91PB,,,,,,2003 KB8ZUZ,EN83JL,,,,,,2003 KB8ZW,EN91IJ,,,,,,2003 KB9GPW,EN61,,,,,,2003 KB9II,EN52WA,,,,,,2003 KB9KCJ,EN52,,,,,,2003 -KB9MLA,EN61CX,EME,,,,18el- 160W,10/98 KB9NLM,EN53UO,,,,,,2003 KB9PCL,EN41,,,,,,2003 KB9PJL,EN44GT,,,,,,2003 KB9Q,EN52VV,,,,,,2003 KB9TLV,EN45MW,,,,,,2003 -KB9UMT,EN50DP,,,Don,,,2003 +KB9UMT,EN50DP,,,,,,2003 KB9VQC,EN53,,,,,,2003 KB9VUG,EN52,,,,,,2003 KB9YXF,EN61,,,,,,2003 KB9ZK,EN62,,,,,,2003 KC0AKJ,EN42,,,,,,2003 KC0AMG,DM98GK,,,,,,2003 +KC0BMF,EN31BE,EME,,,,144: 13el 100W,10/05 KC0CHW,EN41IN,,,,,,2003 KC0CRE,DM28,,,,,,2003 KC0FTQ,DM79OB,,,,,,2003 @@ -2186,96 +2183,100 @@ KC0FXY,EN34,,,,,,2003 KC0HTB,EN34JT,,,,,,2003 KC0LBT,EN35IB,,,,,,01/05 KC0LMS,EN34IW,,,,,,2003 -KC0MLS,EM19QU,,,Myron,,,2003 +KC0MLS,EM19QU,,,,,,2003 KC0OG,EN10,,,,,,2003 KC0P,EN34SB,,,,,,2003 KC0QR,EN10,,,,,,2003 +KC0UWS,DN70KE,EME,,,,50: 3el,08/05 KC0Y,DM79,,,,,,2003 -KC2TN,FM29NS,,,Joe,,,2003 -KC3AK,FM19UU,,,Terry,,,2004 -KC3RE,FM18DB,EME,,Martin,,144: 160 W .5 db 18 el (no elev) - 432:,02/05 -KC4VI,EL88SD,,,,,,2003 +KC2TN,FM29NS,,,,,,2003 +KC3AK,FM19UU,,,,,,2004 +KC3RE,FM18DP,EME,,ex TF3XUU TA3/KC3RE,,144: 280W 0.5dB 15el can elevate manually to,04/06 +KC4/W1MRQ,RB32HD,EME,,Expedition,,144: FT-847 120W 4x 5el hand aimed,03/06 +KC4PX,EL98QG,EME,,,,,06/05 +KC4VI,EL88SD,EME,,,,144: 4x 3.5wl 1000W,05/05 KC5BQS,EL29,,,,,,2003 KC5BRO,EM15,,,,,,2003 KC5LOW,EM22,,,,,,2003 -KC5NOA,EL08,,,Bart,,50: 150W 5el - 144: 100W 10el - 432: 20W 19el,01/01 -KC5NOB,EL07,,,John,,50: 10W 5el - 144: 170W 8el - 432: 10W 19el,01/01 +KC5NOA,EL08,,,,,50: 150W 5el - 144: 100W 10el - 432: 20W 19el,01/01 +KC5NOB,EL07,,,,,50: 10W 5el - 144: 170W 8el - 432: 10W 19el,01/01 KC5UOO,EM26,,,,,,2003 KC5WX,EM13LB,,,,,,2003 -KC5YKX,EL17HS,,,Reid,,Icom 746 w/ DEM 22 and 432 xverters 50: 5el,05/02 +KC5YKX,EL17HS,,,,,Icom 746 w/ DEM 22 and 432 xverters 50: 5el,05/02 KC5ZXE,EM45AM,,,,,,2003 KC6A,DM03,EME,,,,,2003 KC6TEU,CM98MQ,,,,,,2003 -KC6WFS,DM04RK,,,Dave,,50: 100W 5el - 144: 100W 2x12el - 432: 50W 2x,08/01 -KC6ZWT,CM98,,,Alexander,,144: 350W 17el M2 - 222: 250W 15el - 432:,05/03 -KC7MRP,CN88,,,Brad,,,01/97 -KC7OTV,CN84KA,,,Brian,,,2003 +KC6WFS,DM04RK,,,,,50: 100W 5el - 144: 100W 2x12el - 432: 50W 2x,08/01 +KC6ZWT,CM98,,,,,144: 350W 17el M2 - 222: 250W 15el - 432:,03/06 +KC7MRP,CN88,,,,,,01/97 +KC7OTV,CN84KA,,,,,,2003 +KC7V,DM43AS,EME,,,,IC271H,03/06 KC8CCD,EM79VM,,,,,,2003 -KC8DLL,EN66,,,Mike,,50: 150W M25 - 144: 200W 2x13B2 - 432: 100W K,1998 +KC8DLL,EN66,,,,,50: 150W M25 - 144: 200W 2x13B2 - 432: 100W K,1998 KC8GYW,EM79,,,,,,2003 KC8NST,EN91QB,,,,,,2003 KC8OIT,EN83,,,,,,07/01 +KC8QVO,EM79VP,,,,,,11/05 KC9AAX,EN52,,,,,,2003 KC9AER,EN52,,,,,,2003 KC9AYO,EN52,,,,,,2003 KC9BTW,EN52,,,,,,2003 -KC9CMT,EN63LA,,,Michael,,,2004 +KC9CMT,EN63LA,,,,,,2004 KD0BT,EN41,,,,,,2003 KD0DW,DN70LF,,,,,,2003 KD0HE,EN00,,,,,,2003 KD0LO,EM48,,,,,,2003 -KD0PY,EN41UX,,,Darryl,,144: IC275A 2516g 150W 13el - 432: IC471H 70W,01/01 +KD0PY,EN41UX,,,,,144: IC275A 2516g 150W 13el - 432: IC471H 70W,01/01 KD0SU,DM78,,,,,,2003 KD1DU,FN31FH,EME,,,,,2003 -KD3UY,FM19LG,EME,,Bob,,,01/05 -KD4ESV,EL87RH,,,Samuel C.,,,01/01 +KD3UY,FM19LG,EME,,,,144: 2x 4WL antenna 1KW,05/05 +KD4ESV,EL87RH,,,,,,01/01 KD4FNB,FM17TD,,,,,,2003 KD4LT,EM81CG,EME,,,,,2003 -KD4MZM,EL87RG,EME,,Eric,,50: FT107m - 144: FT726r 170W 19el.125.200,07/01 +KD4MZM,EL87RG,EME,,,,50: FT107m - 144: FT726r 170W 19el.125.200,07/01 KD4NOQ,EM55BE,,,,,,2003 KD4NUD,EM91HB,,,,,,2003 KD4TJN,EM55CE,,,,,,2003 KD5FFW,EM12,,,,,,2003 KD5FZX,EM12MP,EME,,,,,2003 -KD5HIO,DM65UV,EME,,Glen,,,2003 -KD5KJD,EL29IR,,,Luis,,,2004 -KD5LDQ,EM26IH,,,Dwayne,,,2003 -KD5LWU,DM66AU,,,Johnny,,,2003 -KD5OMJ,EM04UO,,,Boyd,,,2003 +KD5HIO,DM65UV,EME,,,,,2003 +KD5KJD,EL29IR,,,,,,2004 +KD5LDQ,EM26IH,,,,,,2003 +KD5LWU,DM66AU,,,,,,2003 +KD5OMJ,EM04UO,,,,,,2003 KD5OUG,EM12,,,,,,2003 KD5QQU,EM12QX,,,,,,2003 -KD5QWO,EM15AJ,,,David,,Yaesu ft-847,01/04 -KD5XB,DM84,,,Earl,,,01/97 -KD7ETC,DM54AH,,,Roland,,,2004 +KD5QWO,EM15AJ,,,,,Yaesu ft-847,01/04 +KD5XB,DM84,,,,,,01/97 +KD7ETC,DM54AH,,,,,,2004 KD9KX,EN42,,,,,,2003 KD9PW,EN54,,,,,,2003 KE0MO,EN41,,,,,,2003 KE0UQ,EM29,,,,,,2003 -KE1AF,,,,ABEL,,,2003 -KE2N,FM18EW,EME,,KEN,,432: 16x28 el 1KW,01/05 +KE2N,FM18EW,EME,,= G0VSN,,432: 16x 28el 500W,09/05 KE3PL,FN20PM,,,,,,2003 -KE3UY,,,,mark,,,2003 KE4ENX,EM84GM,,,,,,2003 KE4IKM,EM73,,,,,,2003 KE4KDB,EM55,,,,,,2003 KE4MKW,EM84DJ,,,,,,2003 KE4VUN,EM67MS,,,,,,2003 -KE4YH,EL88OA,,,Stew,,,01/01 -KE4YYD,EL97RV,,,David,,,09/01 +KE4YH,EL88OA,,,,,,01/01 +KE4YYD,EL97RV,,,,,,09/01 KE5CO,EL29,,,,,,2003 KE5ML,EM15,,,,,,2003 -KE6NDG,CN90QJ,,,Jim,,,2003 +KE6NDG,CN90QJ,,,,,,2003 KE6PT,CM88UE,,,,,,2003 KE7CX,CN85LJ,,,,,,2003 -KE7NR,DM33WM,EME,,,,,12/04 -KE7NS,DN41AF,,,Mark,,,01/02 -KE7OI,DN13SU,EME,,Dan,,,01/01 -KE7V,CN88JB,,,John,,,2004 +KE7NR,DM33WM,EME,,,,144: 4x 13el KW 432: 2x 28el 1KW,10/05 +KE7NR/p,DM54AH,EME,,,,144: 2x 18el 1KW,10/05 +KE7NS,DN41AF,,,,,,01/02 +KE7OI,DN13SU,EME,,,,,01/01 +KE7V,CN88JB,,,,,,2004 KF0AU,EN31HI,,,,,,2003 KF0CK,EM38JC,,,,,,2003 KF0DS,DM41,,,,,,2003 KF0FE,EN41,,,,,,2003 -KF0M,EM17HO,EME,,John,,,01/01 +KF0M,EM17HO,EME,,,,,01/01 KF0OA,DM79,,,,,,2003 KF0Q,EN44EA,,,,,,2003 KF4HOU,EM86VE,,,,,,2003 @@ -2285,267 +2286,276 @@ KF5IU,EM31WR,,,,,,2003 KF5PE,EM12,,,,,,2003 KF6BXH,CM87VQ,,,,,,2003 KF6HQC,DM14ED,,,,,,2003 -KF7CN,DN16LV,,,Kevin,,,01/01 -KF7IS,DN41AC,,,Jim,,,2004 +KF7CN,DN16LV,,,,,,01/01 +KF7IS,DN41AC,,,,,,2004 KF7VY,DN17IQ,,,,,,2003 KF8QL,EN72,,,,,,2003 KF9CY,EM59,,,,,,2003 -KF9YR,EN54,,,George,,144: 170W 13B2,01/97 -KG0MW,EN13,,,Chad,,,02/01 +KF9YR,EN54,,,,,144: 170W 13B2,01/97 +KG0MW,EN13,,,,,,02/01 KG0SV,DM79,,,,,,2003 -KG4BMH,EM76JK,,,Jason,,144: 1000 Watts sp144vdg GasFet 40 Element,05/02 +KG4BMH,EM76JK,,,,,144: 1000 Watts sp144vdg GasFet 40 Element,05/02 KG4CHX,EM95LL,,,,,,2003 -KG4FET,EM90FH,,,Sandor,,,07/01 -KG4KAK,EL96VG,,,Leo,,,2005 -KG4MLA,EL88OA,,,Joe,,,2003 +KG4FET,EM90FH,,,,,,07/01 +KG4KAK,EL96VG,,,,,,2005 +KG4MLA,EL88OA,,,,,,2003 KG5RK,EM12,,,,,,2003 KG5SF,EM44,,,,,,2003 KG5UN,EM02,,,,,,2003 -KG6DX,QK23KL,EME,,,,,01/05 +KG6DX,QK23KL,EME,,,,144: 4x 13el CushCraft 900W,06/05 KG6ENA,DM04DK,,,,,,2003 KG7CN,DN23BF,,,,,,2003 -KG7FU,CN83KA,,,James S.,,144: 2x11el 1KW.190.240,01/01 +KG7FU,CN83KA,,,,,144: 2x11el 1KW.190.240,01/01 +KH0/KH2K,QK25VG,EME,,,,50: 1KW LongYagi 7el,05/05 KH7K,AL08UJ,,,,,,2003 -KI0LE,EM36US,EME,,Bryce,,,12/04 -KI4BYV,FM15CX,,,John,,,2004 -KI4M,EM95AQ,,,Shane,,144: 800W M2 18XXX,01/01 +KI0LE,EM36US,EME,,,,,12/04 +KI4BYV,FM15CX,,,,,,2004 +KI4M,EM95AQ,,,,,144: 800W M2 18XXX,01/01 KI6FF,DM13AR,,,,,,2003 -KI7JA,CN85RL,,,Bruce,,,2004 -KI7WB,DN62,,,Ed,,144: 200W 10el,01/01 +KI7JA,CN85RL,,,,,,2004 +KI7WB,DN62,,,,,144: 200W 10el,01/01 KJ5EY,DM65XA,,,,,,2003 KJ5Q,EM15,,,,,,2003 -KJ7A,DM03,EME,,Chip,,432: FT-817 8 x 25 ele,11/00 KJ7F,DN13VO,EME,,,,,2004 KJ7OG,DM42MH,EME,,,,,2003 -KJ9I,EN53QC,EME,,David,,,01/05 +KJ9I,EN53QC,EME,,,,144: 8 antennas,04/05 KK4NO,EM92,,,,,,2003 KK5WA,EM45,,,,,,2003 KK7B,EN57RB,,,,,,2003 KK7LK,CN88SS,,,,,,2003 -KK8O,EN80OR,,,Richard,,,2004 -KL6M,BP51DC,EME,,Mike,,9.2m dish,01/05 +KK8O,EN80OR,,,,,,2004 +KL6M,BP51DC,EME,,ex AL7OB,,9.2m dish,03/05 KL7FB,BP51HO,EME,,,,,2003 +KL7FH,BP41BB,EME,,,,432: 16X12 ele polarity rotation FT-847 100 W,09/05 KL7HFQ,BP51,EME,,,,,2003 KL7IZW,EM13SE,EME,,,,,12/04 -KL7X,BP51AE,EME,,,,,02/01 -KM0A,EM48UT,,,Mark,,,01/01 -KM0T,EN13VB,,,Mike,,,07/01 -KM1H,FN42,,,Carl,,144: 1-5KW 2x4218XL,01/01 +KL7UW,BP40IQ,EME,,ex AL7EB,,FT847 144: 4 Xpol-20el M2 170W MGF1801 432:,09/05 +KM0A,EM84UT,EME,,,,144: single Yagi,06/05 +KM0T,EN13VB,,,,,,07/01 +KM1H,FN42,,,,,144: 1-5KW 2x4218XL,01/01 KM4ID,EM93WA,,,,,,2003 -KM5ES,EM25DI,,,John,,144: TR751 200W 30el,08/01 +KM5ES,EM25DI,EME,,,,144: TR751 200W 17B2,08/05 KM5OL,EM13RB,,,,,,2003 -KM5PO,EM23WK,EME,,Jim ""Mac",,144: 13KW ERP,12/04 -KM6WC,CM97OP,,,Jim,,FT100,09/02 -KN4SM,FN16QT,,,Jerry,,144 : 1-5KW M2 5wl,01/01 +KM5PO,EM12KO,EME,,ex KD5BUR,,144: 13KW ERP,04/05 +KM6WC,CM97OP,,,,,FT100,09/02 +KN4SM,FN16QT,,,,,144 : 1-5KW M2 5wl,01/01 KN6DD,DM03,EME,,,,,2003 KO0Z,EM48,,,,,,2003 KO2R,EN52,,,,,,2003 -KO4FR,FM16UV,,,Robert,,,2005 +KO4FR,FM16UV,,,,,,2005 KO4QR,FM26,,,,,,1998 -KO7N,CN84IA,EME,,Richard,,432.050144.240,08/01 +KO7N,CN84IA,EME,,,,432.050144.240,08/01 KQ0Z,EM37,,,,,,2003 KQ6JI,CM87UJ,,,,,,2003 +KQ6MU,DN16WF,EME,,,,144: 17el 100W,07/05 KQ6UH,DM14BC,,,,,,2003 KR5E,EL29JN,,,,,,2003 KR5V,EM13,EME,,,,,01/02 KR5Vex,EM13SD,,,,,,2003 -KR7O,CM97,,,Robert,,HTX100 144: Trvt 1KW 2M5wl - 222: Trvt 450,01/01 +KR7O,DM07BA,EME,,ex N7STU,,HTX100 144: Trvt 1KW 2M5wl - 222: Trvt 450,07/05 KR8L,DN43AL,,,,,,2003 -KS0F,EM48SL,,,Mike,,,01/97 -KT4HA,FM15BH,,,Joe,,,2003 -KT8O,EN34IV,,,Eric,,,2003 -KT8U,EN80OR,,,Reed,,,2003 +KS0F,EM48SL,,,,,,01/97 +KT4HA,FM15BH,,,,,,2003 +KT8O,EN34IV,,,,,,2003 +KT8U,EN80OR,,,,,,2003 KU0KU,EM28QV,,,,,,2003 KU3T,FN20,EME,,,,,04/98 KU4F,EL99AF,EME,,,,,2003 -KU4R,EM86SK,EME,,Bob,,144: 2x18XXX 200W,01/01 -KU7Z,DN41AF,,,Mark,,,2004 -KV4EB,EM66FL,,,Willie,,144: 7el 14el,11/01 +KU7Z,DN41AF,EME,,,,144: 2x 12el 600W,04/06 +KV4EB,EM66FL,,,,,144: 7el 14el,11/01 KV6J,BK29AQ,,,,,,2003 -KW0A,EM48RI,,,Ken,,144: 1KW 24el,08/01 +KW0A,EM48RI,,,,,144: 1KW 24el,08/01 KW0T,EM19WF,,,,,,2003 KX7V,DM42,,,,,,2003 -KX9X,EN60AC,,,Sean,,IC706MKII - 50: 100W 3el - 144: 100W 11el,09/01 +KX9X,EN60AC,,,ex KF9PL,,IC706MKII - 50: 100W 3el - 144: 100W 11el,09/01 KY7B,DM43,,,,,,2003 KZ2S,FN20XD,,,,,,2003 -LA0BY,JO59FW,,,Stefan,,144: 180W 9el - /p JO59ix: 144: 180W 2x9el,10/01 -LA0FX,JP40LM,,,,,,11/95 -LA1BEA,JO29XB,,,,,,1991 -LA1K,JP53EK,EME,,OP: LA8UGA Asgeir,,144: 2x4CX250b MGF1402 preamp 4x17el1000lp,01/95 -LA1KHA,JO49SE,,,kjell,,,1993 +LA/DF1VB,JP31,EME,,Expedition,,,05/06 +LA/PA5DD,JP54,,,Expedition,,,07/06 +LA0BY,JO59FW,,,ex DF9PY,,144: 180W 9el - /p JO59ix: 144: 180W 2x9el,10/01 +LA0FX,JP40LM,,,ex SP9CSO,,,11/95 +LA1BEA,JO29XB,,,Expedition,,,1991 +LA1K,JP53EK,EME,,,,144: 2x4CX250b MGF1402 preamp 4x17el1000lp,01/95 +LA1KHA,JO49SE,,,,,,1993 LA1TV,JO49TQ,,,,,,01/04 -LA2AB,JO59FV,EME,,Clubstation,,,07/02 -LA2PHA,JO38IB,,,"Stein",,144: 100W 10el,07/02 -LA2RZ,JP20ON,,,Dave,,144: 160W 17el,05/02 +LA2AB,JO59FV,EME,,,,,07/02 +LA2PHA,JO38IB,,,,,144: 100W 10el,07/02 +LA2RZ,JP30AI,,,,,144: 160W 17el,05/02 LA2YMA,JP32LK,,,,,144: 40W 9el,02/04 -LA3BO,JO59CD,,,Svein,,,04/04 -LA3EU,JP32BG,,,per,,,1993 -LA3WU,JP20QH,EME,,ingebrigt,,,1993 +LA3BO,JO59CD,,,,,,04/04 +LA3EU,JP32BG,,,,,,1993 +LA3WU,JP20QH,EME,,,,,1993 LA4DL,JP32EL,,,,,,03/04 -LA4XGA,JP33VC,,,Geir,,144: 17el 1000W or 150W117 DTR 3000lpm,11/04 -LA4YGA,JO48AE,,,Jerzy,,IC821 144: 150W 9el - 432: 2x17el 100WDTR,12/04 +LA4XGA,JP33VC,,,,,144: 17el 150W117 DTR 3000lpm,04/05 +LA4YGA,JO48AE,,,,,IC821 IC706 144: 300W 9el - 432: 17el 100WD,04/06 LA5IH,JP20NK,,,,,,1993 -LA5KJA,JP50IV,,,Kjell,,.070,01/98 -LA5KO,JO59FH,,,Roy,,144: 300W 17el MGF1302165 1500lpm165,12/04 +LA5KJA,JP50IV,,,,,.070,01/98 +LA5KO,JO59FH,,,,,144: 300W 17el MGF1302165 1500lpm165,12/04 LA5PH,JO49XA,,,,,,1992 -LA5SAA,JO29SE,,,michael,,.144,1993 -LA5TFA,JP99LQ,,,Aasmund ""Birger",,IC751-IC706-FT736r-FT225rd - 50: 2x5el HL166,02/02 -LA6CU,JP20QL,,,Per,,144: TS790e 150W 16el MGF1302.145 DTR 150,09/99 -LA6HL,JO28TW,EME,,Johannes,,,01/02 -LA6I,JP41,,,,,,1993 -LA6K,JP33VC,,,Clubstation,,,05/03 +LA5SAA,JO29SE,,,,,.144,1993 +LA5TFA,JP99LQ,,,,,IC751-IC706-FT736r-FT225rd - 50: 2x5el HL166,02/02 +LA6CU,JP20QL,,,,,144: TS790e 150W 16el MGF1302.145 DTR 150,09/99 +LA6HL,JO28TW,EME,,,,,01/02 +LA6I,JP41,,,Expedition,,,1993 +LA6K,JP33VC,,,,,,05/03 LA6LU,JO28,,,,,DTR,07/96 -LA6MV,JO59FJ,,,Helge,,,08/02 -LA6QBA,JP61BJ,,,Frans,,50: 100W 2x5el - 144: 600W 4x11el1500lpm,07/04 -LA6VBA,JO48,EME,,tarald,,,1993 -LA7DFA,JP53,EME,,Per-Einar,,111 DTR,10/03 -LA7KK,JP50,EME,,p.,,,1993 -LA8AE,JO59CC,EME,,ote,,,1994 -LA8AJA,JP50HQ,,,Andreas,,only SSB-MS,01/99 -LA8AK,JO38XC,,,Jan Martin,,144: 200W 2x9el BFT66DTR,08/00 +LA6MV,JO59FJ,,,,,,08/02 +LA6QBA,JP61BJ,,,,,50: 100W 2x5el - 144: 600W 4x11el1500lpm,07/04 +LA6VBA,JO48,EME,,,,,1993 +LA7KK,JP50,EME,,,,,1993 +LA7SP,JP99MQ,,,,,,07/05 +LA8AJA,JP50HQ,,,,,only SSB-MS,01/99 LA8G,JP53EJ,,,,,,01/05 -LA8GKA,JO59FS,,,Rune,,,12/03 -LA8KV,JP52QQ,EME,,Kjetil,,DTR,03/04 -LA8LF,JO59BR,EME,,Anders,,,01/05 -LA8OW,JP50NC,,,Arvid,,3000lpm,05/02 -LA9BM,JP40CM,,,l.,,,03/98 -LA9DL,JO59KE,EME,,,,,04/04 +LA8GKA,JO59FS,,,ex LC1PAT,,IC706,08/05 +LA8KV,JP52QQ,EME,,,,DTR,04/06 +LA8OW,JP50NC,,,,,3000lpm,05/02 +LA9BM,JP40CM,,,,,,03/98 LA9IY,JP53,,,,,,2003 -LA9NEA,JO59DX,EME,,Viggo Magnus,,144: 4x 19el K1FO 1-5KW,02/05 -LB7FA,JO59CR,,,,,,08/04 +LA9NEA,JO59DX,EME,,OP LA2AB,,144: 4x 19el K1FO 1-5KW,02/05 +LB7FA,JO88LM,,,,,144: IC821 9el 180W,03/05 LC1OCT,JP32,,,,,,06/03 LC1PAT,JP78,,,,,,2003 LU4HO,FF78RA,,,,,,2003 LU6DW,GF05SF,EME,,,,,2003 -LU6KK,FG73ie,EME,, -LU7DZ,FF78RA,EME,,Eduardo van,,144: 1KW 4xDJ9BV,04/00 -LU8EDR,GF05TF,EME,,Dany,,,11/02 -LU9AWH,GM04SO,,,Edgardo,,,2003 -LX1DB,JN29,,,Willy,,,07/99 -LX1GR,JN39,,,gilbert,,,1993 -LX2DX,JN29WO,,,Jean,,,10/02 +LU6KK,FG73HE,EME,,qsl via K7LU,,144: 4x 15el 9BV 1000W GS35b,06/05 +LU7DZ,FF78RA,EME,,,,144: 4x14el BV and 1.5KW,06/05 +LU8EDR,GF05TF,EME,,,,,11/02 +LU9AWH,GM04SO,,,,,,2003 +LX1DB,JN29,,,,,,07/99 +LX1GR,JN39,,,,,,1993 +LX2DX,JN29WO,,,,,,10/02 LX2SM,JN39,,,,,,07/04 -LY2AAM,KO06VB,EME,,,,183383,05/03 -LY2BAW,KO25KA,,,Tadas,,FT-736R+home made PA - 144: 24el 2M8WL M2 - 4,05/03 -LY2BIL,KO24PQ,,,Rytis,,144: FT736r 30el 1KW188 DTR 3000lpm188,08/02 +LY2AAM,KO23,,,Expedition QSL via DL3BQA,,358,06/06 +LY2BAW,KO25KA,,,,,FT-736R+home made PA - 144: 24el 2M8WL M2 - 4,05/03 +LY2BIL,KO24PQ,,,ex UP1BWR - not qrv MS nw! (01/01),,144: FT736r 30el 1KW188 DTR 3000lpm188,08/02 LY2BUU,KO15XH,,,,,,04/04 -LY2BW,KO24,,,Algis,,,1/95 -LY2CI,KO14WV,,,Raimundas ""Ray",,TS-790A- 144: 150W 11el - 432: 25el yagi - 1,08/03 -LY2FE,KO05NQ,,,Vytas,,144: FT736r 300W 13elMSDSP,10/02 -LY2FR,KO15VR,,,Paulius,,,07/04 -LY2GC,KO25KA,EME,,Giedrius,,,10/04 -LY2MW,KO24PS,,,Remigijus (Remi),,IC746 + PAs 50: 100W 6el - 144: 100Watt 1,08/04 -LY2SA,KO14LL,,,Vidas,,144: IC821H 300W 16el MGF1502 - 432: 175W,01/04 -LY2WR,KO24OQ,,,Clubstation,,144: FT736r 11el 600W - 432: 800W 24el - 1,01/00 -LY3BF,KO24OR,,,Arvydas,,,01/96 +LY2BW,KO24,,,,,,1/95 +LY2CI,KO14WV,,,,,TS-790A- 144: 150W 11el - 432: 25el yagi - 1,08/03 +LY2FE,KO05NQ,,,not qrv MS nw! (01/01),,144: FT736r 300W 13elMSDSP,10/02 +LY2FR,KO15VR,,,,,,07/04 +LY2GC,KO25KA,EME,,,,,10/04 +LY2MW,KO24PS,,,,,IC746 + PAs 50: 100W 6el - 144: 100Watt 1,08/04 +LY2SA,KO14LL,EME,,,,144: IC821H 300W 17el 5wl MGF1502 - 432:,08/05 +LY2WR,KO24OQ,,,QRT - not qrv anymore (01/01),,144: FT736r 11el 600W - 432: 800W 24el - 1,01/00 +LY2WR/P,KO05MW,,,Expedition,,,12/05 +LY3BF,KO24OR,,,,,,01/96 LY3GM,KO14LL,,,,,,12/97 -LY8X,KO24PQ,,,OP LY2MW,,,08/99 -LZ1AG,KN22ID,EME,,Angel,,144: 14el 100W,12/99 -LZ1BB,KN12SS,,,Harry,,,08/04 -LZ1DP,KN22TR,EME,,Christo,,144: 4x5 WL DJ9BV cross+MGF1302 FT-736R PA 1,01/05 -LZ1DX,KN22,,,net,,,1993 -LZ1JH,KN32FR,,,Ruben,,,06/99 -LZ1KDP,KN12SP,EME,,OP LZ2HM,,.172 1200lpm,01/98 -LZ1KDZ,KN32,EME,,radio,,,1993 -LZ1KG,KN31CS,,,Dimitar,,50: 4el transv. 10W - 144: 2x16 F9FT IC275e,09/03 -LZ1KJ,KN31CS,,,Ivan,,50: FT987 4el 15W - 144: FT987 250W 2x8el G,09/03 -LZ1KQ,KN22TK,,,Veso (OP LZ1KWT),,,12/96 -LZ1KRB,KN32,,,radio,,,1993 +LY8X,KO24PQ,,,SpecialCall - QSL via LY2MW,,,08/99 +LZ1AG,KN22ID,EME,,,,144: 14el 100W,12/99 +LZ1BB,KN12SS,,,,,,08/04 +LZ1BB/p,KN33QC,,,Expedition,,,03/06 +LZ1DP,KN22TR,EME,,,,144: 4x5 WL DJ9BV cross+MGF1302 FT-736R PA 1,01/05 +LZ1DX,KN22,,,,,,1993 +LZ1JH,KN32FR,,,,,,06/99 +LZ1KDP,KN12SP,EME,,,,.172 1200lpm,01/98 +LZ1KDZ,KN32,EME,,,,,1993 +LZ1KG,KN31CS,,,,,50: 4el transv. 10W - 144: 2x16 F9FT IC275e,09/03 +LZ1KJ,KN31CS,,,,,50: FT987 4el 15W - 144: FT987 250W 2x8el G,09/03 +LZ1KQ,KN22TK,,,,,,12/96 +LZ1KRB,KN32,,,,,,1993 LZ1KSN,KN32SL,,,,,,1993 -LZ1KSW,KN31CS,,,Clubstation,,,12/95 -LZ1KU,KN32,,,s.,,,1993 -LZ1KWT,KN22TK,,,Clubstation,,144: FT736 1KW 2x16el F9FT GaAsFet 3SK129r,11/03 +LZ1KSW,KN31CS,,,,,,12/95 +LZ1KU,KN32,,,,,,1993 +LZ1KWT,KN22TK,,,QSL via LZ1DP or LZ1JH,,144: FT736 1KW 2x16el F9FT GaAsFet 3SK129r,11/03 LZ1NO,KN12,,,,,,12/01 -LZ1QI,KN12,,,Bebko,,,11/01 -LZ1QM,KN12,,,s.,,,1993 -LZ1R,KN42AA,,,,,,1993 +LZ1QI,KN12,,,,,,11/01 +LZ1QM,KN12,,,,,,1993 +LZ1R,KN42AA,,,Expedition,,,1993 LZ1UB,KN22TK,,,,,,1994 -LZ1UK,KN22ID,,,Savko ""Savi",,144: 60W 8el Quagi,11/03 +LZ1UK,KN22ID,,,,,144: 60W 8el Quagi,11/03 +LZ1UQ/P,KN41AX,,,Expedition,,,08/05 LZ1V,KN12QQ,,,,,,1990 -LZ1ZP,KN22ID,,,George,,144: 150W 14el DJ9BV1000lpm,05/03 -LZ1ZX,KN32IO,,,mitko,,,12/99 -LZ2AR,KN13SF,EME,,boris,,,1994 -LZ2FO,KN13KX,,,Shecko,,144: 500W 15el 9BV.138 2000lpm,07/04 -LZ2FR,KN13IU,,,,,,12/98 -LZ2HM,KN12QP,EME,,Andre ""Andy",,144: FT847 17el yagi172 1200lpm,07/03 -LZ2HV,KN23UB,,,Christo,,144: 600W 12el Quad.145 2000lpm,12/98 -LZ2JF,KN23,,,n.,,,1993 -LZ2KRU,KN33FL,,,Clubstation,,144: 500W 17el.191 1000lpm,08/97 -LZ2KZ,KN33FC,,,Zlatko,,144: 15el 100W,12/01 -LZ2PP,KN33,,,v.,,,1993 -LZ2US,KN13RJ,EME,,"Marko"" Nikolov,,144: 4x KLM17LBX 2x 4CX800A 2KW FSC11LF.,08/00 -LZ2UU,KN12QP,,,Jordan (Dany),,.172 1200,08/96 -LZ3BD,KN12QQ,,,Bogdan,,432: 250W 32el GaasFet2000lpm.325,12/99 +LZ1VPV,KN32AS,,,,,,08/05 +LZ1ZP,KN22ID,,,,,144: 150W 14el DJ9BV1000lpm,05/03 +LZ1ZX,KN32IO,,,,,,12/99 +LZ2FO,KN13KX,,,,,144: 500W 15el 9BV138 2000lpm,03/06 +LZ2HM,KN12QP,EME,,,,144: FT847 17el yagi172 1200lpm,07/03 +LZ2HM/1,KN21CW,,,Expedition,,,08/05 +LZ2HV,KN23UB,,,,,144: 600W 12el Quad.145 2000lpm,12/98 +LZ2JF,KN23,,,,,,1993 +LZ2KRU,KN33FL,,,,,144: 500W 17el.191 1000lpm,08/97 +LZ2KZ,KN33FC,,,,,144: 15el 100W,12/01 +LZ2PP,KN33,,,,,,1993 +LZ2UU,KN12QP,,,,,.172 1200,08/96 +LZ3BD,KN12QQ,,,,,432: 250W 32el GaasFet2000lpm.325,12/99 LZ3CQ,KN12PQ,,,,,,01/03 -LZ3GM,KN32RL,,,Ivan,,144: IC735 20W 13elBVO MGF1302.148.300,05/03 -LZ3YH,KN22,,,Dora,,,12/95 -LZ5GM,KN32QL,,,Iilian,,144: IC-720 50W 13eleFT MGF1302292,04/03 +LZ3GM,KN32RL,,,,,144: IC735 20W 13elBVO MGF1302.148.300,05/03 +LZ3YH,KN22,,,,,,12/95 +LZ4KK,KN23XU,,,,,,12/05 +LZ5GM,KN32QL,,,,,144: IC-720 50W 13eleFT MGF1302292,04/03 LZ5N,KN21JX,,,,,,1995 -LZ5UV,KN12PR,,,Evengi,,144: FT847 IC271 4cx250 PA 17el DJ9BV.174,11/02 -LZ5Z,KN12PR,,,LZ1JK- LZ2HM- LZ5UV,,144: 2x15el 1KW,12/99 +LZ5UV,KN12PR,,,,,144: FT847 IC271 4cx250 PA 17el DJ9BV.174,11/02 +LZ5UV/1,KN21CW,,,Expedition,,,08/05 +LZ5Z,KN12PR,,,,,144: 2x15el 1KW,12/99 LZ6T,KN22IS,,,,,,12/99 -LZ7A,KN43HL,,,,,,1994 +LZ7A,KN43HL,,,Expedition,,,1994 LZ7P,KN22,,,,,,12/96 -LZ7Y,KN41AX,,,OP LZ3GM,,DTR,08/99 -LZ9M,KN32RL,,,OP: LZ3GM,,,12/03 -LZ9W,KN12MO,,,LZ Contest Team,,IC-746 FT-847,01/05 -M0BPQ,IO91WP,,,Steve,,50: 400W 7el 144: 2x5el 400W 432: 2x21el,11/04 -M0CQZ,IN69UW,,,Ops DH5FS- DH0LS...,,.188,09/00 +LZ7Y,KN41AX,,,,,DTR,08/99 +LZ9M,KN32RL,,,,,,12/03 +LZ9W,KN12MO,,,,,IC-746 FT-847,01/05 +LZ9X,KN32AS,,,= LZ1KWT,,144: 2x 15el 1KW,11/05 +LZ9X/P,KN22TK,,,= LZ1KWT,,144: 2x 15el 1KW,01/06 +M0BCG,IO91DO,EME,,,,144: ic706mk2g 2x4cx250b 4x9el elvation mg,04/05 +M0BPQ,IO91WP,,,ex G7ACQ G5YC,,50: 400W 5el 144: 2x6el 400W 432: 2x13el 12,04/05 +M0CQZ,IN69UW,,,Expedition,,.188,09/00 M0CTP,IO93,,,,,,03/02 -M0EME,IO93GF,EME,,Paul,,FT847 4x FO20 100W,01/05 -M0VHF,IO82VF,,,Mike,,FT847 JST245 3CX800 8877 - 50: 5el - 144:,10/02 -M1DRK,IO93US,,,Andy,,50: TS60 5el 90W130-150,01/02 -M1GSM,IO94BU,,,Stuart,,144: 150W 8elMSDSP,08/03 -M5FUN,JO00DX,,,Jonathan ""Jono",,144: TR751E 100W 12el225 only SSB-MS310,03/04 -M5MUF,IO92JP,,,Mike,,IC202 IC706 various transverters,09/03 -MI0AYR,IO64VQ,,,Paul,,144: TR9130 150W 19el,02/04 -MM0BQI,IO85KX,,,Jim,,50: 100W 5el - 144: 13el.045.345,03/00 -MM0CCC,IO85MW,,,John,,144: FT1000MP TVVF144A 17el 100W,05/04 -MM0CEZ,IO75XU,,,Peter,,IC910 IC775DSP Transverter,03/04 -MM0DQP,IO88KI,,,Erik,,100W,05/04 -MM0KOS,IO85CR,,,Chris,,ICOM 290D MK2,05/04 +M0VHF,IO82VF,,,,,FT847 JST245 3CX800 8877 - 50: 5el - 144:,10/02 +M1DRK,IO93US,,,,,50: TS60 5el 90W130-150,01/02 +M1GSM,IO94BU,,,,,144: 150W 8elMSDSP,08/03 +M5FUN,JO00DX,,,ex 2E0ATF+2E1GOM,,144: TR751E 100W 12el225 only SSB-MS310,03/04 +M5MUF,IO92JP,,,ex GU6AJE,,IC202 IC706 various transverters,09/03 +MI0AYR,IO64VQ,,,,,144: TR9130 150W 19el,04/05 +MI0JST,IO65SE,,,,,144: IC910 100W 10el,06/05 +MI0KAM,IO65PE,,,,,,06/05 +MM0BQI,IO85KX,,,,,50: 100W 5el - 144: 13el.045.345,03/00 +MM0CCC,IO85MW,,,,,144: FT1000MP TVVF144A 17el 100W,05/04 +MM0CEZ,IO75XU,,,,,IC910 IC775DSP Transverter,03/04 +MM0DQP,IO88KI,,,,,100W,05/04 +MM0KOS,IO85CR,EME,,ex MM3KOS,,ICOM 290D MK2,03/05 +MM0MMK,IO85EV,,,,,,06/05 MM1BXF,IO76PA,,,,,,01/03 -MM5AJW,IO88KI,,,Don,,,09/04 -MM5DWW,IO89ID,,,David,,KENWOOD TR751/TS690 100W 11el,04/04 -MS0FNR,IO88KK,,,Erik,,,12/04 +MM3ENW,IO85BS,,,,,,03/05 +MM5AJW,IO88KI,,,,,,08/05 +MM5DWW,IO89ID,,,ex MM1MVJ,,KENWOOD TR751/TS690 100W 11el,04/04 +MS0FNR,IO88KK,,,,,,12/04 N0AB,EM28,,,,,,2003 N0AE,EN51,,,,,,2003 N0AJU,EN11,,,,,,2003 -N0AKC,EN44GU,,,Charles,,144: 1-2KW 17el - 222: 350W 16el,01/01 +N0AKC,EN44GU,EME,,,,144: 4x 18el 1KW 222: 350W 16el,10/05 N0ATV,EN34JX,,,,,,2003 N0BTN,EN21,,,,,,2003 N0CIH,EN42,,,,,,2003 N0CKK,EN34,,,,,,2003 N0DAG,EM29QF,,,,,,2003 -N0DQS,EN22GD,,,Gene,,,07/01 +N0DQS,EN22GD,,,,,,07/01 N0DY,EN42FA,,,,,,2003 -N0EC,DN70LF,,,Ron,,50: 1KW - 144: 1-5KW - 222: 120W - 432: 1KW -,01/01 +N0EC,DN70LF,,,,,50: 1KW - 144: 1-5KW - 222: 120W - 432: 1KW -,01/01 N0ECI,EM37,,,,,,2003 N0EKT,EN21,,,,,,2003 N0EOQ,EM24,,,,,,2003 N0FFO,EM17,,,,,,2003 N0FQW,EM39,,,,,,2003 N0GPH,EM48,,,,,,2003 -N0GXA,EN13QH,,,Kevin,,144: 1KW preamp 18el,1998 +N0GXA,EN13QH,,,,,144: 1KW preamp 18el,1998 N0GXN,EM48,,,,,,2003 -N0HJZ,EN34FV,,,Rich,,144: TS700S 200W preamp 12el,01/01 +N0HJZ,EN34FV,,,,,144: TS700S 200W preamp 12el,01/01 N0HKT,EM17,,,,,,2003 N0HZ,EN34,,,,,,2003 -N0ICV,EN52XA,,,TONY,,,2004 +N0ICV,EN52XA,,,,,,2004 N0IDT,EN10,,,,,,2003 N0IS,EM48,,,,,,2003 -N0IT,EM48RN,,,Dave,,144: 170W,01/01 +N0IT,EM48RN,,,,,144: 170W,01/01 N0JCF,EN35,,,,,,2003 N0JEQ,EM27,,,,,,2003 N0JK,EM17,,,,,,2003 N0KE,DM69,,,,,,2003 N0KEV,EM17,,,,,,2003 N0KIS,EN10QT,,,,,,2003 -N0KM,DM67VR,,,Dave,,,01/97 +N0KM,DM67VR,,,,,,01/97 N0KN,EM28,,,,,,2003 -N0KQY,DM98GK,EME,,Gary,,144: 15/19dbd antenna 1KW,02/01 +N0KQY,DM98GK,EME,,,,144: 15/19dbd antenna 1KW,02/01 N0LIK,EM48,,,,,,2003 -N0LL,EM09,,,Larry,,,01/01 +N0LL,EM09,,,,,,01/01 N0LNO,EN42,,,,,,2003 N0LRJ,DM78,,,,,,2003 N0NAS,EN35,,,,,,2003 @@ -2553,97 +2563,97 @@ N0NEG,EM29,,,,,,2003 N0NHS,DN70LF,,,,,,2003 N0OIB,EN35,,,,,,2003 N0OYQ,EN25,,,,,,2003 -N0PB,EM39WO,,,Phil,,,11/01 +N0PB,EM39WO,,,,,,11/01 N0PJU,EN41,,,,,,2003 -N0POH,DM79OP,,,Wayne,,,01/01 +N0POH,DM79OP,,,,,,01/01 N0QBF,EM48SR,,,,,,2003 N0REN,EN34,,,,,,2003 N0RHL,EN10RT,,,,,,2003 N0SBU,EN35,,,,,,2003 N0SHR,EN26,,,,,,2003 N0SRQ,EN18,,,,,,2003 -N0SWV,DM79,,,Jesse J.,,144: 170W 2x16el - 432: 35W 2x18el - 1296: 60,05/98 +N0SWV,DM79,,,,,144: 170W 2x16el - 432: 35W 2x18el - 1296: 60,05/98 N0TOU,EM29,,,,,,2003 N0UGY,DM79,,,,,,2003 -N0UK,EN34JV,,,Chris,,50: 10W KLM661 - 144: TS930/DEM Tvtr 300W K1F,07/01 +N0UK,EN34JV,,,,,50: 10W KLM661 - 144: TS930/DEM Tvtr 300W K1F,07/01 N0US,EN10,,,,,,2003 N0UU,EM18,,,,,,2003 -N0VSB,DM79RJ,,,Brian,,50: 1KW 7el - 144: 1.5KW 18el MGF- 222: 200W,01/02 +N0VSB,DM79RJ,,,,,50: 1KW 7el - 144: 1.5KW 18el MGF- 222: 200W,01/02 N0WJY,EN10QT,,,,,,2003 N0WVU,DM79HV,,,,,,2003 N0WX,EN34,,,,,,2003 N0XKS,EM29,,,,,,2003 N0XPI,EM29,,,,,,2003 N0YGM,DM78OV,,,,,,2003 +N0YK,DM98MG,EME,,,,144: 18xxx with 350W,05/06 N0YNP,DN81CW,,,,,,2003 N0ZEB,DM79,,,,,,2003 N0ZKK,EM29,,,,,,2003 -N1BUG,FN55MF,EME,,Paul,,50: 400W 5el 144: 1500W 20el Yagi 222: 500W,11/04 +N1BUG,FN55MF,EME,,,,50: 400W 5el 144: 1500W 20el Yagi 222: 500W,11/04 N1CPE,FN42QH,,,,,,2003 N1EKV,FN42JK,,,,,,2003 -N1GMV,FM05TU,,,John,,,2004 -N1GOD,FN41VQ,,,Lou,,,2003 -N1KTM,FN41SR,,,Clint,,144: 1kw- 2x2M9,01/97 -N1LDY,FN41JR,,,Tony,,IC-746 IC-910 DEMI-222 DEMI-903,01/04 -N1NCO,FN42GL,,,John,,,2003 -N1RWY,FN54NO,,,Jason,,50: 100W 3el CC - 144: 800W 18el - 222: 350W,01/01 -N1RZ,FN44EI,,,Tim,,.090,07/01 -N1SZ,DM79NP,,,James,,,2003 +N1GMV,FM05TU,,,,,,2004 +N1GOD,FN41VQ,,,,,,2003 +N1KI,EM75WV,EME,,,,144: 4x 9el 1500W,10/05 +N1KTM,FN41SR,,,,,144: 1kw- 2x2M9,01/97 +N1LDY,FN41JR,,,,,IC-746 IC-910 DEMI-222 DEMI-903,01/04 +N1NCO,FN42GL,,,,,,2003 +N1RWY,FN54NO,,,,,50: 100W 3el CC - 144: 800W 18el - 222: 350W,01/01 +N1RZ,FN44EI,,,,,.090,07/01 +N1SZ,DM79NP,,,,,,2003 N1VQR,FN42JJ,,,,,,2003 N2CEI,FN20,,,,,,2003 -N2FKF,FN30BR,,,Bill,,,2004 +N2FKF,FN30BR,,,,,,2004 N2HLT,FN12LN,EME,,,,,2003 N2IQ,FN13TD,EME,,,,,2003 N2IQU,FN13,,,,,,2003 -N2JMH,FN13AF,,,James,,,2003 -N2JQR,FN13,,,Jeff,,50: 500W 5el,01/01 -N2JR,FM18CP,,,Richard,,50: 100W 5el,09/01 +N2JMH,FN13AF,,,,,,2003 +N2JQR,FN13,,,,,50: 500W 5el,01/01 +N2JR,FM18CP,,,,,50: 100W 5el,09/01 N2KW,FN03XE,,,,,,2003 -N2MB,FN30CO,,,Barry,,,2003 -N2MCY,FN30AR,,,Ray,,,2003 -N2MKT,FN13LK,,,Jeff,,,2003 +N2MB,FN30CO,,,,,,2003 +N2MCY,FN30AR,,,,,,2003 +N2MKT,FN13LK,,,,,,2003 N2MSS,FN31AA,,,,,,2003 N2NEP,FN13EB,,,,,,2003 N2NZI,FN32,,,,,,2003 N2OLA,FN12MM,,,,,,2003 -N2OTO,FN30CR,,,Rupert,,144: TS850 LT2SMKII 200W 4el,01/01 +N2OTO,FN30CR,,,,,144: TS850 LT2SMKII 200W 4el,01/01 N2PC,DM78QX,,,,,,2003 N2UO,FN20QF,EME,,,,,2003 -N2VR,FN12SK,EME,,Mike,,144: 4x13B2,08/01 -N2WK,FN03XE,EME,,Wayne F.,,144: 1-5kw 4x2.2 wl full elv. MGF1302.111,10/00 +N2WK,FN03XE,EME,,,,144: 1-5kw 4x2.2 wl full elv. MGF1302.111,10/00 N2WLS,FN02RQ,,,,,,2003 -N2XK,FN20RF,,,Fred,,,2003 +N2XK,FN20RF,,,,,,2003 N3AHF,FN20SF,,,,,,2003 N3AJX,EN71KC,,,,,,2003 -N3FA,FN21,EME,,Bob,,144: LT2S 8877 700W 4x12el M2 - 432: FT736 SP,10/99 -N3FZ,EN90xh,EME,, +N3FA,FN21,EME,,ex WB3FAA,,144: LT2S 8877 700W 4x12el M2 - 432: FT736 SP,10/99 N3JNP,EN91,,,,,,2003 N3KKM,EM28,,,,,,2003 -N3OPM,FM19PH,,,Daniel F.,,,01/01 -N3RN,FN11WH,,,Bob,,144: 500W 16el KLM,07/01 -N3WT,FM19EJ,,,John,,,2004 +N3OPM,FM19PH,,,,,,01/01 +N3RN,FN11WH,,,,,144: 500W 16el KLM,07/01 +N3WT,FM19EJ,,,,,,2004 N3WXW,FN20CE,,,,,,2003 -N3XI,EN90XJ,,,Frank,,,2003 -N3YGA,FN20BI,,,Craig,,50: 160W 4el - 144: 170W 14el,1998 +N3XI,EN90XJ,,,,,,2003 +N3YGA,FN20BI,,,,,50: 160W 4el - 144: 170W 14el,1998 N4CAG,EM86PI,,,,,,2003 N4EQT,EM77,,,,,,2003 N4FRE,EL06LL,,,,,,2003 N4GJV,EM95PS,EME,,,,,89 -N4GKO,EM65LO,,,Bryn,,144: FT736r 350W 2M18XXX,01/01 -N4HY,FN20RG,,,Bob,,,2004 +N4GKO,EM65LO,,,,,144: FT736r 350W 2M18XXX,01/01 +N4HY,FN20RG,,,,,,2004 N4IP,EM73WV,,,,,,2003 N4IPB,EM66,,,,,,2003 -N4IS,EL96UB,,,Jose,,FT1000MP+Trsv 144: 350W 18el M2.120.200,06/01 -N4KWX,FM08WF,,,Ray,,,01/97 -N4KZ,EM77GT,,,Dave,,,09/01 -N4LXB,EM83VL,,,Paul,,,2003 +N4IS,EL96UB,,,ex AB6WC- PY2DP....,,FT1000MP+Trsv 144: 350W 18el M2.120.200,06/01 +N4KWX,FM08WF,,,,,,01/97 +N4KZ,EM77GT,,,,,,09/01 +N4LXB,EM83VL,,,,,,2003 N4MW,FM17KN,EME,,,,,2003 N4OYS,EM65,,,,,,2003 N4PZ,EN52,EME,,,,,04/97 -N4SC,EN72,,,Roman,,,11/04 -N4TWX,EL89TW,,,Terry,,50: 5el 75W - 144: 15el 150W Preamp,01/01 -N4UK,EM84XP,EME,,Ken,,144: 1KW 13/13el - 222: 750W 23elM2 - 432: 75,01/97 -N4WI,FM14IL,,,Fred,,,2004 +N4SC,EN72,,,,,,11/04 +N4TWX,EL89TW,,,,,50: 5el 75W - 144: 15el 150W Preamp,01/01 +N4UK,EM84XP,EME,,,,144: 1KW 13/13el - 222: 750W 23elM2 - 432: 75,01/97 +N4WI,FM14IL,,,,,,2004 N4XD,FM05,,,,,144: TS700SP 160W,01/01 N4ZKR,EM65,,,,,,2003 N4ZRW,EM17KN,,,,,,2003 @@ -2652,18 +2662,22 @@ N5AHD,EL17,,,,,,2003 N5AMA,EL29,,,,,,2003 N5ARS,EM26,,,,,,2003 N5AXJ,EM86,,,,,,2003 -N5BA,EL29FX,,,Brian,,144: 1500W 4x5wl,08/03 +N5BA,EL29FX,,,,,144: 150W 18el,07/05 N5BHO,EM31,,,,,,2003 N5BHX,EL09,,,,,,2003 N5BHZ,EM22,,,,,,2003 -N5BLZ,EL29EW,EME,,Ed,,144: 4 X 28 XPOL 8877,11/02 +N5BLK,EL29,EME,,,,,02/05 +N5BLZ,EM20AB,EME,,temp. QRT now 10/05,,144: IC746 to homebrew 8877 PA 1 5/8 Andrews,10/05 N5DL,EM36,,,,,,2003 +N5EIL,EM12UR,EME,,,,144: 15el 50W,05/05 N5EM,EL29,,,,,,2003 N5FV,EM03,,,,,,2003 N5HHS,EL29,,,,,,2003 +N5IRM,EM13RC,EME,,,,144: 2x 12el 300W,01/06 N5IS,DM96,,,,,,2003 +N5ITO,EM12MR,EME,,ex KA9JLU,,144: 17el 750W - 432: 4x 18el 250W,11/05 N5JM,EL49,,,,,,2003 -N5KDA,EM41HM,,,Gary,,,09/01 +N5KDA,EM41HM,EME,,,,144: 4 x 17el 700W,10/05 N5KWB,EM32QB,,,,,,2003 N5MP,EM12,,,,,,2003 N5MWS,EM13,,,,,,2003 @@ -2671,68 +2685,72 @@ N5MYH,EM32,,,,,,2003 N5NDV,EM15,,,,,,2003 N5NSH,EM14,,,,,,2003 N5OCP,EM15,,,,,,2003 -N5OSK,EM25FI,,,Jerry,,,10/02 +N5OSK,EM25FI,EME,,,,144: 26B2 350W,06/05 N5QGH,EM13QC,,,,,,2003 N5QS,EM45,,,,,,2003 N5QT,EM45,,,,,,2003 N5RZ,DM81XW,,,,,,2003 N5SAL,EM28,,,,,,2003 -N5SIX,EM42XI,EME,,Bruce,,,02/05 +N5SIX,EM42XI,EME,,,,144: 500W 9el,06/05 N5TML,EM14,,,,,,2003 N5TQB,EM31PJ,,,,,,2003 N5TX,EL09,,,,,,2003 -N5WS,EL09RU,,,W. Russ,,,01/01 +N5WS,EL09RU,,,,,,01/01 N5XCX,EL09,,,,,,2003 -N5XU,EM10DG,,,Kenneth,,,01/01 +N5XU,EM10DG,,,,,,01/01 N5YLS,EM54,,,,,,2003 N5YSM,EM15,,,,,,2003 N5ZLU,DM95,,,,,,2003 N5ZWO,EM32,,,,,,2003 N6CL,EM26,,,,,,2003 N6CV,DM04UF,,,,,,2003 -N6DHN,CM98,,,Frank,,50: 150W 4el - 144: 150W 22el - 432: 100W,1998 -N6ENU,DM04,,,John L.,,144: 270W 13el Yagi - 50: 100W 7el,01/01 +N6DHN,CM98,,,,,50: 150W 4el - 144: 150W 22el - 432: 100W,1998 +N6ENU,DM04,,,,,144: 270W 13el Yagi - 50: 100W 7el,01/01 N6HV,DM04,,,,,,2003 -N6KBX,CM98,,,Don,,50: 400W 2x5el - 144: 350W 4x17el - 432: 17,01/97 -N6KMR,CM97MO,,,Jim,,,2003 +N6KBX,CM98,,,,,50: 400W 2x5el - 144: 350W 4x17el - 432: 17,01/97 +N6KK,DM03TV,EME,,,,144: 5wl Ant 1500W,05/06 +N6KMR,CM97MO,,,,,,2003 N6NB,DM05,,,,,,2003 N6OVP,CM87,EME,,,,,2003 N6PYI,DM05KJ,,,,,,2003 -N6RA,CM87SR,,,Thomas,,,2003 -N6RJM,DM14CP,,,Pat,,50: 1KW 9el - 144: 1-5KW 4x18el - 222: 350W,01/01 +N6RA,CM87SR,,,,,,2003 +N6RJM,DM14CP,,,,,50: 1KW 9el - 144: 1-5KW 4x18el - 222: 350W,01/01 N6RMJ,DM14CP,,,,,,2003 N6RPM,DM04UA,,,,,,2003 -N6RZ,CM87WB,,,Dave,,144: 1KW 17B2,01/01 +N6RZ,CM87WB,,,,,144: 1KW 17B2,01/01 N6SPP,CM87WQ,,,,,,2003 N6TQS,CM87UU,,,,,,2003 N6TX,FN11LH,EME,,,,,2003 -N6VHF,DM13,,,Neil,,,01/01 -N6YM,CM88XF,,,Ed,,,01/01 -N6ZE,DM04NE,EME,,Peter S. ""Pete",,IC756 PRO II 50: 100W 5el - 144: 8930Amp 2M5,08/03 +N6VHF,DM13,,,,,,01/01 +N6VMO,CM94SP,EME,,,,144: 17el 400W,03/06 +N6YM,CM88XF,,,,,,01/01 +N6ZE,DM04NE,EME,,ex K1FJM,,IC756 PRO II 50: 100W 5el - 144: 8930Amp 2M5,08/03 N7AM,CN87QN,EME,,,,,89 N7AMA,DM33,,,,,,2003 N7ART,CN87,EME,,,,,89 N7AVK,CN84,,,,,,2003 N7BSN,CN87QQ,,,,,,2003 -N7CZ,DN47HM,,,Bob,,FT736 IC706,01/02 -N7DMA,DM42NL,,,Karl,,,2003 +N7CZ,DN47HM,,,ex KQ7K,,FT736 IC706,01/02 +N7DMA,DM42NL,,,,,,2003 N7EMD,DM26JE,,,,,,2003 -N7EY,CN96QO,,,Sean,,,2003 +N7EY,CN96QO,,,,,,2003 N7IJ,DN44GB,,,,,,2003 -N7LQ,DN01FA,EME,,Shawn,,432: 1.5KW 4 x FO-25's,06/00 -N7MWV,CN87VQ,,,John,,144: 250W CC3219only SSB-MS,01/01 -N7QJP,DM33VM,,,Stu,,,1998 -N7SKT,DM33SN,,,Bob,,,01/01 +N7LQ,DN01FA,EME,,ex WB7TDI,,432: 1.5KW 4 x FO-25's,06/00 +N7MWV,CN87VQ,,,,,144: 250W CC3219only SSB-MS,01/01 +N7QJP,DM33VM,,,,,,1998 +N7SKT,DM33SN,,,,,,01/01 N7WNX,CN83OW,EME,,,,,12/04 -N7WS,DM42JH,,,Wes,,144: 8877 17el GaAs,01/01 -N7YAG,CN85,,,Arnold,,144: FT736r 300W 11el KLM,1998 -N7YAP,DN07HJ,,,Gregory E.,,.125,08/01 +N7WS,DM42JH,,,,,144: 8877 17el GaAs,01/01 +N7YAG,CN85,,,,,144: FT736r 300W 11el KLM,1998 +N7YAP,DN07HJ,,,,,.125,08/01 N8AIA,EN82KL,,,,,,2003 N8ASB,EM89,,,,,,2003 N8AXA,EM79UP,EME,,,,,2003 N8BSG,EN82,,,,,,2003 N8BXP,EN81,,,,,,2003 -N8CGY,EN74OH,,,Ken,,,01/01 +N8CGY,EN74OH,,,,,,01/01 +N8CJG,EN84FG,EME,,,,,03/05 +N8CJK,EN84FG,EME,,,,,11/05 N8CQ,FM05OT,EME,,,,,2004 N8DJB,EN81FJ,EME,,,,,2003 N8ITP,EN81XF,,,,,,2003 @@ -2740,16 +2758,16 @@ N8JMK,EN90,,,,,,2003 N8KWX,EN62AD,,,,,,2003 N8LCU,EN72,,,,,,2003 N8NPX,EM79XR,,,,,,2003 -N8OC,EN83AO,EME,,Dave,,50: 100Watts 6ele KMA - 144: 1500Watts 17ele,08/03 -N8PUM,EN66DL,,,Branton T.,,144: 200W 2x17B2,1998 +N8OC,EN83AO,EME,,,,50: 100Watts 7el hb - 144: 1500Watts 17ele M2,08/05 +N8PUM,EN66DL,,,,,144: 200W 2x17B2,1998 N8PVT,EN64,,,,,,2003 N8QOD,EN79,,,,,,2003 -N8TDL,EN90BN,,,Greg,,,2003 +N8TDL,EN90BN,,,,,,2003 N8VES,EM79VT,,,,,,2003 N8ZAT,EM79,EME,,,,,2000 N8ZAW,EM79,,,,,,2003 N8ZM,EM79,,,,,,2003 -N9AB,EN52XG,EME,,,,,01/05 +N9AB,EN52XG,EME,,,,432: 16x 22el 1KW,09/05 N9AQ,EN51,,,,,,2003 N9AU,EN62BX,,,,,,2003 N9AZC,EM68,,,,,,2003 @@ -2757,7 +2775,7 @@ N9AZZ,EM57MV,,,,,,2003 N9BD,EM28,,,,,,2003 N9BJG,EM57,,,,,,2003 N9BMH,EN62,,,,,,2003 -N9CIQ,EN44,,,Jay,,,01/01 +N9CIQ,EN44,,,,,,01/01 N9DCA,EN71GG,,,,,,2003 N9DG,EN53BJ,,,,,,2003 N9EGT,EN70,EME,,,,,02/05 @@ -2767,14 +2785,14 @@ N9FH,EN63,,,,,,2003 N9FTC,EL79EQ,,,,,,2003 N9GVF,EN62,,,,,,2003 N9HF,EN52,,,,,,2003 -N9IJ,EN52XI,,,Leonard,,,2003 -N9JIM,CM87XI,,,Jim,,50: 9el 150W - 144: 16el 700W - 432: 21el 50W,11/03 +N9IJ,EN52XI,,,,,,2003 +N9JIM,CM87XI,,,ex WB9AJZ,,50: 9el 150W - 144: 16el 700W - 432: 21el 50W,11/03 N9KC,EN52,EME,,,,,2003 N9LAG,EM57,,,,,,2003 N9LHD,EN62BA,,,,,,2003 -N9LR,EN50DU,EME,,Larry,,,02/05 +N9LR,EN50DU,EME,,,,144: 4x 8el 1500W,08/05 N9MEH,EN44,,,,,,2003 -N9MSG,EN50ES,,,John,,,2003 +N9MSG,EN50ES,,,,,,2003 N9MYK,EN-53W,,,,,,2003 N9NHC,EN61DU,,,,,,2003 N9NJY,EM58AM,,,,,,2003 @@ -2788,14 +2806,13 @@ N9TZL,EN52SH,,,,,,2003 N9UDO,EN53DL,,,,,,2003 N9UUR,EN63,,,,,,2003 N9VSV,EN63,,,,,,2003 -N9WWR,EN62CS,,,John,,,2003 -N9XG,EN60WL,EME,,,,144: 4x 17el 1KW,01/05 +N9WWR,EN62CS,,,,,,2003 +N9XG,EN60WL,EME,,,,144: 4x 17el 1KW,06/05 N9XIX,EN53,,,,,,2003 N9YKE,EN62,,,,,,2003 NA0IA,EN42FB,,,,,,2003 -NA3T,FM05LW,EME,,Joe,,,10/97 -NA4AL,EM63OF,,,Bryan,,IC746 FT817,08/01 -NA4M,EM10DP,,,Phil,,,2003 +NA4AL,EM63OF,,,,,IC746 FT817,08/01 +NA4M,EM10DP,,,,,,2003 NA4N,FM18,EME,,,,,2003 NA6E,CN82,EME,,,,,2003 NA7D,DM43AS,,,,,,2003 @@ -2803,1084 +2820,1122 @@ NB2V,FN30,,,,,,2003 NC1I,FN32OB,EME,,,,,01/05 NC1T,FN32,,,,,,2003 ND2X,EL09,,,,,,2003 -NE0P,EM04,,,John,,,09/01 +NE0P,EM04,,,,,,09/01 NE1H,EM84AC,,,,,,2003 -NE7O,FN53HX,,,chet,,,2005 +NE7O,FN53HX,,,,,,2005 NE8I,EN82JM,,,,,,06/04 NF0Q,EM48,,,,,,2003 NF5B,EL29,,,,,,2003 NF7P,DM09GH,EME,,,,,2003 NG9R,EN40LA,,,,,,2003 +NH2CM,QK23KL,EME,,,,144: 4x 13el CushCraft 900W,12/05 NI4Z,EL98HJ,,,,,,2003 NI6G,DM06,,,,,,2003 NJ0C,DM78,,,,,,2003 -NJ0U,EN71IB,EME,,,,2x 17el 500W,01/05 +NJ0U,EN71IB,EME,,,,144: 2x 18el 500W,05/05 NJ0X,EM29,,,,,,2003 NJ2L,FN13,,,,,,2003 -NJ7A,DN30XP,,,Dave,,144: 170W 16LBX Preamp - 222: 120W 5wL,01/01 +NJ7A,DN30XP,,,,,144: 170W 16LBX Preamp - 222: 120W 5wL,01/01 NK5F,DM65,,,,,,2003 -NK7J,DM33,,,Bob,,,01/01 -NK8Q,FN20KL,,,Mark,,144: 170W 13el - 50: 7W 5el,01/01 +NK7J,DM33,,,,,,01/01 +NK8Q,FN20KL,,,,,144: 170W 13el - 50: 7W 5el,01/01 NL7F,BP64DV,EME,,,,,2003 -NL7Z,BP51EN,EME,,Kevin,,FT920,02/05 NM1A,EL96VF,,,,,,2003 NM5BB,DM65UV,,,,,,2003 NM5X,EM26,,,,,,2003 NM9H,EM59CD,,,,,,2003 NN5DX,DM80NV,,,,,,2003 NN6RF,CM87UW,,,,,,2003 -NN7J,CN85,,,Dan,,,01/05 -NN9K,EN41,,,Pete,,,1998 +NN7J,CN85,,,ex WA7BJU,,,01/05 +NN9K,EN41,,,,,,1998 NP4B,FK67,EME,,,,,2003 -NQ2O,FN13,EME,,WALTER G ""Wastl",,,05/01 +NQ7R,DM42DT,EME,,,,144: 120W 2.5wl Ant,08/05 +NR0X,EN42JH,,,ex DL4AT,,144: 12el,07/05 NR5A,DN84LC,,,,,,2003 NR6E,CM88,,,,,,2003 -NS4W,EM76VC,,,Bert,,500: 1KW - 144: 1kw 2.5wl - 222: 400W - 432:,01/01 -NS7K,DN31XC,,,Richard,,,2004 +NS4W,EM76VC,,,,,500: 1KW - 144: 1kw 2.5wl - 222: 400W - 432:,01/01 +NS7K,DN31XC,,,,,,2004 NS7N,CN87,,,,,,2003 NT0V,EN08OC,,,,,,2003 NT0Z,FN31,,,,,,2003 -NT4P,EM95KF,,,Scott,,,2004 +NT4P,EM95KF,,,,,,2004 NU5O,EM55,,,,,,2003 NU7Z,CN87RT,,,,,,1993 -NU8I,DM43AN,,,Alf,,144: IC706 1KW,01/99 +NU8I,DM43AN,,,,,144: IC706 1KW,01/99 NV3Z,FM15,,,,,,2003 NW0X,EM40,,,,,,2003 NW7O,DM26,,,,,,2003 -NX2Q,FN20WV,,,Al,,,2003 +NX2Q,FN20WV,,,,,,2003 NX7U,DM43DI,,,,,,2003 -NX8M,EM79PE,,,Bob,,,01/01 +NX8M,EM79PE,,,,,,01/01 NY1E,FN43QP,,,,,,2003 NZ5P,DM95,,,,,,2003 +OA4CVT,FH17KW,EME,,,,144: 15el 160W111,04/06 +OA4O,FH17FV,EME,,,,432: 8m dish 400W,07/05 OD5NJ,KM73TW,,,,,,2003 -OD5RAK,KM74WH,,,Clubstation,,50: 6el - 144: 17el+ PADTR,05/98 -OE1MSB,JN88DF,,,Michael,,,10/03 -OE1SOW,JN88FF,EME,,Othmar,,HF:100/600W 4el FD4 vertical- 50: 100W 5el -,09/03 -OE1XVC,JN88ED,,,OP OE3KLU,,144: 2x11el- 432: 2x21el gd Pwr.145.370,03/98 -OE3CEW,JN88,,,e.,,,1988 -OE3FVU,JN78VE,EME,,Franz,,144: 2x14el 5WL 1KW MGF1302 - 432 MHz 1x13W,09/03 -OE3HHB,JN87AQ,,,Harald,,FT847 50: 100W 5el - 144: 50W 17el GaAs - 432,07/99 -OE3JPC,JN87EW,EME,,Johannes,,144: 200W 2x15el CF300 - 432: 500W 4x24el (,08/02 -OE3JTB,JN78QN,,,,,144: 15el,03/04 -OE3MWS,JN88DC,,,Manfred (Fred),,50: 100W 7el - 144: TR751 1-2KW 2x17el MGF1,01/05 -OE3NFC,JN88,,,n.,,,1993 -OE3OBC,JN88,EME,,othmar,,,1994 -OE3OKS,JN87AR,,,Wolfgang,,,12/98 -OE3R,JN88FD,,,via OE3KLU,,.180.320,01/96 -OE3SJA,JN88GH,,,Johan,,,04/04 -OE3UP,JN87CT,EME,,hans peter,,,1993 -OE3XAC,JN88FD,,,via OE3KLU,,.180.320,11/96 -OE3XMU,JN78XD,,,Clubstation,,144: 150W 15el,06/02 -OE4KLU,JN87KS,,,Karl,,,01/96 -OE5EFM,JN78,EME,,wolfgang,,,1994 -OE5EYM,JN68SK,EME,,,,,08/98 +OD5RAK,KM74WH,,,Expedition - QSL via F6FLV,,50: 6el - 144: 17el+ PADTR,05/98 +OE1MSB,JN88DF,,,,,,10/03 +OE1SOW,JN88FF,EME,,,,HF:100/600W 4el FD4 vertical- 50: 100W 5el -,09/03 +OE1XVC,JN88ED,,,,,144: 2x11el- 432: 2x21el gd Pwr.145.370,03/98 +OE3CEW,JN88,,,,,,1988 +OE3DXA,JN88FD,,,,,144: 13el 400W,04/06 +OE3FVU,JN78VE,EME,,= PE0WGA,,144: 2x14el 5WL 1500W MGF1302 - 432 MHz 1x1,11/05 +OE3HHB,JN87AQ,,,,,FT847 50: 100W 5el - 144: 50W 17el GaAs - 432,07/99 +OE3JPC,JN87EW,EME,,,,144: 200W 2x15el CF300 - 432: 500W 4x24el (,08/02 +OE3JTB,JN78QN,,,,,144: 17B2 160W,08/05 +OE3MWS,JN88DC,,,,,50: 100W 7el - 144: TR751 1-2KW 2x17el MGF1,01/05 +OE3NFC,JN88,,,,,,1993 +OE3OKS,JN87AR,,,,,,12/98 +OE3R,JN88FD,,,Contest Call,,.180.320,01/96 +OE3SJA,JN88GH,,,=OE1SJA,,,04/04 +OE3UP,JN87CT,EME,,,,,1993 +OE3XAC,JN88FD,,,,,.180.320,11/96 +OE3XMU,JN78XD,,,,,144: 150W 15el,06/02 +OE4KLU,JN87KS,,,,,,01/96 OE5FD,JN68SC,,,,,,2003 -OE5FDM,JN68SC,,,Daniel,,50: FT-847 5el-Yagi 100W - 144: FT-847 9el 10,08/02 -OE5JFL,JN68RL,EME,,hannes,,,1994 -OE5KE,JN78,,,Adolf,,,05/02 -OE5MPL,JN78CJ,EME,,Peter,,FT-847 - 50: 2xGI7BT 100W 5el 144: 2x,01/05 -OE5VHL,JN68SI,EME,,walter,,,1994 +OE5FDM,JN68SC,,,,,50: FT-847 5el-Yagi 100W - 144: FT-847 9el 10,08/02 +OE5KE,JN78,,,,,,05/02 +OE5MPL,JN78CJ,EME,,,,FT847 - 50: 2xGI7BT 100W 5el 144: 2x 4,04/06 OE5VRL,JN78DK,,,,,,01/97 -OE6AHD,JN76RS,,,Freddy,,,12/95 -OE6BMG,JN77JE,,,Manfred,,,07/00 -OE6IWG,JN77PK,EME,,A.Walter ""Walt",,144: GS35b 4x10el (2-2wl) MGF1302087 4000 D,01/05 -OE6JGD,JN77QC,,,Josef,,,12/95 -OE6KDG,JN77JF,,,,,,03/07 -OE6NLD,JN76SS,,,norbert,,,1993 -OE6XHF,JN76RS,EME,,clubstation,,,1994 -OE75SOW,JN88FF,EME,,Othmar,,50: IC736 100W 5el - 144: IC821H 300W 2x13el,03/01 +OE6AHD,JN76RS,,,,,,12/95 +OE6BMG,JN77JE,,,,,,07/00 +OE6IWG,JN77PK,EME,,,,144: GS35b 4x10el (2-2wl) MGF1302087 4000 D,06/05 +OE6JGD,JN77QC,,,,,,12/95 +OE6KDG,JN77JF,,,,,,07/03 +OE6NLD,JN76SS,,,,,,1993 +OE6RKE,JN76OT,EME,,,,,03/06 +OE6XHF,JN76RS,EME,,,,,1994 +OE75SOW,JN88FF,EME,,SpecialCall,,50: IC736 100W 5el - 144: IC821H 300W 2x13el,03/01 OE8CIQ,JN76FU,,,,,,08/02 -OE8HBQ,JN76KP,,,Harry,,,05/04 -OE8HWQ,JN76,,,helmut,,,03/00 -OE8OLK,JN76DM,,,Schoash,,144: FT817 30W 6el,07/04 -OE9ERC,JN47VL,EME,,Erich,,,02/05 -OE9HHV,JN47,EME,,hubert,,,1994 +OE8HBQ,JN76KP,,,,,,05/04 +OE8HWQ,JN76,,,,,,03/00 +OE8OLK,JN76DM,,,,,144: FT817 30W 6el,07/04 OE9XXI,JN47UL,,,,,,2003 -OF8UV,KP34VJ,EME,,Markku,,144: Ft225RD 130W 2x14el BF981.122 DTR,11/97 -OG6MAZ,KP21IG,,,Hannu,,144: FT767GX 4CX350 200W 15el.147 DTR,01/00 -OG8HDL,KP34VJ,,,Tanja,,144: 130W 2x14el BF981.121.300,01/00 -OG8UV,KP34VJ,EME,,Markku,,144: FT225RD 130W 2x14el BF981.121 DTR.30,01/00 -OH0BT,KO09KW,,,,,,1992 -OH0JFB,JP90XI,,,Peter,,144: 2x17el 800W,04/04 -OH0LIZ,KO09KW,,,OP OH5YW- OH5LIZ,,144: 180W 2x23el.127 1500lpm DTR,05/98 -OH0N,KP00,,,OP: DK5DQ DJ2QV...,,,07/01 -OH0V,KP00,,,OP: DK5DQ DJ2QV...,,,07/01 -OH1AK,KP01TE,,,OP: OH1HJN,,,12/03 +OF8UV,KP34VJ,EME,,SpecialCall,,144: Ft225RD 130W 2x14el BF981.122 DTR,11/97 +OG6MAZ,KP21IG,,,SpecialCall,,144: FT767GX 4CX350 200W 15el.147 DTR,01/00 +OG8HDL,KP34VJ,,,Special Call,,144: 130W 2x14el BF981.121.300,01/00 +OG8UV,KP34VJ,EME,,SpecialCall,,144: FT225RD 130W 2x14el BF981.121 DTR.30,01/00 +OH0/SM5HJZ,JP90VJ,,,Expedition,,,08/05 +OH0BT,KO09KW,,,Expedition,,,1992 +OH0JFB,JP90XI,,,,,144: 2x17el 800W,04/04 +OH0LIZ,KO09KW,,,Expedition,,144: 180W 2x23el.127 1500lpm DTR,05/98 +OH0N,KP00,,,Expedition,,,07/01 +OH0V,KP00,,,Expedition,,,07/01 +OH1AK,KP01TE,,,,,,12/03 OH1AYQ,KP12JB,,,,,,08/98 -OH1BAP,KP12AA,,,,,,1991 +OH1BAP,KP12AA,,,Expedition,,,1991 OH1CF,KP00TC,,,,,,1994 -OH1FA,KP10PL,EME,,Kai,,,10/02 -OH1HSC,KP10CM,,,Olavi,,144: TR9130 60W MGF1302 17elonly SSB MS,01/01 -OH1JCS,KP10AE,EME,,Jojje,,144: 15el 20W,01/05 -OH1JJC,KP10DK,,,Matti,,,01/04 -OH1LEU,KP01UE,,,Tuomo,,50: 150W 8el,09/03 -OH1LSQ,KP03SD,,,Paul,,144: 100W ant-3WL,01/02 -OH1MDR,KP01VJ,,,Timo,,144: IC-706 100W 15el,01/04 +OH1FA,KP10PL,EME,,,,,10/02 +OH1HSC,KP10CM,,,,,144: TR9130 60W MGF1302 17elonly SSB MS,01/01 +OH1JCS,KP10AE,EME,,,,144: 2x 10el 20W,03/05 +OH1JJC,KP10DK,,,,,,01/04 +OH1LEU,KP01UE,,,,,50: 150W 8el,09/03 +OH1LSQ,KP03SD,,,,,144: 100W ant-3WL,01/02 +OH1MDR,KP01VJ,,,,,144: IC-706 100W 15el,01/04 +OH1ND,KP00XL,,,,,, +OH1NOR,KP00XL,EME,,,,144: 2x 3.9wl antennas,04/05 OH1QC,KP10MU,,,,,,1989 -OH1XT,KP01UK,,,Jari,,FT736r 50: 8el 150W - 144: 300W 2x15el MG,11/01 +OH1XT,KP01UK,,,,,FT736r 50: 8el 150W - 144: 300W 2x15el MG,11/01 OH1XTK,KP01UK,,,,,,2003 -OH1ZAA,KP01,,,jan,,,1995 -OH2AUK,KO19TX,,,jan anders,,,1994 -OH2AV,KP20JD,,,yussi,,,1994 -OH2AXH,KP20OK,EME,,OP: OH2AUE,,,08/00 -OH2BAP,KP20PP,EME,,jyrki,,.138,1993 -OH2BNH,KP20LG,EME,,Pasi,,,05/00 -OH2BYJ,KP20MG,,,Jari,,144: IC821h 4x15el3000lpm,07/00 -OH2DG,KP30CK,EME,,eino,,,1994 -OH2JRR,KP10WE,,,,,,10/03 -OH2KKP,KP20MH,,,Tuomas,,,11/95 -OH2LAK,KP10XL,,,Erik,,50: FT847 FT817.130,11/01 -OH2MFE,KP20JE,,,Markus,,IC-575H IC-275E 170W FT-817 100W FT-73,04/02 +OH1ZAA,KP01,,,,,,1995 +OH2AUK,KO19TX,,,,,,1994 +OH2AV,KP20JD,,,ex OH9NLO,,,1994 +OH2BAP,KP20PP,EME,,,,.138,1993 +OH2BC,KP20,EME,,,,,03/05 +OH2BNH,KP20LG,EME,,,,,05/00 +OH2BYJ,KP10QO,,,,,144: :IC290D ANT 21EL YAGI 9.6M,04/06 +OH2DG,KP30CK,EME,,,,DISH 8m,03/06 +OH2HEJ,KP20ME,,,,,144: 4el 100W,08/05 +OH2JRR,KP20HE,,,,,,10/05 +OH2JRR/p,KP10WE,,,,,,10/05 +OH2KKP,KP20MH,,,,,,11/95 +OH2LAK,KP10XL,,,,,50: FT847 FT817.130,11/01 +OH2MFE,KP20JE,,,,,IC-575H IC-275E 170W FT-817 100W FT-73,04/02 OH2MOH,KP30CR,,,,,,05/04 -OH2MPH,KP20KD,,,Antti,,,01/04 -OH2NHP,KP20IF,,,Timo,,144: IC970E 3CX800 MGF1302 preamp 2x15elrx,01/01 -OH2NY,KP20CM,,,Juha,,144: IC202 RE035XB 320W Preamp 4x9el,04/03 -OH2PO,KP10XH,EME,,Matti,,,11/97 -OH2TI,KP20KE,EME,,Clubstation,,,01/01 -OH2Z,KP30CR,,,OP: OH1JJC,,,08/04 -OH3AWW,KP11VJ,EME,,Matti,,144: 150W 9el.137 2000lpm,09/04 -OH3BHL,KP10RR,,,Raimo ""Rami",,IC746+ACOM1000 144: 100W 4x5el - 50: 200W,08/03 +OH2MPH,KP20KD,,,,,,01/04 +OH2NHP,KP20IF,,,,,144: IC970E 3CX800 MGF1302 preamp 2x15elrx,01/01 +OH2NY,KP20CM,,,,,144: IC202 RE035XB 320W Preamp 4x9el,04/03 +OH2TI,KP20KE,EME,,,,,01/01 +OH2Z,KP30CR,,,,,,08/04 +OH3AWW,KP11VJ,EME,,2nd QTH,,144: 150W 9el.137 2000lpm,09/04 +OH3BHL,KP10RR,,,,,IC746+ACOM1000 144: 100W 4x5el - 50: 200W,08/03 OH3BZY,KP10XP,,,,,,1992 OH3EX,KP20JR,,,,,,1994 -OH3KLJ,KP21PI,,,Mika,,144: 15el 100WMSDSP,01/04 +OH3KLJ,KP21PI,,,,,144: 15el 100WMSDSP,01/04 OH3KLT,KP21PI,,,,,,12/01 -OH3LPW,KP11WK,EME,,ari,,,1994 -OH3NWQ,KP11WL,,,Vesa,,50: FT847 100W220 2000lpm,08/02 -OH3VJ,KP21,,,,,,1994 -OH3XR,KP11TH,,,Marko,,IC746,08/04 -OH4EA,KP32MG,,,Vesa,,144: FT225RD 4CX250b 2x19el MGF1302/ATF10136M,11/04 -OH4GGW,KP31PQ,,,Kimmo,,,12/04 -OH4HXK,KP21UM,,,Seppo,,,05/02 -OH5A,KP53NE,,,OP OH5LZY,,,09/99 +OH3KRH,KP21EB,,,,,,12/05 +OH3NWQ,KP11WL,,,,,50: FT847 100W220 2000lpm,08/02 +OH3UW,KP21FA,EME,,,,144: 2x 17el 250W,04/06 +OH3VJ,KP21,,,Silent Key,,,1994 +OH3XR,KP11TH,,,=OH9XX,,IC746,08/04 +OH4EA,KP32MG,,,not qrv now 11/04,,144: FT225RD 4CX250b 2x19el MGF1302/ATF10136M,11/04 +OH4GGW,KP31PQ,,,,,,12/04 +OH4HXK,KP21UM,,,,,,05/02 +OH4LA,KP20LG,EME,,,,144: 4x 17el 600W,03/06 +OH5A,KP53NE,,,,,,09/99 OH5AG,KP31,,,,,,02/98 -OH5HCJ,KP41EC,,,Matti,,,11/04 -OH5IY,KP30HV,EME,,Ilkka,,144: 1KW 4x15el - 432: 750W 8x21elDTR+ 3000l,12/03 -OH5KJQ,KP41JC,,,Matti,,FT847 144: 19el yagi 160W - 50: 4el 100WDTR,10/98 -OH5LID,KP41KL,,,Janne,,144: IC706 150W 2x19el120 2000 DTR.300,04/02 -OH5LIZ,KP30HW,,,OP OH5YW,,144: 180W- 2x23el.127 DTR,08/01 -OH5LK,KP30ON,EME,,Jussi,,144: 1KW 4x15el,04/04 -OH5YW,KP30FU,,,Kari,,,05/98 -OH6AA,KP03TC,,,Club OP OH6GDX,,144: 2x12el,06/03 -OH6AAO,KP14,,,,,,1993 -OH6AI,KP13MW,,,Clubstation,,only SSB-MS,11/00 +OH5HCJ,KP41EC,EME,,,,144: 4x 11el,04/05 +OH5HMV,KP41EC,EME,,,,,04/05 +OH5IY,KP30HV,EME,,,,144: 1KW 4x15el - 432: 750W 8x21elDTR+ 3000l,12/03 +OH5KJQ,KP41JC,,,,,FT847 144: 19el yagi 160W - 50: 4el 100WDTR,10/98 +OH5KNG,KP30GU,EME,,,,144: 4x 9el yagis 1.2kw,03/06 +OH5LID,KP41KL,,,ex OH5LZY,,144: IC706 150W 2x19el120 2000 DTR.300,04/02 +OH5LIZ,KP30HW,,,Expedition,,144: 180W- 2x23el.127 DTR,08/01 +OH5LK,KP30ON,EME,,,,144: 1KW 4x15el,04/04 +OH5YW,KP30FU,,,,,,05/98 +OH6A/9,KP27JT,,,Expedition,,,02/05 +OH6AA,KP03SD,,,,,144: 2x12el,12/05 +OH6AAO,KP14,,,Expedition,,,1993 +OH6AI,KP13MW,,,,,only SSB-MS,11/00 OH6AW,KP03,,,,,3000lpm,06/02 -OH6DD,KP22,EME,,jukka,,,1994 -OH6GDX,KP02QU,,,Patrik,,144: 60W 2x12el CueDee,08/03 -OH6HFX,KP14RA,,,Johannes,,FT847 400W 2x12el172224,02/03 -OH6JKW,KP02RN,,,Kurt,,FT847,01/05 -OH6JW,KP12AJ,EME,,Aulis,,FT847 IC7400 600WMSDSP DTR,09/03 -OH6KTL,KP02OJ,,,Lasse,,50: 6el 150W - 144: FT847+GI46B 4x15el 100WM,12/04 +OH6DD,KP22,EME,,qrv only at OH2TI,,,1994 +OH6GDX,KP02QU,,,,,144: 60W 2x12el CueDee,08/03 +OH6HFX,KP14RA,,,,,FT847 400W 2x12el172224,02/03 +OH6JKW,KP02RN,,,,,FT847,08/05 +OH6JW,KP12AJ,EME,,ex OH6MPC,,FT847 IC7400 600WMSDSP DTR,09/03 +OH6KTL,KP02OJ,EME,,,,50: 6el 150W - 144: FT847+GI46B 4x15el 100WM,05/06 OH6LRL,KP13,,,,,only SSB-MS,11/00 OH6M,KP12KR,,,,,,06/04 -OH6MAZ,KP21IG,EME,,Hannu,,144: FT847 4CX350 250W 2x15el MGF1302155 3000,12/04 -OH6MPC,KP12AJ,,,Aulis,,FT847 50: 200W - 144: 2KW - 432: 250W4000lpm,01/02 +OH6MAZ,KP21IG,EME,,ex OH2MAZ,,144: FT847 4CX350 250W 2x15el MGF1302155 3000,12/04 +OH6MPC,KP12AJ,,,= OH6JW,,FT847 50: 200W - 144: 2KW - 432: 250W4000lpm,01/02 OH6MRD,KP12EP,,,,,,12/02 OH6MSZ,KP21XU,,,,,,08/99 -OH6NDD,KP23VH,,,Taavi,,,1994 -OH6NVQ,KP13IP,EME,,tomas,,,01/97 -OH6PA,KP02PL,,,Ben,,,08/04 -OH6QU,KP03SD,,,Jari,,RX: FT-1000MP DB6NT transverter TR 144 H pre,07/04 +OH6MW,KP20IM,,,,,144: 200W 11el,08/05 +OH6NDD,KP23VH,,,Expedition,,,1994 +OH6NVQ,KP13IP,EME,,,,,02/05 +OH6PA,KP02PL,,,,,,08/04 +OH6QU,KP03SD,,,,,FT-1000MP + Kuhne TR 144 H + GU-78B 16 el (4,09/05 OH6UW,KP22WH,,,,,,01/05 -OH6XX,KP22VE,,,Juha,,144: FT1000MP LT2S 120W 15el MGF1302.147,11/01 -OH6YF,KP02VL,,,Harry,,50: FT-847 PA 7el - 144: FT-847 PA 4x12el300,03/04 -OH6ZZ,KP12BO,EME,,Juho ""Jussi",,TS790E,02/04 -OH7AXB,KP32WM,,,,,,11/02 -OH7EU,KP33MQ,,,Jorma,,,95 -OH7HXH,KP53HG,,,Kari,,144: 50W,04/04 -OH7LIX,KP43JQ,,,Raija,,only SSB-MS,09/95 -OH7MA,KP52EL,,,Dan,,144: 4 x 10el1000lpm,11/99 -OH7PI,KP32XG,EME,,Toivo,,,01/05 -OH7RJ,KP32TV,,,Pena,,,08/02 -OH7TE,KP20IE,,,Juhani ""Yussi",,50: 200W - 144: 4el 300W - 1296: 10W - 5600:,12/04 -OH7TX,KP32TR,,,Jorma,,144: FT847 50W 20el365,04/04 -OH7UV,KP33MQ,,,Markku,,.121 DTR.300,07/95 +OH6YF,KP02VL,EME,,also OH0MYF,,50: FT-847 PA 7el - 144: FT-847 PA 4x12el300,04/05 +OH6ZZ,KP12BO,EME,,,,TS790E,02/04 +OH7AXB,KP32WH,,,,,,10/05 +OH7EU,KP33MQ,,,,,,95 +OH7HXH,KP53HG,,,,,144: 50W,04/04 +OH7LIX,KP43JQ,,,,,only SSB-MS,09/95 +OH7MA,KP52EL,,,,,144: 4 x 10el1000lpm,11/99 +OH7PI,KP32XG,EME,,,,,01/05 +OH7PI/P,KP42HF,EME,,,,144:,04/05 +OH7RJ,KP32TV,,,,,,08/02 +OH7TE,KP20IE,,,ex OH9NLO,,50: 200W - 144: 4el 300W - 1296: 10W - 5600:,10/05 +OH7TX,KP32UV,,,,,144: FT847 50W 20el365,07/05 +OH7UV,KP33MQ,,,,,.121 DTR.300,07/95 OH8GEJ,KP25QC,,,,,,05/02 -OH8HDL,KP34VJ,,,Tanja,,144: 130W 2x14el BF981.121.300,08/99 -OH8K,KP44HE,EME,,Sotkamo Clubstation,,IC7400 gd power 15el 16el 37el loop147 50,05/04 -OH8LRB,KP24HQ,,,Tomi,,144: 200W 8el,11/04 -OH8MFH,KP34UG,,,Kari,,144: TR751A 15el 6WUonly SSB-MS,01/00 -OH8N,KP34VJ,,,OP DH3YAK- 8UV- 8HDL,,,12/98 -OH8NW,KP24SX,,,Kaar,,,1985 -OH8NXE,KP25SB,,,Antti,,144: TM255E Preamp 160W 2x14el,01/02 -OH8SW,KP22UP,,,Hannu,,,11/04 -OH8UV,KP34VJ,EME,,Markku,,144: FT225RD 350W 4CX250R 2x14el BF981121,12/03 -OH8VJ,KP22UN,,,Pentti,,,11/04 -OH9AB,KP46BI,,,Clubstation,,,1994 -OH9AEM,KN08AJ,,,,,,1993 -OH9MNO,KP46BI,,,,,,1991 -OH9MTE,KP46BI,,,Yussi,,,07/99 -OH9MTY,KP46BI,,,Erkki,,FT847 - 144: 700W 6x9el136 3000lpm MSDSP,06/04 -OH9NDD,KP26UM,,,Taavi,,FT847 144: 150W 4x15el preamp,08/03 +OH8HDL,KP34VJ,,,,,144: 130W 2x14el BF981.121.300,08/99 +OH8HTG,KP34DI,,,,,144: 14el 80W,08/05 +OH8K,KP44HE,EME,,QSL via OH8MSM,,IC7400 gd power 15el 16el 37el loop147 50,05/04 +OH8K/p,KP11KX,,,QSL via OH8MSM,,FT847 3CX800A7 ant 1x15 el147355,04/06 +OH8MFH,KP34UG,,,NO MS Skeds!,,144: TR751A 15el 6WUonly SSB-MS,01/00 +OH8N,KP34VJ,,,Expedition - QSL via OH8UV,,,12/98 +OH8NW,KP24SX,,,,,,1985 +OH8NXE,KP25SB,,,,,144: TM255E Preamp 160W 2x14el,01/02 +OH8R,KP24HQ,,,ex OH8LBR,,144: 200W 8el,04/05 +OH8SW,KP22UP,,,,,,11/04 +OH8UV,KP34VJ,EME,,,,144: FT225RD 350W 4CX250R 2x14el BF981121,12/03 +OH8VJ,KP22UN,,,,,,11/04 +OH9AB,KP26,,,not qrv now,,,10/05 +OH9AEM,KN08AJ,,,Expedition,,,1993 +OH9GDT,KP26VL,,,,,144: 4 Yagis,04/06 +OH9MNO,KP46BI,,,Expedition,,,1991 +OH9MTY,KP46BI,,,Expedition,,FT847 - 144: 700W 6x9el136 3000lpm MSDSP,06/04 +OH9NDD,KP26UM,,,,,FT847 144: 150W 4x15el preamp,08/03 OH9NMS,KP36GA,EME,,,,,1994 -OH9O,KP12BO,EME,,Sotkamo Clubstation,,IC7400 gd power 15el 16el 37el loop147 50,05/04 -OH9SCL,KP46BI,EME,,Clubstation,,TR751/FT847 144: 6x9el LY 700W.136,06/01 -OI7UV,KP33MQ,,,Markku,,,12/95 -OI8UV,KP34VJ,EME,,Markku,,144: Ft225RD 130W 2x14el BF981.122 DTR,01/97 +OH9O,KP12BO,EME,,QSL via OH8MSM,,IC7400 gd power 15el 16el 37el loop 50,05/04 +OH9SCL,KP46BI,EME,,Expedition,,TR751/FT847 144: 6x9el LY 700W.136,06/01 +OI7UV,KP33MQ,,,Specialcall,,,12/95 +OI8UV,KP34VJ,EME,,Speciallcall,,144: Ft225RD 130W 2x14el BF981.122 DTR,01/97 OK1AXH,JO70UR,,,,,,01/97 -OK1CA,JO70GM,EME,,f.,,,1994 -OK1CDJ,JO70VA,,,Ondrej ""Ondra",,144: 250W 17el MGF1302.115 4000lpm.300,01/00 -OK1CT,JN69TR,,,Milos,,144: 250W 2x16el CF300 - 50: 20W 5el.139,05/00 -OK1DCF,JO80BJ,,,Lada,,,04/02 -OK1DDO,JO60JD,,,Jirka ""Jiri",,IC706- 144: 150W 7el- 50: 100W 5el1000lpm,06/02 -OK1DFC,JN79GW,EME,,Zdenek ""Zdeno",,144: 750W 18elM2 10m dish - 432: 750W 38elM2,01/05 -OK1DIG,JO60XJ,EME,,Daniel ""Dan",,144: 4x17el M2 GS35 1.5KW MGF1302177377,04/02 -OK1DKZ,JN69XP,,,Vlada,,144: IC275H 100W MGF1302 11el4000lpm MSDSP,11/01 +OK1CA,JO70GM,EME,,,,,1994 +OK1CDJ,JO70VA,,,,,144: 250W 17el MGF1302.115 4000lpm.300,01/00 +OK1COM,JN79GX,,,,,,2003 +OK1CT,JN69TR,,,ex OK1URY,,144: 250W 2x16el CF300 - 50: 20W 5el.139,05/00 +OK1DCF,JO80BJ,,,,,,04/02 +OK1DFC,JN79GW,EME,,,,144: 750W 18elM2 10m dish - 432: 750W 38elM2,08/05 +OK1DIG,JO60XJ,EME,,,,144: 4x17el M2 GS35 1.5KW MGF1302177377,04/02 +OK1DKZ,JN69XP,,,,,144: IC275H 100W MGF1302 11el4000lpm MSDSP,11/01 +OK1DO,JO60JD,,,ex OK1DDO,,IC7400 144: 150W 7el 50: 100W 5el1000lpm,03/06 OK1DQA,JO60TC,,,,,,08/99 OK1DRY,JN79OW,,,,,,07/02 -OK1DTC,JO60TO,,,Tony,,,08/03 -OK1DUO,JO80CA,,,Jaroslav ""Jarda",,HF: TS120S 500W 3el - 144: IC746 PA0MS ant,08/01 +OK1DTC,JO60TO,,,,,,08/03 +OK1DUO,JO80CA,,,,,HF: TS120S 500W 3el - 144: IC746 PA0MS ant,08/01 OK1FAV,JO60CK,,,,,,01/97 +OK1FD,JO60CF,EME,,ex OK1FFD,,50: IC706 5el QUAD - 144: 300W 4CX250 10el 7,04/06 OK1FF,JN78GR,EME,,,,,1995 -OK1FFD,JO60CF,,,Vasek,,50: 5el QUAD- 144: 350W 10el Quagi,08/02 -OK1FID,JO80CH,,,Jiri,,144: Racom R2-CW 100Watts 13ele DL6WU050.30,08/01 -OK1FM,JN69QQ,,,Milan,,144: 250W 17el MGF1302DTR 3000lpm,11/02 -OK1FXX,JO70WL,,,Beda,,144: TS790E 2xGI7B 3KW 4x17el F9FT 0-4db NF -, +OK1FID,JO80CH,,,,,144: Racom R2-CW 100Watts 13ele DL6WU050.30,08/01 +OK1FM,JN69QQ,,,not qrv MS now! (01/01),,144: 250W 17el MGF1302DTR 3000lpm,11/02 +OK1FXX,JO70WL,,,,,144: TS790E 2xGI7B 3KW 4x17el F9FT 0-4db NF -, OK1FZA,JO70FC,,,,,,1992 OK1HAG,JN79,,,,,,01/97 OK1IBL,JO60CG,,,,,,1991 +OK1IN,JO60XA,EME,,ex OK1UND,,TS515 FT221 144: 16el 100W Preamp,02/06 OK1KEI,JO60JL,,,,,,01/97 -OK1KF,JO60TG,EME,,Vaclav,,TS790 FT847 144: 1KW 2x17el M2 or 4xKLM16LBX.,08/02 -OK1KHI,JO70ED,,,S.,,,05/02 -OK1KIR,JN79,EME,,clubstation,,,1994 -OK1KJB,JN79IO,,,Clubstation,,,08/99 +OK1KF,JO60TG,EME,,,,TS790 FT847 144: 1KW 2x17el M2 or 4xKLM16LBX.,08/02 +OK1KHI,JO70ED,,,,,,05/02 +OK1KJB,JN79IO,,,,,,08/99 OK1KKH,JN79,,,,,,1993 -OK1KRQ,JN69QR,EME,,OP OK1MZM- OK1XST,,144: 400W 17el M2 CF300,10/99 -OK1KRY,JN69TR,,,Clubstation Rokycany,,50: 20W 5el - 144: 250W 2x16el CF300.139,05/00 -OK1KT,JO70WE,,,Vrata,,FT 847 - 50: 20W 5 el - 144: 600 W 15 el Cu,06/04 -OK1MAC,JN79IO,,,Jan,,,01/03 -OK1MDK,JN79PX,,,J.,,,08/02 -OK1MZM,JN69PR,,,Milos,,144: 300W 9el 360m asl,06/04 +OK1KRQ,JN69QR,EME,,,,144: 400W 17el M2 CF300,10/99 +OK1KRY,JN69TR,,,,,50: 20W 5el - 144: 250W 2x16el CF300.139,04/05 +OK1KT,JO70WE,,,,,FT 847 - 50: 20W 5 el - 144: 600 W 15 el Cu,06/04 +OK1MAC,JN79IO,,,,,,01/03 +OK1MDK,JN79PX,,,,,,08/02 +OK1MZM,JN69PR,,,,,144: 300W 9el 360m asl,06/04 OK1NH,JN69UH,,,,,144: 10el 20W,05/04 -OK1TEH,JO70FD,,,Matej,,144: FT847 100W 6el - 432: 50W 22el K1FO,11/04 -OK1UAK,JO70MB,,,Petr,,144: 100W 10el preamp160 4000 MSDSP.160,01/05 -OK1UGA,JO80DD,,,Clubstation,,IC821H 144: 100W 7el Quad - 432: DJ9BV Ant,12/03 -OK1UND,JO60XA,EME,,Petr,,TS515 FT221 144: 16el 100W Preamp,11/04 -OK1UWA,JN69QT,EME,,Josef,,1296: par 2.4m 180W 0-45db NF,08/00 +OK1RK,JO70KD,EME,,,,144: FT847 250W 10el DK7ZB,08/05 +OK1TEH,JO70FD,EME,,,,144: FT847 100W 106el - 432: 500W 23el K1FO,09/05 +OK1UAK,JO70MB,,,,,144: 100W 10el preamp160 4000 MSDSP160,09/05 +OK1UGA,JO80DD,,,,,IC821H 144: 100W 7el Quad - 432: DJ9BV Ant,12/03 OK1VBN,JN78,,,,,,01/97 -OK1VEI,JO70UR,,,,,,01/97 -OK1VHF,JO70EB,,,Miloslav ""Milan",,144: 10ml M2 1200W - 432: 6m Tonna 600W - 129,01/04 +OK1VHF,JO70EB,,,,,144: 10ml M2 1200W - 432: 6m Tonna 600W - 129,01/05 OK1VHH,JO70CK,,,,,144: 20W,04/02 -OK1VKC,JN79OW,,,Josef,,,05/02 -OK1VSC,JN79OW,,,Josef,,144: 100W 7el Quad,03/02 +OK1VKC,JN79OW,,,,,,05/02 +OK1VSC,JN79OW,,,,,144: 100W 7el Quad,03/02 OK1VT,JN79IX,,,,,,07/01 -OK1WCF,JO80BJ,,,Martin,,144: R2CW PA 100W 2x 16el F9FT300 / 370,04/04 -OK1WN,JN69LK,,,Standa,,144: 100W 16el CF300,10/01 -OK1XXT,JO70GA,,,Roman,,,04/02 -OK1YA,JN79IO,,,Premysl ""Mek",,144: 1000Watt 4x13ele4000lpm,10/01 -OK1YK,JN78GX,EME,,Jaromir ""Mira",,FT 847 144: 1kW 13el MGF1302 - 432: 1kW 5m,12/04 +OK1WCF,JO80BJ,,,,,144: R2CW PA 100W 2x 16el F9FT300 / 370,04/04 +OK1WN,JN69LK,,,,,144: 100W 16el CF300,10/01 +OK1XXT,JO70GA,,,,,,04/02 +OK1YA,JO70GC,EME,,,,144: 4x 11el 1500W4000 lpm,03/06 +OK1YA/p,JN79IO,,,,,144: 1000Watt 4x13ele4000lpm,03/06 +OK1YK,JN78GX,EME,,ex OK1AYK,,FT 847 144: 750W 4x 17el MGF1302 - 432: 1k,05/06 OK2AB,JN89TI,,,,,,12/03 +OK2BDS,JN79WF,,,,,144: BMT226 100W 10el.7ZB - 432:IC706MKIIG 10,04/06 +OK2BMU,JN99BU,,,ex OL7AVX,,TM255E/TM455E + PA 150W 144: 13 el 432:,07/05 OK2BON,JO70,,,,,,07/02 -OK2BRD,JN99ET,,,Jirka,,IC706MKIIG,08/03 -OK2BXE,JN89SJ,,,Draho,,144: FT847 100W 16el MGF1302 - 10368: 1.5W Di,07/01 -OK2DL,JN89AO,EME,,Mark,,,06/02 +OK2BRD,JN99ET,,,,,IC706MKIIG,08/03 +OK2BXE,JN89SJ,,,,,144: FT847 100W 16el MGF1302 - 10368: 1.5W Di,07/01 +OK2DL,JN89AO,EME,,,,,06/02 OK2KET,JN89JN,,,,,,03/01 OK2KUB,JN89,,,,,,1993 -OK2KZR,JN89BO,EME,,rudi,,,1993 -OK2MWR,JN99HQ,,,Alex,,144: IC706 100W 14el PBM1200lpm,08/00 -OK2PM,JN99AO,,,Karel,,IC706 FT736,08/03 -OK2PMG,JN89SJ,,,Milos,,144: FT847 100W 16el MGF1302 - 10368: 1.5W Di,07/01 -OK2PMS,JN89WW,,,Jirka,,BMT226 13el F9FT,01/03 -OK2PMX,JN88IW,,,Petr,,IC706,04/04 -OK2POI,JN99bl,EME,, +OK2KZR,JN89BO,EME,,,,,1993 +OK2MWR,JN99HQ,,,,,144: IC706 100W 14el PBM1200lpm,08/00 +OK2PM,JN99AO,,,ex OK2BGQ,,IC706 FT736,08/03 +OK2PMG,JN89SJ,,,,,144: FT847 100W 16el MGF1302 - 10368: 1.5W Di,07/01 +OK2PMS,JN89WW,,,,,BMT226 13el F9FT,01/03 +OK2PMX,JN88IW,,,,,IC706,04/04 OK2PTC,JN89MM,,,,,,08/04 OK2PWY,JN89IW,,,,,,11/04 OK2PZW,JN89HI,,,,,,2003 OK2QI,JO80OC,,,,,,1995 -OK2SBL,JN99HQ,,,Josef,,1200lpm,08/00 +OK2SBL,JN99HQ,,,,,1200lpm,08/00 OK2SGY,JN89SS,,,,,,08/96 -OK2SLC,JN89ED,,,Slavek,,,03/04 -OK2UGG,JN89EN,,,Jirka,,,12/01 +OK2SLC,JN89ED,,,,,,04/05 +OK2TUH,JN89RB,EME,,,,144: 7el 200W,03/06 +OK2UGG,JN89EN,,,,,,12/01 +OK2UZL,JN79UG,EME,,,,144: 4x 9el 50W,12/05 OK2VMD,JN89HI,,,,,,1994 +OK2VSO,JN99AJ,EME,,,,,03/06 OK2WO,JN89IH,,,,,,04/04 OK2XPJ,JN89,,,,,,04/02 -OK2YT,JN88IW,,,Radek,,,04/04 -OK2ZAW,JN89BI,EME,,Jan,,,08/04 -OK2ZW,JN89HI,,,Zdeno,,,08/02 -OK2ZZ,JN89DF,,,Rudi,,,08/96 -OK5ACR,JO60NX,,,Vita,,,05/00 -OK8BXF,JO70VA,,,Gavin,,,06/04 +OK2YT,JN88IW,,,,,,04/04 +OK2ZAW,JN79XN,EME,,,,144: IC-706 12el ZZ212 300W GI7bt,02/05 +OK2ZW,JN89HI,,,ex OK2PZW,,,08/02 +OK2ZZ,JN89DF,,,,,,08/96 +OK5ACR,JO60NX,,,,,,05/00 +OK8BXF,JO70VA,,,,,,06/04 OL2O,JN79IO,,,,,4000lpm,12/01 OL5MS,JN69MJ,,,,,,08/99 -OM2TW,JN88UG,,,Richard,,144: IC746 17el LY.050.300,07/01 -OM3AU,KN08OR,,,Andrej,,,1993 -OM3KDX,KN19DB,,,,,144: IC-746 GS35b 4x6 el. 18el. M2 - 10368,06/04 -OM3KMY,JN88MK,,,Clubstation,,,1994 -OM3LQ,JN88MK,,,palo,,,08/01 +OM2TW,JN88UG,,,,,144: IC746 17el LY.050.300,07/01 +OM3AU,KN08OR,,,Silent Key,,,1993 +OM3KDX,KN19DB,,,Expedition,,144: IC-746 GS35b 4x6 el. 18el. M2 - 10368,06/04 +OM3KKF,JN88MD,,,,,144: 700W 13el,07/05 +OM3KMY,JN88MK,,,ex OK3KMY,,,1994 +OM3LQ,JN88MK,,,ex OK3LQ,,,08/01 OM3TZZ,JN88,,,,,,08/02 -OM3WBC,JN98VG,,,Joe,,,08/02 +OM3WBC,JN98VG,EME,,,,144: 500W 2x 17el,07/05 OM4EX,JN98HS,,,,,,07/04 -OM5CM,JN98DF,,,Palo,,IC-910H 144 MHz: 100W 9el - 432 MHz: 70W 18e,04/04 -OM5KM,JN98AH,,,Milan,,only SSB-MS,01/02 +OM5CM,JN98DF,,,ex OM3YCM,,IC-910H 144 MHz: 100W 9el - 432 MHz: 70W 18e,04/04 +OM5KM,JN98AH,,,,,only SSB-MS,01/02 OM5UM,JN98EO,,,,,,04/02 -OM7AC,JN98NN,,,Igor,,FT225RD FT780 Transverter home made 145/28,01/03 -OM7AQ,JN98UI,EME,,Zoltan (Zoli),,144: FT290r 450W 13el F9FT MGF1302 - 432:,08/03 -OM7CM,JN98NR,,,Milan,,,08/04 -OM7JG,JN98TI,,,Julo,,,01/02 -OM9AAW,JN98EP,,,DF8AA,,,07/95 -OM9M,KN18AM,,,OP: OM7AQ- OK1CDJ...,,,08/99 +OM7AC,JN98NN,,,ex OM3YIH OK3YIH,,FT225RD FT780 Transverter home made 145/28,01/03 +OM7AQ,JN98UI,EME,,,,144: FT290r 450W 13el F9FT MGF1302 - 432:,08/03 +OM7CM,JN98NR,EME,,,,144: FT 736R 120W F9FT-9el,03/05 +OM7JG,JN98TI,,,,,,01/02 +OM9AAW,JN98EP,,,Expedition,,,07/95 +OM9M,KN18AM,,,,,,08/99 ON1AEN,JO10UV,,,,,,2003 -ON1AFN,JO20SW,,,Filip,,144: FT290r 150W,09/98 -ON1ALJ,JO10SS,,,Jo,,144: TS790E 3CX800 MGF1302 10el 9BV - 432:,11/01 +ON1AFN,JO20SW,,,,,144: FT290r 150W,09/98 +ON1ALJ,JO10SS,,,,,144: TS790E 3CX800 MGF1302 10el 9BV - 432:,11/01 ON1DDC,JO21UD,,,,,144: 16el 800W1000lpm,08/97 -ON1DSQ,JO21KH,,,Dave,,144: TS700G 50W 8el Quad Preamp.300,04/03 -ON1RR,JO11XA,,,Frank,,FT100.150,09/01 -ON2MRT,JO21MB,,,Thierry,,,07/03 -ON4ADC,JO21FA,,,Marc,,,09/03 -ON4AMX,JO20KV,,,Marc,,144: FT736r 17el 3CX800 BF981DTR 6000lpm,07/01 +ON1DSQ,JO21KH,,,,,144: TS700G 50W 8el Quad Preamp.300,04/03 +ON1RR,JO11XA,,,ex ON1AXO,,FT100.150,09/01 +ON2MRT,JO21MB,,,,,,07/03 +ON3VHF,JO20EM,,,ex ON2VHF,,144: ft290r microset RV45,08/05 +ON4ADC,JO21FA,,,,,,09/03 +ON4AMX,JO20KV,,,,,144: FT736r 17el 3CX800 BF981DTR 6000lpm,07/01 ON4ARF,JO10MV,,,,,,05/02 -ON4ASL,JO21,,,Luc,,,1994 -ON4AVJ,JO11UB,,,Jacques,,144: IC275HE 3CX800A7 17el MGF1302165 2000,10/04 -ON4BBD,JO21NA,,,Marc,,FT736 TS440S,01/04 +ON4ASL,JO21,,,,,,1994 +ON4AVJ,JO11UB,,,,,144: IC275HE 3CX800A7 17el MGF1302165 2000,10/04 +ON4BBD,JO21NA,,,ex ON1CBT,,FT736 TS440S,01/04 ON4BG,JO10WM,,,,,,12/01 -ON4CHP,JO21JD,,,Willy,,144: 150W B5016G 11el FX224 SP2000,07/00 +ON4CHP,JO21JD,,,,,144: 150W B5016G 11el FX224 SP2000,07/00 ON4CJU,JO20,,,,,,11/01 -ON4DPX,JO10NT,EME,,Kenny,,FT736 FT847 144: 14el DK7ZB - 432: 2x 26el,09/03 -ON4FI,JO20IV,,,Karel,,144: 3CX800 600W 13el MGF13026000lpm DTR + MS,12/99 -ON4GG,JO20AR,EME,,Geert,,50: 9el mgf13025000lpm MSDSP,08/04 -ON4IMM,JO11UB,,,Dirk,,144: TS440S + LT2S MK2 Preamp PA3BIY design,09/03 -ON4IQ,JO20AR,EME,,Johan,,50: FT1000 TRSV 4x9el 200W MGF1302 - 144:,01/05 -ON4KHG,JO10XO,,,Gaetan,,144: TS440 300W 11el MGF1302 - 1296: 10W 35 e,03/04 -ON4KNG,JO20DU,EME,,Peter,,,01/04 -ON4KST,JO20HI,,,Alain,,,05/04 -ON4LDP,JO10UM,,,Oliver,,50: HM tsvter 2m/6m 30W GP - 144: 150W 13el M,06/02 -ON4LN,JO20IV,,,Eric,,144: TS711E GS35b 7ele M2 MGF1302155 2000l,11/04 -ON4LUC,JO20TM,EME,,Luc,,144: ft1000mp transverter 800w hf max ampli,01/04 -ON4MU,JO20SS,EME,,Denis,,Ft847 150W 0.5dB 3wl,08/03 -ON4PS,JO20KQ,,,Pierre,,144: 400W 9elonly SSB-MS,06/01 +ON4DPX,JO10NT,EME,,ex ON1DPX,,FT736 FT847 144: 4x 7el 400W - 432: 2x 26el,03/05 +ON4FI,JO20IV,,,,,144: 3CX800 600W 13el MGF13026000lpm DTR + MS,12/99 +ON4GG,JO20AR,EME,,,,50: 9el MGF13025000lpm MSDSP,04/05 +ON4IMM,JO11UB,,,ex ON1IM,,144: TS440S + LT2S MK2 Preamp PA3BIY design,03/06 +ON4IQ,JO20AR,EME,,ex ON4ANT,,50: 4x 6M9KHW FT1000mpMkV FTV1000 - 144: 8x,05/05 +ON4KHG,JO10XO,,,ex ON1KHG,,144 : 300W 4 WL MGF1302 - 1296 : 10W 35 el FH,04/06 +ON4KST,JO20HI,,,,,,05/04 +ON4LDP,JO10UM,,,,,50: HM tsvter 2m/6m 30W GP - 144: 150W 13el M,06/02 +ON4LN,JO20IV,,,ex ON4CGP,,144: TS711E GS35b 7ele M2 MGF1302155 2000l,11/04 +ON4LUC,JO20TM,EME,,,,144: ft1000mp transverter 800w hf max ampli,01/04 +ON4MU,JO20SS,EME,,ex ON1KPW,,Ft847 150W 0.5dB 3wl,08/03 +ON4PS,JO20KQ,,,,,144: 400W 9elonly SSB-MS,06/01 ON4QQ,JO20FS,,,,,,07/95 -ON5AEN,JO10VW,,,Hans,,FT225RD TS770e,01/04 -ON5GS,JO21VD,,,Dirk,,144: IC821 600W 15el,03/02 -ON5LGS,JO10OS,,,Edmond,,only SSB-MS,09/03 -ON5UE,JO11LF,,,Dan,,TS2000DX,01/04 -ON6AB,JO21EC,,,Bruno,,TS930S,03/04 -ON6NL,JO21UE,,,Anton,,144: 120W 13el 6WU088 5000lpm MSDSP288,09/04 -ON6OD,JO20HW,,,franz,,,1993 -ON7CL,JO20JU,,,Rudi,,FT100D 144: FT847 17el high pwr300,09/03 -ON7EH,JO20FV,EME,,michel,,,08/04 -ON7RB,JO11VA,EME,,Roland,,144: 8x13el hor. & 8x12e vert. Full Az/El 1K,11/03 -ON7UC,JO11ND,EME,,Johan,,144: 3CX800A7 2x16el 4.2wlDTR,02/05 -OQ1AEN,JO10VW,,,Hans,,FT225RD TS770E,11/01 -OX2K,GP47TA,EME,,,,144: 4x5wl - 432: 4x28el - 1296: 32m dish,05/00 -OY4TN,IP62NB,,,Trygvi,,,05/04 -OY9JD,IP62OA,,,Jon,,,01/04 -OZ0JX,JO54VU,,,Soeren,,IC761 IC756 50: 5el F9FT,01/03 -OZ1ALS,JO44WX,,,OP OZ1DSK,,144: 2x9el 1KW2500lpm,04/02 -OZ1CDE,JO65CO,,,Jan,,50: FT847 6el 850W,02/02 -OZ1CLL,JO65GQ,,,John,,,08/96 +ON5AEN,JO10VW,,,ex ON1AEN,,FT225RD TS770e,01/04 +ON5GS,JO21VD,,,ex ON1DLL,,144: IC821 600W 15el,03/02 +ON5LGS,JO10OS,,,ex ON1LGS 3X1SG,,only SSB-MS,09/03 +ON5UE,JO11LF,,,ex ON1BCD,,TS2000DX,01/04 +ON6AB,JO21EC,,,,,TS930S,03/04 +ON6NL,JO21UE,,,,,144: IC756PRO 125W 13el 6WU088 5000lpm MSDS,08/05 +ON6OD,JO20HW,,,,,,1993 +ON7CL,JO20JU,,,ex ON4CBT,,FT100D 144: FT847 17el high pwr300,09/03 +ON7EH,JO20FV,EME,,,,,08/04 +ON7RB,JO11VA,EME,,,,144: 8x13el hor. & 8x12e vert. Full Az/El 1K,11/03 +ON7UC,JO11ND,EME,,,,144: 3CX800A7 2x16el 4.2wlDTR,02/05 +OQ1AEN,JO10VW,,,,,FT225RD TS770E,11/01 +OT4G,JO10XO,,,= ON4KHG,,144 : 300W 4 WL MGF1302 - 1296 : 10W 35 el073,04/06 +OY4TN,IP62NB,,,,,,05/04 +OY9JD,IP62OA,,,,,,01/04 +OZ0JX,JO54VU,,,,,IC761 IC756 50: 5el F9FT,01/03 +OZ1ALS,JO44WX,,,,,144: 2x9el 1KW2500lpm,04/02 +OZ1CDE,JO65CO,,,,,50: FT847 6el 850W,02/02 +OZ1CLL,JO65GQ,,,,,,06/05 OZ1CTZ,JO46OE,,,,,,01/02 OZ1DJJ,JO65GP,,,,,,12/04 -OZ1DPR,JO45IG,,,Bernd ""Ben",,50: Yaesu FT-920 GS35b 1000W 5el,08/03 -OZ1FDH,JO65CS,,,Claus,,1200lpm,07/99 -OZ1FF,JO45BO,,,Kjeld,,432: 200W 2x23el LNA435 - 1296: 40W 2x44el SP,04/04 -OZ1FTU,JO55WW,,,Soeren,,,1993 -OZ1GEH,JO65AL,EME,,peter,,,1993 -OZ1HNE,JO57,EME,,Jorgen,,144: 4x18el crossyagi 8877.022,06/99 -OZ1HTB,JO75,,,Bent,,,11/96 -OZ1IEP,JO55XU,EME,,Carl Jan,,50: 100W 6el - 144: FT736 1KW 2x11el - 432:,01/05 -OZ1IPU,JO57JH,,,J.,,,1993 -OZ1JVX,JO46DS,,,A.,,,01/96 -OZ1LPR,JO44UW,EME,,Peter,,144: FT101ZD LT2MK2 YL1050 ampl 1KW 13el MG,01705 -OZ1PIF,JO65AN,EME,,Peter,,FT847 50: 100W 4el - 144: 350W 13el Preamp150,08/04 +OZ1DPR,JO45IG,,,,,50: Yaesu FT-920 GS35b 1000W 5el,08/03 +OZ1FDH,JO65CS,,,,,1200lpm,07/99 +OZ1FF,JO45BO,,,,,432: 200W 2x23el LNA435 - 1296: 40W 2x44el SP,04/04 +OZ1FTU,JO55WW,,,,,,1993 +OZ1GEH,JO65AL,EME,,,,,1993 +OZ1HNE,JO57,EME,,,,144: 4x18el crossyagi 8877022,12/05 +OZ1HTB,JO75,,,,,,11/96 +OZ1IEP,JO55XU,EME,,,,50: 100W 6el - 144: FT736 1KW 2x11el - 432:,03/05 +OZ1IPU,JO57JH,,,,,,1993 +OZ1JVX,JO46DS,,,,,,01/96 +OZ1LPR,JO44UW,EME,,,,144: IC756PROII LT2SMK2 Transv. 2x M2XP2,04/06 +OZ1MAX,JO57GI,,,,,Kenwood TS-2000,03/05 +OZ1PIF,JO65AN,EME,,,,FT847 50: 100W 4el - 144: 350W 2x 13el Prea,05/05 OZ2EEZ,JO45,,,,,,2003 -OZ2ELA,JO65,,,Michael,,,01/97 -OZ2M,JO65FR,,,Bo,,50: HB9CV 100W 70: 25W 5el 144: 15el 1 k,08/04 -OZ2TF,JO46PE,EME,,Ole,,144: IC271h 750W 4x9el Preamp,10/02 -OZ3K,JO45TL,,,Erik,,TS2000,08/02 -OZ3TT,JO66CB,EME,,Bent,,144: ICOM 275H Amp. CS31 M2 18 el MGF1303,12/04 -OZ4MM,JO55GH,EME,,Stig,,10m dish,10/02 -OZ4VV,JO46QU,,,Finn,,50:1000w 9el - 144:1000 Watt 15el MGF1302,03/04 -OZ5AGJ,JO56DG,,,Benny,,144: ICOM 100w 7Elem on 144,01/04 -OZ5QF,JO45VB,,,Jens,,,10/95 -OZ6ABA,JO57DJ,,,Leif,,144: FT736r Mutek Preamp 1KW 15el DJ9BVMS,08/03 +OZ2ELA,JO65,,,,,,01/97 +OZ2M,JO65FR,,,ex OZ1FDJ,,50: HB9CV 100W 70: 25W 5el 144: 15el 1 k,02/05 +OZ2TF,JO46PE,EME,,,,144: IC271h 750W 4x9el Preamp,10/02 +OZ3K,JO45TL,,,ex OZ1ELF,,TS2000,08/02 +OZ3TT,JO66CB,EME,,ex OZ1IUK,,144: ICOM 275H Amp. CS31 M2 18 el MGF1303,12/04 +OZ4VV,JO46QU,EME,,,,50:1000w 9el - 144:1000 Watt 15el MGF1302,02/05 +OZ5AGJ,JO56DG,,,,,144: ICOM 100W 7el,04/05 +OZ5QF,JO45VB,,,,,,10/95 +OZ6ABA,JO57DJ,,,,,144: FT736r Mutek Preamp 1KW 15el DJ9BVMS,08/03 OZ6EI,JO45TT,,,,,,08/01 -OZ6OL,JO65DJ,,,,,,09/01 -OZ6OM,JO55EJ,,,Bjørn ""Matt",,,11/04 -OZ7LE,JO45,,,Hans-Juergen,,144: 9el 400WDTR 4000lpm,03/01 -OZ7U,JO45RL,,,Birger,,TS940S FT847,03/03 -OZ7Z,JO45WA,,,Allan,,144: FT847 1KW 2x9el Yagi,09/01 -OZ8FR,JO55SK,EME,,,,,01/05 -OZ8ZS,JO55RT,EME,,Henrik,,144: IC706 GS31b 1KW 4x8el,08/04 -OZ9AAR,JO45TS,EME,,Carsten,,8x15el Crossyagis- 1KW,12/99 -OZ9FW,JO65CO,,,Frede,,,09/03 -PA0AVS,JO22,EME,,a.n.,,,1994 -PA0BAT,JO31FX,EME,,Gerard,,,01/03 -PA0C,JO22FD,EME,,Henk,,Ft 847 QBL 5/3500 0.4 dB NF 2x 17 el,01/05 -PA0HIP,JO21JO,,,willem,,,1993 -PA0JMV,JO21PM,EME,,Joop,,144: 2x16 el 2x 3CX800A7 0.18dB NF,02/05 -PA0LPE,JO20WW,,,Bert L.,,50: FT847 7el - 144: IC202 400W 2x11el,01/01 -PA0O,JO33HG,,,Jaap,,,08/03 -PA0PVW,JO22VA,,,Peter,,144: 18el M2 3CX800,07/02 -PA0RDY,JO22KJ,,,Robert,,144: 500W 15el MGF1302DTR 3000lpm,10/99 -PA0RLS,JO22,,,R.L.,,,1993 -PA0V,JO33II,EME,,Nanko,,144: 6 x DJ9BV 4 WL Xpol 8 BLF278 Mos fet PA,09/03 -PA0WWM,JO22FE,,,Wim,,144: 160W 9el MGF1302,04/01 -PA0ZN,DM04,,,,,,01/05 -PA1BVM,JO21RI,,,Rick,,50: IC202 Transv. dipol - 144: FT-225 IC 746,05/03 -PA1GYS,JO22WW,EME,,,,144: TS850 LT2S 2 x 2M5WL,01/04 -PA1LA,JO32LS,,,Roel,,144: TS700 16el 60W,01/05 -PA1T,JO33JF,EME,,Timon K.,,144: TS850 LT2S 400W 8877 4x17el M2- 50: 1y.,08/03 -PA2CHR,JO22XA,EME,,Chris,,144: 400W 4x28el Xpol - 432: 400W 2x35el.142,01/05 -PA2DW,JO22GD,EME,,Dick W.,,144: TenTec Trvt 400W(2x4CX250b) 10el.082,09/04 -PA2GER,JO21EW,EME,,Ger,,,09/99 -PA2KW,JO22SB,,,Evert,,144: 1x16el KLM 1.2KW MGF1302,10/04 -PA2M,JO21IP,,,Frank,,FT847 144: 2x blf278 9el 432: 16 el,11/04 -PA2TAB,JO32GF,,,,,,01/05 -PA2V,JO22IM,EME,,Peter,,,08/03 -PA3BAS,JO21PG,,,,,,01/05 +OZ6OL,JO65DJ,EME,,,,,09/01 +OZ6OM,JO55EJ,,,,,,11/04 +OZ7LE,JO45,,,=DJ3LE,,144: 9el 400WDTR 4000lpm,03/01 +OZ7U,JO45RL,,,ex OZ1BVW,,TS940S FT847,03/03 +OZ7Z,JO45WA,,,ex OZ1DSK,,144: FT847 1KW 2x9el Yagi,09/01 +OZ8FR,JO55SK,EME,,,,,03/05 +OZ8ZS,JO55RT,EME,,,,144: IC706 GS31b 1KW 4x8el,08/04 +OZ9FW,JO65CO,,,,,,09/03 +P7/ON4QX,FK88,EME,,Expedition,,144: FT857 375W 17B2,09/05 +PA0BAT,JO31FX,EME,,,,,01/03 +PA0C,JO22FD,EME,,ex PA0CIS,,Ft 847 QBL 5/3500 0.4 dB NF 2x 17 el,02/06 +PA0HIP,JO21JO,,,,,,1993 +PA0JMV,JO21PM,EME,,,,144: 2x16 el 2x 3CX800A7 0.18dB NF,03/05 +PA0LPE,JO20WW,,,,,50: FT847 7el - 144: IC202 400W 2x11el,01/01 +PA0O,JO33HG,,,ex PA0OOS,,,08/03 +PA0PVW,JO22VA,,,,,144: 18el M2 3CX800,07/02 +PA0RDY,JO22KJ,,,,,144: 500W 15el MGF1302DTR 3000lpm,10/99 +PA0RLS,JO22,,,,,,1993 +PA0V,JO33II,EME,,ex PA0OOM,,144: 6 x DJ9BV 4 WL Xpol 8 BLF278 Mos fet PA,04/05 +PA0WWM,JO22FE,,,,,144: 160W 9el MGF1302,04/01 +PA0ZH,JO33AB,EME,,,,,05/06 +PA1BVM,JO21RI,,,ex PE1BVM,,50: IC202 Transv. dipol - 144: FT-225 IC 746,05/03 +PA1GYS,JO22WW,EME,,ex PA3BXH/PE1DWI/PD0HKC,,144: TS850 LT2S 2 x 2M5WL 700W,04/05 +PA1LA,JO32LS,,,ex PE1RWS,,144: TS700 16el 60W,01/05 +PA1T,JO33JF,EME,,ex PA9KT PA3FBN,,144: TS850 LT2S 400W 8877 4x17el M2- 50: 1y.,07/05 +PA2CHR,JO22XA,EME,,,,144: 400W 4x28el Xpol - 432: 400W 2x35el.142,01/05 +PA2DW,JO22GD,EME,,ex PA2DWH- PE0DWH- GM5CJF,,144: TenTec Trvt 400W(2x4CX250b) 10el.082,09/04 +PA2GER,JO21EW,EME,,,,,09/99 +PA2KW,JO22SB,,,ex PE1FYJ PA3BZL,,144: 1x16el KLM 1.2KW MGF1302,10/04 +PA2M,JO21IP,,,ex PA3DYS,,FT847 144: 2x blf278 9el 432: 16 el,11/04 +PA2V,JO22IM,EME,,ex PA2VST- not qrv MS nw! (01/01),,,08/03 PA3BGM,JO33CE,,,,,,08/99 -PA3BIY,JO22EB,,,Peter,,144: 400W 2x9el,03/02 -PA3BXH,JO22WW,,,,,,01/05 -PA3BZL,JO22SB,,,,,,01/05 -PA3BZO,JO21RS,EME,,Piet,,,08/03 -PA3C,JO33FD,,,Aart,,,08/04 -PA3CEE,JO33JI,EME,,Eltje,,144: 600W 2x16el MGF1302165375,01/05 -PA3CMC,JO21WI,EME,,Lins,,,07/04 -PA3CMG,JO21IV,,,,,,01/05 -PA3COB,JO32MF,EME,,Harry,,144: 15el QD 3CX8003000lpm,03/04 -PA3CSG,JO21WD,EME,,Geert,,,08/04 -PA3CWI,JO11TK,EME,,Kees,,144: FT736 6x12 el M2 MGF1302 8877,08/03 -PA3DOL,JO22MT,,,Sjoerd,,144: 400W 17el4000lpm,09/03 -PA3DRL,JO21PS,,,,,144: 30W 10el,04/04 -PA3DUU,JO21IU,,,arie,,,1993 -PA3DYS,JO21JP,,,,,,01/05 -PA3DZL,JO21HM,EME,,Jac,,144: 4x17el 3.6ld MGF1302 EME Pwr - 432: 2x2,01/05 -PA3ECU,JO32CF,,,Rudy,,50: FT726R 5el 175W - 144: FT847 17el 400W -,12/04 -PA3EON,JO21,,,c.,,,1993 -PA3EPX,JO22RC,,,peter,,,1993 -PA3EQS,JO22TI,,,kees,,,1993 -PA3FBN,JO33IF,,,,,,01/05 -PA3FJY,JO32EH,,,,,,01/05 -PA3FOC,JO21FW,EME,,Rene,,144: TenTec Paragon LT2S 17el (2x17el) PA,06/03 -PA3FPQ,JO22XE,EME,,Johan,,FT100 500W single yagi,08/04 -PA3FSA,JO23RF,,,,,,08/01 -PA3FVE,JO21WG,,,wim,,,1993 -PA3FXW,JO22QD,,,robert,,,1993 -PA3FYF,JO22DB,,,peter,,,1993 -PA3GBR,JO32LH,,,johan,,,1993 -PA3GVC,JO22MU,,,Norbert,,,12/04 -PA3HJG,JO32BG,,,Pascal,,TS2000 50: Dipol - 144: 13el1300lpm,08/03 -PA4VHF,JO32EH,EME,,Dick,,50: 100W 5el - 144: TS850 LT2S 400W 2x16el,04/01 -PA5DD,JO22IC,,,Uffe,,144: GS35b 15ele CUE DEE,01/05 -PA5KM,JO11WL,,,Coen,,144: TS790E 9el 400W,05/04 -PA5M,JO21BS,,,Michael,,,08/03 -PA5MS,JO21QJ,EME,,John,,144: 11el GS35b 400W MGF1302132 4000 DTR,11/02 -PA60SHB,JO21OS,,,OP: PE1AHX,,,12/04 -PA6BN,JO13OF,,,OP: BIY- BZL- FOC,,,07/98 -PA6MS,JO32QF,,,OP PA2TAB- PA3FJY,,DTR,10/96 -PA6T,JO32GF,,,OP PA2TAB Arie,,DTR 3000lpm,12/98 +PA3BIY,JO22EB,,,,,144: 400W 2x9el,03/02 +PA3BZO,JO21RS,EME,,,,,08/03 +PA3C,JO33FD,,,ex PA3CPL,,,08/04 +PA3CEE,JO33JI,EME,,,,144: 600W 2x16el MGF1302165375,01/05 +PA3CMC,JO21WI,EME,,ex PA9LB,,144: LT2s mod. MGF1801 PA8877 4x 16el X-pol,04/06 +PA3COB,JO32MF,EME,,,,144: 15el QD 3CX8003000lpm,08/05 +PA3CSG,JO21WD,EME,,,,,08/04 +PA3DOL,JO22MT,,,,,144: 400W 17el4000lpm,03/06 +PA3DRL,JO21PS,,,,,144: ft-847 4x 7el dk7zb GI7-b preamp 20 dB,10/05 +PA3DUU,JO21IU,,,,,,1993 +PA3DZL,JO21HM,EME,,,,144: 4x17el 3.6ld MGF1302 EME Pwr - 432: 2x2,01/05 +PA3ECU,JO32CF,,,,,144: Ft847/FT726r - 400Watt 12el DK7ZB/10el D,03/06 +PA3EON,JO21,,,,,,1993 +PA3EPX,JO22RC,,,,,,1993 +PA3EQS,JO22TI,,,,,,1993 +PA3FOC,JO21FW,EME,,,,144: TenTec Paragon LT2S 17el (2x17el) PA,07/05 +PA3FPQ,JO22XE,EME,,,,144: TS850 + LT2S 500W single yagi,04/05 +PA3FSA,JO23RF,EME,,,,,10/05 +PA3FVE,JO21WG,,,,,,1993 +PA3FXW,JO22QD,,,,,,1993 +PA3FYF,JO22DB,,,,,,1993 +PA3GBR,JO32LH,,,,,,1993 +PA3GVC,JO22MU,,,,,,12/04 +PA3HJG,JO32BG,,,,,TS2000 50: Dipol - 144: 13el1300lpm,08/03 +PA4EME,JO20WX,EME,,,,144: 3.2 wl antenna,05/05 +PA4PS,JO33GH,,,,,144: 2x9el dk7zb,08/05 +PA4VHF,JO32EH,EME,,ex PA3FJY,,50: 100W 5el - 144: TS850 LT2S 400W 2x16el,04/01 +PA5DD,JO22IC,,,ex PA3HDD OZ1DOQ,,144: GS35b 15ele CUE DEE,01/05 +PA5KM,JO11WL,EME,,,,144: TS790E 9el 400W,12/05 +PA5M,JO21BS,,,ex PA5MD PA3GST,,,08/03 +PA5MS,JO21QJ,EME,,ex PE1OGF,,144: 11el GS35b 400W MGF1302132 4000 DTR,11/02 +PA60SHB,JO21OS,,,SpecialCall,,,12/04 +PA6BN,JO13OF,,,Expedition - QSL via PA3BIY,,,07/98 +PA6MS,JO32QF,,,Special-Call,,DTR,10/96 +PA6T,JO32GF,,,Specialcall - QSL via PA2TAB,,DTR 3000lpm,12/98 PA7AL,JO23VG,,,,,,12/04 -PA7C,JO32GF,,,Arie,,50: 100W 6el - 144: R2CW GS31b 400W 14el MGF1,09/03 -PA7FE,JO22OC,,,Frank,,50: 6el leg pwr,03/99 -PA7FM,JO21,,,Dennis,,,08/00 -PA7PYR,JO21UQ,,,Rien,,TS450SAT HF: FB33 - 144: 25W 2x17el Tonna -,09/03 -PA7RP,JO22EC,,,Ruud,,144: 13el 400W GS35B,07/04 -PA7WM,JO23TA,,,l.,,,03/99 -PA9RX,JO32MT,,,Theo,,144: FT847 4x17el 200W370,08/02 -PB0ALS,JO21RV,,,tjeerd,,,1993 -PB1TT,JO22FF,,,Peter,,144: 100W 10el CueDee2000lpm DTR,09/01 -PD0ANQ,JO31EW,,,Wilfred,,,11/01 -PD0HCV,JO31FW,,,Gert,,IC821 144: 15el M2 432: 18el M2,11/04 -PD0ORT,JO23RE,,,Willem,,,04/04 -PD0PYR,JO21UQ,,,,,,01/05 -PD0RFU,JO32LS,,,Rene,,144: FT225RD 2x19el Cushcraft - 432: TS811E,08/04 -PD1AIQ,JO22RM,,,Jan,,144: 25W 4x9el,04/03 -PD1ALD,JO32FI,,,Rene,,Yaesu FT897- Kenwood TR9130- Yaesu FT817,06/03 -PD2GCM,JO21ET,,,Gerard,,FT847,11/04 +PA7C,JO32GF,,,ex PA2TAB,,50: 100W 6el - 144: R2CW GS31b 400W 14el MGF1,09/03 +PA7FE,JO22OC,,,ex PA3BFM,,50: 6el leg pwr,03/99 +PA7FM,JO21,,,ex PE1PZS,,,08/00 +PA7PYR,JO21UQ,,,ex PD0PYR,,TS450SAT HF: FB33 - 144: 25W 2x17el Tonna -,09/03 +PA7RP,JO22EC,EME,,ex PA3BBA,,144: 400 Watt (GS35b) 17 el F9FT,01/06 +PA7WM,JO23TA,,,ex PA3DWD,,,03/99 +PA9RX,JO32MT,,,,,144: FT847 4x17el 200W370,08/02 +PB0ALS,JO21RV,,,,,,1993 +PB1TT,JO22FF,,,ex PA3EFC,,144: 100W 10el CueDee2000lpm DTR,09/01 +PC7M,JO32GF,EME,,ex PA2TAB PE0TAB,,50 MHz : FT847/120W/6el - 144 MHz : FT847/400,04/06 +PD0ANQ,JO31EW,,,,,,11/01 +PD0HCV,JO31FW,,,,,IC821 144: 15el QD 50W 432: 18el M2,08/05 +PD0ORT,JO23RE,,,,,,03/06 +PD0RFU,JO32LS,,,,,144: FT225RD 2x19el Cushcraft - 432: TS811E,08/04 +PD1AIQ,JO22RM,,,,,144: 25W 4x9el,04/03 +PD1ALD,JO32FI,,,,,Yaesu FT897- Kenwood TR9130- Yaesu FT817,06/03 +PD2GCM,JO21ET,,,,,FT847,11/04 PD2VDV,JO23RF,,,,,,08/04 -PE1AHX,JO21OS,,,Catharinus,,DTR +,10/03 -PE1BVM,JO21RI,,,,,,01/05 +PD3AHW,JO32LF,,,,,,05/05 +PE1AHX,JO21OS,,,,,DTR +,02/05 +PE1BTX,JO22XW,EME,,,,144: 4x 12el DK7ZB 600W no preamp,01/06 PE1DCD,JO21FU,,,,,,05/03 -PE1GBT,JO33BC,,,,,,01/05 PE1GNP,JO31IX,,,,,,05/03 -PE1GUR,JO22TH,,,,,,06/03 -PE1HWO,JO21GV,,,Andre,,144: FT101ZD + TRV 4CX250b 400Watt 17el MGF1,12/03 -PE1IKX,JO11TL,,,Marco,,144: 300W 15el Quedee,03/04 -PE1ITR,JO21QK,EME,,Rob,,144: 100W 2x10el 3SK97 432: 60W 2x 28el GS,01/05 -PE1L,JO23WF,EME,,Rene,,144: 400W 4yagis DJ9BVDTR,12/04 -PE1LCH,JO23WF,,,,,,01/05 -PE1LWT,JO22VA,EME,,Jurgen,,144: 800W 2x3wl-Xpol,08/03 -PE1M,JO23XE,,,Kees,,,08/03 -PE1MVJ,JO21FV,,,jJ,,,11/96 -PE1OGF,JO21QJ,,,,,,01/05 -PE1OPK,JO23UE,,,Bram,,IC821,09/03 -PE1PQX,JO32LS,,,Andre,,,07/04 +PE1GUR,JO22TH,,,,,144: 16el 350W,07/05 +PE1HWO,JO21GV,,,,,144: FT101ZD + TRV 4CX250b 400Watt 17el MGF1,12/03 +PE1IKX,JO11TM,,,,,144: 400W 15el Quedee,06/05 +PE1ITR,JO21QK,EME,,,,144: 100W 2x10el 3SK97 432: 60W 2x 28el GS,09/05 +PE1L,JO23WF,EME,,ex PE1LCH,,144: 400W 4yagis DJ9BVDTR,12/04 +PE1LWT,JO22VA,EME,,,,144: 300W 2x3wl-Xpol,07/05 +PE1M,JO23XE,,,ex PE1MCD,,,08/03 +PE1MVJ,JO21FV,,,,,,11/96 +PE1OID,JO33KI,EME,,,,144: TR 751e 160W 10el,10/05 +PE1OPK,JO23UE,,,,,IC821,09/03 +PE1PQX,JO32LS,,,ex PD0RJH,,,07/04 PE1RBG,JO21,,,,,,11/01 -PE1RLF,JO32CG,,,Eric,,144: TS850 LT2S 4CX250F 10el370,01/04 +PE1RDP,JO21QK,EME,,,,FT847 144: 2x 11el 220W,04/06 +PE1RLF,JO32CG,,,,,144: TS850 LT2S 4CX250F 10el370,09/05 PE1RWS,JO32BM,,,,,,01/05 -PE2KP,JO22XE,,,Adriaan,,144: 6el Quad 50W.144 2000 lpm.350,01/01 -PE2PE,JO21LU,,,Freek,,144: 400W 15el Quedee,11/03 -PE2RMI,JO23MH,,,Eddy,,,01/02 -PE2SVN,JO21WR,EME,,Sjoerd,,FT1000 LT2s 3CX800 400W 10el,11/04 -PE9DX,JO33MD,,,Johan,,144: TS711 400W 17el SP2,07/04 -PE9GG,JO33NA,,,,,only SSB-MS,11/00 -PE9HNE,JO22FB,EME,,Hans,,TS711,09/03 -PI4NYV,JO32EH,,,Clubstation,,144: 400W 9el or 17el (/p JO32FI),12/96 -PP2KR,GH53IG,EME,,Kleibe,,TR9130,02/05 -PT9FH,GH11EA,EME,,Tony,,144: 4x12el 2x4CX250,04/00 -PY1EPU,GG88PO,EME,,Franco,,144: 4x 16el 160W FT 1000 Mark V Field + Tran,02/05 -PY1IAM,GG87,EME,,LUIZ ALBERTO,,,04/04 -PY1RO,GG87LB,EME,,Rolf,,IC706MKIIg 1000W 8 over 8 el,08/03 -PY2CLL,GG66RF,EME,,Marcus,,144: Kachina 505DSP Trvt 4x18el M2 LNA 300W,01/00 -PY2NI,GG66RK,EME,,Horta,,.100.220,07/01 -PY2PD,GG66RF,EME,,Jose Carlos,,MP1000- LT2S- 4xM2XP28- 3CX800 0-4db,03/99 -PY2PLL,GG66RF,EME,,Marcus,,144: 750W 16el or 2x15el - TS790A xverters,03/01 -PY2SRB,GG48bc,EME,, -PY3CRX,GG66RF,,,Marcus,,144: 750W 16el or 2x15el,08/00 -PY4EPU,GG88PO,EME,,LUIZ ALBERTO,,YAGI FULL SIZE FOR 14 21 28 50 144 220,09/03 +PE2KP,JO22XE,,,ex PE1KHP,,144: 6el Quad 50W.144 2000 lpm.350,01/01 +PE2PE,JO21LU,,,ex PE1BNK,,144: 400W 15el Quedee,11/03 +PE2RMI,JO23MH,,,,,,01/02 +PE2SVN,JO21WR,EME,,,,FT1000 LT2s 3CX800 400W 10el,11/04 +PE9DX,JO33MD,,,ex PE1LAU,,144: TS711 600W 17el SP2000,08/05 +PE9GG,JO33NA,,,ex PE1PJG,,only SSB-MS,04/05 +PI4NYV,JO32EH,,,,,144: 400W 9el or 17el (/p JO32FI),12/96 +PP5XX,GG53QW,EME,,,,144: 150W single yagi,03/06 +PR8ZX,GI64GL,EME,,ex CT1DYX,,144: 13 el dl6wu 150w mgf1312,08/05 +PY0FF,HI36TD,EME,,,,144: 4x 12el 100W,06/05 +PY1EPU,GG87KD,EME,,,,144: 4x 16el 160W FT 1000 Mark V Field + Tran,04/06 +PY1RO,GG87LB,EME,,,,IC706MKIIg 1000W 8 over 8 el,07/05 +PY2ANE,GG66SH,EME,,,,,05/05 +PY2BL,GG67LE,EME,,ex ZZ2RED,,144: TS2000 IC910 2x 15el 1KW,09/05 +PY2BVF,GG66TB,EME,,,,144: 4x 10el 1KW - 432: 2x 28el 800W,08/05 +PY2OC,GG66OT,EME,,,,50: 8el 100W - 144: 12el 160W,08/05 +PY2PLL,GG66RF,EME,,,,144: 750W 16el or 2x15el - TS790A xverters,03/01 +PY2SRB,GG48BC,EME,,,,144: 160W 4x 10el,05/06 +PY3CRX,GG66RF,,,,,144: 750W 16el or 2x15el,08/00 +PY3FF,GF49IU,EME,,,,,05/05 +PY5EW,GG46KQ,EME,,,,144: 15el 100W,06/05 PY5ZBU,GG54,EME,,,,,2000 -R1MVA,KP40GP,EME,,OP RU1AA- OH5LZY ...,,144: 150W,07/99 -R1MVZ,KP40GP,EME,,OP: RU1AA,,144: 4x14el 1.2KW.072,10/99 -R3VHF,LO16XG,,,Clubstation,,.143,01/96 -RA0FCA,QN16IV,EME,,,,,12/04 +PZ5CY,GJ25JT,EME,,,,50: 1x 6el,03/06 +R1MVA,KP40GP,EME,,Expedition,,144: 150W,07/99 +R1MVW,KP40GP,EME,,Expedition,,144: 2x 9el or 18el 500W - 432: 40el 500W,11/05 +R3VHF,LO16XG,,,Sondercall,,.143,01/96 +RA0FCA,QN16IW,EME,,,,144: 4x 15el Xpol 1KW,04/06 +RA0FW,QN16IW,EME,,,,144: 4x 15el Xpol 1KW,11/05 RA1ASA,KP50FB,,,,,,1976 -RA1AY,KP50EA,,,Serge,,TS450SAT Icom 706MKiiG,11/04 -RA1QA,KO99WF,,,Alexander ""Alex",,144: 100W 14el 9BV.140 rx1000/2000lpm,05/02 +RA1AY,KP50EA,,,ex UA9KG,,TS450SAT Icom 706MKiiG,11/04 +RA1QA,KO99WF,,,,,144: 100W 14el 9BV.140 rx1000/2000lpm,05/02 RA1QAX,LO09CC,,,,,144: IC706 10el PA,10/04 -RA1TC,KO58ON,,,alex,,,1992 +RA1QIB,KO99WG,,,,,,11/05 +RA1TC,KO58ON,,,,,,1992 RA1TL,KO67,,,,,,05/04 -RA1TM,KO67PX,,,Alex,,IC746,11/04 -RA1WL,KO47EV,,,Mikhail ""Mischa",,,06/04 -RA1ZC,KP59JK,EME,,Anatoly y.,,IC706MK2 144: 2x10el DJ9BV 1KW2000lpm,11/01 +RA1TM,KO67PX,,,,,IC746,11/04 +RA1WL,KO47EV,,,,,,07/05 +RA1ZC,KP59JK,EME,,ex UA1ZCG,,IC706MK2 144: 2x10el DJ9BV 1KW2000lpm,11/01 RA1ZK,KP68MV,,,,,,11/04 RA3AGS,KO85UU,,,,,,1990 -RA3AQ,KO85SP,EME,,Dmitry,,144: FT736r 250W 13B2,06/04 +RA3AQ,KO85JE,EME,,,,144: 6x 6.3 wl cross yagi 1500W,08/05 RA3DHK,KO95JH,EME,,,,144: FT-736R Toshiba NB 170W 1x2M12MSDSP,01/05 -RA3DQ,KO85US,,,Victor,,144: IC746 100W 16el,09/01 -RA3DQT,KO95HK,,,Vladimir L.,,144: FT-736R Toshiba NB 170W 1x2M12MSDSP,08/02 -RA3DRC,KO95AP,,,Nick,,144: FT-847 50Wtts 17el DJ9BV 9.2 m long200,03/04 -RA3EL,KO82AX,,,Nikolaj,,144: 50W 16el,03/04 -RA3FO,KO86SI,,,Nicolai,,.080,1995 -RA3GES,KO92SO,,,,,,11/04 -RA3IM,KO56UM,,,Leo,,,06/04 -RA3IS,KO76WT,EME,,Sergey G.,,144: 1000W 2x19el SM2CEW 5wl crossyagi142 MS,01/05 -RA3LBK,KO65QA,,,Viktor,,144: 200W 17el1500lpm,01/00 -RA3LE,KO64AR,EME,,Valeri,,,04/01 -RA3LW,KO54MQ,,,Mikhail K. ""Misha",,144: KT931 BF981 2x10el - 432: KT930 KT3101,06/04 -RA3QTT,LO01GQ,,,Nickolaj,,144: GS35 0.5KW 4 x 3.3wl 9BV 0.35db.167,11/03 -RA3TES,LO15WJ,,,Andy,,,11/95 -RA3WDK,KO81BR,,,Ivan,,144: 60W 11el,04/04 -RA3YCR,KO73DH,EME,,viktor,,.090,1994 -RA4AOR,LN29LA,EME,,Yuri,,144: 4x 14elX-Yagi 1-5KW,11/03 -RA4HCN,LO43SL,EME,,Sergey,,,01/05 -RA6AAB,KN94UR,EME,,vladimir,,,1992 -RA6DA,KN96sa,EME,, -RA6HHT,LN05XB,,,nikolaj,,,1992 -RA9FMT,LO87BW,,,vladimir,,,1992 +RA3DQ,KO85US,,,,,144: IC746 100W 16el,09/01 +RA3DQT,KO95HK,,,,,144: FT-736R Toshiba NB 170W 1x2M12MSDSP,08/02 +RA3DRC,KO95AP,,,,,144: FT-847 50Wtts 17el DJ9BV 9.2 m long200,03/04 +RA3EL,KO82AX,,,ex UA3EAT,,144: 50W 16el,03/04 +RA3FO,KO86SI,,,,,.080,1995 +RA3GES,KO92SO,EME,,,,144: 4x 7el 200W,11/05 +RA3IM,KO56UM,,,,,,06/04 +RA3IS,KO76QP,EME,,ex UA3IFI,,144: 1000W 2x19el SM2CEW 5wl crossyagi142 MS,02/05 +RA3LBK,KO65QA,,,,,144: 200W 17el1500lpm,01/00 +RA3LE,KO64AR,EME,,ex UA3LBO,,,04/01 +RA3LW,KO54MQ,,,ex UA3LAW,,144: KT931 BF981 2x10el - 432: KT930 KT3101,06/04 +RA3MR,KO98JC,,,ex UA3MEP,,IC910,08/05 +RA3MR/3,KO94IX,,,Expedition,,144: 2x 13el 300W,07/05 +RA3QTT,LO01GQ,,,,,144: GS35 0.5KW 4 x 3.3wl 9BV 0.35db.167,11/03 +RA3TES,LO15WJ,,,,,,11/95 +RA3WDK,KO81BR,,,,,144: 60W 11el,04/04 +RA3WND/3,KO95KG,,,,,,08/05 +RA3XAL,KO84DM,,,,,,08/05 +RA3XAL/3,KO74TR,,,,,144: 250W 2x 18el,08/05 +RA3YCR,KO73DH,EME,,Siltent Key,,.090,1994 +RA4HCN,LO43SL,EME,,,,144: 1KW 4x12el,12/05 +RA6AAB,KN94UR,EME,,Silent Key,,,1992 +RA6AX,KN94,EME,,,,,04/05 +RA6DA,KN96SA,EME,,,,144: 8x 12el 100W,08/05 +RA6HHT,LN05WA,EME,,,,144: 16el 1.2KW,10/05 +RA9FMT,LO87BW,EME,,,,,01/06 RA9SO,LO71NS,,,,,,08/96 -RB4EE,KN78WM,,,,,,01/05 -RB5AG,KO60KT,,,,,,01/05 -RB5EU,KN78RI,,,,,,01/05 -RB5GD,KN66HP,,,,,,01/05 -RB5GO,KN66HP,,,,,,01/05 -RB5GZ,KN66HP,,,,,,01/05 +RD3BD,KO85UQ,EME,,,,144: 4x 18el 1500W,04/06 RK1B,KO69AK,,,,,,01/05 -RK1NA,KP71ET,EME,,Konstantin,,144: FT847 100W 14el circular,04/04 -RK2FWA,KO04FT,EME,,Clubstation,,080,04/04 -RK3AF,KO85QR,,,Dmitriy ""Dima",,144: IC746 2xGI7B 450W 16el F9FT177 MSDSP285,12/03 -RK3PWJ,KO83XC,,,OP: 3PF 3PNO,,,05/04 -RK3WWF,KO72QI,,,,,,06/04 -RK9CC,MO06RT,EME,,Stepan,,6x4lb 9BV GS35b,03/04 -RL1P,KO49VW,,,Igor,,144: TR-751 300w 16el DJ9BV,05/03 -RL1X,KO59EW,,,,,,05/03 -RM3T,LO16XG,,,Clubstation,,.143,08/97 +RK1B/1,KO36XX,,,Expedition,,,12/05 +RK1NA,KP71ET,EME,,ex UN1CD - QSL via DK3WG,,144: FT847 100W 14el circular,04/04 +RK2FWA,KO04FT,EME,,ex UZ2FWA,,080,04/04 +RK3AF,KO85QR,,,ex UZ3AF- UA3AJK,,144: IC746 2xGI7B 450W 16el F9FT177 MSDSP285,12/03 +RK3FG,KO86HP,EME,,,,144: 4x 14el 1200W,03/05 +RK3PWJ,KO83XC,,,QSL via UA3PNO,,,05/04 +RK3QWM,KO90AN,,,Expedtion,,,08/05 +RK3WWF,KO72QI,EME,,,,144: 4x 9el 700W,12/05 +RK6LXN,KN97LE,,,,,,04/05 +RK6MC,KN97KG,EME,,ex UA9XEA,,144: 4x 12el 1KW - 432: 8x23 el GS35B/1.1kW,08/05 +RL1P,KO49VW,,,SpecialCall,,144: TR-751 300w 16el DJ9BV,05/03 +RL1X,KO59EW,,,SpecialCall,,,05/03 +RM3T,LO16XG,,,Specialcall,,.143,08/97 +RN3QLU,KO91OO,EME,,,,,06/05 +RN3QO,KO91OO,,,,,,07/05 RN3QQ,LO00BK,,,,,144: 15el DJ9BV 100W1500lpm,06/99 -RN6BN,KN95LC,EME,,Alexandr ""Sam",,144: FT736 16x17el 1KW,11/04 +RN6BN,KN95LC,EME,,,,144: FT736 16x17el 1KW,04/05 RN6HW,LN16AB,,,,,,08/03 -RN6MT,KN97LN,EME,,Gena,,144: 2.3KW 4xYagis.132,11/03 -RU1A,KP40HK,EME,,Clubstation,,144: 6x16el 1KW,01/05 -RU1AA,KP40XD,EME,,Alex,,144: >2KW GU93b 4x15el Crossyagi140 4000 DTR3,07/04 +RN6MT,KN97LN,EME,,ex RA6LDY,,144: 2.3KW 4xYagis,02/06 +RP3POT,KO93CD,,,,,,05/05 +RU1A,KP40HK,EME,,QSL via DK3WG,,144: 6x16el 1KW,01/05 +RU1AA,KP40XD,EME,,QSL via DK3WG,,144: >2KW GU93b 4x15el Crossyagi140 4000 DTR3,07/04 RU1AC,KP50EJ,,,,,,07/04 -RU1AS,KO59,,,Alexander,,,05/03 -RU1R,KO82BW,,,OP RB5AL-R3VHF,,,1993 -RU1U,KO72XW,,,OP RB5AL- R3VHF,,,1993 -RU3ACE,KO85SM,EME,,Maxim ""Max",,,01/05 -RU3GX,KO92SO,,,Igor,,,06/04 -RU3ZD,KO81VG,,,Victor,,144: 16el 200W,1/96 -RU4HU,LO43OM,,,Andy,,144: FT290R 2x10el 50W,04/04 +RU1AS,KO59,,,,,,05/03 +RU1R,KO82BW,,,Expedition,,,1993 +RU1U,KO72XW,,,Expedition,,,1993 +RU3ACE,KO85SM,EME,,,,144: 4el 300W,05/05 +RU3GX,KO92SO,,,,,,06/04 +RU3ZD,KO81VG,,,ex UW3ZD,,144: 16el 200W,1/96 +RU4HU,LO43OM,,,,,144: FT290R 2x10el 50W,04/04 RV1AO,KP50,,,,,,08/04 -RV3AO,KO85RR,,,Vladimir,,144: 4x12el 1500W,07/03 -RV3APM,KO85RU,,,Sergey,,IC910H,03/04 -RV3IG,KO87OT,EME,,Andrey ""Andy",,144: 500W 4x15el.125 1000lpm,01/00 -RV3ZR,KO80CL,,,Alex,,144: 500W YU0B KT939A.150.300,11/03 -RV4AQ,LN28GM,EME,,,,432: 4x4.2ld BV 2xGI7B 500W,10/99 -RV6YY,LN04BH,,,Larry,,,08/04 -RV9AX,LO93LK,,,Oleg,,144: 600W 17el preamp - 50: 100W- 6el.050,10/96 -RV9JD,MP80GW,EME,,,,,01/05 -RW1AW,KP50DA,EME,,Alexander ""Alex",,144: FT736r 2.4KW 2x19el MGF1302 - 432: 12x1,02/05 -RW1Q,KO99WJ,,,Oleg(R3VHF),,.143,12/95 -RW2F,KO04PT,,,OP: DK8LV- DL8UD,,,12/97 -RW3AC,KO86SH,,,Evgeny,,IC910H,01/05 -RW3AZ,KO85TT,,,Alex V.,,,08/03 -RW3DMQ,KO86RI,,,,,,08/04 -RW3PF,KO93CD,,,Peter,,144: 1500W 4x10el GS35 BVO 3wl Preamp - 432:,11/03 -RW3TJ,LO16XG,,,Oleg I.,,.143.243,11/03 -RW3TU,LO25BR,,,Sergej ""Serge",,144:1000Watt 2x13el MGF1302 - 432: 200Watt 2x,09/03 -RW3WR,KO71IM,,,Yuri,,,07/04 -RW4AK,LO20RC,,,Alex,,,01/96 -RW4WE,LO66PU,,,,,,11/04 -RW9FT,LO89TD,,,Eugen,,,11/04 +RV3AO,KO85RR,,,ex RA3AIS,,144: 4x12el 1500W,07/03 +RV3APM,KO85RU,,,,,IC910H,03/04 +RV3IG,KO87OT,EME,,QSL via DK3WG,,144: 500W 4x15el.125 1000lpm,11/05 +RV3YM,KO63QQ,,,ex UA3YOZ,,FT 897 144: 5.5wl gs15 bf998 432: 11wl gs,05/05 +RV3ZR,KO80CL,,,,,144: 500W YU0B KT939A.150.300,11/03 +RV6YY,LN04BH,,,,,,08/04 +RV9AX,LO93LK,,,,,144: 600W 17el preamp - 50: 100W- 6el.050,10/96 +RV9JD,MP80GW,EME,,,,144: 4x 16el 1500W,06/05 +RV9PP,NO15LB,,,,,144: ft-847 4x 12el klm 350watts 432: 4x 22el,03/06 +RW1AW,KP50DA,EME,,QSL via DK3WG,,144: FT736r 2.4KW 2x19el MGF1302 - 432: 12x1,12/05 +RW1AY,KO59CU,EME,,,,144: 15el 4wl 1500W,04/06 +RW1AY/1,KO68NJ,EME,,,,144: 4x14el 5wl 1500w,06/05 +RW1Q,KO99WJ,,,Expedition,,.143,12/95 +RW1ZC/6,LN04,,,Expedition,,144: 100W,05/06 +RW1ZC/MM,DIVERSE,,,,,,08/05 +RW2F,KO04PT,,,Expedition,,,12/97 +RW3AC,KO86SH,EME,,,,144: IC910H 4x 14el QRP,11/05 +RW3AC/3,KO77RC,,,Expedition,,,08/05 +RW3AZ,KO85TT,,,,,,08/03 +RW3AZ/QQ,KO66,,,Expedition,,144: 500W 1el,01/05 +RW3DMQ,KO86RI,,,,,,05/05 +RW3PF,KO93CD,,,QSL via DK3WG,,144: 1500W 4x10el BVO 3wl Preamp - 432: 700W,08/05 +RW3TJ,LO16XG,,,ex UW3TJ,,.143.243,11/03 +RW3TU,LO25BR,,,,,144:1000Watt 2x13el MGF1302 - 432: 200Watt 2x,09/03 +RW3WR,KO71IM,,,ex UA3XJ,,,07/04 +RW4AK,LO20RC,,,ex UW4AK,,,01/96 +RW4HM,LO43RM,EME,,,,ICOM-910H,05/05 +RW4NQ,LO58,,,,,144: 4x 9el GI7B,08/05 +RW4WE,LO66PU,,,,,,04/05 +RW9FT,LO89TD,,,ex UW9FU,,,11/04 RW9MD,MO64RX,EME,,,,,06/01 -RX1AS,KO59FX,EME,,Sergej,,144: 4x21el LY GS35b linear.120 1000lpm,05/04 -RX1AX,KO59EW,,,Anton,,,12/20 -RX3PX,KO84SD,EME,,Gennady V.,,144: 2x11el 210W MGF1302 - 432: 2x23el 180W,06/99 -RX3QFM,KO91FM,EME,,Vladimir ""Vlad",,144: 2xBVO4wl yagi 0.4 dB LNA PWR 1.5 KW (2xG,08/04 -RX6AKO,KN84PV,,,Gennady,,,06/96 -RX9CHW,LO99SE,EME,,,,,01/05 +RW9USA,NO33NS,EME,,,,TM255A IC 821H PA 1500W ant 8/6 yagi,05/05 +RX1AS,KO59FX,EME,,QSL via DK3WG,,144: 4x21el LY GS35b linear.120 1000lpm,03/06 +RX1AX,KO59EW,,,,,,12/20 +RX3AA/3,KO77RC,,,Expedition,,,08/05 +RX3DUR,KO85XM,,,ex UV3DUR,,ICOM 706MK2G + PA GI7B,08/05 +RX3PX,KO84SD,EME,,,,144: 2x11el 210W MGF1302 - 432: 2x23el 180W,06/99 +RX3QFM,KO91FM,EME,,QSL via DK3WG,,144: 2xBVO4wl yagi 0.4 dB LNA PWR 1.5 KW (2xG,07/05 +RX6AKO,KN84PV,,,ex UV6AKO,,,06/96 +RX9CHW,MO09CS,EME,,,,144: 4x 8el 100W,03/06 RX9SA,LO71NS,,,,,IC910H,08/04 -RY3E,KN75,,,OP UT5EC,,,1993 -RY5I,KP51BM,,,,,,1992 -RZ1AP,KO49VW,,,Igor,,144: TR-751 300w 16el DJ9BV,05/04 -RZ1AWR,KO59DX,,,Clubstation,,144: 16el DJ9BV 50Watt.120 tx2500 1500lpm,08/98 -RZ1AWT,KP40XD,,,Yuri,,144: 20W 9el.170 1000lpm,06/98 +RY3E,KN75,,,Expedition,,,1993 +RY5I,KP51BM,,,Expedition,,,1992 +RZ1AP,KO49VW,,,,,144: TR-751 300w 16el DJ9BV,05/04 +RZ1AWR,KO59DX,,,,,144: 16el DJ9BV 50Watt.120 tx2500 1500lpm,08/98 +RZ1AWT,KP40XD,,,QSL via DK3WG,,144: 20W 9el.170 1000lpm,06/98 RZ1QZZ,LO09BC,,,,,,07/04 RZ1ZZZ,KP76EQ,,,,,,08/04 RZ2FWA,KO04FT,,,,,,2003 -RZ3AF,KO85CO,,,,,144: MGF 1302 2x14 el GI-7B,12/02 -RZ3QD,KO91OO,,,,,144: 4wl 1KW LNA6000lpm,08/02 +RZ3AED,KO86RD,EME,,,,TS2000 TM-V7E 144: 4x 15el 500W 432: 4x 21e,01/06 +RZ3AF,KO85CO,,,ex UA3AFA,,144: MGF 1302 2x14 el GI-7B,12/02 +RZ3QD,KO91OO,,,,,144: 4wl 1KW LNA6000lpm,08/05 RZ3QS,KO91SS,,,,,144: 2wl 100W LNA1000lpm,08/02 -RZ3ZZ,KO80GP,,,Nikolaj ""Nick",,144: IC-910H 4x 10el A144S10 - 432: 1 A43,11/04 -RZ4HF,LO43QM,,,Igor,,144: IC-910 IC-970 2x13el 1500W,04/04 -RZ6BU,KN84PV,,,Gennadij,,IC706 144: 200W 10el Preamp KT610073 4000lpm,11/03 -RZ6BY,KN84PV,,,,,,06/97 -S50C,JN76JG,,,Clubstation,,50: 5el 100W - 144: IC275h 2x15el 700WMSDSP,08/01 -S51AT,JN75GW,,,Boris,,144: 400W 16el LY2000lpm MSDSP,12/04 +RZ3ZZ,KO80GP,,,,,144: IC-910H 4x 10el A144S10 - 432: 1 A43,04/05 +RZ4HF,LO43TJ,EME,,,,144: IC-910 IC-970 2x13el 1500W,04/06 +RZ6BU,KN84PV,,,,,IC706 144: 200W 10el Preamp KT610073 4000lpm,11/03 +RZ6BY,KN84PV,,,ex UV6AIL,,,06/97 +S50C,JN76JG,,,,,50: 5el 100W - 144: IC275h 2x15el 700WMSDSP,08/01 +S51AT,JN75GW,,,ex YU3FM,,144: 1KW 16el LY2000lpm MSDSP,08/05 S51BA,JN75IX,,,,,,2003 S51DI,JN76VL,,,,,,09/03 -S51DX,JN75CC,,,Janez,,144: IC275H 100W 2x17el F9FT,11/01 -S51MQ,JN75NT,,,Boris,,50: 50W 6el - 144: TH328 500W 4x7el MGF13021,01/04 +S51DX,JN75CC,,,ex YU3HR,,144: IC275H 100W 2x17el F9FT,11/01 S51S,JN75GV,,,,,,08/96 S51SLO,JN76GB,,,,,DTR,03/01 S51TE,JN76BI,,,,,,11/99 S51WV,JN76SN,,,,,,2003 -S51WX,JN75OS,,,Dusan,,144: 2x11el 350W,09/04 -S51ZO,JN86DR,EME,,Joze,,144: 1-5KW 4x14el 9BV - 432: 800W 8x33el 9,01/00 -S52CW,JN76CI,EME,,Uros,,,01/01 +S51WX,JN75OS,,,,,144: 2x11el 350W,09/04 S52EZ,JN86DT,,,,,,08/01 -S52LM,JN65TX,EME,,Milos,,144: 4X17M2 5WL FT 1000MP JAVORNIK 144/14,01/05 -S53AC,JN76GB,,,Tili,,IC-746 M2-8wl 600W IC-746 17elDTR MSDSP,08/03 -S53CAB,JN76JG,,,Clubstation,,,08/97 -S53J,JN75EV,EME,,Joze,,144: FT847 4x5wl GS35 ATF43154320,12/04 -S53T,JN75GV,,,Clubstation,,,06/01 -S53VV,JN65UM,EME,,Stane,,144: 250W 16el MutekDTR 3500lpm,01/05 +S52LM,JN65TX,EME,,ex YU3ULM YT3LM,,144: 4X17M2 5WL- FT 1000MP- JAVORNIK 144/14,08/05 +S53AC,JN76GB,,,,,IC-746 M2-8wl 600W IC-746 17elDTR MSDSP,08/03 +S53CAB,JN76JG,,,,,,08/97 +S53J,JN75EV,EME,,,,144: FT847 4x5wl GS35 MGF1801 - 432: IC820H,03/05 +S53RM,JN76JCB,EME,,ex YT3RM,,432: 8 x 8.5wl BV OPT X yagi YL1055 Ampl.,04/05 +S53T,JN75GV,,,,,,06/01 +S53VV,JN65UM,EME,,ex YU3ES,,144: 250W 16el MutekDTR 3500lpm,01/05 S53X,JN65WS,,,,,,11/99 -S54AA,JN76EG,,,Franc ""Lane",,144: IC275H 2x4CX250b (650W) 18el DJ9BV,01/01 -S54M,JN86CL,,,Maki,,FT847 PA060210,05/02 -S55AW,JN75DS,,,Stanko,,144: FT1000MP XVRT GS35b 1KW 2x15elMSDSP.3,05/04 -S55M,JN65XM,,,Adi,,144: 8x3el 1KW,11/01 -S55OO,JN76HD,,,Goran,,50: IC735 40W 5el - 144: IC275H 100W 15QD,06/04 +S54AA,JN76EG,,,not active VHF,,144: IC275H 2x4CX250b (650W) 18el DJ9BV,01/01 +S54M,JN86CL,,,ex 9A4ZM- N1MZ,,FT847 PA060210,05/02 +S54O,JN75NT,,,ex S51MQ,,50: 50W 6el - 144: TH328 KW 4x7el MGF130217,06/05 +S54T,JN75EW,EME,,,,144: 4x 17el M2 GS35B 1KW - 432: FT847 4x 2,05/05 +S55AW,JN75DS,,,ex YT3RY,,144: FT1000MP XVRT GS35b 1KW 2x15elMSDSP.3,05/04 +S55M,JN65XM,,,,,144: 8x3el 1KW,11/01 +S55OO,JN76HD,,,,,50: IC735 40W 5el - 144: IC275H 100W 15QD,06/04 S57A,JN65TW,,,,,,11/99 -S57C,JN76HD,,,Branko,,144: 700W 17el - 432: 400W 8x21DTR,07/96 -S57EA,JN76HE,,,Miran,,144: IC202E 150W 4x6 loop (full elv.) MGF1,01/05 +S57C,JN76HD,,,,,144: 700W 17el - 432: 400W 8x21DTR,07/96 +S57EA,JN76HE,EME,,,,144: IC202E 150W 4x6 loop (full elv.) MGF1,04/05 S57JA,JN76GB,,,,,,11/99 -S57LM,JN76HD,,,Lojze,,.300,04/03 -S57M,JN76PO,EME,,Bojan,,,03/02 -S57MSU,JN76EF,,,Uros,,144: TM255E 500W 2x13el (2.1L) 5°El 15dbon,08/01 -S57QM,JN76,EME,,tone,,,1994 -S57RA,JN75FO,EME,,Paul,,432: 4x 8.5wl dj9bv- 0.3db preamp atf35176- g,08/00 -S57S,JN76JB,,,Aleksander,,144: TS850SAT h.m. transv MGF1302 preamp 3,11/00 -S57TW,JN75EX,EME,,Bojan,,144: IC275H 1500W MGF1302 4x2M28XP085 DTR,08/03 +S57LM,JN76HD,,,,,.300,04/03 +S57MSU,JN76EF,,,,,144: TM255E 500W 2x13el (2.1L) 5°El 15dbon,08/01 +S57S,JN76JB,,,,,144: TS850SAT h.m. transv MGF1302 preamp 3,11/00 +S57TW,JN75EX,EME,,,,144: IC275H 1500W MGF1302 4x2M28XP085 DTR,03/05 S57UUU,JN76EC,,,,,,2003 -S58J,JN76EG,,,Janez,,50: IC756 5el,11/99 -S59A,JN76XP,,,Drago,,,11/95 -S59AX,JN65UU,,,janko,,,1993 +S58J,JN76EG,,,,,50: IC756 5el,11/99 +S59A,JN76XP,,,ex YU3ZV,,,11/95 +S59AX,JN65UU,,,,,,1993 S59DCD,JN76NL,,,,,,2003 S59EA,JN75,,,,,DTR,95 -S59F,JN65TX,,,Ivo,,50: 350w 6el - 70: 50w 5el - 144: 500w,04/03 +S59F,JN65TX,,,ex YU3HNI-YT3ET-S59AM,,50: 350w 6el - 70: 50w 5el - 144: 500w,04/03 +S59MA,JN76FD,EME,,,,,02/05 S59UN,JN76XP,,,,,,2003 +S79HP,LI75,EME,,Expedition,,,01/06 S9TX,JJ30,,,,,,2003 SK0AR,JO99BT,,,,,,1993 SK0CC,JO99BD,,,,,,07/02 -SK0UX,JO99BM,EME,,Clubstation,,,01/05 -SK3AH,JP82XO,,,Clubstation,,,10/02 -SK3JR,JP62WK,,,,,,1992 +SK0UX,JO99BM,EME,,,,,01/05 +SK2AT,KP03DU,,,=7S2AT,,,07/05 +SK3AH,JP82XO,,,,,,10/02 +SK3JR,JP62WK,,,Expedition,,,1992 SK3LH,JP93IH,,,,,,1994 -SK3MF,JP92FW,,,Clubstation,,144: 6x15el 1KW,07/02 -SK3SN,JP80IO,,,Clubstation,,,1994 +SK3MF,JP92FW,,,,,144: 6x15el 1KW,07/02 +SK3SN,JP80IO,,,,,,1994 SK4BZ,JP61QM,,,,,,1994 -SK4EA,JO79CO,,,clubstation,,,1993 -SK6HD,JO68SD,,,OP Fredy (SM6FKF),,144: 150W 2x15el1500lpm,09/04 +SK4EA,JO79CO,,,,,,1993 +SK6HD,JO68SD,,,,,144: 150W 2x15el1500lpm,03/05 SK6YH,JO58,,,,,,08/96 -SK7AX,JO77DS,,,Clubstation,,,07/01 -SK7CY,JO65SN,,,OP SM7MRL SM7NYC,,144:TS850 transverter 130 1000W MGF1302300,05/02 -SK7JC,JO76KF,,,Clubstation,,,08/99 -SL4BP,JP70TO,EME,,OP SM4HFI,,144: 800W 4x9el MGF1302,03/02 -SM0EJY,JO89SC,,,Andrew ""Andy",,144: 500W 10 over 10el Preamp1000 lpm,12/99 -SM0EPO,JO89XM,,,Per Olof,,144: 50W 2x6el,12/03 -SM0EPX,JO89SJ,,,Michael ""Mike",,144:1000 Watt 4CX1500 15el X-Y MGF1802,04/04 +SK7AX,JO77DS,,,,,,07/01 +SK7CY,JO65SN,,,,,144:TS850 transverter 130 1000W MGF1302300,05/02 +SK7JC,JO76KF,,,,,,08/99 +SM0EJY,JO89SC,,,,,144: 500W 10 over 10el Preamp1000 lpm,12/99 +SM0EPO,JO89XM,,,,,144: 50W 2x6el,12/03 +SM0EPO/2,KP07CU,,,Expedition,,,07/05 +SM0EPX,JO89SJ,,,,,144:1000 Watt 4CX1500 15el X-Y MGF1802,04/04 SM0FFS,JO99AG,,,,,,1994 SM0FZH,JO89TG,,,,,,01/97 -SM0HAX,JO99,EME,,Peter,,144: 6x9el (3.5lb) GS35b 1KW 2SK571 0.35dbN,01/01 -SM0IKR,JO99CC,,,Göran,,FT847,02/05 -SM0KAK,JO89XK,,,Lasse,,50: 100W 6el - 144: 180W 17el1600lpmtx 1000lp,08/03 -SM0LCB,JO99,,,Ulf,,,04/04 -SM0LQB,JO89XK,,,Stellan ""Stan",,144: 15el 130W - 432: 4W 21el,04/04 +SM0HAX,JO99,EME,,,,144: IC820 6x 12el I0JXX 2x GU74b P-hemt,08/05 +SM0IKR,JO99CC,,,,,FT847,02/05 +SM0KAK,JO89XK,,,,,50: 100W 6el - 144: 180W 17el1600lpmtx 1000lp,08/03 +SM0LQB,JO89XK,,,,,144: 15el 130W - 432: 4W 21el,04/04 SM0MXR,JO89WE,,,,,,2003 -SM0NKZ,JO99IQ,,,johan,,,03/02 -SM0OUG,JO89VG,,,Lasse,,,10/96 -SM0PYP,JO89XG,EME,,paul,,,1994 -SM0TSC,JO99CF,,,Johan,,FT817,11/04 -SM1BSA,JO97DP,,,Arne,,144: FT736r 500W 2x9elDTR,05/04 -SM1HPV,JO97HO,,,Karl-Gunnar,,144: 200Watts 2x15ele,01/02 -SM1SBI,JO97FK,EME,,Pontus,,144: 2x17el 800W315,05/02 +SM0NKZ,JO99IQ,,,,,,03/02 +SM0OUG,JO89VG,,,,,,10/96 +SM0TSC,JO99CF,,,,,FT817,11/04 +SM1BSA,JO97DP,,,NO SKEDS !!,,144: FT736r 500W 2x9elDTR,05/04 +SM1HPV,JO97HO,,,,,144: 200Watts 2x15ele,01/02 +SM1SBI,JO97FK,EME,,,,144: 2x17el 800W315,05/02 SM2AZG,KP03,,,,,,03/02 SM2BLY,KP05RJ,,,,,,1993 -SM2BYA,KP07DU,EME,,Gudmund,,144: FT1000 4x3.2wl CueDee 3CX1000A7 MGF110,08/00 -SM2CEW,KP15CR,EME,,Peter,,144: 6x19el 1KW120 1200lpm,01/05 -SM2CKR,KP03DQ,EME,,Mats,,,07/99 -SM2ECL,KP05RH,,,Anders ""Anti",,144: 200W 4x15el 60m asl150lpm,07/03 -SM2EKM,KP05UW,EME,,Jan Erik ""Jim",,,04/03 +SM2BYA,KP07DU,EME,,,,144: FT1000 4x3.2wl CueDee 3CX1000A7 MGF110,08/00 +SM2CEW,KP15CR,EME,,,,144: 6x19el 1KW120 1200lpm,04/05 +SM2CKR,KP03DQ,EME,,,,,07/99 +SM2ECL,KP05RH,,,,,144: 200W 4x15el 60m asl150lpm,07/03 +SM2EKM,KP05UW,EME,,,,,04/03 SM2GCR,JP93TK,,,,,,07/00 -SM2GGF,KP05DV,,,,,,1984 -SM2ILF,KP04,,,S.,,,12/04 -SM2IUE,JP85,,,Enfried,,,1993 -SM2IZV,JP84,,,peter,,,1993 +SM2GGF,KP05DV,,,SilentKey,,,1984 +SM2ILF,KP04NP,EME,,,,IC910H 144: 6x16 el I0JXX 1kw 432: 4x32 el,04/06 +SM2IUE,JP85,,,,,,1993 +SM2IZV,JP84,,,,,,1993 SM2LKW,KP15BO,,,,,,1994 -SM2LTA,JP94CW,,,Assar,,DTR+,04/98 -SM2ODB,KP03EU,,,Peter,,144: 100W 15el1200lpm,03/02 -SM2VBK,KP15BO,,,Mikael,,,08/02 -SM3AKW,JP92AO,EME,,Carl G.,,144: 2x17LB 1KW - 432: 16x21el 1KW - 1296 4x2,04/00 -SM3AZV,JP83,,,Thorsten,,,1993 -SM3BEI,JP81NG,,,Lennart,,144: 100W 432: 500W 1296: 130W 2320: 120,12/04 -SM3BIU,JP73ST,,,Bas,,,01/97 -SM3BYA,JP81NX,EME,,Gudmund,,432: 450W 8x21el MGF1412,12/00 -SM3COL,JP82,,,Rolf,,,11/96 -SM3GHB,JP72,,,Bentgerik,,,1993 -SM3GHD,JP62,,,lars,,,1993 -SM3IEK,JP82MO,,,Kenneth,,144: 100Watt 15el,01/03 -SM3JBO,JP93IH,,,,,,03/04 -SM3JGG,JP71WJ,,,Staffan,,,07/02 -SM3JLA,JP93LH,,,Mikael,,144: 250W 15eltx1500 3000lpm,06/99 +SM2LTA,JP94CW,,,,,DTR+,04/98 +SM2ODB,KP03EU,,,not qrv MS nw! (01/01),,144: 100W 15el1200lpm,03/02 +SM2VBK,KP15BO,,,,,,08/02 +SM3AKW,JP92AO,EME,,,,144: 2x17LB 1KW - 432: 16x21el 1KW - 1296 4x2,04/00 +SM3AZV,JP83,,,Silent Key,,,1993 +SM3BEI,JP81NG,,,ex SM5BEI,,144: 100W 432: 500W 1296: 130W 2320: 120,12/04 +SM3BIU,JP73ST,,,,,,01/97 +SM3COL,JP82,,,,,,11/96 +SM3GHB,JP72,,,,,,1993 +SM3GHD,JP62,,,,,,1993 +SM3IEK,JP73IT,,,,,144: 100Watt 15el,03/06 +SM3JBO,JP93IH,,,,,144: 2x 10el 200W,08/05 +SM3JGG,JP71WJ,,,,,,07/02 +SM3JLA,JP93LH,,,,,144: 250W 15eltx1500 3000lpm,06/99 SM3KJO,JP92DX,,,,,only SSB-MS,08/97 -SM3KYH,JP82NL,,,Lars,,,04/04 -SM3LBN,JP80IO,,,Hakan,,,08/03 -SM3LGO,JP83VB,,,Mats,,144: 1KW 80el Colineartx2000 rx1500lpm,01/99 -SM3MXR,JP80GR,EME,,Einar,,144: 4x17el M2 emepwr5000lpm,08/01 -SM3PWM,JP81GF,EME,,Sverker,,,12/99 -SM3PXO,JP73GI,,,Petter,,144: 400W 17el 5wl - 50: 50W 9el 2wl,04/03 -SM3RLJ,JP93OI,,,Mikael,,144: 100W 15el1500lpm,07/97 -SM3RPQ,JP74BT,,,Leif,,,04/03 -SM3RWZ,JP82MI,,,Tony,,ICOM IC-275H 200W 9 ele,10/04 -SM3TFR,JP93IG,EME,,goeran,,,1994 -SM3VAC,JP83VA,,,Magnus,,144: 2x17el 1KWMSDSP,08/01 -SM3VEE,JP81VI,,,Anders,,,03/98 -SM3XGV,JP81OF,,,Anders,,TS2000,08/04 -SM4ANQ,JP70OC,,,Ulf,,,02/02 -SM4DHN,JP60VQ,EME,,Lars Bertil,,,01/01 -SM4FXR,JO79OF,,,Christer,,,01/05 -SM4IVE,JO79SD,EME,,Lars,,,08/00 -SM4KYN,JO79,,,anders,,,1993 -SM4POB,JP70FK,,,per,,,1995 -SM4RPQ,JO79HH,,,Leif ""Alf",,TS2000,07/04 -SM4VQP,JO79NB,EME,,Lars,,144: 4x17el eme-pwr,01/02 -SM5BSZ,JO89IJ,EME,,Leif,,,07/99 -SM5CBN,JO78NH,,,len,,,1993 -SM5CFS,JO99IQ,EME,,Bjorn,,144: 4x16el QBL5/3500 1.5KW,11/01 -SM5CUI,JO89WW,EME,,Rune,,,01/05 -SM5DCX,JO89OI,,,Lars,,,01/01 -SM5DIC,JO89JT,,,Ragge ""Gus",,144: 13el 400W MGF1302,07/04 -SM5DRV,JO77MV,,,Lars,,144: IC-275H 100W 13el yagi2000lpm,07/04 -SM5FRH,JO88BW,EME,,Torbjoern ""Tobben",,144: 32x19el horz. or 32x10el vert..017,10/00 +SM3KYH,JP82NL,,,,,,04/04 +SM3LBN,JP80IO,,,,,,08/03 +SM3LGO,JP83VB,,,,,144: 1KW 80el Colineartx2000 rx1500lpm,01/99 +SM3MXR,JP80GR,EME,,,,144: 4x17el M2 emepwr5000lpm,08/01 +SM3PWM,JP81GF,EME,,,,,12/99 +SM3PXO,JP73GI,,,,,144: 400W 17el 5wl - 50: 50W 9el 2wl,04/03 +SM3RLJ,JP93OI,,,,,144: 100W 15el1500lpm,07/97 +SM3RPQ,JP74BT,,,,,,04/03 +SM3RWZ,JP82MI,,,,,ICOM IC-275H 200W 9 ele,10/04 +SM3VAC,JP83VA,,,,,144: 2x17el 1KWMSDSP,08/01 +SM3VEE,JP81VI,,,,,,03/98 +SM3XGV,JP81OF,,,,,TS2000,08/04 +SM4ANQ,JP70OC,,,,,,02/02 +SM4DHN,JP60VQ,EME,,,,,01/01 +SM4FXR,JO79OF,,,,,,01/05 +SM4KYN,JO79,,,,,,1993 +SM4POB,JP70FK,,,not qrv MS nw! (01/01),,,1995 +SM4RPQ,JO79HH,,,,,TS2000,08/05 +SM4SJY,JP70OC,EME,,,,IC706MK2G 144: 9el 600W,09/05 +SM5BSZ,JO89IJ,EME,,NO SKEDS !!,,,07/99 +SM5CBN,JO78NH,,,,,,1993 +SM5CUI,JO89WW,EME,,,,144: 8x 10el 800W,07/05 +SM5DCX,JO89OI,,,,,,01/01 +SM5DIC,JO89JT,,,,,144: 13el 400W MGF1302,07/04 +SM5DRV,JO77MV,,,= SM0DRV,,144: IC-275H 100W 13el yagi2000lpm,07/04 +SM5FRH,JO88BW,EME,,,,144: 32x19el horz. or 32x10el vert..017,10/00 SM5GEP,JO77IP,,,,,,2003 -SM5IOT,JO99,EME,,Christer,,144: 8x9el vargarda GS35b MGF1801,10/00 -SM5LE,JO99bd,EME,, -SM5TSP,JP90CE,EME,,Lars,,144: 4x15el 750W2500lpm,07/03 -SM6AEK,JO66,,,goran,,,1993 -SM6AFH,JO66LQ,,,thomas,,DTR,1994 -SM6CEN,JO57XO,,,Hank,,,03/02 -SM6CKU,JO67,EME,,Bengt-Arne,,,10/00 -SM6CMU,JO57XK,,,Ingemar ""Ingo",,IC706MkIIg 50: 100 Watt 6el - 144: 9el NE7,05/04 -SM6CWM,JO67,EME,,ingemar,,,1994 -SM6EAN,JO57WQ,,,Mats,,144: 600W 10elDTR tx 3000lpm,01/01 -SM6EUP,JO57XQ,EME,,hans,,,1994 -SM6FKF,JO68SD,,,Fredy,,,04/04 +SM5IOT,JO99BX,EME,,,,50: 2x 6el I0JXX - 144: 8x 8el I0JXX 2xGU74B,03/06 +SM5LE,JO99BD,EME,,,,,04/06 +SM5TSP,JP90CE,EME,,,,144: 4x15el 750W2500lpm,07/03 +SM6AEK,JO66,,,,,,1993 +SM6AFH,JO66LQ,,,,,DTR,1994 +SM6CEN,JO57XO,,,,,,03/02 +SM6CMU,JO57XK,,,,,IC7400 100-400W 50: 6el - 144: 9el167 250,08/05 +SM6EAN,JO57WQ,,,,,144: 600W 10elDTR tx 3000lpm,01/01 +SM6FKF,JO68SD,,,,,,03/05 SM6FUD,JO68JV,,,,,,12/04 -SM6KJX,JO67CK,,,Janne,,FT736DTR,07/04 -SM6NET,JO68SD,,,Tony,,144: 100Watt 17el - 432: 50Watt 21el,01/05 -SM6TZX,JO67EE,,,CHRISTER,,,05/02 -SM6U,JO67AT,,,OP SM6USS,,144: FT290 9el 25W,05/00 -SM6UMO,JO68DH,,,Mikael,,144: TR751 170W 2x13el SP2000rx3000 tx1200,1994 -SM6USS,JO67AT,,,Dennis,,144: FT290 9el 25Wonly SSB-MS.290,07/97 -SM7AED,JO65NI,,,Arne,,144: 50W 5el.170 rx1000lpm,03/02 -SM7BAE,JO65,EME,,K.,,144: 24x20el,10/98 -SM7CMV,JO65AM,,,Ken,,50: IC735 25W 5el,01/97 +SM6KJX,JO67CK,,,,,FT736DTR,07/04 +SM6MVE,JO67KW,,,,,50: 10W 3el 144: 25W 4x9el SP2 432: 75W 4x1,03/06 +SM6NET,JO68SD,,,,,144: 300Watt 2x 17el - 432: 50Watt 21el,03/06 +SM6TZX,JO67EE,,,,,,05/02 +SM6U,JO67AT,,,SpecialCall,,144: FT290 9el 25W,05/00 +SM6UMO,JO68DH,,,,,144: TR751 170W 2x13el SP2000rx3000 tx1200,1994 +SM6USS,JO67AT,,,,,144: FT290 9el 25Wonly SSB-MS.290,07/97 +SM7AED,JO65NI,,,,,144: 50W 5el.170 rx1000lpm,03/02 +SM7BAE,JO65OP,EME,,,,50: 8x 9el - 144: 8x20el LBX QRO MGF1801,02/06 +SM7CMV,JO65AM,,,,,50: IC735 25W 5el,01/97 SM7EAN,JO86,,,,,,07/99 -SM7EOI,JO86FP,,,Toby,,IC7400,01/04 -SM7FJE,JO65ML,EME,,Bob,,,01/05 +SM7EOI,JO86FP,,,,,IC7400,01/04 +SM7FJE,JO65ML,EME,,,,,01/05 SM7FMX,JO65KN,,,,,,08/04 -SM7FWZ,JO78,,,Ronny,,,03/03 -SM7GVF,JO76JV,EME,,Kjell,,,03/02 -SM7IWG,JO77IP,,,Carl,,,04/04 -SM7JUQ,JO65WX,,,Harald,,50: 100W 5el - 144: 750W 9el - 432: 50W 19el5,08/04 -SM7KNK,JO75,,,K.,,,1993 -SM7MRL,JO65NP,,,Ingvar,,144: TS850 transverter 130 1000W MGF1302300,03/03 +SM7FWZ,JO78,,,,,,03/03 +SM7IWG,JO77IP,,,,,,04/04 +SM7JUQ,JO65WX,,,,,50: 100W 5el - 144: 750W 9el - 432: 50W 19el5,08/04 +SM7KNK,JO75,,,,,,1993 +SM7MRL,JO65NP,,,,,144: TS850 transverter 130 1000W MGF1302300,03/03 SM7MXO,JO77,,,,,,07/04 -SM7NNJ,JO86DQ,,,Sven Ake,,50: IC290 - 144: FT726R 100W 15el MGF1302255,01/02 -SM7OYP,JO66JA,,,Lars,,50: 100W 5el,09/01 -SM7SCJ,JO65QJ,EME,,Richard ""Ric",,,10/02 -SM7THS,JO76WR,,,Sverker,,144: 15el 170W MGF1302DTR,11/99 -SM7TJC,JO67SH,EME,,Anders,,144: FT-225RD 2xGi7b (800W) - 432: FT-757GX,05/02 -SM7TUG,JO65OT,,,Hans,,144: 2x4CX250b 17el MGF1302DTR,08/98 -SM7WSJ,JO67WI,EME,,Hakan,,144: 2x M2 28XP 1KW MGF1302 - 432: 18el hom,04/03 -SM7WT,JO65QQ,,,Sten,,,06/01 -SO4DFC,KO13AX,,,,,,1992 -SO4TEC,KO13CW,EME,,,,183383,06/02 -SO5AS,KO02JD,,,Stephen ""Steve",,50:100Watt 3el 144:130Watt 14el105 2500lpm MS,08/04 -SO9AN,JO84NG,,,,,.133,05/00 -SO9FB,JO84NG,,,,,.122,05/00 -SP1JVG,JO84LL,,,Miroslaw,,only SSB-MS,02/01 -SP1NQE,JO84LL,,,Bogdan ""Bodo",,TS746 TS811E,04/04 -SP2CHY,JO94GO,,,Wojtek,,,02/05 +SM7NNJ,JO86DQ,,,,,50: IC290 - 144: FT726R 100W 15el MGF1302255,01/02 +SM7OYP,JO66JA,,,,,50: 100W 5el,09/01 +SM7SCJ,JO65QJ,EME,,,,,10/02 +SM7THS,JO76WR,,,,,144: 15el 170W MGF1302DTR,11/99 +SM7TUG,JO65OT,,,,,144: 2x4CX250b 17el MGF1302DTR,08/98 +SM7WSJ,JO67WI,EME,,,,144: 2X16 optimized for EME 1KW - 432mhz 2X1,10/05 +SM7WT,JO65QQ,,,,,,11/05 +SO4DFC,KO13AX,,,Expedition,,,1992 +SO4TEC,KO13CW,EME,,Expedition QSL via DL3BQA,,183383,06/02 +SO5AS,KO02JD,EME,,QSL via G4ASL or LOTW,,50: GS31b 5el 144: 150Watts 14el (no ant.,04/06 +SO9AN,JO84NG,,,Expedition,,.133,05/00 +SO9FB,JO84NG,,,Expedition,,.122,05/00 +SP1JVG,JO84LL,,,= KG2IS,,only SSB-MS,02/01 +SP1NQE,JO84LL,,,,,TS746 TS811E,04/04 +SP2CHY,JO94GO,,,ex SP4CHY,,,02/05 SP2FAX,JO83VA,,,,,144: 2KW 6x17el,08/03 SP2HAX,JO83,,,,,,12/ 9 -SP2HNF,JO94FK,,,,,,01/99 -SP2IQW,JO94GM,,,Michal ""Mike",,50: FT690S 5el - 144: 100W 2M5WL305/360,09/04 +SP2HNF,JO94FK,,,,,,10/05 +SP2IQW,JO94GM,,,,,50: TS690S 5el - 144: TR751A 150W 2M5WL305/3,02/05 SP2JAN,JO94,,,,,,09/94 -SP2JYR,JO92QP,,,Ryszard,,,04/04 -SP2MKI,JO93AC,,,Darek,,,03/02 -SP2MKO,JO93CB,,,,,,05/04 -SP2MSL,JO92NM,,,Andrzej,,only SSB-MS,01/97 -SP2NJI,JO92MP,,,Wieslaw,,50: IC736 100W 5el - 144: IC271 150W 21el - 4,10/99 -SP2OFW,JO93AC,EME,,Wojtek,,144: 2xGS35b 2x15el,01/05 +SP2JYR,JO92QP,,,,,,04/04 +SP2MKI,JO93AC,,,,,,03/02 +SP2MKO,JO93CB,,,,,icom706mkIIg tm255a,08/05 +SP2MSL,JO92NM,,,,,only SSB-MS,01/97 +SP2NJI,JO92MP,,,,,50: IC736 100W 5el - 144: IC271 150W 21el - 4,10/99 +SP2OFW,JO93AC,EME,,,,144: 2xGS35b 2x15el,05/05 SP2SGZ,JO82UU,,,,,,7/96 SP3EPX,JO83ID,,,,,,11/01 SP3FSM,JO81GU,,,,,,08/02 -SP3MFI,JO91,,,st.,,only SSB-MS,1993 -SP3RNW,JO81GQ,,,Leszek,,50: 100W -144: 200W 11el MGF1302 - 432: 100W,08/03 +SP3MFI,JO91,,,,,only SSB-MS,1993 +SP3RNW,JO81GQ,,,,,50: 100W -144: 200W 11el MGF1302 - 432: 100W,08/03 SP3RNZ,JO92DF,EME,,,,IC746 7el TAGI245,09/03 -SP3SUX,JO72OR,,,Irek,,144: 80W 14el BF981,12/96 -SP3VSC,JO92DF,,,Jack,,144: IC746 2X13B2 PA GS35B,01/04 +SP3SUX,JO72OR,,,,,144: 80W 14el BF981,12/96 +SP3VSC,JO92DF,,,,,144: IC746 2X13B2 PA GS35B,01/04 SP4BY,KO13OD,,,,,,07/04 SP4DGN,KO13OD,,,,,,1988 -SP4JCQ,KO13NC,,,Gene,,FT920 IC910H 144: 100W 17el,02/05 -SP4MPB,KO03HT,EME,,Marek,,144: IC746 GS35b MGF1302 - 10GHZ: 5W 120cm,02/04 -SP5CCC,KO02NF,,,Tomasz ""Tom",,,10/02 -SP5CJT,KO02OD,EME,,mike,,,1994 -SP5EFO,KO02,EME,,leszek,,,04/97 -SP5HEJ,KO02,,,Marek,,,01/97 -SP5KVW,KO03SB,,,,,,1989 +SP4JCQ,KO13NC,,,,,FT920 IC910H 144: 100W 17el,02/05 +SP4MPB,KO03HT,EME,,,,144: IC746 GS35b MGF1302 17B2 - 10GHZ: 5W 1,04/06 +SP5CCC,KO02NF,,,,,,10/02 +SP5EFO,KO02,EME,,silent Key,,,04/97 +SP5HEJ,KO02,,,,,,01/97 +SP5KVW,KO03SB,,,Expedition,,,1989 SP5LJX,KO03,,,,,,08/02 -SP5QWB,KO02NF,,,Bart,,50: 400W 7el - 144: 1KW 17el - 432: 50W 26el,05/04 -SP5XMU,KO02LG,,,Tomasz ""Tom",,50: 100W 6el 144: 170W 13el 432: 50W 21el,08/04 -SP6A,JO81NG,EME,,Zbigniew,,,11/03 -SP6ASD,JO81LC,,,Tadek,,180lpm,05/02 +SP5QWB,KO02NF,,,,,50: 400W 7el - 144: 1KW 17el - 432: 50W 26el,05/04 +SP5XMU,KO02LG,,,,,50: 100W 6el 144: 170W 13el 432: 50W 21el,08/04 +SP6A,JO81NG,EME,,ex SP6AZT,,,11/03 +SP6ASD,JO81LC,,,,,180lpm,05/02 SP6AZT,JO81NG,,,,,,2003 SP6CPH,JO81,,,,,,09/01 -SP6GVU,JO81LC,,,Andrzej (Andy),,144: 17el F9FT 200W MGF1302.073.273,02/01 -SP6GWB,JO80HK,EME,,Staszek ""Stan",,50: FT847 1 kW 9 el (2 lambda) - 144: FT8,02/05 -SP6GZZ,JO80FX,,,Roman,,3000lpm MSDSP200,10/04 -SP6IWQ,JO80HK,,,Bogdan,,TR751e FT757gxII Trnsv 100W Pas,11/04 -SP7BUZ,KO00HU,,,Marcin,,,04/04 -SP7DCS,JO91RT,EME,,Krzysztov ""Chris",,144: FT736r DSP GS35vb (21el.horz.+ 21el.ver,01/01 -SP7EBM,JO91QR,,,Wiktor,,.070.350.,01/02 +SP6GVU,JO81LC,,,,,144: 17el F9FT 200W MGF1302.073.273,02/01 +SP6GWB,JO80HK,EME,,,,50: FT847 1 kW 9 el (2 lambda) - 144: FT8,03/05 +SP6GZZ,JO80FX,,,,,3000lpm MSDSP200,10/04 +SP6HED,JO80IK,EME,,,,144: 13el 100W,07/05 +SP6IWQ,JO80HK,,,,,TR751e FT757gxII Trnsv 100W Pas,11/04 +SP7BUZ,KO00HU,,,ex SQ7IKT,,,04/04 +SP7EBM,JO91QR,,,,,.070.350.,01/02 SP7JSG,KO01BW,,,,,,03/02 -SP7OGP,KO01AM,,,Piotr,,50: 100W - 144: IC706MKIIG 14el 9BV 50W BF9,01/05 +SP7OGP,KO01AM,,,,,50: 100W - 144: IC706MKIIG 12el 7ZB 50W BF9,08/05 SP7VC,JO91SS,,,,,,10/04 -SP8AOV,KO11GG,,,Zbigniew ""Zbig",,144: FT480r 100W 2x10el1000lpm,03/00 -SP8NCJ,KO12NA,,,A.,,,11/95 -SP8RHP,KO10FF,,,Robert,,144: 200W 10el DJ9BV122 2000lpm379,12/04 -SP8SN,KO11GG,,,Robert,,,07/04 +SP8AOV,KO11GG,,,,,144: FT480r 100W 2x10el1000lpm,03/00 +SP8NCJ,KO12NA,,,,,,11/95 +SP8RHP,KO10FF,,,,,144: 200W 10el DJ9BV122 2000lpm379,02/05 +SP8SN,KO11GG,,,ex SQ8GKQ,,,07/04 SP8UFT,KO11JI,,,,,,01/02 -SP9COO,JO90GA,,,Grzegorz ""Greg",,144: IC251 + PA 100Watt 44el YU0B MGF13020,04/04 -SP9EWO,JN99HW,,,Janusz,,.423.423,12/99 -SP9EWU,JO90NH,EME,,Wojciech,,,07/03 -SP9KUR,KO00MA,,,,,,1993 -SP9LCV,JO90KF,,,Michal,,,05/02 -SP9MRT,JO90KG,,,Sebastian,,.080,12/95 -SP9PRO,JN99,,,Clubstation,,,03/97 +SP8WJW,KN09SR,,,,,144: 50W 9el,03/06 +SP8YLU/P,KO20AQ,,,Expedition,,144: GS31 8ele DK7ZB MGF4919388,01/05 +SP9COO,JO90GA,,,,,144: IC251 + PA 100Watt 44el YU0B MGF13020,04/04 +SP9EWO,JN99HW,,,,,.423.423,12/99 +SP9EWU,JO90NH,EME,,= SQ9W,,,07/03 +SP9KUR,KO00MA,,,Expedition,,,1993 +SP9LCV,JO90KF,,,,,IC-756pro IC735 TRC PA GI7 home made1353,03/06 +SP9PRO,JN99,,,,,,03/97 SP9PZU,JO90,,,,,,07/96 SP9QMP,JO90FB,,,,,,08/02 -SP9TCE,JO90,,,Jurek,,DTR,08/98 -SP9TTG,JO90NU,,,Peter,,144: 100W LY,05/04 +SP9TCE,JO90,,,,,DTR,08/98 +SP9TTG,JO90NU,EME,,,,144: 100W 4x 5el,04/06 SP9UX,KO00XA,,,,,,07/04 -SQ7DQX,JO91RR,,,Mateusz,,144: 13el 50W,11/04 -SQ8GUP,KN09VQ,,,Waclaw,,,04/01 -SQ9PM,JN99MT,,,Maciek,,FT847 50: 6el - 144: 14el - 432: 29elM,08/03 -SQ9PV,JO90KF,,,Jacek,,,01/03 -SQ9W,JO90NH,EME,,Wojciech,,,07/03 -ST2RS,KK65GN,EME,,Bob,,50: 6el 1KW 144: 4x 8el 140W,01/05 -SV0EC,KN10CJ,EME,,Hardy,,144: TS770 700W 20el Gruppeonly SSB-MS,02/99 +SQ7DQX,JO91RR,,,,,144: 13el 50W,11/04 +SQ8GUP,KN09VQ,,,,,,04/01 +SQ9PM,JN99MT,,,ex SQ9HYM,,FT847 50: 6el - 144: 14el - 432: 29elM,08/03 +SQ9PV,JO90KF,,,,,,01/03 +SQ9QU,JO90KH,,,ex SP9MRT,,144: TM 255A 40W 15 el yagi LCF 78-50 coax,07/05 +SQ9W,JO90NH,EME,,=SP9EWU,,,07/03 +ST2RS,KK65GN,EME,,= ZL1RS,,50: 6el 1KW 144: 4x 8el 140W,01/05 +SV/OE6IWG,KM19UW,,,Expedition,,,08/06 +SV0EC,KN10CJ,EME,,,,144: TS770 700W 20el Gruppeonly SSB-MS,02/99 SV1AAF,KM17VX,EME,,,,,1992 -SV1AB,KM18,,,l.,,,1993 -SV1BTR,KM18NO,EME,,Dimitris ""Jimmy",,144: FT847 4x17el. (F9FT) 1.5KW - 432: 8x 3,01/05 -SV1WE,KM18VA,,,Teo,,144: 500W 17el1000lpm,07/98 -SV2DCD,KN00NF,,,,,,10/04 -SV2EVS,KN10KP,,,Spiros,,,04/02 -SV2JL,KN10LO,,,Fotis,,,06/04 -SV3KH,KM07PQ,EME,,Nikos,,144: 100W 12elonly SSB-MS,12/04 +SV1AB,KM18,,,SilentKey,,,1993 +SV1AWE,KM17VU,EME,,,,432: 4x 21el 1500W,09/05 +SV1BTR,KM18NO,EME,,,,144: FT847 16x 6el X-Pol 1.5KW - 432: 8x 2,04/06 +SV1WE,KM18VA,,,,,144: 500W 17el1000lpm,07/98 +SV2DCD,KN00LI,,,,,,10/04 +SV2EVS,KN10KP,,,,,,04/02 +SV2JL,KN10LO,,,,,,06/04 +SV3KH,KM07PQ,EME,,,,144: 4x 28el Xpol KWonly SSB-MS,07/05 SV5BY,KM46CG,,,,,,2003 -SV5BYR,KM46CG,,,Mike,,144: FT847 2x13el 1KW MGF1302,05/04 -SV8CS,KM07JS,,,Spiros,,144: IC821 + TS2000 17el or 9el Cross 300W,01/05 +SV5BYR,KM46CG,EME,,,,144: FT847 2x 13el 600W MGF1302,01/06 +SV8CS,KM07JS,EME,,= KC2INN,,50: 2x 7el 1KW - 144: IC821 TS2000 4x 16el,04/05 +SV8KOM,KM07KS,EME,,,,144: 2x 9el 180W,05/06 T33C,RI49XC,,,,,,2003 -T49C,FL11SG,,,OP Oscar CO2OJ,,50: 4el 100W - 144: 9el 120W - 432: 17el 100W,11/97 -T77WI,JN63FW,,,OP DL3YEL- DJ2QV,,144: 350W 9el 11el,06/98 -T90M,JN82TW,,,,,,08/96 -T90N,JN82TW,,,,,,08/96 -T94KU,JN94JF,,,Esho,,144: FT480r 6el 50Wonly SSB-MS,01/00 +T49C,FL11SG,,,Contestcall,,50: 4el 100W - 144: 9el 120W - 432: 17el 100W,11/97 +T77WI,JN63FW,,,Expedition - QSL via DJ2QV,,144: 350W 9el 11el,06/98 +T90M,JN82TW,,,Expedition,,,08/96 +T90N,JN82TW,,,Expedition,,,08/96 +T94KU,JN94JF,,,,,144: FT480r 6el 50Wonly SSB-MS,01/00 T94ZQ,JN94FP,,,,,only SSB-MS,07/99 -T98CHR,JN84AX,EME,,OP: PA2CHR- PE1LWT,,,04/99 -T98GTH,JN84UU,,,Gigi,,,01/05 -T98LWT,JN84AX,EME,,OP: PA2CHR- PE1LWT,,,04/99 -T9SO,JN94IM,,,Zel,,144: FT480r 8el 150Wonly SSB-MS,08/98 -TF3EJ,HP84,,,Jakob,,,10/95 -TF8ITT,HP94CD,,,Jonas,,144: 1KW ERP,08/02 -TK1DX,JN42RM,,,OP TK5GF,,144: 8el 200W,01/99 -TK5EP,JN41IW,,,Patrick,,144: 400W 9el or 16el 900m.asl.,11/01 -TK5JJ,JN41JW,,,Jan Jacques ""JJ",,144: 3CX800a7 2x 10el DJ9BV MGF1302090,04/03 -TM1E,JN13,,,OP F5SJP- F1JRD,,144: TS790 180W 17B2TX1200 RX 5000lpm,12/99 -TM6OLW,JN37,,,,,,01/05 +T98CHR,JN84AX,EME,,Expedition,,,04/99 +T98GTH,JN84OT,EME,,,,FT897 150watt 16 el F9FT,09/05 +T98LWT,JN84AX,EME,,Expedition,,,04/99 +T9SO,JN94IM,,,Special-Pfx,,144: FT480r 8el 150Wonly SSB-MS,08/98 +TA1D,KN41LB,,,,,144: 150W 2x 9el,10/05 +TA2ZAF,KM69KV,,,ex TA2/OK1MU,,144: 500W 1x 6m long Yagi355,01/06 +TF3EJ,HP84,,,,,,10/95 +TF8ITT,HP94CD,,,,,144: 1KW ERP,08/02 +TK/DJ2GM,JN41,,,Expedition,,,05/06 +TK1DX,JN42RM,,,,,144: 8el 200W,01/99 +TK5EP,JN41IW,,,,,144: 400W 9el or 16el 900m.asl.,11/01 +TK5JJ,JN41JW,,,ex FC6ABP,,144: 3CX800a7 2x 10el DJ9BV MGF1302090,04/03 +TM0EME,IN88QM,EME,,Expedition QSL via ON4DPX,,144: 2x 10el 200W,08/05 +TM1E,JN13,,,SpecialCall,,144: TS790 180W 17B2TX1200 RX 5000lpm,12/99 +TM6OLW,JN37,,,SpecialCall,,,01/05 TO4E,LG07EQ,,,,,,2003 -TS7N,JM54NQ,,,OP DL6SAQ- 1GGT uva,,144: IC275 HLV600 2x7el FX213MSDSP,11/00 -TV6YGS,IN86,,,,,,1987 +TS7N,JM54NQ,,,Expedition,,144: IC275 HLV600 2x7el FX213MSDSP,11/00 +TV6YGS,IN86,,,Expedition,,,1987 +UA0SNV,OO17IW,EME,,,,432: 21el 50W,10/05 UA1AFA,KO59EV,,,,,,08/02 -UA1ARX,KO48VR,,,OP at RU1AA,,,08/04 -UA1C,KO58BR,,,OP R3VHF,,,1993 -UA1CEA,KO69,,,Roman,,,04/99 -UA1MC,KO59DW,,,Slava,,,08/04 -UA1NAN,KP71ES,,,Eugen,,IC260,01/03 -UA1OLJ,LP03DC,EME,,Vladimir,,144: 150W 9el,12/99 +UA1ARX,KO48VR,,,Expedition,,,08/04 +UA1C,KO58BR,,,Expedition,,,1993 +UA1CEA,KO69,,,,,,04/99 +UA1MC,KO59DW,,,,,,08/04 +UA1NAN,KP71ES,,,,,IC260,01/03 +UA1OLJ,LP03DC,EME,,,,144: 150W 9el,12/99 UA1QV,LO08IW,,,,,144: 300W,06/99 UA1UM,KO68WJ,,,,,,1988 -UA1WER,KO47EU,,,Igor,,144: 50W 4x17el QSL via DL9USA,01/02 +UA1WER,KO47EU,,,,,144: 50W 4x17el QSL via DL9USA,01/02 UA1ZCG,KP59JK,,,,,,2003 -UA1ZCL,KP78TX,EME,,Alex p.,,,1992 +UA1ZCL,KP78TX,EME,,not qrv MS nw,,,1992 UA2FF,KO04,,,,,,12/04 -UA2FL,KO04FQ,,,slava,,,06/97 -UA3AOG,KO85SQ,,,Igor,,144: IC706 100W 11el1000lpm,07/00 -UA3ARC,KO85SO,,,Alexander,,144 :IC-275H GS-35B MGF1302 2M18XXX,07/04 -UA3DHC,KO96CB,,,Alexandr ""Alex",,,04/04 +UA2FL,KO04FQ,,,,,,06/97 +UA3AHM/1,KO55MS,,,,,,01/05 +UA3AOG,KO85SQ,,,,,144: IC706 100W 11el1000lpm,07/00 +UA3ARC,KO85SO,,,,,144 :IC-275H GS-35B MGF1302 2M18XXX,07/04 +UA3DHC,KO96CB,,,,,,04/04 UA3DJG,KO95CN,,,,,144: 11el 800W,07/03 -UA3GA,KO92GO,,,Edward,,,11/04 -UA3IAG,KO77FN,,,Boris A.,,,09/99 -UA3IDQ,KO66JF,,,Victor,,,06/00 +UA3GA,KO92GO,,,,,,11/04 +UA3IAG,KO77FN,,,,,,07/05 +UA3IDQ,KO66JF,,,,,,06/00 UA3MAS,KO97ST,,,,,,1994 -UA3MBJ,KO88SA,EME,,"Nick",,,01/05 -UA3MEE,KO97XN,,,Victor,,,03/01 +UA3MBJ,KO88SA,EME,,QSL via DK3WG,,,01/05 +UA3ME,KO97TS,,,ex UA3MEE,,,07/05 UA3MHJ,KO87SR,,,,,,2003 -UA3OG,LO07KS,,,Serge,,,1992 +UA3OG,LO07KS,,,,,,1992 UA3PBR,KO93BD,,,,,,1986 UA3PBT,KO84UF,,,,,,1982 -UA3PC,KO84PC,,,Valery,,,08/04 -UA3PTW,KO93BS,EME,,Dima,,144: 16el DJ9BV 1KW - 432: 8 yagis 200W,04/01 +UA3PC,KO84TF,,,,,144: 13el 1KW,08/05 +UA3PTW,KO93BS,EME,,,,144: 16el DJ9BV 1KW - 432: 8 yagis 200W,04/01 UA3QHS,KO91QR,,,,,,1981 -UA3QR,KO92KA,,,Viktor,,,1992 +UA3QR,KO92KA,,,,,,1992 UA3RBO,LO03NG,,,,,,11/03 UA3RFS,LO02SW,,,,,,1980 -UA3T,LO16GM,,,Clubstation,,.143.243,07/03 -UA3TCF,LO26IU,EME,,Alexander,,144: 300W,01/00 +UA3T,LO16GM,,,,,.143.243,07/03 +UA3TCF,LO26IU,EME,,QSL via DK3WG,,144: 300W,03/06 UA3TDB,LO16,,,,,,1979 UA3TIE,LO16,,,,,,01/97 UA3UBD,LO06GU,,,,,,1980 -UA3UES,LO07MF,,,alex a.,,,1992 +UA3UES,LO07MF,,,,,,1992 UA3WM,KO72QI,,,,,,07/04 +UA3WU,KO81BQ,,,,,,11705 UA3XEH,KO73FU,,,,,,08/98 UA3XFA,KO73DU,,,,,,01/96 -UA3YOZ,KO63QQ,,,Eugine,,144: 150w 10el 2wl bf998355,08/04 UA3ZAT,KO80,,,,,,1991 -UA4AAV,LO21FC,EME,,Victor,,,04/99 -UA4ALU,LN29LA,EME,,nick,,,1992 -UA4API,LO20QC,EME,,Victor,,,12/99 -UA4AQL,LO20QB,EME,,Aleksandr ""Al",,144: 4x13el DJ9BV Preamp 0.8db 1.2kW(EME),06/03 +UA4ALU,LN29LA,EME,,,,,1992 +UA4API,LO20QC,EME,,QSL via DK3WG,,,12/99 +UA4AQL,LO20QB,EME,,QSL via DK3WG,,144: 4x13el DJ9BV Preamp 0.8db 1.2kW(EME),04/05 +UA4CC,LO21XN,EME,,,,,05/05 UA4CDT,LO41AX,,,,,,1983 -UA4NM,LO48UP,,,Vladimir,,,03/04 +UA4NM,LO48UP,,,,,,03/04 +UA4NX,LO48SO,,,,,144: 200Watt 14el DJ9BV,12/05 +UA4PCY,LO45NF,,,,,,07/05 UA4SF,LO36WP,,,,,,1986 -UA4UK,LO14MA,,,Eugeny,,,11/03 -UA6LGH,KN97LF,EME,,Victor,,,07/96 +UA4UK,LO14MA,,,,,,11/03 +UA6JR/3,KO66,,,Expedition,,144: 500W 1el,01/05 +UA6LGH,KN97LF,EME,,,,,07/96 UA9CGP,MO06RT,,,,,,2003 -UA9CS,MO06FU,EME,,igor,,,1992 -UA9FAD,LO88DA,EME,,Victor,,144: 1KW 4x16el - 432: 1KW 8x15el.037,01/05 -UA9SL,LO71NS,EME,,Vladimir,,,11/04 +UA9FAD,LO88DA,EME,,QSL via DK3WG,,144: 1KW 4x16el - 432: 1KW 8x15el.037,05/05 +UA9FD,LO87DX,,,,,,05/05 +UA9FU,LO87DX,,,,,,11/05 +UA9HK,MO99DF,EME,,,,144: 4x 9el 600W,06/05 +UA9SL,LO71NS,EME,,,,144: 4x 17el 1KW,04/05 UA9XQ,LP63UM,,,,,,01/97 -UA9YLU,MO92EO,EME,,,,,11/04 +UA9YLU,MO92EO,EME,,QSL via DK3WG,,,09/05 UB0QF,KN77NU,,,,,,1988 UB2GA,KN77AB,,,,,,1990 -UE1TWO,KO67PW,,,,,,07/04 -UL7LU,MO13TD,EME,,victor,,,1992 -UL7TZ,MN52,EME,,,,,1992 +UE1TWO,KO67PW,,,Expedition,,,07/04 UN7LU,MO13TD,,,,,,2003 -UN7TQ,MN52VV,EME,,Pavel,,,09/98 -UN8AG,LN53PH,,,Alex,,,07/96 -UN8BA,MO51RD,EME,,anatoly,,,1992 -UR3EE,KN88DC,EME,,Artur N.,,,11/02 -UR3EP,KN78WR,,,,,,01/96 -UR4EWF,KN67OW,,,Clubstation,,,07/03 -UR4LL,KO70XG,,,Alex,,,10/00 -UR5BAE,KN29SM,,,Anatoly,,,07/01 +UN8AG,LN53PH,,,ex UL7AAX,,,07/96 +UR3CTB,KN59RS,,,,,,03/05 +UR3EE,KN88DC,EME,,,,,11/02 +UR3EP,KN78WR,,,ex RB4EE,,,01/96 +UR4EWF,KN67OW,,,,,,07/03 +UR4LL,KO70XG,,,,,,10/00 +UR5BAE,KN29SM,,,ex UB5BAE,,,07/01 UR5LLW,KN89EQ,,,,,,06/03 -UR5LX,KO70WK,EME,,Sergej Leonidov,,144: 800W 13el BF981.076 DTR 2000,01/05 -UR5M,KN99FD,,,OP UT5EC-UT4EQ,,,94 -UR5RCP,KO51OM,,,vladimir,,,1992 -UR5SKB,KN28IW,,,Vik,,FT847,05/04 -UR7GN,KN66HP,,,Sergey,,,06/96 -UR8IDX,KN87TC,,,Victor,,,07/04 -US0WA,KN29XT,,,n.k.,,,07/95 +UR5LX,KO70WK,EME,,QSL via DK3WG,,144: 800W 13el BF981.076 DTR 2000,02/06 +UR5M,KN99FD,,,Expedition,,,94 +UR5NOY,KN48KV,,,,,,07/05 +UR5RCP,KO51OM,,,,,,1992 +UR7GN,KN66HP,,,,,,06/96 +UR8IDX,KN87TC,,,,,,07/04 +US0WA,KN29XT,,,,,,07/95 US1VQ,KN58XA,,,,,,08/95 -US5CCO,KN59XG,,,Vlad,,,05/02 -US5II,KN88WA,,,Serge,,,08/04 -US5WU,KO20DI,,,boris,,.125,06/02 -UT1E,KN57XX,EME,,Clubstation,,.077,08/03 -UT1EA,KN68RA,EME,,Clubstation,,.077,08/03 +US5CCO,KN59XG,,,ex RB5CCO,,,05/02 +US5II,KN88WA,,,,,FT847,07/05 +US5WU,KO20DI,,,,,.125,06/02 +UT/DJ1MT/MM,KN56,,,,,144: 11el 200W,01/05 +UT1E,KN57XX,EME,,,,.077,08/03 +UT1EA,KN68RA,EME,,ex UT1E UB4EWA,,.077,08/03 UT1EWA,KN68RA,,,,,,2003 -UT1PA,KO21FC,EME,,Alexander,,,06/98 -UT1Q,KN77,,,,,,08/95 -UT2CO,KN58CR,,,jan,,,1992 -UT2HN,KN79OI,,,Nick,,144: 100W 16el.140 1000lpm,11/03 -UT3BW,KN29UA,,,Igor b.,,,05/99 -UT3LL,KO80AC,,,,,,2003 -UT4EQ,KN78MK,EME,,Nick,,,06/98 -UT5AO,KO61XQ,EME,,vlad,,,1994 +UT1PA,KO21FC,EME,,,,,06/98 +UT1Q,KN77,,,Expedition,,,08/95 +UT2CO,KN58CR,,,,,,1992 +UT2HN,KN79OI,,,ex UR5HAX,,144: 100W 16el.140 1000lpm,11/03 +UT3BW,KN29UA,,,ex UB5BDC,,,05/99 +UT3LL,KO80AC,EME,,,,432: 6x 27el 500W,09/05 +UT4EQ,KN78MK,EME,,,,,06/98 +UT5AO,KO61XQ,EME,,,,,1994 UT5BN,KO40,,,,,,1981 UT5CO,KN58CQ,,,,,.140,1995 -UT5DL,KN18EP,EME,,w.p. Slava,,,07/02 -UT5EC,KN78MN,EME,,Valery,,,11/99 -UT5EG,KN78GJ,EME,,alex,,,1994 -UT5ER,KN78ER,EME,,Arkady,,144: 4x4.4L DJ9BV 1KW MGF1302.117 DTR 30,01/05 -UT5GU,KN68,,,alex,,,1994 -UT5JAX,KN64RQ,,,vlad,,,1994 -UT5JCW,KN64SN,,,Serge,,50: ic-706mk2 ft-100160,11/03 +UT5DL,KN18EP,EME,,,,,07/02 +UT5EC,KN78MN,EME,,,,,11/99 +UT5EG,KN78GJ,EME,,,,,1994 +UT5ER,KN78ER,EME,,QSL via DK3WG,,144: 4x4.4L DJ9BV 1KW MGF1302.117 DTR 30,01/05 +UT5GU,KN68,,,,,,1994 +UT5JAX,KN64RQ,,,,,,1994 +UT5JCW,KN64SN,,,ex UB5JCW,,50: ic-706mk2 ft-100160,11/03 +UT5ST,KN28IW,,,ex UR5SKB,,FT847,05/05 UT5UBB,KO50,,,,,,01/04 -UT5UCP,KO50DG,,,Eugen,,,07/01 -UT5VD,KN68MT,,,Anatoly,,,10/04 -UT7GA,KN66HP,,,Alex,,144: 1KW 16el F9FT1000lpm,09/99 -UT7VF,KN68MQ,EME,,Victor,,,06/96 -UT8AL,KO61WP,EME,,aleksandr.,,DTR,08/99 +UT5UCP,KO50DG,,,,,,07/01 +UT5VD,KN68MT,,,ex UB5VEP,,,10/04 +UT6UG,KO50EI,,,,,Icom 910h 144: 4x7el DK7ZB 432: 4x13el DK7,11/05 +UT7GA,KN66HP,,,ex RB5GU,,144: 1KW 16el F9FT1000lpm,09/99 +UT8AL,KO61WP,EME,,ex RB5AL - QSL via DJ9YE,,DTR,08/99 UU1AA,KN74BV,,,,,,08/04 -UU1DX,KN74BW,,,Oleg,,144: 500W,07/04 +UU1DX,KN74BW,,,,,144: 500W,07/05 UU5JJ,KN74AV,,,,,,2003 -UW9AH,LO93KK,,,Yuri e.,,,1992 -UX0FF,KN45NI,,,Nikolay,,,07/04 +UW9AH,LO93KK,,,,,,1992 +UX0FF,KN45NI,,,,,,07/04 UX1AS,KO59FX,,,,,,2003 -UX5UL,KO50FL,,,Oleg,,144: IC910H 100W310,07/04 -UY5HF,KN66HP,,,Anatoli,,,06/96 +UX3LV,KO80EA,EME,,,,,08/05 +UX5UL,KO50FL,EME,,,,144: IC910H 100W310,04/05 +UY0UP,KO50FJ,,,,,,03/06 +UY5HF,KN66HP,,,= UT7GA,,,06/96 UY5OE,KO80AB,,,,,,1994 -UZ1OVW,KP94VN,,,anatoly v.,,,1992 -UZ3DD,KO86JH,EME,,,,,1993 -V47YC,FK87,EME,,,,,07/96 -VA2CST,FN35BP,,,Claude,,,2003 -VA2MGL,FN74UQ,,,Marc,,50: 25W 3el,11/01 -VA2PRC,FN46,,,Yves,,50: deltaloop 144: IC706 13el,1998 +UZ1OVW,KP94VN,,,,,,1992 +UZ3DD,KO86JH,EME,,SilentKey,,,1993 +VA2CST,FN35BP,,,,,,2003 +VA2MGL,FN74UQ,,,,,50: 25W 3el,11/01 +VA2PRC,FN46,,,,,50: deltaloop 144: IC706 13el,1998 VA3LK,FN14TO,,,,,,2003 -VA3NFA,FN25BH,,,Tom,,,2003 -VA5VHF,DO70FJ,,,Michael David,,,2003 -VA6DX,DO33IM,,,Barry,,144: 1KW 4x 2M9,01/01 +VA3NFA,FN25BH,,,,,,2003 +VA3TO,FN03BI,EME,,,,144: 2x 12el 300W,04/06 +VA5VHF,DO70FJ,,,,,,2003 +VA6DX,DO33IM,,,ex VE6MK,,144: 1KW 4x 2M9,01/01 +VA6SZ,DO33AP,EME,,ex VE6AQE,,432: 48el,04/05 VA7MM,CN89OG,EME,,,,,2004 VE1ALQ,FN65VH,EME,,,,,10/02 VE1GRT,FN84IQ,,,,,,2003 -VE1KG,FN84CM,EME,,Serge,,4x17el,10/00 VE1MQ,FN65,,,,,,2003 -VE1RG,FN65,,,Chuck,,144: 170W longyagi,12/00 -VE1SKY,FN74,,,Roger,,50: FT620B 3el,01/01 -VE1TAY,FN66,,,Wade,,,01/01 +VE1RG,FN65PT,EME,,,,144: 170W longyagi,04/05 +VE1SKY,FN74,,,,,50: FT620B 3el,01/01 +VE1TAY,FN66,,,,,,01/01 VE1XYL,FN65VH,,,,,,2003 VE1ZJ,FN96UC,EME,,,,144: 1.8KW 6x18el,12/01 -VE2BKL,FN48DJ,,,Roger,,50: 1000W 6el - 144: 150W 19el,04/02 +VE2BKL,FN48DJ,,,,,50: 1000W 6el - 144: 150W 19el,04/02 VE2CST,FN35BP,,,,,,2003 VE2DIV,FN35BP,,,,,,2003 -VE2PEP,FN46IB,,,Germain,,,08/03 -VE2PIJ,FN35QI,,,Pierre,,50: 6el 40W - 144: 17el 25W - 432: 24el 25,08/04 +VE2JWH,FN35LM,EME,,,,144: 4 x 18el. K1FO 1.5kw,07/05 +VE2PEP,FN46IB,,,,,,08/05 +VE2PIJ,FN35QI,,,,,50: 6el 200W - 144: 17el 100W - 432: 24e,03/05 VE2UG,FN35,,,,,,2003 VE2WHZ,FN08WN,,,,,,2003 VE2YAG,FN19ES,,,,,,2003 -VE3AX,FN02CW,,,Peter,,1.5KW 50-432 multiple Yagi arays.200.200,01/02 +VE3AX,FN02CW,,,ex VE3VD,,1.5KW 50-432 multiple Yagi arays.200.200,01/02 VE3BDR,EN98,,,,,,2003 VE3BFM,FN04AE,,,,,,2003 VE3CF,FN03,,,,,,2003 @@ -3888,24 +3943,25 @@ VE3CVG,FN25HM,,,,,,2003 VE3DBP,EN94EE,,,,,,2003 VE3DEW,FN04,EME,,,,,2003 VE3DIR,FN03,,,,,,2003 -VE3DSS,FN03FQ,EME,,Dana,,.200,07/01 +VE3DSS,FN03FQ,EME,,,,.200,07/01 +VE3DXP,EN92JW,EME,,,,144: 100W 2x 10el,04/06 VE3FAC,FN03IS,EME,,,,,2003 -VE3FAL,EN58DF,,,Fred,,,10/01 +VE3FAL,EN58DF,EME,,,,,03/05 VE3FOD,EN76,,,,,,2003 VE3JJX,EN29SS,,,,,,2003 -VE3KH,FN03CL,EME,,Kevin D.,,144: 6 x 2MXP28 AzEl 8877 LNA145 LT2S FT1000D,09/99 VE3KHH,FN03CL,,,,,,2003 -VE3KRP,EN58IJ,EME,,Ed,,,02/05 -VE3NE,FN03FQ,,,Lajos,,,2003 +VE3KRP,EN58IJ,EME,,,,,11/05 +VE3NE,FN03FQ,,,,,,2003 VE3OQC,FN03,,,,,,2003 VE3SCP,EN93WV,,,,,,2003 +VE3SPW,FN04GG,EME,,,,144: 100W 17el,04/05 VE3STZ,EN82,,,,,,2003 VE3WMD,EN92JN,,,,,,2003 VE4AAZ,EN19,,,,,,2003 VE4ACX,EN19,,,,,,2003 VE4AJB,EO00,,,,,,2003 VE4AP,EN19,,,,,,2003 -VE4AQ,EN19OR,,,Jim,,144: 1KW 4218XL,01/01 +VE4AQ,EN19OR,,,,,144: 1KW 4218XL,01/01 VE4CCW,EN19,,,,,,2003 VE4CT,EN19OW,,,,,,2003 VE4DK,EN19,,,,,,2003 @@ -3931,100 +3987,109 @@ VE4UD,EN19,,,,,,2003 VE4ZI,EN19,,,,,,2003 VE4ZK,EN19,,,,,,2003 VE4ZV,EO10IH,,,,,,2003 -VE5UF,DO61OV,,,Doug,,50: 600W 6el quad - 144: 325W 2x 2M126000lpm,07/01 +VE5UF,DO61OV,,,,,50: 600W 6el quad - 144: 325W 2x 2M126000lpm,08/05 VE6AFO,DO21,EME,,,,,2003 -VE6BPR,DO32BG,,,Al,,50: 150W 5el - 144: 250W 16el crossyagi,01/01 +VE6BPR,DO32BG,,,,,50: 150W 5el - 144: 250W 16el crossyagi,01/01 +VE6EGN,DO23QE,EME,,,,144: 22el Xpol 150W,06/05 VE6LR,DO21,,,,,,2003 VE6NA,DO20,EME,,,,,2003 -VE6NTT,DO31,,,Don,,144: 170W 17el,1998 +VE6NTT,DO31,,,,,144: 170W 17el,1998 VE6PY,DO20WW,,,,,,2003 -VE6TA,DO33GS,EME,,Grant,,432: 5m dish 800W,08/00 +VE6TA,DO33GS,EME,,,,432: 5m dish 800W,02/05 VE6XT,DO,,,,,,2003 -VE7BBG,CN88,EME,,,,,12/00 +VE7BBG,CN88DT,EME,,,,,04/05 VE7BEE,DN09HG,,,,,,2003 -VE7BQH,CN89KI,EME,,Lionel,,384el Collininar,03/00 -VE7CFT,CN79ST,,,Russ,,,2003 +VE7CFT,CN79ST,,,,,,2003 VE7CLD,CN89LD,EME,,,,,2003 -VE7DXG,CN88DT,,,Gabor,,50: 150W 5el - 144: 150W 15el,05/03 +VE7DXG,CN88DT,EME,,ex VE3GBA/7,,50: 150W 5el - 144: 150W 15el,02/05 VE7FYC,CN89,,,,,,2003 -VE7KPB,DN29CM,,,Ken,,144: 1KW 5wl M2,06/01 -VE7MDL,CN89,,,Erik,,only SSB-MS,1998 +VE7KPB,DN29CM,,,,,144: 1KW 5wl M2,06/01 +VE7LGF,CO90TQ,EME,,VE5AGJ,,FT100D 144: 17B2 500W,04/06 +VE7MDL,CN89,,,,,only SSB-MS,1998 VE7RJ,DN09LL,,,,,,2003 -VE7SKA,CN88GT,,,Mike,,4000lpm,01/01 -VE7US,CN88IG,,,Reg,,,2003 -VE7VVW,DO00IF,,,Ron,,144: 160W KLM2m22c - 432: 100W MBM88,01/02 +VE7SKA,CN88GT,,,,,4000lpm,01/01 +VE7US,CN88IG,,,,,,2003 +VE7VVW,DO00IF,,,,,144: 160W KLM2m22c - 432: 100W MBM88,01/02 VE7ZD,CN89LG,,,,,,2003 -VE9AA,FN65RS,,,Michael,,,01/02 +VE8/W7EME,CP28LF,EME,,Expedition,,,01/06 +VE9AA,FN66NA,,,,,,08/05 VE9PA,FN65SU,,,,,,2003 +VK0MT,QD95KM,EME,,,,,03/05 VK1VP,QF44NR,EME,,,,,89 VK2ALU,QF55KN,EME,,,,,2003 -VK2BE,QF56NC,EME,,,,,2003 -VK2CZ,QF56NH,,,David,,,2003 -VK2DJG,QF59VK,,,Gordon,,,2004 +VK2AWD,QF56NG,EME,,,,144: 2x 13el 2.2ld 300W,08/05 +VK2CZ,QF56NH,,,,,,2003 +VK2DJG,QF59VK,,,,,,2004 VK2FLR,QF56OD,,,,,,2003 -VK2JKK,QF69LO,,,Wayne,,,2003 -VK2KU,QF55AI,EME,,Guy,,144: 400W 4x 12el,01/05 -VK2XCI,QF27WD,,,Norm,,,2003 -VK3AMZ,QF22IC,EME,,arie,,,1993 -VK3AXH,QF12WJ,,,Ian,,,2003 -VK3CY,QF13,EME,,,,,04/00 -VK3HY,QF22PD,,,Gavin,,,2003 -VK3HZ,QF22ME,,,David,,,2003 -VK3OT,QF12AG,EME,,steve,,,1994 -VK3UM,QF22RO,EME,,,,,2003 -VK4AFL,QG62OJ,EME,,,,,2003 -VK4APG,QG62LP,EME,,peter,,,1994 -VK4CDI,QG52XH,,,Phil,,144: 10el 170W,01/05 -VK4JSR,QG62NM,,,Scott,,50: 100W 8el - 144: 400W 12el - 432: 100W 28e,10/00 +VK2IT,QF56OH,EME,,,,144: FT-847 350W 1x 8el 12el coming soon,04/06 +VK2JKK,QF69LO,,,,,,2003 +VK2KRR,QF34NR,EME,,,,144: 400W 4x 17el,08/05 +VK2KU,QF55AI,EME,,,,144: 400W 4x 12el,12/05 +VK2SN,QF56OC,EME,,,,432: 4x 28el legal pwr,12/05 +VK2XCI,QF27WD,,,,,,2003 +VK2XDE,QF56MG,EME,,,,,04/05 +VK2ZZF,QF43KR,EME,,,,,04/05 +VK3AXH,QF12WI,EME,,,,144: 4x 18el 400W,04/06 +VK3HY,QF22PD,,,,,,2003 +VK3HZ,QF22ME,EME,,,,,09/05 +VK3UM,QF22RO,EME,,,,,04/05 +VK3ZYC,QF31NT,EME,,,,144: 2x 10el 4wl Yagis 300W,03/05 +VK4ABW,QH30GT,EME,,,,144: 4x 17el 300W,01/06 +VK4AFL,QG62OJ,EME,,,,432: 16x 15el 100W,09/05 +VK4CDI,QG52XH,EME,,,,144: 170W 2x 12El Yagi - 432: 100W 22El Yag,09/05 +VK4JSR,QG62NM,,,,,50: 100W 8el - 144: 400W 12el - 432: 100W 28e,10/00 VK4KAZ,QG63KQ,EME,,,,,2003 -VK5DK,QF02JE,,,Colin,,,2003 +VK4WS,QG62OK,EME,,,,144: 12el QRP,12/05 +VK5DK,QF02JE,,,,,,2003 VK5MC,QF02EJ,EME,,,,,89 -VK5OA,QF02JE,,,Kevin,,,2003 -VK6KDD,OG99HP,EME,,Ron,,LT2S LT6S TS850,01/05 -VK7MO,QE37PC,EME,,,,,12/04 +VK5OA,QF02JE,,,,,,2003 +VK6KDD,OG99HP,EME,,ex VK4KDD PE1OZH,,LT2S LT6S TS850,03/06 +VK7JG,QE38NN,EME,,,,144: 1 yagi,04/05 +VK7MO,QE37PC,EME,,,,144: 4x 10el,03/05 VK9CD,NH87JU,,,,,,2003 +VK9CMO,NH87KT,EME,,Expedititon,,144: 230W 1Yagi 6wl,08/05 +VK9XMO,OH29UN,EME,,Expedititon,,144: 230W 1Yagi 6wl,09/05 VK9XW,OH29TI,,,,,,2003 VP2EC,FK88LD,,,,,,2003 -VP2MIS,FK86UV,EME,,,,,11/00 VP2MR,FK86VS,,,,,,2003 VP5JM,FL31VS,,,,,,2003 -VQ9LA,MI62,EME,,,,,09/02 VS6BI,OL72CG,,,,,,2003 VT3AT,RJ38UR,,,,,,2003 -W0AH,DM78LX,EME,,Doug,,,01/01 +VU4AN/VU3RYF,NK61LL,EME,,Expedition,,144: 28el Xpol 900W,04/06 +W0AH,DM78LX,EME,,ex W2CRS,,,01/01 W0AUS,EN35KA,,,,,,2003 W0BJ,DN91OD,,,,,,2003 -W0DB,EN11VD,,,Joe,,144: 50W 2x 8el,09/01 +W0DB,EN11VD,,,,,144: 50W 2x 8el,09/01 W0DEN,EN41,,,,,,2003 W0DFK,EM47LX,,,,,,2003 W0DJM,EN25XK,,,,,,2003 -W0DQY,EM48RS,,,Glenn ""Smitty",,144: 350W 4x8el - 432: 175W 2x88el - 1296: 10,01/01 +W0DQY,EM48RS,,,,,144: 350W 4x8el - 432: 175W 2x88el - 1296: 10,01/01 W0EKZ,EM17,,,,,,2003 W0ETT,DM79,,,,,,2003 W0FMS,EN42EB,,,,,,2003 W0FY,EM48,,,,,,2003 W0GAJ,EN11,,,,,,2003 -W0GC,EN14SQ,,,Gary,,,2003 +W0GC,EN14SQ,,,,,,2003 W0GHZ,EN34,,,,,,2003 W0GN,EN42,,,,,,2003 W0GR,EM38AX,,,,,,2003 W0HHE,DM79,EME,,,,,2003 W0HL,EM27,,,,,,2003 +W0HP,EN34IT,EME,,,,,02/05 W0HRG,EM39,,,,,,2003 W0IC,DM79MR,,,,,,2003 -W0IOH,DM78OU,,,Bill,,,01/01 +W0IOH,DM78OU,,,not qrv MS nw! (02/01),,,01/01 W0IPL,DN62UU,EME,,,,,2004 W0ITB,DM79,,,,,,2003 W0IZ,EN41,,,,,,2003 W0JRP,EM27RB,,,,,,2003 -W0KFG,DN96OT,,,Dick,,,09/01 +W0KFG,DN96OT,,,,,,09/01 W0KJY,DN71,EME,,,,,89 W0KRX,EN34LM,,,,,,2003 -W0LD,DM78,,,Lauren D.,,144: 1KW 2x16el,04/01 -W0LER,EN35IE,,,John,,,01/01 +W0LD,DM78,,,,,144: 1KW 2x16el,04/01 +W0LER,EN35IE,,,,,,01/01 W0LMD,DM79,,,,,,2003 W0MD,EN36,,,,,,2003 -W0MXY,DM78,,,,,,2003 W0NKN,EN42,,,,,,2003 W0OF,EM12,,,,,,2003 W0OHP,EN10,,,,,,2003 @@ -4032,308 +4097,307 @@ W0OHU,EN34OA,,,,,,2003 W0OZI,EN35,,,,,,2003 W0OZL,DN60FM,,,,,,2003 W0PEC,EN34,,,,,,2003 -W0PHD,EN18OE,,,Wally,,144: 190W 16lbx,09/01 +W0PHD,EN18OE,,,,,144: 190W 16lbx,09/01 W0PPF,EN41,,,,,,2003 -W0PT,EM28OD,EME,,Bill,,144: 4X 19XXX and 1.2kw,12/00 +W0PT,EM28OD,EME,,,,144: 4X 19XXX and 1.2kw,03/06 W0PW,EM26TW,,,,,,2003 W0QIN,EN34,,,,,,2003 W0RAP,EN42EB,,,,,,2003 W0RGU,EN35,,,,,,2003 W0RKP,EN31,,,,,,2003 -W0RRY,EM26BX,EME,,Charlie,,144: 700W 9elM2 0.6db Preamp,01/01 +W0RRY,EM26BX,EME,,,,144: 700W 9elM2 0.6db Preamp,01/01 W0RSJ,FN20JQ,,,,,,2003 W0RTZ,DM79,,,,,,2003 -W0RWH,EM39SX,EME,,Donald,,144: 16x19elonly SSB-MS,10/98 +W0RWH,EM39SX,EME,,,,144: 16x19elonly SSB-MS,10/98 W0SD,EN13GQ,EME,,,,,89 W0SII,DN71,,,,,,2003 W0TJ,EN10,,,,,,2003 +W0TUP,DN98IF,,,,,144: 13B2,03/06 W0UC,EN35,,,,,,2003 W0UHF,EN32,,,,,,2003 W0UN,EL07FV,,,,,,2003 W0UT,EM17,,,,,,2003 -W0VB,EN34SB,,,Terry,,,01/01 -W0VD,EM27UD,EME,,Dan,,144: TS790A 8877 (1-5KW) 18elM2,01/01 +W0VB,EN34QB,EME,,,,144: 6x 28el XP 1KW,08/05 +W0VD,EM27UD,EME,,,,144: TS790A 8877 (1-5KW) 18elM2,01/01 W0VX,EM12,,,,,,2003 W0WGZ,EN42,,,,,,2003 W0WTG,EM48,,,,,,2003 -W0XG,EN34QX,,,,,,2003 +W0XG,EN34GX,EME,,,,144: 2x 14el 1KW,11/05 W0YPT,EN43,,,,,,2003 W0ZJY,EM28,,,,,,2003 W0ZQ,EN34IU,,,,,,2003 W0ZZQ,EM26,,,,,,2003 -W1CDO,CN87XF,,,John,,,2004 -W1COT,FN31ST,,,Bob,,,2004 -W1CQD,FN34MR,,,Clair,,,2004 -W1FIG,FN41GV,EME,,Maarten,,50: 1KW 2x7el - 144: 9el M2 1KW 0.8db - 22,01/01 +W1CDO,CN87XF,,,,,,2004 +W1COT,FN31ST,,,,,,2004 +W1CQD,FN34MR,,,,,,2004 +W1FIG,FN41GV,EME,,ex PE1FIG,,50: 1KW 2x7el - 144: 9el M2 1KW 0.8db - 22,01/01 W1FM,FN42,,,,,,2003 -W1GHZ,FN42,,,Paul,,,01/01 -W1HY,FN41HV,,,Paul,,,2003 -W1IPL,DN62UU,EME,,,,,02/05 +W1GHZ,FN42,,,ex N1BWT,,,01/01 +W1HY,FN41HV,,,,,,2003 +W1IPL,DN62UU,EME,,,,144: 4x 12el 200W,04/06 +W1JJ,FN41FO,EME,,,,50: 4x 9el 1500W,05/05 W1JR,FN42HN,EME,,,,,89 -W1LP,FN41SR,,,Clint,,144: 1KW 2x2M9,01/01 +W1LP,FN41SR,,,,,144: 1KW 2x2M9,01/01 +W1PWW,FN53DT,EME,,,,144: 2x 18el 1500W,08/05 W1QC,FN42HU,EME,,,,,2003 W1REZ,FN55,,,,,,10/00 -W1RZF,FN42FC,,,arthur,,,2004 -W1TE,FN42EN,,,Charley,,50: 1KW 7el - 144: 1KW 22el - 432: 44el,08/01 +W1RZF,FN42FC,,,,,,2004 +W1TE,FN42EN,,,,,50: 1KW 7el - 144: 1KW 22el - 432: 44el,08/01 W1UHE,FN41,,,,,,2003 W1VT,FN33KE,,,,,,2003 W1XE,DM79GW,,,,,,2003 W1XR,FN42HW,,,,,,2003 -W1ZC,FN42DR,,,Dick,,144: 1KW - 432: 36el,01/02 +W1ZC,FN42DR,,,,,144: 1KW - 432: 36el,01/02 W1ZX,FM18LG,,,,,,2003 W2AXU,FN20OG,,,,,,2003 -W2BZY,EL98HR,,,Bob,,50: 700W 7el - 144: 160W 17el - 222: 120W 23e,09/01 +W2BZY,EL98HR,,,,,50: 700W 7el - 144: 160W 17el - 222: 120W 23e,09/01 W2CRS,DM78,,,,,,2003 W2DRZ,FN02LA,EME,,,,,01/01 W2ETI,FN21,EME,,,,,2003 -W2HBA,FN31TC,,,GEORGE,,,2003 -W2MPK,FN23BA,EME,,Don,,,10/99 +W2HBA,FN31TC,,,,,,2003 W2SZ,FN22,,,,,,2003 W2UHI,EN73AH,EME,,,,,2003 W2VU,FN20,,,,,,2003 -W2WD,FN20TP,EME,,Warren,,432: 20ft portable dish 1KW,08/00 +W2WD,FN20TP,EME,,,,432: 9wl 600W,09/05 W3ARS,FK88LC,,,,,,2003 W3BDP,FM29,,,,,,2003 W3BW,FN30AS,,,,,,2003 -W3EME,CN85BE,EME,,Brian,,144: Icom 746 MGF2430A MGF1302 4x14el X-P,01/05 W3HQT,FN54,,,,,,2003 W3IKE,FM18SW,,,,,,2003 W3IOA,EM00,,,,,,2003 -W3IWI,FM19ME,,,,,,2003 -W3KJ,FN20HG,,,Joseph,,,2003 +W3IWI,FM19ME,,,,,,10/05 +W3KJ,FN20HG,,,,,,2003 W3MRG,FN10UB,,,,,,2003 W3RY,FN10LL,,,,,,2003 W3SDZ,FN11,,,,,,2003 -W3SE,DM03WW,,,Wes,,50: 50W 5el - 144: 150W 12el,04/02 -W3SZ,FN20AH,,,Roger,,144: 150W 9el - 432: 100W 9wl. - 1296: 10W 4x,01/01 +W3SE,DM03WW,,,,,50: 50W 5el - 144: 150W 12el,04/02 +W3SZ,FN20AH,EME,,ex WA3JYM,,144: 150W 9el - 432: 100W 9wl. - 1296: 10W 4x,07/05 W3TMZ,EL88SU,,,,,,2003 -W3TWO,FM28CA,,,Daniel C.,,144: 400W M2,07/01 -W3UUM,EL29PW,,,Matt,,144: 170W 12el,01/02 +W3TWO,FM28CA,,,,,144: 400W M2,07/01 +W3UR,FM19LG,,,ex WR3E WB3JRU,,FT1000MP FT847 C3I 7el 22ft 1KW,04/05 +W3UUM,EL29PW,EME,,ex WA3UUM,,144: 24el 1000W,04/06 W3VH,FN32HG,EME,,,,,2003 W3WJR,FN20LL,,,,,,2003 W3XO,EM00KD,,,,,,2003 W3XS,FN10,EME,,,,,2000 -W3ZZ,FM19JD,,,Gene,,50: 1-5kw 8el 144: 1-5kw 17 el - 432: 1Kw 33e,07/01 -W4ABC,EL87PT,,,Jon,,50: 100W 7el qubical quad,01/01 -W4AD,FM18IP,EME,,Jack,,,07/01 +W3ZZ,FM19JD,,,,,50: 1-5kw 8el 144: 1-5kw 17 el - 432: 1Kw 33e,07/01 +W4ABC,EL87PT,,,,,50: 100W 7el qubical quad,01/01 W4AME,EM75FG,,,,,,2003 -W4CHA,EL88QA,,,Chuck,,50: 150W 9el M2 - 144: 1-5KW 2M18xxx - 432: 5,01/01 -W4CN,EM17JP,,,Mike,,,09/01 +W4CHA,EL88QA,,,ex WA4CHA,,50: 150W 9el M2 - 144: 1-5KW 2M18xxx - 432: 5,01/01 +W4CN,EM17JP,,,,,,09/01 W4DEX,EM95,EME,,,,,2003 -W4ET,EM56TP,,,RON,,,2004 +W4ET,EM56TP,,,,,,2004 W4FJ,FM17,,,,,,2003 -W4GHW,EM81EQ,,,Greg,,,2004 +W4GHW,EM81EQ,,,,,,2004 W4HTB,EM66,,,,,,2003 -W4KXY,EM84,,,James,,,01/01 +W4KXY,EM84,,,ex WA4KXY,,,01/01 W4LNG,EM73VK,,,,,,2003 W4MOP,EM78,,,,,,2003 W4OZK,EM73,,,,,,2003 W4PJV,EM65SU,,,,,,2003 W4PZA,EM66NC,,,,,,2003 -W4RBO,EL99KF,,,John,,,2003 +W4RBO,EL99KF,,,,,,2003 W4RDI,EL96BQ,EME,,,,,2003 W4REB,EM78,,,,,,2003 W4RFR,EM65,,,,,,2003 W4SM,FM08QA,EME,,,,,2004 -W4SW,FM18IW,EME,,,,,06/00 +W4SW,FM18IW,EME,,,,144: 4x 10el X-Pol 1.5KW Yaesu 767 and 73,10/05 W4TAS,EL87UW,,,,,,2003 W4TJ,FM08,EME,,,,,06/00 W4TNV,FM05XD,,,,,,2003 -W4UDH,EM52AG,,,Smitty,,,01/01 +W4UDH,EM52AG,,,,,,01/01 W4UDQ,EM55DB,,,,,,2003 -W4UE,EM90GC,,,john,,,12/97 +W4UE,EM90GC,,,,,,12/97 W4VHF,EM95,,,,,,2003 W4WD,DN40AM,,,,,,2003 W4WDH,EM83,,,,,,2003 -W4WHN,EL94HP,,,Dean,,,09/01 -W4WSR,EL85CB,,,Ott,,,01/01 -W4WTA,EM83XJ,,,Ace,,144: 160W 18el,11/01 -W4XP,FM18EW,EME,,Chuck,,.100.200,08/01 -W4ZD,EL79HH,EME,,bev,,,1993 +W4WHN,EL94HP,,,,,,09/01 +W4WSR,EM85CB,EME,,,,144: 4x 8el 700W,12/05 +W4WTA,EM83XJ,,,,,144: 160W 18el,11/01 W4ZPG,EM73WU,,,,,,2003 W4ZRZ,EM63SS,,,,,,2003 W5AK,EL29,,,,,,2003 -W5AL,DM95XB,,,Len,,50: 150W - 144: 1KW 18el M2 - 222: 130W - 432,01/01 +W5AL,DM95XB,,,,,50: 150W - 144: 1KW 18el M2 - 222: 130W - 432,01/01 W5CTV,EL49WU,,,,,,2003 W5DBY,EM12,,,,,,2003 W5DID,EL29,,,,,,2003 W5DKE,EM12LL,,,,,,2003 W5DS,EM15,,,,,,2003 W5ETG,EM12LS,,,,,,2003 -W5FR,EM12KX,,,Harold,,,2003 +W5FR,EM12KX,,,,,,2003 W5FYZ,EM32,,,,,,2003 W5GDL,EM15GM,,,,,,2003 W5GEL,EL17,,,,,,2003 W5GG,EM12,,,,,,2003 W5GKO,EM35,,,,,,2003 -W5GNB,DM73VB,,,Gary,,,2003 +W5GNB,DM73VB,,,,,,2003 W5GVE,EM01,,,,,,2003 W5HES,EM12HQ,,,,,,2003 W5HPT,EM12,,,,,,2003 W5HTZ,EM16,,,,,,2003 -W5HUQ,EM35BC,,,John,,,07/01 +W5HUQ,EM35BC,,,,,,07/01 W5ITI,EM32,,,,,,2003 W5IU,EM12HP,,,,,,2003 W5IXR,DM76,,,,,,2003 W5JBP,EM12,,,,,,2003 -W5KI,FM29PU,,,,,,2003 -W5KLF,EM31PJ,,,Keith,,,2003 +W5KI,FM29PU,,,,,756ProII Acom 1000,08/05 +W5KLF,EM31PJ,,,,,,2003 W5KQJ,EM12BS,,,,,,2003 -W5LBT,EM40KV,EME,,R.A. Bob,,,08/01 W5LUA,EM13QC,EME,,,,,2003 -W5LUU,EL09QO,EME,,Derwin,,144: FT736r 1.5KW 4x5wl - 432: 1.5KW 1x5wl,08/01 +W5LUU,EL09QO,EME,,,,144: FT736r 1.5KW 4x5wl - 432: 1.5KW 1x5wl,08/01 W5MRF,EM12,,,,,,2003 W5NFC,EM10,,,,,,2003 W5PIC,EM16LJ,,,,,,2003 W5PLN,EM12,,,,,,2003 W5RCI,EM44UF,EME,,,,,89 -W5SNX,EM73WT,,,Dick,,50: 150Watts 6M7JHV @65ft - 144MHz : 500Wat,01/02 +W5SNX,EM73WT,,,,,50: 150Watts 6M7JHV @65ft - 144MHz : 500Wat,01/02 W5SXD,EL29,,,,,,2003 W5TCD,EM 12,,,,,,2003 W5TVG,EM26,,,,,,2003 -W5UC,EM21PI,EME,,Mike,,,01/05 +W5UC,EM21PI,EME,,,,144:,11/05 W5UMB,EL17AX,,,,,,2003 -W5UN,EM23MG,EME,,Dave,,144: 32x 2M5WL129,12/04 +W5UN,EM23MG,EME,,,,144: 32x 2M5WL129,12/04 W5UPR,EL29,,,,,,2003 -W5UWB,EL17AX,EME,,John,,50: 1000W 6el - 144: 1500W 17el - 222: 17el 1,02/05 +W5UWB,EL17AX,EME,,,,50: 6el 1000W 144: 21el (8wl) 1500W NO ele,04/06 W5VUY,EM40,,,,,,2003 W5WJP,EM12HO,,,,,,2003 W5YUO,EM12,,,,,,2003 -W5ZN,EM45DH,EME,,Joel,,,12/00 -W6CAP,DM14,,,Cap,,144: FT726r 1KW 2yagis,01/01 +W5ZN,EM45DH,EME,,,,,12/00 +W6CAP,DM14,,,,,144: FT726r 1KW 2yagis,01/01 W6CPL,DM04,,,,,,2003 W6FC,DM03,,,,,,2003 W6HD,CM98PF,EME,,,,,2003 +W6IHG,FM09TB,EME,,,,144: 11el 300W,01/06 W6IZU,CM98NO,,,,,,2003 W6KH,CM97,,,,,,2003 W6MT,CM87XH,,,,,,2003 W6NQ,DM13,,,,,,2003 -W6OMF,CM98AK,,,Larry,,144: 650W 2x17el - 222: 120W 7wl - 432: 17,01/01 +W6OMF,CM98AK,,,ex WB5OMF,,144: 650W 2x17el - 222: 120W 7wl - 432: 17,01/01 W6OYJ,DM12,,,,,,2003 W6QT,CM87,,,,,,2003 W6TE,DM06CT,EME,,,,,2003 W6US,DM13JA,,,,,,2003 -W6WE,CM95RD,EME,,mike,,,11/03 -W6YLZ,DM04RF,,,Mike,,50: 80W 4el - 144: 150W 14el,01/01 +W6WE,CM95RD,EME,,,,,11/03 +W6YLZ,DM04RF,,,,,50: 80W 4el - 144: 150W 14el,01/01 W6YX,CM87WJ,EME,,,,,2004 -W7ALW,DN36AT,EME,,Barrie,,50: 8877 9el - 144: 400W 2x18xxx - 432: 200W,01/01 -W7AMI,DN13VO,EME,,Terry,,4x 28el 750W,01/05 -W7ANF,DM43AS,,,Jim,,144: 15W Vertical,07/01 +W7ALW,DN36AT,EME,,,,50: 8877 9el - 144: 400W 2x18xxx - 432: 200W,01/01 +W7AMI,DN13VO,EME,,ex KJ7F,,432: 4x 28el 750W,09/05 +W7ANF,DM43AS,,,,,144: 15W Vertical,07/01 W7AV,CN96QN,,,,,,2003 W7BBM,DM42MB,EME,,,,,2003 W7CI,DM41UN,EME,,,,,89 W7CNK,EM15FI,,,,,,2003 -W7CQ,CN83JX,,,Jimmy,,,2003 -W7CS,DM42OO,EME,,Chuck,,50: 1.5KW 7el - 144: 500W 4x13el - 432: 500W,08/01 +W7CQ,CN83JX,,,,,,2003 W7DHH,DM48LL,,,,,,2003 W7DWW,CN87,,,,,,2003 -W7EME,CN85BE,EME,,Jeremy,,144: FT736r Mutek DSP Preamp 8877 8x8 wl,01/05 -W7EW,CN84LV,,,Lew,,FT1000MP 144: 1-5KW,08/03 -W7FG,EM26BQ,EME,,Gary,,50: 100W 6el - 144: 1.5KW 80el MGF1302,09/02 +W7EME,CN85BE,EME,,,,50: 2x 9el 8877 - 144: FT736r Mutek DSP P,03/06 +W7EW,CN84LV,,,ex W7AT N7AVK,,FT1000MP 144: 1-5KW,08/03 +W7FG,EM26BQ,EME,,,,50: 100W 6el - 144: 1.5KW 80el MGF1302,09/02 W7FN,CN88SA,EME,,,,,89 W7GBI,DM43AN,EME,,,,,2003 -W7GJ,DN27UB,EME,,Lance,,50: 4x 9el 1.5KW 144: 16x 17el 1.5KW MGF1,11/04 -W7GTM,CN87VU,,,Grant,,,2003 +W7GJ,DN27UB,EME,,ex WA1JXN,,50: 4x 9el 1.5KW 144: 16x 17el 1.5KW MGF1,08/05 +W7GTM,CN87VU,,,,,,2003 W7GZ,DM42NF,,,,,,2003 W7ID,DN13UN,EME,,,,,89 -W7IUV,DM07DG,EME,,Larry,,,01/05 +W7IUV,DN07DG,EME,,,,144: 4x 8el 500W 432: 33el 50W,04/06 W7IXL,DM03US,,,,,,2003 W7JF,DN55RS,,,,,,2003 W7JW,EN82HJ,,,,,,2003 -W7KK,DM18,EME,,OP: N7MSD NS9E,,144: 2 x 18XXX at 40'/50' KW Output FT847,04/01 +W7KK,DM18,EME,,Expedition,,144: 2 x 18XXX at 40'/50' KW Output FT847,04/01 W7LD,DM78OV,,,,,,2003 -W7MEM,DN17NT,EME,,Mark,,50: 600W 9el - 144: FT726r 2002A 800W 4x5wl,09/01 +W7MEM,DN17NT,EME,,ex N7EIJ,,50: 600W 9el - 144: FT726r 2002A 800W 4x5wl,09/01 W7NS,DM33WP,,,,,,2003 -W7NTF,CN87TB,,,Gary,,50: 160W 6el - 144: 160W 13elMSDSP 10000lpm,01/01 -W7OJT,DM26KB,,,Dave,,,2005 +W7NTF,CN87TB,,,,,50: 160W 6el - 144: 160W 13elMSDSP 10000lpm,01/01 +W7OJT,DM26KB,,,,,,2005 W7PW,DM09JI,,,,,,2003 -W7QX,DM44AR,EME,,Jerry,,1296: 10 1/2Dish 75Watt,03/04 -W7SZ,CN85UO,EME,,Larry,,432: 4x32el X-pol 1.5KW - 1296: 3m dish 500W,01/00 +W7QX,DM44AR,EME,,,,1296: 10 1/2Dish 75Watt,03/04 +W7SZ,CN85UO,EME,,,,432: 4x32el X-pol 1.5KW - 1296: 3m dish 500W,01/00 W7TVF,DM26,EME,,,,,2003 W7VQQ,DM19,EME,,,,,2003 W7VX,DM03TV,,,,,,2003 -W7XU,EN13LM,,,Arliss,,144: 1-5KW,08/03 +W7XU,EN13LM,,,,,144: 1-5KW,08/03 W7ZRC,DN13,EME,,,,,2003 W8ATH,EN80,EME,,,,,2003 -W8BYA,EN70JT,EME,,Gedas,,144: 2x 17elB2 650W Preamp,02/05 -W8CM,EM13,,,Mike,,50: IC575H 800W 7el - 144: IC275H 800W 4x9el,01/02 -W8CRZ,EN80TB,,,Rob,,,2004 -W8DQ,EM79NC,,,Robert,,,2004 +W8BYA,EN70JT,EME,,,,144: 2x 17elB2 650W Preamp,02/05 +W8CM,EM13,,,,,50: IC575H 800W 7el - 144: IC275H 800W 4x9el,01/02 +W8CRZ,EN80TB,,,,,,2004 +W8DQ,EM79NC,,,,,,2004 W8HOM,EN71LA,,,,,,2003 W8IDU,EN83,EME,,,,,89 W8KSE,EM80,,,,,,2003 -W8LON,EN73JB,EME,,Lon,,,02/05 +W8LON,EN73JB,EME,,,,144: 2x 17el 400W,08/05 W8MGJ,EM79,,,,,,2003 W8MM,EM79SD,,,,,,2003 W8MQW,EN72UR,EME,,,,,2003 W8OUD,EM79RJ,,,,,,2003 -W8PAT,EN81VG,EME,,,,,12/04 -W8SCA,EM79UN,,,Phillip,,,2004 -W8TAH,EN91CD,,,Timothy,,,2003 -W8TL,FM09BM,,,Burt,,50: FT767 1KW 11el - 144: FT736 1KW 17B2,01/01 -W8TN,EM98AK,EME,,Clark,,,07/01 +W8PAT,EN81VG,EME,,,,144: 350 watts 2x12 V or H,04/05 +W8SCA,EM79UN,,,,,,2004 +W8TAH,EN91CD,,,,,,2003 +W8TL,FM09BM,,,,,50: FT767 1KW 11el - 144: FT736 1KW 17B2,01/01 +W8TN,EM98AK,EME,,,,,07/01 W8VHF,EN64,,,,,,2003 -W8WN,EM77BQ,EME,,Shelby,,50: 600W 4el - 144: 1-2KW 4x16el KLM - 432: 1,07/01 -W9BLI,EN64DK,,,,,,2003 +W8WN,EM77BQ,EME,,,,50: 600W 4el - 144: 1.2KW 4x16el KLM - 432: 1,04/05 +W9BLI,EN64DP,EME,,,,144: 14db up 40 200 w 432: 17db up 15 1,02/06 W9BN,EM34TT,,,,,,2003 -W9CGI,EN60WC,,,Dave,,,2003 +W9CGI,EN60WC,,,,,,2003 W9DWP,EN52,,,,,,2003 W9EME,EN54AL,,,,,,2003 W9EQI,EM49,,,,,,2003 -W9FX,EM57MX,,,Brad,,144: 1KW 17el,07/01 +W9FX,EM57MX,,,,,144: 1KW 17el,07/01 W9FY,EN52,,,,,,2003 W9FZ,EN43,,,,,,2003 W9GIR,EN44OG,,,,,,2003 -W9GM,EN43JU,,,Ken,,50: 100W 6el - 144: 100W 13el,05/02 +W9GM,EN43JU,,,,,50: 100W 6el - 144: 100W 13el,05/02 W9HLY,EN70NT,,,,,,2003 W9IIX,EN61DR,,,,,,2003 W9IP,FN24KO,,,,,,2003 W9JMS,EM69,,,,,,2003 -W9JN,EN54DN,,,John,,50: 1KW 6el - 144: 1KW 2x17B2 - 222: 150W 7wL,01/02 +W9JN,EN54DN,EME,,,,50: 1KW 9el - 144: 1KW 18XXX,01/02 W9JUV,EN52,,,,,,2003 W9KFB,EN60,,,,,,2003 W9KHH,EN63AH,,,,,,2003 -W9LT,EN52XG,,,Thomas,,,2004 -W9NHE,EN53,,,,,,2003 +W9LT,EN52XG,,,,,,2004 +W9NHE,EN53XB,EME,,,,144: 17el M2 400W,04/06 W9NLP,EN52WN,,,,,,2003 W9NTP,EM79,,,,,,2003 -W9NWR,EN55FW,,,Charles,,,2004 -W9RVG,EM57RN,EME,,Marshall,,IC746 IC910H FT736,02/05 +W9NWR,EN55FW,,,,,,2004 +W9RVG,EM57RN,EME,,,,IC746 IC910H FT736,11/05 +W9SE,EN90LM,,,,,,03/06 W9VA,EN62,,,,,,2003 W9VNE,EM79,,,,,,2003 W9XA,EN51,,,,,,2003 -W9XT,EN53,,,Gary,,,1998 +W9XT,EN53,,,,,,1998 W9ZIH,EN51NV,,,,,,2003 WA0AUQ,EN41,,,,,,2003 -WA0BWE,EN34LX,,,Gary,,,1998 +WA0BWE,EN34LX,,,,,,1998 WA0CQG,EN34,,,,,,2003 -WA0DXZ,EN41,,,Bob,,,01/97 +WA0DXZ,EN41,,,,,,01/97 WA0ETH,EM38PH,,,,,,2003 WA0JDU,EN34,,,,,,2003 WA0JMP,EN34,,,,,,2003 WA0JYF,EN42,,,,,,2003 -WA0MWW,EN30VX,,,Ron,,,2004 +WA0MWW,EN30VX,,,,,,2004 WA0NOK,EM28,,,,,,2003 WA0QII,CM97,,,,,,2003 WA0RDX,EM17,,,,,,2003 WA0RJT,EN41,,,,,,2003 WA0SJR,EM56,,,,,,2003 -WA0TAQ,EN61QU,,,Jonathan,,,2004 -WA0VSL,DM79OB,,,Doug,,50W,08/04 +WA0TAQ,EN61QU,,,,,,2004 +WA0VSL,DM79OB,,,,,50W,08/04 WA0WPJ,EM29,,,,,,2003 WA0WQI,EM55AA,,,,,,2003 WA0WRI,EN10,,,,,,2003 -WA1FVJ,FN31QS,,,Ed,,144: 13B2 40W,08/04 -WA1HOG,FN42AS,,,Dennis,,144: 100W,01/01 +WA1FVJ,FN31QS,,,,,144: 13B2 40W,08/04 +WA1HOG,FN42AS,,,,,144: 100W,01/01 WA1JOF,FN44XV,EME,,,,,2003 WA1JXN,DN27UB,,,,,,2003 WA1MBA,FN32SL,,,,,,2003 WA1MEK,FN42,,,,,,2003 WA1MKE,EN70GH,,,,,,2003 -WA1OFR,FN42MA,,,Bob,,,01/01 -WA1TMQ,FN31OJ,,,john,,,2003 +WA1OFR,FN42MA,,,,,,01/01 +WA1T,FN43LK,EME,,,,144: 15el 500W,02/06 +WA1TMQ,FN31OJ,,,,,,2003 WA2ALV,FN33,,,,,,2003 -WA2FGK,FN21ML,EME,,Herb,,144: 4x17B2 Ant.,01/01 WA2FUZ,FN22XJ,,,,,,2003 WA2GFP,FN20,,,,,,2003 WA2JGY,DM79,,,,,,2003 @@ -4341,10 +4405,10 @@ WA2LSE,FN20,,,,,,2003 WA2LTM,FN20,,,,,,2003 WA2VOI,EN35JA,,,,,,2003 WA2YJF,FN30FR,,,,,,2003 -WA3BZT,FM29EP,EME,,Ed,,144: IC746 8877 1-5KW 4x2MXP28,07/01 WA3FFC,FN01,EME,,,,,2003 WA3KQA,EM98LL,,,,,,2003 -WA3RQD,FM19QK,,,Jim,,,2003 +WA3LTB,EN92TA,EME,,,,144: 100W 17el,11/05 +WA3RQD,FM19QK,,,,,,2003 WA3SIX,FN10UB,,,,,,2003 WA3USG,FN10LL,,,,,,2003 WA4ALJ,EM63,,,,,,2003 @@ -4352,15 +4416,16 @@ WA4CHA,EL88QA,,,,,,2003 WA4DFS,EM96,,,,,,2003 WA4EWA,EM63LL,,,,,,2003 WA4HEI,EN65UX,,,,,,2003 -WA4HFN,EM55AB,,,Damon,,,09/01 -WA4JQS,EM77TA,,,Anthony ""Tony",,144: 2x33el 2.5WL50.10050.125,08/01 +WA4HFN,EM55AB,EME,,,,,08/05 +WA4JQS,EM77TA,,,,,144: 2x33el 2.5WL50.10050.125,08/01 WA4LBT,EM95,EME,,,,,2003 +WA4NJP,EM84DG,EME,,,,,03/05 WA4OFS,EL98,EME,,,,,2003 WA4PCS,EM78,,,,,,2003 WA4PGJ,EM55,,,,,,2003 -WA4PGM,FM07TI,,,Kyle,,144. 170W 17el,1998 +WA4PGM,FM07TI,,,,,144. 170W 17el,1998 WA4VWR,EM55,,,,,,2003 -WA4YRK,EM75WV,,,Dave,,IC910 IC756,05/02 +WA4YRK,EM75WV,,,,,IC910 IC756,05/02 WA4ZTK,EM85,EME,,,,,2003 WA5CJG,EM15,,,,,,2003 WA5DJJ,DM62PH,,,,,,2003 @@ -4368,7 +4433,7 @@ WA5ETV,EM15,EME,,,,,2003 WA5ICW,EM26,EME,,,,,2003 WA5IYX,EL09,,,,,,2003 WA5JAT,EM12ET,,,,,,2003 -WA5JCI,EM21,,,Pete,,,01/01 +WA5JCI,EM21,,,,,,01/01 WA5KBH,EM30HL,,,,,,2003 WA5NFC,EM45,,,,,,2003 WA5TKU,EM13II,,,,,,2003 @@ -4388,29 +4453,32 @@ WA6GXF,DM06DX,,,,,,2003 WA6IJZ,DM44KM,,,,,,2003 WA6KBL,CM97AG,EME,,,,,2003 WA6KOU,DN17,,,,,,2003 -WA6LHD,CM88XF,,,Ed,,,01/97 -WA6OWM,DM03TU,,,Ray,,50: 100W Loop - 144: 100W 15el155 3000 MSDSP.,09/01 -WA6PY,DM13LA,EME,,Paul,,2x20el VE7BQH 700W,01/05 +WA6LHD,CM88XF,,,,,,01/97 +WA6OWM,DM03TU,,,,,50: 100W Loop - 144: 100W 15el155 3000 MSDSP.,09/01 +WA6PXO,DM13DO,EME,,,,144: 2x 9el 200W,11/05 +WA6PY,DM13LA,EME,,,,2x20el VE7BQH 700W,01/05 WA6TTY,DM78,,,,,,2003 WA6UCT,DM34,,,,,,2003 -WA6YGB,DM04WA,,,Howard,,,2003 +WA6YGB,DM04WA,,,,,,2003 WA6ZKY,CM98,EME,,,,,2003 -WA7ADK,DN31WD,EME,,Jerry,,,01/05 +WA7ADK,DN31WD,EME,,,,,01/05 WA7BJU,CN85,,,,,,01/05 WA7CJO,DM33XL,EME,,,,,2003 WA7EPU,DM62,,,,,,2003 -WA7GSK,DN13SO,,,Al,,144: 300W 2x16el,01/02 -WA7HQD,DN31XA,,,Lee E.,,,1998 +WA7GSK,DN13SO,,,,,144: 300W 2x16el,01/02 +WA7HQD,DN31XA,,,,,,1998 WA7KHO,DN47,,,,,,2003 +WA7SKT,CN86CX,EME,,,,,11/05 WA7TZY,CN87,EME,,,,,12/00 -WA8CLT,EN80LA,EME,,John,,144: 1500W 4x9M2,08/03 +WA8CLT,EN80LA,EME,,,,144: 1500W 4x9M2,03/05 +WA8CXI,EM99WK,EME,,PSE QSL direct,,FT847 - 144: 2x 18el CC with max 68deg elevat,04/06 WA8EUU,EN82,,,,,,2003 WA8MIL,EN63,,,,,,2003 WA8NLC,EM73,,,,,,2003 WA8OGS,EM79,,,,,,2003 -WA8RJF,EN91IQ,,,Tony,,,12/96 +WA8RJF,EN91IQ,EME,,,,144: 17el 250W,03/05 WA8VPD,EN82,EME,,,,,2003 -WA8WZG,EN81OM,EME,,Tom,,.144,01/01 +WA8WZG,EN81OM,EME,,,,.144,01/01 WA8YTB,EN72JH,,,,,,2003 WA9BTT,EN40,,,,,,2003 WA9BVS,EM69WV,,,,,,2003 @@ -4419,8 +4487,8 @@ WA9FWD,EN53,EME,,,,,2003 WA9HCZ,EN43JV,,,,,,2003 WA9HIR,EN61CU,,,,,,2003 WA9HUV,EN51,,,,,,2003 -WA9JML,EN51PW,,,Steve,,,01/01 -WA9NBU,DM14JG,,,Bob,,,2004 +WA9JML,EN51PW,,,,,,01/01 +WA9NBU,DM14JG,,,,,,2004 WA9NRB,EM48,,,,,,2003 WA9O,EN62BX,,,,,,2003 WA9OUU,EM89,EME,,,,,2003 @@ -4450,56 +4518,59 @@ WB0VGI,EN34LL,,,,,,2003 WB0YFL,EN42,,,,,,2003 WB0YRQ,EN12,,,,,,2003 WB0ZJP,EM48,,,,,,2003 -WB1FLD,FN42IW,,,David W.,,,01/02 -WB1GQR,FN33KL,,,Mitch,,,2004 -WB2BYP,FN13FF,EME,,,,144: 4x 9el 8877,01/05 +WB1FLD,FN42IW,,,,,,01/02 +WB1GQR,FN33KL,,,,,,2004 +WB2BYP,FN13FF,EME,,,,144: 4x 9el 8877,07/05 WB2LSP,FM29DP,,,,,,2003 WB2OYC,FM29NN,,,,,,2003 -WB2QLP,EL96DE,,,Jordan,,50: 400W- 144: 400W- 432: 170W,01/01 +WB2QLP,EL96DE,,,,,50: 400W- 144: 400W- 432: 170W,01/01 WB2SEB,FN31DD,,,,,144: 175W 13el - 222: 100W 10el,03/02 +WB2SIH,FN31DD,EME,,,,144: 13B2 800W FT736R SSB-preamp,07/05 WB2VVV,FN21,EME,,,,,2000 WB4AXQ,EM64,,,,,,2003 WB4BKC,EL96,EME,,,,,89 -WB4ECR,EM66QF,,,Michael,,,2004 +WB4ECR,EM66QF,,,,,,2004 WB4EFZ,EM94,,,,,,2003 -WB4GTB,EM73VW,,,john,,,2003 -WB4JEM,EL89QU,,,Jon,,50: 6elQuad 500W - 144: 16x10el preamp 1-5KW,01/01 -WB4KMH,EM75RV,,,Phil,,,01/01 -WB4LHD,EM55DB,EME,,Randy,,,02/05 -WB4NFS,FM18HP,,,Jack,,144: 400W,01/97 -WB4UNA,EM93LV,,,Randy,,ft-736Rr FT847 50: 400W 617 - 144: 250W 17B2,01/05 -WB5AFY,EM04ID,EME,,Dan,,,02/05 -WB5APD,EM84AK,,,Bob,,144: 1.5kw 17 el,01/01 +WB4GTB,EM73VW,,,,,,2003 +WB4JEM,EL89QU,,,,,50: 6elQuad 500W - 144: 16x10el preamp 1-5KW,01/01 +WB4KMH,EM75RV,,,,,,01/01 +WB4LHD,EM55DB,EME,,,,,02/05 +WB4NFS,FM18HP,,,,,144: 400W,01/97 +WB4UNA,EM93LV,,,,,ft-736Rr FT847 50: 400W 617 - 144: 250W 17B2,01/05 +WB5AFY,EM04ID,EME,,,,,02/05 +WB5APD,EM84AK,,,,,144: 1.5kw 17 el,01/01 WB5DSH,EM15,,,,,,2003 WB5IPM,EM12,,,,,,2003 WB5KDC,EM15,,,,,,2003 WB5KYK,EM51JQ,,,,,,2003 -WB5LBT,EM40LK,EME,,R.A. Bob,,,01/01 +WB5LBT,EM40LK,EME,,= W5LBT,,,01/01 WB5NIF,EM42AM,,,,,,2003 WB5ROR,EM23,,,,,,2003 WB5TBL,EM12,,,,,,2003 WB5TCO,EN64,,,,,,2003 WB5VPC,EM12,,,,,,2003 -WB6WLR,DM13AT,,,Wayne,,144: 8877 2x17B2 - 432: 8938 2xFO33,01/01 +WB6WLR,DM13AT,,,,,144: 8877 2x17B2 - 432: 8938 2xFO33,01/01 WB7OSE,CN87XT,,,,,,2003 +WB7UNU,CN85OJ,EME,,,,144: 170W 17el,11/05 WB8AGV,EN34,,,,,,2003 WB8IFM,EM79WS,,,,,,2003 -WB8NUT,EM79UB,,,Duffy,,,2003 -WB8SKP,EN66UC,,,DENIS,,,2004 +WB8NUT,EM79UB,,,,,,2003 +WB8SKP,EN66UC,,,,,,2004 WB8TFV,FM19AL,,,,,,2003 +WB8TGY,EN72PP,EME,,,,144: 13B2 antenna,03/05 WB8WTB,EN72,,,,,,2003 -WB8XX,EM79,,,Kevin,,,12/00 +WB8XX,EM79,,,,,,12/00 WB9BWP,EN52,,,,,,2003 +WB9F,EM57QQ,,,,,ICOM 756 PRP III,10/05 WB9GKA,EM58,,,,,,2003 WB9HLM,EN52IW,,,,,,2003 WB9IHS,EM69,,,,,,2003 -WB9IIV,EM69UL,,,Harry,,,2004 +WB9IIV,EM69ST,EME,,,,144: 11el 150W,02/06 WB9OGM,EN61,,,,,,2003 WB9OWN,EN52,,,,,,2003 WB9SNR,EN62AC,,,,,,2003 WB9SPT,EN71AS,,,,,,2003 WB9USX,EM79,,,,,,2003 -WB9UWA,EN50KK,EME,,Jim,,144: 4x UWA12's 18.5 dbd low temperature MC2,10/00 WB9ZAI,EN61GM,,,,,,2003 WC9C,EM69HH,,,,,,2003 WD0AAD,DM79,,,,,,2003 @@ -4512,19 +4583,20 @@ WD0FCH,EM48,,,,,,2003 WD0GML,EM48,,,,,,2003 WD0HOJ,EN41,,,,,,2003 WD0L,EM17IH,,,,,,2003 -WD0M,DM67KG,,,Joe,,,2004 +WD0M,DM67KG,,,,,,2004 WD4ECK,CN82,,,,,,2003 WD4FAB,EL98HP,,,,,,2003 -WD4KPD,FM15MM,,,David Michael,,,05/02 +WD4KPD,FM15MM,,,,,,05/02 WD4MUO,DM79GX,,,,,,2003 WD4OZN,EM55LK,,,,,,2003 -WD5AGO,EM26BD,EME,,Tommy,,,03/00 +WD5AGO,EM26BD,EME,,,,,03/00 WD5CAN,EM36,,,,,,2003 WD5CAP,EM36,,,,,,2003 WD5DJT,EM12OO,,,,,,2003 WD5EWD,EM22,,,,,,2003 WD5G,EM05,,,,,,2003 WD6BXE,DM22,,,,,,2003 +WD6DBM,CM97LL,EME,,,,144: 2x 17el 400W,10/05 WD8BYA,FM18IP,,,,,,2003 WD8SDL,EM79,,,,,,2003 WD9BGA,EN53BA,,,,,,2003 @@ -4537,27 +4609,27 @@ WE4K,EM77BQ,,,,,,2003 WE7L,DM41,,,,,,2003 WE7P,DN13RP,EME,,,,,2003 WE9D,EN52,,,,,,2003 -WE9Y,EN82EW,EME,,,,,02/05 +WE9Y,EN82EW,EME,,,,IC910H LA22 AM6155 144: 2x 18el 1500W,04/06 WF1F,FN42,,,,,,2003 WF1R,FN32,,,,,,2003 WF4R,FM16TS,,,,,,2003 WF9M,EM79,,,,,,2003 WH6LR,EM04LL,,,,,,2003 -WJ6T,DM05,,,Bob,,,1998 +WJ6T,DM05,,,,,,1998 WK9E,EN53,,,,,,2003 WL7M,BO49IR,,,,,,2003 -WL7U,BP51,EME,,Mike,,50: 150W 5el - 144: 300W 2x10el - 432: 900W-,1998 -WM2Z,FN31SA,,,Warren,,,2004 +WL7U,BP51,EME,,,,50: 150W 5el - 144: 300W 2x10el - 432: 900W-,1998 +WM2Z,FN31SA,,,,,,2004 WM5Y,EN31,,,,,,2003 WN4BML,EL89LL,,,,,,2003 WN4KKN,EM10,,,,,,2003 -WN4M,EM66,,,Greg,,100W,01/04 -WO9S,EN61ET,,,,,,2003 -WP4G,FK68VG,EME,,Angel,,144: 1KW 2x2MX28P,10/00 -WP4O,FK68,,,Ed,,144: FT736r 400W 18ft langyagi preamp,01/01 -WQ0P,EM19VF,,,Greg,,,09/01 -WQ5S,EM13RC,EME,,Brad,,144: 12el 50W,02/05 -WQ5W,EM12FW,,,George,,,2004 +WN4M,EM66,,,,,100W,01/04 +WO9S,EN61ET,EME,,,,144: 13el 140W,07/05 +WP4G,FK68VG,EME,,,,144: 1KW 2x2MX28P,08/05 +WP4O,FK68,,,,,144: FT736r 400W 18ft langyagi preamp,01/01 +WQ0P,EM19VF,,,,,,09/01 +WQ5S,EM13RC,EME,,ex KA5UIQ KF5FQ,,144: FT847 4x 12el 300W,03/06 +WQ5W,EM12FW,,,,,,2004 WR0F,EM29TC,,,,,,2003 WR0I,EM17,,,,,,2003 WR6S,DM14CP,,,,,,2003 @@ -4565,170 +4637,190 @@ WR9W,EM68FA,,,,,,2003 WS5R,DM95,,,,,,2003 WT0W,EN34,,,,,,2003 WV0K,EN13,,,,,,2003 -WV1K,FN41WR,,,Matt,,,2005 -WV2C,FN30,,,Tony,,144: IC706 180W 15el,1998 -WW2R,EM13QD,,,,,,2003 +WV1K,FN41WR,,,,,,2005 +WV2C,FN30,,,,,144: IC706 180W 15el,1998 +WW2R,EM13QD,EME,,,,,04/06 WW4T,EM83,,,,,,2003 -WW8M,EN72,,,,,,2003 +WW8M,EN72XF,EME,,,,144: 4x 18XXX KW,03/06 WX9M,EN54FL,,,,,,2003 WY0C,EM17IT,,,,,,2003 -WY0V,EN12,,,Gary,,,1998 +WY0V,EN12,,,,,,1998 WY3G,EM55,,,,,,2003 -WZ1V,FN31MP,,,Ron,,144: 1kw 2x14el - 222: 500W FO16,01/01 -WZ8D,EM79UG,,,John A.,,50: 1-5KW 6el - 144: 1-5KW 18el,01/01 +WZ1V,FN31MP,,,,,144: 1kw 2x14el - 222: 500W FO16,01/01 +WZ8D,EM89BI,,,ex WB8IGY,,50: 1.5KW 6el - 144: 1.5KW 2x 17el,03/06 WZ9D,EN51,,,,,,2003 XE1AVM,DK79UA,,,,,,2003 XE1GE,EK08,,,,,,2003 -XE1GRR,DL80IP,EME,,Tony,,FT736,11/04 +XE1GRR,DL80IP,EME,,,,50: 4x 6 el - 144: FT736 2x 17el H+V 250W,04/05 XE1XA,EK09,EME,,,,,2003 -XE2AT,DL81,,,Leon,,144: IC820 200W 13elonly SSB-MS,11/01 +XE2AT,DL81UU,EME,,ex XE2YVW,,144: IC820 400W 2x 13elonly SSB-MS,02/06 +XE2OR,DL98OK,,,,,144: 13B2 160W,08/05 YB0US,OI33JU,,,,,,2003 -YL1A,KO07UN,,,,,,05/03 -YL2GUI,KO06MM,,,Egils,,144: TS-570+FTV-250 9el 30W,03/04 -YL2HA,KO26CV,,,,,,05/04 -YL2KA,KO26AX,,,Jack,,,03/02 -YL2LW,KO26CW,,,,,,11/04 +YL1A,KO07UN,,,Expedition,,,05/03 +YL2GUI,KO06MM,,,,,144: TS-570+FTV-250 9el 30W,03/04 +YL2HA,KO26CV,EME,,,,144: 4x 16el 400W,01/06 +YL2KA,KO26AX,,,,,,03/02 +YL2LW,KO26CW,,,,,,07/05 YL2OK,KO37AS,,,,,,11/04 -YL2OW,KO26WL,,,Janis,,FT736R IC706MKIIG,01/05 +YL2OW,KO26WL,,,ex UQ2OW,,FT736R IC706MKIIG,01/05 YL3DW,KO26CW,,,,,,11/02 -YL3GDF,KO26XM,,,Vilis,,,05/04 +YL3GDF,KO26XM,,,,,,04/06 YL3GDJ,KO26AX,,,,,,01/05 -YM3XC,KN30FC,,,OP: HB9DUR,,,11/02 -YO0IS,KN05PS,,,,,,1993 -YO2AMU,KN06OC,EME,,Doru,,144: 4x16el MGF1302 1KW,02/00 +YM3XC,KN30FC,,,Expedition,,,11/02 +YO/OK1CDJ,KN26US,,,Expedition,,,06/05 +YO0IS,KN05PS,,,Specialcall,,,1993 YO2BBT,KN05WG,,,,,,06/04 -YO2IS,KN05PS,EME,,Suli I. ""Szigy",,144: 4CX250B 10el BF981 - 432: 4X150D 17el 3,06/02 -YO2LEA,KN06WK,,,Nelu,,144: IC-211 lin.Mirage B 215G - 6m and 70,03/01 -YO3DMU,KN34BJ,,,Codrut,,144: TS870 +Trsv 1KW MGF1302 16el.165,02/02 -YO3FFF,KN34CJ,EME,,Cristian ""Cristi",,144: TS450 Trvtr 100W B-310G GaAs Preamp 16el,01/05 -YO3IZI,KN34BK,EME,,Ciprian,,TS2000,01/04 -YO3JW,KN34CK,,,Stefan ""Pit",,144: 400W 16el F9FT 3P602A-2.088.222,04/00 -YO3KWJ,KN24,,,Op YO3JW,,,1993 -YO4AUL,KN44HE,,,Cornelius,,144: FT290r 200W 2x12el MGF1302.150 2000lpm,01/01 -YO4BZC,KN45AK,,,Dorucc,,IC 706 5 el delta loop HM PA 70W,10/04 -YO4FNG,KN44HE,,,Liviu,,144: 350W 6el LY,11/04 -YO4RFV,KN45AK,,,EUGEN,,,08/02 +YO2IS,KN05PS,EME,,,,144: 4CX250B 10el BF981 - 432: 4X150D 17el 3,01/06 +YO2LEA,KN06WK,,,,,144: IC-211 lin.Mirage B 215G - 6m and 70,03/01 +YO3DMU,KN34BJ,EME,,,,144: TS870 +Trsv 1KW MGF1302 16el165,10/05 +YO3FFF,KN34CJ,EME,,,,144: TS450 Trvtr 100W B-310G GaAs Preamp 16el,04/05 +YO3FFF/P,KN24ND,EME,,Expedition,,144: TS450 Trvtr 100W B-310G GaAs Preamp 6el,04/05 +YO3IZI,KN34BK,EME,,,,TS2000,01/04 +YO3JW,KN34CK,,,,,144: 400W 16el F9FT 3P602A-2.088.222,04/00 +YO3KWJ,KN24,,,Expedition,,,1993 +YO4AUL,KN44HE,,,,,144: FT290r 200W 2x12el MGF1302.150 2000lpm,01/01 +YO4BZC,KN45AK,,,,,IC 706 5 el delta loop HM PA 70W,07/05 +YO4FNG,KN44HE,,,,,144: 350W 6el LY,03/06 +YO4GJH,KN35XG,,,,,KENWOOD MIRAGE B2518G F9FT 17ele,03/05 +YO4KRB,KN44HE,EME,,,,144: 400 W 10 el 7ZB FT 847 MGF 1302,01/06 +YO4RFV,KN45AK,,,,,,08/02 YO4RXX,KN45AK,,,,,,07/03 -YO5AVN,KN34,,,I.,,,1993 -YO5BIM,KN07XB,,,Puiu,,,05/04 -YO5BWD,KN27GD,,,Aurel,,,08/00 -YO5DJM,KN17,EME,,josif,,,1993 -YO5KAI,KN16TE,EME,,Clubstation,,.149 DTR,06/99 -YO5KAV,KN16TS,EME,,Ion (Nelu),,.149.449,06/99 -YO5TE,KN16TS,EME,,Ion (Nelu),,144: 1KW 4x10el MGF1302.149,01/02 -YO5TP,KN16SS,,,Bela,,144: 40W 16el,11/04 +YO5AVN,KN34,,,,,,1993 +YO5BIM,KN07XB,,,,,,05/04 +YO5BWD,KN27GD,,,,,,08/00 +YO5KAI,KN16TE,EME,,,,.149 DTR,06/99 +YO5KAV,KN16TS,EME,,,,.149.449,06/99 +YO5TE,KN16TS,EME,,,,144: 1KW 4x10el MGF1302.149,01/02 +YO5TP,KN16SS,,,,,144: 40W 16el,11/04 YO7CGS,KN15OA,,,,,1000lpm,08/97 -YO7CKQ,KN15OA,,,nimara,,,05/01 -YO7IV,KN24MT,,,Ion,,144: TS850 + Tcvr 2x4CX250b 800W 15el 9BV,05/03 -YO7VS,KN14VH,,,Dietmar A. ""Dick",,50: 2XQB3/300 2xBF981 5el LY J-Pol crossdipol,10/98 -YO8BSE,KN36EW,,,Costi,,.075,10/95 -YO8CYN,KN36LW,,,Mihai,,,08/01 -YP0A,KN27GD,,,OP YO5TE,,,1992 -YR0A,KN16TS,EME,,Ion (Nelu),,.149.449,06/99 -YR5A,KN16TS,EME,,Ion (Nelu),,.149.449,06/99 -YR99E,KN34,,,OP YO3JW,,,08/99 -YT1VP,JN94WG,,,Vlada,,TS440 FT225,10/04 -YT1VV,JN94US,,,Vasa,,.135.185,07/00 -YT1W,JN91,,,,,,1990 +YO7CKQ,KN15OA,,,,,,05/01 +YO7IV,KN24MT,,,,,144: TS850 + Tcvr 2x4CX250b 800W 15el 9BV,05/03 +YO7VS,KN14VH,,,,,50: 2XQB3/300 2xBF981 5el LY J-Pol crossdipol,10/98 +YO8BSE,KN36EW,,,,,.075,10/95 +YO8CYN,KN36LW,,,,,,08/01 +YO8RHI,KN37TE,,,,,,07/05 +YO9FRJ,KN34AW,EME,,ex YO4FRJ,,FT847 50: 300W 6el - 144: 1000W 4x 17B2 MGF,01/06 +YP0A,KN27GD,,,Expedition,,,1992 +YR0A,KN16TS,EME,,Expedition,,.149.449,06/99 +YR5A,KN16TS,EME,,Expedition,,.149.449,06/99 +YR99E,KN34,,,Expedition,,,08/99 +YT1VP,JN94WG,,,,,TS440 FT225,10/04 +YT1VV,JN94US,,,ex YU1VG,,.135.185,07/00 +YT1W,JN91,,,Expedition,,,1990 +YT2L,KN03QM,,,,,,12/05 YT4D,JN94CP,,,,,144: 250W 11el,08/00 -YT7AC,JN95,,,Stanko,,only SSB-MS,03/97 -YT7W,KN14CF,,,OP YU7AU,,,1993 -YT7WA,KN05EJ,,,OP: YU7MS YZ7UN,,144: 1KW 4x4el Loop 11el WU MGF1302.121,12/01 -YU1ADN,KN03KN,,,m.,,,06/96 +YT7AC,JN95,,,,,only SSB-MS,03/97 +YT7C,KN05FJ,,,= YU7AAA,,144: GS35B 4x10+2x10 el BVO 3WL,03/06 +YT7G,JN94XC,,,= YU7GOL,,144: MGF1302 GS35B 4x10el + 2x10el BVO-3wl,03/06 +YT7W,KN14CF,,,Expedition,,,1993 +YT7WA,KN05EJ,,,SpecialCall,,144: 1KW 4x4el Loop 11el WU MGF1302.121,12/01 +YU0TESLA,KN03QM,EME,,SpecialCall,,144: 16 x 7el Yagi (by Dual) full elevation,04/06 +YU150CF,KN03QM,EME,,SpecialCall,,144: 16 x 7el Yagi (by Dual) full elevation,04/06 +YU1ADN,KN03KN,,,,,,06/96 YU1AFS,KN04FT,,,,,,1992 YU1AZK,KN04,,,,,144: 25W 2x11elonly SSB-MS,10/98 YU1BT,KN03KN,,,,,.148,10/95 -YU1BW,KN04GT,,,Joco,,,04/02 -YU1CF,KN03QN,EME,,Goran,,144: FT736R IC746PRO 1500W 4x7el,01/05 +YU1BW,KN04GT,,,,,,04/02 +YU1CF,KN03QN,EME,,ex YU1OYA,,FT736R IC746PRO 50: 4x 6el Yagi 1KW pream,03/06 YU1EU,KN04DW,,,,,,08/98 -YU1EV,KN04CN,,,Moma,,,05/04 -YU1EXY,KN04FT,,,OP Zoran,,144: FT225rd 350W 16el F9FT MGF13022000lpm,01/02 +YU1EV,KN04CN,,,,,,04/06 +YU1EXY,KN04FT,,,,,144: FT225rd 350W 16el F9FT MGF13022000lpm,01/02 YU1HFG,KN02XX,,,,,,12/95 -YU1IO,KN04IQ,,,Milenko,,144: 600W 4x17el,11/97 +YU1IO,KN04IQ,,,,,144: 600W 4x17el,11/97 YU1L,KN02XX,,,,,,12/95 -YU1LA,KN04FR,,,Ivan,,144: IC746 17B2,04/03 +YU1LA,KN04FR,,,,,144: IC910 17B2 LY,10/05 YU1OO,KN02XX,,,,,,1993 YU1OS,KN04FS,,,,,144: FT225rd 100W 2x9el MGF1302only SSB-MS,11/99 -YU1S,JN94US,,,Mico 1HQR- Vasa 1VG,,144: 17el 400W.147 1000lpm,11/97 -YU1WP,JN94OM,,,Miroslav (Miro),,.420,07/96 +YU1S,JN94US,,,,,144: 17el 400W.147 1000lpm,11/97 +YU1WP,JN94OM,,,,,.420,07/96 YU1ZF,KN03IR,,,,,,1991 -YU4AR,JN94AS,,,Zdravko,,144: TR9130 250W 10el PA0MS-ant PreampUHER 15,11/02 -YU7AA,JN95NS,EME,,,,,01/05 -YU7AAA,KN05FJ,,,RadioClub,,144: GS35B 4x10+2x10 el BVO 3WL,11/04 +YU4AR,JN94AS,,,=4O4AR,,144: TR9130 250W 10el PA0MS-ant PreampUHER 15,11/02 +YU7AA,JN95NS,EME,,ex YU1NOK,,TS850 - 144: 4x 10el 7ZB 500W - 432: 2x 2x 22,04/06 +YU7AAA,KN05FJ,,,= YT7C,,144: GS35B 4x10+2x10 el BVO 3WL,11/04 YU7ACO,KN05QC,,,,,144: FT221r PA 200W 2x 10el. DJ9BV1500lpm,08/00 YU7AJH,JN95WF,,,,,,1990 -YU7AR,KN05BW,,,Teodor ""Teo",,IC745- FT225RD- 144: 4x5wl MGF1412 YL1056,12/01 -YU7AU,KN04HV,,,ljubisa ""Ljube",,144: 250W 2x11el.093,12/01 -YU7AZX,KN04AX,,,Branislav,,,08/03 -YU7BCL,KN05FW,,,Nesa,,,12/97 +YU7AR,KN05BW,,,ex YU7PXB,,IC745- FT225RD- 144: 4x5wl MGF1412 YL1056,12/01 +YU7AS,KN05DJ,,,,,144: 150W 8x 6el Loop,08/05 +YU7AU,KN04HV,,,,,144: 250W 2x11el.093,12/01 +YU7AZX,KN04AX,,,,,,08/03 +YU7BCL,KN05FW,,,,,,12/97 YU7BCX,KN05HP,,,,,,08/96 YU7CV,JN95WK,,,,,,1995 -YU7EF,KN04HV,EME,,Popa,,FT847,07/04 -YU7EW,KN05HP,,,Istvan ""Pista",,144:500Watt 4x10el MGF1302109 2000lpm MSDSP,04/03 +YU7EF,KN04HV,EME,,ex YU7PFR,,FT847,05/05 +YU7EW,KN05HP,EME,,,,144: 500Watt 4x 9el MGF1302109 2000lpm MSDS,01/06 YU7FF,KN05EP,,,,,,1994 -YU7FU,KN04HV,,,Nesa,,,08/04 -YU7KB,JN94XX,,,Branislav (Bane),,144: IC202 2x11el 800W Preamp (MGF1302).141,02/04 -YU7MS,KN05EF,,,Mihalj ""Miska",,144: 400/1KW 2x11el WU MGF13027000 lpm385,02/05 -YU7ON,KN04AX,,,Zoran,,144. TR751 4x11el 25W1000lpm.442,08/00 -YU7PS,KN05FJ,,,Pal ""Pali",,144: 400/1KW 2x11el WU MGF13027000lpm385,02/05 -YU7VA,KN05EJ,,,Voislav - Voja,,144: 100Watt 11el BFT 66.080 1000lpm.180,05/00 -YU8DM,KN02OQ,,,,,,01/05 +YU7FU,KN04HV,,,ex YU7MJA,,,08/04 +YU7GOL,JN94XC,,,= YT7G,,144: MGF1302 GS35B 4x10el + 2x10el BVO-3wl,03/06 +YU7KB,JN94XX,,,,,144: IC202 2x11el 800W Preamp (MGF1302).141,02/04 +YU7MS,KN05EF,,,,,144: 400/1KW 2x11el WU MGF13027000 lpm385,02/05 +YU7ON,KN04AX,,,,,144. TR751 4x11el 25W1000lpm.442,08/00 +YU7PS,KN05FJ,,,,,144: 400/1KW 2x11el WU MGF13027000lpm385,02/05 +YU7VA,KN05EJ,,,,,144: 100Watt 11el BFT 66.080 1000lpm.180,05/00 +YU7XL,JN95NT,EME,,,,FT897 50: 100W 2x4 YU7EF 144: 1000Watt 4x1,04/06 +YV5LIX,FK60NM,EME,,,,IC-275H FT-100D TS-600 200W 18db Antenna,04/05 YV5ZZ,FK60SM,EME,,,,,01/05 YZ1DO,KN04ER,,,,,only SSB-MS,08/99 -YZ1KU,KN04EU,,,Boza,,144: 10W 9el F9FTonly SSB-MS,05/03 -YZ7MON,JN95XA,,,Ilija,,144: TR751E 25W 2x11elonly SSB-MS.383,07/98 -YZ7UN,KN05EI,,,Ivanko,,144: 4x6el Loop 100W,01/01 -Z30B,KN01PA,EME,,Clubstation,,144: 1-5KW 4xYU0B (17-5db) MGF1302.142 150,08/00 -Z31DX,KN11GD,,,George ""Joe",,,06/99 -Z32UC,KN11CR,,,,,,01/05 -Z35Z,KN11CR,EME,,Dimitar ""Dime",,144: IC202 350W 4x4el Loop MGF1302 432: 15,12/04 -Z37CEF,KN01QA,,,Clubstation,,,11/99 -ZA0DXC,KN01,,,OP HG3DXC,,,1991 -ZB0W,IM76HE,,,,,,1993 +YZ1KU,KN04EU,,,,,144: 10W 9el F9FTonly SSB-MS,05/03 +YZ7MON,JN95XA,,,,,144: TR751E 25W 2x11elonly SSB-MS.383,07/98 +YZ7UN,KN05EI,,,,,144: 4x6el Loop 100W,01/01 +Z30B,KN01PA,EME,,,,144: 1-5KW 4xYU0B (17-5db) MGF1302.142 150,08/00 +Z31DX,KN11GD,,,ex YT5G,,,06/99 +Z35Z,KN11CR,EME,,exZ32UC YU5UC VHF(!)QSLs via DL8EBW,,144: IC202 350W 4x4el Loop MGF1302 432: 15,06/05 +Z37CEF,KN01QA,,,ex YU5CEF,,,11/99 +ZA0DXC,KN01,,,Expedition,,,1991 +ZB0W,IM76HE,,,Expedition,,,1993 +ZK1EME,BG80CT,EME,,,,144: 2x 3.2wl X-Pol yagis 8877 1.5KW,05/05 +ZL1BT,RF73LC,EME,,,,144: 12el 400W,03/06 +ZL1IU,RF64VR,EME,,,,144: 4x12el 1.2KW,10/05 ZL1PE,RF74DG,,,,,,2003 -ZL1RS,RF73HD,,,,,,2003 -ZL3AAD,RE66GR,EME,,Graham,,,2003 -ZL3NW,RE66ho,EME,, -ZL3TY,RE57OM,EME,,Bob,,,01/05 -ZP4KFX,GG15LV,,,Giuseppe ""Pino",,,03/01 -ZR1ADI,JF95KU,,,Gilbert,,,01/02 -ZR1AEE,JF96IA,,,Peter,,,01/02 -ZR1EV,JF96IC,,,Shawn,,50: FT690r 200W 4el.200.200,11/96 -ZR1L,JF96HD,,,Chris,,,10/02 -ZR1TRD,JF96HC,,,Andre,,,01/02 -ZR1WZ,KF05QP,,,Werner,,,2004 -ZR2DX,KF26,,,Barry,,,02/02 -ZR5ADQ,KG50IA,,,Mike,,,01/02 -ZR6ABU,KG33XV,,,Craig,,,2003 -ZR6CRW,KG33,,,Craig,,,10/02 -ZR6DXB,KG33XX,,,Barry,,,10/02 -ZR6GE,KG43AR,,,Gavin,,,10/02 -ZR6KHJ,KG43CU,,,Ken,,,02/02 -ZS1EK,JF95FU,,,Bill,,,01/02 -ZS2ACP,KF26SA,,,Andre,,,02/02 -ZS2BWB,KF26TD,,,Ken,,,02/02 -ZS4KB,KG32,,,Johan,,,10/02 -ZS4NS,KG32IA,,,Nico ""Nick",,50: IC551D 6el 80W - QSL via N7RO,02/01 -ZS4TX,KG30BW,,,Bernie,,,01/02 +ZL1RS,RF72SU,EME,,,,,09/05 +ZL1WN,RF73HG,EME,,,,144: 4x 18el 400W,03/06 +ZL2DX,RE78RR,EME,,,,432: 18el 100W,09/05 +ZL3AAD,RE66GR,EME,,,,,2003 +ZL3NW,RE66HO,EME,,,,,03/05 +ZL3TY,RE57OM,EME,,,,,05/05 +ZP4KFX,GG15LV,,,,,,03/01 +ZR1ADI,JF95KU,,,,,,01/02 +ZR1AEE,JF96IA,,,,,,01/02 +ZR1EV,JF96IC,,,,,50: FT690r 200W 4el.200.200,11/96 +ZR1L,JF96HD,,,,,,10/02 +ZR1TRD,JF96HC,,,,,,01/02 +ZR1WZ,KF05QP,,,,,,2004 +ZR2DX,KF26,,,,,,02/02 +ZR5ADQ,KG50IA,,,,,,01/02 +ZR6ABU,KG33XV,,,,,,2003 +ZR6CRW,KG33,,,ex ZR6ABU,,,10/02 +ZR6DXB,KG33XX,,,,,,10/02 +ZR6GE,KG43AR,,,,,,10/02 +ZR6KHJ,KG43CU,,,,,,02/02 +ZS1EK,JF95FU,,,,,,01/02 +ZS2ACP,KF26SA,,,,,,02/02 +ZS2BWB,KF26TD,,,,,,02/02 +ZS4JJ,KG30FV,EME,,,,144: 16el 100W,02/06 +ZS4KB,KG32,,,,,,10/02 +ZS4NS,KG32IA,,,,,50: IC551D 6el 80W - QSL via N7RO,02/01 +ZS4TX,KG30BW,,,,,,01/02 ZS5AV,KF69GX,,,,,,2003 -ZS5DJ,KG59AA,,,Dave,,,01/02 -ZS5LEE,KG50JF,EME,,Lee,,IC821 706MKIIG,01/05 -ZS5Y,JF59JR,EME,,Derek,,,02/05 -ZS6AVP,KG44OD,,,Clive,,,05/02 -ZS6AXT,KG33VV,EME,,Ivo,,,02/00 -ZS6BTE,KG33XV,,,Ian,,,10/02 -ZS6DTS,KG43AR,,,Dickie,,,10/02 -ZS6EGB,KG43BQ,,,Emil,,,10/02 -ZS6GER,KG33,,,Paul,,,02/02 -ZS6GPM,KG33XU,,,Graham,,,10/02 -ZS6HS,KG33XR,,,Bert,,,01/02 -ZS6JON,KG33VV,,,John,,,10/02 -ZS6NK,KG46RC,,,Paul,,,02/02 -ZS6OB,KG44DE,,,Pine,,,01/02 -ZS6RAD,KG44CA,,,Rad,,,10/02 -ZS6UT,KG44EF,,,Ed,,,01/02 -ZS6WAB,KG46RC,EME,,,,,01/05 -ZS6WB,KG44EE,,,Hal,,,05/02 -ZS6WI,KG46RC,,,Will,,,2003 -ZS6Y,KG33WU,,,Etienne,,,02/02 -ZZZZZZ,End-of-Database,VHF-MS-DATABASE-Viewer © 2002/2005 by DG0KW +ZS5DJ,KG59AA,,,,,,01/02 +ZS5LEE,KG50JF,EME,,,,IC821 706MKIIG 144: 4x 2m18XXX QRO 432: 2,04/05 +ZS5Y,KF59JR,EME,,,,1296: 3.7m dish 50W,08/05 +ZS6AVP,KG44OD,,,,,,05/02 +ZS6AXT,KG33VV,EME,,,,,03/05 +ZS6BTE,KG33XV,EME,,,,144: 2x 4wl Yagis 100W,08/05 +ZS6DTS,KG43AR,,,,,,10/02 +ZS6EGB,KG43BQ,,,,,,10/02 +ZS6GER,KG33,,,,,,02/02 +ZS6GPM,KG33XU,,,,,,10/02 +ZS6HS,KG33XR,,,,,,01/02 +ZS6JON,KG33VV,,,,,,10/02 +ZS6JR,KG44,EME,,,,,07/05 +ZS6MRK,KG34XH,EME,,,,144: 400W 2M7,03/06 +ZS6NK,KG46RC,EME,,ex ZS6PJS,,144: 2x 13wl 120W,09/05 +ZS6OB,KG44DE,EME,,,,,07/05 +ZS6RAD,KG44CA,,,,,,10/02 +ZS6UT,KG44EF,,,,,,01/02 +ZS6WAB,KG46RC,EME,,,,,04/05 +ZS6WB,KG44EE,EME,,,,144: 2M5WL 200W,05/06 +ZS6WI,KG46RC,,,,,,2003 +ZS6Y,KG33WU,,,,,,02/02 +ZZZZZZ,End-Of-Call3-Database-225,VHF-MS-Database-Viewer © 2002/2005 by DG0KW \ No newline at end of file diff --git a/wsjt.py b/wsjt.py index 8042f1b72..26a3a5983 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1549,7 +1549,7 @@ filemenu.add('command', label = 'Open next in directory', command = opennext) filemenu.add('command', label = 'Decode remaining files in directory', \ command = decodeall) filemenu.add_separator() -filemenu.add('command', label = 'Delete all *.WAV files in RxWAV', \ +filemenu.add('command', label = 'Delete all *.WAV files in RxWav', \ command = delwav) filemenu.add_separator() filemenu.add('command', label = 'Erase ALL.TXT', command = del_all) From 462ffc3c9683345a224b887d9529134d8b17bf77 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 5 Aug 2006 16:53:41 +0000 Subject: [PATCH 179/811] - libsamplerate is not being used at all in *nix, I assume it is supposed to be used for portaudio. The following files enable libsamplerate when either Win32 is defined or portaudio is used. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@239 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 6 +++--- configure.ac | 2 +- portaudio-v19/config.log | 3 +++ portaudio-v19/config.status | 16 ++++++++-------- wsjt1.F | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/configure b/configure index c476c69e9..9dd56fd94 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 226 2006-08-02 03:47:38Z va3db $ +# $Id: configure.ac 227 2006-08-02 10:12:59Z va3db $ # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -976,7 +976,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 226 2006-08-02 03:47:38Z va3db $ +$Id: configure.ac 227 2006-08-02 10:12:59Z va3db $ _ACEOF exit 0 fi @@ -6737,7 +6737,7 @@ cat >>confdefs.h <<\_ACEOF #define USE_PORTAUDIO 1 _ACEOF - AUDIO="a2d.f90 jtaudio.c start_portaudio.c" + AUDIO="a2d.f90 jtaudio.c resample.c start_portaudio.c" NEEDPORTAUDIO="portaudio-v19/lib/libportaudio.a" diff --git a/configure.ac b/configure.ac index d021f3a8d..c7ea666ec 100644 --- a/configure.ac +++ b/configure.ac @@ -305,7 +305,7 @@ fi if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) - AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c") + AC_SUBST(AUDIO, "a2d.f90 jtaudio.c resample.c start_portaudio.c") AC_SUBST(NEEDPORTAUDIO, "portaudio-v19/lib/libportaudio.a") LDFLAGS="portaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" else diff --git a/portaudio-v19/config.log b/portaudio-v19/config.log index 7b24b68d9..8f29e67d0 100644 --- a/portaudio-v19/config.log +++ b/portaudio-v19/config.log @@ -14,6 +14,9 @@ configure:991: checking whether byte ordering is bigendian configure:1083: checking for snd_pcm_open in -lasound configure:1131: checking host system type configure:1159: checking for pkg-config +configure:1203: checking for jack +configure:1210: checking JACK_CFLAGS +configure:1215: checking JACK_LIBS configure:1244: checking size of short configure:1283: checking size of int configure:1322: checking size of long diff --git a/portaudio-v19/config.status b/portaudio-v19/config.status index d06450081..d2b8f073e 100755 --- a/portaudio-v19/config.status +++ b/portaudio-v19/config.status @@ -2,7 +2,7 @@ # Generated automatically by configure. # Run this file to recreate the current configuration. # This directory was configured as follows, -# on host phy-joe.Princeton.EDU: +# on host night.db.net: # # ./configure --with-jack=no # @@ -64,14 +64,14 @@ s%@INSTALL_PROGRAM@%${INSTALL}%g s%@INSTALL_SCRIPT@%${INSTALL_PROGRAM}%g s%@INSTALL_DATA@%${INSTALL} -m 644%g s%@AR@%/usr/bin/ar%g -s%@host@%i686-pc-linux-gnu%g -s%@host_alias@%i686-pc-linux-gnu%g -s%@host_cpu@%i686%g -s%@host_vendor@%pc%g -s%@host_os@%linux-gnu%g +s%@host@%i386-unknown-freebsd7.0%g +s%@host_alias@%i386-unknown-freebsd7.0%g +s%@host_cpu@%i386%g +s%@host_vendor@%unknown%g +s%@host_os@%freebsd7.0%g s%@PKG_CONFIG@%/usr/local/bin/pkg-config%g -s%@JACK_CFLAGS@%%g -s%@JACK_LIBS@%%g +s%@JACK_CFLAGS@%-I/usr/local/include %g +s%@JACK_LIBS@%-pthread -L/usr/local/lib -ljack %g s%@OTHER_OBJS@% pa_unix_oss/pa_unix_oss.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o%g s%@PADLL@%libportaudio.so%g s%@SHARED_FLAGS@%-shared -fPIC%g diff --git a/wsjt1.F b/wsjt1.F index 05c0e62bd..b0e32d499 100644 --- a/wsjt1.F +++ b/wsjt1.F @@ -105,7 +105,7 @@ dat2(j)=dat(j)-ave enddo -#ifdef Win32 +#if (USE_PORTAUDIO==1) || defined(Win32) ierr=resample(dat2,dat,samratio,jz) if(ierr.ne.0) print*,'Resample error.',samratio #endif From c761a3dc9732dc69c659d0521b77f6da5bba7bec Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 5 Aug 2006 16:54:52 +0000 Subject: [PATCH 180/811] - These two files should not be in the repository, they are created from the portaudio configure. mea culpa. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@240 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- portaudio-v19/config.log | 23 ----- portaudio-v19/config.status | 175 ------------------------------------ 2 files changed, 198 deletions(-) delete mode 100644 portaudio-v19/config.log delete mode 100755 portaudio-v19/config.status diff --git a/portaudio-v19/config.log b/portaudio-v19/config.log deleted file mode 100644 index 8f29e67d0..000000000 --- a/portaudio-v19/config.log +++ /dev/null @@ -1,23 +0,0 @@ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -configure:618: checking for gcc -configure:731: checking whether the C compiler (cc ) works -configure:747: cc -o conftest conftest.c 1>&5 -configure:773: checking whether the C compiler (cc ) is a cross-compiler -configure:778: checking whether we are using GNU C -configure:806: checking whether cc accepts -g -configure:840: checking for ranlib -configure:898: checking for a BSD compatible install -configure:953: checking for ar -configure:991: checking whether byte ordering is bigendian -configure:1083: checking for snd_pcm_open in -lasound -configure:1131: checking host system type -configure:1159: checking for pkg-config -configure:1203: checking for jack -configure:1210: checking JACK_CFLAGS -configure:1215: checking JACK_LIBS -configure:1244: checking size of short -configure:1283: checking size of int -configure:1322: checking size of long -configure:1632: checking for pthread_create in -lpthread diff --git a/portaudio-v19/config.status b/portaudio-v19/config.status deleted file mode 100755 index d2b8f073e..000000000 --- a/portaudio-v19/config.status +++ /dev/null @@ -1,175 +0,0 @@ -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host night.db.net: -# -# ./configure --with-jack=no -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]" -for ac_option -do - case "$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running ${CONFIG_SHELL-/bin/sh} ./configure --with-jack=no --no-create --no-recursion" - exec ${CONFIG_SHELL-/bin/sh} ./configure --with-jack=no --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "./config.status generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "$ac_cs_usage"; exit 0 ;; - *) echo "$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=. -ac_given_INSTALL="/usr/bin/install -c" - -trap 'rm -fr Makefile conftest*; exit 1' 1 2 15 - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g; - s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF -/^[ ]*VPATH[ ]*=[^:]*$/d - -s%@SHELL@%/bin/sh%g -s%@CFLAGS@%-g -O2 -Wall -pedantic -pipe -fPIC -DPA_LITTLE_ENDIAN%g -s%@CPPFLAGS@%%g -s%@CXXFLAGS@%%g -s%@FFLAGS@%%g -s%@DEFS@% -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_LIBPTHREAD=1 -DPA_USE_OSS=1 %g -s%@LDFLAGS@%%g -s%@LIBS@%-lpthread -lm -lpthread%g -s%@exec_prefix@%${prefix}%g -s%@prefix@%/usr/local%g -s%@program_transform_name@%s,x,x,%g -s%@bindir@%${exec_prefix}/bin%g -s%@sbindir@%${exec_prefix}/sbin%g -s%@libexecdir@%${exec_prefix}/libexec%g -s%@datadir@%${prefix}/share%g -s%@sysconfdir@%${prefix}/etc%g -s%@sharedstatedir@%${prefix}/com%g -s%@localstatedir@%${prefix}/var%g -s%@libdir@%${exec_prefix}/lib%g -s%@includedir@%${prefix}/include%g -s%@oldincludedir@%/usr/include%g -s%@infodir@%${prefix}/info%g -s%@mandir@%${prefix}/man%g -s%@CC@%cc%g -s%@RANLIB@%ranlib%g -s%@INSTALL_PROGRAM@%${INSTALL}%g -s%@INSTALL_SCRIPT@%${INSTALL_PROGRAM}%g -s%@INSTALL_DATA@%${INSTALL} -m 644%g -s%@AR@%/usr/bin/ar%g -s%@host@%i386-unknown-freebsd7.0%g -s%@host_alias@%i386-unknown-freebsd7.0%g -s%@host_cpu@%i386%g -s%@host_vendor@%unknown%g -s%@host_os@%freebsd7.0%g -s%@PKG_CONFIG@%/usr/local/bin/pkg-config%g -s%@JACK_CFLAGS@%-I/usr/local/include %g -s%@JACK_LIBS@%-pthread -L/usr/local/lib -ljack %g -s%@OTHER_OBJS@% pa_unix_oss/pa_unix_oss.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o%g -s%@PADLL@%libportaudio.so%g -s%@SHARED_FLAGS@%-shared -fPIC%g -s%@DLL_LIBS@%%g -s%@NASM@%%g -s%@NASMOPT@%%g - -CEOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi - -CONFIG_FILES=${CONFIG_FILES-"Makefile"} -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - - - -exit 0 From a6d055de23411ee2fdbe44eefa232a49c4f90260 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 5 Aug 2006 17:35:21 +0000 Subject: [PATCH 182/811] Dummy git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@242 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 4424 +++++++++++++++++++++++++++---------------------------- 1 file changed, 2212 insertions(+), 2212 deletions(-) diff --git a/wsjt.py b/wsjt.py index 26a3a5983..23f96a6e5 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,2212 +1,2212 @@ -#---------------------------------------------------------------- WSJT - -from Tkinter import * -from tkFileDialog import * -import Pmw -from tkMessageBox import showwarning -import g,os,time -import Audio -from math import log10 -from Numeric import zeros -import dircache -import Image,ImageTk #, ImageDraw -from palettes import colormapblue, colormapgray0, colormapHot, \ - colormapAFMHot, colormapgray1, colormapLinrad, Colormap2Palette -from types import * -import array - -root = Tk() -Version="5.9.5 r" + "$Rev$"[6:-1] -print "******************************************************************" -print "WSJT Version " + Version + ", by K1JT" -print "Revision date: " + \ - "$Date$"[7:-1] -print "Run date: " + time.asctime(time.gmtime()) + " UTC" - -#See if we are running in Windows -g.Win32=0 -if sys.platform=="win32": - g.Win32=1 - try: - root.option_readfile('wsjtrc.win') - except: - pass -else: - try: - root.option_readfile('wsjtrc') - except: - pass -root_geom="" - - -#------------------------------------------------------ Global variables -appdir=os.getcwd() -isync=0 -isync441=2 -isync6m=-10 -isync65=1 -isync_save=0 -iclip=0 -itol=5 -ntol=(10,25,50,100,200,400) #List of available tolerances -idsec=0 -#irdsec=0 -lauto=0 -cmap0="Linrad" -fileopened="" -font1='Helvetica' -hiscall="" -hisgrid="" -isec0=-99 -k2txb=IntVar() -kb8rq=IntVar() -loopall=0 -mode=StringVar() -mode.set("") -mrudir=os.getcwd() -nafc=IntVar() -naz=0 -ndepth=IntVar() -nel=0 -nblank=IntVar() -ncall=0 -ncwtrperiod=120 -ndmiles=0 -ndkm=0 -ndebug=IntVar() -neme=IntVar() -nfreeze=IntVar() -nhotaz=0 -nhotabetter=0 -nopen=0 -nosh441=IntVar() -noshjt65=IntVar() -nsked=IntVar() -setseq=IntVar() -ShOK=IntVar() -slabel="Sync " -textheight=7 -txsnrdb=99. -TxFirst=IntVar() -green=zeros(500,'f') -im=Image.new('P',(500,120)) -im.putpalette(Colormap2Palette(colormapLinrad),"RGB") -pim=ImageTk.PhotoImage(im) -balloon=Pmw.Balloon(root) - -g.freeze_decode=0 -g.mode="" -g.ndevin=IntVar() -g.ndevout=IntVar() -g.DevinName=StringVar() -g.DevoutName=StringVar() -g.focus=0 -#------------------------------------------------------ showspecjt -def showspecjt(event=NONE): - if g.showspecjt>0: - if g.focus>=1: - root.focus_set() - g.focus=0 - else: - g.focus=2 - else: - g.showspecjt=1 - g.focus=2 - -#------------------------------------------------------ restart -def restart(): - Audio.gcom2.nrestart=1 - Audio.gcom2.mantx=1 - -#------------------------------------------------------ restart2 -def restart2(): - Audio.gcom2.shok=ShOK.get() - Audio.gcom2.nrestart=1 - -#------------------------------------------------------ toggle_freeze -def toggle_freeze(event=NONE): - nfreeze.set(1-nfreeze.get()) - -#------------------------------------------------------ toggle_zap -def toggle_zap(event=NONE): - nzap.set(1-nzap.get()) - -#------------------------------------------------------ btx (1-6) -def btx1(event=NONE): - ntx.set(1) - Audio.gcom2.txmsg=(tx1.get()+' ')[:28] - Audio.gcom2.ntxreq=1 - restart() -def btx2(event=NONE): - ntx.set(2) - Audio.gcom2.txmsg=(tx2.get()+' ')[:28] - Audio.gcom2.ntxreq=2 - restart() -def btx3(event=NONE): - ntx.set(3) - Audio.gcom2.txmsg=(tx3.get()+' ')[:28] - Audio.gcom2.ntxreq=3 - restart() -def btx4(event=NONE): - ntx.set(4) - Audio.gcom2.txmsg=(tx4.get()+' ')[:28] - Audio.gcom2.ntxreq=4 - restart() -def btx5(event=NONE): - ntx.set(5) - Audio.gcom2.txmsg=(tx5.get()+' ')[:28] - Audio.gcom2.ntxreq=5 - restart() -def btx6(event=NONE): - ntx.set(6) - Audio.gcom2.txmsg=(tx6.get()+' ')[:28] - Audio.gcom2.ntxreq=6 - restart() - -#------------------------------------------------------ quit -def quit(): - root.destroy() - -#------------------------------------------------------ testmsgs -def testmsgs(): - for m in (tx1, tx2, tx3, tx4, tx5, tx6): - m.delete(0,99) - tx1.insert(0,"@A") - tx2.insert(0,"@B") - tx3.insert(0,"@C") - tx4.insert(0,"@D") - tx5.insert(0,"@1000") - tx6.insert(0,"@2000") - - -#------------------------------------------------------ textsize -def textsize(): - global textheight - if textheight <= 9: - textheight=21 - else: - if mode.get()[:4]=='JT65': - textheight=7 - else: - textheight=9 - text.configure(height=textheight) - -#------------------------------------------------------ logqso -def logqso(event=NONE): - t=time.strftime("%Y-%b-%d,%H:%M",time.gmtime()) - t=t+","+hiscall+","+hisgrid+","+str(g.nfreq)+","+g.mode+"\n" - t2="Please confirm making the following entry in WSJT.LOG:\n\n" + t - msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t2) - msg.geometry(msgpos()) - if g.Win32: msg.iconbitmap("wsjt.ico") - msg.focus_set() - result=msg.activate() - if result == 'Yes': - f=open(appdir+'/WSJT.LOG','a') - f.write(t) - f.close() - -#------------------------------------------------------ monitor -def monitor(event=NONE): - bmonitor.configure(bg='green') - Audio.gcom2.monitoring=1 - -#------------------------------------------------------ stopmon -def stopmon(event=NONE): - global loopall - loopall=0 - bmonitor.configure(bg='gray85') - Audio.gcom2.monitoring=0 - -#------------------------------------------------------ dbl_click_text -def dbl_click_text(event): - t=text.get('1.0',END) #Entire contents of text box - t1=text.get('1.0',CURRENT) #Contents from start to mouse pointer - dbl_click_call(t,t1,event) -#------------------------------------------------------ dbl_click_ave -def dbl_click_ave(event): - t=avetext.get('1.0',END) #Entire contents of text box - t1=avetext.get('1.0',CURRENT) #Contents from start to mouse pointer - dbl_click_call(t,t1,event) -#------------------------------------------------------ dbl_click_call -def dbl_click_call(t,t1,event): - global hiscall - i=len(t1) #Length to mouse pointer - i1=t1.rfind(' ')+1 #index of preceding space - i2=i1+t[i1:].find(' ') #index of next space - hiscall=t[i1:i2] #selected word, assumed as callsign - ToRadio.delete(0,END) - ToRadio.insert(0,hiscall) - i3=t1.rfind('\n')+1 #start of selected line - if i>6 and i2>i1: - try: - nsec=60*int(t1[i3+2:i3+4]) + int(t1[i3+4:i3+6]) - except: - nsec=0 - if setseq.get(): TxFirst.set((nsec/Audio.gcom1.trperiod)%2) - lookup() - GenStdMsgs() - i3=t[:i1].strip().rfind(' ')+1 - if t[i3:i1].strip() == 'CQ': - ntx.set(1) - else: - ntx.set(2) - if event.num==3 and not lauto: toggleauto() - -#------------------------------------------------------ decode -def decode(event=NONE): - if Audio.gcom2.ndecoding==0: #If already busy, ignore request - Audio.gcom2.nagain=1 - Audio.gcom2.npingtime=0 #Decode whole record - n=1 - Audio.gcom2.mousebutton=0 - if Audio.gcom2.ndecoding0==4: n=4 - Audio.gcom2.ndecoding=n #Standard decode, full file (d2a) - -#------------------------------------------------------ decode_include -def decode_include(event=NONE): - global isync,isync_save - isync_save=isync - isync=-99 - Audio.gcom2.minsigdb=-99 - decode() - -#------------------------------------------------------ decode_exclude -def decode_exclude(event=NONE): - global isync,isync_save - isync_save=isync - isync=99 - Audio.gcom2.minsigdb=99 - decode() - -#------------------------------------------------------ openfile -def openfile(event=NONE): - global mrudir,fileopened,nopen - nopen=1 #Work-around for "click feedthrough" bug - try: - os.chdir(mrudir) - except: - pass - fname=askopenfilename(filetypes=[("Wave files","*.wav *.WAV")]) - if fname: - Audio.getfile(fname,len(fname)) - if Audio.gcom2.ierr: print 'Error ',Audio.gcom2.ierr, \ - 'when trying to read file',fname - mrudir=os.path.dirname(fname) - fileopened=os.path.basename(fname) - os.chdir(appdir) - -#------------------------------------------------------ opennext -def opennext(event=NONE): - global ncall,fileopened,loopall,mrudir - if fileopened=="" and ncall==0: - openfile() - ncall=1 - else: -# Make a list of *.wav files in mrudir - la=os.listdir(mrudir) - la.sort() - lb=[] - for i in range(len(la)): - j=la[i].find(".wav") + la[i].find(".WAV") - if j>0: lb.append(la[i]) - for i in range(len(lb)): - if lb[i]==fileopened: - break - if ihc1 and hchc1 and modified==0: - stmp.append(NewEntry+"\n") - try: - f=open(appdir+'/CALL3.TMP','w') - f.writelines(stmp) - f.close() - except: - print 'Error in opening or writing to CALL3.TMP' - - if modified: - if os.path.exists("CALL3.OLD"): os.remove("CALL3.OLD") - os.rename("CALL3.TXT","CALL3.OLD") - os.rename("CALL3.TMP","CALL3.TXT") - -#-------------------------------------------------------- clrToRadio -def clrToRadio(event): - ToRadio.delete(0,END) - HisGrid.delete(0,99) - ToRadio.focus_set() - if kb8rq.get(): ntx.set(6) - - -#------------------------------------------------------ whois -def whois(hiscall): - whodat="" - try: - f=open(appdir+'/CALL3.TXT','r') - s=f.readlines() - f.close() - except: - print 'Error when searching CALL3.TXT, or no such file present' - s="" - for i in range(len(s)): - if s[i][:2] != '//': - i1=s[i].find(',') - if s[i][:i1] == hiscall: - return s[i] - return "" - -#------------------------------------------------------ cleartext -def cleartext(): - f=open(appdir+'/decoded.txt',mode='w') - f.truncate(0) #Delete contents of decoded.txt - f.close() - f=open(appdir+'/decoded.ave',mode='w') - f.truncate(0) #Delete contents of decoded.ave - f.close() - -#------------------------------------------------------ ModeFSK441 -def ModeFSK441(event=NONE): - global slabel,isync,isync441,textheight,itol - if g.mode != "FSK441": - if lauto: toggleauto() - mode.set("FSK441") - cleartext() - Audio.gcom1.trperiod=30 - lab2.configure(text='FileID T Width dB Rpt DF') - lab1.configure(text='Time (s)',bg="green") - lab4.configure(fg='black') - lab5.configure(fg='black') - lab6.configure(bg="green") - isync=isync441 - slabel="S " - lsync.configure(text=slabel+str(isync)) - iframe4b.pack_forget() - textheight=9 - text.configure(height=textheight) - bclravg.configure(state=DISABLED) - binclude.configure(state=DISABLED) - bexclude.configure(state=DISABLED) - cbfreeze.configure(state=DISABLED) - cbafc.configure(state=DISABLED) - sked.configure(state=DISABLED) - report.configure(state=NORMAL) - shmsg.configure(state=NORMAL) - graph2.configure(bg='black') - itol=5 - inctol() - ntx.set(1) - GenStdMsgs() - erase() - -#------------------------------------------------------ ModeJT65 -def ModeJT65(): - global slabel,isync,isync65,textheight,itol - cleartext() - lab2.configure(text='FileID Sync dB DT DF W') - lab4.configure(fg='gray85') - lab5.configure(fg='gray85') - Audio.gcom1.trperiod=60 - iframe4b.pack(after=iframe4,expand=1, fill=X, padx=4) - textheight=7 - text.configure(height=textheight) - isync=isync65 - slabel="Sync " - lsync.configure(text=slabel+str(isync)) - bclravg.configure(state=NORMAL) - binclude.configure(state=NORMAL) - bexclude.configure(state=NORMAL) - cbfreeze.configure(state=NORMAL) - cbafc.configure(state=NORMAL) - sked.configure(state=NORMAL) - report.configure(state=DISABLED) - shmsg.configure(state=DISABLED) - graph2.configure(bg='#66FFFF') - itol=5 - inctol() - ntx.set(1) - GenStdMsgs() - erase() -# graph2.pack_forget() - -#------------------------------------------------------ ModeJT65A -def ModeJT65A(event=NONE): - if g.mode != "JT65A": - if lauto: toggleauto() - mode.set("JT65A") - ModeJT65() - -#------------------------------------------------------ ModeJT65B -def ModeJT65B(event=NONE): - if g.mode != "JT65B": - if lauto: toggleauto() - mode.set("JT65B") - ModeJT65() - -#------------------------------------------------------ ModeJT65C -def ModeJT65C(event=NONE): - if g.mode != "JT65C": - if lauto: toggleauto() - mode.set("JT65C") - ModeJT65() - -#------------------------------------------------------ ModeJT6M -def ModeJT6M(event=NONE): - global slabel,isync,isync6m,itol - if g.mode != "JT6M": - if lauto: toggleauto() - cleartext() - ModeFSK441() - lab2.configure(text='FileID T Width dB DF') - mode.set("JT6M") - isync=isync6m - lsync.configure(text=slabel+str(isync)) - shmsg.configure(state=DISABLED) - cbfreeze.configure(state=NORMAL) - itol=3 - ltol.configure(text='Tol '+str(ntol[itol])) - inctol() - nfreeze.set(1) - ntx.set(1) - Audio.gcom2.mousedf=0 - GenStdMsgs() - erase() - - -#------------------------------------------------------ ModeCW -def ModeCW(event=NONE): - if g.mode != "CW": - if lauto: toggleauto() - cleartext() - mode.set("CW") - Audio.gcom1.trperiod=ncwtrperiod - iframe4b.pack_forget() - text.configure(height=9) - bclravg.configure(state=DISABLED) - binclude.configure(state=DISABLED) - bexclude.configure(state=DISABLED) - cbfreeze.configure(state=DISABLED) - cbafc.configure(state=DISABLED) - sked.configure(state=DISABLED) - report.configure(state=NORMAL) - ntx.set(1) - GenStdMsgs() - erase() - -#------------------------------------------------------ ModeEcho -#def ModeEcho(event=NONE): -# mode.set("Echo") -# stub() - -#------------------------------------------------------ msgpos -def msgpos(): - g=root_geom[root_geom.index("+"):] - t=g[1:] - x=int(t[:t.index("+")]) # + 70 - y=int(t[t.index("+")+1:]) # + 70 - return "+%d+%d" % (x,y) - -#------------------------------------------------------ about -def about(event=NONE): - global Version - about=Toplevel(root) - about.geometry(msgpos()) - if g.Win32: about.iconbitmap("wsjt.ico") - t="WSJT Version " + Version + ", by K1JT" - Label(about,text=t,font=(font1,16)).pack(padx=20,pady=5) - t=""" -WSJT is a weak signal communications program. It supports -four operating modes: - - 1. FSK441 - fast mode for meteor scatter - 2. JT6M - optimized for meteor and ionospheric scatter on 50 MHz - 3. JT65 - for EME and troposcatter - 4. CW - 15 WPM Morse code, messages structured for EME - -Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, with -contributions from additional authors. WSJT is Open Source -software, licensed under the GNU General Public License (GPL). -Source code and programming information may be found at -http://developer.berlios.de/projects/wsjt/. -""" - Label(about,text=t,justify=LEFT).pack(padx=20) - t="Revision date: " + \ - "$Date$"[7:-1] - Label(about,text=t,justify=LEFT).pack(padx=20) - about.focus_set() - -#------------------------------------------------------ shortcuts -def shortcuts(event=NONE): - scwid=Toplevel(root) - scwid.geometry(msgpos()) - if g.Win32: scwid.iconbitmap("wsjt.ico") - t=""" -F1 List keyboard shortcuts -Shift-F1 List special mouse commands -CTRL-F1 About WSJT -F2 Options -F3 Tx Mute -F4 Clear "To Radio" -F5 What message to send? -F6 Open next file in directory -Shift-F6 Decode all wave files in directory -F7 Set FSK441 mode -Shift-F7 Set JT6M mode -F8 Set JT65A mode -Shift-F8 Set JT65B mode -CTRL-F8 Set JT65C mode -Shift-CTRL-F8 Set CW mode -F10 Toggle focus between WSJT screens -Alt-1 to Alt-6 Tx1 to Tx6 -Alt-A Toggle Auto On/Off -Alt-D Decode -Alt-E Erase -Alt-F Toggle Freeze -Alt-G Generate Standard Messages -Alt-I Include -Alt-L Lookup -CTRL-L Lookup, then Generate Standard Messages -Alt-M Monitor -Alt-O Tx Stop -Alt-P Play -Alt-Q Log QSO -Alt-S Stop Monitoring or Decoding -Alt-V Save Last -Alt-X Exclude -Alt-Z Toggle Zap -Right/Left Arrow Increase/decrease Freeze DF -""" - Label(scwid,text=t,justify=LEFT).pack(padx=20) - scwid.focus_set() - -#------------------------------------------------------ mouse_commands -def mouse_commands(event=NONE): - scwid=Toplevel(root) - scwid.geometry(msgpos()) - if g.Win32: scwid.iconbitmap("wsjt.ico") - t=""" -Click on Action --------------------------------------------------------- -Waterfall FSK441/JT6M: click to decode ping - JT65: Click to set DF for Freeze - Double-click to Freeze and Decode - -Main screen, FSK441/JT6M: click to decode ping -graphics area JT65: Click to set DF for Freeze - Double-click to Freeze and Decode - -Main screen, Double-click puts callsign in Tx messages -text area Right-double-click also sets Auto ON - -Sync, Clip, Left/Right click to increase/decrease -Tol, ... -""" - Label(scwid,text=t,justify=LEFT).pack(padx=20) - scwid.focus_set() - -#------------------------------------------------------ what2send -def what2send(event=NONE): - screenf5=Toplevel(root) - screenf5.geometry(root_geom[root_geom.index("+"):]) - if g.Win32: screenf5.iconbitmap("wsjt.ico") - t=""" -To optimize your chances of completing a valid QSO using WSJT, -use the following standard procedures and *do not* exchange pertinent -information by other means (e.g., internet, telephone, ...) while the -QSO is in progress! - -FSK441 or JT6M: If you have received - ... less than both calls from the other station, send both calls. - ... both calls, send both calls and your signal report. - ... both calls and signal report, send R and your report. - ... R plus signal report, send RRR. - ... RRR, the QSO is complete. However, the other station may not -know this, so it is conventional to send 73 to signify that you are done. - -(Outside of North America, the customary procedures for FSK441 -and JT6M may be slightly different.) - - -JT65: If you have received - ... less than both calls, send both calls and your grid locator. - ... both calls, send both calls, your grid locator, and OOO. - ... both calls and OOO, send RO. - ... RO, send RRR. - ... RRR, the QSO is complete. However, the other station may not -know this, so it is conventional to send 73 to signify that you are done. - -(Sending grid locators is conventional in JT65, but numerical signal -reports may be substituted.) -""" - Label(screenf5,text=t,justify=LEFT).pack(padx=20) - screenf5.focus_set() - -#------------------------------------------------------ prefixes -def prefixes(event=NONE): - pfx=Toplevel(root) - pfx.geometry(msgpos()) - if g.Win32: pfx.iconbitmap("wsjt.ico") - f=open(appdir+'/prefixes.txt','r') - s=f.readlines() - t2="" - for i in range(4): - t2=t2+s[i] - t="" - for i in range(len(s)-4): - t=t+s[i+4] - t=t.split() - t.sort() - t1="" - n=0 - for i in range(len(t)): - t1=t1+t[i]+" " - n=n+len(t[i])+2 - if n>60: - t1=t1+"\n" - n=0 - t1=t1+"\n" - if options.addpfx.get().lstrip(): - t1=t1+"\nOptional prefix: "+(options.addpfx.get().lstrip()+' ')[:8] - t2=t2+"\n"+t1 - Label(pfx,text=t2,justify=LEFT).pack(padx=20) - pfx.focus_set() - -#------------------------------------------------------ azdist -def azdist(): - if len(HisGrid.get().strip())<4: - labAz.configure(text="") - labHotAB.configure(text="",bg='gray85') - labDist.configure(text="") - else: - if mode.get()[:4]=="JT65" or mode.get()[:2]=="CW": - labAz.configure(text="Az: %d" % (naz,)) - labHotAB.configure(text="",bg='gray85') - else: - labAz.configure(text="Az: %d El: %d" % (naz,nel)) - if nhotabetter: - labHotAB.configure(text="Hot A: "+str(nhotaz),bg='#FF9900') - else: - labHotAB.configure(text="Hot B: "+str(nhotaz),bg='#FF9900') - if options.mileskm.get()==0: - labDist.configure(text=str(ndmiles)+" mi") - else: - labDist.configure(text=str(int(1.609344*ndmiles))+" km") - -#------------------------------------------------------ incsync -def incsync(event): - global isync - if isync<10: - isync=isync+1 - lsync.configure(text=slabel+str(isync)) - -#------------------------------------------------------ decsync -def decsync(event): - global isync - if isync>-30: - isync=isync-1 - lsync.configure(text=slabel+str(isync)) - -#------------------------------------------------------ incclip -def incclip(event): - global iclip - if iclip<5: - iclip=iclip+1 - if iclip==5: iclip=99 - lclip.configure(text='Clip '+str(iclip)) - -#------------------------------------------------------ decclip -def decclip(event): - global iclip - if iclip>-5: - iclip=iclip-1 - if iclip==98: iclip=4 - lclip.configure(text='Clip '+str(iclip)) - -#------------------------------------------------------ inctol -def inctol(event=NONE): - global itol - if itol<5: itol=itol+1 - ltol.configure(text='Tol '+str(ntol[itol])) - -#------------------------------------------------------ dectol -def dectol(event): - global itol - if itol>0 : itol=itol-1 - ltol.configure(text='Tol '+str(ntol[itol])) - -#------------------------------------------------------ incdsec -def incdsec(event): - global idsec - idsec=idsec+5 - bg='red' - if idsec==0: bg='white' - ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg) - Audio.gcom1.ndsec=idsec - -#------------------------------------------------------ decdsec -def decdsec(event): - global idsec - idsec=idsec-5 - bg='red' - if idsec==0: bg='white' - ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg) - Audio.gcom1.ndsec=idsec - -###------------------------------------------------------ incrdsec -##def incrdsec(event): -## global irdsec -## irdsec=irdsec+5 -## bg='red' -## if irdsec==0: bg='white' -## lrdsec.configure(text='RDsec '+str(0.1*irdsec),bg=bg) -## -###------------------------------------------------------ decrdsec -##def decrdsec(event): -## global irdsec -## irdsec=irdsec-5 -## bg='red' -## if irdsec==0: bg='white' -## lrdsec.configure(text='RDsec '+str(0.1*irdsec),bg=bg) -## -#------------------------------------------------------ inctrperiod -def inctrperiod(event): - global ncwtrperiod - if mode.get()[:2]=="CW": - if ncwtrperiod==120: ncwtrperiod=150 - if ncwtrperiod==60: ncwtrperiod=120 - Audio.gcom1.trperiod=ncwtrperiod - -#------------------------------------------------------ dectrperiod -def dectrperiod(event): - global ncwtrperiod - if mode.get()[:2]=="CW": - if ncwtrperiod==120: ncwtrperiod=60 - if ncwtrperiod==150: ncwtrperiod=120 - Audio.gcom1.trperiod=ncwtrperiod - -#------------------------------------------------------ erase -def erase(event=NONE): - graph1.delete(ALL) - if mode.get()[:4]!="JT65" and mode.get()[:2]!="CW": graph2.delete(ALL) - text.configure(state=NORMAL) - text.delete('1.0',END) - text.configure(state=DISABLED) - avetext.configure(state=NORMAL) - avetext.delete('1.0',END) - avetext.configure(state=DISABLED) - lab3.configure(text=" ") - Audio.gcom2.decodedfile=" " -#------------------------------------------------------ clear_avg -def clear_avg(event=NONE): - avetext.configure(state=NORMAL) - avetext.delete('1.0',END) - avetext.configure(state=DISABLED) - f=open(appdir+'/decoded.ave',mode='w') - f.truncate(0) #Delete contents of decoded.ave - f.close() - Audio.gcom2.nclearave=1 - -#------------------------------------------------------ defaults -def defaults(): - global slabel,isync,iclip,itol,idsec - isync=1 - if g.mode=="FSK441": isync=2 - iclip=0 - lclip.configure(text='Clip '+str(iclip)) - itol=5 - ltol.configure(text='Tol '+str(ntol[itol])) - if g.mode=="JT6M": - isync=-10 - itol=4 - ltol.configure(text='Tol '+str(ntol[itol])) - lsync.configure(text=slabel+str(isync)) - -#------------------------------------------------------ delwav -def delwav(): - t="Are you sure you want to delete\nall *.WAV files in the RxWav directory?" - msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t) - msg.geometry(msgpos()) - if g.Win32: msg.iconbitmap("wsjt.ico") - msg.focus_set() - result=msg.activate() - if result == 'Yes': -# Make a list of *.wav files in RxWav - la=dircache.listdir(appdir+'/RxWav') - lb=[] - for i in range(len(la)): - j=la[i].find(".wav") + la[i].find(".WAV") - if j>0: lb.append(la[i]) -# Now delete them all. - for i in range(len(lb)): - fname=appdir+'/RxWav/'+lb[i] - os.remove(fname) - -#------------------------------------------------------ del_all -def del_all(): - Audio.gcom1.ns0=-999999 - -#------------------------------------------------------ toggleauto -def toggleauto(event=NONE): - global lauto - lauto=1-lauto - Audio.gcom2.lauto=lauto - if lauto: - monitor() - else: - Audio.gcom1.txok=0 - Audio.gcom2.mantx=0 - if lauto==0: auto.configure(text='Auto is OFF',bg='gray85',relief=RAISED) - if lauto==1: auto.configure(text='Auto is ON',bg='red',relief=SOLID) - -#----------------------------------------------------- dtdf_change -# Readout of graphical cursor location -def dtdf_change(event): - if mode.get()[:4]!="JT65": - t="%.1f" % (event.x*30.0/500.0,) - lab6.configure(text=t,bg='green') - else: - if event.y<40 and Audio.gcom2.nspecial==0: - lab1.configure(text='Time (s)',bg="#33FFFF") #light blue - t="%.1f" % (12.0*event.x/500.0-2.0,) - lab6.configure(text=t,bg="#33FFFF") - elif (event.y>=40 and event.y<95) or \ - (event.y<95 and Audio.gcom2.nspecial>0): - lab1.configure(text='DF (Hz)',bg='red') - t="%d" % int(1200.0*event.x/500.0-600.0,) - lab6.configure(text=t,bg="red") - else: - lab1.configure(text='Time (s)',bg='green') - t="%.1f" % (53.0*event.x/500.0,) - lab6.configure(text=t,bg="green") - -#---------------------------------------------------- mouse_click_g1 -def mouse_click_g1(event): - global nopen - if not nopen: - if mode.get()[:4]=="JT65": - Audio.gcom2.mousedf=int((event.x-250)*2.4) - else: - if Audio.gcom2.ndecoding==0: #If decoder is busy, ignore - Audio.gcom2.nagain=1 - Audio.gcom2.mousebutton=event.num #Left=1, Right=3 - Audio.gcom2.npingtime=int(195+60*event.x) #Time (ms) of mouse-picked ping - if Audio.gcom2.ndecoding0==4: - Audio.gcom2.ndecoding=4 #Decode from recorded file - elif Audio.gcom2.ndecoding0==1: - Audio.gcom2.ndecoding=5 #Decode data in main screen - nopen=0 - -#------------------------------------------------------ double-click_g1 -def double_click_g1(event): - if g.mode[:4]=='JT65' and Audio.gcom2.ndecoding==0: - g.freeze_decode=1 - -#------------------------------------------------------ mouse_up_g1 -def mouse_up_g1(event): -# print event.x - pass - -#------------------------------------------------------ right_arrow -def right_arrow(event=NONE): - n=5*int(Audio.gcom2.mousedf/5) + 5 - if n==Audio.gcom2.mousedf: n=n+5 - Audio.gcom2.mousedf=n - -#------------------------------------------------------ left_arrow -def left_arrow(event=NONE): - n=5*int(Audio.gcom2.mousedf/5) - if n==Audio.gcom2.mousedf: n=n-5 - Audio.gcom2.mousedf=n - -#------------------------------------------------------ GenStdMsgs -def GenStdMsgs(event=NONE): - t=ToRadio.get().upper().strip() - ToRadio.delete(0,99) - ToRadio.insert(0,t) - if k2txb.get()!=0: ntx.set(1) - Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] - for m in (tx1, tx2, tx3, tx4, tx5, tx6): - m.delete(0,99) - if mode.get()=="FSK441" or mode.get()=="JT6M": - r=report.get() - tx1.insert(0,setmsg(options.tx1.get(),r)) - tx2.insert(0,setmsg(options.tx2.get(),r)) - tx3.insert(0,setmsg(options.tx3.get(),r)) - tx4.insert(0,setmsg(options.tx4.get(),r)) - tx5.insert(0,setmsg(options.tx5.get(),r)) - tx6.insert(0,setmsg(options.tx6.get(),r)) - elif mode.get()[:4]=="JT65": - if ToRadio.get().find("/") == -1 and \ - options.MyCall.get().find("/") == -1: - t=ToRadio.get() + " "+options.MyCall.get() + " "+options.MyGrid.get()[:4] - tx1.insert(0,t.upper()) - else: - tx1.insert(0,ToRadio.get() + " "+options.MyCall.get()) - tx2.insert(0,tx1.get()+" OOO") - tx3.insert(0,"RO") - tx4.insert(0,"RRR") - tx5.insert(0,"73") - t="CQ " + options.MyCall.get()+ " "+options.MyGrid.get()[:4] - tx6.insert(0,t.upper()) - elif mode.get()[:2]=="CW": - tx1.insert(0,ToRadio.get() + " "+options.MyCall.get()) - tx2.insert(0,tx1.get()+" OOO") - tx3.insert(0,tx1.get()+" RO") - tx4.insert(0,tx1.get()+" RRR") - tx5.insert(0,tx1.get()+" 73") - tx6.insert(0,"CQ " + options.MyCall.get()) - -#------------------------------------------------------ setmsg -def setmsg(template,r): - msg="" - npct=0 - for i in range(len(template)): - if npct: - if template[i]=="M": msg=msg+options.MyCall.get().upper().strip() - if template[i]=="T": msg=msg+ToRadio.get().upper().strip() - if template[i]=="R": msg=msg+r - if template[i]=="G": msg=msg+options.MyGrid.get()[:4] - if template[i]=="L": msg=msg+options.MyGrid.get() - npct=0 - else: - npct=0 - if template[i]=="%": - npct=1 - else: - msg=msg+template[i] - return msg.upper() - -#------------------------------------------------------ plot_large -def plot_large(): - "Plot the green, red, and blue curves in JT65 mode." - graph1.delete(ALL) - y=[] - ngreen=Audio.gcom2.ngreen - if ngreen>0: - for i in range(ngreen): #Find ymax for green curve - green=Audio.gcom2.green[i] - y.append(green) - ymax=max(y) - if ymax<1: ymax=1 - yfac=4.0 - if ymax>75.0/yfac: yfac=75.0/ymax - xy=[] - for i in range(ngreen): #Make xy list for green curve - green=Audio.gcom2.green[i] - n=int(105.0-yfac*green) - xy.append(i) - xy.append(n) - graph1.create_line(xy,fill="green") - - if Audio.gcom2.nspecial==0: - y=[] - for i in range(446): #Find ymax for red curve - psavg=Audio.gcom2.psavg[i+1] - y.append(psavg) - ymax=max(y) - yfac=30.0 - if ymax>85.0/yfac: yfac=85.0/ymax - xy=[] - fac=500.0/446.0 - for i in range(446): #Make xy list for red curve - x=i*fac - psavg=Audio.gcom2.psavg[i+1] - n=int(90.0-yfac*psavg) - xy.append(x) - xy.append(n) - graph1.create_line(xy,fill="red") - else: - y1=[] - y2=[] - for i in range(446): #Find ymax for red curve - ss1=Audio.gcom2.ss1[i+1] - y1.append(ss1) - ss2=Audio.gcom2.ss2[i+1] - y2.append(ss2) - ymax=max(y1+y2) - yfac=30.0 - if ymax>85.0/yfac: yfac=85.0/ymax - xy1=[] - xy2=[] - fac=500.0/446.0 - for i in range(446): #Make xy list for red curve - x=i*fac - ss1=Audio.gcom2.ss1[i+1] - n=int(90.0-yfac*ss1) - xy1.append(x) - xy1.append(n) - ss2=Audio.gcom2.ss2[i+1] - n=int(90.0-yfac*ss2) - 20 - xy2.append(x) - xy2.append(n) - graph1.create_line(xy1,fill="magenta") - graph1.create_line(xy2,fill="orange") - - x1 = 250.0 + fac*Audio.gcom2.ndf/2.6916504 - x2 = x1 + Audio.gcom2.mode65*Audio.gcom2.nspecial*10*fac - graph1.create_line([x1,85,x1,95],fill="yellow") - graph1.create_line([x2,85,x2,95],fill="yellow") - t="RO" - if Audio.gcom2.nspecial==3: t="RRR" - if Audio.gcom2.nspecial==4: t="73" - graph1.create_text(x2+3,93,anchor=W,text=t,fill="yellow") - - if Audio.gcom2.ccf[0] != -9999.0: - y=[] - for i in range(65): #Find ymax for blue curve - ccf=Audio.gcom2.ccf[i] - y.append(ccf) - ymax=max(y) - yfac=40.0 - if ymax>55.0/yfac: yfac=55.0/ymax - xy2=[] - fac=500.0/64.6 - for i in range(65): #Make xy list for blue curve - x=(i+0.5)*fac - ccf=Audio.gcom2.ccf[i] - n=int(60.0-yfac*ccf) - xy2.append(x) - xy2.append(n) - graph1.create_line(xy2,fill='#33FFFF') - -# Put in the tick marks - for i in range(13): - x=int(i*41.667) - j2=115 - if i==1 or i==6 or i==11: j2=110 - graph1.create_line([x,j2,x,125],fill="red") - if Audio.gcom2.nspecial==0: -# x=int((i-0.8)*41.667) - j1=9 - if i==2 or i==7 or i==12: j1=14 - graph1.create_line([x,0,x,j1],fill="#33FFFF") #light blue - else: - graph1.create_line([x,0,x,125-j2],fill="red") - -#------------------------------------------------------ plot_small -def plot_small(): - graph2.delete(ALL) - xy=[] - xy2=[] - df=11025.0/256.0 - fac=150.0/3500.0 - for i in range(81): - x=int(i*df*fac) - xy.append(x) - psavg=Audio.gcom2.psavg[i] - if mode.get()=="JT6M": psavg=psavg + 27.959 - n=int(150.0-2*psavg) - xy.append(n) - if mode.get()=='FSK441': - ps0=Audio.gcom2.ps0[i] - n=int(150.0-2*ps0) - xy2.append(x) - xy2.append(n) - graph2.create_line(xy,fill="magenta") - if mode.get()=='JT6M': - plot_yellow() - elif mode.get()=='FSK441': - graph2.create_line(xy2,fill="red") - for i in range(4): - x=(i+2)*441*fac - graph2.create_line([x,0,x,20],fill="yellow") - for i in range(7): - x=i*500*fac - ytop=110 - if i%2: ytop=115 - graph2.create_line([x,120,x,ytop],fill="white") - -#------------------------------------------------------ plot_yellow -def plot_yellow(): - nz=int(Audio.gcom2.ps0[215]) - if nz>10: - y=[] - for i in range(nz): #Find ymax for yellow curve - n=Audio.gcom2.ps0[i] - y.append(n) - ymax=max(y) - fac=1.0 - if ymax>60: fac=60.0/ymax - xy2=[] - for i in range(nz): - x=int(2.34*i) - y=fac*Audio.gcom2.ps0[i] + 8 - n=int(85.0-y) - xy2.append(x) - xy2.append(n) - graph1.create_line(xy2,fill="yellow") - -#------------------------------------------------------ update -def update(): - global root_geom,isec0,naz,nel,ndmiles,ndkm,nhotaz,nhotabetter,nopen, \ - im,pim,cmap0,isync,isync441,isync6m,isync65,isync_save,idsec, \ - first,itol,txsnrdb - - utc=time.gmtime(time.time()+0.1*idsec) - isec=utc[5] - - if isec != isec0: #Do once per second - isec0=isec - t=time.strftime('%Y %b %d\n%H:%M:%S',utc) - Audio.gcom2.utcdate=t[:12] - ldate.configure(text=t) - root_geom=root.geometry() - utchours=utc[3]+utc[4]/60.0 + utc[5]/3600.0 - naz,nel,ndmiles,ndkm,nhotaz,nhotabetter=Audio.azdist0( \ - options.MyGrid.get().upper(),HisGrid.get().upper(),utchours) - azdist() - g.nfreq=nfreq.get() - - if Audio.gcom2.ndecoding==0: - g.AzSun,g.ElSun,g.AzMoon,g.ElMoon,g.AzMoonB,g.ElMoonB,g.ntsky, \ - g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \ - g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \ - g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \ - utchours,nfreq.get(),options.MyGrid.get().upper(), \ - options.auxra.get()+' '[:9], \ - options.auxdec.get()+' '[:9]) - - if len(HisGrid.get().strip())<4: - g.ndop=g.ndop00 - g.dfdt=g.dfdt0 - - if mode.get()[:4]=='JT65' or mode.get()[:2]=='CW' : - graph2.delete(ALL) - g2font='Helvetica 16' - graph2.create_text(75,13,anchor=CENTER,text="Moon",font=g2font) - graph2.create_text(26,37,anchor=W, text="Az: %8.2f" % g.AzMoon,font=g2font) - graph2.create_text(26,61,anchor=W, text="El: %8.2f" % g.ElMoon,font=g2font) - graph2.create_text(26,85,anchor=W, text="Dop: %6d" % g.ndop,font=g2font) - graph2.create_text(26,109,anchor=W,text="Dgrd:%8.1f" % g.Dgrd,font=g2font) - - if g.freeze_decode and mode.get()[:4]=='JT65': - itol=2 - ltol.configure(text='Tol '+str(50)) - Audio.gcom2.dftolerance=50 - nfreeze.set(1) - Audio.gcom2.nfreeze=1 - if Audio.gcom2.monitoring: - Audio.gcom2.ndecoding=1 - Audio.gcom2.nagain=0 - else: - Audio.gcom2.ndecoding=4 - Audio.gcom2.nagain=1 - g.freeze_decode=0 - - n=int(20.0*log10(g.rms/770.0+0.01)) - t="Rx noise:%3d dB" % (n,) - if n>=-10 and n<=10: - msg4.configure(text=t,bg='gray85') - else: - msg4.configure(text=t,bg='red') - - t=g.ftnstr(Audio.gcom2.decodedfile) -# i=t.rfind(".") - i=g.rfnd(t,".") - t=t[:i] - lab3.configure(text=t) - if mode.get() != g.mode or first: - if mode.get()=="FSK441": - msg2.configure(bg='yellow') - elif mode.get()=="JT65A" or mode.get()=="JT65B" or mode.get()=="JT65C": - msg2.configure(bg='#00FFFF') - elif mode.get()=="JT6M": - msg2.configure(bg='#FF00FF') - elif mode.get()=="CW": - msg2.configure(bg='#00FF00') -# elif mode.get()=="Echo": -# msg2.configure(bg='#FF0000') - g.mode=mode.get() - first=0 - - samfac_in=Audio.gcom1.mfsample/110250.0 - samfac_out=Audio.gcom1.mfsample2/110250.0 - xin=1 - xout=1 - try: - xin=samfac_in/options.samfacin.get() - xout=samfac_out/options.samfacout.get() - if xin<0.999 or xin>1.001 or xout<0.999 or xout>1.001: - lab8.configure(text="%6.4f %6.4f" \ - % (options.samfacin.get(),options.samfacout.get()), \ - fg='black',bg='red') - else: - lab8.configure(fg='gray85',bg='gray85') - except: - pass - - msg1.configure(text="%6.4f %6.4f" % (samfac_in,samfac_out)) - msg2.configure(text=mode.get()) - t="Freeze DF:%4d" % (int(Audio.gcom2.mousedf),) - msg3.configure(text=t) - bdecode.configure(bg='gray85') - if Audio.gcom2.ndecoding: #Set button bg=light_blue - bdecode.configure(bg='#66FFFF') #while decoding - if mode.get()[:2]=="CW": - msg5.configure(text="TR Period: %d s" % (Audio.gcom1.trperiod,), \ - bg='white') - else: - msg5.configure(text="TR Period: %d s" % (Audio.gcom1.trperiod,), \ - bg='gray85') - - tx1.configure(bg='white') - tx2.configure(bg='white') - tx3.configure(bg='white') - tx4.configure(bg='white') - tx5.configure(bg='white') - tx6.configure(bg='white') - if tx6.get()[:1]=='#': - try: - txsnrdb=float(tx6.get()[1:]) - if txsnrdb>-99.0 and txsnrdb<40.0: - Audio.gcom1.txsnrdb=txsnrdb - tx6.configure(bg='orange') - except: - txsnrdb=99.0 - else: - txsnrdb=99.0 - Audio.gcom1.txsnrdb=txsnrdb - if Audio.gcom2.monitoring and not Audio.gcom1.transmitting: - bmonitor.configure(bg='green') - else: - bmonitor.configure(bg='gray85') - if Audio.gcom1.transmitting: - nmsg=int(Audio.gcom2.nmsg) - t=g.ftnstr(Audio.gcom2.sending) - if t[:3]=="CQ ": nsked.set(0) - t="Txing: "+t[:nmsg] - bgcolor='yellow' - if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' #Shorthand (lt blue) - if Audio.gcom2.sendingsh==-1: bgcolor='red' #Plain Text - if Audio.gcom2.sendingsh==2: bgcolor='pink' #Test file - if txsnrdb<90.0: bgcolor='orange' #Simulation mode - if Audio.gcom2.ntxnow==1: tx1.configure(bg=bgcolor) - elif Audio.gcom2.ntxnow==2: tx2.configure(bg=bgcolor) - elif Audio.gcom2.ntxnow==3: tx3.configure(bg=bgcolor) - elif Audio.gcom2.ntxnow==4: tx4.configure(bg=bgcolor) - elif Audio.gcom2.ntxnow==5: tx5.configure(bg=bgcolor) - else: tx6.configure(bg=bgcolor) - else: - bgcolor='green' - t='Receiving' - msg7.configure(text=t,bg=bgcolor) - - if Audio.gcom2.ndecdone==1 or g.cmap != cmap0: - if Audio.gcom2.ndecdone==1: - if isync==-99 or isync==99: - isync=isync_save - Audio.gcom2.minsigdb=isync - try: - f=open(appdir+'/decoded.txt',mode='r') - lines=f.readlines() - f.close() - except: - lines="" - text.configure(state=NORMAL) - for i in range(len(lines)): - text.insert(END,lines[i]) - text.see(END) - text.configure(state=DISABLED) - - if mode.get()[:4]=='JT65': - try: - f=open(appdir+'/decoded.ave',mode='r') - lines=f.readlines() - f.close() - except: - lines[0]="" - lines[1]="" - avetext.configure(state=NORMAL) - avetext.delete('1.0',END) - if len(lines)>1: - avetext.insert(END,lines[0]) - avetext.insert(END,lines[1]) - avetext.configure(state=DISABLED) - Audio.gcom2.ndecdone=2 - - if g.cmap != cmap0: - im.putpalette(g.palette) - cmap0=g.cmap - - if mode.get()[:4]=='JT65': - plot_large() - else: - im.putdata(Audio.gcom2.b) - pim=ImageTk.PhotoImage(im) #Convert Image to PhotoImage - graph1.delete(ALL) -# NB: top two lines are probably invisible ... - graph1.create_image(0,0,anchor='nw',image=pim) - t=g.filetime(g.ftnstr(Audio.gcom2.decodedfile)) - graph1.create_text(100,80,anchor=W,text=t,fill="white") - plot_small() - if loopall: opennext() - nopen=0 - -# Save some parameters - g.mode=mode.get() - g.report=report.get() - if mode.get()=='FSK441': isync441=isync - elif mode.get()=='JT6M': isync6m=isync - elif mode.get()[:4]=='JT65': isync65=isync - Audio.gcom1.txfirst=TxFirst.get() - try: - Audio.gcom1.samfacin=options.samfacin.get() - except: - Audio.gcom1.samfacin=1.0 - try: - Audio.gcom1.samfacout=options.samfacout.get() - except: - Audio.gcom1.samfacout=1.0 -# if Audio.gcom1.samfacin>1.01: Audio.gcom1.samfacin=1.01 -# ... etc. - Audio.gcom2.mycall=(options.MyCall.get()+' ')[:12] - Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] - Audio.gcom2.hisgrid=(HisGrid.get()+' ')[:6] - Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] - Audio.gcom2.ntxreq=ntx.get() - tx=(tx1,tx2,tx3,tx4,tx5,tx6) - Audio.gcom2.txmsg=(tx[ntx.get()-1].get()+' ')[:28] - Audio.gcom2.mode=(mode.get()+' ')[:6] - Audio.gcom2.shok=ShOK.get() - Audio.gcom2.nsave=nsave.get() - Audio.gcom2.nzap=nzap.get() - Audio.gcom2.ndebug=ndebug.get() - Audio.gcom2.minsigdb=isync - Audio.gcom2.nclip=iclip - Audio.gcom2.nblank=nblank.get() - Audio.gcom2.nafc=nafc.get() - Audio.gcom2.nfreeze=nfreeze.get() - Audio.gcom2.dftolerance=ntol[itol] - Audio.gcom2.neme=neme.get() - Audio.gcom2.ndepth=ndepth.get() - Audio.gcom2.nsked=nsked.get() - try: - Audio.gcom2.idinterval=options.IDinterval.get() - except: - Audio.gcom2.idinterval=0 - Audio.gcom2.ntx2=0 -# Audio.gcom1.rxdelay=float('0'+options.RxDelay.get()) -# Audio.gcom1.txdelay=float('0'+options.TxDelay.get()) - if ntx.get()==1 and noshjt65.get()==1: Audio.gcom2.ntx2=1 - Audio.gcom2.nslim2=isync-4 - if nosh441.get()==1 and mode.get()=='FSK441': Audio.gcom2.nslim2=99 - try: - Audio.gcom2.nport=int(options.PttPort.get()) - except: - Audio.gcom2.nport=0 - -# print 'About to init Audio.gcom2.PttPort in save some parameters' - Audio.gcom2.pttport=(options.PttPort.get() + ' ')[:12] -# print Audio.gcom2.pttport - -# Queue up the next update - ldate.after(100,update) - -#------------------------------------------------------ Top level frame -frame = Frame(root) - -#------------------------------------------------------ Menu Bar -mbar = Frame(frame) -mbar.pack(fill = X) - -#------------------------------------------------------ File Menu -filebutton = Menubutton(mbar, text = 'File') -filebutton.pack(side = LEFT) -filemenu = Menu(filebutton, tearoff=0) -filebutton['menu'] = filemenu -filemenu.add('command', label = 'Open', command = openfile) -filemenu.add('command', label = 'Open next in directory', command = opennext) -filemenu.add('command', label = 'Decode remaining files in directory', \ - command = decodeall) -filemenu.add_separator() -filemenu.add('command', label = 'Delete all *.WAV files in RxWav', \ - command = delwav) -filemenu.add_separator() -filemenu.add('command', label = 'Erase ALL.TXT', command = del_all) -filemenu.add_separator() -filemenu.add('command', label = 'Exit', command = quit) - -#------------------------------------------------------ Setup menu -setupbutton = Menubutton(mbar, text = 'Setup', ) -setupbutton.pack(side = LEFT) -setupmenu = Menu(setupbutton, tearoff=0) -setupbutton['menu'] = setupmenu -setupmenu.add('command', label = 'Options', command = options1) -setupmenu.add_separator() -setupmenu.add('command', label = 'Toggle size of text window', command=textsize) -setupmenu.add('command', label = 'Generate messages for test tones', command=testmsgs) -setupmenu.add_separator() -setupmenu.add_checkbutton(label = 'F4 sets Tx6',variable=kb8rq) -setupmenu.add_checkbutton(label = 'Double-click on callsign sets TxFirst', - variable=setseq) -setupmenu.add_checkbutton(label = 'GenStdMsgs sets Tx1',variable=k2txb) -setupmenu.add_separator() -setupmenu.add_checkbutton(label = 'Enable diagnostics',variable=ndebug) - -#------------------------------------------------------ View menu -viewbutton=Menubutton(mbar,text='View',) -viewbutton.pack(side=LEFT) -viewmenu=Menu(viewbutton,tearoff=0) -viewbutton['menu']=viewmenu -viewmenu.add('command', label = 'SpecJT', command = showspecjt) -viewmenu.add('command', label = 'Astronomical data', command = astro1) - -#------------------------------------------------------ Mode menu -modebutton = Menubutton(mbar, text = 'Mode', ) -modebutton.pack(side = LEFT) -modemenu = Menu(modebutton, tearoff=0) -modebutton['menu'] = modemenu -modemenu.add_radiobutton(label = 'FSK441', variable=mode, command = ModeFSK441, - state=NORMAL) - -# To enable menu item 0: -# modemenu.entryconfig(0,state=NORMAL) -# Can use the following to retrieve the state: -# state=modemenu.entrycget(0,"state") - -modemenu.add_radiobutton(label = 'JT6M', variable=mode, command = ModeJT6M) -modemenu.add_radiobutton(label = 'JT65A', variable=mode, command = ModeJT65A) -modemenu.add_radiobutton(label = 'JT65B', variable=mode, command = ModeJT65B) -modemenu.add_radiobutton(label = 'JT65C', variable=mode, command = ModeJT65C) -modemenu.add_radiobutton(label = 'CW', variable=mode, command = ModeCW) -#modemenu.add_radiobutton(label = 'Echo', variable=mode, command = ModeEcho, -# state=DISABLED) - -#------------------------------------------------------ Decode menu -decodebutton = Menubutton(mbar, text = 'Decode', ) -decodebutton.pack(side = LEFT) -decodemenu = Menu(decodebutton, tearoff=1) -decodebutton['menu'] = decodemenu -decodemenu.FSK441=Menu(decodemenu,tearoff=0) -decodemenu.FSK441.add_checkbutton(label='No shorthands',variable=nosh441) -decodemenu.JT65=Menu(decodemenu,tearoff=0) -decodemenu.JT65.add_checkbutton(label='Only EME calls',variable=neme) -decodemenu.JT65.add_checkbutton(label='No Shorthands if Tx 1',variable=noshjt65) -decodemenu.JT65.add_separator() -decodemenu.JT65.add_radiobutton(label = 'No Deep Search', - variable=ndepth, value=0) -decodemenu.JT65.add_radiobutton(label = 'Normal Deep Search', - variable=ndepth, value=1) -decodemenu.JT65.add_radiobutton(label = 'Aggressive Deep Search', - variable=ndepth, value=2) -decodemenu.JT65.add_radiobutton(label ='Include Average in Aggressive Deep Search', - variable=ndepth, value=3) -decodemenu.add_cascade(label = 'FSK441',menu=decodemenu.FSK441) -decodemenu.add_cascade(label = 'JT65',menu=decodemenu.JT65) - -#------------------------------------------------------ Save menu -savebutton = Menubutton(mbar, text = 'Save') -savebutton.pack(side = LEFT) -savemenu = Menu(savebutton, tearoff=1) -savebutton['menu'] = savemenu -nsave=IntVar() -savemenu.add_radiobutton(label = 'None', variable=nsave,value=0) -savemenu.add_radiobutton(label = 'Save decoded', variable=nsave,value=1) -savemenu.add_radiobutton(label = 'Save if Auto On', variable=nsave,value=2) -savemenu.add_radiobutton(label = 'Save all', variable=nsave,value=3) -nsave.set(0) - -#------------------------------------------------------ Band menu -bandbutton = Menubutton(mbar, text = 'Band') -bandbutton.pack(side = LEFT) -bandmenu = Menu(bandbutton, tearoff=1) -bandbutton['menu'] = bandmenu -nfreq=IntVar() -bandmenu.add_radiobutton(label = '50', variable=nfreq,value=50) -bandmenu.add_radiobutton(label = '144', variable=nfreq,value=144) -bandmenu.add_radiobutton(label = '222', variable=nfreq,value=222) -bandmenu.add_radiobutton(label = '432', variable=nfreq,value=432) -bandmenu.add_radiobutton(label = '1296', variable=nfreq,value=1296) -nfreq.set(144) -#------------------------------------------------------ Help menu -helpbutton = Menubutton(mbar, text = 'Help') -helpbutton.pack(side = LEFT) -helpmenu = Menu(helpbutton, tearoff=0) -helpbutton['menu'] = helpmenu -helpmenu.add('command', label = 'Keyboard shortcuts', command = shortcuts) -helpmenu.add('command', label = 'Special mouse commands', command = mouse_commands) -helpmenu.add('command', label = 'What message to send?', command = what2send) -helpmenu.add('command', label = 'Available suffixes and add-on prefixes', \ - command = prefixes) -helpmenu.add('command', label = 'About WSJT', command = about) - -#------------------------------------------------------ Graphics areas -iframe1 = Frame(frame, bd=1, relief=SUNKEN) -graph1=Canvas(iframe1, bg='black', width=500, height=120,cursor='crosshair') -Widget.bind(graph1,"",dtdf_change) -Widget.bind(graph1,"",mouse_click_g1) -Widget.bind(graph1,"",double_click_g1) -Widget.bind(graph1,"",mouse_up_g1) -Widget.bind(graph1,"",mouse_click_g1) -graph1.pack(side=LEFT) -graph2=Canvas(iframe1, bg='black', width=150, height=120,cursor='crosshair') -graph2.pack(side=LEFT) -iframe1.pack(expand=1, fill=X, padx=4) - -#------------------------------------------------------ Labels under graphics -iframe2a = Frame(frame, bd=1, relief=FLAT, height=15) -lab1=Label(iframe2a, text='Time (s)') -lab1.place(x=250, y=6, anchor=CENTER) -lab3=Label(iframe2a, text=' ') -lab3.place(x=400,y=6, anchor=CENTER) -lab4=Label(iframe2a, text='1 2 3') -lab4.place(x=593,y=6, anchor=CENTER) -iframe2a.pack(expand=1, fill=X, padx=1) -iframe2 = Frame(frame, bd=1, relief=FLAT,height=15) -lab2=Label(iframe2, text='FileID Sync dB DT DF W') -lab2.place(x=3,y=6, anchor='w') -lab5=Label(iframe2, text='Freq (kHz)') -lab5.place(x=580,y=6, anchor=CENTER) -lab6=Label(iframe2a,text='0.0',bg='green') -lab6.place(x=40,y=6, anchor=CENTER) -lab7=Label(iframe2a,text='F3',fg='gray85') -lab7.place(x=495,y=6, anchor=CENTER) -lab8=Label(iframe2a,text='1.0000 1.0000',fg='gray85') -lab8.place(x=135,y=6, anchor=CENTER) -iframe2.pack(expand=1, fill=X, padx=4) - -#-------------------------------------------------------- Decoded text -iframe4 = Frame(frame, bd=1, relief=SUNKEN) -text=Text(iframe4, height=6, width=80) -text.bind('',dbl_click_text) -text.bind('',dbl_click_text) - -root.bind_all('', shortcuts) -root.bind_all('', mouse_commands) -root.bind_all('', about) -root.bind_all('', options1) -root.bind_all('', txmute) -root.bind_all('', clrToRadio) -root.bind_all('', what2send) -root.bind_all('', opennext) -root.bind_all('', decodeall) -root.bind_all('', ModeFSK441) -root.bind_all('', ModeJT65A) -root.bind_all('', ModeJT65B) -root.bind_all('', ModeJT65C) -root.bind_all('', ModeJT6M) -root.bind_all('', ModeCW) -#root.bind_all('', ModeEcho) -root.bind_all('', showspecjt) - -root.bind_all('',btx1) -root.bind_all('',btx2) -root.bind_all('',btx3) -root.bind_all('',btx4) -root.bind_all('',btx5) -root.bind_all('',btx6) - -root.bind_all('',toggleauto) -root.bind_all('',toggleauto) -root.bind_all('',clear_avg) -root.bind_all('',clear_avg) -root.bind_all('',decode) -root.bind_all('',decode) -root.bind_all('',erase) -root.bind_all('',erase) -root.bind_all('',toggle_freeze) -root.bind_all('',toggle_freeze) -root.bind_all('',GenStdMsgs) -root.bind_all('',GenStdMsgs) -root.bind_all('',decode_include) -root.bind_all('',decode_include) -root.bind_all('',lookup) -root.bind_all('',lookup) -root.bind_all('',monitor) -root.bind_all('',monitor) -root.bind_all('',txstop) -root.bind_all('',txstop) -root.bind_all('',stub) -root.bind_all('',stub) -root.bind_all('',logqso) -root.bind_all('',logqso) -root.bind_all('',stopmon) -root.bind_all('',stopmon) -root.bind_all('',savelast) -root.bind_all('',savelast) -root.bind_all('',decode_exclude) -root.bind_all('',decode_exclude) -root.bind_all('',toggle_zap) -root.bind_all('',toggle_zap) -root.bind_all('',lookup_gen) -root.bind_all('',lookup_gen) -root.bind_all('',left_arrow) -root.bind_all('',right_arrow) - -text.pack(side=LEFT, fill=X, padx=1) -sb = Scrollbar(iframe4, orient=VERTICAL, command=text.yview) -sb.pack(side=RIGHT, fill=Y) -text.configure(yscrollcommand=sb.set) -iframe4.pack(expand=1, fill=X, padx=4) -iframe4b = Frame(frame, bd=1, relief=SUNKEN) -avetext=Text(iframe4b, height=2, width=80) -#avetext.bind('', lambda e: "break") -avetext.bind('',dbl_click_ave) -avetext.bind('',dbl_click_ave) -avetext.pack(side=LEFT, fill=X, padx=1) -iframe4b.pack(expand=1, fill=X, padx=4) - -#------------------------------------------------------- Button Bar -iframe4c = Frame(frame, bd=1, relief=SUNKEN) -blogqso=Button(iframe4c, text='Log QSO',underline=4,command=logqso, - padx=1,pady=1) -#bplay=Button(iframe4c, text='Play',underline=0,command=stub) -bstop=Button(iframe4c, text='Stop',underline=0,command=stopmon, - padx=1,pady=1) -bmonitor=Button(iframe4c, text='Monitor',underline=0,command=monitor, - padx=1,pady=1) -bsavelast=Button(iframe4c, text='Save',underline=3,command=savelast, - padx=1,pady=1) -bdecode=Button(iframe4c, text='Decode',underline=0,command=decode, - padx=1,pady=1) -berase=Button(iframe4c, text='Erase',underline=0,command=erase, - padx=1,pady=1) -bclravg=Button(iframe4c, text='Clear Avg',underline=0,command=clear_avg, - padx=1,pady=1) -binclude=Button(iframe4c, text='Include',underline=0, - command=decode_include,padx=1,pady=1) -bexclude=Button(iframe4c, text='Exclude',underline=1, - command=decode_exclude,padx=1,pady=1) -btxstop=Button(iframe4c,text='TxStop',underline=4,command=txstop, - padx=1,pady=1) - -blogqso.pack(side=LEFT,expand=1,fill=X) -#bplay.pack(side=LEFT,expand=1,fill=X) -bstop.pack(side=LEFT,expand=1,fill=X) -bmonitor.pack(side=LEFT,expand=1,fill=X) -bsavelast.pack(side=LEFT,expand=1,fill=X) -bdecode.pack(side=LEFT,expand=1,fill=X) -berase.pack(side=LEFT,expand=1,fill=X) -bclravg.pack(side=LEFT,expand=1,fill=X) -binclude.pack(side=LEFT,expand=1,fill=X) -bexclude.pack(side=LEFT,expand=1,fill=X) -btxstop.pack(side=LEFT,expand=1,fill=X) -iframe4c.pack(expand=1, fill=X, padx=4) - -#-----------------------------------------------------General control area -iframe5 = Frame(frame, bd=1, relief=FLAT,height=180) - -#------------------------------------------------------ "Other station" info -f5a=Frame(iframe5,height=170,bd=2,relief=GROOVE) -labToRadio=Label(f5a,text='To radio:', width=9, relief=FLAT) -labToRadio.grid(column=0,row=0) -ToRadio=Entry(f5a,width=9) -ToRadio.insert(0,'W8WN') -ToRadio.grid(column=1,row=0,pady=3) -bLookup=Button(f5a, text='Lookup',underline=0,command=lookup,padx=1,pady=1) -bLookup.grid(column=2,row=0,sticky='EW',padx=4) -labGrid=Label(f5a,text='Grid:', width=9, relief=FLAT) -labGrid.grid(column=0,row=1) -HisGrid=Entry(f5a,width=9) -HisGrid.grid(column=1,row=1,pady=1) -bAdd=Button(f5a, text='Add',command=addtodb,padx=1,pady=1) -bAdd.grid(column=2,row=1,sticky='EW',padx=4) -labAz=Label(f5a,text='Az 257 El 15',width=11,font=(font1,9)) -labAz.grid(column=1,row=2) -labHotAB=Label(f5a,bg='#FFCCFF',text='HotA: 247',font=(font1,9)) -labHotAB.grid(column=0,row=2,sticky='EW',padx=4,pady=3) -labDist=Label(f5a,text='16753 km',font=(font1,9)) -labDist.grid(column=2,row=2) - -#------------------------------------------------------ Date and Time -ldate=Label(f5a, bg='black', fg='yellow', width=11, bd=4, - text='2005 Apr 22\n01:23:45', relief=RIDGE, - justify=CENTER, font=(font1,16)) -ldate.grid(column=0,columnspan=3,row=3,rowspan=2,pady=2) -f5a.pack(side=LEFT,expand=1,fill=BOTH) - -#------------------------------------------------------ Receiving parameters -f5b=Frame(iframe5,bd=2,relief=GROOVE) -lsync=Label(f5b, bg='white', fg='black', text='Sync 1', width=8, relief=RIDGE) -lsync.grid(column=0,row=0,padx=2,pady=1,sticky='EW') -Widget.bind(lsync,'',incsync) -Widget.bind(lsync,'',decsync) -nzap=IntVar() -cbzap=Checkbutton(f5b,text='Zap',underline=0,variable=nzap) -cbzap.grid(column=1,row=0,padx=2,pady=1,sticky='W') -cbnb=Checkbutton(f5b,text='NB',variable=nblank) -cbnb.grid(column=1,row=1,padx=2,pady=1,sticky='W') -cbfreeze=Checkbutton(f5b,text='Freeze',underline=0,variable=nfreeze) -cbfreeze.grid(column=1,row=2,padx=2,sticky='W') -cbafc=Checkbutton(f5b,text='AFC',variable=nafc) -cbafc.grid(column=1,row=3,padx=2,pady=1,sticky='W') -lclip=Label(f5b, bg='white', fg='black', text='Clip 0', width=8, relief=RIDGE) -lclip.grid(column=0,row=1,padx=2,sticky='EW') -Widget.bind(lclip,'',incclip) -Widget.bind(lclip,'',decclip) -ltol=Label(f5b, bg='white', fg='black', text='Tol 400', width=8, relief=RIDGE) -ltol.grid(column=0,row=2,padx=2,pady=1,sticky='EW') -Widget.bind(ltol,'',inctol) -Widget.bind(ltol,'',dectol) -Button(f5b,text='Defaults',command=defaults,padx=1,pady=1).grid(column=0, - row=3,sticky='EW') -ldsec=Label(f5b, bg='white', fg='black', text='Dsec 0.0', width=8, relief=RIDGE) -ldsec.grid(column=0,row=4,ipadx=3,padx=2,pady=5,sticky='EW') -#lrdsec=Label(f5b, bg='white', fg='black', text='RDsec 0.0', width=8, relief=RIDGE) -#lrdsec.grid(column=1,row=4,ipadx=3,padx=2,pady=5,sticky='EW') -Widget.bind(ldsec,'',incdsec) -Widget.bind(ldsec,'',decdsec) -#Widget.bind(lrdsec,'',incrdsec) -#Widget.bind(lrdsec,'',decrdsec) -#Widget.bind(lrdsec,'',stub) -#Widget.bind(lrdsec,'',stub) - -f5b.pack(side=LEFT,expand=0,fill=BOTH) - -#------------------------------------------------------ Tx params and msgs -f5c=Frame(iframe5,bd=2,relief=GROOVE) -txfirst=Checkbutton(f5c,text='Tx First',justify=RIGHT,variable=TxFirst) -f5c2=Frame(f5c,bd=0) -labreport=Label(f5c2,text='Rpt',width=4) -report=Entry(f5c2, width=4) -report.insert(0,'26') -labreport.pack(side=RIGHT,expand=1,fill=BOTH) -report.pack(side=RIGHT,expand=1,fill=BOTH) -shmsg=Checkbutton(f5c,text='Sh Msg',justify=RIGHT,variable=ShOK, - command=restart2) -sked=Checkbutton(f5c,text='Sked',justify=RIGHT,variable=nsked) -genmsg=Button(f5c,text='GenStdMsgs',underline=0,command=GenStdMsgs, - padx=1,pady=1) -auto=Button(f5c,text='Auto is Off',underline=0,command=toggleauto, - padx=1,pady=1) -auto.focus_set() - -txfirst.grid(column=0,row=0,sticky='W',padx=4) -f5c2.grid(column=0,row=1,sticky='W',padx=4) -shmsg.grid(column=0,row=2,sticky='W',padx=4) -sked.grid(column=0,row=3,sticky='W',padx=4) -genmsg.grid(column=0,row=4,sticky='W',padx=4) -auto.grid(column=0,row=5,sticky='EW',padx=4) -#txstop.grid(column=0,row=6,sticky='EW',padx=4) - -ntx=IntVar() -tx1=Entry(f5c,width=24) -rb1=Radiobutton(f5c,value=1,variable=ntx) -b1=Button(f5c, text='Tx1',underline=2,command=btx1,padx=1,pady=1) -tx1.grid(column=1,row=0) -rb1.grid(column=2,row=0) -b1.grid(column=3,row=0) - -tx2=Entry(f5c,width=24) -rb2=Radiobutton(f5c,value=2,variable=ntx) -b2=Button(f5c, text='Tx2',underline=2,command=btx2,padx=1,pady=1) -tx2.grid(column=1,row=1) -rb2.grid(column=2,row=1) -b2.grid(column=3,row=1) - -tx3=Entry(f5c,width=24) -rb3=Radiobutton(f5c,value=3,variable=ntx) -b3=Button(f5c, text='Tx3',underline=2,command=btx3,padx=1,pady=1) -tx3.grid(column=1,row=2) -rb3.grid(column=2,row=2) -b3.grid(column=3,row=2) - -tx4=Entry(f5c,width=24) -rb4=Radiobutton(f5c,value=4,variable=ntx) -b4=Button(f5c, text='Tx4',underline=2,command=btx4,padx=1,pady=1) -tx4.grid(column=1,row=3) -rb4.grid(column=2,row=3) -b4.grid(column=3,row=3) - -tx5=Entry(f5c,width=24) -rb5=Radiobutton(f5c,value=5,variable=ntx) -b5=Button(f5c, text='Tx5',underline=2,command=btx5,padx=1,pady=1) -tx5.grid(column=1,row=4) -rb5.grid(column=2,row=4) -b5.grid(column=3,row=4) - -tx6=Entry(f5c,width=24) -rb6=Radiobutton(f5c,value=6,variable=ntx) -b6=Button(f5c, text='Tx6',underline=2,command=btx6,padx=1,pady=1) -tx6.grid(column=1,row=5) -rb6.grid(column=2,row=5) -b6.grid(column=3,row=5) - -f5c.pack(side=LEFT,fill=BOTH) -iframe5.pack(expand=1, fill=X, padx=4) - -#------------------------------------------------------------ Status Bar -iframe6 = Frame(frame, bd=1, relief=SUNKEN) -msg1=Message(iframe6, text=' ', width=300,relief=SUNKEN) -msg1.pack(side=LEFT, fill=X, padx=1) -msg2=Message(iframe6, text='Message #2', width=300,relief=SUNKEN) -msg2.pack(side=LEFT, fill=X, padx=1) -msg3=Message(iframe6,width=300,relief=SUNKEN) -msg3.pack(side=LEFT, fill=X, padx=1) -msg4=Message(iframe6, text='Message #4', width=300,relief=SUNKEN) -msg4.pack(side=LEFT, fill=X, padx=1) -msg5=Message(iframe6, text='Message #5', width=300,relief=SUNKEN) -msg5.pack(side=LEFT, fill=X, padx=1) -Widget.bind(msg5,'',inctrperiod) -Widget.bind(msg5,'',dectrperiod) -msg7=Message(iframe6, text=' ', width=300,relief=SUNKEN) -msg7.pack(side=RIGHT, fill=X, padx=1) -iframe6.pack(expand=1, fill=X, padx=4) -frame.pack() - -ldate.after(100,update) -lauto=0 -isync=1 -ntx.set(1) -ndepth.set(1) - -import options -options.defaults() -ModeFSK441() -lookup() -balloon.unbind(ToRadio) -g.astro_geom0="+0+0" -Audio.gcom1.mute=0 - -#---------------------------------------------------------- Process INI file -try: - f=open(appdir+'/WSJT.INI',mode='r') - params=f.readlines() -except: - params="" - if g.Win32: - options.PttPort.set("0") - else: - options.PttPort.set("/dev/cuad0") - Audio.gcom2.nport=0 - -try: - for i in range(len(params)): - key,value=params[i].split() - if key == 'WSJTGeometry': root.geometry(value) - elif key == 'Mode': - mode.set(value) - if value=='FSK441': - ModeFSK441() - elif value=='JT65A': - ModeJT65A() - elif value=='JT65B': - ModeJT65B() - elif value=='JT65C': - ModeJT65C() - elif value=='JT6M': - ModeJT6M() - elif value=='CW': - ModeCW() - elif key == 'MyCall': options.MyCall.set(value) - elif key == 'MyGrid': options.MyGrid.set(value) - elif key == 'HisCall': - hiscall=value - if hiscall=="______": hiscall="" - ToRadio.delete(0,END) - ToRadio.insert(0,hiscall) - elif key == 'HisGrid': - hisgrid=value - if hisgrid == "XX00xx": - lookup() - HisGrid.delete(0,END) - HisGrid.insert(0,hisgrid) -# elif key == 'RxDelay': options.RxDelay.set(value) -# elif key == 'TxDelay': options.TxDelay.set(value) - elif key == 'IDinterval': options.IDinterval.set(value) - elif key == 'PttPort': - try: - options.PttPort.set(value) - try: - Audio.gcom2.nport=int(options.PttPort.get()) - except: - Audio.gcom2.nport=0 - except: - if g.Win32: - options.PttPort.set("0") - else: - options.PttPort.set("/dev/cuad0") - Audio.gcom2.nport=0 - Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] - elif key == 'Mileskm': options.mileskm.set(value) - elif key == 'MsgStyle': options.ireport.set(value) - elif key == 'Region': options.iregion.set(value) - elif key == 'AudioIn': - try: - g.ndevin.set(value) - except: - g.ndevin.set(0) - g.DevinName.set(value) - options.DevinName.set(value) - Audio.gcom1.devin_name=(options.DevinName.get()+' ')[:12] - elif key == 'AudioOut': - try: - g.ndevout.set(value) - except: - g.ndevout.set(0) - g.DevoutName.set(value) - options.DevoutName.set(value) - Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12] - elif key == 'SamFacIn': options.samfacin.set(value) - elif key == 'SamFacOut': options.samfacout.set(value) - elif key == 'Template1': options.Template1.set(value.replace("_"," ")) - elif key == 'Template2': options.Template2.set(value.replace("_"," ")) - elif key == 'Template3': options.Template3.set(value.replace("_"," ")) - elif key == 'Template4': options.Template4.set(value.replace("_"," ")) - elif key == 'Template5': options.Template5.set(value.replace("_"," ")) - elif key == 'Template6': - options.Template6.set(value.replace("_"," ")) - if options.Template6.get()==" ": options.Template6.set("") - elif key == 'AddPrefix': options.addpfx.set(value.replace("_"," ").lstrip()) - elif key == 'AuxRA': options.auxra.set(value) - elif key == 'AuxDEC': options.auxdec.set(value) - elif key == 'TxFirst': TxFirst.set(value) - elif key == 'KB8RQ': kb8rq.set(value) - elif key == 'K2TXB': k2txb.set(value) - elif key == 'SetSeq': setseq.set(value) - elif key == 'Report': - report.delete(0,99) - report.insert(0,value) - elif key == 'ShOK': ShOK.set(value) - elif key == 'Nsave': nsave.set(value) - elif key == 'Band': nfreq.set(value) - elif key == 'S441': isync441=int(value) - elif key == 'S6m': isync6m=int(value) - elif key == 'Sync': isync65=int(value) - elif key == 'Clip': iclip=int(value) - elif key == 'Zap': nzap.set(value) - elif key == 'NB': nblank.set(value) - elif key == 'NAFC': nafc.set(value) - elif key == 'Sked': nsked.set(value) - elif key == 'NoSh441': nosh441.set(value) - elif key == 'NoShJT65': noshjt65.set(value) - elif key == 'NEME': neme.set(value) - elif key == 'NDepth': ndepth.set(value) - elif key == 'Debug': ndebug.set(value) - elif key == 'HisCall': - Audio.gcom2.hiscall=(value+' ')[:12] - ToRadio.delete(0,99) - ToRadio.insert(0,value) - lookup() #Maybe should save HisGrid, instead? - elif key == 'MRUDir': mrudir=value.replace("#"," ") - elif key == 'AstroGeometry': g.astro_geom0 =value - elif key == 'CWTRPeriod': - ncwtrperiod=int(value) - if mode.get()[:2]=="CW": Audio.gcom1.trperiod=ncwtrperiod - else: pass -except: - print 'Error reading WSJT.INI, continuing with defaults.' - print key,value - -g.mode=mode.get() -if mode.get()=='FSK441': isync=isync441 -elif mode.get()=='JT6M': isync=isync6m -elif mode.get()[:4]=='JT65': isync=isync65 -lsync.configure(text=slabel+str(isync)) -lclip.configure(text='Clip '+str(iclip)) -Audio.gcom2.appdir=(appdir+' ')[:80] -Audio.gcom2.ndepth=ndepth.get() -Audio.ftn_init() -GenStdMsgs() -Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] -stopmon() -first=1 -if g.Win32: root.iconbitmap("wsjt.ico") -root.title(' WSJT 6 by K1JT') -import astro -import specjt - -# SpecJT has a "mainloop", so does not return until it is terminated. -#root.mainloop() #Superseded by mainloop in SpecJT - -# Clean up and save user options before terminating -f=open(appdir+'/WSJT.INI',mode='a') -root_geom=root_geom[root_geom.index("+"):] -f.write("WSJTGeometry " + root_geom + "\n") -f.write("Mode " + g.mode + "\n") -f.write("MyCall " + options.MyCall.get() + "\n") -f.write("MyGrid " + options.MyGrid.get() + "\n") -t=g.ftnstr(Audio.gcom2.hiscall) -if t[:1]==" ": t="______" -f.write("HisCall " + t + "\n") -t=g.ftnstr(Audio.gcom2.hisgrid) -if t==" ": t="XX00xx" -f.write("HisGrid " + t + "\n") -#f.write("RxDelay " + str(options.RxDelay.get()) + "\n") -#f.write("TxDelay " + str(options.TxDelay.get()) + "\n") -f.write("IDinterval " + str(options.IDinterval.get()) + "\n") -f.write("PttPort " + str(options.PttPort.get()) + "\n") -f.write("Mileskm " + str(options.mileskm.get()) + "\n") -f.write("MsgStyle " + str(options.ireport.get()) + "\n") -f.write("Region " + str(options.iregion.get()) + "\n") -f.write("AudioIn " + options.DevinName.get() + "\n") -f.write("AudioOut " + options.DevoutName.get() + "\n") -f.write("SamFacIn " + str(options.samfacin.get()) + "\n") -f.write("SamFacOut " + str(options.samfacout.get()) + "\n") -if options.Template6.get()=="": options.Template6.set("_") -f.write("Template1 " + options.Template1.get().replace(" ","_") + "\n") -f.write("Template2 " + options.Template2.get().replace(" ","_") + "\n") -f.write("Template3 " + options.Template3.get().replace(" ","_") + "\n") -f.write("Template4 " + options.Template4.get().replace(" ","_") + "\n") -f.write("Template5 " + options.Template5.get().replace(" ","_") + "\n") -f.write("Template6 " + options.Template6.get().replace(" ","_") + "\n") -if options.addpfx.get().lstrip()=="": options.addpfx.set("_") -f.write("AddPrefix " + options.addpfx.get().lstrip() + "\n") -if options.auxra.get()=="": options.auxra.set("0") -if options.auxdec.get()=="": options.auxdec.set("0") -f.write("AuxRA " + options.auxra.get() + "\n") -f.write("AuxDEC " + options.auxdec.get() + "\n") -f.write("TxFirst " + str(TxFirst.get()) + "\n") -f.write("KB8RQ " + str(kb8rq.get()) + "\n") -f.write("K2TXB " + str(k2txb.get()) + "\n") -f.write("SetSeq " + str(setseq.get()) + "\n") -f.write("Report " + g.report + "\n") -f.write("ShOK " + str(ShOK.get()) + "\n") -f.write("Nsave " + str(nsave.get()) + "\n") -f.write("Band " + str(nfreq.get()) + "\n") -f.write("S441 " + str(isync441) + "\n") -f.write("S6m " + str(isync6m) + "\n") -f.write("Sync " + str(isync65) + "\n") -f.write("Clip " + str(iclip) + "\n") -f.write("Zap " + str(nzap.get()) + "\n") -f.write("NB " + str(nblank.get()) + "\n") -f.write("NAFC " + str(nafc.get()) + "\n") -f.write("Sked " + str(nsked.get()) + "\n") -f.write("NoSh441 " + str(nosh441.get()) + "\n") -f.write("NoShJT65 " + str(noshjt65.get()) + "\n") -f.write("NEME " + str(neme.get()) + "\n") -f.write("NDepth " + str(ndepth.get()) + "\n") -f.write("Debug " + str(ndebug.get()) + "\n") -#f.write("TRPeriod " + str(Audio.gcom1.trperiod) + "\n") -mrudir2=mrudir.replace(" ","#") -f.write("MRUDir " + mrudir2 + "\n") -if g.astro_geom[:7]=="200x200": g.astro_geom="268x423" + g.astro_geom[7:] -f.write("AstroGeometry " + g.astro_geom + "\n") -f.write("CWTRPeriod " + str(ncwtrperiod) + "\n") -f.close() - -Audio.ftn_quit() -Audio.gcom1.ngo=0 #Terminate audio streams -Audio.gcom2.lauto=0 -Audio.gcom1.txok=0 -time.sleep(0.5) +#--------------------------------------------------------------- WSJT + +from Tkinter import * +from tkFileDialog import * +import Pmw +from tkMessageBox import showwarning +import g,os,time +import Audio +from math import log10 +from Numeric import zeros +import dircache +import Image,ImageTk #, ImageDraw +from palettes import colormapblue, colormapgray0, colormapHot, \ + colormapAFMHot, colormapgray1, colormapLinrad, Colormap2Palette +from types import * +import array + +root = Tk() +Version="5.9.5 r" + "$Rev$"[6:-1] +print "******************************************************************" +print "WSJT Version " + Version + ", by K1JT" +print "Revision date: " + \ + "$Date$"[7:-1] +print "Run date: " + time.asctime(time.gmtime()) + " UTC" + +#See if we are running in Windows +g.Win32=0 +if sys.platform=="win32": + g.Win32=1 + try: + root.option_readfile('wsjtrc.win') + except: + pass +else: + try: + root.option_readfile('wsjtrc') + except: + pass +root_geom="" + + +#------------------------------------------------------ Global variables +appdir=os.getcwd() +isync=0 +isync441=2 +isync6m=-10 +isync65=1 +isync_save=0 +iclip=0 +itol=5 +ntol=(10,25,50,100,200,400) #List of available tolerances +idsec=0 +#irdsec=0 +lauto=0 +cmap0="Linrad" +fileopened="" +font1='Helvetica' +hiscall="" +hisgrid="" +isec0=-99 +k2txb=IntVar() +kb8rq=IntVar() +loopall=0 +mode=StringVar() +mode.set("") +mrudir=os.getcwd() +nafc=IntVar() +naz=0 +ndepth=IntVar() +nel=0 +nblank=IntVar() +ncall=0 +ncwtrperiod=120 +ndmiles=0 +ndkm=0 +ndebug=IntVar() +neme=IntVar() +nfreeze=IntVar() +nhotaz=0 +nhotabetter=0 +nopen=0 +nosh441=IntVar() +noshjt65=IntVar() +nsked=IntVar() +setseq=IntVar() +ShOK=IntVar() +slabel="Sync " +textheight=7 +txsnrdb=99. +TxFirst=IntVar() +green=zeros(500,'f') +im=Image.new('P',(500,120)) +im.putpalette(Colormap2Palette(colormapLinrad),"RGB") +pim=ImageTk.PhotoImage(im) +balloon=Pmw.Balloon(root) + +g.freeze_decode=0 +g.mode="" +g.ndevin=IntVar() +g.ndevout=IntVar() +g.DevinName=StringVar() +g.DevoutName=StringVar() +g.focus=0 +#------------------------------------------------------ showspecjt +def showspecjt(event=NONE): + if g.showspecjt>0: + if g.focus>=1: + root.focus_set() + g.focus=0 + else: + g.focus=2 + else: + g.showspecjt=1 + g.focus=2 + +#------------------------------------------------------ restart +def restart(): + Audio.gcom2.nrestart=1 + Audio.gcom2.mantx=1 + +#------------------------------------------------------ restart2 +def restart2(): + Audio.gcom2.shok=ShOK.get() + Audio.gcom2.nrestart=1 + +#------------------------------------------------------ toggle_freeze +def toggle_freeze(event=NONE): + nfreeze.set(1-nfreeze.get()) + +#------------------------------------------------------ toggle_zap +def toggle_zap(event=NONE): + nzap.set(1-nzap.get()) + +#------------------------------------------------------ btx (1-6) +def btx1(event=NONE): + ntx.set(1) + Audio.gcom2.txmsg=(tx1.get()+' ')[:28] + Audio.gcom2.ntxreq=1 + restart() +def btx2(event=NONE): + ntx.set(2) + Audio.gcom2.txmsg=(tx2.get()+' ')[:28] + Audio.gcom2.ntxreq=2 + restart() +def btx3(event=NONE): + ntx.set(3) + Audio.gcom2.txmsg=(tx3.get()+' ')[:28] + Audio.gcom2.ntxreq=3 + restart() +def btx4(event=NONE): + ntx.set(4) + Audio.gcom2.txmsg=(tx4.get()+' ')[:28] + Audio.gcom2.ntxreq=4 + restart() +def btx5(event=NONE): + ntx.set(5) + Audio.gcom2.txmsg=(tx5.get()+' ')[:28] + Audio.gcom2.ntxreq=5 + restart() +def btx6(event=NONE): + ntx.set(6) + Audio.gcom2.txmsg=(tx6.get()+' ')[:28] + Audio.gcom2.ntxreq=6 + restart() + +#------------------------------------------------------ quit +def quit(): + root.destroy() + +#------------------------------------------------------ testmsgs +def testmsgs(): + for m in (tx1, tx2, tx3, tx4, tx5, tx6): + m.delete(0,99) + tx1.insert(0,"@A") + tx2.insert(0,"@B") + tx3.insert(0,"@C") + tx4.insert(0,"@D") + tx5.insert(0,"@1000") + tx6.insert(0,"@2000") + + +#------------------------------------------------------ textsize +def textsize(): + global textheight + if textheight <= 9: + textheight=21 + else: + if mode.get()[:4]=='JT65': + textheight=7 + else: + textheight=9 + text.configure(height=textheight) + +#------------------------------------------------------ logqso +def logqso(event=NONE): + t=time.strftime("%Y-%b-%d,%H:%M",time.gmtime()) + t=t+","+hiscall+","+hisgrid+","+str(g.nfreq)+","+g.mode+"\n" + t2="Please confirm making the following entry in WSJT.LOG:\n\n" + t + msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t2) + msg.geometry(msgpos()) + if g.Win32: msg.iconbitmap("wsjt.ico") + msg.focus_set() + result=msg.activate() + if result == 'Yes': + f=open(appdir+'/WSJT.LOG','a') + f.write(t) + f.close() + +#------------------------------------------------------ monitor +def monitor(event=NONE): + bmonitor.configure(bg='green') + Audio.gcom2.monitoring=1 + +#------------------------------------------------------ stopmon +def stopmon(event=NONE): + global loopall + loopall=0 + bmonitor.configure(bg='gray85') + Audio.gcom2.monitoring=0 + +#------------------------------------------------------ dbl_click_text +def dbl_click_text(event): + t=text.get('1.0',END) #Entire contents of text box + t1=text.get('1.0',CURRENT) #Contents from start to mouse pointer + dbl_click_call(t,t1,event) +#------------------------------------------------------ dbl_click_ave +def dbl_click_ave(event): + t=avetext.get('1.0',END) #Entire contents of text box + t1=avetext.get('1.0',CURRENT) #Contents from start to mouse pointer + dbl_click_call(t,t1,event) +#------------------------------------------------------ dbl_click_call +def dbl_click_call(t,t1,event): + global hiscall + i=len(t1) #Length to mouse pointer + i1=t1.rfind(' ')+1 #index of preceding space + i2=i1+t[i1:].find(' ') #index of next space + hiscall=t[i1:i2] #selected word, assumed as callsign + ToRadio.delete(0,END) + ToRadio.insert(0,hiscall) + i3=t1.rfind('\n')+1 #start of selected line + if i>6 and i2>i1: + try: + nsec=60*int(t1[i3+2:i3+4]) + int(t1[i3+4:i3+6]) + except: + nsec=0 + if setseq.get(): TxFirst.set((nsec/Audio.gcom1.trperiod)%2) + lookup() + GenStdMsgs() + i3=t[:i1].strip().rfind(' ')+1 + if t[i3:i1].strip() == 'CQ': + ntx.set(1) + else: + ntx.set(2) + if event.num==3 and not lauto: toggleauto() + +#------------------------------------------------------ decode +def decode(event=NONE): + if Audio.gcom2.ndecoding==0: #If already busy, ignore request + Audio.gcom2.nagain=1 + Audio.gcom2.npingtime=0 #Decode whole record + n=1 + Audio.gcom2.mousebutton=0 + if Audio.gcom2.ndecoding0==4: n=4 + Audio.gcom2.ndecoding=n #Standard decode, full file (d2a) + +#------------------------------------------------------ decode_include +def decode_include(event=NONE): + global isync,isync_save + isync_save=isync + isync=-99 + Audio.gcom2.minsigdb=-99 + decode() + +#------------------------------------------------------ decode_exclude +def decode_exclude(event=NONE): + global isync,isync_save + isync_save=isync + isync=99 + Audio.gcom2.minsigdb=99 + decode() + +#------------------------------------------------------ openfile +def openfile(event=NONE): + global mrudir,fileopened,nopen + nopen=1 #Work-around for "click feedthrough" bug + try: + os.chdir(mrudir) + except: + pass + fname=askopenfilename(filetypes=[("Wave files","*.wav *.WAV")]) + if fname: + Audio.getfile(fname,len(fname)) + if Audio.gcom2.ierr: print 'Error ',Audio.gcom2.ierr, \ + 'when trying to read file',fname + mrudir=os.path.dirname(fname) + fileopened=os.path.basename(fname) + os.chdir(appdir) + +#------------------------------------------------------ opennext +def opennext(event=NONE): + global ncall,fileopened,loopall,mrudir + if fileopened=="" and ncall==0: + openfile() + ncall=1 + else: +# Make a list of *.wav files in mrudir + la=os.listdir(mrudir) + la.sort() + lb=[] + for i in range(len(la)): + j=la[i].find(".wav") + la[i].find(".WAV") + if j>0: lb.append(la[i]) + for i in range(len(lb)): + if lb[i]==fileopened: + break + if ihc1 and hchc1 and modified==0: + stmp.append(NewEntry+"\n") + try: + f=open(appdir+'/CALL3.TMP','w') + f.writelines(stmp) + f.close() + except: + print 'Error in opening or writing to CALL3.TMP' + + if modified: + if os.path.exists("CALL3.OLD"): os.remove("CALL3.OLD") + os.rename("CALL3.TXT","CALL3.OLD") + os.rename("CALL3.TMP","CALL3.TXT") + +#-------------------------------------------------------- clrToRadio +def clrToRadio(event): + ToRadio.delete(0,END) + HisGrid.delete(0,99) + ToRadio.focus_set() + if kb8rq.get(): ntx.set(6) + + +#------------------------------------------------------ whois +def whois(hiscall): + whodat="" + try: + f=open(appdir+'/CALL3.TXT','r') + s=f.readlines() + f.close() + except: + print 'Error when searching CALL3.TXT, or no such file present' + s="" + for i in range(len(s)): + if s[i][:2] != '//': + i1=s[i].find(',') + if s[i][:i1] == hiscall: + return s[i] + return "" + +#------------------------------------------------------ cleartext +def cleartext(): + f=open(appdir+'/decoded.txt',mode='w') + f.truncate(0) #Delete contents of decoded.txt + f.close() + f=open(appdir+'/decoded.ave',mode='w') + f.truncate(0) #Delete contents of decoded.ave + f.close() + +#------------------------------------------------------ ModeFSK441 +def ModeFSK441(event=NONE): + global slabel,isync,isync441,textheight,itol + if g.mode != "FSK441": + if lauto: toggleauto() + mode.set("FSK441") + cleartext() + Audio.gcom1.trperiod=30 + lab2.configure(text='FileID T Width dB Rpt DF') + lab1.configure(text='Time (s)',bg="green") + lab4.configure(fg='black') + lab5.configure(fg='black') + lab6.configure(bg="green") + isync=isync441 + slabel="S " + lsync.configure(text=slabel+str(isync)) + iframe4b.pack_forget() + textheight=9 + text.configure(height=textheight) + bclravg.configure(state=DISABLED) + binclude.configure(state=DISABLED) + bexclude.configure(state=DISABLED) + cbfreeze.configure(state=DISABLED) + cbafc.configure(state=DISABLED) + sked.configure(state=DISABLED) + report.configure(state=NORMAL) + shmsg.configure(state=NORMAL) + graph2.configure(bg='black') + itol=5 + inctol() + ntx.set(1) + GenStdMsgs() + erase() + +#------------------------------------------------------ ModeJT65 +def ModeJT65(): + global slabel,isync,isync65,textheight,itol + cleartext() + lab2.configure(text='FileID Sync dB DT DF W') + lab4.configure(fg='gray85') + lab5.configure(fg='gray85') + Audio.gcom1.trperiod=60 + iframe4b.pack(after=iframe4,expand=1, fill=X, padx=4) + textheight=7 + text.configure(height=textheight) + isync=isync65 + slabel="Sync " + lsync.configure(text=slabel+str(isync)) + bclravg.configure(state=NORMAL) + binclude.configure(state=NORMAL) + bexclude.configure(state=NORMAL) + cbfreeze.configure(state=NORMAL) + cbafc.configure(state=NORMAL) + sked.configure(state=NORMAL) + report.configure(state=DISABLED) + shmsg.configure(state=DISABLED) + graph2.configure(bg='#66FFFF') + itol=5 + inctol() + ntx.set(1) + GenStdMsgs() + erase() +# graph2.pack_forget() + +#------------------------------------------------------ ModeJT65A +def ModeJT65A(event=NONE): + if g.mode != "JT65A": + if lauto: toggleauto() + mode.set("JT65A") + ModeJT65() + +#------------------------------------------------------ ModeJT65B +def ModeJT65B(event=NONE): + if g.mode != "JT65B": + if lauto: toggleauto() + mode.set("JT65B") + ModeJT65() + +#------------------------------------------------------ ModeJT65C +def ModeJT65C(event=NONE): + if g.mode != "JT65C": + if lauto: toggleauto() + mode.set("JT65C") + ModeJT65() + +#------------------------------------------------------ ModeJT6M +def ModeJT6M(event=NONE): + global slabel,isync,isync6m,itol + if g.mode != "JT6M": + if lauto: toggleauto() + cleartext() + ModeFSK441() + lab2.configure(text='FileID T Width dB DF') + mode.set("JT6M") + isync=isync6m + lsync.configure(text=slabel+str(isync)) + shmsg.configure(state=DISABLED) + cbfreeze.configure(state=NORMAL) + itol=3 + ltol.configure(text='Tol '+str(ntol[itol])) + inctol() + nfreeze.set(1) + ntx.set(1) + Audio.gcom2.mousedf=0 + GenStdMsgs() + erase() + + +#------------------------------------------------------ ModeCW +def ModeCW(event=NONE): + if g.mode != "CW": + if lauto: toggleauto() + cleartext() + mode.set("CW") + Audio.gcom1.trperiod=ncwtrperiod + iframe4b.pack_forget() + text.configure(height=9) + bclravg.configure(state=DISABLED) + binclude.configure(state=DISABLED) + bexclude.configure(state=DISABLED) + cbfreeze.configure(state=DISABLED) + cbafc.configure(state=DISABLED) + sked.configure(state=DISABLED) + report.configure(state=NORMAL) + ntx.set(1) + GenStdMsgs() + erase() + +#------------------------------------------------------ ModeEcho +#def ModeEcho(event=NONE): +# mode.set("Echo") +# stub() + +#------------------------------------------------------ msgpos +def msgpos(): + g=root_geom[root_geom.index("+"):] + t=g[1:] + x=int(t[:t.index("+")]) # + 70 + y=int(t[t.index("+")+1:]) # + 70 + return "+%d+%d" % (x,y) + +#------------------------------------------------------ about +def about(event=NONE): + global Version + about=Toplevel(root) + about.geometry(msgpos()) + if g.Win32: about.iconbitmap("wsjt.ico") + t="WSJT Version " + Version + ", by K1JT" + Label(about,text=t,font=(font1,16)).pack(padx=20,pady=5) + t=""" +WSJT is a weak signal communications program. It supports +four operating modes: + + 1. FSK441 - fast mode for meteor scatter + 2. JT6M - optimized for meteor and ionospheric scatter on 50 MHz + 3. JT65 - for EME and troposcatter + 4. CW - 15 WPM Morse code, messages structured for EME + +Copyright (c) 2001-2006 by Joseph H. Taylor, Jr., K1JT, with +contributions from additional authors. WSJT is Open Source +software, licensed under the GNU General Public License (GPL). +Source code and programming information may be found at +http://developer.berlios.de/projects/wsjt/. +""" + Label(about,text=t,justify=LEFT).pack(padx=20) + t="Revision date: " + \ + "$Date$"[7:-1] + Label(about,text=t,justify=LEFT).pack(padx=20) + about.focus_set() + +#------------------------------------------------------ shortcuts +def shortcuts(event=NONE): + scwid=Toplevel(root) + scwid.geometry(msgpos()) + if g.Win32: scwid.iconbitmap("wsjt.ico") + t=""" +F1 List keyboard shortcuts +Shift-F1 List special mouse commands +CTRL-F1 About WSJT +F2 Options +F3 Tx Mute +F4 Clear "To Radio" +F5 What message to send? +F6 Open next file in directory +Shift-F6 Decode all wave files in directory +F7 Set FSK441 mode +Shift-F7 Set JT6M mode +F8 Set JT65A mode +Shift-F8 Set JT65B mode +CTRL-F8 Set JT65C mode +Shift-CTRL-F8 Set CW mode +F10 Toggle focus between WSJT screens +Alt-1 to Alt-6 Tx1 to Tx6 +Alt-A Toggle Auto On/Off +Alt-D Decode +Alt-E Erase +Alt-F Toggle Freeze +Alt-G Generate Standard Messages +Alt-I Include +Alt-L Lookup +CTRL-L Lookup, then Generate Standard Messages +Alt-M Monitor +Alt-O Tx Stop +Alt-P Play +Alt-Q Log QSO +Alt-S Stop Monitoring or Decoding +Alt-V Save Last +Alt-X Exclude +Alt-Z Toggle Zap +Right/Left Arrow Increase/decrease Freeze DF +""" + Label(scwid,text=t,justify=LEFT).pack(padx=20) + scwid.focus_set() + +#------------------------------------------------------ mouse_commands +def mouse_commands(event=NONE): + scwid=Toplevel(root) + scwid.geometry(msgpos()) + if g.Win32: scwid.iconbitmap("wsjt.ico") + t=""" +Click on Action +-------------------------------------------------------- +Waterfall FSK441/JT6M: click to decode ping + JT65: Click to set DF for Freeze + Double-click to Freeze and Decode + +Main screen, FSK441/JT6M: click to decode ping +graphics area JT65: Click to set DF for Freeze + Double-click to Freeze and Decode + +Main screen, Double-click puts callsign in Tx messages +text area Right-double-click also sets Auto ON + +Sync, Clip, Left/Right click to increase/decrease +Tol, ... +""" + Label(scwid,text=t,justify=LEFT).pack(padx=20) + scwid.focus_set() + +#------------------------------------------------------ what2send +def what2send(event=NONE): + screenf5=Toplevel(root) + screenf5.geometry(root_geom[root_geom.index("+"):]) + if g.Win32: screenf5.iconbitmap("wsjt.ico") + t=""" +To optimize your chances of completing a valid QSO using WSJT, +use the following standard procedures and *do not* exchange pertinent +information by other means (e.g., internet, telephone, ...) while the +QSO is in progress! + +FSK441 or JT6M: If you have received + ... less than both calls from the other station, send both calls. + ... both calls, send both calls and your signal report. + ... both calls and signal report, send R and your report. + ... R plus signal report, send RRR. + ... RRR, the QSO is complete. However, the other station may not +know this, so it is conventional to send 73 to signify that you are done. + +(Outside of North America, the customary procedures for FSK441 +and JT6M may be slightly different.) + + +JT65: If you have received + ... less than both calls, send both calls and your grid locator. + ... both calls, send both calls, your grid locator, and OOO. + ... both calls and OOO, send RO. + ... RO, send RRR. + ... RRR, the QSO is complete. However, the other station may not +know this, so it is conventional to send 73 to signify that you are done. + +(Sending grid locators is conventional in JT65, but numerical signal +reports may be substituted.) +""" + Label(screenf5,text=t,justify=LEFT).pack(padx=20) + screenf5.focus_set() + +#------------------------------------------------------ prefixes +def prefixes(event=NONE): + pfx=Toplevel(root) + pfx.geometry(msgpos()) + if g.Win32: pfx.iconbitmap("wsjt.ico") + f=open(appdir+'/prefixes.txt','r') + s=f.readlines() + t2="" + for i in range(4): + t2=t2+s[i] + t="" + for i in range(len(s)-4): + t=t+s[i+4] + t=t.split() + t.sort() + t1="" + n=0 + for i in range(len(t)): + t1=t1+t[i]+" " + n=n+len(t[i])+2 + if n>60: + t1=t1+"\n" + n=0 + t1=t1+"\n" + if options.addpfx.get().lstrip(): + t1=t1+"\nOptional prefix: "+(options.addpfx.get().lstrip()+' ')[:8] + t2=t2+"\n"+t1 + Label(pfx,text=t2,justify=LEFT).pack(padx=20) + pfx.focus_set() + +#------------------------------------------------------ azdist +def azdist(): + if len(HisGrid.get().strip())<4: + labAz.configure(text="") + labHotAB.configure(text="",bg='gray85') + labDist.configure(text="") + else: + if mode.get()[:4]=="JT65" or mode.get()[:2]=="CW": + labAz.configure(text="Az: %d" % (naz,)) + labHotAB.configure(text="",bg='gray85') + else: + labAz.configure(text="Az: %d El: %d" % (naz,nel)) + if nhotabetter: + labHotAB.configure(text="Hot A: "+str(nhotaz),bg='#FF9900') + else: + labHotAB.configure(text="Hot B: "+str(nhotaz),bg='#FF9900') + if options.mileskm.get()==0: + labDist.configure(text=str(ndmiles)+" mi") + else: + labDist.configure(text=str(int(1.609344*ndmiles))+" km") + +#------------------------------------------------------ incsync +def incsync(event): + global isync + if isync<10: + isync=isync+1 + lsync.configure(text=slabel+str(isync)) + +#------------------------------------------------------ decsync +def decsync(event): + global isync + if isync>-30: + isync=isync-1 + lsync.configure(text=slabel+str(isync)) + +#------------------------------------------------------ incclip +def incclip(event): + global iclip + if iclip<5: + iclip=iclip+1 + if iclip==5: iclip=99 + lclip.configure(text='Clip '+str(iclip)) + +#------------------------------------------------------ decclip +def decclip(event): + global iclip + if iclip>-5: + iclip=iclip-1 + if iclip==98: iclip=4 + lclip.configure(text='Clip '+str(iclip)) + +#------------------------------------------------------ inctol +def inctol(event=NONE): + global itol + if itol<5: itol=itol+1 + ltol.configure(text='Tol '+str(ntol[itol])) + +#------------------------------------------------------ dectol +def dectol(event): + global itol + if itol>0 : itol=itol-1 + ltol.configure(text='Tol '+str(ntol[itol])) + +#------------------------------------------------------ incdsec +def incdsec(event): + global idsec + idsec=idsec+5 + bg='red' + if idsec==0: bg='white' + ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg) + Audio.gcom1.ndsec=idsec + +#------------------------------------------------------ decdsec +def decdsec(event): + global idsec + idsec=idsec-5 + bg='red' + if idsec==0: bg='white' + ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg) + Audio.gcom1.ndsec=idsec + +###------------------------------------------------------ incrdsec +##def incrdsec(event): +## global irdsec +## irdsec=irdsec+5 +## bg='red' +## if irdsec==0: bg='white' +## lrdsec.configure(text='RDsec '+str(0.1*irdsec),bg=bg) +## +###------------------------------------------------------ decrdsec +##def decrdsec(event): +## global irdsec +## irdsec=irdsec-5 +## bg='red' +## if irdsec==0: bg='white' +## lrdsec.configure(text='RDsec '+str(0.1*irdsec),bg=bg) +## +#------------------------------------------------------ inctrperiod +def inctrperiod(event): + global ncwtrperiod + if mode.get()[:2]=="CW": + if ncwtrperiod==120: ncwtrperiod=150 + if ncwtrperiod==60: ncwtrperiod=120 + Audio.gcom1.trperiod=ncwtrperiod + +#------------------------------------------------------ dectrperiod +def dectrperiod(event): + global ncwtrperiod + if mode.get()[:2]=="CW": + if ncwtrperiod==120: ncwtrperiod=60 + if ncwtrperiod==150: ncwtrperiod=120 + Audio.gcom1.trperiod=ncwtrperiod + +#------------------------------------------------------ erase +def erase(event=NONE): + graph1.delete(ALL) + if mode.get()[:4]!="JT65" and mode.get()[:2]!="CW": graph2.delete(ALL) + text.configure(state=NORMAL) + text.delete('1.0',END) + text.configure(state=DISABLED) + avetext.configure(state=NORMAL) + avetext.delete('1.0',END) + avetext.configure(state=DISABLED) + lab3.configure(text=" ") + Audio.gcom2.decodedfile=" " +#------------------------------------------------------ clear_avg +def clear_avg(event=NONE): + avetext.configure(state=NORMAL) + avetext.delete('1.0',END) + avetext.configure(state=DISABLED) + f=open(appdir+'/decoded.ave',mode='w') + f.truncate(0) #Delete contents of decoded.ave + f.close() + Audio.gcom2.nclearave=1 + +#------------------------------------------------------ defaults +def defaults(): + global slabel,isync,iclip,itol,idsec + isync=1 + if g.mode=="FSK441": isync=2 + iclip=0 + lclip.configure(text='Clip '+str(iclip)) + itol=5 + ltol.configure(text='Tol '+str(ntol[itol])) + if g.mode=="JT6M": + isync=-10 + itol=4 + ltol.configure(text='Tol '+str(ntol[itol])) + lsync.configure(text=slabel+str(isync)) + +#------------------------------------------------------ delwav +def delwav(): + t="Are you sure you want to delete\nall *.WAV files in the RxWav directory?" + msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t) + msg.geometry(msgpos()) + if g.Win32: msg.iconbitmap("wsjt.ico") + msg.focus_set() + result=msg.activate() + if result == 'Yes': +# Make a list of *.wav files in RxWav + la=dircache.listdir(appdir+'/RxWav') + lb=[] + for i in range(len(la)): + j=la[i].find(".wav") + la[i].find(".WAV") + if j>0: lb.append(la[i]) +# Now delete them all. + for i in range(len(lb)): + fname=appdir+'/RxWav/'+lb[i] + os.remove(fname) + +#------------------------------------------------------ del_all +def del_all(): + Audio.gcom1.ns0=-999999 + +#------------------------------------------------------ toggleauto +def toggleauto(event=NONE): + global lauto + lauto=1-lauto + Audio.gcom2.lauto=lauto + if lauto: + monitor() + else: + Audio.gcom1.txok=0 + Audio.gcom2.mantx=0 + if lauto==0: auto.configure(text='Auto is OFF',bg='gray85',relief=RAISED) + if lauto==1: auto.configure(text='Auto is ON',bg='red',relief=SOLID) + +#----------------------------------------------------- dtdf_change +# Readout of graphical cursor location +def dtdf_change(event): + if mode.get()[:4]!="JT65": + t="%.1f" % (event.x*30.0/500.0,) + lab6.configure(text=t,bg='green') + else: + if event.y<40 and Audio.gcom2.nspecial==0: + lab1.configure(text='Time (s)',bg="#33FFFF") #light blue + t="%.1f" % (12.0*event.x/500.0-2.0,) + lab6.configure(text=t,bg="#33FFFF") + elif (event.y>=40 and event.y<95) or \ + (event.y<95 and Audio.gcom2.nspecial>0): + lab1.configure(text='DF (Hz)',bg='red') + t="%d" % int(1200.0*event.x/500.0-600.0,) + lab6.configure(text=t,bg="red") + else: + lab1.configure(text='Time (s)',bg='green') + t="%.1f" % (53.0*event.x/500.0,) + lab6.configure(text=t,bg="green") + +#---------------------------------------------------- mouse_click_g1 +def mouse_click_g1(event): + global nopen + if not nopen: + if mode.get()[:4]=="JT65": + Audio.gcom2.mousedf=int((event.x-250)*2.4) + else: + if Audio.gcom2.ndecoding==0: #If decoder is busy, ignore + Audio.gcom2.nagain=1 + Audio.gcom2.mousebutton=event.num #Left=1, Right=3 + Audio.gcom2.npingtime=int(195+60*event.x) #Time (ms) of mouse-picked ping + if Audio.gcom2.ndecoding0==4: + Audio.gcom2.ndecoding=4 #Decode from recorded file + elif Audio.gcom2.ndecoding0==1: + Audio.gcom2.ndecoding=5 #Decode data in main screen + nopen=0 + +#------------------------------------------------------ double-click_g1 +def double_click_g1(event): + if g.mode[:4]=='JT65' and Audio.gcom2.ndecoding==0: + g.freeze_decode=1 + +#------------------------------------------------------ mouse_up_g1 +def mouse_up_g1(event): +# print event.x + pass + +#------------------------------------------------------ right_arrow +def right_arrow(event=NONE): + n=5*int(Audio.gcom2.mousedf/5) + 5 + if n==Audio.gcom2.mousedf: n=n+5 + Audio.gcom2.mousedf=n + +#------------------------------------------------------ left_arrow +def left_arrow(event=NONE): + n=5*int(Audio.gcom2.mousedf/5) + if n==Audio.gcom2.mousedf: n=n-5 + Audio.gcom2.mousedf=n + +#------------------------------------------------------ GenStdMsgs +def GenStdMsgs(event=NONE): + t=ToRadio.get().upper().strip() + ToRadio.delete(0,99) + ToRadio.insert(0,t) + if k2txb.get()!=0: ntx.set(1) + Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] + for m in (tx1, tx2, tx3, tx4, tx5, tx6): + m.delete(0,99) + if mode.get()=="FSK441" or mode.get()=="JT6M": + r=report.get() + tx1.insert(0,setmsg(options.tx1.get(),r)) + tx2.insert(0,setmsg(options.tx2.get(),r)) + tx3.insert(0,setmsg(options.tx3.get(),r)) + tx4.insert(0,setmsg(options.tx4.get(),r)) + tx5.insert(0,setmsg(options.tx5.get(),r)) + tx6.insert(0,setmsg(options.tx6.get(),r)) + elif mode.get()[:4]=="JT65": + if ToRadio.get().find("/") == -1 and \ + options.MyCall.get().find("/") == -1: + t=ToRadio.get() + " "+options.MyCall.get() + " "+options.MyGrid.get()[:4] + tx1.insert(0,t.upper()) + else: + tx1.insert(0,ToRadio.get() + " "+options.MyCall.get()) + tx2.insert(0,tx1.get()+" OOO") + tx3.insert(0,"RO") + tx4.insert(0,"RRR") + tx5.insert(0,"73") + t="CQ " + options.MyCall.get()+ " "+options.MyGrid.get()[:4] + tx6.insert(0,t.upper()) + elif mode.get()[:2]=="CW": + tx1.insert(0,ToRadio.get() + " "+options.MyCall.get()) + tx2.insert(0,tx1.get()+" OOO") + tx3.insert(0,tx1.get()+" RO") + tx4.insert(0,tx1.get()+" RRR") + tx5.insert(0,tx1.get()+" 73") + tx6.insert(0,"CQ " + options.MyCall.get()) + +#------------------------------------------------------ setmsg +def setmsg(template,r): + msg="" + npct=0 + for i in range(len(template)): + if npct: + if template[i]=="M": msg=msg+options.MyCall.get().upper().strip() + if template[i]=="T": msg=msg+ToRadio.get().upper().strip() + if template[i]=="R": msg=msg+r + if template[i]=="G": msg=msg+options.MyGrid.get()[:4] + if template[i]=="L": msg=msg+options.MyGrid.get() + npct=0 + else: + npct=0 + if template[i]=="%": + npct=1 + else: + msg=msg+template[i] + return msg.upper() + +#------------------------------------------------------ plot_large +def plot_large(): + "Plot the green, red, and blue curves in JT65 mode." + graph1.delete(ALL) + y=[] + ngreen=Audio.gcom2.ngreen + if ngreen>0: + for i in range(ngreen): #Find ymax for green curve + green=Audio.gcom2.green[i] + y.append(green) + ymax=max(y) + if ymax<1: ymax=1 + yfac=4.0 + if ymax>75.0/yfac: yfac=75.0/ymax + xy=[] + for i in range(ngreen): #Make xy list for green curve + green=Audio.gcom2.green[i] + n=int(105.0-yfac*green) + xy.append(i) + xy.append(n) + graph1.create_line(xy,fill="green") + + if Audio.gcom2.nspecial==0: + y=[] + for i in range(446): #Find ymax for red curve + psavg=Audio.gcom2.psavg[i+1] + y.append(psavg) + ymax=max(y) + yfac=30.0 + if ymax>85.0/yfac: yfac=85.0/ymax + xy=[] + fac=500.0/446.0 + for i in range(446): #Make xy list for red curve + x=i*fac + psavg=Audio.gcom2.psavg[i+1] + n=int(90.0-yfac*psavg) + xy.append(x) + xy.append(n) + graph1.create_line(xy,fill="red") + else: + y1=[] + y2=[] + for i in range(446): #Find ymax for red curve + ss1=Audio.gcom2.ss1[i+1] + y1.append(ss1) + ss2=Audio.gcom2.ss2[i+1] + y2.append(ss2) + ymax=max(y1+y2) + yfac=30.0 + if ymax>85.0/yfac: yfac=85.0/ymax + xy1=[] + xy2=[] + fac=500.0/446.0 + for i in range(446): #Make xy list for red curve + x=i*fac + ss1=Audio.gcom2.ss1[i+1] + n=int(90.0-yfac*ss1) + xy1.append(x) + xy1.append(n) + ss2=Audio.gcom2.ss2[i+1] + n=int(90.0-yfac*ss2) - 20 + xy2.append(x) + xy2.append(n) + graph1.create_line(xy1,fill="magenta") + graph1.create_line(xy2,fill="orange") + + x1 = 250.0 + fac*Audio.gcom2.ndf/2.6916504 + x2 = x1 + Audio.gcom2.mode65*Audio.gcom2.nspecial*10*fac + graph1.create_line([x1,85,x1,95],fill="yellow") + graph1.create_line([x2,85,x2,95],fill="yellow") + t="RO" + if Audio.gcom2.nspecial==3: t="RRR" + if Audio.gcom2.nspecial==4: t="73" + graph1.create_text(x2+3,93,anchor=W,text=t,fill="yellow") + + if Audio.gcom2.ccf[0] != -9999.0: + y=[] + for i in range(65): #Find ymax for blue curve + ccf=Audio.gcom2.ccf[i] + y.append(ccf) + ymax=max(y) + yfac=40.0 + if ymax>55.0/yfac: yfac=55.0/ymax + xy2=[] + fac=500.0/64.6 + for i in range(65): #Make xy list for blue curve + x=(i+0.5)*fac + ccf=Audio.gcom2.ccf[i] + n=int(60.0-yfac*ccf) + xy2.append(x) + xy2.append(n) + graph1.create_line(xy2,fill='#33FFFF') + +# Put in the tick marks + for i in range(13): + x=int(i*41.667) + j2=115 + if i==1 or i==6 or i==11: j2=110 + graph1.create_line([x,j2,x,125],fill="red") + if Audio.gcom2.nspecial==0: +# x=int((i-0.8)*41.667) + j1=9 + if i==2 or i==7 or i==12: j1=14 + graph1.create_line([x,0,x,j1],fill="#33FFFF") #light blue + else: + graph1.create_line([x,0,x,125-j2],fill="red") + +#------------------------------------------------------ plot_small +def plot_small(): + graph2.delete(ALL) + xy=[] + xy2=[] + df=11025.0/256.0 + fac=150.0/3500.0 + for i in range(81): + x=int(i*df*fac) + xy.append(x) + psavg=Audio.gcom2.psavg[i] + if mode.get()=="JT6M": psavg=psavg + 27.959 + n=int(150.0-2*psavg) + xy.append(n) + if mode.get()=='FSK441': + ps0=Audio.gcom2.ps0[i] + n=int(150.0-2*ps0) + xy2.append(x) + xy2.append(n) + graph2.create_line(xy,fill="magenta") + if mode.get()=='JT6M': + plot_yellow() + elif mode.get()=='FSK441': + graph2.create_line(xy2,fill="red") + for i in range(4): + x=(i+2)*441*fac + graph2.create_line([x,0,x,20],fill="yellow") + for i in range(7): + x=i*500*fac + ytop=110 + if i%2: ytop=115 + graph2.create_line([x,120,x,ytop],fill="white") + +#------------------------------------------------------ plot_yellow +def plot_yellow(): + nz=int(Audio.gcom2.ps0[215]) + if nz>10: + y=[] + for i in range(nz): #Find ymax for yellow curve + n=Audio.gcom2.ps0[i] + y.append(n) + ymax=max(y) + fac=1.0 + if ymax>60: fac=60.0/ymax + xy2=[] + for i in range(nz): + x=int(2.34*i) + y=fac*Audio.gcom2.ps0[i] + 8 + n=int(85.0-y) + xy2.append(x) + xy2.append(n) + graph1.create_line(xy2,fill="yellow") + +#------------------------------------------------------ update +def update(): + global root_geom,isec0,naz,nel,ndmiles,ndkm,nhotaz,nhotabetter,nopen, \ + im,pim,cmap0,isync,isync441,isync6m,isync65,isync_save,idsec, \ + first,itol,txsnrdb + + utc=time.gmtime(time.time()+0.1*idsec) + isec=utc[5] + + if isec != isec0: #Do once per second + isec0=isec + t=time.strftime('%Y %b %d\n%H:%M:%S',utc) + Audio.gcom2.utcdate=t[:12] + ldate.configure(text=t) + root_geom=root.geometry() + utchours=utc[3]+utc[4]/60.0 + utc[5]/3600.0 + naz,nel,ndmiles,ndkm,nhotaz,nhotabetter=Audio.azdist0( \ + options.MyGrid.get().upper(),HisGrid.get().upper(),utchours) + azdist() + g.nfreq=nfreq.get() + + if Audio.gcom2.ndecoding==0: + g.AzSun,g.ElSun,g.AzMoon,g.ElMoon,g.AzMoonB,g.ElMoonB,g.ntsky, \ + g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \ + g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \ + g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \ + utchours,nfreq.get(),options.MyGrid.get().upper(), \ + options.auxra.get()+' '[:9], \ + options.auxdec.get()+' '[:9]) + + if len(HisGrid.get().strip())<4: + g.ndop=g.ndop00 + g.dfdt=g.dfdt0 + + if mode.get()[:4]=='JT65' or mode.get()[:2]=='CW' : + graph2.delete(ALL) + g2font='Helvetica 16' + graph2.create_text(75,13,anchor=CENTER,text="Moon",font=g2font) + graph2.create_text(26,37,anchor=W, text="Az: %8.2f" % g.AzMoon,font=g2font) + graph2.create_text(26,61,anchor=W, text="El: %8.2f" % g.ElMoon,font=g2font) + graph2.create_text(26,85,anchor=W, text="Dop: %6d" % g.ndop,font=g2font) + graph2.create_text(26,109,anchor=W,text="Dgrd:%8.1f" % g.Dgrd,font=g2font) + + if g.freeze_decode and mode.get()[:4]=='JT65': + itol=2 + ltol.configure(text='Tol '+str(50)) + Audio.gcom2.dftolerance=50 + nfreeze.set(1) + Audio.gcom2.nfreeze=1 + if Audio.gcom2.monitoring: + Audio.gcom2.ndecoding=1 + Audio.gcom2.nagain=0 + else: + Audio.gcom2.ndecoding=4 + Audio.gcom2.nagain=1 + g.freeze_decode=0 + + n=int(20.0*log10(g.rms/770.0+0.01)) + t="Rx noise:%3d dB" % (n,) + if n>=-10 and n<=10: + msg4.configure(text=t,bg='gray85') + else: + msg4.configure(text=t,bg='red') + + t=g.ftnstr(Audio.gcom2.decodedfile) +# i=t.rfind(".") + i=g.rfnd(t,".") + t=t[:i] + lab3.configure(text=t) + if mode.get() != g.mode or first: + if mode.get()=="FSK441": + msg2.configure(bg='yellow') + elif mode.get()=="JT65A" or mode.get()=="JT65B" or mode.get()=="JT65C": + msg2.configure(bg='#00FFFF') + elif mode.get()=="JT6M": + msg2.configure(bg='#FF00FF') + elif mode.get()=="CW": + msg2.configure(bg='#00FF00') +# elif mode.get()=="Echo": +# msg2.configure(bg='#FF0000') + g.mode=mode.get() + first=0 + + samfac_in=Audio.gcom1.mfsample/110250.0 + samfac_out=Audio.gcom1.mfsample2/110250.0 + xin=1 + xout=1 + try: + xin=samfac_in/options.samfacin.get() + xout=samfac_out/options.samfacout.get() + if xin<0.999 or xin>1.001 or xout<0.999 or xout>1.001: + lab8.configure(text="%6.4f %6.4f" \ + % (options.samfacin.get(),options.samfacout.get()), \ + fg='black',bg='red') + else: + lab8.configure(fg='gray85',bg='gray85') + except: + pass + + msg1.configure(text="%6.4f %6.4f" % (samfac_in,samfac_out)) + msg2.configure(text=mode.get()) + t="Freeze DF:%4d" % (int(Audio.gcom2.mousedf),) + msg3.configure(text=t) + bdecode.configure(bg='gray85') + if Audio.gcom2.ndecoding: #Set button bg=light_blue + bdecode.configure(bg='#66FFFF') #while decoding + if mode.get()[:2]=="CW": + msg5.configure(text="TR Period: %d s" % (Audio.gcom1.trperiod,), \ + bg='white') + else: + msg5.configure(text="TR Period: %d s" % (Audio.gcom1.trperiod,), \ + bg='gray85') + + tx1.configure(bg='white') + tx2.configure(bg='white') + tx3.configure(bg='white') + tx4.configure(bg='white') + tx5.configure(bg='white') + tx6.configure(bg='white') + if tx6.get()[:1]=='#': + try: + txsnrdb=float(tx6.get()[1:]) + if txsnrdb>-99.0 and txsnrdb<40.0: + Audio.gcom1.txsnrdb=txsnrdb + tx6.configure(bg='orange') + except: + txsnrdb=99.0 + else: + txsnrdb=99.0 + Audio.gcom1.txsnrdb=txsnrdb + if Audio.gcom2.monitoring and not Audio.gcom1.transmitting: + bmonitor.configure(bg='green') + else: + bmonitor.configure(bg='gray85') + if Audio.gcom1.transmitting: + nmsg=int(Audio.gcom2.nmsg) + t=g.ftnstr(Audio.gcom2.sending) + if t[:3]=="CQ ": nsked.set(0) + t="Txing: "+t[:nmsg] + bgcolor='yellow' + if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' #Shorthand (lt blue) + if Audio.gcom2.sendingsh==-1: bgcolor='red' #Plain Text + if Audio.gcom2.sendingsh==2: bgcolor='pink' #Test file + if txsnrdb<90.0: bgcolor='orange' #Simulation mode + if Audio.gcom2.ntxnow==1: tx1.configure(bg=bgcolor) + elif Audio.gcom2.ntxnow==2: tx2.configure(bg=bgcolor) + elif Audio.gcom2.ntxnow==3: tx3.configure(bg=bgcolor) + elif Audio.gcom2.ntxnow==4: tx4.configure(bg=bgcolor) + elif Audio.gcom2.ntxnow==5: tx5.configure(bg=bgcolor) + else: tx6.configure(bg=bgcolor) + else: + bgcolor='green' + t='Receiving' + msg7.configure(text=t,bg=bgcolor) + + if Audio.gcom2.ndecdone==1 or g.cmap != cmap0: + if Audio.gcom2.ndecdone==1: + if isync==-99 or isync==99: + isync=isync_save + Audio.gcom2.minsigdb=isync + try: + f=open(appdir+'/decoded.txt',mode='r') + lines=f.readlines() + f.close() + except: + lines="" + text.configure(state=NORMAL) + for i in range(len(lines)): + text.insert(END,lines[i]) + text.see(END) + text.configure(state=DISABLED) + + if mode.get()[:4]=='JT65': + try: + f=open(appdir+'/decoded.ave',mode='r') + lines=f.readlines() + f.close() + except: + lines[0]="" + lines[1]="" + avetext.configure(state=NORMAL) + avetext.delete('1.0',END) + if len(lines)>1: + avetext.insert(END,lines[0]) + avetext.insert(END,lines[1]) + avetext.configure(state=DISABLED) + Audio.gcom2.ndecdone=2 + + if g.cmap != cmap0: + im.putpalette(g.palette) + cmap0=g.cmap + + if mode.get()[:4]=='JT65': + plot_large() + else: + im.putdata(Audio.gcom2.b) + pim=ImageTk.PhotoImage(im) #Convert Image to PhotoImage + graph1.delete(ALL) +# NB: top two lines are probably invisible ... + graph1.create_image(0,0,anchor='nw',image=pim) + t=g.filetime(g.ftnstr(Audio.gcom2.decodedfile)) + graph1.create_text(100,80,anchor=W,text=t,fill="white") + plot_small() + if loopall: opennext() + nopen=0 + +# Save some parameters + g.mode=mode.get() + g.report=report.get() + if mode.get()=='FSK441': isync441=isync + elif mode.get()=='JT6M': isync6m=isync + elif mode.get()[:4]=='JT65': isync65=isync + Audio.gcom1.txfirst=TxFirst.get() + try: + Audio.gcom1.samfacin=options.samfacin.get() + except: + Audio.gcom1.samfacin=1.0 + try: + Audio.gcom1.samfacout=options.samfacout.get() + except: + Audio.gcom1.samfacout=1.0 +# if Audio.gcom1.samfacin>1.01: Audio.gcom1.samfacin=1.01 +# ... etc. + Audio.gcom2.mycall=(options.MyCall.get()+' ')[:12] + Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12] + Audio.gcom2.hisgrid=(HisGrid.get()+' ')[:6] + Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] + Audio.gcom2.ntxreq=ntx.get() + tx=(tx1,tx2,tx3,tx4,tx5,tx6) + Audio.gcom2.txmsg=(tx[ntx.get()-1].get()+' ')[:28] + Audio.gcom2.mode=(mode.get()+' ')[:6] + Audio.gcom2.shok=ShOK.get() + Audio.gcom2.nsave=nsave.get() + Audio.gcom2.nzap=nzap.get() + Audio.gcom2.ndebug=ndebug.get() + Audio.gcom2.minsigdb=isync + Audio.gcom2.nclip=iclip + Audio.gcom2.nblank=nblank.get() + Audio.gcom2.nafc=nafc.get() + Audio.gcom2.nfreeze=nfreeze.get() + Audio.gcom2.dftolerance=ntol[itol] + Audio.gcom2.neme=neme.get() + Audio.gcom2.ndepth=ndepth.get() + Audio.gcom2.nsked=nsked.get() + try: + Audio.gcom2.idinterval=options.IDinterval.get() + except: + Audio.gcom2.idinterval=0 + Audio.gcom2.ntx2=0 +# Audio.gcom1.rxdelay=float('0'+options.RxDelay.get()) +# Audio.gcom1.txdelay=float('0'+options.TxDelay.get()) + if ntx.get()==1 and noshjt65.get()==1: Audio.gcom2.ntx2=1 + Audio.gcom2.nslim2=isync-4 + if nosh441.get()==1 and mode.get()=='FSK441': Audio.gcom2.nslim2=99 + try: + Audio.gcom2.nport=int(options.PttPort.get()) + except: + Audio.gcom2.nport=0 + +# print 'About to init Audio.gcom2.PttPort in save some parameters' + Audio.gcom2.pttport=(options.PttPort.get() + ' ')[:12] +# print Audio.gcom2.pttport + +# Queue up the next update + ldate.after(100,update) + +#------------------------------------------------------ Top level frame +frame = Frame(root) + +#------------------------------------------------------ Menu Bar +mbar = Frame(frame) +mbar.pack(fill = X) + +#------------------------------------------------------ File Menu +filebutton = Menubutton(mbar, text = 'File') +filebutton.pack(side = LEFT) +filemenu = Menu(filebutton, tearoff=0) +filebutton['menu'] = filemenu +filemenu.add('command', label = 'Open', command = openfile) +filemenu.add('command', label = 'Open next in directory', command = opennext) +filemenu.add('command', label = 'Decode remaining files in directory', \ + command = decodeall) +filemenu.add_separator() +filemenu.add('command', label = 'Delete all *.WAV files in RxWav', \ + command = delwav) +filemenu.add_separator() +filemenu.add('command', label = 'Erase ALL.TXT', command = del_all) +filemenu.add_separator() +filemenu.add('command', label = 'Exit', command = quit) + +#------------------------------------------------------ Setup menu +setupbutton = Menubutton(mbar, text = 'Setup', ) +setupbutton.pack(side = LEFT) +setupmenu = Menu(setupbutton, tearoff=0) +setupbutton['menu'] = setupmenu +setupmenu.add('command', label = 'Options', command = options1) +setupmenu.add_separator() +setupmenu.add('command', label = 'Toggle size of text window', command=textsize) +setupmenu.add('command', label = 'Generate messages for test tones', command=testmsgs) +setupmenu.add_separator() +setupmenu.add_checkbutton(label = 'F4 sets Tx6',variable=kb8rq) +setupmenu.add_checkbutton(label = 'Double-click on callsign sets TxFirst', + variable=setseq) +setupmenu.add_checkbutton(label = 'GenStdMsgs sets Tx1',variable=k2txb) +setupmenu.add_separator() +setupmenu.add_checkbutton(label = 'Enable diagnostics',variable=ndebug) + +#------------------------------------------------------ View menu +viewbutton=Menubutton(mbar,text='View',) +viewbutton.pack(side=LEFT) +viewmenu=Menu(viewbutton,tearoff=0) +viewbutton['menu']=viewmenu +viewmenu.add('command', label = 'SpecJT', command = showspecjt) +viewmenu.add('command', label = 'Astronomical data', command = astro1) + +#------------------------------------------------------ Mode menu +modebutton = Menubutton(mbar, text = 'Mode', ) +modebutton.pack(side = LEFT) +modemenu = Menu(modebutton, tearoff=0) +modebutton['menu'] = modemenu +modemenu.add_radiobutton(label = 'FSK441', variable=mode, command = ModeFSK441, + state=NORMAL) + +# To enable menu item 0: +# modemenu.entryconfig(0,state=NORMAL) +# Can use the following to retrieve the state: +# state=modemenu.entrycget(0,"state") + +modemenu.add_radiobutton(label = 'JT6M', variable=mode, command = ModeJT6M) +modemenu.add_radiobutton(label = 'JT65A', variable=mode, command = ModeJT65A) +modemenu.add_radiobutton(label = 'JT65B', variable=mode, command = ModeJT65B) +modemenu.add_radiobutton(label = 'JT65C', variable=mode, command = ModeJT65C) +modemenu.add_radiobutton(label = 'CW', variable=mode, command = ModeCW) +#modemenu.add_radiobutton(label = 'Echo', variable=mode, command = ModeEcho, +# state=DISABLED) + +#------------------------------------------------------ Decode menu +decodebutton = Menubutton(mbar, text = 'Decode', ) +decodebutton.pack(side = LEFT) +decodemenu = Menu(decodebutton, tearoff=1) +decodebutton['menu'] = decodemenu +decodemenu.FSK441=Menu(decodemenu,tearoff=0) +decodemenu.FSK441.add_checkbutton(label='No shorthands',variable=nosh441) +decodemenu.JT65=Menu(decodemenu,tearoff=0) +decodemenu.JT65.add_checkbutton(label='Only EME calls',variable=neme) +decodemenu.JT65.add_checkbutton(label='No Shorthands if Tx 1',variable=noshjt65) +decodemenu.JT65.add_separator() +decodemenu.JT65.add_radiobutton(label = 'No Deep Search', + variable=ndepth, value=0) +decodemenu.JT65.add_radiobutton(label = 'Normal Deep Search', + variable=ndepth, value=1) +decodemenu.JT65.add_radiobutton(label = 'Aggressive Deep Search', + variable=ndepth, value=2) +decodemenu.JT65.add_radiobutton(label ='Include Average in Aggressive Deep Search', + variable=ndepth, value=3) +decodemenu.add_cascade(label = 'FSK441',menu=decodemenu.FSK441) +decodemenu.add_cascade(label = 'JT65',menu=decodemenu.JT65) + +#------------------------------------------------------ Save menu +savebutton = Menubutton(mbar, text = 'Save') +savebutton.pack(side = LEFT) +savemenu = Menu(savebutton, tearoff=1) +savebutton['menu'] = savemenu +nsave=IntVar() +savemenu.add_radiobutton(label = 'None', variable=nsave,value=0) +savemenu.add_radiobutton(label = 'Save decoded', variable=nsave,value=1) +savemenu.add_radiobutton(label = 'Save if Auto On', variable=nsave,value=2) +savemenu.add_radiobutton(label = 'Save all', variable=nsave,value=3) +nsave.set(0) + +#------------------------------------------------------ Band menu +bandbutton = Menubutton(mbar, text = 'Band') +bandbutton.pack(side = LEFT) +bandmenu = Menu(bandbutton, tearoff=1) +bandbutton['menu'] = bandmenu +nfreq=IntVar() +bandmenu.add_radiobutton(label = '50', variable=nfreq,value=50) +bandmenu.add_radiobutton(label = '144', variable=nfreq,value=144) +bandmenu.add_radiobutton(label = '222', variable=nfreq,value=222) +bandmenu.add_radiobutton(label = '432', variable=nfreq,value=432) +bandmenu.add_radiobutton(label = '1296', variable=nfreq,value=1296) +nfreq.set(144) +#------------------------------------------------------ Help menu +helpbutton = Menubutton(mbar, text = 'Help') +helpbutton.pack(side = LEFT) +helpmenu = Menu(helpbutton, tearoff=0) +helpbutton['menu'] = helpmenu +helpmenu.add('command', label = 'Keyboard shortcuts', command = shortcuts) +helpmenu.add('command', label = 'Special mouse commands', command = mouse_commands) +helpmenu.add('command', label = 'What message to send?', command = what2send) +helpmenu.add('command', label = 'Available suffixes and add-on prefixes', \ + command = prefixes) +helpmenu.add('command', label = 'About WSJT', command = about) + +#------------------------------------------------------ Graphics areas +iframe1 = Frame(frame, bd=1, relief=SUNKEN) +graph1=Canvas(iframe1, bg='black', width=500, height=120,cursor='crosshair') +Widget.bind(graph1,"",dtdf_change) +Widget.bind(graph1,"",mouse_click_g1) +Widget.bind(graph1,"",double_click_g1) +Widget.bind(graph1,"",mouse_up_g1) +Widget.bind(graph1,"",mouse_click_g1) +graph1.pack(side=LEFT) +graph2=Canvas(iframe1, bg='black', width=150, height=120,cursor='crosshair') +graph2.pack(side=LEFT) +iframe1.pack(expand=1, fill=X, padx=4) + +#------------------------------------------------------ Labels under graphics +iframe2a = Frame(frame, bd=1, relief=FLAT, height=15) +lab1=Label(iframe2a, text='Time (s)') +lab1.place(x=250, y=6, anchor=CENTER) +lab3=Label(iframe2a, text=' ') +lab3.place(x=400,y=6, anchor=CENTER) +lab4=Label(iframe2a, text='1 2 3') +lab4.place(x=593,y=6, anchor=CENTER) +iframe2a.pack(expand=1, fill=X, padx=1) +iframe2 = Frame(frame, bd=1, relief=FLAT,height=15) +lab2=Label(iframe2, text='FileID Sync dB DT DF W') +lab2.place(x=3,y=6, anchor='w') +lab5=Label(iframe2, text='Freq (kHz)') +lab5.place(x=580,y=6, anchor=CENTER) +lab6=Label(iframe2a,text='0.0',bg='green') +lab6.place(x=40,y=6, anchor=CENTER) +lab7=Label(iframe2a,text='F3',fg='gray85') +lab7.place(x=495,y=6, anchor=CENTER) +lab8=Label(iframe2a,text='1.0000 1.0000',fg='gray85') +lab8.place(x=135,y=6, anchor=CENTER) +iframe2.pack(expand=1, fill=X, padx=4) + +#-------------------------------------------------------- Decoded text +iframe4 = Frame(frame, bd=1, relief=SUNKEN) +text=Text(iframe4, height=6, width=80) +text.bind('',dbl_click_text) +text.bind('',dbl_click_text) + +root.bind_all('', shortcuts) +root.bind_all('', mouse_commands) +root.bind_all('', about) +root.bind_all('', options1) +root.bind_all('', txmute) +root.bind_all('', clrToRadio) +root.bind_all('', what2send) +root.bind_all('', opennext) +root.bind_all('', decodeall) +root.bind_all('', ModeFSK441) +root.bind_all('', ModeJT65A) +root.bind_all('', ModeJT65B) +root.bind_all('', ModeJT65C) +root.bind_all('', ModeJT6M) +root.bind_all('', ModeCW) +#root.bind_all('', ModeEcho) +root.bind_all('', showspecjt) + +root.bind_all('',btx1) +root.bind_all('',btx2) +root.bind_all('',btx3) +root.bind_all('',btx4) +root.bind_all('',btx5) +root.bind_all('',btx6) + +root.bind_all('',toggleauto) +root.bind_all('',toggleauto) +root.bind_all('',clear_avg) +root.bind_all('',clear_avg) +root.bind_all('',decode) +root.bind_all('',decode) +root.bind_all('',erase) +root.bind_all('',erase) +root.bind_all('',toggle_freeze) +root.bind_all('',toggle_freeze) +root.bind_all('',GenStdMsgs) +root.bind_all('',GenStdMsgs) +root.bind_all('',decode_include) +root.bind_all('',decode_include) +root.bind_all('',lookup) +root.bind_all('',lookup) +root.bind_all('',monitor) +root.bind_all('',monitor) +root.bind_all('',txstop) +root.bind_all('',txstop) +root.bind_all('',stub) +root.bind_all('',stub) +root.bind_all('',logqso) +root.bind_all('',logqso) +root.bind_all('',stopmon) +root.bind_all('',stopmon) +root.bind_all('',savelast) +root.bind_all('',savelast) +root.bind_all('',decode_exclude) +root.bind_all('',decode_exclude) +root.bind_all('',toggle_zap) +root.bind_all('',toggle_zap) +root.bind_all('',lookup_gen) +root.bind_all('',lookup_gen) +root.bind_all('',left_arrow) +root.bind_all('',right_arrow) + +text.pack(side=LEFT, fill=X, padx=1) +sb = Scrollbar(iframe4, orient=VERTICAL, command=text.yview) +sb.pack(side=RIGHT, fill=Y) +text.configure(yscrollcommand=sb.set) +iframe4.pack(expand=1, fill=X, padx=4) +iframe4b = Frame(frame, bd=1, relief=SUNKEN) +avetext=Text(iframe4b, height=2, width=80) +#avetext.bind('', lambda e: "break") +avetext.bind('',dbl_click_ave) +avetext.bind('',dbl_click_ave) +avetext.pack(side=LEFT, fill=X, padx=1) +iframe4b.pack(expand=1, fill=X, padx=4) + +#------------------------------------------------------- Button Bar +iframe4c = Frame(frame, bd=1, relief=SUNKEN) +blogqso=Button(iframe4c, text='Log QSO',underline=4,command=logqso, + padx=1,pady=1) +#bplay=Button(iframe4c, text='Play',underline=0,command=stub) +bstop=Button(iframe4c, text='Stop',underline=0,command=stopmon, + padx=1,pady=1) +bmonitor=Button(iframe4c, text='Monitor',underline=0,command=monitor, + padx=1,pady=1) +bsavelast=Button(iframe4c, text='Save',underline=3,command=savelast, + padx=1,pady=1) +bdecode=Button(iframe4c, text='Decode',underline=0,command=decode, + padx=1,pady=1) +berase=Button(iframe4c, text='Erase',underline=0,command=erase, + padx=1,pady=1) +bclravg=Button(iframe4c, text='Clear Avg',underline=0,command=clear_avg, + padx=1,pady=1) +binclude=Button(iframe4c, text='Include',underline=0, + command=decode_include,padx=1,pady=1) +bexclude=Button(iframe4c, text='Exclude',underline=1, + command=decode_exclude,padx=1,pady=1) +btxstop=Button(iframe4c,text='TxStop',underline=4,command=txstop, + padx=1,pady=1) + +blogqso.pack(side=LEFT,expand=1,fill=X) +#bplay.pack(side=LEFT,expand=1,fill=X) +bstop.pack(side=LEFT,expand=1,fill=X) +bmonitor.pack(side=LEFT,expand=1,fill=X) +bsavelast.pack(side=LEFT,expand=1,fill=X) +bdecode.pack(side=LEFT,expand=1,fill=X) +berase.pack(side=LEFT,expand=1,fill=X) +bclravg.pack(side=LEFT,expand=1,fill=X) +binclude.pack(side=LEFT,expand=1,fill=X) +bexclude.pack(side=LEFT,expand=1,fill=X) +btxstop.pack(side=LEFT,expand=1,fill=X) +iframe4c.pack(expand=1, fill=X, padx=4) + +#-----------------------------------------------------General control area +iframe5 = Frame(frame, bd=1, relief=FLAT,height=180) + +#------------------------------------------------------ "Other station" info +f5a=Frame(iframe5,height=170,bd=2,relief=GROOVE) +labToRadio=Label(f5a,text='To radio:', width=9, relief=FLAT) +labToRadio.grid(column=0,row=0) +ToRadio=Entry(f5a,width=9) +ToRadio.insert(0,'W8WN') +ToRadio.grid(column=1,row=0,pady=3) +bLookup=Button(f5a, text='Lookup',underline=0,command=lookup,padx=1,pady=1) +bLookup.grid(column=2,row=0,sticky='EW',padx=4) +labGrid=Label(f5a,text='Grid:', width=9, relief=FLAT) +labGrid.grid(column=0,row=1) +HisGrid=Entry(f5a,width=9) +HisGrid.grid(column=1,row=1,pady=1) +bAdd=Button(f5a, text='Add',command=addtodb,padx=1,pady=1) +bAdd.grid(column=2,row=1,sticky='EW',padx=4) +labAz=Label(f5a,text='Az 257 El 15',width=11,font=(font1,9)) +labAz.grid(column=1,row=2) +labHotAB=Label(f5a,bg='#FFCCFF',text='HotA: 247',font=(font1,9)) +labHotAB.grid(column=0,row=2,sticky='EW',padx=4,pady=3) +labDist=Label(f5a,text='16753 km',font=(font1,9)) +labDist.grid(column=2,row=2) + +#------------------------------------------------------ Date and Time +ldate=Label(f5a, bg='black', fg='yellow', width=11, bd=4, + text='2005 Apr 22\n01:23:45', relief=RIDGE, + justify=CENTER, font=(font1,16)) +ldate.grid(column=0,columnspan=3,row=3,rowspan=2,pady=2) +f5a.pack(side=LEFT,expand=1,fill=BOTH) + +#------------------------------------------------------ Receiving parameters +f5b=Frame(iframe5,bd=2,relief=GROOVE) +lsync=Label(f5b, bg='white', fg='black', text='Sync 1', width=8, relief=RIDGE) +lsync.grid(column=0,row=0,padx=2,pady=1,sticky='EW') +Widget.bind(lsync,'',incsync) +Widget.bind(lsync,'',decsync) +nzap=IntVar() +cbzap=Checkbutton(f5b,text='Zap',underline=0,variable=nzap) +cbzap.grid(column=1,row=0,padx=2,pady=1,sticky='W') +cbnb=Checkbutton(f5b,text='NB',variable=nblank) +cbnb.grid(column=1,row=1,padx=2,pady=1,sticky='W') +cbfreeze=Checkbutton(f5b,text='Freeze',underline=0,variable=nfreeze) +cbfreeze.grid(column=1,row=2,padx=2,sticky='W') +cbafc=Checkbutton(f5b,text='AFC',variable=nafc) +cbafc.grid(column=1,row=3,padx=2,pady=1,sticky='W') +lclip=Label(f5b, bg='white', fg='black', text='Clip 0', width=8, relief=RIDGE) +lclip.grid(column=0,row=1,padx=2,sticky='EW') +Widget.bind(lclip,'',incclip) +Widget.bind(lclip,'',decclip) +ltol=Label(f5b, bg='white', fg='black', text='Tol 400', width=8, relief=RIDGE) +ltol.grid(column=0,row=2,padx=2,pady=1,sticky='EW') +Widget.bind(ltol,'',inctol) +Widget.bind(ltol,'',dectol) +Button(f5b,text='Defaults',command=defaults,padx=1,pady=1).grid(column=0, + row=3,sticky='EW') +ldsec=Label(f5b, bg='white', fg='black', text='Dsec 0.0', width=8, relief=RIDGE) +ldsec.grid(column=0,row=4,ipadx=3,padx=2,pady=5,sticky='EW') +#lrdsec=Label(f5b, bg='white', fg='black', text='RDsec 0.0', width=8, relief=RIDGE) +#lrdsec.grid(column=1,row=4,ipadx=3,padx=2,pady=5,sticky='EW') +Widget.bind(ldsec,'',incdsec) +Widget.bind(ldsec,'',decdsec) +#Widget.bind(lrdsec,'',incrdsec) +#Widget.bind(lrdsec,'',decrdsec) +#Widget.bind(lrdsec,'',stub) +#Widget.bind(lrdsec,'',stub) + +f5b.pack(side=LEFT,expand=0,fill=BOTH) + +#------------------------------------------------------ Tx params and msgs +f5c=Frame(iframe5,bd=2,relief=GROOVE) +txfirst=Checkbutton(f5c,text='Tx First',justify=RIGHT,variable=TxFirst) +f5c2=Frame(f5c,bd=0) +labreport=Label(f5c2,text='Rpt',width=4) +report=Entry(f5c2, width=4) +report.insert(0,'26') +labreport.pack(side=RIGHT,expand=1,fill=BOTH) +report.pack(side=RIGHT,expand=1,fill=BOTH) +shmsg=Checkbutton(f5c,text='Sh Msg',justify=RIGHT,variable=ShOK, + command=restart2) +sked=Checkbutton(f5c,text='Sked',justify=RIGHT,variable=nsked) +genmsg=Button(f5c,text='GenStdMsgs',underline=0,command=GenStdMsgs, + padx=1,pady=1) +auto=Button(f5c,text='Auto is Off',underline=0,command=toggleauto, + padx=1,pady=1) +auto.focus_set() + +txfirst.grid(column=0,row=0,sticky='W',padx=4) +f5c2.grid(column=0,row=1,sticky='W',padx=4) +shmsg.grid(column=0,row=2,sticky='W',padx=4) +sked.grid(column=0,row=3,sticky='W',padx=4) +genmsg.grid(column=0,row=4,sticky='W',padx=4) +auto.grid(column=0,row=5,sticky='EW',padx=4) +#txstop.grid(column=0,row=6,sticky='EW',padx=4) + +ntx=IntVar() +tx1=Entry(f5c,width=24) +rb1=Radiobutton(f5c,value=1,variable=ntx) +b1=Button(f5c, text='Tx1',underline=2,command=btx1,padx=1,pady=1) +tx1.grid(column=1,row=0) +rb1.grid(column=2,row=0) +b1.grid(column=3,row=0) + +tx2=Entry(f5c,width=24) +rb2=Radiobutton(f5c,value=2,variable=ntx) +b2=Button(f5c, text='Tx2',underline=2,command=btx2,padx=1,pady=1) +tx2.grid(column=1,row=1) +rb2.grid(column=2,row=1) +b2.grid(column=3,row=1) + +tx3=Entry(f5c,width=24) +rb3=Radiobutton(f5c,value=3,variable=ntx) +b3=Button(f5c, text='Tx3',underline=2,command=btx3,padx=1,pady=1) +tx3.grid(column=1,row=2) +rb3.grid(column=2,row=2) +b3.grid(column=3,row=2) + +tx4=Entry(f5c,width=24) +rb4=Radiobutton(f5c,value=4,variable=ntx) +b4=Button(f5c, text='Tx4',underline=2,command=btx4,padx=1,pady=1) +tx4.grid(column=1,row=3) +rb4.grid(column=2,row=3) +b4.grid(column=3,row=3) + +tx5=Entry(f5c,width=24) +rb5=Radiobutton(f5c,value=5,variable=ntx) +b5=Button(f5c, text='Tx5',underline=2,command=btx5,padx=1,pady=1) +tx5.grid(column=1,row=4) +rb5.grid(column=2,row=4) +b5.grid(column=3,row=4) + +tx6=Entry(f5c,width=24) +rb6=Radiobutton(f5c,value=6,variable=ntx) +b6=Button(f5c, text='Tx6',underline=2,command=btx6,padx=1,pady=1) +tx6.grid(column=1,row=5) +rb6.grid(column=2,row=5) +b6.grid(column=3,row=5) + +f5c.pack(side=LEFT,fill=BOTH) +iframe5.pack(expand=1, fill=X, padx=4) + +#------------------------------------------------------------ Status Bar +iframe6 = Frame(frame, bd=1, relief=SUNKEN) +msg1=Message(iframe6, text=' ', width=300,relief=SUNKEN) +msg1.pack(side=LEFT, fill=X, padx=1) +msg2=Message(iframe6, text='Message #2', width=300,relief=SUNKEN) +msg2.pack(side=LEFT, fill=X, padx=1) +msg3=Message(iframe6,width=300,relief=SUNKEN) +msg3.pack(side=LEFT, fill=X, padx=1) +msg4=Message(iframe6, text='Message #4', width=300,relief=SUNKEN) +msg4.pack(side=LEFT, fill=X, padx=1) +msg5=Message(iframe6, text='Message #5', width=300,relief=SUNKEN) +msg5.pack(side=LEFT, fill=X, padx=1) +Widget.bind(msg5,'',inctrperiod) +Widget.bind(msg5,'',dectrperiod) +msg7=Message(iframe6, text=' ', width=300,relief=SUNKEN) +msg7.pack(side=RIGHT, fill=X, padx=1) +iframe6.pack(expand=1, fill=X, padx=4) +frame.pack() + +ldate.after(100,update) +lauto=0 +isync=1 +ntx.set(1) +ndepth.set(1) + +import options +options.defaults() +ModeFSK441() +lookup() +balloon.unbind(ToRadio) +g.astro_geom0="+0+0" +Audio.gcom1.mute=0 + +#---------------------------------------------------------- Process INI file +try: + f=open(appdir+'/WSJT.INI',mode='r') + params=f.readlines() +except: + params="" + if g.Win32: + options.PttPort.set("0") + else: + options.PttPort.set("/dev/cuad0") + Audio.gcom2.nport=0 + +try: + for i in range(len(params)): + key,value=params[i].split() + if key == 'WSJTGeometry': root.geometry(value) + elif key == 'Mode': + mode.set(value) + if value=='FSK441': + ModeFSK441() + elif value=='JT65A': + ModeJT65A() + elif value=='JT65B': + ModeJT65B() + elif value=='JT65C': + ModeJT65C() + elif value=='JT6M': + ModeJT6M() + elif value=='CW': + ModeCW() + elif key == 'MyCall': options.MyCall.set(value) + elif key == 'MyGrid': options.MyGrid.set(value) + elif key == 'HisCall': + hiscall=value + if hiscall=="______": hiscall="" + ToRadio.delete(0,END) + ToRadio.insert(0,hiscall) + elif key == 'HisGrid': + hisgrid=value + if hisgrid == "XX00xx": + lookup() + HisGrid.delete(0,END) + HisGrid.insert(0,hisgrid) +# elif key == 'RxDelay': options.RxDelay.set(value) +# elif key == 'TxDelay': options.TxDelay.set(value) + elif key == 'IDinterval': options.IDinterval.set(value) + elif key == 'PttPort': + try: + options.PttPort.set(value) + try: + Audio.gcom2.nport=int(options.PttPort.get()) + except: + Audio.gcom2.nport=0 + except: + if g.Win32: + options.PttPort.set("0") + else: + options.PttPort.set("/dev/cuad0") + Audio.gcom2.nport=0 + Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12] + elif key == 'Mileskm': options.mileskm.set(value) + elif key == 'MsgStyle': options.ireport.set(value) + elif key == 'Region': options.iregion.set(value) + elif key == 'AudioIn': + try: + g.ndevin.set(value) + except: + g.ndevin.set(0) + g.DevinName.set(value) + options.DevinName.set(value) + Audio.gcom1.devin_name=(options.DevinName.get()+' ')[:12] + elif key == 'AudioOut': + try: + g.ndevout.set(value) + except: + g.ndevout.set(0) + g.DevoutName.set(value) + options.DevoutName.set(value) + Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12] + elif key == 'SamFacIn': options.samfacin.set(value) + elif key == 'SamFacOut': options.samfacout.set(value) + elif key == 'Template1': options.Template1.set(value.replace("_"," ")) + elif key == 'Template2': options.Template2.set(value.replace("_"," ")) + elif key == 'Template3': options.Template3.set(value.replace("_"," ")) + elif key == 'Template4': options.Template4.set(value.replace("_"," ")) + elif key == 'Template5': options.Template5.set(value.replace("_"," ")) + elif key == 'Template6': + options.Template6.set(value.replace("_"," ")) + if options.Template6.get()==" ": options.Template6.set("") + elif key == 'AddPrefix': options.addpfx.set(value.replace("_"," ").lstrip()) + elif key == 'AuxRA': options.auxra.set(value) + elif key == 'AuxDEC': options.auxdec.set(value) + elif key == 'TxFirst': TxFirst.set(value) + elif key == 'KB8RQ': kb8rq.set(value) + elif key == 'K2TXB': k2txb.set(value) + elif key == 'SetSeq': setseq.set(value) + elif key == 'Report': + report.delete(0,99) + report.insert(0,value) + elif key == 'ShOK': ShOK.set(value) + elif key == 'Nsave': nsave.set(value) + elif key == 'Band': nfreq.set(value) + elif key == 'S441': isync441=int(value) + elif key == 'S6m': isync6m=int(value) + elif key == 'Sync': isync65=int(value) + elif key == 'Clip': iclip=int(value) + elif key == 'Zap': nzap.set(value) + elif key == 'NB': nblank.set(value) + elif key == 'NAFC': nafc.set(value) + elif key == 'Sked': nsked.set(value) + elif key == 'NoSh441': nosh441.set(value) + elif key == 'NoShJT65': noshjt65.set(value) + elif key == 'NEME': neme.set(value) + elif key == 'NDepth': ndepth.set(value) + elif key == 'Debug': ndebug.set(value) + elif key == 'HisCall': + Audio.gcom2.hiscall=(value+' ')[:12] + ToRadio.delete(0,99) + ToRadio.insert(0,value) + lookup() #Maybe should save HisGrid, instead? + elif key == 'MRUDir': mrudir=value.replace("#"," ") + elif key == 'AstroGeometry': g.astro_geom0 =value + elif key == 'CWTRPeriod': + ncwtrperiod=int(value) + if mode.get()[:2]=="CW": Audio.gcom1.trperiod=ncwtrperiod + else: pass +except: + print 'Error reading WSJT.INI, continuing with defaults.' + print key,value + +g.mode=mode.get() +if mode.get()=='FSK441': isync=isync441 +elif mode.get()=='JT6M': isync=isync6m +elif mode.get()[:4]=='JT65': isync=isync65 +lsync.configure(text=slabel+str(isync)) +lclip.configure(text='Clip '+str(iclip)) +Audio.gcom2.appdir=(appdir+' ')[:80] +Audio.gcom2.ndepth=ndepth.get() +Audio.ftn_init() +GenStdMsgs() +Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] +stopmon() +first=1 +if g.Win32: root.iconbitmap("wsjt.ico") +root.title(' WSJT 6 by K1JT') +import astro +import specjt + +# SpecJT has a "mainloop", so does not return until it is terminated. +#root.mainloop() #Superseded by mainloop in SpecJT + +# Clean up and save user options before terminating +f=open(appdir+'/WSJT.INI',mode='a') +root_geom=root_geom[root_geom.index("+"):] +f.write("WSJTGeometry " + root_geom + "\n") +f.write("Mode " + g.mode + "\n") +f.write("MyCall " + options.MyCall.get() + "\n") +f.write("MyGrid " + options.MyGrid.get() + "\n") +t=g.ftnstr(Audio.gcom2.hiscall) +if t[:1]==" ": t="______" +f.write("HisCall " + t + "\n") +t=g.ftnstr(Audio.gcom2.hisgrid) +if t==" ": t="XX00xx" +f.write("HisGrid " + t + "\n") +#f.write("RxDelay " + str(options.RxDelay.get()) + "\n") +#f.write("TxDelay " + str(options.TxDelay.get()) + "\n") +f.write("IDinterval " + str(options.IDinterval.get()) + "\n") +f.write("PttPort " + str(options.PttPort.get()) + "\n") +f.write("Mileskm " + str(options.mileskm.get()) + "\n") +f.write("MsgStyle " + str(options.ireport.get()) + "\n") +f.write("Region " + str(options.iregion.get()) + "\n") +f.write("AudioIn " + options.DevinName.get() + "\n") +f.write("AudioOut " + options.DevoutName.get() + "\n") +f.write("SamFacIn " + str(options.samfacin.get()) + "\n") +f.write("SamFacOut " + str(options.samfacout.get()) + "\n") +if options.Template6.get()=="": options.Template6.set("_") +f.write("Template1 " + options.Template1.get().replace(" ","_") + "\n") +f.write("Template2 " + options.Template2.get().replace(" ","_") + "\n") +f.write("Template3 " + options.Template3.get().replace(" ","_") + "\n") +f.write("Template4 " + options.Template4.get().replace(" ","_") + "\n") +f.write("Template5 " + options.Template5.get().replace(" ","_") + "\n") +f.write("Template6 " + options.Template6.get().replace(" ","_") + "\n") +if options.addpfx.get().lstrip()=="": options.addpfx.set("_") +f.write("AddPrefix " + options.addpfx.get().lstrip() + "\n") +if options.auxra.get()=="": options.auxra.set("0") +if options.auxdec.get()=="": options.auxdec.set("0") +f.write("AuxRA " + options.auxra.get() + "\n") +f.write("AuxDEC " + options.auxdec.get() + "\n") +f.write("TxFirst " + str(TxFirst.get()) + "\n") +f.write("KB8RQ " + str(kb8rq.get()) + "\n") +f.write("K2TXB " + str(k2txb.get()) + "\n") +f.write("SetSeq " + str(setseq.get()) + "\n") +f.write("Report " + g.report + "\n") +f.write("ShOK " + str(ShOK.get()) + "\n") +f.write("Nsave " + str(nsave.get()) + "\n") +f.write("Band " + str(nfreq.get()) + "\n") +f.write("S441 " + str(isync441) + "\n") +f.write("S6m " + str(isync6m) + "\n") +f.write("Sync " + str(isync65) + "\n") +f.write("Clip " + str(iclip) + "\n") +f.write("Zap " + str(nzap.get()) + "\n") +f.write("NB " + str(nblank.get()) + "\n") +f.write("NAFC " + str(nafc.get()) + "\n") +f.write("Sked " + str(nsked.get()) + "\n") +f.write("NoSh441 " + str(nosh441.get()) + "\n") +f.write("NoShJT65 " + str(noshjt65.get()) + "\n") +f.write("NEME " + str(neme.get()) + "\n") +f.write("NDepth " + str(ndepth.get()) + "\n") +f.write("Debug " + str(ndebug.get()) + "\n") +#f.write("TRPeriod " + str(Audio.gcom1.trperiod) + "\n") +mrudir2=mrudir.replace(" ","#") +f.write("MRUDir " + mrudir2 + "\n") +if g.astro_geom[:7]=="200x200": g.astro_geom="268x423" + g.astro_geom[7:] +f.write("AstroGeometry " + g.astro_geom + "\n") +f.write("CWTRPeriod " + str(ncwtrperiod) + "\n") +f.close() + +Audio.ftn_quit() +Audio.gcom1.ngo=0 #Terminate audio streams +Audio.gcom2.lauto=0 +Audio.gcom1.txok=0 +time.sleep(0.5) From eecdad6922ef571483dc57c9e34cde32dc686a6e Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sat, 5 Aug 2006 17:42:04 +0000 Subject: [PATCH 183/811] - Added $Date$ and $Revision$ git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@243 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- wsjt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wsjt.py b/wsjt.py index 23f96a6e5..b4c222866 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,5 +1,6 @@ #--------------------------------------------------------------- WSJT - +# $Date$ $Revision$ +# from Tkinter import * from tkFileDialog import * import Pmw From 9471e22ff2dc0336992e838d83183a8dd1f89699 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 9 Aug 2006 19:51:29 +0000 Subject: [PATCH 186/811] - first part of update for new portaudio - fix typo in configure - point Makefile and new location for portaudio.a - Still have to import new portaudio over top of this git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@246 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 2 +- configure | 14 +- configure.ac | 10 +- portaudio-v19/pa_common/pa_allocation.c | 234 --- portaudio-v19/pa_common/pa_allocation.h | 95 -- portaudio-v19/pa_common/pa_converters.c | 1926 ---------------------- portaudio-v19/pa_common/pa_converters.h | 254 --- portaudio-v19/pa_common/pa_cpuload.c | 96 -- portaudio-v19/pa_common/pa_cpuload.h | 63 - portaudio-v19/pa_common/pa_dither.c | 204 --- portaudio-v19/pa_common/pa_dither.h | 91 -- portaudio-v19/pa_common/pa_endianness.h | 111 -- portaudio-v19/pa_common/pa_front.c | 1978 ----------------------- portaudio-v19/pa_common/pa_hostapi.h | 244 --- portaudio-v19/pa_common/pa_process.c | 1763 -------------------- portaudio-v19/pa_common/pa_process.h | 741 --------- portaudio-v19/pa_common/pa_skeleton.c | 807 --------- portaudio-v19/pa_common/pa_stream.c | 141 -- portaudio-v19/pa_common/pa_stream.h | 196 --- portaudio-v19/pa_common/pa_trace.c | 88 - portaudio-v19/pa_common/pa_trace.h | 70 - portaudio-v19/pa_common/pa_types.h | 65 - portaudio-v19/pa_common/pa_util.h | 167 -- portaudio-v19/pa_common/portaudio.h | 1124 ------------- 24 files changed, 13 insertions(+), 10471 deletions(-) delete mode 100644 portaudio-v19/pa_common/pa_allocation.c delete mode 100644 portaudio-v19/pa_common/pa_allocation.h delete mode 100644 portaudio-v19/pa_common/pa_converters.c delete mode 100644 portaudio-v19/pa_common/pa_converters.h delete mode 100644 portaudio-v19/pa_common/pa_cpuload.c delete mode 100644 portaudio-v19/pa_common/pa_cpuload.h delete mode 100644 portaudio-v19/pa_common/pa_dither.c delete mode 100644 portaudio-v19/pa_common/pa_dither.h delete mode 100644 portaudio-v19/pa_common/pa_endianness.h delete mode 100644 portaudio-v19/pa_common/pa_front.c delete mode 100644 portaudio-v19/pa_common/pa_hostapi.h delete mode 100644 portaudio-v19/pa_common/pa_process.c delete mode 100644 portaudio-v19/pa_common/pa_process.h delete mode 100644 portaudio-v19/pa_common/pa_skeleton.c delete mode 100644 portaudio-v19/pa_common/pa_stream.c delete mode 100644 portaudio-v19/pa_common/pa_stream.h delete mode 100644 portaudio-v19/pa_common/pa_trace.c delete mode 100644 portaudio-v19/pa_common/pa_trace.h delete mode 100644 portaudio-v19/pa_common/pa_types.h delete mode 100644 portaudio-v19/pa_common/pa_util.h delete mode 100644 portaudio-v19/pa_common/portaudio.h diff --git a/Makefile.in b/Makefile.in index d994c488f..07538ba30 100644 --- a/Makefile.in +++ b/Makefile.in @@ -99,7 +99,7 @@ all: wsjt6 JT65code: $(OBJS1) $(FC) -o JT65code $(OBJS1) -portaudio-v19/lib/libportaudio.a: +portaudio-v19/lib/.libs/libportaudio.a: (cd portaudio-v19;./configure --with-jack=no) (cd portaudio-v19;${MAKE}) diff --git a/configure b/configure index 9dd56fd94..cb1c9041a 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 227 2006-08-02 10:12:59Z va3db $ +# $Id: configure.ac 239 2006-08-05 16:53:41Z va3db $ # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -976,7 +976,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 227 2006-08-02 10:12:59Z va3db $ +$Id: configure.ac 239 2006-08-05 16:53:41Z va3db $ _ACEOF exit 0 fi @@ -2500,7 +2500,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$OLD_CFLAGS" -CPPFLAGS="-Iportaudio-v19/pa_common -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" +CPPFLAGS="-Iportaudio-v19/include -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" echo "$as_me:$LINENO: checking uname -s for Cygwin, Solaris or HPUX" >&5 @@ -4614,12 +4614,12 @@ else fi -if test -e "portaudio-v19/pa_common/portaudio.h" ; then +if test -e "portaudio-v19/include/portaudio.h" ; then echo "Checking for portaudio...yes" HAS_PORTAUDIO_H=1 else echo "Checking for portaudio...no" - HAS_SAMPLERATE_H=0 + HAS_PORTAUDIO_H=0 fi if test "${ac_cv_header_samplerate_h+set}" = set; then echo "$as_me:$LINENO: checking for samplerate.h" >&5 @@ -6739,9 +6739,9 @@ _ACEOF AUDIO="a2d.f90 jtaudio.c resample.c start_portaudio.c" - NEEDPORTAUDIO="portaudio-v19/lib/libportaudio.a" + NEEDPORTAUDIO="portaudio-v19/lib/.libs/libportaudio.a" - LDFLAGS="portaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" + LDFLAGS="portaudio-v19/lib/.libs/libportaudio.a ${LDFLAGS} -lsamplerate" else NEEDPORTAUDIO="" diff --git a/configure.ac b/configure.ac index c7ea666ec..65fd1fd2b 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ dnl Make sure autoconf doesn't interfere with cflags -jmallett CFLAGS="$OLD_CFLAGS" dnl Lets guess at some likely places for extra libs/includes XXX -db -CPPFLAGS="-Iportaudio-v19/pa_common -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" +CPPFLAGS="-Iportaudio-v19/include -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX]) @@ -110,12 +110,12 @@ AC_HEADER_TIME AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0]) AC_CHECK_HEADER([alsa/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0]) AC_CHECK_HEADER([jack/jack.h], [HAS_JACK_H=1], [HAS_JACK_H=0]) -if test -e "portaudio-v19/pa_common/portaudio.h" ; then +if test -e "portaudio-v19/include/portaudio.h" ; then echo "Checking for portaudio...yes" HAS_PORTAUDIO_H=1 else echo "Checking for portaudio...no" - HAS_SAMPLERATE_H=0 + HAS_PORTAUDIO_H=0 fi AC_CHECK_HEADER([samplerate.h], [HAS_SAMPLERATE_H=1], [HAS_SAMPLERATE_H=0]) @@ -306,8 +306,8 @@ fi if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "a2d.f90 jtaudio.c resample.c start_portaudio.c") - AC_SUBST(NEEDPORTAUDIO, "portaudio-v19/lib/libportaudio.a") - LDFLAGS="portaudio-v19/lib/libportaudio.a ${LDFLAGS} -lsamplerate" + AC_SUBST(NEEDPORTAUDIO, "portaudio-v19/lib/.libs/libportaudio.a") + LDFLAGS="portaudio-v19/lib/.libs/libportaudio.a ${LDFLAGS} -lsamplerate" else AC_SUBST(NEEDPORTAUDIO, "") fi diff --git a/portaudio-v19/pa_common/pa_allocation.c b/portaudio-v19/pa_common/pa_allocation.c deleted file mode 100644 index 98239c48f..000000000 --- a/portaudio-v19/pa_common/pa_allocation.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - * $Id$ - * Portable Audio I/O Library allocation group implementation - * memory allocation group for tracking allocation groups - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Ross Bencina, Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Allocation Group implementation. -*/ - - -#include "pa_allocation.h" -#include "pa_util.h" - - -/* - Maintain 3 singly linked lists... - linkBlocks: the buffers used to allocate the links - spareLinks: links available for use in the allocations list - allocations: the buffers currently allocated using PaUtil_ContextAllocateMemory() - - Link block size is doubled every time new links are allocated. -*/ - - -#define PA_INITIAL_LINK_COUNT_ 16 - -struct PaUtilAllocationGroupLink -{ - struct PaUtilAllocationGroupLink *next; - void *buffer; -}; - -/* - Allocate a block of links. The first link will have it's buffer member - pointing to the block, and it's next member set to . The remaining - links will have NULL buffer members, and each link will point to - the next link except the last, which will point to -*/ -static struct PaUtilAllocationGroupLink *AllocateLinks( long count, - struct PaUtilAllocationGroupLink *nextBlock, - struct PaUtilAllocationGroupLink *nextSpare ) -{ - struct PaUtilAllocationGroupLink *result; - int i; - - result = (struct PaUtilAllocationGroupLink *)PaUtil_AllocateMemory( - sizeof(struct PaUtilAllocationGroupLink) * count ); - if( result ) - { - /* the block link */ - result[0].buffer = result; - result[0].next = nextBlock; - - /* the spare links */ - for( i=1; ilinkCount = PA_INITIAL_LINK_COUNT_; - result->linkBlocks = &links[0]; - result->spareLinks = &links[1]; - result->allocations = 0; - } - else - { - PaUtil_FreeMemory( links ); - } - } - - return result; -} - - -void PaUtil_DestroyAllocationGroup( PaUtilAllocationGroup* group ) -{ - struct PaUtilAllocationGroupLink *current = group->linkBlocks; - struct PaUtilAllocationGroupLink *next; - - while( current ) - { - next = current->next; - PaUtil_FreeMemory( current->buffer ); - current = next; - } - - PaUtil_FreeMemory( group ); -} - - -void* PaUtil_GroupAllocateMemory( PaUtilAllocationGroup* group, long size ) -{ - struct PaUtilAllocationGroupLink *links, *link; - void *result = 0; - - /* allocate more links if necessary */ - if( !group->spareLinks ) - { - /* double the link count on each block allocation */ - links = AllocateLinks( group->linkCount, group->linkBlocks, group->spareLinks ); - if( links ) - { - group->linkCount += group->linkCount; - group->linkBlocks = &links[0]; - group->spareLinks = &links[1]; - } - } - - if( group->spareLinks ) - { - result = PaUtil_AllocateMemory( size ); - if( result ) - { - link = group->spareLinks; - group->spareLinks = link->next; - - link->buffer = result; - link->next = group->allocations; - - group->allocations = link; - } - } - - return result; -} - - -void PaUtil_GroupFreeMemory( PaUtilAllocationGroup* group, void *buffer ) -{ - struct PaUtilAllocationGroupLink *current = group->allocations; - struct PaUtilAllocationGroupLink *previous = 0; - - if( buffer == 0 ) - return; - - /* find the right link and remove it */ - while( current ) - { - if( current->buffer == buffer ) - { - if( previous ) - { - previous->next = current->next; - } - else - { - group->allocations = current->next; - } - - current->buffer = 0; - current->next = group->spareLinks; - group->spareLinks = current; - - break; - } - - previous = current; - current = current->next; - } - - PaUtil_FreeMemory( buffer ); /* free the memory whether we found it in the list or not */ -} - - -void PaUtil_FreeAllAllocations( PaUtilAllocationGroup* group ) -{ - struct PaUtilAllocationGroupLink *current = group->allocations; - struct PaUtilAllocationGroupLink *previous = 0; - - /* free all buffers in the allocations list */ - while( current ) - { - PaUtil_FreeMemory( current->buffer ); - current->buffer = 0; - - previous = current; - current = current->next; - } - - /* link the former allocations list onto the front of the spareLinks list */ - if( previous ) - { - previous->next = group->spareLinks; - group->spareLinks = group->allocations; - group->allocations = 0; - } -} - diff --git a/portaudio-v19/pa_common/pa_allocation.h b/portaudio-v19/pa_common/pa_allocation.h deleted file mode 100644 index 5bcfe75a6..000000000 --- a/portaudio-v19/pa_common/pa_allocation.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef PA_ALLOCATION_H -#define PA_ALLOCATION_H -/* - * $Id$ - * Portable Audio I/O Library allocation context header - * memory allocation context for tracking allocation groups - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Ross Bencina, Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Allocation Group prototypes. An Allocation Group makes it easy to - allocate multiple blocks of memory and free them all simultanously. - - An allocation group is useful for keeping track of multiple blocks - of memory which are allocated at the same time (such as during initialization) - and need to be deallocated at the same time. The allocation group maintains - a list of allocated blocks, and can deallocate them all simultaneously which - can be usefull for cleaning up after a partially initialized object fails. - - The allocation group implementation is built on top of the lower - level allocation functions defined in pa_util.h -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -typedef struct -{ - long linkCount; - struct PaUtilAllocationGroupLink *linkBlocks; - struct PaUtilAllocationGroupLink *spareLinks; - struct PaUtilAllocationGroupLink *allocations; -}PaUtilAllocationGroup; - - - -/** Create an allocation group. -*/ -PaUtilAllocationGroup* PaUtil_CreateAllocationGroup( void ); - -/** Destroy an allocation group, but not the memory allocated through the group. -*/ -void PaUtil_DestroyAllocationGroup( PaUtilAllocationGroup* group ); - -/** Allocate a block of memory though an allocation group. -*/ -void* PaUtil_GroupAllocateMemory( PaUtilAllocationGroup* group, long size ); - -/** Free a block of memory that was previously allocated though an allocation - group. Calling this function is a relatively time consuming operation. - Under normal circumstances clients should call PaUtil_FreeAllAllocations to - free all allocated blocks simultaneously. - @see PaUtil_FreeAllAllocations -*/ -void PaUtil_GroupFreeMemory( PaUtilAllocationGroup* group, void *buffer ); - -/** Free all blocks of memory which have been allocated through the allocation - group. This function doesn't destroy the group itself. -*/ -void PaUtil_FreeAllAllocations( PaUtilAllocationGroup* group ); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_ALLOCATION_H */ diff --git a/portaudio-v19/pa_common/pa_converters.c b/portaudio-v19/pa_common/pa_converters.c deleted file mode 100644 index 39f83e481..000000000 --- a/portaudio-v19/pa_common/pa_converters.c +++ /dev/null @@ -1,1926 +0,0 @@ -/* - * $Id$ - * Portable Audio I/O Library sample conversion mechanism - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Conversion functions implementations. - - If the C9x function lrintf() is available, define PA_USE_C99_LRINTF to use it - - @todo Consider whether functions which dither but don't clip should exist, - V18 automatically enabled clipping whenever dithering was selected. Perhaps - we should do the same. - - @todo implement the converters marked IMPLEMENT ME: Float32_To_UInt8_Dither, - Float32_To_UInt8_Clip, Float32_To_UInt8_DitherClip, Int32_To_Int24_Dither, - Int32_To_UInt8_Dither, Int24_To_Int16_Dither, Int24_To_Int8_Dither, - Int24_To_UInt8_Dither, Int16_To_Int8_Dither, Int16_To_UInt8_Dither, - - @todo review the converters marked REVIEW: Float32_To_Int32, - Float32_To_Int32_Dither, Float32_To_Int32_Clip, Float32_To_Int32_DitherClip, - Int32_To_Int16_Dither, Int32_To_Int8_Dither, Int16_To_Int32 -*/ - - -#include "pa_converters.h" -#include "pa_dither.h" -#include "pa_endianness.h" -#include "pa_types.h" - - -PaSampleFormat PaUtil_SelectClosestAvailableFormat( - PaSampleFormat availableFormats, PaSampleFormat format ) -{ - PaSampleFormat result; - - format &= ~paNonInterleaved; - availableFormats &= ~paNonInterleaved; - - if( (format & availableFormats) == 0 ) - { - /* NOTE: this code depends on the sample format constants being in - descending order of quality - ie best quality is 0 - FIXME: should write an assert which checks that all of the - known constants conform to that requirement. - */ - - if( format != 0x01 ) - { - /* scan for better formats */ - result = format; - do - { - result >>= 1; - } - while( (result & availableFormats) == 0 && result != 0 ); - } - else - { - result = 0; - } - - if( result == 0 ){ - /* scan for worse formats */ - result = format; - do - { - result <<= 1; - } - while( (result & availableFormats) == 0 && result != paCustomFormat ); - - if( (result & availableFormats) == 0 ) - result = paSampleFormatNotSupported; - } - - }else{ - result = format; - } - - return result; -} - -/* -------------------------------------------------------------------------- */ - -#define PA_SELECT_FORMAT_( format, float32, int32, int24, int16, int8, uint8 ) \ - switch( format & ~paNonInterleaved ){ \ - case paFloat32: \ - float32 \ - case paInt32: \ - int32 \ - case paInt24: \ - int24 \ - case paInt16: \ - int16 \ - case paInt8: \ - int8 \ - case paUInt8: \ - uint8 \ - default: return 0; \ - } - -/* -------------------------------------------------------------------------- */ - -#define PA_SELECT_CONVERTER_DITHER_CLIP_( flags, source, destination ) \ - if( flags & paClipOff ){ /* no clip */ \ - if( flags & paDitherOff ){ /* no dither */ \ - return paConverters. source ## _To_ ## destination; \ - }else{ /* dither */ \ - return paConverters. source ## _To_ ## destination ## _Dither; \ - } \ - }else{ /* clip */ \ - if( flags & paDitherOff ){ /* no dither */ \ - return paConverters. source ## _To_ ## destination ## _Clip; \ - }else{ /* dither */ \ - return paConverters. source ## _To_ ## destination ## _DitherClip; \ - } \ - } - -/* -------------------------------------------------------------------------- */ - -#define PA_SELECT_CONVERTER_DITHER_( flags, source, destination ) \ - if( flags & paDitherOff ){ /* no dither */ \ - return paConverters. source ## _To_ ## destination; \ - }else{ /* dither */ \ - return paConverters. source ## _To_ ## destination ## _Dither; \ - } - -/* -------------------------------------------------------------------------- */ - -#define PA_USE_CONVERTER_( source, destination )\ - return paConverters. source ## _To_ ## destination; - -/* -------------------------------------------------------------------------- */ - -#define PA_UNITY_CONVERSION_( wordlength )\ - return paConverters. Copy_ ## wordlength ## _To_ ## wordlength; - -/* -------------------------------------------------------------------------- */ - -PaUtilConverter* PaUtil_SelectConverter( PaSampleFormat sourceFormat, - PaSampleFormat destinationFormat, PaStreamFlags flags ) -{ - PA_SELECT_FORMAT_( sourceFormat, - /* paFloat32: */ - PA_SELECT_FORMAT_( destinationFormat, - /* paFloat32: */ PA_UNITY_CONVERSION_( 32 ), - /* paInt32: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int32 ), - /* paInt24: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int24 ), - /* paInt16: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int16 ), - /* paInt8: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int8 ), - /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, UInt8 ) - ), - /* paInt32: */ - PA_SELECT_FORMAT_( destinationFormat, - /* paFloat32: */ PA_USE_CONVERTER_( Int32, Float32 ), - /* paInt32: */ PA_UNITY_CONVERSION_( 32 ), - /* paInt24: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, Int24 ), - /* paInt16: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, Int16 ), - /* paInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, Int8 ), - /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, UInt8 ) - ), - /* paInt24: */ - PA_SELECT_FORMAT_( destinationFormat, - /* paFloat32: */ PA_USE_CONVERTER_( Int24, Float32 ), - /* paInt32: */ PA_USE_CONVERTER_( Int24, Int32 ), - /* paInt24: */ PA_UNITY_CONVERSION_( 24 ), - /* paInt16: */ PA_SELECT_CONVERTER_DITHER_( flags, Int24, Int16 ), - /* paInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int24, Int8 ), - /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int24, UInt8 ) - ), - /* paInt16: */ - PA_SELECT_FORMAT_( destinationFormat, - /* paFloat32: */ PA_USE_CONVERTER_( Int16, Float32 ), - /* paInt32: */ PA_USE_CONVERTER_( Int16, Int32 ), - /* paInt24: */ PA_USE_CONVERTER_( Int16, Int24 ), - /* paInt16: */ PA_UNITY_CONVERSION_( 16 ), - /* paInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int16, Int8 ), - /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int16, UInt8 ) - ), - /* paInt8: */ - PA_SELECT_FORMAT_( destinationFormat, - /* paFloat32: */ PA_USE_CONVERTER_( Int8, Float32 ), - /* paInt32: */ PA_USE_CONVERTER_( Int8, Int32 ), - /* paInt24: */ PA_USE_CONVERTER_( Int8, Int24 ), - /* paInt16: */ PA_USE_CONVERTER_( Int8, Int16 ), - /* paInt8: */ PA_UNITY_CONVERSION_( 8 ), - /* paUInt8: */ PA_USE_CONVERTER_( Int8, UInt8 ) - ), - /* paUInt8: */ - PA_SELECT_FORMAT_( destinationFormat, - /* paFloat32: */ PA_USE_CONVERTER_( UInt8, Float32 ), - /* paInt32: */ PA_USE_CONVERTER_( UInt8, Int32 ), - /* paInt24: */ PA_USE_CONVERTER_( UInt8, Int24 ), - /* paInt16: */ PA_USE_CONVERTER_( UInt8, Int16 ), - /* paInt8: */ PA_USE_CONVERTER_( UInt8, Int8 ), - /* paUInt8: */ PA_UNITY_CONVERSION_( 8 ) - ) - ) -} - -/* -------------------------------------------------------------------------- */ - -#ifdef PA_NO_STANDARD_CONVERTERS - -/* -------------------------------------------------------------------------- */ - -PaUtilConverterTable paConverters = { - 0, /* PaUtilConverter *Float32_To_Int32; */ - 0, /* PaUtilConverter *Float32_To_Int32_Dither; */ - 0, /* PaUtilConverter *Float32_To_Int32_Clip; */ - 0, /* PaUtilConverter *Float32_To_Int32_DitherClip; */ - - 0, /* PaUtilConverter *Float32_To_Int24; */ - 0, /* PaUtilConverter *Float32_To_Int24_Dither; */ - 0, /* PaUtilConverter *Float32_To_Int24_Clip; */ - 0, /* PaUtilConverter *Float32_To_Int24_DitherClip; */ - - 0, /* PaUtilConverter *Float32_To_Int16; */ - 0, /* PaUtilConverter *Float32_To_Int16_Dither; */ - 0, /* PaUtilConverter *Float32_To_Int16_Clip; */ - 0, /* PaUtilConverter *Float32_To_Int16_DitherClip; */ - - 0, /* PaUtilConverter *Float32_To_Int8; */ - 0, /* PaUtilConverter *Float32_To_Int8_Dither; */ - 0, /* PaUtilConverter *Float32_To_Int8_Clip; */ - 0, /* PaUtilConverter *Float32_To_Int8_DitherClip; */ - - 0, /* PaUtilConverter *Float32_To_UInt8; */ - 0, /* PaUtilConverter *Float32_To_UInt8_Dither; */ - 0, /* PaUtilConverter *Float32_To_UInt8_Clip; */ - 0, /* PaUtilConverter *Float32_To_UInt8_DitherClip; */ - - 0, /* PaUtilConverter *Int32_To_Float32; */ - 0, /* PaUtilConverter *Int32_To_Int24; */ - 0, /* PaUtilConverter *Int32_To_Int24_Dither; */ - 0, /* PaUtilConverter *Int32_To_Int16; */ - 0, /* PaUtilConverter *Int32_To_Int16_Dither; */ - 0, /* PaUtilConverter *Int32_To_Int8; */ - 0, /* PaUtilConverter *Int32_To_Int8_Dither; */ - 0, /* PaUtilConverter *Int32_To_UInt8; */ - 0, /* PaUtilConverter *Int32_To_UInt8_Dither; */ - - 0, /* PaUtilConverter *Int24_To_Float32; */ - 0, /* PaUtilConverter *Int24_To_Int32; */ - 0, /* PaUtilConverter *Int24_To_Int16; */ - 0, /* PaUtilConverter *Int24_To_Int16_Dither; */ - 0, /* PaUtilConverter *Int24_To_Int8; */ - 0, /* PaUtilConverter *Int24_To_Int8_Dither; */ - 0, /* PaUtilConverter *Int24_To_UInt8; */ - 0, /* PaUtilConverter *Int24_To_UInt8_Dither; */ - - 0, /* PaUtilConverter *Int16_To_Float32; */ - 0, /* PaUtilConverter *Int16_To_Int32; */ - 0, /* PaUtilConverter *Int16_To_Int24; */ - 0, /* PaUtilConverter *Int16_To_Int8; */ - 0, /* PaUtilConverter *Int16_To_Int8_Dither; */ - 0, /* PaUtilConverter *Int16_To_UInt8; */ - 0, /* PaUtilConverter *Int16_To_UInt8_Dither; */ - - 0, /* PaUtilConverter *Int8_To_Float32; */ - 0, /* PaUtilConverter *Int8_To_Int32; */ - 0, /* PaUtilConverter *Int8_To_Int24 */ - 0, /* PaUtilConverter *Int8_To_Int16; */ - 0, /* PaUtilConverter *Int8_To_UInt8; */ - - 0, /* PaUtilConverter *UInt8_To_Float32; */ - 0, /* PaUtilConverter *UInt8_To_Int32; */ - 0, /* PaUtilConverter *UInt8_To_Int24; */ - 0, /* PaUtilConverter *UInt8_To_Int16; */ - 0, /* PaUtilConverter *UInt8_To_Int8; */ - - 0, /* PaUtilConverter *Copy_8_To_8; */ - 0, /* PaUtilConverter *Copy_16_To_16; */ - 0, /* PaUtilConverter *Copy_24_To_24; */ - 0 /* PaUtilConverter *Copy_32_To_32; */ -}; - -/* -------------------------------------------------------------------------- */ - -#else /* PA_NO_STANDARD_CONVERTERS is not defined */ - -/* -------------------------------------------------------------------------- */ - -#define PA_CLIP_( val, min, max )\ - { val = ((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val)); } - - -static const float const_1_div_128_ = 1.0f / 128.0f; /* 8 bit multiplier */ - -static const float const_1_div_32768_ = 1.0f / 32768.f; /* 16 bit multiplier */ - -static const double const_1_div_2147483648_ = 1.0 / 2147483648.0; /* 32 bit multiplier */ - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - PaInt32 *dest = (PaInt32*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* REVIEW */ -#ifdef PA_USE_C99_LRINTF - float scaled = *src * 0x7FFFFFFF; - *dest = lrintf(scaled-0.5f); -#else - double scaled = *src * 0x7FFFFFFF; - *dest = (PaInt32) scaled; -#endif - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int32_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - PaInt32 *dest = (PaInt32*)destinationBuffer; - - while( count-- ) - { - /* REVIEW */ -#ifdef PA_USE_C99_LRINTF - float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - float dithered = ((float)*src * (2147483646.0f)) + dither; - *dest = lrintf(dithered - 0.5f); -#else - double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - double dithered = ((double)*src * (2147483646.0)) + dither; - *dest = (PaInt32) dithered; -#endif - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int32_Clip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - PaInt32 *dest = (PaInt32*)destinationBuffer; - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* REVIEW */ -#ifdef PA_USE_C99_LRINTF - float scaled = *src * 0x7FFFFFFF; - PA_CLIP_( scaled, -2147483648.f, 2147483647.f ); - *dest = lrintf(scaled-0.5f); -#else - double scaled = *src * 0x7FFFFFFF; - PA_CLIP_( scaled, -2147483648., 2147483647. ); - *dest = (PaInt32) scaled; -#endif - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int32_DitherClip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - PaInt32 *dest = (PaInt32*)destinationBuffer; - - while( count-- ) - { - /* REVIEW */ -#ifdef PA_USE_C99_LRINTF - float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - float dithered = ((float)*src * (2147483646.0f)) + dither; - PA_CLIP_( dithered, -2147483648.f, 2147483647.f ); - *dest = lrintf(dithered-0.5f); -#else - double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - double dithered = ((double)*src * (2147483646.0)) + dither; - PA_CLIP_( dithered, -2147483648., 2147483647. ); - *dest = (PaInt32) dithered; -#endif - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int24( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - PaInt32 temp; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* convert to 32 bit and drop the low 8 bits */ - double scaled = *src * 0x7FFFFFFF; - temp = (PaInt32) scaled; - -#if defined(PA_LITTLE_ENDIAN) - dest[0] = (unsigned char)(temp >> 8); - dest[1] = (unsigned char)(temp >> 16); - dest[2] = (unsigned char)(temp >> 24); -#elif defined(PA_BIG_ENDIAN) - dest[0] = (unsigned char)(temp >> 24); - dest[1] = (unsigned char)(temp >> 16); - dest[2] = (unsigned char)(temp >> 8); -#endif - - src += sourceStride; - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int24_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - PaInt32 temp; - - while( count-- ) - { - /* convert to 32 bit and drop the low 8 bits */ - - double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - double dithered = ((double)*src * (2147483646.0)) + dither; - - temp = (PaInt32) dithered; - -#if defined(PA_LITTLE_ENDIAN) - dest[0] = (unsigned char)(temp >> 8); - dest[1] = (unsigned char)(temp >> 16); - dest[2] = (unsigned char)(temp >> 24); -#elif defined(PA_BIG_ENDIAN) - dest[0] = (unsigned char)(temp >> 24); - dest[1] = (unsigned char)(temp >> 16); - dest[2] = (unsigned char)(temp >> 8); -#endif - - src += sourceStride; - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int24_Clip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - PaInt32 temp; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* convert to 32 bit and drop the low 8 bits */ - double scaled = *src * 0x7FFFFFFF; - PA_CLIP_( scaled, -2147483648., 2147483647. ); - temp = (PaInt32) scaled; - -#if defined(PA_LITTLE_ENDIAN) - dest[0] = (unsigned char)(temp >> 8); - dest[1] = (unsigned char)(temp >> 16); - dest[2] = (unsigned char)(temp >> 24); -#elif defined(PA_BIG_ENDIAN) - dest[0] = (unsigned char)(temp >> 24); - dest[1] = (unsigned char)(temp >> 16); - dest[2] = (unsigned char)(temp >> 8); -#endif - - src += sourceStride; - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int24_DitherClip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - PaInt32 temp; - - while( count-- ) - { - /* convert to 32 bit and drop the low 8 bits */ - - double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - double dithered = ((double)*src * (2147483646.0)) + dither; - PA_CLIP_( dithered, -2147483648., 2147483647. ); - - temp = (PaInt32) dithered; - -#if defined(PA_LITTLE_ENDIAN) - dest[0] = (unsigned char)(temp >> 8); - dest[1] = (unsigned char)(temp >> 16); - dest[2] = (unsigned char)(temp >> 24); -#elif defined(PA_BIG_ENDIAN) - dest[0] = (unsigned char)(temp >> 24); - dest[1] = (unsigned char)(temp >> 16); - dest[2] = (unsigned char)(temp >> 8); -#endif - - src += sourceStride; - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int16( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - PaInt16 *dest = (PaInt16*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { -#ifdef PA_USE_C99_LRINTF - float tempf = (*src * (32767.0f)) ; - *dest = lrintf(tempf-0.5f); -#else - short samp = (short) (*src * (32767.0f)); - *dest = samp; -#endif - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int16_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - PaInt16 *dest = (PaInt16*)destinationBuffer; - - while( count-- ) - { - - float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - float dithered = (*src * (32766.0f)) + dither; - -#ifdef PA_USE_C99_LRINTF - *dest = lrintf(dithered-0.5f); -#else - *dest = (PaInt16) dithered; -#endif - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int16_Clip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - PaInt16 *dest = (PaInt16*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { -#ifdef PA_USE_C99_LRINTF - long samp = lrintf((*src * (32767.0f)) -0.5f); -#else - long samp = (PaInt32) (*src * (32767.0f)); -#endif - PA_CLIP_( samp, -0x8000, 0x7FFF ); - *dest = (PaInt16) samp; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int16_DitherClip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - PaInt16 *dest = (PaInt16*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - - float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - float dithered = (*src * (32766.0f)) + dither; - PaInt32 samp = (PaInt32) dithered; - PA_CLIP_( samp, -0x8000, 0x7FFF ); -#ifdef PA_USE_C99_LRINTF - *dest = lrintf(samp-0.5f); -#else - *dest = (PaInt16) samp; -#endif - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - signed char samp = (signed char) (*src * (127.0f)); - *dest = samp; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int8_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - float dithered = (*src * (126.0f)) + dither; - PaInt32 samp = (PaInt32) dithered; - *dest = (signed char) samp; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int8_Clip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - PaInt32 samp = (PaInt32)(*src * (127.0f)); - PA_CLIP_( samp, -0x80, 0x7F ); - *dest = (signed char) samp; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_Int8_DitherClip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); - /* use smaller scaler to prevent overflow when we add the dither */ - float dithered = (*src * (126.0f)) + dither; - PaInt32 samp = (PaInt32) dithered; - PA_CLIP_( samp, -0x80, 0x7F ); - *dest = (signed char) samp; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_UInt8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - unsigned char samp = (unsigned char)(128 + ((unsigned char) (*src * (127.0f)))); - *dest = samp; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_UInt8_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* IMPLEMENT ME */ - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_UInt8_Clip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* IMPLEMENT ME */ - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Float32_To_UInt8_DitherClip( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - float *src = (float*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* IMPLEMENT ME */ - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int32_To_Float32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt32 *src = (PaInt32*)sourceBuffer; - float *dest = (float*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - *dest = (float) ((double)*src * const_1_div_2147483648_); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int32_To_Int24( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt32 *src = (PaInt32*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* REVIEW */ -#if defined(PA_LITTLE_ENDIAN) - dest[0] = (unsigned char)(*src >> 8); - dest[1] = (unsigned char)(*src >> 16); - dest[2] = (unsigned char)(*src >> 24); -#elif defined(PA_BIG_ENDIAN) - dest[0] = (unsigned char)(*src >> 24); - dest[1] = (unsigned char)(*src >> 16); - dest[2] = (unsigned char)(*src >> 8); -#endif - src += sourceStride; - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int32_To_Int24_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - (void) destinationBuffer; /* unused parameters */ - (void) destinationStride; /* unused parameters */ - (void) sourceBuffer; /* unused parameters */ - (void) sourceStride; /* unused parameters */ - (void) count; /* unused parameters */ - (void) ditherGenerator; /* unused parameters */ - /* IMPLEMENT ME */ -} - -/* -------------------------------------------------------------------------- */ - -static void Int32_To_Int16( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt32 *src = (PaInt32*)sourceBuffer; - PaInt16 *dest = (PaInt16*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - *dest = (PaInt16) ((*src) >> 16); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int32_To_Int16_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt32 *src = (PaInt32*)sourceBuffer; - PaInt16 *dest = (PaInt16*)destinationBuffer; - PaInt32 dither; - - while( count-- ) - { - /* REVIEW */ - dither = PaUtil_Generate16BitTriangularDither( ditherGenerator ); - *dest = (PaInt16) ((((*src)>>1) + dither) >> 15); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int32_To_Int8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt32 *src = (PaInt32*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - *dest = (signed char) ((*src) >> 24); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int32_To_Int8_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt32 *src = (PaInt32*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - PaInt32 dither; - - while( count-- ) - { - /* REVIEW */ - dither = PaUtil_Generate16BitTriangularDither( ditherGenerator ); - *dest = (signed char) ((((*src)>>1) + dither) >> 23); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int32_To_UInt8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt32 *src = (PaInt32*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - (*dest) = (unsigned char)(((*src) >> 24) + 128); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int32_To_UInt8_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt32 *src = (PaInt32*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* IMPLEMENT ME */ - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int24_To_Float32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - float *dest = (float*)destinationBuffer; - PaInt32 temp; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - -#if defined(PA_LITTLE_ENDIAN) - temp = (((long)src[0]) << 8); - temp = temp | (((long)src[1]) << 16); - temp = temp | (((long)src[2]) << 24); -#elif defined(PA_BIG_ENDIAN) - temp = (((long)src[0]) << 24); - temp = temp | (((long)src[1]) << 16); - temp = temp | (((long)src[2]) << 8); -#endif - - *dest = (float) ((double)temp * const_1_div_2147483648_); - - src += sourceStride * 3; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int24_To_Int32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - PaInt32 *dest = (PaInt32*) destinationBuffer; - PaInt32 temp; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - -#if defined(PA_LITTLE_ENDIAN) - temp = (((long)src[0]) << 8); - temp = temp | (((long)src[1]) << 16); - temp = temp | (((long)src[2]) << 24); -#elif defined(PA_BIG_ENDIAN) - temp = (((long)src[0]) << 24); - temp = temp | (((long)src[1]) << 16); - temp = temp | (((long)src[2]) << 8); -#endif - - *dest = temp; - - src += sourceStride * 3; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int24_To_Int16( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - PaInt16 *dest = (PaInt16*)destinationBuffer; - - PaInt16 temp; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - -#if defined(PA_LITTLE_ENDIAN) - /* src[0] is discarded */ - temp = (((PaInt16)src[1])); - temp = temp | (PaInt16)(((PaInt16)src[2]) << 8); -#elif defined(PA_BIG_ENDIAN) - /* src[2] is discarded */ - temp = (PaInt16)(((PaInt16)src[0]) << 8); - temp = temp | (((PaInt16)src[1])); -#endif - - *dest = temp; - - src += sourceStride * 3; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int24_To_Int16_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - (void) destinationBuffer; /* unused parameters */ - (void) destinationStride; /* unused parameters */ - (void) sourceBuffer; /* unused parameters */ - (void) sourceStride; /* unused parameters */ - (void) count; /* unused parameters */ - (void) ditherGenerator; /* unused parameters */ - /* IMPLEMENT ME */ -} - -/* -------------------------------------------------------------------------- */ - -static void Int24_To_Int8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - -#if defined(PA_LITTLE_ENDIAN) - /* src[0] is discarded */ - /* src[1] is discarded */ - *dest = src[2]; -#elif defined(PA_BIG_ENDIAN) - /* src[2] is discarded */ - /* src[1] is discarded */ - *dest = src[0]; -#endif - - src += sourceStride * 3; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int24_To_Int8_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - (void) destinationBuffer; /* unused parameters */ - (void) destinationStride; /* unused parameters */ - (void) sourceBuffer; /* unused parameters */ - (void) sourceStride; /* unused parameters */ - (void) count; /* unused parameters */ - (void) ditherGenerator; /* unused parameters */ - /* IMPLEMENT ME */ -} - -/* -------------------------------------------------------------------------- */ - -static void Int24_To_UInt8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - -#if defined(PA_LITTLE_ENDIAN) - /* src[0] is discarded */ - /* src[1] is discarded */ - *dest = (unsigned char)(src[2] + 128); -#elif defined(PA_BIG_ENDIAN) - *dest = (unsigned char)(src[0] + 128); - /* src[1] is discarded */ - /* src[2] is discarded */ -#endif - - src += sourceStride * 3; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int24_To_UInt8_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - (void) destinationBuffer; /* unused parameters */ - (void) destinationStride; /* unused parameters */ - (void) sourceBuffer; /* unused parameters */ - (void) sourceStride; /* unused parameters */ - (void) count; /* unused parameters */ - (void) ditherGenerator; /* unused parameters */ - /* IMPLEMENT ME */ -} - -/* -------------------------------------------------------------------------- */ - -static void Int16_To_Float32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt16 *src = (PaInt16*)sourceBuffer; - float *dest = (float*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - float samp = *src * const_1_div_32768_; /* FIXME: i'm concerned about this being asymetrical with float->int16 -rb */ - *dest = samp; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int16_To_Int32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt16 *src = (PaInt16*)sourceBuffer; - PaInt32 *dest = (PaInt32*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* REVIEW: we should consider something like - (*src << 16) | (*src & 0xFFFF) - */ - - *dest = *src << 16; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int16_To_Int24( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt16 *src = (PaInt16*) sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - PaInt16 temp; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - temp = *src; - -#if defined(PA_LITTLE_ENDIAN) - dest[0] = 0; - dest[1] = (unsigned char)(temp); - dest[2] = (unsigned char)(temp >> 8); -#elif defined(PA_BIG_ENDIAN) - dest[0] = (unsigned char)(temp >> 8); - dest[1] = (unsigned char)(temp); - dest[2] = 0; -#endif - - src += sourceStride; - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int16_To_Int8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt16 *src = (PaInt16*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - (*dest) = (signed char)((*src) >> 8); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int16_To_Int8_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt16 *src = (PaInt16*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* IMPLEMENT ME */ - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int16_To_UInt8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt16 *src = (PaInt16*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - (*dest) = (unsigned char)(((*src) >> 8) + 128); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int16_To_UInt8_Dither( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaInt16 *src = (PaInt16*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - /* IMPLEMENT ME */ - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int8_To_Float32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - signed char *src = (signed char*)sourceBuffer; - float *dest = (float*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - float samp = *src * const_1_div_128_; - *dest = samp; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int8_To_Int32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - signed char *src = (signed char*)sourceBuffer; - PaInt32 *dest = (PaInt32*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - (*dest) = (*src) << 24; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int8_To_Int24( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - signed char *src = (signed char*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - -#if defined(PA_LITTLE_ENDIAN) - dest[0] = 0; - dest[1] = 0; - dest[2] = (*src); -#elif defined(PA_BIG_ENDIAN) - dest[0] = (*src); - dest[1] = 0; - dest[2] = 0; -#endif - - src += sourceStride; - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int8_To_Int16( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - signed char *src = (signed char*)sourceBuffer; - PaInt16 *dest = (PaInt16*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - (*dest) = (PaInt16)((*src) << 8); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Int8_To_UInt8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - signed char *src = (signed char*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - (*dest) = (unsigned char)(*src + 128); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void UInt8_To_Float32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - float *dest = (float*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - float samp = (*src - 128) * const_1_div_128_; - *dest = samp; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void UInt8_To_Int32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - PaInt32 *dest = (PaInt32*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - (*dest) = (*src - 128) << 24; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void UInt8_To_Int24( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - (void) ditherGenerator; /* unused parameters */ - - while( count-- ) - { - -#if defined(PA_LITTLE_ENDIAN) - dest[0] = 0; - dest[1] = 0; - dest[2] = (unsigned char)(*src - 128); -#elif defined(PA_BIG_ENDIAN) - dest[0] = (unsigned char)(*src - 128); - dest[1] = 0; - dest[2] = 0; -#endif - - src += sourceStride; - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void UInt8_To_Int16( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - PaInt16 *dest = (PaInt16*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - (*dest) = (PaInt16)((*src - 128) << 8); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void UInt8_To_Int8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - signed char *dest = (signed char*)destinationBuffer; - (void)ditherGenerator; /* unused parameter */ - - while( count-- ) - { - (*dest) = (signed char)(*src - 128); - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Copy_8_To_8( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - *dest = *src; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Copy_16_To_16( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaUint16 *src = (PaUint16 *)sourceBuffer; - PaUint16 *dest = (PaUint16 *)destinationBuffer; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - *dest = *src; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Copy_24_To_24( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - unsigned char *src = (unsigned char*)sourceBuffer; - unsigned char *dest = (unsigned char*)destinationBuffer; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - dest[0] = src[0]; - dest[1] = src[1]; - dest[2] = src[2]; - - src += sourceStride * 3; - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Copy_32_To_32( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) -{ - PaUint32 *dest = (PaUint32 *)destinationBuffer; - PaUint32 *src = (PaUint32 *)sourceBuffer; - - (void) ditherGenerator; /* unused parameter */ - - while( count-- ) - { - *dest = *src; - - src += sourceStride; - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -PaUtilConverterTable paConverters = { - Float32_To_Int32, /* PaUtilConverter *Float32_To_Int32; */ - Float32_To_Int32_Dither, /* PaUtilConverter *Float32_To_Int32_Dither; */ - Float32_To_Int32_Clip, /* PaUtilConverter *Float32_To_Int32_Clip; */ - Float32_To_Int32_DitherClip, /* PaUtilConverter *Float32_To_Int32_DitherClip; */ - - Float32_To_Int24, /* PaUtilConverter *Float32_To_Int24; */ - Float32_To_Int24_Dither, /* PaUtilConverter *Float32_To_Int24_Dither; */ - Float32_To_Int24_Clip, /* PaUtilConverter *Float32_To_Int24_Clip; */ - Float32_To_Int24_DitherClip, /* PaUtilConverter *Float32_To_Int24_DitherClip; */ - - Float32_To_Int16, /* PaUtilConverter *Float32_To_Int16; */ - Float32_To_Int16_Dither, /* PaUtilConverter *Float32_To_Int16_Dither; */ - Float32_To_Int16_Clip, /* PaUtilConverter *Float32_To_Int16_Clip; */ - Float32_To_Int16_DitherClip, /* PaUtilConverter *Float32_To_Int16_DitherClip; */ - - Float32_To_Int8, /* PaUtilConverter *Float32_To_Int8; */ - Float32_To_Int8_Dither, /* PaUtilConverter *Float32_To_Int8_Dither; */ - Float32_To_Int8_Clip, /* PaUtilConverter *Float32_To_Int8_Clip; */ - Float32_To_Int8_DitherClip, /* PaUtilConverter *Float32_To_Int8_DitherClip; */ - - Float32_To_UInt8, /* PaUtilConverter *Float32_To_UInt8; */ - Float32_To_UInt8_Dither, /* PaUtilConverter *Float32_To_UInt8_Dither; */ - Float32_To_UInt8_Clip, /* PaUtilConverter *Float32_To_UInt8_Clip; */ - Float32_To_UInt8_DitherClip, /* PaUtilConverter *Float32_To_UInt8_DitherClip; */ - - Int32_To_Float32, /* PaUtilConverter *Int32_To_Float32; */ - Int32_To_Int24, /* PaUtilConverter *Int32_To_Int24; */ - Int32_To_Int24_Dither, /* PaUtilConverter *Int32_To_Int24_Dither; */ - Int32_To_Int16, /* PaUtilConverter *Int32_To_Int16; */ - Int32_To_Int16_Dither, /* PaUtilConverter *Int32_To_Int16_Dither; */ - Int32_To_Int8, /* PaUtilConverter *Int32_To_Int8; */ - Int32_To_Int8_Dither, /* PaUtilConverter *Int32_To_Int8_Dither; */ - Int32_To_UInt8, /* PaUtilConverter *Int32_To_UInt8; */ - Int32_To_UInt8_Dither, /* PaUtilConverter *Int32_To_UInt8_Dither; */ - - Int24_To_Float32, /* PaUtilConverter *Int24_To_Float32; */ - Int24_To_Int32, /* PaUtilConverter *Int24_To_Int32; */ - Int24_To_Int16, /* PaUtilConverter *Int24_To_Int16; */ - Int24_To_Int16_Dither, /* PaUtilConverter *Int24_To_Int16_Dither; */ - Int24_To_Int8, /* PaUtilConverter *Int24_To_Int8; */ - Int24_To_Int8_Dither, /* PaUtilConverter *Int24_To_Int8_Dither; */ - Int24_To_UInt8, /* PaUtilConverter *Int24_To_UInt8; */ - Int24_To_UInt8_Dither, /* PaUtilConverter *Int24_To_UInt8_Dither; */ - - Int16_To_Float32, /* PaUtilConverter *Int16_To_Float32; */ - Int16_To_Int32, /* PaUtilConverter *Int16_To_Int32; */ - Int16_To_Int24, /* PaUtilConverter *Int16_To_Int24; */ - Int16_To_Int8, /* PaUtilConverter *Int16_To_Int8; */ - Int16_To_Int8_Dither, /* PaUtilConverter *Int16_To_Int8_Dither; */ - Int16_To_UInt8, /* PaUtilConverter *Int16_To_UInt8; */ - Int16_To_UInt8_Dither, /* PaUtilConverter *Int16_To_UInt8_Dither; */ - - Int8_To_Float32, /* PaUtilConverter *Int8_To_Float32; */ - Int8_To_Int32, /* PaUtilConverter *Int8_To_Int32; */ - Int8_To_Int24, /* PaUtilConverter *Int8_To_Int24 */ - Int8_To_Int16, /* PaUtilConverter *Int8_To_Int16; */ - Int8_To_UInt8, /* PaUtilConverter *Int8_To_UInt8; */ - - UInt8_To_Float32, /* PaUtilConverter *UInt8_To_Float32; */ - UInt8_To_Int32, /* PaUtilConverter *UInt8_To_Int32; */ - UInt8_To_Int24, /* PaUtilConverter *UInt8_To_Int24; */ - UInt8_To_Int16, /* PaUtilConverter *UInt8_To_Int16; */ - UInt8_To_Int8, /* PaUtilConverter *UInt8_To_Int8; */ - - Copy_8_To_8, /* PaUtilConverter *Copy_8_To_8; */ - Copy_16_To_16, /* PaUtilConverter *Copy_16_To_16; */ - Copy_24_To_24, /* PaUtilConverter *Copy_24_To_24; */ - Copy_32_To_32 /* PaUtilConverter *Copy_32_To_32; */ -}; - -/* -------------------------------------------------------------------------- */ - -#endif /* PA_NO_STANDARD_CONVERTERS */ - -/* -------------------------------------------------------------------------- */ - -PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat ) -{ - switch( destinationFormat & ~paNonInterleaved ){ - case paFloat32: - return paZeroers.Zero32; - case paInt32: - return paZeroers.Zero32; - case paInt24: - return paZeroers.Zero24; - case paInt16: - return paZeroers.Zero16; - case paInt8: - return paZeroers.Zero8; - case paUInt8: - return paZeroers.ZeroU8; - default: return 0; - } -} - -/* -------------------------------------------------------------------------- */ - -#ifdef PA_NO_STANDARD_ZEROERS - -/* -------------------------------------------------------------------------- */ - -PaUtilZeroerTable paZeroers = { - 0, /* PaUtilZeroer *ZeroU8; */ - 0, /* PaUtilZeroer *Zero8; */ - 0, /* PaUtilZeroer *Zero16; */ - 0, /* PaUtilZeroer *Zero24; */ - 0, /* PaUtilZeroer *Zero32; */ -}; - -/* -------------------------------------------------------------------------- */ - -#else /* PA_NO_STANDARD_ZEROERS is not defined */ - -/* -------------------------------------------------------------------------- */ - -static void ZeroU8( void *destinationBuffer, signed int destinationStride, - unsigned int count ) -{ - unsigned char *dest = (unsigned char*)destinationBuffer; - - while( count-- ) - { - *dest = 128; - - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Zero8( void *destinationBuffer, signed int destinationStride, - unsigned int count ) -{ - unsigned char *dest = (unsigned char*)destinationBuffer; - - while( count-- ) - { - *dest = 0; - - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Zero16( void *destinationBuffer, signed int destinationStride, - unsigned int count ) -{ - PaUint16 *dest = (PaUint16 *)destinationBuffer; - - while( count-- ) - { - *dest = 0; - - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Zero24( void *destinationBuffer, signed int destinationStride, - unsigned int count ) -{ - unsigned char *dest = (unsigned char*)destinationBuffer; - - while( count-- ) - { - dest[0] = 0; - dest[1] = 0; - dest[2] = 0; - - dest += destinationStride * 3; - } -} - -/* -------------------------------------------------------------------------- */ - -static void Zero32( void *destinationBuffer, signed int destinationStride, - unsigned int count ) -{ - PaUint32 *dest = (PaUint32 *)destinationBuffer; - - while( count-- ) - { - *dest = 0; - - dest += destinationStride; - } -} - -/* -------------------------------------------------------------------------- */ - -PaUtilZeroerTable paZeroers = { - ZeroU8, /* PaUtilZeroer *ZeroU8; */ - Zero8, /* PaUtilZeroer *Zero8; */ - Zero16, /* PaUtilZeroer *Zero16; */ - Zero24, /* PaUtilZeroer *Zero24; */ - Zero32, /* PaUtilZeroer *Zero32; */ -}; - -/* -------------------------------------------------------------------------- */ - -#endif /* PA_NO_STANDARD_ZEROERS */ diff --git a/portaudio-v19/pa_common/pa_converters.h b/portaudio-v19/pa_common/pa_converters.h deleted file mode 100644 index 1d83c990b..000000000 --- a/portaudio-v19/pa_common/pa_converters.h +++ /dev/null @@ -1,254 +0,0 @@ -#ifndef PA_CONVERTERS_H -#define PA_CONVERTERS_H -/* - * $Id$ - * Portable Audio I/O Library sample conversion mechanism - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Conversion functions used to convert buffers of samples from one - format to another. -*/ - - -#include "portaudio.h" /* for PaSampleFormat */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -struct PaUtilTriangularDitherGenerator; - - -/** Choose an available sample format which is most appropriate for - representing the requested format. If the requested format is not available - higher quality formats are considered before lower quality formates. - @param availableFormats A variable containing the logical OR of all available - formats. - @param format The desired format. - @return The most appropriate available format for representing the requested - format. -*/ -PaSampleFormat PaUtil_SelectClosestAvailableFormat( - PaSampleFormat availableFormats, PaSampleFormat format ); - - -/* high level conversions functions for use by implementations */ - - -/** The generic sample converter prototype. Sample converters convert count - samples from sourceBuffer to destinationBuffer. The actual type of the data - pointed to by these parameters varys for different converter functions. - @param destinationBuffer A pointer to the first sample of the destination. - @param destinationStride An offset between successive destination samples - expressed in samples (not bytes.) It may be negative. - @param sourceBuffer A pointer to the first sample of the source. - @param sourceStride An offset between successive source samples - expressed in samples (not bytes.) It may be negative. - @param count The number of samples to convert. - @param ditherState State information used to calculate dither. Converters - that do not perform dithering will ignore this parameter, in which case - NULL or invalid dither state may be passed. -*/ -typedef void PaUtilConverter( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ); - - -/** Find a sample converter function for the given source and destinations - formats and flags (clip and dither.) - @return - A pointer to a PaUtilConverter which will perform the requested - conversion, or NULL if the given format conversion is not supported. - For conversions where clipping or dithering is not necessary, the - clip and dither flags are ignored and a non-clipping or dithering - version is returned. - If the source and destination formats are the same, a function which - copies data of the appropriate size will be returned. -*/ -PaUtilConverter* PaUtil_SelectConverter( PaSampleFormat sourceFormat, - PaSampleFormat destinationFormat, PaStreamFlags flags ); - - -/** The generic buffer zeroer prototype. Buffer zeroers copy count zeros to - destinationBuffer. The actual type of the data pointed to varys for - different zeroer functions. - @param destinationBuffer A pointer to the first sample of the destination. - @param destinationStride An offset between successive destination samples - expressed in samples (not bytes.) It may be negative. - @param count The number of samples to zero. -*/ -typedef void PaUtilZeroer( - void *destinationBuffer, signed int destinationStride, unsigned int count ); - - -/** Find a buffer zeroer function for the given destination format. - @return - A pointer to a PaUtilZeroer which will perform the requested - zeroing. -*/ -PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat ); - -/*----------------------------------------------------------------------------*/ -/* low level functions and data structures which may be used for - substituting conversion functions */ - - -/** The type used to store all sample conversion functions. - @see paConverters; -*/ -typedef struct{ - PaUtilConverter *Float32_To_Int32; - PaUtilConverter *Float32_To_Int32_Dither; - PaUtilConverter *Float32_To_Int32_Clip; - PaUtilConverter *Float32_To_Int32_DitherClip; - - PaUtilConverter *Float32_To_Int24; - PaUtilConverter *Float32_To_Int24_Dither; - PaUtilConverter *Float32_To_Int24_Clip; - PaUtilConverter *Float32_To_Int24_DitherClip; - - PaUtilConverter *Float32_To_Int16; - PaUtilConverter *Float32_To_Int16_Dither; - PaUtilConverter *Float32_To_Int16_Clip; - PaUtilConverter *Float32_To_Int16_DitherClip; - - PaUtilConverter *Float32_To_Int8; - PaUtilConverter *Float32_To_Int8_Dither; - PaUtilConverter *Float32_To_Int8_Clip; - PaUtilConverter *Float32_To_Int8_DitherClip; - - PaUtilConverter *Float32_To_UInt8; - PaUtilConverter *Float32_To_UInt8_Dither; - PaUtilConverter *Float32_To_UInt8_Clip; - PaUtilConverter *Float32_To_UInt8_DitherClip; - - PaUtilConverter *Int32_To_Float32; - PaUtilConverter *Int32_To_Int24; - PaUtilConverter *Int32_To_Int24_Dither; - PaUtilConverter *Int32_To_Int16; - PaUtilConverter *Int32_To_Int16_Dither; - PaUtilConverter *Int32_To_Int8; - PaUtilConverter *Int32_To_Int8_Dither; - PaUtilConverter *Int32_To_UInt8; - PaUtilConverter *Int32_To_UInt8_Dither; - - PaUtilConverter *Int24_To_Float32; - PaUtilConverter *Int24_To_Int32; - PaUtilConverter *Int24_To_Int16; - PaUtilConverter *Int24_To_Int16_Dither; - PaUtilConverter *Int24_To_Int8; - PaUtilConverter *Int24_To_Int8_Dither; - PaUtilConverter *Int24_To_UInt8; - PaUtilConverter *Int24_To_UInt8_Dither; - - PaUtilConverter *Int16_To_Float32; - PaUtilConverter *Int16_To_Int32; - PaUtilConverter *Int16_To_Int24; - PaUtilConverter *Int16_To_Int8; - PaUtilConverter *Int16_To_Int8_Dither; - PaUtilConverter *Int16_To_UInt8; - PaUtilConverter *Int16_To_UInt8_Dither; - - PaUtilConverter *Int8_To_Float32; - PaUtilConverter *Int8_To_Int32; - PaUtilConverter *Int8_To_Int24; - PaUtilConverter *Int8_To_Int16; - PaUtilConverter *Int8_To_UInt8; - - PaUtilConverter *UInt8_To_Float32; - PaUtilConverter *UInt8_To_Int32; - PaUtilConverter *UInt8_To_Int24; - PaUtilConverter *UInt8_To_Int16; - PaUtilConverter *UInt8_To_Int8; - - PaUtilConverter *Copy_8_To_8; /* copy without any conversion */ - PaUtilConverter *Copy_16_To_16; /* copy without any conversion */ - PaUtilConverter *Copy_24_To_24; /* copy without any conversion */ - PaUtilConverter *Copy_32_To_32; /* copy without any conversion */ -} PaUtilConverterTable; - - -/** A table of pointers to all required converter functions. - PaUtil_SelectConverter() uses this table to lookup the appropriate - conversion functions. The fields of this structure are initialized - with default conversion functions. Fields may be NULL, indicating that - no conversion function is available. User code may substitue optimised - conversion functions by assigning different function pointers to - these fields. - - @note - If the PA_NO_STANDARD_CONVERTERS preprocessor variable is defined, - PortAudio's standard converters will not be compiled, and all fields - of this structure will be initialized to NULL. In such cases, users - should supply their own conversion functions if the require PortAudio - to open a stream that requires sample conversion. - - @see PaUtilConverterTable, PaUtilConverter, PaUtil_SelectConverter -*/ -extern PaUtilConverterTable paConverters; - - -/** The type used to store all buffer zeroing functions. - @see paZeroers; -*/ -typedef struct{ - PaUtilZeroer *ZeroU8; /* unsigned 8 bit, zero == 128 */ - PaUtilZeroer *Zero8; - PaUtilZeroer *Zero16; - PaUtilZeroer *Zero24; - PaUtilZeroer *Zero32; -} PaUtilZeroerTable; - - -/** A table of pointers to all required zeroer functions. - PaUtil_SelectZeroer() uses this table to lookup the appropriate - conversion functions. The fields of this structure are initialized - with default conversion functions. User code may substitue optimised - conversion functions by assigning different function pointers to - these fields. - - @note - If the PA_NO_STANDARD_ZEROERS preprocessor variable is defined, - PortAudio's standard zeroers will not be compiled, and all fields - of this structure will be initialized to NULL. In such cases, users - should supply their own zeroing functions for the sample sizes which - they intend to use. - - @see PaUtilZeroerTable, PaUtilZeroer, PaUtil_SelectZeroer -*/ -extern PaUtilZeroerTable paZeroers; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_CONVERTERS_H */ diff --git a/portaudio-v19/pa_common/pa_cpuload.c b/portaudio-v19/pa_common/pa_cpuload.c deleted file mode 100644 index ee2147dc3..000000000 --- a/portaudio-v19/pa_common/pa_cpuload.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * $Id$ - * Portable Audio I/O Library CPU Load measurement functions - * Portable CPU load measurement facility. - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 2002 Ross Bencina - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Functions to assist in measuring the CPU utilization of a callback - stream. Used to implement the Pa_GetStreamCpuLoad() function. - - @todo Dynamically calculate the coefficients used to smooth the CPU Load - Measurements over time to provide a uniform characterisation of CPU Load - independent of rate at which PaUtil_BeginCpuLoadMeasurement / - PaUtil_EndCpuLoadMeasurement are called. -*/ - - -#include "pa_cpuload.h" - -#include - -#include "pa_util.h" /* for PaUtil_GetTime() */ - - -void PaUtil_InitializeCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer, double sampleRate ) -{ - assert( sampleRate > 0 ); - - measurer->samplingPeriod = 1. / sampleRate; - measurer->averageLoad = 0.; -} - -void PaUtil_ResetCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer ) -{ - measurer->averageLoad = 0.; -} - -void PaUtil_BeginCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer ) -{ - measurer->measurementStartTime = PaUtil_GetTime(); -} - - -void PaUtil_EndCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer, unsigned long framesProcessed ) -{ - double measurementEndTime, secondsFor100Percent, measuredLoad; - - if( framesProcessed > 0 ){ - measurementEndTime = PaUtil_GetTime(); - - assert( framesProcessed > 0 ); - secondsFor100Percent = framesProcessed * measurer->samplingPeriod; - - measuredLoad = (measurementEndTime - measurer->measurementStartTime) / secondsFor100Percent; - - /* Low pass filter the calculated CPU load to reduce jitter using a simple IIR low pass filter. */ - /** FIXME @todo these coefficients shouldn't be hardwired */ -#define LOWPASS_COEFFICIENT_0 (0.9) -#define LOWPASS_COEFFICIENT_1 (0.99999 - LOWPASS_COEFFICIENT_0) - - measurer->averageLoad = (LOWPASS_COEFFICIENT_0 * measurer->averageLoad) + - (LOWPASS_COEFFICIENT_1 * measuredLoad); - } -} - - -double PaUtil_GetCpuLoad( PaUtilCpuLoadMeasurer* measurer ) -{ - return measurer->averageLoad; -} diff --git a/portaudio-v19/pa_common/pa_cpuload.h b/portaudio-v19/pa_common/pa_cpuload.h deleted file mode 100644 index 131ad10bd..000000000 --- a/portaudio-v19/pa_common/pa_cpuload.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef PA_CPULOAD_H -#define PA_CPULOAD_H -/* - * $Id$ - * Portable Audio I/O Library CPU Load measurement functions - * Portable CPU load measurement facility. - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 2002 Ross Bencina - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Functions to assist in measuring the CPU utilization of a callback - stream. Used to implement the Pa_GetStreamCpuLoad() function. -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -typedef struct { - double samplingPeriod; - double measurementStartTime; - double averageLoad; -} PaUtilCpuLoadMeasurer; /**< @todo need better name than measurer */ - -void PaUtil_InitializeCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer, double sampleRate ); -void PaUtil_BeginCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer ); -void PaUtil_EndCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer, unsigned long framesProcessed ); -void PaUtil_ResetCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer ); -double PaUtil_GetCpuLoad( PaUtilCpuLoadMeasurer* measurer ); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_CPULOAD_H */ diff --git a/portaudio-v19/pa_common/pa_dither.c b/portaudio-v19/pa_common/pa_dither.c deleted file mode 100644 index d44a060cd..000000000 --- a/portaudio-v19/pa_common/pa_dither.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * $Id$ - * Portable Audio I/O Library triangular dither generator - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Functions for generating dither noise -*/ - - -#include "pa_dither.h" -#include "pa_types.h" - -#define PA_DITHER_BITS_ (15) - - -void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *state ) -{ - state->previous = 0; - state->randSeed1 = 22222; - state->randSeed2 = 5555555; -} - - -signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *state ) -{ - signed long current, highPass; - - /* Generate two random numbers. */ - state->randSeed1 = (state->randSeed1 * 196314165) + 907633515; - state->randSeed2 = (state->randSeed2 * 196314165) + 907633515; - - /* Generate triangular distribution about 0. - * Shift before adding to prevent overflow which would skew the distribution. - * Also shift an extra bit for the high pass filter. - */ -#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) - current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + - (((signed long)state->randSeed2)>>DITHER_SHIFT_); - - /* High pass filter to reduce audibility. */ - highPass = current - state->previous; - state->previous = current; - return highPass; -} - - -/* Multiply by PA_FLOAT_DITHER_SCALE_ to get a float between -2.0 and +1.99999 */ -#define PA_FLOAT_DITHER_SCALE_ (1.0f / ((1<randSeed1 = (state->randSeed1 * 196314165) + 907633515; - state->randSeed2 = (state->randSeed2 * 196314165) + 907633515; - - /* Generate triangular distribution about 0. - * Shift before adding to prevent overflow which would skew the distribution. - * Also shift an extra bit for the high pass filter. - */ -#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) - current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + - (((signed long)state->randSeed2)>>DITHER_SHIFT_); - - /* High pass filter to reduce audibility. */ - highPass = current - state->previous; - state->previous = current; - return ((float)highPass) * const_float_dither_scale_; -} - - -/* -The following alternate dither algorithms (from musicdsp.org) could be -considered -*/ - -/*Noise shaped dither (March 2000) -------------------- - -This is a simple implementation of highpass triangular-PDF dither with -2nd-order noise shaping, for use when truncating floating point audio -data to fixed point. - -The noise shaping lowers the noise floor by 11dB below 5kHz (@ 44100Hz -sample rate) compared to triangular-PDF dither. The code below assumes -input data is in the range +1 to -1 and doesn't check for overloads! - -To save time when generating dither for multiple channels you can do -things like this: r3=(r1 & 0x7F)<<8; instead of calling rand() again. - - - - int r1, r2; //rectangular-PDF random numbers - float s1, s2; //error feedback buffers - float s = 0.5f; //set to 0.0f for no noise shaping - float w = pow(2.0,bits-1); //word length (usually bits=16) - float wi= 1.0f/w; - float d = wi / RAND_MAX; //dither amplitude (2 lsb) - float o = wi * 0.5f; //remove dc offset - float in, tmp; - int out; - - -//for each sample... - - r2=r1; //can make HP-TRI dither by - r1=rand(); //subtracting previous rand() - - in += s * (s1 + s1 - s2); //error feedback - tmp = in + o + d * (float)(r1 - r2); //dc offset and dither - - out = (int)(w * tmp); //truncate downwards - if(tmp<0.0f) out--; //this is faster than floor() - - s2 = s1; - s1 = in - wi * (float)out; //error - - - --- -paul.kellett@maxim.abel.co.uk -http://www.maxim.abel.co.uk -*/ - - -/* -16-to-8-bit first-order dither - -Type : First order error feedforward dithering code -References : Posted by Jon Watte - -Notes : -This is about as simple a dithering algorithm as you can implement, but it's -likely to sound better than just truncating to N bits. - -Note that you might not want to carry forward the full difference for infinity. -It's probably likely that the worst performance hit comes from the saturation -conditionals, which can be avoided with appropriate instructions on many DSPs -and integer SIMD type instructions, or CMOV. - -Last, if sound quality is paramount (such as when going from > 16 bits to 16 -bits) you probably want to use a higher-order dither function found elsewhere -on this site. - - -Code : -// This code will down-convert and dither a 16-bit signed short -// mono signal into an 8-bit unsigned char signal, using a first -// order forward-feeding error term dither. - -#define uchar unsigned char - -void dither_one_channel_16_to_8( short * input, uchar * output, int count, int * memory ) -{ - int m = *memory; - while( count-- > 0 ) { - int i = *input++; - i += m; - int j = i + 32768 - 128; - uchar o; - if( j < 0 ) { - o = 0; - } - else if( j > 65535 ) { - o = 255; - } - else { - o = (uchar)((j>>8)&0xff); - } - m = ((j-32768+128)-i); - *output++ = o; - } - *memory = m; -} -*/ diff --git a/portaudio-v19/pa_common/pa_dither.h b/portaudio-v19/pa_common/pa_dither.h deleted file mode 100644 index 148db275f..000000000 --- a/portaudio-v19/pa_common/pa_dither.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef PA_DITHER_H -#define PA_DITHER_H -/* - * $Id$ - * Portable Audio I/O Library triangular dither generator - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Functions for generating dither noise -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -/** @brief State needed to generate a dither signal */ -typedef struct PaUtilTriangularDitherGenerator{ - unsigned long previous; - unsigned long randSeed1; - unsigned long randSeed2; -} PaUtilTriangularDitherGenerator; - - -/** @brief Initialize dither state */ -void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *ditherState ); - - -/** - @brief Calculate 2 LSB dither signal with a triangular distribution. - Ranged for adding to a 1 bit right-shifted 32 bit integer - prior to >>15. eg: -
    -    signed long in = *
    -    signed long dither = PaUtil_Generate16BitTriangularDither( ditherState );
    -    signed short out = (signed short)(((in>>1) + dither) >> 15);
    -
    - @return - A signed long with a range of +32767 to -32768 -*/ -signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); - - -/** - @brief Calculate 2 LSB dither signal with a triangular distribution. - Ranged for adding to a pre-scaled float. -
    -    float in = *
    -    float dither = PaUtil_GenerateFloatTriangularDither( ditherState );
    -    // use smaller scaler to prevent overflow when we add the dither
    -    signed short out = (signed short)(in*(32766.0f) + dither );
    -
    - @return - A float with a range of -2.0 to +1.99999. -*/ -float PaUtil_GenerateFloatTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_DITHER_H */ diff --git a/portaudio-v19/pa_common/pa_endianness.h b/portaudio-v19/pa_common/pa_endianness.h deleted file mode 100644 index 3a573929b..000000000 --- a/portaudio-v19/pa_common/pa_endianness.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef PA_ENDIANNESS_H -#define PA_ENDIANNESS_H -/* - * $Id$ - * Portable Audio I/O Library current platform endianness macros - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Configure endianness symbols for the target processor. - - Arrange for either the PA_LITTLE_ENDIAN or PA_BIG_ENDIAN preprocessor symbols - to be defined. The one that is defined reflects the endianness of the target - platform and may be used to implement conditional compilation of byte-order - dependent code. - - If either PA_LITTLE_ENDIAN or PA_BIG_ENDIAN is defined already, then no attempt - is made to override that setting. This may be useful if you have a better way - of determining the platform's endianness. The autoconf mechanism uses this for - example. - - A PA_VALIDATE_ENDIANNESS macro is provided to compare the compile time - and runtime endiannes and raise an assertion if they don't match. -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -#if defined(PA_LITTLE_ENDIAN) || defined(PA_BIG_ENDIAN) - /* endianness define has been set externally, such as by autoconf */ - - #if defined(PA_LITTLE_ENDIAN) && defined(PA_BIG_ENDIAN) - #error both PA_LITTLE_ENDIAN and PA_BIG_ENDIAN have been defined externally to pa_endianness.h - only one endianness at a time please - #endif - -#else - /* endianness define has not been set externally */ - - /* set PA_LITTLE_ENDIAN or PA_BIG_ENDIAN by testing well known platform specific defines */ - - #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) - - #define PA_LITTLE_ENDIAN /* win32, assume intel byte order */ - - #else - -#endif - - #if !defined(PA_LITTLE_ENDIAN) && !defined(PA_BIG_ENDIAN) - /* - If the following error is raised, you either need to modify the code above - to automatically determine the endianness from other symbols defined on your - platform, or define either PA_LITTLE_ENDIAN or PA_BIG_ENDIAN externally. - */ - #error pa_endianness.h was unable to automatically determine the endianness of the target platform - #endif - -#endif - -/* PA_VALIDATE_ENDIANNESS compares the compile time and runtime endianness, - and raises an assertion if they don't match. must be included in - the context in which this macro is used. -*/ -#if defined(PA_LITTLE_ENDIAN) - #define PA_VALIDATE_ENDIANNESS \ - { \ - const long nativeOne = 1; \ - assert( "PortAudio: compile time and runtime endianness don't match" && (((char *)&nativeOne)[0]) == 1 ); \ - } -#elif defined(PA_BIG_ENDIAN) - #define PA_VALIDATE_ENDIANNESS \ - { \ - const long nativeOne = 1; \ - assert( "PortAudio: compile time and runtime endianness don't match" && (((char *)&nativeOne)[0]) == 0 ); \ - } -#endif - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_ENDIANNESS_H */ diff --git a/portaudio-v19/pa_common/pa_front.c b/portaudio-v19/pa_common/pa_front.c deleted file mode 100644 index f330008a7..000000000 --- a/portaudio-v19/pa_common/pa_front.c +++ /dev/null @@ -1,1978 +0,0 @@ -/* - * $Id$ - * Portable Audio I/O Library Multi-Host API front end - * Validate function parameters and manage multiple host APIs. - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Ross Bencina, Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/* doxygen index page */ -/** @mainpage - -PortAudio is an open-source cross-platform ‘C’ library for audio input -and output. It is designed to simplify the porting of audio applications -between various platforms, and also to simplify the development of audio -software in general by hiding the complexities of device interfacing. - -See the PortAudio website for further information http://www.portaudio.com/ - -This documentation pertains to PortAudio V19, API version 2.0 which is -currently under development. API version 2.0 differs in a number of ways from -previous versions, please consult the enhancement proposals for further details: -http://www.portaudio.com/docs/proposals/index.html - -This documentation is under construction. Things you might be interested in -include: - -- The PortAudio API 2.0, as documented in portaudio.h - -- The TODO List - -Feel free to pick an item off TODO list and fix/implement it. You may want to -enquire about status on the PortAudio mailing list first. -*/ - - -/** @file - @brief Implements public PortAudio API, checks some errors, forwards to - host API implementations. - - Implements the functions defined in the PortAudio API, checks for - some parameter and state inconsistencies and forwards API requests to - specific Host API implementations (via the interface declared in - pa_hostapi.h), and Streams (via the interface declared in pa_stream.h). - - This file handles initialization and termination of Host API - implementations via initializers stored in the paHostApiInitializers - global variable. - - Some utility functions declared in pa_util.h are implemented in this file. - - All PortAudio API functions can be conditionally compiled with logging code. - To compile with logging, define the PA_LOG_API_CALLS precompiler symbol. - - @todo Consider adding host API specific error text in Pa_GetErrorText() for - paUnanticipatedHostError - - @todo Consider adding a new error code for when (inputParameters == NULL) - && (outputParameters == NULL) - - @todo review whether Pa_CloseStream() should call the interface's - CloseStream function if aborting the stream returns an error code. - - @todo Create new error codes if a NULL buffer pointer, or a - zero frame count is passed to Pa_ReadStream or Pa_WriteStream. -*/ - - -#include -#include -#include -#include -#include /* needed by PA_VALIDATE_ENDIANNESS */ - -#include "portaudio.h" -#include "pa_util.h" -#include "pa_endianness.h" -#include "pa_types.h" -#include "pa_hostapi.h" -#include "pa_stream.h" - -#include "pa_trace.h" - - -#define PA_VERSION_ 1899 -#define PA_VERSION_TEXT_ "PortAudio V19-devel" - - - -/* #define PA_LOG_API_CALLS */ - -/* - The basic format for log messages is described below. If you need to - add any log messages, please follow this format. - - Function entry (void function): - - "FunctionName called.\n" - - Function entry (non void function): - - "FunctionName called:\n" - "\tParam1Type param1: param1Value\n" - "\tParam2Type param2: param2Value\n" (etc...) - - - Function exit (no return value): - - "FunctionName returned.\n" - - Function exit (simple return value): - - "FunctionName returned:\n" - "\tReturnType: returnValue\n\n" - - If the return type is an error code, the error text is displayed in () - - If the return type is not an error code, but has taken a special value - because an error occurred, then the reason for the error is shown in [] - - If the return type is a struct ptr, the struct is dumped. - - See the code below for examples -*/ - - -int Pa_GetVersion( void ) -{ - return PA_VERSION_; -} - - -const char* Pa_GetVersionText( void ) -{ - return PA_VERSION_TEXT_; -} - - - -#define PA_LAST_HOST_ERROR_TEXT_LENGTH_ 1024 - -static char lastHostErrorText_[ PA_LAST_HOST_ERROR_TEXT_LENGTH_ + 1 ] = {0}; - -static PaHostErrorInfo lastHostErrorInfo_ = { (PaHostApiTypeId)-1, 0, lastHostErrorText_ }; - - -void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode, - const char *errorText ) -{ - lastHostErrorInfo_.hostApiType = hostApiType; - lastHostErrorInfo_.errorCode = errorCode; - - strncpy( lastHostErrorText_, errorText, PA_LAST_HOST_ERROR_TEXT_LENGTH_ ); -} - - -void PaUtil_DebugPrint( const char *format, ... ) -{ - va_list ap; - - va_start( ap, format ); - vfprintf( stderr, format, ap ); - va_end( ap ); - - fflush( stderr ); -} - - -static PaUtilHostApiRepresentation **hostApis_ = 0; -static int hostApisCount_ = 0; -static int initializationCount_ = 0; -static int deviceCount_ = 0; - -PaUtilStreamRepresentation *firstOpenStream_ = NULL; - - -#define PA_IS_INITIALISED_ (initializationCount_ != 0) - - -static int CountHostApiInitializers( void ) -{ - int result = 0; - - while( paHostApiInitializers[ result ] != 0 ) - ++result; - return result; -} - - -static void TerminateHostApis( void ) -{ - /* terminate in reverse order from initialization */ - - while( hostApisCount_ > 0 ) - { - --hostApisCount_; - hostApis_[hostApisCount_]->Terminate( hostApis_[hostApisCount_] ); - } - hostApisCount_ = 0; - deviceCount_ = 0; - - if( hostApis_ != 0 ) - PaUtil_FreeMemory( hostApis_ ); - hostApis_ = 0; -} - - -static PaError InitializeHostApis( void ) -{ - PaError result = paNoError; - int i, initializerCount, baseDeviceIndex; - - initializerCount = CountHostApiInitializers(); - - hostApis_ = (PaUtilHostApiRepresentation**)PaUtil_AllocateMemory( - sizeof(PaUtilHostApiRepresentation*) * initializerCount ); - if( !hostApis_ ) - { - result = paInsufficientMemory; - goto error; - } - - hostApisCount_ = 0; - deviceCount_ = 0; - baseDeviceIndex = 0; - - for( i=0; i< initializerCount; ++i ) - { - hostApis_[hostApisCount_] = NULL; - result = paHostApiInitializers[i]( &hostApis_[hostApisCount_], hostApisCount_ ); - if( result != paNoError ) - goto error; - - if( hostApis_[hostApisCount_] ) - { - - hostApis_[hostApisCount_]->privatePaFrontInfo.baseDeviceIndex = baseDeviceIndex; - - if( hostApis_[hostApisCount_]->info.defaultInputDevice != paNoDevice ) - hostApis_[hostApisCount_]->info.defaultInputDevice += baseDeviceIndex; - - if( hostApis_[hostApisCount_]->info.defaultOutputDevice != paNoDevice ) - hostApis_[hostApisCount_]->info.defaultOutputDevice += baseDeviceIndex; - - baseDeviceIndex += hostApis_[hostApisCount_]->info.deviceCount; - deviceCount_ += hostApis_[hostApisCount_]->info.deviceCount; - - ++hostApisCount_; - } - } - - return result; - -error: - TerminateHostApis(); - return result; -} - - -/* - FindHostApi() finds the index of the host api to which - belongs and returns it. if is - non-null, the host specific device index is returned in it. - returns -1 if is out of range. - -*/ -static int FindHostApi( PaDeviceIndex device, int *hostSpecificDeviceIndex ) -{ - int i=0; - - if( !PA_IS_INITIALISED_ ) - return -1; - - if( device < 0 ) - return -1; - - while( i < hostApisCount_ - && device >= hostApis_[i]->info.deviceCount ) - { - - device -= hostApis_[i]->info.deviceCount; - ++i; - } - - if( i >= hostApisCount_ ) - return -1; - - if( hostSpecificDeviceIndex ) - *hostSpecificDeviceIndex = device; - - return i; -} - - -static void AddOpenStream( PaStream* stream ) -{ - ((PaUtilStreamRepresentation*)stream)->nextOpenStream = firstOpenStream_; - firstOpenStream_ = (PaUtilStreamRepresentation*)stream; -} - - -static void RemoveOpenStream( PaStream* stream ) -{ - PaUtilStreamRepresentation *previous = NULL; - PaUtilStreamRepresentation *current = firstOpenStream_; - - while( current != NULL ) - { - if( ((PaStream*)current) == stream ) - { - if( previous == NULL ) - { - firstOpenStream_ = current->nextOpenStream; - } - else - { - previous->nextOpenStream = current->nextOpenStream; - } - return; - } - else - { - previous = current; - current = current->nextOpenStream; - } - } -} - - -static void CloseOpenStreams( void ) -{ - /* we call Pa_CloseStream() here to ensure that the same destruction - logic is used for automatically closed streams */ - - while( firstOpenStream_ != NULL ) - Pa_CloseStream( firstOpenStream_ ); -} - - -PaError Pa_Initialize( void ) -{ - PaError result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint( "Pa_Initialize called.\n" ); -#endif - - if( PA_IS_INITIALISED_ ) - { - ++initializationCount_; - result = paNoError; - } - else - { - PA_VALIDATE_TYPE_SIZES; - PA_VALIDATE_ENDIANNESS; - - PaUtil_InitializeClock(); - PaUtil_ResetTraceMessages(); - - result = InitializeHostApis(); - if( result == paNoError ) - ++initializationCount_; - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint( "Pa_Initialize returned:\n" ); - PaUtil_DebugPrint( "\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError Pa_Terminate( void ) -{ - PaError result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_Terminate called.\n" ); -#endif - - if( PA_IS_INITIALISED_ ) - { - if( --initializationCount_ == 0 ) - { - CloseOpenStreams(); - - TerminateHostApis(); - - PaUtil_DumpTraceMessages(); - } - result = paNoError; - } - else - { - result= paNotInitialized; - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_Terminate returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ) -{ - return &lastHostErrorInfo_; -} - - -const char *Pa_GetErrorText( PaError errorCode ) -{ - const char *result; - - switch( errorCode ) - { - case paNoError: result = "Success"; break; - case paNotInitialized: result = "PortAudio not initialized"; break; - /** @todo could catenate the last host error text to result in the case of paUnanticipatedHostError */ - case paUnanticipatedHostError: result = "Unanticipated host error"; break; - case paInvalidChannelCount: result = "Invalid number of channels"; break; - case paInvalidSampleRate: result = "Invalid sample rate"; break; - case paInvalidDevice: result = "Invalid device"; break; - case paInvalidFlag: result = "Invalid flag"; break; - case paSampleFormatNotSupported: result = "Sample format not supported"; break; - case paBadIODeviceCombination: result = "Illegal combination of I/O devices"; break; - case paInsufficientMemory: result = "Insufficient memory"; break; - case paBufferTooBig: result = "Buffer too big"; break; - case paBufferTooSmall: result = "Buffer too small"; break; - case paNullCallback: result = "No callback routine specified"; break; - case paBadStreamPtr: result = "Invalid stream pointer"; break; - case paTimedOut: result = "Wait timed out"; break; - case paInternalError: result = "Internal PortAudio error"; break; - case paDeviceUnavailable: result = "Device unavailable"; break; - case paIncompatibleHostApiSpecificStreamInfo: result = "Incompatible host API specific stream info"; break; - case paStreamIsStopped: result = "Stream is stopped"; break; - case paStreamIsNotStopped: result = "Stream is not stopped"; break; - case paInputOverflowed: result = "Input overflowed"; break; - case paOutputUnderflowed: result = "Output underflowed"; break; - case paHostApiNotFound: result = "Host API not found"; break; - case paInvalidHostApi: result = "Invalid host API"; break; - case paCanNotReadFromACallbackStream: result = "Can't read from a callback stream"; break; - case paCanNotWriteToACallbackStream: result = "Can't write to a callback stream"; break; - case paCanNotReadFromAnOutputOnlyStream: result = "Can't read from an output only stream"; break; - case paCanNotWriteToAnInputOnlyStream: result = "Can't write to an input only stream"; break; - default: result = "Illegal error number"; break; - } - return result; -} - - -PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ) -{ - PaHostApiIndex result; - int i; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_HostApiTypeIdToHostApiIndex called:\n" ); - PaUtil_DebugPrint("\tPaHostApiTypeId type: %d\n", type ); -#endif - - if( !PA_IS_INITIALISED_ ) - { - result = paNotInitialized; - } - else - { - result = paHostApiNotFound; - - for( i=0; i < hostApisCount_; ++i ) - { - if( hostApis_[i]->info.type == type ) - { - result = i; - break; - } - } - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_HostApiTypeIdToHostApiIndex returned:\n" ); - if( result < 0 ) - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); - else - PaUtil_DebugPrint("\tPaHostApiIndex: %d\n\n", result ); -#endif - - return result; -} - - -PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **hostApi, - PaHostApiTypeId type ) -{ - PaError result; - int i; - - if( !PA_IS_INITIALISED_ ) - { - result = paNotInitialized; - } - else - { - result = paHostApiNotFound; - - for( i=0; i < hostApisCount_; ++i ) - { - if( hostApis_[i]->info.type == type ) - { - *hostApi = hostApis_[i]; - result = paNoError; - break; - } - } - } - - return result; -} - - -PaError PaUtil_DeviceIndexToHostApiDeviceIndex( - PaDeviceIndex *hostApiDevice, PaDeviceIndex device, struct PaUtilHostApiRepresentation *hostApi ) -{ - PaError result; - PaDeviceIndex x; - - x = device - hostApi->privatePaFrontInfo.baseDeviceIndex; - - if( x < 0 || x >= hostApi->info.deviceCount ) - { - result = paInvalidDevice; - } - else - { - *hostApiDevice = x; - result = paNoError; - } - - return result; -} - - -PaHostApiIndex Pa_GetHostApiCount( void ) -{ - int result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetHostApiCount called.\n" ); -#endif - - if( !PA_IS_INITIALISED_ ) - { - result = paNotInitialized; - } - else - { - result = hostApisCount_; - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetHostApiCount returned:\n" ); - if( result < 0 ) - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); - else - PaUtil_DebugPrint("\tPaHostApiIndex %d\n\n", result ); -#endif - - return result; -} - - -PaHostApiIndex Pa_GetDefaultHostApi( void ) -{ - int result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDefaultHostApi called.\n" ); -#endif - - if( !PA_IS_INITIALISED_ ) - { - result = paNotInitialized; - } - else - { - result = paDefaultHostApiIndex; - - /* internal consistency check: make sure that the default host api - index is within range */ - - if( result < 0 || result >= hostApisCount_ ) - { - result = paInternalError; - } - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDefaultHostApi returned:\n" ); - if( result < 0 ) - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); - else - PaUtil_DebugPrint("\tPaHostApiIndex %d\n\n", result ); -#endif - - return result; -} - - -const PaHostApiInfo* Pa_GetHostApiInfo( PaHostApiIndex hostApi ) -{ - PaHostApiInfo *info; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetHostApiInfo called:\n" ); - PaUtil_DebugPrint("\tPaHostApiIndex hostApi: %d\n", hostApi ); -#endif - - if( !PA_IS_INITIALISED_ ) - { - info = NULL; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetHostApiInfo returned:\n" ); - PaUtil_DebugPrint("\tPaHostApiInfo*: NULL [ PortAudio not initialized ]\n\n" ); -#endif - - } - else if( hostApi < 0 || hostApi >= hostApisCount_ ) - { - info = NULL; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetHostApiInfo returned:\n" ); - PaUtil_DebugPrint("\tPaHostApiInfo*: NULL [ hostApi out of range ]\n\n" ); -#endif - - } - else - { - info = &hostApis_[hostApi]->info; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetHostApiInfo returned:\n" ); - PaUtil_DebugPrint("\tPaHostApiInfo*: 0x%p\n", info ); - PaUtil_DebugPrint("\t{" ); - PaUtil_DebugPrint("\t\tint structVersion: %d\n", info->structVersion ); - PaUtil_DebugPrint("\t\tPaHostApiTypeId type: %d\n", info->type ); - PaUtil_DebugPrint("\t\tconst char *name: %s\n\n", info->name ); - PaUtil_DebugPrint("\t}\n\n" ); -#endif - - } - - return info; -} - - -PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, int hostApiDeviceIndex ) -{ - PaDeviceIndex result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_HostApiDeviceIndexToPaDeviceIndex called:\n" ); - PaUtil_DebugPrint("\tPaHostApiIndex hostApi: %d\n", hostApi ); - PaUtil_DebugPrint("\tint hostApiDeviceIndex: %d\n", hostApiDeviceIndex ); -#endif - - if( !PA_IS_INITIALISED_ ) - { - result = paNotInitialized; - } - else - { - if( hostApi < 0 || hostApi >= hostApisCount_ ) - { - result = paInvalidHostApi; - } - else - { - if( hostApiDeviceIndex < 0 || - hostApiDeviceIndex >= hostApis_[hostApi]->info.deviceCount ) - { - result = paInvalidDevice; - } - else - { - result = hostApis_[hostApi]->privatePaFrontInfo.baseDeviceIndex + hostApiDeviceIndex; - } - } - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_HostApiDeviceIndexToPaDeviceIndex returned:\n" ); - if( result < 0 ) - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); - else - PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); -#endif - - return result; -} - - -PaDeviceIndex Pa_GetDeviceCount( void ) -{ - PaDeviceIndex result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDeviceCount called.\n" ); -#endif - - if( !PA_IS_INITIALISED_ ) - { - result = paNotInitialized; - } - else - { - result = deviceCount_; - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDeviceCount returned:\n" ); - if( result < 0 ) - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); - else - PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); -#endif - - return result; -} - - -PaDeviceIndex Pa_GetDefaultInputDevice( void ) -{ - PaHostApiIndex hostApi; - PaDeviceIndex result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDefaultInputDevice called.\n" ); -#endif - - hostApi = Pa_GetDefaultHostApi(); - if( hostApi < 0 ) - { - result = paNoDevice; - } - else - { - result = hostApis_[hostApi]->info.defaultInputDevice; - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDefaultInputDevice returned:\n" ); - PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); -#endif - - return result; -} - - -PaDeviceIndex Pa_GetDefaultOutputDevice( void ) -{ - PaHostApiIndex hostApi; - PaDeviceIndex result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDefaultOutputDevice called.\n" ); -#endif - - hostApi = Pa_GetDefaultHostApi(); - if( hostApi < 0 ) - { - result = paNoDevice; - } - else - { - result = hostApis_[hostApi]->info.defaultOutputDevice; - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDefaultOutputDevice returned:\n" ); - PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); -#endif - - return result; -} - - -const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ) -{ - int hostSpecificDeviceIndex; - int hostApiIndex = FindHostApi( device, &hostSpecificDeviceIndex ); - PaDeviceInfo *result; - - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDeviceInfo called:\n" ); - PaUtil_DebugPrint("\tPaDeviceIndex device: %d\n", device ); -#endif - - if( hostApiIndex < 0 ) - { - result = NULL; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDeviceInfo returned:\n" ); - PaUtil_DebugPrint("\tPaDeviceInfo* NULL [ invalid device index ]\n\n" ); -#endif - - } - else - { - result = hostApis_[hostApiIndex]->deviceInfos[ hostSpecificDeviceIndex ]; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetDeviceInfo returned:\n" ); - PaUtil_DebugPrint("\tPaDeviceInfo*: 0x%p:\n", result ); - PaUtil_DebugPrint("\t{\n" ); - - PaUtil_DebugPrint("\t\tint structVersion: %d\n", result->structVersion ); - PaUtil_DebugPrint("\t\tconst char *name: %s\n", result->name ); - PaUtil_DebugPrint("\t\tPaHostApiIndex hostApi: %d\n", result->hostApi ); - PaUtil_DebugPrint("\t\tint maxInputChannels: %d\n", result->maxInputChannels ); - PaUtil_DebugPrint("\t\tint maxOutputChannels: %d\n", result->maxOutputChannels ); - PaUtil_DebugPrint("\t}\n\n" ); -#endif - - } - - return result; -} - - -/* - SampleFormatIsValid() returns 1 if sampleFormat is a sample format - defined in portaudio.h, or 0 otherwise. -*/ -static int SampleFormatIsValid( PaSampleFormat format ) -{ - switch( format & ~paNonInterleaved ) - { - case paFloat32: return 1; - case paInt16: return 1; - case paInt32: return 1; - case paInt24: return 1; - case paInt8: return 1; - case paUInt8: return 1; - case paCustomFormat: return 1; - default: return 0; - } -} - -/* - NOTE: make sure this validation list is kept syncronised with the one in - pa_hostapi.h - - ValidateOpenStreamParameters() checks that parameters to Pa_OpenStream() - conform to the expected values as described below. This function is - also designed to be used with the proposed Pa_IsFormatSupported() function. - - There are basically two types of validation that could be performed: - Generic conformance validation, and device capability mismatch - validation. This function performs only generic conformance validation. - Validation that would require knowledge of device capabilities is - not performed because of potentially complex relationships between - combinations of parameters - for example, even if the sampleRate - seems ok, it might not be for a duplex stream - we have no way of - checking this in an API-neutral way, so we don't try. - - On success the function returns PaNoError and fills in hostApi, - hostApiInputDeviceID, and hostApiOutputDeviceID fields. On failure - the function returns an error code indicating the first encountered - parameter error. - - - If ValidateOpenStreamParameters() returns paNoError, the following - assertions are guaranteed to be true. - - - at least one of inputParameters & outputParmeters is valid (not NULL) - - - if inputParameters & outputParameters are both valid, that - inputParameters->device & outputParameters->device both use the same host api - - PaDeviceIndex inputParameters->device - - is within range (0 to Pa_GetDeviceCount-1) Or: - - is paUseHostApiSpecificDeviceSpecification and - inputParameters->hostApiSpecificStreamInfo is non-NULL and refers - to a valid host api - - int inputParameters->channelCount - - if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, channelCount is > 0 - - upper bound is NOT validated against device capabilities - - PaSampleFormat inputParameters->sampleFormat - - is one of the sample formats defined in portaudio.h - - void *inputParameters->hostApiSpecificStreamInfo - - if supplied its hostApi field matches the input device's host Api - - PaDeviceIndex outputParmeters->device - - is within range (0 to Pa_GetDeviceCount-1) - - int outputParmeters->channelCount - - if inputDevice is valid, channelCount is > 0 - - upper bound is NOT validated against device capabilities - - PaSampleFormat outputParmeters->sampleFormat - - is one of the sample formats defined in portaudio.h - - void *outputParmeters->hostApiSpecificStreamInfo - - if supplied its hostApi field matches the output device's host Api - - double sampleRate - - is not an 'absurd' rate (less than 1000. or greater than 200000.) - - sampleRate is NOT validated against device capabilities - - PaStreamFlags streamFlags - - unused platform neutral flags are zero - - paNeverDropInput is only used for full-duplex callback streams with - variable buffer size (paFramesPerBufferUnspecified) -*/ -static PaError ValidateOpenStreamParameters( - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - PaUtilHostApiRepresentation **hostApi, - PaDeviceIndex *hostApiInputDevice, - PaDeviceIndex *hostApiOutputDevice ) -{ - int inputHostApiIndex = -1, /* Surpress uninitialised var warnings: compiler does */ - outputHostApiIndex = -1; /* not see that if inputParameters and outputParame- */ - /* ters are both nonzero, these indices are set. */ - - if( (inputParameters == NULL) && (outputParameters == NULL) ) - { - return paInvalidDevice; /** @todo should be a new error code "invalid device parameters" or something */ - } - else - { - if( inputParameters == NULL ) - { - *hostApiInputDevice = paNoDevice; - } - else if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) - { - if( inputParameters->hostApiSpecificStreamInfo ) - { - inputHostApiIndex = Pa_HostApiTypeIdToHostApiIndex( - ((PaUtilHostApiSpecificStreamInfoHeader*)inputParameters->hostApiSpecificStreamInfo)->hostApiType ); - - if( inputHostApiIndex != -1 ) - { - *hostApiInputDevice = paUseHostApiSpecificDeviceSpecification; - *hostApi = hostApis_[inputHostApiIndex]; - } - else - { - return paInvalidDevice; - } - } - else - { - return paInvalidDevice; - } - } - else - { - if( inputParameters->device < 0 || inputParameters->device >= deviceCount_ ) - return paInvalidDevice; - - inputHostApiIndex = FindHostApi( inputParameters->device, hostApiInputDevice ); - if( inputHostApiIndex < 0 ) - return paInternalError; - - *hostApi = hostApis_[inputHostApiIndex]; - - if( inputParameters->channelCount <= 0 ) - return paInvalidChannelCount; - - if( !SampleFormatIsValid( inputParameters->sampleFormat ) ) - return paSampleFormatNotSupported; - - if( inputParameters->hostApiSpecificStreamInfo != NULL ) - { - if( ((PaUtilHostApiSpecificStreamInfoHeader*)inputParameters->hostApiSpecificStreamInfo)->hostApiType - != (*hostApi)->info.type ) - return paIncompatibleHostApiSpecificStreamInfo; - } - } - - if( outputParameters == NULL ) - { - *hostApiOutputDevice = paNoDevice; - } - else if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) - { - if( outputParameters->hostApiSpecificStreamInfo ) - { - outputHostApiIndex = Pa_HostApiTypeIdToHostApiIndex( - ((PaUtilHostApiSpecificStreamInfoHeader*)outputParameters->hostApiSpecificStreamInfo)->hostApiType ); - - if( outputHostApiIndex != -1 ) - { - *hostApiOutputDevice = paUseHostApiSpecificDeviceSpecification; - *hostApi = hostApis_[outputHostApiIndex]; - } - else - { - return paInvalidDevice; - } - } - else - { - return paInvalidDevice; - } - } - else - { - if( outputParameters->device < 0 || outputParameters->device >= deviceCount_ ) - return paInvalidDevice; - - outputHostApiIndex = FindHostApi( outputParameters->device, hostApiOutputDevice ); - if( outputHostApiIndex < 0 ) - return paInternalError; - - *hostApi = hostApis_[outputHostApiIndex]; - - if( outputParameters->channelCount <= 0 ) - return paInvalidChannelCount; - - if( !SampleFormatIsValid( outputParameters->sampleFormat ) ) - return paSampleFormatNotSupported; - - if( outputParameters->hostApiSpecificStreamInfo != NULL ) - { - if( ((PaUtilHostApiSpecificStreamInfoHeader*)outputParameters->hostApiSpecificStreamInfo)->hostApiType - != (*hostApi)->info.type ) - return paIncompatibleHostApiSpecificStreamInfo; - } - } - - if( (inputParameters != NULL) && (outputParameters != NULL) ) - { - /* ensure that both devices use the same API */ - if( inputHostApiIndex != outputHostApiIndex ) - return paBadIODeviceCombination; - } - } - - - /* Check for absurd sample rates. */ - if( (sampleRate < 1000.0) || (sampleRate > 200000.0) ) - return paInvalidSampleRate; - - if( ((streamFlags & ~paPlatformSpecificFlags) & ~(paClipOff | paDitherOff | paNeverDropInput | paPrimeOutputBuffersUsingStreamCallback ) ) != 0 ) - return paInvalidFlag; - - if( streamFlags & paNeverDropInput ) - { - /* must be a callback stream */ - if( !streamCallback ) - return paInvalidFlag; - - /* must be a full duplex stream */ - if( (inputParameters == NULL) || (outputParameters == NULL) ) - return paInvalidFlag; - - /* must use paFramesPerBufferUnspecified */ - if( framesPerBuffer != paFramesPerBufferUnspecified ) - return paInvalidFlag; - } - - return paNoError; -} - - -PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate ) -{ - PaError result; - PaUtilHostApiRepresentation *hostApi; - PaDeviceIndex hostApiInputDevice, hostApiOutputDevice; - PaStreamParameters hostApiInputParameters, hostApiOutputParameters; - PaStreamParameters *hostApiInputParametersPtr, *hostApiOutputParametersPtr; - - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_IsFormatSupported called:\n" ); - - if( inputParameters == NULL ){ - PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: NULL\n" ); - }else{ - PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: 0x%p\n", inputParameters ); - PaUtil_DebugPrint("\tPaDeviceIndex inputParameters->device: %d\n", inputParameters->device ); - PaUtil_DebugPrint("\tint inputParameters->channelCount: %d\n", inputParameters->channelCount ); - PaUtil_DebugPrint("\tPaSampleFormat inputParameters->sampleFormat: %d\n", inputParameters->sampleFormat ); - PaUtil_DebugPrint("\tPaTime inputParameters->suggestedLatency: %f\n", inputParameters->suggestedLatency ); - PaUtil_DebugPrint("\tvoid *inputParameters->hostApiSpecificStreamInfo: 0x%p\n", inputParameters->hostApiSpecificStreamInfo ); - } - - if( outputParameters == NULL ){ - PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: NULL\n" ); - }else{ - PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: 0x%p\n", outputParameters ); - PaUtil_DebugPrint("\tPaDeviceIndex outputParameters->device: %d\n", outputParameters->device ); - PaUtil_DebugPrint("\tint outputParameters->channelCount: %d\n", outputParameters->channelCount ); - PaUtil_DebugPrint("\tPaSampleFormat outputParameters->sampleFormat: %d\n", outputParameters->sampleFormat ); - PaUtil_DebugPrint("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ); - PaUtil_DebugPrint("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ); - } - - PaUtil_DebugPrint("\tdouble sampleRate: %g\n", sampleRate ); -#endif - - if( !PA_IS_INITIALISED_ ) - { - result = paNotInitialized; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_IsFormatSupported returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - return result; - } - - result = ValidateOpenStreamParameters( inputParameters, - outputParameters, - sampleRate, 0, paNoFlag, 0, - &hostApi, - &hostApiInputDevice, - &hostApiOutputDevice ); - if( result != paNoError ) - { -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_IsFormatSupported returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - return result; - } - - - if( inputParameters ) - { - hostApiInputParameters.device = hostApiInputDevice; - hostApiInputParameters.channelCount = inputParameters->channelCount; - hostApiInputParameters.sampleFormat = inputParameters->sampleFormat; - hostApiInputParameters.suggestedLatency = inputParameters->suggestedLatency; - hostApiInputParameters.hostApiSpecificStreamInfo = inputParameters->hostApiSpecificStreamInfo; - hostApiInputParametersPtr = &hostApiInputParameters; - } - else - { - hostApiInputParametersPtr = NULL; - } - - if( outputParameters ) - { - hostApiOutputParameters.device = hostApiOutputDevice; - hostApiOutputParameters.channelCount = outputParameters->channelCount; - hostApiOutputParameters.sampleFormat = outputParameters->sampleFormat; - hostApiOutputParameters.suggestedLatency = outputParameters->suggestedLatency; - hostApiOutputParameters.hostApiSpecificStreamInfo = outputParameters->hostApiSpecificStreamInfo; - hostApiOutputParametersPtr = &hostApiOutputParameters; - } - else - { - hostApiOutputParametersPtr = NULL; - } - - result = hostApi->IsFormatSupported( hostApi, - hostApiInputParametersPtr, hostApiOutputParametersPtr, - sampleRate ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); - if( result == paFormatIsSupported ) - PaUtil_DebugPrint("\tPaError: 0 [ paFormatIsSupported ]\n\n" ); - else - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError Pa_OpenStream( PaStream** stream, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - void *userData ) -{ - PaError result; - PaUtilHostApiRepresentation *hostApi; - PaDeviceIndex hostApiInputDevice, hostApiOutputDevice; - PaStreamParameters hostApiInputParameters, hostApiOutputParameters; - PaStreamParameters *hostApiInputParametersPtr, *hostApiOutputParametersPtr; - - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_OpenStream called:\n" ); - PaUtil_DebugPrint("\tPaStream** stream: 0x%p\n", stream ); - - if( inputParameters == NULL ){ - PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: NULL\n" ); - }else{ - PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: 0x%p\n", inputParameters ); - PaUtil_DebugPrint("\tPaDeviceIndex inputParameters->device: %d\n", inputParameters->device ); - PaUtil_DebugPrint("\tint inputParameters->channelCount: %d\n", inputParameters->channelCount ); - PaUtil_DebugPrint("\tPaSampleFormat inputParameters->sampleFormat: %d\n", inputParameters->sampleFormat ); - PaUtil_DebugPrint("\tPaTime inputParameters->suggestedLatency: %f\n", inputParameters->suggestedLatency ); - PaUtil_DebugPrint("\tvoid *inputParameters->hostApiSpecificStreamInfo: 0x%p\n", inputParameters->hostApiSpecificStreamInfo ); - } - - if( outputParameters == NULL ){ - PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: NULL\n" ); - }else{ - PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: 0x%p\n", outputParameters ); - PaUtil_DebugPrint("\tPaDeviceIndex outputParameters->device: %d\n", outputParameters->device ); - PaUtil_DebugPrint("\tint outputParameters->channelCount: %d\n", outputParameters->channelCount ); - PaUtil_DebugPrint("\tPaSampleFormat outputParameters->sampleFormat: %d\n", outputParameters->sampleFormat ); - PaUtil_DebugPrint("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ); - PaUtil_DebugPrint("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ); - } - - PaUtil_DebugPrint("\tdouble sampleRate: %g\n", sampleRate ); - PaUtil_DebugPrint("\tunsigned long framesPerBuffer: %d\n", framesPerBuffer ); - PaUtil_DebugPrint("\tPaStreamFlags streamFlags: 0x%x\n", streamFlags ); - PaUtil_DebugPrint("\tPaStreamCallback *streamCallback: 0x%p\n", streamCallback ); - PaUtil_DebugPrint("\tvoid *userData: 0x%p\n", userData ); -#endif - - if( !PA_IS_INITIALISED_ ) - { - result = paNotInitialized; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); - PaUtil_DebugPrint("\t*(PaStream** stream): undefined\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - return result; - } - - /* Check for parameter errors. - NOTE: make sure this validation list is kept syncronised with the one - in pa_hostapi.h - */ - - if( stream == NULL ) - { - result = paBadStreamPtr; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); - PaUtil_DebugPrint("\t*(PaStream** stream): undefined\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - return result; - } - - result = ValidateOpenStreamParameters( inputParameters, - outputParameters, - sampleRate, framesPerBuffer, - streamFlags, streamCallback, - &hostApi, - &hostApiInputDevice, - &hostApiOutputDevice ); - if( result != paNoError ) - { -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); - PaUtil_DebugPrint("\t*(PaStream** stream): undefined\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - return result; - } - - - if( inputParameters ) - { - hostApiInputParameters.device = hostApiInputDevice; - hostApiInputParameters.channelCount = inputParameters->channelCount; - hostApiInputParameters.sampleFormat = inputParameters->sampleFormat; - hostApiInputParameters.suggestedLatency = inputParameters->suggestedLatency; - hostApiInputParameters.hostApiSpecificStreamInfo = inputParameters->hostApiSpecificStreamInfo; - hostApiInputParametersPtr = &hostApiInputParameters; - } - else - { - hostApiInputParametersPtr = NULL; - } - - if( outputParameters ) - { - hostApiOutputParameters.device = hostApiOutputDevice; - hostApiOutputParameters.channelCount = outputParameters->channelCount; - hostApiOutputParameters.sampleFormat = outputParameters->sampleFormat; - hostApiOutputParameters.suggestedLatency = outputParameters->suggestedLatency; - hostApiOutputParameters.hostApiSpecificStreamInfo = outputParameters->hostApiSpecificStreamInfo; - hostApiOutputParametersPtr = &hostApiOutputParameters; - } - else - { - hostApiOutputParametersPtr = NULL; - } - - result = hostApi->OpenStream( hostApi, stream, - hostApiInputParametersPtr, hostApiOutputParametersPtr, - sampleRate, framesPerBuffer, streamFlags, streamCallback, userData ); - - if( result == paNoError ) - AddOpenStream( *stream ); - - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); - PaUtil_DebugPrint("\t*(PaStream** stream): 0x%p\n", *stream ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError Pa_OpenDefaultStream( PaStream** stream, - int inputChannelCount, - int outputChannelCount, - PaSampleFormat sampleFormat, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamCallback *streamCallback, - void *userData ) -{ - PaError result; - PaStreamParameters hostApiInputParameters, hostApiOutputParameters; - PaStreamParameters *hostApiInputParametersPtr, *hostApiOutputParametersPtr; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_OpenDefaultStream called:\n" ); - PaUtil_DebugPrint("\tPaStream** stream: 0x%p\n", stream ); - PaUtil_DebugPrint("\tint inputChannelCount: %d\n", inputChannelCount ); - PaUtil_DebugPrint("\tint outputChannelCount: %d\n", outputChannelCount ); - PaUtil_DebugPrint("\tPaSampleFormat sampleFormat: %d\n", sampleFormat ); - PaUtil_DebugPrint("\tdouble sampleRate: %g\n", sampleRate ); - PaUtil_DebugPrint("\tunsigned long framesPerBuffer: %d\n", framesPerBuffer ); - PaUtil_DebugPrint("\tPaStreamCallback *streamCallback: 0x%p\n", streamCallback ); - PaUtil_DebugPrint("\tvoid *userData: 0x%p\n", userData ); -#endif - - - if( inputChannelCount > 0 ) - { - hostApiInputParameters.device = Pa_GetDefaultInputDevice(); - hostApiInputParameters.channelCount = inputChannelCount; - hostApiInputParameters.sampleFormat = sampleFormat; - /* defaultHighInputLatency is used below instead of - defaultLowInputLatency because it is more important for the default - stream to work reliably than it is for it to work with the lowest - latency. - */ - hostApiInputParameters.suggestedLatency = - Pa_GetDeviceInfo( hostApiInputParameters.device )->defaultHighInputLatency; - hostApiInputParameters.hostApiSpecificStreamInfo = NULL; - hostApiInputParametersPtr = &hostApiInputParameters; - } - else - { - hostApiInputParametersPtr = NULL; - } - - if( outputChannelCount > 0 ) - { - hostApiOutputParameters.device = Pa_GetDefaultOutputDevice(); - hostApiOutputParameters.channelCount = outputChannelCount; - hostApiOutputParameters.sampleFormat = sampleFormat; - /* defaultHighOutputLatency is used below instead of - defaultLowOutputLatency because it is more important for the default - stream to work reliably than it is for it to work with the lowest - latency. - */ - hostApiOutputParameters.suggestedLatency = - Pa_GetDeviceInfo( hostApiOutputParameters.device )->defaultHighOutputLatency; - hostApiOutputParameters.hostApiSpecificStreamInfo = NULL; - hostApiOutputParametersPtr = &hostApiOutputParameters; - } - else - { - hostApiOutputParametersPtr = NULL; - } - - - result = Pa_OpenStream( - stream, hostApiInputParametersPtr, hostApiOutputParametersPtr, - sampleRate, framesPerBuffer, paNoFlag, streamCallback, userData ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_OpenDefaultStream returned:\n" ); - PaUtil_DebugPrint("\t*(PaStream** stream): 0x%p", *stream ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError PaUtil_ValidateStreamPointer( PaStream* stream ) -{ - if( !PA_IS_INITIALISED_ ) return paNotInitialized; - - if( stream == NULL ) return paBadStreamPtr; - - if( ((PaUtilStreamRepresentation*)stream)->magic != PA_STREAM_MAGIC ) - return paBadStreamPtr; - - return paNoError; -} - - -PaError Pa_CloseStream( PaStream* stream ) -{ - PaUtilStreamInterface *interface; - PaError result = PaUtil_ValidateStreamPointer( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_CloseStream called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - /* always remove the open stream from our list, even if this function - eventually returns an error. Otherwise CloseOpenStreams() will - get stuck in an infinite loop */ - RemoveOpenStream( stream ); /* be sure to call this _before_ closing the stream */ - - if( result == paNoError ) - { - interface = PA_STREAM_INTERFACE(stream); - - /* abort the stream if it isn't stopped */ - result = interface->IsStopped( stream ); - if( result == 1 ) - result = paNoError; - else if( result == 0 ) - result = interface->Abort( stream ); - - if( result == paNoError ) /** @todo REVIEW: shouldn't we close anyway? */ - result = interface->Close( stream ); - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_CloseStream returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ) -{ - PaError result = PaUtil_ValidateStreamPointer( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_SetStreamFinishedCallback called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); - PaUtil_DebugPrint("\tPaStreamFinishedCallback* streamFinishedCallback: 0x%p\n", streamFinishedCallback ); -#endif - - if( result == paNoError ) - { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); - if( result == 0 ) - { - result = paStreamIsNotStopped ; - } - if( result == 1 ) - { - PA_STREAM_REP( stream )->streamFinishedCallback = streamFinishedCallback; - result = paNoError; - } - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_SetStreamFinishedCallback returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; - -} - - -PaError Pa_StartStream( PaStream *stream ) -{ - PaError result = PaUtil_ValidateStreamPointer( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_StartStream called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( result == paNoError ) - { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); - if( result == 0 ) - { - result = paStreamIsNotStopped ; - } - else if( result == 1 ) - { - result = PA_STREAM_INTERFACE(stream)->Start( stream ); - } - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_StartStream returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError Pa_StopStream( PaStream *stream ) -{ - PaError result = PaUtil_ValidateStreamPointer( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_StopStream called\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( result == paNoError ) - { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); - if( result == 0 ) - { - result = PA_STREAM_INTERFACE(stream)->Stop( stream ); - } - else if( result == 1 ) - { - result = paStreamIsStopped; - } - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_StopStream returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError Pa_AbortStream( PaStream *stream ) -{ - PaError result = PaUtil_ValidateStreamPointer( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_AbortStream called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( result == paNoError ) - { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); - if( result == 0 ) - { - result = PA_STREAM_INTERFACE(stream)->Abort( stream ); - } - else if( result == 1 ) - { - result = paStreamIsStopped; - } - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_AbortStream returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError Pa_IsStreamStopped( PaStream *stream ) -{ - PaError result = PaUtil_ValidateStreamPointer( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_IsStreamStopped called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( result == paNoError ) - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_IsStreamStopped returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError Pa_IsStreamActive( PaStream *stream ) -{ - PaError result = PaUtil_ValidateStreamPointer( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_IsStreamActive called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( result == paNoError ) - result = PA_STREAM_INTERFACE(stream)->IsActive( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_IsStreamActive returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ) -{ - PaError error = PaUtil_ValidateStreamPointer( stream ); - const PaStreamInfo *result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamInfo called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( error != paNoError ) - { - result = 0; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamInfo returned:\n" ); - PaUtil_DebugPrint("\tconst PaStreamInfo*: 0 [PaError error:%d ( %s )]\n\n", result, error, Pa_GetErrorText( error ) ); -#endif - - } - else - { - result = &PA_STREAM_REP( stream )->streamInfo; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamInfo returned:\n" ); - PaUtil_DebugPrint("\tconst PaStreamInfo*: 0x%p:\n", result ); - PaUtil_DebugPrint("\t{" ); - - PaUtil_DebugPrint("\t\tint structVersion: %d\n", result->structVersion ); - PaUtil_DebugPrint("\t\tPaTime inputLatency: %f\n", result->inputLatency ); - PaUtil_DebugPrint("\t\tPaTime outputLatency: %f\n", result->outputLatency ); - PaUtil_DebugPrint("\t\tdouble sampleRate: %f\n", result->sampleRate ); - PaUtil_DebugPrint("\t}\n\n" ); -#endif - - } - - return result; -} - - -PaTime Pa_GetStreamTime( PaStream *stream ) -{ - PaError error = PaUtil_ValidateStreamPointer( stream ); - PaTime result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamTime called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( error != paNoError ) - { - result = 0; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamTime returned:\n" ); - PaUtil_DebugPrint("\tPaTime: 0 [PaError error:%d ( %s )]\n\n", result, error, Pa_GetErrorText( error ) ); -#endif - - } - else - { - result = PA_STREAM_INTERFACE(stream)->GetTime( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamTime returned:\n" ); - PaUtil_DebugPrint("\tPaTime: %g\n\n", result ); -#endif - - } - - return result; -} - - -double Pa_GetStreamCpuLoad( PaStream* stream ) -{ - PaError error = PaUtil_ValidateStreamPointer( stream ); - double result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamCpuLoad called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( error != paNoError ) - { - - result = 0.0; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamCpuLoad returned:\n" ); - PaUtil_DebugPrint("\tdouble: 0.0 [PaError error: %d ( %s )]\n\n", error, Pa_GetErrorText( error ) ); -#endif - - } - else - { - result = PA_STREAM_INTERFACE(stream)->GetCpuLoad( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamCpuLoad returned:\n" ); - PaUtil_DebugPrint("\tdouble: %g\n\n", result ); -#endif - - } - - return result; -} - - -PaError Pa_ReadStream( PaStream* stream, - void *buffer, - unsigned long frames ) -{ - PaError result = PaUtil_ValidateStreamPointer( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_ReadStream called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( result == paNoError ) - { - if( frames == 0 ) - { - /* XXX: Should we not allow the implementation to signal any overflow condition? */ - result = paNoError; - } - else if( buffer == 0 ) - { - result = paBadBufferPtr; - } - else - { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); - if( result == 0 ) - { - result = PA_STREAM_INTERFACE(stream)->Read( stream, buffer, frames ); - } - else if( result == 1 ) - { - result = paStreamIsStopped; - } - } - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_ReadStream returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - - -PaError Pa_WriteStream( PaStream* stream, - const void *buffer, - unsigned long frames ) -{ - PaError result = PaUtil_ValidateStreamPointer( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_WriteStream called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( result == paNoError ) - { - if( frames == 0 ) - { - /* XXX: Should we not allow the implementation to signal any underflow condition? */ - result = paNoError; - } - else if( buffer == 0 ) - { - result = paBadBufferPtr; - } - else - { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); - if( result == 0 ) - { - result = PA_STREAM_INTERFACE(stream)->Write( stream, buffer, frames ); - } - else if( result == 1 ) - { - result = paStreamIsStopped; - } - } - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_WriteStream returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return result; -} - -signed long Pa_GetStreamReadAvailable( PaStream* stream ) -{ - PaError error = PaUtil_ValidateStreamPointer( stream ); - signed long result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamReadAvailable called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( error != paNoError ) - { - result = 0; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamReadAvailable returned:\n" ); - PaUtil_DebugPrint("\tunsigned long: 0 [ PaError error: %d ( %s ) ]\n\n", error, Pa_GetErrorText( error ) ); -#endif - - } - else - { - result = PA_STREAM_INTERFACE(stream)->GetReadAvailable( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamReadAvailable returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - } - - return result; -} - - -signed long Pa_GetStreamWriteAvailable( PaStream* stream ) -{ - PaError error = PaUtil_ValidateStreamPointer( stream ); - signed long result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamWriteAvailable called:\n" ); - PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); -#endif - - if( error != paNoError ) - { - result = 0; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamWriteAvailable returned:\n" ); - PaUtil_DebugPrint("\tunsigned long: 0 [ PaError error: %d ( %s ) ]\n\n", error, Pa_GetErrorText( error ) ); -#endif - - } - else - { - result = PA_STREAM_INTERFACE(stream)->GetWriteAvailable( stream ); - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetStreamWriteAvailable returned:\n" ); - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - } - - return result; -} - - -PaError Pa_GetSampleSize( PaSampleFormat format ) -{ - int result; - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetSampleSize called:\n" ); - PaUtil_DebugPrint("\tPaSampleFormat format: %d\n", format ); -#endif - - switch( format & ~paNonInterleaved ) - { - - case paUInt8: - case paInt8: - result = 1; - break; - - case paInt16: - result = 2; - break; - - case paInt24: - result = 3; - break; - - case paFloat32: - case paInt32: - result = 4; - break; - - default: - result = paSampleFormatNotSupported; - break; - } - -#ifdef PA_LOG_API_CALLS - PaUtil_DebugPrint("Pa_GetSampleSize returned:\n" ); - if( result > 0 ) - PaUtil_DebugPrint("\tint: %d\n\n", result ); - else - PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); -#endif - - return (PaError) result; -} - diff --git a/portaudio-v19/pa_common/pa_hostapi.h b/portaudio-v19/pa_common/pa_hostapi.h deleted file mode 100644 index fec4e4871..000000000 --- a/portaudio-v19/pa_common/pa_hostapi.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef PA_HOSTAPI_H -#define PA_HOSTAPI_H -/* - * $Id$ - * Portable Audio I/O Library - * host api representation - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Ross Bencina, Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Interface used by pa_front to virtualize functions which operate on - host APIs. -*/ - - -#include "portaudio.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -/** **FOR THE USE OF pa_front.c ONLY** - Do NOT use fields in this structure, they my change at any time. - Use functions defined in pa_util.h if you think you need functionality - which can be derived from here. -*/ -typedef struct PaUtilPrivatePaFrontHostApiInfo { - - - unsigned long baseDeviceIndex; -}PaUtilPrivatePaFrontHostApiInfo; - - -/** The common header for all data structures whose pointers are passed through - the hostApiSpecificStreamInfo field of the PaStreamParameters structure. - Note that in order to keep the public PortAudio interface clean, this structure - is not used explicitly when declaring hostApiSpecificStreamInfo data structures. - However, some code in pa_front depends on the first 3 members being equivalent - with this structure. - @see PaStreamParameters -*/ -typedef struct PaUtilHostApiSpecificStreamInfoHeader -{ - unsigned long size; /**< size of whole structure including this header */ - PaHostApiTypeId hostApiType; /**< host API for which this data is intended */ - unsigned long version; /**< structure version */ -} PaUtilHostApiSpecificStreamInfoHeader; - - - -/** A structure representing the interface to a host API. Contains both - concrete data and pointers to functions which implement the interface. -*/ -typedef struct PaUtilHostApiRepresentation { - PaUtilPrivatePaFrontHostApiInfo privatePaFrontInfo; - - /** The host api implementation should populate the info field. In the - case of info.defaultInputDevice and info.defaultOutputDevice the - values stored should be 0 based indices within the host api's own - device index range (0 to deviceCount). These values will be converted - to global device indices by pa_front after PaUtilHostApiInitializer() - returns. - */ - PaHostApiInfo info; - - PaDeviceInfo** deviceInfos; - - /** - (*Terminate)() is guaranteed to be called with a valid - parameter, which was previously returned from the same implementation's - initializer. - */ - void (*Terminate)( struct PaUtilHostApiRepresentation *hostApi ); - - /** - The inputParameters and outputParameters pointers should not be saved - as they will not remain valid after OpenStream is called. - - - The following guarantees are made about parameters to (*OpenStream)(): - - [NOTE: the following list up to *END PA FRONT VALIDATIONS* should be - kept in sync with the one for ValidateOpenStreamParameters and - Pa_OpenStream in pa_front.c] - - PaHostApiRepresentation *hostApi - - is valid for this implementation - - PaStream** stream - - is non-null - - - at least one of inputParameters & outputParmeters is valid (not NULL) - - - if inputParameters & outputParmeters are both valid, that - inputParameters->device & outputParmeters->device both use the same host api - - PaDeviceIndex inputParameters->device - - is within range (0 to Pa_CountDevices-1) Or: - - is paUseHostApiSpecificDeviceSpecification and - inputParameters->hostApiSpecificStreamInfo is non-NULL and refers - to a valid host api - - int inputParameters->numChannels - - if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, numInputChannels is > 0 - - upper bound is NOT validated against device capabilities - - PaSampleFormat inputParameters->sampleFormat - - is one of the sample formats defined in portaudio.h - - void *inputParameters->hostApiSpecificStreamInfo - - if supplied its hostApi field matches the input device's host Api - - PaDeviceIndex outputParmeters->device - - is within range (0 to Pa_CountDevices-1) - - int outputParmeters->numChannels - - if inputDevice is valid, numInputChannels is > 0 - - upper bound is NOT validated against device capabilities - - PaSampleFormat outputParmeters->sampleFormat - - is one of the sample formats defined in portaudio.h - - void *outputParmeters->hostApiSpecificStreamInfo - - if supplied its hostApi field matches the output device's host Api - - double sampleRate - - is not an 'absurd' rate (less than 1000. or greater than 200000.) - - sampleRate is NOT validated against device capabilities - - PaStreamFlags streamFlags - - unused platform neutral flags are zero - - paNeverDropInput is only used for full-duplex callback streams - with variable buffer size (paFramesPerBufferUnspecified) - - [*END PA FRONT VALIDATIONS*] - - - The following validations MUST be performed by (*OpenStream)(): - - - check that input device can support numInputChannels - - - check that input device can support inputSampleFormat, or that - we have the capability to convert from outputSampleFormat to - a native format - - - if inputStreamInfo is supplied, validate its contents, - or return an error if no inputStreamInfo is expected - - - check that output device can support numOutputChannels - - - check that output device can support outputSampleFormat, or that - we have the capability to convert from outputSampleFormat to - a native format - - - if outputStreamInfo is supplied, validate its contents, - or return an error if no outputStreamInfo is expected - - - if a full duplex stream is requested, check that the combination - of input and output parameters is supported - - - check that the device supports sampleRate - - - alter sampleRate to a close allowable rate if necessary - - - validate inputLatency and outputLatency - - - validate any platform specific flags, if flags are supplied they - must be valid. - */ - PaError (*OpenStream)( struct PaUtilHostApiRepresentation *hostApi, - PaStream** stream, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerCallback, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - void *userData ); - - - PaError (*IsFormatSupported)( struct PaUtilHostApiRepresentation *hostApi, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate ); -} PaUtilHostApiRepresentation; - - -/** Prototype for the initialization function which must be implemented by every - host API. - - @see paHostApiInitializers -*/ -typedef PaError PaUtilHostApiInitializer( PaUtilHostApiRepresentation**, PaHostApiIndex ); - - -/** paHostApiInitializers is a NULL-terminated array of host API initialization - functions. These functions are called by pa_front to initialize the host APIs - when the client calls Pa_Initialize(). - - There is a platform specific file which defines paHostApiInitializers for that - platform, pa_win/pa_win_hostapis.c contains the Win32 definitions for example. -*/ -extern PaUtilHostApiInitializer *paHostApiInitializers[]; - - -/** The index of the default host API in the paHostApiInitializers array. - - There is a platform specific file which defines paDefaultHostApiIndex for that - platform, see pa_win/pa_win_hostapis.c for example. -*/ -extern int paDefaultHostApiIndex; - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_HOSTAPI_H */ diff --git a/portaudio-v19/pa_common/pa_process.c b/portaudio-v19/pa_common/pa_process.c deleted file mode 100644 index 837bbef35..000000000 --- a/portaudio-v19/pa_common/pa_process.c +++ /dev/null @@ -1,1763 +0,0 @@ -/* - * $Id$ - * Portable Audio I/O Library - * streamCallback <-> host buffer processing adapter - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Ross Bencina, Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Buffer Processor implementation. - - The code in this file is not optimised yet - although it's not clear that - it needs to be. there may appear to be redundancies - that could be factored into common functions, but the redundanceis are left - intentionally as each appearance may have different optimisation possibilities. - - The optimisations which are planned involve only converting data in-place - where possible, rather than copying to the temp buffer(s). - - Note that in the extreme case of being able to convert in-place, and there - being no conversion necessary there should be some code which short-circuits - the operation. - - @todo Consider cache tilings for intereave<->deinterleave. - - @todo implement timeInfo->currentTime int PaUtil_BeginBufferProcessing() - - @todo specify and implement some kind of logical policy for handling the - underflow and overflow stream flags when the underflow/overflow overlaps - multiple user buffers/callbacks. - - @todo provide support for priming the buffers with data from the callback. - The client interface is now implemented through PaUtil_SetNoInput() - which sets bp->hostInputChannels[0][0].data to zero. However this is - currently only implemented in NonAdaptingProcess(). It shouldn't be - needed for AdaptingInputOnlyProcess() (no priming should ever be - requested for AdaptingInputOnlyProcess()). - Not sure if additional work should be required to make it work with - AdaptingOutputOnlyProcess, but it definitely is required for - AdaptingProcess. - - @todo implement PaUtil_SetNoOutput for AdaptingProcess - - @todo don't allocate temp buffers for blocking streams unless they are - needed. At the moment they are needed, but perhaps for host APIs - where the implementation passes a buffer to the host they could be - used. -*/ - - -#include -#include /* memset() */ - -#include "pa_process.h" -#include "pa_util.h" - - -#define PA_FRAMES_PER_TEMP_BUFFER_WHEN_HOST_BUFFER_SIZE_IS_UNKNOWN_ 1024 - -#define PA_MIN_( a, b ) ( ((a)<(b)) ? (a) : (b) ) - - -/* greatest common divisor - PGCD in French */ -static unsigned long GCD( unsigned long a, unsigned long b ) -{ - return (b==0) ? a : GCD( b, a%b); -} - -/* least common multiple - PPCM in French */ -static unsigned long LCM( unsigned long a, unsigned long b ) -{ - return (a*b) / GCD(a,b); -} - -#define PA_MAX_( a, b ) (((a) > (b)) ? (a) : (b)) - -static unsigned long CalculateFrameShift( unsigned long M, unsigned long N ) -{ - unsigned long result = 0; - unsigned long i; - unsigned long lcm; - - assert( M > 0 ); - assert( N > 0 ); - - lcm = LCM( M, N ); - for( i = M; i < lcm; i += M ) - result = PA_MAX_( result, i % N ); - - return result; -} - - -PaError PaUtil_InitializeBufferProcessor( PaUtilBufferProcessor* bp, - int inputChannelCount, PaSampleFormat userInputSampleFormat, - PaSampleFormat hostInputSampleFormat, - int outputChannelCount, PaSampleFormat userOutputSampleFormat, - PaSampleFormat hostOutputSampleFormat, - double sampleRate, - PaStreamFlags streamFlags, - unsigned long framesPerUserBuffer, - unsigned long framesPerHostBuffer, - PaUtilHostBufferSizeMode hostBufferSizeMode, - PaStreamCallback *streamCallback, void *userData ) -{ - PaError result = paNoError; - PaError bytesPerSample; - unsigned long tempInputBufferSize, tempOutputBufferSize; - - if( streamFlags & paNeverDropInput ) - { - /* paNeverDropInput is only valid for full-duplex callback streams, with an unspecified number of frames per buffer. */ - if( !streamCallback || !(inputChannelCount > 0 && outputChannelCount > 0) || - framesPerUserBuffer != paFramesPerBufferUnspecified ) - return paInvalidFlag; - } - - /* initialize buffer ptrs to zero so they can be freed if necessary in error */ - bp->tempInputBuffer = 0; - bp->tempInputBufferPtrs = 0; - bp->tempOutputBuffer = 0; - bp->tempOutputBufferPtrs = 0; - - bp->framesPerUserBuffer = framesPerUserBuffer; - bp->framesPerHostBuffer = framesPerHostBuffer; - - bp->inputChannelCount = inputChannelCount; - bp->outputChannelCount = outputChannelCount; - - bp->hostBufferSizeMode = hostBufferSizeMode; - - bp->hostInputChannels[0] = bp->hostInputChannels[1] = 0; - bp->hostOutputChannels[0] = bp->hostOutputChannels[1] = 0; - - if( framesPerUserBuffer == 0 ) /* streamCallback will accept any buffer size */ - { - bp->useNonAdaptingProcess = 1; - bp->initialFramesInTempInputBuffer = 0; - bp->initialFramesInTempOutputBuffer = 0; - - if( hostBufferSizeMode == paUtilFixedHostBufferSize - || hostBufferSizeMode == paUtilBoundedHostBufferSize ) - { - bp->framesPerTempBuffer = framesPerHostBuffer; - } - else /* unknown host buffer size */ - { - bp->framesPerTempBuffer = PA_FRAMES_PER_TEMP_BUFFER_WHEN_HOST_BUFFER_SIZE_IS_UNKNOWN_; - } - } - else - { - bp->framesPerTempBuffer = framesPerUserBuffer; - - if( hostBufferSizeMode == paUtilFixedHostBufferSize - && framesPerHostBuffer % framesPerUserBuffer == 0 ) - { - bp->useNonAdaptingProcess = 1; - bp->initialFramesInTempInputBuffer = 0; - bp->initialFramesInTempOutputBuffer = 0; - } - else - { - bp->useNonAdaptingProcess = 0; - - if( inputChannelCount > 0 && outputChannelCount > 0 ) - { - /* full duplex */ - if( hostBufferSizeMode == paUtilFixedHostBufferSize ) - { - unsigned long frameShift = - CalculateFrameShift( framesPerHostBuffer, framesPerUserBuffer ); - - if( framesPerUserBuffer > framesPerHostBuffer ) - { - bp->initialFramesInTempInputBuffer = frameShift; - bp->initialFramesInTempOutputBuffer = 0; - } - else - { - bp->initialFramesInTempInputBuffer = 0; - bp->initialFramesInTempOutputBuffer = frameShift; - } - } - else /* variable host buffer size, add framesPerUserBuffer latency */ - { - bp->initialFramesInTempInputBuffer = 0; - bp->initialFramesInTempOutputBuffer = framesPerUserBuffer; - } - } - else - { - /* half duplex */ - bp->initialFramesInTempInputBuffer = 0; - bp->initialFramesInTempOutputBuffer = 0; - } - } - } - - - bp->framesInTempInputBuffer = bp->initialFramesInTempInputBuffer; - bp->framesInTempOutputBuffer = bp->initialFramesInTempOutputBuffer; - - - if( inputChannelCount > 0 ) - { - bytesPerSample = Pa_GetSampleSize( hostInputSampleFormat ); - if( bytesPerSample > 0 ) - { - bp->bytesPerHostInputSample = bytesPerSample; - } - else - { - result = bytesPerSample; - goto error; - } - - bytesPerSample = Pa_GetSampleSize( userInputSampleFormat ); - if( bytesPerSample > 0 ) - { - bp->bytesPerUserInputSample = bytesPerSample; - } - else - { - result = bytesPerSample; - goto error; - } - - bp->inputConverter = - PaUtil_SelectConverter( hostInputSampleFormat, userInputSampleFormat, streamFlags ); - - bp->inputZeroer = PaUtil_SelectZeroer( hostInputSampleFormat ); - - bp->userInputIsInterleaved = (userInputSampleFormat & paNonInterleaved)?0:1; - - - tempInputBufferSize = - bp->framesPerTempBuffer * bp->bytesPerUserInputSample * inputChannelCount; - - bp->tempInputBuffer = PaUtil_AllocateMemory( tempInputBufferSize ); - if( bp->tempInputBuffer == 0 ) - { - result = paInsufficientMemory; - goto error; - } - - if( bp->framesInTempInputBuffer > 0 ) - memset( bp->tempInputBuffer, 0, tempInputBufferSize ); - - if( userInputSampleFormat & paNonInterleaved ) - { - bp->tempInputBufferPtrs = - (void **)PaUtil_AllocateMemory( sizeof(void*)*inputChannelCount ); - if( bp->tempInputBufferPtrs == 0 ) - { - result = paInsufficientMemory; - goto error; - } - } - - bp->hostInputChannels[0] = (PaUtilChannelDescriptor*) - PaUtil_AllocateMemory( sizeof(PaUtilChannelDescriptor) * inputChannelCount * 2); - if( bp->hostInputChannels[0] == 0 ) - { - result = paInsufficientMemory; - goto error; - } - - bp->hostInputChannels[1] = &bp->hostInputChannels[0][inputChannelCount]; - } - - if( outputChannelCount > 0 ) - { - bytesPerSample = Pa_GetSampleSize( hostOutputSampleFormat ); - if( bytesPerSample > 0 ) - { - bp->bytesPerHostOutputSample = bytesPerSample; - } - else - { - result = bytesPerSample; - goto error; - } - - bytesPerSample = Pa_GetSampleSize( userOutputSampleFormat ); - if( bytesPerSample > 0 ) - { - bp->bytesPerUserOutputSample = bytesPerSample; - } - else - { - result = bytesPerSample; - goto error; - } - - bp->outputConverter = - PaUtil_SelectConverter( userOutputSampleFormat, hostOutputSampleFormat, streamFlags ); - - bp->outputZeroer = PaUtil_SelectZeroer( hostOutputSampleFormat ); - - bp->userOutputIsInterleaved = (userOutputSampleFormat & paNonInterleaved)?0:1; - - tempOutputBufferSize = - bp->framesPerTempBuffer * bp->bytesPerUserOutputSample * outputChannelCount; - - bp->tempOutputBuffer = PaUtil_AllocateMemory( tempOutputBufferSize ); - if( bp->tempOutputBuffer == 0 ) - { - result = paInsufficientMemory; - goto error; - } - - if( bp->framesInTempOutputBuffer > 0 ) - memset( bp->tempOutputBuffer, 0, tempOutputBufferSize ); - - if( userOutputSampleFormat & paNonInterleaved ) - { - bp->tempOutputBufferPtrs = - (void **)PaUtil_AllocateMemory( sizeof(void*)*outputChannelCount ); - if( bp->tempOutputBufferPtrs == 0 ) - { - result = paInsufficientMemory; - goto error; - } - } - - bp->hostOutputChannels[0] = (PaUtilChannelDescriptor*) - PaUtil_AllocateMemory( sizeof(PaUtilChannelDescriptor)*outputChannelCount * 2 ); - if( bp->hostOutputChannels[0] == 0 ) - { - result = paInsufficientMemory; - goto error; - } - - bp->hostOutputChannels[1] = &bp->hostOutputChannels[0][outputChannelCount]; - } - - PaUtil_InitializeTriangularDitherState( &bp->ditherGenerator ); - - bp->samplePeriod = 1. / sampleRate; - - bp->streamCallback = streamCallback; - bp->userData = userData; - - return result; - -error: - if( bp->tempInputBuffer ) - PaUtil_FreeMemory( bp->tempInputBuffer ); - - if( bp->tempInputBufferPtrs ) - PaUtil_FreeMemory( bp->tempInputBufferPtrs ); - - if( bp->hostInputChannels[0] ) - PaUtil_FreeMemory( bp->hostInputChannels[0] ); - - if( bp->tempOutputBuffer ) - PaUtil_FreeMemory( bp->tempOutputBuffer ); - - if( bp->tempOutputBufferPtrs ) - PaUtil_FreeMemory( bp->tempOutputBufferPtrs ); - - if( bp->hostOutputChannels[0] ) - PaUtil_FreeMemory( bp->hostOutputChannels[0] ); - - return result; -} - - -void PaUtil_TerminateBufferProcessor( PaUtilBufferProcessor* bp ) -{ - if( bp->tempInputBuffer ) - PaUtil_FreeMemory( bp->tempInputBuffer ); - - if( bp->tempInputBufferPtrs ) - PaUtil_FreeMemory( bp->tempInputBufferPtrs ); - - if( bp->hostInputChannels[0] ) - PaUtil_FreeMemory( bp->hostInputChannels[0] ); - - if( bp->tempOutputBuffer ) - PaUtil_FreeMemory( bp->tempOutputBuffer ); - - if( bp->tempOutputBufferPtrs ) - PaUtil_FreeMemory( bp->tempOutputBufferPtrs ); - - if( bp->hostOutputChannels[0] ) - PaUtil_FreeMemory( bp->hostOutputChannels[0] ); -} - - -void PaUtil_ResetBufferProcessor( PaUtilBufferProcessor* bp ) -{ - unsigned long tempInputBufferSize, tempOutputBufferSize; - - bp->framesInTempInputBuffer = bp->initialFramesInTempInputBuffer; - bp->framesInTempOutputBuffer = bp->initialFramesInTempOutputBuffer; - - if( bp->framesInTempInputBuffer > 0 ) - { - tempInputBufferSize = - bp->framesPerTempBuffer * bp->bytesPerUserInputSample * bp->inputChannelCount; - memset( bp->tempInputBuffer, 0, tempInputBufferSize ); - } - - if( bp->framesInTempOutputBuffer > 0 ) - { - tempOutputBufferSize = - bp->framesPerTempBuffer * bp->bytesPerUserOutputSample * bp->outputChannelCount; - memset( bp->tempOutputBuffer, 0, tempOutputBufferSize ); - } -} - - -unsigned long PaUtil_GetBufferProcessorInputLatency( PaUtilBufferProcessor* bp ) -{ - return bp->initialFramesInTempInputBuffer; -} - - -unsigned long PaUtil_GetBufferProcessorOutputLatency( PaUtilBufferProcessor* bp ) -{ - return bp->initialFramesInTempOutputBuffer; -} - - -void PaUtil_SetInputFrameCount( PaUtilBufferProcessor* bp, - unsigned long frameCount ) -{ - if( frameCount == 0 ) - bp->hostInputFrameCount[0] = bp->framesPerHostBuffer; - else - bp->hostInputFrameCount[0] = frameCount; -} - - -void PaUtil_SetNoInput( PaUtilBufferProcessor* bp ) -{ - assert( bp->inputChannelCount > 0 ); - - bp->hostInputChannels[0][0].data = 0; -} - - -void PaUtil_SetInputChannel( PaUtilBufferProcessor* bp, - unsigned int channel, void *data, unsigned int stride ) -{ - assert( channel < bp->inputChannelCount ); - - bp->hostInputChannels[0][channel].data = data; - bp->hostInputChannels[0][channel].stride = stride; -} - - -void PaUtil_SetInterleavedInputChannels( PaUtilBufferProcessor* bp, - unsigned int firstChannel, void *data, unsigned int channelCount ) -{ - unsigned int i; - unsigned int channel = firstChannel; - unsigned char *p = (unsigned char*)data; - - if( channelCount == 0 ) - channelCount = bp->inputChannelCount; - - assert( firstChannel < bp->inputChannelCount ); - assert( firstChannel + channelCount <= bp->inputChannelCount ); - - for( i=0; i< channelCount; ++i ) - { - bp->hostInputChannels[0][channel+i].data = p; - p += bp->bytesPerHostInputSample; - bp->hostInputChannels[0][channel+i].stride = channelCount; - } -} - - -void PaUtil_SetNonInterleavedInputChannel( PaUtilBufferProcessor* bp, - unsigned int channel, void *data ) -{ - assert( channel < bp->inputChannelCount ); - - bp->hostInputChannels[0][channel].data = data; - bp->hostInputChannels[0][channel].stride = 1; -} - - -void PaUtil_Set2ndInputFrameCount( PaUtilBufferProcessor* bp, - unsigned long frameCount ) -{ - bp->hostInputFrameCount[1] = frameCount; -} - - -void PaUtil_Set2ndInputChannel( PaUtilBufferProcessor* bp, - unsigned int channel, void *data, unsigned int stride ) -{ - assert( channel < bp->inputChannelCount ); - - bp->hostInputChannels[1][channel].data = data; - bp->hostInputChannels[1][channel].stride = stride; -} - - -void PaUtil_Set2ndInterleavedInputChannels( PaUtilBufferProcessor* bp, - unsigned int firstChannel, void *data, unsigned int channelCount ) -{ - unsigned int i; - unsigned int channel = firstChannel; - unsigned char *p = (unsigned char*)data; - - if( channelCount == 0 ) - channelCount = bp->inputChannelCount; - - assert( firstChannel < bp->inputChannelCount ); - assert( firstChannel + channelCount <= bp->inputChannelCount ); - - for( i=0; i< channelCount; ++i ) - { - bp->hostInputChannels[1][channel+i].data = p; - p += bp->bytesPerHostInputSample; - bp->hostInputChannels[1][channel+i].stride = channelCount; - } -} - - -void PaUtil_Set2ndNonInterleavedInputChannel( PaUtilBufferProcessor* bp, - unsigned int channel, void *data ) -{ - assert( channel < bp->inputChannelCount ); - - bp->hostInputChannels[1][channel].data = data; - bp->hostInputChannels[1][channel].stride = 1; -} - - -void PaUtil_SetOutputFrameCount( PaUtilBufferProcessor* bp, - unsigned long frameCount ) -{ - if( frameCount == 0 ) - bp->hostOutputFrameCount[0] = bp->framesPerHostBuffer; - else - bp->hostOutputFrameCount[0] = frameCount; -} - - -void PaUtil_SetNoOutput( PaUtilBufferProcessor* bp ) -{ - assert( bp->outputChannelCount > 0 ); - - bp->hostOutputChannels[0][0].data = 0; -} - - -void PaUtil_SetOutputChannel( PaUtilBufferProcessor* bp, - unsigned int channel, void *data, unsigned int stride ) -{ - assert( channel < bp->outputChannelCount ); - assert( data != NULL ); - - bp->hostOutputChannels[0][channel].data = data; - bp->hostOutputChannels[0][channel].stride = stride; -} - - -void PaUtil_SetInterleavedOutputChannels( PaUtilBufferProcessor* bp, - unsigned int firstChannel, void *data, unsigned int channelCount ) -{ - unsigned int i; - unsigned int channel = firstChannel; - unsigned char *p = (unsigned char*)data; - - if( channelCount == 0 ) - channelCount = bp->outputChannelCount; - - assert( firstChannel < bp->outputChannelCount ); - assert( firstChannel + channelCount <= bp->outputChannelCount ); - - for( i=0; i< channelCount; ++i ) - { - PaUtil_SetOutputChannel( bp, channel + i, p, channelCount ); - p += bp->bytesPerHostOutputSample; - } -} - - -void PaUtil_SetNonInterleavedOutputChannel( PaUtilBufferProcessor* bp, - unsigned int channel, void *data ) -{ - assert( channel < bp->outputChannelCount ); - - PaUtil_SetOutputChannel( bp, channel, data, 1 ); -} - - -void PaUtil_Set2ndOutputFrameCount( PaUtilBufferProcessor* bp, - unsigned long frameCount ) -{ - bp->hostOutputFrameCount[1] = frameCount; -} - - -void PaUtil_Set2ndOutputChannel( PaUtilBufferProcessor* bp, - unsigned int channel, void *data, unsigned int stride ) -{ - assert( channel < bp->outputChannelCount ); - assert( data != NULL ); - - bp->hostOutputChannels[1][channel].data = data; - bp->hostOutputChannels[1][channel].stride = stride; -} - - -void PaUtil_Set2ndInterleavedOutputChannels( PaUtilBufferProcessor* bp, - unsigned int firstChannel, void *data, unsigned int channelCount ) -{ - unsigned int i; - unsigned int channel = firstChannel; - unsigned char *p = (unsigned char*)data; - - if( channelCount == 0 ) - channelCount = bp->outputChannelCount; - - assert( firstChannel < bp->outputChannelCount ); - assert( firstChannel + channelCount <= bp->outputChannelCount ); - - for( i=0; i< channelCount; ++i ) - { - PaUtil_Set2ndOutputChannel( bp, channel + i, p, channelCount ); - p += bp->bytesPerHostOutputSample; - } -} - - -void PaUtil_Set2ndNonInterleavedOutputChannel( PaUtilBufferProcessor* bp, - unsigned int channel, void *data ) -{ - assert( channel < bp->outputChannelCount ); - - PaUtil_Set2ndOutputChannel( bp, channel, data, 1 ); -} - - -void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bp, - PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags callbackStatusFlags ) -{ - bp->timeInfo = timeInfo; - - /* the first streamCallback will be called to process samples which are - currently in the input buffer before the ones starting at the timeInfo time */ - - bp->timeInfo->inputBufferAdcTime -= bp->framesInTempInputBuffer * bp->samplePeriod; - - bp->timeInfo->currentTime = 0; /** FIXME: @todo time info currentTime not implemented */ - - /* the first streamCallback will be called to generate samples which will be - outputted after the frames currently in the output buffer have been - outputted. */ - bp->timeInfo->outputBufferDacTime += bp->framesInTempOutputBuffer * bp->samplePeriod; - - bp->callbackStatusFlags = callbackStatusFlags; - - bp->hostInputFrameCount[1] = 0; - bp->hostOutputFrameCount[1] = 0; -} - - -/* - NonAdaptingProcess() is a simple buffer copying adaptor that can handle - both full and half duplex copies. It processes framesToProcess frames, - broken into blocks bp->framesPerTempBuffer long. - This routine can be used when the streamCallback doesn't care what length - the buffers are, or when framesToProcess is an integer multiple of - bp->framesPerTempBuffer, in which case streamCallback will always be called - with bp->framesPerTempBuffer samples. -*/ -static unsigned long NonAdaptingProcess( PaUtilBufferProcessor *bp, - int *streamCallbackResult, - PaUtilChannelDescriptor *hostInputChannels, - PaUtilChannelDescriptor *hostOutputChannels, - unsigned long framesToProcess ) -{ - void *userInput, *userOutput; - unsigned char *srcBytePtr, *destBytePtr; - unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ - unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ - unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ - unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ - unsigned int i; - unsigned long frameCount; - unsigned long framesToGo = framesToProcess; - unsigned long framesProcessed = 0; - - - if( *streamCallbackResult == paContinue ) - { - do - { - frameCount = PA_MIN_( bp->framesPerTempBuffer, framesToGo ); - - /* configure user input buffer and convert input data (host -> user) */ - if( bp->inputChannelCount == 0 ) - { - /* no input */ - userInput = 0; - } - else /* there are input channels */ - { - /* - could use more elaborate logic here and sometimes process - buffers in-place. - */ - - destBytePtr = (unsigned char *)bp->tempInputBuffer; - - if( bp->userInputIsInterleaved ) - { - destSampleStrideSamples = bp->inputChannelCount; - destChannelStrideBytes = bp->bytesPerUserInputSample; - userInput = bp->tempInputBuffer; - } - else /* user input is not interleaved */ - { - destSampleStrideSamples = 1; - destChannelStrideBytes = frameCount * bp->bytesPerUserInputSample; - - /* setup non-interleaved ptrs */ - for( i=0; iinputChannelCount; ++i ) - { - bp->tempInputBufferPtrs[i] = ((unsigned char*)bp->tempInputBuffer) + - i * bp->bytesPerUserInputSample * frameCount; - } - - userInput = bp->tempInputBufferPtrs; - } - - if( !bp->hostInputChannels[0][0].data ) - { - /* no input was supplied (see PaUtil_SetNoInput), so - zero the input buffer */ - - for( i=0; iinputChannelCount; ++i ) - { - bp->inputZeroer( destBytePtr, destSampleStrideSamples, frameCount ); - destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ - } - } - else - { - for( i=0; iinputChannelCount; ++i ) - { - bp->inputConverter( destBytePtr, destSampleStrideSamples, - hostInputChannels[i].data, - hostInputChannels[i].stride, - frameCount, &bp->ditherGenerator ); - - destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ - - /* advance src ptr for next iteration */ - hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + - frameCount * hostInputChannels[i].stride * bp->bytesPerHostInputSample; - } - } - } - - /* configure user output buffer */ - if( bp->outputChannelCount == 0 ) - { - /* no output */ - userOutput = 0; - } - else /* there are output channels */ - { - if( bp->userOutputIsInterleaved ) - { - userOutput = bp->tempOutputBuffer; - } - else /* user output is not interleaved */ - { - for( i = 0; i < bp->outputChannelCount; ++i ) - { - bp->tempOutputBufferPtrs[i] = ((unsigned char*)bp->tempOutputBuffer) + - i * bp->bytesPerUserOutputSample * frameCount; - } - - userOutput = bp->tempOutputBufferPtrs; - } - } - - *streamCallbackResult = bp->streamCallback( userInput, userOutput, - frameCount, bp->timeInfo, bp->callbackStatusFlags, bp->userData ); - - if( *streamCallbackResult == paAbort ) - { - /* callback returned paAbort, don't advance framesProcessed - and framesToGo, they will be handled below */ - } - else - { - bp->timeInfo->inputBufferAdcTime += frameCount * bp->samplePeriod; - bp->timeInfo->outputBufferDacTime += frameCount * bp->samplePeriod; - - /* convert output data (user -> host) */ - - if( bp->outputChannelCount != 0 && bp->hostOutputChannels[0][0].data ) - { - /* - could use more elaborate logic here and sometimes process - buffers in-place. - */ - - srcBytePtr = (unsigned char *)bp->tempOutputBuffer; - - if( bp->userOutputIsInterleaved ) - { - srcSampleStrideSamples = bp->outputChannelCount; - srcChannelStrideBytes = bp->bytesPerUserOutputSample; - } - else /* user output is not interleaved */ - { - srcSampleStrideSamples = 1; - srcChannelStrideBytes = frameCount * bp->bytesPerUserOutputSample; - } - - for( i=0; ioutputChannelCount; ++i ) - { - bp->outputConverter( hostOutputChannels[i].data, - hostOutputChannels[i].stride, - srcBytePtr, srcSampleStrideSamples, - frameCount, &bp->ditherGenerator ); - - srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ - - /* advance dest ptr for next iteration */ - hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + - frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; - } - } - - framesProcessed += frameCount; - - framesToGo -= frameCount; - } - } - while( framesToGo > 0 && *streamCallbackResult == paContinue ); - } - - if( framesToGo > 0 ) - { - /* zero any remaining frames output. There will only be remaining frames - if the callback has returned paComplete or paAbort */ - - frameCount = framesToGo; - - if( bp->outputChannelCount != 0 && bp->hostOutputChannels[0][0].data ) - { - for( i=0; ioutputChannelCount; ++i ) - { - bp->outputZeroer( hostOutputChannels[i].data, - hostOutputChannels[i].stride, - frameCount ); - - /* advance dest ptr for next iteration */ - hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + - frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; - } - } - - framesProcessed += frameCount; - } - - return framesProcessed; -} - - -/* - AdaptingInputOnlyProcess() is a half duplex input buffer processor. It - converts data from the input buffers into the temporary input buffer, - when the temporary input buffer is full, it calls the streamCallback. -*/ -static unsigned long AdaptingInputOnlyProcess( PaUtilBufferProcessor *bp, - int *streamCallbackResult, - PaUtilChannelDescriptor *hostInputChannels, - unsigned long framesToProcess ) -{ - void *userInput, *userOutput; - unsigned char *destBytePtr; - unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ - unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ - unsigned int i; - unsigned long frameCount; - unsigned long framesToGo = framesToProcess; - unsigned long framesProcessed = 0; - - userOutput = 0; - - do - { - frameCount = ( bp->framesInTempInputBuffer + framesToGo > bp->framesPerUserBuffer ) - ? ( bp->framesPerUserBuffer - bp->framesInTempInputBuffer ) - : framesToGo; - - /* convert frameCount samples into temp buffer */ - - if( bp->userInputIsInterleaved ) - { - destBytePtr = ((unsigned char*)bp->tempInputBuffer) + - bp->bytesPerUserInputSample * bp->inputChannelCount * - bp->framesInTempInputBuffer; - - destSampleStrideSamples = bp->inputChannelCount; - destChannelStrideBytes = bp->bytesPerUserInputSample; - - userInput = bp->tempInputBuffer; - } - else /* user input is not interleaved */ - { - destBytePtr = ((unsigned char*)bp->tempInputBuffer) + - bp->bytesPerUserInputSample * bp->framesInTempInputBuffer; - - destSampleStrideSamples = 1; - destChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserInputSample; - - /* setup non-interleaved ptrs */ - for( i=0; iinputChannelCount; ++i ) - { - bp->tempInputBufferPtrs[i] = ((unsigned char*)bp->tempInputBuffer) + - i * bp->bytesPerUserInputSample * bp->framesPerUserBuffer; - } - - userInput = bp->tempInputBufferPtrs; - } - - for( i=0; iinputChannelCount; ++i ) - { - bp->inputConverter( destBytePtr, destSampleStrideSamples, - hostInputChannels[i].data, - hostInputChannels[i].stride, - frameCount, &bp->ditherGenerator ); - - destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ - - /* advance src ptr for next iteration */ - hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + - frameCount * hostInputChannels[i].stride * bp->bytesPerHostInputSample; - } - - bp->framesInTempInputBuffer += frameCount; - - if( bp->framesInTempInputBuffer == bp->framesPerUserBuffer ) - { - /** - @todo (non-critical optimisation) - The conditional below implements the continue/complete/abort mechanism - simply by continuing on iterating through the input buffer, but not - passing the data to the callback. With care, the outer loop could be - terminated earlier, thus some unneeded conversion cycles would be - saved. - */ - if( *streamCallbackResult == paContinue ) - { - bp->timeInfo->outputBufferDacTime = 0; - - *streamCallbackResult = bp->streamCallback( userInput, userOutput, - bp->framesPerUserBuffer, bp->timeInfo, - bp->callbackStatusFlags, bp->userData ); - - bp->timeInfo->inputBufferAdcTime += frameCount * bp->samplePeriod; - } - - bp->framesInTempInputBuffer = 0; - } - - framesProcessed += frameCount; - - framesToGo -= frameCount; - }while( framesToGo > 0 ); - - return framesProcessed; -} - - -/* - AdaptingOutputOnlyProcess() is a half duplex output buffer processor. - It converts data from the temporary output buffer, to the output buffers, - when the temporary output buffer is empty, it calls the streamCallback. -*/ -static unsigned long AdaptingOutputOnlyProcess( PaUtilBufferProcessor *bp, - int *streamCallbackResult, - PaUtilChannelDescriptor *hostOutputChannels, - unsigned long framesToProcess ) -{ - void *userInput, *userOutput; - unsigned char *srcBytePtr; - unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ - unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ - unsigned int i; - unsigned long frameCount; - unsigned long framesToGo = framesToProcess; - unsigned long framesProcessed = 0; - - do - { - if( bp->framesInTempOutputBuffer == 0 && *streamCallbackResult == paContinue ) - { - userInput = 0; - - /* setup userOutput */ - if( bp->userOutputIsInterleaved ) - { - userOutput = bp->tempOutputBuffer; - } - else /* user output is not interleaved */ - { - for( i = 0; i < bp->outputChannelCount; ++i ) - { - bp->tempOutputBufferPtrs[i] = ((unsigned char*)bp->tempOutputBuffer) + - i * bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; - } - - userOutput = bp->tempOutputBufferPtrs; - } - - bp->timeInfo->inputBufferAdcTime = 0; - - *streamCallbackResult = bp->streamCallback( userInput, userOutput, - bp->framesPerUserBuffer, bp->timeInfo, - bp->callbackStatusFlags, bp->userData ); - - if( *streamCallbackResult == paAbort ) - { - /* if the callback returned paAbort, we disregard its output */ - } - else - { - bp->timeInfo->outputBufferDacTime += bp->framesPerUserBuffer * bp->samplePeriod; - - bp->framesInTempOutputBuffer = bp->framesPerUserBuffer; - } - } - - if( bp->framesInTempOutputBuffer > 0 ) - { - /* convert frameCount frames from user buffer to host buffer */ - - frameCount = PA_MIN_( bp->framesInTempOutputBuffer, framesToGo ); - - if( bp->userOutputIsInterleaved ) - { - srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + - bp->bytesPerUserOutputSample * bp->outputChannelCount * - (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); - - srcSampleStrideSamples = bp->outputChannelCount; - srcChannelStrideBytes = bp->bytesPerUserOutputSample; - } - else /* user output is not interleaved */ - { - srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + - bp->bytesPerUserOutputSample * - (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); - - srcSampleStrideSamples = 1; - srcChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; - } - - for( i=0; ioutputChannelCount; ++i ) - { - bp->outputConverter( hostOutputChannels[i].data, - hostOutputChannels[i].stride, - srcBytePtr, srcSampleStrideSamples, - frameCount, &bp->ditherGenerator ); - - srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ - - /* advance dest ptr for next iteration */ - hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + - frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; - } - - bp->framesInTempOutputBuffer -= frameCount; - } - else - { - /* no more user data is available because the callback has returned - paComplete or paAbort. Fill the remainder of the host buffer - with zeros. - */ - - frameCount = framesToGo; - - for( i=0; ioutputChannelCount; ++i ) - { - bp->outputZeroer( hostOutputChannels[i].data, - hostOutputChannels[i].stride, - frameCount ); - - /* advance dest ptr for next iteration */ - hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + - frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; - } - } - - framesProcessed += frameCount; - - framesToGo -= frameCount; - - }while( framesToGo > 0 ); - - return framesProcessed; -} - -/* CopyTempOutputBuffersToHostOutputBuffers is called from AdaptingProcess to copy frames from - tempOutputBuffer to hostOutputChannels. This includes data conversion - and interleaving. -*/ -static void CopyTempOutputBuffersToHostOutputBuffers( PaUtilBufferProcessor *bp) -{ - unsigned long maxFramesToCopy; - PaUtilChannelDescriptor *hostOutputChannels; - unsigned int frameCount; - unsigned char *srcBytePtr; - unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ - unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ - unsigned int i; - - /* copy frames from user to host output buffers */ - while( bp->framesInTempOutputBuffer > 0 && - ((bp->hostOutputFrameCount[0] + bp->hostOutputFrameCount[1]) > 0) ) - { - maxFramesToCopy = bp->framesInTempOutputBuffer; - - /* select the output buffer set (1st or 2nd) */ - if( bp->hostOutputFrameCount[0] > 0 ) - { - hostOutputChannels = bp->hostOutputChannels[0]; - frameCount = PA_MIN_( bp->hostOutputFrameCount[0], maxFramesToCopy ); - } - else - { - hostOutputChannels = bp->hostOutputChannels[1]; - frameCount = PA_MIN_( bp->hostOutputFrameCount[1], maxFramesToCopy ); - } - - if( bp->userOutputIsInterleaved ) - { - srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + - bp->bytesPerUserOutputSample * bp->outputChannelCount * - (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); - - srcSampleStrideSamples = bp->outputChannelCount; - srcChannelStrideBytes = bp->bytesPerUserOutputSample; - } - else /* user output is not interleaved */ - { - srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + - bp->bytesPerUserOutputSample * - (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); - - srcSampleStrideSamples = 1; - srcChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; - } - - for( i=0; ioutputChannelCount; ++i ) - { - assert( hostOutputChannels[i].data != NULL ); - bp->outputConverter( hostOutputChannels[i].data, - hostOutputChannels[i].stride, - srcBytePtr, srcSampleStrideSamples, - frameCount, &bp->ditherGenerator ); - - srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ - - /* advance dest ptr for next iteration */ - hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + - frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; - } - - if( bp->hostOutputFrameCount[0] > 0 ) - bp->hostOutputFrameCount[0] -= frameCount; - else - bp->hostOutputFrameCount[1] -= frameCount; - - bp->framesInTempOutputBuffer -= frameCount; - } -} - -/* - AdaptingProcess is a full duplex adapting buffer processor. It converts - data from the temporary output buffer into the host output buffers, then - from the host input buffers into the temporary input buffers. Calling the - streamCallback when necessary. - When processPartialUserBuffers is 0, all available input data will be - consumed and all available output space will be filled. When - processPartialUserBuffers is non-zero, as many full user buffers - as possible will be processed, but partial buffers will not be consumed. -*/ -static unsigned long AdaptingProcess( PaUtilBufferProcessor *bp, - int *streamCallbackResult, int processPartialUserBuffers ) -{ - void *userInput, *userOutput; - unsigned long framesProcessed = 0; - unsigned long framesAvailable; - unsigned long endProcessingMinFrameCount; - unsigned long maxFramesToCopy; - PaUtilChannelDescriptor *hostInputChannels, *hostOutputChannels; - unsigned int frameCount; - unsigned char *destBytePtr; - unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ - unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ - unsigned int i, j; - - - framesAvailable = bp->hostInputFrameCount[0] + bp->hostInputFrameCount[1];/* this is assumed to be the same as the output buffer's frame count */ - - if( processPartialUserBuffers ) - endProcessingMinFrameCount = 0; - else - endProcessingMinFrameCount = (bp->framesPerUserBuffer - 1); - - /* Fill host output with remaining frames in user output (tempOutputBuffer) */ - CopyTempOutputBuffersToHostOutputBuffers( bp ); - - while( framesAvailable > endProcessingMinFrameCount ) - { - - if( bp->framesInTempOutputBuffer == 0 && *streamCallbackResult != paContinue ) - { - /* the callback will not be called any more, so zero what remains - of the host output buffers */ - - for( i=0; i<2; ++i ) - { - frameCount = bp->hostOutputFrameCount[i]; - if( frameCount > 0 ) - { - hostOutputChannels = bp->hostOutputChannels[i]; - - for( j=0; joutputChannelCount; ++j ) - { - bp->outputZeroer( hostOutputChannels[j].data, - hostOutputChannels[j].stride, - frameCount ); - - /* advance dest ptr for next iteration */ - hostOutputChannels[j].data = ((unsigned char*)hostOutputChannels[j].data) + - frameCount * hostOutputChannels[j].stride * bp->bytesPerHostOutputSample; - } - bp->hostOutputFrameCount[i] = 0; - } - } - } - - - /* copy frames from host to user input buffers */ - while( bp->framesInTempInputBuffer < bp->framesPerUserBuffer && - ((bp->hostInputFrameCount[0] + bp->hostInputFrameCount[1]) > 0) ) - { - maxFramesToCopy = bp->framesPerUserBuffer - bp->framesInTempInputBuffer; - - /* select the input buffer set (1st or 2nd) */ - if( bp->hostInputFrameCount[0] > 0 ) - { - hostInputChannels = bp->hostInputChannels[0]; - frameCount = PA_MIN_( bp->hostInputFrameCount[0], maxFramesToCopy ); - } - else - { - hostInputChannels = bp->hostInputChannels[1]; - frameCount = PA_MIN_( bp->hostInputFrameCount[1], maxFramesToCopy ); - } - - /* configure conversion destination pointers */ - if( bp->userInputIsInterleaved ) - { - destBytePtr = ((unsigned char*)bp->tempInputBuffer) + - bp->bytesPerUserInputSample * bp->inputChannelCount * - bp->framesInTempInputBuffer; - - destSampleStrideSamples = bp->inputChannelCount; - destChannelStrideBytes = bp->bytesPerUserInputSample; - } - else /* user input is not interleaved */ - { - destBytePtr = ((unsigned char*)bp->tempInputBuffer) + - bp->bytesPerUserInputSample * bp->framesInTempInputBuffer; - - destSampleStrideSamples = 1; - destChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserInputSample; - } - - for( i=0; iinputChannelCount; ++i ) - { - bp->inputConverter( destBytePtr, destSampleStrideSamples, - hostInputChannels[i].data, - hostInputChannels[i].stride, - frameCount, &bp->ditherGenerator ); - - destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ - - /* advance src ptr for next iteration */ - hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + - frameCount * hostInputChannels[i].stride * bp->bytesPerHostInputSample; - } - - if( bp->hostInputFrameCount[0] > 0 ) - bp->hostInputFrameCount[0] -= frameCount; - else - bp->hostInputFrameCount[1] -= frameCount; - - bp->framesInTempInputBuffer += frameCount; - - /* update framesAvailable and framesProcessed based on input consumed - unless something is very wrong this will also correspond to the - amount of output generated */ - framesAvailable -= frameCount; - framesProcessed += frameCount; - } - - /* call streamCallback */ - if( bp->framesInTempInputBuffer == bp->framesPerUserBuffer && - bp->framesInTempOutputBuffer == 0 ) - { - if( *streamCallbackResult == paContinue ) - { - /* setup userInput */ - if( bp->userInputIsInterleaved ) - { - userInput = bp->tempInputBuffer; - } - else /* user input is not interleaved */ - { - for( i = 0; i < bp->inputChannelCount; ++i ) - { - bp->tempInputBufferPtrs[i] = ((unsigned char*)bp->tempInputBuffer) + - i * bp->framesPerUserBuffer * bp->bytesPerUserInputSample; - } - - userInput = bp->tempInputBufferPtrs; - } - - /* setup userOutput */ - if( bp->userOutputIsInterleaved ) - { - userOutput = bp->tempOutputBuffer; - } - else /* user output is not interleaved */ - { - for( i = 0; i < bp->outputChannelCount; ++i ) - { - bp->tempOutputBufferPtrs[i] = ((unsigned char*)bp->tempOutputBuffer) + - i * bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; - } - - userOutput = bp->tempOutputBufferPtrs; - } - - /* call streamCallback */ - - *streamCallbackResult = bp->streamCallback( userInput, userOutput, - bp->framesPerUserBuffer, bp->timeInfo, - bp->callbackStatusFlags, bp->userData ); - - bp->timeInfo->inputBufferAdcTime += bp->framesPerUserBuffer * bp->samplePeriod; - bp->timeInfo->outputBufferDacTime += bp->framesPerUserBuffer * bp->samplePeriod; - - bp->framesInTempInputBuffer = 0; - - if( *streamCallbackResult == paAbort ) - bp->framesInTempOutputBuffer = 0; - else - bp->framesInTempOutputBuffer = bp->framesPerUserBuffer; - } - else - { - /* paComplete or paAbort has already been called. */ - - bp->framesInTempInputBuffer = 0; - } - } - - /* copy frames from user (tempOutputBuffer) to host output buffers (hostOutputChannels) - Means to process the user output provided by the callback. Has to be called after - each callback. */ - CopyTempOutputBuffersToHostOutputBuffers( bp ); - - } - - return framesProcessed; -} - - -unsigned long PaUtil_EndBufferProcessing( PaUtilBufferProcessor* bp, int *streamCallbackResult ) -{ - unsigned long framesToProcess, framesToGo; - unsigned long framesProcessed = 0; - - if( bp->inputChannelCount != 0 && bp->outputChannelCount != 0 - && bp->hostInputChannels[0][0].data /* input was supplied (see PaUtil_SetNoInput) */ - && bp->hostOutputChannels[0][0].data /* output was supplied (see PaUtil_SetNoOutput) */ ) - { - assert( (bp->hostInputFrameCount[0] + bp->hostInputFrameCount[1]) == - (bp->hostOutputFrameCount[0] + bp->hostOutputFrameCount[1]) ); - } - - assert( *streamCallbackResult == paContinue - || *streamCallbackResult == paComplete - || *streamCallbackResult == paAbort ); /* don't forget to pass in a valid callback result value */ - - if( bp->useNonAdaptingProcess ) - { - if( bp->inputChannelCount != 0 && bp->outputChannelCount != 0 ) - { - /* full duplex non-adapting process, splice buffers if they are - different lengths */ - - framesToGo = bp->hostOutputFrameCount[0] + bp->hostOutputFrameCount[1]; /* relies on assert above for input/output equivalence */ - - do{ - unsigned long noInputInputFrameCount; - unsigned long *hostInputFrameCount; - PaUtilChannelDescriptor *hostInputChannels; - unsigned long noOutputOutputFrameCount; - unsigned long *hostOutputFrameCount; - PaUtilChannelDescriptor *hostOutputChannels; - unsigned long framesProcessedThisIteration; - - if( !bp->hostInputChannels[0][0].data ) - { - /* no input was supplied (see PaUtil_SetNoInput) - NonAdaptingProcess knows how to deal with this - */ - noInputInputFrameCount = framesToGo; - hostInputFrameCount = &noInputInputFrameCount; - hostInputChannels = 0; - } - else if( bp->hostInputFrameCount[0] != 0 ) - { - hostInputFrameCount = &bp->hostInputFrameCount[0]; - hostInputChannels = bp->hostInputChannels[0]; - } - else - { - hostInputFrameCount = &bp->hostInputFrameCount[1]; - hostInputChannels = bp->hostInputChannels[1]; - } - - if( !bp->hostOutputChannels[0][0].data ) - { - /* no output was supplied (see PaUtil_SetNoOutput) - NonAdaptingProcess knows how to deal with this - */ - noOutputOutputFrameCount = framesToGo; - hostOutputFrameCount = &noOutputOutputFrameCount; - hostOutputChannels = 0; - } - if( bp->hostOutputFrameCount[0] != 0 ) - { - hostOutputFrameCount = &bp->hostOutputFrameCount[0]; - hostOutputChannels = bp->hostOutputChannels[0]; - } - else - { - hostOutputFrameCount = &bp->hostOutputFrameCount[1]; - hostOutputChannels = bp->hostOutputChannels[1]; - } - - framesToProcess = PA_MIN_( *hostInputFrameCount, - *hostOutputFrameCount ); - - assert( framesToProcess != 0 ); - - framesProcessedThisIteration = NonAdaptingProcess( bp, streamCallbackResult, - hostInputChannels, hostOutputChannels, - framesToProcess ); - - *hostInputFrameCount -= framesProcessedThisIteration; - *hostOutputFrameCount -= framesProcessedThisIteration; - - framesProcessed += framesProcessedThisIteration; - framesToGo -= framesProcessedThisIteration; - - }while( framesToGo > 0 ); - } - else - { - /* half duplex non-adapting process, just process 1st and 2nd buffer */ - /* process first buffer */ - - framesToProcess = (bp->inputChannelCount != 0) - ? bp->hostInputFrameCount[0] - : bp->hostOutputFrameCount[0]; - - framesProcessed = NonAdaptingProcess( bp, streamCallbackResult, - bp->hostInputChannels[0], bp->hostOutputChannels[0], - framesToProcess ); - - /* process second buffer if provided */ - - framesToProcess = (bp->inputChannelCount != 0) - ? bp->hostInputFrameCount[1] - : bp->hostOutputFrameCount[1]; - if( framesToProcess > 0 ) - { - framesProcessed += NonAdaptingProcess( bp, streamCallbackResult, - bp->hostInputChannels[1], bp->hostOutputChannels[1], - framesToProcess ); - } - } - } - else /* block adaption necessary*/ - { - - if( bp->inputChannelCount != 0 && bp->outputChannelCount != 0 ) - { - /* full duplex */ - - if( bp->hostBufferSizeMode == paUtilVariableHostBufferSizePartialUsageAllowed ) - { - framesProcessed = AdaptingProcess( bp, streamCallbackResult, - 0 /* dont process partial user buffers */ ); - } - else - { - framesProcessed = AdaptingProcess( bp, streamCallbackResult, - 1 /* process partial user buffers */ ); - } - } - else if( bp->inputChannelCount != 0 ) - { - /* input only */ - framesToProcess = bp->hostInputFrameCount[0]; - - framesProcessed = AdaptingInputOnlyProcess( bp, streamCallbackResult, - bp->hostInputChannels[0], framesToProcess ); - - framesToProcess = bp->hostInputFrameCount[1]; - if( framesToProcess > 0 ) - { - framesProcessed += AdaptingInputOnlyProcess( bp, streamCallbackResult, - bp->hostInputChannels[1], framesToProcess ); - } - } - else - { - /* output only */ - framesToProcess = bp->hostOutputFrameCount[0]; - - framesProcessed = AdaptingOutputOnlyProcess( bp, streamCallbackResult, - bp->hostOutputChannels[0], framesToProcess ); - - framesToProcess = bp->hostOutputFrameCount[1]; - if( framesToProcess > 0 ) - { - framesProcessed += AdaptingOutputOnlyProcess( bp, streamCallbackResult, - bp->hostOutputChannels[1], framesToProcess ); - } - } - } - - return framesProcessed; -} - - -int PaUtil_IsBufferProcessorOutputEmpty( PaUtilBufferProcessor* bp ) -{ - return (bp->framesInTempOutputBuffer) ? 0 : 1; -} - - -unsigned long PaUtil_CopyInput( PaUtilBufferProcessor* bp, - void **buffer, unsigned long frameCount ) -{ - PaUtilChannelDescriptor *hostInputChannels; - unsigned int framesToCopy; - unsigned char *destBytePtr; - void **nonInterleavedDestPtrs; - unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ - unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ - unsigned int i; - - hostInputChannels = bp->hostInputChannels[0]; - framesToCopy = PA_MIN_( bp->hostInputFrameCount[0], frameCount ); - - if( bp->userInputIsInterleaved ) - { - destBytePtr = (unsigned char*)*buffer; - - destSampleStrideSamples = bp->inputChannelCount; - destChannelStrideBytes = bp->bytesPerUserInputSample; - - for( i=0; iinputChannelCount; ++i ) - { - bp->inputConverter( destBytePtr, destSampleStrideSamples, - hostInputChannels[i].data, - hostInputChannels[i].stride, - framesToCopy, &bp->ditherGenerator ); - - destBytePtr += destChannelStrideBytes; /* skip to next source channel */ - - /* advance dest ptr for next iteration */ - hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + - framesToCopy * hostInputChannels[i].stride * bp->bytesPerHostInputSample; - } - - /* advance callers dest pointer (buffer) */ - *buffer = ((unsigned char *)*buffer) + - framesToCopy * bp->inputChannelCount * bp->bytesPerUserInputSample; - } - else - { - /* user input is not interleaved */ - - nonInterleavedDestPtrs = (void**)*buffer; - - destSampleStrideSamples = 1; - - for( i=0; iinputChannelCount; ++i ) - { - destBytePtr = (unsigned char*)nonInterleavedDestPtrs[i]; - - bp->inputConverter( destBytePtr, destSampleStrideSamples, - hostInputChannels[i].data, - hostInputChannels[i].stride, - framesToCopy, &bp->ditherGenerator ); - - /* advance callers dest pointer (nonInterleavedDestPtrs[i]) */ - destBytePtr += bp->bytesPerUserInputSample * framesToCopy; - nonInterleavedDestPtrs[i] = destBytePtr; - - /* advance dest ptr for next iteration */ - hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + - framesToCopy * hostInputChannels[i].stride * bp->bytesPerHostInputSample; - } - } - - bp->hostInputFrameCount[0] -= framesToCopy; - - return framesToCopy; -} - -unsigned long PaUtil_CopyOutput( PaUtilBufferProcessor* bp, - const void ** buffer, unsigned long frameCount ) -{ - PaUtilChannelDescriptor *hostOutputChannels; - unsigned int framesToCopy; - unsigned char *srcBytePtr; - void **nonInterleavedSrcPtrs; - unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ - unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ - unsigned int i; - - hostOutputChannels = bp->hostOutputChannels[0]; - framesToCopy = PA_MIN_( bp->hostOutputFrameCount[0], frameCount ); - - if( bp->userOutputIsInterleaved ) - { - srcBytePtr = (unsigned char*)*buffer; - - srcSampleStrideSamples = bp->outputChannelCount; - srcChannelStrideBytes = bp->bytesPerUserOutputSample; - - for( i=0; ioutputChannelCount; ++i ) - { - bp->outputConverter( hostOutputChannels[i].data, - hostOutputChannels[i].stride, - srcBytePtr, srcSampleStrideSamples, - framesToCopy, &bp->ditherGenerator ); - - srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ - - /* advance dest ptr for next iteration */ - hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + - framesToCopy * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; - } - - /* advance callers source pointer (buffer) */ - *buffer = ((unsigned char *)*buffer) + - framesToCopy * bp->outputChannelCount * bp->bytesPerUserOutputSample; - - } - else - { - /* user output is not interleaved */ - - nonInterleavedSrcPtrs = (void**)*buffer; - - srcSampleStrideSamples = 1; - - for( i=0; ioutputChannelCount; ++i ) - { - srcBytePtr = (unsigned char*)nonInterleavedSrcPtrs[i]; - - bp->outputConverter( hostOutputChannels[i].data, - hostOutputChannels[i].stride, - srcBytePtr, srcSampleStrideSamples, - framesToCopy, &bp->ditherGenerator ); - - - /* advance callers source pointer (nonInterleavedSrcPtrs[i]) */ - srcBytePtr += bp->bytesPerUserOutputSample * framesToCopy; - nonInterleavedSrcPtrs[i] = srcBytePtr; - - /* advance dest ptr for next iteration */ - hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + - framesToCopy * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; - } - } - - bp->hostOutputFrameCount[0] += framesToCopy; - - return framesToCopy; -} - - -unsigned long PaUtil_ZeroOutput( PaUtilBufferProcessor* bp, unsigned long frameCount ) -{ - PaUtilChannelDescriptor *hostOutputChannels; - unsigned int framesToZero; - unsigned int i; - - hostOutputChannels = bp->hostOutputChannels[0]; - framesToZero = PA_MIN_( bp->hostOutputFrameCount[0], frameCount ); - - for( i=0; ioutputChannelCount; ++i ) - { - bp->outputZeroer( hostOutputChannels[i].data, - hostOutputChannels[i].stride, - framesToZero ); - - - /* advance dest ptr for next iteration */ - hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + - framesToZero * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; - } - - bp->hostOutputFrameCount[0] += framesToZero; - - return framesToZero; -} diff --git a/portaudio-v19/pa_common/pa_process.h b/portaudio-v19/pa_common/pa_process.h deleted file mode 100644 index 8d13d903a..000000000 --- a/portaudio-v19/pa_common/pa_process.h +++ /dev/null @@ -1,741 +0,0 @@ -#ifndef PA_PROCESS_H -#define PA_PROCESS_H -/* - * $Id$ - * Portable Audio I/O Library callback buffer processing adapters - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Buffer Processor prototypes. A Buffer Processor performs buffer length - adaption, coordinates sample format conversion, and interleaves/deinterleaves - channels. - -

    Overview

    - - The "Buffer Processor" (PaUtilBufferProcessor) manages conversion of audio - data from host buffers to user buffers and back again. Where required, the - buffer processor takes care of converting between host and user sample formats, - interleaving and deinterleaving multichannel buffers, and adapting between host - and user buffers with different lengths. The buffer processor may be used with - full and half duplex streams, for both callback streams and blocking read/write - streams. - - One of the important capabilities provided by the buffer processor is - the ability to adapt between user and host buffer sizes of different lengths - with minimum latency. Although this task is relatively easy to perform when - the host buffer size is an integer multiple of the user buffer size, the - problem is more complicated when this is not the case - especially for - full-duplex callback streams. Where necessary the adaption is implemented by - internally buffering some input and/or output data. The buffer adation - algorithm used by the buffer processor was originally implemented by - Stephan Letz for the ASIO version of PortAudio, and is described in his - Callback_adaption_.pdf which is included in the distribution. - - The buffer processor performs sample conversion using the functions provided - by pa_converters.c. - - The following sections provide an overview of how to use the buffer processor. - Interested readers are advised to consult the host API implementations for - examples of buffer processor usage. - - -

    Initialization, resetting and termination

    - - When a stream is opened, the buffer processor should be initialized using - PaUtil_InitializeBufferProcessor. This function initializes internal state - and allocates temporary buffers as neccesary according to the supplied - configuration parameters. Some of the parameters correspond to those requested - by the user in their call to Pa_OpenStream(), others reflect the requirements - of the host API implementation - they indicate host buffer sizes, formats, - and the type of buffering which the Host API uses. The buffer processor should - be initialized for callback streams and blocking read/write streams. - - Call PaUtil_ResetBufferProcessor to clear any sample data which is present - in the buffer processor before starting to use it (for example when - Pa_StartStream is called). - - When the buffer processor is no longer used call - PaUtil_TerminateBufferProcessor. - - -

    Using the buffer processor for a callback stream

    - - The buffer processor's role in a callback stream is to take host input buffers - process them with the stream callback, and fill host output buffers. For a - full duplex stream, the buffer processor handles input and output simultaneously - due to the requirements of the minimum-latency buffer adation algorithm. - - When a host buffer becomes available, the implementation should call - the buffer processor to process the buffer. The buffer processor calls the - stream callback to consume and/or produce audio data as necessary. The buffer - processor will convert sample formats, interleave/deinterleave channels, - and slice or chunk the data to the appropriate buffer lengths according to - the requirements of the stream callback and the host API. - - To process a host buffer (or a pair of host buffers for a full-duplex stream) - use the following calling sequence: - - -# Call PaUtil_BeginBufferProcessing - -# For a stream which takes input: - - Call PaUtil_SetInputFrameCount with the number of frames in the host input - buffer. - - Call one of the following functions one or more times to tell the - buffer processor about the host input buffer(s): PaUtil_SetInputChannel, - PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel. - Which function you call will depend on whether the host buffer(s) are - interleaved or not. - - If the available host data is split accross two buffers (for example a - data range at the end of a circular buffer and another range at the - beginning of the circular buffer), also call - PaUtil_Set2ndInputFrameCount, PaUtil_Set2ndInputChannel, - PaUtil_Set2ndInterleavedInputChannels, - PaUtil_Set2ndNonInterleavedInputChannel as necessary to tell the buffer - processor about the second buffer. - -# For a stream which generates output: - - Call PaUtil_SetOutputFrameCount with the number of frames in the host - output buffer. - - Call one of the following functions one or more times to tell the - buffer processor about the host output buffer(s): PaUtil_SetOutputChannel, - PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel. - Which function you call will depend on whether the host buffer(s) are - interleaved or not. - - If the available host output buffer space is split accross two buffers - (for example a data range at the end of a circular buffer and another - range at the beginning of the circular buffer), call - PaUtil_Set2ndOutputFrameCount, PaUtil_Set2ndOutputChannel, - PaUtil_Set2ndInterleavedOutputChannels, - PaUtil_Set2ndNonInterleavedOutputChannel as necessary to tell the buffer - processor about the second buffer. - -# Call PaUtil_EndBufferProcessing, this function performs the actual data - conversion and processing. - - -

    Using the buffer processor for a blocking read/write stream

    - - Blocking read/write streams use the buffer processor to convert and copy user - output data to a host buffer, and to convert and copy host input data to - the user's buffer. The buffer processor does not perform any buffer adaption. - When using the buffer processor in a blocking read/write stream the input and - output conversion are performed separately by the PaUtil_CopyInput and - PaUtil_CopyOutput functions. - - To copy data from a host input buffer to the buffer(s) which the user supplies - to Pa_ReadStream, use the following calling sequence. - - - Repeat the following three steps until the user buffer(s) have been filled - with samples from the host input buffers: - -# Call PaUtil_SetInputFrameCount with the number of frames in the host - input buffer. - -# Call one of the following functions one or more times to tell the - buffer processor about the host input buffer(s): PaUtil_SetInputChannel, - PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel. - Which function you call will depend on whether the host buffer(s) are - interleaved or not. - -# Call PaUtil_CopyInput with the user buffer pointer (or a copy of the - array of buffer pointers for a non-interleaved stream) passed to - Pa_ReadStream, along with the number of frames in the user buffer(s). - Be careful to pass a copy of the user buffer pointers to - PaUtil_CopyInput because PaUtil_CopyInput advances the pointers to - the start of the next region to copy. - - PaUtil_CopyInput will not copy more data than is available in the - host buffer(s), so the above steps need to be repeated until the user - buffer(s) are full. - - - To copy data to the host output buffer from the user buffers(s) supplied - to Pa_WriteStream use the following calling sequence. - - - Repeat the following three steps until all frames from the user buffer(s) - have been copied to the host API: - -# Call PaUtil_SetOutputFrameCount with the number of frames in the host - output buffer. - -# Call one of the following functions one or more times to tell the - buffer processor about the host output buffer(s): PaUtil_SetOutputChannel, - PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel. - Which function you call will depend on whether the host buffer(s) are - interleaved or not. - -# Call PaUtil_CopyOutput with the user buffer pointer (or a copy of the - array of buffer pointers for a non-interleaved stream) passed to - Pa_WriteStream, along with the number of frames in the user buffer(s). - Be careful to pass a copy of the user buffer pointers to - PaUtil_CopyOutput because PaUtil_CopyOutput advances the pointers to - the start of the next region to copy. - - PaUtil_CopyOutput will not copy more data than fits in the host buffer(s), - so the above steps need to be repeated until all user data is copied. -*/ - - -#include "portaudio.h" -#include "pa_converters.h" -#include "pa_dither.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -/** @brief Mode flag passed to PaUtil_InitializeBufferProcessor indicating the type - of buffering that the host API uses. - - The mode used depends on whether the host API or the implementation manages - the buffers, and how these buffers are used (scatter gather, circular buffer). -*/ -typedef enum { -/** The host buffer size is a fixed known size. */ - paUtilFixedHostBufferSize, - -/** The host buffer size may vary, but has a known maximum size. */ - paUtilBoundedHostBufferSize, - -/** Nothing is known about the host buffer size. */ - paUtilUnknownHostBufferSize, - -/** The host buffer size varies, and the client does not require the buffer - processor to consume all of the input and fill all of the output buffer. This - is useful when the implementation has access to the host API's circular buffer - and only needs to consume/fill some of it, not necessarily all of it, with each - call to the buffer processor. This is the only mode where - PaUtil_EndBufferProcessing() may not consume the whole buffer. -*/ - paUtilVariableHostBufferSizePartialUsageAllowed -}PaUtilHostBufferSizeMode; - - -/** @brief An auxilliary data structure used internally by the buffer processor - to represent host input and output buffers. */ -typedef struct PaUtilChannelDescriptor{ - void *data; - unsigned int stride; /**< stride in samples, not bytes */ -}PaUtilChannelDescriptor; - - -/** @brief The main buffer processor data structure. - - Allocate one of these, initialize it with PaUtil_InitializeBufferProcessor - and terminate it with PaUtil_TerminateBufferProcessor. -*/ -typedef struct { - unsigned long framesPerUserBuffer; - unsigned long framesPerHostBuffer; - - PaUtilHostBufferSizeMode hostBufferSizeMode; - int useNonAdaptingProcess; - unsigned long framesPerTempBuffer; - - unsigned int inputChannelCount; - unsigned int bytesPerHostInputSample; - unsigned int bytesPerUserInputSample; - int userInputIsInterleaved; - PaUtilConverter *inputConverter; - PaUtilZeroer *inputZeroer; - - unsigned int outputChannelCount; - unsigned int bytesPerHostOutputSample; - unsigned int bytesPerUserOutputSample; - int userOutputIsInterleaved; - PaUtilConverter *outputConverter; - PaUtilZeroer *outputZeroer; - - unsigned long initialFramesInTempInputBuffer; - unsigned long initialFramesInTempOutputBuffer; - - void *tempInputBuffer; /**< used for slips, block adaption, and conversion. */ - void **tempInputBufferPtrs; /**< storage for non-interleaved buffer pointers, NULL for interleaved user input */ - unsigned long framesInTempInputBuffer; /**< frames remaining in input buffer from previous adaption iteration */ - - void *tempOutputBuffer; /**< used for slips, block adaption, and conversion. */ - void **tempOutputBufferPtrs; /**< storage for non-interleaved buffer pointers, NULL for interleaved user output */ - unsigned long framesInTempOutputBuffer; /**< frames remaining in input buffer from previous adaption iteration */ - - PaStreamCallbackTimeInfo *timeInfo; - - PaStreamCallbackFlags callbackStatusFlags; - - unsigned long hostInputFrameCount[2]; - PaUtilChannelDescriptor *hostInputChannels[2]; /**< pointers to arrays of channel descriptors. - pointers are NULL for half-duplex output processing. - hostInputChannels[i].data is NULL when the caller - calls PaUtil_SetNoInput() - */ - unsigned long hostOutputFrameCount[2]; - PaUtilChannelDescriptor *hostOutputChannels[2]; /**< pointers to arrays of channel descriptors. - pointers are NULL for half-duplex input processing. - hostOutputChannels[i].data is NULL when the caller - calls PaUtil_SetNoOutput() - */ - - PaUtilTriangularDitherGenerator ditherGenerator; - - double samplePeriod; - - PaStreamCallback *streamCallback; - void *userData; -} PaUtilBufferProcessor; - - -/** @name Initialization, termination, resetting and info */ -/*@{*/ - -/** Initialize a buffer processor's representation stored in a - PaUtilBufferProcessor structure. Be sure to call - PaUtil_TerminateBufferProcessor after finishing with a buffer processor. - - @param bufferProcessor The buffer processor structure to initialize. - - @param inputChannelCount The number of input channels as passed to - Pa_OpenStream or 0 for an output-only stream. - - @param userInputSampleFormat Format of user input samples, as passed to - Pa_OpenStream. This parameter is ignored for ouput-only streams. - - @param hostInputSampleFormat Format of host input samples. This parameter is - ignored for output-only streams. See note about host buffer interleave below. - - @param outputChannelCount The number of output channels as passed to - Pa_OpenStream or 0 for an input-only stream. - - @param userOutputSampleFormat Format of user output samples, as passed to - Pa_OpenStream. This parameter is ignored for input-only streams. - - @param hostOutputSampleFormat Format of host output samples. This parameter is - ignored for input-only streams. See note about host buffer interleave below. - - @param sampleRate Sample rate of the stream. The more accurate this is the - better - it is used for updating time stamps when adapting buffers. - - @param streamFlags Stream flags as passed to Pa_OpenStream, this parameter is - used for selecting special sample conversion options such as clipping and - dithering. - - @param framesPerUserBuffer Number of frames per user buffer, as requested - by the framesPerBuffer parameter to Pa_OpenStream. This parameter may be - zero to indicate that the user will accept any (and varying) buffer sizes. - - @param framesPerHostBuffer Specifies the number of frames per host buffer - for the fixed buffer size mode, and the maximum number of frames - per host buffer for the bounded host buffer size mode. It is ignored for - the other modes. - - @param hostBufferSizeMode A mode flag indicating the size variability of - host buffers that will be passed to the buffer processor. See - PaUtilHostBufferSizeMode for further details. - - @param streamCallback The user stream callback passed to Pa_OpenStream. - - @param userData The user data field passed to Pa_OpenStream. - - @note The interleave flag is ignored for host buffer formats. Host - interleave is determined by the use of different SetInput and SetOutput - functions. - - @return An error code indicating whether the initialization was successful. - If the error code is not PaNoError, the buffer processor was not initialized - and should not be used. - - @see Pa_OpenStream, PaUtilHostBufferSizeMode, PaUtil_TerminateBufferProcessor -*/ -PaError PaUtil_InitializeBufferProcessor( PaUtilBufferProcessor* bufferProcessor, - int inputChannelCount, PaSampleFormat userInputSampleFormat, - PaSampleFormat hostInputSampleFormat, - int outputChannelCount, PaSampleFormat userOutputSampleFormat, - PaSampleFormat hostOutputSampleFormat, - double sampleRate, - PaStreamFlags streamFlags, - unsigned long framesPerUserBuffer, /* 0 indicates don't care */ - unsigned long framesPerHostBuffer, - PaUtilHostBufferSizeMode hostBufferSizeMode, - PaStreamCallback *streamCallback, void *userData ); - - -/** Terminate a buffer processor's representation. Deallocates any temporary - buffers allocated by PaUtil_InitializeBufferProcessor. - - @param bufferProcessor The buffer processor structure to terminate. - - @see PaUtil_InitializeBufferProcessor. -*/ -void PaUtil_TerminateBufferProcessor( PaUtilBufferProcessor* bufferProcessor ); - - -/** Clear any internally buffered data. If you call - PaUtil_InitializeBufferProcessor in your OpenStream routine, make sure you - call PaUtil_ResetBufferProcessor in your StartStream call. - - @param bufferProcessor The buffer processor to reset. -*/ -void PaUtil_ResetBufferProcessor( PaUtilBufferProcessor* bufferProcessor ); - - -/** Retrieve the input latency of a buffer processor. - - @param bufferProcessor The buffer processor examine. - - @return The input latency introduced by the buffer processor, in frames. - - @see PaUtil_GetBufferProcessorOutputLatency -*/ -unsigned long PaUtil_GetBufferProcessorInputLatency( PaUtilBufferProcessor* bufferProcessor ); - -/** Retrieve the output latency of a buffer processor. - - @param bufferProcessor The buffer processor examine. - - @return The output latency introduced by the buffer processor, in frames. - - @see PaUtil_GetBufferProcessorInputLatency -*/ -unsigned long PaUtil_GetBufferProcessorOutputLatency( PaUtilBufferProcessor* bufferProcessor ); - -/*@}*/ - - -/** @name Host buffer pointer configuration - - Functions to set host input and output buffers, used by both callback streams - and blocking read/write streams. -*/ -/*@{*/ - - -/** Set the number of frames in the input host buffer(s) specified by the - PaUtil_Set*InputChannel functions. - - @param bufferProcessor The buffer processor. - - @param frameCount The number of host input frames. A 0 frameCount indicates to - use the framesPerHostBuffer value passed to PaUtil_InitializeBufferProcessor. - - @see PaUtil_SetNoInput, PaUtil_SetInputChannel, - PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel -*/ -void PaUtil_SetInputFrameCount( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - - -/** Indicate that no input is avalable. This function should be used when - priming the output of a full-duplex stream opened with the - paPrimeOutputBuffersUsingStreamCallback flag. Note that it is not necessary - to call this or any othe PaUtil_Set*Input* functions for ouput-only streams. - - @param bufferProcessor The buffer processor. -*/ -void PaUtil_SetNoInput( PaUtilBufferProcessor* bufferProcessor ); - - -/** Provide the buffer processor with a pointer to a host input channel. - - @param bufferProcessor The buffer processor. - @param channel The channel number. - @param data The buffer. - @param stride The stride from one sample to the next, in samples. For - interleaved host buffers, the stride will usually be the same as the number of - channels in the buffer. -*/ -void PaUtil_SetInputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data, unsigned int stride ); - - -/** Provide the buffer processor with a pointer to an number of interleaved - host input channels. - - @param bufferProcessor The buffer processor. - @param firstChannel The first channel number. - @param data The buffer. - @param channelCount The number of interleaved channels in the buffer. If - channelCount is zero, the number of channels specified to - PaUtil_InitializeBufferProcessor will be used. -*/ -void PaUtil_SetInterleavedInputChannels( PaUtilBufferProcessor* bufferProcessor, - unsigned int firstChannel, void *data, unsigned int channelCount ); - - -/** Provide the buffer processor with a pointer to one non-interleaved host - output channel. - - @param bufferProcessor The buffer processor. - @param channel The channel number. - @param data The buffer. -*/ -void PaUtil_SetNonInterleavedInputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data ); - - -/** Use for the second buffer half when the input buffer is split in two halves. - @see PaUtil_SetInputFrameCount -*/ -void PaUtil_Set2ndInputFrameCount( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - -/** Use for the second buffer half when the input buffer is split in two halves. - @see PaUtil_SetInputChannel -*/ -void PaUtil_Set2ndInputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data, unsigned int stride ); - -/** Use for the second buffer half when the input buffer is split in two halves. - @see PaUtil_SetInterleavedInputChannels -*/ -void PaUtil_Set2ndInterleavedInputChannels( PaUtilBufferProcessor* bufferProcessor, - unsigned int firstChannel, void *data, unsigned int channelCount ); - -/** Use for the second buffer half when the input buffer is split in two halves. - @see PaUtil_SetNonInterleavedInputChannel -*/ -void PaUtil_Set2ndNonInterleavedInputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data ); - - -/** Set the number of frames in the output host buffer(s) specified by the - PaUtil_Set*OutputChannel functions. - - @param bufferProcessor The buffer processor. - - @param frameCount The number of host output frames. A 0 frameCount indicates to - use the framesPerHostBuffer value passed to PaUtil_InitializeBufferProcessor. - - @see PaUtil_SetOutputChannel, PaUtil_SetInterleavedOutputChannels, - PaUtil_SetNonInterleavedOutputChannel -*/ -void PaUtil_SetOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - - -/** Indicate that the output will be discarded. This function should be used - when implementing the paNeverDropInput mode for full duplex streams. - - @param bufferProcessor The buffer processor. -*/ -void PaUtil_SetNoOutput( PaUtilBufferProcessor* bufferProcessor ); - - -/** Provide the buffer processor with a pointer to a host output channel. - - @param bufferProcessor The buffer processor. - @param channel The channel number. - @param data The buffer. - @param stride The stride from one sample to the next, in samples. For - interleaved host buffers, the stride will usually be the same as the number of - channels in the buffer. -*/ -void PaUtil_SetOutputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data, unsigned int stride ); - - -/** Provide the buffer processor with a pointer to a number of interleaved - host output channels. - - @param bufferProcessor The buffer processor. - @param firstChannel The first channel number. - @param data The buffer. - @param channelCount The number of interleaved channels in the buffer. If - channelCount is zero, the number of channels specified to - PaUtil_InitializeBufferProcessor will be used. -*/ -void PaUtil_SetInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, - unsigned int firstChannel, void *data, unsigned int channelCount ); - - -/** Provide the buffer processor with a pointer to one non-interleaved host - output channel. - - @param bufferProcessor The buffer processor. - @param channel The channel number. - @param data The buffer. -*/ -void PaUtil_SetNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data ); - - -/** Use for the second buffer half when the output buffer is split in two halves. - @see PaUtil_SetOutputFrameCount -*/ -void PaUtil_Set2ndOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - -/** Use for the second buffer half when the output buffer is split in two halves. - @see PaUtil_SetOutputChannel -*/ -void PaUtil_Set2ndOutputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data, unsigned int stride ); - -/** Use for the second buffer half when the output buffer is split in two halves. - @see PaUtil_SetInterleavedOutputChannels -*/ -void PaUtil_Set2ndInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, - unsigned int firstChannel, void *data, unsigned int channelCount ); - -/** Use for the second buffer half when the output buffer is split in two halves. - @see PaUtil_SetNonInterleavedOutputChannel -*/ -void PaUtil_Set2ndNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data ); - -/*@}*/ - - -/** @name Buffer processing functions for callback streams -*/ -/*@{*/ - -/** Commence processing a host buffer (or a pair of host buffers in the - full-duplex case) for a callback stream. - - @param bufferProcessor The buffer processor. - - @param timeInfo Timing information for the first sample of the host - buffer(s). This information may be adjusted when buffer adaption is being - performed. - - @param callbackStatusFlags Flags indicating whether underruns and overruns - have occurred since the last time the buffer processor was called. -*/ -void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bufferProcessor, - PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags callbackStatusFlags ); - - -/** Finish processing a host buffer (or a pair of host buffers in the - full-duplex case) for a callback stream. - - @param bufferProcessor The buffer processor. - - @param callbackResult On input, indicates a previous callback result, and on - exit, the result of the user stream callback, if it is called. - On entry callbackResult should contain one of { paContinue, paComplete, or - paAbort}. If paComplete is passed, the stream callback will not be called - but any audio that was generated by previous stream callbacks will be copied - to the output buffer(s). You can check whether the buffer processor's internal - buffer is empty by calling PaUtil_IsBufferProcessorOutputEmpty. - - If the stream callback is called its result is stored in *callbackResult. If - the stream callback returns paComplete or paAbort, all output buffers will be - full of valid data - some of which may be zeros to acount for data that - wasn't generated by the terminating callback. - - @return The number of frames processed. This usually corresponds to the - number of frames specified by the PaUtil_Set*FrameCount functions, exept in - the paUtilVariableHostBufferSizePartialUsageAllowed buffer size mode when a - smaller value may be returned. -*/ -unsigned long PaUtil_EndBufferProcessing( PaUtilBufferProcessor* bufferProcessor, - int *callbackResult ); - - -/** Determine whether any callback generated output remains in the bufffer - processor's internal buffers. This method may be used to determine when to - continue calling PaUtil_EndBufferProcessing() after the callback has returned - a callbackResult of paComplete. - - @param bufferProcessor The buffer processor. - - @return Returns non-zero when callback generated output remains in the internal - buffer and zero (0) when there internal buffer contains no callback generated - data. -*/ -int PaUtil_IsBufferProcessorOutputEmpty( PaUtilBufferProcessor* bufferProcessor ); - -/*@}*/ - - -/** @name Buffer processing functions for blocking read/write streams -*/ -/*@{*/ - -/** Copy samples from host input channels set up by the PaUtil_Set*InputChannels - functions to a user supplied buffer. This function is intended for use with - blocking read/write streams. Copies the minimum of the number of - user frames (specified by the frameCount parameter) and the number of available - host frames (specified in a previous call to SetInputFrameCount()). - - @param bufferProcessor The buffer processor. - - @param buffer A pointer to the user buffer pointer, or a pointer to a pointer - to an array of user buffer pointers for a non-interleaved stream. It is - important that this parameter points to a copy of the user buffer pointers, - not to the actual user buffer pointers, because this function updates the - pointers before returning. - - @param frameCount The number of frames of data in the buffer(s) pointed to by - the buffer parameter. - - @return The number of frames copied. The buffer pointer(s) pointed to by the - buffer parameter are advanced to point to the frame(s) following the last one - filled. -*/ -unsigned long PaUtil_CopyInput( PaUtilBufferProcessor* bufferProcessor, - void **buffer, unsigned long frameCount ); - - -/* Copy samples from a user supplied buffer to host output channels set up by - the PaUtil_Set*OutputChannels functions. This function is intended for use with - blocking read/write streams. Copies the minimum of the number of - user frames (specified by the frameCount parameter) and the number of - host frames (specified in a previous call to SetOutputFrameCount()). - - @param bufferProcessor The buffer processor. - - @param buffer A pointer to the user buffer pointer, or a pointer to a pointer - to an array of user buffer pointers for a non-interleaved stream. It is - important that this parameter points to a copy of the user buffer pointers, - not to the actual user buffer pointers, because this function updates the - pointers before returning. - - @param frameCount The number of frames of data in the buffer(s) pointed to by - the buffer parameter. - - @return The number of frames copied. The buffer pointer(s) pointed to by the - buffer parameter are advanced to point to the frame(s) following the last one - copied. -*/ -unsigned long PaUtil_CopyOutput( PaUtilBufferProcessor* bufferProcessor, - const void ** buffer, unsigned long frameCount ); - - -/* Zero samples in host output channels set up by the PaUtil_Set*OutputChannels - functions. This function is useful for flushing streams. - Zeros the minimum of frameCount and the number of host frames specified in a - previous call to SetOutputFrameCount(). - - @param bufferProcessor The buffer processor. - - @param frameCount The maximum number of frames to zero. - - @return The number of frames zeroed. -*/ -unsigned long PaUtil_ZeroOutput( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - - -/*@}*/ - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_PROCESS_H */ diff --git a/portaudio-v19/pa_common/pa_skeleton.c b/portaudio-v19/pa_common/pa_skeleton.c deleted file mode 100644 index 51f95c8a3..000000000 --- a/portaudio-v19/pa_common/pa_skeleton.c +++ /dev/null @@ -1,807 +0,0 @@ -/* - * $Id$ - * Portable Audio I/O Library skeleton implementation - * demonstrates how to use the common functions to implement support - * for a host API - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Ross Bencina, Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Skeleton implementation of support for a host API. - - @note This file is provided as a starting point for implementing support for - a new host API. IMPLEMENT ME comments are used to indicate functionality - which much be customised for each implementation. -*/ - - -#include /* strlen() */ - -#include "pa_util.h" -#include "pa_allocation.h" -#include "pa_hostapi.h" -#include "pa_stream.h" -#include "pa_cpuload.h" -#include "pa_process.h" - - -/* prototypes for functions declared in this file */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); -static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate ); -static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, - PaStream** s, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - void *userData ); -static PaError CloseStream( PaStream* stream ); -static PaError StartStream( PaStream *stream ); -static PaError StopStream( PaStream *stream ); -static PaError AbortStream( PaStream *stream ); -static PaError IsStreamStopped( PaStream *s ); -static PaError IsStreamActive( PaStream *stream ); -static PaTime GetStreamTime( PaStream *stream ); -static double GetStreamCpuLoad( PaStream* stream ); -static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); -static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); -static signed long GetStreamReadAvailable( PaStream* stream ); -static signed long GetStreamWriteAvailable( PaStream* stream ); - - -/* IMPLEMENT ME: a macro like the following one should be used for reporting - host errors */ -#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \ - PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText ) - -/* PaSkeletonHostApiRepresentation - host api datastructure specific to this implementation */ - -typedef struct -{ - PaUtilHostApiRepresentation inheritedHostApiRep; - PaUtilStreamInterface callbackStreamInterface; - PaUtilStreamInterface blockingStreamInterface; - - PaUtilAllocationGroup *allocations; - - /* implementation specific data goes here */ -} -PaSkeletonHostApiRepresentation; /* IMPLEMENT ME: rename this */ - - -PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) -{ - PaError result = paNoError; - int i, deviceCount; - PaSkeletonHostApiRepresentation *skeletonHostApi; - PaDeviceInfo *deviceInfoArray; - - skeletonHostApi = (PaSkeletonHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaSkeletonHostApiRepresentation) ); - if( !skeletonHostApi ) - { - result = paInsufficientMemory; - goto error; - } - - skeletonHostApi->allocations = PaUtil_CreateAllocationGroup(); - if( !skeletonHostApi->allocations ) - { - result = paInsufficientMemory; - goto error; - } - - *hostApi = &skeletonHostApi->inheritedHostApiRep; - (*hostApi)->info.structVersion = 1; - (*hostApi)->info.type = paInDevelopment; /* IMPLEMENT ME: change to correct type id */ - (*hostApi)->info.name = "skeleton implementation"; /* IMPLEMENT ME: change to correct name */ - - (*hostApi)->info.defaultInputDevice = paNoDevice; /* IMPLEMENT ME */ - (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */ - - (*hostApi)->info.deviceCount = 0; - - deviceCount = 0; /* IMPLEMENT ME */ - - if( deviceCount > 0 ) - { - (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( - skeletonHostApi->allocations, sizeof(PaDeviceInfo*) * deviceCount ); - if( !(*hostApi)->deviceInfos ) - { - result = paInsufficientMemory; - goto error; - } - - /* allocate all device info structs in a contiguous block */ - deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( - skeletonHostApi->allocations, sizeof(PaDeviceInfo) * deviceCount ); - if( !deviceInfoArray ) - { - result = paInsufficientMemory; - goto error; - } - - for( i=0; i < deviceCount; ++i ) - { - PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; - deviceInfo->structVersion = 2; - deviceInfo->hostApi = hostApiIndex; - deviceInfo->name = 0; /* IMPLEMENT ME: allocate block and copy name eg: - deviceName = (char*)PaUtil_GroupAllocateMemory( skeletonHostApi->allocations, strlen(srcName) + 1 ); - if( !deviceName ) - { - result = paInsufficientMemory; - goto error; - } - strcpy( deviceName, srcName ); - deviceInfo->name = deviceName; - */ - - deviceInfo->maxInputChannels = 0; /* IMPLEMENT ME */ - deviceInfo->maxOutputChannels = 0; /* IMPLEMENT ME */ - - deviceInfo->defaultLowInputLatency = 0.; /* IMPLEMENT ME */ - deviceInfo->defaultLowOutputLatency = 0.; /* IMPLEMENT ME */ - deviceInfo->defaultHighInputLatency = 0.; /* IMPLEMENT ME */ - deviceInfo->defaultHighOutputLatency = 0.; /* IMPLEMENT ME */ - - deviceInfo->defaultSampleRate = 0.; /* IMPLEMENT ME */ - - (*hostApi)->deviceInfos[i] = deviceInfo; - ++(*hostApi)->info.deviceCount; - } - } - - (*hostApi)->Terminate = Terminate; - (*hostApi)->OpenStream = OpenStream; - (*hostApi)->IsFormatSupported = IsFormatSupported; - - PaUtil_InitializeStreamInterface( &skeletonHostApi->callbackStreamInterface, CloseStream, StartStream, - StopStream, AbortStream, IsStreamStopped, IsStreamActive, - GetStreamTime, GetStreamCpuLoad, - PaUtil_DummyRead, PaUtil_DummyWrite, - PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); - - PaUtil_InitializeStreamInterface( &skeletonHostApi->blockingStreamInterface, CloseStream, StartStream, - StopStream, AbortStream, IsStreamStopped, IsStreamActive, - GetStreamTime, PaUtil_DummyGetCpuLoad, - ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); - - return result; - -error: - if( skeletonHostApi ) - { - if( skeletonHostApi->allocations ) - { - PaUtil_FreeAllAllocations( skeletonHostApi->allocations ); - PaUtil_DestroyAllocationGroup( skeletonHostApi->allocations ); - } - - PaUtil_FreeMemory( skeletonHostApi ); - } - return result; -} - - -static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) -{ - PaSkeletonHostApiRepresentation *skeletonHostApi = (PaSkeletonHostApiRepresentation*)hostApi; - - /* - IMPLEMENT ME: - - clean up any resources not handled by the allocation group - */ - - if( skeletonHostApi->allocations ) - { - PaUtil_FreeAllAllocations( skeletonHostApi->allocations ); - PaUtil_DestroyAllocationGroup( skeletonHostApi->allocations ); - } - - PaUtil_FreeMemory( skeletonHostApi ); -} - - -static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate ) -{ - int inputChannelCount, outputChannelCount; - PaSampleFormat inputSampleFormat, outputSampleFormat; - - if( inputParameters ) - { - inputChannelCount = inputParameters->channelCount; - inputSampleFormat = inputParameters->sampleFormat; - - /* all standard sample formats are supported by the buffer adapter, - this implementation doesn't support any custom sample formats */ - if( inputSampleFormat & paCustomFormat ) - return paSampleFormatNotSupported; - - /* unless alternate device specification is supported, reject the use of - paUseHostApiSpecificDeviceSpecification */ - - if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) - return paInvalidDevice; - - /* check that input device can support inputChannelCount */ - if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) - return paInvalidChannelCount; - - /* validate inputStreamInfo */ - if( inputParameters->hostApiSpecificStreamInfo ) - return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - } - else - { - inputChannelCount = 0; - } - - if( outputParameters ) - { - outputChannelCount = outputParameters->channelCount; - outputSampleFormat = outputParameters->sampleFormat; - - /* all standard sample formats are supported by the buffer adapter, - this implementation doesn't support any custom sample formats */ - if( outputSampleFormat & paCustomFormat ) - return paSampleFormatNotSupported; - - /* unless alternate device specification is supported, reject the use of - paUseHostApiSpecificDeviceSpecification */ - - if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) - return paInvalidDevice; - - /* check that output device can support outputChannelCount */ - if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) - return paInvalidChannelCount; - - /* validate outputStreamInfo */ - if( outputParameters->hostApiSpecificStreamInfo ) - return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - } - else - { - outputChannelCount = 0; - } - - /* - IMPLEMENT ME: - - - if a full duplex stream is requested, check that the combination - of input and output parameters is supported if necessary - - - check that the device supports sampleRate - - Because the buffer adapter handles conversion between all standard - sample formats, the following checks are only required if paCustomFormat - is implemented, or under some other unusual conditions. - - - check that input device can support inputSampleFormat, or that - we have the capability to convert from inputSampleFormat to - a native format - - - check that output device can support outputSampleFormat, or that - we have the capability to convert from outputSampleFormat to - a native format - */ - - - /* suppress unused variable warnings */ - (void) sampleRate; - - return paFormatIsSupported; -} - -/* PaSkeletonStream - a stream data structure specifically for this implementation */ - -typedef struct PaSkeletonStream -{ /* IMPLEMENT ME: rename this */ - PaUtilStreamRepresentation streamRepresentation; - PaUtilCpuLoadMeasurer cpuLoadMeasurer; - PaUtilBufferProcessor bufferProcessor; - - /* IMPLEMENT ME: - - implementation specific data goes here - */ - unsigned long framesPerHostCallback; /* just an example */ -} -PaSkeletonStream; - -/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ - -static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, - PaStream** s, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - void *userData ) -{ - PaError result = paNoError; - PaSkeletonHostApiRepresentation *skeletonHostApi = (PaSkeletonHostApiRepresentation*)hostApi; - PaSkeletonStream *stream = 0; - unsigned long framesPerHostBuffer = framesPerBuffer; /* these may not be equivalent for all implementations */ - int inputChannelCount, outputChannelCount; - PaSampleFormat inputSampleFormat, outputSampleFormat; - PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; - - - if( inputParameters ) - { - inputChannelCount = inputParameters->channelCount; - inputSampleFormat = inputParameters->sampleFormat; - - /* unless alternate device specification is supported, reject the use of - paUseHostApiSpecificDeviceSpecification */ - - if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) - return paInvalidDevice; - - /* check that input device can support inputChannelCount */ - if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) - return paInvalidChannelCount; - - /* validate inputStreamInfo */ - if( inputParameters->hostApiSpecificStreamInfo ) - return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - - /* IMPLEMENT ME - establish which host formats are available */ - hostInputSampleFormat = - PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, inputSampleFormat ); - } - else - { - inputChannelCount = 0; - inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ - } - - if( outputParameters ) - { - outputChannelCount = outputParameters->channelCount; - outputSampleFormat = outputParameters->sampleFormat; - - /* unless alternate device specification is supported, reject the use of - paUseHostApiSpecificDeviceSpecification */ - - if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) - return paInvalidDevice; - - /* check that output device can support inputChannelCount */ - if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) - return paInvalidChannelCount; - - /* validate outputStreamInfo */ - if( outputParameters->hostApiSpecificStreamInfo ) - return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - - /* IMPLEMENT ME - establish which host formats are available */ - hostOutputSampleFormat = - PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, outputSampleFormat ); - } - else - { - outputChannelCount = 0; - outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ - } - - /* - IMPLEMENT ME: - - ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? ) - - - check that input device can support inputSampleFormat, or that - we have the capability to convert from outputSampleFormat to - a native format - - - check that output device can support outputSampleFormat, or that - we have the capability to convert from outputSampleFormat to - a native format - - - if a full duplex stream is requested, check that the combination - of input and output parameters is supported - - - check that the device supports sampleRate - - - alter sampleRate to a close allowable rate if possible / necessary - - - validate suggestedInputLatency and suggestedOutputLatency parameters, - use default values where necessary - */ - - - - - /* validate platform specific flags */ - if( (streamFlags & paPlatformSpecificFlags) != 0 ) - return paInvalidFlag; /* unexpected platform specific flag */ - - - stream = (PaSkeletonStream*)PaUtil_AllocateMemory( sizeof(PaSkeletonStream) ); - if( !stream ) - { - result = paInsufficientMemory; - goto error; - } - - if( streamCallback ) - { - PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, - &skeletonHostApi->callbackStreamInterface, streamCallback, userData ); - } - else - { - PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, - &skeletonHostApi->blockingStreamInterface, streamCallback, userData ); - } - - PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); - - - /* we assume a fixed host buffer size in this example, but the buffer processor - can also support bounded and unknown host buffer sizes by passing - paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of - paUtilFixedHostBufferSize below. */ - - result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, - inputChannelCount, inputSampleFormat, hostInputSampleFormat, - outputChannelCount, outputSampleFormat, hostOutputSampleFormat, - sampleRate, streamFlags, framesPerBuffer, - framesPerHostBuffer, paUtilFixedHostBufferSize, - streamCallback, userData ); - if( result != paNoError ) - goto error; - - - /* - IMPLEMENT ME: initialise the following fields with estimated or actual - values. - */ - stream->streamRepresentation.streamInfo.inputLatency = - PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor); - stream->streamRepresentation.streamInfo.outputLatency = - PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor); - stream->streamRepresentation.streamInfo.sampleRate = sampleRate; - - - /* - IMPLEMENT ME: - - additional stream setup + opening - */ - - stream->framesPerHostCallback = framesPerHostBuffer; - - *s = (PaStream*)stream; - - return result; - -error: - if( stream ) - PaUtil_FreeMemory( stream ); - - return result; -} - -/* - ExampleHostProcessingLoop() illustrates the kind of processing which may - occur in a host implementation. - -*/ -static void ExampleHostProcessingLoop( void *inputBuffer, void *outputBuffer, void *userData ) -{ - PaSkeletonStream *stream = (PaSkeletonStream*)userData; - PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */ - int callbackResult; - unsigned long framesProcessed; - - PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); - - /* - IMPLEMENT ME: - - generate timing information - - handle buffer slips - */ - - /* - If you need to byte swap or shift inputBuffer to convert it into a - portaudio format, do it here. - */ - - - - PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ ); - - /* - depending on whether the host buffers are interleaved, non-interleaved - or a mixture, you will want to call PaUtil_SetInterleaved*Channels(), - PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here. - */ - - PaUtil_SetInputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); - PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, - 0, /* first channel of inputBuffer is channel 0 */ - inputBuffer, - 0 ); /* 0 - use inputChannelCount passed to init buffer processor */ - - PaUtil_SetOutputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); - PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, - 0, /* first channel of outputBuffer is channel 0 */ - outputBuffer, - 0 ); /* 0 - use outputChannelCount passed to init buffer processor */ - - /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing() - in general you would pass paContinue for normal operation, and - paComplete to drain the buffer processor's internal output buffer. - You can check whether the buffer processor's output buffer is empty - using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor ) - */ - callbackResult = paContinue; - framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); - - - /* - If you need to byte swap or shift outputBuffer to convert it to - host format, do it here. - */ - - PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); - - - if( callbackResult == paContinue ) - { - /* nothing special to do */ - } - else if( callbackResult == paAbort ) - { - /* IMPLEMENT ME - finish playback immediately */ - - /* once finished, call the finished callback */ - if( stream->streamRepresentation.streamFinishedCallback != 0 ) - stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); - } - else - { - /* User callback has asked us to stop with paComplete or other non-zero value */ - - /* IMPLEMENT ME - finish playback once currently queued audio has completed */ - - /* once finished, call the finished callback */ - if( stream->streamRepresentation.streamFinishedCallback != 0 ) - stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); - } -} - - -/* - When CloseStream() is called, the multi-api layer ensures that - the stream has already been stopped or aborted. -*/ -static PaError CloseStream( PaStream* s ) -{ - PaError result = paNoError; - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* - IMPLEMENT ME: - - additional stream closing + cleanup - */ - - PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); - PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); - PaUtil_FreeMemory( stream ); - - return result; -} - - -static PaError StartStream( PaStream *s ) -{ - PaError result = paNoError; - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); - - /* IMPLEMENT ME, see portaudio.h for required behavior */ - - /* suppress unused function warning. the code in ExampleHostProcessingLoop or - something similar should be implemented to feed samples to and from the - host after StartStream() is called. - */ - (void) ExampleHostProcessingLoop; - - return result; -} - - -static PaError StopStream( PaStream *s ) -{ - PaError result = paNoError; - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior */ - - return result; -} - - -static PaError AbortStream( PaStream *s ) -{ - PaError result = paNoError; - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior */ - - return result; -} - - -static PaError IsStreamStopped( PaStream *s ) -{ - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior */ - - return 0; -} - - -static PaError IsStreamActive( PaStream *s ) -{ - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior */ - - return 0; -} - - -static PaTime GetStreamTime( PaStream *s ) -{ - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - return 0; -} - - -static double GetStreamCpuLoad( PaStream* s ) -{ - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); -} - - -/* - As separate stream interfaces are used for blocking and callback - streams, the following functions can be guaranteed to only be called - for blocking streams. -*/ - -static PaError ReadStream( PaStream* s, - void *buffer, - unsigned long frames ) -{ - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* suppress unused variable warnings */ - (void) buffer; - (void) frames; - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - return paNoError; -} - - -static PaError WriteStream( PaStream* s, - const void *buffer, - unsigned long frames ) -{ - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* suppress unused variable warnings */ - (void) buffer; - (void) frames; - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - return paNoError; -} - - -static signed long GetStreamReadAvailable( PaStream* s ) -{ - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - return 0; -} - - -static signed long GetStreamWriteAvailable( PaStream* s ) -{ - PaSkeletonStream *stream = (PaSkeletonStream*)s; - - /* suppress unused variable warnings */ - (void) stream; - - /* IMPLEMENT ME, see portaudio.h for required behavior*/ - - return 0; -} - - - - diff --git a/portaudio-v19/pa_common/pa_stream.c b/portaudio-v19/pa_common/pa_stream.c deleted file mode 100644 index e820671bc..000000000 --- a/portaudio-v19/pa_common/pa_stream.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * $Id$ - * Portable Audio I/O Library - * - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 2002 Ross Bencina - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Interface used by pa_front to virtualize functions which operate on - streams. -*/ - - -#include "pa_stream.h" - - -void PaUtil_InitializeStreamInterface( PaUtilStreamInterface *streamInterface, - PaError (*Close)( PaStream* ), - PaError (*Start)( PaStream* ), - PaError (*Stop)( PaStream* ), - PaError (*Abort)( PaStream* ), - PaError (*IsStopped)( PaStream* ), - PaError (*IsActive)( PaStream* ), - PaTime (*GetTime)( PaStream* ), - double (*GetCpuLoad)( PaStream* ), - PaError (*Read)( PaStream*, void *, unsigned long ), - PaError (*Write)( PaStream*, const void *, unsigned long ), - signed long (*GetReadAvailable)( PaStream* ), - signed long (*GetWriteAvailable)( PaStream* ) ) -{ - streamInterface->Close = Close; - streamInterface->Start = Start; - streamInterface->Stop = Stop; - streamInterface->Abort = Abort; - streamInterface->IsStopped = IsStopped; - streamInterface->IsActive = IsActive; - streamInterface->GetTime = GetTime; - streamInterface->GetCpuLoad = GetCpuLoad; - streamInterface->Read = Read; - streamInterface->Write = Write; - streamInterface->GetReadAvailable = GetReadAvailable; - streamInterface->GetWriteAvailable = GetWriteAvailable; -} - - -void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation, - PaUtilStreamInterface *streamInterface, - PaStreamCallback *streamCallback, - void *userData ) -{ - streamRepresentation->magic = PA_STREAM_MAGIC; - streamRepresentation->nextOpenStream = 0; - streamRepresentation->streamInterface = streamInterface; - streamRepresentation->streamCallback = streamCallback; - streamRepresentation->streamFinishedCallback = 0; - - streamRepresentation->userData = userData; - - streamRepresentation->streamInfo.inputLatency = 0.; - streamRepresentation->streamInfo.outputLatency = 0.; - streamRepresentation->streamInfo.sampleRate = 0.; -} - - -void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation ) -{ - streamRepresentation->magic = 0; -} - - -PaError PaUtil_DummyRead( PaStream* stream, - void *buffer, - unsigned long frames ) -{ - (void)stream; /* unused parameter */ - (void)buffer; /* unused parameter */ - (void)frames; /* unused parameter */ - - return paCanNotReadFromACallbackStream; -} - - -PaError PaUtil_DummyWrite( PaStream* stream, - const void *buffer, - unsigned long frames ) -{ - (void)stream; /* unused parameter */ - (void)buffer; /* unused parameter */ - (void)frames; /* unused parameter */ - - return paCanNotWriteToACallbackStream; -} - - -signed long PaUtil_DummyGetReadAvailable( PaStream* stream ) -{ - (void)stream; /* unused parameter */ - - return paCanNotReadFromACallbackStream; -} - - -signed long PaUtil_DummyGetWriteAvailable( PaStream* stream ) -{ - (void)stream; /* unused parameter */ - - return paCanNotWriteToACallbackStream; -} - - -double PaUtil_DummyGetCpuLoad( PaStream* stream ) -{ - (void)stream; /* unused parameter */ - - return 0.0; -} diff --git a/portaudio-v19/pa_common/pa_stream.h b/portaudio-v19/pa_common/pa_stream.h deleted file mode 100644 index aaf89cf21..000000000 --- a/portaudio-v19/pa_common/pa_stream.h +++ /dev/null @@ -1,196 +0,0 @@ -#ifndef PA_STREAM_H -#define PA_STREAM_H -/* - * $Id$ - * Portable Audio I/O Library - * stream interface - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Ross Bencina, Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Interface used by pa_front to virtualize functions which operate on - streams. -*/ - - -#include "portaudio.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -#define PA_STREAM_MAGIC (0x18273645) - - -/** A structure representing an (abstract) interface to a host API. Contains - pointers to functions which implement the interface. - - All PaStreamInterface functions are guaranteed to be called with a non-null, - valid stream parameter. -*/ -typedef struct { - PaError (*Close)( PaStream* stream ); - PaError (*Start)( PaStream *stream ); - PaError (*Stop)( PaStream *stream ); - PaError (*Abort)( PaStream *stream ); - PaError (*IsStopped)( PaStream *stream ); - PaError (*IsActive)( PaStream *stream ); - PaTime (*GetTime)( PaStream *stream ); - double (*GetCpuLoad)( PaStream* stream ); - PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ); - PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ); - signed long (*GetReadAvailable)( PaStream* stream ); - signed long (*GetWriteAvailable)( PaStream* stream ); -} PaUtilStreamInterface; - - -/** Initialize the fields of a PaUtilStreamInterface structure. -*/ -void PaUtil_InitializeStreamInterface( PaUtilStreamInterface *streamInterface, - PaError (*Close)( PaStream* ), - PaError (*Start)( PaStream* ), - PaError (*Stop)( PaStream* ), - PaError (*Abort)( PaStream* ), - PaError (*IsStopped)( PaStream* ), - PaError (*IsActive)( PaStream* ), - PaTime (*GetTime)( PaStream* ), - double (*GetCpuLoad)( PaStream* ), - PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ), - PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ), - signed long (*GetReadAvailable)( PaStream* stream ), - signed long (*GetWriteAvailable)( PaStream* stream ) ); - - -/** Dummy Read function for use in interfaces to a callback based streams. - Pass to the Read parameter of PaUtil_InitializeStreamInterface. - @return An error code indicating that the function has no effect - because the stream is a callback stream. -*/ -PaError PaUtil_DummyRead( PaStream* stream, - void *buffer, - unsigned long frames ); - - -/** Dummy Write function for use in an interfaces to callback based streams. - Pass to the Write parameter of PaUtil_InitializeStreamInterface. - @return An error code indicating that the function has no effect - because the stream is a callback stream. -*/ -PaError PaUtil_DummyWrite( PaStream* stream, - const void *buffer, - unsigned long frames ); - - -/** Dummy GetReadAvailable function for use in interfaces to callback based - streams. Pass to the GetReadAvailable parameter of PaUtil_InitializeStreamInterface. - @return An error code indicating that the function has no effect - because the stream is a callback stream. -*/ -signed long PaUtil_DummyGetReadAvailable( PaStream* stream ); - - -/** Dummy GetWriteAvailable function for use in interfaces to callback based - streams. Pass to the GetWriteAvailable parameter of PaUtil_InitializeStreamInterface. - @return An error code indicating that the function has no effect - because the stream is a callback stream. -*/ -signed long PaUtil_DummyGetWriteAvailable( PaStream* stream ); - - - -/** Dummy GetCpuLoad function for use in an interface to a read/write stream. - Pass to the GetCpuLoad parameter of PaUtil_InitializeStreamInterface. - @return Returns 0. -*/ -double PaUtil_DummyGetCpuLoad( PaStream* stream ); - - -/** Non host specific data for a stream. This data is used by pa_front to - forward to the appropriate functions in the streamInterface structure. -*/ -typedef struct PaUtilStreamRepresentation { - unsigned long magic; /**< set to PA_STREAM_MAGIC */ - struct PaUtilStreamRepresentation *nextOpenStream; /**< field used by multi-api code */ - PaUtilStreamInterface *streamInterface; - PaStreamCallback *streamCallback; - PaStreamFinishedCallback *streamFinishedCallback; - void *userData; - PaStreamInfo streamInfo; -} PaUtilStreamRepresentation; - - -/** Initialize a PaUtilStreamRepresentation structure. - - @see PaUtil_InitializeStreamRepresentation -*/ -void PaUtil_InitializeStreamRepresentation( - PaUtilStreamRepresentation *streamRepresentation, - PaUtilStreamInterface *streamInterface, - PaStreamCallback *streamCallback, - void *userData ); - - -/** Clean up a PaUtilStreamRepresentation structure previously initialized - by a call to PaUtil_InitializeStreamRepresentation. - - @see PaUtil_InitializeStreamRepresentation -*/ -void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation ); - - -/** Check that the stream pointer is valid. - - @return Returns paNoError if the stream pointer appears to be OK, otherwise - returns an error indicating the cause of failure. -*/ -PaError PaUtil_ValidateStreamPointer( PaStream *stream ); - - -/** Cast an opaque stream pointer into a pointer to a PaUtilStreamRepresentation. - - @see PaUtilStreamRepresentation -*/ -#define PA_STREAM_REP( stream )\ - ((PaUtilStreamRepresentation*) (stream) ) - - -/** Cast an opaque stream pointer into a pointer to a PaUtilStreamInterface. - - @see PaUtilStreamRepresentation, PaUtilStreamInterface -*/ -#define PA_STREAM_INTERFACE( stream )\ - PA_STREAM_REP( (stream) )->streamInterface - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_STREAM_H */ diff --git a/portaudio-v19/pa_common/pa_trace.c b/portaudio-v19/pa_common/pa_trace.c deleted file mode 100644 index 6619d423a..000000000 --- a/portaudio-v19/pa_common/pa_trace.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * $Id$ - * Portable Audio I/O Library Trace Facility - * Store trace information in real-time for later printing. - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2000 Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Event trace mechanism for debugging. -*/ - - -#include -#include -#include -#include "pa_trace.h" - -#if PA_TRACE_REALTIME_EVENTS - -static char *traceTextArray[PA_MAX_TRACE_RECORDS]; -static int traceIntArray[PA_MAX_TRACE_RECORDS]; -static int traceIndex = 0; -static int traceBlock = 0; - -/*********************************************************************/ -void PaUtil_ResetTraceMessages() -{ - traceIndex = 0; -} - -/*********************************************************************/ -void PaUtil_DumpTraceMessages() -{ - int i; - int messageCount = (traceIndex < PA_MAX_TRACE_RECORDS) ? traceIndex : PA_MAX_TRACE_RECORDS; - - printf("DumpTraceMessages: traceIndex = %d\n", traceIndex ); - for( i=0; i must be included in the - context in which this macro is used. -*/ -#define PA_VALIDATE_TYPE_SIZES \ - { \ - assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaUint16 ) == 2 ); \ - assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaInt16 ) == 2 ); \ - assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaUint32 ) == 4 ); \ - assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaInt32 ) == 4 ); \ - } - - -#endif /* PA_TYPES_H */ diff --git a/portaudio-v19/pa_common/pa_util.h b/portaudio-v19/pa_common/pa_util.h deleted file mode 100644 index ab8dbe046..000000000 --- a/portaudio-v19/pa_common/pa_util.h +++ /dev/null @@ -1,167 +0,0 @@ -#ifndef PA_UTIL_H -#define PA_UTIL_H -/* - * $Id$ - * Portable Audio I/O Library implementation utilities header - * common implementation utilities and interfaces - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Ross Bencina, Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief Prototypes for utility functions used by PortAudio implementations. - - @todo Document and adhere to the alignment guarantees provided by - PaUtil_AllocateMemory(). -*/ - - -#include "portaudio.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -struct PaUtilHostApiRepresentation; - - -/** Retrieve a specific host API representation. This function can be used - by implementations to retrieve a pointer to their representation in - host api specific extension functions which aren't passed a rep pointer - by pa_front.c. - - @param hostApi A pointer to a host API represenation pointer. Apon success - this will receive the requested representation pointer. - - @param type A valid host API type identifier. - - @returns An error code. If the result is PaNoError then a pointer to the - requested host API representation will be stored in *hostApi. If the host API - specified by type is not found, this function returns paHostApiNotFound. -*/ -PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **hostApi, - PaHostApiTypeId type ); - - -/** Convert a PortAudio device index into a host API specific device index. - @param hostApiDevice Pointer to a device index, on success this will recieve the - converted device index value. - @param device The PortAudio device index to convert. - @param hostApi The host api which the index should be converted for. - - @returns On success returns PaNoError and places the converted index in the - hostApiDevice parameter. -*/ -PaError PaUtil_DeviceIndexToHostApiDeviceIndex( - PaDeviceIndex *hostApiDevice, PaDeviceIndex device, - struct PaUtilHostApiRepresentation *hostApi ); - - -/** Set the host error information returned by Pa_GetLastHostErrorInfo. This - function and the paUnanticipatedHostError error code should be used as a - last resort. Implementors should use existing PA error codes where possible, - or nominate new ones. Note that at it is always better to use - PaUtil_SetLastHostErrorInfo() and paUnanticipatedHostError than to return an - ambiguous or inaccurate PaError code. - - @param hostApiType The host API which encountered the error (ie of the caller) - - @param errorCode The error code returned by the native API function. - - @param errorText A string describing the error. PaUtil_SetLastHostErrorInfo - makes a copy of the string, so it is not necessary for the pointer to remain - valid after the call to PaUtil_SetLastHostErrorInfo() returns. - -*/ -void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode, - const char *errorText ); - - - -/** PA_DEBUG() provides a simple debug message printing facility. The macro - passes it's argument to a printf-like function called PaUtil_DebugPrint() - which prints to stderr and always flushes the stream after printing. - Because preprocessor macros cannot directly accept variable length argument - lists, calls to the macro must include an additional set of parenthesis, eg: - PA_DEBUG(("errorno: %d", 1001 )); -*/ - -void PaUtil_DebugPrint( const char *format, ... ); - -#ifdef PA_ENABLE_DEBUG_OUTPUT -#define PA_DEBUG(x) PaUtil_DebugPrint x ; -#else -#define PA_DEBUG(x) -#endif - - -/* the following functions are implemented in a platform platform specific - .c file -*/ - -/** Allocate size bytes, guaranteed to be aligned to a FIXME byte boundary */ -void *PaUtil_AllocateMemory( long size ); - - -/** Realease block if non-NULL. block may be NULL */ -void PaUtil_FreeMemory( void *block ); - - -/** Return the number of currently allocated blocks. This function can be - used for detecting memory leaks. - - @note Allocations will only be tracked if PA_TRACK_MEMORY is #defined. If - it isn't, this function will always return 0. -*/ -int PaUtil_CountCurrentlyAllocatedBlocks( void ); - - -/** Initialize the clock used by PaUtil_GetTime(). Call this before calling - PaUtil_GetTime. - - @see PaUtil_GetTime -*/ -void PaUtil_InitializeClock( void ); - - -/** Return the system time in seconds. Used to implement CPU load functions - - @see PaUtil_InitializeClock -*/ -double PaUtil_GetTime( void ); - - -/* void Pa_Sleep( long msec ); must also be implemented in per-platform .c file */ - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_UTIL_H */ diff --git a/portaudio-v19/pa_common/portaudio.h b/portaudio-v19/pa_common/portaudio.h deleted file mode 100644 index 2b257399b..000000000 --- a/portaudio-v19/pa_common/portaudio.h +++ /dev/null @@ -1,1124 +0,0 @@ - -#ifndef PORTAUDIO_H -#define PORTAUDIO_H -/* - * $Id$ - * PortAudio Portable Real-Time Audio Library - * PortAudio API Header File - * Latest version available at: http://www.portaudio.com/ - * - * Copyright (c) 1999-2002 Ross Bencina and Phil Burk - * - * 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. - * - * 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. - * - * 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. - */ - -/** @file - @brief The PortAudio API. -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -/** Retrieve the release number of the currently running PortAudio build, - eg 1900. -*/ -int Pa_GetVersion( void ); - - -/** Retrieve a textual description of the current PortAudio build, - eg "PortAudio V19-devel 13 October 2002". -*/ -const char* Pa_GetVersionText( void ); - - -/** Error codes returned by PortAudio functions. - Note that with the exception of paNoError, all PaErrorCodes are negative. -*/ - -typedef int PaError; -typedef enum PaErrorCode -{ - paNoError = 0, - - paNotInitialized = -10000, - paUnanticipatedHostError, - paInvalidChannelCount, - paInvalidSampleRate, - paInvalidDevice, - paInvalidFlag, - paSampleFormatNotSupported, - paBadIODeviceCombination, - paInsufficientMemory, - paBufferTooBig, - paBufferTooSmall, - paNullCallback, - paBadStreamPtr, - paTimedOut, - paInternalError, - paDeviceUnavailable, - paIncompatibleHostApiSpecificStreamInfo, - paStreamIsStopped, - paStreamIsNotStopped, - paInputOverflowed, - paOutputUnderflowed, - paHostApiNotFound, - paInvalidHostApi, - paCanNotReadFromACallbackStream, /**< @todo review error code name */ - paCanNotWriteToACallbackStream, /**< @todo review error code name */ - paCanNotReadFromAnOutputOnlyStream, /**< @todo review error code name */ - paCanNotWriteToAnInputOnlyStream, /**< @todo review error code name */ - paIncompatibleStreamHostApi, - paBadBufferPtr -} PaErrorCode; - - -/** Translate the supplied PortAudio error code into a human readable - message. -*/ -const char *Pa_GetErrorText( PaError errorCode ); - - -/** Library initialization function - call this before using PortAudio. - This function initialises internal data structures and prepares underlying - host APIs for use. This function MUST be called before using any other - PortAudio API functions. - - If Pa_Initialize() is called multiple times, each successful - call must be matched with a corresponding call to Pa_Terminate(). - Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not - required to be fully nested. - - Note that if Pa_Initialize() returns an error code, Pa_Terminate() should - NOT be called. - - @return paNoError if successful, otherwise an error code indicating the cause - of failure. - - @see Pa_Terminate -*/ -PaError Pa_Initialize( void ); - - -/** Library termination function - call this when finished using PortAudio. - This function deallocates all resources allocated by PortAudio since it was - initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has - been called multiple times, each call must be matched with a corresponding call - to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically - close any PortAudio streams that are still open. - - Pa_Terminate() MUST be called before exiting a program which uses PortAudio. - Failure to do so may result in serious resource leaks, such as audio devices - not being available until the next reboot. - - @return paNoError if successful, otherwise an error code indicating the cause - of failure. - - @see Pa_Initialize -*/ -PaError Pa_Terminate( void ); - - - -/** The type used to refer to audio devices. Values of this type usually - range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice - and paUseHostApiSpecificDeviceSpecification values. - - @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification -*/ -typedef int PaDeviceIndex; - - -/** A special PaDeviceIndex value indicating that no device is available, - or should be used. - - @see PaDeviceIndex -*/ -#define paNoDevice ((PaDeviceIndex)-1) - - -/** A special PaDeviceIndex value indicating that the device(s) to be used - are specified in the host api specific stream info structure. - - @see PaDeviceIndex -*/ -#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2) - - -/* Host API enumeration mechanism */ - -/** The type used to enumerate to host APIs at runtime. Values of this type - range from 0 to (Pa_GetHostApiCount()-1). - - @see Pa_GetHostApiCount -*/ -typedef int PaHostApiIndex; - - -/** Retrieve the number of available host APIs. Even if a host API is - available it may have no devices available. - - @return A non-negative value indicating the number of available host APIs - or, a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. - - @see PaHostApiIndex -*/ -PaHostApiIndex Pa_GetHostApiCount( void ); - - -/** Retrieve the index of the default host API. The default host API will be - the lowest common denominator host API on the current platform and is - unlikely to provide the best performance. - - @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1) - indicating the default host API index or, a PaErrorCode (which are always - negative) if PortAudio is not initialized or an error is encountered. -*/ -PaHostApiIndex Pa_GetDefaultHostApi( void ); - - -/** Unchanging unique identifiers for each supported host API. This type - is used in the PaHostApiInfo structure. The values are guaranteed to be - unique and to never change, thus allowing code to be written that - conditionally uses host API specific extensions. - - New type ids will be allocated when support for a host API reaches - "public alpha" status, prior to that developers should use the - paInDevelopment type id. - - @see PaHostApiInfo -*/ -typedef enum PaHostApiTypeId -{ - paInDevelopment=0, /* use while developing support for a new host API */ - paDirectSound=1, - paMME=2, - paASIO=3, - paSoundManager=4, - paCoreAudio=5, - paOSS=7, - paALSA=8, - paAL=9, - paBeOS=10, - paWDMKS=11, - paJACK=12 -} PaHostApiTypeId; - - -/** A structure containing information about a particular host API. */ - -typedef struct PaHostApiInfo -{ - /** this is struct version 1 */ - int structVersion; - /** The well known unique identifier of this host API @see PaHostApiTypeId */ - PaHostApiTypeId type; - /** A textual description of the host API for display on user interfaces. */ - const char *name; - - /** The number of devices belonging to this host API. This field may be - used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate - all devices for this host API. - @see Pa_HostApiDeviceIndexToDeviceIndex - */ - int deviceCount; - - /** The the default input device for this host API. The value will be a - device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice - if no default input device is available. - */ - PaDeviceIndex defaultInputDevice; - - /** The the default output device for this host API. The value will be a - device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice - if no default output device is available. - */ - PaDeviceIndex defaultOutputDevice; - -} PaHostApiInfo; - - -/** Retrieve a pointer to a structure containing information about a specific - host Api. - - @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) - - @return A pointer to an immutable PaHostApiInfo structure describing - a specific host API. If the hostApi parameter is out of range or an error - is encountered, the function returns NULL. - - The returned structure is owned by the PortAudio implementation and must not - be manipulated or freed. The pointer is only guaranteed to be valid between - calls to Pa_Initialize() and Pa_Terminate(). -*/ -const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi ); - - -/** Convert a static host API unique identifier, into a runtime - host API index. - - @param type A unique host API identifier belonging to the PaHostApiTypeId - enumeration. - - @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or, - a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. - - The paHostApiNotFound error code indicates that the host API specified by the - type parameter is not available. - - @see PaHostApiTypeId -*/ -PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ); - - -/** Convert a host-API-specific device index to standard PortAudio device index. - This function may be used in conjunction with the deviceCount field of - PaHostApiInfo to enumerate all devices for the specified host API. - - @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) - - @param hostApiDeviceIndex A valid per-host device index in the range - 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1) - - @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1) - or, a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. - - A paInvalidHostApi error code indicates that the host API index specified by - the hostApi parameter is out of range. - - A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter - is out of range. - - @see PaHostApiInfo -*/ -PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, - int hostApiDeviceIndex ); - - - -/** Structure used to return information about a host error condition. -*/ -typedef struct PaHostErrorInfo{ - PaHostApiTypeId hostApiType; /**< the host API which returned the error code */ - long errorCode; /**< the error code returned */ - const char *errorText; /**< a textual description of the error if available, otherwise a zero-length string */ -}PaHostErrorInfo; - - -/** Return information about the last host error encountered. The error - information returned by Pa_GetLastHostErrorInfo() will never be modified - asyncronously by errors occurring in other PortAudio owned threads - (such as the thread that manages the stream callback.) - - This function is provided as a last resort, primarily to enhance debugging - by providing clients with access to all available error information. - - @return A pointer to an immutable structure constaining information about - the host error. The values in this structure will only be valid if a - PortAudio function has previously returned the paUnanticipatedHostError - error code. -*/ -const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ); - - - -/* Device enumeration and capabilities */ - -/** Retrieve the number of available devices. The number of available devices - may be zero. - - @return A non-negative value indicating the number of available devices or, - a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. -*/ -PaDeviceIndex Pa_GetDeviceCount( void ); - - -/** Retrieve the index of the default input device. The result can be - used in the inputDevice parameter to Pa_OpenStream(). - - @return The default input device index for the default host API, or paNoDevice - if no default input device is available or an error was encountered. -*/ -PaDeviceIndex Pa_GetDefaultInputDevice( void ); - - -/** Retrieve the index of the default output device. The result can be - used in the outputDevice parameter to Pa_OpenStream(). - - @return The default output device index for the defualt host API, or paNoDevice - if no default output device is available or an error was encountered. - - @note - On the PC, the user can specify a default device by - setting an environment variable. For example, to use device #1. -
    - set PA_RECOMMENDED_OUTPUT_DEVICE=1
    -
    - The user should first determine the available device ids by using - the supplied application "pa_devs". -*/ -PaDeviceIndex Pa_GetDefaultOutputDevice( void ); - - -/** The type used to represent monotonic time in seconds that can be used - for syncronisation. The type is used for the outTime argument to the - PaStreamCallback and as the result of Pa_GetStreamTime(). - - @see PaStreamCallback, Pa_GetStreamTime -*/ -typedef double PaTime; - - -/** A type used to specify one or more sample formats. Each value indicates - a possible format for sound data passed to and from the stream callback, - Pa_ReadStream and Pa_WriteStream. - - The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 - and aUInt8 are usually implemented by all implementations. - - The floating point representation (paFloat32) uses +1.0 and -1.0 as the - maximum and minimum respectively. - - paUInt8 is an unsigned 8 bit format where 128 is considered "ground" - - The paNonInterleaved flag indicates that a multichannel buffer is passed - as a set of non-interleaved pointers. - - @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo - @see paFloat32, paInt16, paInt32, paInt24, paInt8 - @see paUInt8, paCustomFormat, paNonInterleaved -*/ -typedef unsigned long PaSampleFormat; - - -#define paFloat32 ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */ -#define paInt32 ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */ -#define paInt24 ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */ -#define paInt16 ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */ -#define paInt8 ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */ -#define paUInt8 ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */ -#define paCustomFormat ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */ - -#define paNonInterleaved ((PaSampleFormat) 0x80000000) - -/** A structure providing information and capabilities of PortAudio devices. - Devices may support input, output or both input and output. -*/ -typedef struct PaDeviceInfo -{ - int structVersion; /* this is struct version 2 */ - const char *name; - PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/ - - int maxInputChannels; - int maxOutputChannels; - - /* Default latency values for interactive performance. */ - PaTime defaultLowInputLatency; - PaTime defaultLowOutputLatency; - /* Default latency values for robust non-interactive applications (eg. playing sound files). */ - PaTime defaultHighInputLatency; - PaTime defaultHighOutputLatency; - - double defaultSampleRate; -} PaDeviceInfo; - - -/** Retrieve a pointer to a PaDeviceInfo structure containing information - about the specified device. - @return A pointer to an immutable PaDeviceInfo structure. If the device - parameter is out of range the function returns NULL. - - @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1) - - @note PortAudio manages the memory referenced by the returned pointer, - the client must not manipulate or free the memory. The pointer is only - guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate(). - - @see PaDeviceInfo, PaDeviceIndex -*/ -const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ); - - -/** Parameters for one direction (input or output) of a stream. -*/ -typedef struct PaStreamParameters -{ - /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1) - specifying the device to be used or the special constant - paUseHostApiSpecificDeviceSpecification which indicates that the actual - device(s) to use are specified in hostApiSpecificStreamInfo. - This field must not be set to paNoDevice. - */ - PaDeviceIndex device; - - /** The number of channels of sound to be delivered to the - stream callback or accessed by Pa_ReadStream() or Pa_WriteStream(). - It can range from 1 to the value of maxInputChannels in the - PaDeviceInfo record for the device specified by the device parameter. - */ - int channelCount; - - /** The sample format of the buffer provided to the stream callback, - a_ReadStream() or Pa_WriteStream(). It may be any of the formats described - by the PaSampleFormat enumeration. - */ - PaSampleFormat sampleFormat; - - /** The desired latency in seconds. Where practical, implementations should - configure their latency based on these parameters, otherwise they may - choose the closest viable latency instead. Unless the suggested latency - is greater than the absolute upper limit for the device implementations - should round the suggestedLatency up to the next practial value - ie to - provide an equal or higher latency than suggestedLatency wherever possibe. - Actual latency values for an open stream may be retrieved using the - inputLatency and outputLatency fields of the PaStreamInfo structure - returned by Pa_GetStreamInfo(). - @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo - */ - PaTime suggestedLatency; - - /** An optional pointer to a host api specific data structure - containing additional information for device setup and/or stream processing. - hostApiSpecificStreamInfo is never required for correct operation, - if not used it should be set to NULL. - */ - void *hostApiSpecificStreamInfo; - -} PaStreamParameters; - - -/** Return code for Pa_IsFormatSupported indicating success. */ -#define paFormatIsSupported (0) - -/** Determine whether it would be possible to open a stream with the specified - parameters. - - @param inputParameters A structure that describes the input parameters used to - open a stream. The suggestedLatency field is ignored. See PaStreamParameters - for a description of these parameters. inputParameters must be NULL for - output-only streams. - - @param outputParameters A structure that describes the output parameters used - to open a stream. The suggestedLatency field is ignored. See PaStreamParameters - for a description of these parameters. outputParameters must be NULL for - input-only streams. - - @param sampleRate The required sampleRate. For full-duplex streams it is the - sample rate for both input and output - - @return Returns 0 if the format is supported, and an error code indicating why - the format is not supported otherwise. The constant paFormatIsSupported is - provided to compare with the return value for success. - - @see paFormatIsSupported, PaStreamParameters -*/ -PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate ); - - - -/* Streaming types and functions */ - - -/** - A single PaStream can provide multiple channels of real-time - streaming audio input and output to a client application. A stream - provides access to audio hardware represented by one or more - PaDevices. Depending on the underlying Host API, it may be possible - to open multiple streams using the same device, however this behavior - is implementation defined. Portable applications should assume that - a PaDevice may be simultaneously used by at most one PaStream. - - Pointers to PaStream objects are passed between PortAudio functions that - operate on streams. - - @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream, - Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive, - Pa_GetStreamTime, Pa_GetStreamCpuLoad - -*/ -typedef void PaStream; - - -/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream() - or Pa_OpenDefaultStream() to indicate that the stream callback will - accept buffers of any size. -*/ -#define paFramesPerBufferUnspecified (0) - - -/** Flags used to control the behavior of a stream. They are passed as - parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be - ORed together. - - @see Pa_OpenStream, Pa_OpenDefaultStream - @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput, - paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags -*/ -typedef unsigned long PaStreamFlags; - -/** @see PaStreamFlags */ -#define paNoFlag ((PaStreamFlags) 0) - -/** Disable default clipping of out of range samples. - @see PaStreamFlags -*/ -#define paClipOff ((PaStreamFlags) 0x00000001) - -/** Disable default dithering. - @see PaStreamFlags -*/ -#define paDitherOff ((PaStreamFlags) 0x00000002) - -/** Flag requests that where possible a full duplex stream will not discard - overflowed input samples without calling the stream callback. This flag is - only valid for full duplex callback streams and only when used in combination - with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using - this flag incorrectly results in a paInvalidFlag error being returned from - Pa_OpenStream and Pa_OpenDefaultStream. - - @see PaStreamFlags, paFramesPerBufferUnspecified -*/ -#define paNeverDropInput ((PaStreamFlags) 0x00000004) - -/** Call the stream callback to fill initial output buffers, rather than the - default behavior of priming the buffers with zeros (silence). This flag has - no effect for input-only and blocking read/write streams. - - @see PaStreamFlags -*/ -#define paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) - -/** A mask specifying the platform specific bits. - @see PaStreamFlags -*/ -#define paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000) - -/** - Timing information for the buffers passed to the stream callback. -*/ -typedef struct PaStreamCallbackTimeInfo{ - PaTime inputBufferAdcTime; - PaTime currentTime; - PaTime outputBufferDacTime; -} PaStreamCallbackTimeInfo; - - -/** - Flag bit constants for the statusFlags to PaStreamCallback. - - @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow, - paPrimingOutput -*/ -typedef unsigned long PaStreamCallbackFlags; - -/** In a stream opened with paFramesPerBufferUnspecified, indicates that - input data is all silence (zeros) because no real data is available. In a - stream opened without paFramesPerBufferUnspecified, it indicates that one or - more zero samples have been inserted into the input buffer to compensate - for an input underflow. - @see PaStreamCallbackFlags -*/ -#define paInputUnderflow ((PaStreamCallbackFlags) 0x00000001) - -/** In a stream opened with paFramesPerBufferUnspecified, indicates that data - prior to the first sample of the input buffer was discarded due to an - overflow, possibly because the stream callback is using too much CPU time. - Otherwise indicates that data prior to one or more samples in the - input buffer was discarded. - @see PaStreamCallbackFlags -*/ -#define paInputOverflow ((PaStreamCallbackFlags) 0x00000002) - -/** Indicates that output data (or a gap) was inserted, possibly because the - stream callback is using too much CPU time. - @see PaStreamCallbackFlags -*/ -#define paOutputUnderflow ((PaStreamCallbackFlags) 0x00000004) - -/** Indicates that output data will be discarded because no room is available. - @see PaStreamCallbackFlags -*/ -#define paOutputOverflow ((PaStreamCallbackFlags) 0x00000008) - -/** Some of all of the output data will be used to prime the stream, input - data may be zero. - @see PaStreamCallbackFlags -*/ -#define paPrimingOutput ((PaStreamCallbackFlags) 0x00000010) - -/** - Allowable return values for the PaStreamCallback. - @see PaStreamCallback -*/ -typedef enum PaStreamCallbackResult -{ - paContinue=0, - paComplete=1, - paAbort=2 -} PaStreamCallbackResult; - - -/** - Functions of type PaStreamCallback are implemented by PortAudio clients. - They consume, process or generate audio in response to requests from an - active PortAudio stream. - - @param input and @param output are arrays of interleaved samples, - the format, packing and number of channels used by the buffers are - determined by parameters to Pa_OpenStream(). - - @param frameCount The number of sample frames to be processed by - the stream callback. - - @param timeInfo The time in seconds when the first sample of the input - buffer was received at the audio input, the time in seconds when the first - sample of the output buffer will begin being played at the audio output, and - the time in seconds when the stream callback was called. - See also Pa_GetStreamTime() - - @param statusFlags Flags indicating whether input and/or output buffers - have been inserted or will be dropped to overcome underflow or overflow - conditions. - - @param userData The value of a user supplied pointer passed to - Pa_OpenStream() intended for storing synthesis data etc. - - @return - The stream callback should return one of the values in the - PaStreamCallbackResult enumeration. To ensure that the callback continues - to be called, it should return paContinue (0). Either paComplete or paAbort - can be returned to finish stream processing, after either of these values is - returned the callback will not be called again. If paAbort is returned the - stream will finish as soon as possible. If paComplete is returned, the stream - will continue until all buffers generated by the callback have been played. - This may be useful in applications such as soundfile players where a specific - duration of output is required. However, it is not necessary to utilise this - mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also - be used to stop the stream. The callback must always fill the entire output - buffer irrespective of its return value. - - @see Pa_OpenStream, Pa_OpenDefaultStream - - @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call - PortAudio API functions from within the stream callback. -*/ -typedef int PaStreamCallback( - const void *input, void *output, - unsigned long frameCount, - const PaStreamCallbackTimeInfo* timeInfo, - PaStreamCallbackFlags statusFlags, - void *userData ); - - -/** Opens a stream for either input, output or both. - - @param stream The address of a PaStream pointer which will receive - a pointer to the newly opened stream. - - @param inputParameters A structure that describes the input parameters used by - the opened stream. See PaStreamParameters for a description of these parameters. - inputParameters must be NULL for output-only streams. - - @param outputParameters A structure that describes the output parameters used by - the opened stream. See PaStreamParameters for a description of these parameters. - outputParameters must be NULL for input-only streams. - - @param sampleRate The desired sampleRate. For full-duplex streams it is the - sample rate for both input and output - - @param framesPerBuffer The number of frames passed to the stream callback - function, or the preferred block granularity for a blocking read/write stream. - The special value paFramesPerBufferUnspecified (0) may be used to request that - the stream callback will recieve an optimal (and possibly varying) number of - frames based on host requirements and the requested latency settings. - Note: With some host APIs, the use of non-zero framesPerBuffer for a callback - stream may introduce an additional layer of buffering which could introduce - additional latency. PortAudio guarantees that the additional latency - will be kept to the theoretical minimum however, it is strongly recommended - that a non-zero framesPerBuffer value only be used when your algorithm - requires a fixed number of frames per stream callback. - - @param streamFlags Flags which modify the behaviour of the streaming process. - This parameter may contain a combination of flags ORed together. Some flags may - only be relevant to certain buffer formats. - - @param streamCallback A pointer to a client supplied function that is responsible - for processing and filling input and output buffers. If this parameter is NULL - the stream will be opened in 'blocking read/write' mode. In blocking mode, - the client can receive sample data using Pa_ReadStream and write sample data - using Pa_WriteStream, the number of samples that may be read or written - without blocking is returned by Pa_GetStreamReadAvailable and - Pa_GetStreamWriteAvailable respectively. - - @param userData A client supplied pointer which is passed to the stream callback - function. It could for example, contain a pointer to instance data necessary - for processing the audio buffers. This parameter is ignored if streamCallback - is NULL. - - @return - Upon success Pa_OpenStream() returns paNoError and places a pointer to a - valid PaStream in the stream argument. The stream is inactive (stopped). - If a call to Pa_OpenStream() fails, a non-zero error code is returned (see - PaError for possible error codes) and the value of stream is invalid. - - @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream, - Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable -*/ -PaError Pa_OpenStream( PaStream** stream, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - void *userData ); - - -/** A simplified version of Pa_OpenStream() that opens the default input - and/or output devices. - - @param stream The address of a PaStream pointer which will receive - a pointer to the newly opened stream. - - @param numInputChannels The number of channels of sound that will be supplied - to the stream callback or returned by Pa_ReadStream. It can range from 1 to - the value of maxInputChannels in the PaDeviceInfo record for the default input - device. If 0 the stream is opened as an output-only stream. - - @param numOutputChannels The number of channels of sound to be delivered to the - stream callback or passed to Pa_WriteStream. It can range from 1 to the value - of maxOutputChannels in the PaDeviceInfo record for the default output dvice. - If 0 the stream is opened as an output-only stream. - - @param sampleFormat The sample format of both the input and output buffers - provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream. - sampleFormat may be any of the formats described by the PaSampleFormat - enumeration. - - @param sampleRate Same as Pa_OpenStream parameter of the same name. - @param framesPerBuffer Same as Pa_OpenStream parameter of the same name. - @param streamCallback Same as Pa_OpenStream parameter of the same name. - @param userData Same as Pa_OpenStream parameter of the same name. - - @return As for Pa_OpenStream - - @see Pa_OpenStream, PaStreamCallback -*/ -PaError Pa_OpenDefaultStream( PaStream** stream, - int numInputChannels, - int numOutputChannels, - PaSampleFormat sampleFormat, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamCallback *streamCallback, - void *userData ); - - -/** Closes an audio stream. If the audio stream is active it - discards any pending buffers as if Pa_AbortStream() had been called. -*/ -PaError Pa_CloseStream( PaStream *stream ); - - -/** Functions of type PaStreamFinishedCallback are implemented by PortAudio - clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback - function. Once registered they are called when the stream becomes inactive - (ie once a call to Pa_StopStream() will not block). - A stream will become inactive after the stream callback returns non-zero, - or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio - output, if the stream callback returns paComplete, or Pa_StopStream is called, - the stream finished callback will not be called until all generated sample data - has been played. - - @param userData The userData parameter supplied to Pa_OpenStream() - - @see Pa_SetStreamFinishedCallback -*/ -typedef void PaStreamFinishedCallback( void *userData ); - - -/** Register a stream finished callback function which will be called when the - stream becomes inactive. See the description of PaStreamFinishedCallback for - further details about when the callback will be called. - - @param stream a pointer to a PaStream that is in the stopped state - if the - stream is not stopped, the stream's finished callback will remain unchanged - and an error code will be returned. - - @param streamFinishedCallback a pointer to a function with the same signature - as PaStreamFinishedCallback, that will be called when the stream becomes - inactive. Passing NULL for this parameter will un-register a previously - registered stream finished callback function. - - @return on success returns paNoError, otherwise an error code indicating the cause - of the error. - - @see PaStreamFinishedCallback -*/ -PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); - - -/** Commences audio processing. -*/ -PaError Pa_StartStream( PaStream *stream ); - - -/** Terminates audio processing. It waits until all pending - audio buffers have been played before it returns. -*/ -PaError Pa_StopStream( PaStream *stream ); - - -/** Terminates audio processing immediately without waiting for pending - buffers to complete. -*/ -PaError Pa_AbortStream( PaStream *stream ); - - -/** Determine whether the stream is stopped. - A stream is considered to be stopped prior to a successful call to - Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream. - If a stream callback returns a value other than paContinue the stream is NOT - considered to be stopped. - - @return Returns one (1) when the stream is stopped, zero (0) when - the stream is running or, a PaErrorCode (which are always negative) if - PortAudio is not initialized or an error is encountered. - - @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive -*/ -PaError Pa_IsStreamStopped( PaStream *stream ); - - -/** Determine whether the stream is active. - A stream is active after a successful call to Pa_StartStream(), until it - becomes inactive either as a result of a call to Pa_StopStream() or - Pa_AbortStream(), or as a result of a return value other than paContinue from - the stream callback. In the latter case, the stream is considered inactive - after the last buffer has finished playing. - - @return Returns one (1) when the stream is active (ie playing or recording - audio), zero (0) when not playing or, a PaErrorCode (which are always negative) - if PortAudio is not initialized or an error is encountered. - - @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped -*/ -PaError Pa_IsStreamActive( PaStream *stream ); - - - -/** A structure containing unchanging information about an open stream. - @see Pa_GetStreamInfo -*/ - -typedef struct PaStreamInfo -{ - /** this is struct version 1 */ - int structVersion; - - /** The input latency of the stream in seconds. This value provides the most - accurate estimate of input latency available to the implementation. It may - differ significantly from the suggestedLatency value passed to Pa_OpenStream(). - The value of this field will be zero (0.) for output-only streams. - @see PaTime - */ - PaTime inputLatency; - - /** The output latency of the stream in seconds. This value provides the most - accurate estimate of output latency available to the implementation. It may - differ significantly from the suggestedLatency value passed to Pa_OpenStream(). - The value of this field will be zero (0.) for input-only streams. - @see PaTime - */ - PaTime outputLatency; - - /** The sample rate of the stream in Hertz (samples per second). In cases - where the hardware sample rate is inaccurate and PortAudio is aware of it, - the value of this field may be different from the sampleRate parameter - passed to Pa_OpenStream(). If information about the actual hardware sample - rate is not available, this field will have the same value as the sampleRate - parameter passed to Pa_OpenStream(). - */ - double sampleRate; - -} PaStreamInfo; - - -/** Retrieve a pointer to a PaStreamInfo structure containing information - about the specified stream. - @return A pointer to an immutable PaStreamInfo structure. If the stream - parameter invalid, or an error is encountered, the function returns NULL. - - @param stream A pointer to an open stream previously created with Pa_OpenStream. - - @note PortAudio manages the memory referenced by the returned pointer, - the client must not manipulate or free the memory. The pointer is only - guaranteed to be valid until the specified stream is closed. - - @see PaStreamInfo -*/ -const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ); - - -/** Determine the current time for the stream according to the same clock used - to generate buffer timestamps. This time may be used for syncronising other - events to the audio stream, for example synchronizing audio to MIDI. - - @return The stream's current time in seconds, or 0 if an error occurred. - - @see PaTime, PaStreamCallback -*/ -PaTime Pa_GetStreamTime( PaStream *stream ); - - -/** Retrieve CPU usage information for the specified stream. - The "CPU Load" is a fraction of total CPU time consumed by a callback stream's - audio processing routines including, but not limited to the client supplied - stream callback. This function does not work with blocking read/write streams. - - This function may be called from the stream callback function or the - application. - - @return - A floating point value, typically between 0.0 and 1.0, where 1.0 indicates - that the stream callback is consuming the maximum number of CPU cycles possible - to maintain real-time operation. A value of 0.5 would imply that PortAudio and - the stream callback was consuming roughly 50% of the available CPU time. The - return value may exceed 1.0. A value of 0.0 will always be returned for a - blocking read/write stream, or if an error occurrs. -*/ -double Pa_GetStreamCpuLoad( PaStream* stream ); - - -/** Read samples from an input stream. The function doesn't return until - the entire buffer has been filled - this may involve waiting for the operating - system to supply the data. - - @param stream A pointer to an open stream previously created with Pa_OpenStream. - - @param buffer A pointer to a buffer of sample frames. The buffer contains - samples in the format specified by the inputParameters->sampleFormat field - used to open the stream, and the number of channels specified by - inputParameters->numChannels. If non-interleaved samples were requested, - buffer is a pointer to the first element of an array of non-interleaved - buffer pointers, one for each channel. - - @param frames The number of frames to be read into buffer. This parameter - is not constrained to a specific range, however high performance applications - will want to match this parameter to the framesPerBuffer parameter used - when opening the stream. - - @return On success PaNoError will be returned, or PaInputOverflowed if input - data was discarded by PortAudio after the previous call and before this call. -*/ -PaError Pa_ReadStream( PaStream* stream, - void *buffer, - unsigned long frames ); - - -/** Write samples to an output stream. This function doesn't return until the - entire buffer has been consumed - this may involve waiting for the operating - system to consume the data. - - @param stream A pointer to an open stream previously created with Pa_OpenStream. - - @param buffer A pointer to a buffer of sample frames. The buffer contains - samples in the format specified by the outputParameters->sampleFormat field - used to open the stream, and the number of channels specified by - outputParameters->numChannels. If non-interleaved samples were requested, - buffer is a pointer to the first element of an array of non-interleaved - buffer pointers, one for each channel. - - @param frames The number of frames to be written from buffer. This parameter - is not constrained to a specific range, however high performance applications - will want to match this parameter to the framesPerBuffer parameter used - when opening the stream. - - @return On success PaNoError will be returned, or paOutputUnderflowed if - additional output data was inserted after the previous call and before this - call. -*/ -PaError Pa_WriteStream( PaStream* stream, - const void *buffer, - unsigned long frames ); - - -/** Retrieve the number of frames that can be read from the stream without - waiting. - - @return Returns a non-negative value representing the maximum number of frames - that can be read from the stream without blocking or busy waiting or, a - PaErrorCode (which are always negative) if PortAudio is not initialized or an - error is encountered. -*/ -signed long Pa_GetStreamReadAvailable( PaStream* stream ); - - -/** Retrieve the number of frames that can be written to the stream without - waiting. - - @return Returns a non-negative value representing the maximum number of frames - that can be written to the stream without blocking or busy waiting or, a - PaErrorCode (which are always negative) if PortAudio is not initialized or an - error is encountered. -*/ -signed long Pa_GetStreamWriteAvailable( PaStream* stream ); - - -/* Miscellaneous utilities */ - - -/** Retrieve the size of a given sample format in bytes. - - @return The size in bytes of a single sample in the specified format, - or paSampleFormatNotSupported if the format is not supported. -*/ -PaError Pa_GetSampleSize( PaSampleFormat format ); - - -/** Put the caller to sleep for at least 'msec' milliseconds. This function is - provided only as a convenience for authors of portable code (such as the tests - and examples in the PortAudio distribution.) - - The function may sleep longer than requested so don't rely on this for accurate - musical timing. -*/ -void Pa_Sleep( long msec ); - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PORTAUDIO_H */ From d8934b4f71d65e356a6407d71dd35e8ffbb2b029 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 9 Aug 2006 19:59:20 +0000 Subject: [PATCH 187/811] - Updated portaudio git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@247 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- portaudio-v19/Makefile | 179 +- portaudio-v19/Makefile.in | 168 +- portaudio-v19/README.txt | 2 +- portaudio-v19/SConstruct | 199 +- portaudio-v19/aclocal.m4 | 6658 ++++- portaudio-v19/config.doxy | 114 +- portaudio-v19/config.guess | 31 +- portaudio-v19/config.sub | 41 +- portaudio-v19/configure | 22347 +++++++++++++++- portaudio-v19/configure.in | 136 +- portaudio-v19/include/pa_asio.h | 122 + portaudio-v19/include/pa_linux_alsa.h | 64 + portaudio-v19/include/pa_mac_core.h | 70 + portaudio-v19/include/pa_win_wmme.h | 160 + portaudio-v19/include/portaudio.h | 1126 + portaudio-v19/src/SConscript | 198 + portaudio-v19/src/common/pa_allocation.c | 234 + portaudio-v19/src/common/pa_allocation.h | 95 + portaudio-v19/src/common/pa_converters.c | 1926 ++ portaudio-v19/src/common/pa_converters.h | 254 + portaudio-v19/src/common/pa_cpuload.c | 96 + portaudio-v19/src/common/pa_cpuload.h | 63 + portaudio-v19/src/common/pa_dither.c | 204 + portaudio-v19/src/common/pa_dither.h | 91 + portaudio-v19/src/common/pa_endianness.h | 130 + portaudio-v19/src/common/pa_front.c | 1981 ++ portaudio-v19/src/common/pa_hostapi.h | 244 + portaudio-v19/src/common/pa_process.c | 1763 ++ portaudio-v19/src/common/pa_process.h | 741 + portaudio-v19/src/common/pa_skeleton.c | 807 + portaudio-v19/src/common/pa_stream.c | 141 + portaudio-v19/src/common/pa_stream.h | 196 + portaudio-v19/src/common/pa_trace.c | 88 + portaudio-v19/src/common/pa_trace.h | 70 + portaudio-v19/src/common/pa_types.h | 65 + portaudio-v19/src/common/pa_util.h | 167 + .../src/hostapi/alsa/pa_linux_alsa.c | 3310 +++ .../src/hostapi/asihpi/pa_linux_asihpi.c | 2900 ++ .../src/hostapi/asio/ASIO-README.txt | 137 + .../src/hostapi/asio/Callback_adaptation_.pdf | Bin 0 -> 50527 bytes portaudio-v19/src/hostapi/asio/Pa_ASIO.pdf | Bin 0 -> 50778 bytes .../hostapi/asio/iasiothiscallresolver.cpp | 563 + .../src/hostapi/asio/iasiothiscallresolver.h | 197 + portaudio-v19/src/hostapi/asio/pa_asio.cpp | 2969 ++ portaudio-v19/src/hostapi/coreaudio/notes.txt | 145 + .../src/hostapi/coreaudio/pa_mac_core.c | 2033 ++ .../hostapi/coreaudio/pa_mac_core_blocking.c | 506 + .../hostapi/coreaudio/pa_mac_core_blocking.h | 76 + .../hostapi/coreaudio/pa_mac_core_internal.h | 155 + .../src/hostapi/coreaudio/pa_mac_core_old.c | 907 + .../hostapi/coreaudio/pa_mac_core_utilities.c | 565 + .../hostapi/coreaudio/pa_mac_core_utilities.h | 159 + .../src/hostapi/coreaudio/ringbuffer.c | 254 + .../src/hostapi/coreaudio/ringbuffer.h | 105 + portaudio-v19/src/hostapi/dsound/pa_win_ds.c | 2178 ++ .../src/hostapi/dsound/pa_win_ds_dynlink.c | 121 + .../src/hostapi/dsound/pa_win_ds_dynlink.h | 82 + portaudio-v19/src/hostapi/jack/pa_jack.c | 1724 ++ .../src/hostapi/oss/low_latency_tip.txt | Bin 0 -> 3111 bytes portaudio-v19/src/hostapi/oss/pa_unix_oss.c | 1929 ++ .../src/hostapi/oss/pa_unix_oss.c.orig | 1924 ++ portaudio-v19/src/hostapi/oss/recplay.c | 114 + .../src/hostapi/wasapi/pa_win_wasapi.cpp | 1770 ++ .../src/hostapi/wdmks/pa_win_wdmks.c | 3269 +++ portaudio-v19/src/hostapi/wdmks/readme.txt | 82 + portaudio-v19/src/hostapi/wmme/pa_win_wmme.c | 3634 +++ .../src/os/mac_osx/pa_mac_hostapis.c | 79 + portaudio-v19/src/os/unix/pa_unix_hostapis.c | 68 + portaudio-v19/src/os/unix/pa_unix_util.c | 672 + portaudio-v19/src/os/unix/pa_unix_util.h | 179 + portaudio-v19/src/os/win/pa_win_hostapis.c | 91 + portaudio-v19/src/os/win/pa_win_util.c | 134 + .../src/os/win/pa_x86_plain_converters.c | 1167 + .../src/os/win/pa_x86_plain_converters.h | 19 + 74 files changed, 73647 insertions(+), 1541 deletions(-) create mode 100644 portaudio-v19/include/pa_asio.h create mode 100644 portaudio-v19/include/pa_linux_alsa.h create mode 100644 portaudio-v19/include/pa_mac_core.h create mode 100644 portaudio-v19/include/pa_win_wmme.h create mode 100644 portaudio-v19/include/portaudio.h create mode 100644 portaudio-v19/src/SConscript create mode 100644 portaudio-v19/src/common/pa_allocation.c create mode 100644 portaudio-v19/src/common/pa_allocation.h create mode 100644 portaudio-v19/src/common/pa_converters.c create mode 100644 portaudio-v19/src/common/pa_converters.h create mode 100644 portaudio-v19/src/common/pa_cpuload.c create mode 100644 portaudio-v19/src/common/pa_cpuload.h create mode 100644 portaudio-v19/src/common/pa_dither.c create mode 100644 portaudio-v19/src/common/pa_dither.h create mode 100644 portaudio-v19/src/common/pa_endianness.h create mode 100644 portaudio-v19/src/common/pa_front.c create mode 100644 portaudio-v19/src/common/pa_hostapi.h create mode 100644 portaudio-v19/src/common/pa_process.c create mode 100644 portaudio-v19/src/common/pa_process.h create mode 100644 portaudio-v19/src/common/pa_skeleton.c create mode 100644 portaudio-v19/src/common/pa_stream.c create mode 100644 portaudio-v19/src/common/pa_stream.h create mode 100644 portaudio-v19/src/common/pa_trace.c create mode 100644 portaudio-v19/src/common/pa_trace.h create mode 100644 portaudio-v19/src/common/pa_types.h create mode 100644 portaudio-v19/src/common/pa_util.h create mode 100644 portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c create mode 100644 portaudio-v19/src/hostapi/asihpi/pa_linux_asihpi.c create mode 100644 portaudio-v19/src/hostapi/asio/ASIO-README.txt create mode 100644 portaudio-v19/src/hostapi/asio/Callback_adaptation_.pdf create mode 100644 portaudio-v19/src/hostapi/asio/Pa_ASIO.pdf create mode 100644 portaudio-v19/src/hostapi/asio/iasiothiscallresolver.cpp create mode 100644 portaudio-v19/src/hostapi/asio/iasiothiscallresolver.h create mode 100644 portaudio-v19/src/hostapi/asio/pa_asio.cpp create mode 100644 portaudio-v19/src/hostapi/coreaudio/notes.txt create mode 100644 portaudio-v19/src/hostapi/coreaudio/pa_mac_core.c create mode 100644 portaudio-v19/src/hostapi/coreaudio/pa_mac_core_blocking.c create mode 100644 portaudio-v19/src/hostapi/coreaudio/pa_mac_core_blocking.h create mode 100644 portaudio-v19/src/hostapi/coreaudio/pa_mac_core_internal.h create mode 100644 portaudio-v19/src/hostapi/coreaudio/pa_mac_core_old.c create mode 100644 portaudio-v19/src/hostapi/coreaudio/pa_mac_core_utilities.c create mode 100644 portaudio-v19/src/hostapi/coreaudio/pa_mac_core_utilities.h create mode 100644 portaudio-v19/src/hostapi/coreaudio/ringbuffer.c create mode 100644 portaudio-v19/src/hostapi/coreaudio/ringbuffer.h create mode 100644 portaudio-v19/src/hostapi/dsound/pa_win_ds.c create mode 100644 portaudio-v19/src/hostapi/dsound/pa_win_ds_dynlink.c create mode 100644 portaudio-v19/src/hostapi/dsound/pa_win_ds_dynlink.h create mode 100644 portaudio-v19/src/hostapi/jack/pa_jack.c create mode 100644 portaudio-v19/src/hostapi/oss/low_latency_tip.txt create mode 100644 portaudio-v19/src/hostapi/oss/pa_unix_oss.c create mode 100644 portaudio-v19/src/hostapi/oss/pa_unix_oss.c.orig create mode 100644 portaudio-v19/src/hostapi/oss/recplay.c create mode 100644 portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.cpp create mode 100644 portaudio-v19/src/hostapi/wdmks/pa_win_wdmks.c create mode 100644 portaudio-v19/src/hostapi/wdmks/readme.txt create mode 100644 portaudio-v19/src/hostapi/wmme/pa_win_wmme.c create mode 100644 portaudio-v19/src/os/mac_osx/pa_mac_hostapis.c create mode 100644 portaudio-v19/src/os/unix/pa_unix_hostapis.c create mode 100644 portaudio-v19/src/os/unix/pa_unix_util.c create mode 100644 portaudio-v19/src/os/unix/pa_unix_util.h create mode 100644 portaudio-v19/src/os/win/pa_win_hostapis.c create mode 100644 portaudio-v19/src/os/win/pa_win_util.c create mode 100644 portaudio-v19/src/os/win/pa_x86_plain_converters.c create mode 100644 portaudio-v19/src/os/win/pa_x86_plain_converters.h diff --git a/portaudio-v19/Makefile b/portaudio-v19/Makefile index 61b734506..e09142612 100644 --- a/portaudio-v19/Makefile +++ b/portaudio-v19/Makefile @@ -1,40 +1,58 @@ -# Generated automatically from Makefile.in by configure. # # PortAudio V19 Makefile.in # # Dominic Mazzoni +# Modifications by Mikael Magnusson # +top_srcdir = . +srcdir = . + +top_builddir = . PREFIX = /usr/local -CC = cc -CFLAGS = -Ipa_common -g -O2 -Wall -pedantic -pipe -fPIC -DPA_LITTLE_ENDIAN -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_LIBPTHREAD=1 -DPA_USE_OSS=1 -LIBS = -lpthread -lm -lpthread +prefix = $(PREFIX) +exec_prefix = ${prefix} +bindir = ${exec_prefix}/bin +libdir = ${exec_prefix}/lib +includedir = ${prefix}/include +CC = gcc +CFLAGS = -g -O2 -DPA_LITTLE_ENDIAN -pthread -I$(top_srcdir)/include -I$(top_srcdir)/src/common -I$(top_srcdir)/src/os/unix -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_CLOCK_GETTIME=1 -DHAVE_NANOSLEEP=1 -DPA_USE_OSS=1 +LIBS = -lm -lpthread AR = /usr/bin/ar RANLIB = ranlib +LIBTOOL = $(SHELL) $(top_builddir)/libtool INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 SHARED_FLAGS = -shared -fPIC -DLL_LIBS = -CXXFLAGS = +LDFLAGS = +DLL_LIBS = -lrt -lm -lpthread +CXXFLAGS = -g -O2 NASM = NASMOPT = +LN_S = ln -s +LT_RELEASE=@LT_RELEASE@ +LT_CURRENT=2 +LT_REVISION=0 +LT_AGE=0 -OTHER_OBJS = pa_unix_oss/pa_unix_oss.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o +OTHER_OBJS = src/hostapi/oss/pa_unix_oss.o src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o -PALIB = libportaudio.a -PADLL = libportaudio.so -PADLLV = $(PADLL).0.0.19 -PAINC = pa_common/portaudio.h +PALIB = libportaudio.la +PAINC = include/portaudio.h + +PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined -export-symbols-regex "Pa_.*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) +#MAKEFILE = Makefile COMMON_OBJS = \ - pa_common/pa_allocation.o \ - pa_common/pa_converters.o \ - pa_common/pa_cpuload.o \ - pa_common/pa_dither.o \ - pa_common/pa_front.o \ - pa_common/pa_process.o \ - pa_common/pa_skeleton.o \ - pa_common/pa_stream.o \ - pa_common/pa_trace.o + src/common/pa_allocation.o \ + src/common/pa_converters.o \ + src/common/pa_cpuload.o \ + src/common/pa_dither.o \ + src/common/pa_front.o \ + src/common/pa_process.o \ + src/common/pa_skeleton.o \ + src/common/pa_stream.o \ + src/common/pa_trace.o TESTS = \ bin/paqa_devs \ @@ -56,6 +74,7 @@ TESTS = \ bin/patest_pink \ bin/patest_prime \ bin/patest_read_record \ + bin/patest_read_write_wire \ bin/patest_record \ bin/patest_ringmix \ bin/patest_saw \ @@ -65,7 +84,6 @@ TESTS = \ bin/patest_sine_time \ bin/patest_start_stop \ bin/patest_stop \ - bin/patest_sync \ bin/patest_toomanysines \ bin/patest_underflow \ bin/patest_wire \ @@ -77,6 +95,8 @@ TESTS = \ # Most of these don't compile yet. Put them in TESTS, above, if # you want to try to compile them... ALL_TESTS = \ + $(TESTS) \ + bin/patest_sync \ bin/debug_convert \ bin/debug_dither_calc \ bin/debug_dual \ @@ -88,65 +108,34 @@ ALL_TESTS = \ bin/debug_sine \ bin/debug_sine_formats \ bin/debug_srate \ - bin/debug_test1 \ - bin/pa_devs \ - bin/pa_fuzz \ - bin/pa_minlat \ - bin/paqa_devs \ - bin/paqa_errs \ - bin/patest1 \ - bin/patest_buffer \ - bin/patest_clip \ - bin/patest_dither \ - bin/patest_hang \ - bin/patest_in_overflow \ - bin/patest_latency \ - bin/patest_leftright \ - bin/patest_longsine \ - bin/patest_many \ - bin/patest_maxsines \ - bin/patest_multi_sine \ - bin/patest_out_underflow \ - bin/patest_pink \ - bin/patest_read_record \ - bin/patest_record \ - bin/patest_ringmix \ - bin/patest_saw \ - bin/patest_sine8 \ - bin/patest_sine \ - bin/patest_sine_formats \ - bin/patest_sine_time \ - bin/patest_start_stop \ - bin/patest_stop \ - bin/patest_sync \ - bin/patest_toomanysines \ - bin/patest_underflow \ - bin/patest_wire \ - bin/patest_write_sine + bin/debug_test1 OBJS = $(COMMON_OBJS) $(OTHER_OBJS) -all: lib/$(PALIB) lib/$(PADLLV) tests +LTOBJS:= $(OBJS:.o=.lo) -tests: bin/ $(TESTS) +SUBDIRS = +#SUBDIRS += bindings/cpp -lib/$(PALIB): lib/ $(OBJS) Makefile $(PAINC) - $(AR) ruv lib/$(PALIB) $(OBJS) - $(RANLIB) lib/$(PALIB) +all: lib/$(PALIB) all-recursive tests -lib/$(PADLLV): lib/ $(OBJS) Makefile $(PAINC) - $(CC) $(SHARED_FLAGS) -o lib/$(PADLLV) $(OBJS) $(DLL_LIBS) +tests: bin-stamp $(TESTS) -$(TESTS): bin/%: lib/$(PALIB) Makefile $(PAINC) pa_tests/%.c - $(CC) -o $@ $(CFLAGS) pa_tests/$*.c lib/$(PALIB) $(LIBS) -install: lib/$(PALIB) lib/$(PADLLV) - $(INSTALL) -d $(PREFIX)/lib - $(INSTALL) -m 644 lib/$(PADLLV) $(PREFIX)/lib/$(PADLLV) - $(INSTALL) -m 644 lib/$(PALIB) $(PREFIX)/lib/$(PALIB) - cd $(PREFIX)/lib && rm -f $(PADLL) && ln -s $(PADLLV) $(PADLL) - $(INSTALL) -d $(PREFIX)/include - $(INSTALL) -m 644 pa_common/portaudio.h $(PREFIX)/include/portaudio.h +lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC) + $(LIBTOOL) --mode=link $(CC) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS) + +$(ALL_TESTS): bin/%: lib/$(PALIB) $(MAKEFILE) $(PAINC) test/%.c + $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS) + + +install: lib/$(PALIB) portaudio-2.0.pc + $(INSTALL) -d $(DESTDIR)$(libdir) + $(LIBTOOL) --mode=install $(INSTALL) lib/$(PALIB) $(DESTDIR)$(libdir) + $(INSTALL) -d $(DESTDIR)$(includedir) + $(INSTALL_DATA) -m 644 $(top_srcdir)/$(PAINC) $(DESTDIR)$(includedir)/portaudio.h + $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig + $(INSTALL) -m 644 portaudio-2.0.pc $(DESTDIR)$(libdir)/pkgconfig/portaudio-2.0.pc @echo "" @echo "------------------------------------------------------------" @echo "PortAudio was successfully installed." @@ -154,33 +143,55 @@ install: lib/$(PALIB) lib/$(PADLLV) @echo "On some systems (e.g. Linux) you should run 'ldconfig' now" @echo "to make the shared object available. You may also need to" @echo "modify your LD_LIBRARY_PATH environment variable to include" - @echo "the directory $(PREFIX)/lib" + @echo "the directory $(libdir)" @echo "------------------------------------------------------------" @echo "" + $(MAKE) install-recursive uninstall: - rm -f $(PREFIX)/lib/$(PADLLV) - rm -f $(PREFIX)/lib/$(PALIB) - rm -f $(PREFIX)/lib/$(PADLL) - rm -f $(PREFIX)/include/portaudio.h + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(PALIB) + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(includedir)/portaudio.h + $(MAKE) uninstall-recursive clean: - rm -f $(OBJS) $(TESTS) lib/$(PALIB) lib/$(PADLLV) + $(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(ALL_TESTS) lib/$(PALIB) + rm -f bin-stamp lib-stamp + -rm -rf bin lib -%.o: %.c Makefile $(PAINC) +distclean: clean + rm -f config.log config.status Makefile libtool portaudio-2.0.pc + +%.o: %.c $(MAKEFILE) $(PAINC) $(CC) -c $(CFLAGS) $< -o $@ -%.o: %.cpp Makefile $(PAINC) +%.lo: %.c $(MAKEFILE) $(PAINC) + $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $< -o $@ + +%.o: %.cpp $(MAKEFILE) $(PAINC) $(CXX) -c $(CXXFLAGS) $< -o $@ %.o: %.asm $(NASM) $(NASMOPT) -o $@ $< -bin: - mkdir bin +bin-stamp: + -mkdir bin + touch $@ -lib: - mkdir lib +lib-stamp: + -mkdir lib + -mkdir -p src/os/win src/os/unix src/os/mac_osx src/common \ +src/hostapi/oss src/hostapi/alsa src/hostapi/jack src/hostapi/asihpi \ +src/hostapi/wmme src/hostapi/wdmks src/hostapi/dsound src/hostapi/wasapi + touch $@ +Makefile: Makefile.in config.status + $(SHELL) config.status +all-recursive: + for dir in $(SUBDIRS); do make -C $$dir all; done +install-recursive: + for dir in $(SUBDIRS); do make -C $$dir install; done + +uninstall-recursive: + for dir in $(SUBDIRS); do make -C $$dir uninstall; done diff --git a/portaudio-v19/Makefile.in b/portaudio-v19/Makefile.in index 9ba7a319c..ebd1c8cc6 100644 --- a/portaudio-v19/Makefile.in +++ b/portaudio-v19/Makefile.in @@ -2,38 +2,57 @@ # PortAudio V19 Makefile.in # # Dominic Mazzoni +# Modifications by Mikael Magnusson # +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ +top_builddir = . PREFIX = @prefix@ +prefix = $(PREFIX) +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ CC = @CC@ -CFLAGS = -Ipa_common @CFLAGS@ @DEFS@ +CFLAGS = @CFLAGS@ -I$(top_srcdir)/include -I$(top_srcdir)/src/common -I$(top_srcdir)/src/os/unix @DEFS@ LIBS = @LIBS@ AR = @AR@ RANLIB = @RANLIB@ +LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ SHARED_FLAGS = @SHARED_FLAGS@ +LDFLAGS = @LDFLAGS@ DLL_LIBS = @DLL_LIBS@ CXXFLAGS = @CXXFLAGS@ NASM = @NASM@ NASMOPT = @NASMOPT@ +LN_S = @LN_S@ +LT_RELEASE=@LT_RELEASE@ +LT_CURRENT=@LT_CURRENT@ +LT_REVISION=@LT_REVISION@ +LT_AGE=@LT_AGE@ OTHER_OBJS = @OTHER_OBJS@ -PALIB = libportaudio.a -PADLL = @PADLL@ -PADLLV = $(PADLL).0.0.19 -PAINC = pa_common/portaudio.h +PALIB = libportaudio.la +PAINC = include/portaudio.h + +PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined -export-symbols-regex "Pa_.*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) +#MAKEFILE = Makefile COMMON_OBJS = \ - pa_common/pa_allocation.o \ - pa_common/pa_converters.o \ - pa_common/pa_cpuload.o \ - pa_common/pa_dither.o \ - pa_common/pa_front.o \ - pa_common/pa_process.o \ - pa_common/pa_skeleton.o \ - pa_common/pa_stream.o \ - pa_common/pa_trace.o + src/common/pa_allocation.o \ + src/common/pa_converters.o \ + src/common/pa_cpuload.o \ + src/common/pa_dither.o \ + src/common/pa_front.o \ + src/common/pa_process.o \ + src/common/pa_skeleton.o \ + src/common/pa_stream.o \ + src/common/pa_trace.o TESTS = \ bin/paqa_devs \ @@ -55,6 +74,7 @@ TESTS = \ bin/patest_pink \ bin/patest_prime \ bin/patest_read_record \ + bin/patest_read_write_wire \ bin/patest_record \ bin/patest_ringmix \ bin/patest_saw \ @@ -64,7 +84,6 @@ TESTS = \ bin/patest_sine_time \ bin/patest_start_stop \ bin/patest_stop \ - bin/patest_sync \ bin/patest_toomanysines \ bin/patest_underflow \ bin/patest_wire \ @@ -76,6 +95,8 @@ TESTS = \ # Most of these don't compile yet. Put them in TESTS, above, if # you want to try to compile them... ALL_TESTS = \ + $(TESTS) \ + bin/patest_sync \ bin/debug_convert \ bin/debug_dither_calc \ bin/debug_dual \ @@ -87,65 +108,34 @@ ALL_TESTS = \ bin/debug_sine \ bin/debug_sine_formats \ bin/debug_srate \ - bin/debug_test1 \ - bin/pa_devs \ - bin/pa_fuzz \ - bin/pa_minlat \ - bin/paqa_devs \ - bin/paqa_errs \ - bin/patest1 \ - bin/patest_buffer \ - bin/patest_clip \ - bin/patest_dither \ - bin/patest_hang \ - bin/patest_in_overflow \ - bin/patest_latency \ - bin/patest_leftright \ - bin/patest_longsine \ - bin/patest_many \ - bin/patest_maxsines \ - bin/patest_multi_sine \ - bin/patest_out_underflow \ - bin/patest_pink \ - bin/patest_read_record \ - bin/patest_record \ - bin/patest_ringmix \ - bin/patest_saw \ - bin/patest_sine8 \ - bin/patest_sine \ - bin/patest_sine_formats \ - bin/patest_sine_time \ - bin/patest_start_stop \ - bin/patest_stop \ - bin/patest_sync \ - bin/patest_toomanysines \ - bin/patest_underflow \ - bin/patest_wire \ - bin/patest_write_sine + bin/debug_test1 OBJS = $(COMMON_OBJS) $(OTHER_OBJS) -all: lib/$(PALIB) lib/$(PADLLV) tests +LTOBJS:= $(OBJS:.o=.lo) -tests: bin/ $(TESTS) +SUBDIRS = +@ENABLE_CXX_TRUE@SUBDIRS += bindings/cpp -lib/$(PALIB): lib/ $(OBJS) Makefile $(PAINC) - $(AR) ruv lib/$(PALIB) $(OBJS) - $(RANLIB) lib/$(PALIB) +all: lib/$(PALIB) all-recursive tests -lib/$(PADLLV): lib/ $(OBJS) Makefile $(PAINC) - $(CC) $(SHARED_FLAGS) -o lib/$(PADLLV) $(OBJS) $(DLL_LIBS) +tests: bin-stamp $(TESTS) -$(TESTS): bin/%: lib/$(PALIB) Makefile $(PAINC) pa_tests/%.c - $(CC) -o $@ $(CFLAGS) pa_tests/$*.c lib/$(PALIB) $(LIBS) -install: lib/$(PALIB) lib/$(PADLLV) - $(INSTALL) -d $(PREFIX)/lib - $(INSTALL) -m 644 lib/$(PADLLV) $(PREFIX)/lib/$(PADLLV) - $(INSTALL) -m 644 lib/$(PALIB) $(PREFIX)/lib/$(PALIB) - cd $(PREFIX)/lib && rm -f $(PADLL) && ln -s $(PADLLV) $(PADLL) - $(INSTALL) -d $(PREFIX)/include - $(INSTALL) -m 644 pa_common/portaudio.h $(PREFIX)/include/portaudio.h +lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC) + $(LIBTOOL) --mode=link $(CC) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS) + +$(ALL_TESTS): bin/%: lib/$(PALIB) $(MAKEFILE) $(PAINC) test/%.c + $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS) + + +install: lib/$(PALIB) portaudio-2.0.pc + $(INSTALL) -d $(DESTDIR)$(libdir) + $(LIBTOOL) --mode=install $(INSTALL) lib/$(PALIB) $(DESTDIR)$(libdir) + $(INSTALL) -d $(DESTDIR)$(includedir) + $(INSTALL_DATA) -m 644 $(top_srcdir)/$(PAINC) $(DESTDIR)$(includedir)/portaudio.h + $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig + $(INSTALL) -m 644 portaudio-2.0.pc $(DESTDIR)$(libdir)/pkgconfig/portaudio-2.0.pc @echo "" @echo "------------------------------------------------------------" @echo "PortAudio was successfully installed." @@ -153,33 +143,55 @@ install: lib/$(PALIB) lib/$(PADLLV) @echo "On some systems (e.g. Linux) you should run 'ldconfig' now" @echo "to make the shared object available. You may also need to" @echo "modify your LD_LIBRARY_PATH environment variable to include" - @echo "the directory $(PREFIX)/lib" + @echo "the directory $(libdir)" @echo "------------------------------------------------------------" @echo "" + $(MAKE) install-recursive uninstall: - rm -f $(PREFIX)/lib/$(PADLLV) - rm -f $(PREFIX)/lib/$(PALIB) - rm -f $(PREFIX)/lib/$(PADLL) - rm -f $(PREFIX)/include/portaudio.h + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(PALIB) + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(includedir)/portaudio.h + $(MAKE) uninstall-recursive clean: - rm -f $(OBJS) $(TESTS) lib/$(PALIB) lib/$(PADLLV) + $(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(ALL_TESTS) lib/$(PALIB) + rm -f bin-stamp lib-stamp + -rm -rf bin lib -%.o: %.c Makefile $(PAINC) +distclean: clean + rm -f config.log config.status Makefile libtool portaudio-2.0.pc + +%.o: %.c $(MAKEFILE) $(PAINC) $(CC) -c $(CFLAGS) $< -o $@ -%.o: %.cpp Makefile $(PAINC) +%.lo: %.c $(MAKEFILE) $(PAINC) + $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $< -o $@ + +%.o: %.cpp $(MAKEFILE) $(PAINC) $(CXX) -c $(CXXFLAGS) $< -o $@ %.o: %.asm $(NASM) $(NASMOPT) -o $@ $< -bin: - mkdir bin +bin-stamp: + -mkdir bin + touch $@ -lib: - mkdir lib +lib-stamp: + -mkdir lib + -mkdir -p src/os/win src/os/unix src/os/mac_osx src/common \ +src/hostapi/oss src/hostapi/alsa src/hostapi/jack src/hostapi/asihpi \ +src/hostapi/wmme src/hostapi/wdmks src/hostapi/dsound src/hostapi/wasapi + touch $@ +Makefile: Makefile.in config.status + $(SHELL) config.status +all-recursive: + for dir in $(SUBDIRS); do make -C $$dir all; done +install-recursive: + for dir in $(SUBDIRS); do make -C $$dir install; done + +uninstall-recursive: + for dir in $(SUBDIRS); do make -C $$dir uninstall; done diff --git a/portaudio-v19/README.txt b/portaudio-v19/README.txt index 4cfc6166e..e37b07b31 100644 --- a/portaudio-v19/README.txt +++ b/portaudio-v19/README.txt @@ -46,7 +46,7 @@ Documentation: For information on compiling programs with PortAudio, please see the tutorial at: - http://www.portaudio.com/docs/pa_tutorial.html + http://portaudio.com/trac/wiki/TutorialDir/TutorialStart Important Files and Folders: pa_common/ = platform independant code diff --git a/portaudio-v19/SConstruct b/portaudio-v19/SConstruct index 07e219a8b..b6d5f56f2 100644 --- a/portaudio-v19/SConstruct +++ b/portaudio-v19/SConstruct @@ -1,78 +1,147 @@ import sys, os.path -class ConfigurationError(Exception): - def __init__(self, reason): - Exception.__init__(self, "Configuration failed: %s" % reason) +def rsplit(toSplit, sub, max=-1): + """ str.rsplit seems to have been introduced in 2.4 :( """ + l = [] + i = 0 + while i != max: + try: idx = toSplit.rindex(sub) + except ValueError: break -def _PackageOption(pkgName, default="yes"): - return BoolOption("use%s" % pkgName[0].upper() + pkgName[1:], "use %s if available" % (pkgName), default) + toSplit, splitOff = toSplit[:idx], toSplit[idx + len(sub):] + l.insert(0, splitOff) + i += 1 -def _BoolOption(opt, explanation, default="yes"): - return BoolOption("enable%s" % opt[0].upper() + opt[1:], explanation, default) + l.insert(0, toSplit) + return l -def _DirectoryOption(path, help, default): - return PathOption(path, help, default) - # Incompatible with the latest stable SCons - # return PathOption(path, help, default, PathOption.PathIsDir) +sconsDir = os.path.join("build", "scons") +SConscript(os.path.join(sconsDir, "SConscript_common")) +Import("Platform", "Posix", "ApiVer") -def _EnumOption(opt, explanation, allowedValues, default): - assert default in allowedValues - return EnumOption("with%s" % opt[0].upper() + opt[1:], explanation, default, allowed_values=allowedValues) +# SConscript_opts exports PortAudio options +optsDict = SConscript(os.path.join(sconsDir, "SConscript_opts")) +optionsCache = os.path.join(sconsDir, "options.cache") # Save options between runs in this cache +options = Options(optionsCache, args=ARGUMENTS) +for k in ("Installation Dirs", "Build Targets", "Host APIs", "Build Parameters", "Bindings"): + options.AddOptions(*optsDict[k]) +# Propagate options into environment +env = Environment(options=options) +# Save options for next run +options.Save(optionsCache, env) +# Generate help text for options +env.Help(options.GenerateHelpText(env)) -def getPlatform(): - global __platform - try: return __platform - except NameError: - env = Environment() - if env["PLATFORM"] == "posix": - if sys.platform[:5] == "linux": - __platform = "linux" - else: - raise ConfigurationError("Unknown platform %s" % sys.platform) - else: - if not env["PLATFORM"] in ("win32", "cygwin") + Posix: - raise ConfigurationError("Unknown platform %s" % env["PLATFORM"]) - __platform = env["PLATFORM"] +buildDir = os.path.join("#", sconsDir, env["PLATFORM"]) - return __platform - -# sunos, aix, hpux, irix, sunos appear to be platforms known by SCons, assuming they're POSIX compliant -Posix = ("linux", "darwin", "sunos", "aix", "hpux", "irix", "sunos") -Windows = ("win32", "cygwin") -env = Environment(CPPPATH="pa_common") - -Platform = getPlatform() - -opts = Options("options.cache", args=ARGUMENTS) +# Determine parameters to build tools if Platform in Posix: - opts.AddOptions( - _DirectoryOption("prefix", "installation prefix", "/usr/local"), - _PackageOption("ALSA"), - _PackageOption("OSS"), - _PackageOption("JACK"), - ) -elif Platform in Windows: - if Platform == "cygwin": - opts.AddOptions(_DirectoryOption("prefix", "installation prefix", "/usr/local")) - opts.AddOptions(_EnumOption("winAPI", "Windows API to use", ("wmme", "directx", "asio"), "wmme")) + baseLinkFlags = threadCFlags = "-pthread" + baseCxxFlags = baseCFlags = "-Wall -pedantic -pipe " + threadCFlags + debugCxxFlags = debugCFlags = "-g" + optCxxFlags = optCFlags = "-O2" +env["CCFLAGS"] = baseCFlags.split() +env["CXXFLAGS"] = baseCxxFlags.split() +env["LINKFLAGS"] = baseLinkFlags.split() +if env["enableDebug"]: + env.AppendUnique(CCFLAGS=debugCFlags.split()) + env.AppendUnique(CXXFLAGS=debugCxxFlags.split()) +if env["enableOptimize"]: + env.AppendUnique(CCFLAGS=optCFlags.split()) + env.AppendUnique(CXXFLAGS=optCxxFlags.split()) +if not env["enableAsserts"]: + env.AppendUnique(CPPDEFINES=["-DNDEBUG"]) +if env["customCFlags"]: + env.Append(CCFLAGS=env["customCFlags"]) +if env["customCxxFlags"]: + env.Append(CXXFLAGS=env["customCxxFlags"]) +if env["customLinkFlags"]: + env.Append(LINKFLAGS=env["customLinkFlags"]) -if Platform == "darwin": - opts.AddOptions(_EnumOption("macAPI", "Mac API to use", ("asio", "core", "sm"), "core")) +env.Append(CPPPATH=[os.path.join("#", "include"), "common"]) -opts.AddOptions( - _BoolOption("shared", "create shared library"), - _BoolOption("static", "create static library"), - _BoolOption("debug", "compile with debug symbols"), - _BoolOption("optimize", "compile with optimization", default="no"), - _BoolOption("asserts", "runtime assertions are helpful for debugging, but can be detrimental to performance", default="yes"), - _BoolOption("debugOutput", "enable debug output", default="no"), - ("customCFlags", "customize compilation of C code", ""), - ) - -opts.Update(env) -opts.Save("options.cache", env) - -Help(opts.GenerateHelpText(env)) +# Store all signatures in one file, otherwise .sconsign files will get installed along with our own files +env.SConsignFile(os.path.join(sconsDir, ".sconsign")) env.SConscriptChdir(False) -SConscript("SConscript", build_dir=".build_scons", exports=["env", "Platform", "Posix", "ConfigurationError"], duplicate=False) +sources, sharedLib, staticLib, tests, portEnv = env.SConscript(os.path.join("src", "SConscript"), + build_dir=buildDir, duplicate=False, exports=["env"]) + +if Platform in Posix: + prefix = env["prefix"] + includeDir = os.path.join(prefix, "include") + libDir = os.path.join(prefix, "lib") + env.Alias("install", includeDir) + env.Alias("install", libDir) + + # pkg-config + + def installPkgconfig(env, target, source): + tgt = str(target[0]) + src = str(source[0]) + f = open(src) + try: txt = f.read() + finally: f.close() + txt = txt.replace("@prefix@", prefix) + txt = txt.replace("@exec_prefix@", prefix) + txt = txt.replace("@libdir@", libDir) + txt = txt.replace("@includedir@", includeDir) + txt = txt.replace("@LIBS@", " ".join(["-l%s" % l for l in portEnv["LIBS"]])) + txt = txt.replace("@THREAD_CFLAGS@", threadCFlags) + + f = open(tgt, "w") + try: f.write(txt) + finally: f.close() + + pkgconfigTgt = "portaudio-%d.0.pc" % int(ApiVer.split(".", 1)[0]) + env.Command(os.path.join(libDir, "pkgconfig", pkgconfigTgt), + os.path.join("#", pkgconfigTgt + ".in"), installPkgconfig) + +# Default to None, since if the user disables all targets and no Default is set, all targets +# are built by default +env.Default(None) +if env["enableTests"]: + env.Default(tests) +if env["enableShared"]: + env.Default(sharedLib) + + if Platform in Posix: + def symlink(env, target, source): + trgt = str(target[0]) + src = str(source[0]) + + if os.path.islink(trgt) or os.path.exists(trgt): + os.remove(trgt) + os.symlink(os.path.basename(src), trgt) + + major, minor, micro = [int(c) for c in ApiVer.split(".")] + + soFile = "%s.%s" % (os.path.basename(str(sharedLib[0])), ApiVer) + env.InstallAs(target=os.path.join(libDir, soFile), source=sharedLib) + # Install symlinks + symTrgt = os.path.join(libDir, soFile) + env.Command(os.path.join(libDir, "libportaudio.so.%d.%d" % (major, minor)), + symTrgt, symlink) + symTrgt = rsplit(symTrgt, ".", 1)[0] + env.Command(os.path.join(libDir, "libportaudio.so.%d" % major), symTrgt, symlink) + symTrgt = rsplit(symTrgt, ".", 1)[0] + env.Command(os.path.join(libDir, "libportaudio.so"), symTrgt, symlink) + +if env["enableStatic"]: + env.Default(staticLib) + env.Install(libDir, staticLib) + +env.Install(includeDir, os.path.join("include", "portaudio.h")) + +if env["enableCxx"]: + env.SConscriptChdir(True) + cxxEnv = env.Copy() + sharedLibs, staticLibs, headers = env.SConscript(os.path.join("bindings", "cpp", "SConscript"), + exports={"env": cxxEnv, "buildDir": buildDir}, build_dir=os.path.join(buildDir, "portaudiocpp"), duplicate=False) + if env["enableStatic"]: + env.Default(staticLibs) + env.Install(libDir, staticLibs) + if env["enableShared"]: + env.Default(sharedLibs) + env.Install(libDir, sharedLibs) + env.Install(os.path.join(includeDir, "portaudiocpp"), headers) diff --git a/portaudio-v19/aclocal.m4 b/portaudio-v19/aclocal.m4 index c80e0acfc..9e5b4fd03 100644 --- a/portaudio-v19/aclocal.m4 +++ b/portaudio-v19/aclocal.m4 @@ -1,57 +1,6627 @@ +# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- -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 +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) +# 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. + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 48 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' +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 - 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) +# 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'] - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - 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 +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' - 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 +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# 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 "$LTCFLAGS" && LTCFLAGS=$CFLAGS +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="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# 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 - 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 +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 + +# Check if we have a version mismatch between libtool.m4 and ltmain.sh. +# +# Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined. +# We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually +# calls AC_LIBTOOL_CONFIG and creates libtool. +# +_LT_VERSION_CHECK + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_VERSION_CHECK +# ----------------- +AC_DEFUN([_LT_VERSION_CHECK], +[AC_MSG_CHECKING([for correct ltmain.sh version]) +if test "x$ltmain" = "x" ; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ + +*** @<:@Gentoo@:>@ sanity check failed! *** +*** \$ltmain is not defined, please check the patch for consistency! *** +]) +fi +gentoo_lt_version="1.5.22" +gentoo_ltmain_version=`sed -n '/^[[ ]]*VERSION=/{s/^[[ ]]*VERSION=//;p;q;}' "$ltmain"` +if test "x$gentoo_lt_version" != "x$gentoo_ltmain_version" ; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ + +*** @<:@Gentoo@:>@ sanity check failed! *** +*** libtool.m4 and ltmain.sh have a version mismatch! *** +*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) *** + +Please run: + + libtoolize --copy --force + +if appropriate, please contact the maintainer of this +package (or your distribution) for help. +]) +else + AC_MSG_RESULT(yes) +fi +])# _LT_VERSION_CHECK + + +# _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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _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 </dev/null 2>&1 && unset CDPATH + +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*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + 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 linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm 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 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # 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. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + 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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + 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_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# 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 + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + 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" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; 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 DLLs +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 <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +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 variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1
    &1
    /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +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*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | 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_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + 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 +# AC_CONFIG_SUBDIRS is not called here. 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 +# AC_CONFIG_SUBDIRS is not called here. 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 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([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# 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 + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +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 + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +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([_LT_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_shlibpath_var, $1)=unsupported +_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=cpp + +# 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 + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_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_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_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' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + 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)=unsupported + _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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + 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_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _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)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP '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 $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + 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 $libobjs $deplibs $compiler_flags -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 -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + 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 | dragonfly*) + # 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | 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 + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _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*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $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 + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _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' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_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::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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' + _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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_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~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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' + _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 + ;; + 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(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_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~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_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. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_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" + +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_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 < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$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 , 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 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +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 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'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + 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'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# 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='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + 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 < $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 < 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 <> 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)= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + 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 | dragonfly*) + # 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)='${wl}-a ${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)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_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* | ecpc*) + # 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' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_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*) + ;; + 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 + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _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' + ;; + esac + ;; + 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' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + 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_basename 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' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + 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' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + 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*) + _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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _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' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + 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 + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# 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 '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[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= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + 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}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_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 + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + 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 <&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 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 says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${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)=unsupported + _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 '\''/^[[BCDGRS]] /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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_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 "$lt_prog_compiler_static"; 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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_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_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_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' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _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 + ;; + + bsdi[[45]]*) + _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)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `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' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + 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_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _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)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _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 $libobjs $deplibs $compiler_flags -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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + 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 | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _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 $libobjs $deplibs $compiler_flags~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*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_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 + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _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 $libobjs $deplibs $compiler_flags ${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 $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _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 $libobjs $deplibs $compiler_flags' + _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 $libobjs $deplibs $compiler_flags $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} $libobjs $deplibs $compiler_flags ${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} $libobjs $deplibs $compiler_flags ${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 ${output_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)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_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~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _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]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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 $libobjs $deplibs $compiler_flags' + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + +# +# 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) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $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 +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #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 +# 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 && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# 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. +# +# 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. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [$4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + diff --git a/portaudio-v19/config.doxy b/portaudio-v19/config.doxy index f6509a32d..1c3e33aa0 100644 --- a/portaudio-v19/config.doxy +++ b/portaudio-v19/config.doxy @@ -1,60 +1,93 @@ -# Doxyfile 1.2.13-20020210 +# Doxyfile 1.4.6 #--------------------------------------------------------------------------- -# General configuration options +# Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = PortAudio PROJECT_NUMBER = 2.0 -OUTPUT_DIRECTORY = "./docs/" +OUTPUT_DIRECTORY = ./doc/ +CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO +USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = -INTERNAL_DOCS = NO -STRIP_CODE_COMMENTS = YES -CASE_SENSE_NAMES = YES +STRIP_FROM_INC_PATH = SHORT_NAMES = NO -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = YES -SHOW_INCLUDE_FILES = YES JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +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_MEMBER_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES -ALIASES = +GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = ./pa_common ./pa_win_wmme ./pa_asio ./pa_win_ds ./pa_linux_alsa ./pa_unix_oss ./pa_jack ./pa_tests -FILE_PATTERNS = *.h *.c *.cpp +INPUT = src \ + include \ + test +FILE_PATTERNS = *.h \ + *.c \ + *.cpp RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO @@ -64,14 +97,18 @@ EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = +FILTER_PATTERNS = 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 +USE_HTAGS = NO +VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -82,13 +119,15 @@ IGNORE_PREFIX = # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES -HTML_OUTPUT = doxygen_html +HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO @@ -110,6 +149,7 @@ LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -130,11 +170,22 @@ MAN_LINKS = NO # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # 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 @@ -147,7 +198,7 @@ PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to external references +# Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = @@ -162,24 +213,25 @@ HIDE_UNDOC_RELATIONS = NO HAVE_DOT = NO CLASS_GRAPH = YES COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine +# Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO -CGI_NAME = search.cgi -CGI_URL = -DOC_URL = -DOC_ABSPATH = -BIN_ABSPATH = /usr/local/bin/ -EXT_DOC_PATHS = diff --git a/portaudio-v19/config.guess b/portaudio-v19/config.guess index 0e30d56e9..cc726cd15 100755 --- a/portaudio-v19/config.guess +++ b/portaudio-v19/config.guess @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-07-02' +timestamp='2003-02-22' # 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 @@ -106,7 +106,6 @@ 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" ; @@ -283,9 +282,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -324,9 +320,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; @@ -751,7 +744,7 @@ EOF *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; - *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) + *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -763,10 +756,7 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/FreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -777,8 +767,8 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + x86:Interix*:3*) + echo i586-pc-interix3 exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks @@ -807,9 +797,6 @@ EOF arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -888,9 +875,6 @@ EOF s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -1049,7 +1033,7 @@ EOF exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1205,9 +1189,6 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/portaudio-v19/config.sub b/portaudio-v19/config.sub index 9d7f73390..9772e87d2 100755 --- a/portaudio-v19/config.sub +++ b/portaudio-v19/config.sub @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-07-04' +timestamp='2003-02-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -118,7 +118,7 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -229,7 +229,7 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ + | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ @@ -261,7 +261,7 @@ case $basic_machine in | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | tahoe | thumb | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ @@ -292,7 +292,7 @@ case $basic_machine in | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ @@ -373,9 +373,6 @@ case $basic_machine in basic_machine=a29k-none os=-bsd ;; - amd64) - basic_machine=x86_64-pc - ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -771,24 +768,18 @@ case $basic_machine in pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; - pentiumii | pentium2 | pentiumiii | pentium3) + pentiumii | pentium2) 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-*) + pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; pn) basic_machine=pn-gould ;; @@ -847,10 +838,6 @@ case $basic_machine in sb1el) basic_machine=mipsisa64sb1el-unknown ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; sequent) basic_machine=i386-sequent ;; @@ -858,9 +845,6 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; - sh64) - basic_machine=sh64-unknown - ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks @@ -935,6 +919,10 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; + tic4x | c4x*) + basic_machine=tic4x-unknown + os=-coff + ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff @@ -1128,7 +1116,7 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ @@ -1140,7 +1128,7 @@ case $os in | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + | -powermax* | -dnix*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1286,9 +1274,6 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 diff --git a/portaudio-v19/configure b/portaudio-v19/configure index 017015446..ad355c8d2 100755 --- a/portaudio-v19/configure +++ b/portaudio-v19/configure @@ -1,42 +1,480 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.59. # +# Copyright (C) 2003 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. ## +## --------------------- ## -# Defaults: -ac_help= +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + 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=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # 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 before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, 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 + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# 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'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + + +# 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 </dev/null 2>&1 && unset CDPATH + +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 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --with-alsa (default=yes)" -ac_help="$ac_help - --with-jack (default=yes)" -ac_help="$ac_help - --with-oss (default=yes)" -ac_help="$ac_help - --with-host_os (no default)" -ac_help="$ac_help - --with-winapi ((wmme/directx/asio) default=wmme)" -ac_help="$ac_help - --with-macapi ((asio/core/sm) default=core)" -ac_help="$ac_help - --with-asiodir (default=/usr/local/asiosdk2)" -ac_help="$ac_help - --with-dxdir (default=/usr/local/dx7sdk)" +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="include/portaudio.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subdirs_all="$ac_subdirs_all bindings/cpp" +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PKG_CONFIG ac_pt_PKG_CONFIG JACK_CFLAGS JACK_LIBS LT_CURRENT LT_REVISION LT_AGE OTHER_OBJS PADLL SHARED_FLAGS THREAD_CFLAGS DLL_LIBS NASM NASMOPT subdirs ENABLE_CXX_TRUE ENABLE_CXX_FALSE LIBOBJS LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -45,10 +483,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -62,17 +505,9 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -80,59 +515,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + 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" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -141,95 +576,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -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 ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + 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" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -238,19 +625,19 @@ EOF -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -264,26 +651,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + 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_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_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -300,7 +687,7 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -310,7 +697,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -321,58 +708,57 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + 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" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -383,115 +769,641 @@ EOF 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_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" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { 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 && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +# 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 + 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 -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=pa_common/portaudio.h # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + 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 + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then +if test ! -r "$srcdir/$ac_unique_file"; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_env_PKG_CONFIG_value=$PKG_CONFIG +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG +ac_env_JACK_CFLAGS_set=${JACK_CFLAGS+set} +ac_env_JACK_CFLAGS_value=$JACK_CFLAGS +ac_cv_env_JACK_CFLAGS_set=${JACK_CFLAGS+set} +ac_cv_env_JACK_CFLAGS_value=$JACK_CFLAGS +ac_env_JACK_LIBS_set=${JACK_LIBS+set} +ac_env_JACK_LIBS_value=$JACK_LIBS +ac_cv_env_JACK_LIBS_set=${JACK_LIBS+set} +ac_cv_env_JACK_LIBS_value=$JACK_LIBS +# +# 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 \`..'] + +_ACEOF + + cat <<_ACEOF +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] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --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] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-debug-output + --enable-cxx (default=no) + --enable-shared[=PKGS] + build shared libraries [default=yes] + --enable-static[=PKGS] + build static libraries [default=yes] + --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-alsa (default=yes) + --with-jack (default=yes) + --with-oss (default=yes) + --with-host_os (no default) + --with-winapi ((wmme/directx/asio) default=wmme) + --with-macapi ((asio/core/sm) default=core) + --with-asiodir (default=/usr/local/asiosdk2) + --with-dxdir (default=/usr/local/dx7sdk) + --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 if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + PKG_CONFIG path to pkg-config utility + JACK_CFLAGS C compiler flags for JACK, overriding pkg-config + JACK_LIBS linker flags for JACK, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style 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 + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright (C) 2003 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 0 +fi +exec 5>config.log +cat >&5 <<_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.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +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` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&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_sep= +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=`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_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + 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: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +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, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf 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 -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >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 explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then @@ -502,39 +1414,104 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +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 - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +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 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`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 + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +ac_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_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi @@ -545,7 +1522,7 @@ if test "${with_alsa+set}" = set; then with_alsa=$withval else with_alsa="yes" -fi +fi; # Check whether --with-jack or --without-jack was given. @@ -554,7 +1531,7 @@ if test "${with_jack+set}" = set; then with_jack=$withval else with_jack="yes" -fi +fi; # Check whether --with-oss or --without-oss was given. @@ -563,14 +1540,14 @@ if test "${with_oss+set}" = set; then with_oss=$withval else with_oss="yes" -fi +fi; # Check whether --with-host_os or --without-host_os was given. if test "${with_host_os+set}" = set; then withval="$with_host_os" host_os=$withval -fi +fi; # Check whether --with-winapi or --without-winapi was given. @@ -579,7 +1556,7 @@ if test "${with_winapi+set}" = set; then with_winapi=$withval else with_winapi="wmme" -fi +fi; # Check whether --with-macapi or --without-macapi was given. @@ -588,7 +1565,7 @@ if test "${with_macapi+set}" = set; then with_macapi=$withval else with_macapi="core" -fi +fi; # Check whether --with-asiodir or --without-asiodir was given. @@ -597,7 +1574,7 @@ if test "${with_asiodir+set}" = set; then with_asiodir=$withval else with_asiodir="/usr/local/asiosdk2" -fi +fi; # Check whether --with-dxdir or --without-dxdir was given. @@ -606,219 +1583,683 @@ if test "${with_dxdir+set}" = set; then with_dxdir=$withval else with_dxdir="/usr/local/dx7sdk" -fi +fi; - +# Check whether --enable-debug-output or --disable-debug-output was given. +if test "${enable_debug_output+set}" = set; then + enableval="$enable_debug_output" + if test x$enableval != xno ; then + +cat >>confdefs.h <<\_ACEOF +#define PA_ENABLE_DEBUG_OUTPUT +_ACEOF + + fi + +fi; + +# Check whether --enable-cxx or --disable-cxx was given. +if test "${enable_cxx+set}" = set; then + enableval="$enable_cxx" + enable_cxx=$enableval +else + enable_cxx="no" +fi; -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:618: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" 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 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:648: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +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 $as_executable_p "$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" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + 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 $# -gt 0; then + 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 - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:699: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - ;; - esac + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:731: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + test -n "$ac_ct_CC" && break +done -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross + CC=$ac_ct_CC +fi -cat > conftest.$ac_ext << EOF +fi -#line 742 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +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. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version
    &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + 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.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. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +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 +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&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' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no else - ac_cv_prog_cc_cross=yes + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { 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 +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 -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:773: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:778: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + 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 | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done else - cat > conftest.c <&5 +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 +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +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 +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes else - GCC= + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:806: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -832,36 +2273,343 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=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 +#include +#include +#include +/* 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; +} -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:840: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +/* 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 -std1 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 -std1. */ +int osf4_cc_array ['\x00' == 0 ? 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 +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break else - echo "$ac_t""no" 1>&6 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext 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 + + + +# Check whether --enable-shared or --disable-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=yes +fi; + +# Check whether --enable-static or --disable-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-fast-install or --disable-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; ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do @@ -873,14 +2621,15749 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + + +# Check whether --with-gnu-ld or --without-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. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$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' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + ;; + +bsdi[45]*) + 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*) + # func_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='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +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*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check whether --enable-libtool-lock or --disable-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=$? + 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 3187 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + 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=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*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" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + 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 +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$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 + ;; +sparc*-*solaris*) + # 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=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-cygwin* | *-*-mingw* | *-*-pw32*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_DLLTOOL" && ac_cv_prog_ac_ct_DLLTOOL="false" +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +echo "${ECHO_T}$ac_ct_DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DLLTOOL=$ac_ct_DLLTOOL +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AS" && ac_cv_prog_ac_ct_AS="false" +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +echo "${ECHO_T}$ac_ct_AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AS=$ac_ct_AS +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_OBJDUMP" && ac_cv_prog_ac_ct_OBJDUMP="false" +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +echo "${ECHO_T}$ac_ct_OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + OBJDUMP=$ac_ct_OBJDUMP +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; + +esac + +need_locks="$enable_libtool_lock" + + +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 +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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 + echo $ECHO_N "(cached) $ECHO_C" >&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 to if __STDC__ is defined, since + # 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 +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + 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 non-existent 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 +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$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 to if __STDC__ is defined, since + # 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 +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + 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 non-existent 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 +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +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 + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f 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 + +_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 + +_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 +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +ac_ext=cc +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 -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$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 +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=cc +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 -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +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 +echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 to if __STDC__ is defined, since + # 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 +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + 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 non-existent 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 +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$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 to if __STDC__ is defined, since + # 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 +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + 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 non-existent 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 +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +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_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 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:4919:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + 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 +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$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 + +G77=`test $ac_compiler_gnu = yes && echo yes` +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 +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # 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. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 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'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + 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'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# 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='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + 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 <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + 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=$? + 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 < 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 <> 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=$? + 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 + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$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 1s/^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 MSVC, +# 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +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 "$LTCFLAGS" && LTCFLAGS=$CFLAGS +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="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# 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 + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +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 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +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 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=yes + +# Check whether --enable-libtool-lock or --disable-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 or --without-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 + +# Check if we have a version mismatch between libtool.m4 and ltmain.sh. +# +# Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined. +# We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually +# calls AC_LIBTOOL_CONFIG and creates libtool. +# +echo "$as_me:$LINENO: checking for correct ltmain.sh version" >&5 +echo $ECHO_N "checking for correct ltmain.sh version... $ECHO_C" >&6 +if test "x$ltmain" = "x" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: + +*** [Gentoo] sanity check failed! *** +*** \$ltmain is not defined, please check the patch for consistency! *** +" >&5 +echo "$as_me: error: + +*** [Gentoo] sanity check failed! *** +*** \$ltmain is not defined, please check the patch for consistency! *** +" >&2;} + { (exit 1); exit 1; }; } +fi +gentoo_lt_version="1.5.22" +gentoo_ltmain_version=`sed -n '/^[ ]*VERSION=/{s/^[ ]*VERSION=//;p;q;}' "$ltmain"` +if test "x$gentoo_lt_version" != "x$gentoo_ltmain_version" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: + +*** [Gentoo] sanity check failed! *** +*** libtool.m4 and ltmain.sh have a version mismatch! *** +*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) *** + +Please run: + + libtoolize --copy --force + +if appropriate, please contact the maintainer of this +package (or your distribution) for help. +" >&5 +echo "$as_me: error: + +*** [Gentoo] sanity check failed! *** +*** libtool.m4 and ltmain.sh have a version mismatch! *** +*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) *** + +Please run: + + libtoolize --copy --force + +if appropriate, please contact the maintainer of this +package (or your distribution) for help. +" >&2;} + { (exit 1); exit 1; }; } +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +fi + + +# 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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6043: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6047: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$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= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&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' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + 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_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + 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' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6311: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6315: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$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 + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6415: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:6419: \$? = $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 + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$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 + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + 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}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + 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 + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&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 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 says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${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=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + 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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + 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 "$lt_prog_compiler_static"; 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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + ;; + + bsdi[45]*) + 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=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `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*) + 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 + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + 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 | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~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*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + 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 + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + 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 $libobjs $deplibs $compiler_flags ${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 $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + 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 $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags $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} $libobjs $deplibs $compiler_flags ${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} $libobjs $deplibs $compiler_flags ${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 ${output_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=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + 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].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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 $libobjs $deplibs $compiler_flags' + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +# +# 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$? + 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 + pic_flag=$lt_prog_compiler_pic + 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=$? + 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* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$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= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}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" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = 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 + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 declares shl_load. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +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 +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +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 +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = 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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$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 library types will actually be built +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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" + { echo "$as_me:$LINENO: creating $ofile" >&5 +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 , 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 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +CC="$lt_save_CC" + + +# Check whether --with-tags or --without-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 + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +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 + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + 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 + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +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 + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +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" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +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_shlibpath_var_CXX=unsupported +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=cpp + +# 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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# 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 or --without-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. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + 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=unsupported + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + 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 + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP '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 $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + 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 $libobjs $deplibs $compiler_flags -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 -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + 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 + ;; + freebsd[12]*) + # 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 | dragonfly*) + # 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | 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 + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + 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*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $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 + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + 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' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + 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::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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_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 + ;; + 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++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + 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} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$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. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + 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 +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + 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) + # 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 + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +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= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&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= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + 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 | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${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='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_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* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_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*) + ;; + 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 + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:11237: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:11241: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$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 + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:11341: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:11345: \$? = $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 + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$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 + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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 '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$? + 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 + pic_flag=$lt_prog_compiler_pic_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=$? + 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* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$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 + + +# 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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&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' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + 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_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + 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' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12948: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:12952: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$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 + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13052: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:13056: \$? = $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 + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$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 + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + 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}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + 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 + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&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 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 says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${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=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + 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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${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" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + 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 "$lt_prog_compiler_static"; 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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + ;; + + bsdi[45]*) + 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=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `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_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + 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 + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + 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 | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~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*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + 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 + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + 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 $libobjs $deplibs $compiler_flags ${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 $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + 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 $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags $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} $libobjs $deplibs $compiler_flags ${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} $libobjs $deplibs $compiler_flags ${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 ${output_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=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + 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].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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 $libobjs $deplibs $compiler_flags' + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$? + 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 + pic_flag=$lt_prog_compiler_pic_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=$? + 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* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$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 + + +# 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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15292: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15296: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$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= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&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' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + 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_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + 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' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15560: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15564: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$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 + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15664: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:15668: \$? = $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 + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$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 + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + 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}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + 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 + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&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 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 says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${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=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + 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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${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" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + 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 "$lt_prog_compiler_static"; 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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + ;; + + bsdi[45]*) + 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=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `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_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + 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 + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + 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 | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~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*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + 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 + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + 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 $libobjs $deplibs $compiler_flags ${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 $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + 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 $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags $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} $libobjs $deplibs $compiler_flags ${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} $libobjs $deplibs $compiler_flags ${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 ${output_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=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + 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].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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 $libobjs $deplibs $compiler_flags' + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$? + 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 + pic_flag=$lt_prog_compiler_pic_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=$? + 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* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$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 + + +# 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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +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" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +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' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -889,160 +18372,311 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # 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. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:898: checking for a BSD compatible install" >&5 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then + 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 $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + 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 - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$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_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:953: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$AR" in - /*) + case $AR in + [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_AR="$AR" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_AR="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_AR" && ac_cv_path_AR="no" ;; esac fi -AR="$ac_cv_path_AR" +AR=$ac_cv_path_AR + if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if [ $AR = "no" ] ; then - { echo "configure: error: "Could not find ar - needed to create a library"" 1>&2; exit 1; }; + { { echo "$as_me:$LINENO: error: \"Could not find ar - needed to create a library\"" >&5 +echo "$as_me: error: \"Could not find ar - needed to create a library\"" >&2;} + { (exit 1); exit 1; }; }; fi -echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:991: checking whether byte ordering is bigendian" >&5 -if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -int main() { +int +main () +{ #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif -; return 0; } -EOF -if { (eval echo configure:1009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -int main() { +int +main () +{ #if BYTE_ORDER != BIG_ENDIAN not big endian #endif -; return 0; } -EOF -if { (eval echo configure:1024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_bigendian=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -if test $ac_cv_c_bigendian = unknown; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi else - cat > conftest.$ac_ext <&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +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 () +{ /* Are we little or big endian? From Harbison&Steele. */ union { @@ -1052,308 +18686,1723 @@ main () { u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } -EOF -if { (eval echo configure:1057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_bigendian=yes -fi -rm -fr conftest* -fi + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) -echo "$ac_t""$ac_cv_c_bigendian" 1>&6 -if test $ac_cv_c_bigendian = yes; then - cat >> confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 -EOF - -fi +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac -echo $ac_n "checking for snd_pcm_open in -lasound""... $ac_c" 1>&6 -echo "configure:1083: checking for snd_pcm_open in -lasound" >&5 -ac_lib_var=`echo asound'_'snd_pcm_open | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for snd_pcm_open in -lasound" >&5 +echo $ECHO_N "checking for snd_pcm_open in -lasound... $ECHO_C" >&6 +if test "${ac_cv_lib_asound_snd_pcm_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lasound $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char snd_pcm_open(); - -int main() { -snd_pcm_open() -; return 0; } -EOF -if { (eval echo configure:1102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char snd_pcm_open (); +int +main () +{ +snd_pcm_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_asound_snd_pcm_open=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_asound_snd_pcm_open=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_pcm_open" >&5 +echo "${ECHO_T}$ac_cv_lib_asound_snd_pcm_open" >&6 +if test $ac_cv_lib_asound_snd_pcm_open = yes; then have_alsa=yes else - echo "$ac_t""no" 1>&6 -have_alsa=no + have_alsa=no fi -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1131: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - - succeeded=no - - if test -z "$PKG_CONFIG"; then - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1159: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$PKG_CONFIG" in - /*) + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + ;; esac fi -PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - echo "$ac_t""$PKG_CONFIG" 1>&6 + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done +done - 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 - echo $ac_n "checking for jack""... $ac_c" 1>&6 -echo "configure:1203: checking for jack" >&5 + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG - if $PKG_CONFIG --exists "jack" ; then - echo "$ac_t""yes" 1>&6 - succeeded=yes +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi - echo $ac_n "checking JACK_CFLAGS""... $ac_c" 1>&6 -echo "configure:1210: checking JACK_CFLAGS" >&5 - JACK_CFLAGS=`$PKG_CONFIG --cflags "jack"` - echo "$ac_t""$JACK_CFLAGS" 1>&6 + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi - echo $ac_n "checking JACK_LIBS""... $ac_c" 1>&6 -echo "configure:1215: checking JACK_LIBS" >&5 - JACK_LIBS=`$PKG_CONFIG --libs "jack"` - echo "$ac_t""$JACK_LIBS" 1>&6 +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +echo "$as_me:$LINENO: checking for JACK" >&5 +echo $ECHO_N "checking for JACK... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$JACK_CFLAGS"; then + pkg_cv_JACK_CFLAGS="$JACK_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"jack\"") >&5 + ($PKG_CONFIG --exists --print-errors "jack") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_JACK_CFLAGS=`$PKG_CONFIG --cflags "jack" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$JACK_LIBS"; then + pkg_cv_JACK_LIBS="$JACK_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"jack\"") >&5 + ($PKG_CONFIG --exists --print-errors "jack") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_JACK_LIBS=`$PKG_CONFIG --libs "jack" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + JACK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "jack"` else - JACK_CFLAGS="" - JACK_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - JACK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "jack"` - + JACK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "jack"` fi + # Put the nasty error message in config.log where it belongs + echo "$JACK_PKG_ERRORS" >&5 - - - 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 - have_jack=yes - else - have_jack=no - fi + have_jack=no +elif test $pkg_failed = untried; then + have_jack=no +else + JACK_CFLAGS=$pkg_cv_JACK_CFLAGS + JACK_LIBS=$pkg_cv_JACK_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + have_jack=yes +fi +echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6 +if test "${ac_cv_type_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +int +main () +{ +if ((short *) 0) + return 0; +if (sizeof (short)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_short=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:1244: checking size of short" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +ac_cv_type_short=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6 + +echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6 +if test "${ac_cv_sizeof_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_short" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_short=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac else if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (short)); } +unsigned long ulongval () { return (long) (sizeof (short)); } #include -main() +#include +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(short)); - exit(0); + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (short))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; } -EOF -if { (eval echo configure:1263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_short=`cat conftestval` +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_short=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* ac_cv_sizeof_short=0 fi -rm -fr conftest* fi - -fi -echo "$ac_t""$ac_cv_sizeof_short" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6 +cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short -EOF +_ACEOF -echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1283: checking size of int" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6 +if test "${ac_cv_type_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +int +main () +{ +if ((int *) 0) + return 0; +if (sizeof (int)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6 + +echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac else if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (int)); } +unsigned long ulongval () { return (long) (sizeof (int)); } #include -main() +#include +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(int)); - exit(0); + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; } -EOF -if { (eval echo configure:1302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_int=`cat conftestval` +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* ac_cv_sizeof_int=0 fi -rm -fr conftest* fi - -fi -echo "$ac_t""$ac_cv_sizeof_int" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int -EOF +_ACEOF -echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1322: checking size of long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 +if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +int +main () +{ +if ((long *) 0) + return 0; +if (sizeof (long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 + +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac else if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } #include -main() +#include +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(long)); - exit(0); + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; } -EOF -if { (eval echo configure:1341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_long=`cat conftestval` +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* ac_cv_sizeof_long=0 fi -rm -fr conftest* fi - -fi -echo "$ac_t""$ac_cv_sizeof_long" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long -EOF +_ACEOF + + + +save_LIBS="${LIBS}" +echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5 +echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6 +if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char clock_gettime (); +int +main () +{ +clock_gettime (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_rt_clock_gettime=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_rt_clock_gettime=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_gettime" >&5 +echo "${ECHO_T}$ac_cv_lib_rt_clock_gettime" >&6 +if test $ac_cv_lib_rt_clock_gettime = yes; then + rt_libs=" -lrt" +fi + +LIBS="${LIBS}${rt_libs}" +DLL_LIBS="${DLL_LIBS}${rt_libs}" + + +for ac_func in clock_gettime nanosleep +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +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 +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +LIBS="${save_LIBS}" + +LT_CURRENT=2 +LT_REVISION=0 +LT_AGE=0 @@ -1365,7 +20414,10 @@ EOF -CFLAGS="-g -O2 -Wall -pedantic -pipe -fPIC" + + + +CFLAGS=${CFLAGS:-"-g -O2 -Wall -pedantic -pipe -fPIC"} if [ $ac_cv_c_bigendian = "yes" ] ; then CFLAGS="$CFLAGS -DPA_BIG_ENDIAN" @@ -1375,15 +20427,15 @@ fi case "${host_os}" in darwin* ) - - cat >> confdefs.h <<\EOF -#define PA_USE_COREAUDIO 1 -EOF - OTHER_OBJS="pa_mac/pa_mac_hostapis.o pa_unix/pa_unix_util.o pa_mac_core/pa_mac_core.o"; + cat >>confdefs.h <<\_ACEOF +#define PA_USE_COREAUDIO 1 +_ACEOF + + OTHER_OBJS="src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o"; LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"; PADLL="libportaudio.dylib"; - SHARED_FLAGS="-framework CoreAudio -framework AudioToolbox -dynamiclib -framework AudioUnit -framework Carbon"; + SHARED_FLAGS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib"; if [ $with_macapi = "asio" ] ; then if [ $with_asiodir ] ; then ASIODIR="$with_asiodir"; @@ -1393,13 +20445,13 @@ EOF echo "ASIODIR: $ASIODIR"; OTHER_OBJS="$CFLAGS pa_asio/iasiothiscallresolver.o $ASIODIR/host/asiodrivers.o $ASIODIR/common/asio.o $ASIODIR/host/mac/asioshlib.o"; - CFLAGS="$CFLAGS -Ipa_asio -I$ASIDIR/host/mac -I$ASIODIR/common"; + CFLAGS="$CFLAGS -I\$(top_srcdir)/pa_asio -I$ASIDIR/host/mac -I$ASIODIR/common"; CXXFLAGS="$CFLAGS"; fi ;; mingw* ) - + echo "WINAPI: $with_winapi" if [ $with_winapi = "directx" ] ; then if [ $with_dxdir ] ; then @@ -1408,14 +20460,15 @@ EOF DXDIR="/usr/local/dx7sdk"; fi echo "DXDIR: $DXDIR" - OTHER_OBJS="pa_win_ds/pa_win_ds.o pa_win_ds/dsound_wrapper.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + OTHER_OBJS="src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/dsound_wrapper.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o"; LIBS="-lwinmm -lm -ldsound -lole32"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -ldsound -lole32"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L./dx7sdk/lib -ldsound -lole32"; #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""; #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"; - CFLAGS="$CFLAGS -Ipa_common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO" -DPA_NO_WDMKS; + CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO" -DPA_NO_WDMKS; elif [ $with_winapi = "asio" ] ; then if [ $with_asiodir ] ; then ASIODIR="$with_asiodir"; @@ -1424,12 +20477,13 @@ EOF fi echo "ASIODIR: $ASIODIR" - OTHER_OBJS="pa_asio/pa_asio.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o pa_asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o"; + OTHER_OBJS="pa_asio/pa_asio.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o pa_asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o"; LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; - CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -Ipa_common -Ipa_asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lstdc++ -lole32 -luuid"; + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/common -I\$(top_srcdir)/pa_asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS"; CXXFLAGS="$CFLAGS"; elif [ $with_winapi = "wdmks" ] ; then if [ $with_dxdir ] ; then @@ -1438,553 +20492,1552 @@ EOF DXDIR="/usr/local/dx7sdk"; fi echo "DXDIR: $DXDIR" - OTHER_OBJS="pa_win_wdmks/pa_win_wdmks.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + OTHER_OBJS="src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o"; LIBS="-lwinmm -lm -luuid -lsetupapi -lole32"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -luuid -lsetupapi -lole32"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L./dx7sdk/lib -luuid -lsetupapi -lole32"; #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""; #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"; - CFLAGS="$CFLAGS -Ipa_common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO"; + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO"; else # WMME default - OTHER_OBJS="pa_win_wmme/pa_win_wmme.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o"; LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm"; - CFLAGS="$CFLAGS -Ipa_common -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm"; + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS"; fi ;; cygwin* ) - - OTHER_OBJS="pa_win_wmme/pa_win_wmme.o"; + + OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o"; LIBS="-lwinmm -lm"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm"; ;; irix* ) - echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:1471: checking for pthread_create in -lpthread" >&5 -ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_create(); - -int main() { -pthread_create() -; return 0; } -EOF -if { (eval echo configure:1490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char pthread_create (); +int +main () +{ +pthread_create (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_pthread_create=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_pthread_pthread_create=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6 +if test $ac_cv_lib_pthread_pthread_create = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF LIBS="-lpthread $LIBS" else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: IRIX posix thread library not found!" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: IRIX posix thread library not found!" >&5 +echo "$as_me: error: IRIX posix thread library not found!" >&2;} + { (exit 1); exit 1; }; } fi - echo $ac_n "checking for alOpenPort in -laudio""... $ac_c" 1>&6 -echo "configure:1519: checking for alOpenPort in -laudio" >&5 -ac_lib_var=`echo audio'_'alOpenPort | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +echo "$as_me:$LINENO: checking for alOpenPort in -laudio" >&5 +echo $ECHO_N "checking for alOpenPort in -laudio... $ECHO_C" >&6 +if test "${ac_cv_lib_audio_alOpenPort+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-laudio $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char alOpenPort(); - -int main() { -alOpenPort() -; return 0; } -EOF -if { (eval echo configure:1538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char alOpenPort (); +int +main () +{ +alOpenPort (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_audio_alOpenPort=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_audio_alOpenPort=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo audio | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_lib_audio_alOpenPort" >&6 +if test $ac_cv_lib_audio_alOpenPort = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAUDIO 1 +_ACEOF LIBS="-laudio $LIBS" else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: IRIX audio library not found!" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: IRIX audio library not found!" >&5 +echo "$as_me: error: IRIX audio library not found!" >&2;} + { (exit 1); exit 1; }; } fi - echo $ac_n "checking for dmGetUST in -ldmedia""... $ac_c" 1>&6 -echo "configure:1567: checking for dmGetUST in -ldmedia" >&5 -ac_lib_var=`echo dmedia'_'dmGetUST | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +echo "$as_me:$LINENO: checking for dmGetUST in -ldmedia" >&5 +echo $ECHO_N "checking for dmGetUST in -ldmedia... $ECHO_C" >&6 +if test "${ac_cv_lib_dmedia_dmGetUST+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-ldmedia $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dmGetUST(); - -int main() { -dmGetUST() -; return 0; } -EOF -if { (eval echo configure:1586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char dmGetUST (); +int +main () +{ +dmGetUST (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dmedia_dmGetUST=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_dmedia_dmGetUST=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo dmedia | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_lib_dmedia_dmGetUST" >&6 +if test $ac_cv_lib_dmedia_dmGetUST = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDMEDIA 1 +_ACEOF LIBS="-ldmedia $LIBS" else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: IRIX digital media library not found!" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: IRIX digital media library not found!" >&5 +echo "$as_me: error: IRIX digital media library not found!" >&2;} + { (exit 1); exit 1; }; } fi - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\_ACEOF #define PA_USE_SGI 1 -EOF +_ACEOF - CFLAGS="$CFLAGS -D_REENTRANT" - - OTHER_OBJS="pa_sgi/pa_sgi.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o"; - + THREAD_CFLAGS="-D_REENTRANT" + + OTHER_OBJS="pa_sgi/pa_sgi.o src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o"; + LIBS="-lm -ldmedia -laudio -lpthread"; PADLL="libportaudio.so"; - SHARED_FLAGS="-shared"; + SHARED_FLAGS=""; ;; *) - - echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:1632: checking for pthread_create in -lpthread" >&5 -ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_create(); - -int main() { -pthread_create() -; return 0; } -EOF -if { (eval echo configure:1651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char pthread_create (); +int +main () +{ +pthread_create (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_pthread_create=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_pthread_pthread_create=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6 +if test $ac_cv_lib_pthread_pthread_create = yes; then + have_pthread="yes" else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: libpthread not found!" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: libpthread not found!" >&5 +echo "$as_me: error: libpthread not found!" >&2;} + { (exit 1); exit 1; }; } fi if [ $have_alsa = "yes" ] && [ $with_alsa != "no" ] ; then - LIBS="$LIBS -lasound" DLL_LIBS="$DLL_LIBS -lasound" - OTHER_OBJS="$OTHER_OBJS pa_linux_alsa/pa_linux_alsa.o" - cat >> confdefs.h <<\EOF + OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o" + cat >>confdefs.h <<\_ACEOF #define PA_USE_ALSA 1 -EOF +_ACEOF fi if [ $have_jack = "yes" ] && [ $with_jack != "no" ] ; then - LIBS="$LIBS $JACK_LIBS" DLL_LIBS="$DLL_LIBS $JACK_LIBS" CFLAGS="$CFLAGS $JACK_CFLAGS" - OTHER_OBJS="$OTHER_OBJS pa_jack/pa_jack.o" - cat >> confdefs.h <<\EOF + OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o" + cat >>confdefs.h <<\_ACEOF #define PA_USE_JACK 1 -EOF +_ACEOF fi if [ $with_oss != "no" ] ; then - OTHER_OBJS="$OTHER_OBJS pa_unix_oss/pa_unix_oss.o" - cat >> confdefs.h <<\EOF + OTHER_OBJS="$OTHER_OBJS src/hostapi/oss/pa_unix_oss.o" + cat >>confdefs.h <<\_ACEOF #define PA_USE_OSS 1 -EOF +_ACEOF fi + THREAD_CFLAGS="-pthread" + DLL_LIBS="$DLL_LIBS -lm -lpthread"; LIBS="$LIBS -lm -lpthread"; PADLL="libportaudio.so"; SHARED_FLAGS="-shared -fPIC"; - OTHER_OBJS="$OTHER_OBJS pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o" + OTHER_OBJS="$OTHER_OBJS src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o" esac +CFLAGS="$CFLAGS $THREAD_CFLAGS" -trap '' 1 2 15 -cat > confcache <<\EOF +if test "$enable_cxx" = "yes"; then + + +subdirs="$subdirs bindings/cpp" + + ENABLE_CXX_TRUE="" + ENABLE_CXX_FALE="#" +else + ENABLE_CXX_TRUE="#" + ENABLE_CXX_FALE="" +fi + + + + ac_config_files="$ac_config_files Makefile portaudio-2.0.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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# 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. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `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, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. +# 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[ ]*=[^:]*$/d' + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' fi -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +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_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + -# Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. # Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# # Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# configure, is in config.log if it exists. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@CC@%$CC%g -s%@RANLIB@%$RANLIB%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@AR@%$AR%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@PKG_CONFIG@%$PKG_CONFIG%g -s%@JACK_CFLAGS@%$JACK_CFLAGS%g -s%@JACK_LIBS@%$JACK_LIBS%g -s%@OTHER_OBJS@%$OTHER_OBJS%g -s%@PADLL@%$PADLL%g -s%@SHARED_FLAGS@%$SHARED_FLAGS%g -s%@DLL_LIBS@%$DLL_LIBS%g -s%@NASM@%$NASM%g -s%@NASMOPT@%$NASMOPT%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi -EOF +DUALCASE=1; export DUALCASE # for MKS sh -cat >> $CONFIG_STATUS </dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + 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=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + # 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 before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, 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 + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + # 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' else - ac_dir_suffix= ac_dots= + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# 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'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet 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 + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + 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 +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "portaudio-2.0.pc" ) CONFIG_FILES="$CONFIG_FILES portaudio-2.0.pc" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +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 +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $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 -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@EGREP@,$EGREP,;t t +s,@LN_S@,$LN_S,;t t +s,@ECHO@,$ECHO,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@DLLTOOL@,$DLLTOOL,;t t +s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t +s,@AS@,$AS,;t t +s,@ac_ct_AS@,$ac_ct_AS,;t t +s,@OBJDUMP@,$OBJDUMP,;t t +s,@ac_ct_OBJDUMP@,$ac_ct_OBJDUMP,;t t +s,@CPP@,$CPP,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@CXXCPP@,$CXXCPP,;t t +s,@F77@,$F77,;t t +s,@FFLAGS@,$FFLAGS,;t t +s,@ac_ct_F77@,$ac_ct_F77,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@JACK_CFLAGS@,$JACK_CFLAGS,;t t +s,@JACK_LIBS@,$JACK_LIBS,;t t +s,@LT_CURRENT@,$LT_CURRENT,;t t +s,@LT_REVISION@,$LT_REVISION,;t t +s,@LT_AGE@,$LT_AGE,;t t +s,@OTHER_OBJS@,$OTHER_OBJS,;t t +s,@PADLL@,$PADLL,;t t +s,@SHARED_FLAGS@,$SHARED_FLAGS,;t t +s,@THREAD_CFLAGS@,$THREAD_CFLAGS,;t t +s,@DLL_LIBS@,$DLL_LIBS,;t t +s,@NASM@,$NASM,;t t +s,@NASMOPT@,$NASMOPT,;t t +s,@subdirs@,$subdirs,;t t +s,@ENABLE_CXX_TRUE@,$ENABLE_CXX_TRUE,;t t +s,@ENABLE_CXX_FALSE@,$ENABLE_CXX_FALSE,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out fi - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac +done +_ACEOF - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac +cat >>$CONFIG_STATUS <<\_ACEOF - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF - -exit 0 -EOF +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# 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 + +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ + | --c=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d $srcdir/$ac_dir || continue + + { echo "$as_me:$LINENO: configuring in $ac_dir" >&5 +echo "$as_me: configuring in $ac_dir" >&6;} + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + cd $ac_dir + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'" + elif test -f $ac_srcdir/configure; then + ac_sub_configure="$SHELL '$ac_srcdir/configure'" + elif test -f $ac_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 +echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file=$ac_top_builddir$cache_file ;; + esac + + { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval $ac_sub_configure $ac_sub_configure_args \ + --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir || + { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 +echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} + { (exit 1); exit 1; }; } + fi + + cd $ac_popdir + done +fi diff --git a/portaudio-v19/configure.in b/portaudio-v19/configure.in index 640f87800..6ac29ee3d 100644 --- a/portaudio-v19/configure.in +++ b/portaudio-v19/configure.in @@ -9,7 +9,7 @@ AC_PREREQ(2.13) dnl Init autoconf and make sure configure is being called dnl from the right directory -AC_INIT([pa_common/portaudio.h]) +AC_INIT([include/portaudio.h]) dnl Specify options @@ -25,6 +25,10 @@ AC_ARG_WITH(oss, [ --with-oss (default=yes)], with_oss=$withval, with_oss="yes") +AC_ARG_WITH(asihpi, + [ --with-asihpi (default=auto)], + with_asihpi=$withval, with_asihpi="yes") + AC_ARG_WITH(host_os, [ --with-host_os (no default)], host_os=$withval) @@ -45,13 +49,25 @@ AC_ARG_WITH(asiodir, AC_ARG_WITH(dxdir, [ --with-dxdir (default=/usr/local/dx7sdk)], with_dxdir=$withval, with_dxdir="/usr/local/dx7sdk") - + +AC_ARG_ENABLE(debug-output, + [ --enable-debug-output], + [if test x$enableval != xno ; then + AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages]) + fi + ]) + +AC_ARG_ENABLE(cxx, + [ --enable-cxx (default=no)], + enable_cxx=$enableval, enable_cxx="no") dnl Checks for programs. AC_PROG_CC -AC_PROG_RANLIB +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL AC_PROG_INSTALL +AC_PROG_LN_S AC_PATH_PROG(AR, ar, no) if [[ $AR = "no" ]] ; then AC_MSG_ERROR("Could not find ar - needed to create a library"); @@ -64,12 +80,13 @@ dnl checks for various host APIs and arguments to configure that dnl turn them on or off AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) +AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm) dnl Determine the host description for the subsequent test. dnl PKG_CHECK_MODULES seems to check and set the host variable also, but dnl that then requires pkg-config availability which is not standard on dnl MinGW systems and can be a pain to install. -AC_CANONICAL_HOST +dnl AC_CANONICAL_HOST PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) @@ -79,16 +96,34 @@ AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) +save_LIBS="${LIBS}" +AC_CHECK_LIB(rt, clock_gettime, [rt_libs=" -lrt"]) +LIBS="${LIBS}${rt_libs}" +DLL_LIBS="${DLL_LIBS}${rt_libs}" +AC_CHECK_FUNCS([clock_gettime nanosleep]) +LIBS="${save_LIBS}" + +dnl LT_RELEASE=19 +LT_CURRENT=2 +LT_REVISION=0 +LT_AGE=0 + +dnl AC_SUBST(LT_RELEASE) +AC_SUBST(LT_CURRENT) +AC_SUBST(LT_REVISION) +AC_SUBST(LT_AGE) + dnl extra variables AC_SUBST(OTHER_OBJS) AC_SUBST(PADLL) AC_SUBST(SHARED_FLAGS) +AC_SUBST(THREAD_CFLAGS) AC_SUBST(DLL_LIBS) AC_SUBST(CXXFLAGS) AC_SUBST(NASM) AC_SUBST(NASMOPT) -CFLAGS="-g -O2 -Wall -pedantic -pipe -fPIC" +CFLAGS=${CFLAGS:-"-g -O2 -Wall -pedantic -pipe -fPIC"} if [[ $ac_cv_c_bigendian = "yes" ]] ; then CFLAGS="$CFLAGS -DPA_BIG_ENDIAN" @@ -101,10 +136,10 @@ case "${host_os}" in dnl Mac OS X configuration AC_DEFINE(PA_USE_COREAUDIO) - OTHER_OBJS="pa_mac/pa_mac_hostapis.o pa_unix/pa_unix_util.o pa_mac_core/pa_mac_core.o"; + OTHER_OBJS="src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o"; LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"; PADLL="libportaudio.dylib"; - SHARED_FLAGS="-framework CoreAudio -framework AudioToolbox -framework -framework AudioUnit -framework Carbon -dynamiclib"; + SHARED_FLAGS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib"; if [[ $with_macapi = "asio" ]] ; then if [[ $with_asiodir ]] ; then ASIODIR="$with_asiodir"; @@ -114,7 +149,7 @@ case "${host_os}" in echo "ASIODIR: $ASIODIR"; OTHER_OBJS="$CFLAGS pa_asio/iasiothiscallresolver.o $ASIODIR/host/asiodrivers.o $ASIODIR/common/asio.o $ASIODIR/host/mac/asioshlib.o"; - CFLAGS="$CFLAGS -Ipa_asio -I$ASIDIR/host/mac -I$ASIODIR/common"; + CFLAGS="$CFLAGS -I\$(top_srcdir)/pa_asio -I$ASIDIR/host/mac -I$ASIODIR/common"; CXXFLAGS="$CFLAGS"; fi ;; @@ -130,14 +165,15 @@ case "${host_os}" in DXDIR="/usr/local/dx7sdk"; fi echo "DXDIR: $DXDIR" - OTHER_OBJS="pa_win_ds/pa_win_ds.o pa_win_ds/dsound_wrapper.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + OTHER_OBJS="src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/dsound_wrapper.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o"; LIBS="-lwinmm -lm -ldsound -lole32"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -ldsound -lole32"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L./dx7sdk/lib -ldsound -lole32"; #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""; #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"; - CFLAGS="$CFLAGS -Ipa_common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO" -DPA_NO_WDMKS; + CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO" -DPA_NO_WDMKS; elif [[ $with_winapi = "asio" ]] ; then if [[ $with_asiodir ]] ; then ASIODIR="$with_asiodir"; @@ -146,12 +182,13 @@ case "${host_os}" in fi echo "ASIODIR: $ASIODIR" - OTHER_OBJS="pa_asio/pa_asio.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o pa_asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o"; + OTHER_OBJS="pa_asio/pa_asio.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o pa_asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o"; LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; - CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -Ipa_common -Ipa_asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lstdc++ -lole32 -luuid"; + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/common -I\$(top_srcdir)/pa_asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS"; CXXFLAGS="$CFLAGS"; elif [[ $with_winapi = "wdmks" ]] ; then if [[ $with_dxdir ]] ; then @@ -160,32 +197,35 @@ case "${host_os}" in DXDIR="/usr/local/dx7sdk"; fi echo "DXDIR: $DXDIR" - OTHER_OBJS="pa_win_wdmks/pa_win_wdmks.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + OTHER_OBJS="src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o"; LIBS="-lwinmm -lm -luuid -lsetupapi -lole32"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -luuid -lsetupapi -lole32"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L./dx7sdk/lib -luuid -lsetupapi -lole32"; #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""; #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"; - CFLAGS="$CFLAGS -Ipa_common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO"; + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO"; else # WMME default - OTHER_OBJS="pa_win_wmme/pa_win_wmme.o pa_win/pa_win_hostapis.o pa_win/pa_win_util.o"; + OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o"; LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm"; - CFLAGS="$CFLAGS -Ipa_common -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm"; + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS"; fi ;; cygwin* ) dnl Cygwin configuration - OTHER_OBJS="pa_win_wmme/pa_win_wmme.o"; + OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o"; LIBS="-lwinmm -lm"; PADLL="portaudio.dll"; - SHARED_FLAGS="-shared -mthreads"; - DLL_LIBS="-lwinmm"; + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared"; + DLL_LIBS="${DLL_LIBS} -lwinmm"; ;; irix* ) @@ -203,48 +243,68 @@ case "${host_os}" in dnl The _REENTRANT option for pthread safety. Perhaps not necessary but it 'll do no harm. dnl - CFLAGS="$CFLAGS -D_REENTRANT" + THREAD_CFLAGS="-D_REENTRANT" - OTHER_OBJS="pa_sgi/pa_sgi.o pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o"; + OTHER_OBJS="pa_sgi/pa_sgi.o src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o"; dnl SGI books say -lpthread should be the last of the libs mentioned. dnl LIBS="-lm -ldmedia -laudio -lpthread"; PADLL="libportaudio.so"; - SHARED_FLAGS="-shared"; + SHARED_FLAGS=""; ;; *) dnl Unix configuration - AC_CHECK_LIB(pthread, pthread_create, + AC_CHECK_LIB(pthread, pthread_create,[have_pthread="yes"] , AC_MSG_ERROR([libpthread not found!])) if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then - LIBS="$LIBS -lasound" DLL_LIBS="$DLL_LIBS -lasound" - OTHER_OBJS="$OTHER_OBJS pa_linux_alsa/pa_linux_alsa.o" + OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o" AC_DEFINE(PA_USE_ALSA) fi if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then - LIBS="$LIBS $JACK_LIBS" DLL_LIBS="$DLL_LIBS $JACK_LIBS" CFLAGS="$CFLAGS $JACK_CFLAGS" - OTHER_OBJS="$OTHER_OBJS pa_jack/pa_jack.o" + OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o" AC_DEFINE(PA_USE_JACK) fi if [[ $with_oss != "no" ]] ; then - OTHER_OBJS="$OTHER_OBJS pa_unix_oss/pa_unix_oss.o" + OTHER_OBJS="$OTHER_OBJS src/hostapi/oss/pa_unix_oss.o" AC_DEFINE(PA_USE_OSS) fi + + if [[ $have_asihpi = "yes" ] && [ $with_asihpi != "no" ]] ; then + LIBS="$LIBS -lhpi" + DLL_LIBS="$DLL_LIBS -lhpi" + OTHER_OBJS="$OTHER_OBJS src/hostapi/asihpi/pa_linux_asihpi.o" + AC_DEFINE(PA_USE_ASIHPI) + fi + + THREAD_CFLAGS="-pthread" + DLL_LIBS="$DLL_LIBS -lm -lpthread"; LIBS="$LIBS -lm -lpthread"; PADLL="libportaudio.so"; SHARED_FLAGS="-shared -fPIC"; - OTHER_OBJS="$OTHER_OBJS pa_unix/pa_unix_hostapis.o pa_unix/pa_unix_util.o" + OTHER_OBJS="$OTHER_OBJS src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o" esac +CFLAGS="$CFLAGS $THREAD_CFLAGS" -AC_OUTPUT([Makefile]) +if test "$enable_cxx" = "yes"; then + AC_CONFIG_SUBDIRS([bindings/cpp]) + ENABLE_CXX_TRUE="" + ENABLE_CXX_FALE="#" +else + ENABLE_CXX_TRUE="#" + ENABLE_CXX_FALE="" +fi +AC_SUBST(ENABLE_CXX_TRUE) +AC_SUBST(ENABLE_CXX_FALSE) + +AC_OUTPUT([Makefile portaudio-2.0.pc]) diff --git a/portaudio-v19/include/pa_asio.h b/portaudio-v19/include/pa_asio.h new file mode 100644 index 000000000..573930572 --- /dev/null +++ b/portaudio-v19/include/pa_asio.h @@ -0,0 +1,122 @@ +#ifndef PA_ASIO_H +#define PA_ASIO_H +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * ASIO specific extensions + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +/** @file + @brief ASIO-specific PortAudio API extension header file. +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** Retrieve legal latency settings for the specificed device, in samples. + + @param device The global index of the device about which the query is being made. + @param minLatency A pointer to the location which will recieve the minimum latency value. + @param maxLatency A pointer to the location which will recieve the maximum latency value. + @param preferredLatency A pointer to the location which will recieve the preferred latency value. + @param granularity A pointer to the location which will recieve the granularity. This value + determines which values between minLatency and maxLatency are available. ie the step size, + if granularity is -1 then available latency settings are powers of two. + + @see ASIOGetBufferSize in the ASIO SDK. + + @todo This function should have a better name, any suggestions? +*/ +PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device, + long *minLatency, long *maxLatency, long *preferredLatency, long *granularity ); + + +/** Display the ASIO control panel for the specified device. + + @param device The global index of the device whose control panel is to be displayed. + @param systemSpecific On Windows, the calling application's main window handle, + on Macintosh this value should be zero. +*/ +PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ); + + + + +/** Retrieve a pointer to a string containing the name of the specified + input channel. The string is valid until Pa_Terminate is called. + + The string will be no longer than 32 characters including the null terminator. +*/ +PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ); + + +/** Retrieve a pointer to a string containing the name of the specified + input channel. The string is valid until Pa_Terminate is called. + + The string will be no longer than 32 characters including the null terminator. +*/ +PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ); + + +#define paAsioUseChannelSelectors (0x01) + +typedef struct PaAsioStreamInfo{ + unsigned long size; /**< sizeof(PaAsioStreamInfo) */ + PaHostApiTypeId hostApiType; /**< paASIO */ + unsigned long version; /**< 1 */ + + unsigned long flags; + + /* Support for opening only specific channels of an ASIO device. + If the paAsioUseChannelSelectors flag is set, channelSelectors is a + pointer to an array of integers specifying the device channels to use. + When used, the length of the channelSelectors array must match the + corresponding channelCount parameter to Pa_OpenStream() otherwise a + crash may result. + The values in the selectors array must specify channels within the + range of supported channels for the device or paInvalidChannelCount will + result. + */ + int *channelSelectors; +}PaAsioStreamInfo; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* PA_ASIO_H */ diff --git a/portaudio-v19/include/pa_linux_alsa.h b/portaudio-v19/include/pa_linux_alsa.h new file mode 100644 index 000000000..b9d43c929 --- /dev/null +++ b/portaudio-v19/include/pa_linux_alsa.h @@ -0,0 +1,64 @@ +#ifndef PA_LINUX_ALSA_H +#define PA_LINUX_ALSA_H + +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * ALSA-specific extensions + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +/** @file + * ALSA-specific PortAudio API extension header file. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct PaAlsaStreamInfo +{ + unsigned long size; + PaHostApiTypeId hostApiType; + unsigned long version; + + const char *deviceString; +} +PaAlsaStreamInfo; + +void PaAlsa_InitializeStreamInfo( PaAlsaStreamInfo *info ); + +void PaAlsa_EnableRealtimeScheduling( PaStream *s, int enable ); + +void PaAlsa_EnableWatchdog( PaStream *s, int enable ); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/portaudio-v19/include/pa_mac_core.h b/portaudio-v19/include/pa_mac_core.h new file mode 100644 index 000000000..5e57f61c8 --- /dev/null +++ b/portaudio-v19/include/pa_mac_core.h @@ -0,0 +1,70 @@ +/* + * Mac spcific flags for PA. + * portaudio.h should be included before this file. + */ + +/* + * A pointer to a paMacCoreStreamInfo may be passed as + * the hostApiSpecificStreamInfo in the PaStreamParameters struct + * when opening a stream or querying the format. Use NULL, for the + * defaults. Note that for duplex streams, both infos should be the + * same or behaviour is undefined. + */ +typedef struct paMacCoreStreamInfo +{ + unsigned long size; /**size of whole structure including this header */ + PaHostApiTypeId hostApiType;/**host API for which this data is intended */ + unsigned long version; /**structure version */ + unsigned long flags; /* flags to modify behaviour */ +} paMacCoreStreamInfo; + +/* Use this function to initialize a paMacCoreStreamInfo struct + using the requested flags. */ +void paSetupMacCoreStreamInfo( paMacCoreStreamInfo *data, unsigned long flags ) +{ + bzero( data, sizeof( paMacCoreStreamInfo ) ); + data->size = sizeof( paMacCoreStreamInfo ); + data->hostApiType = paCoreAudio; + data->version = 0x01; + data->flags = flags; +} + +/* + * The following flags alter the behaviour of PA on the mac platform. + * they can be ORed together. These should work both for opening and + * checking a device. + */ +/* Allows PortAudio to change things like the device's frame size, + * which allows for much lower latency, but might disrupt the device + * if other programs are using it, even when you are just Querying + * the device. */ +const unsigned long paMacCore_ChangeDeviceParameters = 0x01; + +/* In combination with the above flag, + * causes the stream opening to fail, unless the exact sample rates + * are supported by the device. */ +const unsigned long paMacCore_FailIfConversionRequired = 0x02; + +/* These flags set the SR conversion quality, if required. The wierd ordering + * allows Maximum Quality to be the default.*/ +const unsigned long paMacCore_ConversionQualityMin = 0x0100; +const unsigned long paMacCore_ConversionQualityMedium = 0x0200; +const unsigned long paMacCore_ConversionQualityLow = 0x0300; +const unsigned long paMacCore_ConversionQualityHigh = 0x0400; +const unsigned long paMacCore_ConversionQualityMax = 0x0000; + +/* + * Here are some "preset" combinations of flags (above) to get to some + * common configurations. THIS IS OVERKILL, but if more flags are added + * it won't be. + */ +/*This is the default setting: do as much sample rate conversion as possible + * and as little mucking with the device as possible. */ +const unsigned long paMacCorePlayNice = 0x00; +/*This setting is tuned for pro audio apps. It allows SR conversion on input + and output, but it tries to set the appropriate SR on the device.*/ +const unsigned long paMacCorePro = 0x01; +/*This is a setting to minimize CPU usage and still play nice.*/ +const unsigned long paMacCoreMinimizeCPUButPlayNice = 0x0100; +/*This is a setting to minimize CPU usage, even if that means interrupting the device. */ +const unsigned long paMacCoreMinimizeCPU = 0x0101; diff --git a/portaudio-v19/include/pa_win_wmme.h b/portaudio-v19/include/pa_win_wmme.h new file mode 100644 index 000000000..458f88f99 --- /dev/null +++ b/portaudio-v19/include/pa_win_wmme.h @@ -0,0 +1,160 @@ +#ifndef PA_WIN_WMME_H +#define PA_WIN_WMME_H +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * MME specific extensions + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +/** @file + @brief WMME-specific PortAudio API extension header file. +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +#define paWinMmeUseLowLevelLatencyParameters (0x01) +#define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */ + + +/* By default, the mme implementation drops the processing thread's priority + to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100% + This flag disables any priority throttling. The processing thread will always + run at THREAD_PRIORITY_TIME_CRITICAL. +*/ +#define paWinMmeDontThrottleOverloadedProcessingThread (0x08) + + +typedef struct PaWinMmeDeviceAndChannelCount{ + PaDeviceIndex device; + int channelCount; +}PaWinMmeDeviceAndChannelCount; + + +typedef struct PaWinMmeStreamInfo{ + unsigned long size; /**< sizeof(PaWinMmeStreamInfo) */ + PaHostApiTypeId hostApiType; /**< paMME */ + unsigned long version; /**< 1 */ + + unsigned long flags; + + /* low-level latency setting support + These settings control the number and size of host buffers in order + to set latency. They will be used instead of the generic parameters + to Pa_OpenStream() if flags contains the PaWinMmeUseLowLevelLatencyParameters + flag. + + If PaWinMmeStreamInfo structures with PaWinMmeUseLowLevelLatencyParameters + are supplied for both input and output in a full duplex stream, then the + input and output framesPerBuffer must be the same, or the larger of the + two must be a multiple of the smaller, otherwise a + paIncompatibleHostApiSpecificStreamInfo error will be returned from + Pa_OpenStream(). + */ + unsigned long framesPerBuffer; + unsigned long bufferCount; /* formerly numBuffers */ + + /* multiple devices per direction support + If flags contains the PaWinMmeUseMultipleDevices flag, + this functionality will be used, otherwise the device parameter to + Pa_OpenStream() will be used instead. + If devices are specified here, the corresponding device parameter + to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpecification, + otherwise an paInvalidDevice error will result. + The total number of channels accross all specified devices + must agree with the corresponding channelCount parameter to + Pa_OpenStream() otherwise a paInvalidChannelCount error will result. + */ + PaWinMmeDeviceAndChannelCount *devices; + unsigned long deviceCount; + +}PaWinMmeStreamInfo; + + +/** Retrieve the number of wave in handles used by a PortAudio WinMME stream. + Returns zero if the stream is output only. + + @return A non-negative value indicating the number of wave in handles + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + @see PaWinMME_GetStreamInputHandle +*/ +int PaWinMME_GetStreamInputHandleCount( PaStream* stream ); + + +/** Retrieve a wave in handle used by a PortAudio WinMME stream. + + @param stream The stream to query. + @param handleIndex The zero based index of the wave in handle to retrieve. This + should be in the range [0, PaWinMME_GetStreamInputHandle(stream)-1]. + + @return A valid wave in handle, or NULL if an error occurred. + + @see PaWinMME_GetStreamInputHandle +*/ +HWAVEIN PaWinMME_GetStreamInputHandle( PaStream* stream, int handleIndex ); + + +/** Retrieve the number of wave out handles used by a PortAudio WinMME stream. + Returns zero if the stream is input only. + + @return A non-negative value indicating the number of wave out handles + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + @see PaWinMME_GetStreamOutputHandle +*/ +int PaWinMME_GetStreamOutputHandleCount( PaStream* stream ); + + +/** Retrieve a wave out handle used by a PortAudio WinMME stream. + + @param stream The stream to query. + @param handleIndex The zero based index of the wave out handle to retrieve. + This should be in the range [0, PaWinMME_GetStreamOutputHandleCount(stream)-1]. + + @return A valid wave out handle, or NULL if an error occurred. + + @see PaWinMME_GetStreamOutputHandleCount +*/ +HWAVEOUT PaWinMME_GetStreamOutputHandle( PaStream* stream, int handleIndex ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* PA_WIN_WMME_H */ diff --git a/portaudio-v19/include/portaudio.h b/portaudio-v19/include/portaudio.h new file mode 100644 index 000000000..77dd960d8 --- /dev/null +++ b/portaudio-v19/include/portaudio.h @@ -0,0 +1,1126 @@ + +#ifndef PORTAUDIO_H +#define PORTAUDIO_H +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * PortAudio API Header File + * Latest version available at: http://www.portaudio.com/ + * + * Copyright (c) 1999-2002 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief The PortAudio API. +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** Retrieve the release number of the currently running PortAudio build, + eg 1900. +*/ +int Pa_GetVersion( void ); + + +/** Retrieve a textual description of the current PortAudio build, + eg "PortAudio V19-devel 13 October 2002". +*/ +const char* Pa_GetVersionText( void ); + + +/** Error codes returned by PortAudio functions. + Note that with the exception of paNoError, all PaErrorCodes are negative. +*/ + +typedef int PaError; +typedef enum PaErrorCode +{ + paNoError = 0, + + paNotInitialized = -10000, + paUnanticipatedHostError, + paInvalidChannelCount, + paInvalidSampleRate, + paInvalidDevice, + paInvalidFlag, + paSampleFormatNotSupported, + paBadIODeviceCombination, + paInsufficientMemory, + paBufferTooBig, + paBufferTooSmall, + paNullCallback, + paBadStreamPtr, + paTimedOut, + paInternalError, + paDeviceUnavailable, + paIncompatibleHostApiSpecificStreamInfo, + paStreamIsStopped, + paStreamIsNotStopped, + paInputOverflowed, + paOutputUnderflowed, + paHostApiNotFound, + paInvalidHostApi, + paCanNotReadFromACallbackStream, /**< @todo review error code name */ + paCanNotWriteToACallbackStream, /**< @todo review error code name */ + paCanNotReadFromAnOutputOnlyStream, /**< @todo review error code name */ + paCanNotWriteToAnInputOnlyStream, /**< @todo review error code name */ + paIncompatibleStreamHostApi, + paBadBufferPtr +} PaErrorCode; + + +/** Translate the supplied PortAudio error code into a human readable + message. +*/ +const char *Pa_GetErrorText( PaError errorCode ); + + +/** Library initialization function - call this before using PortAudio. + This function initialises internal data structures and prepares underlying + host APIs for use. This function MUST be called before using any other + PortAudio API functions. + + If Pa_Initialize() is called multiple times, each successful + call must be matched with a corresponding call to Pa_Terminate(). + Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not + required to be fully nested. + + Note that if Pa_Initialize() returns an error code, Pa_Terminate() should + NOT be called. + + @return paNoError if successful, otherwise an error code indicating the cause + of failure. + + @see Pa_Terminate +*/ +PaError Pa_Initialize( void ); + + +/** Library termination function - call this when finished using PortAudio. + This function deallocates all resources allocated by PortAudio since it was + initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has + been called multiple times, each call must be matched with a corresponding call + to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically + close any PortAudio streams that are still open. + + Pa_Terminate() MUST be called before exiting a program which uses PortAudio. + Failure to do so may result in serious resource leaks, such as audio devices + not being available until the next reboot. + + @return paNoError if successful, otherwise an error code indicating the cause + of failure. + + @see Pa_Initialize +*/ +PaError Pa_Terminate( void ); + + + +/** The type used to refer to audio devices. Values of this type usually + range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice + and paUseHostApiSpecificDeviceSpecification values. + + @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification +*/ +typedef int PaDeviceIndex; + + +/** A special PaDeviceIndex value indicating that no device is available, + or should be used. + + @see PaDeviceIndex +*/ +#define paNoDevice ((PaDeviceIndex)-1) + + +/** A special PaDeviceIndex value indicating that the device(s) to be used + are specified in the host api specific stream info structure. + + @see PaDeviceIndex +*/ +#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2) + + +/* Host API enumeration mechanism */ + +/** The type used to enumerate to host APIs at runtime. Values of this type + range from 0 to (Pa_GetHostApiCount()-1). + + @see Pa_GetHostApiCount +*/ +typedef int PaHostApiIndex; + + +/** Retrieve the number of available host APIs. Even if a host API is + available it may have no devices available. + + @return A non-negative value indicating the number of available host APIs + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + @see PaHostApiIndex +*/ +PaHostApiIndex Pa_GetHostApiCount( void ); + + +/** Retrieve the index of the default host API. The default host API will be + the lowest common denominator host API on the current platform and is + unlikely to provide the best performance. + + @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1) + indicating the default host API index or, a PaErrorCode (which are always + negative) if PortAudio is not initialized or an error is encountered. +*/ +PaHostApiIndex Pa_GetDefaultHostApi( void ); + + +/** Unchanging unique identifiers for each supported host API. This type + is used in the PaHostApiInfo structure. The values are guaranteed to be + unique and to never change, thus allowing code to be written that + conditionally uses host API specific extensions. + + New type ids will be allocated when support for a host API reaches + "public alpha" status, prior to that developers should use the + paInDevelopment type id. + + @see PaHostApiInfo +*/ +typedef enum PaHostApiTypeId +{ + paInDevelopment=0, /* use while developing support for a new host API */ + paDirectSound=1, + paMME=2, + paASIO=3, + paSoundManager=4, + paCoreAudio=5, + paOSS=7, + paALSA=8, + paAL=9, + paBeOS=10, + paWDMKS=11, + paJACK=12, + paWASAPI=13, + paAudioScienceHPI=14 +} PaHostApiTypeId; + + +/** A structure containing information about a particular host API. */ + +typedef struct PaHostApiInfo +{ + /** this is struct version 1 */ + int structVersion; + /** The well known unique identifier of this host API @see PaHostApiTypeId */ + PaHostApiTypeId type; + /** A textual description of the host API for display on user interfaces. */ + const char *name; + + /** The number of devices belonging to this host API. This field may be + used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate + all devices for this host API. + @see Pa_HostApiDeviceIndexToDeviceIndex + */ + int deviceCount; + + /** The default input device for this host API. The value will be a + device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice + if no default input device is available. + */ + PaDeviceIndex defaultInputDevice; + + /** The default output device for this host API. The value will be a + device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice + if no default output device is available. + */ + PaDeviceIndex defaultOutputDevice; + +} PaHostApiInfo; + + +/** Retrieve a pointer to a structure containing information about a specific + host Api. + + @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) + + @return A pointer to an immutable PaHostApiInfo structure describing + a specific host API. If the hostApi parameter is out of range or an error + is encountered, the function returns NULL. + + The returned structure is owned by the PortAudio implementation and must not + be manipulated or freed. The pointer is only guaranteed to be valid between + calls to Pa_Initialize() and Pa_Terminate(). +*/ +const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi ); + + +/** Convert a static host API unique identifier, into a runtime + host API index. + + @param type A unique host API identifier belonging to the PaHostApiTypeId + enumeration. + + @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or, + a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + The paHostApiNotFound error code indicates that the host API specified by the + type parameter is not available. + + @see PaHostApiTypeId +*/ +PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ); + + +/** Convert a host-API-specific device index to standard PortAudio device index. + This function may be used in conjunction with the deviceCount field of + PaHostApiInfo to enumerate all devices for the specified host API. + + @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) + + @param hostApiDeviceIndex A valid per-host device index in the range + 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1) + + @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1) + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + A paInvalidHostApi error code indicates that the host API index specified by + the hostApi parameter is out of range. + + A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter + is out of range. + + @see PaHostApiInfo +*/ +PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, + int hostApiDeviceIndex ); + + + +/** Structure used to return information about a host error condition. +*/ +typedef struct PaHostErrorInfo{ + PaHostApiTypeId hostApiType; /**< the host API which returned the error code */ + long errorCode; /**< the error code returned */ + const char *errorText; /**< a textual description of the error if available, otherwise a zero-length string */ +}PaHostErrorInfo; + + +/** Return information about the last host error encountered. The error + information returned by Pa_GetLastHostErrorInfo() will never be modified + asyncronously by errors occurring in other PortAudio owned threads + (such as the thread that manages the stream callback.) + + This function is provided as a last resort, primarily to enhance debugging + by providing clients with access to all available error information. + + @return A pointer to an immutable structure constaining information about + the host error. The values in this structure will only be valid if a + PortAudio function has previously returned the paUnanticipatedHostError + error code. +*/ +const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ); + + + +/* Device enumeration and capabilities */ + +/** Retrieve the number of available devices. The number of available devices + may be zero. + + @return A non-negative value indicating the number of available devices or, + a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. +*/ +PaDeviceIndex Pa_GetDeviceCount( void ); + + +/** Retrieve the index of the default input device. The result can be + used in the inputDevice parameter to Pa_OpenStream(). + + @return The default input device index for the default host API, or paNoDevice + if no default input device is available or an error was encountered. +*/ +PaDeviceIndex Pa_GetDefaultInputDevice( void ); + + +/** Retrieve the index of the default output device. The result can be + used in the outputDevice parameter to Pa_OpenStream(). + + @return The default output device index for the defualt host API, or paNoDevice + if no default output device is available or an error was encountered. + + @note + On the PC, the user can specify a default device by + setting an environment variable. For example, to use device #1. +
    + set PA_RECOMMENDED_OUTPUT_DEVICE=1
    +
    + The user should first determine the available device ids by using + the supplied application "pa_devs". +*/ +PaDeviceIndex Pa_GetDefaultOutputDevice( void ); + + +/** The type used to represent monotonic time in seconds that can be used + for syncronisation. The type is used for the outTime argument to the + PaStreamCallback and as the result of Pa_GetStreamTime(). + + @see PaStreamCallback, Pa_GetStreamTime +*/ +typedef double PaTime; + + +/** A type used to specify one or more sample formats. Each value indicates + a possible format for sound data passed to and from the stream callback, + Pa_ReadStream and Pa_WriteStream. + + The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 + and aUInt8 are usually implemented by all implementations. + + The floating point representation (paFloat32) uses +1.0 and -1.0 as the + maximum and minimum respectively. + + paUInt8 is an unsigned 8 bit format where 128 is considered "ground" + + The paNonInterleaved flag indicates that a multichannel buffer is passed + as a set of non-interleaved pointers. + + @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo + @see paFloat32, paInt16, paInt32, paInt24, paInt8 + @see paUInt8, paCustomFormat, paNonInterleaved +*/ +typedef unsigned long PaSampleFormat; + + +#define paFloat32 ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */ +#define paInt32 ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */ +#define paInt24 ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */ +#define paInt16 ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */ +#define paInt8 ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */ +#define paUInt8 ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */ +#define paCustomFormat ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */ + +#define paNonInterleaved ((PaSampleFormat) 0x80000000) + +/** A structure providing information and capabilities of PortAudio devices. + Devices may support input, output or both input and output. +*/ +typedef struct PaDeviceInfo +{ + int structVersion; /* this is struct version 2 */ + const char *name; + PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/ + + int maxInputChannels; + int maxOutputChannels; + + /* Default latency values for interactive performance. */ + PaTime defaultLowInputLatency; + PaTime defaultLowOutputLatency; + /* Default latency values for robust non-interactive applications (eg. playing sound files). */ + PaTime defaultHighInputLatency; + PaTime defaultHighOutputLatency; + + double defaultSampleRate; +} PaDeviceInfo; + + +/** Retrieve a pointer to a PaDeviceInfo structure containing information + about the specified device. + @return A pointer to an immutable PaDeviceInfo structure. If the device + parameter is out of range the function returns NULL. + + @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1) + + @note PortAudio manages the memory referenced by the returned pointer, + the client must not manipulate or free the memory. The pointer is only + guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate(). + + @see PaDeviceInfo, PaDeviceIndex +*/ +const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ); + + +/** Parameters for one direction (input or output) of a stream. +*/ +typedef struct PaStreamParameters +{ + /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1) + specifying the device to be used or the special constant + paUseHostApiSpecificDeviceSpecification which indicates that the actual + device(s) to use are specified in hostApiSpecificStreamInfo. + This field must not be set to paNoDevice. + */ + PaDeviceIndex device; + + /** The number of channels of sound to be delivered to the + stream callback or accessed by Pa_ReadStream() or Pa_WriteStream(). + It can range from 1 to the value of maxInputChannels in the + PaDeviceInfo record for the device specified by the device parameter. + */ + int channelCount; + + /** The sample format of the buffer provided to the stream callback, + a_ReadStream() or Pa_WriteStream(). It may be any of the formats described + by the PaSampleFormat enumeration. + */ + PaSampleFormat sampleFormat; + + /** The desired latency in seconds. Where practical, implementations should + configure their latency based on these parameters, otherwise they may + choose the closest viable latency instead. Unless the suggested latency + is greater than the absolute upper limit for the device implementations + should round the suggestedLatency up to the next practial value - ie to + provide an equal or higher latency than suggestedLatency wherever possibe. + Actual latency values for an open stream may be retrieved using the + inputLatency and outputLatency fields of the PaStreamInfo structure + returned by Pa_GetStreamInfo(). + @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo + */ + PaTime suggestedLatency; + + /** An optional pointer to a host api specific data structure + containing additional information for device setup and/or stream processing. + hostApiSpecificStreamInfo is never required for correct operation, + if not used it should be set to NULL. + */ + void *hostApiSpecificStreamInfo; + +} PaStreamParameters; + + +/** Return code for Pa_IsFormatSupported indicating success. */ +#define paFormatIsSupported (0) + +/** Determine whether it would be possible to open a stream with the specified + parameters. + + @param inputParameters A structure that describes the input parameters used to + open a stream. The suggestedLatency field is ignored. See PaStreamParameters + for a description of these parameters. inputParameters must be NULL for + output-only streams. + + @param outputParameters A structure that describes the output parameters used + to open a stream. The suggestedLatency field is ignored. See PaStreamParameters + for a description of these parameters. outputParameters must be NULL for + input-only streams. + + @param sampleRate The required sampleRate. For full-duplex streams it is the + sample rate for both input and output + + @return Returns 0 if the format is supported, and an error code indicating why + the format is not supported otherwise. The constant paFormatIsSupported is + provided to compare with the return value for success. + + @see paFormatIsSupported, PaStreamParameters +*/ +PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); + + + +/* Streaming types and functions */ + + +/** + A single PaStream can provide multiple channels of real-time + streaming audio input and output to a client application. A stream + provides access to audio hardware represented by one or more + PaDevices. Depending on the underlying Host API, it may be possible + to open multiple streams using the same device, however this behavior + is implementation defined. Portable applications should assume that + a PaDevice may be simultaneously used by at most one PaStream. + + Pointers to PaStream objects are passed between PortAudio functions that + operate on streams. + + @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream, + Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive, + Pa_GetStreamTime, Pa_GetStreamCpuLoad + +*/ +typedef void PaStream; + + +/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream() + or Pa_OpenDefaultStream() to indicate that the stream callback will + accept buffers of any size. +*/ +#define paFramesPerBufferUnspecified (0) + + +/** Flags used to control the behavior of a stream. They are passed as + parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be + ORed together. + + @see Pa_OpenStream, Pa_OpenDefaultStream + @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput, + paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags +*/ +typedef unsigned long PaStreamFlags; + +/** @see PaStreamFlags */ +#define paNoFlag ((PaStreamFlags) 0) + +/** Disable default clipping of out of range samples. + @see PaStreamFlags +*/ +#define paClipOff ((PaStreamFlags) 0x00000001) + +/** Disable default dithering. + @see PaStreamFlags +*/ +#define paDitherOff ((PaStreamFlags) 0x00000002) + +/** Flag requests that where possible a full duplex stream will not discard + overflowed input samples without calling the stream callback. This flag is + only valid for full duplex callback streams and only when used in combination + with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using + this flag incorrectly results in a paInvalidFlag error being returned from + Pa_OpenStream and Pa_OpenDefaultStream. + + @see PaStreamFlags, paFramesPerBufferUnspecified +*/ +#define paNeverDropInput ((PaStreamFlags) 0x00000004) + +/** Call the stream callback to fill initial output buffers, rather than the + default behavior of priming the buffers with zeros (silence). This flag has + no effect for input-only and blocking read/write streams. + + @see PaStreamFlags +*/ +#define paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) + +/** A mask specifying the platform specific bits. + @see PaStreamFlags +*/ +#define paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000) + +/** + Timing information for the buffers passed to the stream callback. +*/ +typedef struct PaStreamCallbackTimeInfo{ + PaTime inputBufferAdcTime; + PaTime currentTime; + PaTime outputBufferDacTime; +} PaStreamCallbackTimeInfo; + + +/** + Flag bit constants for the statusFlags to PaStreamCallback. + + @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow, + paPrimingOutput +*/ +typedef unsigned long PaStreamCallbackFlags; + +/** In a stream opened with paFramesPerBufferUnspecified, indicates that + input data is all silence (zeros) because no real data is available. In a + stream opened without paFramesPerBufferUnspecified, it indicates that one or + more zero samples have been inserted into the input buffer to compensate + for an input underflow. + @see PaStreamCallbackFlags +*/ +#define paInputUnderflow ((PaStreamCallbackFlags) 0x00000001) + +/** In a stream opened with paFramesPerBufferUnspecified, indicates that data + prior to the first sample of the input buffer was discarded due to an + overflow, possibly because the stream callback is using too much CPU time. + Otherwise indicates that data prior to one or more samples in the + input buffer was discarded. + @see PaStreamCallbackFlags +*/ +#define paInputOverflow ((PaStreamCallbackFlags) 0x00000002) + +/** Indicates that output data (or a gap) was inserted, possibly because the + stream callback is using too much CPU time. + @see PaStreamCallbackFlags +*/ +#define paOutputUnderflow ((PaStreamCallbackFlags) 0x00000004) + +/** Indicates that output data will be discarded because no room is available. + @see PaStreamCallbackFlags +*/ +#define paOutputOverflow ((PaStreamCallbackFlags) 0x00000008) + +/** Some of all of the output data will be used to prime the stream, input + data may be zero. + @see PaStreamCallbackFlags +*/ +#define paPrimingOutput ((PaStreamCallbackFlags) 0x00000010) + +/** + Allowable return values for the PaStreamCallback. + @see PaStreamCallback +*/ +typedef enum PaStreamCallbackResult +{ + paContinue=0, + paComplete=1, + paAbort=2 +} PaStreamCallbackResult; + + +/** + Functions of type PaStreamCallback are implemented by PortAudio clients. + They consume, process or generate audio in response to requests from an + active PortAudio stream. + + @param input and @param output are arrays of interleaved samples, + the format, packing and number of channels used by the buffers are + determined by parameters to Pa_OpenStream(). + + @param frameCount The number of sample frames to be processed by + the stream callback. + + @param timeInfo The time in seconds when the first sample of the input + buffer was received at the audio input, the time in seconds when the first + sample of the output buffer will begin being played at the audio output, and + the time in seconds when the stream callback was called. + See also Pa_GetStreamTime() + + @param statusFlags Flags indicating whether input and/or output buffers + have been inserted or will be dropped to overcome underflow or overflow + conditions. + + @param userData The value of a user supplied pointer passed to + Pa_OpenStream() intended for storing synthesis data etc. + + @return + The stream callback should return one of the values in the + PaStreamCallbackResult enumeration. To ensure that the callback continues + to be called, it should return paContinue (0). Either paComplete or paAbort + can be returned to finish stream processing, after either of these values is + returned the callback will not be called again. If paAbort is returned the + stream will finish as soon as possible. If paComplete is returned, the stream + will continue until all buffers generated by the callback have been played. + This may be useful in applications such as soundfile players where a specific + duration of output is required. However, it is not necessary to utilise this + mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also + be used to stop the stream. The callback must always fill the entire output + buffer irrespective of its return value. + + @see Pa_OpenStream, Pa_OpenDefaultStream + + @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call + PortAudio API functions from within the stream callback. +*/ +typedef int PaStreamCallback( + const void *input, void *output, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + + +/** Opens a stream for either input, output or both. + + @param stream The address of a PaStream pointer which will receive + a pointer to the newly opened stream. + + @param inputParameters A structure that describes the input parameters used by + the opened stream. See PaStreamParameters for a description of these parameters. + inputParameters must be NULL for output-only streams. + + @param outputParameters A structure that describes the output parameters used by + the opened stream. See PaStreamParameters for a description of these parameters. + outputParameters must be NULL for input-only streams. + + @param sampleRate The desired sampleRate. For full-duplex streams it is the + sample rate for both input and output + + @param framesPerBuffer The number of frames passed to the stream callback + function, or the preferred block granularity for a blocking read/write stream. + The special value paFramesPerBufferUnspecified (0) may be used to request that + the stream callback will recieve an optimal (and possibly varying) number of + frames based on host requirements and the requested latency settings. + Note: With some host APIs, the use of non-zero framesPerBuffer for a callback + stream may introduce an additional layer of buffering which could introduce + additional latency. PortAudio guarantees that the additional latency + will be kept to the theoretical minimum however, it is strongly recommended + that a non-zero framesPerBuffer value only be used when your algorithm + requires a fixed number of frames per stream callback. + + @param streamFlags Flags which modify the behaviour of the streaming process. + This parameter may contain a combination of flags ORed together. Some flags may + only be relevant to certain buffer formats. + + @param streamCallback A pointer to a client supplied function that is responsible + for processing and filling input and output buffers. If this parameter is NULL + the stream will be opened in 'blocking read/write' mode. In blocking mode, + the client can receive sample data using Pa_ReadStream and write sample data + using Pa_WriteStream, the number of samples that may be read or written + without blocking is returned by Pa_GetStreamReadAvailable and + Pa_GetStreamWriteAvailable respectively. + + @param userData A client supplied pointer which is passed to the stream callback + function. It could for example, contain a pointer to instance data necessary + for processing the audio buffers. This parameter is ignored if streamCallback + is NULL. + + @return + Upon success Pa_OpenStream() returns paNoError and places a pointer to a + valid PaStream in the stream argument. The stream is inactive (stopped). + If a call to Pa_OpenStream() fails, a non-zero error code is returned (see + PaError for possible error codes) and the value of stream is invalid. + + @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream, + Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable +*/ +PaError Pa_OpenStream( PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); + + +/** A simplified version of Pa_OpenStream() that opens the default input + and/or output devices. + + @param stream The address of a PaStream pointer which will receive + a pointer to the newly opened stream. + + @param numInputChannels The number of channels of sound that will be supplied + to the stream callback or returned by Pa_ReadStream. It can range from 1 to + the value of maxInputChannels in the PaDeviceInfo record for the default input + device. If 0 the stream is opened as an output-only stream. + + @param numOutputChannels The number of channels of sound to be delivered to the + stream callback or passed to Pa_WriteStream. It can range from 1 to the value + of maxOutputChannels in the PaDeviceInfo record for the default output dvice. + If 0 the stream is opened as an output-only stream. + + @param sampleFormat The sample format of both the input and output buffers + provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream. + sampleFormat may be any of the formats described by the PaSampleFormat + enumeration. + + @param sampleRate Same as Pa_OpenStream parameter of the same name. + @param framesPerBuffer Same as Pa_OpenStream parameter of the same name. + @param streamCallback Same as Pa_OpenStream parameter of the same name. + @param userData Same as Pa_OpenStream parameter of the same name. + + @return As for Pa_OpenStream + + @see Pa_OpenStream, PaStreamCallback +*/ +PaError Pa_OpenDefaultStream( PaStream** stream, + int numInputChannels, + int numOutputChannels, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamCallback *streamCallback, + void *userData ); + + +/** Closes an audio stream. If the audio stream is active it + discards any pending buffers as if Pa_AbortStream() had been called. +*/ +PaError Pa_CloseStream( PaStream *stream ); + + +/** Functions of type PaStreamFinishedCallback are implemented by PortAudio + clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback + function. Once registered they are called when the stream becomes inactive + (ie once a call to Pa_StopStream() will not block). + A stream will become inactive after the stream callback returns non-zero, + or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio + output, if the stream callback returns paComplete, or Pa_StopStream is called, + the stream finished callback will not be called until all generated sample data + has been played. + + @param userData The userData parameter supplied to Pa_OpenStream() + + @see Pa_SetStreamFinishedCallback +*/ +typedef void PaStreamFinishedCallback( void *userData ); + + +/** Register a stream finished callback function which will be called when the + stream becomes inactive. See the description of PaStreamFinishedCallback for + further details about when the callback will be called. + + @param stream a pointer to a PaStream that is in the stopped state - if the + stream is not stopped, the stream's finished callback will remain unchanged + and an error code will be returned. + + @param streamFinishedCallback a pointer to a function with the same signature + as PaStreamFinishedCallback, that will be called when the stream becomes + inactive. Passing NULL for this parameter will un-register a previously + registered stream finished callback function. + + @return on success returns paNoError, otherwise an error code indicating the cause + of the error. + + @see PaStreamFinishedCallback +*/ +PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); + + +/** Commences audio processing. +*/ +PaError Pa_StartStream( PaStream *stream ); + + +/** Terminates audio processing. It waits until all pending + audio buffers have been played before it returns. +*/ +PaError Pa_StopStream( PaStream *stream ); + + +/** Terminates audio processing immediately without waiting for pending + buffers to complete. +*/ +PaError Pa_AbortStream( PaStream *stream ); + + +/** Determine whether the stream is stopped. + A stream is considered to be stopped prior to a successful call to + Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream. + If a stream callback returns a value other than paContinue the stream is NOT + considered to be stopped. + + @return Returns one (1) when the stream is stopped, zero (0) when + the stream is running or, a PaErrorCode (which are always negative) if + PortAudio is not initialized or an error is encountered. + + @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive +*/ +PaError Pa_IsStreamStopped( PaStream *stream ); + + +/** Determine whether the stream is active. + A stream is active after a successful call to Pa_StartStream(), until it + becomes inactive either as a result of a call to Pa_StopStream() or + Pa_AbortStream(), or as a result of a return value other than paContinue from + the stream callback. In the latter case, the stream is considered inactive + after the last buffer has finished playing. + + @return Returns one (1) when the stream is active (ie playing or recording + audio), zero (0) when not playing or, a PaErrorCode (which are always negative) + if PortAudio is not initialized or an error is encountered. + + @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped +*/ +PaError Pa_IsStreamActive( PaStream *stream ); + + + +/** A structure containing unchanging information about an open stream. + @see Pa_GetStreamInfo +*/ + +typedef struct PaStreamInfo +{ + /** this is struct version 1 */ + int structVersion; + + /** The input latency of the stream in seconds. This value provides the most + accurate estimate of input latency available to the implementation. It may + differ significantly from the suggestedLatency value passed to Pa_OpenStream(). + The value of this field will be zero (0.) for output-only streams. + @see PaTime + */ + PaTime inputLatency; + + /** The output latency of the stream in seconds. This value provides the most + accurate estimate of output latency available to the implementation. It may + differ significantly from the suggestedLatency value passed to Pa_OpenStream(). + The value of this field will be zero (0.) for input-only streams. + @see PaTime + */ + PaTime outputLatency; + + /** The sample rate of the stream in Hertz (samples per second). In cases + where the hardware sample rate is inaccurate and PortAudio is aware of it, + the value of this field may be different from the sampleRate parameter + passed to Pa_OpenStream(). If information about the actual hardware sample + rate is not available, this field will have the same value as the sampleRate + parameter passed to Pa_OpenStream(). + */ + double sampleRate; + +} PaStreamInfo; + + +/** Retrieve a pointer to a PaStreamInfo structure containing information + about the specified stream. + @return A pointer to an immutable PaStreamInfo structure. If the stream + parameter invalid, or an error is encountered, the function returns NULL. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @note PortAudio manages the memory referenced by the returned pointer, + the client must not manipulate or free the memory. The pointer is only + guaranteed to be valid until the specified stream is closed. + + @see PaStreamInfo +*/ +const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ); + + +/** Determine the current time for the stream according to the same clock used + to generate buffer timestamps. This time may be used for syncronising other + events to the audio stream, for example synchronizing audio to MIDI. + + @return The stream's current time in seconds, or 0 if an error occurred. + + @see PaTime, PaStreamCallback +*/ +PaTime Pa_GetStreamTime( PaStream *stream ); + + +/** Retrieve CPU usage information for the specified stream. + The "CPU Load" is a fraction of total CPU time consumed by a callback stream's + audio processing routines including, but not limited to the client supplied + stream callback. This function does not work with blocking read/write streams. + + This function may be called from the stream callback function or the + application. + + @return + A floating point value, typically between 0.0 and 1.0, where 1.0 indicates + that the stream callback is consuming the maximum number of CPU cycles possible + to maintain real-time operation. A value of 0.5 would imply that PortAudio and + the stream callback was consuming roughly 50% of the available CPU time. The + return value may exceed 1.0. A value of 0.0 will always be returned for a + blocking read/write stream, or if an error occurrs. +*/ +double Pa_GetStreamCpuLoad( PaStream* stream ); + + +/** Read samples from an input stream. The function doesn't return until + the entire buffer has been filled - this may involve waiting for the operating + system to supply the data. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @param buffer A pointer to a buffer of sample frames. The buffer contains + samples in the format specified by the inputParameters->sampleFormat field + used to open the stream, and the number of channels specified by + inputParameters->numChannels. If non-interleaved samples were requested, + buffer is a pointer to the first element of an array of non-interleaved + buffer pointers, one for each channel. + + @param frames The number of frames to be read into buffer. This parameter + is not constrained to a specific range, however high performance applications + will want to match this parameter to the framesPerBuffer parameter used + when opening the stream. + + @return On success PaNoError will be returned, or PaInputOverflowed if input + data was discarded by PortAudio after the previous call and before this call. +*/ +PaError Pa_ReadStream( PaStream* stream, + void *buffer, + unsigned long frames ); + + +/** Write samples to an output stream. This function doesn't return until the + entire buffer has been consumed - this may involve waiting for the operating + system to consume the data. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @param buffer A pointer to a buffer of sample frames. The buffer contains + samples in the format specified by the outputParameters->sampleFormat field + used to open the stream, and the number of channels specified by + outputParameters->numChannels. If non-interleaved samples were requested, + buffer is a pointer to the first element of an array of non-interleaved + buffer pointers, one for each channel. + + @param frames The number of frames to be written from buffer. This parameter + is not constrained to a specific range, however high performance applications + will want to match this parameter to the framesPerBuffer parameter used + when opening the stream. + + @return On success PaNoError will be returned, or paOutputUnderflowed if + additional output data was inserted after the previous call and before this + call. +*/ +PaError Pa_WriteStream( PaStream* stream, + const void *buffer, + unsigned long frames ); + + +/** Retrieve the number of frames that can be read from the stream without + waiting. + + @return Returns a non-negative value representing the maximum number of frames + that can be read from the stream without blocking or busy waiting or, a + PaErrorCode (which are always negative) if PortAudio is not initialized or an + error is encountered. +*/ +signed long Pa_GetStreamReadAvailable( PaStream* stream ); + + +/** Retrieve the number of frames that can be written to the stream without + waiting. + + @return Returns a non-negative value representing the maximum number of frames + that can be written to the stream without blocking or busy waiting or, a + PaErrorCode (which are always negative) if PortAudio is not initialized or an + error is encountered. +*/ +signed long Pa_GetStreamWriteAvailable( PaStream* stream ); + + +/* Miscellaneous utilities */ + + +/** Retrieve the size of a given sample format in bytes. + + @return The size in bytes of a single sample in the specified format, + or paSampleFormatNotSupported if the format is not supported. +*/ +PaError Pa_GetSampleSize( PaSampleFormat format ); + + +/** Put the caller to sleep for at least 'msec' milliseconds. This function is + provided only as a convenience for authors of portable code (such as the tests + and examples in the PortAudio distribution.) + + The function may sleep longer than requested so don't rely on this for accurate + musical timing. +*/ +void Pa_Sleep( long msec ); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PORTAUDIO_H */ diff --git a/portaudio-v19/src/SConscript b/portaudio-v19/src/SConscript new file mode 100644 index 000000000..2cd77ea1d --- /dev/null +++ b/portaudio-v19/src/SConscript @@ -0,0 +1,198 @@ +import os.path, copy, sys + +def checkSymbol(conf, header, library=None, symbol=None, autoAdd=True, critical=False, pkgName=None): + """ Check for symbol in library, optionally look only for header. + @param conf: Configure instance. + @param header: The header file where the symbol is declared. + @param library: The library in which the symbol exists, if None it is taken to be the standard C library. + @param symbol: The symbol to look for, if None only the header will be looked up. + @param autoAdd: Automatically link with this library if check is positive. + @param critical: Raise on error? + @param pkgName: Optional name of pkg-config entry for library, to determine build parameters. + @return: True/False + """ + origEnv = conf.env.Copy() # Copy unmodified environment so we can restore it upon error + env = conf.env + if library is None: + library = "c" # Standard library + autoAdd = False + + if pkgName is not None: + origLibs = copy.copy(env.get("LIBS", None)) + + try: env.ParseConfig("pkg-config --silence-errors %s --cflags --libs" % pkgName) + except: pass + else: + # I see no other way of checking that the parsing succeeded, if it did add no more linking parameters + if env.get("LIBS", None) != origLibs: + autoAdd = False + + try: + if not conf.CheckCHeader(header, include_quotes="<>"): + raise ConfigurationError("missing header %s" % header) + if symbol is not None and not conf.CheckLib(library, symbol, language="C", autoadd=autoAdd): + raise ConfigurationError("missing symbol %s in library %s" % (symbol, library)) + except ConfigurationError: + conf.env = origEnv + if not critical: + return False + raise + + return True + +import SCons.Errors + +# Import common variables + +# Could use '#' to refer to top-level SConstruct directory, but looks like env.SConsignFile doesn't interpret this at least :( +sconsDir = os.path.abspath(os.path.join("build", "scons")) + +try: + Import("Platform", "Posix", "ConfigurationError", "ApiVer") +except SCons.Errors.UserError: + # The common objects must be exported first + SConscript(os.path.join(sconsDir, "SConscript_common")) + Import("Platform", "Posix", "ConfigurationError", "ApiVer") + +Import("env") + +# This will be manipulated +env = env.Copy() + +# We operate with a set of needed libraries and optional libraries, the latter stemming from host API implementations. +# For libraries of both types we record a set of values that is used to look for the library in question, during +# configuration. If the corresponding library for a host API implementation isn't found, the implementation is left out. +neededLibs = [] +optionalImpls = {} +if Platform in Posix: + env.Append(CPPPATH=os.path.join("os", "unix")) + neededLibs += [("pthread", "pthread.h", "pthread_create"), ("m", "math.h", "sin")] + if env["useALSA"]: + optionalImpls["ALSA"] = ("asound", "alsa/asoundlib.h", "snd_pcm_open") + if env["useJACK"]: + optionalImpls["JACK"] = ("jack", "jack/jack.h", "jack_client_new") + if env["useOSS"]: + # TODO: It looks like the prefix for soundcard.h depends on the platform + optionalImpls["OSS"] = ("oss", "sys/soundcard.h", None) + if env["useASIHPI"]: + optionalImpls["ASIHPI"] = ("hpi", "asihpi/hpi.h", "HPI_SubSysCreate") +else: + raise ConfigurationError("unknown platform %s" % Platform) + +if Platform == "darwin": + env.Append(LINKFLAGS=["-framework CoreAudio", "-framework AudioToolBox"]) + env.Append(CPPDEFINES=["PA_USE_COREAUDIO"]) +elif Platform == "cygwin": + env.Append(LIBS=["winmm"]) +elif Platform == "irix": + neededLibs += [("audio", "dmedia/audio.h", "alOpenPort"), ("dmedia", "dmedia/dmedia.h", "dmGetUST")] + env.Append(CPPDEFINES=["PA_USE_SGI"]) + +def CheckCTypeSize(context, tp): + """ Check size of C type. + @param context: A configuration context. + @param tp: The type to check. + @return: Size of type, in bytes. + """ + context.Message("Checking the size of C type %s..." % tp) + ret = context.TryRun(""" +#include + +int main() { + printf("%%d", sizeof(%s)); + return 0; +} +""" % tp, ".c") + if not ret[0]: + context.Result(" Couldn't obtain size of type %s!" % tp) + return None + + assert ret[1] + sz = int(ret[1]) + context.Result("%d" % sz) + return sz + +""" +if sys.byteorder == "little": + env.Append(CPPDEFINES=["PA_LITTLE_ENDIAN"]) +elif sys.byteorder == "big": + env.Append(CPPDEFINES=["PA_BIG_ENDIAN"]) +else: + raise ConfigurationError("unknown byte order: %s" % sys.byteorder) +""" +if env["enableDebugOutput"]: + env.Append(CPPDEFINES=["PA_ENABLE_DEBUG_OUTPUT"]) + +# Start configuration + +# Use an absolute path for conf_dir, otherwise it gets created both relative to current directory and build directory +conf = env.Configure(log_file=os.path.join(sconsDir, "sconf.log"), custom_tests={"CheckCTypeSize": CheckCTypeSize}, + conf_dir=os.path.join(sconsDir, ".sconf_temp")) +conf.env.Append(CPPDEFINES=["SIZEOF_SHORT=%d" % conf.CheckCTypeSize("short")]) +conf.env.Append(CPPDEFINES=["SIZEOF_INT=%d" % conf.CheckCTypeSize("int")]) +conf.env.Append(CPPDEFINES=["SIZEOF_LONG=%d" % conf.CheckCTypeSize("long")]) +if checkSymbol(conf, "time.h", "rt", "clock_gettime"): + conf.env.Append(CPPDEFINES=["HAVE_CLOCK_GETTIME"]) +if checkSymbol(conf, "time.h", symbol="nanosleep"): + conf.env.Append(CPPDEFINES=["HAVE_NANOSLEEP"]) + +# Look for needed libraries and link with them +for lib, hdr, sym in neededLibs: + checkSymbol(conf, hdr, lib, sym, critical=True) +# Look for host API libraries, if a library isn't found disable corresponding host API implementation. +for name, val in optionalImpls.items(): + lib, hdr, sym = val + if checkSymbol(conf, hdr, lib, sym, critical=False, pkgName=name.lower()): + conf.env.Append(CPPDEFINES=["PA_USE_%s=1" % name.upper()]) + else: + del optionalImpls[name] + +# Configuration finished +env = conf.Finish() + +# PA infrastructure +CommonSources = [os.path.join("common", f) for f in "pa_allocation.c pa_converters.c pa_cpuload.c pa_dither.c pa_front.c \ + pa_process.c pa_skeleton.c pa_stream.c pa_trace.c".split()] + +# Host API implementations +ImplSources = [] +if Platform in Posix: + ImplSources += [os.path.join("os", "unix", f) for f in "pa_unix_hostapis.c pa_unix_util.c".split()] + +if "ALSA" in optionalImpls: + ImplSources.append(os.path.join("hostapi", "alsa", "pa_linux_alsa.c")) +if "JACK" in optionalImpls: + ImplSources.append(os.path.join("hostapi", "jack", "pa_jack.c")) +if "OSS" in optionalImpls: + ImplSources.append(os.path.join("hostapi", "oss", "pa_unix_oss.c")) +if "ASIHPI" in optionalImpls: + ImplSources.append(os.path.join("hostapi", "asihpi", "pa_linux_asihpi.c")) + + +sources = CommonSources + ImplSources + +sharedLibEnv = env.Copy() +if Platform in Posix: + # Add soname to library, this is so a reference is made to the versioned library in programs linking against libportaudio.so + sharedLibEnv.AppendUnique(SHLINKFLAGS="-Wl,-soname=libportaudio.so.%d" % int(ApiVer.split(".")[0])) +sharedLib = sharedLibEnv.SharedLibrary(target="portaudio", source=sources) + +staticLib = env.StaticLibrary(target="portaudio", source=sources) + +if Platform in Posix: + prefix = env["prefix"] + includeDir = os.path.join(prefix, "include") + libDir = os.path.join(prefix, "lib") + +testNames = ["patest_sine", "paqa_devs", "paqa_errs", "patest1", "patest_buffer", "patest_callbackstop", "patest_clip", \ + "patest_dither", "patest_hang", "patest_in_overflow", "patest_latency", "patest_leftright", "patest_longsine", \ + "patest_many", "patest_maxsines", "patest_multi_sine", "patest_out_underflow", "patest_pink", "patest_prime", \ + "patest_read_record", "patest_record", "patest_ringmix", "patest_saw", "patest_sine8", "patest_sine", \ + "patest_sine_time", "patest_start_stop", "patest_stop", "patest_sync", \ + "patest_toomanysines", "patest_underflow", "patest_wire", "patest_write_sine", "pa_devs", "pa_fuzz", "pa_minlat"] + +# The test directory ("bin") should be in the top-level PA directory +tests = [env.Program(target=os.path.join("#", "bin", name), source=[os.path.join("#", "test", name + ".c"), + staticLib]) for name in testNames] + +Return("sources", "sharedLib", "staticLib", "tests", "env") diff --git a/portaudio-v19/src/common/pa_allocation.c b/portaudio-v19/src/common/pa_allocation.c new file mode 100644 index 000000000..98239c48f --- /dev/null +++ b/portaudio-v19/src/common/pa_allocation.c @@ -0,0 +1,234 @@ +/* + * $Id$ + * Portable Audio I/O Library allocation group implementation + * memory allocation group for tracking allocation groups + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Allocation Group implementation. +*/ + + +#include "pa_allocation.h" +#include "pa_util.h" + + +/* + Maintain 3 singly linked lists... + linkBlocks: the buffers used to allocate the links + spareLinks: links available for use in the allocations list + allocations: the buffers currently allocated using PaUtil_ContextAllocateMemory() + + Link block size is doubled every time new links are allocated. +*/ + + +#define PA_INITIAL_LINK_COUNT_ 16 + +struct PaUtilAllocationGroupLink +{ + struct PaUtilAllocationGroupLink *next; + void *buffer; +}; + +/* + Allocate a block of links. The first link will have it's buffer member + pointing to the block, and it's next member set to . The remaining + links will have NULL buffer members, and each link will point to + the next link except the last, which will point to +*/ +static struct PaUtilAllocationGroupLink *AllocateLinks( long count, + struct PaUtilAllocationGroupLink *nextBlock, + struct PaUtilAllocationGroupLink *nextSpare ) +{ + struct PaUtilAllocationGroupLink *result; + int i; + + result = (struct PaUtilAllocationGroupLink *)PaUtil_AllocateMemory( + sizeof(struct PaUtilAllocationGroupLink) * count ); + if( result ) + { + /* the block link */ + result[0].buffer = result; + result[0].next = nextBlock; + + /* the spare links */ + for( i=1; ilinkCount = PA_INITIAL_LINK_COUNT_; + result->linkBlocks = &links[0]; + result->spareLinks = &links[1]; + result->allocations = 0; + } + else + { + PaUtil_FreeMemory( links ); + } + } + + return result; +} + + +void PaUtil_DestroyAllocationGroup( PaUtilAllocationGroup* group ) +{ + struct PaUtilAllocationGroupLink *current = group->linkBlocks; + struct PaUtilAllocationGroupLink *next; + + while( current ) + { + next = current->next; + PaUtil_FreeMemory( current->buffer ); + current = next; + } + + PaUtil_FreeMemory( group ); +} + + +void* PaUtil_GroupAllocateMemory( PaUtilAllocationGroup* group, long size ) +{ + struct PaUtilAllocationGroupLink *links, *link; + void *result = 0; + + /* allocate more links if necessary */ + if( !group->spareLinks ) + { + /* double the link count on each block allocation */ + links = AllocateLinks( group->linkCount, group->linkBlocks, group->spareLinks ); + if( links ) + { + group->linkCount += group->linkCount; + group->linkBlocks = &links[0]; + group->spareLinks = &links[1]; + } + } + + if( group->spareLinks ) + { + result = PaUtil_AllocateMemory( size ); + if( result ) + { + link = group->spareLinks; + group->spareLinks = link->next; + + link->buffer = result; + link->next = group->allocations; + + group->allocations = link; + } + } + + return result; +} + + +void PaUtil_GroupFreeMemory( PaUtilAllocationGroup* group, void *buffer ) +{ + struct PaUtilAllocationGroupLink *current = group->allocations; + struct PaUtilAllocationGroupLink *previous = 0; + + if( buffer == 0 ) + return; + + /* find the right link and remove it */ + while( current ) + { + if( current->buffer == buffer ) + { + if( previous ) + { + previous->next = current->next; + } + else + { + group->allocations = current->next; + } + + current->buffer = 0; + current->next = group->spareLinks; + group->spareLinks = current; + + break; + } + + previous = current; + current = current->next; + } + + PaUtil_FreeMemory( buffer ); /* free the memory whether we found it in the list or not */ +} + + +void PaUtil_FreeAllAllocations( PaUtilAllocationGroup* group ) +{ + struct PaUtilAllocationGroupLink *current = group->allocations; + struct PaUtilAllocationGroupLink *previous = 0; + + /* free all buffers in the allocations list */ + while( current ) + { + PaUtil_FreeMemory( current->buffer ); + current->buffer = 0; + + previous = current; + current = current->next; + } + + /* link the former allocations list onto the front of the spareLinks list */ + if( previous ) + { + previous->next = group->spareLinks; + group->spareLinks = group->allocations; + group->allocations = 0; + } +} + diff --git a/portaudio-v19/src/common/pa_allocation.h b/portaudio-v19/src/common/pa_allocation.h new file mode 100644 index 000000000..5bcfe75a6 --- /dev/null +++ b/portaudio-v19/src/common/pa_allocation.h @@ -0,0 +1,95 @@ +#ifndef PA_ALLOCATION_H +#define PA_ALLOCATION_H +/* + * $Id$ + * Portable Audio I/O Library allocation context header + * memory allocation context for tracking allocation groups + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Allocation Group prototypes. An Allocation Group makes it easy to + allocate multiple blocks of memory and free them all simultanously. + + An allocation group is useful for keeping track of multiple blocks + of memory which are allocated at the same time (such as during initialization) + and need to be deallocated at the same time. The allocation group maintains + a list of allocated blocks, and can deallocate them all simultaneously which + can be usefull for cleaning up after a partially initialized object fails. + + The allocation group implementation is built on top of the lower + level allocation functions defined in pa_util.h +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +typedef struct +{ + long linkCount; + struct PaUtilAllocationGroupLink *linkBlocks; + struct PaUtilAllocationGroupLink *spareLinks; + struct PaUtilAllocationGroupLink *allocations; +}PaUtilAllocationGroup; + + + +/** Create an allocation group. +*/ +PaUtilAllocationGroup* PaUtil_CreateAllocationGroup( void ); + +/** Destroy an allocation group, but not the memory allocated through the group. +*/ +void PaUtil_DestroyAllocationGroup( PaUtilAllocationGroup* group ); + +/** Allocate a block of memory though an allocation group. +*/ +void* PaUtil_GroupAllocateMemory( PaUtilAllocationGroup* group, long size ); + +/** Free a block of memory that was previously allocated though an allocation + group. Calling this function is a relatively time consuming operation. + Under normal circumstances clients should call PaUtil_FreeAllAllocations to + free all allocated blocks simultaneously. + @see PaUtil_FreeAllAllocations +*/ +void PaUtil_GroupFreeMemory( PaUtilAllocationGroup* group, void *buffer ); + +/** Free all blocks of memory which have been allocated through the allocation + group. This function doesn't destroy the group itself. +*/ +void PaUtil_FreeAllAllocations( PaUtilAllocationGroup* group ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_ALLOCATION_H */ diff --git a/portaudio-v19/src/common/pa_converters.c b/portaudio-v19/src/common/pa_converters.c new file mode 100644 index 000000000..39f83e481 --- /dev/null +++ b/portaudio-v19/src/common/pa_converters.c @@ -0,0 +1,1926 @@ +/* + * $Id$ + * Portable Audio I/O Library sample conversion mechanism + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Conversion functions implementations. + + If the C9x function lrintf() is available, define PA_USE_C99_LRINTF to use it + + @todo Consider whether functions which dither but don't clip should exist, + V18 automatically enabled clipping whenever dithering was selected. Perhaps + we should do the same. + + @todo implement the converters marked IMPLEMENT ME: Float32_To_UInt8_Dither, + Float32_To_UInt8_Clip, Float32_To_UInt8_DitherClip, Int32_To_Int24_Dither, + Int32_To_UInt8_Dither, Int24_To_Int16_Dither, Int24_To_Int8_Dither, + Int24_To_UInt8_Dither, Int16_To_Int8_Dither, Int16_To_UInt8_Dither, + + @todo review the converters marked REVIEW: Float32_To_Int32, + Float32_To_Int32_Dither, Float32_To_Int32_Clip, Float32_To_Int32_DitherClip, + Int32_To_Int16_Dither, Int32_To_Int8_Dither, Int16_To_Int32 +*/ + + +#include "pa_converters.h" +#include "pa_dither.h" +#include "pa_endianness.h" +#include "pa_types.h" + + +PaSampleFormat PaUtil_SelectClosestAvailableFormat( + PaSampleFormat availableFormats, PaSampleFormat format ) +{ + PaSampleFormat result; + + format &= ~paNonInterleaved; + availableFormats &= ~paNonInterleaved; + + if( (format & availableFormats) == 0 ) + { + /* NOTE: this code depends on the sample format constants being in + descending order of quality - ie best quality is 0 + FIXME: should write an assert which checks that all of the + known constants conform to that requirement. + */ + + if( format != 0x01 ) + { + /* scan for better formats */ + result = format; + do + { + result >>= 1; + } + while( (result & availableFormats) == 0 && result != 0 ); + } + else + { + result = 0; + } + + if( result == 0 ){ + /* scan for worse formats */ + result = format; + do + { + result <<= 1; + } + while( (result & availableFormats) == 0 && result != paCustomFormat ); + + if( (result & availableFormats) == 0 ) + result = paSampleFormatNotSupported; + } + + }else{ + result = format; + } + + return result; +} + +/* -------------------------------------------------------------------------- */ + +#define PA_SELECT_FORMAT_( format, float32, int32, int24, int16, int8, uint8 ) \ + switch( format & ~paNonInterleaved ){ \ + case paFloat32: \ + float32 \ + case paInt32: \ + int32 \ + case paInt24: \ + int24 \ + case paInt16: \ + int16 \ + case paInt8: \ + int8 \ + case paUInt8: \ + uint8 \ + default: return 0; \ + } + +/* -------------------------------------------------------------------------- */ + +#define PA_SELECT_CONVERTER_DITHER_CLIP_( flags, source, destination ) \ + if( flags & paClipOff ){ /* no clip */ \ + if( flags & paDitherOff ){ /* no dither */ \ + return paConverters. source ## _To_ ## destination; \ + }else{ /* dither */ \ + return paConverters. source ## _To_ ## destination ## _Dither; \ + } \ + }else{ /* clip */ \ + if( flags & paDitherOff ){ /* no dither */ \ + return paConverters. source ## _To_ ## destination ## _Clip; \ + }else{ /* dither */ \ + return paConverters. source ## _To_ ## destination ## _DitherClip; \ + } \ + } + +/* -------------------------------------------------------------------------- */ + +#define PA_SELECT_CONVERTER_DITHER_( flags, source, destination ) \ + if( flags & paDitherOff ){ /* no dither */ \ + return paConverters. source ## _To_ ## destination; \ + }else{ /* dither */ \ + return paConverters. source ## _To_ ## destination ## _Dither; \ + } + +/* -------------------------------------------------------------------------- */ + +#define PA_USE_CONVERTER_( source, destination )\ + return paConverters. source ## _To_ ## destination; + +/* -------------------------------------------------------------------------- */ + +#define PA_UNITY_CONVERSION_( wordlength )\ + return paConverters. Copy_ ## wordlength ## _To_ ## wordlength; + +/* -------------------------------------------------------------------------- */ + +PaUtilConverter* PaUtil_SelectConverter( PaSampleFormat sourceFormat, + PaSampleFormat destinationFormat, PaStreamFlags flags ) +{ + PA_SELECT_FORMAT_( sourceFormat, + /* paFloat32: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_UNITY_CONVERSION_( 32 ), + /* paInt32: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int32 ), + /* paInt24: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int24 ), + /* paInt16: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int16 ), + /* paInt8: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, Int8 ), + /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_CLIP_( flags, Float32, UInt8 ) + ), + /* paInt32: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( Int32, Float32 ), + /* paInt32: */ PA_UNITY_CONVERSION_( 32 ), + /* paInt24: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, Int24 ), + /* paInt16: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, Int16 ), + /* paInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, Int8 ), + /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int32, UInt8 ) + ), + /* paInt24: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( Int24, Float32 ), + /* paInt32: */ PA_USE_CONVERTER_( Int24, Int32 ), + /* paInt24: */ PA_UNITY_CONVERSION_( 24 ), + /* paInt16: */ PA_SELECT_CONVERTER_DITHER_( flags, Int24, Int16 ), + /* paInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int24, Int8 ), + /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int24, UInt8 ) + ), + /* paInt16: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( Int16, Float32 ), + /* paInt32: */ PA_USE_CONVERTER_( Int16, Int32 ), + /* paInt24: */ PA_USE_CONVERTER_( Int16, Int24 ), + /* paInt16: */ PA_UNITY_CONVERSION_( 16 ), + /* paInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int16, Int8 ), + /* paUInt8: */ PA_SELECT_CONVERTER_DITHER_( flags, Int16, UInt8 ) + ), + /* paInt8: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( Int8, Float32 ), + /* paInt32: */ PA_USE_CONVERTER_( Int8, Int32 ), + /* paInt24: */ PA_USE_CONVERTER_( Int8, Int24 ), + /* paInt16: */ PA_USE_CONVERTER_( Int8, Int16 ), + /* paInt8: */ PA_UNITY_CONVERSION_( 8 ), + /* paUInt8: */ PA_USE_CONVERTER_( Int8, UInt8 ) + ), + /* paUInt8: */ + PA_SELECT_FORMAT_( destinationFormat, + /* paFloat32: */ PA_USE_CONVERTER_( UInt8, Float32 ), + /* paInt32: */ PA_USE_CONVERTER_( UInt8, Int32 ), + /* paInt24: */ PA_USE_CONVERTER_( UInt8, Int24 ), + /* paInt16: */ PA_USE_CONVERTER_( UInt8, Int16 ), + /* paInt8: */ PA_USE_CONVERTER_( UInt8, Int8 ), + /* paUInt8: */ PA_UNITY_CONVERSION_( 8 ) + ) + ) +} + +/* -------------------------------------------------------------------------- */ + +#ifdef PA_NO_STANDARD_CONVERTERS + +/* -------------------------------------------------------------------------- */ + +PaUtilConverterTable paConverters = { + 0, /* PaUtilConverter *Float32_To_Int32; */ + 0, /* PaUtilConverter *Float32_To_Int32_Dither; */ + 0, /* PaUtilConverter *Float32_To_Int32_Clip; */ + 0, /* PaUtilConverter *Float32_To_Int32_DitherClip; */ + + 0, /* PaUtilConverter *Float32_To_Int24; */ + 0, /* PaUtilConverter *Float32_To_Int24_Dither; */ + 0, /* PaUtilConverter *Float32_To_Int24_Clip; */ + 0, /* PaUtilConverter *Float32_To_Int24_DitherClip; */ + + 0, /* PaUtilConverter *Float32_To_Int16; */ + 0, /* PaUtilConverter *Float32_To_Int16_Dither; */ + 0, /* PaUtilConverter *Float32_To_Int16_Clip; */ + 0, /* PaUtilConverter *Float32_To_Int16_DitherClip; */ + + 0, /* PaUtilConverter *Float32_To_Int8; */ + 0, /* PaUtilConverter *Float32_To_Int8_Dither; */ + 0, /* PaUtilConverter *Float32_To_Int8_Clip; */ + 0, /* PaUtilConverter *Float32_To_Int8_DitherClip; */ + + 0, /* PaUtilConverter *Float32_To_UInt8; */ + 0, /* PaUtilConverter *Float32_To_UInt8_Dither; */ + 0, /* PaUtilConverter *Float32_To_UInt8_Clip; */ + 0, /* PaUtilConverter *Float32_To_UInt8_DitherClip; */ + + 0, /* PaUtilConverter *Int32_To_Float32; */ + 0, /* PaUtilConverter *Int32_To_Int24; */ + 0, /* PaUtilConverter *Int32_To_Int24_Dither; */ + 0, /* PaUtilConverter *Int32_To_Int16; */ + 0, /* PaUtilConverter *Int32_To_Int16_Dither; */ + 0, /* PaUtilConverter *Int32_To_Int8; */ + 0, /* PaUtilConverter *Int32_To_Int8_Dither; */ + 0, /* PaUtilConverter *Int32_To_UInt8; */ + 0, /* PaUtilConverter *Int32_To_UInt8_Dither; */ + + 0, /* PaUtilConverter *Int24_To_Float32; */ + 0, /* PaUtilConverter *Int24_To_Int32; */ + 0, /* PaUtilConverter *Int24_To_Int16; */ + 0, /* PaUtilConverter *Int24_To_Int16_Dither; */ + 0, /* PaUtilConverter *Int24_To_Int8; */ + 0, /* PaUtilConverter *Int24_To_Int8_Dither; */ + 0, /* PaUtilConverter *Int24_To_UInt8; */ + 0, /* PaUtilConverter *Int24_To_UInt8_Dither; */ + + 0, /* PaUtilConverter *Int16_To_Float32; */ + 0, /* PaUtilConverter *Int16_To_Int32; */ + 0, /* PaUtilConverter *Int16_To_Int24; */ + 0, /* PaUtilConverter *Int16_To_Int8; */ + 0, /* PaUtilConverter *Int16_To_Int8_Dither; */ + 0, /* PaUtilConverter *Int16_To_UInt8; */ + 0, /* PaUtilConverter *Int16_To_UInt8_Dither; */ + + 0, /* PaUtilConverter *Int8_To_Float32; */ + 0, /* PaUtilConverter *Int8_To_Int32; */ + 0, /* PaUtilConverter *Int8_To_Int24 */ + 0, /* PaUtilConverter *Int8_To_Int16; */ + 0, /* PaUtilConverter *Int8_To_UInt8; */ + + 0, /* PaUtilConverter *UInt8_To_Float32; */ + 0, /* PaUtilConverter *UInt8_To_Int32; */ + 0, /* PaUtilConverter *UInt8_To_Int24; */ + 0, /* PaUtilConverter *UInt8_To_Int16; */ + 0, /* PaUtilConverter *UInt8_To_Int8; */ + + 0, /* PaUtilConverter *Copy_8_To_8; */ + 0, /* PaUtilConverter *Copy_16_To_16; */ + 0, /* PaUtilConverter *Copy_24_To_24; */ + 0 /* PaUtilConverter *Copy_32_To_32; */ +}; + +/* -------------------------------------------------------------------------- */ + +#else /* PA_NO_STANDARD_CONVERTERS is not defined */ + +/* -------------------------------------------------------------------------- */ + +#define PA_CLIP_( val, min, max )\ + { val = ((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val)); } + + +static const float const_1_div_128_ = 1.0f / 128.0f; /* 8 bit multiplier */ + +static const float const_1_div_32768_ = 1.0f / 32768.f; /* 16 bit multiplier */ + +static const double const_1_div_2147483648_ = 1.0 / 2147483648.0; /* 32 bit multiplier */ + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* REVIEW */ +#ifdef PA_USE_C99_LRINTF + float scaled = *src * 0x7FFFFFFF; + *dest = lrintf(scaled-0.5f); +#else + double scaled = *src * 0x7FFFFFFF; + *dest = (PaInt32) scaled; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + + while( count-- ) + { + /* REVIEW */ +#ifdef PA_USE_C99_LRINTF + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = ((float)*src * (2147483646.0f)) + dither; + *dest = lrintf(dithered - 0.5f); +#else + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + double dithered = ((double)*src * (2147483646.0)) + dither; + *dest = (PaInt32) dithered; +#endif + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* REVIEW */ +#ifdef PA_USE_C99_LRINTF + float scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648.f, 2147483647.f ); + *dest = lrintf(scaled-0.5f); +#else + double scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648., 2147483647. ); + *dest = (PaInt32) scaled; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + + while( count-- ) + { + /* REVIEW */ +#ifdef PA_USE_C99_LRINTF + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = ((float)*src * (2147483646.0f)) + dither; + PA_CLIP_( dithered, -2147483648.f, 2147483647.f ); + *dest = lrintf(dithered-0.5f); +#else + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + double dithered = ((double)*src * (2147483646.0)) + dither; + PA_CLIP_( dithered, -2147483648., 2147483647. ); + *dest = (PaInt32) dithered; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt32 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* convert to 32 bit and drop the low 8 bits */ + double scaled = *src * 0x7FFFFFFF; + temp = (PaInt32) scaled; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 24); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 8); +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt32 temp; + + while( count-- ) + { + /* convert to 32 bit and drop the low 8 bits */ + + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + double dithered = ((double)*src * (2147483646.0)) + dither; + + temp = (PaInt32) dithered; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 24); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 8); +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt32 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* convert to 32 bit and drop the low 8 bits */ + double scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648., 2147483647. ); + temp = (PaInt32) scaled; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 24); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 8); +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt32 temp; + + while( count-- ) + { + /* convert to 32 bit and drop the low 8 bits */ + + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + double dithered = ((double)*src * (2147483646.0)) + dither; + PA_CLIP_( dithered, -2147483648., 2147483647. ); + + temp = (PaInt32) dithered; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 24); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 8); +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { +#ifdef PA_USE_C99_LRINTF + float tempf = (*src * (32767.0f)) ; + *dest = lrintf(tempf-0.5f); +#else + short samp = (short) (*src * (32767.0f)); + *dest = samp; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + + while( count-- ) + { + + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = (*src * (32766.0f)) + dither; + +#ifdef PA_USE_C99_LRINTF + *dest = lrintf(dithered-0.5f); +#else + *dest = (PaInt16) dithered; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { +#ifdef PA_USE_C99_LRINTF + long samp = lrintf((*src * (32767.0f)) -0.5f); +#else + long samp = (PaInt32) (*src * (32767.0f)); +#endif + PA_CLIP_( samp, -0x8000, 0x7FFF ); + *dest = (PaInt16) samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = (*src * (32766.0f)) + dither; + PaInt32 samp = (PaInt32) dithered; + PA_CLIP_( samp, -0x8000, 0x7FFF ); +#ifdef PA_USE_C99_LRINTF + *dest = lrintf(samp-0.5f); +#else + *dest = (PaInt16) samp; +#endif + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + signed char samp = (signed char) (*src * (127.0f)); + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = (*src * (126.0f)) + dither; + PaInt32 samp = (PaInt32) dithered; + *dest = (signed char) samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int8_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + PaInt32 samp = (PaInt32)(*src * (127.0f)); + PA_CLIP_( samp, -0x80, 0x7F ); + *dest = (signed char) samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int8_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + /* use smaller scaler to prevent overflow when we add the dither */ + float dithered = (*src * (126.0f)) + dither; + PaInt32 samp = (PaInt32) dithered; + PA_CLIP_( samp, -0x80, 0x7F ); + *dest = (signed char) samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + unsigned char samp = (unsigned char)(128 + ((unsigned char) (*src * (127.0f)))); + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_UInt8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_UInt8_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_UInt8_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + float *dest = (float*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = (float) ((double)*src * const_1_div_2147483648_); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* REVIEW */ +#if defined(PA_LITTLE_ENDIAN) + dest[0] = (unsigned char)(*src >> 8); + dest[1] = (unsigned char)(*src >> 16); + dest[2] = (unsigned char)(*src >> 24); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(*src >> 24); + dest[1] = (unsigned char)(*src >> 16); + dest[2] = (unsigned char)(*src >> 8); +#endif + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int24_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + (void) destinationBuffer; /* unused parameters */ + (void) destinationStride; /* unused parameters */ + (void) sourceBuffer; /* unused parameters */ + (void) sourceStride; /* unused parameters */ + (void) count; /* unused parameters */ + (void) ditherGenerator; /* unused parameters */ + /* IMPLEMENT ME */ +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = (PaInt16) ((*src) >> 16); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int16_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + PaInt32 dither; + + while( count-- ) + { + /* REVIEW */ + dither = PaUtil_Generate16BitTriangularDither( ditherGenerator ); + *dest = (PaInt16) ((((*src)>>1) + dither) >> 15); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = (signed char) ((*src) >> 24); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_Int8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + PaInt32 dither; + + while( count-- ) + { + /* REVIEW */ + dither = PaUtil_Generate16BitTriangularDither( ditherGenerator ); + *dest = (signed char) ((((*src)>>1) + dither) >> 23); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (unsigned char)(((*src) >> 24) + 128); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int32_To_UInt8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt32 *src = (PaInt32*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + float *dest = (float*)destinationBuffer; + PaInt32 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + temp = (((long)src[0]) << 8); + temp = temp | (((long)src[1]) << 16); + temp = temp | (((long)src[2]) << 24); +#elif defined(PA_BIG_ENDIAN) + temp = (((long)src[0]) << 24); + temp = temp | (((long)src[1]) << 16); + temp = temp | (((long)src[2]) << 8); +#endif + + *dest = (float) ((double)temp * const_1_div_2147483648_); + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + PaInt32 *dest = (PaInt32*) destinationBuffer; + PaInt32 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + temp = (((long)src[0]) << 8); + temp = temp | (((long)src[1]) << 16); + temp = temp | (((long)src[2]) << 24); +#elif defined(PA_BIG_ENDIAN) + temp = (((long)src[0]) << 24); + temp = temp | (((long)src[1]) << 16); + temp = temp | (((long)src[2]) << 8); +#endif + + *dest = temp; + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + + PaInt16 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + /* src[0] is discarded */ + temp = (((PaInt16)src[1])); + temp = temp | (PaInt16)(((PaInt16)src[2]) << 8); +#elif defined(PA_BIG_ENDIAN) + /* src[2] is discarded */ + temp = (PaInt16)(((PaInt16)src[0]) << 8); + temp = temp | (((PaInt16)src[1])); +#endif + + *dest = temp; + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int16_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + (void) destinationBuffer; /* unused parameters */ + (void) destinationStride; /* unused parameters */ + (void) sourceBuffer; /* unused parameters */ + (void) sourceStride; /* unused parameters */ + (void) count; /* unused parameters */ + (void) ditherGenerator; /* unused parameters */ + /* IMPLEMENT ME */ +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + /* src[0] is discarded */ + /* src[1] is discarded */ + *dest = src[2]; +#elif defined(PA_BIG_ENDIAN) + /* src[2] is discarded */ + /* src[1] is discarded */ + *dest = src[0]; +#endif + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_Int8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + (void) destinationBuffer; /* unused parameters */ + (void) destinationStride; /* unused parameters */ + (void) sourceBuffer; /* unused parameters */ + (void) sourceStride; /* unused parameters */ + (void) count; /* unused parameters */ + (void) ditherGenerator; /* unused parameters */ + /* IMPLEMENT ME */ +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + /* src[0] is discarded */ + /* src[1] is discarded */ + *dest = (unsigned char)(src[2] + 128); +#elif defined(PA_BIG_ENDIAN) + *dest = (unsigned char)(src[0] + 128); + /* src[1] is discarded */ + /* src[2] is discarded */ +#endif + + src += sourceStride * 3; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int24_To_UInt8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + (void) destinationBuffer; /* unused parameters */ + (void) destinationStride; /* unused parameters */ + (void) sourceBuffer; /* unused parameters */ + (void) sourceStride; /* unused parameters */ + (void) count; /* unused parameters */ + (void) ditherGenerator; /* unused parameters */ + /* IMPLEMENT ME */ +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + float *dest = (float*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float samp = *src * const_1_div_32768_; /* FIXME: i'm concerned about this being asymetrical with float->int16 -rb */ + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* REVIEW: we should consider something like + (*src << 16) | (*src & 0xFFFF) + */ + + *dest = *src << 16; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*) sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + PaInt16 temp; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + temp = *src; + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = 0; + dest[1] = (unsigned char)(temp); + dest[2] = (unsigned char)(temp >> 8); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp); + dest[2] = 0; +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (signed char)((*src) >> 8); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_Int8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (unsigned char)(((*src) >> 8) + 128); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int16_To_UInt8_Dither( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaInt16 *src = (PaInt16*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + /* IMPLEMENT ME */ + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + float *dest = (float*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float samp = *src * const_1_div_128_; + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (*src) << 24; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = 0; + dest[1] = 0; + dest[2] = (*src); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (*src); + dest[1] = 0; + dest[2] = 0; +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (PaInt16)((*src) << 8); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Int8_To_UInt8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + signed char *src = (signed char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (unsigned char)(*src + 128); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Float32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + float *dest = (float*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + float samp = (*src - 128) * const_1_div_128_; + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Int32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + PaInt32 *dest = (PaInt32*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (*src - 128) << 24; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + (void) ditherGenerator; /* unused parameters */ + + while( count-- ) + { + +#if defined(PA_LITTLE_ENDIAN) + dest[0] = 0; + dest[1] = 0; + dest[2] = (unsigned char)(*src - 128); +#elif defined(PA_BIG_ENDIAN) + dest[0] = (unsigned char)(*src - 128); + dest[1] = 0; + dest[2] = 0; +#endif + + src += sourceStride; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + PaInt16 *dest = (PaInt16*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (PaInt16)((*src - 128) << 8); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void UInt8_To_Int8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + signed char *dest = (signed char*)destinationBuffer; + (void)ditherGenerator; /* unused parameter */ + + while( count-- ) + { + (*dest) = (signed char)(*src - 128); + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Copy_8_To_8( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = *src; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Copy_16_To_16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaUint16 *src = (PaUint16 *)sourceBuffer; + PaUint16 *dest = (PaUint16 *)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = *src; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Copy_24_To_24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + unsigned char *src = (unsigned char*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + + src += sourceStride * 3; + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Copy_32_To_32( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + PaUint32 *dest = (PaUint32 *)destinationBuffer; + PaUint32 *src = (PaUint32 *)sourceBuffer; + + (void) ditherGenerator; /* unused parameter */ + + while( count-- ) + { + *dest = *src; + + src += sourceStride; + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +PaUtilConverterTable paConverters = { + Float32_To_Int32, /* PaUtilConverter *Float32_To_Int32; */ + Float32_To_Int32_Dither, /* PaUtilConverter *Float32_To_Int32_Dither; */ + Float32_To_Int32_Clip, /* PaUtilConverter *Float32_To_Int32_Clip; */ + Float32_To_Int32_DitherClip, /* PaUtilConverter *Float32_To_Int32_DitherClip; */ + + Float32_To_Int24, /* PaUtilConverter *Float32_To_Int24; */ + Float32_To_Int24_Dither, /* PaUtilConverter *Float32_To_Int24_Dither; */ + Float32_To_Int24_Clip, /* PaUtilConverter *Float32_To_Int24_Clip; */ + Float32_To_Int24_DitherClip, /* PaUtilConverter *Float32_To_Int24_DitherClip; */ + + Float32_To_Int16, /* PaUtilConverter *Float32_To_Int16; */ + Float32_To_Int16_Dither, /* PaUtilConverter *Float32_To_Int16_Dither; */ + Float32_To_Int16_Clip, /* PaUtilConverter *Float32_To_Int16_Clip; */ + Float32_To_Int16_DitherClip, /* PaUtilConverter *Float32_To_Int16_DitherClip; */ + + Float32_To_Int8, /* PaUtilConverter *Float32_To_Int8; */ + Float32_To_Int8_Dither, /* PaUtilConverter *Float32_To_Int8_Dither; */ + Float32_To_Int8_Clip, /* PaUtilConverter *Float32_To_Int8_Clip; */ + Float32_To_Int8_DitherClip, /* PaUtilConverter *Float32_To_Int8_DitherClip; */ + + Float32_To_UInt8, /* PaUtilConverter *Float32_To_UInt8; */ + Float32_To_UInt8_Dither, /* PaUtilConverter *Float32_To_UInt8_Dither; */ + Float32_To_UInt8_Clip, /* PaUtilConverter *Float32_To_UInt8_Clip; */ + Float32_To_UInt8_DitherClip, /* PaUtilConverter *Float32_To_UInt8_DitherClip; */ + + Int32_To_Float32, /* PaUtilConverter *Int32_To_Float32; */ + Int32_To_Int24, /* PaUtilConverter *Int32_To_Int24; */ + Int32_To_Int24_Dither, /* PaUtilConverter *Int32_To_Int24_Dither; */ + Int32_To_Int16, /* PaUtilConverter *Int32_To_Int16; */ + Int32_To_Int16_Dither, /* PaUtilConverter *Int32_To_Int16_Dither; */ + Int32_To_Int8, /* PaUtilConverter *Int32_To_Int8; */ + Int32_To_Int8_Dither, /* PaUtilConverter *Int32_To_Int8_Dither; */ + Int32_To_UInt8, /* PaUtilConverter *Int32_To_UInt8; */ + Int32_To_UInt8_Dither, /* PaUtilConverter *Int32_To_UInt8_Dither; */ + + Int24_To_Float32, /* PaUtilConverter *Int24_To_Float32; */ + Int24_To_Int32, /* PaUtilConverter *Int24_To_Int32; */ + Int24_To_Int16, /* PaUtilConverter *Int24_To_Int16; */ + Int24_To_Int16_Dither, /* PaUtilConverter *Int24_To_Int16_Dither; */ + Int24_To_Int8, /* PaUtilConverter *Int24_To_Int8; */ + Int24_To_Int8_Dither, /* PaUtilConverter *Int24_To_Int8_Dither; */ + Int24_To_UInt8, /* PaUtilConverter *Int24_To_UInt8; */ + Int24_To_UInt8_Dither, /* PaUtilConverter *Int24_To_UInt8_Dither; */ + + Int16_To_Float32, /* PaUtilConverter *Int16_To_Float32; */ + Int16_To_Int32, /* PaUtilConverter *Int16_To_Int32; */ + Int16_To_Int24, /* PaUtilConverter *Int16_To_Int24; */ + Int16_To_Int8, /* PaUtilConverter *Int16_To_Int8; */ + Int16_To_Int8_Dither, /* PaUtilConverter *Int16_To_Int8_Dither; */ + Int16_To_UInt8, /* PaUtilConverter *Int16_To_UInt8; */ + Int16_To_UInt8_Dither, /* PaUtilConverter *Int16_To_UInt8_Dither; */ + + Int8_To_Float32, /* PaUtilConverter *Int8_To_Float32; */ + Int8_To_Int32, /* PaUtilConverter *Int8_To_Int32; */ + Int8_To_Int24, /* PaUtilConverter *Int8_To_Int24 */ + Int8_To_Int16, /* PaUtilConverter *Int8_To_Int16; */ + Int8_To_UInt8, /* PaUtilConverter *Int8_To_UInt8; */ + + UInt8_To_Float32, /* PaUtilConverter *UInt8_To_Float32; */ + UInt8_To_Int32, /* PaUtilConverter *UInt8_To_Int32; */ + UInt8_To_Int24, /* PaUtilConverter *UInt8_To_Int24; */ + UInt8_To_Int16, /* PaUtilConverter *UInt8_To_Int16; */ + UInt8_To_Int8, /* PaUtilConverter *UInt8_To_Int8; */ + + Copy_8_To_8, /* PaUtilConverter *Copy_8_To_8; */ + Copy_16_To_16, /* PaUtilConverter *Copy_16_To_16; */ + Copy_24_To_24, /* PaUtilConverter *Copy_24_To_24; */ + Copy_32_To_32 /* PaUtilConverter *Copy_32_To_32; */ +}; + +/* -------------------------------------------------------------------------- */ + +#endif /* PA_NO_STANDARD_CONVERTERS */ + +/* -------------------------------------------------------------------------- */ + +PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat ) +{ + switch( destinationFormat & ~paNonInterleaved ){ + case paFloat32: + return paZeroers.Zero32; + case paInt32: + return paZeroers.Zero32; + case paInt24: + return paZeroers.Zero24; + case paInt16: + return paZeroers.Zero16; + case paInt8: + return paZeroers.Zero8; + case paUInt8: + return paZeroers.ZeroU8; + default: return 0; + } +} + +/* -------------------------------------------------------------------------- */ + +#ifdef PA_NO_STANDARD_ZEROERS + +/* -------------------------------------------------------------------------- */ + +PaUtilZeroerTable paZeroers = { + 0, /* PaUtilZeroer *ZeroU8; */ + 0, /* PaUtilZeroer *Zero8; */ + 0, /* PaUtilZeroer *Zero16; */ + 0, /* PaUtilZeroer *Zero24; */ + 0, /* PaUtilZeroer *Zero32; */ +}; + +/* -------------------------------------------------------------------------- */ + +#else /* PA_NO_STANDARD_ZEROERS is not defined */ + +/* -------------------------------------------------------------------------- */ + +static void ZeroU8( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + unsigned char *dest = (unsigned char*)destinationBuffer; + + while( count-- ) + { + *dest = 128; + + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Zero8( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + unsigned char *dest = (unsigned char*)destinationBuffer; + + while( count-- ) + { + *dest = 0; + + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Zero16( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + PaUint16 *dest = (PaUint16 *)destinationBuffer; + + while( count-- ) + { + *dest = 0; + + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Zero24( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + unsigned char *dest = (unsigned char*)destinationBuffer; + + while( count-- ) + { + dest[0] = 0; + dest[1] = 0; + dest[2] = 0; + + dest += destinationStride * 3; + } +} + +/* -------------------------------------------------------------------------- */ + +static void Zero32( void *destinationBuffer, signed int destinationStride, + unsigned int count ) +{ + PaUint32 *dest = (PaUint32 *)destinationBuffer; + + while( count-- ) + { + *dest = 0; + + dest += destinationStride; + } +} + +/* -------------------------------------------------------------------------- */ + +PaUtilZeroerTable paZeroers = { + ZeroU8, /* PaUtilZeroer *ZeroU8; */ + Zero8, /* PaUtilZeroer *Zero8; */ + Zero16, /* PaUtilZeroer *Zero16; */ + Zero24, /* PaUtilZeroer *Zero24; */ + Zero32, /* PaUtilZeroer *Zero32; */ +}; + +/* -------------------------------------------------------------------------- */ + +#endif /* PA_NO_STANDARD_ZEROERS */ diff --git a/portaudio-v19/src/common/pa_converters.h b/portaudio-v19/src/common/pa_converters.h new file mode 100644 index 000000000..1d83c990b --- /dev/null +++ b/portaudio-v19/src/common/pa_converters.h @@ -0,0 +1,254 @@ +#ifndef PA_CONVERTERS_H +#define PA_CONVERTERS_H +/* + * $Id$ + * Portable Audio I/O Library sample conversion mechanism + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Conversion functions used to convert buffers of samples from one + format to another. +*/ + + +#include "portaudio.h" /* for PaSampleFormat */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +struct PaUtilTriangularDitherGenerator; + + +/** Choose an available sample format which is most appropriate for + representing the requested format. If the requested format is not available + higher quality formats are considered before lower quality formates. + @param availableFormats A variable containing the logical OR of all available + formats. + @param format The desired format. + @return The most appropriate available format for representing the requested + format. +*/ +PaSampleFormat PaUtil_SelectClosestAvailableFormat( + PaSampleFormat availableFormats, PaSampleFormat format ); + + +/* high level conversions functions for use by implementations */ + + +/** The generic sample converter prototype. Sample converters convert count + samples from sourceBuffer to destinationBuffer. The actual type of the data + pointed to by these parameters varys for different converter functions. + @param destinationBuffer A pointer to the first sample of the destination. + @param destinationStride An offset between successive destination samples + expressed in samples (not bytes.) It may be negative. + @param sourceBuffer A pointer to the first sample of the source. + @param sourceStride An offset between successive source samples + expressed in samples (not bytes.) It may be negative. + @param count The number of samples to convert. + @param ditherState State information used to calculate dither. Converters + that do not perform dithering will ignore this parameter, in which case + NULL or invalid dither state may be passed. +*/ +typedef void PaUtilConverter( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ); + + +/** Find a sample converter function for the given source and destinations + formats and flags (clip and dither.) + @return + A pointer to a PaUtilConverter which will perform the requested + conversion, or NULL if the given format conversion is not supported. + For conversions where clipping or dithering is not necessary, the + clip and dither flags are ignored and a non-clipping or dithering + version is returned. + If the source and destination formats are the same, a function which + copies data of the appropriate size will be returned. +*/ +PaUtilConverter* PaUtil_SelectConverter( PaSampleFormat sourceFormat, + PaSampleFormat destinationFormat, PaStreamFlags flags ); + + +/** The generic buffer zeroer prototype. Buffer zeroers copy count zeros to + destinationBuffer. The actual type of the data pointed to varys for + different zeroer functions. + @param destinationBuffer A pointer to the first sample of the destination. + @param destinationStride An offset between successive destination samples + expressed in samples (not bytes.) It may be negative. + @param count The number of samples to zero. +*/ +typedef void PaUtilZeroer( + void *destinationBuffer, signed int destinationStride, unsigned int count ); + + +/** Find a buffer zeroer function for the given destination format. + @return + A pointer to a PaUtilZeroer which will perform the requested + zeroing. +*/ +PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat ); + +/*----------------------------------------------------------------------------*/ +/* low level functions and data structures which may be used for + substituting conversion functions */ + + +/** The type used to store all sample conversion functions. + @see paConverters; +*/ +typedef struct{ + PaUtilConverter *Float32_To_Int32; + PaUtilConverter *Float32_To_Int32_Dither; + PaUtilConverter *Float32_To_Int32_Clip; + PaUtilConverter *Float32_To_Int32_DitherClip; + + PaUtilConverter *Float32_To_Int24; + PaUtilConverter *Float32_To_Int24_Dither; + PaUtilConverter *Float32_To_Int24_Clip; + PaUtilConverter *Float32_To_Int24_DitherClip; + + PaUtilConverter *Float32_To_Int16; + PaUtilConverter *Float32_To_Int16_Dither; + PaUtilConverter *Float32_To_Int16_Clip; + PaUtilConverter *Float32_To_Int16_DitherClip; + + PaUtilConverter *Float32_To_Int8; + PaUtilConverter *Float32_To_Int8_Dither; + PaUtilConverter *Float32_To_Int8_Clip; + PaUtilConverter *Float32_To_Int8_DitherClip; + + PaUtilConverter *Float32_To_UInt8; + PaUtilConverter *Float32_To_UInt8_Dither; + PaUtilConverter *Float32_To_UInt8_Clip; + PaUtilConverter *Float32_To_UInt8_DitherClip; + + PaUtilConverter *Int32_To_Float32; + PaUtilConverter *Int32_To_Int24; + PaUtilConverter *Int32_To_Int24_Dither; + PaUtilConverter *Int32_To_Int16; + PaUtilConverter *Int32_To_Int16_Dither; + PaUtilConverter *Int32_To_Int8; + PaUtilConverter *Int32_To_Int8_Dither; + PaUtilConverter *Int32_To_UInt8; + PaUtilConverter *Int32_To_UInt8_Dither; + + PaUtilConverter *Int24_To_Float32; + PaUtilConverter *Int24_To_Int32; + PaUtilConverter *Int24_To_Int16; + PaUtilConverter *Int24_To_Int16_Dither; + PaUtilConverter *Int24_To_Int8; + PaUtilConverter *Int24_To_Int8_Dither; + PaUtilConverter *Int24_To_UInt8; + PaUtilConverter *Int24_To_UInt8_Dither; + + PaUtilConverter *Int16_To_Float32; + PaUtilConverter *Int16_To_Int32; + PaUtilConverter *Int16_To_Int24; + PaUtilConverter *Int16_To_Int8; + PaUtilConverter *Int16_To_Int8_Dither; + PaUtilConverter *Int16_To_UInt8; + PaUtilConverter *Int16_To_UInt8_Dither; + + PaUtilConverter *Int8_To_Float32; + PaUtilConverter *Int8_To_Int32; + PaUtilConverter *Int8_To_Int24; + PaUtilConverter *Int8_To_Int16; + PaUtilConverter *Int8_To_UInt8; + + PaUtilConverter *UInt8_To_Float32; + PaUtilConverter *UInt8_To_Int32; + PaUtilConverter *UInt8_To_Int24; + PaUtilConverter *UInt8_To_Int16; + PaUtilConverter *UInt8_To_Int8; + + PaUtilConverter *Copy_8_To_8; /* copy without any conversion */ + PaUtilConverter *Copy_16_To_16; /* copy without any conversion */ + PaUtilConverter *Copy_24_To_24; /* copy without any conversion */ + PaUtilConverter *Copy_32_To_32; /* copy without any conversion */ +} PaUtilConverterTable; + + +/** A table of pointers to all required converter functions. + PaUtil_SelectConverter() uses this table to lookup the appropriate + conversion functions. The fields of this structure are initialized + with default conversion functions. Fields may be NULL, indicating that + no conversion function is available. User code may substitue optimised + conversion functions by assigning different function pointers to + these fields. + + @note + If the PA_NO_STANDARD_CONVERTERS preprocessor variable is defined, + PortAudio's standard converters will not be compiled, and all fields + of this structure will be initialized to NULL. In such cases, users + should supply their own conversion functions if the require PortAudio + to open a stream that requires sample conversion. + + @see PaUtilConverterTable, PaUtilConverter, PaUtil_SelectConverter +*/ +extern PaUtilConverterTable paConverters; + + +/** The type used to store all buffer zeroing functions. + @see paZeroers; +*/ +typedef struct{ + PaUtilZeroer *ZeroU8; /* unsigned 8 bit, zero == 128 */ + PaUtilZeroer *Zero8; + PaUtilZeroer *Zero16; + PaUtilZeroer *Zero24; + PaUtilZeroer *Zero32; +} PaUtilZeroerTable; + + +/** A table of pointers to all required zeroer functions. + PaUtil_SelectZeroer() uses this table to lookup the appropriate + conversion functions. The fields of this structure are initialized + with default conversion functions. User code may substitue optimised + conversion functions by assigning different function pointers to + these fields. + + @note + If the PA_NO_STANDARD_ZEROERS preprocessor variable is defined, + PortAudio's standard zeroers will not be compiled, and all fields + of this structure will be initialized to NULL. In such cases, users + should supply their own zeroing functions for the sample sizes which + they intend to use. + + @see PaUtilZeroerTable, PaUtilZeroer, PaUtil_SelectZeroer +*/ +extern PaUtilZeroerTable paZeroers; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_CONVERTERS_H */ diff --git a/portaudio-v19/src/common/pa_cpuload.c b/portaudio-v19/src/common/pa_cpuload.c new file mode 100644 index 000000000..ee2147dc3 --- /dev/null +++ b/portaudio-v19/src/common/pa_cpuload.c @@ -0,0 +1,96 @@ +/* + * $Id$ + * Portable Audio I/O Library CPU Load measurement functions + * Portable CPU load measurement facility. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 2002 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Functions to assist in measuring the CPU utilization of a callback + stream. Used to implement the Pa_GetStreamCpuLoad() function. + + @todo Dynamically calculate the coefficients used to smooth the CPU Load + Measurements over time to provide a uniform characterisation of CPU Load + independent of rate at which PaUtil_BeginCpuLoadMeasurement / + PaUtil_EndCpuLoadMeasurement are called. +*/ + + +#include "pa_cpuload.h" + +#include + +#include "pa_util.h" /* for PaUtil_GetTime() */ + + +void PaUtil_InitializeCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer, double sampleRate ) +{ + assert( sampleRate > 0 ); + + measurer->samplingPeriod = 1. / sampleRate; + measurer->averageLoad = 0.; +} + +void PaUtil_ResetCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer ) +{ + measurer->averageLoad = 0.; +} + +void PaUtil_BeginCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer ) +{ + measurer->measurementStartTime = PaUtil_GetTime(); +} + + +void PaUtil_EndCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer, unsigned long framesProcessed ) +{ + double measurementEndTime, secondsFor100Percent, measuredLoad; + + if( framesProcessed > 0 ){ + measurementEndTime = PaUtil_GetTime(); + + assert( framesProcessed > 0 ); + secondsFor100Percent = framesProcessed * measurer->samplingPeriod; + + measuredLoad = (measurementEndTime - measurer->measurementStartTime) / secondsFor100Percent; + + /* Low pass filter the calculated CPU load to reduce jitter using a simple IIR low pass filter. */ + /** FIXME @todo these coefficients shouldn't be hardwired */ +#define LOWPASS_COEFFICIENT_0 (0.9) +#define LOWPASS_COEFFICIENT_1 (0.99999 - LOWPASS_COEFFICIENT_0) + + measurer->averageLoad = (LOWPASS_COEFFICIENT_0 * measurer->averageLoad) + + (LOWPASS_COEFFICIENT_1 * measuredLoad); + } +} + + +double PaUtil_GetCpuLoad( PaUtilCpuLoadMeasurer* measurer ) +{ + return measurer->averageLoad; +} diff --git a/portaudio-v19/src/common/pa_cpuload.h b/portaudio-v19/src/common/pa_cpuload.h new file mode 100644 index 000000000..131ad10bd --- /dev/null +++ b/portaudio-v19/src/common/pa_cpuload.h @@ -0,0 +1,63 @@ +#ifndef PA_CPULOAD_H +#define PA_CPULOAD_H +/* + * $Id$ + * Portable Audio I/O Library CPU Load measurement functions + * Portable CPU load measurement facility. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 2002 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Functions to assist in measuring the CPU utilization of a callback + stream. Used to implement the Pa_GetStreamCpuLoad() function. +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +typedef struct { + double samplingPeriod; + double measurementStartTime; + double averageLoad; +} PaUtilCpuLoadMeasurer; /**< @todo need better name than measurer */ + +void PaUtil_InitializeCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer, double sampleRate ); +void PaUtil_BeginCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer ); +void PaUtil_EndCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer, unsigned long framesProcessed ); +void PaUtil_ResetCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer ); +double PaUtil_GetCpuLoad( PaUtilCpuLoadMeasurer* measurer ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_CPULOAD_H */ diff --git a/portaudio-v19/src/common/pa_dither.c b/portaudio-v19/src/common/pa_dither.c new file mode 100644 index 000000000..d44a060cd --- /dev/null +++ b/portaudio-v19/src/common/pa_dither.c @@ -0,0 +1,204 @@ +/* + * $Id$ + * Portable Audio I/O Library triangular dither generator + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Functions for generating dither noise +*/ + + +#include "pa_dither.h" +#include "pa_types.h" + +#define PA_DITHER_BITS_ (15) + + +void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *state ) +{ + state->previous = 0; + state->randSeed1 = 22222; + state->randSeed2 = 5555555; +} + + +signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *state ) +{ + signed long current, highPass; + + /* Generate two random numbers. */ + state->randSeed1 = (state->randSeed1 * 196314165) + 907633515; + state->randSeed2 = (state->randSeed2 * 196314165) + 907633515; + + /* Generate triangular distribution about 0. + * Shift before adding to prevent overflow which would skew the distribution. + * Also shift an extra bit for the high pass filter. + */ +#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) + current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + + (((signed long)state->randSeed2)>>DITHER_SHIFT_); + + /* High pass filter to reduce audibility. */ + highPass = current - state->previous; + state->previous = current; + return highPass; +} + + +/* Multiply by PA_FLOAT_DITHER_SCALE_ to get a float between -2.0 and +1.99999 */ +#define PA_FLOAT_DITHER_SCALE_ (1.0f / ((1<randSeed1 = (state->randSeed1 * 196314165) + 907633515; + state->randSeed2 = (state->randSeed2 * 196314165) + 907633515; + + /* Generate triangular distribution about 0. + * Shift before adding to prevent overflow which would skew the distribution. + * Also shift an extra bit for the high pass filter. + */ +#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) + current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + + (((signed long)state->randSeed2)>>DITHER_SHIFT_); + + /* High pass filter to reduce audibility. */ + highPass = current - state->previous; + state->previous = current; + return ((float)highPass) * const_float_dither_scale_; +} + + +/* +The following alternate dither algorithms (from musicdsp.org) could be +considered +*/ + +/*Noise shaped dither (March 2000) +------------------- + +This is a simple implementation of highpass triangular-PDF dither with +2nd-order noise shaping, for use when truncating floating point audio +data to fixed point. + +The noise shaping lowers the noise floor by 11dB below 5kHz (@ 44100Hz +sample rate) compared to triangular-PDF dither. The code below assumes +input data is in the range +1 to -1 and doesn't check for overloads! + +To save time when generating dither for multiple channels you can do +things like this: r3=(r1 & 0x7F)<<8; instead of calling rand() again. + + + + int r1, r2; //rectangular-PDF random numbers + float s1, s2; //error feedback buffers + float s = 0.5f; //set to 0.0f for no noise shaping + float w = pow(2.0,bits-1); //word length (usually bits=16) + float wi= 1.0f/w; + float d = wi / RAND_MAX; //dither amplitude (2 lsb) + float o = wi * 0.5f; //remove dc offset + float in, tmp; + int out; + + +//for each sample... + + r2=r1; //can make HP-TRI dither by + r1=rand(); //subtracting previous rand() + + in += s * (s1 + s1 - s2); //error feedback + tmp = in + o + d * (float)(r1 - r2); //dc offset and dither + + out = (int)(w * tmp); //truncate downwards + if(tmp<0.0f) out--; //this is faster than floor() + + s2 = s1; + s1 = in - wi * (float)out; //error + + + +-- +paul.kellett@maxim.abel.co.uk +http://www.maxim.abel.co.uk +*/ + + +/* +16-to-8-bit first-order dither + +Type : First order error feedforward dithering code +References : Posted by Jon Watte + +Notes : +This is about as simple a dithering algorithm as you can implement, but it's +likely to sound better than just truncating to N bits. + +Note that you might not want to carry forward the full difference for infinity. +It's probably likely that the worst performance hit comes from the saturation +conditionals, which can be avoided with appropriate instructions on many DSPs +and integer SIMD type instructions, or CMOV. + +Last, if sound quality is paramount (such as when going from > 16 bits to 16 +bits) you probably want to use a higher-order dither function found elsewhere +on this site. + + +Code : +// This code will down-convert and dither a 16-bit signed short +// mono signal into an 8-bit unsigned char signal, using a first +// order forward-feeding error term dither. + +#define uchar unsigned char + +void dither_one_channel_16_to_8( short * input, uchar * output, int count, int * memory ) +{ + int m = *memory; + while( count-- > 0 ) { + int i = *input++; + i += m; + int j = i + 32768 - 128; + uchar o; + if( j < 0 ) { + o = 0; + } + else if( j > 65535 ) { + o = 255; + } + else { + o = (uchar)((j>>8)&0xff); + } + m = ((j-32768+128)-i); + *output++ = o; + } + *memory = m; +} +*/ diff --git a/portaudio-v19/src/common/pa_dither.h b/portaudio-v19/src/common/pa_dither.h new file mode 100644 index 000000000..148db275f --- /dev/null +++ b/portaudio-v19/src/common/pa_dither.h @@ -0,0 +1,91 @@ +#ifndef PA_DITHER_H +#define PA_DITHER_H +/* + * $Id$ + * Portable Audio I/O Library triangular dither generator + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Functions for generating dither noise +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** @brief State needed to generate a dither signal */ +typedef struct PaUtilTriangularDitherGenerator{ + unsigned long previous; + unsigned long randSeed1; + unsigned long randSeed2; +} PaUtilTriangularDitherGenerator; + + +/** @brief Initialize dither state */ +void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *ditherState ); + + +/** + @brief Calculate 2 LSB dither signal with a triangular distribution. + Ranged for adding to a 1 bit right-shifted 32 bit integer + prior to >>15. eg: +
    +    signed long in = *
    +    signed long dither = PaUtil_Generate16BitTriangularDither( ditherState );
    +    signed short out = (signed short)(((in>>1) + dither) >> 15);
    +
    + @return + A signed long with a range of +32767 to -32768 +*/ +signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); + + +/** + @brief Calculate 2 LSB dither signal with a triangular distribution. + Ranged for adding to a pre-scaled float. +
    +    float in = *
    +    float dither = PaUtil_GenerateFloatTriangularDither( ditherState );
    +    // use smaller scaler to prevent overflow when we add the dither
    +    signed short out = (signed short)(in*(32766.0f) + dither );
    +
    + @return + A float with a range of -2.0 to +1.99999. +*/ +float PaUtil_GenerateFloatTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_DITHER_H */ diff --git a/portaudio-v19/src/common/pa_endianness.h b/portaudio-v19/src/common/pa_endianness.h new file mode 100644 index 000000000..a49be969d --- /dev/null +++ b/portaudio-v19/src/common/pa_endianness.h @@ -0,0 +1,130 @@ +#ifndef PA_ENDIANNESS_H +#define PA_ENDIANNESS_H +/* + * $Id$ + * Portable Audio I/O Library current platform endianness macros + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Configure endianness symbols for the target processor. + + Arrange for either the PA_LITTLE_ENDIAN or PA_BIG_ENDIAN preprocessor symbols + to be defined. The one that is defined reflects the endianness of the target + platform and may be used to implement conditional compilation of byte-order + dependent code. + + If either PA_LITTLE_ENDIAN or PA_BIG_ENDIAN is defined already, then no attempt + is made to override that setting. This may be useful if you have a better way + of determining the platform's endianness. The autoconf mechanism uses this for + example. + + A PA_VALIDATE_ENDIANNESS macro is provided to compare the compile time + and runtime endiannes and raise an assertion if they don't match. +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/* If this is an apple, we need to do detect endianness this way */ +#if defined(__APPLE__) + /* we need to do some endian detection that is sensitive to harware arch */ + #if defined(__LITTLE_ENDIAN__) + #if !defined( PA_LITTLE_ENDIAN ) + #define PA_LITTLE_ENDIAN + #endif + #if defined( PA_BIG_ENDIAN ) + #undef PA_BIG_ENDIAN + #endif + #else + #if !defined( PA_BIG_ENDIAN ) + #define PA_BIG_ENDIAN + #endif + #if defined( PA_LITTLE_ENDIAN ) + #undef PA_LITTLE_ENDIAN + #endif + #endif +#else + /* this is not an apple, so first check the existing defines, and, failing that, + detect well-known architechtures. */ + + #if defined(PA_LITTLE_ENDIAN) || defined(PA_BIG_ENDIAN) + /* endianness define has been set externally, such as by autoconf */ + + #if defined(PA_LITTLE_ENDIAN) && defined(PA_BIG_ENDIAN) + #error both PA_LITTLE_ENDIAN and PA_BIG_ENDIAN have been defined externally to pa_endianness.h - only one endianness at a time please + #endif + + #endif + /* endianness define has not been set externally */ + + /* set PA_LITTLE_ENDIAN or PA_BIG_ENDIAN by testing well known platform specific defines */ + + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(LITTLE_ENDIAN) || defined(__i386) || defined(_M_IX86) + #define PA_LITTLE_ENDIAN /* win32, assume intel byte order */ + #else + #define PA_BIG_ENDIAN + #endif + + #if !defined(PA_LITTLE_ENDIAN) && !defined(PA_BIG_ENDIAN) + /* + If the following error is raised, you either need to modify the code above + to automatically determine the endianness from other symbols defined on your + platform, or define either PA_LITTLE_ENDIAN or PA_BIG_ENDIAN externally. + */ + #error pa_endianness.h was unable to automatically determine the endianness of the target platform + #endif + +#endif + +/* PA_VALIDATE_ENDIANNESS compares the compile time and runtime endianness, + and raises an assertion if they don't match. must be included in + the context in which this macro is used. +*/ +#if defined(PA_LITTLE_ENDIAN) + #define PA_VALIDATE_ENDIANNESS \ + { \ + const long nativeOne = 1; \ + assert( "PortAudio: compile time and runtime endianness don't match" && (((char *)&nativeOne)[0]) == 1 ); \ + } +#elif defined(PA_BIG_ENDIAN) + #define PA_VALIDATE_ENDIANNESS \ + { \ + const long nativeOne = 1; \ + assert( "PortAudio: compile time and runtime endianness don't match" && (((char *)&nativeOne)[0]) == 0 ); \ + } +#endif + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_ENDIANNESS_H */ diff --git a/portaudio-v19/src/common/pa_front.c b/portaudio-v19/src/common/pa_front.c new file mode 100644 index 000000000..e80b207ba --- /dev/null +++ b/portaudio-v19/src/common/pa_front.c @@ -0,0 +1,1981 @@ +/* + * $Id$ + * Portable Audio I/O Library Multi-Host API front end + * Validate function parameters and manage multiple host APIs. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/* doxygen index page */ +/** @mainpage + +PortAudio is an open-source cross-platform ‘C’ library for audio input +and output. It is designed to simplify the porting of audio applications +between various platforms, and also to simplify the development of audio +software in general by hiding the complexities of device interfacing. + +See the PortAudio website for further information http://www.portaudio.com/ + +This documentation pertains to PortAudio V19, API version 2.0 which is +currently under development. API version 2.0 differs in a number of ways from +previous versions, please consult the enhancement proposals for further details: +http://www.portaudio.com/docs/proposals/index.html + +This documentation is under construction. Things you might be interested in +include: + +- The PortAudio API 2.0, as documented in portaudio.h + +- The TODO List + +Feel free to pick an item off TODO list and fix/implement it. You may want to +enquire about status on the PortAudio mailing list first. +*/ + + +/** @file + @brief Implements public PortAudio API, checks some errors, forwards to + host API implementations. + + Implements the functions defined in the PortAudio API, checks for + some parameter and state inconsistencies and forwards API requests to + specific Host API implementations (via the interface declared in + pa_hostapi.h), and Streams (via the interface declared in pa_stream.h). + + This file handles initialization and termination of Host API + implementations via initializers stored in the paHostApiInitializers + global variable. + + Some utility functions declared in pa_util.h are implemented in this file. + + All PortAudio API functions can be conditionally compiled with logging code. + To compile with logging, define the PA_LOG_API_CALLS precompiler symbol. + + @todo Consider adding host API specific error text in Pa_GetErrorText() for + paUnanticipatedHostError + + @todo Consider adding a new error code for when (inputParameters == NULL) + && (outputParameters == NULL) + + @todo review whether Pa_CloseStream() should call the interface's + CloseStream function if aborting the stream returns an error code. + + @todo Create new error codes if a NULL buffer pointer, or a + zero frame count is passed to Pa_ReadStream or Pa_WriteStream. +*/ + + +#include +#include +#include +#include +#include /* needed by PA_VALIDATE_ENDIANNESS */ + +#include "portaudio.h" +#include "pa_util.h" +#include "pa_endianness.h" +#include "pa_types.h" +#include "pa_hostapi.h" +#include "pa_stream.h" + +#include "pa_trace.h" + + +#define PA_VERSION_ 1899 +#define PA_VERSION_TEXT_ "PortAudio V19-devel" + + + +/* #define PA_LOG_API_CALLS */ + +/* + The basic format for log messages is described below. If you need to + add any log messages, please follow this format. + + Function entry (void function): + + "FunctionName called.\n" + + Function entry (non void function): + + "FunctionName called:\n" + "\tParam1Type param1: param1Value\n" + "\tParam2Type param2: param2Value\n" (etc...) + + + Function exit (no return value): + + "FunctionName returned.\n" + + Function exit (simple return value): + + "FunctionName returned:\n" + "\tReturnType: returnValue\n\n" + + If the return type is an error code, the error text is displayed in () + + If the return type is not an error code, but has taken a special value + because an error occurred, then the reason for the error is shown in [] + + If the return type is a struct ptr, the struct is dumped. + + See the code below for examples +*/ + + +int Pa_GetVersion( void ) +{ + return PA_VERSION_; +} + + +const char* Pa_GetVersionText( void ) +{ + return PA_VERSION_TEXT_; +} + + + +#define PA_LAST_HOST_ERROR_TEXT_LENGTH_ 1024 + +static char lastHostErrorText_[ PA_LAST_HOST_ERROR_TEXT_LENGTH_ + 1 ] = {0}; + +static PaHostErrorInfo lastHostErrorInfo_ = { (PaHostApiTypeId)-1, 0, lastHostErrorText_ }; + + +void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode, + const char *errorText ) +{ + lastHostErrorInfo_.hostApiType = hostApiType; + lastHostErrorInfo_.errorCode = errorCode; + + strncpy( lastHostErrorText_, errorText, PA_LAST_HOST_ERROR_TEXT_LENGTH_ ); +} + + +void PaUtil_DebugPrint( const char *format, ... ) +{ + va_list ap; + + va_start( ap, format ); + vfprintf( stderr, format, ap ); + va_end( ap ); + + fflush( stderr ); +} + + +static PaUtilHostApiRepresentation **hostApis_ = 0; +static int hostApisCount_ = 0; +static int initializationCount_ = 0; +static int deviceCount_ = 0; + +PaUtilStreamRepresentation *firstOpenStream_ = NULL; + + +#define PA_IS_INITIALISED_ (initializationCount_ != 0) + + +static int CountHostApiInitializers( void ) +{ + int result = 0; + + while( paHostApiInitializers[ result ] != 0 ) + ++result; + return result; +} + + +static void TerminateHostApis( void ) +{ + /* terminate in reverse order from initialization */ + + while( hostApisCount_ > 0 ) + { + --hostApisCount_; + hostApis_[hostApisCount_]->Terminate( hostApis_[hostApisCount_] ); + } + hostApisCount_ = 0; + deviceCount_ = 0; + + if( hostApis_ != 0 ) + PaUtil_FreeMemory( hostApis_ ); + hostApis_ = 0; +} + + +static PaError InitializeHostApis( void ) +{ + PaError result = paNoError; + int i, initializerCount, baseDeviceIndex; + + initializerCount = CountHostApiInitializers(); + + hostApis_ = (PaUtilHostApiRepresentation**)PaUtil_AllocateMemory( + sizeof(PaUtilHostApiRepresentation*) * initializerCount ); + if( !hostApis_ ) + { + result = paInsufficientMemory; + goto error; + } + + hostApisCount_ = 0; + deviceCount_ = 0; + baseDeviceIndex = 0; + + for( i=0; i< initializerCount; ++i ) + { + hostApis_[hostApisCount_] = NULL; + result = paHostApiInitializers[i]( &hostApis_[hostApisCount_], hostApisCount_ ); + if( result != paNoError ) + goto error; + + if( hostApis_[hostApisCount_] ) + { + PaUtilHostApiRepresentation* hostApi = hostApis_[hostApisCount_]; + assert( hostApi->info.defaultInputDevice < hostApi->info.deviceCount ); + assert( hostApi->info.defaultOutputDevice < hostApi->info.deviceCount ); + + hostApis_[hostApisCount_]->privatePaFrontInfo.baseDeviceIndex = baseDeviceIndex; + + if( hostApis_[hostApisCount_]->info.defaultInputDevice != paNoDevice ) + hostApis_[hostApisCount_]->info.defaultInputDevice += baseDeviceIndex; + + if( hostApis_[hostApisCount_]->info.defaultOutputDevice != paNoDevice ) + hostApis_[hostApisCount_]->info.defaultOutputDevice += baseDeviceIndex; + + baseDeviceIndex += hostApis_[hostApisCount_]->info.deviceCount; + deviceCount_ += hostApis_[hostApisCount_]->info.deviceCount; + + ++hostApisCount_; + } + } + + return result; + +error: + TerminateHostApis(); + return result; +} + + +/* + FindHostApi() finds the index of the host api to which + belongs and returns it. if is + non-null, the host specific device index is returned in it. + returns -1 if is out of range. + +*/ +static int FindHostApi( PaDeviceIndex device, int *hostSpecificDeviceIndex ) +{ + int i=0; + + if( !PA_IS_INITIALISED_ ) + return -1; + + if( device < 0 ) + return -1; + + while( i < hostApisCount_ + && device >= hostApis_[i]->info.deviceCount ) + { + + device -= hostApis_[i]->info.deviceCount; + ++i; + } + + if( i >= hostApisCount_ ) + return -1; + + if( hostSpecificDeviceIndex ) + *hostSpecificDeviceIndex = device; + + return i; +} + + +static void AddOpenStream( PaStream* stream ) +{ + ((PaUtilStreamRepresentation*)stream)->nextOpenStream = firstOpenStream_; + firstOpenStream_ = (PaUtilStreamRepresentation*)stream; +} + + +static void RemoveOpenStream( PaStream* stream ) +{ + PaUtilStreamRepresentation *previous = NULL; + PaUtilStreamRepresentation *current = firstOpenStream_; + + while( current != NULL ) + { + if( ((PaStream*)current) == stream ) + { + if( previous == NULL ) + { + firstOpenStream_ = current->nextOpenStream; + } + else + { + previous->nextOpenStream = current->nextOpenStream; + } + return; + } + else + { + previous = current; + current = current->nextOpenStream; + } + } +} + + +static void CloseOpenStreams( void ) +{ + /* we call Pa_CloseStream() here to ensure that the same destruction + logic is used for automatically closed streams */ + + while( firstOpenStream_ != NULL ) + Pa_CloseStream( firstOpenStream_ ); +} + + +PaError Pa_Initialize( void ) +{ + PaError result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint( "Pa_Initialize called.\n" ); +#endif + + if( PA_IS_INITIALISED_ ) + { + ++initializationCount_; + result = paNoError; + } + else + { + PA_VALIDATE_TYPE_SIZES; + PA_VALIDATE_ENDIANNESS; + + PaUtil_InitializeClock(); + PaUtil_ResetTraceMessages(); + + result = InitializeHostApis(); + if( result == paNoError ) + ++initializationCount_; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint( "Pa_Initialize returned:\n" ); + PaUtil_DebugPrint( "\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_Terminate( void ) +{ + PaError result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_Terminate called.\n" ); +#endif + + if( PA_IS_INITIALISED_ ) + { + if( --initializationCount_ == 0 ) + { + CloseOpenStreams(); + + TerminateHostApis(); + + PaUtil_DumpTraceMessages(); + } + result = paNoError; + } + else + { + result= paNotInitialized; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_Terminate returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ) +{ + return &lastHostErrorInfo_; +} + + +const char *Pa_GetErrorText( PaError errorCode ) +{ + const char *result; + + switch( errorCode ) + { + case paNoError: result = "Success"; break; + case paNotInitialized: result = "PortAudio not initialized"; break; + /** @todo could catenate the last host error text to result in the case of paUnanticipatedHostError */ + case paUnanticipatedHostError: result = "Unanticipated host error"; break; + case paInvalidChannelCount: result = "Invalid number of channels"; break; + case paInvalidSampleRate: result = "Invalid sample rate"; break; + case paInvalidDevice: result = "Invalid device"; break; + case paInvalidFlag: result = "Invalid flag"; break; + case paSampleFormatNotSupported: result = "Sample format not supported"; break; + case paBadIODeviceCombination: result = "Illegal combination of I/O devices"; break; + case paInsufficientMemory: result = "Insufficient memory"; break; + case paBufferTooBig: result = "Buffer too big"; break; + case paBufferTooSmall: result = "Buffer too small"; break; + case paNullCallback: result = "No callback routine specified"; break; + case paBadStreamPtr: result = "Invalid stream pointer"; break; + case paTimedOut: result = "Wait timed out"; break; + case paInternalError: result = "Internal PortAudio error"; break; + case paDeviceUnavailable: result = "Device unavailable"; break; + case paIncompatibleHostApiSpecificStreamInfo: result = "Incompatible host API specific stream info"; break; + case paStreamIsStopped: result = "Stream is stopped"; break; + case paStreamIsNotStopped: result = "Stream is not stopped"; break; + case paInputOverflowed: result = "Input overflowed"; break; + case paOutputUnderflowed: result = "Output underflowed"; break; + case paHostApiNotFound: result = "Host API not found"; break; + case paInvalidHostApi: result = "Invalid host API"; break; + case paCanNotReadFromACallbackStream: result = "Can't read from a callback stream"; break; + case paCanNotWriteToACallbackStream: result = "Can't write to a callback stream"; break; + case paCanNotReadFromAnOutputOnlyStream: result = "Can't read from an output only stream"; break; + case paCanNotWriteToAnInputOnlyStream: result = "Can't write to an input only stream"; break; + default: result = "Illegal error number"; break; + } + return result; +} + + +PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ) +{ + PaHostApiIndex result; + int i; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_HostApiTypeIdToHostApiIndex called:\n" ); + PaUtil_DebugPrint("\tPaHostApiTypeId type: %d\n", type ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = paHostApiNotFound; + + for( i=0; i < hostApisCount_; ++i ) + { + if( hostApis_[i]->info.type == type ) + { + result = i; + break; + } + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_HostApiTypeIdToHostApiIndex returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaHostApiIndex: %d\n\n", result ); +#endif + + return result; +} + + +PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **hostApi, + PaHostApiTypeId type ) +{ + PaError result; + int i; + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = paHostApiNotFound; + + for( i=0; i < hostApisCount_; ++i ) + { + if( hostApis_[i]->info.type == type ) + { + *hostApi = hostApis_[i]; + result = paNoError; + break; + } + } + } + + return result; +} + + +PaError PaUtil_DeviceIndexToHostApiDeviceIndex( + PaDeviceIndex *hostApiDevice, PaDeviceIndex device, struct PaUtilHostApiRepresentation *hostApi ) +{ + PaError result; + PaDeviceIndex x; + + x = device - hostApi->privatePaFrontInfo.baseDeviceIndex; + + if( x < 0 || x >= hostApi->info.deviceCount ) + { + result = paInvalidDevice; + } + else + { + *hostApiDevice = x; + result = paNoError; + } + + return result; +} + + +PaHostApiIndex Pa_GetHostApiCount( void ) +{ + int result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiCount called.\n" ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = hostApisCount_; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiCount returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaHostApiIndex %d\n\n", result ); +#endif + + return result; +} + + +PaHostApiIndex Pa_GetDefaultHostApi( void ) +{ + int result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultHostApi called.\n" ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = paDefaultHostApiIndex; + + /* internal consistency check: make sure that the default host api + index is within range */ + + if( result < 0 || result >= hostApisCount_ ) + { + result = paInternalError; + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultHostApi returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaHostApiIndex %d\n\n", result ); +#endif + + return result; +} + + +const PaHostApiInfo* Pa_GetHostApiInfo( PaHostApiIndex hostApi ) +{ + PaHostApiInfo *info; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiInfo called:\n" ); + PaUtil_DebugPrint("\tPaHostApiIndex hostApi: %d\n", hostApi ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + info = NULL; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiInfo returned:\n" ); + PaUtil_DebugPrint("\tPaHostApiInfo*: NULL [ PortAudio not initialized ]\n\n" ); +#endif + + } + else if( hostApi < 0 || hostApi >= hostApisCount_ ) + { + info = NULL; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiInfo returned:\n" ); + PaUtil_DebugPrint("\tPaHostApiInfo*: NULL [ hostApi out of range ]\n\n" ); +#endif + + } + else + { + info = &hostApis_[hostApi]->info; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetHostApiInfo returned:\n" ); + PaUtil_DebugPrint("\tPaHostApiInfo*: 0x%p\n", info ); + PaUtil_DebugPrint("\t{" ); + PaUtil_DebugPrint("\t\tint structVersion: %d\n", info->structVersion ); + PaUtil_DebugPrint("\t\tPaHostApiTypeId type: %d\n", info->type ); + PaUtil_DebugPrint("\t\tconst char *name: %s\n\n", info->name ); + PaUtil_DebugPrint("\t}\n\n" ); +#endif + + } + + return info; +} + + +PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, int hostApiDeviceIndex ) +{ + PaDeviceIndex result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_HostApiDeviceIndexToPaDeviceIndex called:\n" ); + PaUtil_DebugPrint("\tPaHostApiIndex hostApi: %d\n", hostApi ); + PaUtil_DebugPrint("\tint hostApiDeviceIndex: %d\n", hostApiDeviceIndex ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + if( hostApi < 0 || hostApi >= hostApisCount_ ) + { + result = paInvalidHostApi; + } + else + { + if( hostApiDeviceIndex < 0 || + hostApiDeviceIndex >= hostApis_[hostApi]->info.deviceCount ) + { + result = paInvalidDevice; + } + else + { + result = hostApis_[hostApi]->privatePaFrontInfo.baseDeviceIndex + hostApiDeviceIndex; + } + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_HostApiDeviceIndexToPaDeviceIndex returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); +#endif + + return result; +} + + +PaDeviceIndex Pa_GetDeviceCount( void ) +{ + PaDeviceIndex result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceCount called.\n" ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + } + else + { + result = deviceCount_; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceCount returned:\n" ); + if( result < 0 ) + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); + else + PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); +#endif + + return result; +} + + +PaDeviceIndex Pa_GetDefaultInputDevice( void ) +{ + PaHostApiIndex hostApi; + PaDeviceIndex result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultInputDevice called.\n" ); +#endif + + hostApi = Pa_GetDefaultHostApi(); + if( hostApi < 0 ) + { + result = paNoDevice; + } + else + { + result = hostApis_[hostApi]->info.defaultInputDevice; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultInputDevice returned:\n" ); + PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); +#endif + + return result; +} + + +PaDeviceIndex Pa_GetDefaultOutputDevice( void ) +{ + PaHostApiIndex hostApi; + PaDeviceIndex result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultOutputDevice called.\n" ); +#endif + + hostApi = Pa_GetDefaultHostApi(); + if( hostApi < 0 ) + { + result = paNoDevice; + } + else + { + result = hostApis_[hostApi]->info.defaultOutputDevice; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDefaultOutputDevice returned:\n" ); + PaUtil_DebugPrint("\tPaDeviceIndex: %d\n\n", result ); +#endif + + return result; +} + + +const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ) +{ + int hostSpecificDeviceIndex; + int hostApiIndex = FindHostApi( device, &hostSpecificDeviceIndex ); + PaDeviceInfo *result; + + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceInfo called:\n" ); + PaUtil_DebugPrint("\tPaDeviceIndex device: %d\n", device ); +#endif + + if( hostApiIndex < 0 ) + { + result = NULL; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceInfo returned:\n" ); + PaUtil_DebugPrint("\tPaDeviceInfo* NULL [ invalid device index ]\n\n" ); +#endif + + } + else + { + result = hostApis_[hostApiIndex]->deviceInfos[ hostSpecificDeviceIndex ]; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetDeviceInfo returned:\n" ); + PaUtil_DebugPrint("\tPaDeviceInfo*: 0x%p:\n", result ); + PaUtil_DebugPrint("\t{\n" ); + + PaUtil_DebugPrint("\t\tint structVersion: %d\n", result->structVersion ); + PaUtil_DebugPrint("\t\tconst char *name: %s\n", result->name ); + PaUtil_DebugPrint("\t\tPaHostApiIndex hostApi: %d\n", result->hostApi ); + PaUtil_DebugPrint("\t\tint maxInputChannels: %d\n", result->maxInputChannels ); + PaUtil_DebugPrint("\t\tint maxOutputChannels: %d\n", result->maxOutputChannels ); + PaUtil_DebugPrint("\t}\n\n" ); +#endif + + } + + return result; +} + + +/* + SampleFormatIsValid() returns 1 if sampleFormat is a sample format + defined in portaudio.h, or 0 otherwise. +*/ +static int SampleFormatIsValid( PaSampleFormat format ) +{ + switch( format & ~paNonInterleaved ) + { + case paFloat32: return 1; + case paInt16: return 1; + case paInt32: return 1; + case paInt24: return 1; + case paInt8: return 1; + case paUInt8: return 1; + case paCustomFormat: return 1; + default: return 0; + } +} + +/* + NOTE: make sure this validation list is kept syncronised with the one in + pa_hostapi.h + + ValidateOpenStreamParameters() checks that parameters to Pa_OpenStream() + conform to the expected values as described below. This function is + also designed to be used with the proposed Pa_IsFormatSupported() function. + + There are basically two types of validation that could be performed: + Generic conformance validation, and device capability mismatch + validation. This function performs only generic conformance validation. + Validation that would require knowledge of device capabilities is + not performed because of potentially complex relationships between + combinations of parameters - for example, even if the sampleRate + seems ok, it might not be for a duplex stream - we have no way of + checking this in an API-neutral way, so we don't try. + + On success the function returns PaNoError and fills in hostApi, + hostApiInputDeviceID, and hostApiOutputDeviceID fields. On failure + the function returns an error code indicating the first encountered + parameter error. + + + If ValidateOpenStreamParameters() returns paNoError, the following + assertions are guaranteed to be true. + + - at least one of inputParameters & outputParmeters is valid (not NULL) + + - if inputParameters & outputParameters are both valid, that + inputParameters->device & outputParameters->device both use the same host api + + PaDeviceIndex inputParameters->device + - is within range (0 to Pa_GetDeviceCount-1) Or: + - is paUseHostApiSpecificDeviceSpecification and + inputParameters->hostApiSpecificStreamInfo is non-NULL and refers + to a valid host api + + int inputParameters->channelCount + - if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, channelCount is > 0 + - upper bound is NOT validated against device capabilities + + PaSampleFormat inputParameters->sampleFormat + - is one of the sample formats defined in portaudio.h + + void *inputParameters->hostApiSpecificStreamInfo + - if supplied its hostApi field matches the input device's host Api + + PaDeviceIndex outputParmeters->device + - is within range (0 to Pa_GetDeviceCount-1) + + int outputParmeters->channelCount + - if inputDevice is valid, channelCount is > 0 + - upper bound is NOT validated against device capabilities + + PaSampleFormat outputParmeters->sampleFormat + - is one of the sample formats defined in portaudio.h + + void *outputParmeters->hostApiSpecificStreamInfo + - if supplied its hostApi field matches the output device's host Api + + double sampleRate + - is not an 'absurd' rate (less than 1000. or greater than 200000.) + - sampleRate is NOT validated against device capabilities + + PaStreamFlags streamFlags + - unused platform neutral flags are zero + - paNeverDropInput is only used for full-duplex callback streams with + variable buffer size (paFramesPerBufferUnspecified) +*/ +static PaError ValidateOpenStreamParameters( + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + PaUtilHostApiRepresentation **hostApi, + PaDeviceIndex *hostApiInputDevice, + PaDeviceIndex *hostApiOutputDevice ) +{ + int inputHostApiIndex = -1, /* Surpress uninitialised var warnings: compiler does */ + outputHostApiIndex = -1; /* not see that if inputParameters and outputParame- */ + /* ters are both nonzero, these indices are set. */ + + if( (inputParameters == NULL) && (outputParameters == NULL) ) + { + return paInvalidDevice; /** @todo should be a new error code "invalid device parameters" or something */ + } + else + { + if( inputParameters == NULL ) + { + *hostApiInputDevice = paNoDevice; + } + else if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + { + if( inputParameters->hostApiSpecificStreamInfo ) + { + inputHostApiIndex = Pa_HostApiTypeIdToHostApiIndex( + ((PaUtilHostApiSpecificStreamInfoHeader*)inputParameters->hostApiSpecificStreamInfo)->hostApiType ); + + if( inputHostApiIndex != -1 ) + { + *hostApiInputDevice = paUseHostApiSpecificDeviceSpecification; + *hostApi = hostApis_[inputHostApiIndex]; + } + else + { + return paInvalidDevice; + } + } + else + { + return paInvalidDevice; + } + } + else + { + if( inputParameters->device < 0 || inputParameters->device >= deviceCount_ ) + return paInvalidDevice; + + inputHostApiIndex = FindHostApi( inputParameters->device, hostApiInputDevice ); + if( inputHostApiIndex < 0 ) + return paInternalError; + + *hostApi = hostApis_[inputHostApiIndex]; + + if( inputParameters->channelCount <= 0 ) + return paInvalidChannelCount; + + if( !SampleFormatIsValid( inputParameters->sampleFormat ) ) + return paSampleFormatNotSupported; + + if( inputParameters->hostApiSpecificStreamInfo != NULL ) + { + if( ((PaUtilHostApiSpecificStreamInfoHeader*)inputParameters->hostApiSpecificStreamInfo)->hostApiType + != (*hostApi)->info.type ) + return paIncompatibleHostApiSpecificStreamInfo; + } + } + + if( outputParameters == NULL ) + { + *hostApiOutputDevice = paNoDevice; + } + else if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + { + if( outputParameters->hostApiSpecificStreamInfo ) + { + outputHostApiIndex = Pa_HostApiTypeIdToHostApiIndex( + ((PaUtilHostApiSpecificStreamInfoHeader*)outputParameters->hostApiSpecificStreamInfo)->hostApiType ); + + if( outputHostApiIndex != -1 ) + { + *hostApiOutputDevice = paUseHostApiSpecificDeviceSpecification; + *hostApi = hostApis_[outputHostApiIndex]; + } + else + { + return paInvalidDevice; + } + } + else + { + return paInvalidDevice; + } + } + else + { + if( outputParameters->device < 0 || outputParameters->device >= deviceCount_ ) + return paInvalidDevice; + + outputHostApiIndex = FindHostApi( outputParameters->device, hostApiOutputDevice ); + if( outputHostApiIndex < 0 ) + return paInternalError; + + *hostApi = hostApis_[outputHostApiIndex]; + + if( outputParameters->channelCount <= 0 ) + return paInvalidChannelCount; + + if( !SampleFormatIsValid( outputParameters->sampleFormat ) ) + return paSampleFormatNotSupported; + + if( outputParameters->hostApiSpecificStreamInfo != NULL ) + { + if( ((PaUtilHostApiSpecificStreamInfoHeader*)outputParameters->hostApiSpecificStreamInfo)->hostApiType + != (*hostApi)->info.type ) + return paIncompatibleHostApiSpecificStreamInfo; + } + } + + if( (inputParameters != NULL) && (outputParameters != NULL) ) + { + /* ensure that both devices use the same API */ + if( inputHostApiIndex != outputHostApiIndex ) + return paBadIODeviceCombination; + } + } + + + /* Check for absurd sample rates. */ + if( (sampleRate < 1000.0) || (sampleRate > 200000.0) ) + return paInvalidSampleRate; + + if( ((streamFlags & ~paPlatformSpecificFlags) & ~(paClipOff | paDitherOff | paNeverDropInput | paPrimeOutputBuffersUsingStreamCallback ) ) != 0 ) + return paInvalidFlag; + + if( streamFlags & paNeverDropInput ) + { + /* must be a callback stream */ + if( !streamCallback ) + return paInvalidFlag; + + /* must be a full duplex stream */ + if( (inputParameters == NULL) || (outputParameters == NULL) ) + return paInvalidFlag; + + /* must use paFramesPerBufferUnspecified */ + if( framesPerBuffer != paFramesPerBufferUnspecified ) + return paInvalidFlag; + } + + return paNoError; +} + + +PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiInputDevice, hostApiOutputDevice; + PaStreamParameters hostApiInputParameters, hostApiOutputParameters; + PaStreamParameters *hostApiInputParametersPtr, *hostApiOutputParametersPtr; + + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsFormatSupported called:\n" ); + + if( inputParameters == NULL ){ + PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: NULL\n" ); + }else{ + PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: 0x%p\n", inputParameters ); + PaUtil_DebugPrint("\tPaDeviceIndex inputParameters->device: %d\n", inputParameters->device ); + PaUtil_DebugPrint("\tint inputParameters->channelCount: %d\n", inputParameters->channelCount ); + PaUtil_DebugPrint("\tPaSampleFormat inputParameters->sampleFormat: %d\n", inputParameters->sampleFormat ); + PaUtil_DebugPrint("\tPaTime inputParameters->suggestedLatency: %f\n", inputParameters->suggestedLatency ); + PaUtil_DebugPrint("\tvoid *inputParameters->hostApiSpecificStreamInfo: 0x%p\n", inputParameters->hostApiSpecificStreamInfo ); + } + + if( outputParameters == NULL ){ + PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: NULL\n" ); + }else{ + PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: 0x%p\n", outputParameters ); + PaUtil_DebugPrint("\tPaDeviceIndex outputParameters->device: %d\n", outputParameters->device ); + PaUtil_DebugPrint("\tint outputParameters->channelCount: %d\n", outputParameters->channelCount ); + PaUtil_DebugPrint("\tPaSampleFormat outputParameters->sampleFormat: %d\n", outputParameters->sampleFormat ); + PaUtil_DebugPrint("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ); + PaUtil_DebugPrint("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ); + } + + PaUtil_DebugPrint("\tdouble sampleRate: %g\n", sampleRate ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsFormatSupported returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + result = ValidateOpenStreamParameters( inputParameters, + outputParameters, + sampleRate, 0, paNoFlag, 0, + &hostApi, + &hostApiInputDevice, + &hostApiOutputDevice ); + if( result != paNoError ) + { +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsFormatSupported returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + + if( inputParameters ) + { + hostApiInputParameters.device = hostApiInputDevice; + hostApiInputParameters.channelCount = inputParameters->channelCount; + hostApiInputParameters.sampleFormat = inputParameters->sampleFormat; + hostApiInputParameters.suggestedLatency = inputParameters->suggestedLatency; + hostApiInputParameters.hostApiSpecificStreamInfo = inputParameters->hostApiSpecificStreamInfo; + hostApiInputParametersPtr = &hostApiInputParameters; + } + else + { + hostApiInputParametersPtr = NULL; + } + + if( outputParameters ) + { + hostApiOutputParameters.device = hostApiOutputDevice; + hostApiOutputParameters.channelCount = outputParameters->channelCount; + hostApiOutputParameters.sampleFormat = outputParameters->sampleFormat; + hostApiOutputParameters.suggestedLatency = outputParameters->suggestedLatency; + hostApiOutputParameters.hostApiSpecificStreamInfo = outputParameters->hostApiSpecificStreamInfo; + hostApiOutputParametersPtr = &hostApiOutputParameters; + } + else + { + hostApiOutputParametersPtr = NULL; + } + + result = hostApi->IsFormatSupported( hostApi, + hostApiInputParametersPtr, hostApiOutputParametersPtr, + sampleRate ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + if( result == paFormatIsSupported ) + PaUtil_DebugPrint("\tPaError: 0 [ paFormatIsSupported ]\n\n" ); + else + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_OpenStream( PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiInputDevice, hostApiOutputDevice; + PaStreamParameters hostApiInputParameters, hostApiOutputParameters; + PaStreamParameters *hostApiInputParametersPtr, *hostApiOutputParametersPtr; + + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream called:\n" ); + PaUtil_DebugPrint("\tPaStream** stream: 0x%p\n", stream ); + + if( inputParameters == NULL ){ + PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: NULL\n" ); + }else{ + PaUtil_DebugPrint("\tPaStreamParameters *inputParameters: 0x%p\n", inputParameters ); + PaUtil_DebugPrint("\tPaDeviceIndex inputParameters->device: %d\n", inputParameters->device ); + PaUtil_DebugPrint("\tint inputParameters->channelCount: %d\n", inputParameters->channelCount ); + PaUtil_DebugPrint("\tPaSampleFormat inputParameters->sampleFormat: %d\n", inputParameters->sampleFormat ); + PaUtil_DebugPrint("\tPaTime inputParameters->suggestedLatency: %f\n", inputParameters->suggestedLatency ); + PaUtil_DebugPrint("\tvoid *inputParameters->hostApiSpecificStreamInfo: 0x%p\n", inputParameters->hostApiSpecificStreamInfo ); + } + + if( outputParameters == NULL ){ + PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: NULL\n" ); + }else{ + PaUtil_DebugPrint("\tPaStreamParameters *outputParameters: 0x%p\n", outputParameters ); + PaUtil_DebugPrint("\tPaDeviceIndex outputParameters->device: %d\n", outputParameters->device ); + PaUtil_DebugPrint("\tint outputParameters->channelCount: %d\n", outputParameters->channelCount ); + PaUtil_DebugPrint("\tPaSampleFormat outputParameters->sampleFormat: %d\n", outputParameters->sampleFormat ); + PaUtil_DebugPrint("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ); + PaUtil_DebugPrint("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ); + } + + PaUtil_DebugPrint("\tdouble sampleRate: %g\n", sampleRate ); + PaUtil_DebugPrint("\tunsigned long framesPerBuffer: %d\n", framesPerBuffer ); + PaUtil_DebugPrint("\tPaStreamFlags streamFlags: 0x%x\n", streamFlags ); + PaUtil_DebugPrint("\tPaStreamCallback *streamCallback: 0x%p\n", streamCallback ); + PaUtil_DebugPrint("\tvoid *userData: 0x%p\n", userData ); +#endif + + if( !PA_IS_INITIALISED_ ) + { + result = paNotInitialized; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): undefined\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + /* Check for parameter errors. + NOTE: make sure this validation list is kept syncronised with the one + in pa_hostapi.h + */ + + if( stream == NULL ) + { + result = paBadStreamPtr; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): undefined\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + result = ValidateOpenStreamParameters( inputParameters, + outputParameters, + sampleRate, framesPerBuffer, + streamFlags, streamCallback, + &hostApi, + &hostApiInputDevice, + &hostApiOutputDevice ); + if( result != paNoError ) + { +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): undefined\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + return result; + } + + + if( inputParameters ) + { + hostApiInputParameters.device = hostApiInputDevice; + hostApiInputParameters.channelCount = inputParameters->channelCount; + hostApiInputParameters.sampleFormat = inputParameters->sampleFormat; + hostApiInputParameters.suggestedLatency = inputParameters->suggestedLatency; + hostApiInputParameters.hostApiSpecificStreamInfo = inputParameters->hostApiSpecificStreamInfo; + hostApiInputParametersPtr = &hostApiInputParameters; + } + else + { + hostApiInputParametersPtr = NULL; + } + + if( outputParameters ) + { + hostApiOutputParameters.device = hostApiOutputDevice; + hostApiOutputParameters.channelCount = outputParameters->channelCount; + hostApiOutputParameters.sampleFormat = outputParameters->sampleFormat; + hostApiOutputParameters.suggestedLatency = outputParameters->suggestedLatency; + hostApiOutputParameters.hostApiSpecificStreamInfo = outputParameters->hostApiSpecificStreamInfo; + hostApiOutputParametersPtr = &hostApiOutputParameters; + } + else + { + hostApiOutputParametersPtr = NULL; + } + + result = hostApi->OpenStream( hostApi, stream, + hostApiInputParametersPtr, hostApiOutputParametersPtr, + sampleRate, framesPerBuffer, streamFlags, streamCallback, userData ); + + if( result == paNoError ) + AddOpenStream( *stream ); + + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): 0x%p\n", *stream ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_OpenDefaultStream( PaStream** stream, + int inputChannelCount, + int outputChannelCount, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result; + PaStreamParameters hostApiInputParameters, hostApiOutputParameters; + PaStreamParameters *hostApiInputParametersPtr, *hostApiOutputParametersPtr; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenDefaultStream called:\n" ); + PaUtil_DebugPrint("\tPaStream** stream: 0x%p\n", stream ); + PaUtil_DebugPrint("\tint inputChannelCount: %d\n", inputChannelCount ); + PaUtil_DebugPrint("\tint outputChannelCount: %d\n", outputChannelCount ); + PaUtil_DebugPrint("\tPaSampleFormat sampleFormat: %d\n", sampleFormat ); + PaUtil_DebugPrint("\tdouble sampleRate: %g\n", sampleRate ); + PaUtil_DebugPrint("\tunsigned long framesPerBuffer: %d\n", framesPerBuffer ); + PaUtil_DebugPrint("\tPaStreamCallback *streamCallback: 0x%p\n", streamCallback ); + PaUtil_DebugPrint("\tvoid *userData: 0x%p\n", userData ); +#endif + + + if( inputChannelCount > 0 ) + { + hostApiInputParameters.device = Pa_GetDefaultInputDevice(); + hostApiInputParameters.channelCount = inputChannelCount; + hostApiInputParameters.sampleFormat = sampleFormat; + /* defaultHighInputLatency is used below instead of + defaultLowInputLatency because it is more important for the default + stream to work reliably than it is for it to work with the lowest + latency. + */ + hostApiInputParameters.suggestedLatency = + Pa_GetDeviceInfo( hostApiInputParameters.device )->defaultHighInputLatency; + hostApiInputParameters.hostApiSpecificStreamInfo = NULL; + hostApiInputParametersPtr = &hostApiInputParameters; + } + else + { + hostApiInputParametersPtr = NULL; + } + + if( outputChannelCount > 0 ) + { + hostApiOutputParameters.device = Pa_GetDefaultOutputDevice(); + hostApiOutputParameters.channelCount = outputChannelCount; + hostApiOutputParameters.sampleFormat = sampleFormat; + /* defaultHighOutputLatency is used below instead of + defaultLowOutputLatency because it is more important for the default + stream to work reliably than it is for it to work with the lowest + latency. + */ + hostApiOutputParameters.suggestedLatency = + Pa_GetDeviceInfo( hostApiOutputParameters.device )->defaultHighOutputLatency; + hostApiOutputParameters.hostApiSpecificStreamInfo = NULL; + hostApiOutputParametersPtr = &hostApiOutputParameters; + } + else + { + hostApiOutputParametersPtr = NULL; + } + + + result = Pa_OpenStream( + stream, hostApiInputParametersPtr, hostApiOutputParametersPtr, + sampleRate, framesPerBuffer, paNoFlag, streamCallback, userData ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_OpenDefaultStream returned:\n" ); + PaUtil_DebugPrint("\t*(PaStream** stream): 0x%p", *stream ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError PaUtil_ValidateStreamPointer( PaStream* stream ) +{ + if( !PA_IS_INITIALISED_ ) return paNotInitialized; + + if( stream == NULL ) return paBadStreamPtr; + + if( ((PaUtilStreamRepresentation*)stream)->magic != PA_STREAM_MAGIC ) + return paBadStreamPtr; + + return paNoError; +} + + +PaError Pa_CloseStream( PaStream* stream ) +{ + PaUtilStreamInterface *interface; + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_CloseStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + /* always remove the open stream from our list, even if this function + eventually returns an error. Otherwise CloseOpenStreams() will + get stuck in an infinite loop */ + RemoveOpenStream( stream ); /* be sure to call this _before_ closing the stream */ + + if( result == paNoError ) + { + interface = PA_STREAM_INTERFACE(stream); + + /* abort the stream if it isn't stopped */ + result = interface->IsStopped( stream ); + if( result == 1 ) + result = paNoError; + else if( result == 0 ) + result = interface->Abort( stream ); + + if( result == paNoError ) /** @todo REVIEW: shouldn't we close anyway? */ + result = interface->Close( stream ); + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_CloseStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_SetStreamFinishedCallback called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); + PaUtil_DebugPrint("\tPaStreamFinishedCallback* streamFinishedCallback: 0x%p\n", streamFinishedCallback ); +#endif + + if( result == paNoError ) + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = paStreamIsNotStopped ; + } + if( result == 1 ) + { + PA_STREAM_REP( stream )->streamFinishedCallback = streamFinishedCallback; + result = paNoError; + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_SetStreamFinishedCallback returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; + +} + + +PaError Pa_StartStream( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_StartStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = paStreamIsNotStopped ; + } + else if( result == 1 ) + { + result = PA_STREAM_INTERFACE(stream)->Start( stream ); + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_StartStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_StopStream( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_StopStream called\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = PA_STREAM_INTERFACE(stream)->Stop( stream ); + } + else if( result == 1 ) + { + result = paStreamIsStopped; + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_StopStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_AbortStream( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_AbortStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = PA_STREAM_INTERFACE(stream)->Abort( stream ); + } + else if( result == 1 ) + { + result = paStreamIsStopped; + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_AbortStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_IsStreamStopped( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsStreamStopped called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsStreamStopped returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_IsStreamActive( PaStream *stream ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsStreamActive called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + result = PA_STREAM_INTERFACE(stream)->IsActive( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_IsStreamActive returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + const PaStreamInfo *result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamInfo called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + result = 0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamInfo returned:\n" ); + PaUtil_DebugPrint("\tconst PaStreamInfo*: 0 [PaError error:%d ( %s )]\n\n", result, error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = &PA_STREAM_REP( stream )->streamInfo; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamInfo returned:\n" ); + PaUtil_DebugPrint("\tconst PaStreamInfo*: 0x%p:\n", result ); + PaUtil_DebugPrint("\t{" ); + + PaUtil_DebugPrint("\t\tint structVersion: %d\n", result->structVersion ); + PaUtil_DebugPrint("\t\tPaTime inputLatency: %f\n", result->inputLatency ); + PaUtil_DebugPrint("\t\tPaTime outputLatency: %f\n", result->outputLatency ); + PaUtil_DebugPrint("\t\tdouble sampleRate: %f\n", result->sampleRate ); + PaUtil_DebugPrint("\t}\n\n" ); +#endif + + } + + return result; +} + + +PaTime Pa_GetStreamTime( PaStream *stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + PaTime result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamTime called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + result = 0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamTime returned:\n" ); + PaUtil_DebugPrint("\tPaTime: 0 [PaError error:%d ( %s )]\n\n", result, error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = PA_STREAM_INTERFACE(stream)->GetTime( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamTime returned:\n" ); + PaUtil_DebugPrint("\tPaTime: %g\n\n", result ); +#endif + + } + + return result; +} + + +double Pa_GetStreamCpuLoad( PaStream* stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + double result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamCpuLoad called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + + result = 0.0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamCpuLoad returned:\n" ); + PaUtil_DebugPrint("\tdouble: 0.0 [PaError error: %d ( %s )]\n\n", error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = PA_STREAM_INTERFACE(stream)->GetCpuLoad( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamCpuLoad returned:\n" ); + PaUtil_DebugPrint("\tdouble: %g\n\n", result ); +#endif + + } + + return result; +} + + +PaError Pa_ReadStream( PaStream* stream, + void *buffer, + unsigned long frames ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_ReadStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + if( frames == 0 ) + { + /* XXX: Should we not allow the implementation to signal any overflow condition? */ + result = paNoError; + } + else if( buffer == 0 ) + { + result = paBadBufferPtr; + } + else + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = PA_STREAM_INTERFACE(stream)->Read( stream, buffer, frames ); + } + else if( result == 1 ) + { + result = paStreamIsStopped; + } + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_ReadStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + + +PaError Pa_WriteStream( PaStream* stream, + const void *buffer, + unsigned long frames ) +{ + PaError result = PaUtil_ValidateStreamPointer( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_WriteStream called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( result == paNoError ) + { + if( frames == 0 ) + { + /* XXX: Should we not allow the implementation to signal any underflow condition? */ + result = paNoError; + } + else if( buffer == 0 ) + { + result = paBadBufferPtr; + } + else + { + result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + if( result == 0 ) + { + result = PA_STREAM_INTERFACE(stream)->Write( stream, buffer, frames ); + } + else if( result == 1 ) + { + result = paStreamIsStopped; + } + } + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_WriteStream returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return result; +} + +signed long Pa_GetStreamReadAvailable( PaStream* stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + signed long result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamReadAvailable called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + result = 0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamReadAvailable returned:\n" ); + PaUtil_DebugPrint("\tunsigned long: 0 [ PaError error: %d ( %s ) ]\n\n", error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = PA_STREAM_INTERFACE(stream)->GetReadAvailable( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamReadAvailable returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + } + + return result; +} + + +signed long Pa_GetStreamWriteAvailable( PaStream* stream ) +{ + PaError error = PaUtil_ValidateStreamPointer( stream ); + signed long result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamWriteAvailable called:\n" ); + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); +#endif + + if( error != paNoError ) + { + result = 0; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamWriteAvailable returned:\n" ); + PaUtil_DebugPrint("\tunsigned long: 0 [ PaError error: %d ( %s ) ]\n\n", error, Pa_GetErrorText( error ) ); +#endif + + } + else + { + result = PA_STREAM_INTERFACE(stream)->GetWriteAvailable( stream ); + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetStreamWriteAvailable returned:\n" ); + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + } + + return result; +} + + +PaError Pa_GetSampleSize( PaSampleFormat format ) +{ + int result; + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetSampleSize called:\n" ); + PaUtil_DebugPrint("\tPaSampleFormat format: %d\n", format ); +#endif + + switch( format & ~paNonInterleaved ) + { + + case paUInt8: + case paInt8: + result = 1; + break; + + case paInt16: + result = 2; + break; + + case paInt24: + result = 3; + break; + + case paFloat32: + case paInt32: + result = 4; + break; + + default: + result = paSampleFormatNotSupported; + break; + } + +#ifdef PA_LOG_API_CALLS + PaUtil_DebugPrint("Pa_GetSampleSize returned:\n" ); + if( result > 0 ) + PaUtil_DebugPrint("\tint: %d\n\n", result ); + else + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); +#endif + + return (PaError) result; +} + diff --git a/portaudio-v19/src/common/pa_hostapi.h b/portaudio-v19/src/common/pa_hostapi.h new file mode 100644 index 000000000..fec4e4871 --- /dev/null +++ b/portaudio-v19/src/common/pa_hostapi.h @@ -0,0 +1,244 @@ +#ifndef PA_HOSTAPI_H +#define PA_HOSTAPI_H +/* + * $Id$ + * Portable Audio I/O Library + * host api representation + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Interface used by pa_front to virtualize functions which operate on + host APIs. +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** **FOR THE USE OF pa_front.c ONLY** + Do NOT use fields in this structure, they my change at any time. + Use functions defined in pa_util.h if you think you need functionality + which can be derived from here. +*/ +typedef struct PaUtilPrivatePaFrontHostApiInfo { + + + unsigned long baseDeviceIndex; +}PaUtilPrivatePaFrontHostApiInfo; + + +/** The common header for all data structures whose pointers are passed through + the hostApiSpecificStreamInfo field of the PaStreamParameters structure. + Note that in order to keep the public PortAudio interface clean, this structure + is not used explicitly when declaring hostApiSpecificStreamInfo data structures. + However, some code in pa_front depends on the first 3 members being equivalent + with this structure. + @see PaStreamParameters +*/ +typedef struct PaUtilHostApiSpecificStreamInfoHeader +{ + unsigned long size; /**< size of whole structure including this header */ + PaHostApiTypeId hostApiType; /**< host API for which this data is intended */ + unsigned long version; /**< structure version */ +} PaUtilHostApiSpecificStreamInfoHeader; + + + +/** A structure representing the interface to a host API. Contains both + concrete data and pointers to functions which implement the interface. +*/ +typedef struct PaUtilHostApiRepresentation { + PaUtilPrivatePaFrontHostApiInfo privatePaFrontInfo; + + /** The host api implementation should populate the info field. In the + case of info.defaultInputDevice and info.defaultOutputDevice the + values stored should be 0 based indices within the host api's own + device index range (0 to deviceCount). These values will be converted + to global device indices by pa_front after PaUtilHostApiInitializer() + returns. + */ + PaHostApiInfo info; + + PaDeviceInfo** deviceInfos; + + /** + (*Terminate)() is guaranteed to be called with a valid + parameter, which was previously returned from the same implementation's + initializer. + */ + void (*Terminate)( struct PaUtilHostApiRepresentation *hostApi ); + + /** + The inputParameters and outputParameters pointers should not be saved + as they will not remain valid after OpenStream is called. + + + The following guarantees are made about parameters to (*OpenStream)(): + + [NOTE: the following list up to *END PA FRONT VALIDATIONS* should be + kept in sync with the one for ValidateOpenStreamParameters and + Pa_OpenStream in pa_front.c] + + PaHostApiRepresentation *hostApi + - is valid for this implementation + + PaStream** stream + - is non-null + + - at least one of inputParameters & outputParmeters is valid (not NULL) + + - if inputParameters & outputParmeters are both valid, that + inputParameters->device & outputParmeters->device both use the same host api + + PaDeviceIndex inputParameters->device + - is within range (0 to Pa_CountDevices-1) Or: + - is paUseHostApiSpecificDeviceSpecification and + inputParameters->hostApiSpecificStreamInfo is non-NULL and refers + to a valid host api + + int inputParameters->numChannels + - if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, numInputChannels is > 0 + - upper bound is NOT validated against device capabilities + + PaSampleFormat inputParameters->sampleFormat + - is one of the sample formats defined in portaudio.h + + void *inputParameters->hostApiSpecificStreamInfo + - if supplied its hostApi field matches the input device's host Api + + PaDeviceIndex outputParmeters->device + - is within range (0 to Pa_CountDevices-1) + + int outputParmeters->numChannels + - if inputDevice is valid, numInputChannels is > 0 + - upper bound is NOT validated against device capabilities + + PaSampleFormat outputParmeters->sampleFormat + - is one of the sample formats defined in portaudio.h + + void *outputParmeters->hostApiSpecificStreamInfo + - if supplied its hostApi field matches the output device's host Api + + double sampleRate + - is not an 'absurd' rate (less than 1000. or greater than 200000.) + - sampleRate is NOT validated against device capabilities + + PaStreamFlags streamFlags + - unused platform neutral flags are zero + - paNeverDropInput is only used for full-duplex callback streams + with variable buffer size (paFramesPerBufferUnspecified) + + [*END PA FRONT VALIDATIONS*] + + + The following validations MUST be performed by (*OpenStream)(): + + - check that input device can support numInputChannels + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if inputStreamInfo is supplied, validate its contents, + or return an error if no inputStreamInfo is expected + + - check that output device can support numOutputChannels + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if outputStreamInfo is supplied, validate its contents, + or return an error if no outputStreamInfo is expected + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + - alter sampleRate to a close allowable rate if necessary + + - validate inputLatency and outputLatency + + - validate any platform specific flags, if flags are supplied they + must be valid. + */ + PaError (*OpenStream)( struct PaUtilHostApiRepresentation *hostApi, + PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerCallback, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); + + + PaError (*IsFormatSupported)( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +} PaUtilHostApiRepresentation; + + +/** Prototype for the initialization function which must be implemented by every + host API. + + @see paHostApiInitializers +*/ +typedef PaError PaUtilHostApiInitializer( PaUtilHostApiRepresentation**, PaHostApiIndex ); + + +/** paHostApiInitializers is a NULL-terminated array of host API initialization + functions. These functions are called by pa_front to initialize the host APIs + when the client calls Pa_Initialize(). + + There is a platform specific file which defines paHostApiInitializers for that + platform, pa_win/pa_win_hostapis.c contains the Win32 definitions for example. +*/ +extern PaUtilHostApiInitializer *paHostApiInitializers[]; + + +/** The index of the default host API in the paHostApiInitializers array. + + There is a platform specific file which defines paDefaultHostApiIndex for that + platform, see pa_win/pa_win_hostapis.c for example. +*/ +extern int paDefaultHostApiIndex; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_HOSTAPI_H */ diff --git a/portaudio-v19/src/common/pa_process.c b/portaudio-v19/src/common/pa_process.c new file mode 100644 index 000000000..837bbef35 --- /dev/null +++ b/portaudio-v19/src/common/pa_process.c @@ -0,0 +1,1763 @@ +/* + * $Id$ + * Portable Audio I/O Library + * streamCallback <-> host buffer processing adapter + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Buffer Processor implementation. + + The code in this file is not optimised yet - although it's not clear that + it needs to be. there may appear to be redundancies + that could be factored into common functions, but the redundanceis are left + intentionally as each appearance may have different optimisation possibilities. + + The optimisations which are planned involve only converting data in-place + where possible, rather than copying to the temp buffer(s). + + Note that in the extreme case of being able to convert in-place, and there + being no conversion necessary there should be some code which short-circuits + the operation. + + @todo Consider cache tilings for intereave<->deinterleave. + + @todo implement timeInfo->currentTime int PaUtil_BeginBufferProcessing() + + @todo specify and implement some kind of logical policy for handling the + underflow and overflow stream flags when the underflow/overflow overlaps + multiple user buffers/callbacks. + + @todo provide support for priming the buffers with data from the callback. + The client interface is now implemented through PaUtil_SetNoInput() + which sets bp->hostInputChannels[0][0].data to zero. However this is + currently only implemented in NonAdaptingProcess(). It shouldn't be + needed for AdaptingInputOnlyProcess() (no priming should ever be + requested for AdaptingInputOnlyProcess()). + Not sure if additional work should be required to make it work with + AdaptingOutputOnlyProcess, but it definitely is required for + AdaptingProcess. + + @todo implement PaUtil_SetNoOutput for AdaptingProcess + + @todo don't allocate temp buffers for blocking streams unless they are + needed. At the moment they are needed, but perhaps for host APIs + where the implementation passes a buffer to the host they could be + used. +*/ + + +#include +#include /* memset() */ + +#include "pa_process.h" +#include "pa_util.h" + + +#define PA_FRAMES_PER_TEMP_BUFFER_WHEN_HOST_BUFFER_SIZE_IS_UNKNOWN_ 1024 + +#define PA_MIN_( a, b ) ( ((a)<(b)) ? (a) : (b) ) + + +/* greatest common divisor - PGCD in French */ +static unsigned long GCD( unsigned long a, unsigned long b ) +{ + return (b==0) ? a : GCD( b, a%b); +} + +/* least common multiple - PPCM in French */ +static unsigned long LCM( unsigned long a, unsigned long b ) +{ + return (a*b) / GCD(a,b); +} + +#define PA_MAX_( a, b ) (((a) > (b)) ? (a) : (b)) + +static unsigned long CalculateFrameShift( unsigned long M, unsigned long N ) +{ + unsigned long result = 0; + unsigned long i; + unsigned long lcm; + + assert( M > 0 ); + assert( N > 0 ); + + lcm = LCM( M, N ); + for( i = M; i < lcm; i += M ) + result = PA_MAX_( result, i % N ); + + return result; +} + + +PaError PaUtil_InitializeBufferProcessor( PaUtilBufferProcessor* bp, + int inputChannelCount, PaSampleFormat userInputSampleFormat, + PaSampleFormat hostInputSampleFormat, + int outputChannelCount, PaSampleFormat userOutputSampleFormat, + PaSampleFormat hostOutputSampleFormat, + double sampleRate, + PaStreamFlags streamFlags, + unsigned long framesPerUserBuffer, + unsigned long framesPerHostBuffer, + PaUtilHostBufferSizeMode hostBufferSizeMode, + PaStreamCallback *streamCallback, void *userData ) +{ + PaError result = paNoError; + PaError bytesPerSample; + unsigned long tempInputBufferSize, tempOutputBufferSize; + + if( streamFlags & paNeverDropInput ) + { + /* paNeverDropInput is only valid for full-duplex callback streams, with an unspecified number of frames per buffer. */ + if( !streamCallback || !(inputChannelCount > 0 && outputChannelCount > 0) || + framesPerUserBuffer != paFramesPerBufferUnspecified ) + return paInvalidFlag; + } + + /* initialize buffer ptrs to zero so they can be freed if necessary in error */ + bp->tempInputBuffer = 0; + bp->tempInputBufferPtrs = 0; + bp->tempOutputBuffer = 0; + bp->tempOutputBufferPtrs = 0; + + bp->framesPerUserBuffer = framesPerUserBuffer; + bp->framesPerHostBuffer = framesPerHostBuffer; + + bp->inputChannelCount = inputChannelCount; + bp->outputChannelCount = outputChannelCount; + + bp->hostBufferSizeMode = hostBufferSizeMode; + + bp->hostInputChannels[0] = bp->hostInputChannels[1] = 0; + bp->hostOutputChannels[0] = bp->hostOutputChannels[1] = 0; + + if( framesPerUserBuffer == 0 ) /* streamCallback will accept any buffer size */ + { + bp->useNonAdaptingProcess = 1; + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = 0; + + if( hostBufferSizeMode == paUtilFixedHostBufferSize + || hostBufferSizeMode == paUtilBoundedHostBufferSize ) + { + bp->framesPerTempBuffer = framesPerHostBuffer; + } + else /* unknown host buffer size */ + { + bp->framesPerTempBuffer = PA_FRAMES_PER_TEMP_BUFFER_WHEN_HOST_BUFFER_SIZE_IS_UNKNOWN_; + } + } + else + { + bp->framesPerTempBuffer = framesPerUserBuffer; + + if( hostBufferSizeMode == paUtilFixedHostBufferSize + && framesPerHostBuffer % framesPerUserBuffer == 0 ) + { + bp->useNonAdaptingProcess = 1; + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = 0; + } + else + { + bp->useNonAdaptingProcess = 0; + + if( inputChannelCount > 0 && outputChannelCount > 0 ) + { + /* full duplex */ + if( hostBufferSizeMode == paUtilFixedHostBufferSize ) + { + unsigned long frameShift = + CalculateFrameShift( framesPerHostBuffer, framesPerUserBuffer ); + + if( framesPerUserBuffer > framesPerHostBuffer ) + { + bp->initialFramesInTempInputBuffer = frameShift; + bp->initialFramesInTempOutputBuffer = 0; + } + else + { + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = frameShift; + } + } + else /* variable host buffer size, add framesPerUserBuffer latency */ + { + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = framesPerUserBuffer; + } + } + else + { + /* half duplex */ + bp->initialFramesInTempInputBuffer = 0; + bp->initialFramesInTempOutputBuffer = 0; + } + } + } + + + bp->framesInTempInputBuffer = bp->initialFramesInTempInputBuffer; + bp->framesInTempOutputBuffer = bp->initialFramesInTempOutputBuffer; + + + if( inputChannelCount > 0 ) + { + bytesPerSample = Pa_GetSampleSize( hostInputSampleFormat ); + if( bytesPerSample > 0 ) + { + bp->bytesPerHostInputSample = bytesPerSample; + } + else + { + result = bytesPerSample; + goto error; + } + + bytesPerSample = Pa_GetSampleSize( userInputSampleFormat ); + if( bytesPerSample > 0 ) + { + bp->bytesPerUserInputSample = bytesPerSample; + } + else + { + result = bytesPerSample; + goto error; + } + + bp->inputConverter = + PaUtil_SelectConverter( hostInputSampleFormat, userInputSampleFormat, streamFlags ); + + bp->inputZeroer = PaUtil_SelectZeroer( hostInputSampleFormat ); + + bp->userInputIsInterleaved = (userInputSampleFormat & paNonInterleaved)?0:1; + + + tempInputBufferSize = + bp->framesPerTempBuffer * bp->bytesPerUserInputSample * inputChannelCount; + + bp->tempInputBuffer = PaUtil_AllocateMemory( tempInputBufferSize ); + if( bp->tempInputBuffer == 0 ) + { + result = paInsufficientMemory; + goto error; + } + + if( bp->framesInTempInputBuffer > 0 ) + memset( bp->tempInputBuffer, 0, tempInputBufferSize ); + + if( userInputSampleFormat & paNonInterleaved ) + { + bp->tempInputBufferPtrs = + (void **)PaUtil_AllocateMemory( sizeof(void*)*inputChannelCount ); + if( bp->tempInputBufferPtrs == 0 ) + { + result = paInsufficientMemory; + goto error; + } + } + + bp->hostInputChannels[0] = (PaUtilChannelDescriptor*) + PaUtil_AllocateMemory( sizeof(PaUtilChannelDescriptor) * inputChannelCount * 2); + if( bp->hostInputChannels[0] == 0 ) + { + result = paInsufficientMemory; + goto error; + } + + bp->hostInputChannels[1] = &bp->hostInputChannels[0][inputChannelCount]; + } + + if( outputChannelCount > 0 ) + { + bytesPerSample = Pa_GetSampleSize( hostOutputSampleFormat ); + if( bytesPerSample > 0 ) + { + bp->bytesPerHostOutputSample = bytesPerSample; + } + else + { + result = bytesPerSample; + goto error; + } + + bytesPerSample = Pa_GetSampleSize( userOutputSampleFormat ); + if( bytesPerSample > 0 ) + { + bp->bytesPerUserOutputSample = bytesPerSample; + } + else + { + result = bytesPerSample; + goto error; + } + + bp->outputConverter = + PaUtil_SelectConverter( userOutputSampleFormat, hostOutputSampleFormat, streamFlags ); + + bp->outputZeroer = PaUtil_SelectZeroer( hostOutputSampleFormat ); + + bp->userOutputIsInterleaved = (userOutputSampleFormat & paNonInterleaved)?0:1; + + tempOutputBufferSize = + bp->framesPerTempBuffer * bp->bytesPerUserOutputSample * outputChannelCount; + + bp->tempOutputBuffer = PaUtil_AllocateMemory( tempOutputBufferSize ); + if( bp->tempOutputBuffer == 0 ) + { + result = paInsufficientMemory; + goto error; + } + + if( bp->framesInTempOutputBuffer > 0 ) + memset( bp->tempOutputBuffer, 0, tempOutputBufferSize ); + + if( userOutputSampleFormat & paNonInterleaved ) + { + bp->tempOutputBufferPtrs = + (void **)PaUtil_AllocateMemory( sizeof(void*)*outputChannelCount ); + if( bp->tempOutputBufferPtrs == 0 ) + { + result = paInsufficientMemory; + goto error; + } + } + + bp->hostOutputChannels[0] = (PaUtilChannelDescriptor*) + PaUtil_AllocateMemory( sizeof(PaUtilChannelDescriptor)*outputChannelCount * 2 ); + if( bp->hostOutputChannels[0] == 0 ) + { + result = paInsufficientMemory; + goto error; + } + + bp->hostOutputChannels[1] = &bp->hostOutputChannels[0][outputChannelCount]; + } + + PaUtil_InitializeTriangularDitherState( &bp->ditherGenerator ); + + bp->samplePeriod = 1. / sampleRate; + + bp->streamCallback = streamCallback; + bp->userData = userData; + + return result; + +error: + if( bp->tempInputBuffer ) + PaUtil_FreeMemory( bp->tempInputBuffer ); + + if( bp->tempInputBufferPtrs ) + PaUtil_FreeMemory( bp->tempInputBufferPtrs ); + + if( bp->hostInputChannels[0] ) + PaUtil_FreeMemory( bp->hostInputChannels[0] ); + + if( bp->tempOutputBuffer ) + PaUtil_FreeMemory( bp->tempOutputBuffer ); + + if( bp->tempOutputBufferPtrs ) + PaUtil_FreeMemory( bp->tempOutputBufferPtrs ); + + if( bp->hostOutputChannels[0] ) + PaUtil_FreeMemory( bp->hostOutputChannels[0] ); + + return result; +} + + +void PaUtil_TerminateBufferProcessor( PaUtilBufferProcessor* bp ) +{ + if( bp->tempInputBuffer ) + PaUtil_FreeMemory( bp->tempInputBuffer ); + + if( bp->tempInputBufferPtrs ) + PaUtil_FreeMemory( bp->tempInputBufferPtrs ); + + if( bp->hostInputChannels[0] ) + PaUtil_FreeMemory( bp->hostInputChannels[0] ); + + if( bp->tempOutputBuffer ) + PaUtil_FreeMemory( bp->tempOutputBuffer ); + + if( bp->tempOutputBufferPtrs ) + PaUtil_FreeMemory( bp->tempOutputBufferPtrs ); + + if( bp->hostOutputChannels[0] ) + PaUtil_FreeMemory( bp->hostOutputChannels[0] ); +} + + +void PaUtil_ResetBufferProcessor( PaUtilBufferProcessor* bp ) +{ + unsigned long tempInputBufferSize, tempOutputBufferSize; + + bp->framesInTempInputBuffer = bp->initialFramesInTempInputBuffer; + bp->framesInTempOutputBuffer = bp->initialFramesInTempOutputBuffer; + + if( bp->framesInTempInputBuffer > 0 ) + { + tempInputBufferSize = + bp->framesPerTempBuffer * bp->bytesPerUserInputSample * bp->inputChannelCount; + memset( bp->tempInputBuffer, 0, tempInputBufferSize ); + } + + if( bp->framesInTempOutputBuffer > 0 ) + { + tempOutputBufferSize = + bp->framesPerTempBuffer * bp->bytesPerUserOutputSample * bp->outputChannelCount; + memset( bp->tempOutputBuffer, 0, tempOutputBufferSize ); + } +} + + +unsigned long PaUtil_GetBufferProcessorInputLatency( PaUtilBufferProcessor* bp ) +{ + return bp->initialFramesInTempInputBuffer; +} + + +unsigned long PaUtil_GetBufferProcessorOutputLatency( PaUtilBufferProcessor* bp ) +{ + return bp->initialFramesInTempOutputBuffer; +} + + +void PaUtil_SetInputFrameCount( PaUtilBufferProcessor* bp, + unsigned long frameCount ) +{ + if( frameCount == 0 ) + bp->hostInputFrameCount[0] = bp->framesPerHostBuffer; + else + bp->hostInputFrameCount[0] = frameCount; +} + + +void PaUtil_SetNoInput( PaUtilBufferProcessor* bp ) +{ + assert( bp->inputChannelCount > 0 ); + + bp->hostInputChannels[0][0].data = 0; +} + + +void PaUtil_SetInputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data, unsigned int stride ) +{ + assert( channel < bp->inputChannelCount ); + + bp->hostInputChannels[0][channel].data = data; + bp->hostInputChannels[0][channel].stride = stride; +} + + +void PaUtil_SetInterleavedInputChannels( PaUtilBufferProcessor* bp, + unsigned int firstChannel, void *data, unsigned int channelCount ) +{ + unsigned int i; + unsigned int channel = firstChannel; + unsigned char *p = (unsigned char*)data; + + if( channelCount == 0 ) + channelCount = bp->inputChannelCount; + + assert( firstChannel < bp->inputChannelCount ); + assert( firstChannel + channelCount <= bp->inputChannelCount ); + + for( i=0; i< channelCount; ++i ) + { + bp->hostInputChannels[0][channel+i].data = p; + p += bp->bytesPerHostInputSample; + bp->hostInputChannels[0][channel+i].stride = channelCount; + } +} + + +void PaUtil_SetNonInterleavedInputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data ) +{ + assert( channel < bp->inputChannelCount ); + + bp->hostInputChannels[0][channel].data = data; + bp->hostInputChannels[0][channel].stride = 1; +} + + +void PaUtil_Set2ndInputFrameCount( PaUtilBufferProcessor* bp, + unsigned long frameCount ) +{ + bp->hostInputFrameCount[1] = frameCount; +} + + +void PaUtil_Set2ndInputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data, unsigned int stride ) +{ + assert( channel < bp->inputChannelCount ); + + bp->hostInputChannels[1][channel].data = data; + bp->hostInputChannels[1][channel].stride = stride; +} + + +void PaUtil_Set2ndInterleavedInputChannels( PaUtilBufferProcessor* bp, + unsigned int firstChannel, void *data, unsigned int channelCount ) +{ + unsigned int i; + unsigned int channel = firstChannel; + unsigned char *p = (unsigned char*)data; + + if( channelCount == 0 ) + channelCount = bp->inputChannelCount; + + assert( firstChannel < bp->inputChannelCount ); + assert( firstChannel + channelCount <= bp->inputChannelCount ); + + for( i=0; i< channelCount; ++i ) + { + bp->hostInputChannels[1][channel+i].data = p; + p += bp->bytesPerHostInputSample; + bp->hostInputChannels[1][channel+i].stride = channelCount; + } +} + + +void PaUtil_Set2ndNonInterleavedInputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data ) +{ + assert( channel < bp->inputChannelCount ); + + bp->hostInputChannels[1][channel].data = data; + bp->hostInputChannels[1][channel].stride = 1; +} + + +void PaUtil_SetOutputFrameCount( PaUtilBufferProcessor* bp, + unsigned long frameCount ) +{ + if( frameCount == 0 ) + bp->hostOutputFrameCount[0] = bp->framesPerHostBuffer; + else + bp->hostOutputFrameCount[0] = frameCount; +} + + +void PaUtil_SetNoOutput( PaUtilBufferProcessor* bp ) +{ + assert( bp->outputChannelCount > 0 ); + + bp->hostOutputChannels[0][0].data = 0; +} + + +void PaUtil_SetOutputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data, unsigned int stride ) +{ + assert( channel < bp->outputChannelCount ); + assert( data != NULL ); + + bp->hostOutputChannels[0][channel].data = data; + bp->hostOutputChannels[0][channel].stride = stride; +} + + +void PaUtil_SetInterleavedOutputChannels( PaUtilBufferProcessor* bp, + unsigned int firstChannel, void *data, unsigned int channelCount ) +{ + unsigned int i; + unsigned int channel = firstChannel; + unsigned char *p = (unsigned char*)data; + + if( channelCount == 0 ) + channelCount = bp->outputChannelCount; + + assert( firstChannel < bp->outputChannelCount ); + assert( firstChannel + channelCount <= bp->outputChannelCount ); + + for( i=0; i< channelCount; ++i ) + { + PaUtil_SetOutputChannel( bp, channel + i, p, channelCount ); + p += bp->bytesPerHostOutputSample; + } +} + + +void PaUtil_SetNonInterleavedOutputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data ) +{ + assert( channel < bp->outputChannelCount ); + + PaUtil_SetOutputChannel( bp, channel, data, 1 ); +} + + +void PaUtil_Set2ndOutputFrameCount( PaUtilBufferProcessor* bp, + unsigned long frameCount ) +{ + bp->hostOutputFrameCount[1] = frameCount; +} + + +void PaUtil_Set2ndOutputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data, unsigned int stride ) +{ + assert( channel < bp->outputChannelCount ); + assert( data != NULL ); + + bp->hostOutputChannels[1][channel].data = data; + bp->hostOutputChannels[1][channel].stride = stride; +} + + +void PaUtil_Set2ndInterleavedOutputChannels( PaUtilBufferProcessor* bp, + unsigned int firstChannel, void *data, unsigned int channelCount ) +{ + unsigned int i; + unsigned int channel = firstChannel; + unsigned char *p = (unsigned char*)data; + + if( channelCount == 0 ) + channelCount = bp->outputChannelCount; + + assert( firstChannel < bp->outputChannelCount ); + assert( firstChannel + channelCount <= bp->outputChannelCount ); + + for( i=0; i< channelCount; ++i ) + { + PaUtil_Set2ndOutputChannel( bp, channel + i, p, channelCount ); + p += bp->bytesPerHostOutputSample; + } +} + + +void PaUtil_Set2ndNonInterleavedOutputChannel( PaUtilBufferProcessor* bp, + unsigned int channel, void *data ) +{ + assert( channel < bp->outputChannelCount ); + + PaUtil_Set2ndOutputChannel( bp, channel, data, 1 ); +} + + +void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bp, + PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags callbackStatusFlags ) +{ + bp->timeInfo = timeInfo; + + /* the first streamCallback will be called to process samples which are + currently in the input buffer before the ones starting at the timeInfo time */ + + bp->timeInfo->inputBufferAdcTime -= bp->framesInTempInputBuffer * bp->samplePeriod; + + bp->timeInfo->currentTime = 0; /** FIXME: @todo time info currentTime not implemented */ + + /* the first streamCallback will be called to generate samples which will be + outputted after the frames currently in the output buffer have been + outputted. */ + bp->timeInfo->outputBufferDacTime += bp->framesInTempOutputBuffer * bp->samplePeriod; + + bp->callbackStatusFlags = callbackStatusFlags; + + bp->hostInputFrameCount[1] = 0; + bp->hostOutputFrameCount[1] = 0; +} + + +/* + NonAdaptingProcess() is a simple buffer copying adaptor that can handle + both full and half duplex copies. It processes framesToProcess frames, + broken into blocks bp->framesPerTempBuffer long. + This routine can be used when the streamCallback doesn't care what length + the buffers are, or when framesToProcess is an integer multiple of + bp->framesPerTempBuffer, in which case streamCallback will always be called + with bp->framesPerTempBuffer samples. +*/ +static unsigned long NonAdaptingProcess( PaUtilBufferProcessor *bp, + int *streamCallbackResult, + PaUtilChannelDescriptor *hostInputChannels, + PaUtilChannelDescriptor *hostOutputChannels, + unsigned long framesToProcess ) +{ + void *userInput, *userOutput; + unsigned char *srcBytePtr, *destBytePtr; + unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + unsigned long frameCount; + unsigned long framesToGo = framesToProcess; + unsigned long framesProcessed = 0; + + + if( *streamCallbackResult == paContinue ) + { + do + { + frameCount = PA_MIN_( bp->framesPerTempBuffer, framesToGo ); + + /* configure user input buffer and convert input data (host -> user) */ + if( bp->inputChannelCount == 0 ) + { + /* no input */ + userInput = 0; + } + else /* there are input channels */ + { + /* + could use more elaborate logic here and sometimes process + buffers in-place. + */ + + destBytePtr = (unsigned char *)bp->tempInputBuffer; + + if( bp->userInputIsInterleaved ) + { + destSampleStrideSamples = bp->inputChannelCount; + destChannelStrideBytes = bp->bytesPerUserInputSample; + userInput = bp->tempInputBuffer; + } + else /* user input is not interleaved */ + { + destSampleStrideSamples = 1; + destChannelStrideBytes = frameCount * bp->bytesPerUserInputSample; + + /* setup non-interleaved ptrs */ + for( i=0; iinputChannelCount; ++i ) + { + bp->tempInputBufferPtrs[i] = ((unsigned char*)bp->tempInputBuffer) + + i * bp->bytesPerUserInputSample * frameCount; + } + + userInput = bp->tempInputBufferPtrs; + } + + if( !bp->hostInputChannels[0][0].data ) + { + /* no input was supplied (see PaUtil_SetNoInput), so + zero the input buffer */ + + for( i=0; iinputChannelCount; ++i ) + { + bp->inputZeroer( destBytePtr, destSampleStrideSamples, frameCount ); + destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ + } + } + else + { + for( i=0; iinputChannelCount; ++i ) + { + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + frameCount, &bp->ditherGenerator ); + + destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ + + /* advance src ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + frameCount * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + } + } + + /* configure user output buffer */ + if( bp->outputChannelCount == 0 ) + { + /* no output */ + userOutput = 0; + } + else /* there are output channels */ + { + if( bp->userOutputIsInterleaved ) + { + userOutput = bp->tempOutputBuffer; + } + else /* user output is not interleaved */ + { + for( i = 0; i < bp->outputChannelCount; ++i ) + { + bp->tempOutputBufferPtrs[i] = ((unsigned char*)bp->tempOutputBuffer) + + i * bp->bytesPerUserOutputSample * frameCount; + } + + userOutput = bp->tempOutputBufferPtrs; + } + } + + *streamCallbackResult = bp->streamCallback( userInput, userOutput, + frameCount, bp->timeInfo, bp->callbackStatusFlags, bp->userData ); + + if( *streamCallbackResult == paAbort ) + { + /* callback returned paAbort, don't advance framesProcessed + and framesToGo, they will be handled below */ + } + else + { + bp->timeInfo->inputBufferAdcTime += frameCount * bp->samplePeriod; + bp->timeInfo->outputBufferDacTime += frameCount * bp->samplePeriod; + + /* convert output data (user -> host) */ + + if( bp->outputChannelCount != 0 && bp->hostOutputChannels[0][0].data ) + { + /* + could use more elaborate logic here and sometimes process + buffers in-place. + */ + + srcBytePtr = (unsigned char *)bp->tempOutputBuffer; + + if( bp->userOutputIsInterleaved ) + { + srcSampleStrideSamples = bp->outputChannelCount; + srcChannelStrideBytes = bp->bytesPerUserOutputSample; + } + else /* user output is not interleaved */ + { + srcSampleStrideSamples = 1; + srcChannelStrideBytes = frameCount * bp->bytesPerUserOutputSample; + } + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + frameCount, &bp->ditherGenerator ); + + srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + } + + framesProcessed += frameCount; + + framesToGo -= frameCount; + } + } + while( framesToGo > 0 && *streamCallbackResult == paContinue ); + } + + if( framesToGo > 0 ) + { + /* zero any remaining frames output. There will only be remaining frames + if the callback has returned paComplete or paAbort */ + + frameCount = framesToGo; + + if( bp->outputChannelCount != 0 && bp->hostOutputChannels[0][0].data ) + { + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputZeroer( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + frameCount ); + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + } + + framesProcessed += frameCount; + } + + return framesProcessed; +} + + +/* + AdaptingInputOnlyProcess() is a half duplex input buffer processor. It + converts data from the input buffers into the temporary input buffer, + when the temporary input buffer is full, it calls the streamCallback. +*/ +static unsigned long AdaptingInputOnlyProcess( PaUtilBufferProcessor *bp, + int *streamCallbackResult, + PaUtilChannelDescriptor *hostInputChannels, + unsigned long framesToProcess ) +{ + void *userInput, *userOutput; + unsigned char *destBytePtr; + unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + unsigned long frameCount; + unsigned long framesToGo = framesToProcess; + unsigned long framesProcessed = 0; + + userOutput = 0; + + do + { + frameCount = ( bp->framesInTempInputBuffer + framesToGo > bp->framesPerUserBuffer ) + ? ( bp->framesPerUserBuffer - bp->framesInTempInputBuffer ) + : framesToGo; + + /* convert frameCount samples into temp buffer */ + + if( bp->userInputIsInterleaved ) + { + destBytePtr = ((unsigned char*)bp->tempInputBuffer) + + bp->bytesPerUserInputSample * bp->inputChannelCount * + bp->framesInTempInputBuffer; + + destSampleStrideSamples = bp->inputChannelCount; + destChannelStrideBytes = bp->bytesPerUserInputSample; + + userInput = bp->tempInputBuffer; + } + else /* user input is not interleaved */ + { + destBytePtr = ((unsigned char*)bp->tempInputBuffer) + + bp->bytesPerUserInputSample * bp->framesInTempInputBuffer; + + destSampleStrideSamples = 1; + destChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserInputSample; + + /* setup non-interleaved ptrs */ + for( i=0; iinputChannelCount; ++i ) + { + bp->tempInputBufferPtrs[i] = ((unsigned char*)bp->tempInputBuffer) + + i * bp->bytesPerUserInputSample * bp->framesPerUserBuffer; + } + + userInput = bp->tempInputBufferPtrs; + } + + for( i=0; iinputChannelCount; ++i ) + { + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + frameCount, &bp->ditherGenerator ); + + destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ + + /* advance src ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + frameCount * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + + bp->framesInTempInputBuffer += frameCount; + + if( bp->framesInTempInputBuffer == bp->framesPerUserBuffer ) + { + /** + @todo (non-critical optimisation) + The conditional below implements the continue/complete/abort mechanism + simply by continuing on iterating through the input buffer, but not + passing the data to the callback. With care, the outer loop could be + terminated earlier, thus some unneeded conversion cycles would be + saved. + */ + if( *streamCallbackResult == paContinue ) + { + bp->timeInfo->outputBufferDacTime = 0; + + *streamCallbackResult = bp->streamCallback( userInput, userOutput, + bp->framesPerUserBuffer, bp->timeInfo, + bp->callbackStatusFlags, bp->userData ); + + bp->timeInfo->inputBufferAdcTime += frameCount * bp->samplePeriod; + } + + bp->framesInTempInputBuffer = 0; + } + + framesProcessed += frameCount; + + framesToGo -= frameCount; + }while( framesToGo > 0 ); + + return framesProcessed; +} + + +/* + AdaptingOutputOnlyProcess() is a half duplex output buffer processor. + It converts data from the temporary output buffer, to the output buffers, + when the temporary output buffer is empty, it calls the streamCallback. +*/ +static unsigned long AdaptingOutputOnlyProcess( PaUtilBufferProcessor *bp, + int *streamCallbackResult, + PaUtilChannelDescriptor *hostOutputChannels, + unsigned long framesToProcess ) +{ + void *userInput, *userOutput; + unsigned char *srcBytePtr; + unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + unsigned long frameCount; + unsigned long framesToGo = framesToProcess; + unsigned long framesProcessed = 0; + + do + { + if( bp->framesInTempOutputBuffer == 0 && *streamCallbackResult == paContinue ) + { + userInput = 0; + + /* setup userOutput */ + if( bp->userOutputIsInterleaved ) + { + userOutput = bp->tempOutputBuffer; + } + else /* user output is not interleaved */ + { + for( i = 0; i < bp->outputChannelCount; ++i ) + { + bp->tempOutputBufferPtrs[i] = ((unsigned char*)bp->tempOutputBuffer) + + i * bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; + } + + userOutput = bp->tempOutputBufferPtrs; + } + + bp->timeInfo->inputBufferAdcTime = 0; + + *streamCallbackResult = bp->streamCallback( userInput, userOutput, + bp->framesPerUserBuffer, bp->timeInfo, + bp->callbackStatusFlags, bp->userData ); + + if( *streamCallbackResult == paAbort ) + { + /* if the callback returned paAbort, we disregard its output */ + } + else + { + bp->timeInfo->outputBufferDacTime += bp->framesPerUserBuffer * bp->samplePeriod; + + bp->framesInTempOutputBuffer = bp->framesPerUserBuffer; + } + } + + if( bp->framesInTempOutputBuffer > 0 ) + { + /* convert frameCount frames from user buffer to host buffer */ + + frameCount = PA_MIN_( bp->framesInTempOutputBuffer, framesToGo ); + + if( bp->userOutputIsInterleaved ) + { + srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + + bp->bytesPerUserOutputSample * bp->outputChannelCount * + (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); + + srcSampleStrideSamples = bp->outputChannelCount; + srcChannelStrideBytes = bp->bytesPerUserOutputSample; + } + else /* user output is not interleaved */ + { + srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + + bp->bytesPerUserOutputSample * + (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); + + srcSampleStrideSamples = 1; + srcChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; + } + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + frameCount, &bp->ditherGenerator ); + + srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + + bp->framesInTempOutputBuffer -= frameCount; + } + else + { + /* no more user data is available because the callback has returned + paComplete or paAbort. Fill the remainder of the host buffer + with zeros. + */ + + frameCount = framesToGo; + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputZeroer( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + frameCount ); + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + } + + framesProcessed += frameCount; + + framesToGo -= frameCount; + + }while( framesToGo > 0 ); + + return framesProcessed; +} + +/* CopyTempOutputBuffersToHostOutputBuffers is called from AdaptingProcess to copy frames from + tempOutputBuffer to hostOutputChannels. This includes data conversion + and interleaving. +*/ +static void CopyTempOutputBuffersToHostOutputBuffers( PaUtilBufferProcessor *bp) +{ + unsigned long maxFramesToCopy; + PaUtilChannelDescriptor *hostOutputChannels; + unsigned int frameCount; + unsigned char *srcBytePtr; + unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + + /* copy frames from user to host output buffers */ + while( bp->framesInTempOutputBuffer > 0 && + ((bp->hostOutputFrameCount[0] + bp->hostOutputFrameCount[1]) > 0) ) + { + maxFramesToCopy = bp->framesInTempOutputBuffer; + + /* select the output buffer set (1st or 2nd) */ + if( bp->hostOutputFrameCount[0] > 0 ) + { + hostOutputChannels = bp->hostOutputChannels[0]; + frameCount = PA_MIN_( bp->hostOutputFrameCount[0], maxFramesToCopy ); + } + else + { + hostOutputChannels = bp->hostOutputChannels[1]; + frameCount = PA_MIN_( bp->hostOutputFrameCount[1], maxFramesToCopy ); + } + + if( bp->userOutputIsInterleaved ) + { + srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + + bp->bytesPerUserOutputSample * bp->outputChannelCount * + (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); + + srcSampleStrideSamples = bp->outputChannelCount; + srcChannelStrideBytes = bp->bytesPerUserOutputSample; + } + else /* user output is not interleaved */ + { + srcBytePtr = ((unsigned char*)bp->tempOutputBuffer) + + bp->bytesPerUserOutputSample * + (bp->framesPerUserBuffer - bp->framesInTempOutputBuffer); + + srcSampleStrideSamples = 1; + srcChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; + } + + for( i=0; ioutputChannelCount; ++i ) + { + assert( hostOutputChannels[i].data != NULL ); + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + frameCount, &bp->ditherGenerator ); + + srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + frameCount * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + + if( bp->hostOutputFrameCount[0] > 0 ) + bp->hostOutputFrameCount[0] -= frameCount; + else + bp->hostOutputFrameCount[1] -= frameCount; + + bp->framesInTempOutputBuffer -= frameCount; + } +} + +/* + AdaptingProcess is a full duplex adapting buffer processor. It converts + data from the temporary output buffer into the host output buffers, then + from the host input buffers into the temporary input buffers. Calling the + streamCallback when necessary. + When processPartialUserBuffers is 0, all available input data will be + consumed and all available output space will be filled. When + processPartialUserBuffers is non-zero, as many full user buffers + as possible will be processed, but partial buffers will not be consumed. +*/ +static unsigned long AdaptingProcess( PaUtilBufferProcessor *bp, + int *streamCallbackResult, int processPartialUserBuffers ) +{ + void *userInput, *userOutput; + unsigned long framesProcessed = 0; + unsigned long framesAvailable; + unsigned long endProcessingMinFrameCount; + unsigned long maxFramesToCopy; + PaUtilChannelDescriptor *hostInputChannels, *hostOutputChannels; + unsigned int frameCount; + unsigned char *destBytePtr; + unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i, j; + + + framesAvailable = bp->hostInputFrameCount[0] + bp->hostInputFrameCount[1];/* this is assumed to be the same as the output buffer's frame count */ + + if( processPartialUserBuffers ) + endProcessingMinFrameCount = 0; + else + endProcessingMinFrameCount = (bp->framesPerUserBuffer - 1); + + /* Fill host output with remaining frames in user output (tempOutputBuffer) */ + CopyTempOutputBuffersToHostOutputBuffers( bp ); + + while( framesAvailable > endProcessingMinFrameCount ) + { + + if( bp->framesInTempOutputBuffer == 0 && *streamCallbackResult != paContinue ) + { + /* the callback will not be called any more, so zero what remains + of the host output buffers */ + + for( i=0; i<2; ++i ) + { + frameCount = bp->hostOutputFrameCount[i]; + if( frameCount > 0 ) + { + hostOutputChannels = bp->hostOutputChannels[i]; + + for( j=0; joutputChannelCount; ++j ) + { + bp->outputZeroer( hostOutputChannels[j].data, + hostOutputChannels[j].stride, + frameCount ); + + /* advance dest ptr for next iteration */ + hostOutputChannels[j].data = ((unsigned char*)hostOutputChannels[j].data) + + frameCount * hostOutputChannels[j].stride * bp->bytesPerHostOutputSample; + } + bp->hostOutputFrameCount[i] = 0; + } + } + } + + + /* copy frames from host to user input buffers */ + while( bp->framesInTempInputBuffer < bp->framesPerUserBuffer && + ((bp->hostInputFrameCount[0] + bp->hostInputFrameCount[1]) > 0) ) + { + maxFramesToCopy = bp->framesPerUserBuffer - bp->framesInTempInputBuffer; + + /* select the input buffer set (1st or 2nd) */ + if( bp->hostInputFrameCount[0] > 0 ) + { + hostInputChannels = bp->hostInputChannels[0]; + frameCount = PA_MIN_( bp->hostInputFrameCount[0], maxFramesToCopy ); + } + else + { + hostInputChannels = bp->hostInputChannels[1]; + frameCount = PA_MIN_( bp->hostInputFrameCount[1], maxFramesToCopy ); + } + + /* configure conversion destination pointers */ + if( bp->userInputIsInterleaved ) + { + destBytePtr = ((unsigned char*)bp->tempInputBuffer) + + bp->bytesPerUserInputSample * bp->inputChannelCount * + bp->framesInTempInputBuffer; + + destSampleStrideSamples = bp->inputChannelCount; + destChannelStrideBytes = bp->bytesPerUserInputSample; + } + else /* user input is not interleaved */ + { + destBytePtr = ((unsigned char*)bp->tempInputBuffer) + + bp->bytesPerUserInputSample * bp->framesInTempInputBuffer; + + destSampleStrideSamples = 1; + destChannelStrideBytes = bp->framesPerUserBuffer * bp->bytesPerUserInputSample; + } + + for( i=0; iinputChannelCount; ++i ) + { + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + frameCount, &bp->ditherGenerator ); + + destBytePtr += destChannelStrideBytes; /* skip to next destination channel */ + + /* advance src ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + frameCount * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + + if( bp->hostInputFrameCount[0] > 0 ) + bp->hostInputFrameCount[0] -= frameCount; + else + bp->hostInputFrameCount[1] -= frameCount; + + bp->framesInTempInputBuffer += frameCount; + + /* update framesAvailable and framesProcessed based on input consumed + unless something is very wrong this will also correspond to the + amount of output generated */ + framesAvailable -= frameCount; + framesProcessed += frameCount; + } + + /* call streamCallback */ + if( bp->framesInTempInputBuffer == bp->framesPerUserBuffer && + bp->framesInTempOutputBuffer == 0 ) + { + if( *streamCallbackResult == paContinue ) + { + /* setup userInput */ + if( bp->userInputIsInterleaved ) + { + userInput = bp->tempInputBuffer; + } + else /* user input is not interleaved */ + { + for( i = 0; i < bp->inputChannelCount; ++i ) + { + bp->tempInputBufferPtrs[i] = ((unsigned char*)bp->tempInputBuffer) + + i * bp->framesPerUserBuffer * bp->bytesPerUserInputSample; + } + + userInput = bp->tempInputBufferPtrs; + } + + /* setup userOutput */ + if( bp->userOutputIsInterleaved ) + { + userOutput = bp->tempOutputBuffer; + } + else /* user output is not interleaved */ + { + for( i = 0; i < bp->outputChannelCount; ++i ) + { + bp->tempOutputBufferPtrs[i] = ((unsigned char*)bp->tempOutputBuffer) + + i * bp->framesPerUserBuffer * bp->bytesPerUserOutputSample; + } + + userOutput = bp->tempOutputBufferPtrs; + } + + /* call streamCallback */ + + *streamCallbackResult = bp->streamCallback( userInput, userOutput, + bp->framesPerUserBuffer, bp->timeInfo, + bp->callbackStatusFlags, bp->userData ); + + bp->timeInfo->inputBufferAdcTime += bp->framesPerUserBuffer * bp->samplePeriod; + bp->timeInfo->outputBufferDacTime += bp->framesPerUserBuffer * bp->samplePeriod; + + bp->framesInTempInputBuffer = 0; + + if( *streamCallbackResult == paAbort ) + bp->framesInTempOutputBuffer = 0; + else + bp->framesInTempOutputBuffer = bp->framesPerUserBuffer; + } + else + { + /* paComplete or paAbort has already been called. */ + + bp->framesInTempInputBuffer = 0; + } + } + + /* copy frames from user (tempOutputBuffer) to host output buffers (hostOutputChannels) + Means to process the user output provided by the callback. Has to be called after + each callback. */ + CopyTempOutputBuffersToHostOutputBuffers( bp ); + + } + + return framesProcessed; +} + + +unsigned long PaUtil_EndBufferProcessing( PaUtilBufferProcessor* bp, int *streamCallbackResult ) +{ + unsigned long framesToProcess, framesToGo; + unsigned long framesProcessed = 0; + + if( bp->inputChannelCount != 0 && bp->outputChannelCount != 0 + && bp->hostInputChannels[0][0].data /* input was supplied (see PaUtil_SetNoInput) */ + && bp->hostOutputChannels[0][0].data /* output was supplied (see PaUtil_SetNoOutput) */ ) + { + assert( (bp->hostInputFrameCount[0] + bp->hostInputFrameCount[1]) == + (bp->hostOutputFrameCount[0] + bp->hostOutputFrameCount[1]) ); + } + + assert( *streamCallbackResult == paContinue + || *streamCallbackResult == paComplete + || *streamCallbackResult == paAbort ); /* don't forget to pass in a valid callback result value */ + + if( bp->useNonAdaptingProcess ) + { + if( bp->inputChannelCount != 0 && bp->outputChannelCount != 0 ) + { + /* full duplex non-adapting process, splice buffers if they are + different lengths */ + + framesToGo = bp->hostOutputFrameCount[0] + bp->hostOutputFrameCount[1]; /* relies on assert above for input/output equivalence */ + + do{ + unsigned long noInputInputFrameCount; + unsigned long *hostInputFrameCount; + PaUtilChannelDescriptor *hostInputChannels; + unsigned long noOutputOutputFrameCount; + unsigned long *hostOutputFrameCount; + PaUtilChannelDescriptor *hostOutputChannels; + unsigned long framesProcessedThisIteration; + + if( !bp->hostInputChannels[0][0].data ) + { + /* no input was supplied (see PaUtil_SetNoInput) + NonAdaptingProcess knows how to deal with this + */ + noInputInputFrameCount = framesToGo; + hostInputFrameCount = &noInputInputFrameCount; + hostInputChannels = 0; + } + else if( bp->hostInputFrameCount[0] != 0 ) + { + hostInputFrameCount = &bp->hostInputFrameCount[0]; + hostInputChannels = bp->hostInputChannels[0]; + } + else + { + hostInputFrameCount = &bp->hostInputFrameCount[1]; + hostInputChannels = bp->hostInputChannels[1]; + } + + if( !bp->hostOutputChannels[0][0].data ) + { + /* no output was supplied (see PaUtil_SetNoOutput) + NonAdaptingProcess knows how to deal with this + */ + noOutputOutputFrameCount = framesToGo; + hostOutputFrameCount = &noOutputOutputFrameCount; + hostOutputChannels = 0; + } + if( bp->hostOutputFrameCount[0] != 0 ) + { + hostOutputFrameCount = &bp->hostOutputFrameCount[0]; + hostOutputChannels = bp->hostOutputChannels[0]; + } + else + { + hostOutputFrameCount = &bp->hostOutputFrameCount[1]; + hostOutputChannels = bp->hostOutputChannels[1]; + } + + framesToProcess = PA_MIN_( *hostInputFrameCount, + *hostOutputFrameCount ); + + assert( framesToProcess != 0 ); + + framesProcessedThisIteration = NonAdaptingProcess( bp, streamCallbackResult, + hostInputChannels, hostOutputChannels, + framesToProcess ); + + *hostInputFrameCount -= framesProcessedThisIteration; + *hostOutputFrameCount -= framesProcessedThisIteration; + + framesProcessed += framesProcessedThisIteration; + framesToGo -= framesProcessedThisIteration; + + }while( framesToGo > 0 ); + } + else + { + /* half duplex non-adapting process, just process 1st and 2nd buffer */ + /* process first buffer */ + + framesToProcess = (bp->inputChannelCount != 0) + ? bp->hostInputFrameCount[0] + : bp->hostOutputFrameCount[0]; + + framesProcessed = NonAdaptingProcess( bp, streamCallbackResult, + bp->hostInputChannels[0], bp->hostOutputChannels[0], + framesToProcess ); + + /* process second buffer if provided */ + + framesToProcess = (bp->inputChannelCount != 0) + ? bp->hostInputFrameCount[1] + : bp->hostOutputFrameCount[1]; + if( framesToProcess > 0 ) + { + framesProcessed += NonAdaptingProcess( bp, streamCallbackResult, + bp->hostInputChannels[1], bp->hostOutputChannels[1], + framesToProcess ); + } + } + } + else /* block adaption necessary*/ + { + + if( bp->inputChannelCount != 0 && bp->outputChannelCount != 0 ) + { + /* full duplex */ + + if( bp->hostBufferSizeMode == paUtilVariableHostBufferSizePartialUsageAllowed ) + { + framesProcessed = AdaptingProcess( bp, streamCallbackResult, + 0 /* dont process partial user buffers */ ); + } + else + { + framesProcessed = AdaptingProcess( bp, streamCallbackResult, + 1 /* process partial user buffers */ ); + } + } + else if( bp->inputChannelCount != 0 ) + { + /* input only */ + framesToProcess = bp->hostInputFrameCount[0]; + + framesProcessed = AdaptingInputOnlyProcess( bp, streamCallbackResult, + bp->hostInputChannels[0], framesToProcess ); + + framesToProcess = bp->hostInputFrameCount[1]; + if( framesToProcess > 0 ) + { + framesProcessed += AdaptingInputOnlyProcess( bp, streamCallbackResult, + bp->hostInputChannels[1], framesToProcess ); + } + } + else + { + /* output only */ + framesToProcess = bp->hostOutputFrameCount[0]; + + framesProcessed = AdaptingOutputOnlyProcess( bp, streamCallbackResult, + bp->hostOutputChannels[0], framesToProcess ); + + framesToProcess = bp->hostOutputFrameCount[1]; + if( framesToProcess > 0 ) + { + framesProcessed += AdaptingOutputOnlyProcess( bp, streamCallbackResult, + bp->hostOutputChannels[1], framesToProcess ); + } + } + } + + return framesProcessed; +} + + +int PaUtil_IsBufferProcessorOutputEmpty( PaUtilBufferProcessor* bp ) +{ + return (bp->framesInTempOutputBuffer) ? 0 : 1; +} + + +unsigned long PaUtil_CopyInput( PaUtilBufferProcessor* bp, + void **buffer, unsigned long frameCount ) +{ + PaUtilChannelDescriptor *hostInputChannels; + unsigned int framesToCopy; + unsigned char *destBytePtr; + void **nonInterleavedDestPtrs; + unsigned int destSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int destChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + + hostInputChannels = bp->hostInputChannels[0]; + framesToCopy = PA_MIN_( bp->hostInputFrameCount[0], frameCount ); + + if( bp->userInputIsInterleaved ) + { + destBytePtr = (unsigned char*)*buffer; + + destSampleStrideSamples = bp->inputChannelCount; + destChannelStrideBytes = bp->bytesPerUserInputSample; + + for( i=0; iinputChannelCount; ++i ) + { + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + framesToCopy, &bp->ditherGenerator ); + + destBytePtr += destChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + framesToCopy * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + + /* advance callers dest pointer (buffer) */ + *buffer = ((unsigned char *)*buffer) + + framesToCopy * bp->inputChannelCount * bp->bytesPerUserInputSample; + } + else + { + /* user input is not interleaved */ + + nonInterleavedDestPtrs = (void**)*buffer; + + destSampleStrideSamples = 1; + + for( i=0; iinputChannelCount; ++i ) + { + destBytePtr = (unsigned char*)nonInterleavedDestPtrs[i]; + + bp->inputConverter( destBytePtr, destSampleStrideSamples, + hostInputChannels[i].data, + hostInputChannels[i].stride, + framesToCopy, &bp->ditherGenerator ); + + /* advance callers dest pointer (nonInterleavedDestPtrs[i]) */ + destBytePtr += bp->bytesPerUserInputSample * framesToCopy; + nonInterleavedDestPtrs[i] = destBytePtr; + + /* advance dest ptr for next iteration */ + hostInputChannels[i].data = ((unsigned char*)hostInputChannels[i].data) + + framesToCopy * hostInputChannels[i].stride * bp->bytesPerHostInputSample; + } + } + + bp->hostInputFrameCount[0] -= framesToCopy; + + return framesToCopy; +} + +unsigned long PaUtil_CopyOutput( PaUtilBufferProcessor* bp, + const void ** buffer, unsigned long frameCount ) +{ + PaUtilChannelDescriptor *hostOutputChannels; + unsigned int framesToCopy; + unsigned char *srcBytePtr; + void **nonInterleavedSrcPtrs; + unsigned int srcSampleStrideSamples; /* stride from one sample to the next within a channel, in samples */ + unsigned int srcChannelStrideBytes; /* stride from one channel to the next, in bytes */ + unsigned int i; + + hostOutputChannels = bp->hostOutputChannels[0]; + framesToCopy = PA_MIN_( bp->hostOutputFrameCount[0], frameCount ); + + if( bp->userOutputIsInterleaved ) + { + srcBytePtr = (unsigned char*)*buffer; + + srcSampleStrideSamples = bp->outputChannelCount; + srcChannelStrideBytes = bp->bytesPerUserOutputSample; + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + framesToCopy, &bp->ditherGenerator ); + + srcBytePtr += srcChannelStrideBytes; /* skip to next source channel */ + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + framesToCopy * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + + /* advance callers source pointer (buffer) */ + *buffer = ((unsigned char *)*buffer) + + framesToCopy * bp->outputChannelCount * bp->bytesPerUserOutputSample; + + } + else + { + /* user output is not interleaved */ + + nonInterleavedSrcPtrs = (void**)*buffer; + + srcSampleStrideSamples = 1; + + for( i=0; ioutputChannelCount; ++i ) + { + srcBytePtr = (unsigned char*)nonInterleavedSrcPtrs[i]; + + bp->outputConverter( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + srcBytePtr, srcSampleStrideSamples, + framesToCopy, &bp->ditherGenerator ); + + + /* advance callers source pointer (nonInterleavedSrcPtrs[i]) */ + srcBytePtr += bp->bytesPerUserOutputSample * framesToCopy; + nonInterleavedSrcPtrs[i] = srcBytePtr; + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + framesToCopy * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + } + + bp->hostOutputFrameCount[0] += framesToCopy; + + return framesToCopy; +} + + +unsigned long PaUtil_ZeroOutput( PaUtilBufferProcessor* bp, unsigned long frameCount ) +{ + PaUtilChannelDescriptor *hostOutputChannels; + unsigned int framesToZero; + unsigned int i; + + hostOutputChannels = bp->hostOutputChannels[0]; + framesToZero = PA_MIN_( bp->hostOutputFrameCount[0], frameCount ); + + for( i=0; ioutputChannelCount; ++i ) + { + bp->outputZeroer( hostOutputChannels[i].data, + hostOutputChannels[i].stride, + framesToZero ); + + + /* advance dest ptr for next iteration */ + hostOutputChannels[i].data = ((unsigned char*)hostOutputChannels[i].data) + + framesToZero * hostOutputChannels[i].stride * bp->bytesPerHostOutputSample; + } + + bp->hostOutputFrameCount[0] += framesToZero; + + return framesToZero; +} diff --git a/portaudio-v19/src/common/pa_process.h b/portaudio-v19/src/common/pa_process.h new file mode 100644 index 000000000..8d13d903a --- /dev/null +++ b/portaudio-v19/src/common/pa_process.h @@ -0,0 +1,741 @@ +#ifndef PA_PROCESS_H +#define PA_PROCESS_H +/* + * $Id$ + * Portable Audio I/O Library callback buffer processing adapters + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Buffer Processor prototypes. A Buffer Processor performs buffer length + adaption, coordinates sample format conversion, and interleaves/deinterleaves + channels. + +

    Overview

    + + The "Buffer Processor" (PaUtilBufferProcessor) manages conversion of audio + data from host buffers to user buffers and back again. Where required, the + buffer processor takes care of converting between host and user sample formats, + interleaving and deinterleaving multichannel buffers, and adapting between host + and user buffers with different lengths. The buffer processor may be used with + full and half duplex streams, for both callback streams and blocking read/write + streams. + + One of the important capabilities provided by the buffer processor is + the ability to adapt between user and host buffer sizes of different lengths + with minimum latency. Although this task is relatively easy to perform when + the host buffer size is an integer multiple of the user buffer size, the + problem is more complicated when this is not the case - especially for + full-duplex callback streams. Where necessary the adaption is implemented by + internally buffering some input and/or output data. The buffer adation + algorithm used by the buffer processor was originally implemented by + Stephan Letz for the ASIO version of PortAudio, and is described in his + Callback_adaption_.pdf which is included in the distribution. + + The buffer processor performs sample conversion using the functions provided + by pa_converters.c. + + The following sections provide an overview of how to use the buffer processor. + Interested readers are advised to consult the host API implementations for + examples of buffer processor usage. + + +

    Initialization, resetting and termination

    + + When a stream is opened, the buffer processor should be initialized using + PaUtil_InitializeBufferProcessor. This function initializes internal state + and allocates temporary buffers as neccesary according to the supplied + configuration parameters. Some of the parameters correspond to those requested + by the user in their call to Pa_OpenStream(), others reflect the requirements + of the host API implementation - they indicate host buffer sizes, formats, + and the type of buffering which the Host API uses. The buffer processor should + be initialized for callback streams and blocking read/write streams. + + Call PaUtil_ResetBufferProcessor to clear any sample data which is present + in the buffer processor before starting to use it (for example when + Pa_StartStream is called). + + When the buffer processor is no longer used call + PaUtil_TerminateBufferProcessor. + + +

    Using the buffer processor for a callback stream

    + + The buffer processor's role in a callback stream is to take host input buffers + process them with the stream callback, and fill host output buffers. For a + full duplex stream, the buffer processor handles input and output simultaneously + due to the requirements of the minimum-latency buffer adation algorithm. + + When a host buffer becomes available, the implementation should call + the buffer processor to process the buffer. The buffer processor calls the + stream callback to consume and/or produce audio data as necessary. The buffer + processor will convert sample formats, interleave/deinterleave channels, + and slice or chunk the data to the appropriate buffer lengths according to + the requirements of the stream callback and the host API. + + To process a host buffer (or a pair of host buffers for a full-duplex stream) + use the following calling sequence: + + -# Call PaUtil_BeginBufferProcessing + -# For a stream which takes input: + - Call PaUtil_SetInputFrameCount with the number of frames in the host input + buffer. + - Call one of the following functions one or more times to tell the + buffer processor about the host input buffer(s): PaUtil_SetInputChannel, + PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel. + Which function you call will depend on whether the host buffer(s) are + interleaved or not. + - If the available host data is split accross two buffers (for example a + data range at the end of a circular buffer and another range at the + beginning of the circular buffer), also call + PaUtil_Set2ndInputFrameCount, PaUtil_Set2ndInputChannel, + PaUtil_Set2ndInterleavedInputChannels, + PaUtil_Set2ndNonInterleavedInputChannel as necessary to tell the buffer + processor about the second buffer. + -# For a stream which generates output: + - Call PaUtil_SetOutputFrameCount with the number of frames in the host + output buffer. + - Call one of the following functions one or more times to tell the + buffer processor about the host output buffer(s): PaUtil_SetOutputChannel, + PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel. + Which function you call will depend on whether the host buffer(s) are + interleaved or not. + - If the available host output buffer space is split accross two buffers + (for example a data range at the end of a circular buffer and another + range at the beginning of the circular buffer), call + PaUtil_Set2ndOutputFrameCount, PaUtil_Set2ndOutputChannel, + PaUtil_Set2ndInterleavedOutputChannels, + PaUtil_Set2ndNonInterleavedOutputChannel as necessary to tell the buffer + processor about the second buffer. + -# Call PaUtil_EndBufferProcessing, this function performs the actual data + conversion and processing. + + +

    Using the buffer processor for a blocking read/write stream

    + + Blocking read/write streams use the buffer processor to convert and copy user + output data to a host buffer, and to convert and copy host input data to + the user's buffer. The buffer processor does not perform any buffer adaption. + When using the buffer processor in a blocking read/write stream the input and + output conversion are performed separately by the PaUtil_CopyInput and + PaUtil_CopyOutput functions. + + To copy data from a host input buffer to the buffer(s) which the user supplies + to Pa_ReadStream, use the following calling sequence. + + - Repeat the following three steps until the user buffer(s) have been filled + with samples from the host input buffers: + -# Call PaUtil_SetInputFrameCount with the number of frames in the host + input buffer. + -# Call one of the following functions one or more times to tell the + buffer processor about the host input buffer(s): PaUtil_SetInputChannel, + PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel. + Which function you call will depend on whether the host buffer(s) are + interleaved or not. + -# Call PaUtil_CopyInput with the user buffer pointer (or a copy of the + array of buffer pointers for a non-interleaved stream) passed to + Pa_ReadStream, along with the number of frames in the user buffer(s). + Be careful to pass a copy of the user buffer pointers to + PaUtil_CopyInput because PaUtil_CopyInput advances the pointers to + the start of the next region to copy. + - PaUtil_CopyInput will not copy more data than is available in the + host buffer(s), so the above steps need to be repeated until the user + buffer(s) are full. + + + To copy data to the host output buffer from the user buffers(s) supplied + to Pa_WriteStream use the following calling sequence. + + - Repeat the following three steps until all frames from the user buffer(s) + have been copied to the host API: + -# Call PaUtil_SetOutputFrameCount with the number of frames in the host + output buffer. + -# Call one of the following functions one or more times to tell the + buffer processor about the host output buffer(s): PaUtil_SetOutputChannel, + PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel. + Which function you call will depend on whether the host buffer(s) are + interleaved or not. + -# Call PaUtil_CopyOutput with the user buffer pointer (or a copy of the + array of buffer pointers for a non-interleaved stream) passed to + Pa_WriteStream, along with the number of frames in the user buffer(s). + Be careful to pass a copy of the user buffer pointers to + PaUtil_CopyOutput because PaUtil_CopyOutput advances the pointers to + the start of the next region to copy. + - PaUtil_CopyOutput will not copy more data than fits in the host buffer(s), + so the above steps need to be repeated until all user data is copied. +*/ + + +#include "portaudio.h" +#include "pa_converters.h" +#include "pa_dither.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** @brief Mode flag passed to PaUtil_InitializeBufferProcessor indicating the type + of buffering that the host API uses. + + The mode used depends on whether the host API or the implementation manages + the buffers, and how these buffers are used (scatter gather, circular buffer). +*/ +typedef enum { +/** The host buffer size is a fixed known size. */ + paUtilFixedHostBufferSize, + +/** The host buffer size may vary, but has a known maximum size. */ + paUtilBoundedHostBufferSize, + +/** Nothing is known about the host buffer size. */ + paUtilUnknownHostBufferSize, + +/** The host buffer size varies, and the client does not require the buffer + processor to consume all of the input and fill all of the output buffer. This + is useful when the implementation has access to the host API's circular buffer + and only needs to consume/fill some of it, not necessarily all of it, with each + call to the buffer processor. This is the only mode where + PaUtil_EndBufferProcessing() may not consume the whole buffer. +*/ + paUtilVariableHostBufferSizePartialUsageAllowed +}PaUtilHostBufferSizeMode; + + +/** @brief An auxilliary data structure used internally by the buffer processor + to represent host input and output buffers. */ +typedef struct PaUtilChannelDescriptor{ + void *data; + unsigned int stride; /**< stride in samples, not bytes */ +}PaUtilChannelDescriptor; + + +/** @brief The main buffer processor data structure. + + Allocate one of these, initialize it with PaUtil_InitializeBufferProcessor + and terminate it with PaUtil_TerminateBufferProcessor. +*/ +typedef struct { + unsigned long framesPerUserBuffer; + unsigned long framesPerHostBuffer; + + PaUtilHostBufferSizeMode hostBufferSizeMode; + int useNonAdaptingProcess; + unsigned long framesPerTempBuffer; + + unsigned int inputChannelCount; + unsigned int bytesPerHostInputSample; + unsigned int bytesPerUserInputSample; + int userInputIsInterleaved; + PaUtilConverter *inputConverter; + PaUtilZeroer *inputZeroer; + + unsigned int outputChannelCount; + unsigned int bytesPerHostOutputSample; + unsigned int bytesPerUserOutputSample; + int userOutputIsInterleaved; + PaUtilConverter *outputConverter; + PaUtilZeroer *outputZeroer; + + unsigned long initialFramesInTempInputBuffer; + unsigned long initialFramesInTempOutputBuffer; + + void *tempInputBuffer; /**< used for slips, block adaption, and conversion. */ + void **tempInputBufferPtrs; /**< storage for non-interleaved buffer pointers, NULL for interleaved user input */ + unsigned long framesInTempInputBuffer; /**< frames remaining in input buffer from previous adaption iteration */ + + void *tempOutputBuffer; /**< used for slips, block adaption, and conversion. */ + void **tempOutputBufferPtrs; /**< storage for non-interleaved buffer pointers, NULL for interleaved user output */ + unsigned long framesInTempOutputBuffer; /**< frames remaining in input buffer from previous adaption iteration */ + + PaStreamCallbackTimeInfo *timeInfo; + + PaStreamCallbackFlags callbackStatusFlags; + + unsigned long hostInputFrameCount[2]; + PaUtilChannelDescriptor *hostInputChannels[2]; /**< pointers to arrays of channel descriptors. + pointers are NULL for half-duplex output processing. + hostInputChannels[i].data is NULL when the caller + calls PaUtil_SetNoInput() + */ + unsigned long hostOutputFrameCount[2]; + PaUtilChannelDescriptor *hostOutputChannels[2]; /**< pointers to arrays of channel descriptors. + pointers are NULL for half-duplex input processing. + hostOutputChannels[i].data is NULL when the caller + calls PaUtil_SetNoOutput() + */ + + PaUtilTriangularDitherGenerator ditherGenerator; + + double samplePeriod; + + PaStreamCallback *streamCallback; + void *userData; +} PaUtilBufferProcessor; + + +/** @name Initialization, termination, resetting and info */ +/*@{*/ + +/** Initialize a buffer processor's representation stored in a + PaUtilBufferProcessor structure. Be sure to call + PaUtil_TerminateBufferProcessor after finishing with a buffer processor. + + @param bufferProcessor The buffer processor structure to initialize. + + @param inputChannelCount The number of input channels as passed to + Pa_OpenStream or 0 for an output-only stream. + + @param userInputSampleFormat Format of user input samples, as passed to + Pa_OpenStream. This parameter is ignored for ouput-only streams. + + @param hostInputSampleFormat Format of host input samples. This parameter is + ignored for output-only streams. See note about host buffer interleave below. + + @param outputChannelCount The number of output channels as passed to + Pa_OpenStream or 0 for an input-only stream. + + @param userOutputSampleFormat Format of user output samples, as passed to + Pa_OpenStream. This parameter is ignored for input-only streams. + + @param hostOutputSampleFormat Format of host output samples. This parameter is + ignored for input-only streams. See note about host buffer interleave below. + + @param sampleRate Sample rate of the stream. The more accurate this is the + better - it is used for updating time stamps when adapting buffers. + + @param streamFlags Stream flags as passed to Pa_OpenStream, this parameter is + used for selecting special sample conversion options such as clipping and + dithering. + + @param framesPerUserBuffer Number of frames per user buffer, as requested + by the framesPerBuffer parameter to Pa_OpenStream. This parameter may be + zero to indicate that the user will accept any (and varying) buffer sizes. + + @param framesPerHostBuffer Specifies the number of frames per host buffer + for the fixed buffer size mode, and the maximum number of frames + per host buffer for the bounded host buffer size mode. It is ignored for + the other modes. + + @param hostBufferSizeMode A mode flag indicating the size variability of + host buffers that will be passed to the buffer processor. See + PaUtilHostBufferSizeMode for further details. + + @param streamCallback The user stream callback passed to Pa_OpenStream. + + @param userData The user data field passed to Pa_OpenStream. + + @note The interleave flag is ignored for host buffer formats. Host + interleave is determined by the use of different SetInput and SetOutput + functions. + + @return An error code indicating whether the initialization was successful. + If the error code is not PaNoError, the buffer processor was not initialized + and should not be used. + + @see Pa_OpenStream, PaUtilHostBufferSizeMode, PaUtil_TerminateBufferProcessor +*/ +PaError PaUtil_InitializeBufferProcessor( PaUtilBufferProcessor* bufferProcessor, + int inputChannelCount, PaSampleFormat userInputSampleFormat, + PaSampleFormat hostInputSampleFormat, + int outputChannelCount, PaSampleFormat userOutputSampleFormat, + PaSampleFormat hostOutputSampleFormat, + double sampleRate, + PaStreamFlags streamFlags, + unsigned long framesPerUserBuffer, /* 0 indicates don't care */ + unsigned long framesPerHostBuffer, + PaUtilHostBufferSizeMode hostBufferSizeMode, + PaStreamCallback *streamCallback, void *userData ); + + +/** Terminate a buffer processor's representation. Deallocates any temporary + buffers allocated by PaUtil_InitializeBufferProcessor. + + @param bufferProcessor The buffer processor structure to terminate. + + @see PaUtil_InitializeBufferProcessor. +*/ +void PaUtil_TerminateBufferProcessor( PaUtilBufferProcessor* bufferProcessor ); + + +/** Clear any internally buffered data. If you call + PaUtil_InitializeBufferProcessor in your OpenStream routine, make sure you + call PaUtil_ResetBufferProcessor in your StartStream call. + + @param bufferProcessor The buffer processor to reset. +*/ +void PaUtil_ResetBufferProcessor( PaUtilBufferProcessor* bufferProcessor ); + + +/** Retrieve the input latency of a buffer processor. + + @param bufferProcessor The buffer processor examine. + + @return The input latency introduced by the buffer processor, in frames. + + @see PaUtil_GetBufferProcessorOutputLatency +*/ +unsigned long PaUtil_GetBufferProcessorInputLatency( PaUtilBufferProcessor* bufferProcessor ); + +/** Retrieve the output latency of a buffer processor. + + @param bufferProcessor The buffer processor examine. + + @return The output latency introduced by the buffer processor, in frames. + + @see PaUtil_GetBufferProcessorInputLatency +*/ +unsigned long PaUtil_GetBufferProcessorOutputLatency( PaUtilBufferProcessor* bufferProcessor ); + +/*@}*/ + + +/** @name Host buffer pointer configuration + + Functions to set host input and output buffers, used by both callback streams + and blocking read/write streams. +*/ +/*@{*/ + + +/** Set the number of frames in the input host buffer(s) specified by the + PaUtil_Set*InputChannel functions. + + @param bufferProcessor The buffer processor. + + @param frameCount The number of host input frames. A 0 frameCount indicates to + use the framesPerHostBuffer value passed to PaUtil_InitializeBufferProcessor. + + @see PaUtil_SetNoInput, PaUtil_SetInputChannel, + PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel +*/ +void PaUtil_SetInputFrameCount( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + + +/** Indicate that no input is avalable. This function should be used when + priming the output of a full-duplex stream opened with the + paPrimeOutputBuffersUsingStreamCallback flag. Note that it is not necessary + to call this or any othe PaUtil_Set*Input* functions for ouput-only streams. + + @param bufferProcessor The buffer processor. +*/ +void PaUtil_SetNoInput( PaUtilBufferProcessor* bufferProcessor ); + + +/** Provide the buffer processor with a pointer to a host input channel. + + @param bufferProcessor The buffer processor. + @param channel The channel number. + @param data The buffer. + @param stride The stride from one sample to the next, in samples. For + interleaved host buffers, the stride will usually be the same as the number of + channels in the buffer. +*/ +void PaUtil_SetInputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data, unsigned int stride ); + + +/** Provide the buffer processor with a pointer to an number of interleaved + host input channels. + + @param bufferProcessor The buffer processor. + @param firstChannel The first channel number. + @param data The buffer. + @param channelCount The number of interleaved channels in the buffer. If + channelCount is zero, the number of channels specified to + PaUtil_InitializeBufferProcessor will be used. +*/ +void PaUtil_SetInterleavedInputChannels( PaUtilBufferProcessor* bufferProcessor, + unsigned int firstChannel, void *data, unsigned int channelCount ); + + +/** Provide the buffer processor with a pointer to one non-interleaved host + output channel. + + @param bufferProcessor The buffer processor. + @param channel The channel number. + @param data The buffer. +*/ +void PaUtil_SetNonInterleavedInputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data ); + + +/** Use for the second buffer half when the input buffer is split in two halves. + @see PaUtil_SetInputFrameCount +*/ +void PaUtil_Set2ndInputFrameCount( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + +/** Use for the second buffer half when the input buffer is split in two halves. + @see PaUtil_SetInputChannel +*/ +void PaUtil_Set2ndInputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data, unsigned int stride ); + +/** Use for the second buffer half when the input buffer is split in two halves. + @see PaUtil_SetInterleavedInputChannels +*/ +void PaUtil_Set2ndInterleavedInputChannels( PaUtilBufferProcessor* bufferProcessor, + unsigned int firstChannel, void *data, unsigned int channelCount ); + +/** Use for the second buffer half when the input buffer is split in two halves. + @see PaUtil_SetNonInterleavedInputChannel +*/ +void PaUtil_Set2ndNonInterleavedInputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data ); + + +/** Set the number of frames in the output host buffer(s) specified by the + PaUtil_Set*OutputChannel functions. + + @param bufferProcessor The buffer processor. + + @param frameCount The number of host output frames. A 0 frameCount indicates to + use the framesPerHostBuffer value passed to PaUtil_InitializeBufferProcessor. + + @see PaUtil_SetOutputChannel, PaUtil_SetInterleavedOutputChannels, + PaUtil_SetNonInterleavedOutputChannel +*/ +void PaUtil_SetOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + + +/** Indicate that the output will be discarded. This function should be used + when implementing the paNeverDropInput mode for full duplex streams. + + @param bufferProcessor The buffer processor. +*/ +void PaUtil_SetNoOutput( PaUtilBufferProcessor* bufferProcessor ); + + +/** Provide the buffer processor with a pointer to a host output channel. + + @param bufferProcessor The buffer processor. + @param channel The channel number. + @param data The buffer. + @param stride The stride from one sample to the next, in samples. For + interleaved host buffers, the stride will usually be the same as the number of + channels in the buffer. +*/ +void PaUtil_SetOutputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data, unsigned int stride ); + + +/** Provide the buffer processor with a pointer to a number of interleaved + host output channels. + + @param bufferProcessor The buffer processor. + @param firstChannel The first channel number. + @param data The buffer. + @param channelCount The number of interleaved channels in the buffer. If + channelCount is zero, the number of channels specified to + PaUtil_InitializeBufferProcessor will be used. +*/ +void PaUtil_SetInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, + unsigned int firstChannel, void *data, unsigned int channelCount ); + + +/** Provide the buffer processor with a pointer to one non-interleaved host + output channel. + + @param bufferProcessor The buffer processor. + @param channel The channel number. + @param data The buffer. +*/ +void PaUtil_SetNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data ); + + +/** Use for the second buffer half when the output buffer is split in two halves. + @see PaUtil_SetOutputFrameCount +*/ +void PaUtil_Set2ndOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + +/** Use for the second buffer half when the output buffer is split in two halves. + @see PaUtil_SetOutputChannel +*/ +void PaUtil_Set2ndOutputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data, unsigned int stride ); + +/** Use for the second buffer half when the output buffer is split in two halves. + @see PaUtil_SetInterleavedOutputChannels +*/ +void PaUtil_Set2ndInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, + unsigned int firstChannel, void *data, unsigned int channelCount ); + +/** Use for the second buffer half when the output buffer is split in two halves. + @see PaUtil_SetNonInterleavedOutputChannel +*/ +void PaUtil_Set2ndNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, + unsigned int channel, void *data ); + +/*@}*/ + + +/** @name Buffer processing functions for callback streams +*/ +/*@{*/ + +/** Commence processing a host buffer (or a pair of host buffers in the + full-duplex case) for a callback stream. + + @param bufferProcessor The buffer processor. + + @param timeInfo Timing information for the first sample of the host + buffer(s). This information may be adjusted when buffer adaption is being + performed. + + @param callbackStatusFlags Flags indicating whether underruns and overruns + have occurred since the last time the buffer processor was called. +*/ +void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bufferProcessor, + PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags callbackStatusFlags ); + + +/** Finish processing a host buffer (or a pair of host buffers in the + full-duplex case) for a callback stream. + + @param bufferProcessor The buffer processor. + + @param callbackResult On input, indicates a previous callback result, and on + exit, the result of the user stream callback, if it is called. + On entry callbackResult should contain one of { paContinue, paComplete, or + paAbort}. If paComplete is passed, the stream callback will not be called + but any audio that was generated by previous stream callbacks will be copied + to the output buffer(s). You can check whether the buffer processor's internal + buffer is empty by calling PaUtil_IsBufferProcessorOutputEmpty. + + If the stream callback is called its result is stored in *callbackResult. If + the stream callback returns paComplete or paAbort, all output buffers will be + full of valid data - some of which may be zeros to acount for data that + wasn't generated by the terminating callback. + + @return The number of frames processed. This usually corresponds to the + number of frames specified by the PaUtil_Set*FrameCount functions, exept in + the paUtilVariableHostBufferSizePartialUsageAllowed buffer size mode when a + smaller value may be returned. +*/ +unsigned long PaUtil_EndBufferProcessing( PaUtilBufferProcessor* bufferProcessor, + int *callbackResult ); + + +/** Determine whether any callback generated output remains in the bufffer + processor's internal buffers. This method may be used to determine when to + continue calling PaUtil_EndBufferProcessing() after the callback has returned + a callbackResult of paComplete. + + @param bufferProcessor The buffer processor. + + @return Returns non-zero when callback generated output remains in the internal + buffer and zero (0) when there internal buffer contains no callback generated + data. +*/ +int PaUtil_IsBufferProcessorOutputEmpty( PaUtilBufferProcessor* bufferProcessor ); + +/*@}*/ + + +/** @name Buffer processing functions for blocking read/write streams +*/ +/*@{*/ + +/** Copy samples from host input channels set up by the PaUtil_Set*InputChannels + functions to a user supplied buffer. This function is intended for use with + blocking read/write streams. Copies the minimum of the number of + user frames (specified by the frameCount parameter) and the number of available + host frames (specified in a previous call to SetInputFrameCount()). + + @param bufferProcessor The buffer processor. + + @param buffer A pointer to the user buffer pointer, or a pointer to a pointer + to an array of user buffer pointers for a non-interleaved stream. It is + important that this parameter points to a copy of the user buffer pointers, + not to the actual user buffer pointers, because this function updates the + pointers before returning. + + @param frameCount The number of frames of data in the buffer(s) pointed to by + the buffer parameter. + + @return The number of frames copied. The buffer pointer(s) pointed to by the + buffer parameter are advanced to point to the frame(s) following the last one + filled. +*/ +unsigned long PaUtil_CopyInput( PaUtilBufferProcessor* bufferProcessor, + void **buffer, unsigned long frameCount ); + + +/* Copy samples from a user supplied buffer to host output channels set up by + the PaUtil_Set*OutputChannels functions. This function is intended for use with + blocking read/write streams. Copies the minimum of the number of + user frames (specified by the frameCount parameter) and the number of + host frames (specified in a previous call to SetOutputFrameCount()). + + @param bufferProcessor The buffer processor. + + @param buffer A pointer to the user buffer pointer, or a pointer to a pointer + to an array of user buffer pointers for a non-interleaved stream. It is + important that this parameter points to a copy of the user buffer pointers, + not to the actual user buffer pointers, because this function updates the + pointers before returning. + + @param frameCount The number of frames of data in the buffer(s) pointed to by + the buffer parameter. + + @return The number of frames copied. The buffer pointer(s) pointed to by the + buffer parameter are advanced to point to the frame(s) following the last one + copied. +*/ +unsigned long PaUtil_CopyOutput( PaUtilBufferProcessor* bufferProcessor, + const void ** buffer, unsigned long frameCount ); + + +/* Zero samples in host output channels set up by the PaUtil_Set*OutputChannels + functions. This function is useful for flushing streams. + Zeros the minimum of frameCount and the number of host frames specified in a + previous call to SetOutputFrameCount(). + + @param bufferProcessor The buffer processor. + + @param frameCount The maximum number of frames to zero. + + @return The number of frames zeroed. +*/ +unsigned long PaUtil_ZeroOutput( PaUtilBufferProcessor* bufferProcessor, + unsigned long frameCount ); + + +/*@}*/ + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_PROCESS_H */ diff --git a/portaudio-v19/src/common/pa_skeleton.c b/portaudio-v19/src/common/pa_skeleton.c new file mode 100644 index 000000000..51f95c8a3 --- /dev/null +++ b/portaudio-v19/src/common/pa_skeleton.c @@ -0,0 +1,807 @@ +/* + * $Id$ + * Portable Audio I/O Library skeleton implementation + * demonstrates how to use the common functions to implement support + * for a host API + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Skeleton implementation of support for a host API. + + @note This file is provided as a starting point for implementing support for + a new host API. IMPLEMENT ME comments are used to indicate functionality + which much be customised for each implementation. +*/ + + +#include /* strlen() */ + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + + +/* IMPLEMENT ME: a macro like the following one should be used for reporting + host errors */ +#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \ + PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText ) + +/* PaSkeletonHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ +} +PaSkeletonHostApiRepresentation; /* IMPLEMENT ME: rename this */ + + +PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i, deviceCount; + PaSkeletonHostApiRepresentation *skeletonHostApi; + PaDeviceInfo *deviceInfoArray; + + skeletonHostApi = (PaSkeletonHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaSkeletonHostApiRepresentation) ); + if( !skeletonHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + skeletonHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !skeletonHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + *hostApi = &skeletonHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paInDevelopment; /* IMPLEMENT ME: change to correct type id */ + (*hostApi)->info.name = "skeleton implementation"; /* IMPLEMENT ME: change to correct name */ + + (*hostApi)->info.defaultInputDevice = paNoDevice; /* IMPLEMENT ME */ + (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */ + + (*hostApi)->info.deviceCount = 0; + + deviceCount = 0; /* IMPLEMENT ME */ + + if( deviceCount > 0 ) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + skeletonHostApi->allocations, sizeof(PaDeviceInfo*) * deviceCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + skeletonHostApi->allocations, sizeof(PaDeviceInfo) * deviceCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < deviceCount; ++i ) + { + PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + deviceInfo->name = 0; /* IMPLEMENT ME: allocate block and copy name eg: + deviceName = (char*)PaUtil_GroupAllocateMemory( skeletonHostApi->allocations, strlen(srcName) + 1 ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, srcName ); + deviceInfo->name = deviceName; + */ + + deviceInfo->maxInputChannels = 0; /* IMPLEMENT ME */ + deviceInfo->maxOutputChannels = 0; /* IMPLEMENT ME */ + + deviceInfo->defaultLowInputLatency = 0.; /* IMPLEMENT ME */ + deviceInfo->defaultLowOutputLatency = 0.; /* IMPLEMENT ME */ + deviceInfo->defaultHighInputLatency = 0.; /* IMPLEMENT ME */ + deviceInfo->defaultHighOutputLatency = 0.; /* IMPLEMENT ME */ + + deviceInfo->defaultSampleRate = 0.; /* IMPLEMENT ME */ + + (*hostApi)->deviceInfos[i] = deviceInfo; + ++(*hostApi)->info.deviceCount; + } + } + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &skeletonHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &skeletonHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( skeletonHostApi ) + { + if( skeletonHostApi->allocations ) + { + PaUtil_FreeAllAllocations( skeletonHostApi->allocations ); + PaUtil_DestroyAllocationGroup( skeletonHostApi->allocations ); + } + + PaUtil_FreeMemory( skeletonHostApi ); + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaSkeletonHostApiRepresentation *skeletonHostApi = (PaSkeletonHostApiRepresentation*)hostApi; + + /* + IMPLEMENT ME: + - clean up any resources not handled by the allocation group + */ + + if( skeletonHostApi->allocations ) + { + PaUtil_FreeAllAllocations( skeletonHostApi->allocations ); + PaUtil_DestroyAllocationGroup( skeletonHostApi->allocations ); + } + + PaUtil_FreeMemory( skeletonHostApi ); +} + + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support outputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + /* + IMPLEMENT ME: + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported if necessary + + - check that the device supports sampleRate + + Because the buffer adapter handles conversion between all standard + sample formats, the following checks are only required if paCustomFormat + is implemented, or under some other unusual conditions. + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from inputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + */ + + + /* suppress unused variable warnings */ + (void) sampleRate; + + return paFormatIsSupported; +} + +/* PaSkeletonStream - a stream data structure specifically for this implementation */ + +typedef struct PaSkeletonStream +{ /* IMPLEMENT ME: rename this */ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + /* IMPLEMENT ME: + - implementation specific data goes here + */ + unsigned long framesPerHostCallback; /* just an example */ +} +PaSkeletonStream; + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaSkeletonHostApiRepresentation *skeletonHostApi = (PaSkeletonHostApiRepresentation*)hostApi; + PaSkeletonStream *stream = 0; + unsigned long framesPerHostBuffer = framesPerBuffer; /* these may not be equivalent for all implementations */ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + /* IMPLEMENT ME - establish which host formats are available */ + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, inputSampleFormat ); + } + else + { + inputChannelCount = 0; + inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + /* IMPLEMENT ME - establish which host formats are available */ + hostOutputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, outputSampleFormat ); + } + else + { + outputChannelCount = 0; + outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ + } + + /* + IMPLEMENT ME: + + ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? ) + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + - alter sampleRate to a close allowable rate if possible / necessary + + - validate suggestedInputLatency and suggestedOutputLatency parameters, + use default values where necessary + */ + + + + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + + stream = (PaSkeletonStream*)PaUtil_AllocateMemory( sizeof(PaSkeletonStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &skeletonHostApi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &skeletonHostApi->blockingStreamInterface, streamCallback, userData ); + } + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + /* we assume a fixed host buffer size in this example, but the buffer processor + can also support bounded and unknown host buffer sizes by passing + paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of + paUtilFixedHostBufferSize below. */ + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerHostBuffer, paUtilFixedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ) + goto error; + + + /* + IMPLEMENT ME: initialise the following fields with estimated or actual + values. + */ + stream->streamRepresentation.streamInfo.inputLatency = + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor); + stream->streamRepresentation.streamInfo.outputLatency = + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor); + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + + /* + IMPLEMENT ME: + - additional stream setup + opening + */ + + stream->framesPerHostCallback = framesPerHostBuffer; + + *s = (PaStream*)stream; + + return result; + +error: + if( stream ) + PaUtil_FreeMemory( stream ); + + return result; +} + +/* + ExampleHostProcessingLoop() illustrates the kind of processing which may + occur in a host implementation. + +*/ +static void ExampleHostProcessingLoop( void *inputBuffer, void *outputBuffer, void *userData ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)userData; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */ + int callbackResult; + unsigned long framesProcessed; + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + /* + IMPLEMENT ME: + - generate timing information + - handle buffer slips + */ + + /* + If you need to byte swap or shift inputBuffer to convert it into a + portaudio format, do it here. + */ + + + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ ); + + /* + depending on whether the host buffers are interleaved, non-interleaved + or a mixture, you will want to call PaUtil_SetInterleaved*Channels(), + PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here. + */ + + PaUtil_SetInputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, + 0, /* first channel of inputBuffer is channel 0 */ + inputBuffer, + 0 ); /* 0 - use inputChannelCount passed to init buffer processor */ + + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, + 0, /* first channel of outputBuffer is channel 0 */ + outputBuffer, + 0 ); /* 0 - use outputChannelCount passed to init buffer processor */ + + /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing() + in general you would pass paContinue for normal operation, and + paComplete to drain the buffer processor's internal output buffer. + You can check whether the buffer processor's output buffer is empty + using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor ) + */ + callbackResult = paContinue; + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + + + /* + If you need to byte swap or shift outputBuffer to convert it to + host format, do it here. + */ + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + + if( callbackResult == paContinue ) + { + /* nothing special to do */ + } + else if( callbackResult == paAbort ) + { + /* IMPLEMENT ME - finish playback immediately */ + + /* once finished, call the finished callback */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + else + { + /* User callback has asked us to stop with paComplete or other non-zero value */ + + /* IMPLEMENT ME - finish playback once currently queued audio has completed */ + + /* once finished, call the finished callback */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } +} + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* + IMPLEMENT ME: + - additional stream closing + cleanup + */ + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); + + return result; +} + + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + /* suppress unused function warning. the code in ExampleHostProcessingLoop or + something similar should be implemented to feed samples to and from the + host after StartStream() is called. + */ + (void) ExampleHostProcessingLoop; + + return result; +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return result; +} + + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return 0; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return 0; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaSkeletonStream *stream = (PaSkeletonStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + + + diff --git a/portaudio-v19/src/common/pa_stream.c b/portaudio-v19/src/common/pa_stream.c new file mode 100644 index 000000000..e820671bc --- /dev/null +++ b/portaudio-v19/src/common/pa_stream.c @@ -0,0 +1,141 @@ +/* + * $Id$ + * Portable Audio I/O Library + * + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 2002 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Interface used by pa_front to virtualize functions which operate on + streams. +*/ + + +#include "pa_stream.h" + + +void PaUtil_InitializeStreamInterface( PaUtilStreamInterface *streamInterface, + PaError (*Close)( PaStream* ), + PaError (*Start)( PaStream* ), + PaError (*Stop)( PaStream* ), + PaError (*Abort)( PaStream* ), + PaError (*IsStopped)( PaStream* ), + PaError (*IsActive)( PaStream* ), + PaTime (*GetTime)( PaStream* ), + double (*GetCpuLoad)( PaStream* ), + PaError (*Read)( PaStream*, void *, unsigned long ), + PaError (*Write)( PaStream*, const void *, unsigned long ), + signed long (*GetReadAvailable)( PaStream* ), + signed long (*GetWriteAvailable)( PaStream* ) ) +{ + streamInterface->Close = Close; + streamInterface->Start = Start; + streamInterface->Stop = Stop; + streamInterface->Abort = Abort; + streamInterface->IsStopped = IsStopped; + streamInterface->IsActive = IsActive; + streamInterface->GetTime = GetTime; + streamInterface->GetCpuLoad = GetCpuLoad; + streamInterface->Read = Read; + streamInterface->Write = Write; + streamInterface->GetReadAvailable = GetReadAvailable; + streamInterface->GetWriteAvailable = GetWriteAvailable; +} + + +void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation, + PaUtilStreamInterface *streamInterface, + PaStreamCallback *streamCallback, + void *userData ) +{ + streamRepresentation->magic = PA_STREAM_MAGIC; + streamRepresentation->nextOpenStream = 0; + streamRepresentation->streamInterface = streamInterface; + streamRepresentation->streamCallback = streamCallback; + streamRepresentation->streamFinishedCallback = 0; + + streamRepresentation->userData = userData; + + streamRepresentation->streamInfo.inputLatency = 0.; + streamRepresentation->streamInfo.outputLatency = 0.; + streamRepresentation->streamInfo.sampleRate = 0.; +} + + +void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation ) +{ + streamRepresentation->magic = 0; +} + + +PaError PaUtil_DummyRead( PaStream* stream, + void *buffer, + unsigned long frames ) +{ + (void)stream; /* unused parameter */ + (void)buffer; /* unused parameter */ + (void)frames; /* unused parameter */ + + return paCanNotReadFromACallbackStream; +} + + +PaError PaUtil_DummyWrite( PaStream* stream, + const void *buffer, + unsigned long frames ) +{ + (void)stream; /* unused parameter */ + (void)buffer; /* unused parameter */ + (void)frames; /* unused parameter */ + + return paCanNotWriteToACallbackStream; +} + + +signed long PaUtil_DummyGetReadAvailable( PaStream* stream ) +{ + (void)stream; /* unused parameter */ + + return paCanNotReadFromACallbackStream; +} + + +signed long PaUtil_DummyGetWriteAvailable( PaStream* stream ) +{ + (void)stream; /* unused parameter */ + + return paCanNotWriteToACallbackStream; +} + + +double PaUtil_DummyGetCpuLoad( PaStream* stream ) +{ + (void)stream; /* unused parameter */ + + return 0.0; +} diff --git a/portaudio-v19/src/common/pa_stream.h b/portaudio-v19/src/common/pa_stream.h new file mode 100644 index 000000000..aaf89cf21 --- /dev/null +++ b/portaudio-v19/src/common/pa_stream.h @@ -0,0 +1,196 @@ +#ifndef PA_STREAM_H +#define PA_STREAM_H +/* + * $Id$ + * Portable Audio I/O Library + * stream interface + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Interface used by pa_front to virtualize functions which operate on + streams. +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +#define PA_STREAM_MAGIC (0x18273645) + + +/** A structure representing an (abstract) interface to a host API. Contains + pointers to functions which implement the interface. + + All PaStreamInterface functions are guaranteed to be called with a non-null, + valid stream parameter. +*/ +typedef struct { + PaError (*Close)( PaStream* stream ); + PaError (*Start)( PaStream *stream ); + PaError (*Stop)( PaStream *stream ); + PaError (*Abort)( PaStream *stream ); + PaError (*IsStopped)( PaStream *stream ); + PaError (*IsActive)( PaStream *stream ); + PaTime (*GetTime)( PaStream *stream ); + double (*GetCpuLoad)( PaStream* stream ); + PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ); + PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ); + signed long (*GetReadAvailable)( PaStream* stream ); + signed long (*GetWriteAvailable)( PaStream* stream ); +} PaUtilStreamInterface; + + +/** Initialize the fields of a PaUtilStreamInterface structure. +*/ +void PaUtil_InitializeStreamInterface( PaUtilStreamInterface *streamInterface, + PaError (*Close)( PaStream* ), + PaError (*Start)( PaStream* ), + PaError (*Stop)( PaStream* ), + PaError (*Abort)( PaStream* ), + PaError (*IsStopped)( PaStream* ), + PaError (*IsActive)( PaStream* ), + PaTime (*GetTime)( PaStream* ), + double (*GetCpuLoad)( PaStream* ), + PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ), + PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ), + signed long (*GetReadAvailable)( PaStream* stream ), + signed long (*GetWriteAvailable)( PaStream* stream ) ); + + +/** Dummy Read function for use in interfaces to a callback based streams. + Pass to the Read parameter of PaUtil_InitializeStreamInterface. + @return An error code indicating that the function has no effect + because the stream is a callback stream. +*/ +PaError PaUtil_DummyRead( PaStream* stream, + void *buffer, + unsigned long frames ); + + +/** Dummy Write function for use in an interfaces to callback based streams. + Pass to the Write parameter of PaUtil_InitializeStreamInterface. + @return An error code indicating that the function has no effect + because the stream is a callback stream. +*/ +PaError PaUtil_DummyWrite( PaStream* stream, + const void *buffer, + unsigned long frames ); + + +/** Dummy GetReadAvailable function for use in interfaces to callback based + streams. Pass to the GetReadAvailable parameter of PaUtil_InitializeStreamInterface. + @return An error code indicating that the function has no effect + because the stream is a callback stream. +*/ +signed long PaUtil_DummyGetReadAvailable( PaStream* stream ); + + +/** Dummy GetWriteAvailable function for use in interfaces to callback based + streams. Pass to the GetWriteAvailable parameter of PaUtil_InitializeStreamInterface. + @return An error code indicating that the function has no effect + because the stream is a callback stream. +*/ +signed long PaUtil_DummyGetWriteAvailable( PaStream* stream ); + + + +/** Dummy GetCpuLoad function for use in an interface to a read/write stream. + Pass to the GetCpuLoad parameter of PaUtil_InitializeStreamInterface. + @return Returns 0. +*/ +double PaUtil_DummyGetCpuLoad( PaStream* stream ); + + +/** Non host specific data for a stream. This data is used by pa_front to + forward to the appropriate functions in the streamInterface structure. +*/ +typedef struct PaUtilStreamRepresentation { + unsigned long magic; /**< set to PA_STREAM_MAGIC */ + struct PaUtilStreamRepresentation *nextOpenStream; /**< field used by multi-api code */ + PaUtilStreamInterface *streamInterface; + PaStreamCallback *streamCallback; + PaStreamFinishedCallback *streamFinishedCallback; + void *userData; + PaStreamInfo streamInfo; +} PaUtilStreamRepresentation; + + +/** Initialize a PaUtilStreamRepresentation structure. + + @see PaUtil_InitializeStreamRepresentation +*/ +void PaUtil_InitializeStreamRepresentation( + PaUtilStreamRepresentation *streamRepresentation, + PaUtilStreamInterface *streamInterface, + PaStreamCallback *streamCallback, + void *userData ); + + +/** Clean up a PaUtilStreamRepresentation structure previously initialized + by a call to PaUtil_InitializeStreamRepresentation. + + @see PaUtil_InitializeStreamRepresentation +*/ +void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation ); + + +/** Check that the stream pointer is valid. + + @return Returns paNoError if the stream pointer appears to be OK, otherwise + returns an error indicating the cause of failure. +*/ +PaError PaUtil_ValidateStreamPointer( PaStream *stream ); + + +/** Cast an opaque stream pointer into a pointer to a PaUtilStreamRepresentation. + + @see PaUtilStreamRepresentation +*/ +#define PA_STREAM_REP( stream )\ + ((PaUtilStreamRepresentation*) (stream) ) + + +/** Cast an opaque stream pointer into a pointer to a PaUtilStreamInterface. + + @see PaUtilStreamRepresentation, PaUtilStreamInterface +*/ +#define PA_STREAM_INTERFACE( stream )\ + PA_STREAM_REP( (stream) )->streamInterface + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_STREAM_H */ diff --git a/portaudio-v19/src/common/pa_trace.c b/portaudio-v19/src/common/pa_trace.c new file mode 100644 index 000000000..6619d423a --- /dev/null +++ b/portaudio-v19/src/common/pa_trace.c @@ -0,0 +1,88 @@ +/* + * $Id$ + * Portable Audio I/O Library Trace Facility + * Store trace information in real-time for later printing. + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2000 Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Event trace mechanism for debugging. +*/ + + +#include +#include +#include +#include "pa_trace.h" + +#if PA_TRACE_REALTIME_EVENTS + +static char *traceTextArray[PA_MAX_TRACE_RECORDS]; +static int traceIntArray[PA_MAX_TRACE_RECORDS]; +static int traceIndex = 0; +static int traceBlock = 0; + +/*********************************************************************/ +void PaUtil_ResetTraceMessages() +{ + traceIndex = 0; +} + +/*********************************************************************/ +void PaUtil_DumpTraceMessages() +{ + int i; + int messageCount = (traceIndex < PA_MAX_TRACE_RECORDS) ? traceIndex : PA_MAX_TRACE_RECORDS; + + printf("DumpTraceMessages: traceIndex = %d\n", traceIndex ); + for( i=0; i must be included in the + context in which this macro is used. +*/ +#define PA_VALIDATE_TYPE_SIZES \ + { \ + assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaUint16 ) == 2 ); \ + assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaInt16 ) == 2 ); \ + assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaUint32 ) == 4 ); \ + assert( "PortAudio: type sizes are not correct in pa_types.h" && sizeof( PaInt32 ) == 4 ); \ + } + + +#endif /* PA_TYPES_H */ diff --git a/portaudio-v19/src/common/pa_util.h b/portaudio-v19/src/common/pa_util.h new file mode 100644 index 000000000..ab8dbe046 --- /dev/null +++ b/portaudio-v19/src/common/pa_util.h @@ -0,0 +1,167 @@ +#ifndef PA_UTIL_H +#define PA_UTIL_H +/* + * $Id$ + * Portable Audio I/O Library implementation utilities header + * common implementation utilities and interfaces + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Prototypes for utility functions used by PortAudio implementations. + + @todo Document and adhere to the alignment guarantees provided by + PaUtil_AllocateMemory(). +*/ + + +#include "portaudio.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +struct PaUtilHostApiRepresentation; + + +/** Retrieve a specific host API representation. This function can be used + by implementations to retrieve a pointer to their representation in + host api specific extension functions which aren't passed a rep pointer + by pa_front.c. + + @param hostApi A pointer to a host API represenation pointer. Apon success + this will receive the requested representation pointer. + + @param type A valid host API type identifier. + + @returns An error code. If the result is PaNoError then a pointer to the + requested host API representation will be stored in *hostApi. If the host API + specified by type is not found, this function returns paHostApiNotFound. +*/ +PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **hostApi, + PaHostApiTypeId type ); + + +/** Convert a PortAudio device index into a host API specific device index. + @param hostApiDevice Pointer to a device index, on success this will recieve the + converted device index value. + @param device The PortAudio device index to convert. + @param hostApi The host api which the index should be converted for. + + @returns On success returns PaNoError and places the converted index in the + hostApiDevice parameter. +*/ +PaError PaUtil_DeviceIndexToHostApiDeviceIndex( + PaDeviceIndex *hostApiDevice, PaDeviceIndex device, + struct PaUtilHostApiRepresentation *hostApi ); + + +/** Set the host error information returned by Pa_GetLastHostErrorInfo. This + function and the paUnanticipatedHostError error code should be used as a + last resort. Implementors should use existing PA error codes where possible, + or nominate new ones. Note that at it is always better to use + PaUtil_SetLastHostErrorInfo() and paUnanticipatedHostError than to return an + ambiguous or inaccurate PaError code. + + @param hostApiType The host API which encountered the error (ie of the caller) + + @param errorCode The error code returned by the native API function. + + @param errorText A string describing the error. PaUtil_SetLastHostErrorInfo + makes a copy of the string, so it is not necessary for the pointer to remain + valid after the call to PaUtil_SetLastHostErrorInfo() returns. + +*/ +void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode, + const char *errorText ); + + + +/** PA_DEBUG() provides a simple debug message printing facility. The macro + passes it's argument to a printf-like function called PaUtil_DebugPrint() + which prints to stderr and always flushes the stream after printing. + Because preprocessor macros cannot directly accept variable length argument + lists, calls to the macro must include an additional set of parenthesis, eg: + PA_DEBUG(("errorno: %d", 1001 )); +*/ + +void PaUtil_DebugPrint( const char *format, ... ); + +#ifdef PA_ENABLE_DEBUG_OUTPUT +#define PA_DEBUG(x) PaUtil_DebugPrint x ; +#else +#define PA_DEBUG(x) +#endif + + +/* the following functions are implemented in a platform platform specific + .c file +*/ + +/** Allocate size bytes, guaranteed to be aligned to a FIXME byte boundary */ +void *PaUtil_AllocateMemory( long size ); + + +/** Realease block if non-NULL. block may be NULL */ +void PaUtil_FreeMemory( void *block ); + + +/** Return the number of currently allocated blocks. This function can be + used for detecting memory leaks. + + @note Allocations will only be tracked if PA_TRACK_MEMORY is #defined. If + it isn't, this function will always return 0. +*/ +int PaUtil_CountCurrentlyAllocatedBlocks( void ); + + +/** Initialize the clock used by PaUtil_GetTime(). Call this before calling + PaUtil_GetTime. + + @see PaUtil_GetTime +*/ +void PaUtil_InitializeClock( void ); + + +/** Return the system time in seconds. Used to implement CPU load functions + + @see PaUtil_InitializeClock +*/ +double PaUtil_GetTime( void ); + + +/* void Pa_Sleep( long msec ); must also be implemented in per-platform .c file */ + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_UTIL_H */ diff --git a/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c b/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c new file mode 100644 index 000000000..666a2b49a --- /dev/null +++ b/portaudio-v19/src/hostapi/alsa/pa_linux_alsa.c @@ -0,0 +1,3310 @@ +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * ALSA implementation by Joshua Haberman and Arve Knudsen + * + * Copyright (c) 2002 Joshua Haberman + * Copyright (c) 2005-2006 Arve Knudsen + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +#define ALSA_PCM_NEW_HW_PARAMS_API +#define ALSA_PCM_NEW_SW_PARAMS_API +#include +#undef ALSA_PCM_NEW_HW_PARAMS_API +#undef ALSA_PCM_NEW_SW_PARAMS_API + +#include +#include /* strlen() */ +#include +#include +#include +#include +#include +#include +#include /* For sig_atomic_t */ + +#include "portaudio.h" +#include "pa_util.h" +#include "pa_unix_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + +#include "pa_linux_alsa.h" + +/* Check return value of ALSA function, and map it to PaError */ +#define ENSURE_(expr, code) \ + do { \ + if( UNLIKELY( (aErr_ = (expr)) < 0 ) ) \ + { \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( (code) == paUnanticipatedHostError && pthread_equal( pthread_self(), paUnixMainThread) ) \ + { \ + PaUtil_SetLastHostErrorInfo( paALSA, aErr_, snd_strerror( aErr_ ) ); \ + } \ + PaUtil_DebugPrint( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" ); \ + if( (code) == paUnanticipatedHostError ) \ + PA_DEBUG(( "Host error description: %s\n", snd_strerror( aErr_ ) )); \ + result = (code); \ + goto error; \ + } \ + } while( 0 ); + +#define ASSERT_CALL_(expr, success) \ + aErr_ = (expr); \ + assert( success == aErr_ ); + +static int aErr_; /* Used with ENSURE_ */ + +typedef enum +{ + StreamDirection_In, + StreamDirection_Out +} StreamDirection; + +typedef struct +{ + PaSampleFormat hostSampleFormat; + unsigned long framesPerBuffer; + int numUserChannels, numHostChannels; + int userInterleaved, hostInterleaved; + + snd_pcm_t *pcm; + snd_pcm_uframes_t bufferSize; + snd_pcm_format_t nativeFormat; + unsigned int nfds; + int ready; /* Marked ready from poll */ + void **userBuffers; + snd_pcm_uframes_t offset; + StreamDirection streamDir; + + snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */ +} PaAlsaStreamComponent; + +/* Implementation specific stream structure */ +typedef struct PaAlsaStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + PaUnixThread thread; + + unsigned long framesPerUserBuffer, maxFramesPerHostBuffer; + + int primeBuffers; + int callbackMode; /* bool: are we running in callback mode? */ + int pcmsSynced; /* Have we successfully synced pcms */ + + /* the callback thread uses these to poll the sound device(s), waiting + * for data to be ready/available */ + struct pollfd* pfds; + int pollTimeout; + + /* Used in communication between threads */ + volatile sig_atomic_t callback_finished; /* bool: are we in the "callback finished" state? */ + volatile sig_atomic_t callbackAbort; /* Drop frames? */ + volatile sig_atomic_t isActive; /* Is stream in active state? (Between StartStream and StopStream || !paContinue) */ + PaUnixMutex stateMtx; /* Used to synchronize access to stream state */ + + int neverDropInput; + + PaTime underrun; + PaTime overrun; + + PaAlsaStreamComponent capture, playback; +} +PaAlsaStream; + +/* PaAlsaHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct PaAlsaHostApiRepresentation +{ + PaUtilHostApiRepresentation baseHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + PaHostApiIndex hostApiIndex; +} +PaAlsaHostApiRepresentation; + +typedef struct PaAlsaDeviceInfo +{ + PaDeviceInfo baseDeviceInfo; + char *alsaName; + int isPlug; + int minInputChannels; + int minOutputChannels; +} +PaAlsaDeviceInfo; + +/* prototypes for functions declared in this file */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *callback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError BuildDeviceList( PaAlsaHostApiRepresentation *hostApi ); +static int SetApproximateSampleRate( snd_pcm_t *pcm, snd_pcm_hw_params_t *hwParams, double sampleRate ); +static int GetExactSampleRate( snd_pcm_hw_params_t *hwParams, double *sampleRate ); + +/* Callback prototypes */ +static void *CallbackThreadFunc( void *userData ); + +/* Blocking prototypes */ +static signed long GetStreamReadAvailable( PaStream* s ); +static signed long GetStreamWriteAvailable( PaStream* s ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); + + +static const PaAlsaDeviceInfo *GetDeviceInfo( const PaUtilHostApiRepresentation *hostApi, int device ) +{ + return (const PaAlsaDeviceInfo *)hostApi->deviceInfos[device]; +} + +static void AlsaErrorHandler(const char *file, int line, const char *function, int err, const char *fmt, ...) +{ +} + +PaError PaAlsa_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaAlsaHostApiRepresentation *alsaHostApi = NULL; + + PA_UNLESS( alsaHostApi = (PaAlsaHostApiRepresentation*) PaUtil_AllocateMemory( + sizeof(PaAlsaHostApiRepresentation) ), paInsufficientMemory ); + PA_UNLESS( alsaHostApi->allocations = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + alsaHostApi->hostApiIndex = hostApiIndex; + + *hostApi = (PaUtilHostApiRepresentation*)alsaHostApi; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paALSA; + (*hostApi)->info.name = "ALSA"; + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + ENSURE_( snd_lib_error_set_handler(AlsaErrorHandler), paUnanticipatedHostError ); + + PA_ENSURE( BuildDeviceList( alsaHostApi ) ); + + PaUtil_InitializeStreamInterface( &alsaHostApi->callbackStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, + IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &alsaHostApi->blockingStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, + IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, + GetStreamReadAvailable, + GetStreamWriteAvailable ); + + PA_ENSURE( PaUnixThreading_Initialize() ); + + return result; + +error: + if( alsaHostApi ) + { + if( alsaHostApi->allocations ) + { + PaUtil_FreeAllAllocations( alsaHostApi->allocations ); + PaUtil_DestroyAllocationGroup( alsaHostApi->allocations ); + } + + PaUtil_FreeMemory( alsaHostApi ); + } + + return result; +} + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaAlsaHostApiRepresentation *alsaHostApi = (PaAlsaHostApiRepresentation*)hostApi; + + assert( hostApi ); + + if( alsaHostApi->allocations ) + { + PaUtil_FreeAllAllocations( alsaHostApi->allocations ); + PaUtil_DestroyAllocationGroup( alsaHostApi->allocations ); + } + + PaUtil_FreeMemory( alsaHostApi ); + snd_config_update_free_global(); +} + +/** Determine max channels and default latencies. + * + * This function provides functionality to grope an opened (might be opened for capture or playback) pcm device for + * traits like max channels, suitable default latencies and default sample rate. Upon error, max channels is set to zero, + * and a suitable result returned. The device is closed before returning. + */ +static PaError GropeDevice( snd_pcm_t* pcm, int isPlug, StreamDirection mode, int openBlocking, + PaAlsaDeviceInfo* devInfo, int* canMmap ) +{ + PaError result = paNoError; + snd_pcm_hw_params_t *hwParams; + snd_pcm_uframes_t lowLatency = 512, highLatency = 2048; + unsigned int minChans, maxChans; + int* minChannels, * maxChannels; + double * defaultLowLatency, * defaultHighLatency, * defaultSampleRate = + &devInfo->baseDeviceInfo.defaultSampleRate; + double defaultSr = *defaultSampleRate; + + assert( pcm ); + + if( StreamDirection_In == mode ) + { + minChannels = &devInfo->minInputChannels; + maxChannels = &devInfo->baseDeviceInfo.maxInputChannels; + defaultLowLatency = &devInfo->baseDeviceInfo.defaultLowInputLatency; + defaultHighLatency = &devInfo->baseDeviceInfo.defaultHighInputLatency; + } + else + { + minChannels = &devInfo->minOutputChannels; + maxChannels = &devInfo->baseDeviceInfo.maxOutputChannels; + defaultLowLatency = &devInfo->baseDeviceInfo.defaultLowOutputLatency; + defaultHighLatency = &devInfo->baseDeviceInfo.defaultHighOutputLatency; + } + + ENSURE_( snd_pcm_nonblock( pcm, 0 ), paUnanticipatedHostError ); + + snd_pcm_hw_params_alloca( &hwParams ); + snd_pcm_hw_params_any( pcm, hwParams ); + + *canMmap = snd_pcm_hw_params_test_access( pcm, hwParams, SND_PCM_ACCESS_MMAP_INTERLEAVED ) >= 0 || + snd_pcm_hw_params_test_access( pcm, hwParams, SND_PCM_ACCESS_MMAP_NONINTERLEAVED ) >= 0; + + if( defaultSr >= 0 ) + { + /* Could be that the device opened in one mode supports samplerates that the other mode wont have, + * so try again .. */ + if( SetApproximateSampleRate( pcm, hwParams, defaultSr ) < 0 ) + { + defaultSr = -1.; + PA_DEBUG(( "%s: Original default samplerate failed, trying again ..\n", __FUNCTION__ )); + } + } + + if( defaultSr < 0. ) /* Default sample rate not set */ + { + unsigned int sampleRate = 44100; /* Will contain approximate rate returned by alsa-lib */ + if( snd_pcm_hw_params_set_rate_near( pcm, hwParams, &sampleRate, NULL ) < 0) + { + result = paUnanticipatedHostError; + goto error; + } + ENSURE_( GetExactSampleRate( hwParams, &defaultSr ), paUnanticipatedHostError ); + } + + ENSURE_( snd_pcm_hw_params_get_channels_min( hwParams, &minChans ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_get_channels_max( hwParams, &maxChans ), paUnanticipatedHostError ); + assert( maxChans <= INT_MAX ); + assert( maxChans > 0 ); /* Weird linking issue could cause wrong version of ALSA symbols to be called, + resulting in zeroed values */ + + /* XXX: Limit to sensible number (ALSA plugins accept a crazy amount of channels)? */ + if( isPlug && maxChans > 128 ) + { + maxChans = 128; + PA_DEBUG(( "%s: Limiting number of plugin channels to %u\n", __FUNCTION__, maxChans )); + } + + /* TWEAKME: + * + * Giving values for default min and max latency is not + * straightforward. Here are our objectives: + * + * * for low latency, we want to give the lowest value + * that will work reliably. This varies based on the + * sound card, kernel, CPU, etc. I think it is better + * to give sub-optimal latency than to give a number + * too low and cause dropouts. My conservative + * estimate at this point is to base it on 4096-sample + * latency at 44.1 kHz, which gives a latency of 23ms. + * * for high latency we want to give a large enough + * value that dropouts are basically impossible. This + * doesn't really require as much tweaking, since + * providing too large a number will just cause us to + * select the nearest setting that will work at stream + * config time. + */ + ENSURE_( snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &lowLatency ), paUnanticipatedHostError ); + + /* Have to reset hwParams, to set new buffer size */ + ENSURE_( snd_pcm_hw_params_any( pcm, hwParams ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &highLatency ), paUnanticipatedHostError ); + + *minChannels = (int)minChans; + *maxChannels = (int)maxChans; + *defaultSampleRate = defaultSr; + *defaultLowLatency = (double) lowLatency / *defaultSampleRate; + *defaultHighLatency = (double) highLatency / *defaultSampleRate; + +end: + snd_pcm_close( pcm ); + return result; + +error: + goto end; +} + +/* Initialize device info with invalid values (maxInputChannels and maxOutputChannels are set to zero since these indicate + * wether input/output is available) */ +static void InitializeDeviceInfo( PaDeviceInfo *deviceInfo ) +{ + deviceInfo->structVersion = -1; + deviceInfo->name = NULL; + deviceInfo->hostApi = -1; + deviceInfo->maxInputChannels = 0; + deviceInfo->maxOutputChannels = 0; + deviceInfo->defaultLowInputLatency = -1.; + deviceInfo->defaultLowOutputLatency = -1.; + deviceInfo->defaultHighInputLatency = -1.; + deviceInfo->defaultHighOutputLatency = -1.; + deviceInfo->defaultSampleRate = -1.; +} + +/* Helper struct */ +typedef struct +{ + char *alsaName; + char *name; + int isPlug; + int hasPlayback; + int hasCapture; +} DeviceNames; + +static PaError PaAlsa_StrDup( PaAlsaHostApiRepresentation *alsaApi, + char **dst, + const char *src) +{ + PaError result = paNoError; + int len = strlen( src ) + 1; + + /* PA_DEBUG(("PaStrDup %s %d\n", src, len)); */ + + PA_UNLESS( *dst = (char *)PaUtil_GroupAllocateMemory( alsaApi->allocations, len ), + paInsufficientMemory ); + strncpy( *dst, src, len ); + +error: + return result; +} + +/* Disregard some standard plugins + */ +static int IgnorePlugin( const char *pluginId ) +{ + /* XXX: dmix and default ignored because after opening and closing, they seem to keep hogging resources. + */ + static const char *ignoredPlugins[] = {"hw", "plughw", "plug", "dsnoop", "tee", + "file", "null", "shm", "cards", "dmix", "default", NULL}; + int i = 0; + while( ignoredPlugins[i] ) + { + if( !strcmp( pluginId, ignoredPlugins[i] ) ) + { + return 1; + } + ++i; + } + + return 0; +} + +/* Build PaDeviceInfo list, ignore devices for which we cannot determine capabilities (possibly busy, sigh) */ +static PaError BuildDeviceList( PaAlsaHostApiRepresentation *alsaApi ) +{ + PaUtilHostApiRepresentation *baseApi = &alsaApi->baseHostApiRep; + PaAlsaDeviceInfo *deviceInfoArray; + int cardIdx = -1, devIdx = 0; + snd_ctl_card_info_t *cardInfo; + PaError result = paNoError; + size_t numDeviceNames = 0, maxDeviceNames = 1, i; + DeviceNames *deviceNames = NULL; + snd_config_t *topNode = NULL; + snd_pcm_info_t *pcmInfo; + int res; + int blocking = SND_PCM_NONBLOCK; + char alsaCardName[50]; + if( getenv( "PA_ALSA_INITIALIZE_BLOCK" ) && atoi( getenv( "PA_ALSA_INITIALIZE_BLOCK" ) ) ) + blocking = 0; + + /* These two will be set to the first working input and output device, respectively */ + baseApi->info.defaultInputDevice = paNoDevice; + baseApi->info.defaultOutputDevice = paNoDevice; + + /* count the devices by enumerating all the card numbers */ + + /* snd_card_next() modifies the integer passed to it to be: + * the index of the first card if the parameter is -1 + * the index of the next card if the parameter is the index of a card + * -1 if there are no more cards + * + * The function itself returns 0 if it succeeded. */ + cardIdx = -1; + snd_ctl_card_info_alloca( &cardInfo ); + snd_pcm_info_alloca( &pcmInfo ); + while( snd_card_next( &cardIdx ) == 0 && cardIdx >= 0 ) + { + char *cardName; + int devIdx = -1; + snd_ctl_t *ctl; + char buf[50]; + + snprintf( alsaCardName, sizeof (alsaCardName), "hw:%d", cardIdx ); + + /* Acquire name of card */ + if( snd_ctl_open( &ctl, alsaCardName, 0 ) < 0 ) + { + /* Unable to open card :( */ + PA_DEBUG(( "%s: Unable to open device %s\n", __FUNCTION__, alsaCardName )); + continue; + } + snd_ctl_card_info( ctl, cardInfo ); + + PA_ENSURE( PaAlsa_StrDup( alsaApi, &cardName, snd_ctl_card_info_get_name( cardInfo )) ); + + while( snd_ctl_pcm_next_device( ctl, &devIdx ) == 0 && devIdx >= 0 ) + { + char *alsaDeviceName, *deviceName; + size_t len; + int hasPlayback = 0, hasCapture = 0; + snprintf( buf, sizeof (buf), "%s:%d,%d", "hw", cardIdx, devIdx ); + + /* Obtain info about this particular device */ + snd_pcm_info_set_device( pcmInfo, devIdx ); + snd_pcm_info_set_subdevice( pcmInfo, 0 ); + snd_pcm_info_set_stream( pcmInfo, SND_PCM_STREAM_CAPTURE ); + if( snd_ctl_pcm_info( ctl, pcmInfo ) >= 0 ) + { + hasCapture = 1; + } + + snd_pcm_info_set_stream( pcmInfo, SND_PCM_STREAM_PLAYBACK ); + if( snd_ctl_pcm_info( ctl, pcmInfo ) >= 0 ) + { + hasPlayback = 1; + } + + if( !hasPlayback && !hasCapture ) + { + continue; /* Error */ + } + + /* The length of the string written by snprintf plus terminating 0 */ + len = snprintf( NULL, 0, "%s: %s (%s)", cardName, snd_pcm_info_get_name( pcmInfo ), buf ) + 1; + PA_UNLESS( deviceName = (char *)PaUtil_GroupAllocateMemory( alsaApi->allocations, len ), + paInsufficientMemory ); + snprintf( deviceName, len, "%s: %s (%s)", cardName, + snd_pcm_info_get_name( pcmInfo ), buf ); + + ++numDeviceNames; + if( !deviceNames || numDeviceNames > maxDeviceNames ) + { + maxDeviceNames *= 2; + PA_UNLESS( deviceNames = (DeviceNames *) realloc( deviceNames, maxDeviceNames * sizeof (DeviceNames) ), + paInsufficientMemory ); + } + + PA_ENSURE( PaAlsa_StrDup( alsaApi, &alsaDeviceName, buf ) ); + + deviceNames[ numDeviceNames - 1 ].alsaName = alsaDeviceName; + deviceNames[ numDeviceNames - 1 ].name = deviceName; + deviceNames[ numDeviceNames - 1 ].isPlug = 0; + deviceNames[ numDeviceNames - 1 ].hasPlayback = hasPlayback; + deviceNames[ numDeviceNames - 1 ].hasCapture = hasCapture; + } + snd_ctl_close( ctl ); + } + + /* Iterate over plugin devices */ + if( NULL == snd_config ) + { + /* snd_config_update is called implicitly by some functions, if this hasn't happened snd_config will be NULL (bleh) */ + ENSURE_( snd_config_update(), paUnanticipatedHostError ); + PA_DEBUG(( "Updating snd_config\n" )); + } + assert( snd_config ); + if( (res = snd_config_search( snd_config, "pcm", &topNode )) >= 0 ) + { + snd_config_iterator_t i, next; + + snd_config_for_each( i, next, topNode ) + { + const char *tpStr = "unknown", *idStr = NULL; + int err = 0; + + char *alsaDeviceName, *deviceName; + snd_config_t *n = snd_config_iterator_entry( i ), * tp = NULL;; + + if( (err = snd_config_search( n, "type", &tp )) < 0 ) + { + if( -ENOENT != err ) + { + ENSURE_(err, paUnanticipatedHostError); + } + } + else + { + ENSURE_( snd_config_get_string( tp, &tpStr ), paUnanticipatedHostError ); + } + ENSURE_( snd_config_get_id( n, &idStr ), paUnanticipatedHostError ); + if( IgnorePlugin( idStr ) ) + { + PA_DEBUG(( "%s: Ignoring ALSA plugin device %s of type %s\n", __FUNCTION__, idStr, tpStr )); + continue; + } + PA_DEBUG(( "%s: Found plugin %s of type %s\n", __FUNCTION__, idStr, tpStr )); + + PA_UNLESS( alsaDeviceName = (char*)PaUtil_GroupAllocateMemory( alsaApi->allocations, + strlen(idStr) + 6 ), paInsufficientMemory ); + strcpy( alsaDeviceName, idStr ); + PA_UNLESS( deviceName = (char*)PaUtil_GroupAllocateMemory( alsaApi->allocations, + strlen(idStr) + 1 ), paInsufficientMemory ); + strcpy( deviceName, idStr ); + + ++numDeviceNames; + if( !deviceNames || numDeviceNames > maxDeviceNames ) + { + maxDeviceNames *= 2; + PA_UNLESS( deviceNames = (DeviceNames *) realloc( deviceNames, maxDeviceNames * sizeof (DeviceNames) ), + paInsufficientMemory ); + } + + deviceNames[numDeviceNames - 1].alsaName = alsaDeviceName; + deviceNames[numDeviceNames - 1].name = deviceName; + deviceNames[numDeviceNames - 1].isPlug = 1; + deviceNames[numDeviceNames - 1].hasPlayback = 1; + deviceNames[numDeviceNames - 1].hasCapture = 1; + } + } + else + PA_DEBUG(( "%s: Iterating over ALSA plugins failed: %s\n", __FUNCTION__, snd_strerror( res ) )); + + /* allocate deviceInfo memory based on the number of devices */ + PA_UNLESS( baseApi->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + alsaApi->allocations, sizeof(PaDeviceInfo*) * (numDeviceNames) ), paInsufficientMemory ); + + /* allocate all device info structs in a contiguous block */ + PA_UNLESS( deviceInfoArray = (PaAlsaDeviceInfo*)PaUtil_GroupAllocateMemory( + alsaApi->allocations, sizeof(PaAlsaDeviceInfo) * numDeviceNames ), paInsufficientMemory ); + + /* Loop over list of cards, filling in info, if a device is deemed unavailable (can't get name), + * it's ignored. + */ + /* while( snd_card_next( &cardIdx ) == 0 && cardIdx >= 0 ) */ + for( i = 0, devIdx = 0; i < numDeviceNames; ++i ) + { + snd_pcm_t *pcm; + PaAlsaDeviceInfo *deviceInfo = &deviceInfoArray[devIdx]; + PaDeviceInfo *baseDeviceInfo = &deviceInfo->baseDeviceInfo; + int canMmap = -1; + + /* Zero fields */ + InitializeDeviceInfo( baseDeviceInfo ); + + /* to determine device capabilities, we must open the device and query the + * hardware parameter configuration space */ + + /* Query capture */ + if( deviceNames[i].hasCapture && + snd_pcm_open( &pcm, deviceNames[i].alsaName, SND_PCM_STREAM_CAPTURE, blocking ) >= 0 ) + { + if( GropeDevice( pcm, deviceNames[i].isPlug, StreamDirection_In, blocking, deviceInfo, + &canMmap ) != paNoError ) + { + /* Error */ + PA_DEBUG(("%s: Failed groping %s for capture\n", __FUNCTION__, deviceNames[i].alsaName)); + continue; + } + } + + /* Query playback */ + if( deviceNames[i].hasPlayback && + snd_pcm_open( &pcm, deviceNames[i].alsaName, SND_PCM_STREAM_PLAYBACK, blocking ) >= 0 ) + { + if( GropeDevice( pcm, deviceNames[i].isPlug, StreamDirection_Out, blocking, deviceInfo, + &canMmap ) != paNoError ) + { + /* Error */ + PA_DEBUG(("%s: Failed groping %s for playback\n", __FUNCTION__, deviceNames[i].alsaName)); + continue; + } + } + + if( 0 == canMmap ) + { + PA_DEBUG(("%s: Device %s doesn't support mmap\n", __FUNCTION__, deviceNames[i].alsaName)); + continue; + } + + baseDeviceInfo->structVersion = 2; + baseDeviceInfo->hostApi = alsaApi->hostApiIndex; + baseDeviceInfo->name = deviceNames[i].name; + deviceInfo->alsaName = deviceNames[i].alsaName; + deviceInfo->isPlug = deviceNames[i].isPlug; + + /* A: Storing pointer to PaAlsaDeviceInfo object as pointer to PaDeviceInfo object. + * Should now be safe to add device info, unless the device supports neither capture nor playback + */ + if( baseDeviceInfo->maxInputChannels > 0 || baseDeviceInfo->maxOutputChannels > 0 ) + { + if( baseApi->info.defaultInputDevice == paNoDevice && baseDeviceInfo->maxInputChannels > 0 ) + baseApi->info.defaultInputDevice = devIdx; + if( baseApi->info.defaultOutputDevice == paNoDevice && baseDeviceInfo->maxOutputChannels > 0 ) + baseApi->info.defaultOutputDevice = devIdx; + PA_DEBUG(("%s: Adding device %s\n", __FUNCTION__, deviceNames[i].name)); + baseApi->deviceInfos[devIdx++] = (PaDeviceInfo *) deviceInfo; + } + } + free( deviceNames ); + + baseApi->info.deviceCount = devIdx; /* Number of successfully queried devices */ + +end: + return result; + +error: + /* No particular action */ + goto end; +} + +/* Check against known device capabilities */ +static PaError ValidateParameters( const PaStreamParameters *parameters, PaUtilHostApiRepresentation *hostApi, StreamDirection mode ) +{ + PaError result = paNoError; + int maxChans; + const PaAlsaDeviceInfo *deviceInfo = NULL; + assert( parameters ); + + if( parameters->device != paUseHostApiSpecificDeviceSpecification ) + { + assert( parameters->device < hostApi->info.deviceCount ); + PA_UNLESS( parameters->hostApiSpecificStreamInfo == NULL, paBadIODeviceCombination ); + deviceInfo = GetDeviceInfo( hostApi, parameters->device ); + } + else + { + const PaAlsaStreamInfo *streamInfo = parameters->hostApiSpecificStreamInfo; + + PA_UNLESS( parameters->device == paUseHostApiSpecificDeviceSpecification, paInvalidDevice ); + PA_UNLESS( streamInfo->size == sizeof (PaAlsaStreamInfo) && streamInfo->version == 1, + paIncompatibleHostApiSpecificStreamInfo ); + PA_UNLESS( streamInfo->deviceString != NULL, paInvalidDevice ); + + /* Skip further checking */ + return paNoError; + } + + assert( deviceInfo ); + assert( parameters->hostApiSpecificStreamInfo == NULL ); + maxChans = (StreamDirection_In == mode ? deviceInfo->baseDeviceInfo.maxInputChannels : + deviceInfo->baseDeviceInfo.maxOutputChannels); + PA_UNLESS( parameters->channelCount <= maxChans, paInvalidChannelCount ); + +error: + return result; +} + +/* Given an open stream, what sample formats are available? */ +static PaSampleFormat GetAvailableFormats( snd_pcm_t *pcm ) +{ + PaSampleFormat available = 0; + snd_pcm_hw_params_t *hwParams; + snd_pcm_hw_params_alloca( &hwParams ); + + snd_pcm_hw_params_any( pcm, hwParams ); + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_FLOAT ) >= 0) + available |= paFloat32; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_S32 ) >= 0) + available |= paInt32; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_S24 ) >= 0) + available |= paInt24; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_S16 ) >= 0) + available |= paInt16; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_U8 ) >= 0) + available |= paUInt8; + + if( snd_pcm_hw_params_test_format( pcm, hwParams, SND_PCM_FORMAT_S8 ) >= 0) + available |= paInt8; + + return available; +} + +static snd_pcm_format_t Pa2AlsaFormat( PaSampleFormat paFormat ) +{ + switch( paFormat ) + { + case paFloat32: + return SND_PCM_FORMAT_FLOAT; + + case paInt16: + return SND_PCM_FORMAT_S16; + + case paInt24: + return SND_PCM_FORMAT_S24; + + case paInt32: + return SND_PCM_FORMAT_S32; + + case paInt8: + return SND_PCM_FORMAT_S8; + + case paUInt8: + return SND_PCM_FORMAT_U8; + + default: + return SND_PCM_FORMAT_UNKNOWN; + } +} + +/** Open an ALSA pcm handle. + * + * The device to be open can be specified in a custom PaAlsaStreamInfo struct, or it will be a device number. In case of a + * device number, it maybe specified through an env variable (PA_ALSA_PLUGHW) that we should open the corresponding plugin + * device. + */ +static PaError AlsaOpen( const PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *params, StreamDirection + streamDir, snd_pcm_t **pcm ) +{ + PaError result = paNoError; + int ret; + const char *deviceName = alloca( 50 ); + const PaAlsaDeviceInfo *deviceInfo = NULL; + PaAlsaStreamInfo *streamInfo = (PaAlsaStreamInfo *)params->hostApiSpecificStreamInfo; + + if( !streamInfo ) + { + int usePlug = 0; + deviceInfo = GetDeviceInfo( hostApi, params->device ); + + /* If device name starts with hw: and PA_ALSA_PLUGHW is 1, we open the plughw device instead */ + if( !strncmp( "hw:", deviceInfo->alsaName, 3 ) && getenv( "PA_ALSA_PLUGHW" ) ) + usePlug = atoi( getenv( "PA_ALSA_PLUGHW" ) ); + if( usePlug ) + snprintf( (char *) deviceName, 50, "plug%s", deviceInfo->alsaName ); + else + deviceName = deviceInfo->alsaName; + } + else + deviceName = streamInfo->deviceString; + + PA_DEBUG(( "%s: Opening device %s\n", __FUNCTION__, deviceName )); + if( (ret = snd_pcm_open( pcm, deviceName, streamDir == StreamDirection_In ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK, + SND_PCM_NONBLOCK )) < 0 ) + { + /* Not to be closed */ + *pcm = NULL; + ENSURE_( ret, ret == -EBUSY ? paDeviceUnavailable : paBadIODeviceCombination ); + } + ENSURE_( snd_pcm_nonblock( *pcm, 0 ), paUnanticipatedHostError ); + +end: + return result; + +error: + goto end; +} + +static PaError TestParameters( const PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *parameters, + double sampleRate, StreamDirection streamDir ) +{ + PaError result = paNoError; + snd_pcm_t *pcm = NULL; + PaSampleFormat availableFormats; + /* We are able to adapt to a number of channels less than what the device supports */ + unsigned int numHostChannels; + PaSampleFormat hostFormat; + snd_pcm_hw_params_t *hwParams; + snd_pcm_hw_params_alloca( &hwParams ); + + if( !parameters->hostApiSpecificStreamInfo ) + { + const PaAlsaDeviceInfo *devInfo = GetDeviceInfo( hostApi, parameters->device ); + numHostChannels = PA_MAX( parameters->channelCount, StreamDirection_In == streamDir ? + devInfo->minInputChannels : devInfo->minOutputChannels ); + } + else + numHostChannels = parameters->channelCount; + + PA_ENSURE( AlsaOpen( hostApi, parameters, streamDir, &pcm ) ); + + snd_pcm_hw_params_any( pcm, hwParams ); + + if( SetApproximateSampleRate( pcm, hwParams, sampleRate ) < 0 ) + { + result = paInvalidSampleRate; + goto error; + } + + if( snd_pcm_hw_params_set_channels( pcm, hwParams, numHostChannels ) < 0 ) + { + result = paInvalidChannelCount; + goto error; + } + + /* See if we can find a best possible match */ + availableFormats = GetAvailableFormats( pcm ); + PA_ENSURE( hostFormat = PaUtil_SelectClosestAvailableFormat( availableFormats, parameters->sampleFormat ) ); + ENSURE_( snd_pcm_hw_params_set_format( pcm, hwParams, Pa2AlsaFormat( hostFormat ) ), paUnanticipatedHostError ); + + { + /* It happens that this call fails because the device is busy */ + int ret = 0; + if( (ret = snd_pcm_hw_params( pcm, hwParams )) < 0) + { + ENSURE_( ret, ret == -EBUSY ? paDeviceUnavailable : paUnanticipatedHostError ); + } + } + +end: + if( pcm ) + { + snd_pcm_close( pcm ); + } + return result; + +error: + goto end; +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount = 0, outputChannelCount = 0; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaError result = paFormatIsSupported; + + if( inputParameters ) + { + PA_ENSURE( ValidateParameters( inputParameters, hostApi, StreamDirection_In ) ); + + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + } + + if( outputParameters ) + { + PA_ENSURE( ValidateParameters( outputParameters, hostApi, StreamDirection_Out ) ); + + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + } + + if( inputChannelCount ) + { + if( (result = TestParameters( hostApi, inputParameters, sampleRate, StreamDirection_In )) + != paNoError ) + goto error; + } + if ( outputChannelCount ) + { + if( (result = TestParameters( hostApi, outputParameters, sampleRate, StreamDirection_Out )) + != paNoError ) + goto error; + } + + return paFormatIsSupported; + +error: + return result; +} + +static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, PaAlsaHostApiRepresentation *alsaApi, + const PaStreamParameters *params, StreamDirection streamDir, int callbackMode ) +{ + PaError result = paNoError; + PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat; + assert( params->channelCount > 0 ); + + /* Make sure things have an initial value */ + memset( self, 0, sizeof (PaAlsaStreamComponent) ); + + if( NULL == params->hostApiSpecificStreamInfo ) + { + const PaAlsaDeviceInfo *devInfo = GetDeviceInfo( &alsaApi->baseHostApiRep, params->device ); + self->numHostChannels = PA_MAX( params->channelCount, StreamDirection_In == streamDir ? devInfo->minInputChannels + : devInfo->minOutputChannels ); + } + else + { + /* We're blissfully unaware of the minimum channelCount */ + self->numHostChannels = params->channelCount; + } + + PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) ); + self->nfds = snd_pcm_poll_descriptors_count( self->pcm ); + hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ); + + self->hostSampleFormat = hostSampleFormat; + self->nativeFormat = Pa2AlsaFormat( hostSampleFormat ); + self->hostInterleaved = self->userInterleaved = !(userSampleFormat & paNonInterleaved); + self->numUserChannels = params->channelCount; + self->streamDir = streamDir; + + if( !callbackMode && !self->userInterleaved ) + { + /* Pre-allocate non-interleaved user provided buffers */ + PA_UNLESS( self->userBuffers = PaUtil_AllocateMemory( sizeof (void *) * self->numUserChannels ), + paInsufficientMemory ); + } + +error: + return result; +} + +static void PaAlsaStreamComponent_Terminate( PaAlsaStreamComponent *self ) +{ + snd_pcm_close( self->pcm ); + if( self->userBuffers ) + PaUtil_FreeMemory( self->userBuffers ); +} + +int nearbyint_(float value) { + if( value - (int)value > .5 ) + return (int)ceil( value ); + return (int)floor( value ); +} + +/** Initiate configuration, preparing for determining a period size suitable for both capture and playback components. + * + */ +static PaError PaAlsaStreamComponent_InitialConfigure( PaAlsaStreamComponent *self, const PaStreamParameters *params, + int primeBuffers, snd_pcm_hw_params_t *hwParams, double *sampleRate ) +{ + /* Configuration consists of setting all of ALSA's parameters. + * These parameters come in two flavors: hardware parameters + * and software paramters. Hardware parameters will affect + * the way the device is initialized, software parameters + * affect the way ALSA interacts with me, the user-level client. + */ + + PaError result = paNoError; + snd_pcm_access_t accessMode, alternateAccessMode; + int dir = 0; + snd_pcm_t *pcm = self->pcm; + double sr = *sampleRate; + unsigned int minPeriods = 2; + + /* self->framesPerBuffer = framesPerHostBuffer; */ + + /* ... fill up the configuration space with all possibile + * combinations of parameters this device will accept */ + ENSURE_( snd_pcm_hw_params_any( pcm, hwParams ), paUnanticipatedHostError ); + + ENSURE_( snd_pcm_hw_params_set_periods_integer( pcm, hwParams ), paUnanticipatedHostError ); + /* I think there should be at least 2 periods (even though ALSA doesn't appear to enforce this) */ + dir = 0; + ENSURE_( snd_pcm_hw_params_set_periods_min( pcm, hwParams, &minPeriods, &dir ), paUnanticipatedHostError ); + + if( self->userInterleaved ) + { + accessMode = SND_PCM_ACCESS_MMAP_INTERLEAVED; + alternateAccessMode = SND_PCM_ACCESS_MMAP_NONINTERLEAVED; + } + else + { + accessMode = SND_PCM_ACCESS_MMAP_NONINTERLEAVED; + alternateAccessMode = SND_PCM_ACCESS_MMAP_INTERLEAVED; + } + /* If requested access mode fails, try alternate mode */ + if( snd_pcm_hw_params_set_access( pcm, hwParams, accessMode ) < 0 ) + { + int err = 0; + if( (err = snd_pcm_hw_params_set_access( pcm, hwParams, alternateAccessMode )) < 0) + { + result = paUnanticipatedHostError; + if( -EINVAL == err ) + { + PaUtil_SetLastHostErrorInfo( paALSA, err, "PA ALSA requires that a device supports mmap access" ); + } + else + { + PaUtil_SetLastHostErrorInfo( paALSA, err, snd_strerror( err ) ); + } + goto error; + } + /* Flip mode */ + self->hostInterleaved = !self->userInterleaved; + } + + ENSURE_( snd_pcm_hw_params_set_format( pcm, hwParams, self->nativeFormat ), paUnanticipatedHostError ); + + ENSURE_( SetApproximateSampleRate( pcm, hwParams, sr ), paInvalidSampleRate ); + ENSURE_( GetExactSampleRate( hwParams, &sr ), paUnanticipatedHostError ); + /* reject if there's no sample rate within 1% of the one requested */ + if( (fabs( *sampleRate - sr ) / *sampleRate) > 0.01 ) + { + PA_DEBUG(("%s: Wanted %f, closest sample rate was %d\n", __FUNCTION__, sampleRate, sr )); + PA_ENSURE( paInvalidSampleRate ); + } + + ENSURE_( snd_pcm_hw_params_set_channels( pcm, hwParams, self->numHostChannels ), paInvalidChannelCount ); + + *sampleRate = sr; + +end: + return result; + +error: + /* No particular action */ + goto end; +} + +/** Finish the configuration of the component's ALSA device. + * + * As part of this method, the component's bufferSize attribute will be set. + * @param latency: The latency for this component. + */ +static PaError PaAlsaStreamComponent_FinishConfigure( PaAlsaStreamComponent *self, snd_pcm_hw_params_t* hwParams, + const PaStreamParameters *params, int primeBuffers, double sampleRate, PaTime* latency ) +{ + PaError result = paNoError; + snd_pcm_sw_params_t* swParams; + snd_pcm_uframes_t bufSz = 0; + *latency = -1.; + + snd_pcm_sw_params_alloca( &swParams ); + + bufSz = (params->suggestedLatency * sampleRate) + self->framesPerBuffer; /* One period does not count as latency */ + ENSURE_( snd_pcm_hw_params_set_buffer_size_near( self->pcm, hwParams, &bufSz ), paUnanticipatedHostError ); + + /* Set the parameters! */ + ENSURE_( snd_pcm_hw_params( self->pcm, hwParams ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_get_buffer_size( hwParams, &self->bufferSize ), paUnanticipatedHostError ); + /* Latency in seconds, one period is not counted as latency */ + *latency = (self->bufferSize - self->framesPerBuffer) / sampleRate; + + /* Now software parameters... */ + ENSURE_( snd_pcm_sw_params_current( self->pcm, swParams ), paUnanticipatedHostError ); + + ENSURE_( snd_pcm_sw_params_set_start_threshold( self->pcm, swParams, self->framesPerBuffer ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_stop_threshold( self->pcm, swParams, self->bufferSize ), paUnanticipatedHostError ); + + /* Silence buffer in the case of underrun */ + if( !primeBuffers ) /* XXX: Make sense? */ + { + snd_pcm_uframes_t boundary; + ENSURE_( snd_pcm_sw_params_get_boundary( swParams, &boundary ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_silence_threshold( self->pcm, swParams, 0 ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_silence_size( self->pcm, swParams, boundary ), paUnanticipatedHostError ); + } + + ENSURE_( snd_pcm_sw_params_set_avail_min( self->pcm, swParams, self->framesPerBuffer ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_xfer_align( self->pcm, swParams, 1 ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_tstamp_mode( self->pcm, swParams, SND_PCM_TSTAMP_MMAP ), paUnanticipatedHostError ); + + /* Set the parameters! */ + ENSURE_( snd_pcm_sw_params( self->pcm, swParams ), paUnanticipatedHostError ); + +error: + return result; +} + +static PaError PaAlsaStream_Initialize( PaAlsaStream *self, PaAlsaHostApiRepresentation *alsaApi, const PaStreamParameters *inParams, + const PaStreamParameters *outParams, double sampleRate, unsigned long framesPerUserBuffer, PaStreamCallback callback, + PaStreamFlags streamFlags, void *userData ) +{ + PaError result = paNoError; + assert( self ); + + memset( self, 0, sizeof (PaAlsaStream) ); + + if( NULL != callback ) + { + PaUtil_InitializeStreamRepresentation( &self->streamRepresentation, + &alsaApi->callbackStreamInterface, + callback, userData ); + self->callbackMode = 1; + } + else + { + PaUtil_InitializeStreamRepresentation( &self->streamRepresentation, + &alsaApi->blockingStreamInterface, + NULL, userData ); + } + + self->framesPerUserBuffer = framesPerUserBuffer; + self->neverDropInput = streamFlags & paNeverDropInput; + /* XXX: Ignore paPrimeOutputBuffersUsingStreamCallback untill buffer priming is fully supported in pa_process.c */ + /* + if( outParams & streamFlags & paPrimeOutputBuffersUsingStreamCallback ) + self->primeBuffers = 1; + */ + memset( &self->capture, 0, sizeof (PaAlsaStreamComponent) ); + memset( &self->playback, 0, sizeof (PaAlsaStreamComponent) ); + if( inParams ) + { + PA_ENSURE( PaAlsaStreamComponent_Initialize( &self->capture, alsaApi, inParams, StreamDirection_In, NULL != callback ) ); + } + if( outParams ) + { + PA_ENSURE( PaAlsaStreamComponent_Initialize( &self->playback, alsaApi, outParams, StreamDirection_Out, NULL != callback ) ); + } + + assert( self->capture.nfds || self->playback.nfds ); + + PA_UNLESS( self->pfds = (struct pollfd*)PaUtil_AllocateMemory( (self->capture.nfds + + self->playback.nfds) * sizeof (struct pollfd) ), paInsufficientMemory ); + + PaUtil_InitializeCpuLoadMeasurer( &self->cpuLoadMeasurer, sampleRate ); + ASSERT_CALL_( PaUnixMutex_Initialize( &self->stateMtx ), paNoError ); + +error: + return result; +} + +/** Free resources associated with stream, and eventually stream itself. + * + * Frees allocated memory, and terminates individual StreamComponents. + */ +static void PaAlsaStream_Terminate( PaAlsaStream *self ) +{ + assert( self ); + + if( self->capture.pcm ) + { + PaAlsaStreamComponent_Terminate( &self->capture ); + } + if( self->playback.pcm ) + { + PaAlsaStreamComponent_Terminate( &self->playback ); + } + + PaUtil_FreeMemory( self->pfds ); + ASSERT_CALL_( PaUnixMutex_Terminate( &self->stateMtx ), paNoError ); + + PaUtil_FreeMemory( self ); +} + +/** Calculate polling timeout + * + * @param frames Time to wait + * @return Polling timeout in milliseconds + */ +static int CalculatePollTimeout( const PaAlsaStream *stream, unsigned long frames ) +{ + assert( stream->streamRepresentation.streamInfo.sampleRate > 0.0 ); + /* Period in msecs, rounded up */ + return (int)ceil( 1000 * frames / stream->streamRepresentation.streamInfo.sampleRate ); +} + +/** Determine size per host buffer. + * + * During this method call, the component's framesPerBuffer attribute gets computed, and the corresponding period size + * gets configured for the device. + * @param accurate: If the configured period size is non-integer, this will be set to 0. + */ +static PaError PaAlsaStreamComponent_DetermineFramesPerBuffer( PaAlsaStreamComponent* self, const PaStreamParameters* params, + unsigned long framesPerUserBuffer, double sampleRate, snd_pcm_hw_params_t* hwParams, int* accurate ) +{ + PaError result = paNoError; + unsigned long bufferSize = params->suggestedLatency * sampleRate, framesPerHostBuffer; + int dir = 0; + + { + snd_pcm_uframes_t tmp; + snd_pcm_hw_params_get_buffer_size_min( hwParams, &tmp ); + bufferSize = PA_MAX( bufferSize, tmp ); + snd_pcm_hw_params_get_buffer_size_max( hwParams, &tmp ); + bufferSize = PA_MIN( bufferSize, tmp ); + } + + assert( bufferSize > 0 ); + + if( framesPerUserBuffer != paFramesPerBufferUnspecified ) + { + /* Preferably the host buffer size should be a multiple of the user buffer size */ + + if( bufferSize > framesPerUserBuffer ) + { + snd_pcm_uframes_t remainder = bufferSize % framesPerUserBuffer; + if( remainder > framesPerUserBuffer / 2. ) + bufferSize += framesPerUserBuffer - remainder; + else + bufferSize -= remainder; + + assert( bufferSize % framesPerUserBuffer == 0 ); + } + else if( framesPerUserBuffer % bufferSize != 0 ) + { + /* Find a good compromise between user specified latency and buffer size */ + if( bufferSize > framesPerUserBuffer * .75 ) + { + bufferSize = framesPerUserBuffer; + } + else + { + snd_pcm_uframes_t newSz = framesPerUserBuffer; + while( newSz / 2 >= bufferSize ) + { + if( framesPerUserBuffer % (newSz / 2) != 0 ) + { + /* No use dividing any further */ + break; + } + newSz /= 2; + } + bufferSize = newSz; + } + + assert( framesPerUserBuffer % bufferSize == 0 ); + } + } + + /* Using 5 as a base number of periods, we try to approximate the suggested latency (+1 period), + finding a combination of period/buffer size which best fits these constraints */ + { + unsigned numPeriods = 4, maxPeriods = 0; + /* It may be that the device only supports 2 periods for instance */ + dir = 0; + ENSURE_( snd_pcm_hw_params_get_periods_max( hwParams, &maxPeriods, &dir ), paUnanticipatedHostError ); + assert( maxPeriods > 1 ); + /* One period is not counted as latency */ + maxPeriods -= 1; + numPeriods = PA_MIN( maxPeriods, numPeriods ); + + if( framesPerUserBuffer != paFramesPerBufferUnspecified ) + { + framesPerHostBuffer = framesPerUserBuffer; + if( framesPerHostBuffer < bufferSize ) + { + while( bufferSize / framesPerHostBuffer > numPeriods ) + { + framesPerHostBuffer *= 2; + } + } + else + { + while( bufferSize / framesPerHostBuffer < numPeriods ) + { + if( framesPerUserBuffer % (framesPerHostBuffer / 2) != 0 ) + { + /* Can't be divided any further */ + break; + } + framesPerHostBuffer /= 2; + } + } + + if( framesPerHostBuffer < framesPerUserBuffer ) + { + assert( framesPerUserBuffer % framesPerHostBuffer == 0 ); + if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer, 0 ) < 0 ) + { + if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer * 2, 0 ) == 0 ) + framesPerHostBuffer *= 2; + else if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer / 2, 0 ) == 0 ) + framesPerHostBuffer /= 2; + } + } + else + { + assert( framesPerHostBuffer % framesPerUserBuffer == 0 ); + if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer, 0 ) < 0 ) + { + if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer + framesPerUserBuffer, 0 ) == 0 ) + framesPerHostBuffer += framesPerUserBuffer; + else if( snd_pcm_hw_params_test_period_size( self->pcm, hwParams, framesPerHostBuffer - framesPerUserBuffer, 0 ) == 0 ) + framesPerHostBuffer -= framesPerUserBuffer; + } + } + } + else + { + framesPerHostBuffer = bufferSize / numPeriods; + } + } + + assert( framesPerHostBuffer > 0 ); + { + snd_pcm_uframes_t min = 0, max = 0; + ENSURE_( snd_pcm_hw_params_get_period_size_min( hwParams, &min, NULL ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_get_period_size_max( hwParams, &max, NULL ), paUnanticipatedHostError ); + + if( framesPerHostBuffer < min ) + { + framesPerHostBuffer = min; + PA_DEBUG(( "%s: The determined period size (%lu) is less than minimum (%lu)\n", __FUNCTION__, + framesPerHostBuffer, min )); + } + else if( framesPerHostBuffer > max ) + { + framesPerHostBuffer = max; + PA_DEBUG(( "%s: The determined period size (%lu) is greater than maximum (%lu)\n", __FUNCTION__, + framesPerHostBuffer, max )); + } + + assert( framesPerHostBuffer >= min && framesPerHostBuffer <= max ); + dir = 0; + ENSURE_( snd_pcm_hw_params_set_period_size_near( self->pcm, hwParams, &framesPerHostBuffer, &dir ), + paUnanticipatedHostError ); + if( dir != 0 ) + { + PA_DEBUG(( "%s: The configured period size is non-integer.\n", __FUNCTION__, dir )); + *accurate = 0; + } + } + self->framesPerBuffer = framesPerHostBuffer; + +error: + return result; +} + +/* We need to determine how many frames per host buffer (period) to use. Our + * goals are to provide the best possible performance, but also to + * honor the requested latency settings as closely as we can. Therefore this + * decision is based on: + * + * - the period sizes that playback and/or capture support. The + * host buffer size has to be one of these. + * - the number of periods that playback and/or capture support. + * + * We want to make period_size*(num_periods-1) to be as close as possible + * to latency*rate for both playback and capture. + * + * This method will determine suitable period sizes for capture and playback handles, and report the maximum number of + * frames per host buffer. The latter is relevant, in case we should be so unfortunate that the period size differs + * between capture and playback. If this should happen, the stream's hostBufferSizeMode attribute will be set to + * paUtilBoundedHostBufferSize, because the best we can do is limit the size of individual host buffers to the upper + * bound. The size of host buffers scheduled for processing should only matter if the user has specified a buffer size, + * but when he/she does we must strive for an optimal configuration. By default we'll opt for a fixed host buffer size, + * which should be fine if the period size is the same for capture and playback. In general, if there is a specified user + * buffer size, this method tries it best to determine a period size which is a multiple of the user buffer size. + * + * The framesPerBuffer attributes of the individual capture and playback components of the stream are set to corresponding + * values determined here. Since these should be reported as + * + * This is one of those blocks of code that will just take a lot of + * refinement to be any good. + * + * In the full-duplex case it is possible that the routine was unable + * to find a number of frames per buffer acceptable to both devices + * TODO: Implement an algorithm to find the value closest to acceptance + * by both devices, to minimize difference between period sizes? + * + * @param determinedFramesPerHostBuffer: The determined host buffer size. + */ +static PaError PaAlsaStream_DetermineFramesPerBuffer( PaAlsaStream* self, double sampleRate, const PaStreamParameters* inputParameters, + const PaStreamParameters* outputParameters, unsigned long framesPerUserBuffer, snd_pcm_hw_params_t* hwParamsCapture, + snd_pcm_hw_params_t* hwParamsPlayback, PaUtilHostBufferSizeMode* hostBufferSizeMode ) +{ + PaError result = paNoError; + unsigned long framesPerHostBuffer = 0; + int dir = 0; + int accurate = 1; + + if( self->capture.pcm && self->playback.pcm ) + { + if( framesPerUserBuffer == paFramesPerBufferUnspecified ) + { + snd_pcm_uframes_t desiredLatency, e, minPeriodSize, maxPeriodSize, optimalPeriodSize, periodSize, + minCapture, minPlayback, maxCapture, maxPlayback; + + /* Come up with a common desired latency */ + + dir = 0; + ENSURE_( snd_pcm_hw_params_get_period_size_min( hwParamsCapture, &minCapture, &dir ), paUnanticipatedHostError ); + dir = 0; + ENSURE_( snd_pcm_hw_params_get_period_size_min( hwParamsPlayback, &minPlayback, &dir ), paUnanticipatedHostError ); + dir = 0; + ENSURE_( snd_pcm_hw_params_get_period_size_max( hwParamsCapture, &maxCapture, &dir ), paUnanticipatedHostError ); + dir = 0; + ENSURE_( snd_pcm_hw_params_get_period_size_max( hwParamsPlayback, &maxPlayback, &dir ), paUnanticipatedHostError ); + minPeriodSize = PA_MAX( minPlayback, minCapture ); + maxPeriodSize = PA_MIN( maxPlayback, maxCapture ); + PA_UNLESS( minPeriodSize <= maxPeriodSize, paBadIODeviceCombination ); + + desiredLatency = (snd_pcm_uframes_t)(PA_MIN( outputParameters->suggestedLatency, inputParameters->suggestedLatency ) + * sampleRate); + /* Clamp desiredLatency */ + { + snd_pcm_uframes_t maxBufferSize; + snd_pcm_uframes_t maxBufferSizeCapture, maxBufferSizePlayback; + ENSURE_( snd_pcm_hw_params_get_buffer_size_max( hwParamsCapture, &maxBufferSizeCapture ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_get_buffer_size_max( hwParamsPlayback, &maxBufferSizePlayback ), paUnanticipatedHostError ); + maxBufferSize = PA_MIN( maxBufferSizeCapture, maxBufferSizePlayback ); + + desiredLatency = PA_MIN( desiredLatency, maxBufferSize ); + } + + /* Find the closest power of 2 */ + e = ilogb( minPeriodSize ); + if( minPeriodSize & (minPeriodSize - 1) ) + e += 1; + periodSize = (snd_pcm_uframes_t)pow( 2, e ); + + while( periodSize <= maxPeriodSize ) + { + if( snd_pcm_hw_params_test_period_size( self->playback.pcm, hwParamsPlayback, periodSize, 0 ) >= 0 && + snd_pcm_hw_params_test_period_size( self->capture.pcm, hwParamsCapture, periodSize, 0 ) >= 0 ) + break; /* Ok! */ + + periodSize *= 2; + } + + /* 4 periods considered optimal */ + optimalPeriodSize = PA_MAX( desiredLatency / 4, minPeriodSize ); + optimalPeriodSize = PA_MIN( optimalPeriodSize, maxPeriodSize ); + + /* Find the closest power of 2 */ + e = ilogb( optimalPeriodSize ); + if( optimalPeriodSize & (optimalPeriodSize - 1) ) + e += 1; + optimalPeriodSize = (snd_pcm_uframes_t)pow( 2, e ); + + while( optimalPeriodSize >= periodSize ) + { + if( snd_pcm_hw_params_test_period_size( self->capture.pcm, hwParamsCapture, optimalPeriodSize, 0 ) < 0 ) + continue; + if( snd_pcm_hw_params_test_period_size( self->playback.pcm, hwParamsPlayback, optimalPeriodSize, 0 ) >= 0 ) + break; + optimalPeriodSize /= 2; + } + if( optimalPeriodSize > periodSize ) + periodSize = optimalPeriodSize; + + if( periodSize <= maxPeriodSize ) + { + /* Looks good, the periodSize _should_ be acceptable by both devices */ + ENSURE_( snd_pcm_hw_params_set_period_size( self->capture.pcm, hwParamsCapture, periodSize, 0 ), + paUnanticipatedHostError ); + ENSURE_( snd_pcm_hw_params_set_period_size( self->playback.pcm, hwParamsPlayback, periodSize, 0 ), + paUnanticipatedHostError ); + self->capture.framesPerBuffer = self->playback.framesPerBuffer = periodSize; + framesPerHostBuffer = periodSize; + } + else + { + /* Unable to find a common period size, oh well */ + optimalPeriodSize = PA_MAX( desiredLatency / 4, minPeriodSize ); + optimalPeriodSize = PA_MIN( optimalPeriodSize, maxPeriodSize ); + + self->capture.framesPerBuffer = optimalPeriodSize; + dir = 0; + ENSURE_( snd_pcm_hw_params_set_period_size_near( self->capture.pcm, hwParamsCapture, &self->capture.framesPerBuffer, &dir ), + paUnanticipatedHostError ); + self->playback.framesPerBuffer = optimalPeriodSize; + dir = 0; + ENSURE_( snd_pcm_hw_params_set_period_size_near( self->playback.pcm, hwParamsPlayback, &self->playback.framesPerBuffer, &dir ), + paUnanticipatedHostError ); + framesPerHostBuffer = PA_MAX( self->capture.framesPerBuffer, self->playback.framesPerBuffer ); + *hostBufferSizeMode = paUtilBoundedHostBufferSize; + } + } + else + { + /* We choose the simple route and determine a suitable number of frames per buffer for one component of + * the stream, then we hope that this will work for the other component too (it should!). + */ + + unsigned maxPeriods = 0; + PaAlsaStreamComponent* first = &self->capture, * second = &self->playback; + const PaStreamParameters* firstStreamParams = inputParameters; + snd_pcm_hw_params_t* firstHwParams = hwParamsCapture, * secondHwParams = hwParamsPlayback; + + dir = 0; + ENSURE_( snd_pcm_hw_params_get_periods_max( hwParamsPlayback, &maxPeriods, &dir ), paUnanticipatedHostError ); + if( maxPeriods < 4 ) + { + /* The playback component is trickier to get right, try that first */ + first = &self->playback; + second = &self->capture; + firstStreamParams = outputParameters; + firstHwParams = hwParamsPlayback; + secondHwParams = hwParamsCapture; + } + + PA_ENSURE( PaAlsaStreamComponent_DetermineFramesPerBuffer( first, firstStreamParams, framesPerUserBuffer, + sampleRate, firstHwParams, &accurate ) ); + + second->framesPerBuffer = first->framesPerBuffer; + dir = 0; + ENSURE_( snd_pcm_hw_params_set_period_size_near( second->pcm, secondHwParams, &second->framesPerBuffer, &dir ), + paUnanticipatedHostError ); + if( self->capture.framesPerBuffer == self->playback.framesPerBuffer ) + { + framesPerHostBuffer = self->capture.framesPerBuffer; + } + else + { + framesPerHostBuffer = PA_MAX( self->capture.framesPerBuffer, self->playback.framesPerBuffer ); + *hostBufferSizeMode = paUtilBoundedHostBufferSize; + } + } + } + else /* half-duplex is a slightly simpler case */ + { + if( self->capture.pcm ) + { + PA_ENSURE( PaAlsaStreamComponent_DetermineFramesPerBuffer( &self->capture, inputParameters, framesPerUserBuffer, + sampleRate, hwParamsCapture, &accurate) ); + framesPerHostBuffer = self->capture.framesPerBuffer; + } + else + { + assert( self->playback.pcm ); + PA_ENSURE( PaAlsaStreamComponent_DetermineFramesPerBuffer( &self->playback, outputParameters, framesPerUserBuffer, + sampleRate, hwParamsPlayback, &accurate ) ); + framesPerHostBuffer = self->playback.framesPerBuffer; + } + } + + PA_UNLESS( framesPerHostBuffer != 0, paInternalError ); + self->maxFramesPerHostBuffer = framesPerHostBuffer; + + if( !accurate ) + { + /* Don't know the exact size per host buffer */ + *hostBufferSizeMode = paUtilBoundedHostBufferSize; + /* Raise upper bound */ + ++self->maxFramesPerHostBuffer; + } + +error: + return result; +} + +/** Set up ALSA stream parameters. + * + */ +static PaError PaAlsaStream_Configure( PaAlsaStream *self, const PaStreamParameters *inParams, const PaStreamParameters* + outParams, double sampleRate, unsigned long framesPerUserBuffer, double* inputLatency, double* outputLatency, + PaUtilHostBufferSizeMode* hostBufferSizeMode ) +{ + PaError result = paNoError; + double realSr = sampleRate; + snd_pcm_hw_params_t* hwParamsCapture, * hwParamsPlayback; + + snd_pcm_hw_params_alloca( &hwParamsCapture ); + snd_pcm_hw_params_alloca( &hwParamsPlayback ); + + if( self->capture.pcm ) + PA_ENSURE( PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, + &realSr ) ); + if( self->playback.pcm ) + PA_ENSURE( PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, + &realSr ) ); + + PA_ENSURE( PaAlsaStream_DetermineFramesPerBuffer( self, realSr, inParams, outParams, framesPerUserBuffer, + hwParamsCapture, hwParamsPlayback, hostBufferSizeMode ) ); + + if( self->capture.pcm ) + { + assert( self->capture.framesPerBuffer != 0 ); + PA_ENSURE( PaAlsaStreamComponent_FinishConfigure( &self->capture, hwParamsCapture, inParams, self->primeBuffers, realSr, + inputLatency ) ); + PA_DEBUG(( "%s: Capture period size: %lu, latency: %f\n", __FUNCTION__, self->capture.framesPerBuffer, *inputLatency )); + } + if( self->playback.pcm ) + { + assert( self->playback.framesPerBuffer != 0 ); + PA_ENSURE( PaAlsaStreamComponent_FinishConfigure( &self->playback, hwParamsPlayback, outParams, self->primeBuffers, realSr, + outputLatency ) ); + PA_DEBUG(( "%s: Playback period size: %lu, latency: %f\n", __FUNCTION__, self->playback.framesPerBuffer, *outputLatency )); + } + + /* Should be exact now */ + self->streamRepresentation.streamInfo.sampleRate = realSr; + + /* this will cause the two streams to automatically start/stop/prepare in sync. + * We only need to execute these operations on one of the pair. + * A: We don't want to do this on a blocking stream. + */ + if( self->callbackMode && self->capture.pcm && self->playback.pcm ) + { + int err = snd_pcm_link( self->capture.pcm, self->playback.pcm ); + if( err == 0 ) + self->pcmsSynced = 1; + else + PA_DEBUG(( "%s: Unable to sync pcms: %s\n", __FUNCTION__, snd_strerror( err ) )); + } + + { + unsigned long minFramesPerHostBuffer = PA_MIN( self->capture.pcm ? self->capture.framesPerBuffer : ULONG_MAX, + self->playback.pcm ? self->playback.framesPerBuffer : ULONG_MAX ); + self->pollTimeout = CalculatePollTimeout( self, minFramesPerHostBuffer ); /* Period in msecs, rounded up */ + + /* Time before watchdog unthrottles realtime thread == 1/4 of period time in msecs */ + /* self->threading.throttledSleepTime = (unsigned long) (minFramesPerHostBuffer / sampleRate / 4 * 1000); */ + } + + if( self->callbackMode ) + { + /* If the user expects a certain number of frames per callback we will either have to rely on block adaption + * (framesPerHostBuffer is not an integer multiple of framesPerBuffer) or we can simply align the number + * of host buffer frames with what the user specified */ + if( self->framesPerUserBuffer != paFramesPerBufferUnspecified ) + { + /* self->alignFrames = 1; */ + + /* Unless the ratio between number of host and user buffer frames is an integer we will have to rely + * on block adaption */ + /* + if( framesPerHostBuffer % framesPerBuffer != 0 || (self->capture.pcm && self->playback.pcm && + self->capture.framesPerBuffer != self->playback.framesPerBuffer) ) + self->useBlockAdaption = 1; + else + self->alignFrames = 1; + */ + } + } + +error: + return result; +} + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback* callback, + void *userData ) +{ + PaError result = paNoError; + PaAlsaHostApiRepresentation *alsaHostApi = (PaAlsaHostApiRepresentation*)hostApi; + PaAlsaStream *stream = NULL; + PaSampleFormat hostInputSampleFormat = 0, hostOutputSampleFormat = 0; + PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0; + int numInputChannels = 0, numOutputChannels = 0; + PaTime inputLatency, outputLatency; + /* Operate with fixed host buffer size by default, since other modes will invariably lead to block adaption */ + /* XXX: Use Bounded by default? Output tends to get stuttery with Fixed ... */ + PaUtilHostBufferSizeMode hostBufferSizeMode = paUtilFixedHostBufferSize; + + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; + + if( inputParameters ) + { + PA_ENSURE( ValidateParameters( inputParameters, hostApi, StreamDirection_In ) ); + + numInputChannels = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + } + if( outputParameters ) + { + PA_ENSURE( ValidateParameters( outputParameters, hostApi, StreamDirection_Out ) ); + + numOutputChannels = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + } + + /* XXX: Why do we support this anyway? */ + if( framesPerBuffer == paFramesPerBufferUnspecified && getenv( "PA_ALSA_PERIODSIZE" ) != NULL ) + { + PA_DEBUG(( "%s: Getting framesPerBuffer from environment\n", __FUNCTION__ )); + framesPerBuffer = atoi( getenv("PA_ALSA_PERIODSIZE") ); + } + + PA_UNLESS( stream = (PaAlsaStream*)PaUtil_AllocateMemory( sizeof(PaAlsaStream) ), paInsufficientMemory ); + PA_ENSURE( PaAlsaStream_Initialize( stream, alsaHostApi, inputParameters, outputParameters, sampleRate, + framesPerBuffer, callback, streamFlags, userData ) ); + + PA_ENSURE( PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, + &inputLatency, &outputLatency, &hostBufferSizeMode ) ); + hostInputSampleFormat = stream->capture.hostSampleFormat; + hostOutputSampleFormat = stream->playback.hostSampleFormat; + + PA_ENSURE( PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + numInputChannels, inputSampleFormat, hostInputSampleFormat, + numOutputChannels, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, stream->maxFramesPerHostBuffer, + hostBufferSizeMode, callback, userData ) ); + + /* Ok, buffer processor is initialized, now we can deduce it's latency */ + if( numInputChannels > 0 ) + stream->streamRepresentation.streamInfo.inputLatency = inputLatency + PaUtil_GetBufferProcessorInputLatency( + &stream->bufferProcessor ); + if( numOutputChannels > 0 ) + stream->streamRepresentation.streamInfo.outputLatency = outputLatency + PaUtil_GetBufferProcessorOutputLatency( + &stream->bufferProcessor ); + + *s = (PaStream*)stream; + + return result; + +error: + if( stream ) + { + PA_DEBUG(( "%s: Stream in error, terminating\n", __FUNCTION__ )); + PaAlsaStream_Terminate( stream ); + } + + return result; +} + +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*)s; + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + + PaAlsaStream_Terminate( stream ); + + return result; +} + +static void SilenceBuffer( PaAlsaStream *stream ) +{ + const snd_pcm_channel_area_t *areas; + snd_pcm_uframes_t frames = (snd_pcm_uframes_t)snd_pcm_avail_update( stream->playback.pcm ), offset; + + snd_pcm_mmap_begin( stream->playback.pcm, &areas, &offset, &frames ); + snd_pcm_areas_silence( areas, offset, stream->playback.numHostChannels, frames, stream->playback.nativeFormat ); + snd_pcm_mmap_commit( stream->playback.pcm, offset, frames ); +} + +/** Start/prepare pcm(s) for streaming. + * + * Depending on wether the stream is in callback or blocking mode, we will respectively start or simply + * prepare the playback pcm. If the buffer has _not_ been primed, we will in callback mode prepare and + * silence the buffer before starting playback. In blocking mode we simply prepare, as the playback will + * be started automatically as the user writes to output. + * + * The capture pcm, however, will simply be prepared and started. + */ +static PaError AlsaStart( PaAlsaStream *stream, int priming ) +{ + PaError result = paNoError; + + if( stream->playback.pcm ) + { + if( stream->callbackMode ) + { + if( !priming ) + { + /* Buffer isn't primed, so prepare and silence */ + ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); + SilenceBuffer( stream ); + } + ENSURE_( snd_pcm_start( stream->playback.pcm ), paUnanticipatedHostError ); + } + else + ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); + } + if( stream->capture.pcm && !stream->pcmsSynced ) + { + ENSURE_( snd_pcm_prepare( stream->capture.pcm ), paUnanticipatedHostError ); + /* For a blocking stream we want to start capture as well, since nothing will happen otherwise */ + ENSURE_( snd_pcm_start( stream->capture.pcm ), paUnanticipatedHostError ); + } + +end: + return result; +error: + goto end; +} + +/** Utility function for determining if pcms are in running state. + * + */ +#if 0 +static int IsRunning( PaAlsaStream *stream ) +{ + int result = 0; + + PA_ENSURE( PaUnixMutex_Lock( &stream->stateMtx ) ); + if( stream->capture.pcm ) + { + snd_pcm_state_t capture_state = snd_pcm_state( stream->capture.pcm ); + + if( capture_state == SND_PCM_STATE_RUNNING || capture_state == SND_PCM_STATE_XRUN + || capture_state == SND_PCM_STATE_DRAINING ) + { + result = 1; + goto end; + } + } + + if( stream->playback.pcm ) + { + snd_pcm_state_t playback_state = snd_pcm_state( stream->playback.pcm ); + + if( playback_state == SND_PCM_STATE_RUNNING || playback_state == SND_PCM_STATE_XRUN + || playback_state == SND_PCM_STATE_DRAINING ) + { + result = 1; + goto end; + } + } + +end: + ASSERT_CALL_( PaUnixMutex_Unlock( &stream->stateMtx ), paNoError ); + return result; +error: + goto error; +} +#endif + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaAlsaStream* stream = (PaAlsaStream*)s; + int streamStarted = 0; /* So we can know wether we need to take the stream down */ + + /* Ready the processor */ + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + /* Set now, so we can test for activity further down */ + stream->isActive = 1; + + if( stream->callbackMode ) + { + PA_ENSURE( PaUnixThread_New( &stream->thread, &CallbackThreadFunc, stream, 1. ) ); + } + else + { + PA_ENSURE( AlsaStart( stream, 0 ) ); + streamStarted = 1; + } + +end: + return result; +error: + if( streamStarted ) + { + AbortStream( stream ); + } + stream->isActive = 0; + + goto end; +} + +/** Stop PCM handle, either softly or abruptly. + */ +static PaError AlsaStop( PaAlsaStream *stream, int abort ) +{ + PaError result = paNoError; + + if( abort ) + { + if( stream->playback.pcm ) + { + ENSURE_( snd_pcm_drop( stream->playback.pcm ), paUnanticipatedHostError ); + } + if( stream->capture.pcm && !stream->pcmsSynced ) + { + ENSURE_( snd_pcm_drop( stream->capture.pcm ), paUnanticipatedHostError ); + } + + PA_DEBUG(( "%s: Dropped frames\n", __FUNCTION__ )); + } + else + { + if( stream->playback.pcm ) + { + ENSURE_( snd_pcm_nonblock( stream->playback.pcm, 0 ), paUnanticipatedHostError ); + if( snd_pcm_drain( stream->playback.pcm ) < 0 ) + { + PA_DEBUG(( "%s: Draining playback handle failed!\n", __FUNCTION__ )); + } + } + if( stream->capture.pcm && !stream->pcmsSynced ) + { + /* We don't need to retrieve any remaining frames */ + if( snd_pcm_drop( stream->capture.pcm ) < 0 ) + { + PA_DEBUG(( "%s: Draining capture handle failed!\n", __FUNCTION__ )); + } + } + } + +end: + return result; +error: + goto end; +} + +/** Stop or abort stream. + * + * If a stream is in callback mode we will have to inspect wether the background thread has + * finished, or we will have to take it out. In either case we join the thread before + * returning. In blocking mode, we simply tell ALSA to stop abruptly (abort) or finish + * buffers (drain) + * + * Stream will be considered inactive (!PaAlsaStream::isActive) after a call to this function + */ +static PaError RealStop( PaAlsaStream *stream, int abort ) +{ + PaError result = paNoError; + + /* First deal with the callback thread, cancelling and/or joining + * it if necessary + */ + if( stream->callbackMode ) + { + PaError threadRes; + stream->callbackAbort = abort; + + if( !abort ) + { + PA_DEBUG(( "Stopping callback\n" )); + } + PA_ENSURE( PaUnixThread_Terminate( &stream->thread, !abort, &threadRes ) ); + if( threadRes != paNoError ) + { + PA_DEBUG(( "Callback thread returned: %d\n", threadRes )); + } +#if 0 + if( watchdogRes != paNoError ) + PA_DEBUG(( "Watchdog thread returned: %d\n", watchdogRes )); +#endif + + stream->callback_finished = 0; + } + else + { + PA_ENSURE( AlsaStop( stream, abort ) ); + } + + stream->isActive = 0; + +end: + return result; + +error: + goto end; +} + +static PaError StopStream( PaStream *s ) +{ + return RealStop( (PaAlsaStream *) s, 0 ); +} + +static PaError AbortStream( PaStream *s ) +{ + return RealStop( (PaAlsaStream * ) s, 1 ); +} + +/** The stream is considered stopped before StartStream, or AFTER a call to Abort/StopStream (callback + * returning !paContinue is not considered) + * + */ +static PaError IsStreamStopped( PaStream *s ) +{ + PaAlsaStream *stream = (PaAlsaStream *)s; + + /* callback_finished indicates we need to join callback thread (ie. in Abort/StopStream) */ + return !IsStreamActive( s ) && !stream->callback_finished; +} + +static PaError IsStreamActive( PaStream *s ) +{ + PaAlsaStream *stream = (PaAlsaStream*)s; + return stream->isActive; +} + +static PaTime GetStreamTime( PaStream *s ) +{ + PaAlsaStream *stream = (PaAlsaStream*)s; + + snd_timestamp_t timestamp; + snd_pcm_status_t* status; + snd_pcm_status_alloca( &status ); + + /* TODO: what if we have both? does it really matter? */ + + /* TODO: if running in callback mode, this will mean + * libasound routines are being called from multiple threads. + * need to verify that libasound is thread-safe. */ + + if( stream->capture.pcm ) + { + snd_pcm_status( stream->capture.pcm, status ); + } + else if( stream->playback.pcm ) + { + snd_pcm_status( stream->playback.pcm, status ); + } + + snd_pcm_status_get_tstamp( status, ×tamp ); + return timestamp.tv_sec + (PaTime)timestamp.tv_usec / 1e6; +} + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaAlsaStream *stream = (PaAlsaStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + +static int SetApproximateSampleRate( snd_pcm_t *pcm, snd_pcm_hw_params_t *hwParams, double sampleRate ) +{ + unsigned long approx = (unsigned long) sampleRate; + int dir = 0; + double fraction = sampleRate - approx; + + assert( pcm && hwParams ); + + if( fraction > 0.0 ) + { + if( fraction > 0.5 ) + { + ++approx; + dir = -1; + } + else + dir = 1; + } + + return snd_pcm_hw_params_set_rate( pcm, hwParams, approx, dir ); +} + +/* Return exact sample rate in param sampleRate */ +static int GetExactSampleRate( snd_pcm_hw_params_t *hwParams, double *sampleRate ) +{ + unsigned int num, den; + int err; + + assert( hwParams ); + + err = snd_pcm_hw_params_get_rate_numden( hwParams, &num, &den ); + *sampleRate = (double) num / den; + + return err; +} + +/* Utility functions for blocking/callback interfaces */ + +/* Atomic restart of stream (we don't want the intermediate state visible) */ +static PaError AlsaRestart( PaAlsaStream *stream ) +{ + PaError result = paNoError; + + PA_ENSURE( PaUnixMutex_Lock( &stream->stateMtx ) ); + PA_ENSURE( AlsaStop( stream, 0 ) ); + PA_ENSURE( AlsaStart( stream, 0 ) ); + + PA_DEBUG(( "%s: Restarted audio\n", __FUNCTION__ )); + +error: + PA_ENSURE( PaUnixMutex_Unlock( &stream->stateMtx ) ); + + return result; +} + +/** Recover from xrun state. + * + */ +static PaError PaAlsaStream_HandleXrun( PaAlsaStream *self ) +{ + PaError result = paNoError; + snd_pcm_status_t *st; + PaTime now = PaUtil_GetTime(); + snd_timestamp_t t; + + snd_pcm_status_alloca( &st ); + + if( self->playback.pcm ) + { + snd_pcm_status( self->playback.pcm, st ); + if( snd_pcm_status_get_state( st ) == SND_PCM_STATE_XRUN ) + { + snd_pcm_status_get_trigger_tstamp( st, &t ); + self->underrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000); + } + } + if( self->capture.pcm ) + { + snd_pcm_status( self->capture.pcm, st ); + if( snd_pcm_status_get_state( st ) == SND_PCM_STATE_XRUN ) + { + snd_pcm_status_get_trigger_tstamp( st, &t ); + self->overrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000); + } + } + + PA_ENSURE( AlsaRestart( self ) ); + +end: + return result; +error: + goto end; +} + +/** Decide if we should continue polling for specified direction, eventually adjust the poll timeout. + * + */ +static PaError ContinuePoll( const PaAlsaStream *stream, StreamDirection streamDir, int *pollTimeout, int *continuePoll ) +{ + PaError result = paNoError; + snd_pcm_sframes_t delay, margin; + int err; + const PaAlsaStreamComponent *component = NULL, *otherComponent = NULL; + + *continuePoll = 1; + + if( StreamDirection_In == streamDir ) + { + component = &stream->capture; + otherComponent = &stream->playback; + } + else + { + component = &stream->playback; + otherComponent = &stream->capture; + } + + /* ALSA docs say that negative delay should indicate xrun, but in my experience snd_pcm_delay returns -EPIPE */ + if( (err = snd_pcm_delay( otherComponent->pcm, &delay )) < 0 ) + { + if( err == -EPIPE ) + { + /* Xrun */ + *continuePoll = 0; + goto error; + } + + ENSURE_( err, paUnanticipatedHostError ); + } + + if( StreamDirection_Out == streamDir ) + { + /* Number of eligible frames before capture overrun */ + delay = otherComponent->bufferSize - delay; + } + margin = delay - otherComponent->framesPerBuffer / 2; + + if( margin < 0 ) + { + PA_DEBUG(( "%s: Stopping poll for %s\n", __FUNCTION__, StreamDirection_In == streamDir ? "capture" : "playback" )); + *continuePoll = 0; + } + else if( margin < otherComponent->framesPerBuffer ) + { + *pollTimeout = CalculatePollTimeout( stream, margin ); + PA_DEBUG(( "%s: Trying to poll again for %s frames, pollTimeout: %d\n", + __FUNCTION__, StreamDirection_In == streamDir ? "capture" : "playback", *pollTimeout )); + } + +error: + return result; +} + +/* Callback interface */ + +static void OnExit( void *data ) +{ + PaAlsaStream *stream = (PaAlsaStream *) data; + + assert( data ); + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + stream->callback_finished = 1; /* Let the outside world know stream was stopped in callback */ + PA_DEBUG(( "%s: Stopping ALSA handles\n", __FUNCTION__ )); + AlsaStop( stream, stream->callbackAbort ); + + PA_DEBUG(( "%s: Stoppage\n", __FUNCTION__ )); + + /* Eventually notify user all buffers have played */ + if( stream->streamRepresentation.streamFinishedCallback ) + { + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + stream->isActive = 0; +} + +static void CalculateTimeInfo( PaAlsaStream *stream, PaStreamCallbackTimeInfo *timeInfo ) +{ + snd_pcm_status_t *capture_status, *playback_status; + snd_timestamp_t capture_timestamp, playback_timestamp; + PaTime capture_time = 0., playback_time = 0.; + + snd_pcm_status_alloca( &capture_status ); + snd_pcm_status_alloca( &playback_status ); + + if( stream->capture.pcm ) + { + snd_pcm_sframes_t capture_delay; + + snd_pcm_status( stream->capture.pcm, capture_status ); + snd_pcm_status_get_tstamp( capture_status, &capture_timestamp ); + + capture_time = capture_timestamp.tv_sec + + ((PaTime)capture_timestamp.tv_usec / 1000000.0); + timeInfo->currentTime = capture_time; + + capture_delay = snd_pcm_status_get_delay( capture_status ); + timeInfo->inputBufferAdcTime = timeInfo->currentTime - + (PaTime)capture_delay / stream->streamRepresentation.streamInfo.sampleRate; + } + if( stream->playback.pcm ) + { + snd_pcm_sframes_t playback_delay; + + snd_pcm_status( stream->playback.pcm, playback_status ); + snd_pcm_status_get_tstamp( playback_status, &playback_timestamp ); + + playback_time = playback_timestamp.tv_sec + + ((PaTime)playback_timestamp.tv_usec / 1000000.0); + + if( stream->capture.pcm ) /* Full duplex */ + { + /* Hmm, we have both a playback and a capture timestamp. + * Hopefully they are the same... */ + if( fabs( capture_time - playback_time ) > 0.01 ) + PA_DEBUG(("Capture time and playback time differ by %f\n", fabs(capture_time-playback_time))); + } + else + timeInfo->currentTime = playback_time; + + playback_delay = snd_pcm_status_get_delay( playback_status ); + timeInfo->outputBufferDacTime = timeInfo->currentTime + + (PaTime)playback_delay / stream->streamRepresentation.streamInfo.sampleRate; + } +} + +/** Called after buffer processing is finished. + * + * A number of mmapped frames is committed, it is possible that an xrun has occurred in the meantime. + * + * @param numFrames The number of frames that has been processed + * @param xrun Return whether an xrun has occurred + */ +static PaError PaAlsaStreamComponent_EndProcessing( PaAlsaStreamComponent *self, unsigned long numFrames, int *xrun ) +{ + PaError result = paNoError; + int res; + + /* @concern FullDuplex It is possible that only one direction is marked ready after polling, and processed + * afterwards + */ + if( !self->ready ) + goto end; + + res = snd_pcm_mmap_commit( self->pcm, self->offset, numFrames ); + if( res == -EPIPE || res == -ESTRPIPE ) + { + *xrun = 1; + } + else + { + ENSURE_( res, paUnanticipatedHostError ); + } + +end: +error: + return result; +} + +/* Extract buffer from channel area */ +static unsigned char *ExtractAddress( const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset ) +{ + return (unsigned char *) area->addr + (area->first + offset * area->step) / 8; +} + +/** Do necessary adaption between user and host channels. + * + @concern ChannelAdaption Adapting between user and host channels can involve silencing unused channels and + duplicating mono information if host outputs come in pairs. + */ +static PaError PaAlsaStreamComponent_DoChannelAdaption( PaAlsaStreamComponent *self, PaUtilBufferProcessor *bp, int numFrames ) +{ + PaError result = paNoError; + unsigned char *p; + int i; + int unusedChans = self->numHostChannels - self->numUserChannels; + unsigned char *src, *dst; + int convertMono = (self->numHostChannels % 2) == 0 && (self->numUserChannels % 2) != 0; + + assert( StreamDirection_Out == self->streamDir ); + + if( self->hostInterleaved ) + { + int swidth = snd_pcm_format_size( self->nativeFormat, 1 ); + unsigned char *buffer = ExtractAddress( self->channelAreas, self->offset ); + + /* Start after the last user channel */ + p = buffer + self->numUserChannels * swidth; + + if( convertMono ) + { + /* Convert the last user channel into stereo pair */ + src = buffer + (self->numUserChannels - 1) * swidth; + for( i = 0; i < numFrames; ++i ) + { + dst = src + swidth; + memcpy( dst, src, swidth ); + src += self->numHostChannels * swidth; + } + + /* Don't touch the channel we just wrote to */ + p += swidth; + --unusedChans; + } + + if( unusedChans > 0 ) + { + /* Silence unused output channels */ + for( i = 0; i < numFrames; ++i ) + { + memset( p, 0, swidth * unusedChans ); + p += self->numHostChannels * swidth; + } + } + } + else + { + /* We extract the last user channel */ + if( convertMono ) + { + ENSURE_( snd_pcm_area_copy( self->channelAreas + self->numUserChannels, self->offset, self->channelAreas + + (self->numUserChannels - 1), self->offset, numFrames, self->nativeFormat ), paUnanticipatedHostError ); + --unusedChans; + } + if( unusedChans > 0 ) + { + snd_pcm_areas_silence( self->channelAreas + (self->numHostChannels - unusedChans), self->offset, unusedChans, numFrames, + self->nativeFormat ); + } + } + +error: + return result; +} + +static PaError PaAlsaStream_EndProcessing( PaAlsaStream *self, unsigned long numFrames, int *xrunOccurred ) +{ + PaError result = paNoError; + int xrun = 0; + + if( self->capture.pcm ) + { + PA_ENSURE( PaAlsaStreamComponent_EndProcessing( &self->capture, numFrames, &xrun ) ); + } + if( self->playback.pcm ) + { + if( self->playback.numHostChannels > self->playback.numUserChannels ) + { + PA_ENSURE( PaAlsaStreamComponent_DoChannelAdaption( &self->playback, &self->bufferProcessor, numFrames ) ); + } + PA_ENSURE( PaAlsaStreamComponent_EndProcessing( &self->playback, numFrames, &xrun ) ); + } + +error: + *xrunOccurred = xrun; + return result; +} + +/** Update the number of available frames. + * + */ +static PaError PaAlsaStreamComponent_GetAvailableFrames( PaAlsaStreamComponent *self, unsigned long *numFrames, int *xrunOccurred ) +{ + PaError result = paNoError; + snd_pcm_sframes_t framesAvail = snd_pcm_avail_update( self->pcm ); + *xrunOccurred = 0; + + if( -EPIPE == framesAvail ) + { + *xrunOccurred = 1; + framesAvail = 0; + } + else + { + ENSURE_( framesAvail, paUnanticipatedHostError ); + } + + *numFrames = framesAvail; + +error: + return result; +} + +/** Fill in pollfd objects. + */ +static PaError PaAlsaStreamComponent_BeginPolling( PaAlsaStreamComponent* self, struct pollfd* pfds ) +{ + PaError result = paNoError; + int ret = snd_pcm_poll_descriptors( self->pcm, pfds, self->nfds ); + (void)ret; /* Prevent unused variable warning if asserts are turned off */ + assert( ret == self->nfds ); + + self->ready = 0; + + return result; +} + +/** Examine results from poll(). + * + * @param pfds pollfds to inspect + * @param shouldPoll Should we continue to poll + * @param xrun Has an xrun occurred + */ +static PaError PaAlsaStreamComponent_EndPolling( PaAlsaStreamComponent* self, struct pollfd* pfds, int* shouldPoll, int* xrun ) +{ + PaError result = paNoError; + unsigned short revents; + + ENSURE_( snd_pcm_poll_descriptors_revents( self->pcm, pfds, self->nfds, &revents ), paUnanticipatedHostError ); + if( revents != 0 ) + { + if( revents & POLLERR ) + { + *xrun = 1; + } + else + self->ready = 1; + + *shouldPoll = 0; + } + +error: + return result; +} + +/** Return the number of available frames for this stream. + * + * @concern FullDuplex The minimum available for the two directions is calculated, it might be desirable to ignore + * one direction however (not marked ready from poll), so this is controlled by queryCapture and queryPlayback. + * + * @param queryCapture Check available for capture + * @param queryPlayback Check available for playback + * @param available The returned number of frames + * @param xrunOccurred Return whether an xrun has occurred + */ +static PaError PaAlsaStream_GetAvailableFrames( PaAlsaStream *self, int queryCapture, int queryPlayback, unsigned long + *available, int *xrunOccurred ) +{ + PaError result = paNoError; + unsigned long captureFrames, playbackFrames; + *xrunOccurred = 0; + + assert( queryCapture || queryPlayback ); + + if( queryCapture ) + { + assert( self->capture.pcm ); + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &self->capture, &captureFrames, xrunOccurred ) ); + if( *xrunOccurred ) + { + goto end; + } + } + if( queryPlayback ) + { + assert( self->playback.pcm ); + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &self->playback, &playbackFrames, xrunOccurred ) ); + if( *xrunOccurred ) + { + goto end; + } + } + + if( queryCapture && queryPlayback ) + { + *available = PA_MIN( captureFrames, playbackFrames ); + /*PA_DEBUG(("capture: %lu, playback: %lu, combined: %lu\n", captureFrames, playbackFrames, *available));*/ + } + else if( queryCapture ) + { + *available = captureFrames; + } + else + { + *available = playbackFrames; + } + +end: +error: + return result; +} + +/** Wait for and report available buffer space from ALSA. + * + * Unless ALSA reports a minimum of frames available for I/O, we poll the ALSA filedescriptors for more. + * Both of these operations can uncover xrun conditions. + * + * @concern Xruns Both polling and querying available frames can report an xrun condition. + * + * @param framesAvail Return the number of available frames + * @param xrunOccurred Return whether an xrun has occurred + */ +static PaError PaAlsaStream_WaitForFrames( PaAlsaStream *self, unsigned long *framesAvail, int *xrunOccurred ) +{ + PaError result = paNoError; + int pollPlayback = self->playback.pcm != NULL, pollCapture = self->capture.pcm != NULL; + int pollTimeout = self->pollTimeout; + int xrun = 0; + + assert( self ); + assert( framesAvail ); + + if( !self->callbackMode ) + { + /* In blocking mode we will only wait if necessary */ + PA_ENSURE( PaAlsaStream_GetAvailableFrames( self, self->capture.pcm != NULL, self->playback.pcm != NULL, + framesAvail, &xrun ) ); + if( xrun ) + { + goto end; + } + + if( *framesAvail > 0 ) + { + /* Mark pcms ready from poll */ + if( self->capture.pcm ) + self->capture.ready = 1; + if( self->playback.pcm ) + self->playback.ready = 1; + + goto end; + } + } + + while( pollPlayback || pollCapture ) + { + int totalFds = 0; + struct pollfd *capturePfds = NULL, *playbackPfds = NULL; + + pthread_testcancel(); + + if( pollCapture ) + { + capturePfds = self->pfds; + PA_ENSURE( PaAlsaStreamComponent_BeginPolling( &self->capture, capturePfds ) ); + totalFds += self->capture.nfds; + } + if( pollPlayback ) + { + playbackPfds = self->pfds + (self->capture.pcm ? self->capture.nfds : 0); + PA_ENSURE( PaAlsaStreamComponent_BeginPolling( &self->playback, playbackPfds ) ); + totalFds += self->playback.nfds; + } + + if( poll( self->pfds, totalFds, pollTimeout ) < 0 ) + { + /* XXX: Depend on preprocessor condition? */ + if( errno == EINTR ) + { + /* gdb */ + continue; + } + + /* TODO: Add macro for checking system calls */ + PA_ENSURE( paInternalError ); + } + + /* check the return status of our pfds */ + if( pollCapture ) + { + PA_ENSURE( PaAlsaStreamComponent_EndPolling( &self->capture, capturePfds, &pollCapture, &xrun ) ); + } + if( pollPlayback ) + { + PA_ENSURE( PaAlsaStreamComponent_EndPolling( &self->playback, playbackPfds, &pollPlayback, &xrun ) ); + } + if( xrun ) + { + break; + } + + /* @concern FullDuplex If only one of two pcms is ready we may want to compromise between the two. + * If there is less than half a period's worth of samples left of frames in the other pcm's buffer we will + * stop polling. + */ + if( self->capture.pcm && self->playback.pcm ) + { + if( pollCapture && !pollPlayback ) + { + PA_ENSURE( ContinuePoll( self, StreamDirection_In, &pollTimeout, &pollCapture ) ); + } + else if( pollPlayback && !pollCapture ) + { + PA_ENSURE( ContinuePoll( self, StreamDirection_Out, &pollTimeout, &pollPlayback ) ); + } + } + } + + if( !xrun ) + { + /* Get the number of available frames for the pcms that are marked ready. + * @concern FullDuplex If only one direction is marked ready (from poll), the number of frames available for + * the other direction is returned. Output is normally preferred over capture however, so capture frames may be + * discarded to avoid overrun unless paNeverDropInput is specified. + */ + int captureReady = self->capture.pcm ? self->capture.ready : 0, + playbackReady = self->playback.pcm ? self->playback.ready : 0; + PA_ENSURE( PaAlsaStream_GetAvailableFrames( self, captureReady, playbackReady, framesAvail, &xrun ) ); + + if( self->capture.pcm && self->playback.pcm ) + { + if( !self->playback.ready && !self->neverDropInput ) + { + /* Drop input, a period's worth */ + assert( self->capture.ready ); + PaAlsaStreamComponent_EndProcessing( &self->capture, PA_MIN( self->capture.framesPerBuffer, + *framesAvail ), &xrun ); + *framesAvail = 0; + self->capture.ready = 0; + } + } + else if( self->capture.pcm ) + assert( self->capture.ready ); + else + assert( self->playback.ready ); + } + +end: +error: + if( xrun ) + { + /* Recover from the xrun state */ + PA_ENSURE( PaAlsaStream_HandleXrun( self ) ); + *framesAvail = 0; + } + else + { + if( 0 != *framesAvail ) + { + /* If we're reporting frames eligible for processing, one of the handles better be ready */ + PA_UNLESS( self->capture.ready || self->playback.ready, paInternalError ); + } + } + *xrunOccurred = xrun; + + return result; +} + +/** Register per-channel ALSA buffer information with buffer processor. + * + * Mmapped buffer space is acquired from ALSA, and registered with the buffer processor. Differences between the + * number of host and user channels is taken into account. + * + * @param numFrames On entrance the number of requested frames, on exit the number of contiguously accessible frames. + */ +static PaError PaAlsaStreamComponent_RegisterChannels( PaAlsaStreamComponent* self, PaUtilBufferProcessor* bp, + unsigned long* numFrames, int* xrun ) +{ + PaError result = paNoError; + const snd_pcm_channel_area_t *areas, *area; + void (*setChannel)(PaUtilBufferProcessor *, unsigned int, void *, unsigned int) = + StreamDirection_In == self->streamDir ? PaUtil_SetInputChannel : PaUtil_SetOutputChannel; + unsigned char *buffer, *p; + int i; + unsigned long framesAvail; + + /* This _must_ be called before mmap_begin */ + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( self, &framesAvail, xrun ) ); + if( *xrun ) + { + *numFrames = 0; + goto end; + } + + ENSURE_( snd_pcm_mmap_begin( self->pcm, &areas, &self->offset, numFrames ), paUnanticipatedHostError ); + + if( self->hostInterleaved ) + { + int swidth = snd_pcm_format_size( self->nativeFormat, 1 ); + + p = buffer = ExtractAddress( areas, self->offset ); + for( i = 0; i < self->numUserChannels; ++i ) + { + /* We're setting the channels up to userChannels, but the stride will be hostChannels samples */ + setChannel( bp, i, p, self->numHostChannels ); + p += swidth; + } + } + else + { + for( i = 0; i < self->numUserChannels; ++i ) + { + area = areas + i; + buffer = ExtractAddress( area, self->offset ); + setChannel( bp, i, buffer, 1 ); + } + } + + /* @concern ChannelAdaption Buffer address is recorded so we can do some channel adaption later */ + self->channelAreas = (snd_pcm_channel_area_t *)areas; + +end: +error: + return result; +} + +/** Initiate buffer processing. + * + * ALSA buffers are registered with the PA buffer processor and the buffer size (in frames) set. + * + * @concern FullDuplex If both directions are being processed, the minimum amount of frames for the two directions is + * calculated. + * + * @param numFrames On entrance the number of available frames, on exit the number of received frames + * @param xrunOccurred Return whether an xrun has occurred + */ +static PaError PaAlsaStream_SetUpBuffers( PaAlsaStream* self, unsigned long* numFrames, int* xrunOccurred ) +{ + PaError result = paNoError; + unsigned long captureFrames = ULONG_MAX, playbackFrames = ULONG_MAX, commonFrames = 0; + int xrun = 0; + + if( *xrunOccurred ) + { + *numFrames = 0; + return result; + } + /* If we got here at least one of the pcm's should be marked ready */ + PA_UNLESS( self->capture.ready || self->playback.ready, paInternalError ); + + /* Extract per-channel ALSA buffer pointers and register them with the buffer processor. + * It is possible that a direction is not marked ready however, because it is out of sync with the other. + */ + if( self->capture.pcm && self->capture.ready ) + { + captureFrames = *numFrames; + PA_ENSURE( PaAlsaStreamComponent_RegisterChannels( &self->capture, &self->bufferProcessor, &captureFrames, + &xrun ) ); + } + if( self->playback.pcm && self->playback.ready ) + { + playbackFrames = *numFrames; + PA_ENSURE( PaAlsaStreamComponent_RegisterChannels( &self->playback, &self->bufferProcessor, &playbackFrames, + &xrun ) ); + } + if( xrun ) + { + /* Nothing more to do */ + assert( 0 == commonFrames ); + goto end; + } + + commonFrames = PA_MIN( captureFrames, playbackFrames ); + /* assert( commonFrames <= *numFrames ); */ + if( commonFrames > *numFrames ) + { + /* Hmmm ... how come there are more frames available than we requested!? Blah. */ + PA_DEBUG(( "%s: Common available frames are reported to be more than number requested: %lu, %lu, callbackMode: %d\n", __FUNCTION__, + commonFrames, *numFrames, self->callbackMode )); + if( self->capture.pcm ) + { + PA_DEBUG(( "%s: captureFrames: %lu, capture.ready: %d\n", __FUNCTION__, captureFrames, self->capture.ready )); + } + if( self->playback.pcm ) + { + PA_DEBUG(( "%s: playbackFrames: %lu, playback.ready: %d\n", __FUNCTION__, playbackFrames, self->playback.ready )); + } + + commonFrames = 0; + goto end; + } + + /* Inform PortAudio of the number of frames we got. + * @concern FullDuplex We might be experiencing underflow in either end; if its an input underflow, we go on + * with output. If its output underflow however, depending on the paNeverDropInput flag, we may want to simply + * discard the excess input or call the callback with paOutputOverflow flagged. + */ + if( self->capture.pcm ) + { + if( self->capture.ready ) + { + PaUtil_SetInputFrameCount( &self->bufferProcessor, commonFrames ); + } + else + { + /* We have input underflow */ + PaUtil_SetNoInput( &self->bufferProcessor ); + } + } + if( self->playback.pcm ) + { + if( self->playback.ready ) + { + PaUtil_SetOutputFrameCount( &self->bufferProcessor, commonFrames ); + } + else + { + /* We have output underflow, but keeping input data (paNeverDropInput) */ + assert( self->neverDropInput ); + assert( self->capture.pcm != NULL ); + PA_DEBUG(( "%s: Setting output buffers to NULL\n", __FUNCTION__ )); + PaUtil_SetNoOutput( &self->bufferProcessor ); + } + } + +end: + *numFrames = commonFrames; +error: + if( xrun ) + { + PA_ENSURE( PaAlsaStream_HandleXrun( self ) ); + *numFrames = 0; + } + *xrunOccurred = xrun; + + return result; +} + +/** Callback thread's function. + * + * Roughly, the workflow can be described in the following way: The number of available frames that can be processed + * directly is obtained from ALSA, we then request as much directly accessible memory as possible within this amount + * from ALSA. The buffer memory is registered with the PA buffer processor and processing is carried out with + * PaUtil_EndBufferProcessing. Finally, the number of processed frames is reported to ALSA. The processing can + * happen in several iterations untill we have consumed the known number of available frames (or an xrun is detected). + */ +static void *CallbackThreadFunc( void *userData ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*) userData; + PaStreamCallbackTimeInfo timeInfo = {0, 0, 0}; + snd_pcm_sframes_t startThreshold = 0; + int callbackResult = paContinue; + PaStreamCallbackFlags cbFlags = 0; /* We might want to keep state across iterations */ + int streamStarted = 0; + + assert( stream ); + + /* Execute OnExit when exiting */ + pthread_cleanup_push( &OnExit, stream ); + + /* Not implemented */ + assert( !stream->primeBuffers ); + + /* @concern StreamStart If the output is being primed the output pcm needs to be prepared, otherwise the + * stream is started immediately. The latter involves signaling the waiting main thread. + */ + if( stream->primeBuffers ) + { + snd_pcm_sframes_t avail; + + if( stream->playback.pcm ) + ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); + if( stream->capture.pcm && !stream->pcmsSynced ) + ENSURE_( snd_pcm_prepare( stream->capture.pcm ), paUnanticipatedHostError ); + + /* We can't be certain that the whole ring buffer is available for priming, but there should be + * at least one period */ + avail = snd_pcm_avail_update( stream->playback.pcm ); + startThreshold = avail - (avail % stream->playback.framesPerBuffer); + assert( startThreshold >= stream->playback.framesPerBuffer ); + } + else + { + PA_ENSURE( PaUnixThread_PrepareNotify( &stream->thread ) ); + /* Buffer will be zeroed */ + PA_ENSURE( AlsaStart( stream, 0 ) ); + PA_ENSURE( PaUnixThread_NotifyParent( &stream->thread ) ); + + streamStarted = 1; + } + + while( 1 ) + { + unsigned long framesAvail, framesGot; + int xrun = 0; + + pthread_testcancel(); + + /* @concern StreamStop if the main thread has requested a stop and the stream has not been effectively + * stopped we signal this condition by modifying callbackResult (we'll want to flush buffered output). + */ + if( PaUnixThread_StopRequested( &stream->thread ) && paContinue == callbackResult ) + { + PA_DEBUG(( "Setting callbackResult to paComplete\n" )); + callbackResult = paComplete; + } + + if( paContinue != callbackResult ) + { + stream->callbackAbort = (paAbort == callbackResult); + if( stream->callbackAbort || + /** @concern BlockAdaption: Go on if adaption buffers are empty */ + PaUtil_IsBufferProcessorOutputEmpty( &stream->bufferProcessor ) ) + { + goto end; + } + + PA_DEBUG(( "%s: Flushing buffer processor\n", __FUNCTION__ )); + /* There is still buffered output that needs to be processed */ + } + + /* Wait for data to become available, this comes down to polling the ALSA file descriptors untill we have + * a number of available frames. + */ + PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) ); + if( xrun ) + { + assert( 0 == framesAvail ); + continue; + + /* XXX: Report xruns to the user? A situation is conceivable where the callback is never invoked due + * to constant xruns, it might be desirable to notify the user of this. + */ + } + + /* Consume buffer space. Once we have a number of frames available for consumption we must retrieve the + * mmapped buffers from ALSA, this is contiguously accessible memory however, so we may receive smaller + * portions at a time than is available as a whole. Therefore we should be prepared to process several + * chunks successively. The buffers are passed to the PA buffer processor. + */ + while( framesAvail > 0 ) + { + xrun = 0; + + pthread_testcancel(); + + /** @concern Xruns Under/overflows are to be reported to the callback */ + if( stream->underrun > 0.0 ) + { + cbFlags |= paOutputUnderflow; + stream->underrun = 0.0; + } + if( stream->overrun > 0.0 ) + { + cbFlags |= paInputOverflow; + stream->overrun = 0.0; + } + if( stream->capture.pcm && stream->playback.pcm ) + { + /** @concern FullDuplex It's possible that only one direction is being processed to avoid an + * under- or overflow, this should be reported correspondingly */ + if( !stream->capture.ready ) + { + cbFlags |= paInputUnderflow; + PA_DEBUG(( "%s: Input underflow\n", __FUNCTION__ )); + } + else if( !stream->playback.ready ) + { + cbFlags |= paOutputOverflow; + PA_DEBUG(( "%s: Output overflow\n", __FUNCTION__ )); + } + } + +#if 0 + CallbackUpdate( &stream->threading ); +#endif + CalculateTimeInfo( stream, &timeInfo ); + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, cbFlags ); + cbFlags = 0; + + /* CPU load measurement should include processing activivity external to the stream callback */ + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + framesGot = framesAvail; + if( paUtilFixedHostBufferSize == stream->bufferProcessor.hostBufferSizeMode ) + { + /* We've committed to a fixed host buffer size, stick to that */ + framesGot = framesGot >= stream->maxFramesPerHostBuffer ? stream->maxFramesPerHostBuffer : 0; + } + else + { + /* We've committed to an upper bound on the size of host buffers */ + assert( paUtilBoundedHostBufferSize == stream->bufferProcessor.hostBufferSizeMode ); + framesGot = PA_MIN( framesGot, stream->maxFramesPerHostBuffer ); + } + PA_ENSURE( PaAlsaStream_SetUpBuffers( stream, &framesGot, &xrun ) ); + /* Check the host buffer size against the buffer processor configuration */ + framesAvail -= framesGot; + + if( framesGot > 0 ) + { + assert( !xrun ); + PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + PA_ENSURE( PaAlsaStream_EndProcessing( stream, framesGot, &xrun ) ); + } + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesGot ); + + if( 0 == framesGot ) + { + /* Go back to polling for more frames */ + break; + + } + + if( paContinue != callbackResult ) + break; + } + } + + /* Match pthread_cleanup_push */ + pthread_cleanup_pop( 1 ); + +end: + PA_DEBUG(( "%s: Thread %d exiting\n ", __FUNCTION__, pthread_self() )); + PaUnixThreading_EXIT( result ); +error: + goto end; +} + +/* Blocking interface */ + +static PaError ReadStream( PaStream* s, void *buffer, unsigned long frames ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*)s; + unsigned long framesGot, framesAvail; + void *userBuffer; + snd_pcm_t *save = stream->playback.pcm; + + assert( stream ); + + PA_UNLESS( stream->capture.pcm, paCanNotReadFromAnOutputOnlyStream ); + + /* Disregard playback */ + stream->playback.pcm = NULL; + + if( stream->overrun > 0. ) + { + result = paInputOverflowed; + stream->overrun = 0.0; + } + + if( stream->capture.userInterleaved ) + { + userBuffer = buffer; + } + else + { + /* Copy channels into local array */ + userBuffer = stream->capture.userBuffers; + memcpy( userBuffer, buffer, sizeof (void *) * stream->capture.numUserChannels ); + } + + /* Start stream if in prepared state */ + if( snd_pcm_state( stream->capture.pcm ) == SND_PCM_STATE_PREPARED ) + { + ENSURE_( snd_pcm_start( stream->capture.pcm ), paUnanticipatedHostError ); + } + + while( frames > 0 ) + { + int xrun = 0; + PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) ); + framesGot = PA_MIN( framesAvail, frames ); + + PA_ENSURE( PaAlsaStream_SetUpBuffers( stream, &framesGot, &xrun ) ); + if( framesGot > 0 ) + { + framesGot = PaUtil_CopyInput( &stream->bufferProcessor, &userBuffer, framesGot ); + PA_ENSURE( PaAlsaStream_EndProcessing( stream, framesGot, &xrun ) ); + frames -= framesGot; + } + } + +end: + stream->playback.pcm = save; + return result; +error: + goto end; +} + +static PaError WriteStream( PaStream* s, const void *buffer, unsigned long frames ) +{ + PaError result = paNoError; + signed long err; + PaAlsaStream *stream = (PaAlsaStream*)s; + snd_pcm_uframes_t framesGot, framesAvail; + const void *userBuffer; + snd_pcm_t *save = stream->capture.pcm; + + assert( stream ); + + PA_UNLESS( stream->playback.pcm, paCanNotWriteToAnInputOnlyStream ); + + /* Disregard capture */ + stream->capture.pcm = NULL; + + if( stream->underrun > 0. ) + { + result = paOutputUnderflowed; + stream->underrun = 0.0; + } + + if( stream->playback.userInterleaved ) + userBuffer = buffer; + else /* Copy channels into local array */ + { + userBuffer = stream->playback.userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->playback.numUserChannels ); + } + + while( frames > 0 ) + { + int xrun = 0; + snd_pcm_uframes_t hwAvail; + + PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) ); + framesGot = PA_MIN( framesAvail, frames ); + + PA_ENSURE( PaAlsaStream_SetUpBuffers( stream, &framesGot, &xrun ) ); + if( framesGot > 0 ) + { + framesGot = PaUtil_CopyOutput( &stream->bufferProcessor, &userBuffer, framesGot ); + PA_ENSURE( PaAlsaStream_EndProcessing( stream, framesGot, &xrun ) ); + frames -= framesGot; + } + + /* Start stream after one period of samples worth */ + + /* Frames residing in buffer */ + PA_ENSURE( err = GetStreamWriteAvailable( stream ) ); + framesAvail = err; + hwAvail = stream->playback.bufferSize - framesAvail; + + if( snd_pcm_state( stream->playback.pcm ) == SND_PCM_STATE_PREPARED && + hwAvail >= stream->playback.framesPerBuffer ) + { + ENSURE_( snd_pcm_start( stream->playback.pcm ), paUnanticipatedHostError ); + } + } + +end: + stream->capture.pcm = save; + return result; +error: + goto end; +} + +/* Return frames available for reading. In the event of an overflow, the capture pcm will be restarted */ +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*)s; + unsigned long avail; + int xrun; + + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &stream->capture, &avail, &xrun ) ); + if( xrun ) + { + PA_ENSURE( PaAlsaStream_HandleXrun( stream ) ); + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &stream->capture, &avail, &xrun ) ); + if( xrun ) + PA_ENSURE( paInputOverflowed ); + } + + return (signed long)avail; + +error: + return result; +} + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaError result = paNoError; + PaAlsaStream *stream = (PaAlsaStream*)s; + unsigned long avail; + int xrun; + + PA_ENSURE( PaAlsaStreamComponent_GetAvailableFrames( &stream->playback, &avail, &xrun ) ); + if( xrun ) + { + snd_pcm_sframes_t savail; + + PA_ENSURE( PaAlsaStream_HandleXrun( stream ) ); + savail = snd_pcm_avail_update( stream->playback.pcm ); + + /* savail should not contain -EPIPE now, since PaAlsaStream_HandleXrun will only prepare the pcm */ + ENSURE_( savail, paUnanticipatedHostError ); + + avail = (unsigned long) savail; + } + + return (signed long)avail; + +error: + return result; +} + +/* Extensions */ + +/* Initialize host api specific structure */ +void PaAlsa_InitializeStreamInfo( PaAlsaStreamInfo *info ) +{ + info->size = sizeof (PaAlsaStreamInfo); + info->hostApiType = paALSA; + info->version = 1; + info->deviceString = NULL; +} + +void PaAlsa_EnableRealtimeScheduling( PaStream *s, int enable ) +{ +#if 0 + PaAlsaStream *stream = (PaAlsaStream *) s; + stream->threading.rtSched = enable; +#endif +} + +void PaAlsa_EnableWatchdog( PaStream *s, int enable ) +{ +#if 0 + PaAlsaStream *stream = (PaAlsaStream *) s; + stream->threading.useWatchdog = enable; +#endif +} diff --git a/portaudio-v19/src/hostapi/asihpi/pa_linux_asihpi.c b/portaudio-v19/src/hostapi/asihpi/pa_linux_asihpi.c new file mode 100644 index 000000000..fb4e3080d --- /dev/null +++ b/portaudio-v19/src/hostapi/asihpi/pa_linux_asihpi.c @@ -0,0 +1,2900 @@ +/* + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * + * PortAudio v18 version of AudioScience HPI driver by Fred Gleason + * PortAudio v19 version of AudioScience HPI driver by Ludwig Schwardt + * + * Copyright (c) 2003 Fred Gleason + * Copyright (c) 2005,2006 Ludwig Schwardt + * + * 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. + * + * 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. + * + * 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. + * + * + * Modification History + * 12/2003 - Initial version + * 09/2005 - v19 version [rewrite] + */ + +/** @file + @brief Host API implementation supporting AudioScience cards + via the Linux HPI interface. + +

    Overview

    + + This is a PortAudio implementation for the AudioScience HPI Audio API + on the Linux platform. AudioScience makes a range of audio adapters customised + for the broadcasting industry, with support for both Windows and Linux. + More information on their products can be found on their website: + + http://www.audioscience.com + + Documentation for the HPI API can be found at: + + http://www.audioscience.com/internet/download/sdk/spchpi.pdf + + The Linux HPI driver itself (a kernel module + library) can be downloaded from: + + http://www.audioscience.com/internet/download/linux_drivers.htm + +

    Implementation strategy

    + + *Note* Ideally, AudioScience cards should be handled by the PortAudio ALSA + implementation on Linux, as ALSA is the preferred Linux soundcard API. The existence + of this host API implementation might therefore seem a bit flawed. Unfortunately, at + the time of the creation of this implementation (June 2006), the PA ALSA implementation + could not make use of the existing AudioScience ALSA driver. PA ALSA uses the + "memory-mapped" (mmap) ALSA access mode to interact with the ALSA library, while the + AudioScience ALSA driver only supports the "read-write" access mode. The appropriate + solution to this problem is to add "read-write" support to PortAudio ALSA, thereby + extending the range of soundcards it supports (AudioScience cards are not the only + ones with this problem). Given the author's limited knowledge of ALSA and the + simplicity of the HPI API, the second-best solution was born... + + The following mapping between HPI and PA was followed: + HPI subsystem => PortAudio host API + HPI adapter => nothing specific + HPI stream => PortAudio device + + Each HPI stream is either input or output (not both), and can support + different channel counts, sampling rates and sample formats. It is therefore + a more natural fit to a PA device. A PA stream can therefore combine two + HPI streams (one input and one output) into a "full-duplex" stream. These + HPI streams can even be on different physical adapters. The two streams ought to be + sample-synchronised when they reside on the same adapter, as most AudioScience adapters + derive their ADC and DAC clocks from one master clock. When combining two adapters + into one full-duplex stream, however, the use of a word clock connection between the + adapters is strongly recommended. + + The HPI interface is inherently blocking, making use of read and write calls to + transfer data between user buffers and driver buffers. The callback interface therefore + requires a helper thread ("callback engine") which periodically transfers data (one thread + per PA stream, in fact). The current implementation explicitly sleeps via Pa_Sleep() until + enough samples can be transferred (select() or poll() would be better, but currently seems + impossible...). The thread implementation makes use of the Unix thread helper functions + and some pthread calls here and there. If a unified PA thread exists, this host API + implementation might also compile on Windows, as this is the only real Linux-specific + part of the code. + + There is no inherent fixed buffer size in the HPI interface, as in some other host APIs. + The PortAudio implementation contains a buffer that is allocated during OpenStream and + used to transfer data between the callback and the HPI driver buffer. The size of this + buffer is quite flexible and is derived from latency suggestions and matched to the + requested callback buffer size as far as possible. It can become quite huge, as the + AudioScience cards are typically geared towards higher-latency applications and contain + large hardware buffers. + + The HPI interface natively supports most common sample formats and sample rates (some + conversion is done on the adapter itself). + + Stream time is measured based on the number of processed frames, which is adjusted by the + number of frames currently buffered by the HPI driver. + + There is basic support for detecting overflow and underflow. The HPI interface does not + explicitly indicate this, so thresholds on buffer levels are used in combination with + stream state. Recovery from overflow and underflow is left to the PA client. + + Blocking streams are also implemented. It makes use of the same polling routines that + the callback interface uses, in order to prevent the allocation of variable-sized + buffers during reading and writing. The framesPerBuffer parameter is therefore still + relevant, and this can be increased in the blocking case to improve efficiency. + + The implementation contains extensive reporting macros (slightly modified PA_ENSURE and + PA_UNLESS versions) and a useful stream dump routine to provide debugging feedback. + + Output buffer priming via the user callback (i.e. paPrimeOutputBuffersUsingStreamCallback + and friends) is not implemented yet. All output is primed with silence. + + Please send bug reports etc. to Ludwig Schwardt + */ + +#include +#include +#include +#include /* strlen() */ +#include /* pthreads and friends */ +#include /* assert */ +#include /* ceil, floor */ + +#include /* HPI API */ + +#include "portaudio.h" /* PortAudio API */ +#include "pa_util.h" /* PA_DEBUG, other small utilities */ +#include "pa_unix_util.h" /* Unix threading utilities */ +#include "pa_allocation.h" /* Group memory allocation */ +#include "pa_hostapi.h" /* Host API structs */ +#include "pa_stream.h" /* Stream interface structs */ +#include "pa_cpuload.h" /* CPU load measurer */ +#include "pa_process.h" /* Buffer processor */ +#include "pa_converters.h" /* PaUtilZeroer */ + +/* -------------------------------------------------------------------------- */ + +/* + * Defines + */ + +/* Error reporting and assertions */ + +/** Evaluate expression, and return on any PortAudio errors */ +#define PA_ENSURE_(expr) \ + do { \ + PaError paError = (expr); \ + if( UNLIKELY( paError < paNoError ) ) \ + { \ + PA_DEBUG(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = paError; \ + goto error; \ + } \ + } while (0); + +/** Assert expression, else return the provided PaError */ +#define PA_UNLESS_(expr, paError) \ + do { \ + if( UNLIKELY( (expr) == 0 ) ) \ + { \ + PA_DEBUG(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = (paError); \ + goto error; \ + } \ + } while( 0 ); + +/** Check return value of HPI function, and map it to PaError */ +#define PA_ASIHPI_UNLESS_(expr, paError) \ + do { \ + HW16 hpiError = (expr); \ + /* If HPI error occurred */ \ + if( UNLIKELY( hpiError ) ) \ + { \ + char szError[256]; \ + HPI_GetErrorText( hpiError, szError ); \ + PA_DEBUG(( "HPI error %d occurred: %s\n", hpiError, szError )); \ + /* This message will always be displayed, even if debug info is disabled */ \ + PA_DEBUG(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + if( (paError) == paUnanticipatedHostError ) \ + { \ + PA_DEBUG(( "Host error description: %s\n", szError )); \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( pthread_equal( pthread_self(), paUnixMainThread ) ) \ + { \ + PaUtil_SetLastHostErrorInfo( paInDevelopment, hpiError, szError ); \ + } \ + } \ + /* If paNoError is specified, continue as usual */ \ + /* (useful if you only want to print out the debug messages above) */ \ + if( (paError) < 0 ) \ + { \ + result = (paError); \ + goto error; \ + } \ + } \ + } while( 0 ); + +/** Report HPI error code and text */ +#define PA_ASIHPI_REPORT_ERROR_(hpiErrorCode) \ + do { \ + char szError[256]; \ + HPI_GetErrorText( hpiError, szError ); \ + PA_DEBUG(( "HPI error %d occurred: %s\n", hpiError, szError )); \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( pthread_equal( pthread_self(), paUnixMainThread ) ) \ + { \ + PaUtil_SetLastHostErrorInfo( paInDevelopment, (hpiErrorCode), szError ); \ + } \ + } while( 0 ); + +/* Defaults */ + +/** Sample formats available natively on AudioScience hardware */ +#define PA_ASIHPI_AVAILABLE_FORMATS_ (paFloat32 | paInt32 | paInt24 | paInt16 | paUInt8) +/** Enable background bus mastering (BBM) for buffer transfers, if available (see HPI docs) */ +#define PA_ASIHPI_USE_BBM_ 1 +/** Minimum number of frames in HPI buffer (for either data or available space). + If buffer contains less data/space, it indicates xrun or completion. */ +#define PA_ASIHPI_MIN_FRAMES_ 1152 +/** Minimum polling interval in milliseconds, which determines minimum host buffer size */ +#define PA_ASIHPI_MIN_POLLING_INTERVAL_ 10 + +/* -------------------------------------------------------------------------- */ + +/* + * Structures + */ + +/** Host API global data */ +typedef struct PaAsiHpiHostApiRepresentation +{ + /* PortAudio "base class" - keep the baseRep first! (C-style inheritance) */ + PaUtilHostApiRepresentation baseHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ + + PaHostApiIndex hostApiIndex; + /** HPI subsystem pointer */ + HPI_HSUBSYS *subSys; +} +PaAsiHpiHostApiRepresentation; + + +/** Device data */ +typedef struct PaAsiHpiDeviceInfo +{ + /* PortAudio "base class" - keep the baseRep first! (C-style inheritance) */ + /** Common PortAudio device information */ + PaDeviceInfo baseDeviceInfo; + + /* implementation specific data goes here */ + + /** HPI subsystem (required for most HPI calls) */ + HPI_HSUBSYS *subSys; + /** Adapter index */ + HW16 adapterIndex; + /** Adapter model number (hex) */ + HW16 adapterType; + /** Adapter HW/SW version */ + HW16 adapterVersion; + /** Adapter serial number */ + HW32 adapterSerialNumber; + /** Stream number */ + HW16 streamIndex; + /** 0=Input, 1=Output (HPI streams are either input or output but not both) */ + HW16 streamIsOutput; +} +PaAsiHpiDeviceInfo; + + +/** Stream state as defined by PortAudio. + It seems that the host API implementation has to keep track of the PortAudio stream state. + Please note that this is NOT the same as the state of the underlying HPI stream. By separating + these two concepts, a lot of flexibility is gained. There is a rough match between the two, + of course, but forcing a precise match is difficult. For example, HPI_STATE_DRAINED can occur + during the Active state of PortAudio (due to underruns) and also during CallBackFinished in + the case of an output stream. Similarly, HPI_STATE_STOPPED mostly coincides with the Stopped + PortAudio state, by may also occur in the CallbackFinished state when recording is finished. + + Here is a rough match-up: + + PortAudio state => HPI state + --------------- --------- + Active => HPI_STATE_RECORDING, HPI_STATE_PLAYING, (HPI_STATE_DRAINED) + Stopped => HPI_STATE_STOPPED + CallbackFinished => HPI_STATE_STOPPED, HPI_STATE_DRAINED */ +typedef enum PaAsiHpiStreamState +{ + paAsiHpiStoppedState=0, + paAsiHpiActiveState=1, + paAsiHpiCallbackFinishedState=2 +} +PaAsiHpiStreamState; + + +/** Stream component data (associated with one direction, i.e. either input or output) */ +typedef struct PaAsiHpiStreamComponent +{ + /** Device information (HPI handles, etc) */ + PaAsiHpiDeviceInfo *hpiDevice; + /** Stream handle, as passed to HPI interface. + HACK: we assume types HPI_HISTREAM and HPI_HOSTREAM are the same... + (both are HW32 up to version 3.00 of ASIHPI, and hopefully they stay that way) */ + HPI_HISTREAM hpiStream; + /** Stream format, as passed to HPI interface */ + HPI_FORMAT hpiFormat; + /** Number of bytes per frame, derived from hpiFormat and saved for convenience */ + HW32 bytesPerFrame; + /** Size of hardware (on-card) buffer of stream in bytes */ + HW32 hardwareBufferSize; + /** Size of host (BBM) buffer of stream in bytes (if used) */ + HW32 hostBufferSize; + /** Upper limit on the utilization of output stream buffer (both hardware and host). + This prevents large latencies in an output-only stream with a potentially huge buffer + and a fast data generator, which would otherwise keep the hardware buffer filled to + capacity. See also the "Hardware Buffering=off" option in the AudioScience WAV driver. */ + HW32 outputBufferCap; + /** Sample buffer (halfway station between HPI and buffer processor) */ + HW8 *tempBuffer; + /** Sample buffer size, in bytes */ + HW32 tempBufferSize; +} +PaAsiHpiStreamComponent; + + +/** Stream data */ +typedef struct PaAsiHpiStream +{ + /* PortAudio "base class" - keep the baseRep first! (C-style inheritance) */ + PaUtilStreamRepresentation baseStreamRep; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ + + /** Separate structs for input and output sides of stream */ + PaAsiHpiStreamComponent *input, *output; + + /** Polling interval (in milliseconds) */ + HW32 pollingInterval; + /** Are we running in callback mode? */ + int callbackMode; + /** Number of frames to transfer at a time to/from HPI */ + unsigned long maxFramesPerHostBuffer; + /** Indicates that the stream is in the paNeverDropInput mode */ + int neverDropInput; + /** Contains copy of user buffers, used by blocking interface to transfer non-interleaved data. + It went here instead of to each stream component, as the stream component buffer setup in + PaAsiHpi_SetupBuffers doesn't know the stream details such as callbackMode. + (Maybe a problem later if ReadStream and WriteStream happens concurrently on same stream.) */ + void **blockingUserBufferCopy; + + /* Thread-related variables */ + + /** Helper thread which will deliver data to user callback */ + PaUnixThread thread; + /** PortAudio stream state (Active/Stopped/CallbackFinished) */ + volatile sig_atomic_t state; + /** Hard abort, i.e. drop frames? */ + volatile sig_atomic_t callbackAbort; + /** True if stream stopped via exiting callback with paComplete/paAbort flag + (as opposed to explicit call to StopStream/AbortStream) */ + volatile sig_atomic_t callbackFinished; +} +PaAsiHpiStream; + + +/** Stream state information, collected together for convenience */ +typedef struct PaAsiHpiStreamInfo +{ + /** HPI stream state (HPI_STATE_STOPPED, HPI_STATE_PLAYING, etc.) */ + HW16 state; + /** Size (in bytes) of recording/playback data buffer in HPI driver */ + HW32 bufferSize; + /** Amount of data (in bytes) available in the buffer */ + HW32 dataSize; + /** Number of frames played/recorded since last stream reset */ + HW32 frameCounter; + /** Amount of data (in bytes) in hardware (on-card) buffer. + This differs from dataSize if bus mastering (BBM) is used, which introduces another + driver-level buffer to which dataSize/bufferSize then refers. */ + HW32 auxDataSize; + /** Total number of data frames currently buffered by HPI driver (host + hw buffers) */ + HW32 totalBufferedData; + /** Size of immediately available data (for input) or space (for output) in frames. + This only checks the first-level buffer (typically host buffer). This amount can be + transferred immediately. */ + HW32 availableFrames; + /** Indicates that hardware buffer is getting too full */ + int overflow; + /** Indicates that hardware buffer is getting too empty */ + int underflow; +} +PaAsiHpiStreamInfo; + +/* -------------------------------------------------------------------------- */ + +/* + * Function prototypes + */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + /* The only exposed function in the entire host API implementation */ + PaError PaAsiHpi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); + +/* Stream prototypes */ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream **s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream *s ); +static PaError StartStream( PaStream *s ); +static PaError StopStream( PaStream *s ); +static PaError AbortStream( PaStream *s ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *s ); +static PaTime GetStreamTime( PaStream *s ); +static double GetStreamCpuLoad( PaStream *s ); + +/* Blocking prototypes */ +static PaError ReadStream( PaStream *s, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream *s, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream *s ); +static signed long GetStreamWriteAvailable( PaStream *s ); + +/* Callback prototypes */ +static void *CallbackThreadFunc( void *userData ); + +/* Functions specific to this API */ +static PaError PaAsiHpi_BuildDeviceList( PaAsiHpiHostApiRepresentation *hpiHostApi ); +static HW16 PaAsiHpi_PaToHpiFormat( PaSampleFormat paFormat ); +static PaSampleFormat PaAsiHpi_HpiToPaFormat( HW16 hpiFormat ); +static PaError PaAsiHpi_CreateFormat( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *parameters, double sampleRate, + PaAsiHpiDeviceInfo **hpiDevice, HPI_FORMAT *hpiFormat ); +static PaError PaAsiHpi_OpenInput( struct PaUtilHostApiRepresentation *hostApi, + const PaAsiHpiDeviceInfo *hpiDevice, const HPI_FORMAT *hpiFormat, + HPI_HISTREAM *hpiStream ); +static PaError PaAsiHpi_OpenOutput( struct PaUtilHostApiRepresentation *hostApi, + const PaAsiHpiDeviceInfo *hpiDevice, const HPI_FORMAT *hpiFormat, + HPI_HOSTREAM *hpiStream ); +static PaError PaAsiHpi_GetStreamInfo( PaAsiHpiStreamComponent *streamComp, PaAsiHpiStreamInfo *info ); +static void PaAsiHpi_StreamComponentDump( PaAsiHpiStreamComponent *streamComp, PaAsiHpiStream *stream ); +static void PaAsiHpi_StreamDump( PaAsiHpiStream *stream ); +static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32 pollingInterval, + unsigned long framesPerPaHostBuffer, PaTime suggestedLatency ); +static PaError PaAsiHpi_PrimeOutputWithSilence( PaAsiHpiStream *stream ); +static PaError PaAsiHpi_StartStream( PaAsiHpiStream *stream, int outputPrimed ); +static PaError PaAsiHpi_StopStream( PaAsiHpiStream *stream, int abort ); +static PaError PaAsiHpi_ExplicitStop( PaAsiHpiStream *stream, int abort ); +static void PaAsiHpi_OnThreadExit( void *userData ); +static PaError PaAsiHpi_WaitForFrames( PaAsiHpiStream *stream, unsigned long *framesAvail, + PaStreamCallbackFlags *cbFlags ); +static void PaAsiHpi_CalculateTimeInfo( PaAsiHpiStream *stream, PaStreamCallbackTimeInfo *timeInfo ); +static PaError PaAsiHpi_BeginProcessing( PaAsiHpiStream* stream, unsigned long* numFrames, + PaStreamCallbackFlags *cbFlags ); +static PaError PaAsiHpi_EndProcessing( PaAsiHpiStream *stream, unsigned long numFrames, + PaStreamCallbackFlags *cbFlags ); + +/* ========================================================================== + * ============================= IMPLEMENTATION ============================= + * ========================================================================== */ + +/* --------------------------- Host API Interface --------------------------- */ + +/** Enumerate all PA devices (= HPI streams). + This compiles a list of all HPI adapters, and registers a PA device for each input and + output stream it finds. Most errors are ignored, as missing or erroneous devices are + simply skipped. + + @param hpiHostApi Pointer to HPI host API struct + + @return PortAudio error code (only paInsufficientMemory in practice) + */ +static PaError PaAsiHpi_BuildDeviceList( PaAsiHpiHostApiRepresentation *hpiHostApi ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *hostApi = &hpiHostApi->baseHostApiRep; + PaHostApiInfo *baseApiInfo = &hostApi->info; + PaAsiHpiDeviceInfo *hpiDeviceList; + HW16 adapterList[ HPI_MAX_ADAPTERS ]; + HW16 numAdapters; + HW16 hpiError = 0; + int i, j, deviceCount = 0, deviceIndex = 0; + + assert( hpiHostApi ); + assert( hpiHostApi->subSys ); + + /* Look for adapters (not strictly necessary, as AdapterOpen can do the same, but this */ + /* way we have less errors since we do not try to open adapters we know aren't there) */ + /* Errors not considered critical here (subsystem may report 0 devices), but report them */ + /* in debug mode. */ + PA_ASIHPI_UNLESS_( HPI_SubSysFindAdapters( hpiHostApi->subSys, &numAdapters, + adapterList, HPI_MAX_ADAPTERS ), paNoError ); + + /* First open and count the number of devices (= number of streams), to ease memory allocation */ + for( i=0; i < HPI_MAX_ADAPTERS; ++i ) + { + HW16 inStreams, outStreams; + HW16 version; + HW32 serial; + HW16 type; + + /* If no adapter found at this index, skip it */ + if( adapterList[i] == 0 ) + continue; + + /* Try to open adapter */ + hpiError = HPI_AdapterOpen( hpiHostApi->subSys, i ); + /* Report error and skip to next device on failure */ + if( hpiError ) + { + PA_ASIHPI_REPORT_ERROR_( hpiError ); + continue; + } + hpiError = HPI_AdapterGetInfo( hpiHostApi->subSys, i, + &outStreams, &inStreams, &version, &serial, &type ); + /* Skip to next device on failure */ + if( hpiError ) + { + PA_ASIHPI_REPORT_ERROR_( hpiError ); + continue; + } + else + { + /* Assign default devices if available and increment device count */ + if( (baseApiInfo->defaultInputDevice == paNoDevice) && (inStreams > 0) ) + baseApiInfo->defaultInputDevice = deviceCount; + deviceCount += inStreams; + if( (baseApiInfo->defaultOutputDevice == paNoDevice) && (outStreams > 0) ) + baseApiInfo->defaultOutputDevice = deviceCount; + deviceCount += outStreams; + } + } + + /* Register any discovered devices */ + if( deviceCount > 0 ) + { + /* Memory allocation */ + PA_UNLESS_( hostApi->deviceInfos = (PaDeviceInfo**) PaUtil_GroupAllocateMemory( + hpiHostApi->allocations, sizeof(PaDeviceInfo*) * deviceCount ), + paInsufficientMemory ); + /* Allocate all device info structs in a contiguous block */ + PA_UNLESS_( hpiDeviceList = (PaAsiHpiDeviceInfo*) PaUtil_GroupAllocateMemory( + hpiHostApi->allocations, sizeof(PaAsiHpiDeviceInfo) * deviceCount ), + paInsufficientMemory ); + + /* Now query devices again for information */ + for( i=0; i < HPI_MAX_ADAPTERS; ++i ) + { + HW16 inStreams, outStreams; + HW16 version; + HW32 serial; + HW16 type; + + /* If no adapter found at this index, skip it */ + if( adapterList[i] == 0 ) + continue; + + /* Assume adapter is still open from previous round */ + hpiError = HPI_AdapterGetInfo( hpiHostApi->subSys, i, + &outStreams, &inStreams, &version, &serial, &type ); + /* Report error and skip to next device on failure */ + if( hpiError ) + { + PA_ASIHPI_REPORT_ERROR_( hpiError ); + continue; + } + else + { + PA_DEBUG(( "Found HPI Adapter ID=%4X Idx=%d #In=%d #Out=%d S/N=%d HWver=%c%d DSPver=%03d\n", + type, i, inStreams, outStreams, serial, + ((version>>3)&0xf)+'A', /* Hw version major */ + version&0x7, /* Hw version minor */ + ((version>>13)*100)+((version>>7)&0x3f) /* DSP code version */ + )); + } + + /* First add all input streams as devices */ + for( j=0; j < inStreams; ++j ) + { + PaAsiHpiDeviceInfo *hpiDevice = &hpiDeviceList[deviceIndex]; + PaDeviceInfo *baseDeviceInfo = &hpiDevice->baseDeviceInfo; + char srcName[72]; + char *deviceName; + + memset( hpiDevice, 0, sizeof(PaAsiHpiDeviceInfo) ); + /* Set implementation-specific device details */ + hpiDevice->subSys = hpiHostApi->subSys; + hpiDevice->adapterIndex = i; + hpiDevice->adapterType = type; + hpiDevice->adapterVersion = version; + hpiDevice->adapterSerialNumber = serial; + hpiDevice->streamIndex = j; + hpiDevice->streamIsOutput = 0; + /* Set common PortAudio device stats */ + baseDeviceInfo->structVersion = 2; + /* Make sure name string is owned by API info structure */ + sprintf( srcName, + "Adapter %d (%4X) - Input Stream %d", i+1, type, j+1 ); + PA_UNLESS_( deviceName = (char *) PaUtil_GroupAllocateMemory( + hpiHostApi->allocations, strlen(srcName) + 1 ), paInsufficientMemory ); + strcpy( deviceName, srcName ); + baseDeviceInfo->name = deviceName; + baseDeviceInfo->hostApi = hpiHostApi->hostApiIndex; + baseDeviceInfo->maxInputChannels = HPI_MAX_CHANNELS; + baseDeviceInfo->maxOutputChannels = 0; + /* Default latency values for interactive performance */ + baseDeviceInfo->defaultLowInputLatency = 0.01; + baseDeviceInfo->defaultLowOutputLatency = -1.0; + /* Default latency values for robust non-interactive applications (eg. playing sound files) */ + baseDeviceInfo->defaultHighInputLatency = 0.2; + baseDeviceInfo->defaultHighOutputLatency = -1.0; + /* HPI interface can actually handle any sampling rate to 1 Hz accuracy, + * so this default is as good as any */ + baseDeviceInfo->defaultSampleRate = 44100; + + /* Store device in global PortAudio list */ + hostApi->deviceInfos[deviceIndex++] = (PaDeviceInfo *) hpiDevice; + } + + /* Now add all output streams as devices (I know, the repetition is painful) */ + for( j=0; j < outStreams; ++j ) + { + PaAsiHpiDeviceInfo *hpiDevice = &hpiDeviceList[deviceIndex]; + PaDeviceInfo *baseDeviceInfo = &hpiDevice->baseDeviceInfo; + char srcName[72]; + char *deviceName; + + memset( hpiDevice, 0, sizeof(PaAsiHpiDeviceInfo) ); + /* Set implementation-specific device details */ + hpiDevice->subSys = hpiHostApi->subSys; + hpiDevice->adapterIndex = i; + hpiDevice->adapterType = type; + hpiDevice->adapterVersion = version; + hpiDevice->adapterSerialNumber = serial; + hpiDevice->streamIndex = j; + hpiDevice->streamIsOutput = 1; + /* Set common PortAudio device stats */ + baseDeviceInfo->structVersion = 2; + /* Make sure name string is owned by API info structure */ + sprintf( srcName, + "Adapter %d (%4X) - Output Stream %d", i+1, type, j+1 ); + PA_UNLESS_( deviceName = (char *) PaUtil_GroupAllocateMemory( + hpiHostApi->allocations, strlen(srcName) + 1 ), paInsufficientMemory ); + strcpy( deviceName, srcName ); + baseDeviceInfo->name = deviceName; + baseDeviceInfo->hostApi = hpiHostApi->hostApiIndex; + baseDeviceInfo->maxInputChannels = 0; + baseDeviceInfo->maxOutputChannels = HPI_MAX_CHANNELS; + /* Default latency values for interactive performance. */ + baseDeviceInfo->defaultLowInputLatency = -1.0; + baseDeviceInfo->defaultLowOutputLatency = 0.01; + /* Default latency values for robust non-interactive applications (eg. playing sound files). */ + baseDeviceInfo->defaultHighInputLatency = -1.0; + baseDeviceInfo->defaultHighOutputLatency = 0.2; + /* HPI interface can actually handle any sampling rate to 1 Hz accuracy, + * so this default is as good as any */ + baseDeviceInfo->defaultSampleRate = 44100; + + /* Store device in global PortAudio list */ + hostApi->deviceInfos[deviceIndex++] = (PaDeviceInfo *) hpiDevice; + } + } + } + + /* Finally acknowledge checked devices */ + baseApiInfo->deviceCount = deviceIndex; + +error: + return result; +} + + +/** Initialize host API implementation. + This is the only function exported beyond this file. It is called by PortAudio to initialize + the host API. It stores API info, finds and registers all devices, and sets up callback and + blocking interfaces. + + @param hostApi Pointer to host API struct + + @param hostApiIndex Index of current (HPI) host API + + @return PortAudio error code + */ +PaError PaAsiHpi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaAsiHpiHostApiRepresentation *hpiHostApi = NULL; + PaHostApiInfo *baseApiInfo; + + /* Allocate host API structure */ + PA_UNLESS_( hpiHostApi = (PaAsiHpiHostApiRepresentation*) PaUtil_AllocateMemory( + sizeof(PaAsiHpiHostApiRepresentation) ), paInsufficientMemory ); + PA_UNLESS_( hpiHostApi->allocations = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + + hpiHostApi->hostApiIndex = hostApiIndex; + hpiHostApi->subSys = NULL; + + /* Try to initialize HPI subsystem */ + if( ( hpiHostApi->subSys = HPI_SubSysCreate() ) == NULL) + { + /* the V19 development docs say that if an implementation + * detects that it cannot be used, it should return a NULL + * interface and paNoError */ + PA_DEBUG(( "Could not open HPI interface\n" )); + result = paNoError; + *hostApi = NULL; + goto error; + } + else + { + HW32 hpiVersion; + PA_ASIHPI_UNLESS_( HPI_SubSysGetVersion( hpiHostApi->subSys, &hpiVersion ), paUnanticipatedHostError ); + PA_DEBUG(( "HPI interface v%d.%02d\n", + hpiVersion >> 8, 10*((hpiVersion & 0xF0) >> 4) + (hpiVersion & 0x0F) )); + } + + *hostApi = &hpiHostApi->baseHostApiRep; + baseApiInfo = &((*hostApi)->info); + /* Fill in common API details */ + baseApiInfo->structVersion = 1; + baseApiInfo->type = paAudioScienceHPI; + baseApiInfo->name = "AudioScience HPI"; + baseApiInfo->deviceCount = 0; + baseApiInfo->defaultInputDevice = paNoDevice; + baseApiInfo->defaultOutputDevice = paNoDevice; + + PA_ENSURE_( PaAsiHpi_BuildDeviceList( hpiHostApi ) ); + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &hpiHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &hpiHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + /* Store identity of main thread */ + PA_ENSURE_( PaUnixThreading_Initialize() ); + + return result; +error: + /* Clean up memory */ + Terminate( (PaUtilHostApiRepresentation *)hpiHostApi ); + return result; +} + + +/** Terminate host API implementation. + This closes all HPI adapters and frees the HPI subsystem. It also frees the host API struct + memory. It should be called once for every PaAsiHpi_Initialize call. + + @param Pointer to host API struct + */ +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaAsiHpiHostApiRepresentation *hpiHostApi = (PaAsiHpiHostApiRepresentation*)hostApi; + int i; + PaError result = paNoError; + + if( hpiHostApi ) + { + /* Get rid of HPI-specific structures */ + if( hpiHostApi->subSys ) + { + HW16 lastAdapterIndex = HPI_MAX_ADAPTERS; + /* Iterate through device list and close adapters */ + for( i=0; i < hostApi->info.deviceCount; ++i ) + { + PaAsiHpiDeviceInfo *hpiDevice = (PaAsiHpiDeviceInfo *) hostApi->deviceInfos[ i ]; + /* Close adapter only if it differs from previous one */ + if( hpiDevice->adapterIndex != lastAdapterIndex ) + { + /* Ignore errors (report only during debugging) */ + PA_ASIHPI_UNLESS_( HPI_AdapterClose( hpiHostApi->subSys, + hpiDevice->adapterIndex ), paNoError ); + lastAdapterIndex = hpiDevice->adapterIndex; + } + } + /* Finally dismantle HPI subsystem */ + HPI_SubSysFree( hpiHostApi->subSys ); + } + + if( hpiHostApi->allocations ) + { + PaUtil_FreeAllAllocations( hpiHostApi->allocations ); + PaUtil_DestroyAllocationGroup( hpiHostApi->allocations ); + } + + PaUtil_FreeMemory( hpiHostApi ); + } +error: + return; +} + + +/** Converts PortAudio sample format to equivalent HPI format. + + @param paFormat PortAudio sample format + + @return HPI sample format + */ +static HW16 PaAsiHpi_PaToHpiFormat( PaSampleFormat paFormat ) +{ + /* Ignore interleaving flag */ + switch( paFormat & ~paNonInterleaved ) + { + case paFloat32: + return HPI_FORMAT_PCM32_FLOAT; + + case paInt32: + return HPI_FORMAT_PCM32_SIGNED; + + case paInt24: + return HPI_FORMAT_PCM24_SIGNED; + + case paInt16: + return HPI_FORMAT_PCM16_SIGNED; + + case paUInt8: + return HPI_FORMAT_PCM8_UNSIGNED; + + /* Default is 16-bit signed */ + case paInt8: + default: + return HPI_FORMAT_PCM16_SIGNED; + } +} + + +/** Converts HPI sample format to equivalent PortAudio format. + + @param paFormat HPI sample format + + @return PortAudio sample format + */ +static PaSampleFormat PaAsiHpi_HpiToPaFormat( HW16 hpiFormat ) +{ + switch( hpiFormat ) + { + case HPI_FORMAT_PCM32_FLOAT: + return paFloat32; + + case HPI_FORMAT_PCM32_SIGNED: + return paInt32; + + case HPI_FORMAT_PCM24_SIGNED: + return paInt24; + + case HPI_FORMAT_PCM16_SIGNED: + return paInt16; + + case HPI_FORMAT_PCM8_UNSIGNED: + return paUInt8; + + /* Default is custom format (e.g. for HPI MP3 format) */ + default: + return paCustomFormat; + } +} + + +/** Creates HPI format struct based on PortAudio parameters. + This also does some checks to see whether the desired format is valid, and whether + the device allows it. This only checks the format of one half (input or output) of the + PortAudio stream. + + @param hostApi Pointer to host API struct + + @param parameters Pointer to stream parameter struct + + @param sampleRate Desired sample rate + + @param hpiDevice Pointer to HPI device struct + + @param hpiFormat Resulting HPI format returned here + + @return PortAudio error code (typically indicating a problem with stream format) + */ +static PaError PaAsiHpi_CreateFormat( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *parameters, double sampleRate, + PaAsiHpiDeviceInfo **hpiDevice, HPI_FORMAT *hpiFormat ) +{ + int maxChannelCount = 0; + PaSampleFormat hostSampleFormat = 0; + HW16 hpiError = 0; + + /* Unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + if( parameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + else + { + assert( parameters->device < hostApi->info.deviceCount ); + *hpiDevice = (PaAsiHpiDeviceInfo*) hostApi->deviceInfos[ parameters->device ]; + } + + /* Validate streamInfo - this implementation doesn't use custom stream info */ + if( parameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; + + /* Check that device can support channel count */ + if( (*hpiDevice)->streamIsOutput ) + { + maxChannelCount = (*hpiDevice)->baseDeviceInfo.maxOutputChannels; + } + else + { + maxChannelCount = (*hpiDevice)->baseDeviceInfo.maxInputChannels; + } + if( (maxChannelCount == 0) || (parameters->channelCount > maxChannelCount) ) + return paInvalidChannelCount; + + /* All standard sample formats are supported by the buffer adapter, + and this implementation doesn't support any custom sample formats */ + if( parameters->sampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* Switch to closest HPI native format */ + hostSampleFormat = PaUtil_SelectClosestAvailableFormat(PA_ASIHPI_AVAILABLE_FORMATS_, + parameters->sampleFormat ); + /* Setup format + info objects */ + hpiError = HPI_FormatCreate( hpiFormat, (HW16)parameters->channelCount, + PaAsiHpi_PaToHpiFormat( hostSampleFormat ), + (HW32)sampleRate, 0, 0 ); + if( hpiError ) + { + PA_ASIHPI_REPORT_ERROR_( hpiError ); + switch( hpiError ) + { + case HPI_ERROR_INVALID_FORMAT: + return paSampleFormatNotSupported; + + case HPI_ERROR_INVALID_SAMPLERATE: + case HPI_ERROR_INCOMPATIBLE_SAMPLERATE: + return paInvalidSampleRate; + + case HPI_ERROR_INVALID_CHANNELS: + return paInvalidChannelCount; + } + } + + return paNoError; +} + + +/** Open HPI input stream with given format. + This attempts to open HPI input stream with desired format. If the format is not supported + or the device is unavailable, the stream is closed and a PortAudio error code is returned. + + @param hostApi Pointer to host API struct + + @param hpiDevice Pointer to HPI device struct + + @param hpiFormat Pointer to HPI format struct + + @return PortAudio error code (typically indicating a problem with stream format or device) +*/ +static PaError PaAsiHpi_OpenInput( struct PaUtilHostApiRepresentation *hostApi, + const PaAsiHpiDeviceInfo *hpiDevice, const HPI_FORMAT *hpiFormat, + HPI_HISTREAM *hpiStream ) +{ + PaAsiHpiHostApiRepresentation *hpiHostApi = (PaAsiHpiHostApiRepresentation*)hostApi; + PaError result = paNoError; + HW16 hpiError = 0; + + /* Catch misplaced output devices, as they typically have 0 input channels */ + PA_UNLESS_( !hpiDevice->streamIsOutput, paInvalidChannelCount ); + /* Try to open input stream */ + PA_ASIHPI_UNLESS_( HPI_InStreamOpen( hpiHostApi->subSys, hpiDevice->adapterIndex, + hpiDevice->streamIndex, hpiStream ), paDeviceUnavailable ); + /* Set input format (checking it in the process) */ + /* Could also use HPI_InStreamQueryFormat, but this economizes the process */ + hpiError = HPI_InStreamSetFormat( hpiHostApi->subSys, *hpiStream, (HPI_FORMAT*)hpiFormat ); + if( hpiError ) + { + PA_ASIHPI_REPORT_ERROR_( hpiError ); + PA_ASIHPI_UNLESS_( HPI_InStreamClose( hpiHostApi->subSys, *hpiStream ), paNoError ); + switch( hpiError ) + { + case HPI_ERROR_INVALID_FORMAT: + return paSampleFormatNotSupported; + + case HPI_ERROR_INVALID_SAMPLERATE: + case HPI_ERROR_INCOMPATIBLE_SAMPLERATE: + return paInvalidSampleRate; + + case HPI_ERROR_INVALID_CHANNELS: + return paInvalidChannelCount; + + default: + /* In case anything else went wrong */ + return paInvalidDevice; + } + } + +error: + return result; +} + + +/** Open HPI output stream with given format. + This attempts to open HPI output stream with desired format. If the format is not supported + or the device is unavailable, the stream is closed and a PortAudio error code is returned. + + @param hostApi Pointer to host API struct + + @param hpiDevice Pointer to HPI device struct + + @param hpiFormat Pointer to HPI format struct + + @return PortAudio error code (typically indicating a problem with stream format or device) +*/ +static PaError PaAsiHpi_OpenOutput( struct PaUtilHostApiRepresentation *hostApi, + const PaAsiHpiDeviceInfo *hpiDevice, const HPI_FORMAT *hpiFormat, + HPI_HOSTREAM *hpiStream ) +{ + PaAsiHpiHostApiRepresentation *hpiHostApi = (PaAsiHpiHostApiRepresentation*)hostApi; + PaError result = paNoError; + HW16 hpiError = 0; + + /* Catch misplaced input devices, as they typically have 0 output channels */ + PA_UNLESS_( hpiDevice->streamIsOutput, paInvalidChannelCount ); + /* Try to open output stream */ + PA_ASIHPI_UNLESS_( HPI_OutStreamOpen( hpiHostApi->subSys, hpiDevice->adapterIndex, + hpiDevice->streamIndex, hpiStream ), paDeviceUnavailable ); + + /* Check output format (format is set on first write to output stream) */ + hpiError = HPI_OutStreamQueryFormat( hpiHostApi->subSys, *hpiStream, (HPI_FORMAT*)hpiFormat ); + if( hpiError ) + { + PA_ASIHPI_REPORT_ERROR_( hpiError ); + PA_ASIHPI_UNLESS_( HPI_OutStreamClose( hpiHostApi->subSys, *hpiStream ), paNoError ); + switch( hpiError ) + { + case HPI_ERROR_INVALID_FORMAT: + return paSampleFormatNotSupported; + + case HPI_ERROR_INVALID_SAMPLERATE: + case HPI_ERROR_INCOMPATIBLE_SAMPLERATE: + return paInvalidSampleRate; + + case HPI_ERROR_INVALID_CHANNELS: + return paInvalidChannelCount; + + default: + /* In case anything else went wrong */ + return paInvalidDevice; + } + } + +error: + return result; +} + + +/** Checks whether the desired stream formats and devices are supported + (for both input and output). + This is done by actually opening the appropriate HPI streams and closing them again. + + @param hostApi Pointer to host API struct + + @param inputParameters Pointer to stream parameter struct for input side of stream + + @param outputParameters Pointer to stream parameter struct for output side of stream + + @param sampleRate Desired sample rate + + @return PortAudio error code (paFormatIsSupported on success) + */ +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaError result = paFormatIsSupported; + PaAsiHpiHostApiRepresentation *hpiHostApi = (PaAsiHpiHostApiRepresentation*)hostApi; + PaAsiHpiDeviceInfo *hpiDevice = NULL; + HPI_FORMAT hpiFormat; + + /* Input stream */ + if( inputParameters ) + { + HPI_HISTREAM hpiStream; + PA_DEBUG(( "%s: Checking input params: dev=%d, sr=%d, chans=%d, fmt=%d\n", + __FUNCTION__, inputParameters->device, (int)sampleRate, + inputParameters->channelCount, inputParameters->sampleFormat )); + /* Create and validate format */ + PA_ENSURE_( PaAsiHpi_CreateFormat( hostApi, inputParameters, sampleRate, + &hpiDevice, &hpiFormat ) ); + /* Open stream to further check format */ + PA_ENSURE_( PaAsiHpi_OpenInput( hostApi, hpiDevice, &hpiFormat, &hpiStream ) ); + /* Close stream again */ + PA_ASIHPI_UNLESS_( HPI_InStreamClose( hpiHostApi->subSys, hpiStream ), paNoError ); + } + + /* Output stream */ + if( outputParameters ) + { + HPI_HOSTREAM hpiStream; + PA_DEBUG(( "%s: Checking output params: dev=%d, sr=%d, chans=%d, fmt=%d\n", + __FUNCTION__, outputParameters->device, (int)sampleRate, + outputParameters->channelCount, outputParameters->sampleFormat )); + /* Create and validate format */ + PA_ENSURE_( PaAsiHpi_CreateFormat( hostApi, outputParameters, sampleRate, + &hpiDevice, &hpiFormat ) ); + /* Open stream to further check format */ + PA_ENSURE_( PaAsiHpi_OpenOutput( hostApi, hpiDevice, &hpiFormat, &hpiStream ) ); + /* Close stream again */ + PA_ASIHPI_UNLESS_( HPI_OutStreamClose( hpiHostApi->subSys, hpiStream ), paNoError ); + } + +error: + return result; +} + +/* ---------------------------- Stream Interface ---------------------------- */ + +/** Obtain HPI stream information. + This obtains info such as stream state and available data/space in buffers. It also + estimates whether an underflow or overflow occurred. + + @param streamComp Pointer to stream component (input or output) to query + + @param info Pointer to stream info struct that will contain result + + @return PortAudio error code (either paNoError, paDeviceUnavailable or paUnanticipatedHostError) + */ +static PaError PaAsiHpi_GetStreamInfo( PaAsiHpiStreamComponent *streamComp, PaAsiHpiStreamInfo *info ) +{ + PaError result = paDeviceUnavailable; + HW16 state; + HW32 bufferSize, dataSize, frameCounter, auxDataSize, threshold; + HW32 hwBufferSize, hwDataSize; + + assert( streamComp ); + assert( info ); + + /* First blank the stream info struct, in case something goes wrong below. + This saves the caller from initializing the struct. */ + info->state = 0; + info->bufferSize = 0; + info->dataSize = 0; + info->frameCounter = 0; + info->auxDataSize = 0; + info->totalBufferedData = 0; + info->availableFrames = 0; + info->underflow = 0; + info->overflow = 0; + + if( streamComp->hpiDevice && streamComp->hpiStream ) + { + /* Obtain detailed stream info (either input or output) */ + if( streamComp->hpiDevice->streamIsOutput ) + { + PA_ASIHPI_UNLESS_( HPI_OutStreamGetInfoEx( streamComp->hpiDevice->subSys, + streamComp->hpiStream, + &state, &bufferSize, &dataSize, &frameCounter, + &auxDataSize ), paUnanticipatedHostError ); + } + else + { + PA_ASIHPI_UNLESS_( HPI_InStreamGetInfoEx( streamComp->hpiDevice->subSys, + streamComp->hpiStream, + &state, &bufferSize, &dataSize, &frameCounter, + &auxDataSize ), paUnanticipatedHostError ); + } + /* Load stream info */ + info->state = state; + info->bufferSize = bufferSize; + info->dataSize = dataSize; + info->frameCounter = frameCounter; + info->auxDataSize = auxDataSize; + /* Determine total buffered data */ + info->totalBufferedData = dataSize; + if( streamComp->hostBufferSize > 0 ) + info->totalBufferedData += auxDataSize; + info->totalBufferedData /= streamComp->bytesPerFrame; + /* Determine immediately available frames */ + info->availableFrames = streamComp->hpiDevice->streamIsOutput ? + bufferSize - dataSize : dataSize; + info->availableFrames /= streamComp->bytesPerFrame; + /* Minimum space/data required in buffers */ + threshold = PA_MIN( streamComp->tempBufferSize, + streamComp->bytesPerFrame * PA_ASIHPI_MIN_FRAMES_ ); + /* Obtain hardware buffer stats first, to simplify things */ + hwBufferSize = streamComp->hardwareBufferSize; + hwDataSize = streamComp->hostBufferSize > 0 ? auxDataSize : dataSize; + /* Underflow is a bit tricky */ + info->underflow = streamComp->hpiDevice->streamIsOutput ? + /* Stream seems to start in drained state sometimes, so ignore initial underflow */ + (frameCounter > 0) && ( (state == HPI_STATE_DRAINED) || (hwDataSize == 0) ) : + /* Input streams check the first-level (host) buffer for underflow */ + (state != HPI_STATE_STOPPED) && (dataSize < threshold); + /* Check for overflow in second-level (hardware) buffer for both input and output */ + info->overflow = (state != HPI_STATE_STOPPED) && (hwBufferSize - hwDataSize < threshold); + + return paNoError; + } + +error: + return result; +} + + +/** Display stream component information for debugging purposes. + + @param streamComp Pointer to stream component (input or output) to query + + @param stream Pointer to stream struct which contains the component above + */ +static void PaAsiHpi_StreamComponentDump( PaAsiHpiStreamComponent *streamComp, + PaAsiHpiStream *stream ) +{ + PaAsiHpiStreamInfo streamInfo; + + assert( streamComp ); + assert( stream ); + + /* Name of soundcard/device used by component */ + PA_DEBUG(( "device: %s\n", streamComp->hpiDevice->baseDeviceInfo.name )); + /* Unfortunately some overlap between input and output here */ + if( streamComp->hpiDevice->streamIsOutput ) + { + /* Settings on the user side (as experienced by user callback) */ + PA_DEBUG(( "user: %d-bit, %d ", + 8*stream->bufferProcessor.bytesPerUserOutputSample, + stream->bufferProcessor.outputChannelCount)); + if( stream->bufferProcessor.userOutputIsInterleaved ) + { + PA_DEBUG(( "interleaved channels, " )); + } + else + { + PA_DEBUG(( "non-interleaved channels, " )); + } + PA_DEBUG(( "%d frames/buffer, latency = %5.1f ms\n", + stream->bufferProcessor.framesPerUserBuffer, + 1000*stream->baseStreamRep.streamInfo.outputLatency )); + /* Settings on the host side (internal to PortAudio host API) */ + PA_DEBUG(( "host: %d-bit, %d interleaved channels, %d frames/buffer ", + 8*stream->bufferProcessor.bytesPerHostOutputSample, + stream->bufferProcessor.outputChannelCount, + stream->bufferProcessor.framesPerHostBuffer )); + } + else + { + /* Settings on the user side (as experienced by user callback) */ + PA_DEBUG(( "user: %d-bit, %d ", + 8*stream->bufferProcessor.bytesPerUserInputSample, + stream->bufferProcessor.inputChannelCount)); + if( stream->bufferProcessor.userInputIsInterleaved ) + { + PA_DEBUG(( "interleaved channels, " )); + } + else + { + PA_DEBUG(( "non-interleaved channels, " )); + } + PA_DEBUG(( "%d frames/buffer, latency = %5.1f ms\n", + stream->bufferProcessor.framesPerUserBuffer, + 1000*stream->baseStreamRep.streamInfo.inputLatency )); + /* Settings on the host side (internal to PortAudio host API) */ + PA_DEBUG(( "host: %d-bit, %d interleaved channels, %d frames/buffer ", + 8*stream->bufferProcessor.bytesPerHostInputSample, + stream->bufferProcessor.inputChannelCount, + stream->bufferProcessor.framesPerHostBuffer )); + } + switch( stream->bufferProcessor.hostBufferSizeMode ) + { + case paUtilFixedHostBufferSize: + PA_DEBUG(( "[fixed] " )); + break; + case paUtilBoundedHostBufferSize: + PA_DEBUG(( "[bounded] " )); + break; + case paUtilUnknownHostBufferSize: + PA_DEBUG(( "[unknown] " )); + break; + case paUtilVariableHostBufferSizePartialUsageAllowed: + PA_DEBUG(( "[variable] " )); + break; + } + PA_DEBUG(( "(%d max)\n", streamComp->tempBufferSize / streamComp->bytesPerFrame )); + /* HPI hardware settings */ + PA_DEBUG(( "HPI: adapter %d stream %d, %d-bit, %d-channel, %d Hz\n", + streamComp->hpiDevice->adapterIndex, streamComp->hpiDevice->streamIndex, + 8 * streamComp->bytesPerFrame / streamComp->hpiFormat.wChannels, + streamComp->hpiFormat.wChannels, + streamComp->hpiFormat.dwSampleRate )); + /* Stream state and buffer levels */ + PA_DEBUG(( "HPI: " )); + PaAsiHpi_GetStreamInfo( streamComp, &streamInfo ); + switch( streamInfo.state ) + { + case HPI_STATE_STOPPED: + PA_DEBUG(( "[STOPPED] " )); + break; + case HPI_STATE_PLAYING: + PA_DEBUG(( "[PLAYING] " )); + break; + case HPI_STATE_RECORDING: + PA_DEBUG(( "[RECORDING] " )); + break; + case HPI_STATE_DRAINED: + PA_DEBUG(( "[DRAINED] " )); + break; + default: + PA_DEBUG(( "[unknown state] " )); + break; + } + if( streamComp->hostBufferSize ) + { + PA_DEBUG(( "host = %d/%d B, ", streamInfo.dataSize, streamComp->hostBufferSize )); + PA_DEBUG(( "hw = %d/%d (%d) B, ", streamInfo.auxDataSize, + streamComp->hardwareBufferSize, streamComp->outputBufferCap )); + } + else + { + PA_DEBUG(( "hw = %d/%d B, ", streamInfo.dataSize, streamComp->hardwareBufferSize )); + } + PA_DEBUG(( "count = %d", streamInfo.frameCounter )); + if( streamInfo.overflow ) + { + PA_DEBUG(( " [overflow]" )); + } + else if( streamInfo.underflow ) + { + PA_DEBUG(( " [underflow]" )); + } + PA_DEBUG(( "\n" )); +} + + +/** Display stream information for debugging purposes. + + @param stream Pointer to stream to query + */ +static void PaAsiHpi_StreamDump( PaAsiHpiStream *stream ) +{ + assert( stream ); + + PA_DEBUG(( "\n------------------------- STREAM INFO FOR %p ---------------------------\n", stream )); + /* General stream info (input+output) */ + if( stream->baseStreamRep.streamCallback ) + { + PA_DEBUG(( "[callback] " )); + } + else + { + PA_DEBUG(( "[blocking] " )); + } + PA_DEBUG(( "sr=%d Hz, poll=%d ms, max %d frames/buf ", + (int)stream->baseStreamRep.streamInfo.sampleRate, + stream->pollingInterval, stream->maxFramesPerHostBuffer )); + switch( stream->state ) + { + case paAsiHpiStoppedState: + PA_DEBUG(( "[stopped]\n" )); + break; + case paAsiHpiActiveState: + PA_DEBUG(( "[active]\n" )); + break; + case paAsiHpiCallbackFinishedState: + PA_DEBUG(( "[cb fin]\n" )); + break; + default: + PA_DEBUG(( "[unknown state]\n" )); + break; + } + if( stream->callbackMode ) + { + PA_DEBUG(( "cb info: thread=%p, cbAbort=%d, cbFinished=%d\n", + stream->thread.thread, stream->callbackAbort, stream->callbackFinished )); + } + + PA_DEBUG(( "----------------------------------- Input ------------------------------------\n" )); + if( stream->input ) + { + PaAsiHpi_StreamComponentDump( stream->input, stream ); + } + else + { + PA_DEBUG(( "*none*\n" )); + } + + PA_DEBUG(( "----------------------------------- Output ------------------------------------\n" )); + if( stream->output ) + { + PaAsiHpi_StreamComponentDump( stream->output, stream ); + } + else + { + PA_DEBUG(( "*none*\n" )); + } + PA_DEBUG(( "-------------------------------------------------------------------------------\n\n" )); + +} + + +/** Determine buffer sizes and allocate appropriate stream buffers. + This attempts to allocate a BBM (host) buffer for the HPI stream component (either input + or output, as both have similar buffer needs). Not all AudioScience adapters support BBM, + in which case the hardware buffer has to suffice. The size of the HPI host buffer is chosen + as a multiple of framesPerPaHostBuffer, and also influenced by the suggested latency and the + estimated minimum polling interval. The HPI host and hardware buffer sizes are stored, and an + appropriate cap for the hardware buffer is also calculated. Finally, the temporary stream + buffer which serves as the PortAudio host buffer for this implementation is allocated. + This buffer contains an integer number of user buffers, to simplify buffer adaption in the + buffer processor. The function returns paBufferTooBig if the HPI interface cannot allocate + an HPI host buffer of the desired size. + + @param streamComp Pointer to stream component struct + + @param pollingInterval Polling interval for stream, in milliseconds + + @param framesPerPaHostBuffer Size of PortAudio host buffer, in frames + + @param suggestedLatency Suggested latency for stream component, in seconds + + @return PortAudio error code (possibly paBufferTooBig or paInsufficientMemory) + */ +static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32 pollingInterval, + unsigned long framesPerPaHostBuffer, PaTime suggestedLatency ) +{ + PaError result = paNoError; + PaAsiHpiStreamInfo streamInfo; + unsigned long hpiBufferSize = 0, paHostBufferSize = 0; + + assert( streamComp ); + assert( streamComp->hpiDevice ); + + /* Obtain size of hardware buffer of HPI stream, since we will be activating BBM shortly + and afterwards the buffer size will refer to the BBM (host-side) buffer. + This is necessary to enable reliable detection of xruns. */ + PA_ENSURE_( PaAsiHpi_GetStreamInfo( streamComp, &streamInfo ) ); + streamComp->hardwareBufferSize = streamInfo.bufferSize; + hpiBufferSize = streamInfo.bufferSize; + + /* Check if BBM (background bus mastering) is to be enabled */ + if( PA_ASIHPI_USE_BBM_ ) + { + HW32 bbmBufferSize = 0, preLatencyBufferSize = 0; + HW16 hpiError = 0; + PaTime pollingOverhead; + + /* Check overhead of Pa_Sleep() call (minimum sleep duration in ms -> OS dependent) */ + pollingOverhead = PaUtil_GetTime(); + Pa_Sleep( 0 ); + pollingOverhead = 1000*(PaUtil_GetTime() - pollingOverhead); + PA_DEBUG(( "polling overhead = %f ms (length of 0-second sleep)\n", pollingOverhead )); + /* Obtain minimum recommended size for host buffer (in bytes) */ + PA_ASIHPI_UNLESS_( HPI_StreamEstimateBufferSize( &streamComp->hpiFormat, + pollingInterval + (HW32)ceil( pollingOverhead ), + &bbmBufferSize ), paUnanticipatedHostError ); + /* BBM places more stringent requirements on buffer size (see description */ + /* of HPI_StreamEstimateBufferSize in HPI API document) */ + bbmBufferSize *= 3; + /* Make sure the BBM buffer contains multiple PA host buffers */ + if( bbmBufferSize < 3 * streamComp->bytesPerFrame * framesPerPaHostBuffer ) + bbmBufferSize = 3 * streamComp->bytesPerFrame * framesPerPaHostBuffer; + /* Try to honor latency suggested by user by growing buffer (no decrease possible) */ + if( suggestedLatency > 0.0 ) + { + PaTime bufferDuration = ((PaTime)bbmBufferSize) / streamComp->bytesPerFrame + / streamComp->hpiFormat.dwSampleRate; + /* Don't decrease buffer */ + if( bufferDuration < suggestedLatency ) + { + /* Save old buffer size, to be retried if new size proves too big */ + preLatencyBufferSize = bbmBufferSize; + bbmBufferSize = (HW32)ceil( suggestedLatency * streamComp->bytesPerFrame + * streamComp->hpiFormat.dwSampleRate ); + } + } + /* Choose closest memory block boundary (HPI API document states that + "a buffer size of Nx4096 - 20 makes the best use of memory" + (under the entry for HPI_StreamEstimateBufferSize)) */ + bbmBufferSize = ((HW32)ceil((bbmBufferSize + 20)/4096.0))*4096 - 20; + streamComp->hostBufferSize = bbmBufferSize; + /* Allocate BBM host buffer (this enables bus mastering transfers in background) */ + if( streamComp->hpiDevice->streamIsOutput ) + hpiError = HPI_OutStreamHostBufferAllocate( streamComp->hpiDevice->subSys, + streamComp->hpiStream, + bbmBufferSize ); + else + hpiError = HPI_InStreamHostBufferAllocate( streamComp->hpiDevice->subSys, + streamComp->hpiStream, + bbmBufferSize ); + if( hpiError ) + { + PA_ASIHPI_REPORT_ERROR_( hpiError ); + /* Indicate that BBM is disabled */ + streamComp->hostBufferSize = 0; + /* Retry with smaller buffer size (transfers will still work, but not via BBM) */ + if( hpiError == HPI_ERROR_INVALID_DATASIZE ) + { + /* Retry BBM allocation with smaller size if requested latency proved too big */ + if( preLatencyBufferSize > 0 ) + { + PA_DEBUG(( "Retrying BBM allocation with smaller size (%d vs. %d bytes)\n", + preLatencyBufferSize, bbmBufferSize )); + bbmBufferSize = preLatencyBufferSize; + if( streamComp->hpiDevice->streamIsOutput ) + hpiError = HPI_OutStreamHostBufferAllocate( streamComp->hpiDevice->subSys, + streamComp->hpiStream, + bbmBufferSize ); + else + hpiError = HPI_InStreamHostBufferAllocate( streamComp->hpiDevice->subSys, + streamComp->hpiStream, + bbmBufferSize ); + /* Another round of error checking */ + if( hpiError ) + { + PA_ASIHPI_REPORT_ERROR_( hpiError ); + /* No escapes this time */ + if( hpiError == HPI_ERROR_INVALID_DATASIZE ) + { + result = paBufferTooBig; + goto error; + } + else if( hpiError != HPI_ERROR_INVALID_OPERATION ) + { + result = paUnanticipatedHostError; + goto error; + } + } + else + { + streamComp->hostBufferSize = bbmBufferSize; + hpiBufferSize = bbmBufferSize; + } + } + else + { + result = paBufferTooBig; + goto error; + } + } + /* If BBM not supported, foreground transfers will be used, but not a show-stopper */ + /* Anything else is an error */ + else if( hpiError != HPI_ERROR_INVALID_OPERATION ) + { + result = paUnanticipatedHostError; + goto error; + } + } + else + { + hpiBufferSize = bbmBufferSize; + } + } + + /* Final check of buffer size */ + paHostBufferSize = streamComp->bytesPerFrame * framesPerPaHostBuffer; + if( hpiBufferSize < 3*paHostBufferSize ) + { + result = paBufferTooBig; + goto error; + } + /* Set cap on output buffer size, based on latency suggestions */ + if( streamComp->hpiDevice->streamIsOutput ) + { + PaTime latency = suggestedLatency > 0.0 ? suggestedLatency : + streamComp->hpiDevice->baseDeviceInfo.defaultHighOutputLatency; + streamComp->outputBufferCap = + (HW32)ceil( latency * streamComp->bytesPerFrame * streamComp->hpiFormat.dwSampleRate ); + /* The cap should not be too small, to prevent underflow */ + if( streamComp->outputBufferCap < 4*paHostBufferSize ) + streamComp->outputBufferCap = 4*paHostBufferSize; + } + else + { + streamComp->outputBufferCap = 0; + } + /* Temp buffer size should be multiple of PA host buffer size (or 1x, if using fixed blocks) */ + streamComp->tempBufferSize = paHostBufferSize; + /* Allocate temp buffer */ + PA_UNLESS_( streamComp->tempBuffer = (HW8 *)PaUtil_AllocateMemory( streamComp->tempBufferSize ), + paInsufficientMemory ); +error: + return result; +} + + +/** Opens PortAudio stream. + This determines a suitable value for framesPerBuffer, if the user didn't specify it, + based on the suggested latency. It then opens each requested stream direction with the + appropriate stream format, and allocates the required stream buffers. It sets up the + various PortAudio structures dealing with streams, and estimates the stream latency. + + See pa_hostapi.h for a list of validity guarantees made about OpenStream parameters. + + @param hostApi Pointer to host API struct + + @param s List of open streams, where successfully opened stream will go + + @param inputParameters Pointer to stream parameter struct for input side of stream + + @param outputParameters Pointer to stream parameter struct for output side of stream + + @param sampleRate Desired sample rate + + @param framesPerBuffer Desired number of frames per buffer passed to user callback + (or chunk size for blocking stream) + + @param streamFlags Stream flags + + @param streamCallback Pointer to user callback function (zero for blocking interface) + + @param userData Pointer to user data that will be passed to callback function along with data + + @return PortAudio error code +*/ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream **s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaAsiHpiHostApiRepresentation *hpiHostApi = (PaAsiHpiHostApiRepresentation*)hostApi; + PaAsiHpiStream *stream = NULL; + unsigned long framesPerHostBuffer = framesPerBuffer; + int inputChannelCount = 0, outputChannelCount = 0; + PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0; + PaSampleFormat hostInputSampleFormat = 0, hostOutputSampleFormat = 0; + PaTime maxSuggestedLatency = 0.0; + + /* Validate platform-specific flags -> none expected for HPI */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform-specific flag */ + + /* Create blank stream structure */ + PA_UNLESS_( stream = (PaAsiHpiStream *)PaUtil_AllocateMemory( sizeof(PaAsiHpiStream) ), + paInsufficientMemory ); + memset( stream, 0, sizeof(PaAsiHpiStream) ); + + /* If the number of frames per buffer is unspecified, we have to come up with one. */ + if( framesPerHostBuffer == paFramesPerBufferUnspecified ) + { + if( inputParameters ) + maxSuggestedLatency = inputParameters->suggestedLatency; + if( outputParameters && (outputParameters->suggestedLatency > maxSuggestedLatency) ) + maxSuggestedLatency = outputParameters->suggestedLatency; + /* Use suggested latency if available */ + if( maxSuggestedLatency > 0.0 ) + framesPerHostBuffer = (unsigned long)ceil( maxSuggestedLatency * sampleRate ); + else + /* AudioScience cards like BIG buffers by default */ + framesPerHostBuffer = 4096; + } + /* Lower bounds on host buffer size, due to polling and HPI constraints */ + if( 1000.0*framesPerHostBuffer/sampleRate < PA_ASIHPI_MIN_POLLING_INTERVAL_ ) + framesPerHostBuffer = (unsigned long)ceil( sampleRate * PA_ASIHPI_MIN_POLLING_INTERVAL_ / 1000.0 ); + /* if( framesPerHostBuffer < PA_ASIHPI_MIN_FRAMES_ ) + framesPerHostBuffer = PA_ASIHPI_MIN_FRAMES_; */ + /* Efficient if host buffer size is integer multiple of user buffer size */ + if( framesPerBuffer > 0 ) + framesPerHostBuffer = (unsigned long)ceil( (double)framesPerHostBuffer / framesPerBuffer ) * framesPerBuffer; + /* Buffer should always be a multiple of 4 bytes to facilitate 32-bit PCI transfers. + By keeping the frames a multiple of 4, this is ensured even for 8-bit mono sound. */ + framesPerHostBuffer = (framesPerHostBuffer / 4) * 4; + /* Polling is based on time length (in milliseconds) of user-requested block size */ + stream->pollingInterval = (HW32)ceil( 1000.0*framesPerHostBuffer/sampleRate ); + assert( framesPerHostBuffer > 0 ); + + /* Open underlying streams, check formats and allocate buffers */ + if( inputParameters ) + { + /* Create blank stream component structure */ + PA_UNLESS_( stream->input = (PaAsiHpiStreamComponent *)PaUtil_AllocateMemory( sizeof(PaAsiHpiStreamComponent) ), + paInsufficientMemory ); + memset( stream->input, 0, sizeof(PaAsiHpiStreamComponent) ); + /* Create/validate format */ + PA_ENSURE_( PaAsiHpi_CreateFormat( hostApi, inputParameters, sampleRate, + &stream->input->hpiDevice, &stream->input->hpiFormat ) ); + /* Open stream and set format */ + PA_ENSURE_( PaAsiHpi_OpenInput( hostApi, stream->input->hpiDevice, &stream->input->hpiFormat, + &stream->input->hpiStream ) ); + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + hostInputSampleFormat = PaAsiHpi_HpiToPaFormat( stream->input->hpiFormat.wFormat ); + stream->input->bytesPerFrame = inputChannelCount * Pa_GetSampleSize( hostInputSampleFormat ); + assert( stream->input->bytesPerFrame > 0 ); + /* Allocate host and temp buffers of appropriate size */ + PA_ENSURE_( PaAsiHpi_SetupBuffers( stream->input, stream->pollingInterval, + framesPerHostBuffer, inputParameters->suggestedLatency ) ); + } + if( outputParameters ) + { + /* Create blank stream component structure */ + PA_UNLESS_( stream->output = (PaAsiHpiStreamComponent *)PaUtil_AllocateMemory( sizeof(PaAsiHpiStreamComponent) ), + paInsufficientMemory ); + memset( stream->output, 0, sizeof(PaAsiHpiStreamComponent) ); + /* Create/validate format */ + PA_ENSURE_( PaAsiHpi_CreateFormat( hostApi, outputParameters, sampleRate, + &stream->output->hpiDevice, &stream->output->hpiFormat ) ); + /* Open stream and check format */ + PA_ENSURE_( PaAsiHpi_OpenOutput( hostApi, stream->output->hpiDevice, + &stream->output->hpiFormat, + &stream->output->hpiStream ) ); + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + hostOutputSampleFormat = PaAsiHpi_HpiToPaFormat( stream->output->hpiFormat.wFormat ); + stream->output->bytesPerFrame = outputChannelCount * Pa_GetSampleSize( hostOutputSampleFormat ); + /* Allocate host and temp buffers of appropriate size */ + PA_ENSURE_( PaAsiHpi_SetupBuffers( stream->output, stream->pollingInterval, + framesPerHostBuffer, outputParameters->suggestedLatency ) ); + } + + /* Determine maximum frames per host buffer (least common denominator of input/output) */ + if( inputParameters && outputParameters ) + { + stream->maxFramesPerHostBuffer = PA_MIN( stream->input->tempBufferSize / stream->input->bytesPerFrame, + stream->output->tempBufferSize / stream->output->bytesPerFrame ); + } + else + { + stream->maxFramesPerHostBuffer = inputParameters ? stream->input->tempBufferSize / stream->input->bytesPerFrame + : stream->output->tempBufferSize / stream->output->bytesPerFrame; + } + assert( stream->maxFramesPerHostBuffer > 0 ); + /* Initialize various other stream parameters */ + stream->neverDropInput = streamFlags & paNeverDropInput; + stream->state = paAsiHpiStoppedState; + + /* Initialize either callback or blocking interface */ + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->baseStreamRep, + &hpiHostApi->callbackStreamInterface, + streamCallback, userData ); + stream->callbackMode = 1; + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->baseStreamRep, + &hpiHostApi->blockingStreamInterface, + streamCallback, userData ); + /* Pre-allocate non-interleaved user buffer pointers for blocking interface */ + PA_UNLESS_( stream->blockingUserBufferCopy = + PaUtil_AllocateMemory( sizeof(void *) * PA_MAX( inputChannelCount, outputChannelCount ) ), + paInsufficientMemory ); + stream->callbackMode = 0; + } + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + /* Following pa_linux_alsa's lead, we operate with fixed host buffer size by default, */ + /* since other modes will invariably lead to block adaption (maybe Bounded better?) */ + PA_ENSURE_( PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, + framesPerBuffer, framesPerHostBuffer, paUtilFixedHostBufferSize, + streamCallback, userData ) ); + + stream->baseStreamRep.streamInfo.structVersion = 1; + stream->baseStreamRep.streamInfo.sampleRate = sampleRate; + /* Determine input latency from buffer processor and buffer sizes */ + if( stream->input ) + { + PaTime bufferDuration = ( stream->input->hostBufferSize + stream->input->hardwareBufferSize ) + / sampleRate / stream->input->bytesPerFrame; + stream->baseStreamRep.streamInfo.inputLatency = + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor ) + + bufferDuration - stream->maxFramesPerHostBuffer / sampleRate; + assert( stream->baseStreamRep.streamInfo.inputLatency > 0.0 ); + } + /* Determine output latency from buffer processor and buffer sizes */ + if( stream->output ) + { + PaTime bufferDuration = ( stream->output->hostBufferSize + stream->output->hardwareBufferSize ) + / sampleRate / stream->output->bytesPerFrame; + /* Take buffer size cap into account (see PaAsiHpi_WaitForFrames) */ + if( !stream->input && (stream->output->outputBufferCap > 0) ) + { + bufferDuration = PA_MIN( bufferDuration, + stream->output->outputBufferCap / sampleRate / stream->output->bytesPerFrame ); + } + stream->baseStreamRep.streamInfo.outputLatency = + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor ) + + bufferDuration - stream->maxFramesPerHostBuffer / sampleRate; + assert( stream->baseStreamRep.streamInfo.outputLatency > 0.0 ); + } + + /* Report stream info, for debugging purposes */ + PaAsiHpi_StreamDump( stream ); + + /* Save initialized stream to PA stream list */ + *s = (PaStream*)stream; + return result; + +error: + CloseStream( (PaStream*)stream ); + return result; +} + + +/** Close PortAudio stream. + When CloseStream() is called, the multi-api layer ensures that the stream has already + been stopped or aborted. This closes the underlying HPI streams and deallocates stream + buffers and structs. + + @param s Pointer to PortAudio stream + + @return PortAudio error code +*/ +static PaError CloseStream( PaStream *s ) +{ + PaError result = paNoError; + PaAsiHpiStream *stream = (PaAsiHpiStream*)s; + + /* If stream is already gone, all is well */ + if( stream == NULL ) + return paNoError; + + /* Generic stream cleanup */ + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->baseStreamRep ); + + /* Implementation-specific details - close internal streams */ + if( stream->input ) + { + /* Close HPI stream (freeing BBM host buffer in the process, if used) */ + if( stream->input->hpiStream ) + { + PA_ASIHPI_UNLESS_( HPI_InStreamClose( stream->input->hpiDevice->subSys, + stream->input->hpiStream ), paUnanticipatedHostError ); + } + /* Free temp buffer and stream component */ + PaUtil_FreeMemory( stream->input->tempBuffer ); + PaUtil_FreeMemory( stream->input ); + } + if( stream->output ) + { + /* Close HPI stream (freeing BBM host buffer in the process, if used) */ + if( stream->output->hpiStream ) + { + PA_ASIHPI_UNLESS_( HPI_OutStreamClose( stream->output->hpiDevice->subSys, + stream->output->hpiStream ), paUnanticipatedHostError ); + } + /* Free temp buffer and stream component */ + PaUtil_FreeMemory( stream->output->tempBuffer ); + PaUtil_FreeMemory( stream->output ); + } + + PaUtil_FreeMemory( stream->blockingUserBufferCopy ); + PaUtil_FreeMemory( stream ); + +error: + return result; +} + + +/** Prime HPI output stream with silence. + This resets the output stream and uses PortAudio helper routines to fill the + temp buffer with silence. It then writes two host buffers to the stream. This is supposed + to be called before the stream is started. It has no effect on input-only streams. + + @param stream Pointer to stream struct + + @return PortAudio error code + */ +static PaError PaAsiHpi_PrimeOutputWithSilence( PaAsiHpiStream *stream ) +{ + PaError result = paNoError; + PaAsiHpiStreamComponent *out; + PaUtilZeroer *zeroer; + PaSampleFormat outputFormat; + HPI_DATA data; + + assert( stream ); + out = stream->output; + /* Only continue if stream has output channels */ + if( !out ) + return result; + assert( out->tempBuffer ); + + /* Clear all existing data in hardware playback buffer */ + PA_ASIHPI_UNLESS_( HPI_OutStreamReset( out->hpiDevice->subSys, + out->hpiStream ), paUnanticipatedHostError ); + /* Fill temp buffer with silence */ + outputFormat = PaAsiHpi_HpiToPaFormat( out->hpiFormat.wFormat ); + zeroer = PaUtil_SelectZeroer( outputFormat ); + zeroer(out->tempBuffer, 1, out->tempBufferSize / Pa_GetSampleSize(outputFormat) ); + /* Write temp buffer to hardware fifo twice, to get started */ + PA_ASIHPI_UNLESS_( HPI_DataCreate( &data, &out->hpiFormat, out->tempBuffer, out->tempBufferSize ), + paUnanticipatedHostError ); + PA_ASIHPI_UNLESS_( HPI_OutStreamWrite( out->hpiDevice->subSys, + out->hpiStream, &data ), paUnanticipatedHostError ); + PA_ASIHPI_UNLESS_( HPI_OutStreamWrite( out->hpiDevice->subSys, + out->hpiStream, &data ), paUnanticipatedHostError ); + +error: + return result; +} + + +/** Start HPI streams (both input + output). + This starts all HPI streams in the PortAudio stream. Output streams are first primed with + silence, if required. After this call the PA stream is in the Active state. + + @todo Implement priming via the user callback + + @param stream Pointer to stream struct + + @param outputPrimed True if output is already primed (if false, silence will be loaded before starting) + + @return PortAudio error code + */ +static PaError PaAsiHpi_StartStream( PaAsiHpiStream *stream, int outputPrimed ) +{ + PaError result = paNoError; + + if( stream->input ) + { + PA_ASIHPI_UNLESS_( HPI_InStreamStart( stream->input->hpiDevice->subSys, + stream->input->hpiStream ), paUnanticipatedHostError ); + } + if( stream->output ) + { + if( !outputPrimed ) + { + /* Buffer isn't primed, so load stream with silence */ + PA_ENSURE_( PaAsiHpi_PrimeOutputWithSilence( stream ) ); + } + PA_ASIHPI_UNLESS_( HPI_OutStreamStart( stream->output->hpiDevice->subSys, + stream->output->hpiStream ), paUnanticipatedHostError ); + } + stream->state = paAsiHpiActiveState; + stream->callbackFinished = 0; + + /* Report stream info for debugging purposes */ + /* PaAsiHpi_StreamDump( stream ); */ + +error: + return result; +} + + +/** Start PortAudio stream. + If the stream has a callback interface, this starts a helper thread to feed the user callback. + The thread will then take care of starting the HPI streams, and this function will block + until the streams actually start. In the case of a blocking interface, the HPI streams + are simply started. + + @param s Pointer to PortAudio stream + + @return PortAudio error code +*/ +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaAsiHpiStream *stream = (PaAsiHpiStream*)s; + + assert( stream ); + + /* Ready the processor */ + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + if( stream->callbackMode ) + { + /* Create and start callback engine thread */ + /* Also waits 1 second for stream to be started by engine thread (otherwise aborts) */ + PA_ENSURE_( PaUnixThread_New( &stream->thread, &CallbackThreadFunc, stream, 1. ) ); + } + else + { + PA_ENSURE_( PaAsiHpi_StartStream( stream, 0 ) ); + } + +error: + return result; +} + + +/** Stop HPI streams (input + output), either softly or abruptly. + If abort is false, the function blocks until the output stream is drained, otherwise it + stops immediately and discards data in the stream hardware buffers. + + This function is safe to call from the callback engine thread as well as the main thread. + + @param stream Pointer to stream struct + + @param abort True if samples in output buffer should be discarded (otherwise blocks until stream is done) + + @return PortAudio error code + + */ +static PaError PaAsiHpi_StopStream( PaAsiHpiStream *stream, int abort ) +{ + PaError result = paNoError; + + assert( stream ); + + /* Input channels */ + if( stream->input ) + { + PA_ASIHPI_UNLESS_( HPI_InStreamReset( stream->input->hpiDevice->subSys, + stream->input->hpiStream ), paUnanticipatedHostError ); + } + /* Output channels */ + if( stream->output ) + { + if( !abort ) + { + /* Wait until HPI output stream is drained */ + while( 1 ) + { + PaAsiHpiStreamInfo streamInfo; + PaTime timeLeft; + + /* Obtain number of samples waiting to be played */ + PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->output, &streamInfo ) ); + /* Check if stream is drained */ + if( (streamInfo.state != HPI_STATE_PLAYING) && + (streamInfo.dataSize < stream->output->bytesPerFrame * PA_ASIHPI_MIN_FRAMES_) ) + break; + /* Sleep amount of time represented by remaining samples */ + timeLeft = 1000.0 * streamInfo.dataSize / stream->output->bytesPerFrame + / stream->baseStreamRep.streamInfo.sampleRate; + Pa_Sleep( (long)ceil( timeLeft ) ); + } + } + PA_ASIHPI_UNLESS_( HPI_OutStreamReset( stream->output->hpiDevice->subSys, + stream->output->hpiStream ), paUnanticipatedHostError ); + } + + /* Report stream info for debugging purposes */ + /* PaAsiHpi_StreamDump( stream ); */ + +error: + return result; +} + + +/** Stop or abort PortAudio stream. + + This function is used to explicitly stop the PortAudio stream (via StopStream/AbortStream), + as opposed to the situation when the callback finishes with a result other than paContinue. + If a stream is in callback mode we will have to inspect whether the background thread has + finished, or we will have to take it out. In either case we join the thread before returning. + In blocking mode, we simply tell HPI to stop abruptly (abort) or finish buffers (drain). + The PortAudio stream will be in the Stopped state after a call to this function. + + Don't call this from the callback engine thread! + + @param stream Pointer to stream struct + + @param abort True if samples in output buffer should be discarded (otherwise blocks until stream is done) + + @return PortAudio error code +*/ +static PaError PaAsiHpi_ExplicitStop( PaAsiHpiStream *stream, int abort ) +{ + PaError result = paNoError; + + /* First deal with the callback thread, cancelling and/or joining it if necessary */ + if( stream->callbackMode ) + { + PaError threadRes; + stream->callbackAbort = abort; + if( abort ) + { + PA_DEBUG(( "Aborting callback\n" )); + } + else + { + PA_DEBUG(( "Stopping callback\n" )); + } + PA_ENSURE_( PaUnixThread_Terminate( &stream->thread, !abort, &threadRes ) ); + if( threadRes != paNoError ) + { + PA_DEBUG(( "Callback thread returned: %d\n", threadRes )); + } + } + else + { + PA_ENSURE_( PaAsiHpi_StopStream( stream, abort ) ); + } + + stream->state = paAsiHpiStoppedState; + +error: + return result; +} + + +/** Stop PortAudio stream. + This blocks until the output buffers are drained. + + @param s Pointer to PortAudio stream + + @return PortAudio error code +*/ +static PaError StopStream( PaStream *s ) +{ + return PaAsiHpi_ExplicitStop( (PaAsiHpiStream *) s, 0 ); +} + + +/** Abort PortAudio stream. + This discards any existing data in output buffers and stops the stream immediately. + + @param s Pointer to PortAudio stream + + @return PortAudio error code +*/ +static PaError AbortStream( PaStream *s ) +{ + return PaAsiHpi_ExplicitStop( (PaAsiHpiStream * ) s, 1 ); +} + + +/** Determine whether the stream is stopped. + A stream is considered to be stopped prior to a successful call to StartStream and after + a successful call to StopStream or AbortStream. If a stream callback returns a value other + than paContinue the stream is NOT considered to be stopped (it is in CallbackFinished state). + + @param s Pointer to PortAudio stream + + @return Returns one (1) when the stream is stopped, zero (0) when the stream is running, or + a PaErrorCode (which are always negative) if PortAudio is not initialized or an + error is encountered. +*/ +static PaError IsStreamStopped( PaStream *s ) +{ + PaAsiHpiStream *stream = (PaAsiHpiStream*)s; + + assert( stream ); + return stream->state == paAsiHpiStoppedState ? 1 : 0; +} + + +/** Determine whether the stream is active. + A stream is active after a successful call to StartStream(), until it becomes inactive either + as a result of a call to StopStream() or AbortStream(), or as a result of a return value + other than paContinue from the stream callback. In the latter case, the stream is considered + inactive after the last buffer has finished playing. + + @param s Pointer to PortAudio stream + + @return Returns one (1) when the stream is active (i.e. playing or recording audio), + zero (0) when not playing, or a PaErrorCode (which are always negative) + if PortAudio is not initialized or an error is encountered. +*/ +static PaError IsStreamActive( PaStream *s ) +{ + PaAsiHpiStream *stream = (PaAsiHpiStream*)s; + + assert( stream ); + return stream->state == paAsiHpiActiveState ? 1 : 0; +} + + +/** Returns current stream time. + This corresponds to the system clock. The clock should run continuously while the stream + is open, i.e. between calls to OpenStream() and CloseStream(), therefore a frame counter + is not good enough. + + @param s Pointer to PortAudio stream + + @return Stream time, in seconds + */ +static PaTime GetStreamTime( PaStream *s ) +{ + return PaUtil_GetTime(); +} + + +/** Returns CPU load. + + @param s Pointer to PortAudio stream + + @return CPU load (0.0 if blocking interface is used) + */ +static double GetStreamCpuLoad( PaStream *s ) +{ + PaAsiHpiStream *stream = (PaAsiHpiStream*)s; + + return stream->callbackMode ? PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ) : 0.0; +} + +/* --------------------------- Callback Interface --------------------------- */ + +/** Exit routine which is called when callback thread quits. + This takes care of stopping the HPI streams (either waiting for output to finish, or + abruptly). It also calls the user-supplied StreamFinished callback, and sets the + stream state to CallbackFinished if it was reached via a non-paContinue return from + the user callback function. + + @param userData A pointer to an open stream previously created with Pa_OpenStream + */ +static void PaAsiHpi_OnThreadExit( void *userData ) +{ + PaAsiHpiStream *stream = (PaAsiHpiStream *) userData; + + assert( stream ); + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + PA_DEBUG(( "%s: Stopping HPI streams\n", __FUNCTION__ )); + PaAsiHpi_StopStream( stream, stream->callbackAbort ); + PA_DEBUG(( "%s: Stoppage\n", __FUNCTION__ )); + + /* Eventually notify user all buffers have played */ + if( stream->baseStreamRep.streamFinishedCallback ) + { + stream->baseStreamRep.streamFinishedCallback( stream->baseStreamRep.userData ); + } + + /* Unfortunately both explicit calls to Stop/AbortStream (leading to Stopped state) + and implicit stops via paComplete/paAbort (leading to CallbackFinished state) + end up here - need another flag to remind us which is the case */ + if( stream->callbackFinished ) + stream->state = paAsiHpiCallbackFinishedState; +} + + +/** Wait until there is enough frames to fill a host buffer. + The routine attempts to sleep until at least a full host buffer can be retrieved from the + input HPI stream and passed to the output HPI stream. It will first sleep until enough + output space is available, as this is usually easily achievable. If it is an output-only + stream, it will also sleep if the hardware buffer is too full, thereby throttling the + filling of the output buffer and reducing output latency. The routine then blocks until + enough input samples are available, unless this will cause an output underflow. In the + process, input overflows and output underflows are indicated. + + @param stream Pointer to stream struct + + @param framesAvail Returns the number of available frames + + @param cbFlags Overflows and underflows indicated in here + + @return PortAudio error code (only paUnanticipatedHostError expected) + */ +static PaError PaAsiHpi_WaitForFrames( PaAsiHpiStream *stream, unsigned long *framesAvail, + PaStreamCallbackFlags *cbFlags ) +{ + PaError result = paNoError; + double sampleRate; + unsigned long framesTarget; + HW32 outputData = 0, outputSpace = 0, inputData = 0, framesLeft = 0; + + assert( stream ); + assert( stream->input || stream->output ); + + sampleRate = stream->baseStreamRep.streamInfo.sampleRate; + /* We have to come up with this much frames on both input and output */ + framesTarget = stream->bufferProcessor.framesPerHostBuffer; + assert( framesTarget > 0 ); + + while( 1 ) + { + PaAsiHpiStreamInfo info; + /* Check output first, as this takes priority in the default full-duplex mode */ + if( stream->output ) + { + PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->output, &info ) ); + /* Wait until enough space is available in output buffer to receive a full block */ + if( info.availableFrames < framesTarget ) + { + framesLeft = framesTarget - info.availableFrames; + Pa_Sleep( (long)ceil( 1000 * framesLeft / sampleRate ) ); + continue; + } + /* Wait until the data in hardware buffer has dropped to a sensible level. + Without this, the hardware buffer quickly fills up in the absence of an input + stream to regulate its data rate (if data generation is fast). This leads to + large latencies, as the AudioScience hardware buffers are humongous. + This is similar to the default "Hardware Buffering=off" option in the + AudioScience WAV driver. */ + if( !stream->input && (stream->output->outputBufferCap > 0) && + ( info.totalBufferedData > stream->output->outputBufferCap / stream->output->bytesPerFrame ) ) + { + framesLeft = info.totalBufferedData - stream->output->outputBufferCap / stream->output->bytesPerFrame; + Pa_Sleep( (long)ceil( 1000 * framesLeft / sampleRate ) ); + continue; + } + outputData = info.totalBufferedData; + outputSpace = info.availableFrames; + /* Report output underflow to callback */ + if( info.underflow ) + { + *cbFlags |= paOutputUnderflow; + } + } + + /* Now check input side */ + if( stream->input ) + { + PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->input, &info ) ); + /* If a full block of samples hasn't been recorded yet, wait for it if possible */ + if( info.availableFrames < framesTarget ) + { + framesLeft = framesTarget - info.availableFrames; + /* As long as output is not disrupted in the process, wait for a full + block of input samples */ + if( !stream->output || (outputData > framesLeft) ) + { + Pa_Sleep( (long)ceil( 1000 * framesLeft / sampleRate ) ); + continue; + } + } + inputData = info.availableFrames; + /** @todo The paInputOverflow flag should be set in the callback containing the + first input sample following the overflow. That means the block currently sitting + at the fore-front of recording, i.e. typically the one containing the newest (last) + sample in the HPI buffer system. This is most likely not the same as the current + block of data being passed to the callback. The current overflow should ideally + be noted in an overflow list of sorts, with an indication of when it should be + reported. The trouble starts if there are several separate overflow incidents, + given a big input buffer. Oh well, something to try out later... */ + if( info.overflow ) + { + *cbFlags |= paInputOverflow; + } + } + break; + } + /* Full-duplex stream */ + if( stream->input && stream->output ) + { + if( outputSpace >= framesTarget ) + *framesAvail = outputSpace; + /* If input didn't make the target, keep the output count instead (input underflow) */ + if( (inputData >= framesTarget) && (inputData < outputSpace) ) + *framesAvail = inputData; + } + else + { + *framesAvail = stream->input ? inputData : outputSpace; + } + +error: + return result; +} + + +/** Obtain recording, current and playback timestamps of stream. + The current time is determined by the system clock. This "now" timestamp occurs at the + forefront of recording (and playback in the full-duplex case), which happens later than the + input timestamp by an amount equal to the total number of recorded frames in the input buffer. + The output timestamp indicates when the next generated sample will actually be played. This + happens after all the samples currently in the output buffer are played. The output timestamp + therefore follows the current timestamp by an amount equal to the number of frames yet to be + played back in the output buffer. + + If the current timestamp is the present, the input timestamp is in the past and the output + timestamp is in the future. + + @param stream Pointer to stream struct + + @param timeInfo Pointer to timeInfo struct that will contain timestamps + */ +static void PaAsiHpi_CalculateTimeInfo( PaAsiHpiStream *stream, PaStreamCallbackTimeInfo *timeInfo ) +{ + PaAsiHpiStreamInfo streamInfo; + double sampleRate; + + assert( stream ); + assert( timeInfo ); + sampleRate = stream->baseStreamRep.streamInfo.sampleRate; + + /* The current time ("now") is at the forefront of both recording and playback */ + timeInfo->currentTime = GetStreamTime( (PaStream *)stream ); + /* The last sample in the input buffer was recorded just now, so the first sample + happened (number of recorded samples)/sampleRate ago */ + timeInfo->inputBufferAdcTime = timeInfo->currentTime; + if( stream->input ) + { + PaAsiHpi_GetStreamInfo( stream->input, &streamInfo ); + timeInfo->inputBufferAdcTime -= streamInfo.totalBufferedData / sampleRate; + } + /* The first of the outgoing samples will be played after all the samples in the output + buffer is done */ + timeInfo->outputBufferDacTime = timeInfo->currentTime; + if( stream->output ) + { + PaAsiHpi_GetStreamInfo( stream->output, &streamInfo ); + timeInfo->outputBufferDacTime += streamInfo.totalBufferedData / sampleRate; + } +} + + +/** Read from HPI input stream and register buffers. + This reads data from the HPI input stream (if it exists) and registers the temp stream + buffers of both input and output streams with the buffer processor. In the process it also + handles input underflows in the full-duplex case. + + @param stream Pointer to stream struct + + @param numFrames On entrance the number of available frames, on exit the number of + received frames + + @param cbFlags Indicates overflows and underflows + + @return PortAudio error code + */ +static PaError PaAsiHpi_BeginProcessing( PaAsiHpiStream *stream, unsigned long *numFrames, + PaStreamCallbackFlags *cbFlags ) +{ + PaError result = paNoError; + + assert( stream ); + if( *numFrames > stream->maxFramesPerHostBuffer ) + *numFrames = stream->maxFramesPerHostBuffer; + + if( stream->input ) + { + PaAsiHpiStreamInfo info; + HPI_DATA data; + HW32 framesToGet = *numFrames; + + /* Check for overflows and underflows yet again */ + PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->input, &info ) ); + if( info.overflow ) + { + *cbFlags |= paInputOverflow; + } + /* Input underflow if less than expected number of samples pitch up */ + if( framesToGet > info.availableFrames ) + { + PaUtilZeroer *zeroer; + PaSampleFormat inputFormat; + + /* Never call an input-only stream with InputUnderflow set */ + if( stream->output ) + *cbFlags |= paInputUnderflow; + framesToGet = info.availableFrames; + /* Fill temp buffer with silence (to make up for missing input samples) */ + inputFormat = PaAsiHpi_HpiToPaFormat( stream->input->hpiFormat.wFormat ); + zeroer = PaUtil_SelectZeroer( inputFormat ); + zeroer(stream->input->tempBuffer, 1, + stream->input->tempBufferSize / Pa_GetSampleSize(inputFormat) ); + } + + /* Setup HPI data structure around temp buffer */ + HPI_DataCreate( &data, &stream->input->hpiFormat, stream->input->tempBuffer, + framesToGet * stream->input->bytesPerFrame ); + /* Read block of data into temp buffer */ + PA_ASIHPI_UNLESS_( HPI_InStreamRead( stream->input->hpiDevice->subSys, + stream->input->hpiStream, &data ), + paUnanticipatedHostError ); + /* Register temp buffer with buffer processor (always FULL buffer) */ + PaUtil_SetInputFrameCount( &stream->bufferProcessor, *numFrames ); + /* HPI interface only allows interleaved channels */ + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, + 0, stream->input->tempBuffer, + stream->input->hpiFormat.wChannels ); + } + if( stream->output ) + { + /* Register temp buffer with buffer processor */ + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, *numFrames ); + /* HPI interface only allows interleaved channels */ + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, + 0, stream->output->tempBuffer, + stream->output->hpiFormat.wChannels ); + } + +error: + return result; +} + + +/** Flush output buffers to HPI output stream. + This completes the processing cycle by writing the temp buffer to the HPI interface. + Additional output underflows are caught before data is written to the stream, as this + action typically remedies the underflow and hides it in the process. + + @param stream Pointer to stream struct + + @param numFrames The number of frames to write to the output stream + + @param cbFlags Indicates overflows and underflows + */ +static PaError PaAsiHpi_EndProcessing( PaAsiHpiStream *stream, unsigned long numFrames, + PaStreamCallbackFlags *cbFlags ) +{ + PaError result = paNoError; + + assert( stream ); + + if( stream->output ) + { + PaAsiHpiStreamInfo info; + HPI_DATA data; + + /* Check for underflows after the (potentially time-consuming) callback */ + PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->output, &info ) ); + if( info.underflow ) + { + *cbFlags |= paOutputUnderflow; + } + + /* Setup HPI data structure around temp buffer */ + HPI_DataCreate( &data, &stream->output->hpiFormat, stream->output->tempBuffer, + numFrames * stream->output->bytesPerFrame ); + /* Write temp buffer to HPI stream */ + PA_ASIHPI_UNLESS_( HPI_OutStreamWrite( stream->output->hpiDevice->subSys, + stream->output->hpiStream, &data ), + paUnanticipatedHostError ); + } + +error: + return result; +} + + +/** Main callback engine. + This function runs in a separate thread and does all the work of fetching audio data from + the AudioScience card via the HPI interface, feeding it to the user callback via the buffer + processor, and delivering the resulting output data back to the card via HPI calls. + It is started and terminated when the PortAudio stream is started and stopped, and starts + the HPI streams on startup. + + @param userData A pointer to an open stream previously created with Pa_OpenStream. +*/ +static void *CallbackThreadFunc( void *userData ) +{ + PaError result = paNoError; + PaAsiHpiStream *stream = (PaAsiHpiStream *) userData; + int callbackResult = paContinue; + + assert( stream ); + + /* Cleanup routine stops streams on thread exit */ + pthread_cleanup_push( &PaAsiHpi_OnThreadExit, stream ); + + /* Start HPI streams and notify parent when we're done */ + PA_ENSURE_( PaUnixThread_PrepareNotify( &stream->thread ) ); + /* Buffer will be primed with silence */ + PA_ENSURE_( PaAsiHpi_StartStream( stream, 0 ) ); + PA_ENSURE_( PaUnixThread_NotifyParent( &stream->thread ) ); + + /* MAIN LOOP */ + while( 1 ) + { + PaStreamCallbackFlags cbFlags = 0; + unsigned long framesAvail, framesGot; + + pthread_testcancel(); + + /** @concern StreamStop if the main thread has requested a stop and the stream has not + * been effectively stopped we signal this condition by modifying callbackResult + * (we'll want to flush buffered output). */ + if( PaUnixThread_StopRequested( &stream->thread ) && (callbackResult == paContinue) ) + { + PA_DEBUG(( "Setting callbackResult to paComplete\n" )); + callbackResult = paComplete; + } + + /* Start winding down thread if requested */ + if( callbackResult != paContinue ) + { + stream->callbackAbort = (callbackResult == paAbort); + if( stream->callbackAbort || + /** @concern BlockAdaption: Go on if adaption buffers are empty */ + PaUtil_IsBufferProcessorOutputEmpty( &stream->bufferProcessor ) ) + { + goto end; + } + PA_DEBUG(( "%s: Flushing buffer processor\n", __FUNCTION__ )); + /* There is still buffered output that needs to be processed */ + } + + /* SLEEP */ + /* Wait for data (or buffer space) to become available. This basically sleeps and + polls the HPI interface until a full block of frames can be moved. */ + PA_ENSURE_( PaAsiHpi_WaitForFrames( stream, &framesAvail, &cbFlags ) ); + + /* Consume buffer space. Once we have a number of frames available for consumption we + must retrieve the data from the HPI interface and pass it to the PA buffer processor. + We should be prepared to process several chunks successively. */ + while( framesAvail > 0 ) + { + PaStreamCallbackTimeInfo timeInfo = {0, 0, 0}; + + pthread_testcancel(); + + framesGot = framesAvail; + if( stream->bufferProcessor.hostBufferSizeMode == paUtilFixedHostBufferSize ) + { + /* We've committed to a fixed host buffer size, stick to that */ + framesGot = framesGot >= stream->maxFramesPerHostBuffer ? stream->maxFramesPerHostBuffer : 0; + } + else + { + /* We've committed to an upper bound on the size of host buffers */ + assert( stream->bufferProcessor.hostBufferSizeMode == paUtilBoundedHostBufferSize ); + framesGot = PA_MIN( framesGot, stream->maxFramesPerHostBuffer ); + } + + /* Obtain buffer timestamps */ + PaAsiHpi_CalculateTimeInfo( stream, &timeInfo ); + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, cbFlags ); + /* CPU load measurement should include processing activivity external to the stream callback */ + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + if( framesGot > 0 ) + { + /* READ FROM HPI INPUT STREAM */ + PA_ENSURE_( PaAsiHpi_BeginProcessing( stream, &framesGot, &cbFlags ) ); + /* Input overflow in a full-duplex stream makes for interesting times */ + if( stream->input && stream->output && (cbFlags & paInputOverflow) ) + { + /* Special full-duplex paNeverDropInput mode */ + if( stream->neverDropInput ) + { + PaUtil_SetNoOutput( &stream->bufferProcessor ); + cbFlags |= paOutputOverflow; + } + } + /* CALL USER CALLBACK WITH INPUT DATA, AND OBTAIN OUTPUT DATA */ + PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + /* Clear overflow and underflow information (but PaAsiHpi_EndProcessing might + still show up output underflow that will carry over to next round) */ + cbFlags = 0; + /* WRITE TO HPI OUTPUT STREAM */ + PA_ENSURE_( PaAsiHpi_EndProcessing( stream, framesGot, &cbFlags ) ); + /* Advance frame counter */ + framesAvail -= framesGot; + } + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesGot ); + + if( framesGot == 0 ) + { + /* Go back to polling for more frames */ + break; + + } + if( callbackResult != paContinue ) + break; + } + } + + /* This code is unreachable, but important to include regardless because it + * is possibly a macro with a closing brace to match the opening brace in + * pthread_cleanup_push() above. The documentation states that they must + * always occur in pairs. */ + pthread_cleanup_pop( 1 ); + +end: + /* Indicates normal exit of callback, as opposed to the thread getting killed explicitly */ + stream->callbackFinished = 1; + PA_DEBUG(( "%s: Thread %d exiting (callbackResult = %d)\n ", + __FUNCTION__, pthread_self(), callbackResult )); + /* Exit from thread and report any PortAudio error in the process */ + PaUnixThreading_EXIT( result ); +error: + goto end; +} + +/* --------------------------- Blocking Interface --------------------------- */ + +/* As separate stream interfaces are used for blocking and callback streams, the following + functions can be guaranteed to only be called for blocking streams. */ + +/** Read data from input stream. + This reads the indicated number of frames into the supplied buffer from an input stream, + and blocks until this is done. + + @param s Pointer to PortAudio stream + + @param buffer Pointer to buffer that will receive interleaved data (or an array of pointers + to a buffer for each non-interleaved channel) + + @param frames Number of frames to read from stream + + @return PortAudio error code (also indicates overflow via paInputOverflowed) + */ +static PaError ReadStream( PaStream *s, + void *buffer, + unsigned long frames ) +{ + PaError result = paNoError; + PaAsiHpiStream *stream = (PaAsiHpiStream*)s; + PaAsiHpiStreamInfo info; + void *userBuffer; + + assert( stream ); + PA_UNLESS_( stream->input, paCanNotReadFromAnOutputOnlyStream ); + + /* Check for input overflow since previous call to ReadStream */ + PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->input, &info ) ); + if( info.overflow ) + { + result = paInputOverflowed; + } + + /* NB Make copy of user buffer pointers, since they are advanced by buffer processor */ + if( stream->bufferProcessor.userInputIsInterleaved ) + { + userBuffer = buffer; + } + else + { + /* Copy channels into local array */ + userBuffer = stream->blockingUserBufferCopy; + memcpy( userBuffer, buffer, sizeof (void *) * stream->input->hpiFormat.wChannels ); + } + + while( frames > 0 ) + { + unsigned long framesGot, framesAvail; + PaStreamCallbackFlags cbFlags = 0; + + PA_ENSURE_( PaAsiHpi_WaitForFrames( stream, &framesAvail, &cbFlags ) ); + framesGot = PA_MIN( framesAvail, frames ); + PA_ENSURE_( PaAsiHpi_BeginProcessing( stream, &framesGot, &cbFlags ) ); + + if( framesGot > 0 ) + { + framesGot = PaUtil_CopyInput( &stream->bufferProcessor, &userBuffer, framesGot ); + PA_ENSURE_( PaAsiHpi_EndProcessing( stream, framesGot, &cbFlags ) ); + /* Advance frame counter */ + frames -= framesGot; + } + } + +error: + return result; +} + + +/** Write data to output stream. + This writes the indicated number of frames from the supplied buffer to an output stream, + and blocks until this is done. + + @param s Pointer to PortAudio stream + + @param buffer Pointer to buffer that provides interleaved data (or an array of pointers + to a buffer for each non-interleaved channel) + + @param frames Number of frames to write to stream + + @return PortAudio error code (also indicates underflow via paOutputUnderflowed) + */ +static PaError WriteStream( PaStream *s, + const void *buffer, + unsigned long frames ) +{ + PaError result = paNoError; + PaAsiHpiStream *stream = (PaAsiHpiStream*)s; + PaAsiHpiStreamInfo info; + const void *userBuffer; + + assert( stream ); + PA_UNLESS_( stream->output, paCanNotWriteToAnInputOnlyStream ); + + /* Check for output underflow since previous call to WriteStream */ + PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->output, &info ) ); + if( info.underflow ) + { + result = paOutputUnderflowed; + } + + /* NB Make copy of user buffer pointers, since they are advanced by buffer processor */ + if( stream->bufferProcessor.userOutputIsInterleaved ) + { + userBuffer = buffer; + } + else + { + /* Copy channels into local array */ + userBuffer = stream->blockingUserBufferCopy; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->output->hpiFormat.wChannels ); + } + + while( frames > 0 ) + { + unsigned long framesGot, framesAvail; + PaStreamCallbackFlags cbFlags = 0; + + PA_ENSURE_( PaAsiHpi_WaitForFrames( stream, &framesAvail, &cbFlags ) ); + framesGot = PA_MIN( framesAvail, frames ); + PA_ENSURE_( PaAsiHpi_BeginProcessing( stream, &framesGot, &cbFlags ) ); + + if( framesGot > 0 ) + { + framesGot = PaUtil_CopyOutput( &stream->bufferProcessor, &userBuffer, framesGot ); + PA_ENSURE_( PaAsiHpi_EndProcessing( stream, framesGot, &cbFlags ) ); + /* Advance frame counter */ + frames -= framesGot; + } + } + +error: + return result; +} + + +/** Number of frames that can be read from input stream without blocking. + + @param s Pointer to PortAudio stream + + @return Number of frames, or PortAudio error code + */ +static signed long GetStreamReadAvailable( PaStream *s ) +{ + PaError result = paNoError; + PaAsiHpiStream *stream = (PaAsiHpiStream*)s; + PaAsiHpiStreamInfo info; + + assert( stream ); + PA_UNLESS_( stream->input, paCanNotReadFromAnOutputOnlyStream ); + + PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->input, &info ) ); + /* Round down to the nearest host buffer multiple */ + result = (info.availableFrames / stream->maxFramesPerHostBuffer) * stream->maxFramesPerHostBuffer; + if( info.overflow ) + { + result = paInputOverflowed; + } + +error: + return result; +} + + +/** Number of frames that can be written to output stream without blocking. + + @param s Pointer to PortAudio stream + + @return Number of frames, or PortAudio error code + */ +static signed long GetStreamWriteAvailable( PaStream *s ) +{ + PaError result = paNoError; + PaAsiHpiStream *stream = (PaAsiHpiStream*)s; + PaAsiHpiStreamInfo info; + + assert( stream ); + PA_UNLESS_( stream->output, paCanNotWriteToAnInputOnlyStream ); + + PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->output, &info ) ); + /* Round down to the nearest host buffer multiple */ + result = (info.availableFrames / stream->maxFramesPerHostBuffer) * stream->maxFramesPerHostBuffer; + if( info.underflow ) + { + result = paOutputUnderflowed; + } + +error: + return result; +} diff --git a/portaudio-v19/src/hostapi/asio/ASIO-README.txt b/portaudio-v19/src/hostapi/asio/ASIO-README.txt new file mode 100644 index 000000000..9fb74ae16 --- /dev/null +++ b/portaudio-v19/src/hostapi/asio/ASIO-README.txt @@ -0,0 +1,137 @@ +ASIO-README.txt + +This document contains information to help you compile PortAudio with +ASIO support. If you find any omissions or errors in this document +please notify Ross Bencina . + + +Building PortAudio with ASIO support +------------------------------------ + +To build PortAudio with ASIO support you need to compile and link with +pa_asio.c, and files from the ASIO SDK (see below), along with the common +files from pa_common/ and platform specific files from pa_win/ (for Win32) +or pa_mac/ (for Macintosh). + +If you are compiling with a non-Microsoft compiler on windows, also +compile and link with iasiothiscallresolver.cpp (see below for +an explanation). + +For some platforms (MingW, possibly Mac), you may simply +be able to type: + +./configure --with-host_os=mingw --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2] +make + +./configure --with-host_os=darwin --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2] +make + +and life will be good. + + +Obtaining the ASIO SDK +---------------------- + +In order to build PortAudio with ASIO support, you need to download +the ASIO SDK (version 2.0) from Steinberg. Steinberg makes the ASIO +SDK available to anyone free of charge, however they do not permit its +source code to be distributed. + +NOTE: In some cases the ASIO SDK may require patching, see below +for further details. + +http://www.steinberg.net/en/ps/support/3rdparty/asio_sdk/ + +If the above link is broken search Google for: +"download steinberg ASIO SDK" + + + +Building the ASIO SDK on Macintosh +---------------------------------- + +To build the ASIO SDK on Macintosh you need to compile and link with the +following files from the ASIO SDK: + +host/asiodrivers.cpp +host/mac/asioshlib.cpp +host/mac/codefragements.cpp + + + +Building the ASIO SDK on Windows +-------------------------------- + +To build the ASIO SDK on Windows you need to compile and link with the +following files from the ASIO SDK: + +asio_sdk\common\asio.cpp +asio_sdk\host\asiodrivers.cpp +asio_sdk\host\pc\asiolist.cpp + +You may also need to adjust your include paths to support inclusion of +header files from the above directories. + +The ASIO SDK depends on the following COM API functions: +CoInitialize, CoUninitialize, CoCreateInstance, CLSIDFromString +For compilation with MinGW you will need to link with -lole32, for +Borland link with Import32.lib. + + + +Non-Microsoft (MSVC) Compilers on Windows including Borland and GCC +------------------------------------------------------------------- + +Steinberg did not specify a calling convention in the IASIO interface +definition. This causes the Microsoft compiler to use the proprietary +thiscall convention which is not compatible with other compilers, such +as compilers from Borland (BCC and C++Builder) and GNU (gcc). +Steinberg's ASIO SDK will compile but crash on initialization if +compiled with a non-Microsoft compiler on Windows. + +PortAudio solves this problem using the iasiothiscallresolver library +which is included in the distribution. When building ASIO support for +non-Microsoft compilers, be sure to compile and link with +iasiothiscallresolver.cpp. Note that iasiothiscallresolver includes +conditional directives which cause it to have no effect if it is +compiled with a Microsoft compiler, or on the Macintosh. + +If you use configure and make (see above), this should be handled +automatically for you. + +For further information about the IASIO thiscall problem see this page: +http://www.audiomulch.com/~rossb/code/calliasio + + + +Macintosh ASIO SDK Bug Patch +---------------------------- + +There is a bug in the ASIO SDK that causes the Macintosh version to +often fail during initialization. Below is a patch that you can apply. + +In codefragments.cpp replace getFrontProcessDirectory function with +the following one (GetFrontProcess replaced by GetCurrentProcess). + + +bool CodeFragments::getFrontProcessDirectory(void *specs) +{ + FSSpec *fss = (FSSpec *)specs; + ProcessInfoRec pif; + ProcessSerialNumber psn; + + memset(&psn,0,(long)sizeof(ProcessSerialNumber)); + // if(GetFrontProcess(&psn) == noErr) // wrong !!! + if(GetCurrentProcess(&psn) == noErr) // correct !!! + { + pif.processName = 0; + pif.processAppSpec = fss; + pif.processInfoLength = sizeof(ProcessInfoRec); + if(GetProcessInformation(&psn, &pif) == noErr) + return true; + } + return false; +} + + +--- diff --git a/portaudio-v19/src/hostapi/asio/Callback_adaptation_.pdf b/portaudio-v19/src/hostapi/asio/Callback_adaptation_.pdf new file mode 100644 index 0000000000000000000000000000000000000000..76bf67863524626aa079d74629c9dd9f720b0b54 GIT binary patch literal 50527 zcmc$`by!`^@+OMAy9WpmeBceTl3PUGqls>;1qdjElN3HtASMuN{Q9lyNnZ(&UB zC?oVLg8b83M>Vdr)yS307`&vCP}05i+OyoELkyUVQBV!9Jy<>lq!R|1d}&21vresu zC$cHPF`omm4w~9HH9m0w9T9D#1;NFj@~dOr5W}o;Qp+f&l1ENlrDjcvFf&Fl>Y3jp z8EB2i8X9%C;}C)4BT0UkK_=r!dZy(Y$DWhD8yqyyUT818=R@vUuZ9_fJ?Rhfwg&;! zNm39)=cb^etGqsSDNgL7T?Tc|&J89L zIYNdbcl%qUnfKHA9)oU}+G|+<_t5c}Zsx7lxV$VuTe#dh4XEt{9UF0$JtR}SVH-)4 zUf6xA=vaP|iQ z!v_la)kz3<8r`2t?!+@pF?ByF?RnE&4-iOm``K(2ro5=n2UIdAip$xtzSzJ>T@lqzYP#b2c`JxOHWT+hV z_@o^iY0%a=1ngAjSH=`~KHXJ*Lkg*T}x& zjY8a5m0&n`2Vlr=ldz~kXV;6V;871+X&6nW2n~PUyIMD5g0YQP*Ra&Ko_MX&P960I zWux>w2?q>5et&&7`@~~MbHA7}V0BueN0lfw#r#4Lz7OV1NdT#cU>Q1WU2r53CoZ;X zfwg`xtN`?*W-mdD_xh+_*fc=;p}v2pcmx=kEOHq{Eq~>P+Q6gs8EYYi;#gIKE#8U^ zL@~1CKaR;?(Q;DH^j6KVP|mOr8AtRP_?e;_H%V4o0}oPsal|>1pVUo`#$m-yJJ$de za`v)lf3;)iSwn;1x97(C8~$MSAS&$b@F7(NiSlLB{NB0PFKf)i3wT+HHoL66gBVR%{h2{GV(?xF)%hVKPx;%FUX{;6^0>M)|xR@obu}yA=QTcS&>hHF3H8 zQaiY&{|gM_&PTG>Q?%Qby=TU+Si5U^XvUDcQAXp&L&!BW#PPU|(A?>d1>x)Gdu>xn zbFwpEUd5m&8>0)V4_ZnVOfyP8J`wo6fQF?TX>bhiB+G4WvY?Zg!9@E5CS&s)lw}-IW z77ck&zQVI^Pt%>1mACWCvOfgBG_Z`O>qdjqhg*)cU)nXF+#&fj@ZtxZ!)tmq8d$+0 z85reE*D^>YX(-8YJ#)*^GNrgmkxp+IV_!S$jq*voN0lqa>T~+kGDUik6~-hN$v{KT z$i}B#4isER&pf@@Q1huE2uUeAjt=hVT^kd#+mRP&Z_;>38=SP7A^TG0;XM5yGNp@D z#&z9+Z^~3V))33&H(HwLLmVt;F1=w2p#x8cC#k`s-+;9?3hskEtczo`nQpiFx$YQ0hb2}P3w^2=&57>zMtMp0E37k8m)%fTmlqR4ZnU5Z z$lGG)Z2Xm#9LQmVA3|)LC~jJ3B_;G!>B|G9nR|8Bge%&{P=c{wO3~u1g~@qy^lrVk?H{60h1J<26A&E)q6)pTN@|RKUgWjOv?7& zT;*M2A!Yxk#7fHXPl=tB^DpTgF#+OkPLirl?{VKMWn#NE#KglDGzg zE_H9RG%QIB3_OyF(1}vjCdX1iTbvKSN8moDz4=2!{qB(@h~tVLKCFft9(y+t4Dj47 zaKVuwP(Han5z4C8as!fnAFxntl#y3yCuG%0#CaoA~gKgr_u#%vxKo`R8yp z=WtZhleS|^t>;q8#EQf#nGc=|UXMQym%w%9f{66Z!UE8P4xLplrFC8v;~IQy2gtuy z`^I7CjdvV))rv*e#P~Xlx-mT&@faar4wch4tz49G+xP{sC6VK2U(b8&gav5So4{6; zt_ww2U`Pu{P_4_76A2TN8MDE65Zw%SU^$!~(}tORAE3bLWu5tX(1_$sfbP6xqK>Gc zrqH@-GMeJ(izlyrwjkd8faVwEWC`9cFQ$w%k^(P7Wh^#D<;hpzFZ%X&SJPP=xm8I| zLOea#S`Rmqm=tMA*powgzsh*dJ8a0CPP(N78jFzT;c)g@rHR)olIagK;9n^cxK>fm zvcU!z&CnBYWYH24T(Qa|I*tW4CzKA~23cDm&~1Txs%u-xn$29rtzx?IEriEORTWS*S;Nm-V1!g-TGUPyokRyI$Kk4%P|->2XX~gtD_*6W zJTsrxRuaQvgho0W*c9hf#l%~f6?uFwdh--6cOL1#$YayY$VQxbB+E;F%jgtuB z#1}2yyE5LVKpjxX{c1{I4ZIEFqm8uqmC}j7>gom^)UmA*FxM9a%dBsjAJj6TCUCu zBC4XSP2M*I3nUAb0losqKuk7*G$$pMs;b(_z--TaR6v@G29~t#s>)ib$yfi_rADs3 z!f>I(c5u|$%{IH*gE|f*i#(T7H`QlM6PRE1sJc!G_E8oD5{^)Y;{ezD9j#J@L|nZ+ z_;ae9st3Q1SwctLdIDq}FHQ~dOeIJCwoUqLD!k@-R*|ri;=p6xqCJxq)8jn2eUpcw z^P-6r4ubt1U8kzK*_v+-BdWF=hCb(+#H){-AJvk+dFBe#*Xsz`9XdaD6)7lHa2aKW zm1I9~F`d)JO^5dE9-8qwA!7|Lp8q^Sn^g*~?0#WC547BS$g$;}PX7|mU&^b&A7v&^ z#z8t-uDWmmkv{)fh8qk>>??FDO~BobP2t!Ur|P+%Ah!fc%*yuc5(ess7m0ux%@uNe z1Bb6+trd7SV#9(PvG(hZ`6mvwGl?DhS~6BUGzPLhrD%Pn4ZbHr-n(!}k%Q%=dzJ`E zwMGuh-BD;Vcdh)1Vx0vuxujel+#nww+YzoicKu0&iuXv&a#tV4dJmy^EyfUi@+(Vy z!~HH_`e>!^`u(?a{`s)iAye?CC}>5fxa?{q4w6YfPaGxd8`js~*zs4ec!I{Xi~CJm zknw$V&^@l^QYP`eii1LpJB<(kpP50Za@I~}M=gr$yDPJHjG#Fqgk@h7qBh>RrG``2 z(tckTipgGJ&1~xITm5T6?=9Lv79z~|kH+Ax3{OHoev@Ihez3aoRYeb+jDBe4`waOz zGc$??)}_HLnaNZC;oclvbvrE4mt5qHt(+@8h*AZDvzxHm?)Y0gKU4&C4R1tsdn>P& zn-SDl_RCTUVW0nH4fAF|;Q`AoHDcVU*LLHp=xD@%8 zWXcI)fp6)SBsGnV!v+0IqzBo2g{z*?R}Uc(zi&ftjH20^7*wun{JTobzx3OxD1th{ zN#QrieIUHA(h=h;A-}qezae^!-!{ z$lMw3gkd;6bsGT8DLSo=EJ_3B_&)Xa3r6{NZnB8hpMl;47wx-HWV1|sWDVZh8UycE3>`WJucY6OZN0&lD@b(Xy`Xvc0}>NT zZNT23<9qfG>7TWBgUAtP>yZ_#NBzn_TO|^E=Bd2yedXaElP08jA}3ayBCT)SHVYM) zQKM)hl%o%_N4+LXyVn&`dZ*0e$F)H{dS&!crWL;qp8RS%o`fBZ=$cP;JRxIdc|9Rv z8QZ%!wRlm_ksr>s)(ER_a)GSV!Ko)I)#E$ z)O>aZZ<$y3nA~)pS-zYP&f1G+CO;L6Wnap2E!uc@+2Zh_5?krCN6&~I6?&$78eY_# zf6yrDoEonxDc?riv6lRh1i$8K`-( zrapgb?wPOHsr3L~s+h?a|AF=chGRG!QVM|-PWy+#>m9Tc!mVRpg+-;FA2I1?X=mA= z%flx%^ptDeoio=el~=%J*8Q>7`!ADyn?&#{y{vFIdO*UXv z939(R>PASKE&^V>v|Y=-tCQ6;N9ucS6nUt4SRJcbrP+fAcbnIcUylQ?G2^u0D;z&u zA6U}QR7BUhvBxaDb#>Myd%eRR2YJOv$!fkyfvKR6+sXOyq}vEC;_7{+D>fi_^_Qx^ zQtn|E1{vzcX|<;>KMo?Q#$xK4#_(yguBC*Ia<#$JMQO}**xpEfe-#tkLfeY7+vxsL z#b|XUhTznHO}5|pf`~YIv|hBr-m*`a-0Tt-U`Q7DWZ~tINVwng`Y>>#gBlzHt2MpL zEcAb=P%b{u(FA~Z!H?n5b_V7IiDe7AVPdX%P#CCU5QXS3=}OTv@p^Bg+yjPatSwvZfh=?&44SZ!z9A{`sL@>cG1>|3 z_m}A^6o1nOvg~00Y~hXGDLc{Vqo>8$%nP1Et0t&jdwRf9V8{T~7cKSi;7=j#O7W~?penr*V| zNbrQ$+=z>&*b%q4%||3S7I@fj)QbN2!Oi{&Yb*!<1M=OI)Y^4F#fR(A0KmGv0QuEL zibjlJ#ey+p#m7hrf4GWUcnJ(YrKd^OcsR%bDT%3lC`@$KNE4GH{E;+63jc$F9;lD# z^hOlyJDK1SPlLk>tnr*ZQV8$F6P~n~E^|Dt+mtUhtprQ$6fhqSr&Gc$I1WpM^SdF1 z9~~;QijH6c+{XbajU=nVq&PRX;CLleR3@nAs|&MrNmzFz{9nQ15hke(wsk8Hlp1^| zL!mjvR|}Z%+hpZ3w5(3ASwRi zy?lMa63kU40OL3=2NmrX5omG#lNo+R4niXTjAt_lQPt!5=SUHs-Q3oI25D+T_m< z%|M#BQ9oC4)n4y-_IjjmFo@sRhAs69;i6GAnop%sG~ z{m$!yiAE|rsrC^nZmW161_${X+zrcF?BJY}t@=us5f&8a#T;LJ50A2li?Ej?ws0A5{eAvePh#aH@RtVKPWrS zp-B`eh&9Wy;1>4UQGW)up+s!Vje|T6Rf>=Z25^PV#_e=A*DI~Ss`NWZvN}3UEgpxo z7y_8DmW#Zn^>OZYsmDcrX1&uXhGK^?|HgXwLyP#-$VY>ox#G)!So-o zC@axxTsUtKzab4Ent4FjoYp=2IjnODnJ~I=Xq+!(lL7Q|jTqXcGx6WYm!>+fXyR(= z)O+${zg2{~a`XMTy4f(be^gY!TOq=U#CY{HK&P}Pikom39S ziDg&!%yIw}rZzXypOa?liQkqjV+%D&iN!`tsR$e_#GnoIxt+p^pQ1&_`pnMYqmD}K zRXLTQKsNoj-lp?_)*8haI z+hloZo6<$e;cTKhc62;}r=p6=i}N{m7`VfJM&4hk{G+`1A+*QO%6@M6i;%OYBkmk9 zi@~Z9elP{oF}N=sU$>WIwuW9F3F!>O7^Lq=_=G?2U0t*o1iU)T_kD#n2a{61lyRnd z8BsXU-lBC&U-}WE;vAmN7{9MAUP{nOo_FG%RmR_Kk}N{^6>_+d(`PGQm<-;vxfAI% z(*lj02$LnR*4?BG=7Kz~3k0fyG1Nrk$`8BBjxW)s#jIm4Lef~&a_}iV)lh#rUpAB1 zaF!9CF8`Qnz>EmVte&71)n6j~n>$q3jkI<2CILND(uxGeBAr6Da2n?W$^fLoSK$?B zgNu=55*7zt<0JWb# zpI(G=U@+Br36~Qdv8Z6?iAw5(MVkcZ$N2=qus}#m1;LRM{i&WtJj*pO} zNHe$MLOjC$@$1Z{Q^nH`MHSX+&YTmUo0NI6^FS*q((syXo5nd1(BP4Ls`*HQK*T0a zY^jhfp|QVqkS9Q*ANLV#MxX3ShN-${B@Bepbj^1^J1SI2)0Xa??dO-hDO7d$yVr}{2uTta)Djd~oHW*UE86_H-OkVe zZ#t7`ADDn#O1j;Z3Ot8}#Q4FgG@#o!KVR&InU}Bk2)*xXDy~;JO*eot*T!g5aBen6 z#-~$-OVC=kO9S&ES3^%?oKZh!<+kFQqSfkrbUU;6ix8t1atz6-hX@|7GxS<%JB;51 zHm|F|MI>C_W6aPDymd1qXVy29`!5Y_lYMjCP`f)_S~H#}170LW=jc*FjROaKI$I~V zTi>cOW^ZA}8}vjtQa)XVs7-}!Wz1J_rD7MIBDKOVVSoO#R`yfq(F8t)N^E%fli~O7 z!U$^jR8zYaI8j*$$$?A{BQ=P}c}&Ogj{~R+2|`ZIN<{N6HEn;16_HKHG( z=;SF&p>vz^JMi`|AlC)?#$xsX@$(pq<7jXD%4X<`CFj_OUU%A59bW-c z=f!geZ^XX&(}rYBi8rq3j5u3!WYvsXTZA7roPFU#!Weyidp2{!uFcCwRD$l$0+2Vh zVYhIdU5kCUI(UX5iv3xlAX4)qxNsEMGbRsHIOJ}nZs>iu^7%)2-I#%b=1B&|dLo36 ztma;V$1+b&NZtswa7Tez1z-BuDb?J@EvDdoP{Hh)}Q(*l|!*4Aile82*$3zq7K z0z-Xfs@|G_bs1GT-p{xwq`GFvzoBF;SmhBnp9y{FgwB!i~%`-Nw+$Cvrws!V~=iK z!F_%8?i<2tu`4kJOK))P`0wqB^P9}xUDEX1P4&`y0c+<$@U`cHIPSs^E35Qs0a9zK z8_AwdiB>U-@G(k@U{SLbAAXjP_>Q_v?hgyJLAR17jenW*gGG630}zDraM!m$^%gZg zRYBx2S3XY9{}h0=tA;(X5Yqxj#u5!gl@ z)p3!`Q;!7}5>#Z|2;zswRrj<26XuVC;4omk3?(W5##s8}6Z+e7`M+ZTAbRf{57FcaufOYN;=QT$cX_*Ahk-_7~UU9P!K3%%ug3Mz&TN zOZbeP+w<^DcM`>5Dq}^F2ya{y<<|GtPL+}f9t_hK4@r5(N?Q!lV#8ibW=ODXN2pQC zWriZ=j*MHvJOV|#ue>&AwYespx^Tu@0V$nbY9jVGI`c1HJZ{ftW3L^zd+WkhA(9Xx zB%;*5j>X^VM5ZpUetS~fVIQA|Eh2lp>3GRRcEYpDFnxMEZ3kMbLq*8#h#OhWROB%~)-Vv)Cw< zAP^Wcs+hYwDRfti+WbpWja$UKJ247l#%~nUk7S5*dne`i?30VGHvQl%2KtJ;Ge7)j z|9mg858tdxG zIpa+zKNJm2>kw({?5Q@rS_IpNq6-IuGgBBVW||H|hVHuu*PJp3YbXwXddL|vv6U5o zERz=Dyeq-_S$S9dA)k^!i|lr98g9iaFI%AzfriRi+hl+sNg5nc{D*?_NcM^eyFl3j zHibBXX94nwe9Mrgbbuh%8Le}2qIJerz>8z@Cv88^1TQ@e?Yfl{WNH0msIvPhNTiRa zeYlS|qsVmUZ8Sh_8&~VR`WTTCtgKB+_cC3)5$cm5K)doI!ioNtnPR+jbiw{wBM%_K zzf?ZDK=Nmty&XOO>N0PS^bKbEpjtjIehQTl!G5JuN+mDMSJ{O;iCH~$p-%D3n%nGZZ?#%#8 zob`^8=1(to_l|Kn%2;21Qiu!Vk+57b`{;zgl2k$r+Xpp-YPtXBaMhTq*@V1OhM2*U zMEe{EZjJCWafM_paWkih7eaQ43&XAF`=dzpWSn;yF+7D85qxBtJ;iW=i;2dewxOm+ zh`o~phEjMiwE4av8|(JjM|4j%c6bGb3rXA}swjpx*aWyJ0@&1^S?&TBmB_<1)xKaP z)cK{tr@$nwj{G*%RuOlbFPF5QFNU&D5R!y_OMw zA}tkPz+fk)A=OKKIJ7!bLlA~N`}sf{KMn?%=b^hp4m4&xHvp+`ILm5m^BdC5bk~yL zq~2Gvompz_xaPfJ&mZg*&YF)=OyQ2)q;;II?W##7$6Qc)I^jUWgg=zbuLpo~mypZrcuf)w>t|pbA%E^?T3+^t_EzK?fQdNDQA)V4gph5qJdAoFlXrCf)n&um3Lo)ZHlMMDt`Y=KL<@e(! zUJM&~;zG-!aHnbZ7YcTxX&pA6fvv^$=xJNCb>gLzb25GaM%gL3`uq}{GnHV72Zwe` z1`A=hx3qORWG>A_vv-}+2I8X@okvB#Y%t=MzOo+(2Z~1@6Mji;LB|SnVsE@&jJmw* zs5y!UH-N@X{m{LoNXYb~R5+jdN(!(%$N25sH=a+3lk+i6!AM^@bQEC{Ew5_acMP2u zxU%EOWBi>BeqMgTC=B=kGya}YDHBx(|C9#}*CRIbh(jmIExx=sXE469TK*!QRu*Sj z!lh7QEqt;f{y?Hn5gJ8)eqdQ7-EnP){;U-ax4lj51wv~R;OI<2-}l6tF4~5PQmX&` zY0C6UC*eRlfs6(#-9GVPr8V2hDGQQnhKg{9i*SDk^=z0DX-isypfqe?kVt$?660ky z#mnvSu)>{Cz^e?H+Xn`g#s1j=`tHm1Gyba{jhw6>0O#t4((UO8wmb<}sQK=W_8H~8 z^S30dMr$W0LYWI%dQn)Oy5wzNS{f|dxlTZ?yMBHOUs0D?l8(ay>!~E^3tyPMN6KL3 z{NCxBP3&D8&4Ix?3{O;ao&Jw7%<`{c82?)^43OX?W%=Vj`4b|-P0I2oxJ2bo1m%Ag z55n@V()kq<`!cLcYmAYm_H=dv!~ z){`NJT!{P?HFt@DWMVM^TNTGxxlgJpBKNUEEzi7ud_f`Y<%aH3bNRkpI(<3)oG-VJ zN)!t@!}C#R)jGSP?Fl&7C=({qwF--|hZ8|=Z7owS(i+IWLw&@Xb$gI0SC#zlQ=lTi zGK9eDIkchsjuiQbOXucI`_VOXU2ljI{j`>@U7SA>ZSh;p%4|$OK&G{%*K>XYT}P{8 z^U&vKJ>&Ivp+@9Dagjw6SNnDcE@K(obhgvlXd472n6ss1Qyzw3Kp!PDsglBKZjX-} zlN=Lau2U}&^6_NtbbZ)IZ;x^Pd zE4f~-EcLpWu=_);^@&F>mKet}6YmF$Q5>1ULs%dKMGWexJW82co8DlVA}GX3RBh|l zGQlRpx$;v<6K#Eyf{OHV?+M(*d90nN`9SrZdxf40U-+$G*;ErtPKukQNGNf$0DA)) zwzgK*?F4~Dn$_3h%~2=f0FQ4UX!laVN-3Vzvo?X^ym!mQ!}4exd9eWAT|vD<;*_o8^PkZw#Dt0Xvb&2AZiprZ3Aj*{i8c zmP&=~&NXer=~JuikGdIDB#9ZT-@%Iw`FQt-@U4%0h!lOy_xxHv8RA_$GeI137=E+I z50d^>!jvKp|M3&Wl{E>>8QU475x12bv|K+MUrb8WSYPXvh0Rs@EGmz+4nv#Qo-QAa!O_CTTL+|B#?{QG(*x4OIy zqT0k1aHWH4IYWc}EKZ}T-Wb&89Ba(ta4tI4hKR&#o34QYV5(Y-bZ(lEZ5-XsnZO}} zz`RgS^mkMT>IV~~UXQEKOV7W?Y|YbtMP_=;yH^&KB)~|o727?WE&|59kzNw$DgW@? z`B<)YC8souI}3Fc24$sh3X*8js~Roa1tOagbCdpsD$WMkV_3=^C;b6*m#6neaUBFp z=HFh<@P>l0BYqVj$O40U2Ty#2fwZK2IzV9}<~tAjj@E7%&CMA9Fm`55 zxa{8tM$HjHU{8rpiD^ZWk~pFaZH_?YdGc_c0a~`T{99MIC-Bl1`3SQ(lCPU z-WR4)^if*^-IOss(Zk#;df7Qb#bmCAFfG$hFvp!-*8&8uAG^Wu_JvCRjaL5?miHeY zuKrs*-{0Qr|6N`FuV=fzbvY{&_kVEEYJb<|dw+uLfA{f?mJGzsdvDNB%eS`CRIfnT zXDxawSdJc|FkD#O1iP1%E*x5~$4n;Bhx8dIVu@xycR z6-Yx**}Gu*qS%np$T-L5ALRJ&hUQ*nw+FlWemc%c8U)DX(2`Ef(MGZ2C#reV%*hDF zQNSvLlR%7rHF(Rd8&-om`hGngR&T7LYzlY4tGPHie7D${l2EZ6;gxn6EkK)_wa5TtDs-Jt8H)36phj|y?|lBO zqq$sbXpMZwC?~z-=$td5ixI5v_Ib7IpoTY)=#j|z`yn<3s2%gM)Irnx@*@URxeE#L zvX>Qwr%wn*ukb0y5(BWJ2(2SU=-Q(aeG~$NMXY)vEJAVa)8H}GVnWo_9=6%KV}n#=<1{OJKy?Zo3^?=JS!m=t1UowfV*Q1q{~X~v0}rITVgzki2MD=;gB^tH5XzvQGM z@|CWIz?LfA3=+n{=bz(M7Ql;UMsf${oNJ`kC{1-*e6Fua8K%+Wn4T|uauI4mpl9$? zQOB0`bWHN(z9uL7SkLkM2IkZ<^Cn;A&Q^M9Vfn*O6^cY`LA*+69mWKQon=Wx9K5P` z90`~+L%vF$G1qgKHL^kkO4h>B6>>2;Ns~L}DBmP0_hA|>g9HED2g_IvH+bS*G2jr9 z8Ba)7jk>(^i@9(pbYyVfPLFdyv~O?%)As#St&@XKADg}VfZ^mby-5c5lEt${IX&q} zcylY*1f%>3?ljU?--i7oDS;aEu7s22H%`97Td*f;EGOh1&ur6G_JVst_gklE_aP!A z7d+gydOgVSx5w)OoJk5vC2D;^4d&9gI5pf|!?GOlj!%fkIR!p3mp zsdbr4&-itu$@#t`()IG>o@Y}pli`XCBF^O}^FVt^f|_fx*rY?p;nOpY zP2rkF9I}`_^>+VK-!}5KLVIk{hA^P&H*75DAU8X@9;_r3pnc_Aex8p{BB5Xo@;SBd z4y_F?ibvE}AT|AZBoE$OXgpi1ys?zSoeGy`vQf}Zy13|8%?3^STg}t`c9En>=EAeZ79cJ6d3hxuQ$Yx=bH0w}1U@6&__ zs24U_I=#Bsexwt~>|boU)itJejN=O>Mjxab{Pfbrr8Da{Kl;Hq|8V?RB)X*QBXx-k zBdM2$Y=eW0SNC@8cDN%G@Ov>921l&STnC%?G|EohyQfAovb6hX6L0XHrtuZG;(+u*OY zEE+2@bt;TszTw9FjO&Ncpjz1Y7=+zgakx;BDELkQif^NBtX}n4gl}7~QKLBEc8(O5 zlz0a3i>ls~mZWf!xx+%&Y*BB#;6>D#1mtLa246BK<8^p741s` zCpbBj7TsjII>4XcpXDbVLEUf^ihv=sGcK0V&-*cZi&&G8R)~TsV%O0rGhWvAjdyU? z#G8*nb5CJR*I7*}cx1Xt3+>^JMde_HUPyaXO};APJV3|{V#IKzNpJ8?6jT#SQ#WRz z*jSgBKM_5UJ2qA0%`(21Kvzqeh;H@3bOS=5*Wc0 zg87^+D~jG$is5VUffjEka{*_2!UxAx#F~PEa##ZfMJ(x zH9J-<1nh*64hb9Nqgdu3>gO}$e(IY~15aInZ)9s4s2}w%AwK1s-_KTem<95ie+ejl z1M2o=4#Ip{?Sb?dJvX=VvYgJHYbd*&GY>$BZt#wLv;MP-% zPh?9HKi`0*$A4e>Ijn8Jye>#v{!vog*jg8?aK^Ot}{ZNH@m7|uG-7e#7{qmUN z1W#94JUM`Dbs+b6^tw*2mM5zJiN?bQ;XqV-0ACl5N#>mbnCSbR>urKDx}X$&vd@W8 z=3CIGWsH(VT#WV=^IXFdJY`?KeQjY4p{>m$U_90OD`uh{;ShIu0$Y?OtCSu1E&*`>0#i8(Nj7>=5RxncOn%9UQ%K5ZMqSv;9U|&r za)S+MSU;_6AoH`PFE|(tG??xG2oI*JiNWB>)yN)B3UO{{cE<6VQOS3|YzY0i<|o|MK_q;F%U0z%OPBng$xF?FqUb6Htu_PP0rWA&I&` z5dgNLOj&#+2LyldD~>&x8W=$d8q?dVqj?lu3l}p$gq#*c%Q+K8SLIC{l7066S{F?+ zrY8_2wH1hY;35&Ii`5;uj0LE}dVBk5aC_*8kBqCm>MpC2mwgq}{< z&2#!WWjE3JzVe&nrt8ltg^}&k?#NXn0Eo0_AC`$fk?f^;0=--$N9`LN)fvXU;wNXX z)Jx3+ffyZi9fgI#e!{^3gefd+WN78!QH!CzjJwTXvE@MSdi{x4S|7#s&{&w^rZ6;b zU$$-pN;zTUJdw5!eSwaz?0MjOdy@F(5Iaxm>LE)AF^bx_brBN;y-c1UVZ@D0AXkgZ zzC_cfm)4c6qq3>|+jJn^;U`L$`71AjPn3noS<+{Cw>qO#5V;hhvr|_gKWzqnQ#$Cq z_$C5XBK(mL&~22gG0j_zHLM%+0-1I`JdJ8)pZWBiSH+xPtW@qj!;X}gmoyACz?%Hu%R)gO|0>#jBh0-0_HC}&vvlRvNC%B9qj%r4qc7teK) zs@LGmJT}+WR-8alrowjgmTYg=LCa%ETe9g*6n~1ttsoeEy)%6KRhI5~qt#!1`cXDr@YGGBd>uBHwsNhV-W3|cczd^0C9Rp z`svRrxrQeEmS0HKub-Bj!HNY zj+{lKNGzeavE$wQkE#~gmNULp1hHd9uH1dC^40zEROFMyl;)7NM8b`)M6XDQ;*AM4 zRAi1l(&mPlJazgo5{K8PzjgAN(w*qhj<1l|BW_K59;)qz>zlJ8FHu!yNr(HT%54tI zri8^}YSDO^fY|&nd8=Yg*MvFlQ;zu56WUp6|E>QTPGN$$vz9qgDJCA*%2Phi3iX&N({uBpXZFmb(TiHm^Ol&@$o z27Fd~loNrm%cSrS7S}%9FN*KV{KHB_`@d1<|4NnrPdWSl^UD0+#2j*Pv-}6T+)HiE zVU-E%72?+pUpxv|{KSN}V`V`C8`2ZQNB})z`Jk3s{1}D7*2j@pHhG?LyeP`^mAbYe zGxy6oS{Q`qR!L*hr@k(Dzhft;=SE4xIo=L^<>eHTFgQx%VeU#hKi7wjUwD)1eW#03 z3+elU=us}_6xrx89GM>Vp|KPwa1>;$A$D6+zICmPcwZqjYBNAMHQfmM>^GWp*+wu3 zWCY6=Krv%+{GN4)O=V9=4dE|P%N;zu+hgI{zgx|hzT_YmvwxdqxE8>BCLae=Ai2F< z-j0=!dg@I$ZT*SU{cQc0ucY#%V1Ut2yg6 zA8EmjJ6OKf>f@p&t3`KC=cfORs~D=lE8&z5Bf(ox@ntAOcbn&nYze8(IJo$j#w{;( z(9UO^P-?>FF7yXzBQcLih?`G7s;k^$W~`d;*)aNy6wfVH3EB=<_d-tb(GWA9ic}dW zb9d-0FxDZCjECL_N!uB*pJ0ZSo+k{9|sg!8D|MGAJ3fz!k1DkFM$#aXY+W;)3IG67V}~GE!OhWdgiB z_RS!i2L&&jE***yS@ZXaB+5%%APM;ufq>a^rBM{v?+enTi0%*?lv-Ut-I^@hBk=;I z&-)Pud%YUs(>N+F%5P6>{_A~j3?FJbwD@VV0#O$D9g+~cB7rrUev94R^E`PP?vd^LAF5GgCW90wJ?S6k$nA8+#<@i1cMWw$bDK%2SKL`Dn zZrJ`c@a7-={K+d9134NySlBt)I=s)w(HQieY0km@J||J2ofOEz%>4Z)$Gckj)9gM$^KaQ;0n$!DD+}X)EXMn)s5*hHHAvqDt$z;B#>V+R8*`w;pTu}- zfECEm5#VI*00IFl0FnSFfGPk4GaQYofC<3t{Z^Ux)&Nrr7ZBhJzy)AzYi$h#*jYI{{{6VapCtf@ z0URyd0M-CGfVsP!Imia!3eW^t0USXt@3IX*9^ekJdmq)-1mFe$Isv2rMgUuY0>A?x z0{CkU0oni~=l5})0LB1OfE~cb!bTSv1W*JxS^*u+0crpbkb^A%1h5Avz0bkQ)&^h) zbO71>HPQDS1`q}~+5wG00C9i=00=PsGuWSh1K{Lp`(JPMkC~bS904i-34qx@dibmG z&(3@QpWg4*0kM*@{UMD0atZ%)d;L}Lx0~YM-M{l+H}o*EbG`FQs?J7Ef9?N2dx%-| z|9w4=$u|o%RZWPY53vU|cyTXUo1WgN0~Na*9_vl5q#8oPXh^(9*<|o!@TkLsMq24S zuq#jyfoLKo$@2NNbf4)a!R@E*@f#X5?0GU9S0~**Ca;ElIGpo(%J{jH`J2DX^YXVo zZy+dUd1b|&SOCw7>#Eu|MTuOA2-}1tSq4KTKs2CNK+dKbgYn`jFWwrxyx-`gFxduBRj9`Y&kB{L&;?8x}m`p?Cjf>u?4 zoituP+MIu|bz6IK1|dAxYZ zd3&BR`ju~622GvNIi;(LkI$U9xx4)Ik=lM+VrEXRnI7)bj_lPMt6g+G98sIgFOcV~ ztXwl{8g6`dc2;1fvWeEhJEC7uNkopRT5lF4m)Tc!Fd+GT@WtwfIeF~2H}xf&!N<@H zZx%+|FrHts+E@~7&Fl|5bN>z)DJAZk^jT;*xcTE>tK%AQ%4rIi`=694VZO%b}6|gE9FM)LC}tB8y!;}K~`YQqLdl_ zNwGX#vju{_H>=sDiXuu%StJEXn6T{1)ab780MokL+jZQrELdJqw>B%+$nK}GE2}kB z3nPsojj67ax-*)l+9iVNe+=|zHwZY^YS#=9ngZJ4?91cxZnf}iL%ycqOQ+Qq|1q%h z$N}E!fCMJspF`^+&=}*X;94s@XN{Wt8$Z0S57O1~JA4j?9EPYzB0+@7ltC&nSAS-I zh7k7iN|m_mY#EY~10@`9Lw+UCOg z%N6FcW_ULtp)ZYUVV3K0m;07ujdc`UDUp>UHOQX8V4%InxRr( zvZ8Rc_3X+6q(VKi9|-u>WtYVFn03vbhhK_*W&JcMpS z7CO$L>9i59CT$uN!In-%YwK=ZO*$Zwj-gqchA`p8jFB@{Hm!5AfX2;hCbvZ{L;8R#-itQMO2M9+CoU`cHT!sBY z2o#w1YW#Rzn`g@y7a}IC)?W2;;ox2bU7Z^eN!jbW60-#OFUCHMY_?n42Ua~ICq}0v z{Ti_;B>kn}im$2JZ3761b(1InhswEzM20{}^k3rQ*x>f;UM{E$jDr-obuS~1!$d$K zAcr!Kf?T~8!-0UgDYBxva+G}Elo*_*%o?aqAbMkLY0Qj%PDcGcv>IJYXs zEog=b?Zq+J7iAsGgU~T(Rd*g9EkhRWJGESW5~a>7j9oQigNHN6tg)1236XAU_LQ&3WQF9Cw0Akqs6!U-ZSn1Bff3Ztlkf>Nlq zAEtSA zHCVU8>wjef{{W?lBHGRTR7$Zl_=8_}W`nWuiX35POl5fAwX z&J@@>eoR7lFSTzl%rS~V-^ncW;^%X7h{8SV+17jq!jL|zsvI3cORTF7o{^%$`jR5Y zfMu*?ZyKWmVIgAGKNTT6I0SEmrxkULOy*EQmiiZd6zcZh78XySG?o(SoJWQr=4eIA3 zXYZY&=w}y$qvsNZX3E26be7td&C4cIK7d|}X!_*M#t$Jm>QPHdJKN$V^A7qy^|<2! z=Za>H?9| zvfn3*@j6AGGgtU$@%Mf2zG`!RlB^D>->C65HeQ|nkS=nCyF?b7p6FN(vzH?+v%7pc zFb<8v&=$hN=zxv2p(G!hrmE~269f&#f}^A92ODIXdGZz}^G2-aeV$R@wHK@pDCkGH zsi9HCDV~~MnzqMYmz%B5J}JP*L##PuI@VH0kfI-?QT7%CPa40yGN=_hfxha@YfB@~ zdWtLXjOEvBtZu{X;LA23tl0AIZ}W!WolrO$j_nl66yRjsc@iz3{AnqlF_xOq1r}%v zrmXmeTF?42(q@dbiH>1>C{xptsh|Ao7yM#gU6;g-2b`-}T#eKeTeW=YY5P;FmX)q< z8Oek4o#}>M;Rv_4?j359XJU9WQ5=aD^QSM|pE@t{wg{}um6BxN!wYK{RpysZ)R5pg zb{fP)-FxY2*k4w5k1{7xq=lRzTbi^9>!eLcb7L68H#e3WTWv?zG0WO>-u}d(nCr7S zs)AQSYO5uamxk?&|29Hf`?tvi&gj|YoUf^ z#gRuZw-9GS4%Q!>()VZzIRDuV5dHK3YBV=sdF%#*v=|ZOmM}`whU=pxh}-n%)DdaH^45TSYK*iG+tZgo8AJ?XuuFWA!Oubh2~#Cb6@KXjFdcEX_a^YP#N zpvc?I>nomI)IUBqVrzMCW~C%Mqq- zpbV-UJ!=)$#^=#D;#~*h3q#U}^LQRudHIg^21Xzj2&#br3v@<5YY6Q94l>*+^UW>k zicJn#dU*P|%~IEA096{g)h>4M!-)sDLk3XI5$c6jJnT#^YA{-%;eA`QtRXgWFFz3g zei5lzp~2bFChRKj7_|CP(2RarIfc-NP%v2Fh0Vp@Li0igL8+!SPm{yCIc`9b+byTd zbX4mLPaV#c9RCgOe*&K>&-SxPp(#tZ%1790Z^!GaU3Rm)&#i8MJ$`tGegN6`*e%LL zXe@}7S%iojmqD5qjohI^cLF8|h756O+GCCoBnFDd9P;T|419KKybJ<*i~?+|6@ zj{RWE-wOrphJe~&@bmYb0v&=_>?M;z?*y{bTXoq6d+B%02}gI)uhC8Ngi=Ox#eDZh zoj{ok;`g9LLI||UW*Z)(h|TR(f+yJZy~eWAgtyu~YfE!F2>4Syv^=@KlJfeIUE(}$ zwT+HDOT%zZlMa4fUDPZ~fq8{*y}P3*r%fVF?>8rj;xeh$=*@^k+8;<#4xov0q8w4| zA|sI_6PXhK3K$yQ3jP7RB1Lw?ryV;vB>fnNO9=u#3R@4ekY!N0155gNz;5;QaGf6G zEnX|`XTqPYmPCx#w;P3$Oz?-X)X2vUQgJ_lXP}a|J}_J8D%{T9>2DgvX0j%2N;oeq zugXiF45KnS29RrME8}R1ub?X(<<5bYGSL^kGoLut!O6)SBa=RG4svYI7;^)pl%srO z-&(?3Tucu8qvdp?d&$(WUh820yj^z@)9mV2v>sS#+XRJ@3P%KCBp?C=1SAy4PKcmK z#m7KMLI^1-0|AMEyiH+$_vK3v&c)SHy_~(4&F8k^oao%wg?Lpj$L;*n?tFdYd&0f* z^5H9nmDnB8d$BqWLvks2f3K3>4zKh=z6e-ynW1H&jH!H&9MPi>*aLp#Kee-1WX!SUK zN0=PZ$hy%~7+jXfNJ4y&y>w)Qm0Tfx_?E`=<1Pd-eLD-XH{I{fsD?ID6GO@e#{dVe z6flr!Zsa#;R89+$DohG3yTj+8D{^Jk`a z+WxGm+P-xq=4k?^XfjXf0=uqcnN5?M@zB6*lSi9cx)Rz0ZrEJEbL?S~I_IUUuOW9K z@lJR}N{>FqiN5<}w}&g~GbA#be%4xCzmTC*jPcaqx=Y9~{}Eb|fv+K_5&qmY-FJ8Q zdvZp%M+kphj0LQIYq2W*b?E9d%Vu-KQ1^ffxY)7vSics??7i}VAfeR6|-UqlWasMg0h+PpO6FR z9Dda;-OeRl)*#;Kw{p=3Rmr5~2Ls%H1GF(Vc;=if6Ha+r;;zY>qFnLSiy3RUu~W7> z3gm&|nKj5$%ZT0O2U%jektf%VmprjRhpf|fXyjf6n3VtG>*(hAkc+2MM?iKP$YzY(CNZD=~tyU^l+}*U{)H`!SIpZ14(=7QGz>eWbwBQd=6y+?Rz_* z_`o|H5n3=ogy?!D{TouZlUMf0fWQWlwe!ezgg7H#oN@&ZQ8odj9n*3kzJS!?CV;m$ z08U(aMICpU2?hm+0U%zn+~efQe>ed;A$q^qwr}XTzbsGb)`zOjcsy!@ z0J?WJ>|~V^*>UCjHeLrdwLhUrem+yS36Ra8-W4GIgc+88tS{eS=W<(%ho$l=cgZ1Z zl_CX=ejAbVKNLp3|1SLI4(F7YG$RG+|FNqxF4H$5A`h7M`yV)5{xzUtItrEF5&- zNw2;REpx}-rEgw*LMHGd&Y>2JJQ7M{?=c0&(+JS~K-Qi9Aczxhpc9eJ3EvM3J9!A} z0_WRTaT^t$25Zv8r8yHgGxEen>I^k0TB6^zXs^u~FKRS$uHx$_c2lw>M8SL+;2)}~ zFH2I5!$(50J82#CZ`n3m)sXab0##6;FQFilax%$6xiZ~4({i&KQNMuL<}HI4zxw%$ zQyFRPODbm>uPEHd?JC0bvNgmp@^$vWojSaVd2U}=G$ z)FF2H|A}uqT;Mi?)3~Hd!xPO#1pFmpqlnaMcpUqypvbYbHB#b$nO{riVSswD#5 zjp!H!Dm9sQ0+QUh|G+3Hfl+Wa7g`-z5D^MFcOUzu5t`eXD{_R&&H$C&iau)Z5!pqH zt&%Z;ToYU#p)lqxeqJ$U0L&tWhzh`bk^&}fpaoWY^qKXb@1@yz;~yY7cqIYAjrhZ= z&-wT3D(VA@S&q^dfIEi|R(1kh`J;)S^-P4L(O}=DIke{;$ITtb%vMoR-WD!v0-BU+ zRov(VLtCky%HJE>=us`{{$Wi<6|M)4^jK;7RfmSjJk><2Xw7BGRoo~_P{s?mWhzS7 zrV=G$H3_TKjDI-TG#>5It7+o-_Sq8f?SNpGMl7Yg&2;y_tSW)yGz)m-$?IJT_r zSX;DU*;tns4HGOQ(7+SN{$4YE;lIW~f4GMOJZ_oyyFWs6*@XJ=4;|dL=Ea^Y_IA6v zV8HuCLTZP(2k@s71`vMB2|=Ca%c#uNW@4{myI8=jstU5 zs{OIJgoLZklP{l%q%|@0Q|l0jO*igV0Y#Dqc6vixMDta9RO3<3sGuW@Tx^#@Hk==0 zv68Av!Q8kFI^jSQm7ai{H)y2vj9~5>vP2tCSVn1v+6n59CCUTmC!r*vv{QeUt0d?W ziu1Rhx4l{uC3}oI)+cQ5z*=-0Uv=+(!B5mk(z(@dpBSzv`-nP7CT`MWfF$_cWkkdU2Y2?wkH!#o9*PMe2?@DJ5Q=Q)=b`9_ zdWxLbsFq|exK)^MI4k3~~Nq$W6SR2#3f z*y6o{>U^AYFTNz+wdE4OpdqDi=irH>$jL*x$?hU|a3z$YQalX+UpQ%KSjmy`<2rFf z-aw#+9iDc)qDqgf!84%omr#Zfb?r}-8DnYac%hAF~NB^ z9jO|#wCVI?atDM9hP`LwQCK5sMBjK}Pr_gJchXO-#&-k7+GJdY)93coVaZ_(jW)Hh zlrFg0S^q48eGM%VvI1>FEB0NM_OU;9rFmQDhwk=osR^6WAEwX6??5KWMQ>9hoxDP1 z7RNM+i&}XZya+~;Mpd!C3dUREma&t@u5Db(BF`1XhdUuw;cn`*ge-p1rufqxtYl9( z(xAMdOz>35dZRSKc92N1ray*eDrNBK^VgYVi5vlrC8H#+*^uN9%t zLwt~?t;w5u7SK-9E-#d%gZutDNor%{Qg9%DE3uk)I^2PZYos3$>)bk;1Ajabw_|>d zRx*GwHe*K5H0J)zuYq0{S*b6s7pl@veR+t&L+ZhwEKnt0mij?qVg}r7c&r~{g7f)# zJV%Xw2dxhFef%EvO$(*Wk#57c+u*En#&9;Zjfs}y8U1ra$b>k_JCl}60y~+%=lCOu z5q(N+iCLdFsw^ad1$BjK@GUDgu(Z2)iy*-qV zbrnO*fWdH~<(SK+fOy#Ks7;E;JL|QH#{TGm-KDpA;M({)TX+va9vpos2W=B%e-nqk zkXps@!#hVuAhYmk#+xB$yCY?n+Y?z!W0MHOEV-o0L_0f5RX$;e_{WW-JwkExPsk~F z@eYTi{(VOgo+Lp_{6`v8z@0xzm5oBHO4{$+dK_KQ;HhrPm`J&QMC~o&DpktgB)GwV zpLh+{AtOqUlOaSN`FQ~Kwd8tFr9Ooml8~fVb7G;tjVUbsX61e|{;;?8vQ=#Y>Znw_ z0rBkL=ZRulYKuUNvbcK_z7lx&ws@i-Ij{?xmN_{2*UsM=;#LCGBW;1NCzVW@Xmtpcfjr$6Rc2h;d(#1)g z6c%zH%0UiqGh@(zYHEg2Gz_q$Z zkq9OM$P>3;pwdcQ7C)2~Oj?`HKLyJGHOfl5;N;DgOJhbTLU3NB(i$}^yB95-h;6ZF#}P!8>k_=Y1`hL?3d62jCZvSECK@guP^3{+&K zT%5#@b(rj0W`S4l)*10e*MjU&|IM(sLnR>?QKTT9n8b;bhBOs)*Z^$#M(}ejJYfdb z(hDlVu3EOMe-uvuV~q|`PLmWXWlLlRDv(t+SVCebhR~@b*19EV23B>?IbtV8m*P(2 zmYkt~?MET`XvteC{spEG>m>wDn*063!7N2znukDNCaBT+lOB>LSy`iE9iUgtR*@&O zxk=dznlBYQ4TqyD<%OC=DI-N%t%iAoq_R$Pm0(yu8}19m*Sh8P1jOgVDpXCdQV8#- zDNwVvyUzkrc9b*kZf<@t&w`PASeVVnN}mU<9!CQ`B5+gv*B3f7Ku*bOO+1Jqf{638 zU5vHbYLRtFz`e>xnZg5#kQfDZXWCh{RIzHvfW_FXa9*n}xLN__qeBYED3^fdse#3xlOkcFfg3OS?+aqS zCN9!nIJaDwfRr2x#1LfQ`hJA#6YhrQya$YXJJ_E*JZ8y8RVdt9N~sFxGpP@J`20P@8FEW8uBhKTYgd+!z1AOhX>AJ0|11G-xZt6beTsk-C&@0jM<7+c2nF8*W4~ zMGLqJsFq!oU6~o0wLauVd=>FCr!C$Y)+F};!oCHapfa9&H+gJ_^t|Oo#inCWra133 z6hU0jk3EoRFPx~kWOC& zJz&reep;jW44iN;xg)2?k`$I3y49nfK(`{Uzrh=O)))vWZtCtlCOo zTNuqi5}I!$ktGn2FzRJP$M)`H>)zu=xAedJTJ^v2uZsp02I_+}!6XS_ft^^dveamH z%U&*tFKOCf^cGt`G2xe4=V$Qg;oo`i-TC0VdFUN?Pu)y@{Z5SqUe-&X3oBaChNvjI zp5(p^qWH-B+y#Wmi%7jjM=}^8_8h^?=*9mbWbn%E20Fa_O{B^HF&U@~w5(uYP3mhKv|Ji_yII zNl+^Sf+kL$$nZ)=o+bJDrzJz4Ce9;f3S_6M5s z$|y4_Sh8xxD!No`(Pn?o$gadTL38aE-?Ai1Z`Eq6jQh7$Za=WpTO`&hp`pZ@W9rrD zSsp(=_s1A7V=&j?@r9Gc>6LlEZ>+$CP*1PSCUmai?epv*Orbp@$RD!Tg_W5}^or)j z9fmCE=%V27#Nk!JU6%npm>$aas|}PDOsfEK^JqDa=AC=W6yhLSc`HuMc%H zOxtYd6znPz52X6IV)$p(wi&q&G%PTV#jg`7{|YhL`^LJ(RR|B@g}m*5C)|&I3Ul@A zL$6la^Khc8ce#27W?326)!{G_1J#ifQ=zwKb-r`6D?vlsHmReQECwz|pz*$a1MtE^ zB-qX|r+kAQ_WVRIu4A=OUJ3Rq)E_+EiYI4Z4qqy6S`~l2EYiy%IJnPS-TK?EUHO!( z@hmH%Fk_EOkuO+4FMLh_<;Iy~-SCqx)UQ9cvH0cGsGp-OA#ieB$<1!ARV)=-zJVpf z8DbOcIfCyXDOo0c6!5Tv$SAKn!bBdontj)HN^xGYsfI51)?{mJvY{b@-Y?Ae;cSc= zZeY9~P9gw8;*AdPcW@%!_wrYwJq6b5>GW7mV!V{;Y*N?a-x>gNoSKy*OG3_HX*Rs? zcSc21P)$d<&u7ESq<>uFgauC(somwiNR13=MN)2&xJNBc6XK-Wx3Evbx$y6zjrdlgR z%b2C?3zZGP`)!%a2uglYZ#BYYoML;E&^NR`5u>5EEiqT&tK|(qi3@|KJP{?I(6Qa4 zlm@PtSPZT4yoCFsh_JBdA8dl)JH>~%ry7RiFe%`|p<1bHfuz=6Qjf}473W|Da^dgE zK+dL=QJ;%?f7dfJNKb><(ei#WLyeyxcm|tU7=R&4avl9-3VuhJqV?&L*gII0Q`^D0 zv`_MF8Gsi%RZ!H0iTl;d9?dYE#j=Zs9)Cr|)%0G$Xp+CrO4g2wBK76ap`TsWXWDu$ z8eKDEF|^gGPLT>IvjJc+`@qOfvLN+;0tY2!IwD+zqL;uJ;|`1y z9yuh|WOTP*P3D@+cTa*j6 zq&O4vcr-#n{4Ad;cPq4N89Nxt3OM|<4g4nbi5c$Y9KIYA=)zJ?Z`1-2{TQb zIPn1el8|fK-PAHfiPLi(mo7GN@G8j;+8If(}6|_cqkvEGpAnq;lh?T325{E^9WJ(sGLl;&i`zbzzXDX88}`$z78zk`m1vl=G@lIIUOcmCFm9J7IIh%}xdpuZNQM z14-Q45~sd&;Q%JfbXF!`k!wo%mm+OZjT(`cmi0>ylC9*!>U4YWYih z|EJ~sA9D9UPKo~~^;M!bvv+m+g}tuys{es@P5!5b{qJ=4e{;RIzijtE{qFyx-Tfb` z*8M*Luh4%dy#EPz|3m5;|KeTY|IoTBzg}15SM2^*ultL7f3@*{6}!K<_*d*Yo7!6b z$91Cr-R%B%-TNOm^WVU(`7itZuUuK|e-*p`v&89th~57>GVK2(b~%_Ce$##bN3iRn zVymF6j@6Brfb$6vE_Szl(M7X#9;38XJ~R|4QPHZR0E2=^9D+cgFCfI{?=LAbsKq#Z zi%US_EhPX`nnn~DX;hI{WhY)SUAkfWZ+&gLwc!Givu~@GyW{6M%VUSx{J3+*W1D%# z86)k7C#ugtp@Uy;H5;LaPLl)~jTDOY1KK40?ZbVq4s`x9_^=Hbduy=YbX#1WhQ9mtracZ89i&e-K%sM0q`DiKN4??mr`IraD1X(;=BfaKCIKtB0N+T1 zC3FbLMxLN#kO48&(py_!d6nu?7c7>M2mWQ_fcz=*-s`+)kbm_aW*OA29VXp5N!AeH_`s zO4856df6g1|HHYGC{vKuGFJ4%5s5rbnBGLvkZdB=YR^x~85QYD;6eHel`N93VK92kDQciReE~E`cMfFJT zBGNW(QJp89;etEz9$u&Y$U-p~1XSVv#i@|_`7b}WgF8C@?V7`bt3k$3iZYcN>#6#K1mk0Y%X3AZ7sPb zB>Qp`rsNWt9-#_q3e-}Nav;@otfaD7)GMKy6JkLiVS8?eHN$5L|o-Y$(#?#UU*V(J)P&obgzUn%qDlAc3zIa*% zGn09wc%|YcYuAw9|1xs$m^0~>WYz<1&4LE5%TKNcU+;EJ(e-7huAsr468}`@%87*Y zVd%?~SD7fa&4Lz-7%ijftqfyCxAUrAx>l13TQV=yJfQcS{^VIVI`* zZ<2Fsf|%EeOlRDQJbp4!24!;JT_XovXDk*RZ%`L}<-pBF6j8Abl(OSAn-aW0q(YDk zYMub7st>V{vC^E?bYr{jWpgh-n0{eoNPve;lS_6J!~U{UD%J&7-=RILdRy`XcsCfZ ziUA{mL#HCx1WZRJf5yD$L`~E(5z5KGT*VLpSt(>qNeEqg+zXaC&$}GS$&d-|$1Yft zH8IJf{>@07yH?}!7;j%FRc}k?&+mq0+74hT&`N|5Snnv>)XB`dM+0v~JLIpnQ@Sm2 z>iK&_^RiS|Nb~7$PfufS5pQ<3|IGcWcFaE&in2n{Vp36Yfi|KFrijt0bWU%2yHNlXt!B^(Z2c^klceZv(J38qx`uLO&u?Rs`NGjD&WPHTYp+GAQh?U+n zF9rymud;)Yo?YT~#RWSB_G^28Q<-(?;-5MDIY1X6Sm32ef{*-66Q@o2t*K4!xtQ?i*X@MHP8%w2 z_J&u2I{rFmo}3tb^k)p2Jh4K~LZW+A&t&;wsxF;S^X6mDqa=q*O-2)B2C(YR_Y3Ry zry64iLYRTvvYxSwyn3={AIzgp*YEKmJM>dGR$bg7e5o6NKXO|0ZQ6U|pz9^1Ejn_8v&b z0#$$fUp-lFMLz!Bd-Byh^!w1!nctk=lb~#o`6hh*$FtQOQ|O%=bBE{O<@ATevLhZZ zJYUCf2s|`V0SF5|7($C+2uTP=gxf-@TtbZQ9+)_w2>(0+v_Wbpqa{Uo#F>SMtO~6< zwLgh}63>nwd8}>Cvzq-bC#NsFA3k$-evgwEIG1RDWMWqKo?(g`*+q`r4v?&SnD-Z9 zRYUj?`9kb?#`5rktf*ezX;Yf3;*B;JlnrGZb9ScGw_syos}GvyLe$>PKNBLdy=7#< zd#yQ6r6CX<$O*W7I%SXKlv1=+RxK#fG$|`Z7KX(X?xaIs)9~B6-6y3aBbP0~=iag@sSHFY5!H%xl0lN@6_V3QO7Wj@e1jbrTy$7a)GzrMR z^3)=WP0Crhh-3-p!w$Gbo;B4-uHzOE(X(Evf3TAE>-(KV+0LHJr^fy)lo36;1gPHDWe^QnY7*w9&q5hCJ`B3d#>DCGD&VGsbWAyDLEFa z>D9qIy}vw#A&rkOms7R~P(#ebjf%Ydra%>&vg_g$i^;L?_yX}F=&bYhhp^W-2vNo^ z&1K)Tx;h7p3eubKai=6M4!V?h3#t@@unHa?bzSAM6-kJbK(a|3x&-=*;kU(;WhX+J zoH%hMX^F}%;{Oh@@ZPj~v-)EcUX*5=fZ--NEONaa9@&DPLMdsg8QKQQ?T{c0o+n>z zT9iek`PU;0^g2I>cJ4~0BH%ZLanr8~WGoA@#%Anx6vpuwnln!jo`3+WRm%VX)XR70 zz;tNj-~==QC>!fr z1R+Yp;`c+5I|s$>3EWnlMK{m+%Y~>N#Fy=gc~;U0ggUBzJm?$KR+9Jabx_X|ESIl# zWhC7!okH4cEb^!voH6n68tNsujJ{k4@;J>Rj8ttfwV~E}+QJvSgWfH~ftWh#3@gRN zOFs~&3sWEUks)s!V@$#7D3UrqG+)^icFUu)Nsivo$mYaQti6u2g5x#VV?{}2UaVH(0RcA3fG>QF+I;cc6~D}72T0gWlc&?ElvVww~+3~K1{XCi0sc^0vi7_C`Xb4H~cyCu{jfqpje zT6mwCN+se2iDzD_#Iw|$N3IG!JOOZwxK0W$5M=B;MezM_4*qw?8>FGH)BbRX@9%6s z*DvJHHDSqK-un&zJl&QqCdVdSRXEQ4X>!N8R$G@r!D*5@ji*kKM5lyDdJzT zJX|Gt=x|NwNeH3k`w2|I96GjR_Cws2)3OCI_~$BLGp&tk*nS*rk(Z|W>2JtjRlT|(yx z^Qu^;+6TV zwVdu5)F`^?&6J8_qb7UjN3G#%8pRfmDMk%xDENwBcU)#a*ym{%PEHv(awZHd4W%&@ z<;=6B%=J0CFzp7@J8qg+DlHszsu|N|=#(;<#s$URat_oPJdvb)M55^_ zFo_H+e5hWgJzA`TcD0^v;Hf0u)v(WVu6puxb-3aj9WD5& ziTEgJ*A>fnvJ9d>kUIq*{za?7u;ST+r-o_S@eYe6(uu+%C<6Cg`7Y&+!^<)C54ApY z{R!+24Z+K_R_O%v8E>&j_rZI4d&-X2HBlF-+M%&2CR3RvKlFAKYJ@5+_+maexH!AX z>G0`K#$UHDfMw-v_H`{mU;XW9+#JDg!-{7w`mDDnUh78f6h)6VK5dJkvBh00vxr}c zI2TzWRK*WM^CW`zJ=XKq<(bB@`b4G@_)52)>M zBrv?q$?$~#SE7uJ-Hk(P@4LpV;sL3mM^m6+g(!wS*NvlXh^n}#pr)%1B-4}vgl*T% zgoHTnMZ;VbK(mre5qZ>0F>_Kgkd{c1mCUD&Cp9V@GPie`Ov|Iu1q8pYq4NSiT)|da z#ta>cd)HlvyJD9~>7(yiBll-h%fxoXRmWQWLTed*S+oueg#?lj1OgBUWb}`O#A_N+ zutc{o1Yt0BT(AfbT^>KW)pl?6wVs9_$5+GGPq+E>L)J;w z2@YQ0Ln_>8fdJavmZ^-l9j{x5?dE0Ql&)LY2oOz9+!+p3DE^H(*yfNsQC$}5_=uCV z3>s*Dt(7hqzQwr>q;4RkBsJQ`P;}-NTIK-=#~#6k_}r?5k?r_q^Q+eJOEPG}oAK(a zzu*9lIabA{3ar+Jb_gbe>9?1SJh3|cz!OuIRvECTX?lFnJ?LE%<-|03+Kw~*n}+Hk zk3noy?m1AaQ6otP zFHC5|LI+y`?pcPFS+9DXGzbpC?&8r&zflK=LWDFB;S|JQ7!6PF;F=LMj9_2ayn6ha zhto~BQ*&WJ9bM<+RvY_@qDdF14V;bH}bHiA$%TS*p zr*U4mUsy#uvtL5-A=Ge-5as6rwyNpX7 z)5q{3WU~I8_|aETfu5M5hz-f0v^>@M{6-4y3tcgKi$>NFyZ*OWWNbz#-gI-@Q9k!a zfbvqtwWQ$Imh+@fVS>zMKT+DSpX=5Oo=EN)Pob`@-s4A?$ASyyHp@g2p-5VXvTU#3 z_QY<|gwRvdniJbq8Jq3iLiIU&q4(n63}_j-l^%0tkan*v?t92PN1ONKbU#$DL{RX* zP$EhMw1`%37B?S03*r%z*rfW{rK$wmZIc33^hLFg+yr$od}B~XJFZ)i(=;h0;hya< zSloLRj*(T~21l80m7y*-Lb?1o9Ru$f!)2%%%uURc7WW%jtqaF2UU36vl`ROzq0OGC zmG;YQ)_240X3>CB+}6BII>(TwffQU8ch5+CHB<8a4p#_2By#u6+1dzS-sKd;*%C7p z>lsk|qtfrZ+4V6}9-mYx3mQfWyRcBvS|z|-n(6Uj!FP8EZh3EM#U<#aS)rq%94}NM z#?%K1Z#HOMJWcK|aQjbBKeI`!eg|P&3L`Hx_mb`_88~t90QMv6 zqF48Z`)VNeFMV4nu|SmSE;>J6GX3PhZ19QD=I0v6 zAPFI<&F}>-N^Nv?L*U)PdlFfssf2feG#y7|pjttcZZ_p9Z&W7;%ZVa(Ak`TC$aMkE zNxQ9n#2|itb2&kTwgU~|ZJy&==ZY?B|5(h2L6lHd^KL1__-JL~teW6vxxAXtH!t)q zl{>UG>Nr;-Li|Sdqju=(tUU#~7C4+hhcoNG7kq$y*&SZqxj*7IEN9mtJC+MrmVlJ6 z?lx^1>L52vcP$TP;-pl^76?FXQPG;POE*L3uo=2RKJxcctYFlmRYlx|4dVW+x&q)% ztw?x)sArIm{*E9Uh(NDR4lDDal-$rTs;iF!Z-XOLre?%c8lII{6-)q;`P>) z-}7AQjozR4=kxx(zTZE-_w}0B%ri6R%$Yf7&df8<+;iTlS}B&?sp_LFCHrRNe?m$j zvpZhmsx{Hb#Xx^|!e{G#J<^+@xI!Mq)E#Gj{BYOS&9ZuZDKINgv(f4ceQ}tlBl8cq z&Lz*dt=S~PRS^O4k{gUV@0!gx^G2+BYNW`v-F*qVkS57w4P?$e0@_+yHyVb%7?hyh zZnraWE5r_-_VySGEBi?ZH8yX=ty(`*I9|9ztCtvwQ|Csb_mN37z2wZRQu3ro{W5$~ zc?tr;k~@9V(;Bb05-qhx&mk+%TN~Ow@XznsloLzBMR822$_6VbTZV9*S2|UN&H(f* z@28?5<~-7by2m?VMyQFo`NHKSo=#<|dchZ!Dt)y(AH`mkKfopDyL5g`_EM{I)z?$R z>ZN3cL4G%C=qGL26h<0aPwL|kU%phpjCZa1dc%+*QXL|Ty}xcI)aQEYi&HHm=?s;!?;|5*bGA%3WfsC0k=|K^fhQ;1a)p|Nu1F#(N8}Y5}2dYXijs`*hgGtekFfYIstCu>qGs7#wVklSX1Z0yVFnC zaOqNM$9-N5wi^j=&np+&axsT7+D9;uGR(7dh6?I^j|}~2MbJRqfog}~f2d`MucF>q zE((*b=W&mUyFz?Z&M{Cd5qF9;?x9R^&S%9}YqA+~Q+TqzJhvhf8_3Qu4V>>>kg~u% znJJeUkeg{>v|17PZ7I8KDX6+B*1K4FE6^HBoH^dSP2lOg-r5>2^r)}WvolBE6pe=A z*JVA|W$E~mT=qbXQAx2=u-`9-CVEGvjN%rUlYYs6|cF(0dR)totZNBh;4&uAK3@quR2~-^LccwkdeVeLi z;uwc?$a9AIRXuv$Rl5^$Dr5m=uheU*(;t6df;VGc2Pr#^PVkGirQ8-BTFNjQ&todN z`YOcINwhPKpM%n;7w{rf@g=W-dNf$5zn=Q_=!*qAdhJ0B4ZGOA*Y6X(#s+wUJ4$$Q z3qSQ#-dUGT&uZn?@YP;u`lMGmc6t;ht9d3 zh>FkOG|isg`3&q1?K6 zf-=56nKAO_cQ3Ud9D|dN7H5*5OWu;nG{9w&J>Law);InK7EBcr3b%Bcm;Tyyj)b>rNsw1?Y1Z&0JmM z-6&7XnWrZ_??|${ym|j!)q;zGTSTnq#aZKcpH#YwGS>%lc*i$NYDG(=vgznx%a&Fo z-kbu@==A-gnYktFBkNuoxfqbkomD=zQhAZJ*WywJO%^6b_>-hBA4sFYdF=QW=Kblt5AJ6oVws%NTZIUZLHRyf1^5Tc$+QVOyn{1xof3C zDRS=9V>X;t)_G6mCSFfZo$N77^G!?~imu}Q9$5QuphtEFVr%mAVN=srZH-E5E9&g0 z0ZVP=x`MciHP);wDTq{VP0mli|3?TTUVXI^7vyTL99-V!%@twtlATVU8J8KPiIq*h zq?&=-=SWv71!+E+AUXVsG@O^ukIdnMJ!;d@fRmf^9V<>bYoz0g$H$`2D@Bkg=DRpe zK{MVDPWbXlM~Dv#4^p8trbBw%C7JVE@MYysYR?(@OkJ~K;|OG4J%zhyZe=I5(hgtr zsEXyPdq_QSu58|AwPbVg8=lsS5Yw`bsSrGA$4Ct#^?;>x2So>RjF^qW>*O4U27}vO z`UTzgZ5^}7W66Y1qtSHeFW ziHmVCp-~f8cYIu&k)kWd#4{z;+s0fs$}^8pEL6T(rx&yOc-1*;Czw^X{{e0do@U3l zniW&aNiwPGgo_Jt>Au5c;Z(ZAKTo^8IpOyq=cZ8hGUFDbS1R;j?P*_JkB~mX^&l}W z&SG}cKCaluo!OgmH?uaoYB0;aYr%o`Mkc+dN%Rv!9J!)tLVn;)9LZ{aCpJZ=`HWXz zAh_8~booI61#=4OOsUm^*!l)6M3Wc}Z zHwKg5RxxOoG{#81j7sho8|6}N$gJ+Ny58=#cDHIlb8GB63ebdy2IC4xM85B zzCW$gfp=?uTc-nWttexS%^6`0%7Ir-tN;sfzwN_;hT+@+D{yvzIVSK1325u)Xh5Jo3q};PYsIQ@PCv zeCx#^zS$xb0*U8VKH0LD*pJFE)`Z+Y0{j~a$4DDuMTe_hRZ&-QD#V*pNkuaGrI8{VhJ@N81i@22rmEx1NgUQ;7u4# zaZ*V9MW+xP>+BLAesTG0WXqwC%M3OHJorZnJoE|IxTsBBE9ZzeoRXIs#s)gNKlFH2 zztQj4I5|2vbwn**V`(zlaX!w|cHToICo_YEMyMG2rXy`kiHDr~Ne}mx;)0)g+z;%` z3&$ukGfwOC*k^phbTx!FI=*1Ks=|>lDj}fy(!A=~R6`njXkx=ubT+G8Mhp{M@r$eX z1JBbH#~9r`6)35V_Wv>7`&}F*9d}G5s#@Wpsszoe<6Sh;FUmOQBmhH4kHZubGT{2P zRSlsWi7(Ph@-rAHAtBcK%p^T>tNwG(<(m~r^S*phH7j9*eS`8ywh?D1w`<~1h$v~W zG8-pH5uEg~Aahe;HWBJhKpp2j6*(wzU*6qN|MMfN#(6I5p)1zVF!_AFk=JD9xhfuX z?QzX06$6!Szex%l71GG5@mDg27e8pIYxNn3HohvT!s+cXOeIicsr=Tni_&x!E-^<~lM@Y40k=OFwbR1K5KJ+R-_L(>pM7TS#~KnQqUW zqb;9e`$&TjouF6OUG?^ZFmjNQG?CN{xK5XymZUFZkMg*S<3id6#gFlaEi|ux zQ@2&>6#@X;CStIm|?iS;vD+4hy ziRwh<64VbRoUV=ezty>RL8)U*^=1*Gy0RWRsuG=@(t7I5IPsC|lo}h$aT^>v!?5fvm?B_B%@C5qw(F?EC%gPqlg5i9;=hV&RW11M3 z6zXKxYAKHo0QN@%@%?>>(bgjz3oGYWJy_;?9^$JlXo~x%@e(qb-Z~O_!)u_J`)Kmo zm~M?;oYGIgiX);&y6pJCj!f%&2z)}UA%h{OAgo+6>Hd)f>&S=IeMHA!iOv`Zq?4vb zXFM~Tw3(Z;p-;GGF>2B6x;8*r;)&57Wm-}u!jR~v2rawenrp(-*d}f6R%G`Q%zONR51DTHN`H*>V)80m?%Y()`ox)~ zsf$Nc${XcR&mtv!?6vEMYUVr^MI#l9%Wtxd`Drg0wEi4@H}JN&F)e=nt-TxBxl*U( z+a&YTO_Xm!xczHi9kB{Ca(u%~HA_1@=Sq8V=2QsHed$|j?PKD1^VMpfN|L@Gq-|{B zL<=Yd1u!$KP!+jqIP=B_&CA6XJ={)T92>o2U}ocB;!b-mE-o|nogkfa_X#&m<=1Kk zJ-B^2+Dy8UNoq#yxrlBzI)sAGb0vKT&lJXI*XTGLEf;EgzV}$ds4rE*xYqE6HP^z_IorDKxNgooM|N_n z@w-1dj~TOcopfo7hYzQuY3JYJYCUmX$7rKjt?Y7DoIY4h!rY}v3@1jV<-FT!)mEcvB__^AuhA1p zb?d4ISNb(d67l>3nt6uI$ulg{n^G5~GKnp^5-PUPQMex!Q5iDT{Ok{+D~}=l)zz)e4f&bc<9<2x7<|HxW@9;j$)HuQ-`x(%hX~~iMLOuh6d){Tc*c^gL@u0i3tr6 z#OXapR2)hga-Wj==v_wbQP$^)iLLID`Z_w=U!AAaT&G<&WskY6)Rb&HRFs?ce{+i; z`1#X|pXy8$gRMw5wcPdk%|1G-N4)04M=qa!`_UtyI>N3`=oZ6mQNMdyp`nky$r!M> zN$2}6wpp!00`w;ytB!@AXup3ByhYLpD=Pl>tmE>8&1i3waNEFf7qVd< zkJx@OTFWz*Z=P1DC57Q-l*y;QGm`Sr!B<(CFk0(r;yE?s6!rC%Mr2voH^LpIf{TPA zF{&R0CC&~TkB!lDHI2L&wf&Y%qHtMK>9GXkmjnUD+nxlOm!$@8&=s#5Gd=6o&Qav_ zJ2{))l*vX(L);LM{OV2k%Q5A|ZnICvogcX0qq2lYzor??es-3kDYcN(`uTNk+t6V# zd%#LvU3$I}m72}*Vq;O-30293?#BLv#+q_c#}?a4EQhzc4&7A*7I+UK5~srArQjCa%-9Te&51>&>(6A%dXE`m+MK4=7p|=GY2Oq@0Xg z`~;5+)qS`aJNELv-t=RuIFm*%y z=w?u{WWeS?5FB)qH6@3t`v~f2fVEl>w*p=S*b(yTU22u=8U&hk@|$UFBg zR~5>&R6BNl7VNC@a=Ra!HmUjprznzG(UYe%SX36rwBc1^~pl3cnN%X@8Ws@p*$ zQ|v6VCFz70ayBd07co$j@R_*k4^(yJ64N>C4RWM_D|pHM;02?q7QD_1vR}&^0?wUBbzX4Do^S^zv4r zP_W;-&W=w(rCOHZ6jcdOX-CT9yJZa09n5yzvm8eGah4)yXoI&&GUIL!e%Fq97IT*P zIYoTuOzmueKx`CrI=W3ZD63I@^vL&&WK}=AQh|GqRG*&b!Mt)Qc0O0sX=_j5|D3b! zYiW9e%*+H?$f7Xlir zS#CDmzF|TAIJ_h-h|x=K&bM4-RMDVGBJpb3xz+LEmUjiABn8y2rTn7A3GcT#x(eQs z6sX#KVolv*?^08xdSPfz*iO=VIr5!E;A!lK@hX7BT*Kb0x`_K+B(HoH69 zwis;1?%|O6848_e6SGA5Ke{((s>l7MET86tUsZMtq2!(rzOK;syjk1yl_dGb1I>#m z?VPF(mG%7vVcLs4GFpw^FTL0pZ(3a>vdzb3cK(=L5UQ3^UerkimInL}9#8c#U zke`dCgO5h?^)F0#xipVD9{I|D6=bSWF*8}2QZG{`qsa4q&n>Rn9-w(LbG=wgt;uH2 zviRs=SP@FF{(?DCL~cB{@N+E^O2@Y?dhhzU-6QU0r(c!DPs!?ROZB$njQS3zxMOLS z2Swp}bvu-}-rmYmr@wLisSv|r5>I@~%=?Tdnif~(H18<|_#@oDYh)aiVA0v}EW|oRaC;lc=gk2%6QYJQTS)t#B!=_ zc8xmL0u23B*+pzZI-Y&^lI}650esxJvE*s_t@B+UWK@102jgfGT-^}x8YoLq}5U{-p!gpN4P1<1q5`Z z()1mEz!q&p=e%SB?_R_?-lw|;SeLB1v9+_6G&!x@*&=_{DS_v0XYT{lR}1GSo!X?g zhv{@QgH`5KOvClYSpD;&185a9OT}EgMC^HPEjG+Vp7_jVBAk9%lq$p1`cuAQVrpVW z3eSg|;S&-sW*w)Uj*_O{OJw_Ota6b({`=EN3W&g~d(HGa4gb)ly7)LfIoMah?O zF2b9qR-TGP^5fNwTv?qkx;6Yn#HP|w;mz_BN|y5Pz=f)#c+ef;Ai}m)22}j8;dZXU z6nUVIv=Y?eWZ*5-;~+wqUH9;DSvs=v*kGI9k+k-*Py(M5$`eKHr@aw7YY*(w+0t`4 z)VPdOm8Xzxp&G!y!aTSNb7Z70%W>p2-<`7h;X*hL|AD?xX>B&0N%Cr|q>IigJM)w; zgXl0%KF&^ncjM5;6(~-HZ{JB>li<6GY6bIpP9^P9Kgzin;{&9JU#pH~?QUU_m#!yzR6rs9UM)rWUoj~-^9NnoA{ z9Q)dTM>*yLuAUDunfms9vWG?Y47;`>JOW9{9!aWSuHdR*)#7Q^{HG=Sl*F{IWK(n6C`~hpTL<3=m{Eur9n-_S zJU_{v{YhnpODeXiBB=g;{k`o;8yur2pCGLYohQ}(t||J6KK4H!Z$)~_z(;>FX702~ zjhykkgIF(5Y3FAjz^;GVx$2i6BE;*eT6S`Xtqf+i+PKbUGQ6f2YavVi=($mZV4FRE zk#h2Letz}ECyv6rJ#(dc#LUbCSMbXgsTX?XJ4aHwY09D5Q`MHPGag(y(X?=aNq15e)bS<6p>><9*_?&`KS+H1;Dz z<9_<+^yi&;Dh)mL#$=?@Pxr}pnpK!A`>wuT-KP}t^r9t-qHk_$)0Z-PY3VyS={t11 zGqnFO?2sF1Pjo6k1)X?}?&=AtC?^xnnf!;Fr#^{9xjp=O?CVv^6-D}DJm)%NRv6QX zHh+0TbIH>m_})&{u199A-nTk(+`54Ej96T`uJ^#B+g0+890i=i@F68f z)zT9Y1?#GPbxqpyy+ZsVn@@*e+N{X1VD3kZc@XD>Ok7<@uToqMy)$FdxaA!WDP8it ztSpvq`$Wdm=sIZPY!G;RlWb`#OheCk7QD~h8T4gy)SIO8?W+&Ap!3%r|Ewc?@A%~O zdD)n*g=aV&LmK}0Oi<{(z6wjnt&b8PMNXIe7|Dn;?<6vsOW{2_=$)oKC0Sn7#Uxe( z&yT4jx|{a6im5Um-NS8PN0c4ej;Ooltg3^#@jAqWbw*z|bR_D7$bckVmmhj2Up>6# zJT-R7 zy?SLyyzAO(Z1GFc?ZPMx6VkjT%<-ilf8d5+88NqYNX~C-i4{ZILSp#xEo^YH=RP@rfC5(>ozH1G_9!q89% zSOx}c89xF`3-}BI!ht$qKKUNtKgD2WEC7H6`70n02nYragOH=(aKO6`3LCI#7z~0$ z@VRo*eD=z~7&`_a03Sdawx2*ISb!z*R~kf)00tEfJcBV3a5;nJ5zvj_ zUD!`P2#f^+0sl+Dc43dqy?8%~|1C|9_(kSkMLvMX2;}YzXOO2#ScMX01g0!XgGifD2Jl}Ap-LGU?4&?mgQiBVE3?+h!qYH5r_bY`C$N$ ze^CZ_RQfd?fPvZL>mCVUC30+yy`jSL17sqA2BZV50YZTun!xn$azJW8$-!a(B^xXN zkzlcb5PM7k<2^arg9hV0T0m}MIr%#S00x<{zw$q&0bfy)HiouF<~F8)fMP#)@rvm? z8iQZ*08d;0(RmbD{+9)rvY{!A;y}z%)2Od$JD3 zs z#bID9>0sGj0I2(0#f1c>09Xly0N4Wr?1=tmCZG^@hZv;w->5D=?6~i$uKk_dRb8Nr z{LiWjX!IZe`QE+@4%?l=d()U7h5Y}&@7j|i5XoKu z8^iz&lkY8OzeVKN^0vo)5Ez`QU^zIMKnnNQ-Bo}95Vi~8Yy(6FM2f8l=Kq?ed%Geq zM*PwZAoAZ^N3azT2^fQFYHv)yG#K{s!3Orqz<77x^-H4n0QX1+V=!P_1uDaVF~Dwe ze(k%kDi}KkK>zmQy}s{nWq*1P>0bQz>I-OXKhQs=|6YB8+a&mP4N9oAjoJK}!bwckbY|Dd~o7sJ2y zfFP_A`My0M)^jK~)^F%Or=~!M|CN3OtPcG{8{)Rk4(7%V`|D4#rN-4mJ=N z-{0iH(Y%+8fG!z3nmdx~>~Hf==KNEewoXRICJ;2xIySZIjudS2R|W)*`JIIAZxndx zgYVWp&^+jb^k9##>6-#hY_EZCPn{s3vt5AuO2&==N5G!%nn2=4R7SMz`FHVpLr3k<|xRPN4;znlZZ z{`5=y&nSU&hl41A1@R!2@ITLb{tL=qFKoZ5gzt{TUsS^Xl(zqZ@|Ohsg>rW!{z3`7 zhx|MC@Eztj-(ije3jAN9Jj`*v!yM=Pw;bm?%yGWM9RGWUJCgHWF*gEK1h!MaE*NAg zFhO@CEQ26eSy6&u`3po?#1QN_DgjFdwkDQdC170uR3R`AVZdctIb$PpeXNUT5GN9Y zgrE`d1FGat2i4;GfKz8%Q*b_;0<(9QnSb#PSRwx!XmQX9GvN4I0&v9)ILj6QPKjW^ zj}JJ8gYzMQi?D!$ZzE?zV+RP^B|`^W1AQlmgt?=WIp9v&0m8=vg+oki9U#|iU4chA zeM55_CtF7|0PK>plNnIJ2Ka-vGm}ODIoOuKtV?!wR>tbK4wjAr5a49e*g@UF9Pk4T zK|`bf%jRev6b}rju3`>2kA|>`>swhF0IsAV`bPS8PFPae_bJkw4#pv1{QNT56aKS{|79Z9~jMp_z-9WaLRTt4~j;?4)+%ZMS{W){(kcVfkHtK*F&Jt z(8IJK&`9KASQwNaIN3dj4+gAzf5P&E2UG{zg#m9phsO%WhXi%gfqDou3fLMS%!Bdq zBmaO!!oazI2p0XP93bJKW;sv~#t+W!gLw!vxW_%12kdCUeb+%)6hPr0dHlfaJX{Zj zIm}BK@Y-~^9vlM&m*@j+z%fX0K|GMhhXOA3AI?L={}?L-3iAgoz*+Pk_z)Nv>~KGT zJm5v?ce_pw`hX{O2XY}H;2hE1-58wvyh^sVPQc+ds6+vm_BJNAz{%^c2MLIl5DEn| zfWlB1q=^yK$Pj};Bl%HKJ~T?-2nyvhFoX;L_ZnE0>j-?Fbi%3}1cna-krZO{@InB(>%$%k&Gcz+YGrP=O#xgTAGc%X%yZ7m{XL@vd)IHMG zNGWAxM801re`Lhcvmz)IMaAiv832eBd;8P#h;YorOvHA^KM;9&5gAoI>`jRoH5H71 zn3^~vGOD;3JO8Uk%Erjt6p>Nh$mXwMDH~=)Mh#1#vjs7Ll?9Pe($v!2!kHMr!Gy>t zZ0YQzXzD0pXJc+bS^7A7)IXjvf*&xD6MqH%9cXrSr^oE5OYiVh_HeP=*ZzI+e zg&#pO9{<_qQ;6_i_XVtiyck@-jhk9>lzw|c{bi!mTAJuuCosI3a6GN}4E74Y@PX>f z^}zJ($NXTw>__v!+3H93V3FpB*M#ZkhuKJB?uXjQrs0R!C???t+o;Cj2ia&!#pYsF zEm`BGs@68tSnA{U9T!K3-~ppM+2#9+8neQl6rzXP%>0Ye+#97H;=QOolZY3+!9(PCvrvS~7kb0Zg3GbK-eybB#%?2VNtz|bi4QZi#{2x}h>gW;eOFfr$p7V1=mx%lnS&M}BU z2;Z{%M-)#NdT`ODC2U6IP9(>uml10*;^eL0CwfWQkd`QXTWV}FDcN#>okrg^1IG(G zv(H%)R+4jN?G~f8&I)x9N%8BEMMO~ct6(*7wX%TgS6w1&o7sSL(q-NeYbYY6Ky?VX zA6|R(`+gs5DPGfOx?ig|D82yx6}M$IoSVuc_Xgre8#jSt(cBt91_>dGVB%4W8u@~F zQfI(kLAGQYV}gEU4S){Vhr@{iIg;OrB3w%%ZY`%{nHL}tKywoY((}nSPT0UbnonjOpFnn#kdM9 z_eHBEdnGz1pS2dBa1-{4Y!BMXw%LW3t1OZ>1HNf_t}d;znRr^`N+qIvYXPw^w8Dg^ z!pCK4oN{W>8fW#W^3Hya0hd*g2#;va;ZuZhDHqd3t3x?eJw$wY=>jr~3Fj1sc%grWG>betdkxLjLe_2*WBJnZK$>ObBdegTna$ov??t30Z=W`}LtAC&k$QV^1a z64}0 zovV+*ffeZFImg~|OUSDBW1o#fa!jcfA6=yb9!yrvchTMos#(ZdDuR!hDNTk&M*O0@ zp3>!H`WKtV@<{bJO0j`VSe?k~2&51BTrBz(6;rwI3myZNSyn)X<<-~2Yci1%-iE6K z?TqoeYZ4tdhmQ$A!qu~g`o3VB5VAqVKrId^s}S^jU*U~g8}D6N8yd9_**6pbpbZNxm-Gy)NSS><(F{a6Wf{GmW^xJir&w|k|& zMT!B`#I#aJg2XhPQj;QKvn@QX9XCp@>4a-3=Kz4?1lRKoq=W0QdL$WPkJ#C-YNYld zT`_r-?-Ee_sE=F-LPM%@HYdf|w&hUBvpbJOvF~ zgOR1yE?lvGaC&@#l0>Qmu3xuGg6IKh$ZHo&wl@&jG-Ny~fU}3uli+G7`$_Lg1+Nv@ z5#$fPJ^PXohD3F%cLh;7NRVJ46q7xErcT_vhWo>-g+j!P_C6}Y9qj=3R(S$yAQWsO zvLtgiBwZ)L27qU5iDO1~i$7A$IW&Q6!(_=X6w3~5Y5=)Q6N9pvkTaP6Gl5IEdB(5l zP{EaYBwpLKzc*faOb73pNk9E-g3Z_r;c?b%jc$5EcPlFjlbwrcj%t2ihJ#t;%*HY2epczMc31QTOz0#cK@mebp(A&o+LcS2%We8Tr* zqXK1}1G}O3_9r=w*O=#79${I^9-Qk7-7v!%KMip5!#|jT&#%Z7SGr%v+n{X-R?-5J}+t&rVdW5CMB&UHbW&oN=eqjOQb{0G^IOP;-E1prJA) zGA9KfvNm2U(P2k|=CJ)o*|Uu8z?B0hfbM>mI_a0=-ATZ=f}cp7umb`f!nkP!#a(GG zz!xxiH_#zZ>2jl0BAR~ZYteb41fQ_y=_fV6jDud3==ye30H>Mjz{Ia zFW1J6Fe`%-8)onXMQnsg)9NnyR8fo@i5||z>Z!w|23IvMexp}i9D-NdS>PS!om%%{ z6#@#RC4?PN_wa||{-#Zwi4mRtus_&4ssKA@BL6Nfls*J+kwT%h+2_DS+(|->_hvy- zD_Or6)dMD&tCwLg)`;7bm=-u`m_n?{DrEl!MRF$bYCw`v8+4sXL33{lsV5LR!rx0+ z9?q2k%qvd{$0H^nhVfj`q%*kQJe_O+(d(Jn`o?iM1~Eiqf?h&5?gIL$_{Tu|eyePE zw?)XuJ{}GQtrd!};b#Qohv*hD>|hFmM!?UJL9Tv!94(CYt6*CDA_tnN$QS8uZaCrJ zT!@b_MWsSZsqr2;ny`0W6KgK0I8okxyhHUcu%~XR$pHp0Zc5+{*r7Se6#&3gI)PEj zx9j|{ca|4T!(D|}!o+iP+;~ReHBOZ6!=n!&b39*}mZqfrX#r)Z(v8$P5Hn7;3;3rt zs!wS!ohY{Nx$IK1JnWyz*WWRDSbM>R6Wfv`y!|Gu;MF2|1x9|bOgrfu`Gp!BlTn@+ z){MNo3sG+0t7aeT2;ZT%UDQX?p|Ktwn!Jb);Z-=|X@Dz#2#BJ# zBwoIrs)1)!qKQT}^5DxKZ{Ehp9;Sl}{VvqQ%pmPAv3soxkmyHJ-Kqx5$NWvs@j+6{LyaX5bSssRSIA5SHl z9;ioc`a>B`6D*su&~H6~opQeNSzWbV1#fJp#DW%Rm1x!~*v85Hi$i1;EvlTccH3Ub89ee9k92=`HO5 zl~lJ}QGed}3q5Np?3m!x#yqCks@)G$_@mAy*?U}MX&;>e)ZX>b6q2bUUR72RanLY0FevEW%9f)Y3OtQl3#nm4 z4MZrSh(SSODtUhm^PU14n%gkpr$$5QHSdm#3gp}>2l?C!YgD~TNvM8<`9@`+zcdU0 zbzY%{5zW5+1|NnEr5Zxhjc`q(3hpoh7V7E6n=yX~#R;S^we%bW-3fB70{WpOq!P{}T(K z>Tyw_r8L4!RdOK@0l>E}VXu&E2}_Mt+D3Go+*p{_+_3P$dY8p^8T`=v>@n-0`elHsD% zMU+t*+`9jA%IO(KHNSMLZ@szLN8!j388CVGxFh>W$2oG*{h;V`W9&ZAxf7O<^%}CN z6H1l4jE(Wh>&O_|$@03OiU-Z}p6+t}7Jx!nOo-3E*JnDy>hbZrXh86pms{lOIoFGj z$NGcE#Inbt1&B%{(OmOU%%#JgW7$dWs_OVD@mW_;%F%s7B<^Z&;S%C~&PnWAbalY@ z%tk9+0WrfTTvYtKI)dNmeeF^2tOWIg2tUdiHM63Vs74gH=Aa=@7Bc zO_SlBdl8e|KaieG@!>rJBHUJ`faTvAd)X8&vTOslUP@i%(qVf9MSkp!gYDS2f$_zMEV-kyhD z&kcF7$G#UX>}^>GJoA5?S=|WRNI06y&%@HaP;PoG6(%heLL%Rcp1j5@o111ImSsL! zzbxZDTDvZmN8nP)tNl+JN(f50>wP>`TQ6`kOJ5JY@wA~zG%jQT`152rARu7;1qI*8 z;XG<=wb;S$@QBh+O$&stQ0_muS4%?Z6WQsl5lu;Jg9+LhX>!Q0aI*?I_h7<^vWdq9Syq;ufES#t~&urJwZ~lNf6qEoJL@zTZySopDHQyT0Wd zArQ)oV|YH|d1O0#x=;;W_?qsZ{F{t)JDq9}p6?(qVU`(dMOas8$lF&{PXYD4b`Xo6X_2I+g8`Jg$ zhEmC8t*9*tGSEyzIz}AhHJll^2hK0&;qb{@)nhG*AgRbU9JS)7w4seyOA&-rzhRPi z{r){cXzq`&8jEg^%?SgPREfYpK1I}eO7no4&_N zz_c4_=;@yc+hYpn{jkG%nQ|hH0(h@ zFMQ-%bB4Ergpb2AKVlA#b;%>-3=W(0AAns8hdc(_R3|M2PdbLP5VsHVVV)^9R> z5#Gs$(?fCN8G98>!K^A*JCU}aUv`Dt{N~}#Q!#eO@l2KS zY5Z20$HCM}1$%@%ap?f}2g%SDxxgFsCo4WV?x)*O=!(Sr<~#R5YJ2Qa&xh1IRWC?> zjjJo7sV(r|DbQc7zauKv{}fgIJ40e-W&SIT`foF&V09anbxxE|$XDcdRNF+uQ9CIC zf~JuD&{X}TjI6AEe(IL&^5&9-#DJUgPTEzH02*kP-@oV1R*yYgHNK6{u2O(QjsIXZ z!YBPxGEE*yoYmKWBUVS4qeqWjeMy}ujyi6nHG@8W`!R5`omBPnIFG*{Vk^sRooltf zY^oBhTbfo($9hM+y43z{`)*o^H|7=^IsFbJl}H>NZloPqvR*#5VZ}l%9G4%DirMTp zWwc!3h4U-o?WCtSi=-x8Gz)UPpecBH^t+&e?0K?2xKFNI3BdmI5H~vXe(=!-2J5kp zG~5G>E`}yuBKh6oli8Smqkq#O)rLb@rY+%WR3f|-wxs_lqnKsQ?QV5r+$@CGe&b5R zOy$$K#K3(qQoLI(+cJdZl7Tqa?43Hdjl?qdL3(0%#uaT0saBMhK-U{|$czT)MCj1= zC(?ZLkJCHO*0?f1X{&znD!e@%tmQ)b@wHVTXN@+Pz3Zq~5%DcLf6lerfqs9|eTqvB zwXP<9*dQu>4D{asaK*? z{8JKjvg?qo;0fBNdIu}AE8H^D!F~&t^!iT!NxaxlqJMZjCy1jLG8SGDT=1NhR;WDUCfZiUfn9MW=ojD6jeC~Z>`8g7YNkddg?ckRfyW_#stJjqgPwXREK zkNK%R9;}vFZ5lCfx0es;Z$Y?n`w%a@@M0Z|B)YD>GAmt-H|EpxN9ltipcGxp6eRrN zP(-^|8nQB9*3>{Xuq49>$>WW3&AKvyGDEVN_dpy{+YT2va{84 z$H1de8MoBw<%I9#`CCoBYoJ~qD&|%n|3Z*ukB;$9yb1eyTo<9-^w>-LarCbE>6HUQ zRMk1NZi})$9sf%a=r%nb|mM!^%_r|qRbU+RglVya>F+dddtVl#z=vD}}g9+v91bFEM;(H6n z`kLEag)m8I{Gc~2yJnIFZQ+!C=QLve=dhUS%Xm%z5*wuU(fa&P)P|_?Md?W>htGcm7*5{N)@({{1ec_tzqC_m@xj+fs-#6SMz^NDv1QbNsu-Ld^N^ z78^0wzgmAugnv}Vzsmmd7Q}zc4&}e~0;8C_vxJKCU&`TMV-hNVjWPXSga1ic{5_$_ zU!(t_F8-?g>-F#L=}m|LfyF zrsbaiBsb{2?+_cqytdX#F@-mMn_x2n2D5|PDp`L zR)SZIg_1)++NU>#Y9^S$l%N+!$x97ZOBUPf=F&fYc9%UNUbGIrYxc_ zr_XImW+W(JLn~sTu1w1##mCOBD{kQI!b)#TE)AsR)s}OXBh!&n^ZnOv{eN!4%>UIc z%*Da+KiP#f)*aV5(LTVwzzGj)P=nxM13m6J(;n5$_6bgnDk*hTnji)@N+dDG25)^o zT=#{+>Z~a$NC)%n$~qM|eDw@|z5j+GJKtPPR0{OF&CrOHlv;YHmG1tlzsvaG{Wj7p z`6#=Z<0W-IvO2F8YujBvUO}XXYWe)jpWU`OBHCe4X!8v`*DN390L$Rbv#Rxp{GLi| zYV4H!a6-#aEf(ujH@==~`Ah%HWN8Y}7p2AJ?mu?jVP<{S@@imAGJPkF5de8eXJ3&W zvacDJ*`+XXQ=K??fone0JUDrFMY|RmO{bM`3$~+m7wsi8F)UmKZ!yb@%!_d+ELeCj zh%-{YGZZaE$Jz_1{mvzGu+;mJkNkKe%!4>vSfarY1#dw^0p6!8XR(QdOYX~e>FUYZ z?JwszNV*a{tuV-#uRiL{0N%F^7pYWWcC5KuC0ou>8C@^vXS?v_d)86D!gOi>D;D4->+_9mVYTf%@#x}5m~QVk0t#O|`rzmWBn81`1) ziqn2R@=~4^fWVG%zRp;DCF!%q{y}%M&_wT1hx>r#8yiP0ooQR;m*{KmYyCbiQe|T( zNraOnE%7$D%btK-3N~W0c{S1sN%0}L(rR`0uwqTPdyeV^a)cz(Gb?eE!pnTqlhodyF|8{x8v702OHx*E4NP6 z%#4|D-aBB|*=_SqC3^NNLKz5{61s9CX275;I+Tr6O*IlrXo9Cjohv+SON)_%$6RPu zRYET27Q>16XHx5^OTn=`#DPC8e>l`lO&!`o*D3fQp_$>O#f<4Q%C*4>eK+HfLFLrw zB7i|R>WNtH9ToZR1c5s9qf#AvMKHpc!ZKcR*8~GyLOYzFbr@VV)trC*9aK97 z#7l|BqXjdhLs42OQg>?`rUnBvt?$GOkr_6KuSSulMXKK;1g>KI=#^I!6JEOMCR*(P zRh`JMUs5bMRW{JJ*BO?5FTuiHUYi-T+{e zWEaKF#$I|OQpqQbKzenyjak;un$X*AJ9}xvDeK4^hqdT365FQ|70iB{~UDu{6bRtc!d5lDj5v} zq$c3Hp_J+Iu*HkUC(RK$X&RaZwavhv(v%a@77y{GM7IT_hM6D!@x9^uTw!j1lmzz1 zQy^`C9zy<^BG*tdN_k?XY#I^^aN~PMLR@(F=c%$g|8g;xxD=035m*+*c=rV71wANy zyUq#%r_=^51$-i#Ui3r^GI9C^Ub|^7nbKIfWN{vBH_)bJahh{L5}6Ap(7HW^KN27_ zV91$c3gYV5B^H|S=1 zE0`u`j^4E#i3cv-_tU%QTWc>}#tcKc{ix2i#h+;ubT?72)$fL)obgtvjQj?Srl5s2 z9+88iA4~bkETe$-w)UesNJjN12k5v#jd%H4t`+)^2rob5!kIv=89DsYBx~>rS$n)z z4;F|0o!&MFF30A?T9XtL^>PNWV`1}l8S3$m2M4}DxDiGaj-tpw9u?5f^Wv~$jgTdXY6DVopae)A5}U_u~?k+;=>C^pmSp61XY-f6mu()+PvaN?-BxrDBX)xO1>U7#rIf{7FGCZDC(E|CneRAlE&AOP zlJuHaKh?LkuWd1)LogK9R}bPJ@Z-42mII9II12#&mVP25F>UFBV+*a(9*#jt7L0_u(^)togm}YxLE^sVb5;Jd&7^1K)E9*E(pa zP-KaxJZ386OSmPI~_p}pcdw~Q8Ck^V471=>%jL@_EGdH?nl z=E~#HNeB;4V5Hhy+$4Jq;61bKSMd5!)yQ1fEFfBQtbCv9?%jYVRl@F$%faejrDt-O z&g!x0aXv_EsO+pDii4P!cp92dNDiV5>zF08e1l7D3Nx3K8cM1?Yaj{hUOf*`HJ$Ix z>lUV&u)#Zq*%ouRv7?Z_mDa12S&N7h`E#mFJY>==O@B%nrSGqYH|+}>1iH^0apAs$u8 zPRG>o+yXY>DeqPfX<4V>&2>pmarO@eFd5-e?7zWo<%lG}()#zFSPQPnLolr?`i2}2 zQRlMKKsawZ4zh>7N+L?P0B7bs{5MQ8XN~5FVEh5)K~+5@kWk_K0BQb4?jYH?BW4sq zd~(w{kuXWOL%k3ca?$(dIW^gxzh2698@ z0w-C2j~;jPEW{n}5_l(hz-J_~*W$Tz_HWg*3JIZ;0UkfeD$L$zW@pA0>#rrO%~W=s z-a%UPhuFSvmwh4#$bGqW;0RR4Zr4~k`az9vH8;q4W$tvL zelna{b^N|bXTxaMCWjj_zPxyP)dcrebQnEJg$}_|`n|tJM)QRU`koiQ4{ajXvx8;n6RcGOq(BM@fv8|ZhOb%K4#(p% z7qasbYhNG!@}a>B0Y(99RZQ-WrUv`s&tohBXp^xHQ! z#T81NR+VJ;((Vv)@W-VgsA6jTw42ah%22lvR@h?b0MtW+E?Mf>ttlL`QQ^DT316PU z)7G>Ccv_4_?~hXtgMBxke(E^ZYY^Y^?wika5mPE;4tPp5-{3Y}ky|)Nn zQ8ep=FN2LT*Y*0#Y$rD_06t7u^W8`k5CNBxAZZs```%bQTeywqigV?GK921(8Vhh( zY=q%~1%c!SQ-0Ookr*?#?O7x1F3H^@3EQg$_{ zaF!l49STUzYAcClj^&dh`~-cb_M^58t|MX`zUN`566jh8XLLr@Fh9gHG#KEI^frg4 zde_Jykq-v1r3q(8f4Cbf4)8MA=5l{Iu`RPxEb--?E=O5CD%39e91q2vcx2psRpz9t z8SwN~1Jy7*EH3(E745x1e?8=oL*zWbiPw_Gq^8AkeR8ql4+5{F(CPW^*yc1(5iKH21Ul zKM!`kIryw;LgrsP>@<221#HpRWO0rawRsFTG}XoK%EIXLF1BUwOn&mdR>8K5Q8M%B zxY)8WEjChyrUejPl*0OSZAvhrQr~Yq!JzGjsW%7*s~X32T!Jdq;SvG;@eUn| z+;Q#qJr(q(kpn^&TI(27aFR5}=+qJigOAN+zSn3A35RNci%ir+z>?}f4$av!6!N>M zzQ$^nUk}z9wvXRE1XAF~(0qeahaTx9?xL2260NfeXuX-3w7s_jg#w9`2w3>vp$hPK z{PYjX{8x$C|8GzQ_$S!g3g$D&O)=g(&=oW;<+=cm590ksIh5n zDS0FC$8UlxksP?Z5qxlabSc2EbXRWIPmDn0t-Yhb8d{cX=exO~7IZOcA1~VcL$Od@ z8==xFg783TJF{oQr{hZ!PHEXo$(wSzvUXJ8A|%h7#MHc7#l>Zluj(nmSzkN zsItDc_0YZg5FTPSvCHdz{VI=xS8^m3GWx=oslwq%dEdxP#mi7hHdMc`DZ8rZ6v4jP6j31|T%Uj$Gxl zdNjUYPo`1{P2{`j;LgyPKYuWpKP{@DV?HQKK|m?~EO8g^71c>JDQjL^cKqQq+pN&A zJOUwzdQLyoopxzxJObqlAck&1-US<{G07Zep;I#j`!xpxW=djUi@2%2&Ch(39~pGG zTYo)PA1}y)UWEsZaHQhMw~G5>JYi|Fjc$0Y&gIq3l%D$)=ND~Gwa`Wd61N`(aWbR< zgEBZ89W=in&VT{t9udMD-Uxgme-?8XS`xV#dmr!*^YBavxXlhwaiYVVCzeO=u<*jp zWM3hQIk48Ik&z=LE>gBV77dPjp#b>ue6zu&rt`&>-8yQf9Nu(u<#ZCr&afK4A{NRp zn_CQL1TqS3YDw$l&67uAj^G= zEo2}#n=fF`iNWZ-4msP(e4xr^>E+_7Ky-k%f!EMBZ$l zG)~Py<90fC;XVy#d+1GVbpVa@S{NBF5q1wwcvKs_IG{lEY|-RBi&b$bEqv|Ack1RC zA5(M|Y}ju+le!nIhqn0U)d8M_UbDpT0sdg@_KdsBd>5KpeXimaxhhe-)(7MDX}Ino zK}vlC$^u>W(IO{<${dJSv^Jto!Lfb|Fk1Nx9;wr-$tmQyoEsnb{NNB6OlUvOM)k(9VrIP1Z zZbrfKQF8iez>(o{1U-V&Ec!>2%0YFHHOvMF$bUEPWiaM)Gm{|ZFGj}*oi5e$fGJI` zCT=E}yZx5C#S=uI8SF>wjcO`zh~J~JqaDM;9)fJPM44=jPs7R;^Si{%3&ST;u80TWN+vcA%*aTL z%xP)l(@^vBf4ma!9P7cGsWyprw@rlBRt3D%OG8RCR*E~ITo&<;?(vS?3o%HtuYY4f zKVd~lHCRV1CemR^L(U?KAlM@U^1%oXd`tJG!-4`eMJ~MyREXr`t|#JM5m6*TaH?Qp zS;ex2;Tfqmxa668q>XZZzUR}XCIf+jch8@=`}K+7X$vkUlb#Vjb(V;INH>8(8%IAclw#@Oc>UW-q)Ko4oLxNTSv1K!^w z@7s)=+NXKN{q}Q-P&R#s+)4dvJCt#1ViWZ;acN+-D zGug0>2TEn1Ibtm(ZQjZ0l+}U#iL{~wwX4s>>?sJ$>x69QMpMLtrkj@%V>28498->- z(!z62htndf^x3X*S@$quyWU66YvacuI%&g9dyUt0|CblN*(|TATjL6F*^c9<8mCBG z!jZS{x#^goVfS*;1Bk_5qwde-67!sA#)p2HEo-i04-}gz!H>_B(&}o01-yIOcL$k9 z;=Ue+j=ikCiO$oA*+TP@%Rp@tqBkoF*_BhAlYP(rIr3bRUw6GHLbaqH-z->I-vX_x z&kpNSMA*H?Jq!>D(-K7tmc8XMol7gEDi*1GnY6-`OT;Fhj?xR41Hz2=9_kF#Pl(#ni3VD!c!pTr zvyhBZTS3OU`}MlDjunma-#x-5ug%;6hH;A;;SU-O>GM`-NW6QN&I#hD%a%Z+srC|R0)i$ zD&|Iuvy{GN4JhnEmI}|abk7aav@*S;XNTz6@{N|Jt-4I<7Y!yht{8MFQO)IQM@Q6j zOzh7n?fxOn07Y@Ky0Cg&VIXCi+2za%@L-#$0?9iXaJ<3qI9yG*rEC9f_}4$E58Z#O z@sVnRadMDt2Omj$cJZ!=E+5tc#af78Pn@tg{BX*i`Of!{bG&)qd(lmaF*aHJ3af)` zNJ71m6SAIADu0~WcTAHQz#G&Ui2Pjma08?C$+SR`s@0` zUw$|6nfspe?oe|87Q`vW%^yFw^0v(2i#|*M=7Qx-$9_qu7rF?57L+362(!Av@7Y9J zme1U7u!T~U8^WM$L0UrhkkIxl!FyK*x3JF$rX=9Xw?TuLEu8X0#_k(i+ZC?p4>N-* z!YLt}*dkj99?1tGHE?`M6nTsR3*C=$NI1}B#GXtqktDYny$K%&+zIx0m8#m5sn;)y ziF*anhn?|Ku???wwizjsTH@nO`*3 zw2`VpP@!p7CSh3kKy_=+{GoYvW~J|I7lU#PFOVL;LH(@$N8 zEZHk~B3)~x`9e)vp|P&G6x1Q zT*i^t>vIEQc8+?ou^@kun@6u`G(q?9hLw_ahR$`j%3oX0ojzZ-J*(wUB3bHZo{guf ze%+tf>BLFNjX*YWShO5?Z*7OP8Jz~JjzY%FObj+lXU#yWcrOCo=k z-9H!%3DG!W^a0tcsna~Jn=Soq;5+Iva zmovCLvxK=9YgJP!-;q9lN^0}7+RWO~Dm$0!$-jjHGVyRVYH)Bvy<7s7zM@~dzU zy#LU>p%sHSRv$xm2F1Kp>Pym!?3rg! z%%{q!+?ut4&*E947;+HmP|u($jRSWx@FN>U6Il}<1%{ABgw$QJn7p%+ z-Wx^<65?aE$y@rcH#^S#f z7Mfe=z%|z)6%jDIA9U1#VITy@_4=}2K%g9a9hUr#g5T-4RbOyaR;1)#GOnQJ{@ zzv*zf^pZG(Q&w3vdHql&k_a%T((nzJRCHfmH%4}KUCr}M*PCk9R#zX4mIm#O(u?ih zw6{4*Q4GglTg>X(jerf{5m&k zoaPAI3i`P?(H@!*eP8tL`2Zso0W3}))Zeb)I?u^RoeNhJ z)uW3c4s9Qz&H!oW0%Sh@0h8~YEu+sFJrgdX<^x?gSKk6|ZI9Y|=J9El@g1#W^LD*` za^AXr-Zbi9Igw~$jJDr-O2fC(vfHQ-bbf@31MaeUIM`8OStU08!LyQaHhRhL*{f=R zdS4Q|BDf*4Q;0)gsi%)a!X%9+U~Vq{j3N^<4CCgHdsno|@MS*eyC- z^I2QLE5b3NhV|qPsWiQgWV`XmuI`*Ge;(566F>P&IUO(9M2p0Yb|Rb3hk5(fOQXeE zADtM|npr`32;8MJjT=^!sDZl0wi;N%pHHEU1-k$6nQZU_ofvbnm>cjU_K2)mAZ{IyaU3U1b>Mz9Z$O=&xxWMnCGq+uSk6U!ve`k0d;6X^3F;L)2tYq zs@bZeR&X4i@Rv<)lgxEBY?Bc87U!18cmvl2 zWdYe!eM?-t(TZUq3jvnwQG@-t288W~T~?_|^E`x|ojdcU2_SyWRs$;|WBCK?VgvL_ zBFD(24U+WK16=d06q?w6o_pt~F~IlL*dj?Yb!i^drYmXt#^QVAFG?`vHu&{q-Qx-8$8JLlJlEd8LGVY{>j@(WI))`sFb_=A%5T(BZwuRHk4#( zpq{uvdkO<|&`FT4-SIcj9VDp-VU;_1Q<}ORyB{-nISDfYoOQGV`Wf5H_2cT-Ux(BV)CoBM3;6n5P5vLrrMG!4L!HN?u30n{t5GteTGMvpEO*IHg?DU z<=X?iF_dt?7#_t?hxC!2!&mQ|O^Z?=&=#yn@z2OOlRZ$4g5ElYA$V|^p7pMi+K6f$PTxo8gN?Kr z)wsuXWRI6PsxdlVPjk!K3iU>_LJi`l`d6&FUz^B0D}G)>{0Lafns)n;8!%{@KSI1b zl|g)G&x;o2GKc-LkhY}s+FkEF2Rzy`V9S5*N3=bSDJIrFNNsm5LdvT7GM`AEcAvngY8d!!>@*K%XI1_JCQ|W_G;oU0-JdmyV6?mC6 z;%D#>zh~XdVx|lMJc$htkx~2R`c~c{tb@StT%&moAPgY^ljkB>JP}m&y?QbJnB88a z)%vGWfLs5iy8uxaUjg6J&jCv3TlZi4UNRR84MK_a$GCs^VOD3y6E!Kq09ri0J)oJkK zX3$i4(!Wz)$jyI{ca`s`@31k#dlD9!-*>q+(Rd3k{gBS@>vrBcvQo2GS=(OGS&E{O z3H;S=#&W8&P!Kmk90rl9eh%2SOF|ERC;cUGc&J@wqk2c>+_@k^<*iljGb7B?y zoGW^MYt@qx9<#R%0%rRe1qL(>`cFBpzY6X!9W0N;o@*?tk?kpGf_YsyLT%IcvskE! z47O|r2Ab1$E~`;iE+min#Bi8L2XVS9+nw~7{mgD*qm8>j^>3^Q#;=X4C0knMoLohU zzPI%RF~@Qm%kMG>{um}>waBsj6Ph3cnrOIJ?jM=+(L3ul^ifQcuwibRTH~(BzSDP& z!Ro}>19)8+)5d){{X=4dDQL~#R-7&d3gVwdNX$WHMS=^$*wL~+AcFQGxIiMnVFfHnb|I5naa$} z%*;$>W@cuWnYn$=x%c&*o)<5AVj}hrr82itN-5*Z2rVs{-^FLM`JA1WJ37Mc?4Qoi znYp38^rugL?*nhfPMc0FX{I;RW~2bACx$gu{#=o<#b&Uc)nXLj`*NgxUY_lLI}vIutQC8Q_eGdAsfxB2Ba+Y|4E z7GHoC5gI)gLJRw>2cm-R zq;{P?y#zLBY5^_gT{644zw+B`GFz|y);2yj2pK9qF3cyZOk6(i$G~Y11q;)_5*Bq# z?&F2!rr|GajuJ>csU0(2H{2!^^t42uP)Owb^Yfoc7Wo-HwGh?ojv-lY;i8H$T0zuY z$H{?3fTmVOW2_So80VM47vD^M`>K=*8{tm56A|C-lk=GkaaiV zMKswMRc$^{_m}n{HY4sj=7B-{)Et7g&p424L@1e%;U5Ytx;|`jTcWT>B@j zsJxae5sU-YPp#oC$bD~vjt zIJlVD8hH@1eFaqkTQh4DLKfC9+l{@Qv#5)$k+X%JEg?YB&c)XFKVa{_>F|Gt<$rGd zUkLfve+39l4XmBMY9S~8@07UmUp)BVcm0oYzPRxJ9p3*b=P$5b*u=@m(Zb%@&he{C zPDX#JbJ#e)DkWrK|1ZA|8ygecS9$-Oqhn%Z`)Y}`fteHGUx}|01O@Hf3AN}L+1LsH zI{SsQGjI}eGBW>b+VCHDkGO!0l#DoyvW1O_ldOrGqMeO_t-O+qG8{m{*}&Su=%1(Y z^;ndgO>9&NzY^;Ix;+ca7vU{rZs7PAs80!SHg_~J0Z0KX0Ac`VfD*vOz{thf1mFNL zbTlxsGI6#xF?9x*+POFaECDV634nu(owJFtq4nSSDqpiX|GLicFLw~Y)WX#SUO{9J&ZfNFsKBAfUT_~C)5fcAm;foc|xL1;mw_^DD31{`NO?lW|4iJL#` z3A6l~qud~rjPTwRe|*~vh~C~p`5uo`wCVKcaGg1v9V2B4M%k(J2)|igvm+y!?=tdW z=~ivrw^2V#Tdb>L)wXl^rR`qm>~S&MT6YCMkG52SE6k^vA+*+DvM$!OL8r>Q{O9=2 zR@ABpSoj3SmiBIwagRme-0*C5MrTI1i-Y6Jg=9Ogy%tZWQYbJDN%m+Uq;&F5wqsz2 zZ_Jz_(dv~1?f%IV2zPG{5uUf$XhSL2Z~lkK^j zZDOk-FWhpTq2U}iS0YW~HJHzcqIvR|s}e*IaLAUitVYJj*Lv;iFi-8rI;bA#uKarHE_*L934Hz9Utw$3{wNRGSP?h10_tjKdmsC?tN>Hs)fuoR$ zo)L?}=XFn@+tAC~6qC3ql$eoLtT0yNhewL`HBUe7^qez4C^Z1KC<&-yRvBKvB)JPI zmnf`L&yp=9NM52!UFV8yOXV%5s;)FTI~`@6nCEOHZ;mQe8XcQEac<>O8-Xqe=7Xw5 zb}SO-pzFoIg%c61z|tDS=+UPnnK_#B(Lty@?motO8Cby&vTG;P1^4 zZ}C8CF!AJvLlw)Wmnz-OiMw#h$~Gh!4x0LwaB#IeyTbT zp(N$K%=;BO>^9sDANqqi*7~Um1>v17m*vuZ^SV<7LJkF@96`^UAIbx)l*2PjHB)>D zbPlzG7>4Nvm6JM1vTD;il%qxKrI8@g=RoiH4a+eHV;!V*`VZs4DC%Xt z_fRV178+it6nB**-0HY3{OV4Tpwll|pFQPAI34zxN}RG*F*#VXFqaCp-H1*|=?icGTGf&~-1RX=b$SE-hrG!ERahAdW z1-Zm5nMK^&@K0e;n5uI%n%8Asljb}L-FP>ydal%xWL05NMV}i)3sREUuzg@>Q`Heh zuyU?Am00<7d75f@0-`8%)T9z~laG&1YSqRgegj@IzSNB};Z-^=vND#fo*FUTdoNN39O4^08dY{q36W!KOX)(81pcFV0Jl9j4pi8GlmKYlT?B1 z3}*=L^qX^LL?1Hbl0-A<&dNh_{*3udSm?I?1bRkgk?_D{_$>|Y?m}0rqpkE)dnNct zCYtNQb-mN^wao#162TIj^|8DgK*H63mD;nyxqn^6T!{U05;~qA(pguuiFIB2n{(4) z4bwqeSrrqn^Hx|28pq3HiS9RQZi-@br2Mx+6tqu6@HM~!dm>5z#2l+}e4EX_k&{V;B6+0xS;+UCY48sYW_~tum5b2azJysksPW0C ztM7cCdyAqrv^eDxSl*(M%3l(K9&>Q|JA{Wmk(Q-N(gUJ5}bDXfm`EmNrlTKO3+ZN8TVZgmv+ucUh+z6 z_(KXK6W3siE0mj3mvmgzd37|jB9vk3RK#JTVI2fJNdAa~`h6s%J7_w^)QNt`o4_8z z_@YQbc>Xc^wcDlQjOV1*tLt6yjJ;9zWf%0KTVxG1FnKrN-@9ZCAHOb7Z(iF8HgKS*s zxJ4N<%UQF%NJ-6P)OjaZk10+vZQn6u>r zc>$ztjj|eLN`y?Ohp?D`FieHZcy7R1XYq>tC8>Eycj0^PK>(_cBLu^9ICe$niWU@e zM6L1#I}%KXVgR<;4!fO>)i0Pr0^=#pf{66c(SfPrVgZDu~AetpB4^yVLm1zECM{Q1Wi7U*E2n&2s-2OYm?&i`@rVJ6Z<=Oa9))L5+eX|<)k<~k`KF{)H)9;{mny8( zeYJSyMhcyDApU&g_rtWfIO<$$oMx;7G&K=y!Nq;=m(#u4uo=TI5vv*~)Bz@M1XkP> zF}HqPCHAp_yYD~yo))KvIJflJf4~sPwWF{|U*J4+)U*LBzi^df_NCxo-=}k@2@yTD4ReN+v04#nR12E1X3{ zbH+59WfQTLb4QoWNcA291HlGJB#xV7f%2?e5z-e>&HhT9+>{wOx-^I^#rSUsS?d8X z@m4nLv4u-X=huXrW=>7awT?nU)er|W?MJTbq@kJPo^X{8=6W!E$DXpTJOmxD-U!F7 z+zNaW9Ue&?UJ2OO-L_jn;`Z25MIIHPPADw)Nj;L7KOpEsaKlP}{$5IP+}^#)Cv6!< z(2Vi13GJkPI>yS!n;j8u)75dtvymD?JE$Uc7+z&z- zBy^}yhAxG0#)Bt0Ra*3e(KR#_5=2r-Zgu#CgAf-X z4m_ayKmJw39?T1*q@gpY zzlWeZ>V$+(2z3UOKoO5&G+|zSaI9$|CfKj+^KSV4K`5bb;He=!Jb$Ihd9XT^8>#T4 z;b`DWGB};AqgL?*9eQzBJqSnvVNA%1V5UWru=8j>gV2%3Li`+KP*WH9?yaoql-;Jr zoQHP~(!l(BaV>SKWb8GOddj;yuMtm|HD3>j+>f?iAE53 zf5%`HvCqV)-^6Y7{U)k5hMjQVg)0Lhd3#y|f)Cf0{3q~|wakBz4Q9Hf0? zYMD`#d|GQ9rG5uvb>b=G*5+CyF<9ARKGB7OU*y(8g~ma`44e72f-b?*?BxyX<6(*K z^*h_S(`ojPP5l(J)gD(G_vUA(+d~DNWoJcFW_BDO6JM`Cna~s5Xq{Yh#|>fVWwu4o z@e^wv4RC9xRxkchw^`9Rbjt`TFVt`=o@Mox+n>R=T~oJpdg~>jZB6q=%^H- zf%F>ZJXZgeFv?lQp-}PxSX#iJAIKcCqg~m!^<39x#s6dKT3pH8bUI;i26gXg!z1#0 zmoSeIB=5#YGN1#Bh;Ta}nw(ZbToCz&5K#~W3gAJu`}#Y#L?weM%j|4I=d#RcX^Xr& zrd_7>p=0uo9(Q~8`=86#XCJ<7fNH+Qae5!m)J*H)FI7AVD^|;T5Tz7~$qlkUymo`2 zFQ@Z{CfBcf5P@XIZTb$D9$rX(i~^i-6*Uz)D;BxdgC~zYXc55}%H!AZ6;NPVlhl%x zp-^vo6+BQY$wkMsd7~_i@wY8*R4@EYt3@Q0p2aW74x1NRQBR|9Bwg5-kVDPizqM|2 z=-TAKE|f{O!Ny}q!i(&E6!PWZmoB65PZ%vUg=%(%O6El*LC86If{@YgJE%ImPEee( zD*L)5%ahD2yBu)GF@7eg*&Buyh-7e}i(TpAPJNqy4gPeBio{S3`!O}wdt;22p6r0{ za1RrWP3Z!KM-T;Y&VgaxWX9E-cEf`R_7FH~wMW~3_t!CSa!B#O^XaP+CL)Ce8|!%y zN5oqu-byz;8i0nb0P0BJHnInWkl^km9|q%qvL6nzvg@w|T?b#f2$tGm8dZuNdq*ZF zv1hL6Gnh1J;eEsVLesP$wwXY>x=f$OzUIWP>PfGV5Vr~KFav$T0*1}%eR05hLAQP4 zJ3jE!ZB?ZC_72$Y?z8?7@gGZ_jnlHeioG&lVSluklV3xpx_dnG2Ldw-SH$*bqjbG| zVyQ_;tq=OyYd|R{e-HvUCGN&PIg2C{$}2CSWaLf@)ZV)5k%0f?p=n`SiW!iUj#PsQ zE+O(~)yeidK{56+y4t#FCaaMkBueX!q~v+fP$F`^>D-YRd?og2$RkTJK3uG-LST09Yh1AcTN*=LVyYL z8SQ{u_o*^S>KSIsBQi%KZ3?}ooj^0$ zKnJ@OQ_sqj6cMTIjp}%ICc6}7#fyRjd>Anr4q?6TZfheEiHWiVi9;PK*`=H)aBusf zK2c<7ZDTrMdKw=ZQM2G)LA#kEjUD$VWN>z9wks53S@xmLX<2+<+v_JF>`1)Ap>Qa&y!B4RwL@F$&>S7G6Z@fdNkQ)apVULU<6 zsqc}$igBu2><_x_=nG6|Y0I}1CtxKlQ>vwNqC zEotMN$-%5W&sg1pO6A1az6WU|mbvktVnTl)4o9_cpT^^cd&>tcr|Co+= zgb#UiJ?V(a301}_&W~B1SVo|;!IWREm!$+Ch%dJh1~|$wQuubAhM}=bxLA^vDyJ5B z2Toit8xxXGjEHg;R;VqM3fHYJrlH4%RnyAvt1kv|EdNmI;OCD#f_-h9E*x^9!%k{a zw251V?A&mp{&sTt!D~YWIy?ICO~+uIx|@9<*pCJusEQ6K>YG78Cjxi2C4llS7rR`w zI^Kv$r+8pcbE4gR`_C+hOH(TL>3l+)EPY-Orp|)4Lex6_9y@j<4pOrKj%*>>wtIr_(hsh znar9+D*Krgo^)YhCD*gscvw&5cLXX}#4?fs>=ynw;1erl#FMc@ius1mik@fz5Z+AC z*QAOq!X(tMQ_{2MOgSad)B~dwI;tC+`vp&Fy>+VS>u-vlaUj6;a=824_DK)032H#_ke>ao{z?i77fHg160PP?2 z#2=wPjcjdfs}aIND5I+*Gm1@${MdeDt#zEBe+qx3n$o=c4H8{`ac)zK)LgYMDx(;$ zP;`G)%%QE@!o?f6j?_&-ktQyeT*g!?t&&8v7RK0LGH1Y=hKi{L5smZIs*%oQ#C%)( z^SV9U4Y_+|H)BieJpJesjkdR&mB(R=cnH_F-=@z3DfzTC3faR)NmHpT5P)L%BT{3Z za2yZWWV=F(Mf69WKJ6i&v)ZSc(j!(D?v77e(_2k_gJ*TSnwE=|8(X&;*Q!ReO2jfT zu77|eBqj)y1gW0*@Wdky@(Lp;DLaS+q(6`-B*rtfNVqEAX~Ss^rIJ;-i;I@r(#an< zZ4NVbzsaWJ&mOO=M~|=HmK!9VJGm`<;hlWJxEV&yLL6r+^EVPpRI)X-9%mF*kP zBa-8z>FaL=>$~0QpM>vu4YmSr1N2yC3{mj2wMCQa`N9S?LeAh67Jbt6eMVN`O^0FO zcT?LV{UnZ_QBkvFYt6Bu$Tc&{ysUdqd2W~M9p-4%BSx9LBthd(%HP?5J^%t{! z@pg?le;0F2lMj&YZTT!_2x&B-%i{Bx0zw7y?lA4c>Ds*4^|51<3!EJjNR;l3W^yDc z?f9tyW*P%i4fb!5)j~^=pYd`-gj<^@*zFPCOpC7?8*0Blz~Y1ju;oC7JEXsZY1}W) zIM6rU2Oqb8yCY_}He8>lS{*+j;K1jIls8bKf)PSX@PrZnEzre`Cf$kVcI9broI^06 zm!i&l&1sgvs1tCkmZ2ACFppMc2j%WpT>IMv6pBqFGBRarniK&#Jtz{o8Y-m&KON%w z)$#}L_?Z*y(+<6hI-+3oxw!3WgtfThrAhMHW(GpRnm?(==TM?ObiD~mr^zW!sMQ`4 zb%Olqs4{qt+Q^tx%y$E0KgrO&@KeD*GB`CEhS9(5%u!I~?1~=kSq#T`$+SJ?l|u4e z+~wy=We?Gz&JP5$>V`=nK)VQr3=C?Hg^|)cqq8UqIUzH}0bC#VB!5oHPOFWshSH3{ z#AX7j{uDiGdn}Y^j#p<~a=3DjQva4!i5!8GE|~C!tg5_;fumg6MhMjO`{?hz5eSTG z#o=;;YUh}BIEQ&sns^Q%O7P*Wn(*pT2vXt9fDb`YR^^6&-hP2@?!>ONU&V8UuwQO~ zFoujrT1xI9szKN25N)7?lG;V@?1Yvrl|wMe&;8@md*ZF7=cB@;of8l*eHpZ^M^xyjqtxO=YyWaVsqDaYcD@i%8CQ(#f$A@6KFZ1HJOD z`x+*L$6||4xdyb%NQN)v2JTcS7w8E`!VhFB*S#1K{;?(r{p^s?7(hlvZGq4+(7p(MmE=I9nj_ z%7TpO1ZWa0W$mhYiCxSKro|*Lzt)*eC-fpae&-68_2uZK%y>K+4%k)Dju+{`WGm%E z!|x`Rhl6~6zZSf5o@g~&DP0M~Dw`-xY9hXLCMBy|*0w^cY2w`kx343IY%LS(1rPZ? zjd2M?ia{EcgU8QGC%A_UQUMG}))r-!?t&l=@@gv3Wn_sX-TtXV@@X>q3i;@b3dJOT zV9CoKv{0p}1M%a6Z1YHPe&#g>Kvxe2-~39K`0siBxXCqraSyfSbR`o zU}c4gv_W&>xm&BvT4a<&%!#M4J%MKx9C>jI&A%8OO6IMcLDW(gHG)f60#(CL?87yI zY0eTuR7$9w$5{ftcX{2tP%Iao8N6_Ml6`-E)pi|!Frs{l^NjrE3*KdhQw^)PGmuw#g_vjEPFh^J7axdBr@DmiC}^Jio}Lg z!6qd{E*$5s1x&qRHg#76H9=+Hc|zki`;hzqWKc<0)Ev?Dv_vc_(|Y-CNR8icW*1VH zU~VQ_-aC1MJmx5isQx@^l38uyO}2E_i&y+m5cLb*1&Yx7d4gSTbXe6rvo|%b*C9qb zlWAF@S}2WliHgDO={S%Yn${yRw!!{4YI-?MktC7!D!OWjBvG%&m17dObdKUnQI%q{ zPLPLRX#0y7f^~IpHyg|J9+swxc^?7RlmJ++rE`;#L$HlF^Fq}8zN3(zWuvmg9 zVh;$28}zH~cLWn<)G4sA2Z^Bl#P}Opm=5#sVaEsVsYtHVzU6g2DB^aLS&gZG~a8b!R3= zARe)0!~#c29}O7y_Q@q-Ri@oSo@(ZbIjLWlur(U-O+aWJ4Sl&iecBl$f>q-?&yhhJ z-f2wWe5Gkl@k<2-BG&_fcXqVFBLRG!*sf)YE^$t-+eL2vrA>}1A(n`KnE=}K6u1ovE0bVmbdG_DP8S$A)Hk!@i59}K)l6X}P$*}N`Q>!HDP*ZA0rmP3N8 zY4Lo^H)Z=qw^u-ImoAcd{V_`t@e2ODuwh7qBy8oH)t8iG9;;cRBy6%%1*8pwMqoo{eQbDXqt+vS-h%1{N-t9V*|ua| zzG~$-RiBsefvS4T^7&l6C!aEr`qS|TPzV=N&bk)zF&W;2>s#^t3Z1!9^S6+uxIk02y0US82<>V3z#-njPC`emfwPA%d5>8=JNQ|1u1y{|Ryii?U8T*=A`qf$M zoInyQaPZ;v2ris948W-iw!RctmMw>cSL|{$^sF&(7>SqNKXo8kO#+3Byl+>x(y~}L z?8YRgt(Qt_uu!mnZ#W8W(w*82o=puU;|$B$Dz3G4=NVq9MDd-%z4UQ#FCIn2u7+qW zaz7=nm1?E$A4)y|M|c4;U$D2cQMMPhGA0_NEh$dtsjOVV$7)VSNMln{3~YBFZBMwu zjAKU^i=%QlFS=3?5vXJ2oXF#mHH}=Mhe=3DSd2PDa82S}i3idiy;vLV zr$nCL1{hv@?r4 z1 zbe_>a@aP4R3rZ}C!CTc(gJPEq4n1Tjb`4db*1{%&erlru#>x$jXP0+d8=T5J~(C^8AD*Ahxdnr2$Lo}(jnx{CC(8S zaKyLl`FDpUxU< zvO66tdabwj=)m{@cM#yVFP8i%ol9kLZ6hdbSpXq^FB~;8mM7VR465a?sBwlcXYz0sZ?CZicWVi-Tn^EM4I3^@1ERO z^|O3Yp0#vCKtxicBwoV_soR^Pt3|d7K*vYD5ORtS{&w2Oce}7S%86 zCvgj$jIk`YTBXhkUaDFiSS0AN;sOGpcRSY3ZPjtYL$C{quN%v!4m}=u@bh}cejwbF z^va`DEY|c=2NeZ#x3tn{fg%*Bl*Z_Y~2Z8{@NBzMUiG^+U zNY0P~`A8~K*vR7N=3w`-c!H$ymz!*PuuI;SB`H*K?|EP1Z2)3)kQ`ZcU;&T!N!tEC z;6<`a=o(EKD4aFICYxxtf>c@ z7E~=Opyu27wm7CCM97bprM)_@vSo0z#YHJ9E+`SR^8El*!%yB$*6tekW~=AM4YuAv z)x#Yl$nLuUPn?2H`U{m&ahYfpqQL?m6X$GCY=jyi5~F?lY4-i!-n_{RQl5kz==s)) zopJJt$w9@d(__Q=zvQYh>~dJ!yMzvWVLnKDfLtxxi~ipPG4p>eZT_E8*uU7<|L-U) z2g?@<%k)2>u(Fc>Ckjg^XlHHwf5pSH{x>}A-=OF}?5D-wSge857sqPhWc5YK{sXiA zjl@cPA+h$>E>2$@o8+G;gB3%E4x~hM1um6y)e{rt=LRn@1 z3v~SpauxbQTmO@4bpZS)&Fc6?vKjzHwBY~>fd9f+|7KqQH^urFiTnSASO0QB|LxQM zH@y0va_IjFUgcos{M!5Te`Hq^RJ@dx#PGZLFD42NbB@6}*f-1N%d6_7)U@V}bfz_V zs-}qvd9fKuiTIHTNr?ilQ01)-kUXfWW3C`s1Neodk@Wm#+f=m9EDLqEmu;hMnv*Wt zoJL6h1oN0}yqkS4r`}GC6WqT0bf?~WGvh-Jp#Y?Sv845l|s4OU&m5?j`D(#$%Jk=Wd`YSS=yTb41>Taofvg zh_}q~5IDAzw5w=0`Z_7q3iF2Xw#!_1r3T~WUfLnCrPy8QqXbxbNq+jQIey3kVE76a zK)8c1e`^MlrGwITOob)6RQmW4W~bMdJa}S2Zm=?I@^YX%M%J6Ly+-6gWJE-N6%kDg zY&*ViMYLP8Gg_ovQGyz{nydn|%rFEFw=wm=J-``o#l7ygQ!20$0O(3fFS&`@DxG}LdW*Y*^|%3&}?o2e(zP( zhl|eiH@AG?;J$ZK>BW9~th=Jb?j&1@9~9?TT|#y+_P`hw-SAI6b9n5yN44E9EGR(> z8t2G3wkY8df|9W+6$?z7=SVK(r6p6AV@0esX5p_T%$XE4*3w3|Bj~4>L#WV^Y}Mw! zx)?~*3Xm+ASUgtTbzMs(C8(|DMe#C?SO{w6b?{tFQH+>aVdo>%GTEI~apW3VoYN+8 zlqMnA}iZ6fzI7^J6U-7n@vS@d_)0WEv(D43Kd|2FFFcJG*pk zCOJZq5gwDiHa5sMFW9_f%jOWe*E*9vmrg%%ZckUXUc^2@w^6m>B111l35uXqshq($ zfnkP;yQQ{HB*2aU-#bCjdUY_;+u(#*(J>xjn<@HJ(FQA7O08^#8Ck}mBv58)LQZ6Z zoRx&r0B%#5ryaLm^1ZTp$Rpi`R;mWuj2zOKSpyEz(Ndii*10Sb8lEKZO~79$&3u9$QHe={zO!V!3t*~R-$ZwIw0MqM__Bow6~h2OCrmW90B@a&x- zFqJu~hDpP^wBG3g9^DNvOI`FmGt11HqMGWFEvRHl5%2rYu3M6yt%6j_Kd*I$d9AVDC9rgII z_410MOB`LwK)&Ye1zansz*i5SB7(Y)oE-u>f0S4 z8V}(-?o`Q{sCkv4F&@!DCnBV^--BMB(j*y%wNX7tpQCJj!&1+?OG{$57x-IycWdx`CY^bT|R801%DTC^|boz(eRrcB}wApoTCfxSX>pmqBXeL)+Iz=-1C zhk}^OW%w@pM9c5Hwas1H<=^^(D71S&yPeo?Iiat}cGAG7OpAM+P^Z^h#U??WQI@WU zTOq*4S}xQqoBZv+g9AH78vub*Z~zuNCNOXp2L7=8I7|!n6(ZUruZ22Zxh7Mpbo1%H3B z90`jgkd7419;&d*xbkT$8PHIR4uh(C&D57qGvp&P<_oCj;+XkG9o?hYiJ08=8Gz_* zKTok(T?_X%Nk7!x&F+C(Tb)YrHCTJI**0u0FTe(=R>NQS+sF&UPbHrPHEBQ_`||Yl z*4arY6~xI!MWn#E1?qZ)Y~-dVFqNg9T05!EcZ&$8F_lj*gM24{P!OVk%^(9aPl5Kf zvmx!C2cbDi>gHN-1YdIZ7dDg~7+{BA{&8%kaFWyeCN z<-K9_uZZ=ipy;Cv^q|)n6a!*VgG~!*;YeEw>;Xy>fzMe%$RHd;cw+3&z(KHq;y7{$ zvW>vzX7k*6p!6fqr-!%AvJ&BMaZOy0RXh};MEWgEC zVVY%k?}TvH!zpbS`~J#h+E2;a*0t3ImHKnfSsFDSJ+XKFrFXkG0RA-nhHnYJ3AQQY z^3TcHg%yD78ej!; zIHQK9TsgJXxGEgHAai=6*aM3LWzR0rbS2oj@Q35cJtYbT4mah@*$I6%=BF!l=JgS) z6)c;1eMz|rdO-}I`TSA%hMA`C2~*~$mMUXsrD1o(&$*=b{Ed3YMzaH3c(H|~3lb-i zLEt6GM)lHZ?iGTQK!zvhxoe{m_zC6O<$L5Gy9F#kM;Q zWNhxD`R0Y1XpxNfz4rnKx?tJ8hNtSav9}-T> z0gz5=l7cHDu*=9hl~r;;LlPj!((McS2dHZ`TLv9+cQUK!N&1x{u-O*e9(6_w)=IM%_}b>DUiGKcP4vo#OR|qRg}srDVMhM9 z{BOj~L4Sbi5Vv3lM`}5^F%N7o)n@i z$41Dx6nF2`cD4-a&irc5p@9#+y*}wS;PoQ&svjO#cQI@eB$HDanP<9xz&+v3L7q|Y zjB+b^5dV(mOL}i^O0%rf)@+2Cee?U63;!iSXDoNjqayte)_r$k@J(b40WF-A_0ucA z)R>Ha7Zscl!q9M9Ez8G`(YOicInj7Wq{Z4|vUX237f~I>{1%0`od|-%tR^yDNy)P}O%i&i6Dl4eVs4Zza)Pe2> zfskCS^n5MD5$6Xmz&Q2>6|6l|4I*r$+0eMH_iD>pk1-&RNH9>t@?E@#cgX6n$qL%!tD1hQ9%&z-u)0gF-g&as ziwE1`2M3U1KXBhAdtn*8mfbA2Rv4chB$_MI%jGV0;l`dDyn%R&e;y=4W* zdN09q!5H66%2KeRJd~_|l07=ySE3xz|NM}GYaY5j+IjT#ihRo_shi1_33PaSFY3m> zjT)wr%!`Akkz!5cS89Eom&su3-=?s46<9$GT7^?xhftG-2(7AIC{NyQ8nHDXG8Ru! z%VUnseS7~f4(nR;@3am2kRSAhs+FcU8EGWgeOuCUfyL@~Ain2h5}4^ElT6XL zV?12rjJvuZP>y6O<(F10ZdBQ$g&yKVGqNeFy62KZ8T30wX=Y&8T`09i5WIDg}6R^b3vMrIu9d^?9sWf*AtdE-cNb zs1P{eGh|Ja)8=F;fz~^Mh-54IuSK#$VpbfN%Xmc_HljZecp!!*trP1`UGbJqElYpn z5Ql+PhDwA=_#rZ^_e%`(genQsw>lxm#|-q-u|v7%(u!aJ8gnYcD;8ZFW!=n9Pn*`V zwtroSE+KGpzZ!IR-;Uq=sVgS ze4Z-X-uvd6B$2j^O7G@Sdb1hKn`3|W1NHkJW*BGx+l+P_Mq* zC20iyrFM+g=GM08$N#5L*|fj@`{Psb(BsOSTV8&_#?iH_SKD`;&LI*4GR#?8Vd4aV zvjIHp^jS&>(Y(wUfmr(?uW|-cs`_6Va&9&s{w54f>eexTYSt!FRu0b~^S|{{lm|&9 z^yZVWZdfYHF1nVzhE0AZ`5@X!8EB86yNtOSJCTM5elAyS|kJ4%THS?n_b8{*K-e(&f`wXMGG`ciVzDQ*_5i^%|;lc*Iuhm3Ac%Gb1 zB2$sVjQD8nsc%^w+NJ}P-E-tqgT7{QE$ z`zvpVUm3`_s3($^;)V#ad!^RFSrD+)G)_<7UVMJ@6v!bp@iuN;V(y5=jPL6hfB2C8 zf;ua?NC>UNI3CSdNU8J=kYKetDsoT(k|84!{)|t=W~Pfs@m1;0^;mHiNGvzS$BmnN zb_-e8|Eli0qM}-sKqX3)AW7m#&M?C;3^{|KNX`h7Gf2)VIVc%LGKh$xWD&_pa+V-b zKv6)F1VK>X?LCSI_1tsreQUjs2dh{2?yj!tuBxux)6-KG7MV|UcwJTIx^WQ`O|RaS zZ++{Z?g?iGy;OMTxH8w|8%RkspV)mbFHXP6C%B^}V%j6dqtep_yK1MAIsB z*yvOqsEzVsKW(k#=Ch>WZ@76$InML|iqZXI3pI<#OVy#xpK-=Tdbrl&Sm=~(oderIwjDI zOk-2pJbxzFa5I*#ZAQUnd&zt!s?IOUGdFyBg2&b9m1aP}hFF}6&H5nzoGM-Aiut{O zo^y-BXxyIGibTEvW&Gx3u}|WxbG3S>E&Hts39Yj)y-GW+!>sl^sJ*uNX-JR#Aqyp` zIN?o7qnu)M_QN4)pOMHIH@&lLPNx)qo*lbM2@lKEi%OY2x-mHrL} zcCLv6@ag?&lV@>j%s9`^Wj4EVs$tez&DRfgq&#jF$cG9FJ!Ah|GOD+pWD3hS5r|OO zS1AJYzs#G1>M6tQt{Iu+>v{^y>vwtk`kKqjE{^84#GWZZ2t4jy9A*Pz5~X%;V?Ja` zQh^Z;bZ`=gX_1N2NO@M$!bU!y3cbQmPq1K|4`mi+4X91-<-Wu>of_Ftqy6GKOONXZ zIlPh!hvaJk8`vB4(zuin$mn#&7trcuUdl=7Ys+>8QYz5}WwcR_q{>0+cNXl51kv}l zReE*V>t>y&18%gj8Refot=QOj&eZ|^I@6c!X?6wj2a_rAq)rFZ4Q4vebG+rY>GX>N z)ftz2mbR%mp82r4J|h$tGTks~D*mD<+vEoE?sJ(Fpc)N}I5j$7nDg@B<{O!Q>xT)o zlVv=@?BcO0{ST4Pz3wH?k+!lv#yLyRo4BDKe~&=f#kR!uB43D<`RN9pH|P-JtSur;2ZiV8nUH|P{ZJ#{S=;lZ(PvT zA1_Zgz)Oy%F>$D<4(Ew)R@W;W?y@tNDg3MH#vd#ckm;E_=54A85Vvxo;~c#hE^x=F znC9O;ce?_@ruucimKow#tH7W<@tKp$NjqhJ^>cRJq23%el}WV2;8s#}B%^jz8Kr#G zoWf*P6+86DmPJ6=A!9|SLaUK%%4oir!omaBY-T#&%UcT2dA zEsB>5R$x~XJvN^=d6SJluql2a|4WyCY?y7%jiMF^2N=<`eNitm(%te zur(Q^ypJA78pmEb4D2%%S*BOE*6F@&!TkxX6LO3^GnPztH>B=OxEid^LFWwmo6*z z?Vb+p(3mX*b1B9>;!Dc;379%I3PPg=5RZcAg9Vz!y&eTuP9HuRc(8gj^Ui+(_@9Xv z-CVC%I!v;INLmFPeA()M(?IR+gd?KJLpf<1|3;lq<>P60ab(Fmt2~0cOKEVGM+%(t z$#>P!qq==JbMtL|9%9a5+#|f9yV-Ec>Zx#|3>BZDZ`ra>NauBG)1_UKOk?Q_kHn=` z2g4WUzMQjxi-?KLqj?q=+vjZ~#Z_FM)GovMl|(kZ8auOO+oJ`svFy}rY*lpMYSgil zUl^j&nlN_O-NBf$y=QbuoIIVDioo}#_0>j^o7*B;r5E0?pgq*2+jGv#>>Aab-Nq!r zy+ix1{I*w-h0*G;q76kIf%s^^gLH*ELxk_rAvmshzOHe#GItg+J@4m~a7*gC1`BDQ zI~5qk=*O#}cKf1osfLo0_Ia8(zP!yZT^UDgL_yGr*a%z?KDCG=L8`}%||^eSg@s6p{{ zO2?wOEjdz1GU6j9PD9`#rMX#_+0*y1fx}Xd%nxw?wV4kr!?p7f``;SZ@h24GZdS^_ zzu&ItKlU;ygzud|M+T8Nmh2FFWxZ-RA%v4k*8T@3Vx@C+tBi~k<4o9p&NQeH`4ta zYeP_5mm(IE>nFRnr?wb0Ul(&TCNjO^l%(id&C}7Gy!x@SEZPXsMe%OR|Q=bOM{MqA$+rcbYfm2+l5MoVIaUY1%FU#M)WqwS%S*2#R~HO=i) zyJm)`HY4NQrYrD12s?v{qjk=;*ITGWOR0)KRSxsA5SRr&**ZS@<-Z+U(e^#5X>oH&3X9h z%d=@)hF6dIxq7HY>jVaj>m@O>BB2-P-Dfu0)_H~{mgw=e(Q1a|@hiutMkhi&sOan( zFw-|r3z}aTP~G-}7Wa!#2eNIPS7Ml8BOxBSu%v{wF8(wmIoZtyA7Y;<88*tgMY^QA zc@Ga-WCuMJTvSDabu21QXa_%r!c<N3OgU6HyA$#oU2(YWi= zTJmu;0-i^fD+xEg1xez4Q=c3;_a)3MOfq^i-_6M(bq1d0x8x47BsSt5d%fyXqo(Ve z#d7nKO6LnxZX?kY@eOP$CEWxD=nJkstBY-^mR3uBK>>jRIt*#qp^XUwJ%wwM3kR~*OnCFA~$m_8V z-zY~eT-R6B+<5KIS&4c|*8e*Y+3-x#8+My;TW` zP+p#}=aXH{TM#}g)|mBzxgpFbc4D7VZ;Y~vI0b9C`b+gf5@Ikem3c$`d}8e#8`>LG zFGep8jlVC)7Hvd+zAi{+w^h0QNIG_cJGoh~OtxZD?IR1P!a>xxu=9FaD!VOCL9dtKEhT|NWu59pr{RevO*sfMD zO8uAIQFn~w4{l5FMcOLj+~e2B!Jkm^7S)7qEZw;{Vv)|ciM^Mz5%yWONbM3bu4mUnbyvuVtW_Hnj7|E?M%GOq=-hMesJUe7d+@L{BwV-^l&O#1-U*Q-~B%9iQQ ze?>muQQFDiweQzYz^f+KzuqwU9vt+qh@S!{UGo0Z4HE=EKi~xL zA8(krYuW3aT_VpsB|t#YbTPN{l1T6qo7We+pL;IndderYCQX_(M&RHxa+Ap13<>cg zZEmH(W=4~}sWeZD76=KVyoyCBFGcB7>*;8zJ34J(|Jvz^Npr}v;IG@(H){KL50DGu zz`vg)#ry~KQa$c0aZ%ae7Fi*=sFzBwN|;-XBa!D1&Ni{ubDvj9qN1)MerMexu8Y(W zY4%>5*_@I!ZN^+3{I>8i@+c#7tm_Gx1rRz0&MnZX0||tZcPMr=QJ`8}!17 z3Ij)Fs?>z+DeVVXhCT}wnbbr#qeb9vHj1Bp@8j*e&HZt2+`fOXmE#tJpP#p+5u?%m z+^apyk?vjIhK(&_&ndjQu2>zrg)GP$~Xf#$ib z=sl6ok2SQO6sd7QAHy_Lr5{9*4&_>Eakh6akb7qps*!aw-;-m@Ba=Hb^5FUGUDg05 zd5xs{&LI6^YjQGajt9QDyzvDo)W)9uRm$|~U71Hydp$F{jjGD;So2us6&W;H+#KpJ zL)$$1nF15FPxC{ z*4rrTQG%(VXv-;l$)S(soeozrrIm8*WY3L6o#U!52#aJ`puL7ClixQvwvGRC2j4J! zU=YnuWvs-0WvW0X;~~Y!@LigZP-V%h*X2&-9as$!cubG=2qH2Z9R#v{3uGr_1z2cV z$ft!G=ipgN{qxhqb^-F=R;LWqOYCyBgHIdC>Q1AhV04r88@2zB{DZI zr{7c}9Bx~7?Z4*MPbP#gSJ_7!5=T!O&${`(PyYpFsaH?$tFk?v(&F1$d>=mCawEeN zG>CI~!JIm$CP1qh(T8_2zC(`gjy#N83*Sn3+E7UDRN+Cz5}M%fK(nI_bR^BAV&bsN z@6Mw;nJ!tCNQR+{3-m49ZZEqJCwOO@8Z4Y6w(t)R?h;jEKE=&V&L()dt>Js_c{kNS zRq*1J3y-@9MRZ!`okN<_^;flL2xjAN3Sk&EzCBlR&T@bV5mYf|LS{mDU5;5Is(NDs zYg=a4^CL!jn7?I~6U33zWJl`i)^j5M3DMvWa)aw61UmzZo(;1%OAbiPv}j3;iDQaC zuh%ok(!b!#*rUNlI$j+?>ZuY0wwlzYdLs|7nOSU#`Ci}jJV^fXALT6A{?rHmly{pk3wy!Zy++NZiLWMJm0J|)o<5`Wg*SzXmI#C z%gnrRp}tlvx&VKx%k^5`zJ)wg|2nKjq?5|_GK~G%qOE!q;#~ff135qR&S_~5Lm|^S zkDwj)`*Rm=Y|}~14oaxL_L94=rO}&%IFU#EA^ zWK<0OphPMtBes>nk$JvC2T2jBT!856bjY0;4yqWPS;oADb2W7muR-2;N^K#NWwPvJ zf_X_uLa_4r!QfN6vo|w5Ius_*_+DItMLQm~7*VdiT?s1eX#U(MnIedADWnwTzFVy$ zTT}Ek=}ni*Q+ar&_J8GR`M#oW&1A*aNLIbyd>Puexl}c;wUw8^g=+q7g5G#9cl~9~eGym1I7o zfLVe(G5szLUL<3%zT24w@2XP!INC*es(KiY-CKWZR^^@^Y3c^Kh`4c-5y&X6rZk*}6(dv}BS|f@GIWt{5A{Jw^(nnqq@5s@1kKdufUF9hs z$uiA3V$#^Q@Q_ZXPX}3Wy**~VChwQ{+mounxhru;n?`HWDp!1HXU18)t-bELc!mk4 zcc(wOXz%mI$ZJ$%X5!9%1RMuPPd@Gx8Y#i~5axLmDN&|4HXkWcob$LB_(Q^N)TBxo z&B=LS!=DA8i+DUU9CspG8R>hYS9vsb)K|Cb)wjEKkm;;E5${0X*4>w2J(p!M5zKub zq9^Wow)SH>Lss|#eay@~>b9`_hZD}ThkXVq!8SS{$uzPhwEZ+NmhH9il%gLfa6Hj8 z^N7-P6(+W8r8t*lU;w{dTRuJP#3oW}b##h~G=pbT+C;tDk+R-O`y5l`1v7`~q`Nos zT9a>llF(a!BbbUSpkVFYzfn~a)97ec?Yuv+EnAdEUvWX+QNevKLE(mCFrl;k2s?L( z`ncRd=p*Co4^7q7(It1Yqzey?m{k+0!5ui8ZfLeJu-i3kxX{sEy7-QBzIFK;^j;9-(#v zh(Md{z$R|au>3+Q=<$4%uVB$2+(s}&!B6=K#+jCz0eJT*OG$Xkfl zChKYV{J1Cr4F`qL2eSHd?&U|^#E}Sq9S{?_cY4!>+_L8F!?2KJt>TWk6f!)>ZDf2^ zE;nNKU1=oE*uaI!Mau!UHB-Nw@C@67)0uHEEsI!2`7517h{K_8k?ZZjbVW(=7;z-~ zQCp;nF6_2v3Keg#6x7ma?9g_Tx8b!7(d;9qYu}9cK1iG`A(%zD)wN04EK}QQOKIk7UCdV2;L}7e)v>!PTP6II zAo+@OIf+i%n>BO^CAN0LY0JG24&OfIP+!K5ZxT*Q+p<;Xy`^3fnb;-COB#VG^H?hS zF%}lvkjoN1^~5=)HUGqP)uJbQxty^i{u(LT>K%N%lIo1ja+b8@$*u=s3WVx2-ev0e zsn0}m(F}S-Zei&OTBYD3xR_NK(@nIwC`b~h?_4(TQ>2=Of5r8$j-VX(ekoC zFROD{0KKWhGB=b9ymyHukDRhPN`UB<}Tbr zvR2_HronqDuD(j;W?kHk@tks!?RMV^95)>6>1}+iDy8cfTT6LgCH~Egp^lvnxmV;o zy<~J}OSr~|A8MO7lRht?lI$wW;9yd&vB%~O{905sz@1L0f^D^dkA@q*c?V{1%sTtJ z%px3e?g%@!o~cf4x~W}+vzJ^fuC?zXN1!DKL!_>HXZ7HCmICcAo?p0BBkd>5?EK;e zzn)OULa#37h#nc>D&|!#{#_)EO*HSNn zlYG8??f$oPV#G^?i~EeL;VVttMTj~Kp|p=9zB0v5_g%xE@Wxrmx^^z_+I&-qa_4nz~OSI zTAGrcCEX6Yu-z5ye!4vC-X`R8Y{y35rJ4y20S{5QvfJ1zOHzpLJl=EZSD&|ZQm@v) z!ihLPH&Z~#Dv{bwQ#VGZNSGB4&L(QkxK=N6Tba^-#bhmxAMJE`Uz{a?US41M9zP

    K75OA}9dN52TwZ4DErjd?^x+;{v+XKcikghe_ef|bhr}x>5vK#S<>}(O& zXI!6K^KSPq#}-Rgy9+P2Iq)Xe6ADp(d}KcQnA(yNqV^$bN5*w>Sr?u}CVYD|Ty1-i zXm_BXeUYf2-ZYapYvinP_I(O=nijVJUQw3t{NX77xfqXmf;utv=fz~7JVug`%!rza zP%m!+gz}r`Z`K00Fk0%%c`{foi+sK2g2r+tMXzXZw!$Mn?PCkm$LPiZ|2Lm;G(3rA z?dgYib_35_Ru151G~=B;-QV+6ELEDBxk0flzTv!^GZWpkuacy97-vC75Mq%mDNXrP zkc_-GG``F1!J2Acf5&)_k+kLJd67L=NuH0ANrg7I&y;~)x#)OL z&gGe%DD!T8BtbAVD1pwTnysezrP0CCW@4#fZY6Kb?JxXkH7d^SX(}FeEuy?#H|Eg& z>JoIS2TR_+*tn{rlQ%KD2?zu4LS$n~P0p6L3Q3MQV{kN7^_ z7EME-b($Bi%O`dx3auDNFVH$Kaj+=+G3RjHyeesMoq;EOcx!3(sMKgjS|#0w*10fJ z)Gfn!VGVY6XK6Lp+T@|vj=^$9jEH#OeH>U6UJx3$Ob9U!<^{xg8ksVEnQIT3Lx?vs ziDl+l!cGactJ|RoW2;Tjk2Tlb{;UxDcwywS-DjXFWI#t zt@M_7L?YezlCL!&J67d%s(JQ^r|$}Swvu8_zoFP)a$JJHh>1shAWdHlwISrW|;;EMab(8l`S zW^yvLtniiCF>$w*6SIOgHyJQ%xmfhHq zIBKwJ_o#f(vn>$Xr;~hoH(TKn>B>yjx5m}Nd6$N%4vKlV{`9fkK9?1lLo5w~g83uG zOp*{WzQcI(BJqr&3CX)_H{%}_A<&sNdFF+UzS?gyrfP_!4ka}rXr=GbZl>70^tvQk z*lroNRRBlFeOWHHLwG&uAadj#-MXO)?i(DFb()&b2UF82s$rz@5i@}mqO=rjizOA$ z$FfHppwE{kwdkU+uw!~w8Ps0QZWovh%^^yUgo;hk4%Fc2o*eyEH z+fiQ|qp;1MpG!;P>bp6Wn1x?39Hk&Uz~#uxkyL%5rj)SUhI&G4wu8gcg@oHzH6<wG<(K+2F(-Eku{ld-SY|SS#mea%HK7u)hbKD(jwfBw)0r(`Zmq^y(CrR9$>CdOdoQMi^vW%p@mTr9bkTa^bOt^JG zCVp|G^s$+z=&p2_T3L$-u@iof9^cSnu=s;@@%9aVuYun9)hT{No5@UCkKR;|6c;f= zroNF+$>!{qbMm;g^=pL&oIbOdz@0^6`rKlO9u9)N#x78%cab_r=k-(dcOtj?ir7T9 zdFvR&uiS188Q<2iAkpTG|3c+*+wV|iE#D@~L|K(O^u2!)d%f~?rnnVv$wj{zeAc%L zgvxZO**$)PGT}RHFAlWy<#(zu7S0&;+!-+sW33KFbJq+{4w}ZZOvZZzH=G$2gyAGD zui6#I*x-aNab2|-_WDe1bg#DCY^FTL+(=roa{5a6osfNPrfjc)AxQ#fmCJmrhdOhV zqmczK6YMTcW;>3e<(5u2N#(W>kEqgFG*BEarNv695SSjSHO^thIGv>nWi8GhA#9%Z zG&vYDwqhn454!0;n3`v-!Xc9tU&m)VmfonAa9(k$K2DLBuo z$1E2b%iJ*5Ok`hM*-O}l{n_Hw{+%`M_O+B=%8;^G_iLZ_1O?q9jU*Kq?6nfGfmZ4p z3>H)(Q^k2CH1j)y#;JnkPk+1ve;mSjM_N7n$tpEbs8kPdeP6A4ND_?=Tla2*y!{TR zUqnFs^cL_Va%hd)Qq31@y>9|XQ)HR^FNaMTpB8wHWGhiu7(B|ODx+X?w4;=N!Cow3 zgO{5A&{M$5vGiW5%YkKZ3M-Yy72`WzfRkPKNOq6i6fGCijcREde~WJ+k>|`OkiuQj z`8lwmhD&BaB-gLP2Nrhs0s@O}l9waHCqJP1MK`3B`b6p`hKR1^2=FXC;ZuY0liQ%#2@@qd03a`GtuuP;J= zKeQ+0`yRVS0XWWAuyu8F2fuoN01uadU)Q3_FhSsJ3SClfFZ3sAOEZ{TP5eC43 z^@PVA|0xH7Q5^szfbcWkPT$;P6l8V8ij0ehwdi0m~qN zj@!T-#RIT|05CMvJb_BE0X4)QWe_I5~W<0o4iY_%8`H zh2vo!=O>5wZ)HOGk6|7I3IH;O3x4N;5CWJAkc3a_1Y8*MQxZ^siGo1I&jcb9LO|fc zfCPX>Bn&_Vw8Mk|B?9UNfZ$X@2qa46AVF|?C{08u2Z#tn0OSZLAmbk+1L8ydSPnnr z3o__<2p|w43gVbmD0zTF1kixv03pC0V7w`?{Iea<8c=gk7(mSi8$cu|Y+#RLp@8|Z z9v$}va}WlV0BNEm`LhCO0EKZ9_@Bx^h=pzPKU;|C)9 zsd(T6*b_B&5F;=LK_p-uf2i+w+Y9I}sIDLuFh>D_69=A;nQ>eO83dM5i~(}OpPhiQ zqB{O)1Sz9{07NLHzygB7fVBZGBq0CAa2*d5%#Rz6JO7@8$WEreH(bX<1gCK_f%PX7 z(Dt{6OA!8j{zAZK0x+RC3eFETN5CL_XEDH1&^rCsrb_^zCjf{ZG+ie-^xbrUI`Ute zE`an;F@sb5Zo7^rdvd7%v+V+r{KWn9r3$DKN|iuCpGe2b3g$l*5+z7Ln8)gKJe+^Z z|J`=|gYS~x4H)QW<)oL6lM#mh3j+o?>iGY{fWd*4bS(1YeHRS+eF>v96_6xCNbvuD z-*qf75Xo@@2?_&*36EcAKUL(%>+M+jU}tctg6-g{14nog_PYTDI-#Zj0Dv7qq$ohJ z{>M^1-W7p4{D)xyk^kH}f>b~xU=HfsF;BoUn2zgDt~n6q`@ZXkHXnC99x|AN2}KnE zh5yHF+=#RG6@fO7}(2dz|<_n5r6p#Fiz1xp7{OLtpyQo$B#Gfl#uxR#uikTvKyP;6pQnpO4oGh<^$Z=5um(ax`_d2R6;F zmhK*|P7tWT-_*g7e9{)SKz}z|H^M6?Y5w_g`6rsr?iQ9-5F|hyRpLX1Rs~7^sDQwP ze-@!9i2@(|VBevCCI5%$)J&~`u)Jzu2v>Iqu-;HApke9e?BNPd{kwkg$pU+R0Kg6M z-J=x{{?{D{K?~slKDVEk9I(6jT{Hd#J@j|{!29U?2>zbHpWOQw0>G;Wh41GCpx_Dt zwEXX90Gtr~k23&_=dT0+d+<*LPI>_QzCizN2H&rE{v`s~51##p8T`3y{*Ay7j{Ia1 z?1v%vdjcpO`E}KR1l$PuF4|fEYX!v*Kt(|=0OvZW48>Lr2n;1$z+8frfFYCxf=B~_ zoC*0Y=Cak9>A$H&1aSHn zI5-@E1cdo(ogh*eVDGPWLQsA{u)o$J1;F+8OC1zAo&i?bFLl7X8`vlPTE~wN1l8tO zIHWM}cK@}GA0Y%T@?YTikwQX$_JxDm_zN5y`8PC#`GJF|U*Y(H>HaYfC=@uP`V|f? z3zt%yaFyY_nLIs52zteyV!+_6@zx5SB3jRSC0TudPmT+MKVCVB&Ujz*K2VEgy z;otj0kx<}3_P4%B0sh~|2Sp;`zr(?V1weBL{{7THn6MDAL;JN3h{P@QJ3eq~f655) zhrYm(LV(8qiVrR5{iid2j;fEKn#1}NL<6&*&R4l0L>2& z(%s3*8Q7!$c#wk_ioswOP<~+f@bg<)@x$O|7UpnEb0H|qN*FF|W)2gU_;(1D(Q + + BACKGROUND + + The IASIO interface declared in the Steinberg ASIO 2 SDK declares + functions with no explicit calling convention. This causes MSVC++ to default + to using the thiscall convention, which is a proprietary convention not + implemented by some non-microsoft compilers - notably borland BCC, + C++Builder, and gcc. MSVC++ is the defacto standard compiler used by + Steinberg. As a result of this situation, the ASIO sdk will compile with + any compiler, however attempting to execute the compiled code will cause a + crash due to different default calling conventions on non-Microsoft + compilers. + + IASIOThiscallResolver solves the problem by providing an adapter class that + delegates to the IASIO interface using the correct calling convention + (thiscall). Due to the lack of support for thiscall in the Borland and GCC + compilers, the calls have been implemented in assembly language. + + A number of macros are defined for thiscall function calls with different + numbers of parameters, with and without return values - it may be possible + to modify the format of these macros to make them work with other inline + assemblers. + + + THISCALL DEFINITION + + A number of definitions of the thiscall calling convention are floating + around the internet. The following definition has been validated against + output from the MSVC++ compiler: + + For non-vararg functions, thiscall works as follows: the object (this) + pointer is passed in ECX. All arguments are passed on the stack in + right to left order. The return value is placed in EAX. The callee + clears the passed arguments from the stack. + + + FINDING FUNCTION POINTERS FROM AN IASIO POINTER + + The first field of a COM object is a pointer to its vtble. Thus a pointer + to an object implementing the IASIO interface also points to a pointer to + that object's vtbl. The vtble is a table of function pointers for all of + the virtual functions exposed by the implemented interfaces. + + If we consider a variable declared as a pointer to IASO: + + IASIO *theAsioDriver + + theAsioDriver points to: + + object implementing IASIO + { + IASIOvtbl *vtbl + other data + } + + in other words, theAsioDriver points to a pointer to an IASIOvtbl + + vtbl points to a table of function pointers: + + IASIOvtbl ( interface IASIO : public IUnknown ) + { + (IUnknown functions) + 0 virtual HRESULT STDMETHODCALLTYPE (*QueryInterface)(REFIID riid, void **ppv) = 0; + 4 virtual ULONG STDMETHODCALLTYPE (*AddRef)() = 0; + 8 virtual ULONG STDMETHODCALLTYPE (*Release)() = 0; + + (IASIO functions) + 12 virtual ASIOBool (*init)(void *sysHandle) = 0; + 16 virtual void (*getDriverName)(char *name) = 0; + 20 virtual long (*getDriverVersion)() = 0; + 24 virtual void (*getErrorMessage)(char *string) = 0; + 28 virtual ASIOError (*start)() = 0; + 32 virtual ASIOError (*stop)() = 0; + 36 virtual ASIOError (*getChannels)(long *numInputChannels, long *numOutputChannels) = 0; + 40 virtual ASIOError (*getLatencies)(long *inputLatency, long *outputLatency) = 0; + 44 virtual ASIOError (*getBufferSize)(long *minSize, long *maxSize, + long *preferredSize, long *granularity) = 0; + 48 virtual ASIOError (*canSampleRate)(ASIOSampleRate sampleRate) = 0; + 52 virtual ASIOError (*getSampleRate)(ASIOSampleRate *sampleRate) = 0; + 56 virtual ASIOError (*setSampleRate)(ASIOSampleRate sampleRate) = 0; + 60 virtual ASIOError (*getClockSources)(ASIOClockSource *clocks, long *numSources) = 0; + 64 virtual ASIOError (*setClockSource)(long reference) = 0; + 68 virtual ASIOError (*getSamplePosition)(ASIOSamples *sPos, ASIOTimeStamp *tStamp) = 0; + 72 virtual ASIOError (*getChannelInfo)(ASIOChannelInfo *info) = 0; + 76 virtual ASIOError (*createBuffers)(ASIOBufferInfo *bufferInfos, long numChannels, + long bufferSize, ASIOCallbacks *callbacks) = 0; + 80 virtual ASIOError (*disposeBuffers)() = 0; + 84 virtual ASIOError (*controlPanel)() = 0; + 88 virtual ASIOError (*future)(long selector,void *opt) = 0; + 92 virtual ASIOError (*outputReady)() = 0; + }; + + The numbers in the left column show the byte offset of each function ptr + from the beginning of the vtbl. These numbers are used in the code below + to select different functions. + + In order to find the address of a particular function, theAsioDriver + must first be dereferenced to find the value of the vtbl pointer: + + mov eax, theAsioDriver + mov edx, [theAsioDriver] // edx now points to vtbl[0] + + Then an offset must be added to the vtbl pointer to select a + particular function, for example vtbl+44 points to the slot containing + a pointer to the getBufferSize function. + + Finally vtbl+x must be dereferenced to obtain the value of the function + pointer stored in that address: + + call [edx+44] // call the function pointed to by + // the value in the getBufferSize field of the vtbl + + + SEE ALSO + + Martin Fay's OpenASIO DLL at http://www.martinfay.com solves the same + problem by providing a new COM interface which wraps IASIO with an + interface that uses portable calling conventions. OpenASIO must be compiled + with MSVC, and requires that you ship the OpenASIO DLL with your + application. + + + ACKNOWLEDGEMENTS + + Ross Bencina: worked out the thiscall details above, wrote the original + Borland asm macros, and a patch for asio.cpp (which is no longer needed). + Thanks to Martin Fay for introducing me to the issues discussed here, + and to Rene G. Ceballos for assisting with asm dumps from MSVC++. + + Antti Silvast: converted the original calliasio to work with gcc and NASM + by implementing the asm code in a separate file. + + Fraser Adams: modified the original calliasio containing the Borland inline + asm to add inline asm for gcc i.e. Intel syntax for Borland and AT&T syntax + for gcc. This seems a neater approach for gcc than to have a separate .asm + file and it means that we only need one version of the thiscall patch. + + Fraser Adams: rewrote the original calliasio patch in the form of the + IASIOThiscallResolver class in order to avoid modifications to files from + the Steinberg SDK, which may have had potential licence issues. + + Andrew Baldwin: contributed fixes for compatibility problems with more + recent versions of the gcc assembler. +*/ + + +// We only need IASIOThiscallResolver at all if we are on Win32. For other +// platforms we simply bypass the IASIOThiscallResolver definition to allow us +// to be safely #include'd whatever the platform to keep client code portable +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) + + +// If microsoft compiler we can call IASIO directly so IASIOThiscallResolver +// is not used. +#if !defined(_MSC_VER) + + +#include +#include + +// We have a mechanism in iasiothiscallresolver.h to ensure that asio.h is +// #include'd before it in client code, we do NOT want to do this test here. +#define iasiothiscallresolver_sourcefile 1 +#include "iasiothiscallresolver.h" +#undef iasiothiscallresolver_sourcefile + +// iasiothiscallresolver.h redefines ASIOInit for clients, but we don't want +// this macro defined in this translation unit. +#undef ASIOInit + + +// theAsioDriver is a global pointer to the current IASIO instance which the +// ASIO SDK uses to perform all actions on the IASIO interface. We substitute +// our own forwarding interface into this pointer. +extern IASIO* theAsioDriver; + + +// The following macros define the inline assembler for BORLAND first then gcc + +#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) + + +#define CALL_THISCALL_0( resultName, thisPtr, funcOffset )\ + void *this_ = (thisPtr); \ + __asm { \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 )\ + void *this_ = (thisPtr); \ + __asm { \ + mov eax, param1 ; \ + push eax ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + } + + +#define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 )\ + void *this_ = (thisPtr); \ + __asm { \ + mov eax, param1 ; \ + push eax ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 )\ + void *this_ = (thisPtr); \ + void *doubleParamPtr_ (¶m1); \ + __asm { \ + mov eax, doubleParamPtr_ ; \ + push [eax+4] ; \ + push [eax] ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 )\ + void *this_ = (thisPtr); \ + __asm { \ + mov eax, param2 ; \ + push eax ; \ + mov eax, param1 ; \ + push eax ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\ + void *this_ = (thisPtr); \ + __asm { \ + mov eax, param4 ; \ + push eax ; \ + mov eax, param3 ; \ + push eax ; \ + mov eax, param2 ; \ + push eax ; \ + mov eax, param1 ; \ + push eax ; \ + mov ecx, this_ ; \ + mov eax, [ecx] ; \ + call [eax+funcOffset] ; \ + mov resultName, eax ; \ + } + + +#elif defined(__GNUC__) + + +#define CALL_THISCALL_0( resultName, thisPtr, funcOffset ) \ + __asm__ __volatile__ ("movl (%1), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"c"(thisPtr) /* Input Operands */ \ + ); \ + + +#define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 ) \ + __asm__ __volatile__ ("pushl %0\n\t" \ + "movl (%1), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + : /* Output Operands */ \ + :"r"(param1), /* Input Operands */ \ + "c"(thisPtr) \ + ); \ + + +#define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 ) \ + __asm__ __volatile__ ("pushl %1\n\t" \ + "movl (%2), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"r"(param1), /* Input Operands */ \ + "c"(thisPtr) \ + ); \ + + +#define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 ) \ + __asm__ __volatile__ ("pushl 4(%1)\n\t" \ + "pushl (%1)\n\t" \ + "movl (%2), %%edx\n\t" \ + "call *"#funcOffset"(%%edx);\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"a"(¶m1), /* Input Operands */ \ + /* Note: Using "r" above instead of "a" fails */ \ + /* when using GCC 3.3.3, and maybe later versions*/\ + "c"(thisPtr) \ + ); \ + + +#define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 ) \ + __asm__ __volatile__ ("pushl %1\n\t" \ + "pushl %2\n\t" \ + "movl (%3), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"r"(param2), /* Input Operands */ \ + "r"(param1), \ + "c"(thisPtr) \ + ); \ + + +#define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\ + __asm__ __volatile__ ("pushl %1\n\t" \ + "pushl %2\n\t" \ + "pushl %3\n\t" \ + "pushl %4\n\t" \ + "movl (%5), %%edx\n\t" \ + "call *"#funcOffset"(%%edx)\n\t" \ + :"=a"(resultName) /* Output Operands */ \ + :"r"(param4), /* Input Operands */ \ + "r"(param3), \ + "r"(param2), \ + "r"(param1), \ + "c"(thisPtr) \ + ); \ + +#endif + + + +// Our static singleton instance. +IASIOThiscallResolver IASIOThiscallResolver::instance; + +// Constructor called to initialize static Singleton instance above. Note that +// it is important not to clear that_ incase it has already been set by the call +// to placement new in ASIOInit(). +IASIOThiscallResolver::IASIOThiscallResolver() +{ +} + +// Constructor called from ASIOInit() below +IASIOThiscallResolver::IASIOThiscallResolver(IASIO* that) +: that_( that ) +{ +} + +// Implement IUnknown methods as assert(false). IASIOThiscallResolver is not +// really a COM object, just a wrapper which will work with the ASIO SDK. +// If you wanted to use ASIO without the SDK you might want to implement COM +// aggregation in these methods. +HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface(REFIID riid, void **ppv) +{ + (void)riid; // suppress unused variable warning + + assert( false ); // this function should never be called by the ASIO SDK. + + *ppv = NULL; + return E_NOINTERFACE; +} + +ULONG STDMETHODCALLTYPE IASIOThiscallResolver::AddRef() +{ + assert( false ); // this function should never be called by the ASIO SDK. + + return 1; +} + +ULONG STDMETHODCALLTYPE IASIOThiscallResolver::Release() +{ + assert( false ); // this function should never be called by the ASIO SDK. + + return 1; +} + + +// Implement the IASIO interface methods by performing the vptr manipulation +// described above then delegating to the real implementation. +ASIOBool IASIOThiscallResolver::init(void *sysHandle) +{ + ASIOBool result; + CALL_THISCALL_1( result, that_, 12, sysHandle ); + return result; +} + +void IASIOThiscallResolver::getDriverName(char *name) +{ + CALL_VOID_THISCALL_1( that_, 16, name ); +} + +long IASIOThiscallResolver::getDriverVersion() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 20 ); + return result; +} + +void IASIOThiscallResolver::getErrorMessage(char *string) +{ + CALL_VOID_THISCALL_1( that_, 24, string ); +} + +ASIOError IASIOThiscallResolver::start() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 28 ); + return result; +} + +ASIOError IASIOThiscallResolver::stop() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 32 ); + return result; +} + +ASIOError IASIOThiscallResolver::getChannels(long *numInputChannels, long *numOutputChannels) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 36, numInputChannels, numOutputChannels ); + return result; +} + +ASIOError IASIOThiscallResolver::getLatencies(long *inputLatency, long *outputLatency) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 40, inputLatency, outputLatency ); + return result; +} + +ASIOError IASIOThiscallResolver::getBufferSize(long *minSize, long *maxSize, + long *preferredSize, long *granularity) +{ + ASIOBool result; + CALL_THISCALL_4( result, that_, 44, minSize, maxSize, preferredSize, granularity ); + return result; +} + +ASIOError IASIOThiscallResolver::canSampleRate(ASIOSampleRate sampleRate) +{ + ASIOBool result; + CALL_THISCALL_1_DOUBLE( result, that_, 48, sampleRate ); + return result; +} + +ASIOError IASIOThiscallResolver::getSampleRate(ASIOSampleRate *sampleRate) +{ + ASIOBool result; + CALL_THISCALL_1( result, that_, 52, sampleRate ); + return result; +} + +ASIOError IASIOThiscallResolver::setSampleRate(ASIOSampleRate sampleRate) +{ + ASIOBool result; + CALL_THISCALL_1_DOUBLE( result, that_, 56, sampleRate ); + return result; +} + +ASIOError IASIOThiscallResolver::getClockSources(ASIOClockSource *clocks, long *numSources) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 60, clocks, numSources ); + return result; +} + +ASIOError IASIOThiscallResolver::setClockSource(long reference) +{ + ASIOBool result; + CALL_THISCALL_1( result, that_, 64, reference ); + return result; +} + +ASIOError IASIOThiscallResolver::getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 68, sPos, tStamp ); + return result; +} + +ASIOError IASIOThiscallResolver::getChannelInfo(ASIOChannelInfo *info) +{ + ASIOBool result; + CALL_THISCALL_1( result, that_, 72, info ); + return result; +} + +ASIOError IASIOThiscallResolver::createBuffers(ASIOBufferInfo *bufferInfos, + long numChannels, long bufferSize, ASIOCallbacks *callbacks) +{ + ASIOBool result; + CALL_THISCALL_4( result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks ); + return result; +} + +ASIOError IASIOThiscallResolver::disposeBuffers() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 80 ); + return result; +} + +ASIOError IASIOThiscallResolver::controlPanel() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 84 ); + return result; +} + +ASIOError IASIOThiscallResolver::future(long selector,void *opt) +{ + ASIOBool result; + CALL_THISCALL_2( result, that_, 88, selector, opt ); + return result; +} + +ASIOError IASIOThiscallResolver::outputReady() +{ + ASIOBool result; + CALL_THISCALL_0( result, that_, 92 ); + return result; +} + + +// Implement our substitute ASIOInit() method +ASIOError IASIOThiscallResolver::ASIOInit(ASIODriverInfo *info) +{ + // To ensure that our instance's vptr is correctly constructed, even if + // ASIOInit is called prior to main(), we explicitly call its constructor + // (potentially over the top of an existing instance). Note that this is + // pretty ugly, and is only safe because IASIOThiscallResolver has no + // destructor and contains no objects with destructors. + new((void*)&instance) IASIOThiscallResolver( theAsioDriver ); + + // Interpose between ASIO client code and the real driver. + theAsioDriver = &instance; + + // Note that we never need to switch theAsioDriver back to point to the + // real driver because theAsioDriver is reset to zero in ASIOExit(). + + // Delegate to the real ASIOInit + return ::ASIOInit(info); +} + + +#endif /* !defined(_MSC_VER) */ + +#endif /* Win32 */ + diff --git a/portaudio-v19/src/hostapi/asio/iasiothiscallresolver.h b/portaudio-v19/src/hostapi/asio/iasiothiscallresolver.h new file mode 100644 index 000000000..2ecfed799 --- /dev/null +++ b/portaudio-v19/src/hostapi/asio/iasiothiscallresolver.h @@ -0,0 +1,197 @@ +// **************************************************************************** +// File: IASIOThiscallResolver.h +// Description: The IASIOThiscallResolver class implements the IASIO +// interface and acts as a proxy to the real IASIO interface by +// calling through its vptr table using the thiscall calling +// convention. To put it another way, we interpose +// IASIOThiscallResolver between ASIO SDK code and the driver. +// This is necessary because most non-Microsoft compilers don't +// implement the thiscall calling convention used by IASIO. +// +// iasiothiscallresolver.cpp contains the background of this +// problem plus a technical description of the vptr +// manipulations. +// +// In order to use this mechanism one simply has to add +// iasiothiscallresolver.cpp to the list of files to compile +// and #include +// +// Note that this #include must come after the other ASIO SDK +// #includes, for example: +// +// #include +// #include +// #include +// #include +// #include +// +// Actually the important thing is to #include +// after . We have +// incorporated a test to enforce this ordering. +// +// The code transparently takes care of the interposition by +// using macro substitution to intercept calls to ASIOInit() +// and ASIOExit(). We save the original ASIO global +// "theAsioDriver" in our "that" variable, and then set +// "theAsioDriver" to equal our IASIOThiscallResolver instance. +// +// Whilst this method of resolving the thiscall problem requires +// the addition of #include to client +// code it has the advantage that it does not break the terms +// of the ASIO licence by publishing it. We are NOT modifying +// any Steinberg code here, we are merely implementing the IASIO +// interface in the same way that we would need to do if we +// wished to provide an open source ASIO driver. +// +// For compilation with MinGW -lole32 needs to be added to the +// linker options. For BORLAND, linking with Import32.lib is +// sufficient. +// +// The dependencies are with: CoInitialize, CoUninitialize, +// CoCreateInstance, CLSIDFromString - used by asiolist.cpp +// and are required on Windows whether ThiscallResolver is used +// or not. +// +// Searching for the above strings in the root library path +// of your compiler should enable the correct libraries to be +// identified if they aren't immediately obvious. +// +// Note that the current implementation of IASIOThiscallResolver +// is not COM compliant - it does not correctly implement the +// IUnknown interface. Implementing it is not necessary because +// it is not called by parts of the ASIO SDK which call through +// theAsioDriver ptr. The IUnknown methods are implemented as +// assert(false) to ensure that the code fails if they are +// ever called. +// Restrictions: None. Public Domain & Open Source distribute freely +// You may use IASIOThiscallResolver commercially as well as +// privately. +// You the user assume the responsibility for the use of the +// files, binary or text, and there is no guarantee or warranty, +// expressed or implied, including but not limited to the +// implied warranties of merchantability and fitness for a +// particular purpose. You assume all responsibility and agree +// to hold no entity, copyright holder or distributors liable +// for any loss of data or inaccurate representations of data +// as a result of using IASIOThiscallResolver. +// Version: 1.4 Added separate macro CALL_THISCALL_1_DOUBLE from +// Andrew Baldwin, and volatile for whole gcc asm blocks, +// both for compatibility with newer gcc versions. Cleaned up +// Borland asm to use one less register. +// 1.3 Switched to including assert.h for better compatibility. +// Wrapped entire .h and .cpp contents with a check for +// _MSC_VER to provide better compatibility with MS compilers. +// Changed Singleton implementation to use static instance +// instead of freestore allocated instance. Removed ASIOExit +// macro as it is no longer needed. +// 1.2 Removed semicolons from ASIOInit and ASIOExit macros to +// allow them to be embedded in expressions (if statements). +// Cleaned up some comments. Removed combase.c dependency (it +// doesn't compile with BCB anyway) by stubbing IUnknown. +// 1.1 Incorporated comments from Ross Bencina including things +// such as changing name from ThiscallResolver to +// IASIOThiscallResolver, tidying up the constructor, fixing +// a bug in IASIOThiscallResolver::ASIOExit() and improving +// portability through the use of conditional compilation +// 1.0 Initial working version. +// Created: 6/09/2003 +// Authors: Fraser Adams +// Ross Bencina +// Rene G. Ceballos +// Martin Fay +// Antti Silvast +// Andrew Baldwin +// +// **************************************************************************** + + +#ifndef included_iasiothiscallresolver_h +#define included_iasiothiscallresolver_h + +// We only need IASIOThiscallResolver at all if we are on Win32. For other +// platforms we simply bypass the IASIOThiscallResolver definition to allow us +// to be safely #include'd whatever the platform to keep client code portable +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) + + +// If microsoft compiler we can call IASIO directly so IASIOThiscallResolver +// is not used. +#if !defined(_MSC_VER) + + +// The following is in order to ensure that this header is only included after +// the other ASIO headers (except for the case of iasiothiscallresolver.cpp). +// We need to do this because IASIOThiscallResolver works by eclipsing the +// original definition of ASIOInit() with a macro (see below). +#if !defined(iasiothiscallresolver_sourcefile) + #if !defined(__ASIO_H) + #error iasiothiscallresolver.h must be included AFTER asio.h + #endif +#endif + +#include +#include /* From ASIO SDK */ + + +class IASIOThiscallResolver : public IASIO { +private: + IASIO* that_; // Points to the real IASIO + + static IASIOThiscallResolver instance; // Singleton instance + + // Constructors - declared private so construction is limited to + // our Singleton instance + IASIOThiscallResolver(); + IASIOThiscallResolver(IASIO* that); +public: + + // Methods from the IUnknown interface. We don't fully implement IUnknown + // because the ASIO SDK never calls these methods through theAsioDriver ptr. + // These methods are implemented as assert(false). + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv); + virtual ULONG STDMETHODCALLTYPE AddRef(); + virtual ULONG STDMETHODCALLTYPE Release(); + + // Methods from the IASIO interface, implemented as forwarning calls to that. + virtual ASIOBool init(void *sysHandle); + virtual void getDriverName(char *name); + virtual long getDriverVersion(); + virtual void getErrorMessage(char *string); + virtual ASIOError start(); + virtual ASIOError stop(); + virtual ASIOError getChannels(long *numInputChannels, long *numOutputChannels); + virtual ASIOError getLatencies(long *inputLatency, long *outputLatency); + virtual ASIOError getBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity); + virtual ASIOError canSampleRate(ASIOSampleRate sampleRate); + virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate); + virtual ASIOError setSampleRate(ASIOSampleRate sampleRate); + virtual ASIOError getClockSources(ASIOClockSource *clocks, long *numSources); + virtual ASIOError setClockSource(long reference); + virtual ASIOError getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp); + virtual ASIOError getChannelInfo(ASIOChannelInfo *info); + virtual ASIOError createBuffers(ASIOBufferInfo *bufferInfos, long numChannels, long bufferSize, ASIOCallbacks *callbacks); + virtual ASIOError disposeBuffers(); + virtual ASIOError controlPanel(); + virtual ASIOError future(long selector,void *opt); + virtual ASIOError outputReady(); + + // Class method, see ASIOInit() macro below. + static ASIOError ASIOInit(ASIODriverInfo *info); // Delegates to ::ASIOInit +}; + + +// Replace calls to ASIOInit with our interposing version. +// This macro enables us to perform thiscall resolution simply by #including +// after the asio #includes (this file _must_ be +// included _after_ the asio #includes) + +#define ASIOInit(name) IASIOThiscallResolver::ASIOInit((name)) + + +#endif /* !defined(_MSC_VER) */ + +#endif /* Win32 */ + +#endif /* included_iasiothiscallresolver_h */ + + diff --git a/portaudio-v19/src/hostapi/asio/pa_asio.cpp b/portaudio-v19/src/hostapi/asio/pa_asio.cpp new file mode 100644 index 000000000..6d60dcc84 --- /dev/null +++ b/portaudio-v19/src/hostapi/asio/pa_asio.cpp @@ -0,0 +1,2969 @@ +/* + * $Id$ + * Portable Audio I/O Library for ASIO Drivers + * + * Author: Stephane Letz + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 2000-2002 Stephane Letz, Phil Burk, Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/* Modification History + + 08-03-01 First version : Stephane Letz + 08-06-01 Tweaks for PC, use C++, buffer allocation, Float32 to Int32 conversion : Phil Burk + 08-20-01 More conversion, PA_StreamTime, Pa_GetHostError : Stephane Letz + 08-21-01 PaUInt8 bug correction, implementation of ASIOSTFloat32LSB and ASIOSTFloat32MSB native formats : Stephane Letz + 08-24-01 MAX_INT32_FP hack, another Uint8 fix : Stephane and Phil + 08-27-01 Implementation of hostBufferSize < userBufferSize case, better management of the ouput buffer when + the stream is stopped : Stephane Letz + 08-28-01 Check the stream pointer for null in bufferSwitchTimeInfo, correct bug in bufferSwitchTimeInfo when + the stream is stopped : Stephane Letz + 10-12-01 Correct the PaHost_CalcNumHostBuffers function: computes FramesPerHostBuffer to be the lowest that + respect requested FramesPerUserBuffer and userBuffersPerHostBuffer : Stephane Letz + 10-26-01 Management of hostBufferSize and userBufferSize of any size : Stephane Letz + 10-27-01 Improve calculus of hostBufferSize to be multiple or divisor of userBufferSize if possible : Stephane and Phil + 10-29-01 Change MAX_INT32_FP to (2147483520.0f) to prevent roundup to 0x80000000 : Phil Burk + 10-31-01 Clear the ouput buffer and user buffers in PaHost_StartOutput, correct bug in GetFirstMultiple : Stephane Letz + 11-06-01 Rename functions : Stephane Letz + 11-08-01 New Pa_ASIO_Adaptor_Init function to init Callback adpatation variables, cleanup of Pa_ASIO_Callback_Input: Stephane Letz + 11-29-01 Break apart device loading to debug random failure in Pa_ASIO_QueryDeviceInfo ; Phil Burk + 01-03-02 Desallocate all resources in PaHost_Term for cases where Pa_CloseStream is not called properly : Stephane Letz + 02-01-02 Cleanup, test of multiple-stream opening : Stephane Letz + 19-02-02 New Pa_ASIO_loadDriver that calls CoInitialize on each thread on Windows : Stephane Letz + 09-04-02 Correct error code management in PaHost_Term, removes various compiler warning : Stephane Letz + 12-04-02 Add Mac includes for and : Phil Burk + 13-04-02 Removes another compiler warning : Stephane Letz + 30-04-02 Pa_ASIO_QueryDeviceInfo bug correction, memory allocation checking, better error handling : D Viens, P Burk, S Letz + 12-06-02 Rehashed into new multi-api infrastructure, added support for all ASIO sample formats : Ross Bencina + 18-06-02 Added pa_asio.h, PaAsio_GetAvailableLatencyValues() : Ross B. + 21-06-02 Added SelectHostBufferSize() which selects host buffer size based on user latency parameters : Ross Bencina + ** NOTE maintanance history is now stored in CVS ** +*/ + +/** @file + + Note that specific support for paInputUnderflow, paOutputOverflow and + paNeverDropInput is not necessary or possible with this driver due to the + synchronous full duplex double-buffered architecture of ASIO. + + @todo check that CoInitialize()/CoUninitialize() are always correctly + paired, even in error cases. + + @todo implement host api specific extension to set i/o buffer sizes in frames + + @todo implement ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable + + @todo implement IsFormatSupported + + @todo work out how to implement stream stoppage from callback and + implement IsStreamActive properly. Stream stoppage could be implemented + using a high-priority thread blocked on an Event which is signalled + by the callback. Or, we could just call ASIO stop from the callback + and see what happens. + + @todo rigorously check asio return codes and convert to pa error codes + + @todo Different channels of a multichannel stream can have different sample + formats, but we assume that all are the same as the first channel for now. + Fixing this will require the block processor to maintain per-channel + conversion functions - could get nasty. + + @todo investigate whether the asio processNow flag needs to be honoured + + @todo handle asioMessages() callbacks in a useful way, or at least document + what cases we don't handle. + + @todo miscellaneous other FIXMEs + + @todo provide an asio-specific method for setting the systems specific + value (aka main window handle) - check that this matches the value + passed to PaAsio_ShowControlPanel, or remove it entirely from + PaAsio_ShowControlPanel. - this would allow PaAsio_ShowControlPanel + to be called for the currently open stream (at present all streams + must be closed). +*/ + + + +#include +#include +#include +//#include + +#include +#include + +#include "portaudio.h" +#include "pa_asio.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + + +/* This version of pa_asio.cpp is currently only targetted at Win32, + It would require a few tweaks to work with pre-OS X Macintosh. + To make configuration easier, we define WIN32 here to make sure + that the ASIO SDK knows this is Win32. +*/ +#ifndef WIN32 +#define WIN32 +#endif + +#include "asiosys.h" +#include "asio.h" +#include "asiodrivers.h" +#include "iasiothiscallresolver.h" + +/* +#if MAC +#include +#include +#include +#else +*/ +/* +#include +#include +#include +*/ +/* +#endif +*/ + +/* external references */ +extern AsioDrivers* asioDrivers ; +bool loadAsioDriver(char *name); + + +/* We are trying to be compatible with CARBON but this has not been thoroughly tested. */ +/* not tested at all since new code was introduced. */ +#define CARBON_COMPATIBLE (0) + + + + +/* prototypes for functions declared in this file */ + +extern "C" PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ); +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + +/* our ASIO callback functions */ + +static void bufferSwitch(long index, ASIOBool processNow); +static ASIOTime *bufferSwitchTimeInfo(ASIOTime *timeInfo, long index, ASIOBool processNow); +static void sampleRateChanged(ASIOSampleRate sRate); +static long asioMessages(long selector, long value, void* message, double* opt); + +static ASIOCallbacks asioCallbacks_ = + { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo }; + + +#define PA_ASIO_SET_LAST_HOST_ERROR( errorCode, errorText ) \ + PaUtil_SetLastHostErrorInfo( paASIO, errorCode, errorText ) + + +static void PaAsio_SetLastSystemError( DWORD errorCode ) +{ + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + errorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + PaUtil_SetLastHostErrorInfo( paASIO, errorCode, (const char*)lpMsgBuf ); + LocalFree( lpMsgBuf ); +} + +#define PA_ASIO_SET_LAST_SYSTEM_ERROR( errorCode ) \ + PaAsio_SetLastSystemError( errorCode ) + + +static const char* PaAsio_GetAsioErrorText( ASIOError asioError ) +{ + const char *result; + + switch( asioError ){ + case ASE_OK: + case ASE_SUCCESS: result = "Success"; break; + case ASE_NotPresent: result = "Hardware input or output is not present or available"; break; + case ASE_HWMalfunction: result = "Hardware is malfunctioning"; break; + case ASE_InvalidParameter: result = "Input parameter invalid"; break; + case ASE_InvalidMode: result = "Hardware is in a bad mode or used in a bad mode"; break; + case ASE_SPNotAdvancing: result = "Hardware is not running when sample position is inquired"; break; + case ASE_NoClock: result = "Sample clock or rate cannot be determined or is not present"; break; + case ASE_NoMemory: result = "Not enough memory for completing the request"; break; + default: result = "Unknown ASIO error"; break; + } + + return result; +} + + +#define PA_ASIO_SET_LAST_ASIO_ERROR( asioError ) \ + PaUtil_SetLastHostErrorInfo( paASIO, asioError, PaAsio_GetAsioErrorText( asioError ) ) + + + + +// Atomic increment and decrement operations +#if MAC + /* need to be implemented on Mac */ + inline long PaAsio_AtomicIncrement(volatile long* v) {return ++(*const_cast(v));} + inline long PaAsio_AtomicDecrement(volatile long* v) {return --(*const_cast(v));} +#elif WINDOWS + inline long PaAsio_AtomicIncrement(volatile long* v) {return InterlockedIncrement(const_cast(v));} + inline long PaAsio_AtomicDecrement(volatile long* v) {return InterlockedDecrement(const_cast(v));} +#endif + + + +typedef struct PaAsioDriverInfo +{ + ASIODriverInfo asioDriverInfo; + long inputChannelCount, outputChannelCount; + long bufferMinSize, bufferMaxSize, bufferPreferredSize, bufferGranularity; + bool postOutput; +} +PaAsioDriverInfo; + + +/* PaAsioHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + void *systemSpecific; + + /* the ASIO C API only allows one ASIO driver to be open at a time, + so we keep track of whether we have the driver open here, and + use this information to return errors from OpenStream if the + driver is already open. + + openAsioDeviceIndex will be PaNoDevice if there is no device open + and a valid pa_asio (not global) device index otherwise. + + openAsioDriverInfo is populated with the driver info for the + currently open device (if any) + */ + PaDeviceIndex openAsioDeviceIndex; + PaAsioDriverInfo openAsioDriverInfo; +} +PaAsioHostApiRepresentation; + + +/* + Retrieve driver names from ASIO, returned in a char** + allocated in . +*/ +static char **GetAsioDriverNames( PaUtilAllocationGroup *group, long driverCount ) +{ + char **result = 0; + int i; + + result =(char**)PaUtil_GroupAllocateMemory( + group, sizeof(char*) * driverCount ); + if( !result ) + goto error; + + result[0] = (char*)PaUtil_GroupAllocateMemory( + group, 32 * driverCount ); + if( !result[0] ) + goto error; + + for( i=0; igetDriverNames( result, driverCount ); + +error: + return result; +} + + +static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat(ASIOSampleType type) +{ + switch (type) { + case ASIOSTInt16MSB: + case ASIOSTInt16LSB: + return paInt16; + + case ASIOSTFloat32MSB: + case ASIOSTFloat32LSB: + case ASIOSTFloat64MSB: + case ASIOSTFloat64LSB: + return paFloat32; + + case ASIOSTInt32MSB: + case ASIOSTInt32LSB: + case ASIOSTInt32MSB16: + case ASIOSTInt32LSB16: + case ASIOSTInt32MSB18: + case ASIOSTInt32MSB20: + case ASIOSTInt32MSB24: + case ASIOSTInt32LSB18: + case ASIOSTInt32LSB20: + case ASIOSTInt32LSB24: + return paInt32; + + case ASIOSTInt24MSB: + case ASIOSTInt24LSB: + return paInt24; + + default: + return paCustomFormat; + } +} + +void AsioSampleTypeLOG(ASIOSampleType type) +{ + switch (type) { + case ASIOSTInt16MSB: PA_DEBUG(("ASIOSTInt16MSB\n")); break; + case ASIOSTInt16LSB: PA_DEBUG(("ASIOSTInt16LSB\n")); break; + case ASIOSTFloat32MSB:PA_DEBUG(("ASIOSTFloat32MSB\n"));break; + case ASIOSTFloat32LSB:PA_DEBUG(("ASIOSTFloat32LSB\n"));break; + case ASIOSTFloat64MSB:PA_DEBUG(("ASIOSTFloat64MSB\n"));break; + case ASIOSTFloat64LSB:PA_DEBUG(("ASIOSTFloat64LSB\n"));break; + case ASIOSTInt32MSB: PA_DEBUG(("ASIOSTInt32MSB\n")); break; + case ASIOSTInt32LSB: PA_DEBUG(("ASIOSTInt32LSB\n")); break; + case ASIOSTInt32MSB16:PA_DEBUG(("ASIOSTInt32MSB16\n"));break; + case ASIOSTInt32LSB16:PA_DEBUG(("ASIOSTInt32LSB16\n"));break; + case ASIOSTInt32MSB18:PA_DEBUG(("ASIOSTInt32MSB18\n"));break; + case ASIOSTInt32MSB20:PA_DEBUG(("ASIOSTInt32MSB20\n"));break; + case ASIOSTInt32MSB24:PA_DEBUG(("ASIOSTInt32MSB24\n"));break; + case ASIOSTInt32LSB18:PA_DEBUG(("ASIOSTInt32LSB18\n"));break; + case ASIOSTInt32LSB20:PA_DEBUG(("ASIOSTInt32LSB20\n"));break; + case ASIOSTInt32LSB24:PA_DEBUG(("ASIOSTInt32LSB24\n"));break; + case ASIOSTInt24MSB: PA_DEBUG(("ASIOSTInt24MSB\n")); break; + case ASIOSTInt24LSB: PA_DEBUG(("ASIOSTInt24LSB\n")); break; + default: PA_DEBUG(("Custom Format%d\n",type));break; + + } +} + +static int BytesPerAsioSample( ASIOSampleType sampleType ) +{ + switch (sampleType) { + case ASIOSTInt16MSB: + case ASIOSTInt16LSB: + return 2; + + case ASIOSTFloat64MSB: + case ASIOSTFloat64LSB: + return 8; + + case ASIOSTFloat32MSB: + case ASIOSTFloat32LSB: + case ASIOSTInt32MSB: + case ASIOSTInt32LSB: + case ASIOSTInt32MSB16: + case ASIOSTInt32LSB16: + case ASIOSTInt32MSB18: + case ASIOSTInt32MSB20: + case ASIOSTInt32MSB24: + case ASIOSTInt32LSB18: + case ASIOSTInt32LSB20: + case ASIOSTInt32LSB24: + return 4; + + case ASIOSTInt24MSB: + case ASIOSTInt24LSB: + return 3; + + default: + return 0; + } +} + + +static void Swap16( void *buffer, long shift, long count ) +{ + unsigned short *p = (unsigned short*)buffer; + unsigned short temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + temp = *p; + *p++ = (unsigned short)((temp<<8) | (temp>>8)); + } +} + +static void Swap24( void *buffer, long shift, long count ) +{ + unsigned char *p = (unsigned char*)buffer; + unsigned char temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + temp = *p; + *p = *(p+2); + *(p+2) = temp; + p += 3; + } +} + +#define PA_SWAP32_( x ) ((x>>24) | ((x>>8)&0xFF00) | ((x<<8)&0xFF0000) | (x<<24)); + +static void Swap32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + temp = *p; + *p++ = PA_SWAP32_( temp); + } +} + +static void SwapShiftLeft32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + + while( count-- ) + { + temp = *p; + temp = PA_SWAP32_( temp); + *p++ = temp << shift; + } +} + +static void ShiftRightSwap32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + + while( count-- ) + { + temp = *p >> shift; + *p++ = PA_SWAP32_( temp); + } +} + +static void ShiftLeft32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + + while( count-- ) + { + temp = *p; + *p++ = temp << shift; + } +} + +static void ShiftRight32( void *buffer, long shift, long count ) +{ + unsigned long *p = (unsigned long*)buffer; + unsigned long temp; + + while( count-- ) + { + temp = *p; + *p++ = temp >> shift; + } +} + +#define PA_SWAP_( x, y ) temp=x; x = y; y = temp; + +static void Swap64ConvertFloat64ToFloat32( void *buffer, long shift, long count ) +{ + double *in = (double*)buffer; + float *out = (float*)buffer; + unsigned char *p; + unsigned char temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + p = (unsigned char*)in; + PA_SWAP_( p[0], p[7] ); + PA_SWAP_( p[1], p[6] ); + PA_SWAP_( p[2], p[5] ); + PA_SWAP_( p[3], p[4] ); + + *out++ = (float) (*in++); + } +} + +static void ConvertFloat64ToFloat32( void *buffer, long shift, long count ) +{ + double *in = (double*)buffer; + float *out = (float*)buffer; + (void) shift; /* unused parameter */ + + while( count-- ) + *out++ = (float) (*in++); +} + +static void ConvertFloat32ToFloat64Swap64( void *buffer, long shift, long count ) +{ + float *in = ((float*)buffer) + (count-1); + double *out = ((double*)buffer) + (count-1); + unsigned char *p; + unsigned char temp; + (void) shift; /* unused parameter */ + + while( count-- ) + { + *out = *in--; + + p = (unsigned char*)out; + PA_SWAP_( p[0], p[7] ); + PA_SWAP_( p[1], p[6] ); + PA_SWAP_( p[2], p[5] ); + PA_SWAP_( p[3], p[4] ); + + out--; + } +} + +static void ConvertFloat32ToFloat64( void *buffer, long shift, long count ) +{ + float *in = ((float*)buffer) + (count-1); + double *out = ((double*)buffer) + (count-1); + (void) shift; /* unused parameter */ + + while( count-- ) + *out-- = *in--; +} + +#ifdef MAC +#define PA_MSB_IS_NATIVE_ +#undef PA_LSB_IS_NATIVE_ +#endif + +#ifdef WINDOWS +#undef PA_MSB_IS_NATIVE_ +#define PA_LSB_IS_NATIVE_ +#endif + +typedef void PaAsioBufferConverter( void *, long, long ); + +static void SelectAsioToPaConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) +{ + *shift = 0; + *converter = 0; + + switch (type) { + case ASIOSTInt16MSB: + /* dest: paInt16, no conversion necessary, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; + #endif + break; + case ASIOSTInt16LSB: + /* dest: paInt16, no conversion necessary, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; + #endif + break; + case ASIOSTFloat32MSB: + /* dest: paFloat32, no conversion necessary, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTFloat32LSB: + /* dest: paFloat32, no conversion necessary, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTFloat64MSB: + /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; + #else + *converter = ConvertFloat64ToFloat32; + #endif + break; + case ASIOSTFloat64LSB: + /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; + #else + *converter = ConvertFloat64ToFloat32; + #endif + break; + case ASIOSTInt32MSB: + /* dest: paInt32, no conversion necessary, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTInt32LSB: + /* dest: paInt32, no conversion necessary, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTInt32MSB16: + /* dest: paInt32, 16 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 16; + break; + case ASIOSTInt32MSB18: + /* dest: paInt32, 14 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 14; + break; + case ASIOSTInt32MSB20: + /* dest: paInt32, 12 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 12; + break; + case ASIOSTInt32MSB24: + /* dest: paInt32, 8 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 8; + break; + case ASIOSTInt32LSB16: + /* dest: paInt32, 16 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 16; + break; + case ASIOSTInt32LSB18: + /* dest: paInt32, 14 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 14; + break; + case ASIOSTInt32LSB20: + /* dest: paInt32, 12 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 12; + break; + case ASIOSTInt32LSB24: + /* dest: paInt32, 8 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif + *shift = 8; + break; + case ASIOSTInt24MSB: + /* dest: paInt24, no conversion necessary, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; + #endif + break; + case ASIOSTInt24LSB: + /* dest: paInt24, no conversion necessary, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; + #endif + break; + } +} + + +static void SelectPaToAsioConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) +{ + *shift = 0; + *converter = 0; + + switch (type) { + case ASIOSTInt16MSB: + /* src: paInt16, no conversion necessary, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; + #endif + break; + case ASIOSTInt16LSB: + /* src: paInt16, no conversion necessary, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; + #endif + break; + case ASIOSTFloat32MSB: + /* src: paFloat32, no conversion necessary, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTFloat32LSB: + /* src: paFloat32, no conversion necessary, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTFloat64MSB: + /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; + #else + *converter = ConvertFloat32ToFloat64; + #endif + break; + case ASIOSTFloat64LSB: + /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; + #else + *converter = ConvertFloat32ToFloat64; + #endif + break; + case ASIOSTInt32MSB: + /* src: paInt32, no conversion necessary, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTInt32LSB: + /* src: paInt32, no conversion necessary, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif + break; + case ASIOSTInt32MSB16: + /* src: paInt32, 16 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 16; + break; + case ASIOSTInt32MSB18: + /* src: paInt32, 14 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 14; + break; + case ASIOSTInt32MSB20: + /* src: paInt32, 12 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 12; + break; + case ASIOSTInt32MSB24: + /* src: paInt32, 8 bit shift, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 8; + break; + case ASIOSTInt32LSB16: + /* src: paInt32, 16 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 16; + break; + case ASIOSTInt32LSB18: + /* src: paInt32, 14 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 14; + break; + case ASIOSTInt32LSB20: + /* src: paInt32, 12 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 12; + break; + case ASIOSTInt32LSB24: + /* src: paInt32, 8 bit shift, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif + *shift = 8; + break; + case ASIOSTInt24MSB: + /* src: paInt24, no conversion necessary, possible byte swap */ + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; + #endif + break; + case ASIOSTInt24LSB: + /* src: paInt24, no conversion necessary, possible byte swap */ + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; + #endif + break; + } +} + + +typedef struct PaAsioDeviceInfo +{ + PaDeviceInfo commonDeviceInfo; + long minBufferSize; + long maxBufferSize; + long preferredBufferSize; + long bufferGranularity; + + ASIOChannelInfo *asioChannelInfos; +} +PaAsioDeviceInfo; + + +PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device, + long *minLatency, long *maxLatency, long *preferredLatency, long *granularity ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiDevice; + + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + + if( result == paNoError ) + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + + if( result == paNoError ) + { + PaAsioDeviceInfo *asioDeviceInfo = + (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + + *minLatency = asioDeviceInfo->minBufferSize; + *maxLatency = asioDeviceInfo->maxBufferSize; + *preferredLatency = asioDeviceInfo->preferredBufferSize; + *granularity = asioDeviceInfo->bufferGranularity; + } + } + + return result; +} + + + +/* + load the asio driver named by and return statistics about + the driver in info. If no error occurred, the driver will remain open + and must be closed by the called by calling ASIOExit() - if an error + is returned the driver will already be closed. +*/ +static PaError LoadAsioDriver( const char *driverName, + PaAsioDriverInfo *driverInfo, void *systemSpecific ) +{ + PaError result = paNoError; + ASIOError asioError; + int asioIsInitialized = 0; + + if( !loadAsioDriver( const_cast(driverName) ) ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_HOST_ERROR( 0, "Failed to load ASIO driver" ); + goto error; + } + + memset( &driverInfo->asioDriverInfo, 0, sizeof(ASIODriverInfo) ); + driverInfo->asioDriverInfo.asioVersion = 2; + driverInfo->asioDriverInfo.sysRef = systemSpecific; + if( (asioError = ASIOInit( &driverInfo->asioDriverInfo )) != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + else + { + asioIsInitialized = 1; + } + + if( (asioError = ASIOGetChannels(&driverInfo->inputChannelCount, + &driverInfo->outputChannelCount)) != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + + if( (asioError = ASIOGetBufferSize(&driverInfo->bufferMinSize, + &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize, + &driverInfo->bufferGranularity)) != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + + if( ASIOOutputReady() == ASE_OK ) + driverInfo->postOutput = true; + else + driverInfo->postOutput = false; + + return result; + +error: + if( asioIsInitialized ) + ASIOExit(); + + return result; +} + + +#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ 13 /* must be the same number of elements as in the array below */ +static ASIOSampleRate defaultSampleRateSearchOrder_[] + = {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, + 192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 }; + + +PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i, driverCount; + PaAsioHostApiRepresentation *asioHostApi; + PaAsioDeviceInfo *deviceInfoArray; + char **names; + PaAsioDriverInfo paAsioDriverInfo; + + asioHostApi = (PaAsioHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaAsioHostApiRepresentation) ); + if( !asioHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + asioHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !asioHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + asioHostApi->systemSpecific = 0; + asioHostApi->openAsioDeviceIndex = paNoDevice; + + *hostApi = &asioHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + + (*hostApi)->info.type = paASIO; + (*hostApi)->info.name = "ASIO"; + (*hostApi)->info.deviceCount = 0; + + #ifdef WINDOWS + /* use desktop window as system specific ptr */ + asioHostApi->systemSpecific = GetDesktopWindow(); + CoInitialize(NULL); + #endif + + /* MUST BE CHECKED : to force fragments loading on Mac */ + loadAsioDriver( "dummy" ); + + /* driverCount is the number of installed drivers - not necessarily + the number of installed physical devices. */ + #if MAC + driverCount = asioDrivers->getNumFragments(); + #elif WINDOWS + driverCount = asioDrivers->asioGetNumDev(); + #endif + + if( driverCount > 0 ) + { + names = GetAsioDriverNames( asioHostApi->allocations, driverCount ); + if( !names ) + { + result = paInsufficientMemory; + goto error; + } + + + /* allocate enough space for all drivers, even if some aren't installed */ + + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, sizeof(PaDeviceInfo*) * driverCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaAsioDeviceInfo*)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, sizeof(PaAsioDeviceInfo) * driverCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < driverCount; ++i ) + { + + PA_DEBUG(("ASIO names[%d]:%s\n",i,names[i])); + + // Since portaudio opens ALL ASIO drivers, and no one else does that, + // we face fact that some drivers were not meant for it, drivers which act + // like shells on top of REAL drivers, for instance. + // so we get duplicate handles, locks and other problems. + // so lets NOT try to load any such wrappers. + // The ones i [davidv] know of so far are: + + if ( strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0 + || strcmp (names[i],"ASIO Multimedia Driver") == 0 + || strncmp(names[i],"Premiere",8) == 0 //"Premiere Elements Windows Sound 1.0" + || strncmp(names[i],"Adobe",5) == 0 //"Adobe Default Windows Sound 1.5" + || strncmp(names[i],"ReaRoute ASIO",13) == 0) //Reaper www.reaper.fm <- fix your stuff man. + { + PA_DEBUG(("BLACKLISTED!!!\n")); + continue; + } + + + /* Attempt to load the asio driver... */ + if( LoadAsioDriver( names[i], &paAsioDriverInfo, asioHostApi->systemSpecific ) == paNoError ) + { + PaAsioDeviceInfo *asioDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ]; + PaDeviceInfo *deviceInfo = &asioDeviceInfo->commonDeviceInfo; + + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + deviceInfo->name = names[i]; + PA_DEBUG(("PaAsio_Initialize: drv:%d name = %s\n", i,deviceInfo->name)); + PA_DEBUG(("PaAsio_Initialize: drv:%d inputChannels = %d\n", i, paAsioDriverInfo.inputChannelCount)); + PA_DEBUG(("PaAsio_Initialize: drv:%d outputChannels = %d\n", i, paAsioDriverInfo.outputChannelCount)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMinSize = %d\n", i, paAsioDriverInfo.bufferMinSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMaxSize = %d\n", i, paAsioDriverInfo.bufferMaxSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferGranularity = %d\n", i, paAsioDriverInfo.bufferGranularity)); + + deviceInfo->maxInputChannels = paAsioDriverInfo.inputChannelCount; + deviceInfo->maxOutputChannels = paAsioDriverInfo.outputChannelCount; + + deviceInfo->defaultSampleRate = 0.; + bool foundDefaultSampleRate = false; + for( int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j ) + { + ASIOError asioError = ASIOCanSampleRate( defaultSampleRateSearchOrder_[j] ); + if( asioError != ASE_NoClock && asioError != ASE_NotPresent ) + { + deviceInfo->defaultSampleRate = defaultSampleRateSearchOrder_[j]; + foundDefaultSampleRate = true; + break; + } + } + + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate)); + + if( foundDefaultSampleRate ){ + + /* calculate default latency values from bufferPreferredSize + for default low latency, and bufferPreferredSize * 3 + for default high latency. + use the default sample rate to convert from samples to + seconds. Without knowing what sample rate the user will + use this is the best we can do. + */ + + double defaultLowLatency = + paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate; + + deviceInfo->defaultLowInputLatency = defaultLowLatency; + deviceInfo->defaultLowOutputLatency = defaultLowLatency; + + long defaultHighLatencyBufferSize = + paAsioDriverInfo.bufferPreferredSize * 3; + + if( defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize ) + defaultHighLatencyBufferSize = paAsioDriverInfo.bufferMaxSize; + + double defaultHighLatency = + defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate; + + if( defaultHighLatency < defaultLowLatency ) + defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ + + deviceInfo->defaultHighInputLatency = defaultHighLatency; + deviceInfo->defaultHighOutputLatency = defaultHighLatency; + + }else{ + + deviceInfo->defaultLowInputLatency = 0.; + deviceInfo->defaultLowOutputLatency = 0.; + deviceInfo->defaultHighInputLatency = 0.; + deviceInfo->defaultHighOutputLatency = 0.; + } + + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency)); + + asioDeviceInfo->minBufferSize = paAsioDriverInfo.bufferMinSize; + asioDeviceInfo->maxBufferSize = paAsioDriverInfo.bufferMaxSize; + asioDeviceInfo->preferredBufferSize = paAsioDriverInfo.bufferPreferredSize; + asioDeviceInfo->bufferGranularity = paAsioDriverInfo.bufferGranularity; + + + asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, + sizeof(ASIOChannelInfo) * (deviceInfo->maxInputChannels + + deviceInfo->maxOutputChannels) ); + if( !asioDeviceInfo->asioChannelInfos ) + { + result = paInsufficientMemory; + goto error; + } + + int a; + + for( a=0; a < deviceInfo->maxInputChannels; ++a ){ + asioDeviceInfo->asioChannelInfos[a].channel = a; + asioDeviceInfo->asioChannelInfos[a].isInput = ASIOTrue; + ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[a] ); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + } + + for( a=0; a < deviceInfo->maxOutputChannels; ++a ){ + int b = deviceInfo->maxInputChannels + a; + asioDeviceInfo->asioChannelInfos[b].channel = a; + asioDeviceInfo->asioChannelInfos[b].isInput = ASIOFalse; + ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[b] ); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + } + + + /* unload the driver */ + ASIOExit(); + + (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo; + ++(*hostApi)->info.deviceCount; + } + } + } + + if( (*hostApi)->info.deviceCount > 0 ) + { + (*hostApi)->info.defaultInputDevice = 0; + (*hostApi)->info.defaultOutputDevice = 0; + } + else + { + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + } + + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &asioHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &asioHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( asioHostApi ) + { + if( asioHostApi->allocations ) + { + PaUtil_FreeAllAllocations( asioHostApi->allocations ); + PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); + } + + PaUtil_FreeMemory( asioHostApi ); + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + + /* + IMPLEMENT ME: + - clean up any resources not handled by the allocation group + */ + + if( asioHostApi->allocations ) + { + PaUtil_FreeAllAllocations( asioHostApi->allocations ); + PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); + } + + PaUtil_FreeMemory( asioHostApi ); +} + + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaError result = paNoError; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + PaAsioDriverInfo *driverInfo = &asioHostApi->openAsioDriverInfo; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaDeviceIndex asioDeviceIndex; + ASIOError asioError; + + if( inputParameters && outputParameters ) + { + /* full duplex ASIO stream must use the same device for input and output */ + + if( inputParameters->device != outputParameters->device ) + return paBadIODeviceCombination; + } + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + asioDeviceIndex = inputParameters->device; + + /* validate inputStreamInfo */ + /** @todo do more validation here */ + // if( inputParameters->hostApiSpecificStreamInfo ) + // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + asioDeviceIndex = outputParameters->device; + + /* validate outputStreamInfo */ + /** @todo do more validation here */ + // if( outputParameters->hostApiSpecificStreamInfo ) + // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + + + /* if an ASIO device is open we can only get format information for the currently open device */ + + if( asioHostApi->openAsioDeviceIndex != paNoDevice + && asioHostApi->openAsioDeviceIndex != asioDeviceIndex ) + { + return paDeviceUnavailable; + } + + + /* NOTE: we load the driver and use its current settings + rather than the ones in our device info structure which may be stale */ + + /* open the device if it's not already open */ + if( asioHostApi->openAsioDeviceIndex == paNoDevice ) + { + result = LoadAsioDriver( asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific ); + if( result != paNoError ) + return result; + } + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > 0 ) + { + if( inputChannelCount > driverInfo->inputChannelCount ) + { + result = paInvalidChannelCount; + goto done; + } + } + + /* check that output device can support outputChannelCount */ + if( outputChannelCount ) + { + if( outputChannelCount > driverInfo->outputChannelCount ) + { + result = paInvalidChannelCount; + goto done; + } + } + + /* query for sample rate support */ + asioError = ASIOCanSampleRate( sampleRate ); + if( asioError == ASE_NoClock || asioError == ASE_NotPresent ) + { + result = paInvalidSampleRate; + goto done; + } + +done: + /* close the device if it wasn't already open */ + if( asioHostApi->openAsioDeviceIndex == paNoDevice ) + { + ASIOExit(); /* not sure if we should check for errors here */ + } + + if( result == paNoError ) + return paFormatIsSupported; + else + return result; +} + + + +/* PaAsioStream - a stream data structure specifically for this implementation */ + +typedef struct PaAsioStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + PaAsioHostApiRepresentation *asioHostApi; + unsigned long framesPerHostCallback; + + /* ASIO driver info - these may not be needed for the life of the stream, + but store them here until we work out how format conversion is going + to work. */ + + ASIOBufferInfo *asioBufferInfos; + ASIOChannelInfo *asioChannelInfos; + long inputLatency, outputLatency; // actual latencies returned by asio + + long inputChannelCount, outputChannelCount; + bool postOutput; + + void **bufferPtrs; /* this is carved up for inputBufferPtrs and outputBufferPtrs */ + void **inputBufferPtrs[2]; + void **outputBufferPtrs[2]; + + PaAsioBufferConverter *inputBufferConverter; + long inputShift; + PaAsioBufferConverter *outputBufferConverter; + long outputShift; + + volatile bool stopProcessing; + int stopPlayoutCount; + HANDLE completedBuffersPlayedEvent; + + bool streamFinishedCallbackCalled; + volatile int isActive; + volatile bool zeroOutput; /* all future calls to the callback will output silence */ + + volatile long reenterCount; + volatile long reenterError; + + PaStreamCallbackFlags callbackFlags; +} +PaAsioStream; + +static PaAsioStream *theAsioStream = 0; /* due to ASIO sdk limitations there can be only one stream */ + + +static void ZeroOutputBuffers( PaAsioStream *stream, long index ) +{ + int i; + + for( i=0; i < stream->outputChannelCount; ++i ) + { + void *buffer = stream->asioBufferInfos[ i + stream->inputChannelCount ].buffers[index]; + + int bytesPerSample = BytesPerAsioSample( stream->asioChannelInfos[ i + stream->inputChannelCount ].type ); + + memset( buffer, 0, stream->framesPerHostCallback * bytesPerSample ); + } +} + + +static unsigned long SelectHostBufferSize( unsigned long suggestedLatencyFrames, + PaAsioDriverInfo *driverInfo ) +{ + unsigned long result; + + if( suggestedLatencyFrames == 0 ) + { + result = driverInfo->bufferPreferredSize; + } + else{ + if( suggestedLatencyFrames <= (unsigned long)driverInfo->bufferMinSize ) + { + result = driverInfo->bufferMinSize; + } + else if( suggestedLatencyFrames >= (unsigned long)driverInfo->bufferMaxSize ) + { + result = driverInfo->bufferMaxSize; + } + else + { + if( driverInfo->bufferGranularity == -1 ) + { + /* power-of-two */ + result = 2; + + while( result < suggestedLatencyFrames ) + result *= 2; + + if( result < (unsigned long)driverInfo->bufferMinSize ) + result = driverInfo->bufferMinSize; + + if( result > (unsigned long)driverInfo->bufferMaxSize ) + result = driverInfo->bufferMaxSize; + } + else if( driverInfo->bufferGranularity == 0 ) + { + /* the documentation states that bufferGranularity should be + zero when bufferMinSize, bufferMaxSize and + bufferPreferredSize are the same. We assume that is the case. + */ + + result = driverInfo->bufferPreferredSize; + } + else + { + /* modulo granularity */ + + unsigned long remainder = + suggestedLatencyFrames % driverInfo->bufferGranularity; + + if( remainder == 0 ) + { + result = suggestedLatencyFrames; + } + else + { + result = suggestedLatencyFrames + + (driverInfo->bufferGranularity - remainder); + + if( result > (unsigned long)driverInfo->bufferMaxSize ) + result = driverInfo->bufferMaxSize; + } + } + } + } + + return result; +} + + +/* returns channelSelectors if present */ + +static PaError ValidateAsioSpecificStreamInfo( + const PaStreamParameters *streamParameters, + const PaAsioStreamInfo *streamInfo, + int deviceChannelCount, + int **channelSelectors ) +{ + if( streamInfo ) + { + if( streamInfo->size != sizeof( PaAsioStreamInfo ) + || streamInfo->version != 1 ) + { + return paIncompatibleHostApiSpecificStreamInfo; + } + + if( streamInfo->flags & paAsioUseChannelSelectors ) + *channelSelectors = streamInfo->channelSelectors; + + if( !(*channelSelectors) ) + return paIncompatibleHostApiSpecificStreamInfo; + + for( int i=0; i < streamParameters->channelCount; ++i ){ + if( (*channelSelectors)[i] < 0 + || (*channelSelectors)[i] >= deviceChannelCount ){ + return paInvalidChannelCount; + } + } + } + + return paNoError; +} + + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + PaAsioStream *stream = 0; + PaAsioStreamInfo *inputStreamInfo, *outputStreamInfo; + unsigned long framesPerHostBuffer; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + unsigned long suggestedInputLatencyFrames; + unsigned long suggestedOutputLatencyFrames; + PaDeviceIndex asioDeviceIndex; + ASIOError asioError; + int asioIsInitialized = 0; + int asioBuffersCreated = 0; + int completedBuffersPlayedEventInited = 0; + int i; + PaAsioDriverInfo *driverInfo; + int *inputChannelSelectors = 0; + int *outputChannelSelectors = 0; + + /* unless we move to using lower level ASIO calls, we can only have + one device open at a time */ + if( asioHostApi->openAsioDeviceIndex != paNoDevice ){ + PA_DEBUG(("OpenStream paDeviceUnavailable\n")); + return paDeviceUnavailable; + } + + if( inputParameters && outputParameters ) + { + /* full duplex ASIO stream must use the same device for input and output */ + + if( inputParameters->device != outputParameters->device ){ + PA_DEBUG(("OpenStream paBadIODeviceCombination\n")); + return paBadIODeviceCombination; + } + } + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + suggestedInputLatencyFrames = (unsigned long)((inputParameters->suggestedLatency * sampleRate)+0.5f); + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + asioDeviceIndex = inputParameters->device; + + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; + + /* validate hostApiSpecificStreamInfo */ + inputStreamInfo = (PaAsioStreamInfo*)inputParameters->hostApiSpecificStreamInfo; + result = ValidateAsioSpecificStreamInfo( inputParameters, inputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxInputChannels, + &inputChannelSelectors + ); + if( result != paNoError ) return result; + } + else + { + inputChannelCount = 0; + inputSampleFormat = 0; + suggestedInputLatencyFrames = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + suggestedOutputLatencyFrames = (unsigned long)((outputParameters->suggestedLatency * sampleRate)+0.5f); + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + asioDeviceIndex = outputParameters->device; + + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; + + /* validate hostApiSpecificStreamInfo */ + outputStreamInfo = (PaAsioStreamInfo*)outputParameters->hostApiSpecificStreamInfo; + result = ValidateAsioSpecificStreamInfo( outputParameters, outputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxOutputChannels, + &outputChannelSelectors + ); + if( result != paNoError ) return result; + } + else + { + outputChannelCount = 0; + outputSampleFormat = 0; + suggestedOutputLatencyFrames = 0; + } + + driverInfo = &asioHostApi->openAsioDriverInfo; + + /* NOTE: we load the driver and use its current settings + rather than the ones in our device info structure which may be stale */ + + result = LoadAsioDriver( asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific ); + if( result == paNoError ) + asioIsInitialized = 1; + else{ + PA_DEBUG(("OpenStream ERROR1\n")); + goto error; + } + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > 0 ) + { + if( inputChannelCount > driverInfo->inputChannelCount ) + { + result = paInvalidChannelCount; + PA_DEBUG(("OpenStream ERROR2\n")); + goto error; + } + } + + /* check that output device can support outputChannelCount */ + if( outputChannelCount ) + { + if( outputChannelCount > driverInfo->outputChannelCount ) + { + result = paInvalidChannelCount; + PA_DEBUG(("OpenStream ERROR3\n")); + goto error; + } + } + + + // check that the device supports the requested sample rate + + asioError = ASIOCanSampleRate( sampleRate ); + PA_DEBUG(("ASIOCanSampleRate(%f):%d\n",sampleRate, asioError )); + + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + + + // retrieve the current sample rate, we only change to the requested + // sample rate if the device is not already in that rate. + + ASIOSampleRate oldRate; + asioError = ASIOGetSampleRate(&oldRate); + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + PA_DEBUG(("ASIOGetSampleRate:%f\n",oldRate)); + + if (oldRate != sampleRate){ + + PA_DEBUG(("before ASIOSetSampleRate(%f)\n",sampleRate)); + asioError = ASIOSetSampleRate( sampleRate ); + /* Set sample rate */ + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + PA_DEBUG(("after ASIOSetSampleRate(%f)\n",sampleRate)); + } + else + { + PA_DEBUG(("No Need to change SR\n")); + } + + + /* + IMPLEMENT ME: + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + */ + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ){ + PA_DEBUG(("OpenStream invalid flags!!\n")); + return paInvalidFlag; /* unexpected platform specific flag */ + } + + + stream = (PaAsioStream*)PaUtil_AllocateMemory( sizeof(PaAsioStream) ); + if( !stream ) + { + result = paInsufficientMemory; + PA_DEBUG(("OpenStream ERROR5\n")); + goto error; + } + + stream->completedBuffersPlayedEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + if( stream->completedBuffersPlayedEvent == NULL ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_DEBUG(("OpenStream ERROR6\n")); + goto error; + } + completedBuffersPlayedEventInited = 1; + + + stream->asioBufferInfos = 0; /* for deallocation in error */ + stream->asioChannelInfos = 0; /* for deallocation in error */ + stream->bufferPtrs = 0; /* for deallocation in error */ + + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &asioHostApi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &asioHostApi->blockingStreamInterface, streamCallback, userData ); + } + + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + stream->asioBufferInfos = (ASIOBufferInfo*)PaUtil_AllocateMemory( + sizeof(ASIOBufferInfo) * (inputChannelCount + outputChannelCount) ); + if( !stream->asioBufferInfos ) + { + result = paInsufficientMemory; + PA_DEBUG(("OpenStream ERROR7\n")); + goto error; + } + + + for( i=0; i < inputChannelCount; ++i ) + { + ASIOBufferInfo *info = &stream->asioBufferInfos[i]; + + info->isInput = ASIOTrue; + + if( inputChannelSelectors ){ + // inputChannelSelectors values have already been validated in + // ValidateAsioSpecificStreamInfo() above + info->channelNum = inputChannelSelectors[i]; + }else{ + info->channelNum = i; + } + + info->buffers[0] = info->buffers[1] = 0; + } + + for( i=0; i < outputChannelCount; ++i ){ + ASIOBufferInfo *info = &stream->asioBufferInfos[inputChannelCount+i]; + + info->isInput = ASIOFalse; + + if( outputChannelSelectors ){ + // outputChannelSelectors values have already been validated in + // ValidateAsioSpecificStreamInfo() above + info->channelNum = outputChannelSelectors[i]; + }else{ + info->channelNum = i; + } + + info->buffers[0] = info->buffers[1] = 0; + } + + + framesPerHostBuffer = SelectHostBufferSize( + (( suggestedInputLatencyFrames > suggestedOutputLatencyFrames ) + ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames), + driverInfo ); + + + PA_DEBUG(("PaAsioOpenStream: framesPerHostBuffer :%d\n", framesPerHostBuffer)); + + asioError = ASIOCreateBuffers( stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_ ); + + if( asioError != ASE_OK + && framesPerHostBuffer != (unsigned long)driverInfo->bufferPreferredSize ) + { + PA_DEBUG(("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText(asioError) )); + /* + Some buggy drivers (like the Hoontech DSP24) give incorrect + [min, preferred, max] values They should work with the preferred size + value, thus if Pa_ASIO_CreateBuffers fails with the hostBufferSize + computed in SelectHostBufferSize, we try again with the preferred size. + */ + + framesPerHostBuffer = driverInfo->bufferPreferredSize; + + PA_DEBUG(("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n", framesPerHostBuffer)); + + ASIOError asioError2 = ASIOCreateBuffers( stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_ ); + if( asioError2 == ASE_OK ) + asioError = ASE_OK; + } + + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_DEBUG(("OpenStream ERROR9\n")); + goto error; + } + + asioBuffersCreated = 1; + + stream->asioChannelInfos = (ASIOChannelInfo*)PaUtil_AllocateMemory( + sizeof(ASIOChannelInfo) * (inputChannelCount + outputChannelCount) ); + if( !stream->asioChannelInfos ) + { + result = paInsufficientMemory; + PA_DEBUG(("OpenStream ERROR10\n")); + goto error; + } + + for( i=0; i < inputChannelCount + outputChannelCount; ++i ) + { + stream->asioChannelInfos[i].channel = stream->asioBufferInfos[i].channelNum; + stream->asioChannelInfos[i].isInput = stream->asioBufferInfos[i].isInput; + asioError = ASIOGetChannelInfo( &stream->asioChannelInfos[i] ); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_DEBUG(("OpenStream ERROR11\n")); + goto error; + } + } + + stream->bufferPtrs = (void**)PaUtil_AllocateMemory( + 2 * sizeof(void*) * (inputChannelCount + outputChannelCount) ); + if( !stream->bufferPtrs ) + { + result = paInsufficientMemory; + PA_DEBUG(("OpenStream ERROR12\n")); + goto error; + } + + if( inputChannelCount > 0 ) + { + stream->inputBufferPtrs[0] = stream-> bufferPtrs; + stream->inputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount]; + + for( i=0; iinputBufferPtrs[0][i] = stream->asioBufferInfos[i].buffers[0]; + stream->inputBufferPtrs[1][i] = stream->asioBufferInfos[i].buffers[1]; + } + } + else + { + stream->inputBufferPtrs[0] = 0; + stream->inputBufferPtrs[1] = 0; + } + + if( outputChannelCount > 0 ) + { + stream->outputBufferPtrs[0] = &stream->bufferPtrs[inputChannelCount*2]; + stream->outputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount*2 + outputChannelCount]; + + for( i=0; ioutputBufferPtrs[0][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[0]; + stream->outputBufferPtrs[1][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[1]; + } + } + else + { + stream->outputBufferPtrs[0] = 0; + stream->outputBufferPtrs[1] = 0; + } + + if( inputChannelCount > 0 ) + { + /* FIXME: assume all channels use the same type for now */ + ASIOSampleType inputType = stream->asioChannelInfos[0].type; + + PA_DEBUG(("ASIO Input type:%d",inputType)); + AsioSampleTypeLOG(inputType); + hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( inputType ); + + SelectAsioToPaConverter( inputType, &stream->inputBufferConverter, &stream->inputShift ); + } + else + { + hostInputSampleFormat = 0; + stream->inputBufferConverter = 0; + } + + if( outputChannelCount > 0 ) + { + /* FIXME: assume all channels use the same type for now */ + ASIOSampleType outputType = stream->asioChannelInfos[inputChannelCount].type; + + PA_DEBUG(("ASIO Output type:%d",outputType)); + AsioSampleTypeLOG(outputType); + hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( outputType ); + + SelectPaToAsioConverter( outputType, &stream->outputBufferConverter, &stream->outputShift ); + } + else + { + hostOutputSampleFormat = 0; + stream->outputBufferConverter = 0; + } + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerHostBuffer, paUtilFixedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ){ + PA_DEBUG(("OpenStream ERROR13\n")); + goto error; + } + + + ASIOGetLatencies( &stream->inputLatency, &stream->outputLatency ); + + stream->streamRepresentation.streamInfo.inputLatency = + (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) + + stream->inputLatency) / sampleRate; // seconds + stream->streamRepresentation.streamInfo.outputLatency = + (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) + + stream->outputLatency) / sampleRate; // seconds + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + // the code below prints the ASIO latency which doesn't include the + // buffer processor latency. it reports the added latency separately + PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->inputLatency, + (long)((stream->inputLatency*1000)/ sampleRate), + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor), + (long)((PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)*1000)/ sampleRate) + )); + + PA_DEBUG(("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->outputLatency, + (long)((stream->outputLatency*1000)/ sampleRate), + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor), + (long)((PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)*1000)/ sampleRate) + )); + + stream->asioHostApi = asioHostApi; + stream->framesPerHostCallback = framesPerHostBuffer; + + stream->inputChannelCount = inputChannelCount; + stream->outputChannelCount = outputChannelCount; + stream->postOutput = driverInfo->postOutput; + stream->isActive = 0; + + asioHostApi->openAsioDeviceIndex = asioDeviceIndex; + + *s = (PaStream*)stream; + + return result; + +error: + PA_DEBUG(("goto errored\n")); + if( stream ) + { + if( completedBuffersPlayedEventInited ) + CloseHandle( stream->completedBuffersPlayedEvent ); + + if( stream->asioBufferInfos ) + PaUtil_FreeMemory( stream->asioBufferInfos ); + + if( stream->asioChannelInfos ) + PaUtil_FreeMemory( stream->asioChannelInfos ); + + if( stream->bufferPtrs ) + PaUtil_FreeMemory( stream->bufferPtrs ); + + PaUtil_FreeMemory( stream ); + } + + if( asioBuffersCreated ) + ASIODisposeBuffers(); + + if( asioIsInitialized ) + ASIOExit(); + + return result; +} + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaAsioStream *stream = (PaAsioStream*)s; + + /* + IMPLEMENT ME: + - additional stream closing + cleanup + */ + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + + stream->asioHostApi->openAsioDeviceIndex = paNoDevice; + + CloseHandle( stream->completedBuffersPlayedEvent ); + + PaUtil_FreeMemory( stream->asioBufferInfos ); + PaUtil_FreeMemory( stream->asioChannelInfos ); + PaUtil_FreeMemory( stream->bufferPtrs ); + PaUtil_FreeMemory( stream ); + + ASIODisposeBuffers(); + ASIOExit(); + + return result; +} + + +static void bufferSwitch(long index, ASIOBool directProcess) +{ +//TAKEN FROM THE ASIO SDK + + // the actual processing callback. + // Beware that this is normally in a seperate thread, hence be sure that + // you take care about thread synchronization. This is omitted here for + // simplicity. + + // as this is a "back door" into the bufferSwitchTimeInfo a timeInfo needs + // to be created though it will only set the timeInfo.samplePosition and + // timeInfo.systemTime fields and the according flags + + ASIOTime timeInfo; + memset( &timeInfo, 0, sizeof (timeInfo) ); + + // get the time stamp of the buffer, not necessary if no + // synchronization to other media is required + if( ASIOGetSamplePosition(&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK) + timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; + + // Call the real callback + bufferSwitchTimeInfo( &timeInfo, index, directProcess ); +} + + +// conversion from 64 bit ASIOSample/ASIOTimeStamp to double float +#if NATIVE_INT64 + #define ASIO64toDouble(a) (a) +#else + const double twoRaisedTo32 = 4294967296.; + #define ASIO64toDouble(a) ((a).lo + (a).hi * twoRaisedTo32) +#endif + +static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool directProcess ) +{ + // the actual processing callback. + // Beware that this is normally in a seperate thread, hence be sure that + // you take care about thread synchronization. + + + /* The SDK says the following about the directProcess flag: + suggests to the host whether it should immediately start processing + (directProcess == ASIOTrue), or whether its process should be deferred + because the call comes from a very low level (for instance, a high level + priority interrupt), and direct processing would cause timing instabilities for + the rest of the system. If in doubt, directProcess should be set to ASIOFalse. + + We just ignore directProcess. This could cause incompatibilities with + drivers which really don't want the audio processing to occur in this + callback, but none have been identified yet. + */ + + (void) directProcess; /* suppress unused parameter warning */ + +#if 0 + // store the timeInfo for later use + asioDriverInfo.tInfo = *timeInfo; + + // get the time stamp of the buffer, not necessary if no + // synchronization to other media is required + + if (timeInfo->timeInfo.flags & kSystemTimeValid) + asioDriverInfo.nanoSeconds = ASIO64toDouble(timeInfo->timeInfo.systemTime); + else + asioDriverInfo.nanoSeconds = 0; + + if (timeInfo->timeInfo.flags & kSamplePositionValid) + asioDriverInfo.samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); + else + asioDriverInfo.samples = 0; + + if (timeInfo->timeCode.flags & kTcValid) + asioDriverInfo.tcSamples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); + else + asioDriverInfo.tcSamples = 0; + + // get the system reference time + asioDriverInfo.sysRefTime = get_sys_reference_time(); +#endif + +#if 0 + // a few debug messages for the Windows device driver developer + // tells you the time when driver got its interrupt and the delay until the app receives + // the event notification. + static double last_samples = 0; + char tmp[128]; + sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples \n", asioDriverInfo.sysRefTime - (long)(asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long)(asioDriverInfo.nanoSeconds / 1000000.0), (long)(asioDriverInfo.samples - last_samples)); + OutputDebugString (tmp); + last_samples = asioDriverInfo.samples; +#endif + + + if( !theAsioStream ) + return 0L; + + // Keep sample position + // FIXME: asioDriverInfo.pahsc_NumFramesDone = timeInfo->timeInfo.samplePosition.lo; + + + // protect against reentrancy + if( PaAsio_AtomicIncrement(&theAsioStream->reenterCount) ) + { + theAsioStream->reenterError++; + //DBUG(("bufferSwitchTimeInfo : reentrancy detection = %d\n", asioDriverInfo.reenterError)); + return 0L; + } + + int buffersDone = 0; + + do + { + if( buffersDone > 0 ) + { + // this is a reentered buffer, we missed processing it on time + // set the input overflow and output underflow flags as appropriate + + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; + } + else + { + if( theAsioStream->zeroOutput ) + { + ZeroOutputBuffers( theAsioStream, index ); + + // Finally if the driver supports the ASIOOutputReady() optimization, + // do it here, all data are in place + if( theAsioStream->postOutput ) + ASIOOutputReady(); + + if( theAsioStream->stopProcessing ) + { + if( theAsioStream->stopPlayoutCount < 2 ) + { + ++theAsioStream->stopPlayoutCount; + if( theAsioStream->stopPlayoutCount == 2 ) + { + theAsioStream->isActive = 0; + if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) + theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); + theAsioStream->streamFinishedCallbackCalled = true; + SetEvent( theAsioStream->completedBuffersPlayedEvent ); + } + } + } + } + else + { + +#if 0 +// test code to try to detect slip conditions... these may work on some systems +// but neither of them work on the RME Digi96 + +// check that sample delta matches buffer size (otherwise we must have skipped +// a buffer. +static double last_samples = -512; +double samples; +//if( timeInfo->timeCode.flags & kTcValid ) +// samples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); +//else + samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); +int delta = samples - last_samples; +//printf( "%d\n", delta); +last_samples = samples; + +if( delta > theAsioStream->framesPerHostCallback ) +{ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; +} + +// check that the buffer index is not the previous index (which would indicate +// that a buffer was skipped. +static int previousIndex = 1; +if( index == previousIndex ) +{ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; +} +previousIndex = index; +#endif + + int i; + + PaUtil_BeginCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer ); + + PaStreamCallbackTimeInfo paTimeInfo; + + // asio systemTime is supposed to be measured according to the same + // clock as timeGetTime + paTimeInfo.currentTime = (ASIO64toDouble( timeInfo->timeInfo.systemTime ) * .000000001); + + /* patch from Paul Boege */ + paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - + ((double)theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + + paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + + ((double)theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + + /* old version is buggy because the buffer processor also adds in its latency to the time parameters + paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - theAsioStream->streamRepresentation.streamInfo.inputLatency; + paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + theAsioStream->streamRepresentation.streamInfo.outputLatency; + */ +#if 1 +// detect underflows by checking inter-callback time > 2 buffer period +static double previousTime = -1; +if( previousTime > 0 ){ + + double delta = paTimeInfo.currentTime - previousTime; + + if( delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate) ){ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; + } +} +previousTime = paTimeInfo.currentTime; +#endif + + // note that the above input and output times do not need to be + // adjusted for the latency of the buffer processor -- the buffer + // processor handles that. + + if( theAsioStream->inputBufferConverter ) + { + for( i=0; iinputChannelCount; i++ ) + { + theAsioStream->inputBufferConverter( theAsioStream->inputBufferPtrs[index][i], + theAsioStream->inputShift, theAsioStream->framesPerHostCallback ); + } + } + + PaUtil_BeginBufferProcessing( &theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags ); + + /* reset status flags once they've been passed to the callback */ + theAsioStream->callbackFlags = 0; + + PaUtil_SetInputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); + for( i=0; iinputChannelCount; ++i ) + PaUtil_SetNonInterleavedInputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i] ); + + PaUtil_SetOutputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); + for( i=0; ioutputChannelCount; ++i ) + PaUtil_SetNonInterleavedOutputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i] ); + + int callbackResult; + if( theAsioStream->stopProcessing ) + callbackResult = paComplete; + else + callbackResult = paContinue; + unsigned long framesProcessed = PaUtil_EndBufferProcessing( &theAsioStream->bufferProcessor, &callbackResult ); + + if( theAsioStream->outputBufferConverter ) + { + for( i=0; ioutputChannelCount; i++ ) + { + theAsioStream->outputBufferConverter( theAsioStream->outputBufferPtrs[index][i], + theAsioStream->outputShift, theAsioStream->framesPerHostCallback ); + } + } + + PaUtil_EndCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer, framesProcessed ); + + // Finally if the driver supports the ASIOOutputReady() optimization, + // do it here, all data are in place + if( theAsioStream->postOutput ) + ASIOOutputReady(); + + if( callbackResult == paContinue ) + { + /* nothing special to do */ + } + else if( callbackResult == paAbort ) + { + /* finish playback immediately */ + theAsioStream->isActive = 0; + if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) + theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); + theAsioStream->streamFinishedCallbackCalled = true; + SetEvent( theAsioStream->completedBuffersPlayedEvent ); + theAsioStream->zeroOutput = true; + } + else /* paComplete or other non-zero value indicating complete */ + { + /* Finish playback once currently queued audio has completed. */ + theAsioStream->stopProcessing = true; + + if( PaUtil_IsBufferProcessorOutputEmpty( &theAsioStream->bufferProcessor ) ) + { + theAsioStream->zeroOutput = true; + theAsioStream->stopPlayoutCount = 0; + } + } + } + } + + ++buffersDone; + }while( PaAsio_AtomicDecrement(&theAsioStream->reenterCount) >= 0 ); + + return 0L; +} + + +static void sampleRateChanged(ASIOSampleRate sRate) +{ + // TAKEN FROM THE ASIO SDK + // do whatever you need to do if the sample rate changed + // usually this only happens during external sync. + // Audio processing is not stopped by the driver, actual sample rate + // might not have even changed, maybe only the sample rate status of an + // AES/EBU or S/PDIF digital input at the audio device. + // You might have to update time/sample related conversion routines, etc. + + (void) sRate; /* unused parameter */ + PA_DEBUG( ("sampleRateChanged : %d \n", sRate)); +} + +static long asioMessages(long selector, long value, void* message, double* opt) +{ +// TAKEN FROM THE ASIO SDK + // currently the parameters "value", "message" and "opt" are not used. + long ret = 0; + + (void) message; /* unused parameters */ + (void) opt; + + PA_DEBUG( ("asioMessages : %d , %d \n", selector, value)); + + switch(selector) + { + case kAsioSelectorSupported: + if(value == kAsioResetRequest + || value == kAsioEngineVersion + || value == kAsioResyncRequest + || value == kAsioLatenciesChanged + // the following three were added for ASIO 2.0, you don't necessarily have to support them + || value == kAsioSupportsTimeInfo + || value == kAsioSupportsTimeCode + || value == kAsioSupportsInputMonitor) + ret = 1L; + break; + + case kAsioBufferSizeChange: + //printf("kAsioBufferSizeChange \n"); + break; + + case kAsioResetRequest: + // defer the task and perform the reset of the driver during the next "safe" situation + // You cannot reset the driver right now, as this code is called from the driver. + // Reset the driver is done by completely destruct is. I.e. ASIOStop(), ASIODisposeBuffers(), Destruction + // Afterwards you initialize the driver again. + + /*FIXME: commented the next line out */ + //asioDriverInfo.stopped; // In this sample the processing will just stop + ret = 1L; + break; + + case kAsioResyncRequest: + // This informs the application, that the driver encountered some non fatal data loss. + // It is used for synchronization purposes of different media. + // Added mainly to work around the Win16Mutex problems in Windows 95/98 with the + // Windows Multimedia system, which could loose data because the Mutex was hold too long + // by another thread. + // However a driver can issue it in other situations, too. + ret = 1L; + break; + + case kAsioLatenciesChanged: + // This will inform the host application that the drivers were latencies changed. + // Beware, it this does not mean that the buffer sizes have changed! + // You might need to update internal delay data. + ret = 1L; + //printf("kAsioLatenciesChanged \n"); + break; + + case kAsioEngineVersion: + // return the supported ASIO version of the host application + // If a host applications does not implement this selector, ASIO 1.0 is assumed + // by the driver + ret = 2L; + break; + + case kAsioSupportsTimeInfo: + // informs the driver wether the asioCallbacks.bufferSwitchTimeInfo() callback + // is supported. + // For compatibility with ASIO 1.0 drivers the host application should always support + // the "old" bufferSwitch method, too. + ret = 1; + break; + + case kAsioSupportsTimeCode: + // informs the driver wether application is interested in time code info. + // If an application does not need to know about time code, the driver has less work + // to do. + ret = 0; + break; + } + return ret; +} + + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaAsioStream *stream = (PaAsioStream*)s; + ASIOError asioError; + + if( stream->outputChannelCount > 0 ) + { + ZeroOutputBuffers( stream, 0 ); + ZeroOutputBuffers( stream, 1 ); + } + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + stream->stopProcessing = false; + stream->zeroOutput = false; + + /* Reentrancy counter initialisation */ + stream->reenterCount = -1; + stream->reenterError = 0; + + stream->callbackFlags = 0; + + if( ResetEvent( stream->completedBuffersPlayedEvent ) == 0 ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + + if( result == paNoError ) + { + theAsioStream = stream; + asioError = ASIOStart(); + if( asioError == ASE_OK ) + { + stream->isActive = 1; + stream->streamFinishedCallbackCalled = false; + } + else + { + theAsioStream = 0; + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + } + } + + return result; +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaAsioStream *stream = (PaAsioStream*)s; + ASIOError asioError; + + if( stream->isActive ) + { + stream->stopProcessing = true; + + /* wait for the stream to finish playing out enqueued buffers. + timeout after four times the stream latency. + + @todo should use a better time out value - if the user buffer + length is longer than the asio buffer size then that should + be taken into account. + */ + if( WaitForSingleObject( theAsioStream->completedBuffersPlayedEvent, + (DWORD)(stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.) ) + == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n" )); + } + } + + asioError = ASIOStop(); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + } + + theAsioStream = 0; + stream->isActive = 0; + + if( !stream->streamFinishedCallbackCalled ) + { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + + return result; +} + + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaAsioStream *stream = (PaAsioStream*)s; + ASIOError asioError; + + stream->zeroOutput = true; + + asioError = ASIOStop(); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + } + else + { + // make sure that the callback is not still in-flight when ASIOStop() + // returns. This has been observed to happen on the Hoontech DSP24 for + // example. + int count = 2000; // only wait for 2 seconds, rather than hanging. + while( theAsioStream->reenterCount != -1 && count > 0 ) + { + Sleep(1); + --count; + } + } + + /* it is questionable whether we should zero theAsioStream if ASIOStop() + returns an error, because the callback could still be active. We assume + not - this is based on the fact that ASIOStop is unlikely to fail + if the callback is running - it's more likely to fail because the + callback is not running. */ + + theAsioStream = 0; + stream->isActive = 0; + + if( !stream->streamFinishedCallbackCalled ) + { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + //PaAsioStream *stream = (PaAsioStream*)s; + (void) s; /* unused parameter */ + return theAsioStream == 0; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + return stream->isActive; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + (void) s; /* unused parameter */ + return (double)timeGetTime() * .001; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + (void) stream; /* unused parameters */ + (void) buffer; + (void) frames; + + return paNoError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + (void) stream; /* unused parameters */ + (void) buffer; + (void) frames; + + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + (void) stream; /* unused parameter */ + + return 0; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaAsioStream *stream = (PaAsioStream*)s; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + (void) stream; /* unused parameter */ + + return 0; +} + + +PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiDevice; + ASIODriverInfo asioDriverInfo; + ASIOError asioError; + int asioIsInitialized = 0; + PaAsioHostApiRepresentation *asioHostApi; + PaAsioDeviceInfo *asioDeviceInfo; + + + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) + goto error; + + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) + goto error; + + /* + In theory we could proceed if the currently open device was the same + one for which the control panel was requested, however because the + window pointer is not available until this function is called we + currently need to call ASIOInit() again here, which of course can't be + done safely while a stream is open. + */ + + asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + if( asioHostApi->openAsioDeviceIndex != paNoDevice ) + { + result = paDeviceUnavailable; + goto error; + } + + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + + if( !loadAsioDriver( const_cast(asioDeviceInfo->commonDeviceInfo.name) ) ) + { + result = paUnanticipatedHostError; + goto error; + } + + /* CRUCIAL!!! */ + memset( &asioDriverInfo, 0, sizeof(ASIODriverInfo) ); + asioDriverInfo.asioVersion = 2; + asioDriverInfo.sysRef = systemSpecific; + asioError = ASIOInit( &asioDriverInfo ); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + else + { + asioIsInitialized = 1; + } + +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); +PA_DEBUG(("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion )); +PA_DEBUG(("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion )); +PA_DEBUG(("Name: ASIOInit(): %s\n", asioDriverInfo.name )); +PA_DEBUG(("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage )); + + asioError = ASIOControlPanel(); + if( asioError != ASE_OK ) + { + PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + goto error; + } + +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); + + asioError = ASIOExit(); + if( asioError != ASE_OK ) + { + result = paUnanticipatedHostError; + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + asioIsInitialized = 0; + goto error; + } + +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); + + return result; + +error: + if( asioIsInitialized ) + ASIOExit(); + + return result; +} + + +PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiDevice; + PaAsioDeviceInfo *asioDeviceInfo; + + + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) + goto error; + + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) + goto error; + + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + + if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels ){ + result = paInvalidChannelCount; + goto error; + } + + *channelName = asioDeviceInfo->asioChannelInfos[channelIndex].name; + + return paNoError; + +error: + return result; +} + + +PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *hostApi; + PaDeviceIndex hostApiDevice; + PaAsioDeviceInfo *asioDeviceInfo; + + + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) + goto error; + + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) + goto error; + + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; + + if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels ){ + result = paInvalidChannelCount; + goto error; + } + + *channelName = asioDeviceInfo->asioChannelInfos[ + asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name; + + return paNoError; + +error: + return result; +} diff --git a/portaudio-v19/src/hostapi/coreaudio/notes.txt b/portaudio-v19/src/hostapi/coreaudio/notes.txt new file mode 100644 index 000000000..ad66f358d --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/notes.txt @@ -0,0 +1,145 @@ +Notes on status of CoreAudio Implementation of PortAudio + +Document Last Updated December 9, 2005 + +There are currently two implementations of PortAudio for Mac Core Audio. + +The original is in pa_mac_core_old.c, and the newer, default implementation +is in pa_mac_core.c. +Only pa_mac_core.c is currently developed and supported as it uses apple's +current core audio technology. To select use the old implementation, replace +pa_mac_core.c with pa_mac_core_old.c (eg. "cp pa_mac_core_auhal.c +pa_mac_core.c"), then run configure and make as usual. + +---------------------------------------- + +Notes on Original implementation: + +by Phil Burk and Darren Gibbs + +Last updated March 20, 2002 + +WHAT WORKS + +Output with very low latency, <10 msec. +Half duplex input or output. +Full duplex on the same CoreAudio device. +The paFLoat32, paInt16, paInt8, paUInt8 sample formats. +Pa_GetCPULoad() +Pa_StreamTime() + +KNOWN BUGS OR LIMITATIONS + +We do not yet support simultaneous input and output on different +devices. Note that some CoreAudio devices like the Roland UH30 look +like one device but are actually two different CoreAudio devices. The +Built-In audio is typically one CoreAudio device. + +Mono doesn't work. + +DEVICE MAPPING + +CoreAudio devices can support both input and output. But the sample +rates supported may be different. So we have map one or two PortAudio +device to each CoreAudio device depending on whether it supports +input, output or both. + +When we query devices, we first get a list of CoreAudio devices. Then +we scan the list and add a PortAudio device for each CoreAudio device +that supports input. Then we make a scan for output devices. + +------------------------------------------- + +Notes on Newer/Default AUHAL implementation: + +by Bjorn Roche + +Last Updated December 9, 2005 + +Principle of Operation: + +This implementation uses AUHAL for audio I/O. To some extent, it also +operates at the "HAL" Layer, though this behavior can be limited by +platform specific flags (see pa_mac_core.h for details). The default +settings should be reasonable: they don't change the SR of the device and +don't cause interruptions if other devices are using the device. + +Major Software Elements Used: Apple's HAL AUs provide output SR +conversion transparently, however, only on output, so this +implementation uses AudioConverters to convert the sample rate on input. +A PortAudio ring buffer is used to buffer input when sample rate +conversion is required or when separate audio units are used for duplex +IO. Finally, a PortAudio buffer processor is used to convert formats and +provide additional buffers if needed. Internally, interleaved floating +point data streams are used exclusively - the audio unit converts from +the audio hardware's native format to interleaved float PCM and +PortAudio's Buffer processor is used for conversion to user formats. + +Simplex Input: Simplex input uses a single callback. If sample rate +conversion is required, a ring buffer and AudioConverter are used as +well. + +Simplex output: Simplex output uses a single callback. No ring buffer or +audio converter is used because AUHAL does its own output SR conversion. + +Duplex, one device (no SR conversion): When one device is used, a single +callback is used. This achieves very low latency. + +Duplex, separate devices or SR conversion: When SR conversion is +required, data must be buffered before it is converted and data is not +always available at the same times on input and output, so SR conversion +requires the same treatment as separate devices. The input callback +reads data and puts it in the ring buffer. The output callback reads the +data off the ring buffer, into an audio converter and finally to the +buffer processor. + +Platform Specific Options: + +By using the flags in pa_mac_core.h, the user may specify several options. +For example, the user can specify the sample-rate conversion quality, and +the extent to which PA will attempt to "play nice" and to what extent it +will interrupt other apps to improve performance. For example, if 44100 Hz +sample rate is requested but the device is set at 48000 Hz, PA can either +change the device for optimal playback ("Pro" mode), which may interrupt +other programs playing back audio, or simple use a sample-rate coversion, +which allows for friendlier sharing of the device ("Play Nice" mode). + + +Known issues: + +- Latency: Latency settings are ignored in most cases. Exceptions are when +doing I/O between different devices and as a hint for selecting a realtively +low or relatively high latency in conjunction with +paHostFramesPerBufferUnspecified. Latency settings are always automatically +bound to "safe" values, however, so setting extreme values here should not be +an issue. + +- Buffer Size: paHostFramesPerBufferUnspecified and specific host buffer sizes +are supported. paHostFramesPerBufferUnspecified works best in "pro" mode, +where the buffer size and sample rate of the audio device is most likely +to match the expected values. + +- Timing info. It reports on stream time, but I'm probably doing something +wrong since patest_sine_time often reports negative latency numbers. + +- xrun detection: The only xrun detection performed is when reading +and writing the ring buffer. There is probably more that can be done. + +- abort/stop issues: stopping a stream is always a complete operation, +but latency should be low enough to make the lack of a separate abort +unnecessary. Apple clarifies its AudioOutputUnitStop() call here: +http://lists.apple.com/archives/coreaudio-api/2005/Dec/msg00055.html + +- blocking interface: Not implemented. + +- multichannel: It has been tested successfully on multichannel hardware +from MOTU: traveler and 896HD. + +- sample rate conversion quality: By default, SR conversion is the maximum +available. This can be tweaked using flags pa_mac_core.h. Note that the AU +render quyality property is used to set the sample rat conversion quality +as "documented" here: +http://lists.apple.com/archives/coreaudio-api/2004/Jan/msg00141.html + +- x86: I haven't tested it on an x86 Mac myself, but users have reported +being able to comiple and run it. diff --git a/portaudio-v19/src/hostapi/coreaudio/pa_mac_core.c b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core.c new file mode 100644 index 000000000..080da5958 --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core.c @@ -0,0 +1,2033 @@ +/* + * This is the AUHAL implementation of portaudio. + * + * Written by Bjorn Roche of XO Audio LLC, from PA skeleton code. + * Portions copied from code by Dominic Mazzoni (who wrote a HAL implementation) + * + * Dominic's code was based on code by Phil Burk, Darren Gibbs, + * Gord Peters, Stephane Letz, and Greg Pfiel. + * + * Bjorn Roche and XO Audio LLC reserve no rights to this code. + * The maintainers of PortAudio may redistribute and modify the code and + * licenses as they deam appropriate. + * + * The following people also deserve acknowledgements: + * + * Olivier Tristan for feedback and testing + * Glenn Zelniker and Z-Systems engineering for sponsoring the Blocking I/O + * interface. + * + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** + @file pa_mac_core + @author Bjorn Roche + @brief AUHAL implementation of PortAudio +*/ + +/* FIXME: not all error conditions call PaUtil_SetLastHostErrorInfo() + * PaMacCore_SetError() will do this. + */ + +#include "pa_mac_core_internal.h" + +#include /* strlen(), memcmp() etc. */ + +#include "pa_mac_core.h" +#include "pa_mac_core_utilities.h" +#include "pa_mac_core_blocking.h" + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#define RING_BUFFER_ADVANCE_DENOMINATOR (4) + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static void setStreamStartTime( PaStream *stream ); +static OSStatus AudioIOProc( void *inRefCon, + AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList *ioData ); +static double GetStreamCpuLoad( PaStream* stream ); + +static PaError GetChannelInfo( PaMacAUHAL *auhalHostApi, + PaDeviceInfo *deviceInfo, + AudioDeviceID macCoreDeviceId, + int isInput); + +static PaError OpenAndSetupOneAudioUnit( + const PaStreamParameters *inStreamParams, + const PaStreamParameters *outStreamParams, + const unsigned long requestedFramesPerBuffer, + unsigned long *actualInputFramesPerBuffer, + unsigned long *actualOutputFramesPerBuffer, + const PaMacAUHAL *auhalHostApi, + AudioUnit *audioUnit, + AudioConverterRef *srConverter, + AudioDeviceID *audioDevice, + const double sampleRate, + void *refCon ); + +/* for setting errors. */ +#define PA_AUHAL_SET_LAST_HOST_ERROR( errorCode, errorText ) \ + PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText ) + + +/*currently, this is only used in initialization, but it might be modified + to be used when the list of devices changes.*/ +static PaError gatherDeviceInfo(PaMacAUHAL *auhalHostApi) +{ + UInt32 size; + UInt32 propsize; + VVDBUG(("gatherDeviceInfo()\n")); + /* -- free any previous allocations -- */ + if( auhalHostApi->devIds ) + PaUtil_GroupFreeMemory(auhalHostApi->allocations, auhalHostApi->devIds); + auhalHostApi->devIds = NULL; + + /* -- figure out how many devices there are -- */ + AudioHardwareGetPropertyInfo( kAudioHardwarePropertyDevices, + &propsize, + NULL ); + auhalHostApi->devCount = propsize / sizeof( AudioDeviceID ); + + VDBUG( ( "Found %ld device(s).\n", auhalHostApi->devCount ) ); + + /* -- copy the device IDs -- */ + auhalHostApi->devIds = (AudioDeviceID *)PaUtil_GroupAllocateMemory( + auhalHostApi->allocations, + propsize ); + if( !auhalHostApi->devIds ) + return paInsufficientMemory; + AudioHardwareGetProperty( kAudioHardwarePropertyDevices, + &propsize, + auhalHostApi->devIds ); +#ifdef MAC_CORE_VERBOSE_DEBUG + { + int i; + for( i=0; idevCount; ++i ) + printf( "Device %d\t: %ld\n", i, auhalHostApi->devIds[i] ); + } +#endif + + size = sizeof(AudioDeviceID); + auhalHostApi->defaultIn = kAudioDeviceUnknown; + auhalHostApi->defaultOut = kAudioDeviceUnknown; + + /* determine the default device. */ + /* I am not sure how these calls to AudioHardwareGetProperty() + could fail, but in case they do, we use the first available + device as the default. */ + if( 0 != AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, + &size, + &auhalHostApi->defaultIn) ) { + int i; + auhalHostApi->defaultIn = kAudioDeviceUnknown; + VDBUG(("Failed to get default input device from OS.")); + VDBUG((" I will substitute the first available input Device.")); + for( i=0; idevCount; ++i ) { + PaDeviceInfo devInfo; + if( 0 != GetChannelInfo( auhalHostApi, &devInfo, + auhalHostApi->devIds[i], TRUE ) ) + if( devInfo.maxInputChannels ) { + auhalHostApi->defaultIn = auhalHostApi->devIds[i]; + break; + } + } + } + if( 0 != AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, + &size, + &auhalHostApi->defaultOut) ) { + int i; + auhalHostApi->defaultIn = kAudioDeviceUnknown; + VDBUG(("Failed to get default output device from OS.")); + VDBUG((" I will substitute the first available output Device.")); + for( i=0; idevCount; ++i ) { + PaDeviceInfo devInfo; + if( 0 != GetChannelInfo( auhalHostApi, &devInfo, + auhalHostApi->devIds[i], FALSE ) ) + if( devInfo.maxOutputChannels ) { + auhalHostApi->defaultOut = auhalHostApi->devIds[i]; + break; + } + } + } + + VDBUG( ( "Default in : %ld\n", auhalHostApi->defaultIn ) ); + VDBUG( ( "Default out: %ld\n", auhalHostApi->defaultOut ) ); + + return paNoError; +} + +static PaError GetChannelInfo( PaMacAUHAL *auhalHostApi, + PaDeviceInfo *deviceInfo, + AudioDeviceID macCoreDeviceId, + int isInput) +{ + UInt32 propSize; + PaError err = paNoError; + UInt32 i; + int numChannels = 0; + AudioBufferList *buflist = NULL; + UInt32 frameLatency; + + VVDBUG(("GetChannelInfo()\n")); + + /* Get the number of channels from the stream configuration. + Fail if we can't get this. */ + + err = ERR(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, NULL)); + if (err) + return err; + + buflist = PaUtil_AllocateMemory(propSize); + if( !buflist ) + return paInsufficientMemory; + err = ERR(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, buflist)); + if (err) + goto error; + + for (i = 0; i < buflist->mNumberBuffers; ++i) + numChannels += buflist->mBuffers[i].mNumberChannels; + + if (isInput) + deviceInfo->maxInputChannels = numChannels; + else + deviceInfo->maxOutputChannels = numChannels; + + if (numChannels > 0) /* do not try to retrieve the latency if there is no channels. */ + { + /* Get the latency. Don't fail if we can't get this. */ + /* default to something reasonable */ + deviceInfo->defaultLowInputLatency = .01; + deviceInfo->defaultHighInputLatency = .10; + deviceInfo->defaultLowOutputLatency = .01; + deviceInfo->defaultHighOutputLatency = .10; + propSize = sizeof(UInt32); + err = WARNING(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyLatency, &propSize, &frameLatency)); + if (!err) + { + /** FEEDBACK: + * This code was arrived at by trial and error, and some extentive, but not exhaustive + * testing. Sebastien Beaulieu has suggested using + * kAudioDevicePropertyLatency + kAudioDevicePropertySafetyOffset + buffer size instead. + * At the time this code was written, many users were reporting dropouts with audio + * programs that probably used this formula. This was probably + * around 10.4.4, and the problem is probably fixed now. So perhaps + * his formula should be reviewed and used. + * */ + double secondLatency = frameLatency / deviceInfo->defaultSampleRate; + if (isInput) + { + deviceInfo->defaultLowInputLatency = 3 * secondLatency; + deviceInfo->defaultHighInputLatency = 3 * 10 * secondLatency; + } + else + { + deviceInfo->defaultLowOutputLatency = 3 * secondLatency; + deviceInfo->defaultHighOutputLatency = 3 * 10 * secondLatency; + } + } + } + PaUtil_FreeMemory( buflist ); + return paNoError; + error: + PaUtil_FreeMemory( buflist ); + return err; +} + +static PaError InitializeDeviceInfo( PaMacAUHAL *auhalHostApi, + PaDeviceInfo *deviceInfo, + AudioDeviceID macCoreDeviceId, + PaHostApiIndex hostApiIndex ) +{ + Float64 sampleRate; + char *name; + PaError err = paNoError; + UInt32 propSize; + + VVDBUG(("InitializeDeviceInfo(): macCoreDeviceId=%ld\n", macCoreDeviceId)); + + memset(deviceInfo, 0, sizeof(deviceInfo)); + + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + /* Get the device name. Fail if we can't get it. */ + err = ERR(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, NULL)); + if (err) + return err; + + name = PaUtil_GroupAllocateMemory(auhalHostApi->allocations,propSize); + if ( !name ) + return paInsufficientMemory; + err = ERR(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, name)); + if (err) + return err; + deviceInfo->name = name; + + /* Try to get the default sample rate. Don't fail if we can't get this. */ + propSize = sizeof(Float64); + err = ERR(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyNominalSampleRate, &propSize, &sampleRate)); + if (err) + deviceInfo->defaultSampleRate = 0.0; + else + deviceInfo->defaultSampleRate = sampleRate; + + /* Get the maximum number of input and output channels. Fail if we can't get this. */ + + err = GetChannelInfo(auhalHostApi, deviceInfo, macCoreDeviceId, 1); + if (err) + return err; + + err = GetChannelInfo(auhalHostApi, deviceInfo, macCoreDeviceId, 0); + if (err) + return err; + + return paNoError; +} + +PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i; + PaMacAUHAL *auhalHostApi; + PaDeviceInfo *deviceInfoArray; + + VVDBUG(("PaMacCore_Initialize(): hostApiIndex=%d\n", hostApiIndex)); + + auhalHostApi = (PaMacAUHAL*)PaUtil_AllocateMemory( sizeof(PaMacAUHAL) ); + if( !auhalHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + auhalHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !auhalHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + auhalHostApi->devIds = NULL; + auhalHostApi->devCount = 0; + + /* get the info we need about the devices */ + result = gatherDeviceInfo( auhalHostApi ); + if( result != paNoError ) + goto error; + + *hostApi = &auhalHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paCoreAudio; + (*hostApi)->info.name = "Core Audio"; + + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + + (*hostApi)->info.deviceCount = 0; + + if( auhalHostApi->devCount > 0 ) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + auhalHostApi->allocations, sizeof(PaDeviceInfo*) * auhalHostApi->devCount); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + auhalHostApi->allocations, sizeof(PaDeviceInfo) * auhalHostApi->devCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < auhalHostApi->devCount; ++i ) + { + int err; + err = InitializeDeviceInfo( auhalHostApi, &deviceInfoArray[i], + auhalHostApi->devIds[i], + hostApiIndex ); + if (err == paNoError) + { /* copy some info and set the defaults */ + (*hostApi)->deviceInfos[(*hostApi)->info.deviceCount] = &deviceInfoArray[i]; + if (auhalHostApi->devIds[i] == auhalHostApi->defaultIn) + (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; + if (auhalHostApi->devIds[i] == auhalHostApi->defaultOut) + (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount; + (*hostApi)->info.deviceCount++; + } + else + { /* there was an error. we need to shift the devices down, so we ignore this one */ + int j; + auhalHostApi->devCount--; + for( j=i; jdevCount; ++j ) + auhalHostApi->devIds[j] = auhalHostApi->devIds[j+1]; + i--; + } + } + } + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &auhalHostApi->callbackStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, + IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &auhalHostApi->blockingStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, + IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, + GetStreamReadAvailable, + GetStreamWriteAvailable ); + + return result; + +error: + if( auhalHostApi ) + { + if( auhalHostApi->allocations ) + { + PaUtil_FreeAllAllocations( auhalHostApi->allocations ); + PaUtil_DestroyAllocationGroup( auhalHostApi->allocations ); + } + + PaUtil_FreeMemory( auhalHostApi ); + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaMacAUHAL *auhalHostApi = (PaMacAUHAL*)hostApi; + + VVDBUG(("Terminate()\n")); + + /* + IMPLEMENT ME: + - clean up any resources not handled by the allocation group + TODO: Double check that everything is handled by alloc group + */ + + if( auhalHostApi->allocations ) + { + PaUtil_FreeAllAllocations( auhalHostApi->allocations ); + PaUtil_DestroyAllocationGroup( auhalHostApi->allocations ); + } + + PaUtil_FreeMemory( auhalHostApi ); +} + + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + VVDBUG(("IsFormatSupported(): in chan=%d, in fmt=%ld, out chan=%d, out fmt=%ld sampleRate=%g\n", + inputParameters ? inputParameters->channelCount : -1, + inputParameters ? inputParameters->sampleFormat : -1, + outputParameters ? outputParameters->channelCount : -1, + outputParameters ? outputParameters->sampleFormat : -1, + (float) sampleRate )); + + /** These first checks are standard PA checks. We do some fancier checks + later. */ + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support outputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + } + else + { + outputChannelCount = 0; + } + + /* FEEDBACK */ + /* I think the only way to check a given format SR combo is */ + /* to try opening it. This could be disruptive, is that Okay? */ + /* The alternative is to just read off available sample rates, */ + /* but this will not work %100 of the time (eg, a device that */ + /* supports N output at one rate but only N/2 at a higher rate.)*/ + + /* The following code opens the device with the requested parameters to + see if it works. */ + { + PaError err; + PaStream *s; + err = OpenStream( hostApi, &s, inputParameters, outputParameters, + sampleRate, 1024, 0, (PaStreamCallback *)1, NULL ); + if( err != paNoError && err != paInvalidSampleRate ) + DBUG( ( "OpenStream @ %g returned: %d: %s\n", + (float) sampleRate, err, Pa_GetErrorText( err ) ) ); + if( err ) + return err; + err = CloseStream( s ); + if( err ) { + /* FEEDBACK: is this more serious? should we assert? */ + DBUG( ( "WARNING: could not close Stream. %d: %s\n", + err, Pa_GetErrorText( err ) ) ); + } + } + + return paFormatIsSupported; +} + +static PaError OpenAndSetupOneAudioUnit( + const PaStreamParameters *inStreamParams, + const PaStreamParameters *outStreamParams, + const unsigned long requestedFramesPerBuffer, + unsigned long *actualInputFramesPerBuffer, + unsigned long *actualOutputFramesPerBuffer, + const PaMacAUHAL *auhalHostApi, + AudioUnit *audioUnit, + AudioConverterRef *srConverter, + AudioDeviceID *audioDevice, + const double sampleRate, + void *refCon ) +{ + ComponentDescription desc; + Component comp; + /*An Apple TN suggests using CAStreamBasicDescription, but that is C++*/ + AudioStreamBasicDescription desiredFormat; + OSErr result = noErr; + PaError paResult = paNoError; + int line = 0; + UInt32 callbackKey; + AURenderCallbackStruct rcbs; + unsigned long macInputStreamFlags = paMacCorePlayNice; + unsigned long macOutputStreamFlags = paMacCorePlayNice; + + VVDBUG(("OpenAndSetupOneAudioUnit(): in chan=%d, in fmt=%ld, out chan=%d, out fmt=%ld, requestedFramesPerBuffer=%ld\n", + inStreamParams ? inStreamParams->channelCount : -1, + inStreamParams ? inStreamParams->sampleFormat : -1, + outStreamParams ? outStreamParams->channelCount : -1, + outStreamParams ? outStreamParams->sampleFormat : -1, + requestedFramesPerBuffer )); + + /* -- handle the degenerate case -- */ + if( !inStreamParams && !outStreamParams ) { + *audioUnit = NULL; + *audioDevice = kAudioDeviceUnknown; + return paNoError; + } + + /* -- get the user's api specific info, if they set any -- */ + if( inStreamParams && inStreamParams->hostApiSpecificStreamInfo ) + macInputStreamFlags= + ((paMacCoreStreamInfo*)inStreamParams->hostApiSpecificStreamInfo) + ->flags; + if( outStreamParams && outStreamParams->hostApiSpecificStreamInfo ) + macOutputStreamFlags= + ((paMacCoreStreamInfo*)outStreamParams->hostApiSpecificStreamInfo) + ->flags; + /* Override user's flags here, if desired for testing. */ + + /* + * The HAL AU is a Mac OS style "component". + * the first few steps deal with that. + * Later steps work on a combination of Mac OS + * components and the slightly lower level + * HAL. + */ + + /* -- describe the output type AudioUnit -- */ + /* Note: for the default AudioUnit, we could use the + * componentSubType value kAudioUnitSubType_DefaultOutput; + * but I don't think that's relevant here. + */ + desc.componentType = kAudioUnitType_Output; + desc.componentSubType = kAudioUnitSubType_HALOutput; + desc.componentManufacturer = kAudioUnitManufacturer_Apple; + desc.componentFlags = 0; + desc.componentFlagsMask = 0; + /* -- find the component -- */ + comp = FindNextComponent( NULL, &desc ); + if( !comp ) + { + DBUG( ( "AUHAL component not found." ) ); + *audioUnit = NULL; + *audioDevice = kAudioDeviceUnknown; + return paUnanticipatedHostError; + } + /* -- open it -- */ + result = OpenAComponent( comp, audioUnit ); + if( result ) + { + DBUG( ( "Failed to open AUHAL component." ) ); + *audioUnit = NULL; + *audioDevice = kAudioDeviceUnknown; + return ERR( result ); + } + /* -- prepare a little error handling logic / hackery -- */ +#define ERR_WRAP(mac_err) do { result = mac_err ; line = __LINE__ ; if ( result != noErr ) goto error ; } while(0) + + /* -- if there is input, we have to explicitly enable input -- */ + if( inStreamParams ) + { + UInt32 enableIO; + enableIO = 1; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Input, + INPUT_ELEMENT, + &enableIO, + sizeof(enableIO) ) ); + } + /* -- if there is no output, we must explicitly disable output -- */ + if( !outStreamParams ) + { + UInt32 enableIO; + enableIO = 0; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Output, + OUTPUT_ELEMENT, + &enableIO, + sizeof(enableIO) ) ); + } + /* -- set the devices -- */ + /* make sure input and output are the same device if we are doing input and + output. */ + if( inStreamParams && outStreamParams ) + assert( outStreamParams->device == inStreamParams->device ); + if( inStreamParams ) + { + *audioDevice = auhalHostApi->devIds[inStreamParams->device] ; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, + INPUT_ELEMENT, + audioDevice, + sizeof(AudioDeviceID) ) ); + } + if( outStreamParams ) + { + *audioDevice = auhalHostApi->devIds[outStreamParams->device] ; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, + OUTPUT_ELEMENT, + audioDevice, + sizeof(AudioDeviceID) ) ); + } + + /* -- set format -- */ + bzero( &desiredFormat, sizeof(desiredFormat) ); + desiredFormat.mFormatID = kAudioFormatLinearPCM ; + desiredFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; + desiredFormat.mFramesPerPacket = 1; + desiredFormat.mBitsPerChannel = sizeof( float ) * 8; + + result = 0; + /* set device format first, but only touch the device if the user asked */ + if( inStreamParams ) { + /*The callback never calls back if we don't set the FPB */ + /*This seems wierd, because I would think setting anything on the device + would be disruptive.*/ + paResult = setBestFramesPerBuffer( *audioDevice, FALSE, + requestedFramesPerBuffer, + actualInputFramesPerBuffer ); + if( paResult ) goto error; + if( macInputStreamFlags & paMacCore_ChangeDeviceParameters ) { + bool requireExact; + requireExact=macInputStreamFlags&paMacCore_FailIfConversionRequired; + paResult = setBestSampleRateForDevice( *audioDevice, FALSE, + requireExact, sampleRate ); + if( paResult ) goto error; + } + if( actualInputFramesPerBuffer && actualOutputFramesPerBuffer ) + *actualOutputFramesPerBuffer = *actualInputFramesPerBuffer ; + } + if( outStreamParams && !inStreamParams ) { + /*The callback never calls back if we don't set the FPB */ + /*This seems wierd, because I would think setting anything on the device + would be disruptive.*/ + paResult = setBestFramesPerBuffer( *audioDevice, TRUE, + requestedFramesPerBuffer, + actualOutputFramesPerBuffer ); + if( paResult ) goto error; + if( macOutputStreamFlags & paMacCore_ChangeDeviceParameters ) { + bool requireExact; + requireExact=macOutputStreamFlags&paMacCore_FailIfConversionRequired; + paResult = setBestSampleRateForDevice( *audioDevice, TRUE, + requireExact, sampleRate ); + if( paResult ) goto error; + } + } + + /* -- set the quality of the output converter -- */ + if( outStreamParams ) { + UInt32 value = kAudioConverterQuality_Max; + switch( macOutputStreamFlags & 0x0700 ) { + case 0x0100: /*paMacCore_ConversionQualityMin:*/ + value=kRenderQuality_Min; + break; + case 0x0200: /*paMacCore_ConversionQualityLow:*/ + value=kRenderQuality_Low; + break; + case 0x0300: /*paMacCore_ConversionQualityMedium:*/ + value=kRenderQuality_Medium; + break; + case 0x0400: /*paMacCore_ConversionQualityHigh:*/ + value=kRenderQuality_High; + break; + } + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioUnitProperty_RenderQuality, + kAudioUnitScope_Global, + OUTPUT_ELEMENT, + &value, + sizeof(value) ) ); + } + /* now set the format on the Audio Units. */ + if( outStreamParams ) + { + desiredFormat.mSampleRate =sampleRate; + desiredFormat.mBytesPerPacket=sizeof(float)*outStreamParams->channelCount; + desiredFormat.mBytesPerFrame =sizeof(float)*outStreamParams->channelCount; + desiredFormat.mChannelsPerFrame = outStreamParams->channelCount; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, + OUTPUT_ELEMENT, + &desiredFormat, + sizeof(AudioStreamBasicDescription) ) ); + } + if( inStreamParams ) + { + AudioStreamBasicDescription sourceFormat; + UInt32 size = sizeof( AudioStreamBasicDescription ); + + /* keep the sample rate of the device, or we confuse AUHAL */ + ERR_WRAP( AudioUnitGetProperty( *audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, + INPUT_ELEMENT, + &sourceFormat, + &size ) ); + desiredFormat.mSampleRate = sourceFormat.mSampleRate; + desiredFormat.mBytesPerPacket=sizeof(float)*inStreamParams->channelCount; + desiredFormat.mBytesPerFrame =sizeof(float)*inStreamParams->channelCount; + desiredFormat.mChannelsPerFrame = inStreamParams->channelCount; + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Output, + INPUT_ELEMENT, + &desiredFormat, + sizeof(AudioStreamBasicDescription) ) ); + } + /* set the maximumFramesPerSlice */ + /* not doing this causes real problems + (eg. the callback might not be called). The idea of setting both this + and the frames per buffer on the device is that we'll be most likely + to actually get the frame size we requested in the callback with the + minimum latency. */ + if( outStreamParams ) { + UInt32 size = sizeof( *actualOutputFramesPerBuffer ); + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioUnitProperty_MaximumFramesPerSlice, + kAudioUnitScope_Input, + OUTPUT_ELEMENT, + actualOutputFramesPerBuffer, + sizeof(unsigned long) ) ); + ERR_WRAP( AudioUnitGetProperty( *audioUnit, + kAudioUnitProperty_MaximumFramesPerSlice, + kAudioUnitScope_Global, + OUTPUT_ELEMENT, + actualOutputFramesPerBuffer, + &size ) ); + } + if( inStreamParams ) { + /*UInt32 size = sizeof( *actualInputFramesPerBuffer );*/ + ERR_WRAP( AudioUnitSetProperty( *audioUnit, + kAudioUnitProperty_MaximumFramesPerSlice, + kAudioUnitScope_Output, + INPUT_ELEMENT, + actualInputFramesPerBuffer, + sizeof(unsigned long) ) ); +/* Don't know why this causes problems + ERR_WRAP( AudioUnitGetProperty( *audioUnit, + kAudioUnitProperty_MaximumFramesPerSlice, + kAudioUnitScope_Global, //Output, + INPUT_ELEMENT, + actualInputFramesPerBuffer, + &size ) ); +*/ + } + + /* -- if we have input, we may need to setup an SR converter -- */ + /* even if we got the sample rate we asked for, we need to do + the conversion in case another program changes the underlying SR. */ + /* FIXME: I think we need to monitor stream and change the converter if the incoming format changes. */ + if( inStreamParams ) { + AudioStreamBasicDescription desiredFormat; + AudioStreamBasicDescription sourceFormat; + UInt32 sourceSize = sizeof( sourceFormat ); + bzero( &desiredFormat, sizeof(desiredFormat) ); + desiredFormat.mSampleRate = sampleRate; + desiredFormat.mFormatID = kAudioFormatLinearPCM ; + desiredFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; + desiredFormat.mFramesPerPacket = 1; + desiredFormat.mBitsPerChannel = sizeof( float ) * 8; + desiredFormat.mBytesPerPacket=sizeof(float)*inStreamParams->channelCount; + desiredFormat.mBytesPerFrame =sizeof(float)*inStreamParams->channelCount; + desiredFormat.mChannelsPerFrame = inStreamParams->channelCount; + + /* get the source format */ + ERR_WRAP( AudioUnitGetProperty( + *audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Output, + INPUT_ELEMENT, + &sourceFormat, + &sourceSize ) ); + + if( desiredFormat.mSampleRate != sourceFormat.mSampleRate ) + { + UInt32 value = kAudioConverterQuality_Max; + switch( macInputStreamFlags & 0x0700 ) { + case 0x0100: /*paMacCore_ConversionQualityMin:*/ + value=kAudioConverterQuality_Min; + break; + case 0x0200: /*paMacCore_ConversionQualityLow:*/ + value=kAudioConverterQuality_Low; + break; + case 0x0300: /*paMacCore_ConversionQualityMedium:*/ + value=kAudioConverterQuality_Medium; + break; + case 0x0400: /*paMacCore_ConversionQualityHigh:*/ + value=kAudioConverterQuality_High; + break; + } + VDBUG(( "Creating sample rate converter for input" + " to convert from %g to %g\n", + (float)sourceFormat.mSampleRate, + (float)desiredFormat.mSampleRate ) ); + /* create our converter */ + ERR_WRAP( AudioConverterNew( + &sourceFormat, + &desiredFormat, + srConverter ) ); + /* Set quality */ + ERR_WRAP( AudioConverterSetProperty( + *srConverter, + kAudioConverterSampleRateConverterQuality, + sizeof( value ), + &value ) ); + } + } + /* -- set IOProc (callback) -- */ + callbackKey = outStreamParams ? kAudioUnitProperty_SetRenderCallback + : kAudioOutputUnitProperty_SetInputCallback ; + rcbs.inputProc = AudioIOProc; + rcbs.inputProcRefCon = refCon; + ERR_WRAP( AudioUnitSetProperty( + *audioUnit, + callbackKey, + kAudioUnitScope_Output, + outStreamParams ? OUTPUT_ELEMENT : INPUT_ELEMENT, + &rcbs, + sizeof(rcbs)) ); + + if( inStreamParams && outStreamParams && *srConverter ) + ERR_WRAP( AudioUnitSetProperty( + *audioUnit, + kAudioOutputUnitProperty_SetInputCallback, + kAudioUnitScope_Output, + INPUT_ELEMENT, + &rcbs, + sizeof(rcbs)) ); + + /*IMPLEMENTME: may need to worry about channel mapping.*/ + + /* initialize the audio unit */ + ERR_WRAP( AudioUnitInitialize(*audioUnit) ); + + if( inStreamParams && outStreamParams ) + VDBUG( ("Opened device %ld for input and output.\n", *audioDevice ) ); + else if( inStreamParams ) + VDBUG( ("Opened device %ld for input.\n", *audioDevice ) ); + else if( outStreamParams ) + VDBUG( ("Opened device %ld for output.\n", *audioDevice ) ); + return paNoError; +#undef ERR_WRAP + + error: + CloseComponent( *audioUnit ); + *audioUnit = NULL; + if( result ) + return PaMacCore_SetError( result, line, 1 ); + return paResult; +} + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaMacAUHAL *auhalHostApi = (PaMacAUHAL*)hostApi; + PaMacCoreStream *stream = 0; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + VVDBUG(("OpenStream(): in chan=%d, in fmt=%ld, out chan=%d, out fmt=%ld SR=%g, FPB=%ld\n", + inputParameters ? inputParameters->channelCount : -1, + inputParameters ? inputParameters->sampleFormat : -1, + outputParameters ? outputParameters->channelCount : -1, + outputParameters ? outputParameters->sampleFormat : -1, + (float) sampleRate, + framesPerBuffer )); + VDBUG( ("Opening Stream.\n") ); + + /*These first few bits of code are from paSkeleton with few modifications.*/ + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* Host supports interleaved float32 */ + hostInputSampleFormat = paFloat32; + } + else + { + inputChannelCount = 0; + inputSampleFormat = hostInputSampleFormat = paFloat32; /* Surpress 'uninitialised var' warnings. */ + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* Host supports interleaved float32 */ + hostOutputSampleFormat = paFloat32; + } + else + { + outputChannelCount = 0; + outputSampleFormat = hostOutputSampleFormat = paFloat32; /* Surpress 'uninitialized var' warnings. */ + } + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + stream = (PaMacCoreStream*)PaUtil_AllocateMemory( sizeof(PaMacCoreStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + + /* If we fail after this point, we my be left in a bad state, with + some data structures setup and others not. So, first thing we + do is initialize everything so that if we fail, we know what hasn't + been touched. + */ + + stream->inputAudioBufferList.mBuffers[0].mData = NULL; + stream->inputRingBuffer.buffer = NULL; + bzero( &stream->blio, sizeof( PaMacBlio ) ); +/* + stream->blio.inputRingBuffer.buffer = NULL; + stream->blio.outputRingBuffer.buffer = NULL; + stream->blio.inputSampleFormat = inputParameters?inputParameters->sampleFormat:0; + stream->blio.inputSampleSize = computeSampleSizeFromFormat(stream->blio.inputSampleFormat); + stream->blio.outputSampleFormat=outputParameters?outputParameters->sampleFormat:0; + stream->blio.outputSampleSize = computeSampleSizeFromFormat(stream->blio.outputSampleFormat); +*/ + stream->inputSRConverter = NULL; + stream->inputUnit = NULL; + stream->outputUnit = NULL; + stream->inputFramesPerBuffer = 0; + stream->outputFramesPerBuffer = 0; + stream->bufferProcessorIsInitialized = FALSE; + + /* assert( streamCallback ) ; */ /* only callback mode is implemented */ + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &auhalHostApi->callbackStreamInterface, + streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &auhalHostApi->blockingStreamInterface, + BlioCallback, &stream->blio ); + } + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + /* -- handle paFramesPerBufferUnspecified -- */ + if( framesPerBuffer == paFramesPerBufferUnspecified ) { + long requested = 64; + if( inputParameters ) + requested = MAX( requested, inputParameters->suggestedLatency * sampleRate / 2 ); + if( outputParameters ) + requested = MAX( requested, outputParameters->suggestedLatency *sampleRate / 2 ); + VDBUG( ("Block Size unspecified. Based on Latency, the user wants a Block Size near: %ld.\n", + requested ) ); + if( requested <= 64 ) { + /*requested a realtively low latency. make sure this is in range of devices */ + /*try to get the device's min natural buffer size and use that (but no smaller than 64).*/ + AudioValueRange audioRange; + size_t size = sizeof( audioRange ); + if( inputParameters ) { + WARNING( result = AudioDeviceGetProperty( auhalHostApi->devIds[inputParameters->device], + 0, + false, + kAudioDevicePropertyBufferFrameSizeRange, + &size, &audioRange ) ); + if( result ) + requested = MAX( requested, audioRange.mMinimum ); + } + if( outputParameters ) { + WARNING( result = AudioDeviceGetProperty( auhalHostApi->devIds[outputParameters->device], + 0, + false, + kAudioDevicePropertyBufferFrameSizeRange, + &size, &audioRange ) ); + if( result ) + requested = MAX( requested, audioRange.mMinimum ); + } + } else { + /* requested a realtively high latency. make sure this is in range of devices */ + /*try to get the device's max natural buffer size and use that (but no larger than 1024).*/ + AudioValueRange audioRange; + size_t size = sizeof( audioRange ); + requested = MIN( requested, 1024 ); + if( inputParameters ) { + WARNING( result = AudioDeviceGetProperty( auhalHostApi->devIds[inputParameters->device], + 0, + false, + kAudioDevicePropertyBufferFrameSizeRange, + &size, &audioRange ) ); + if( result ) + requested = MIN( requested, audioRange.mMaximum ); + } + if( outputParameters ) { + WARNING( result = AudioDeviceGetProperty( auhalHostApi->devIds[outputParameters->device], + 0, + false, + kAudioDevicePropertyBufferFrameSizeRange, + &size, &audioRange ) ); + if( result ) + requested = MIN( requested, audioRange.mMaximum ); + } + } + /* -- double check ranges -- */ + if( requested > 1024 ) requested = 1024; + if( requested < 64 ) requested = 64; + VDBUG(("After querying hardware, setting block size to %ld.\n", requested)); + framesPerBuffer = requested; + } + + /* -- Now we actually open and setup streams. -- */ + if( inputParameters && outputParameters && outputParameters->device == inputParameters->device ) + { /* full duplex. One device. */ + result = OpenAndSetupOneAudioUnit( inputParameters, + outputParameters, + framesPerBuffer, + &(stream->inputFramesPerBuffer), + &(stream->outputFramesPerBuffer), + auhalHostApi, + &(stream->inputUnit), + &(stream->inputSRConverter), + &(stream->inputDevice), + sampleRate, + stream ); + stream->outputUnit = stream->inputUnit; + stream->outputDevice = stream->inputDevice; + if( result != paNoError ) + goto error; + } + else + { /* full duplex, different devices OR simplex */ + result = OpenAndSetupOneAudioUnit( NULL, + outputParameters, + framesPerBuffer, + NULL, + &(stream->outputFramesPerBuffer), + auhalHostApi, + &(stream->outputUnit), + NULL, + &(stream->outputDevice), + sampleRate, + stream ); + if( result != paNoError ) + goto error; + result = OpenAndSetupOneAudioUnit( inputParameters, + NULL, + framesPerBuffer, + &(stream->inputFramesPerBuffer), + NULL, + auhalHostApi, + &(stream->inputUnit), + &(stream->inputSRConverter), + &(stream->inputDevice), + sampleRate, + stream ); + if( result != paNoError ) + goto error; + } + + if( stream->inputUnit ) { + const size_t szfl = sizeof(float); + /* setup the AudioBufferList used for input */ + bzero( &stream->inputAudioBufferList, sizeof( AudioBufferList ) ); + stream->inputAudioBufferList.mNumberBuffers = 1; + stream->inputAudioBufferList.mBuffers[0].mNumberChannels + = inputChannelCount; + stream->inputAudioBufferList.mBuffers[0].mDataByteSize + = stream->inputFramesPerBuffer*inputChannelCount*szfl; + stream->inputAudioBufferList.mBuffers[0].mData + = (float *) calloc( + stream->inputFramesPerBuffer*inputChannelCount, + szfl ); + if( !stream->inputAudioBufferList.mBuffers[0].mData ) + { + result = paInsufficientMemory; + goto error; + } + + /* + * If input and output devs are different or we are doing SR conversion, + * we also need a + * ring buffer to store inpt data while waiting for output + * data. + */ + if( (stream->outputUnit && stream->inputUnit != stream->outputUnit) + || stream->inputSRConverter ) + { + /* May want the ringSize ot initial position in + ring buffer to depend somewhat on sample rate change */ + + void *data; + long ringSize; + + ringSize = computeRingBufferSize( inputParameters, + outputParameters, + stream->inputFramesPerBuffer, + stream->outputFramesPerBuffer, + sampleRate ); + /*ringSize <<= 4; *//*16x bigger, for testing */ + + + /*now, we need to allocate memory for the ring buffer*/ + data = calloc( ringSize, szfl ); + if( !data ) + { + result = paInsufficientMemory; + goto error; + } + + /* now we can initialize the ring buffer */ + assert( 0 == + RingBuffer_Init( &stream->inputRingBuffer, + ringSize*szfl, data ) ); + /* advance the read point a little, so we are reading from the + middle of the buffer */ + if( stream->outputUnit ) + RingBuffer_AdvanceWriteIndex( &stream->inputRingBuffer, ringSize*szfl / RING_BUFFER_ADVANCE_DENOMINATOR ); + } + } + + /* -- initialize Blio Buffer Processors -- */ + if( !streamCallback ) + { + long ringSize; + + ringSize = computeRingBufferSize( inputParameters, + outputParameters, + stream->inputFramesPerBuffer, + stream->outputFramesPerBuffer, + sampleRate ); + result = initializeBlioRingBuffers( &stream->blio, + inputParameters?inputParameters->sampleFormat:0 , + outputParameters?outputParameters->sampleFormat:0 , + MAX(stream->inputFramesPerBuffer,stream->outputFramesPerBuffer), + ringSize, + inputParameters?inputChannelCount:0 , + outputParameters?outputChannelCount:0 ) ; + if( result != paNoError ) + goto error; + } + + /* -- initialize Buffer Processor -- */ + { + unsigned long maxHostFrames = stream->inputFramesPerBuffer; + if( stream->outputFramesPerBuffer > maxHostFrames ) + maxHostFrames = stream->outputFramesPerBuffer; + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, + hostInputSampleFormat, + outputChannelCount, outputSampleFormat, + hostOutputSampleFormat, + sampleRate, + streamFlags, + framesPerBuffer, + /* If sample rate conversion takes place, the buffer size + will not be known. */ + maxHostFrames, + stream->inputSRConverter + ? paUtilUnknownHostBufferSize + : paUtilBoundedHostBufferSize, + streamCallback ? streamCallback : BlioCallback, + streamCallback ? userData : &stream->blio ); + if( result != paNoError ) + goto error; + } + stream->bufferProcessorIsInitialized = TRUE; + + /* + IMPLEMENT ME: initialise the following fields with estimated or actual + values. + I think this is okay the way it is br 12/1/05 + maybe need to change input latency estimate if IO devs differ + */ + stream->streamRepresentation.streamInfo.inputLatency = + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)/sampleRate; + stream->streamRepresentation.streamInfo.outputLatency = + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)/sampleRate; + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + stream->sampleRate = sampleRate; + stream->outDeviceSampleRate = 0; + if( stream->outputUnit ) { + Float64 rate; + UInt32 size = sizeof( rate ); + result = ERR( AudioDeviceGetProperty( stream->outputDevice, + 0, + FALSE, + kAudioDevicePropertyNominalSampleRate, + &size, &rate ) ); + if( result ) + goto error; + stream->outDeviceSampleRate = rate; + } + stream->inDeviceSampleRate = 0; + if( stream->inputUnit ) { + Float64 rate; + UInt32 size = sizeof( rate ); + result = ERR( AudioDeviceGetProperty( stream->inputDevice, + 0, + TRUE, + kAudioDevicePropertyNominalSampleRate, + &size, &rate ) ); + if( result ) + goto error; + stream->inDeviceSampleRate = rate; + } + stream->userInChan = inputChannelCount; + stream->userOutChan = outputChannelCount; + + stream->isTimeSet = FALSE; + stream->state = STOPPED; + stream->xrunFlags = 0; + + *s = (PaStream*)stream; + + return result; + +error: + CloseStream( stream ); + return result; +} + +PaTime GetStreamTime( PaStream *s ) +{ + /* FIXME: I am not at all sure this timing info stuff is right. + patest_sine_time reports negative latencies, which is wierd.*/ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + AudioTimeStamp timeStamp; + + VVDBUG(("GetStreamTime()\n")); + + if ( !stream->isTimeSet ) + return (PaTime)0; + + if ( stream->outputDevice ) { + AudioDeviceGetCurrentTime( stream->outputDevice, &timeStamp); + return (PaTime)(timeStamp.mSampleTime - stream->startTime.mSampleTime)/stream->outDeviceSampleRate; + } else if ( stream->inputDevice ) { + AudioDeviceGetCurrentTime( stream->inputDevice, &timeStamp); + return (PaTime)(timeStamp.mSampleTime - stream->startTime.mSampleTime)/stream->inDeviceSampleRate; + } else { + return (PaTime)0; + } +} + +static void setStreamStartTime( PaStream *stream ) +{ + /* FIXME: I am not at all sure this timing info stuff is right. + patest_sine_time reports negative latencies, which is wierd.*/ + PaMacCoreStream *s = (PaMacCoreStream *) stream; + VVDBUG(("setStreamStartTime()\n")); + if( s->outputDevice ) + AudioDeviceGetCurrentTime( s->outputDevice, &s->startTime); + else if( s->inputDevice ) + AudioDeviceGetCurrentTime( s->inputDevice, &s->startTime); + else + bzero( &s->startTime, sizeof( s->startTime ) ); + + //FIXME: we need a memory barier here + + s->isTimeSet = TRUE; +} + + +static PaTime TimeStampToSecs(PaMacCoreStream *stream, const AudioTimeStamp* timeStamp) +{ + VVDBUG(("TimeStampToSecs()\n")); + //printf( "ATS: %lu, %g, %g\n", timeStamp->mFlags, timeStamp->mSampleTime, timeStamp->mRateScalar ); + if (timeStamp->mFlags & kAudioTimeStampSampleTimeValid) + return (timeStamp->mSampleTime / stream->sampleRate); + else + return 0; +} + +#define RING_BUFFER_EMPTY (1000) + +static OSStatus ringBufferIOProc( AudioConverterRef inAudioConverter, + UInt32*ioDataSize, + void** outData, + void*inUserData ) +{ + void *dummyData; + long dummySize; + RingBuffer *rb = (RingBuffer *) inUserData; + + VVDBUG(("ringBufferIOProc()\n")); + + assert( sizeof( UInt32 ) == sizeof( long ) ); + if( RingBuffer_GetReadAvailable( rb ) == 0 ) { + *outData = NULL; + *ioDataSize = 0; + return RING_BUFFER_EMPTY; + } + RingBuffer_GetReadRegions( rb, *ioDataSize, + outData, (long *)ioDataSize, + &dummyData, &dummySize ); + + assert( *ioDataSize ); + RingBuffer_AdvanceReadIndex( rb, *ioDataSize ); + + return noErr; +} + +/* + * Called by the AudioUnit API to process audio from the sound card. + * This is where the magic happens. + */ +/* FEEDBACK: there is a lot of redundant code here because of how all the cases differ. This makes it hard to maintain, so if there are suggestinos for cleaning it up, I'm all ears. */ +static OSStatus AudioIOProc( void *inRefCon, + AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList *ioData ) +{ + unsigned long framesProcessed = 0; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; + PaMacCoreStream *stream = (PaMacCoreStream*)inRefCon; + const bool isRender = inBusNumber == OUTPUT_ELEMENT; + int callbackResult = paContinue ; + + VVDBUG(("AudioIOProc()\n")); + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + /* -----------------------------------------------------------------*\ + This output may be useful for debugging, + But printing durring the callback is a bad enough idea that + this is not enabled by enableing the usual debugging calls. + \* -----------------------------------------------------------------*/ + /* + static int renderCount = 0; + static int inputCount = 0; + printf( "------------------- starting reder/input\n" ); + if( isRender ) + printf("Render callback (%d):\t", ++renderCount); + else + printf("Input callback (%d):\t", ++inputCount); + printf( "Call totals: %d (input), %d (render)\n", inputCount, renderCount ); + + printf( "--- inBusNumber: %lu\n", inBusNumber ); + printf( "--- inNumberFrames: %lu\n", inNumberFrames ); + printf( "--- %x ioData\n", (unsigned) ioData ); + if( ioData ) + { + int i=0; + printf( "--- ioData.mNumBuffers %lu: \n", ioData->mNumberBuffers ); + for( i=0; imNumberBuffers; ++i ) + printf( "--- ioData buffer %d size: %lu.\n", i, ioData->mBuffers[i].mDataByteSize ); + } + ----------------------------------------------------------------- */ + + if( !stream->isTimeSet ) + setStreamStartTime( stream ); + + if( isRender ) { + AudioTimeStamp currentTime; + timeInfo.outputBufferDacTime = TimeStampToSecs(stream, inTimeStamp); + AudioDeviceGetCurrentTime(stream->outputDevice, ¤tTime); + timeInfo.currentTime = TimeStampToSecs(stream, ¤tTime); + } + if( isRender && stream->inputUnit == stream->outputUnit ) + timeInfo.inputBufferAdcTime = TimeStampToSecs(stream, inTimeStamp); + if( !isRender ) { + AudioTimeStamp currentTime; + timeInfo.inputBufferAdcTime = TimeStampToSecs(stream, inTimeStamp); + AudioDeviceGetCurrentTime(stream->inputDevice, ¤tTime); + timeInfo.currentTime = TimeStampToSecs(stream, ¤tTime); + } + + //printf( "---%g, %g, %g\n", timeInfo.inputBufferAdcTime, timeInfo.currentTime, timeInfo.outputBufferDacTime ); + + if( isRender && stream->inputUnit == stream->outputUnit + && !stream->inputSRConverter ) + { + /* --------- Full Duplex, One Device, no SR Conversion ------- + * + * This is the lowest latency case, and also the simplest. + * Input data and output data are available at the same time. + * we do not use the input SR converter or the input ring buffer. + * + */ + OSErr err = 0; + unsigned long frames; + + /* -- start processing -- */ + PaUtil_BeginBufferProcessing( &(stream->bufferProcessor), + &timeInfo, + stream->xrunFlags ); + stream->xrunFlags = 0; + + /* -- compute frames. do some checks -- */ + assert( ioData->mNumberBuffers == 1 ); + assert( ioData->mBuffers[0].mNumberChannels == stream->userOutChan ); + frames = ioData->mBuffers[0].mDataByteSize; + frames /= sizeof( float ) * ioData->mBuffers[0].mNumberChannels; + /* -- copy and process input data -- */ + err= AudioUnitRender(stream->inputUnit, + ioActionFlags, + inTimeStamp, + INPUT_ELEMENT, + inNumberFrames, + &stream->inputAudioBufferList ); + /* FEEDBACK: I'm not sure what to do when this call fails */ + assert( !err ); + + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + stream->inputAudioBufferList.mBuffers[0].mData, + stream->inputAudioBufferList.mBuffers[0].mNumberChannels); + /* -- Copy and process output data -- */ + PaUtil_SetOutputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedOutputChannels( &(stream->bufferProcessor), + 0, + ioData->mBuffers[0].mData, + ioData->mBuffers[0].mNumberChannels); + /* -- complete processing -- */ + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + else if( isRender ) + { + /* -------- Output Side of Full Duplex (Separate Devices or SR Conversion) + * -- OR Simplex Output + * + * This case handles output data as in the full duplex case, + * and, if there is input data, reads it off the ring buffer + * and into the PA buffer processor. If sample rate conversion + * is required on input, that is done here as well. + */ + unsigned long frames; + + /* Sometimes, when stopping a duplex stream we get erroneous + xrun flags, so if this is our last run, clear the flags. */ + int xrunFlags = stream->xrunFlags; +/* + if( xrunFlags & paInputUnderflow ) + printf( "input underflow.\n" ); + if( xrunFlags & paInputOverflow ) + printf( "input overflow.\n" ); +*/ + if( stream->state == STOPPING || stream->state == CALLBACK_STOPPED ) + xrunFlags = 0; + + /* -- start processing -- */ + PaUtil_BeginBufferProcessing( &(stream->bufferProcessor), + &timeInfo, + xrunFlags ); + stream->xrunFlags = 0; /* FEEDBACK: we only send flags to Buf Proc once */ + + /* -- Copy and process output data -- */ + assert( ioData->mNumberBuffers == 1 ); + frames = ioData->mBuffers[0].mDataByteSize; + frames /= sizeof( float ) * ioData->mBuffers[0].mNumberChannels; + assert( ioData->mBuffers[0].mNumberChannels == stream->userOutChan ); + PaUtil_SetOutputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedOutputChannels( &(stream->bufferProcessor), + 0, + ioData->mBuffers[0].mData, + ioData->mBuffers[0].mNumberChannels); + + /* -- copy and process input data, and complete processing -- */ + if( stream->inputUnit ) { + const int flsz = sizeof( float ); + /* Here, we read the data out of the ring buffer, through the + audio converter. */ + int inChan = stream->inputAudioBufferList.mBuffers[0].mNumberChannels; + if( stream->inputSRConverter ) + { + OSStatus err; + UInt32 size; + float data[ inChan * frames ]; + size = sizeof( data ); + err = AudioConverterFillBuffer( + stream->inputSRConverter, + ringBufferIOProc, + &stream->inputRingBuffer, + &size, + (void *)&data ); + if( err == RING_BUFFER_EMPTY ) + { /*the ring buffer callback underflowed */ + err = 0; + bzero( ((char *)data) + size, sizeof(data)-size ); + stream->xrunFlags |= paInputUnderflow; + } + ERR( err ); + assert( !err ); + + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data, + inChan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + else + { + /* Without the AudioConverter is actually a bit more complex + because we have to do a little buffer processing that the + AudioConverter would otherwise handle for us. */ + void *data1, *data2; + long size1, size2; + RingBuffer_GetReadRegions( &stream->inputRingBuffer, + inChan*frames*flsz, + &data1, &size1, + &data2, &size2 ); + if( size1 / ( flsz * inChan ) == frames ) { + /* simplest case: all in first buffer */ + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data1, + inChan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + RingBuffer_AdvanceReadIndex(&stream->inputRingBuffer, size1 ); + } else if( ( size1 + size2 ) / ( flsz * inChan ) < frames ) { + /*we underflowed. take what data we can, zero the rest.*/ + float data[frames*inChan]; + if( size1 ) + memcpy( data, data1, size1 ); + if( size2 ) + memcpy( data+size1, data2, size2 ); + bzero( data+size1+size2, frames*flsz*inChan - size1 - size2 ); + + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data, + inChan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + RingBuffer_AdvanceReadIndex( &stream->inputRingBuffer, + size1+size2 ); + /* flag underflow */ + stream->xrunFlags |= paInputUnderflow; + } else { + /*we got all the data, but split between buffers*/ + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), + size1 / ( flsz * inChan ) ); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data1, + inChan ); + PaUtil_Set2ndInputFrameCount( &(stream->bufferProcessor), + size2 / ( flsz * inChan ) ); + PaUtil_Set2ndInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data2, + inChan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + RingBuffer_AdvanceReadIndex(&stream->inputRingBuffer, size1+size2 ); + } + } + } else { + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + + } + else + { + /* ------------------ Input + * + * First, we read off the audio data and put it in the ring buffer. + * if this is an input-only stream, we need to process it more, + * otherwise, we let the output case deal with it. + */ + OSErr err = 0; + int chan = stream->inputAudioBufferList.mBuffers[0].mNumberChannels ; + /* FIXME: looping here may not actually be necessary, but it was something I tried in testing. */ + do { + err= AudioUnitRender(stream->inputUnit, + ioActionFlags, + inTimeStamp, + INPUT_ELEMENT, + inNumberFrames, + &stream->inputAudioBufferList ); + if( err == -10874 ) + inNumberFrames /= 2; + } while( err == -10874 && inNumberFrames > 1 ); + /* FEEDBACK: I'm not sure what to do when this call fails */ + ERR( err ); + assert( !err ); + if( stream->inputSRConverter || stream->outputUnit ) + { + /* If this is duplex or we use a converter, put the data + into the ring buffer. */ + long bytesIn, bytesOut; + bytesIn = sizeof( float ) * inNumberFrames * chan; + bytesOut = RingBuffer_Write( &stream->inputRingBuffer, + stream->inputAudioBufferList.mBuffers[0].mData, + bytesIn ); + if( bytesIn != bytesOut ) + stream->xrunFlags |= paInputOverflow ; + } + else + { + /* for simplex input w/o SR conversion, + just pop the data into the buffer processor.*/ + PaUtil_BeginBufferProcessing( &(stream->bufferProcessor), + &timeInfo, + stream->xrunFlags ); + stream->xrunFlags = 0; + + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), inNumberFrames); + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + stream->inputAudioBufferList.mBuffers[0].mData, + chan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + if( !stream->outputUnit && stream->inputSRConverter ) + { + /* ------------------ Simplex Input w/ SR Conversion + * + * if this is a simplex input stream, we need to read off the buffer, + * do our sample rate conversion and pass the results to the buffer + * processor. + * The logic here is complicated somewhat by the fact that we don't + * know how much data is available, so we loop on reasonably sized + * chunks, and let the BufferProcessor deal with the rest. + * + */ + /*This might be too big or small depending on SR conversion*/ + float data[ chan * inNumberFrames ]; + OSStatus err; + do + { /*Run the buffer processor until we are out of data*/ + UInt32 size; + long f; + + size = sizeof( data ); + err = AudioConverterFillBuffer( + stream->inputSRConverter, + ringBufferIOProc, + &stream->inputRingBuffer, + &size, + (void *)data ); + if( err != RING_BUFFER_EMPTY ) + ERR( err ); + assert( err == 0 || err == RING_BUFFER_EMPTY ); + + f = size / ( chan * sizeof(float) ); + PaUtil_SetInputFrameCount( &(stream->bufferProcessor), f ); + if( f ) + { + PaUtil_BeginBufferProcessing( &(stream->bufferProcessor), + &timeInfo, + stream->xrunFlags ); + stream->xrunFlags = 0; + + PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), + 0, + data, + chan ); + framesProcessed = + PaUtil_EndBufferProcessing( &(stream->bufferProcessor), + &callbackResult ); + } + } while( callbackResult == paContinue && !err ); + } + } + + switch( callbackResult ) + { + case paContinue: break; + case paComplete: + case paAbort: + stream->isTimeSet = FALSE; + stream->state = CALLBACK_STOPPED ; + if( stream->outputUnit ) + AudioOutputUnitStop(stream->outputUnit); + if( stream->inputUnit ) + AudioOutputUnitStop(stream->inputUnit); + break; + } + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + return noErr; +} + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + /* This may be called from a failed OpenStream. + Therefore, each piece of info is treated seperately. */ + PaError result = paNoError; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + VVDBUG(("CloseStream()\n")); + VDBUG( ( "Closing stream.\n" ) ); + + if( stream ) { + if( stream->outputUnit && stream->outputUnit != stream->inputUnit ) { + AudioUnitUninitialize( stream->outputUnit ); + CloseComponent( stream->outputUnit ); + } + stream->outputUnit = NULL; + if( stream->inputUnit ) + { + AudioUnitUninitialize( stream->inputUnit ); + CloseComponent( stream->inputUnit ); + stream->inputUnit = NULL; + } + if( stream->inputRingBuffer.buffer ) + free( (void *) stream->inputRingBuffer.buffer ); + stream->inputRingBuffer.buffer = NULL; + /*TODO: is there more that needs to be done on error + from AudioConverterDispose?*/ + if( stream->inputSRConverter ) + ERR( AudioConverterDispose( stream->inputSRConverter ) ); + stream->inputSRConverter = NULL; + if( stream->inputAudioBufferList.mBuffers[0].mData ) + free( stream->inputAudioBufferList.mBuffers[0].mData ); + stream->inputAudioBufferList.mBuffers[0].mData = NULL; + + result = destroyBlioRingBuffers( &stream->blio ); + if( result ) + return result; + if( stream->bufferProcessorIsInitialized ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); + } + + return result; +} + + +static PaError StartStream( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + OSErr result = noErr; + VVDBUG(("StartStream()\n")); + VDBUG( ( "Starting stream.\n" ) ); + +#define ERR_WRAP(mac_err) do { result = mac_err ; if ( result != noErr ) return ERR(result) ; } while(0) + + /*FIXME: maybe want to do this on close/abort for faster start? */ + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + if( stream->inputSRConverter ) + ERR_WRAP( AudioConverterReset( stream->inputSRConverter ) ); + + /* -- start -- */ + stream->state = ACTIVE; + if( stream->inputUnit ) { + ERR_WRAP( AudioOutputUnitStart(stream->inputUnit) ); + } + if( stream->outputUnit && stream->outputUnit != stream->inputUnit ) { + ERR_WRAP( AudioOutputUnitStart(stream->outputUnit) ); + } + + //setStreamStartTime( stream ); + //stream->isTimeSet = TRUE; + + return paNoError; +#undef ERR_WRAP +} + + +static PaError StopStream( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + OSErr result = noErr; + PaError paErr; + VVDBUG(("StopStream()\n")); + + VDBUG( ("Waiting for BLIO.\n") ); + waitUntilBlioWriteBufferIsFlushed( &stream->blio ); + VDBUG( ( "Stopping stream.\n" ) ); + + stream->isTimeSet = FALSE; + stream->state = STOPPING; + +#define ERR_WRAP(mac_err) do { result = mac_err ; if ( result != noErr ) return ERR(result) ; } while(0) + /* -- stop and reset -- */ + if( stream->inputUnit == stream->outputUnit && stream->inputUnit ) + { + ERR_WRAP( AudioOutputUnitStop(stream->inputUnit) ); + ERR_WRAP( AudioUnitReset(stream->inputUnit, kAudioUnitScope_Global, 1) ); + ERR_WRAP( AudioUnitReset(stream->inputUnit, kAudioUnitScope_Global, 0) ); + } + else + { + if( stream->inputUnit ) + { + ERR_WRAP(AudioOutputUnitStop(stream->inputUnit) ); + ERR_WRAP(AudioUnitReset(stream->inputUnit,kAudioUnitScope_Global,1)); + } + if( stream->outputUnit ) + { + ERR_WRAP(AudioOutputUnitStop(stream->outputUnit)); + ERR_WRAP(AudioUnitReset(stream->outputUnit,kAudioUnitScope_Global,0)); + } + } + if( stream->inputRingBuffer.buffer ) { + RingBuffer_Flush( &stream->inputRingBuffer ); + bzero( (void *)stream->inputRingBuffer.buffer, + stream->inputRingBuffer.bufferSize ); + /* advance the write point a little, so we are reading from the + middle of the buffer. We'll need extra at the end because + testing has shown that this helps. */ + if( stream->outputUnit ) + RingBuffer_AdvanceWriteIndex( &stream->inputRingBuffer, + stream->inputRingBuffer.bufferSize + / RING_BUFFER_ADVANCE_DENOMINATOR ); + } + + stream->xrunFlags = 0; + stream->state = STOPPED; + + paErr = resetBlioRingBuffers( &stream->blio ); + if( paErr ) + return paErr; + +/* + //stream->isTimeSet = FALSE; +*/ + + VDBUG( ( "Stream Stopped.\n" ) ); + return paNoError; +#undef ERR_WRAP +} + +static PaError AbortStream( PaStream *s ) +{ + VVDBUG(("AbortStream()->StopStream()\n")); + VDBUG( ( "Aborting stream.\n" ) ); + /* We have nothing faster than StopStream. */ + return StopStream(s); +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + VVDBUG(("IsStreamStopped()\n")); + + return stream->state == STOPPED ? 1 : 0; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + VVDBUG(("IsStreamActive()\n")); + return ( stream->state == ACTIVE || stream->state == STOPPING ); +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + VVDBUG(("GetStreamCpuLoad()\n")); + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} diff --git a/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_blocking.c b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_blocking.c new file mode 100644 index 000000000..d9bdf80c2 --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_blocking.c @@ -0,0 +1,506 @@ +/* This file contains the implementation + * required for blocking I/O. It is separated from pa_mac_core.c simply to ease + * development. */ + +#include "pa_mac_core_blocking.h" +#include "pa_mac_core_internal.h" +#include +#ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS +# define OSAtomicOr32( a, b ) ( (*(b)) |= (a) ) +# define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) ) +#else +# include +#endif + +/* + * This fnuction determines the size of a particular sample format. + * if the format is not recognized, this returns zero. + */ +static size_t computeSampleSizeFromFormat( PaSampleFormat format ) +{ + switch( format ) { + case paFloat32: return 4; + case paInt32: return 4; + case paInt24: return 3; + case paInt16: return 2; + case paInt8: case paUInt8: return 1; + default: return 0; + } +} + + +/* + * Functions for initializing, resetting, and destroying BLIO structures. + * + */ + +/* This should be called with the relevant info when initializing a stream for + callback. */ +PaError initializeBlioRingBuffers( + PaMacBlio *blio, + PaSampleFormat inputSampleFormat, + PaSampleFormat outputSampleFormat, + size_t framesPerBuffer, + long ringBufferSize, + int inChan, + int outChan ) +{ + void *data; + int result; + + /* zeroify things */ + bzero( blio, sizeof( PaMacBlio ) ); + /* this is redundant, but the buffers are used to check + if the bufffers have been initialized, so we do it explicitly. */ + blio->inputRingBuffer.buffer = NULL; + blio->outputRingBuffer.buffer = NULL; + + /* initialize simple data */ + blio->inputSampleFormat = inputSampleFormat; + blio->inputSampleSize = computeSampleSizeFromFormat(inputSampleFormat); + blio->outputSampleFormat = outputSampleFormat; + blio->outputSampleSize = computeSampleSizeFromFormat(outputSampleFormat); + blio->framesPerBuffer = framesPerBuffer; + blio->inChan = inChan; + blio->outChan = outChan; + blio->statusFlags = 0; + blio->errors = paNoError; +#ifdef PA_MAC_BLIO_MUTEX + blio->isInputEmpty = false; + blio->isOutputFull = false; +#endif + + /* setup ring buffers */ +#ifdef PA_MAC_BLIO_MUTEX + result = PaMacCore_SetUnixError( pthread_mutex_init(&(blio->inputMutex),NULL), 0 ); + if( result ) + goto error; + result = UNIX_ERR( pthread_cond_init( &(blio->inputCond), NULL ) ); + if( result ) + goto error; + result = UNIX_ERR( pthread_mutex_init(&(blio->outputMutex),NULL) ); + if( result ) + goto error; + result = UNIX_ERR( pthread_cond_init( &(blio->outputCond), NULL ) ); +#endif + if( inChan ) { + data = calloc( ringBufferSize, blio->inputSampleSize ); + if( !data ) + { + result = paInsufficientMemory; + goto error; + } + + assert( 0 == RingBuffer_Init( + &blio->inputRingBuffer, + ringBufferSize*blio->inputSampleSize, + data ) ); + } + if( outChan ) { + data = calloc( ringBufferSize, blio->outputSampleSize ); + if( !data ) + { + result = paInsufficientMemory; + goto error; + } + + assert( 0 == RingBuffer_Init( + &blio->outputRingBuffer, + ringBufferSize*blio->outputSampleSize, + data ) ); + } + + result = resetBlioRingBuffers( blio ); + if( result ) + goto error; + + return 0; + + error: + destroyBlioRingBuffers( blio ); + return result; +} + +#ifdef PA_MAC_BLIO_MUTEX +PaError blioSetIsInputEmpty( PaMacBlio *blio, bool isEmpty ) +{ + PaError result = paNoError; + if( isEmpty == blio->isInputEmpty ) + goto done; + + /* we need to update the value. Here's what we do: + * - Lock the mutex, so noone else can write. + * - update the value. + * - unlock. + * - broadcast to all listeners. + */ + result = UNIX_ERR( pthread_mutex_lock( &blio->inputMutex ) ); + if( result ) + goto done; + blio->isInputEmpty = isEmpty; + result = UNIX_ERR( pthread_mutex_unlock( &blio->inputMutex ) ); + if( result ) + goto done; + result = UNIX_ERR( pthread_cond_broadcast( &blio->inputCond ) ); + if( result ) + goto done; + + done: + return result; +} +PaError blioSetIsOutputFull( PaMacBlio *blio, bool isFull ) +{ + PaError result = paNoError; + if( isFull == blio->isOutputFull ) + goto done; + + /* we need to update the value. Here's what we do: + * - Lock the mutex, so noone else can write. + * - update the value. + * - unlock. + * - broadcast to all listeners. + */ + result = UNIX_ERR( pthread_mutex_lock( &blio->outputMutex ) ); + if( result ) + goto done; + blio->isOutputFull = isFull; + result = UNIX_ERR( pthread_mutex_unlock( &blio->outputMutex ) ); + if( result ) + goto done; + result = UNIX_ERR( pthread_cond_broadcast( &blio->outputCond ) ); + if( result ) + goto done; + + done: + return result; +} +#endif + +/* This should be called after stopping or aborting the stream, so that on next + start, the buffers will be ready. */ +PaError resetBlioRingBuffers( PaMacBlio *blio ) +{ +#ifdef PA_MAC__BLIO_MUTEX + int result; +#endif + blio->statusFlags = 0; + if( blio->outputRingBuffer.buffer ) { + RingBuffer_Flush( &blio->outputRingBuffer ); + bzero( blio->outputRingBuffer.buffer, + blio->outputRingBuffer.bufferSize ); + /* Advance buffer */ + RingBuffer_AdvanceWriteIndex( &blio->outputRingBuffer, blio->outputRingBuffer.bufferSize ); + + /* Update isOutputFull. */ +#ifdef PA_MAC__BLIO_MUTEX + result = blioSetIsOutputFull( blio, toAdvance == blio->outputRingBuffer.bufferSize ); + if( result ) + goto error; +#endif +/* + printf( "------%d\n" , blio->framesPerBuffer ); + printf( "------%d\n" , blio->outChan ); + printf( "------%d\n" , blio->outputSampleSize ); + printf( "------%d\n" , blio->framesPerBuffer*blio->outChan*blio->outputSampleSize ); +*/ + } + if( blio->inputRingBuffer.buffer ) { + RingBuffer_Flush( &blio->inputRingBuffer ); + bzero( blio->inputRingBuffer.buffer, + blio->inputRingBuffer.bufferSize ); + /* Update isInputEmpty. */ +#ifdef PA_MAC__BLIO_MUTEX + result = blioSetIsInputEmpty( blio, true ); + if( result ) + goto error; +#endif + } + return paNoError; +#ifdef PA_MAC__BLIO_MUTEX + error: + return result; +#endif +} + +/*This should be called when you are done with the blio. It can safely be called + multiple times if there are no exceptions. */ +PaError destroyBlioRingBuffers( PaMacBlio *blio ) +{ + PaError result = paNoError; + if( blio->inputRingBuffer.buffer ) { + free( blio->inputRingBuffer.buffer ); +#ifdef PA_MAC__BLIO_MUTEX + result = UNIX_ERR( pthread_mutex_destroy( & blio->inputMutex ) ); + if( result ) return result; + result = UNIX_ERR( pthread_cond_destroy( & blio->inputCond ) ); + if( result ) return result; +#endif + } + blio->inputRingBuffer.buffer = NULL; + if( blio->outputRingBuffer.buffer ) { + free( blio->outputRingBuffer.buffer ); +#ifdef PA_MAC__BLIO_MUTEX + result = UNIX_ERR( pthread_mutex_destroy( & blio->outputMutex ) ); + if( result ) return result; + result = UNIX_ERR( pthread_cond_destroy( & blio->outputCond ) ); + if( result ) return result; +#endif + } + blio->outputRingBuffer.buffer = NULL; + + return result; +} + +/* + * this is the BlioCallback function. It expects to recieve a PaMacBlio Object + * pointer as userData. + * + */ +int BlioCallback( const void *input, void *output, unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + PaMacBlio *blio = (PaMacBlio*)userData; + long avail; + long toRead; + long toWrite; + + /* set flags returned by OS: */ + OSAtomicOr32( statusFlags, &blio->statusFlags ) ; + + /* --- Handle Input Buffer --- */ + if( blio->inChan ) { + avail = RingBuffer_GetWriteAvailable( &blio->inputRingBuffer ); + + /* check for underflow */ + if( avail < frameCount * blio->inputSampleSize * blio->inChan ) + OSAtomicOr32( paInputOverflow, &blio->statusFlags ); + + toRead = MIN( avail, frameCount * blio->inputSampleSize * blio->inChan ); + + /* copy the data */ + /*printf( "reading %d\n", toRead );*/ + assert( toRead == RingBuffer_Write( &blio->inputRingBuffer, input, toRead ) ); +#ifdef PA_MAC__BLIO_MUTEX + /* Priority inversion. See notes below. */ + blioSetIsInputEmpty( blio, false ); +#endif + } + + + /* --- Handle Output Buffer --- */ + if( blio->outChan ) { + avail = RingBuffer_GetReadAvailable( &blio->outputRingBuffer ); + + /* check for underflow */ + if( avail < frameCount * blio->outputSampleSize * blio->outChan ) + OSAtomicOr32( paOutputUnderflow, &blio->statusFlags ); + + toWrite = MIN( avail, frameCount * blio->outputSampleSize * blio->outChan ); + + if( toWrite != frameCount * blio->outputSampleSize * blio->outChan ) + bzero( ((char *)output)+toWrite, + frameCount * blio->outputSampleSize * blio->outChan - toWrite ); + /* copy the data */ + /*printf( "writing %d\n", toWrite );*/ + assert( toWrite == RingBuffer_Read( &blio->outputRingBuffer, output, toWrite ) ); +#ifdef PA_MAC__BLIO_MUTEX + /* We have a priority inversion here. However, we will only have to + wait if this was true and is now false, which means we've got + some room in the buffer. + Hopefully problems will be minimized. */ + blioSetIsOutputFull( blio, false ); +#endif + } + + return paContinue; +} + +PaError ReadStream( PaStream* stream, + void *buffer, + unsigned long frames ) +{ + PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio; + char *cbuf = (char *) buffer; + PaError ret = paNoError; + VVDBUG(("ReadStream()\n")); + + while( frames > 0 ) { + long avail; + long toRead; + do { + avail = RingBuffer_GetReadAvailable( &blio->inputRingBuffer ); +/* + printf( "Read Buffer is %%%g full: %ld of %ld.\n", + 100 * (float)avail / (float) blio->inputRingBuffer.bufferSize, + avail, blio->inputRingBuffer.bufferSize ); +*/ + if( avail == 0 ) { +#ifdef PA_MAC_BLIO_MUTEX + /**block when empty*/ + ret = UNIX_ERR( pthread_mutex_lock( &blio->inputMutex ) ); + if( ret ) + return ret; + while( blio->isInputEmpty ) { + ret = UNIX_ERR( pthread_cond_wait( &blio->inputCond, &blio->inputMutex ) ); + if( ret ) + return ret; + } + ret = UNIX_ERR( pthread_mutex_unlock( &blio->inputMutex ) ); + if( ret ) + return ret; +#else + Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL ); +#endif + } + } while( avail == 0 ); + toRead = MIN( avail, frames * blio->inputSampleSize * blio->inChan ); + toRead -= toRead % blio->inputSampleSize * blio->inChan ; + RingBuffer_Read( &blio->inputRingBuffer, (void *)cbuf, toRead ); + cbuf += toRead; + frames -= toRead / ( blio->inputSampleSize * blio->inChan ); + + if( toRead == avail ) { +#ifdef PA_MAC_BLIO_MUTEX + /* we just emptied the buffer, so we need to mark it as empty. */ + ret = blioSetIsInputEmpty( blio, true ); + if( ret ) + return ret; + /* of course, in the meantime, the callback may have put some sats + in, so + so check for that, too, to avoid a race condition. */ + if( RingBuffer_GetReadAvailable( &blio->inputRingBuffer ) ) { + blioSetIsInputEmpty( blio, false ); + if( ret ) + return ret; + } +#endif + } + } + + /* Report either paNoError or paInputOverflowed. */ + /* may also want to report other errors, but this is non-standard. */ + ret = blio->statusFlags & paInputOverflow; + + /* report underflow only once: */ + if( ret ) { + OSAtomicAnd32( ~paInputOverflow, &blio->statusFlags ); + ret = paInputOverflowed; + } + + return ret; +} + + +PaError WriteStream( PaStream* stream, + const void *buffer, + unsigned long frames ) +{ + PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio; + char *cbuf = (char *) buffer; + PaError ret = paNoError; + VVDBUG(("WriteStream()\n")); + + while( frames > 0 ) { + long avail = 0; + long toWrite; + + do { + avail = RingBuffer_GetWriteAvailable( &blio->outputRingBuffer ); +/* + printf( "Write Buffer is %%%g full: %ld of %ld.\n", + 100 - 100 * (float)avail / (float) blio->outputRingBuffer.bufferSize, + avail, blio->outputRingBuffer.bufferSize ); +*/ + if( avail == 0 ) { +#ifdef PA_MAC_BLIO_MUTEX + /*block while full*/ + ret = UNIX_ERR( pthread_mutex_lock( &blio->outputMutex ) ); + if( ret ) + return ret; + while( blio->isOutputFull ) { + ret = UNIX_ERR( pthread_cond_wait( &blio->outputCond, &blio->outputMutex ) ); + if( ret ) + return ret; + } + ret = UNIX_ERR( pthread_mutex_unlock( &blio->outputMutex ) ); + if( ret ) + return ret; +#else + Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL ); +#endif + } + } while( avail == 0 ); + + toWrite = MIN( avail, frames * blio->outputSampleSize * blio->outChan ); + toWrite -= toWrite % blio->outputSampleSize * blio->outChan ; + RingBuffer_Write( &blio->outputRingBuffer, (void *)cbuf, toWrite ); + cbuf += toWrite; + frames -= toWrite / ( blio->outputSampleSize * blio->outChan ); + +#ifdef PA_MAC_BLIO_MUTEX + if( toWrite == avail ) { + /* we just filled up the buffer, so we need to mark it as filled. */ + ret = blioSetIsOutputFull( blio, true ); + if( ret ) + return ret; + /* of course, in the meantime, we may have emptied the buffer, so + so check for that, too, to avoid a race condition. */ + if( RingBuffer_GetWriteAvailable( &blio->outputRingBuffer ) ) { + blioSetIsOutputFull( blio, false ); + if( ret ) + return ret; + } + } +#endif + } + + /* Report either paNoError or paOutputUnderflowed. */ + /* may also want to report other errors, but this is non-standard. */ + ret = blio->statusFlags & paOutputUnderflow; + + /* report underflow only once: */ + if( ret ) { + OSAtomicAnd32( ~paOutputUnderflow, &blio->statusFlags ); + ret = paOutputUnderflowed; + } + + return ret; +} + +/* + * + */ +void waitUntilBlioWriteBufferIsFlushed( PaMacBlio *blio ) +{ + if( blio->outputRingBuffer.buffer ) { + long avail = RingBuffer_GetWriteAvailable( &blio->outputRingBuffer ); + while( avail != blio->outputRingBuffer.bufferSize ) { + if( avail == 0 ) + Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL ); + avail = RingBuffer_GetWriteAvailable( &blio->outputRingBuffer ); + } + } +} + + +signed long GetStreamReadAvailable( PaStream* stream ) +{ + PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio; + VVDBUG(("GetStreamReadAvailable()\n")); + + return RingBuffer_GetReadAvailable( &blio->inputRingBuffer ) + / ( blio->outputSampleSize * blio->outChan ); +} + + +signed long GetStreamWriteAvailable( PaStream* stream ) +{ + PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio; + VVDBUG(("GetStreamWriteAvailable()\n")); + + return RingBuffer_GetWriteAvailable( &blio->outputRingBuffer ) + / ( blio->outputSampleSize * blio->outChan ); +} + diff --git a/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_blocking.h b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_blocking.h new file mode 100644 index 000000000..657689cf8 --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_blocking.h @@ -0,0 +1,76 @@ + +#ifndef PA_MAC_CORE_BLOCKING_H_ +#define PA_MAC_CORE_BLOCKING_H_ + +#include "ringbuffer.h" +#include "portaudio.h" +#include "pa_mac_core_utilities.h" + +/* + * Number of miliseconds to busy wait whil waiting for data in blocking calls. + */ +#define PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL (5) +/* + * Define exactly one of these blocking methods + * PA_MAC_BLIO_MUTEX is not actively maintained. + */ +#define PA_MAC_BLIO_BUSY_WAIT +/* +#define PA_MAC_BLIO_MUTEX +*/ + +typedef struct { + RingBuffer inputRingBuffer; + RingBuffer outputRingBuffer; + PaSampleFormat inputSampleFormat; + size_t inputSampleSize; + PaSampleFormat outputSampleFormat; + size_t outputSampleSize; + + size_t framesPerBuffer; + + int inChan; + int outChan; + + //PaStreamCallbackFlags statusFlags; + uint32_t statusFlags; + PaError errors; + + /* Here we handle blocking, using condition variables. */ +#ifdef PA_MAC_BLIO_MUTEX + volatile bool isInputEmpty; + pthread_mutex_t inputMutex; + pthread_cond_t inputCond; + + volatile bool isOutputFull; + pthread_mutex_t outputMutex; + pthread_cond_t outputCond; +#endif +} +PaMacBlio; + +/* + * These functions operate on condition and related variables. + */ + +PaError initializeBlioRingBuffers( + PaMacBlio *blio, + PaSampleFormat inputSampleFormat, + PaSampleFormat outputSampleFormat, + size_t framesPerBuffer, + long ringBufferSize, + int inChan, + int outChan ); +PaError destroyBlioRingBuffers( PaMacBlio *blio ); +PaError resetBlioRingBuffers( PaMacBlio *blio ); + +int BlioCallback( + const void *input, void *output, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + +void waitUntilBlioWriteBufferIsFlushed( PaMacBlio *blio ); + +#endif /*PA_MAC_CORE_BLOCKING_H_*/ diff --git a/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_internal.h b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_internal.h new file mode 100644 index 000000000..5e15ad5cc --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_internal.h @@ -0,0 +1,155 @@ +/* + * This is the AUHAL implementation of portaudio. + * + * Written by Bjorn Roche of XO Audio LLC, from PA skeleton code. + * Portions copied from code by Dominic Mazzoni (who wrote a HAL implementation) + * + * Dominic's code was based on code by Phil Burk, Darren Gibbs, + * Gord Peters, Stephane Letz, and Greg Pfiel. + * + * Bjorn Roche and XO Audio LLC reserve no rights to this code. + * The maintainers of PortAudio may redistribute and modify the code and + * licenses as they deam appropriate. + * + * The following people also deserve acknowledgements: + * + * Olivier Tristan for feedback and testing + * Glenn Zelniker and Z-Systems engineering for sponsoring the Blocking I/O + * interface. + * + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** + @file pa_mac_core + @author Bjorn Roche + @brief AUHAL implementation of PortAudio +*/ + +#ifndef PA_MAC_CORE_INTERNAL_H__ +#define PA_MAC_CORE_INTERNAL_H__ + +#include +#include + + +#include "portaudio.h" +#include "pa_util.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_allocation.h" +#include "pa_cpuload.h" +#include "pa_process.h" +#include "ringbuffer.h" + +#include "pa_mac_core_blocking.h" + +/* function prototypes */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#define RING_BUFFER_ADVANCE_DENOMINATOR (4) + +PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +signed long GetStreamReadAvailable( PaStream* stream ); +signed long GetStreamWriteAvailable( PaStream* stream ); +/* PaMacAUHAL - host api datastructure specific to this implementation */ +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ + long devCount; + AudioDeviceID *devIds; /*array of all audio devices*/ + AudioDeviceID defaultIn; + AudioDeviceID defaultOut; +} +PaMacAUHAL; + + + +/* stream data structure specifically for this implementation */ +typedef struct PaMacCoreStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + /* implementation specific data goes here */ + bool bufferProcessorIsInitialized; + AudioUnit inputUnit; + AudioUnit outputUnit; + AudioDeviceID inputDevice; + AudioDeviceID outputDevice; + size_t userInChan; + size_t userOutChan; + size_t inputFramesPerBuffer; + size_t outputFramesPerBuffer; + PaMacBlio blio; + /* We use this ring buffer when input and out devs are different. */ + RingBuffer inputRingBuffer; + /* We may need to do SR conversion on input. */ + AudioConverterRef inputSRConverter; + /* We need to preallocate an inputBuffer for reading data. */ + AudioBufferList inputAudioBufferList; + AudioTimeStamp startTime; + volatile PaStreamCallbackFlags xrunFlags; + volatile bool isTimeSet; + volatile enum { + STOPPED = 0, /* playback is completely stopped, + and the user has called StopStream(). */ + CALLBACK_STOPPED = 1, /* callback has requested stop, + but user has not yet called StopStream(). */ + STOPPING = 2, /* The stream is in the process of closing. + This state is just used internally; + externally it is indistinguishable from + ACTIVE.*/ + ACTIVE = 3 /* The stream is active and running. */ + } state; + double sampleRate; + //these may be different from the stream sample rate due to SR conversion: + double outDeviceSampleRate; + double inDeviceSampleRate; +} +PaMacCoreStream; + +#endif /* PA_MAC_CORE_INTERNAL_H__ */ diff --git a/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_old.c b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_old.c new file mode 100644 index 000000000..d9a2df26c --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_old.c @@ -0,0 +1,907 @@ +/* + * $Id$ + * pa_mac_core.c + * Implementation of PortAudio for Mac OS X CoreAudio + * + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * + * Authors: Ross Bencina and Phil Burk + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include +#include +#include +#include + +#include "portaudio.h" +#include "pa_trace.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + +// ===== constants ===== + +// ===== structs ===== +#pragma mark structs + +// PaMacCoreHostApiRepresentation - host api datastructure specific to this implementation +typedef struct PaMacCore_HAR +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + AudioDeviceID *macCoreDeviceIds; +} +PaMacCoreHostApiRepresentation; + +typedef struct PaMacCore_DI +{ + PaDeviceInfo inheritedDeviceInfo; +} +PaMacCoreDeviceInfo; + +// PaMacCoreStream - a stream data structure specifically for this implementation +typedef struct PaMacCore_S +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + int primeStreamUsingCallback; + + AudioDeviceID inputDevice; + AudioDeviceID outputDevice; + + // Processing thread management -------------- +// HANDLE abortEvent; +// HANDLE processingThread; +// DWORD processingThreadId; + + char throttleProcessingThreadOnOverload; // 0 -> don't throtte, non-0 -> throttle + int processingThreadPriority; + int highThreadPriority; + int throttledThreadPriority; + unsigned long throttledSleepMsecs; + + int isStopped; + volatile int isActive; + volatile int stopProcessing; // stop thread once existing buffers have been returned + volatile int abortProcessing; // stop thread immediately + +// DWORD allBuffersDurationMs; // used to calculate timeouts +} +PaMacCoreStream; + +// Data needed by the CoreAudio callback functions +typedef struct PaMacCore_CD +{ + PaMacCoreStream *stream; + PaStreamCallback *callback; + void *userData; + PaUtilConverter *inputConverter; + PaUtilConverter *outputConverter; + void *inputBuffer; + void *outputBuffer; + int inputChannelCount; + int outputChannelCount; + PaSampleFormat inputSampleFormat; + PaSampleFormat outputSampleFormat; + PaUtilTriangularDitherGenerator *ditherGenerator; +} +PaMacClientData; + +// ===== CoreAudio-PortAudio bridge functions ===== +#pragma mark CoreAudio-PortAudio bridge functions + +// Maps CoreAudio OSStatus codes to PortAudio PaError codes +static PaError conv_err(OSStatus error) +{ + PaError result; + + switch (error) { + case kAudioHardwareNoError: + result = paNoError; break; + case kAudioHardwareNotRunningError: + result = paInternalError; break; + case kAudioHardwareUnspecifiedError: + result = paInternalError; break; + case kAudioHardwareUnknownPropertyError: + result = paInternalError; break; + case kAudioHardwareBadPropertySizeError: + result = paInternalError; break; + case kAudioHardwareIllegalOperationError: + result = paInternalError; break; + case kAudioHardwareBadDeviceError: + result = paInvalidDevice; break; + case kAudioHardwareBadStreamError: + result = paBadStreamPtr; break; + case kAudioHardwareUnsupportedOperationError: + result = paInternalError; break; + case kAudioDeviceUnsupportedFormatError: + result = paSampleFormatNotSupported; break; + case kAudioDevicePermissionsError: + result = paDeviceUnavailable; break; + default: + result = paInternalError; + } + + return result; +} + +/* This function is unused +static AudioStreamBasicDescription *InitializeStreamDescription(const PaStreamParameters *parameters, double sampleRate) +{ + struct AudioStreamBasicDescription *streamDescription = PaUtil_AllocateMemory(sizeof(AudioStreamBasicDescription)); + streamDescription->mSampleRate = sampleRate; + streamDescription->mFormatID = kAudioFormatLinearPCM; + streamDescription->mFormatFlags = 0; + streamDescription->mFramesPerPacket = 1; + + if (parameters->sampleFormat & paNonInterleaved) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsNonInterleaved; + streamDescription->mChannelsPerFrame = 1; + streamDescription->mBytesPerFrame = Pa_GetSampleSize(parameters->sampleFormat); + streamDescription->mBytesPerPacket = Pa_GetSampleSize(parameters->sampleFormat); + } + else { + streamDescription->mChannelsPerFrame = parameters->channelCount; + } + + streamDescription->mBytesPerFrame = Pa_GetSampleSize(parameters->sampleFormat) * streamDescription->mChannelsPerFrame; + streamDescription->mBytesPerPacket = streamDescription->mBytesPerFrame * streamDescription->mFramesPerPacket; + + if (parameters->sampleFormat & paFloat32) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsFloat; + streamDescription->mBitsPerChannel = 32; + } + else if (parameters->sampleFormat & paInt32) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + streamDescription->mBitsPerChannel = 32; + } + else if (parameters->sampleFormat & paInt24) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + streamDescription->mBitsPerChannel = 24; + } + else if (parameters->sampleFormat & paInt16) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + streamDescription->mBitsPerChannel = 16; + } + else if (parameters->sampleFormat & paInt8) { + streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + streamDescription->mBitsPerChannel = 8; + } + else if (parameters->sampleFormat & paInt32) { + streamDescription->mBitsPerChannel = 8; + } + + return streamDescription; +} +*/ + +static PaStreamCallbackTimeInfo *InitializeTimeInfo(const AudioTimeStamp* now, const AudioTimeStamp* inputTime, const AudioTimeStamp* outputTime) +{ + PaStreamCallbackTimeInfo *timeInfo = PaUtil_AllocateMemory(sizeof(PaStreamCallbackTimeInfo)); + + timeInfo->inputBufferAdcTime = inputTime->mSampleTime; + timeInfo->currentTime = now->mSampleTime; + timeInfo->outputBufferDacTime = outputTime->mSampleTime; + + return timeInfo; +} + +// ===== support functions ===== +#pragma mark support functions + +static void CleanUp(PaMacCoreHostApiRepresentation *macCoreHostApi) +{ + if( macCoreHostApi->allocations ) + { + PaUtil_FreeAllAllocations( macCoreHostApi->allocations ); + PaUtil_DestroyAllocationGroup( macCoreHostApi->allocations ); + } + + PaUtil_FreeMemory( macCoreHostApi ); +} + +static PaError GetChannelInfo(PaDeviceInfo *deviceInfo, AudioDeviceID macCoreDeviceId, int isInput) +{ + UInt32 propSize; + PaError err = paNoError; + UInt32 i; + int numChannels = 0; + AudioBufferList *buflist; + + err = conv_err(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, NULL)); + buflist = PaUtil_AllocateMemory(propSize); + err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, buflist)); + if (!err) { + for (i = 0; i < buflist->mNumberBuffers; ++i) { + numChannels += buflist->mBuffers[i].mNumberChannels; + } + + if (isInput) + deviceInfo->maxInputChannels = numChannels; + else + deviceInfo->maxOutputChannels = numChannels; + + int frameLatency; + propSize = sizeof(UInt32); + err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyLatency, &propSize, &frameLatency)); + if (!err) { + double secondLatency = frameLatency / deviceInfo->defaultSampleRate; + if (isInput) { + deviceInfo->defaultLowInputLatency = secondLatency; + deviceInfo->defaultHighInputLatency = secondLatency; + } + else { + deviceInfo->defaultLowOutputLatency = secondLatency; + deviceInfo->defaultHighOutputLatency = secondLatency; + } + } + } + PaUtil_FreeMemory(buflist); + + return err; +} + +static PaError InitializeDeviceInfo(PaMacCoreDeviceInfo *macCoreDeviceInfo, AudioDeviceID macCoreDeviceId, PaHostApiIndex hostApiIndex ) +{ + PaDeviceInfo *deviceInfo = &macCoreDeviceInfo->inheritedDeviceInfo; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + PaError err = paNoError; + UInt32 propSize; + + err = conv_err(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, NULL)); + // FIXME: this allocation should be part of the allocations group + char *name = PaUtil_AllocateMemory(propSize); + err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, name)); + if (!err) { + deviceInfo->name = name; + } + + Float64 sampleRate; + propSize = sizeof(Float64); + err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyNominalSampleRate, &propSize, &sampleRate)); + if (!err) { + deviceInfo->defaultSampleRate = sampleRate; + } + + + // Get channel info + err = GetChannelInfo(deviceInfo, macCoreDeviceId, 1); + err = GetChannelInfo(deviceInfo, macCoreDeviceId, 0); + + return err; +} + +static PaError InitializeDeviceInfos( PaMacCoreHostApiRepresentation *macCoreHostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *hostApi; + PaMacCoreDeviceInfo *deviceInfoArray; + + // initialise device counts and default devices under the assumption that there are no devices. These values are incremented below if and when devices are successfully initialized. + hostApi = &macCoreHostApi->inheritedHostApiRep; + hostApi->info.deviceCount = 0; + hostApi->info.defaultInputDevice = paNoDevice; + hostApi->info.defaultOutputDevice = paNoDevice; + + UInt32 propsize; + AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &propsize, NULL); + int numDevices = propsize / sizeof(AudioDeviceID); + hostApi->info.deviceCount = numDevices; + if (numDevices > 0) { + hostApi->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + macCoreHostApi->allocations, sizeof(PaDeviceInfo*) * numDevices ); + if( !hostApi->deviceInfos ) + { + return paInsufficientMemory; + } + + // allocate all device info structs in a contiguous block + deviceInfoArray = (PaMacCoreDeviceInfo*)PaUtil_GroupAllocateMemory( + macCoreHostApi->allocations, sizeof(PaMacCoreDeviceInfo) * numDevices ); + if( !deviceInfoArray ) + { + return paInsufficientMemory; + } + + macCoreHostApi->macCoreDeviceIds = PaUtil_GroupAllocateMemory(macCoreHostApi->allocations, propsize); + AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &propsize, macCoreHostApi->macCoreDeviceIds); + + AudioDeviceID defaultInputDevice, defaultOutputDevice; + propsize = sizeof(AudioDeviceID); + AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, &propsize, &defaultInputDevice); + AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &propsize, &defaultOutputDevice); + + UInt32 i; + for (i = 0; i < numDevices; ++i) { + if (macCoreHostApi->macCoreDeviceIds[i] == defaultInputDevice) { + hostApi->info.defaultInputDevice = i; + } + if (macCoreHostApi->macCoreDeviceIds[i] == defaultOutputDevice) { + hostApi->info.defaultOutputDevice = i; + } + InitializeDeviceInfo(&deviceInfoArray[i], macCoreHostApi->macCoreDeviceIds[i], hostApiIndex); + hostApi->deviceInfos[i] = &(deviceInfoArray[i].inheritedDeviceInfo); + } + } + + return result; +} + +static OSStatus CheckFormat(AudioDeviceID macCoreDeviceId, const PaStreamParameters *parameters, double sampleRate, int isInput) +{ + UInt32 propSize = sizeof(AudioStreamBasicDescription); + AudioStreamBasicDescription *streamDescription = PaUtil_AllocateMemory(propSize); + + streamDescription->mSampleRate = sampleRate; + streamDescription->mFormatID = 0; + streamDescription->mFormatFlags = 0; + streamDescription->mBytesPerPacket = 0; + streamDescription->mFramesPerPacket = 0; + streamDescription->mBytesPerFrame = 0; + streamDescription->mChannelsPerFrame = 0; + streamDescription->mBitsPerChannel = 0; + streamDescription->mReserved = 0; + + OSStatus result = AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamFormatSupported, &propSize, streamDescription); + PaUtil_FreeMemory(streamDescription); + return result; +} + +static OSStatus CopyInputData(PaMacClientData* destination, const AudioBufferList *source, unsigned long frameCount) +{ + int frameSpacing, channelSpacing; + if (destination->inputSampleFormat & paNonInterleaved) { + frameSpacing = 1; + channelSpacing = destination->inputChannelCount; + } + else { + frameSpacing = destination->inputChannelCount; + channelSpacing = 1; + } + + AudioBuffer const *inputBuffer = &source->mBuffers[0]; + void *coreAudioBuffer = inputBuffer->mData; + void *portAudioBuffer = destination->inputBuffer; + UInt32 i, streamNumber, streamChannel; + for (i = streamNumber = streamChannel = 0; i < destination->inputChannelCount; ++i, ++streamChannel) { + if (streamChannel >= inputBuffer->mNumberChannels) { + ++streamNumber; + inputBuffer = &source->mBuffers[streamNumber]; + coreAudioBuffer = inputBuffer->mData; + streamChannel = 0; + } + destination->inputConverter(portAudioBuffer, frameSpacing, coreAudioBuffer, inputBuffer->mNumberChannels, frameCount, destination->ditherGenerator); + coreAudioBuffer += sizeof(Float32); + portAudioBuffer += Pa_GetSampleSize(destination->inputSampleFormat) * channelSpacing; + } + return noErr; +} + +static OSStatus CopyOutputData(AudioBufferList* destination, PaMacClientData *source, unsigned long frameCount) +{ + int frameSpacing, channelSpacing; + if (source->outputSampleFormat & paNonInterleaved) { + frameSpacing = 1; + channelSpacing = source->outputChannelCount; + } + else { + frameSpacing = source->outputChannelCount; + channelSpacing = 1; + } + + AudioBuffer *outputBuffer = &destination->mBuffers[0]; + void *coreAudioBuffer = outputBuffer->mData; + void *portAudioBuffer = source->outputBuffer; + UInt32 i, streamNumber, streamChannel; + for (i = streamNumber = streamChannel = 0; i < source->outputChannelCount; ++i, ++streamChannel) { + if (streamChannel >= outputBuffer->mNumberChannels) { + ++streamNumber; + outputBuffer = &destination->mBuffers[streamNumber]; + coreAudioBuffer = outputBuffer->mData; + streamChannel = 0; + } + source->outputConverter(coreAudioBuffer, outputBuffer->mNumberChannels, portAudioBuffer, frameSpacing, frameCount, NULL); + coreAudioBuffer += sizeof(Float32); + portAudioBuffer += Pa_GetSampleSize(source->outputSampleFormat) * channelSpacing; + } + return noErr; +} + +static OSStatus AudioIOProc( AudioDeviceID inDevice, + const AudioTimeStamp* inNow, + const AudioBufferList* inInputData, + const AudioTimeStamp* inInputTime, + AudioBufferList* outOutputData, + const AudioTimeStamp* inOutputTime, + void* inClientData) +{ + PaMacClientData *clientData = (PaMacClientData *)inClientData; + PaStreamCallbackTimeInfo *timeInfo = InitializeTimeInfo(inNow, inInputTime, inOutputTime); + + PaUtil_BeginCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer ); + + AudioBuffer *outputBuffer = &outOutputData->mBuffers[0]; + unsigned long frameCount = outputBuffer->mDataByteSize / (outputBuffer->mNumberChannels * sizeof(Float32)); + + if (clientData->inputBuffer) { + CopyInputData(clientData, inInputData, frameCount); + } + PaStreamCallbackResult result = clientData->callback(clientData->inputBuffer, clientData->outputBuffer, frameCount, timeInfo, paNoFlag, clientData->userData); + if (clientData->outputBuffer) { + CopyOutputData(outOutputData, clientData, frameCount); + } + + PaUtil_EndCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer, frameCount ); + + if (result == paComplete || result == paAbort) { + Pa_StopStream(clientData->stream); + } + + PaUtil_FreeMemory( timeInfo ); + return noErr; +} + +// This is not for input-only streams, this is for streams where the input device is different from the output device +static OSStatus AudioInputProc( AudioDeviceID inDevice, + const AudioTimeStamp* inNow, + const AudioBufferList* inInputData, + const AudioTimeStamp* inInputTime, + AudioBufferList* outOutputData, + const AudioTimeStamp* inOutputTime, + void* inClientData) +{ + PaMacClientData *clientData = (PaMacClientData *)inClientData; + PaStreamCallbackTimeInfo *timeInfo = InitializeTimeInfo(inNow, inInputTime, inOutputTime); + + PaUtil_BeginCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer ); + + AudioBuffer const *inputBuffer = &inInputData->mBuffers[0]; + unsigned long frameCount = inputBuffer->mDataByteSize / (inputBuffer->mNumberChannels * sizeof(Float32)); + + CopyInputData(clientData, inInputData, frameCount); + PaStreamCallbackResult result = clientData->callback(clientData->inputBuffer, clientData->outputBuffer, frameCount, timeInfo, paNoFlag, clientData->userData); + + PaUtil_EndCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer, frameCount ); + if( result == paComplete || result == paAbort ) + Pa_StopStream(clientData->stream); + PaUtil_FreeMemory( timeInfo ); + return noErr; +} + +// This is not for output-only streams, this is for streams where the input device is different from the output device +static OSStatus AudioOutputProc( AudioDeviceID inDevice, + const AudioTimeStamp* inNow, + const AudioBufferList* inInputData, + const AudioTimeStamp* inInputTime, + AudioBufferList* outOutputData, + const AudioTimeStamp* inOutputTime, + void* inClientData) +{ + PaMacClientData *clientData = (PaMacClientData *)inClientData; + //PaStreamCallbackTimeInfo *timeInfo = InitializeTimeInfo(inNow, inInputTime, inOutputTime); + + PaUtil_BeginCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer ); + + AudioBuffer *outputBuffer = &outOutputData->mBuffers[0]; + unsigned long frameCount = outputBuffer->mDataByteSize / (outputBuffer->mNumberChannels * sizeof(Float32)); + + //clientData->callback(NULL, clientData->outputBuffer, frameCount, timeInfo, paNoFlag, clientData->userData); + + CopyOutputData(outOutputData, clientData, frameCount); + + PaUtil_EndCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer, frameCount ); + return noErr; +} + +static PaError SetSampleRate(AudioDeviceID device, double sampleRate, int isInput) +{ + PaError result = paNoError; + + double actualSampleRate; + UInt32 propSize = sizeof(double); + result = conv_err(AudioDeviceSetProperty(device, NULL, 0, isInput, kAudioDevicePropertyNominalSampleRate, propSize, &sampleRate)); + + result = conv_err(AudioDeviceGetProperty(device, 0, isInput, kAudioDevicePropertyNominalSampleRate, &propSize, &actualSampleRate)); + + if (result == paNoError && actualSampleRate != sampleRate) { + result = paInvalidSampleRate; + } + + return result; +} + +static PaError SetFramesPerBuffer(AudioDeviceID device, unsigned long framesPerBuffer, int isInput) +{ + PaError result = paNoError; + UInt32 preferredFramesPerBuffer = framesPerBuffer; + // while (preferredFramesPerBuffer > UINT32_MAX) { + // preferredFramesPerBuffer /= 2; + // } + + UInt32 actualFramesPerBuffer; + UInt32 propSize = sizeof(UInt32); + result = conv_err(AudioDeviceSetProperty(device, NULL, 0, isInput, kAudioDevicePropertyBufferFrameSize, propSize, &preferredFramesPerBuffer)); + + result = conv_err(AudioDeviceGetProperty(device, 0, isInput, kAudioDevicePropertyBufferFrameSize, &propSize, &actualFramesPerBuffer)); + + if (result != paNoError) { + // do nothing + } + else if (actualFramesPerBuffer > framesPerBuffer) { + result = paBufferTooSmall; + } + else if (actualFramesPerBuffer < framesPerBuffer) { + result = paBufferTooBig; + } + + return result; +} + +static PaError SetUpUnidirectionalStream(AudioDeviceID device, double sampleRate, unsigned long framesPerBuffer, int isInput) +{ + PaError err = paNoError; + err = SetSampleRate(device, sampleRate, isInput); + if( err == paNoError ) + err = SetFramesPerBuffer(device, framesPerBuffer, isInput); + return err; +} + +// ===== PortAudio functions ===== +#pragma mark PortAudio functions + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + + PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif // __cplusplus + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaMacCoreHostApiRepresentation *macCoreHostApi = (PaMacCoreHostApiRepresentation*)hostApi; + + CleanUp(macCoreHostApi); +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaMacCoreHostApiRepresentation *macCoreHostApi = (PaMacCoreHostApiRepresentation*)hostApi; + PaDeviceInfo *deviceInfo; + + PaError result = paNoError; + if (inputParameters) { + deviceInfo = macCoreHostApi->inheritedHostApiRep.deviceInfos[inputParameters->device]; + if (inputParameters->channelCount > deviceInfo->maxInputChannels) + result = paInvalidChannelCount; + else if (CheckFormat(macCoreHostApi->macCoreDeviceIds[inputParameters->device], inputParameters, sampleRate, 1) != kAudioHardwareNoError) { + result = paInvalidSampleRate; + } + } + if (outputParameters && result == paNoError) { + deviceInfo = macCoreHostApi->inheritedHostApiRep.deviceInfos[outputParameters->device]; + if (outputParameters->channelCount > deviceInfo->maxOutputChannels) + result = paInvalidChannelCount; + else if (CheckFormat(macCoreHostApi->macCoreDeviceIds[outputParameters->device], outputParameters, sampleRate, 0) != kAudioHardwareNoError) { + result = paInvalidSampleRate; + } + } + + return result; +} + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError err = paNoError; + PaMacCoreHostApiRepresentation *macCoreHostApi = (PaMacCoreHostApiRepresentation *)hostApi; + PaMacCoreStream *stream = PaUtil_AllocateMemory(sizeof(PaMacCoreStream)); + stream->isActive = 0; + stream->isStopped = 1; + stream->inputDevice = kAudioDeviceUnknown; + stream->outputDevice = kAudioDeviceUnknown; + + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + ( (streamCallback) + ? &macCoreHostApi->callbackStreamInterface + : &macCoreHostApi->blockingStreamInterface ), + streamCallback, userData ); + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + *s = (PaStream*)stream; + PaMacClientData *clientData = PaUtil_AllocateMemory(sizeof(PaMacClientData)); + clientData->stream = stream; + clientData->callback = streamCallback; + clientData->userData = userData; + clientData->inputBuffer = 0; + clientData->outputBuffer = 0; + clientData->ditherGenerator = PaUtil_AllocateMemory(sizeof(PaUtilTriangularDitherGenerator)); + PaUtil_InitializeTriangularDitherState(clientData->ditherGenerator); + + if (inputParameters != NULL) { + stream->inputDevice = macCoreHostApi->macCoreDeviceIds[inputParameters->device]; + clientData->inputConverter = PaUtil_SelectConverter(paFloat32, inputParameters->sampleFormat, streamFlags); + clientData->inputBuffer = PaUtil_AllocateMemory(Pa_GetSampleSize(inputParameters->sampleFormat) * framesPerBuffer * inputParameters->channelCount); + clientData->inputChannelCount = inputParameters->channelCount; + clientData->inputSampleFormat = inputParameters->sampleFormat; + err = SetUpUnidirectionalStream(stream->inputDevice, sampleRate, framesPerBuffer, 1); + } + + if (err == paNoError && outputParameters != NULL) { + stream->outputDevice = macCoreHostApi->macCoreDeviceIds[outputParameters->device]; + clientData->outputConverter = PaUtil_SelectConverter(outputParameters->sampleFormat, paFloat32, streamFlags); + clientData->outputBuffer = PaUtil_AllocateMemory(Pa_GetSampleSize(outputParameters->sampleFormat) * framesPerBuffer * outputParameters->channelCount); + clientData->outputChannelCount = outputParameters->channelCount; + clientData->outputSampleFormat = outputParameters->sampleFormat; + err = SetUpUnidirectionalStream(stream->outputDevice, sampleRate, framesPerBuffer, 0); + } + + if (inputParameters == NULL || outputParameters == NULL || stream->inputDevice == stream->outputDevice) { + AudioDeviceID device = (inputParameters == NULL) ? stream->outputDevice : stream->inputDevice; + + AudioDeviceAddIOProc(device, AudioIOProc, clientData); + } + else { + // using different devices for input and output + AudioDeviceAddIOProc(stream->inputDevice, AudioInputProc, clientData); + AudioDeviceAddIOProc(stream->outputDevice, AudioOutputProc, clientData); + } + + return err; +} + +// Note: When CloseStream() is called, the multi-api layer ensures that the stream has already been stopped or aborted. +static PaError CloseStream( PaStream* s ) +{ + PaError err = paNoError; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + if (stream->inputDevice != kAudioDeviceUnknown) { + if (stream->outputDevice == kAudioDeviceUnknown || stream->outputDevice == stream->inputDevice) { + err = conv_err(AudioDeviceRemoveIOProc(stream->inputDevice, AudioIOProc)); + } + else { + err = conv_err(AudioDeviceRemoveIOProc(stream->inputDevice, AudioInputProc)); + err = conv_err(AudioDeviceRemoveIOProc(stream->outputDevice, AudioOutputProc)); + } + } + else { + err = conv_err(AudioDeviceRemoveIOProc(stream->outputDevice, AudioIOProc)); + } + + return err; +} + + +static PaError StartStream( PaStream *s ) +{ + PaError err = paNoError; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + if (stream->inputDevice != kAudioDeviceUnknown) { + if (stream->outputDevice == kAudioDeviceUnknown || stream->outputDevice == stream->inputDevice) { + err = conv_err(AudioDeviceStart(stream->inputDevice, AudioIOProc)); + } + else { + err = conv_err(AudioDeviceStart(stream->inputDevice, AudioInputProc)); + err = conv_err(AudioDeviceStart(stream->outputDevice, AudioOutputProc)); + } + } + else { + err = conv_err(AudioDeviceStart(stream->outputDevice, AudioIOProc)); + } + + stream->isActive = 1; + stream->isStopped = 0; + return err; +} + +static PaError AbortStream( PaStream *s ) +{ + PaError err = paNoError; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + if (stream->inputDevice != kAudioDeviceUnknown) { + if (stream->outputDevice == kAudioDeviceUnknown || stream->outputDevice == stream->inputDevice) { + err = conv_err(AudioDeviceStop(stream->inputDevice, AudioIOProc)); + } + else { + err = conv_err(AudioDeviceStop(stream->inputDevice, AudioInputProc)); + err = conv_err(AudioDeviceStop(stream->outputDevice, AudioOutputProc)); + } + } + else { + err = conv_err(AudioDeviceStop(stream->outputDevice, AudioIOProc)); + } + + stream->isActive = 0; + stream->isStopped = 1; + return err; +} + +static PaError StopStream( PaStream *s ) +{ + // TODO: this should be nicer than abort + return AbortStream(s); +} + +static PaError IsStreamStopped( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + return stream->isStopped; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + return stream->isActive; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + OSStatus err; + PaTime result; + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + AudioTimeStamp *timeStamp = PaUtil_AllocateMemory(sizeof(AudioTimeStamp)); + if (stream->inputDevice != kAudioDeviceUnknown) { + err = AudioDeviceGetCurrentTime(stream->inputDevice, timeStamp); + } + else { + err = AudioDeviceGetCurrentTime(stream->outputDevice, timeStamp); + } + + result = err ? 0 : timeStamp->mSampleTime; + PaUtil_FreeMemory(timeStamp); + + return result; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaMacCoreStream *stream = (PaMacCoreStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +// As separate stream interfaces are used for blocking and callback streams, the following functions can be guaranteed to only be called for blocking streams. + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + return paInternalError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + return paInternalError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + return paInternalError; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + return paInternalError; +} + +// HostAPI-specific initialization function +PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaMacCoreHostApiRepresentation *macCoreHostApi = (PaMacCoreHostApiRepresentation *)PaUtil_AllocateMemory( sizeof(PaMacCoreHostApiRepresentation) ); + if( !macCoreHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + macCoreHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !macCoreHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + *hostApi = &macCoreHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paCoreAudio; + (*hostApi)->info.name = "CoreAudio"; + + result = InitializeDeviceInfos(macCoreHostApi, hostApiIndex); + if (result != paNoError) { + goto error; + } + + // Set up the proper callbacks to this HostApi's functions + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &macCoreHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &macCoreHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( macCoreHostApi ) { + CleanUp(macCoreHostApi); + } + + return result; +} diff --git a/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_utilities.c b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_utilities.c new file mode 100644 index 000000000..29c851d8a --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_utilities.c @@ -0,0 +1,565 @@ +/* + * + * pa_mac_core_utilities.c + * + * utilitiy functions for pa_mac_core.c + * + * This functions are more like helper functions than part of the core, + * so I moved them to a separate file so the core code would be cleaner. + * + * by Bjorn Roche. + */ + +#include "pa_mac_core_utilities.h" + +PaError PaMacCore_SetUnixError( int err, int line ) +{ + PaError ret; + const char *errorText; + + if( err == 0 ) + { + return paNoError; + } + + ret = paNoError; + errorText = strerror( err ); + + /** Map Unix error to PaError. Pretty much the only one that maps + is ENOMEM. */ + if( err == ENOMEM ) + ret = paInsufficientMemory; + else + ret = paInternalError; + + DBUG(("%d on line %d: msg='%s'\n", err, line, errorText)); + PaUtil_SetLastHostErrorInfo( paCoreAudio, err, errorText ); + + return ret; +} + +/* + * Translates MacOS generated errors into PaErrors + */ +PaError PaMacCore_SetError(OSStatus error, int line, int isError) +{ + /*FIXME: still need to handle possible ComponentResult values.*/ + /* unfortunately, they don't seem to be documented anywhere.*/ + PaError result; + const char *errorType; + const char *errorText; + + switch (error) { + case kAudioHardwareNoError: + return paNoError; + case kAudioHardwareNotRunningError: + errorText = "Audio Hardware Not Running"; + result = paInternalError; break; + case kAudioHardwareUnspecifiedError: + errorText = "Unspecified Audio Hardware Error"; + result = paInternalError; break; + case kAudioHardwareUnknownPropertyError: + errorText = "Audio Hardware: Unknown Property"; + result = paInternalError; break; + case kAudioHardwareBadPropertySizeError: + errorText = "Audio Hardware: Bad Property Size"; + result = paInternalError; break; + case kAudioHardwareIllegalOperationError: + errorText = "Audio Hardware: Illegal Operation"; + result = paInternalError; break; + case kAudioHardwareBadDeviceError: + errorText = "Audio Hardware: Bad Device"; + result = paInvalidDevice; break; + case kAudioHardwareBadStreamError: + errorText = "Audio Hardware: BadStream"; + result = paBadStreamPtr; break; + case kAudioHardwareUnsupportedOperationError: + errorText = "Audio Hardware: Unsupported Operation"; + result = paInternalError; break; + case kAudioDeviceUnsupportedFormatError: + errorText = "Audio Device: Unsupported Format"; + result = paSampleFormatNotSupported; break; + case kAudioDevicePermissionsError: + errorText = "Audio Device: Permissions Error"; + result = paDeviceUnavailable; break; + /* Audio Unit Errors: http://developer.apple.com/documentation/MusicAudio/Reference/CoreAudio/audio_units/chapter_5_section_3.html */ + case kAudioUnitErr_InvalidProperty: + errorText = "Audio Unit: Invalid Property"; + result = paInternalError; break; + case kAudioUnitErr_InvalidParameter: + errorText = "Audio Unit: Invalid Parameter"; + result = paInternalError; break; + case kAudioUnitErr_NoConnection: + errorText = "Audio Unit: No Connection"; + result = paInternalError; break; + case kAudioUnitErr_FailedInitialization: + errorText = "Audio Unit: Initialization Failed"; + result = paInternalError; break; + case kAudioUnitErr_TooManyFramesToProcess: + errorText = "Audio Unit: Too Many Frames"; + result = paInternalError; break; + case kAudioUnitErr_IllegalInstrument: + errorText = "Audio Unit: Illegal Instrument"; + result = paInternalError; break; + case kAudioUnitErr_InstrumentTypeNotFound: + errorText = "Audio Unit: Instrument Type Not Found"; + result = paInternalError; break; + case kAudioUnitErr_InvalidFile: + errorText = "Audio Unit: Invalid File"; + result = paInternalError; break; + case kAudioUnitErr_UnknownFileType: + errorText = "Audio Unit: Unknown File Type"; + result = paInternalError; break; + case kAudioUnitErr_FileNotSpecified: + errorText = "Audio Unit: File Not Specified"; + result = paInternalError; break; + case kAudioUnitErr_FormatNotSupported: + errorText = "Audio Unit: Format Not Supported"; + result = paInternalError; break; + case kAudioUnitErr_Uninitialized: + errorText = "Audio Unit: Unitialized"; + result = paInternalError; break; + case kAudioUnitErr_InvalidScope: + errorText = "Audio Unit: Invalid Scope"; + result = paInternalError; break; + case kAudioUnitErr_PropertyNotWritable: + errorText = "Audio Unit: PropertyNotWritable"; + result = paInternalError; break; + case kAudioUnitErr_InvalidPropertyValue: + errorText = "Audio Unit: Invalid Property Value"; + result = paInternalError; break; + case kAudioUnitErr_PropertyNotInUse: + errorText = "Audio Unit: Property Not In Use"; + result = paInternalError; break; + case kAudioUnitErr_Initialized: + errorText = "Audio Unit: Initialized"; + result = paInternalError; break; + case kAudioUnitErr_InvalidOfflineRender: + errorText = "Audio Unit: Invalid Offline Render"; + result = paInternalError; break; + case kAudioUnitErr_Unauthorized: + errorText = "Audio Unit: Unauthorized"; + result = paInternalError; break; + case kAudioUnitErr_CannotDoInCurrentContext: + errorText = "Audio Unit: cannot do in current context"; + result = paInternalError; break; + default: + errorText = "Unknown Error"; + result = paInternalError; + } + + if (isError) + errorType = "Error"; + else + errorType = "Warning"; + + if ((int)error < -99999 || (int)error > 99999) + DBUG(("%s on line %d: err='%4s', msg='%s'\n", errorType, line, (const char *)&error, errorText)); + else + DBUG(("%s on line %d: err=%d, 0x%x, msg='%s'\n", errorType, line, (int)error, (unsigned)error, errorText)); + + PaUtil_SetLastHostErrorInfo( paCoreAudio, error, errorText ); + + return result; +} + +/* + * This function computes an appropriate ring buffer size given + * a requested latency (in seconds), sample rate and framesPerBuffer. + * + * The returned ringBufferSize is computed using the following + * constraints: + * - it must be at least 4. + * - it must be at least 3x framesPerBuffer. + * - it must be at least 2x the suggestedLatency. + * - it must be a power of 2. + * This function attempts to compute the minimum such size. + * + * FEEDBACK: too liberal/conservative/another way? + */ +long computeRingBufferSize( const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + long inputFramesPerBuffer, + long outputFramesPerBuffer, + double sampleRate ) +{ + long ringSize; + int index; + int i; + double latencyTimesChannelCount ; + long framesPerBufferTimesChannelCount ; + + VVDBUG(( "computeRingBufferSize()\n" )); + + assert( inputParameters || outputParameters ); + + if( outputParameters && inputParameters ) + { + latencyTimesChannelCount = MAX( + inputParameters->suggestedLatency * inputParameters->channelCount, + outputParameters->suggestedLatency * outputParameters->channelCount ); + framesPerBufferTimesChannelCount = MAX( + inputFramesPerBuffer * inputParameters->channelCount, + outputFramesPerBuffer * outputParameters->channelCount ); + } + else if( outputParameters ) + { + latencyTimesChannelCount + = outputParameters->suggestedLatency * outputParameters->channelCount; + framesPerBufferTimesChannelCount + = outputFramesPerBuffer * outputParameters->channelCount; + } + else /* we have inputParameters */ + { + latencyTimesChannelCount + = inputParameters->suggestedLatency * inputParameters->channelCount; + framesPerBufferTimesChannelCount + = inputFramesPerBuffer * inputParameters->channelCount; + } + + ringSize = (long) ( latencyTimesChannelCount * sampleRate * 2 + .5); + VDBUG( ( "suggested latency * channelCount: %d\n", (int) (latencyTimesChannelCount*sampleRate) ) ); + if( ringSize < framesPerBufferTimesChannelCount * 3 ) + ringSize = framesPerBufferTimesChannelCount * 3 ; + VDBUG(("framesPerBuffer*channelCount:%d\n",(int)framesPerBufferTimesChannelCount)); + VDBUG(("Ringbuffer size (1): %d\n", (int)ringSize )); + + /* make sure it's at least 4 */ + ringSize = MAX( ringSize, 4 ); + + /* round up to the next power of 2 */ + index = -1; + for( i=0; i> i & 0x01 ) + index = i; + assert( index > 0 ); + if( ringSize <= ( 0x01 << index ) ) + ringSize = 0x01 << index ; + else + ringSize = 0x01 << ( index + 1 ); + + VDBUG(( "Final Ringbuffer size (2): %d\n", (int)ringSize )); + return ringSize; +} + + +/* + * Durring testing of core audio, I found that serious crashes could occur + * if properties such as sample rate were changed multiple times in rapid + * succession. The function below has some fancy logic to make sure that changes + * are acknowledged before another is requested. That seems to help a lot. + */ + +OSStatus propertyProc( + AudioDeviceID inDevice, + UInt32 inChannel, + Boolean isInput, + AudioDevicePropertyID inPropertyID, + void* inClientData ) +{ + MutexAndBool *mab = (MutexAndBool *) inClientData; + mab->once = TRUE; + pthread_mutex_unlock( &(mab->mutex) ); + return noErr; +} + +/* sets the value of the given property and waits for the change to + be acknowledged, and returns the final value, which is not guaranteed + by this function to be the same as the desired value. Obviously, this + function can only be used for data whose input and output are the + same size and format, and their size and format are known in advance.*/ +PaError AudioDeviceSetPropertyNowAndWaitForChange( + AudioDeviceID inDevice, + UInt32 inChannel, + Boolean isInput, + AudioDevicePropertyID inPropertyID, + UInt32 inPropertyDataSize, + const void *inPropertyData, + void *outPropertyData ) +{ + OSStatus macErr; + int unixErr; + MutexAndBool mab; + UInt32 outPropertyDataSize = inPropertyDataSize; + + /* First, see if it already has that value. If so, return. */ + macErr = AudioDeviceGetProperty( inDevice, inChannel, + isInput, inPropertyID, + &outPropertyDataSize, outPropertyData ); + if( macErr ) + goto failMac2; + if( inPropertyDataSize!=outPropertyDataSize ) + return paInternalError; + if( 0==memcmp( outPropertyData, inPropertyData, outPropertyDataSize ) ) + return paNoError; + + /* setup and lock mutex */ + mab.once = FALSE; + unixErr = pthread_mutex_init( &mab.mutex, NULL ); + if( unixErr ) + goto failUnix2; + unixErr = pthread_mutex_lock( &mab.mutex ); + if( unixErr ) + goto failUnix; + + /* add property listener */ + macErr = AudioDeviceAddPropertyListener( inDevice, inChannel, isInput, + inPropertyID, propertyProc, + &mab ); + if( macErr ) + goto failMac; + /* set property */ + macErr = AudioDeviceSetProperty( inDevice, NULL, inChannel, + isInput, inPropertyID, + inPropertyDataSize, inPropertyData ); + if( macErr ) { + /* we couldn't set the property, so we'll just unlock the mutex + and move on. */ + pthread_mutex_unlock( &mab.mutex ); + } + + /* wait for property to change */ + unixErr = pthread_mutex_lock( &mab.mutex ); + if( unixErr ) + goto failUnix; + + /* now read the property back out */ + macErr = AudioDeviceGetProperty( inDevice, inChannel, + isInput, inPropertyID, + &outPropertyDataSize, outPropertyData ); + if( macErr ) + goto failMac; + /* cleanup */ + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, + inPropertyID, propertyProc ); + unixErr = pthread_mutex_unlock( &mab.mutex ); + if( unixErr ) + goto failUnix2; + unixErr = pthread_mutex_destroy( &mab.mutex ); + if( unixErr ) + goto failUnix2; + + return paNoError; + + failUnix: + pthread_mutex_destroy( &mab.mutex ); + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, + inPropertyID, propertyProc ); + + failUnix2: + DBUG( ("Error #%d while setting a device property: %s\n", unixErr, strerror( unixErr ) ) ); + return paUnanticipatedHostError; + + failMac: + pthread_mutex_destroy( &mab.mutex ); + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, + inPropertyID, propertyProc ); + failMac2: + return ERR( macErr ); +} + +/* + * Sets the sample rate the HAL device. + * if requireExact: set the sample rate or fail. + * + * otherwise : set the exact sample rate. + * If that fails, check for available sample rates, and choose one + * higher than the requested rate. If there isn't a higher one, + * just use the highest available. + */ +PaError setBestSampleRateForDevice( const AudioDeviceID device, + const bool isOutput, + const bool requireExact, + const Float64 desiredSrate ) +{ + /*FIXME: changing the sample rate is disruptive to other programs using the + device, so it might be good to offer a custom flag to not change the + sample rate and just do conversion. (in my casual tests, there is + no disruption unless the sample rate really does need to change) */ + const bool isInput = isOutput ? 0 : 1; + Float64 srate; + UInt32 propsize = sizeof( Float64 ); + OSErr err; + AudioValueRange *ranges; + int i=0; + Float64 max = -1; /*the maximum rate available*/ + Float64 best = -1; /*the lowest sample rate still greater than desired rate*/ + VDBUG(("Setting sample rate for device %ld to %g.\n",device,(float)desiredSrate)); + + /* -- try setting the sample rate -- */ + err = AudioDeviceSetPropertyNowAndWaitForChange( + device, 0, isInput, + kAudioDevicePropertyNominalSampleRate, + propsize, &desiredSrate, &srate ); + if( err ) + return err; + + /* -- if the rate agrees, and we got no errors, we are done -- */ + if( !err && srate == desiredSrate ) + return paNoError; + /* -- we've failed if the rates disagree and we are setting input -- */ + if( requireExact ) + return paInvalidSampleRate; + + /* -- generate a list of available sample rates -- */ + err = AudioDeviceGetPropertyInfo( device, 0, isInput, + kAudioDevicePropertyAvailableNominalSampleRates, + &propsize, NULL ); + if( err ) + return ERR( err ); + ranges = (AudioValueRange *)calloc( 1, propsize ); + if( !ranges ) + return paInsufficientMemory; + err = AudioDeviceGetProperty( device, 0, isInput, + kAudioDevicePropertyAvailableNominalSampleRates, + &propsize, ranges ); + if( err ) + { + free( ranges ); + return ERR( err ); + } + VDBUG(("Requested sample rate of %g was not available.\n", (float)desiredSrate)); + VDBUG(("%lu Available Sample Rates are:\n",propsize/sizeof(AudioValueRange))); +#ifdef MAC_CORE_VERBOSE_DEBUG + for( i=0; i max ) max = ranges[i].mMaximum; + if( ranges[i].mMinimum > desiredSrate ) { + if( best < 0 ) + best = ranges[i].mMinimum; + else if( ranges[i].mMinimum < best ) + best = ranges[i].mMinimum; + } + } + if( best < 0 ) + best = max; + VDBUG( ("Maximum Rate %g. best is %g.\n", max, best ) ); + free( ranges ); + + /* -- set the sample rate -- */ + propsize = sizeof( best ); + err = AudioDeviceSetPropertyNowAndWaitForChange( + device, 0, isInput, + kAudioDevicePropertyNominalSampleRate, + propsize, &best, &srate ); + if( err ) + return err; + + if( err ) + return ERR( err ); + /* -- if the set rate matches, we are done -- */ + if( srate == best ) + return paNoError; + + /* -- otherwise, something wierd happened: we didn't set the rate, and we got no errors. Just bail. */ + return paInternalError; +} + + +/* + Attempts to set the requestedFramesPerBuffer. If it can't set the exact + value, it settles for something smaller if available. If nothing smaller + is available, it uses the smallest available size. + actualFramesPerBuffer will be set to the actual value on successful return. + OK to pass NULL to actualFramesPerBuffer. + The logic is very simmilar too setBestSampleRate only failure here is + not usually catastrophic. +*/ +PaError setBestFramesPerBuffer( const AudioDeviceID device, + const bool isOutput, + unsigned long requestedFramesPerBuffer, + unsigned long *actualFramesPerBuffer ) +{ + UInt32 afpb; + const bool isInput = !isOutput; + UInt32 propsize = sizeof(UInt32); + OSErr err; + Float64 min = -1; /*the min blocksize*/ + Float64 best = -1; /*the best blocksize*/ + int i=0; + AudioValueRange *ranges; + + if( actualFramesPerBuffer == NULL ) + actualFramesPerBuffer = &afpb; + + + /* -- try and set exact FPB -- */ + err = AudioDeviceSetProperty( device, NULL, 0, isInput, + kAudioDevicePropertyBufferFrameSize, + propsize, &requestedFramesPerBuffer); + err = AudioDeviceGetProperty( device, 0, isInput, + kAudioDevicePropertyBufferFrameSize, + &propsize, actualFramesPerBuffer); + if( err ) + return ERR( err ); + if( *actualFramesPerBuffer == requestedFramesPerBuffer ) + return paNoError; /* we are done */ + + /* -- fetch available block sizes -- */ + err = AudioDeviceGetPropertyInfo( device, 0, isInput, + kAudioDevicePropertyBufferSizeRange, + &propsize, NULL ); + if( err ) + return ERR( err ); + ranges = (AudioValueRange *)calloc( 1, propsize ); + if( !ranges ) + return paInsufficientMemory; + err = AudioDeviceGetProperty( device, 0, isInput, + kAudioDevicePropertyBufferSizeRange, + &propsize, ranges ); + if( err ) + { + free( ranges ); + return ERR( err ); + } + VDBUG(("Requested block size of %lu was not available.\n", + requestedFramesPerBuffer )); + VDBUG(("%lu Available block sizes are:\n",propsize/sizeof(AudioValueRange))); +#ifdef MAC_CORE_VERBOSE_DEBUG + for( i=0; i best ) + best = ranges[i].mMaximum; + } + } + if( best == -1 ) + best = min; + VDBUG( ("Minimum FPB %g. best is %g.\n", min, best ) ); + free( ranges ); + + /* --- set the buffer size (ignore errors) -- */ + requestedFramesPerBuffer = (UInt32) best ; + propsize = sizeof( UInt32 ); + err = AudioDeviceSetProperty( device, NULL, 0, isInput, + kAudioDevicePropertyBufferSize, + propsize, &requestedFramesPerBuffer ); + /* --- read the property to check that it was set -- */ + err = AudioDeviceGetProperty( device, 0, isInput, + kAudioDevicePropertyBufferSize, + &propsize, actualFramesPerBuffer ); + + if( err ) + return ERR( err ); + + return paNoError; +} diff --git a/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_utilities.h b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_utilities.h new file mode 100644 index 000000000..7f1e16273 --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/pa_mac_core_utilities.h @@ -0,0 +1,159 @@ +/* + * + * pa_mac_core_utilities.c + * + * utilitiy functions for pa_mac_core.c + * + * This functions are more like helper functions than part of the core, + * so I moved them to a separate file so the core code would be cleaner. + * + * by Bjorn Roche. + */ + +#ifndef PA_MAC_CORE_UTILITIES_H__ +#define PA_MAC_CORE_UTILITIES_H__ + +#include +#include "portaudio.h" +#include "pa_util.h" +#include +#include + +#ifndef MIN +#define MIN(a, b) (((a)<(b))?(a):(b)) +#endif + +#ifndef MAX +#define MAX(a, b) (((a)<(b))?(b):(a)) +#endif + +#define ERR(mac_error) PaMacCore_SetError(mac_error, __LINE__, 1 ) +#define WARNING(mac_error) PaMacCore_SetError(mac_error, __LINE__, 0 ) + + +/* Help keep track of AUHAL element numbers */ +#define INPUT_ELEMENT (1) +#define OUTPUT_ELEMENT (0) + +/* Normal level of debugging: fine for most apps that don't mind the occational warning being printf'ed */ +/* + */ +#define MAC_CORE_DEBUG +#ifdef MAC_CORE_DEBUG +# define DBUG(MSG) do { printf("||PaMacCore (AUHAL)|| "); printf MSG ; fflush(stdout); } while(0) +#else +# define DBUG(MSG) +#endif + +/* Verbose Debugging: useful for developement */ +/* +#define MAC_CORE_VERBOSE_DEBUG +*/ +#ifdef MAC_CORE_VERBOSE_DEBUG +# define VDBUG(MSG) do { printf("||PaMacCore (v )|| "); printf MSG ; fflush(stdout); } while(0) +#else +# define VDBUG(MSG) +#endif + +/* Very Verbose Debugging: Traces every call. */ +/* +#define MAC_CORE_VERY_VERBOSE_DEBUG + */ +#ifdef MAC_CORE_VERY_VERBOSE_DEBUG +# define VVDBUG(MSG) do { printf("||PaMacCore (vv)|| "); printf MSG ; fflush(stdout); } while(0) +#else +# define VVDBUG(MSG) +#endif + + + + + +#define UNIX_ERR(err) PaMacCore_SetUnixError( err, __LINE__ ) + +PaError PaMacCore_SetUnixError( int err, int line ); + +/* + * Translates MacOS generated errors into PaErrors + */ +PaError PaMacCore_SetError(OSStatus error, int line, int isError); + +/* + * This function computes an appropriate ring buffer size given + * a requested latency (in seconds), sample rate and framesPerBuffer. + * + * The returned ringBufferSize is computed using the following + * constraints: + * - it must be at least 4. + * - it must be at least 3x framesPerBuffer. + * - it must be at least 2x the suggestedLatency. + * - it must be a power of 2. + * This function attempts to compute the minimum such size. + * + */ +long computeRingBufferSize( const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + long inputFramesPerBuffer, + long outputFramesPerBuffer, + double sampleRate ); + +/* + * Durring testing of core audio, I found that serious crashes could occur + * if properties such as sample rate were changed multiple times in rapid + * succession. The function below has some fancy logic to make sure that changes + * are acknowledged before another is requested. That seems to help a lot. + */ + +typedef struct { + bool once; /* I didn't end up using this. bdr */ + pthread_mutex_t mutex; +} MutexAndBool ; + +OSStatus propertyProc( + AudioDeviceID inDevice, + UInt32 inChannel, + Boolean isInput, + AudioDevicePropertyID inPropertyID, + void* inClientData ); + +/* sets the value of the given property and waits for the change to + be acknowledged, and returns the final value, which is not guaranteed + by this function to be the same as the desired value. Obviously, this + function can only be used for data whose input and output are the + same size and format, and their size and format are known in advance.*/ +PaError AudioDeviceSetPropertyNowAndWaitForChange( + AudioDeviceID inDevice, + UInt32 inChannel, + Boolean isInput, + AudioDevicePropertyID inPropertyID, + UInt32 inPropertyDataSize, + const void *inPropertyData, + void *outPropertyData ); + +/* + * Sets the sample rate the HAL device. + * if requireExact: set the sample rate or fail. + * + * otherwise : set the exact sample rate. + * If that fails, check for available sample rates, and choose one + * higher than the requested rate. If there isn't a higher one, + * just use the highest available. + */ +PaError setBestSampleRateForDevice( const AudioDeviceID device, + const bool isOutput, + const bool requireExact, + const Float64 desiredSrate ); +/* + Attempts to set the requestedFramesPerBuffer. If it can't set the exact + value, it settles for something smaller if available. If nothing smaller + is available, it uses the smallest available size. + actualFramesPerBuffer will be set to the actual value on successful return. + OK to pass NULL to actualFramesPerBuffer. + The logic is very simmilar too setBestSampleRate only failure here is + not usually catastrophic. +*/ +PaError setBestFramesPerBuffer( const AudioDeviceID device, + const bool isOutput, + unsigned long requestedFramesPerBuffer, + unsigned long *actualFramesPerBuffer ); +#endif /* PA_MAC_CORE_UTILITIES_H__*/ diff --git a/portaudio-v19/src/hostapi/coreaudio/ringbuffer.c b/portaudio-v19/src/hostapi/coreaudio/ringbuffer.c new file mode 100644 index 000000000..c6770c05b --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/ringbuffer.c @@ -0,0 +1,254 @@ +/* + * $Id$ + * ringbuffer.c + * Ring Buffer utility.. + * + * Author: Phil Burk, http://www.softsynth.com + * modified for SMP safety on Mac OS X by Bjorn Roche + * also, alowed for const where possible + * Note that this is safe only for a single-thread reader and a + * single-thread writer. + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "ringbuffer.h" +#include + +/* + * We can undefine this, to turn off memory barriers, but that + * is only useful if we know we don't need to be MP safe or + * we are interested in doing some kind of tests. + */ +#define MPSAFE + +/**************** + * First, we'll define some memory barrier primitives based on the system. + * right now only OS X and FreeBSD are supported. In addition to providing + * memory barriers, these functions should ensure that data cached in registers + * is written out to cache where it can be snooped by other CPUs. (ie, the volatile + * keyword should not be required) + * + * the primitives that must be defined are: + * + * FullMemoryBarrier() + * ReadMemoryBarrier() + * WriteMemoryBarrier() + * + ****************/ + +#if defined(__APPLE__) || defined(__FreeBSD__) +# include + /* Here are the memory barrier functions. Mac OS X and FreeBSD only provide + full memory barriers, so the three types of barriers are the same. + The asm volatile may be redundant with the memory barrier, but + until I have proof of that, I'm leaving it. */ +# define FullMemoryBarrier() do{ asm volatile("":::"memory"); OSMemoryBarrier(); }while(false) +# define ReadMemoryBarrier() do{ asm volatile("":::"memory"); OSMemoryBarrier(); }while(false) +# define WriteMemoryBarrier() do{ asm volatile("":::"memory"); OSMemoryBarrier(); }while(false) +#else +# error Memory Barriers not defined on this system or system unknown +#endif + +/*************************************************************************** + * Initialize FIFO. + * numBytes must be power of 2, returns -1 if not. + */ +long RingBuffer_Init( RingBuffer *rbuf, long numBytes, void *dataPtr ) +{ + if( ((numBytes-1) & numBytes) != 0) return -1; /* Not Power of two. */ + rbuf->bufferSize = numBytes; + rbuf->buffer = (char *)dataPtr; + RingBuffer_Flush( rbuf ); + rbuf->bigMask = (numBytes*2)-1; + rbuf->smallMask = (numBytes)-1; + return 0; +} +/*************************************************************************** +** Return number of bytes available for reading. */ +long RingBuffer_GetReadAvailable( RingBuffer *rbuf ) +{ +#ifdef MPSAFE + ReadMemoryBarrier(); +#endif + return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask ); +} +/*************************************************************************** +** Return number of bytes available for writing. */ +long RingBuffer_GetWriteAvailable( RingBuffer *rbuf ) +{ + /* Since we are calling RingBuffer_GetReadAvailable, we don't need an aditional MB */ + return ( rbuf->bufferSize - RingBuffer_GetReadAvailable(rbuf)); +} + +/*************************************************************************** +** Clear buffer. Should only be called when buffer is NOT being read. */ +void RingBuffer_Flush( RingBuffer *rbuf ) +{ + rbuf->writeIndex = rbuf->readIndex = 0; +} + +/*************************************************************************** +** Get address of region(s) to which we can write data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetWriteRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ) +{ + long index; + long available = RingBuffer_GetWriteAvailable( rbuf ); + if( numBytes > available ) numBytes = available; + /* Check to see if write is not contiguous. */ + index = rbuf->writeIndex & rbuf->smallMask; + if( (index + numBytes) > rbuf->bufferSize ) + { + /* Write data in two blocks that wrap the buffer. */ + long firstHalf = rbuf->bufferSize - index; + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = firstHalf; + *dataPtr2 = &rbuf->buffer[0]; + *sizePtr2 = numBytes - firstHalf; + } + else + { + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = numBytes; + *dataPtr2 = NULL; + *sizePtr2 = 0; + } + return numBytes; +} + + +/*************************************************************************** +*/ +long RingBuffer_AdvanceWriteIndex( RingBuffer *rbuf, long numBytes ) +{ +#ifdef MPSAFE + /* we need to ensure that previous writes are seen before we update the write index */ + WriteMemoryBarrier(); + return rbuf->writeIndex = (rbuf->writeIndex + numBytes) & rbuf->bigMask; +#else + return rbuf->writeIndex = (rbuf->writeIndex + numBytes) & rbuf->bigMask; +#endif +} + +/*************************************************************************** +** Get address of region(s) from which we can read data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetReadRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ) +{ + long index; + long available = RingBuffer_GetReadAvailable( rbuf ); + if( numBytes > available ) numBytes = available; + /* Check to see if read is not contiguous. */ + index = rbuf->readIndex & rbuf->smallMask; + if( (index + numBytes) > rbuf->bufferSize ) + { + /* Write data in two blocks that wrap the buffer. */ + long firstHalf = rbuf->bufferSize - index; + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = firstHalf; + *dataPtr2 = &rbuf->buffer[0]; + *sizePtr2 = numBytes - firstHalf; + } + else + { + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = numBytes; + *dataPtr2 = NULL; + *sizePtr2 = 0; + } + return numBytes; +} +/*************************************************************************** +*/ +long RingBuffer_AdvanceReadIndex( RingBuffer *rbuf, long numBytes ) +{ +#ifdef MPSAFE + /* we need to ensure that previous writes are always seen before updating the index. */ + WriteMemoryBarrier(); + return rbuf->readIndex = (rbuf->readIndex + numBytes) & rbuf->bigMask; +#else + return rbuf->readIndex = (rbuf->readIndex + numBytes) & rbuf->bigMask; +#endif +} + +/*************************************************************************** +** Return bytes written. */ +long RingBuffer_Write( RingBuffer *rbuf, const void *data, long numBytes ) +{ + long size1, size2, numWritten; + void *data1, *data2; + numWritten = RingBuffer_GetWriteRegions( rbuf, numBytes, &data1, &size1, &data2, &size2 ); + if( size2 > 0 ) + { + + memcpy( data1, data, size1 ); + data = ((char *)data) + size1; + memcpy( data2, data, size2 ); + } + else + { + memcpy( data1, data, size1 ); + } + RingBuffer_AdvanceWriteIndex( rbuf, numWritten ); + return numWritten; +} + +/*************************************************************************** +** Return bytes read. */ +long RingBuffer_Read( RingBuffer *rbuf, void *data, long numBytes ) +{ + long size1, size2, numRead; + void *data1, *data2; + numRead = RingBuffer_GetReadRegions( rbuf, numBytes, &data1, &size1, &data2, &size2 ); + if( size2 > 0 ) + { + memcpy( data, data1, size1 ); + data = ((char *)data) + size1; + memcpy( data, data2, size2 ); + } + else + { + memcpy( data, data1, size1 ); + } + RingBuffer_AdvanceReadIndex( rbuf, numRead ); + return numRead; +} diff --git a/portaudio-v19/src/hostapi/coreaudio/ringbuffer.h b/portaudio-v19/src/hostapi/coreaudio/ringbuffer.h new file mode 100644 index 000000000..a8682f82c --- /dev/null +++ b/portaudio-v19/src/hostapi/coreaudio/ringbuffer.h @@ -0,0 +1,105 @@ +#ifndef _RINGBUFFER_H +#define _RINGBUFFER_H +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/* + * $Id$ + * ringbuffer.h + * Ring Buffer utility.. + * + * Author: Phil Burk, http://www.softsynth.com + * modified for SMP safety on OS X by Bjorn Roche. + * also allowed for const where possible. + * Note that this is safe only for a single-thread reader + * and a single-thread writer. + * + * This program is distributed with the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "ringbuffer.h" +#include + +typedef struct +{ + long bufferSize; /* Number of bytes in FIFO. Power of 2. Set by RingBuffer_Init. */ + long writeIndex; /* Index of next writable byte. Set by RingBuffer_AdvanceWriteIndex. */ + long readIndex; /* Index of next readable byte. Set by RingBuffer_AdvanceReadIndex. */ + long bigMask; /* Used for wrapping indices with extra bit to distinguish full/empty. */ + long smallMask; /* Used for fitting indices to buffer. */ + char * buffer; +} +RingBuffer; +/* + * Initialize Ring Buffer. + * numBytes must be power of 2, returns -1 if not. + */ +long RingBuffer_Init( RingBuffer *rbuf, long numBytes, void *dataPtr ); + +/* Clear buffer. Should only be called when buffer is NOT being read. */ +void RingBuffer_Flush( RingBuffer *rbuf ); + +/* Return number of bytes available for writing. */ +long RingBuffer_GetWriteAvailable( RingBuffer *rbuf ); +/* Return number of bytes available for read. */ +long RingBuffer_GetReadAvailable( RingBuffer *rbuf ); +/* Return bytes written. */ +long RingBuffer_Write( RingBuffer *rbuf, const void *data, long numBytes ); +/* Return bytes read. */ +long RingBuffer_Read( RingBuffer *rbuf, void *data, long numBytes ); + +/* Get address of region(s) to which we can write data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetWriteRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ); +long RingBuffer_AdvanceWriteIndex( RingBuffer *rbuf, long numBytes ); + +/* Get address of region(s) from which we can read data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetReadRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ); + +long RingBuffer_AdvanceReadIndex( RingBuffer *rbuf, long numBytes ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* _RINGBUFFER_H */ diff --git a/portaudio-v19/src/hostapi/dsound/pa_win_ds.c b/portaudio-v19/src/hostapi/dsound/pa_win_ds.c new file mode 100644 index 000000000..dfcc6e7dd --- /dev/null +++ b/portaudio-v19/src/hostapi/dsound/pa_win_ds.c @@ -0,0 +1,2178 @@ +/* + * $Id$ + * Portable Audio I/O Library DirectSound implementation + * + * Authors: Phil Burk, Robert Marsanyi & Ross Bencina + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2006 Ross Bencina, Phil Burk, Robert Marsanyi + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + + @todo implement paInputOverflow callback status flag + + @todo implement paNeverDropInput. + + @todo implement host api specific extension to set i/o buffer sizes in frames + + @todo implement initialisation of PaDeviceInfo default*Latency fields (currently set to 0.) + + @todo implement ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable + + @todo audit handling of DirectSound result codes - in many cases we could convert a HRESULT into + a native portaudio error code. Standard DirectSound result codes are documented at msdn. + + @todo implement IsFormatSupported + + @todo check that CoInitialize() CoUninitialize() are always correctly + paired, even in error cases. + + @todo call PaUtil_SetLastHostErrorInfo with a specific error string (currently just "DSound error"). + + @todo make sure all buffers have been played before stopping the stream + when the stream callback returns paComplete + + old TODOs from phil, need to work out if these have been done: + O- fix "patest_stop.c" +*/ + +#include +#include /* strlen() */ + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + +#include "pa_win_ds_dynlink.h" + +#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ +#pragma comment( lib, "dsound.lib" ) +#pragma comment( lib, "winmm.lib" ) +#endif + +/* + provided in newer platform sdks and x64 + */ +#ifndef DWORD_PTR +#define DWORD_PTR DWORD +#endif + +#define PRINT(x) PA_DEBUG(x); +#define ERR_RPT(x) PRINT(x) +#define DBUG(x) PRINT(x) +#define DBUGX(x) PRINT(x) + +#define PA_USE_HIGH_LATENCY (0) +#if PA_USE_HIGH_LATENCY +#define PA_WIN_9X_LATENCY (500) +#define PA_WIN_NT_LATENCY (600) +#else +#define PA_WIN_9X_LATENCY (140) +#define PA_WIN_NT_LATENCY (280) +#endif + +#define PA_WIN_WDM_LATENCY (120) + +#define SECONDS_PER_MSEC (0.001) +#define MSEC_PER_SECOND (1000) + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaWinDs_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + + +/* FIXME: should convert hr to a string */ +#define PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ) \ + PaUtil_SetLastHostErrorInfo( paDirectSound, hr, "DirectSound error" ) + +/************************************************* DX Prototypes **********/ +static BOOL CALLBACK CollectGUIDsProc(LPGUID lpGUID, + LPCTSTR lpszDesc, + LPCTSTR lpszDrvName, + LPVOID lpContext ); + +/************************************************************************************/ +/********************** Structures **************************************************/ +/************************************************************************************/ +/* PaWinDsHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct PaWinDsDeviceInfo +{ + GUID guid; + GUID *lpGUID; + double sampleRates[3]; +} PaWinDsDeviceInfo; + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ + PaWinDsDeviceInfo *winDsDeviceInfos; + +} PaWinDsHostApiRepresentation; + + +/* PaWinDsStream - a stream data structure specifically for this implementation */ + +typedef struct PaWinDsStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + +/* DirectSound specific data. */ + +/* Output */ + LPDIRECTSOUND pDirectSound; + LPDIRECTSOUNDBUFFER pDirectSoundOutputBuffer; + DWORD outputBufferWriteOffsetBytes; /* last write position */ + INT outputBufferSizeBytes; + INT bytesPerOutputFrame; + /* Try to detect play buffer underflows. */ + LARGE_INTEGER perfCounterTicksPerBuffer; /* counter ticks it should take to play a full buffer */ + LARGE_INTEGER previousPlayTime; + UINT previousPlayCursor; + UINT outputUnderflowCount; + BOOL outputIsRunning; + /* use double which lets us can play for several thousand years with enough precision */ + double dsw_framesWritten; + double framesPlayed; +/* Input */ + LPDIRECTSOUNDCAPTURE pDirectSoundCapture; + LPDIRECTSOUNDCAPTUREBUFFER pDirectSoundInputBuffer; + INT bytesPerInputFrame; + UINT readOffset; /* last read position */ + UINT inputSize; + + + MMRESULT timerID; + int framesPerDSBuffer; + double framesWritten; + double secondsPerHostByte; /* Used to optimize latency calculation for outTime */ + + PaStreamCallbackFlags callbackFlags; + +/* FIXME - move all below to PaUtilStreamRepresentation */ + volatile int isStarted; + volatile int isActive; + volatile int stopProcessing; /* stop thread once existing buffers have been returned */ + volatile int abortProcessing; /* stop thread immediately */ +} PaWinDsStream; + + +/************************************************************************************ +** Duplicate the input string using the allocations allocator. +** A NULL string is converted to a zero length string. +** If memory cannot be allocated, NULL is returned. +**/ +static char *DuplicateDeviceNameString( PaUtilAllocationGroup *allocations, const char* src ) +{ + char *result = 0; + + if( src != NULL ) + { + size_t len = strlen(src); + result = (char*)PaUtil_GroupAllocateMemory( allocations, (long)(len + 1) ); + if( result ) + memcpy( (void *) result, src, len+1 ); + } + else + { + result = (char*)PaUtil_GroupAllocateMemory( allocations, 1 ); + if( result ) + result[0] = '\0'; + } + + return result; +} + +/************************************************************************************ +** DSDeviceNameAndGUID, DSDeviceNameAndGUIDVector used for collecting preliminary +** information during device enumeration. +*/ +typedef struct DSDeviceNameAndGUID{ + char *name; // allocated from parent's allocations, never deleted by this structure + GUID guid; + LPGUID lpGUID; +} DSDeviceNameAndGUID; + +typedef struct DSDeviceNameAndGUIDVector{ + PaUtilAllocationGroup *allocations; + PaError enumerationError; + + int count; + int free; + DSDeviceNameAndGUID *items; // Allocated using LocalAlloc() +} DSDeviceNameAndGUIDVector; + +static PaError InitializeDSDeviceNameAndGUIDVector( + DSDeviceNameAndGUIDVector *guidVector, PaUtilAllocationGroup *allocations ) +{ + PaError result = paNoError; + + guidVector->allocations = allocations; + guidVector->enumerationError = paNoError; + + guidVector->count = 0; + guidVector->free = 8; + guidVector->items = (DSDeviceNameAndGUID*)LocalAlloc( LMEM_FIXED, sizeof(DSDeviceNameAndGUID) * guidVector->free ); + if( guidVector->items == NULL ) + result = paInsufficientMemory; + + return result; +} + +static PaError ExpandDSDeviceNameAndGUIDVector( DSDeviceNameAndGUIDVector *guidVector ) +{ + PaError result = paNoError; + DSDeviceNameAndGUID *newItems; + int i; + + /* double size of vector */ + int size = guidVector->count + guidVector->free; + guidVector->free += size; + + newItems = (DSDeviceNameAndGUID*)LocalAlloc( LMEM_FIXED, sizeof(DSDeviceNameAndGUID) * size * 2 ); + if( newItems == NULL ) + { + result = paInsufficientMemory; + } + else + { + for( i=0; i < guidVector->count; ++i ) + { + newItems[i].name = guidVector->items[i].name; + if( guidVector->items[i].lpGUID == NULL ) + { + newItems[i].lpGUID = NULL; + } + else + { + newItems[i].lpGUID = &newItems[i].guid; + memcpy( &newItems[i].guid, guidVector->items[i].lpGUID, sizeof(GUID) );; + } + } + + LocalFree( guidVector->items ); + guidVector->items = newItems; + } + + return result; +} + +/* + it's safe to call DSDeviceNameAndGUIDVector multiple times +*/ +static PaError TerminateDSDeviceNameAndGUIDVector( DSDeviceNameAndGUIDVector *guidVector ) +{ + PaError result = paNoError; + + if( guidVector->items != NULL ) + { + if( LocalFree( guidVector->items ) != NULL ) + result = paInsufficientMemory; /** @todo this isn't the correct error to return from a deallocation failure */ + + guidVector->items = NULL; + } + + return result; +} + +/************************************************************************************ +** Collect preliminary device information during DirectSound enumeration +*/ +static BOOL CALLBACK CollectGUIDsProc(LPGUID lpGUID, + LPCTSTR lpszDesc, + LPCTSTR lpszDrvName, + LPVOID lpContext ) +{ + DSDeviceNameAndGUIDVector *namesAndGUIDs = (DSDeviceNameAndGUIDVector*)lpContext; + PaError error; + + (void) lpszDrvName; /* unused variable */ + + if( namesAndGUIDs->free == 0 ) + { + error = ExpandDSDeviceNameAndGUIDVector( namesAndGUIDs ); + if( error != paNoError ) + { + namesAndGUIDs->enumerationError = error; + return FALSE; + } + } + + /* Set GUID pointer, copy GUID to storage in DSDeviceNameAndGUIDVector. */ + if( lpGUID == NULL ) + { + namesAndGUIDs->items[namesAndGUIDs->count].lpGUID = NULL; + } + else + { + namesAndGUIDs->items[namesAndGUIDs->count].lpGUID = + &namesAndGUIDs->items[namesAndGUIDs->count].guid; + + memcpy( &namesAndGUIDs->items[namesAndGUIDs->count].guid, lpGUID, sizeof(GUID) ); + } + + namesAndGUIDs->items[namesAndGUIDs->count].name = + DuplicateDeviceNameString( namesAndGUIDs->allocations, lpszDesc ); + if( namesAndGUIDs->items[namesAndGUIDs->count].name == NULL ) + { + namesAndGUIDs->enumerationError = paInsufficientMemory; + return FALSE; + } + + ++namesAndGUIDs->count; + --namesAndGUIDs->free; + + return TRUE; +} + + +/* + GUIDs for emulated devices which we blacklist below. + are there more than two of them?? +*/ + +GUID IID_IRolandVSCEmulated1 = {0xc2ad1800, 0xb243, 0x11ce, 0xa8, 0xa4, 0x00, 0xaa, 0x00, 0x6c, 0x45, 0x01}; +GUID IID_IRolandVSCEmulated2 = {0xc2ad1800, 0xb243, 0x11ce, 0xa8, 0xa4, 0x00, 0xaa, 0x00, 0x6c, 0x45, 0x02}; + + +#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ (13) /* must match array length below */ +static double defaultSampleRateSearchOrder_[] = + { 44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, 192000.0, + 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 }; + + +/************************************************************************************ +** Extract capabilities from an output device, and add it to the device info list +** if successful. This function assumes that there is enough room in the +** device info list to accomodate all entries. +** +** The device will not be added to the device list if any errors are encountered. +*/ +static PaError AddOutputDeviceInfoFromDirectSound( + PaWinDsHostApiRepresentation *winDsHostApi, char *name, LPGUID lpGUID ) +{ + PaUtilHostApiRepresentation *hostApi = &winDsHostApi->inheritedHostApiRep; + PaDeviceInfo *deviceInfo = hostApi->deviceInfos[hostApi->info.deviceCount]; + PaWinDsDeviceInfo *winDsDeviceInfo = &winDsHostApi->winDsDeviceInfos[hostApi->info.deviceCount]; + HRESULT hr; + LPDIRECTSOUND lpDirectSound; + DSCAPS caps; + int deviceOK = TRUE; + PaError result = paNoError; + int i; + + /* Copy GUID to the device info structure. Set pointer. */ + if( lpGUID == NULL ) + { + winDsDeviceInfo->lpGUID = NULL; + } + else + { + memcpy( &winDsDeviceInfo->guid, lpGUID, sizeof(GUID) ); + winDsDeviceInfo->lpGUID = &winDsDeviceInfo->guid; + } + + + if( lpGUID ) + { + if (IsEqualGUID (&IID_IRolandVSCEmulated1,lpGUID) || + IsEqualGUID (&IID_IRolandVSCEmulated2,lpGUID) ) + { + PA_DEBUG(("BLACKLISTED: %s \n",name)); + return paNoError; + } + } + + /* Create a DirectSound object for the specified GUID + Note that using CoCreateInstance doesn't work on windows CE. + */ + hr = paWinDsDSoundEntryPoints.DirectSoundCreate( lpGUID, &lpDirectSound, NULL ); + + /** try using CoCreateInstance because DirectSoundCreate was hanging under + some circumstances - note this was probably related to the + #define BOOL short bug which has now been fixed + @todo delete this comment and the following code once we've ensured + there is no bug. + */ + /* + hr = CoCreateInstance( &CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectSound, (void**)&lpDirectSound ); + + if( hr == S_OK ) + { + hr = IDirectSound_Initialize( lpDirectSound, lpGUID ); + } + */ + + if( hr != DS_OK ) + { + if (hr == DSERR_ALLOCATED) + PA_DEBUG(("AddOutputDeviceInfoFromDirectSound %s DSERR_ALLOCATED\n",name)); + DBUG(("Cannot create DirectSound for %s. Result = 0x%x\n", name, hr )); + if (lpGUID) + DBUG(("%s's GUID: {0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x, 0x%x} \n", + name, + lpGUID->Data1, + lpGUID->Data2, + lpGUID->Data3, + lpGUID->Data4[0], + lpGUID->Data4[1], + lpGUID->Data4[2], + lpGUID->Data4[3], + lpGUID->Data4[4], + lpGUID->Data4[5], + lpGUID->Data4[6], + lpGUID->Data4[7])); + + deviceOK = FALSE; + } + else + { + /* Query device characteristics. */ + memset( &caps, 0, sizeof(caps) ); + caps.dwSize = sizeof(caps); + hr = IDirectSound_GetCaps( lpDirectSound, &caps ); + if( hr != DS_OK ) + { + DBUG(("Cannot GetCaps() for DirectSound device %s. Result = 0x%x\n", name, hr )); + deviceOK = FALSE; + } + else + { + +#ifndef PA_NO_WMME + if( caps.dwFlags & DSCAPS_EMULDRIVER ) + { + /* If WMME supported, then reject Emulated drivers because they are lousy. */ + deviceOK = FALSE; + } +#endif + + if( deviceOK ) + { + deviceInfo->maxInputChannels = 0; + /* Mono or stereo device? */ + deviceInfo->maxOutputChannels = ( caps.dwFlags & DSCAPS_PRIMARYSTEREO ) ? 2 : 1; + + deviceInfo->defaultLowInputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultLowOutputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultHighInputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultHighOutputLatency = 0.; /** @todo IMPLEMENT ME */ + + /* initialize defaultSampleRate */ + + if( caps.dwFlags & DSCAPS_CONTINUOUSRATE ) + { + /* initialize to caps.dwMaxSecondarySampleRate incase none of the standard rates match */ + deviceInfo->defaultSampleRate = caps.dwMaxSecondarySampleRate; + + for( i = 0; i < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++i ) + { + if( defaultSampleRateSearchOrder_[i] >= caps.dwMinSecondarySampleRate + && defaultSampleRateSearchOrder_[i] <= caps.dwMaxSecondarySampleRate ){ + + deviceInfo->defaultSampleRate = defaultSampleRateSearchOrder_[i]; + break; + } + } + } + else if( caps.dwMinSecondarySampleRate == caps.dwMaxSecondarySampleRate ) + { + if( caps.dwMinSecondarySampleRate == 0 ) + { + /* + ** On my Thinkpad 380Z, DirectSoundV6 returns min-max=0 !! + ** But it supports continuous sampling. + ** So fake range of rates, and hope it really supports it. + */ + deviceInfo->defaultSampleRate = 44100.0f; + + DBUG(("PA - Reported rates both zero. Setting to fake values for device #%s\n", name )); + } + else + { + deviceInfo->defaultSampleRate = caps.dwMaxSecondarySampleRate; + } + } + else if( (caps.dwMinSecondarySampleRate < 1000.0) && (caps.dwMaxSecondarySampleRate > 50000.0) ) + { + /* The EWS88MT drivers lie, lie, lie. The say they only support two rates, 100 & 100000. + ** But we know that they really support a range of rates! + ** So when we see a ridiculous set of rates, assume it is a range. + */ + deviceInfo->defaultSampleRate = 44100.0f; + DBUG(("PA - Sample rate range used instead of two odd values for device #%s\n", name )); + } + else deviceInfo->defaultSampleRate = caps.dwMaxSecondarySampleRate; + + + //printf( "min %d max %d\n", caps.dwMinSecondarySampleRate, caps.dwMaxSecondarySampleRate ); + // dwFlags | DSCAPS_CONTINUOUSRATE + } + } + + IDirectSound_Release( lpDirectSound ); + } + + if( deviceOK ) + { + deviceInfo->name = name; + + if( lpGUID == NULL ) + hostApi->info.defaultOutputDevice = hostApi->info.deviceCount; + + hostApi->info.deviceCount++; + } + + return result; +} + + +/************************************************************************************ +** Extract capabilities from an input device, and add it to the device info list +** if successful. This function assumes that there is enough room in the +** device info list to accomodate all entries. +** +** The device will not be added to the device list if any errors are encountered. +*/ +static PaError AddInputDeviceInfoFromDirectSoundCapture( + PaWinDsHostApiRepresentation *winDsHostApi, char *name, LPGUID lpGUID ) +{ + PaUtilHostApiRepresentation *hostApi = &winDsHostApi->inheritedHostApiRep; + PaDeviceInfo *deviceInfo = hostApi->deviceInfos[hostApi->info.deviceCount]; + PaWinDsDeviceInfo *winDsDeviceInfo = &winDsHostApi->winDsDeviceInfos[hostApi->info.deviceCount]; + HRESULT hr; + LPDIRECTSOUNDCAPTURE lpDirectSoundCapture; + DSCCAPS caps; + int deviceOK = TRUE; + PaError result = paNoError; + + /* Copy GUID to the device info structure. Set pointer. */ + if( lpGUID == NULL ) + { + winDsDeviceInfo->lpGUID = NULL; + } + else + { + winDsDeviceInfo->lpGUID = &winDsDeviceInfo->guid; + memcpy( &winDsDeviceInfo->guid, lpGUID, sizeof(GUID) ); + } + + + hr = paWinDsDSoundEntryPoints.DirectSoundCaptureCreate( lpGUID, &lpDirectSoundCapture, NULL ); + + /** try using CoCreateInstance because DirectSoundCreate was hanging under + some circumstances - note this was probably related to the + #define BOOL short bug which has now been fixed + @todo delete this comment and the following code once we've ensured + there is no bug. + */ + /* + hr = CoCreateInstance( &CLSID_DirectSoundCapture, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectSoundCapture, (void**)&lpDirectSoundCapture ); + */ + if( hr != DS_OK ) + { + DBUG(("Cannot create Capture for %s. Result = 0x%x\n", name, hr )); + deviceOK = FALSE; + } + else + { + /* Query device characteristics. */ + memset( &caps, 0, sizeof(caps) ); + caps.dwSize = sizeof(caps); + hr = IDirectSoundCapture_GetCaps( lpDirectSoundCapture, &caps ); + if( hr != DS_OK ) + { + DBUG(("Cannot GetCaps() for Capture device %s. Result = 0x%x\n", name, hr )); + deviceOK = FALSE; + } + else + { +#ifndef PA_NO_WMME + if( caps.dwFlags & DSCAPS_EMULDRIVER ) + { + /* If WMME supported, then reject Emulated drivers because they are lousy. */ + deviceOK = FALSE; + } +#endif + + if( deviceOK ) + { + deviceInfo->maxInputChannels = caps.dwChannels; + deviceInfo->maxOutputChannels = 0; + + deviceInfo->defaultLowInputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultLowOutputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultHighInputLatency = 0.; /** @todo IMPLEMENT ME */ + deviceInfo->defaultHighOutputLatency = 0.; /** @todo IMPLEMENT ME */ + +/* constants from a WINE patch by Francois Gouget, see: + http://www.winehq.com/hypermail/wine-patches/2003/01/0290.html + + --- + Date: Fri, 14 May 2004 10:38:12 +0200 (CEST) + From: Francois Gouget + To: Ross Bencina + Subject: Re: Permission to use wine 48/96 wave patch in BSD licensed library + + [snip] + + I give you permission to use the patch below under the BSD license. + http://www.winehq.com/hypermail/wine-patches/2003/01/0290.html + + [snip] +*/ +#ifndef WAVE_FORMAT_48M08 +#define WAVE_FORMAT_48M08 0x00001000 /* 48 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_48S08 0x00002000 /* 48 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_48M16 0x00004000 /* 48 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_48S16 0x00008000 /* 48 kHz, Stereo, 16-bit */ +#define WAVE_FORMAT_96M08 0x00010000 /* 96 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_96S08 0x00020000 /* 96 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_96M16 0x00040000 /* 96 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_96S16 0x00080000 /* 96 kHz, Stereo, 16-bit */ +#endif + + /* defaultSampleRate */ + if( caps.dwChannels == 2 ) + { + if( caps.dwFormats & WAVE_FORMAT_4S16 ) + deviceInfo->defaultSampleRate = 44100.0; + else if( caps.dwFormats & WAVE_FORMAT_48S16 ) + deviceInfo->defaultSampleRate = 48000.0; + else if( caps.dwFormats & WAVE_FORMAT_2S16 ) + deviceInfo->defaultSampleRate = 22050.0; + else if( caps.dwFormats & WAVE_FORMAT_1S16 ) + deviceInfo->defaultSampleRate = 11025.0; + else if( caps.dwFormats & WAVE_FORMAT_96S16 ) + deviceInfo->defaultSampleRate = 96000.0; + else + deviceInfo->defaultSampleRate = 0.; + } + else if( caps.dwChannels == 1 ) + { + if( caps.dwFormats & WAVE_FORMAT_4M16 ) + deviceInfo->defaultSampleRate = 44100.0; + else if( caps.dwFormats & WAVE_FORMAT_48M16 ) + deviceInfo->defaultSampleRate = 48000.0; + else if( caps.dwFormats & WAVE_FORMAT_2M16 ) + deviceInfo->defaultSampleRate = 22050.0; + else if( caps.dwFormats & WAVE_FORMAT_1M16 ) + deviceInfo->defaultSampleRate = 11025.0; + else if( caps.dwFormats & WAVE_FORMAT_96M16 ) + deviceInfo->defaultSampleRate = 96000.0; + else + deviceInfo->defaultSampleRate = 0.; + } + else deviceInfo->defaultSampleRate = 0.; + } + } + + IDirectSoundCapture_Release( lpDirectSoundCapture ); + } + + if( deviceOK ) + { + deviceInfo->name = name; + + if( lpGUID == NULL ) + hostApi->info.defaultInputDevice = hostApi->info.deviceCount; + + hostApi->info.deviceCount++; + } + + return result; +} + + +/***********************************************************************************/ +PaError PaWinDs_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i, deviceCount; + PaWinDsHostApiRepresentation *winDsHostApi; + DSDeviceNameAndGUIDVector inputNamesAndGUIDs, outputNamesAndGUIDs; + PaDeviceInfo *deviceInfoArray; + + HRESULT hr = CoInitialize(NULL); /** @todo: should uninitialize too */ + if( FAILED(hr) ){ + return paUnanticipatedHostError; + } + + /* initialise guid vectors so they can be safely deleted on error */ + inputNamesAndGUIDs.items = NULL; + outputNamesAndGUIDs.items = NULL; + + PaWinDs_InitializeDSoundEntryPoints(); + + winDsHostApi = (PaWinDsHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinDsHostApiRepresentation) ); + if( !winDsHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + winDsHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !winDsHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + *hostApi = &winDsHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paDirectSound; + (*hostApi)->info.name = "Windows DirectSound"; + + (*hostApi)->info.deviceCount = 0; + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + + +/* DSound - enumerate devices to count them and to gather their GUIDs */ + + + result = InitializeDSDeviceNameAndGUIDVector( &inputNamesAndGUIDs, winDsHostApi->allocations ); + if( result != paNoError ) + goto error; + + result = InitializeDSDeviceNameAndGUIDVector( &outputNamesAndGUIDs, winDsHostApi->allocations ); + if( result != paNoError ) + goto error; + + paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK)CollectGUIDsProc, (void *)&inputNamesAndGUIDs ); + + paWinDsDSoundEntryPoints.DirectSoundEnumerate( (LPDSENUMCALLBACK)CollectGUIDsProc, (void *)&outputNamesAndGUIDs ); + + if( inputNamesAndGUIDs.enumerationError != paNoError ) + { + result = inputNamesAndGUIDs.enumerationError; + goto error; + } + + if( outputNamesAndGUIDs.enumerationError != paNoError ) + { + result = outputNamesAndGUIDs.enumerationError; + goto error; + } + + deviceCount = inputNamesAndGUIDs.count + outputNamesAndGUIDs.count; + + if( deviceCount > 0 ) + { + /* allocate array for pointers to PaDeviceInfo structs */ + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + winDsHostApi->allocations, sizeof(PaDeviceInfo*) * deviceCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all PaDeviceInfo structs in a contiguous block */ + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + winDsHostApi->allocations, sizeof(PaDeviceInfo) * deviceCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all DSound specific info structs in a contiguous block */ + winDsHostApi->winDsDeviceInfos = (PaWinDsDeviceInfo*)PaUtil_GroupAllocateMemory( + winDsHostApi->allocations, sizeof(PaWinDsDeviceInfo) * deviceCount ); + if( !winDsHostApi->winDsDeviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < deviceCount; ++i ) + { + PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + deviceInfo->name = 0; + (*hostApi)->deviceInfos[i] = deviceInfo; + } + + for( i=0; i< inputNamesAndGUIDs.count; ++i ) + { + result = AddInputDeviceInfoFromDirectSoundCapture( winDsHostApi, + inputNamesAndGUIDs.items[i].name, + inputNamesAndGUIDs.items[i].lpGUID ); + if( result != paNoError ) + goto error; + } + + for( i=0; i< outputNamesAndGUIDs.count; ++i ) + { + result = AddOutputDeviceInfoFromDirectSound( winDsHostApi, + outputNamesAndGUIDs.items[i].name, + outputNamesAndGUIDs.items[i].lpGUID ); + if( result != paNoError ) + goto error; + } + } + + result = TerminateDSDeviceNameAndGUIDVector( &inputNamesAndGUIDs ); + if( result != paNoError ) + goto error; + + result = TerminateDSDeviceNameAndGUIDVector( &outputNamesAndGUIDs ); + if( result != paNoError ) + goto error; + + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &winDsHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &winDsHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( winDsHostApi ) + { + if( winDsHostApi->allocations ) + { + PaUtil_FreeAllAllocations( winDsHostApi->allocations ); + PaUtil_DestroyAllocationGroup( winDsHostApi->allocations ); + } + + PaUtil_FreeMemory( winDsHostApi ); + } + + TerminateDSDeviceNameAndGUIDVector( &inputNamesAndGUIDs ); + TerminateDSDeviceNameAndGUIDVector( &outputNamesAndGUIDs ); + + return result; +} + + +/***********************************************************************************/ +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaWinDsHostApiRepresentation *winDsHostApi = (PaWinDsHostApiRepresentation*)hostApi; + + /* + IMPLEMENT ME: + - clean up any resources not handled by the allocation group + */ + + if( winDsHostApi->allocations ) + { + PaUtil_FreeAllAllocations( winDsHostApi->allocations ); + PaUtil_DestroyAllocationGroup( winDsHostApi->allocations ); + } + + PaUtil_FreeMemory( winDsHostApi ); + + PaWinDs_TerminateDSoundEntryPoints(); + + CoUninitialize(); +} + + +/* Set minimal latency based on whether NT or Win95. + * NT has higher latency. + */ +static int PaWinDS_GetMinSystemLatency( void ) +{ + int minLatencyMsec; + /* Set minimal latency based on whether NT or other OS. + * NT has higher latency. + */ + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize = sizeof( osvi ); + GetVersionEx( &osvi ); + DBUG(("PA - PlatformId = 0x%x\n", osvi.dwPlatformId )); + DBUG(("PA - MajorVersion = 0x%x\n", osvi.dwMajorVersion )); + DBUG(("PA - MinorVersion = 0x%x\n", osvi.dwMinorVersion )); + /* Check for NT */ + if( (osvi.dwMajorVersion == 4) && (osvi.dwPlatformId == 2) ) + { + minLatencyMsec = PA_WIN_NT_LATENCY; + } + else if(osvi.dwMajorVersion >= 5) + { + minLatencyMsec = PA_WIN_WDM_LATENCY; + } + else + { + minLatencyMsec = PA_WIN_9X_LATENCY; + } + return minLatencyMsec; +} + +/***********************************************************************************/ +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + /* + IMPLEMENT ME: + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported if necessary + + - check that the device supports sampleRate + + Because the buffer adapter handles conversion between all standard + sample formats, the following checks are only required if paCustomFormat + is implemented, or under some other unusual conditions. + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + */ + + return paFormatIsSupported; +} + + +/************************************************************************* +** Determine minimum number of buffers required for this host based +** on minimum latency. Latency can be optionally set by user by setting +** an environment variable. For example, to set latency to 200 msec, put: +** +** set PA_MIN_LATENCY_MSEC=200 +** +** in the AUTOEXEC.BAT file and reboot. +** If the environment variable is not set, then the latency will be determined +** based on the OS. Windows NT has higher latency than Win95. +*/ +#define PA_LATENCY_ENV_NAME ("PA_MIN_LATENCY_MSEC") +#define PA_ENV_BUF_SIZE (32) + +static int PaWinDs_GetMinLatencyFrames( double sampleRate ) +{ + char envbuf[PA_ENV_BUF_SIZE]; + DWORD hresult; + int minLatencyMsec = 0; + + /* Let user determine minimal latency by setting environment variable. */ + hresult = GetEnvironmentVariable( PA_LATENCY_ENV_NAME, envbuf, PA_ENV_BUF_SIZE ); + if( (hresult > 0) && (hresult < PA_ENV_BUF_SIZE) ) + { + minLatencyMsec = atoi( envbuf ); + } + else + { + minLatencyMsec = PaWinDS_GetMinSystemLatency(); +#if PA_USE_HIGH_LATENCY + PRINT(("PA - Minimum Latency set to %d msec!\n", minLatencyMsec )); +#endif + + } + + return (int) (minLatencyMsec * sampleRate * SECONDS_PER_MSEC); +} + + +static HRESULT InitInputBuffer( PaWinDsStream *stream, unsigned long nFrameRate, WORD nChannels, int bytesPerBuffer ) +{ + DSCBUFFERDESC captureDesc; + WAVEFORMATEX wfFormat; + HRESULT result; + + stream->bytesPerInputFrame = nChannels * sizeof(short); + + // Define the buffer format + wfFormat.wFormatTag = WAVE_FORMAT_PCM; + wfFormat.nChannels = nChannels; + wfFormat.nSamplesPerSec = nFrameRate; + wfFormat.wBitsPerSample = 8 * sizeof(short); + wfFormat.nBlockAlign = (WORD)(wfFormat.nChannels * (wfFormat.wBitsPerSample / 8)); + wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign; + wfFormat.cbSize = 0; /* No extended format info. */ + stream->inputSize = bytesPerBuffer; + // ---------------------------------------------------------------------- + // Setup the secondary buffer description + ZeroMemory(&captureDesc, sizeof(DSCBUFFERDESC)); + captureDesc.dwSize = sizeof(DSCBUFFERDESC); + captureDesc.dwFlags = 0; + captureDesc.dwBufferBytes = bytesPerBuffer; + captureDesc.lpwfxFormat = &wfFormat; + // Create the capture buffer + if ((result = IDirectSoundCapture_CreateCaptureBuffer( stream->pDirectSoundCapture, + &captureDesc, &stream->pDirectSoundInputBuffer, NULL)) != DS_OK) return result; + stream->readOffset = 0; // reset last read position to start of buffer + return DS_OK; +} + + +static HRESULT InitOutputBuffer( PaWinDsStream *stream, unsigned long nFrameRate, WORD nChannels, int bytesPerBuffer ) +{ + DWORD dwDataLen; + DWORD playCursor; + HRESULT result; + LPDIRECTSOUNDBUFFER pPrimaryBuffer; + HWND hWnd; + HRESULT hr; + WAVEFORMATEX wfFormat; + DSBUFFERDESC primaryDesc; + DSBUFFERDESC secondaryDesc; + unsigned char* pDSBuffData; + LARGE_INTEGER counterFrequency; + + stream->outputBufferSizeBytes = bytesPerBuffer; + stream->outputIsRunning = FALSE; + stream->outputUnderflowCount = 0; + stream->dsw_framesWritten = 0; + stream->bytesPerOutputFrame = nChannels * sizeof(short); + + // We were using getForegroundWindow() but sometimes the ForegroundWindow may not be the + // applications's window. Also if that window is closed before the Buffer is closed + // then DirectSound can crash. (Thanks for Scott Patterson for reporting this.) + // So we will use GetDesktopWindow() which was suggested by Miller Puckette. + // hWnd = GetForegroundWindow(); + // + // FIXME: The example code I have on the net creates a hidden window that + // is managed by our code - I think we should do that - one hidden + // window for the whole of Pa_DS + // + hWnd = GetDesktopWindow(); + + // Set cooperative level to DSSCL_EXCLUSIVE so that we can get 16 bit output, 44.1 KHz. + // Exclusize also prevents unexpected sounds from other apps during a performance. + if ((hr = IDirectSound_SetCooperativeLevel( stream->pDirectSound, + hWnd, DSSCL_EXCLUSIVE)) != DS_OK) + { + return hr; + } + + // ----------------------------------------------------------------------- + // Create primary buffer and set format just so we can specify our custom format. + // Otherwise we would be stuck with the default which might be 8 bit or 22050 Hz. + // Setup the primary buffer description + ZeroMemory(&primaryDesc, sizeof(DSBUFFERDESC)); + primaryDesc.dwSize = sizeof(DSBUFFERDESC); + primaryDesc.dwFlags = DSBCAPS_PRIMARYBUFFER; // all panning, mixing, etc done by synth + primaryDesc.dwBufferBytes = 0; + primaryDesc.lpwfxFormat = NULL; + // Create the buffer + if ((result = IDirectSound_CreateSoundBuffer( stream->pDirectSound, + &primaryDesc, &pPrimaryBuffer, NULL)) != DS_OK) return result; + // Define the buffer format + wfFormat.wFormatTag = WAVE_FORMAT_PCM; + wfFormat.nChannels = nChannels; + wfFormat.nSamplesPerSec = nFrameRate; + wfFormat.wBitsPerSample = 8 * sizeof(short); + wfFormat.nBlockAlign = (WORD)(wfFormat.nChannels * (wfFormat.wBitsPerSample / 8)); + wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign; + wfFormat.cbSize = 0; /* No extended format info. */ + // Set the primary buffer's format + if((result = IDirectSoundBuffer_SetFormat( pPrimaryBuffer, &wfFormat)) != DS_OK) return result; + + // ---------------------------------------------------------------------- + // Setup the secondary buffer description + ZeroMemory(&secondaryDesc, sizeof(DSBUFFERDESC)); + secondaryDesc.dwSize = sizeof(DSBUFFERDESC); + secondaryDesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2; + secondaryDesc.dwBufferBytes = bytesPerBuffer; + secondaryDesc.lpwfxFormat = &wfFormat; + // Create the secondary buffer + if ((result = IDirectSound_CreateSoundBuffer( stream->pDirectSound, + &secondaryDesc, &stream->pDirectSoundOutputBuffer, NULL)) != DS_OK) return result; + // Lock the DS buffer + if ((result = IDirectSoundBuffer_Lock( stream->pDirectSoundOutputBuffer, 0, stream->outputBufferSizeBytes, (LPVOID*)&pDSBuffData, + &dwDataLen, NULL, 0, 0)) != DS_OK) return result; + // Zero the DS buffer + ZeroMemory(pDSBuffData, dwDataLen); + // Unlock the DS buffer + if ((result = IDirectSoundBuffer_Unlock( stream->pDirectSoundOutputBuffer, pDSBuffData, dwDataLen, NULL, 0)) != DS_OK) return result; + if( QueryPerformanceFrequency( &counterFrequency ) ) + { + int framesInBuffer = bytesPerBuffer / (nChannels * sizeof(short)); + stream->perfCounterTicksPerBuffer.QuadPart = (counterFrequency.QuadPart * framesInBuffer) / nFrameRate; + } + else + { + stream->perfCounterTicksPerBuffer.QuadPart = 0; + } + // Let DSound set the starting write position because if we set it to zero, it looks like the + // buffer is full to begin with. This causes a long pause before sound starts when using large buffers. + hr = IDirectSoundBuffer_GetCurrentPosition( stream->pDirectSoundOutputBuffer, + &playCursor, &stream->outputBufferWriteOffsetBytes ); + if( hr != DS_OK ) + { + return hr; + } + stream->dsw_framesWritten = stream->outputBufferWriteOffsetBytes / stream->bytesPerOutputFrame; + /* printf("DSW_InitOutputBuffer: playCursor = %d, writeCursor = %d\n", playCursor, dsw->dsw_WriteOffset ); */ + return DS_OK; +} + + +/***********************************************************************************/ +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaWinDsHostApiRepresentation *winDsHostApi = (PaWinDsHostApiRepresentation*)hostApi; + PaWinDsStream *stream = 0; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + unsigned long suggestedInputLatencyFrames, suggestedOutputLatencyFrames; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + suggestedInputLatencyFrames = (unsigned long)(inputParameters->suggestedLatency * sampleRate); + + /* IDEA: the following 3 checks could be performed by default by pa_front + unless some flag indicated otherwise */ + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate hostApiSpecificStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + suggestedInputLatencyFrames = 0; + } + + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + suggestedOutputLatencyFrames = (unsigned long)(outputParameters->suggestedLatency * sampleRate); + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate hostApiSpecificStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + suggestedOutputLatencyFrames = 0; + } + + + /* + IMPLEMENT ME: + + ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() ) + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + - alter sampleRate to a close allowable rate if possible / necessary + + - validate suggestedInputLatency and suggestedOutputLatency parameters, + use default values where necessary + */ + + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + + stream = (PaWinDsStream*)PaUtil_AllocateMemory( sizeof(PaWinDsStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + + memset( stream, 0, sizeof(PaWinDsStream) ); /* initialize all stream variables to 0 */ + + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &winDsHostApi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &winDsHostApi->blockingStreamInterface, streamCallback, userData ); + } + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + if( inputParameters ) + { + /* IMPLEMENT ME - establish which host formats are available */ + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, inputParameters->sampleFormat ); + } + + if( outputParameters ) + { + /* IMPLEMENT ME - establish which host formats are available */ + hostOutputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, outputParameters->sampleFormat ); + } + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerBuffer, /* ignored in paUtilVariableHostBufferSizePartialUsageAllowed mode. */ + /* This next mode is required because DS can split the host buffer when it wraps around. */ + paUtilVariableHostBufferSizePartialUsageAllowed, + streamCallback, userData ); + if( result != paNoError ) + goto error; + + + stream->streamRepresentation.streamInfo.inputLatency = + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor); /* FIXME: not initialised anywhere else */ + stream->streamRepresentation.streamInfo.outputLatency = + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor); /* FIXME: not initialised anywhere else */ + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + +/* DirectSound specific initialization */ + { + HRESULT hr; + int bytesPerDirectSoundBuffer; + int userLatencyFrames; + int minLatencyFrames; + + stream->timerID = 0; + + /* Get system minimum latency. */ + minLatencyFrames = PaWinDs_GetMinLatencyFrames( sampleRate ); + + /* Let user override latency by passing latency parameter. */ + userLatencyFrames = (suggestedInputLatencyFrames > suggestedOutputLatencyFrames) + ? suggestedInputLatencyFrames + : suggestedOutputLatencyFrames; + if( userLatencyFrames > 0 ) minLatencyFrames = userLatencyFrames; + + /* Calculate stream->framesPerDSBuffer depending on framesPerBuffer */ + if( framesPerBuffer == paFramesPerBufferUnspecified ) + { + /* App support variable framesPerBuffer */ + stream->framesPerDSBuffer = minLatencyFrames; + + stream->streamRepresentation.streamInfo.outputLatency = (double)(minLatencyFrames - 1) / sampleRate; + } + else + { + /* Round up to number of buffers needed to guarantee that latency. */ + int numUserBuffers = (minLatencyFrames + framesPerBuffer - 1) / framesPerBuffer; + if( numUserBuffers < 1 ) numUserBuffers = 1; + numUserBuffers += 1; /* So we have latency worth of buffers ahead of current buffer. */ + stream->framesPerDSBuffer = framesPerBuffer * numUserBuffers; + + stream->streamRepresentation.streamInfo.outputLatency = (double)(framesPerBuffer * (numUserBuffers-1)) / sampleRate; + } + + { + /** @todo REVIEW: this calculation seems incorrect to me - rossb. */ + int msecLatency = (int) ((stream->framesPerDSBuffer * MSEC_PER_SECOND) / sampleRate); + PRINT(("PortAudio on DirectSound - Latency = %d frames, %d msec\n", stream->framesPerDSBuffer, msecLatency )); + } + + + /* ------------------ OUTPUT */ + if( outputParameters ) + { + /* + PaDeviceInfo *deviceInfo = hostApi->deviceInfos[ outputParameters->device ]; + DBUG(("PaHost_OpenStream: deviceID = 0x%x\n", outputParameters->device)); + */ + + bytesPerDirectSoundBuffer = stream->framesPerDSBuffer * outputParameters->channelCount * sizeof(short); + if( bytesPerDirectSoundBuffer < DSBSIZE_MIN ) + { + result = paBufferTooSmall; + goto error; + } + else if( bytesPerDirectSoundBuffer > DSBSIZE_MAX ) + { + result = paBufferTooBig; + goto error; + } + + + hr = paWinDsDSoundEntryPoints.DirectSoundCreate( winDsHostApi->winDsDeviceInfos[outputParameters->device].lpGUID, + &stream->pDirectSound, NULL ); + if( hr != DS_OK ) + { + ERR_RPT(("PortAudio: DirectSoundCreate() failed!\n")); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + hr = InitOutputBuffer( stream, + (unsigned long) (sampleRate + 0.5), + (WORD)outputParameters->channelCount, bytesPerDirectSoundBuffer ); + DBUG(("InitOutputBuffer() returns %x\n", hr)); + if( hr != DS_OK ) + { + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + /* Calculate value used in latency calculation to avoid real-time divides. */ + stream->secondsPerHostByte = 1.0 / + (stream->bufferProcessor.bytesPerHostOutputSample * + outputChannelCount * sampleRate); + } + + /* ------------------ INPUT */ + if( inputParameters ) + { + /* + PaDeviceInfo *deviceInfo = hostApi->deviceInfos[ inputParameters->device ]; + DBUG(("PaHost_OpenStream: deviceID = 0x%x\n", inputParameters->device)); + */ + + bytesPerDirectSoundBuffer = stream->framesPerDSBuffer * inputParameters->channelCount * sizeof(short); + if( bytesPerDirectSoundBuffer < DSBSIZE_MIN ) + { + result = paBufferTooSmall; + goto error; + } + else if( bytesPerDirectSoundBuffer > DSBSIZE_MAX ) + { + result = paBufferTooBig; + goto error; + } + + hr = paWinDsDSoundEntryPoints.DirectSoundCaptureCreate( winDsHostApi->winDsDeviceInfos[inputParameters->device].lpGUID, + &stream->pDirectSoundCapture, NULL ); + if( hr != DS_OK ) + { + ERR_RPT(("PortAudio: DirectSoundCaptureCreate() failed!\n")); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + hr = InitInputBuffer( stream, + (unsigned long) (sampleRate + 0.5), + (WORD)inputParameters->channelCount, bytesPerDirectSoundBuffer ); + DBUG(("InitInputBuffer() returns %x\n", hr)); + if( hr != DS_OK ) + { + ERR_RPT(("PortAudio: DSW_InitInputBuffer() returns %x\n", hr)); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + } + + } + + *s = (PaStream*)stream; + + return result; + +error: + if( stream ) + PaUtil_FreeMemory( stream ); + + return result; +} + + +/************************************************************************************ + * Determine how much space can be safely written to in DS buffer. + * Detect underflows and overflows. + * Does not allow writing into safety gap maintained by DirectSound. + */ +static HRESULT QueryOutputSpace( PaWinDsStream *stream, long *bytesEmpty ) +{ + HRESULT hr; + DWORD playCursor; + DWORD writeCursor; + long numBytesEmpty; + long playWriteGap; + // Query to see how much room is in buffer. + hr = IDirectSoundBuffer_GetCurrentPosition( stream->pDirectSoundOutputBuffer, + &playCursor, &writeCursor ); + if( hr != DS_OK ) + { + return hr; + } + // Determine size of gap between playIndex and WriteIndex that we cannot write into. + playWriteGap = writeCursor - playCursor; + if( playWriteGap < 0 ) playWriteGap += stream->outputBufferSizeBytes; // unwrap + /* DirectSound doesn't have a large enough playCursor so we cannot detect wrap-around. */ + /* Attempt to detect playCursor wrap-around and correct it. */ + if( stream->outputIsRunning && (stream->perfCounterTicksPerBuffer.QuadPart != 0) ) + { + /* How much time has elapsed since last check. */ + LARGE_INTEGER currentTime; + LARGE_INTEGER elapsedTime; + long bytesPlayed; + long bytesExpected; + long buffersWrapped; + QueryPerformanceCounter( ¤tTime ); + elapsedTime.QuadPart = currentTime.QuadPart - stream->previousPlayTime.QuadPart; + stream->previousPlayTime = currentTime; + /* How many bytes does DirectSound say have been played. */ + bytesPlayed = playCursor - stream->previousPlayCursor; + if( bytesPlayed < 0 ) bytesPlayed += stream->outputBufferSizeBytes; // unwrap + stream->previousPlayCursor = playCursor; + /* Calculate how many bytes we would have expected to been played by now. */ + bytesExpected = (long) ((elapsedTime.QuadPart * stream->outputBufferSizeBytes) / stream->perfCounterTicksPerBuffer.QuadPart); + buffersWrapped = (bytesExpected - bytesPlayed) / stream->outputBufferSizeBytes; + if( buffersWrapped > 0 ) + { + playCursor += (buffersWrapped * stream->outputBufferSizeBytes); + bytesPlayed += (buffersWrapped * stream->outputBufferSizeBytes); + } + /* Maintain frame output cursor. */ + stream->framesPlayed += (bytesPlayed / stream->bytesPerOutputFrame); + } + numBytesEmpty = playCursor - stream->outputBufferWriteOffsetBytes; + if( numBytesEmpty < 0 ) numBytesEmpty += stream->outputBufferSizeBytes; // unwrap offset + /* Have we underflowed? */ + if( numBytesEmpty > (stream->outputBufferSizeBytes - playWriteGap) ) + { + if( stream->outputIsRunning ) + { + stream->outputUnderflowCount += 1; + } + stream->outputBufferWriteOffsetBytes = writeCursor; + numBytesEmpty = stream->outputBufferSizeBytes - playWriteGap; + } + *bytesEmpty = numBytesEmpty; + return hr; +} + +/***********************************************************************************/ +static PaError Pa_TimeSlice( PaWinDsStream *stream ) +{ + PaError result = 0; /* FIXME: this should be declared int and this function should also return that type (same as stream callback return type)*/ + long numFrames = 0; + long bytesEmpty = 0; + long bytesFilled = 0; + long bytesToXfer = 0; + long framesToXfer = 0; + long numInFramesReady = 0; + long numOutFramesReady = 0; + long bytesProcessed; + HRESULT hresult; + double outputLatency = 0; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /** @todo implement inputBufferAdcTime */ + +/* Input */ + LPBYTE lpInBuf1 = NULL; + LPBYTE lpInBuf2 = NULL; + DWORD dwInSize1 = 0; + DWORD dwInSize2 = 0; +/* Output */ + LPBYTE lpOutBuf1 = NULL; + LPBYTE lpOutBuf2 = NULL; + DWORD dwOutSize1 = 0; + DWORD dwOutSize2 = 0; + + /* How much input data is available? */ + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + HRESULT hr; + DWORD capturePos; + DWORD readPos; + long filled = 0; + // Query to see how much data is in buffer. + // We don't need the capture position but sometimes DirectSound doesn't handle NULLS correctly + // so let's pass a pointer just to be safe. + hr = IDirectSoundCaptureBuffer_GetCurrentPosition( stream->pDirectSoundInputBuffer, &capturePos, &readPos ); + if( hr == DS_OK ) + { + filled = readPos - stream->readOffset; + if( filled < 0 ) filled += stream->inputSize; // unwrap offset + bytesFilled = filled; + } + // FIXME: what happens if IDirectSoundCaptureBuffer_GetCurrentPosition fails? + + framesToXfer = numInFramesReady = bytesFilled / stream->bytesPerInputFrame; + outputLatency = ((double)bytesFilled) * stream->secondsPerHostByte; + + /** @todo Check for overflow */ + } + + /* How much output room is available? */ + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + UINT previousUnderflowCount = stream->outputUnderflowCount; + QueryOutputSpace( stream, &bytesEmpty ); + framesToXfer = numOutFramesReady = bytesEmpty / stream->bytesPerOutputFrame; + + /* Check for underflow */ + if( stream->outputUnderflowCount != previousUnderflowCount ) + stream->callbackFlags |= paOutputUnderflow; + } + + if( (numInFramesReady > 0) && (numOutFramesReady > 0) ) + { + framesToXfer = (numOutFramesReady < numInFramesReady) ? numOutFramesReady : numInFramesReady; + } + + if( framesToXfer > 0 ) + { + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + /* The outputBufferDacTime parameter should indicates the time at which + the first sample of the output buffer is heard at the DACs. */ + timeInfo.currentTime = PaUtil_GetTime(); + timeInfo.outputBufferDacTime = timeInfo.currentTime + outputLatency; + + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, stream->callbackFlags ); + stream->callbackFlags = 0; + + /* Input */ + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + bytesToXfer = framesToXfer * stream->bytesPerInputFrame; + hresult = IDirectSoundCaptureBuffer_Lock ( stream->pDirectSoundInputBuffer, + stream->readOffset, bytesToXfer, + (void **) &lpInBuf1, &dwInSize1, + (void **) &lpInBuf2, &dwInSize2, 0); + if (hresult != DS_OK) + { + ERR_RPT(("DirectSound IDirectSoundCaptureBuffer_Lock failed, hresult = 0x%x\n",hresult)); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hresult ); + goto error2; + } + + numFrames = dwInSize1 / stream->bytesPerInputFrame; + PaUtil_SetInputFrameCount( &stream->bufferProcessor, numFrames ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, lpInBuf1, 0 ); + /* Is input split into two regions. */ + if( dwInSize2 > 0 ) + { + numFrames = dwInSize2 / stream->bytesPerInputFrame; + PaUtil_Set2ndInputFrameCount( &stream->bufferProcessor, numFrames ); + PaUtil_Set2ndInterleavedInputChannels( &stream->bufferProcessor, 0, lpInBuf2, 0 ); + } + } + + /* Output */ + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + bytesToXfer = framesToXfer * stream->bytesPerOutputFrame; + hresult = IDirectSoundBuffer_Lock ( stream->pDirectSoundOutputBuffer, + stream->outputBufferWriteOffsetBytes, bytesToXfer, + (void **) &lpOutBuf1, &dwOutSize1, + (void **) &lpOutBuf2, &dwOutSize2, 0); + if (hresult != DS_OK) + { + ERR_RPT(("DirectSound IDirectSoundBuffer_Lock failed, hresult = 0x%x\n",hresult)); + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hresult ); + goto error1; + } + + numFrames = dwOutSize1 / stream->bytesPerOutputFrame; + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, numFrames ); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, lpOutBuf1, 0 ); + + /* Is output split into two regions. */ + if( dwOutSize2 > 0 ) + { + numFrames = dwOutSize2 / stream->bytesPerOutputFrame; + PaUtil_Set2ndOutputFrameCount( &stream->bufferProcessor, numFrames ); + PaUtil_Set2ndInterleavedOutputChannels( &stream->bufferProcessor, 0, lpOutBuf2, 0 ); + } + } + + result = paContinue; + numFrames = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &result ); + stream->framesWritten += numFrames; + + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + /* FIXME: an underflow could happen here */ + + /* Update our buffer offset and unlock sound buffer */ + bytesProcessed = numFrames * stream->bytesPerOutputFrame; + stream->outputBufferWriteOffsetBytes = (stream->outputBufferWriteOffsetBytes + bytesProcessed) % stream->outputBufferSizeBytes; + IDirectSoundBuffer_Unlock( stream->pDirectSoundOutputBuffer, lpOutBuf1, dwOutSize1, lpOutBuf2, dwOutSize2); + stream->dsw_framesWritten += numFrames; + } + +error1: + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + /* FIXME: an overflow could happen here */ + + /* Update our buffer offset and unlock sound buffer */ + bytesProcessed = numFrames * stream->bytesPerInputFrame; + stream->readOffset = (stream->readOffset + bytesProcessed) % stream->inputSize; + IDirectSoundCaptureBuffer_Unlock( stream->pDirectSoundInputBuffer, lpInBuf1, dwInSize1, lpInBuf2, dwInSize2); + } +error2: + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, numFrames ); + + } + + return result; +} +/*******************************************************************/ + +static HRESULT ZeroAvailableOutputSpace( PaWinDsStream *stream ) +{ + HRESULT hr; + LPBYTE lpbuf1 = NULL; + LPBYTE lpbuf2 = NULL; + DWORD dwsize1 = 0; + DWORD dwsize2 = 0; + long bytesEmpty; + hr = QueryOutputSpace( stream, &bytesEmpty ); // updates framesPlayed + if (hr != DS_OK) return hr; + if( bytesEmpty == 0 ) return DS_OK; + // Lock free space in the DS + hr = IDirectSoundBuffer_Lock( stream->pDirectSoundOutputBuffer, stream->outputBufferWriteOffsetBytes, + bytesEmpty, (void **) &lpbuf1, &dwsize1, + (void **) &lpbuf2, &dwsize2, 0); + if (hr == DS_OK) + { + // Copy the buffer into the DS + ZeroMemory(lpbuf1, dwsize1); + if(lpbuf2 != NULL) + { + ZeroMemory(lpbuf2, dwsize2); + } + // Update our buffer offset and unlock sound buffer + stream->outputBufferWriteOffsetBytes = (stream->outputBufferWriteOffsetBytes + dwsize1 + dwsize2) % stream->outputBufferSizeBytes; + IDirectSoundBuffer_Unlock( stream->pDirectSoundOutputBuffer, lpbuf1, dwsize1, lpbuf2, dwsize2); + stream->dsw_framesWritten += bytesEmpty / stream->bytesPerOutputFrame; + } + return hr; +} + + +static void CALLBACK Pa_TimerCallback(UINT uID, UINT uMsg, DWORD_PTR dwUser, DWORD dw1, DWORD dw2) +{ + PaWinDsStream *stream; + + /* suppress unused variable warnings */ + (void) uID; + (void) uMsg; + (void) dw1; + (void) dw2; + + stream = (PaWinDsStream *) dwUser; + if( stream == NULL ) return; + + if( stream->isActive ) + { + if( stream->abortProcessing ) + { + stream->isActive = 0; + } + else if( stream->stopProcessing ) + { + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + ZeroAvailableOutputSpace( stream ); + /* clear isActive when all sound played */ + if( stream->framesPlayed >= stream->framesWritten ) + { + stream->isActive = 0; + } + } + else + { + stream->isActive = 0; + } + } + else + { + if( Pa_TimeSlice( stream ) != 0) /* Call time slice independant of timing method. */ + { + /* FIXME implement handling of paComplete and paAbort if possible */ + stream->stopProcessing = 1; + } + } + + if( !stream->isActive ){ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + } +} + +/*********************************************************************************** + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaWinDsStream *stream = (PaWinDsStream*)s; + + // Cleanup the sound buffers + if( stream->pDirectSoundOutputBuffer ) + { + IDirectSoundBuffer_Stop( stream->pDirectSoundOutputBuffer ); + IDirectSoundBuffer_Release( stream->pDirectSoundOutputBuffer ); + stream->pDirectSoundOutputBuffer = NULL; + } + + if( stream->pDirectSoundInputBuffer ) + { + IDirectSoundCaptureBuffer_Stop( stream->pDirectSoundInputBuffer ); + IDirectSoundCaptureBuffer_Release( stream->pDirectSoundInputBuffer ); + stream->pDirectSoundInputBuffer = NULL; + } + + if( stream->pDirectSoundCapture ) + { + IDirectSoundCapture_Release( stream->pDirectSoundCapture ); + stream->pDirectSoundCapture = NULL; + } + + if( stream->pDirectSound ) + { + IDirectSound_Release( stream->pDirectSound ); + stream->pDirectSound = NULL; + } + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); + + return result; +} + +/***********************************************************************************/ +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinDsStream *stream = (PaWinDsStream*)s; + HRESULT hr; + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + // Start the buffer playback + if( stream->pDirectSoundInputBuffer != NULL ) // FIXME: not sure this check is necessary + { + hr = IDirectSoundCaptureBuffer_Start( stream->pDirectSoundInputBuffer, DSCBSTART_LOOPING ); + } + + DBUG(("StartStream: DSW_StartInput returned = 0x%X.\n", hr)); + if( hr != DS_OK ) + { + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + } + + stream->framesWritten = 0; + stream->callbackFlags = 0; + + stream->abortProcessing = 0; + stream->stopProcessing = 0; + stream->isActive = 1; + + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + /* Give user callback a chance to pre-fill buffer. REVIEW - i thought we weren't pre-filling, rb. */ + result = Pa_TimeSlice( stream ); + if( result != paNoError ) return result; // FIXME - what if finished? + + QueryPerformanceCounter( &stream->previousPlayTime ); + stream->previousPlayCursor = 0; + stream->framesPlayed = 0; + hr = IDirectSoundBuffer_SetCurrentPosition( stream->pDirectSoundOutputBuffer, 0 ); + DBUG(("PaHost_StartOutput: IDirectSoundBuffer_SetCurrentPosition returned = 0x%X.\n", hr)); + if( hr != DS_OK ) + { + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + + // Start the buffer playback in a loop. + if( stream->pDirectSoundOutputBuffer != NULL ) // FIXME: not sure this needs to be checked here + { + hr = IDirectSoundBuffer_Play( stream->pDirectSoundOutputBuffer, 0, 0, DSBPLAY_LOOPING ); + DBUG(("PaHost_StartOutput: IDirectSoundBuffer_Play returned = 0x%X.\n", hr)); + if( hr != DS_OK ) + { + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + stream->outputIsRunning = TRUE; + } + } + + + /* Create timer that will wake us up so we can fill the DSound buffer. */ + { + int resolution; + int framesPerWakeup = stream->framesPerDSBuffer / 4; + int msecPerWakeup = MSEC_PER_SECOND * framesPerWakeup / (int) stream->streamRepresentation.streamInfo.sampleRate; + if( msecPerWakeup < 10 ) msecPerWakeup = 10; + else if( msecPerWakeup > 100 ) msecPerWakeup = 100; + resolution = msecPerWakeup/4; + stream->timerID = timeSetEvent( msecPerWakeup, resolution, (LPTIMECALLBACK) Pa_TimerCallback, + (DWORD_PTR) stream, TIME_PERIODIC ); + } + if( stream->timerID == 0 ) + { + stream->isActive = 0; + result = paUnanticipatedHostError; + PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ); + goto error; + } + + stream->isStarted = TRUE; + +error: + return result; +} + + +/***********************************************************************************/ +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinDsStream *stream = (PaWinDsStream*)s; + HRESULT hr; + int timeoutMsec; + + stream->stopProcessing = 1; + /* Set timeout at 20% beyond maximum time we might wait. */ + timeoutMsec = (int) (1200.0 * stream->framesPerDSBuffer / stream->streamRepresentation.streamInfo.sampleRate); + while( stream->isActive && (timeoutMsec > 0) ) + { + Sleep(10); + timeoutMsec -= 10; + } + if( stream->timerID != 0 ) + { + timeKillEvent(stream->timerID); /* Stop callback timer. */ + stream->timerID = 0; + } + + + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + // Stop the buffer playback + if( stream->pDirectSoundOutputBuffer != NULL ) + { + stream->outputIsRunning = FALSE; + // FIXME: what happens if IDirectSoundBuffer_Stop returns an error? + hr = IDirectSoundBuffer_Stop( stream->pDirectSoundOutputBuffer ); + } + } + + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + // Stop the buffer capture + if( stream->pDirectSoundInputBuffer != NULL ) + { + // FIXME: what happens if IDirectSoundCaptureBuffer_Stop returns an error? + hr = IDirectSoundCaptureBuffer_Stop( stream->pDirectSoundInputBuffer ); + } + } + + stream->isStarted = FALSE; + + return result; +} + + +/***********************************************************************************/ +static PaError AbortStream( PaStream *s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + stream->abortProcessing = 1; + return StopStream( s ); +} + + +/***********************************************************************************/ +static PaError IsStreamStopped( PaStream *s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + return !stream->isStarted; +} + + +/***********************************************************************************/ +static PaError IsStreamActive( PaStream *s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + return stream->isActive; +} + +/***********************************************************************************/ +static PaTime GetStreamTime( PaStream *s ) +{ + /* suppress unused variable warnings */ + (void) s; + + return PaUtil_GetTime(); +} + + +/***********************************************************************************/ +static double GetStreamCpuLoad( PaStream* s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/*********************************************************************************** + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +/***********************************************************************************/ +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +/***********************************************************************************/ +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + +/***********************************************************************************/ +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaWinDsStream *stream = (PaWinDsStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + + diff --git a/portaudio-v19/src/hostapi/dsound/pa_win_ds_dynlink.c b/portaudio-v19/src/hostapi/dsound/pa_win_ds_dynlink.c new file mode 100644 index 000000000..ef8a41c04 --- /dev/null +++ b/portaudio-v19/src/hostapi/dsound/pa_win_ds_dynlink.c @@ -0,0 +1,121 @@ +#include "pa_win_ds_dynlink.h" + + +PaWinDsDSoundEntryPoints paWinDsDSoundEntryPoints = { 0, 0, 0, 0, 0, 0, 0 }; + + +static HRESULT WINAPI DummyDirectSoundCreate(LPGUID lpcGuidDevice, LPDIRECTSOUND *ppDS, LPUNKNOWN pUnkOuter) +{ + (void)lpcGuidDevice; /* unused parameter */ + (void)ppDS; /* unused parameter */ + (void)pUnkOuter; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext) +{ + (void)lpDSEnumCallback; /* unused parameter */ + (void)lpContext; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundEnumerateA(LPDSENUMCALLBACKA lpDSEnumCallback, LPVOID lpContext) +{ + (void)lpDSEnumCallback; /* unused parameter */ + (void)lpContext; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundCaptureCreate(LPGUID lpcGUID, LPDIRECTSOUNDCAPTURE *lplpDSC, LPUNKNOWN pUnkOuter) +{ + (void)lpcGUID; /* unused parameter */ + (void)lplpDSC; /* unused parameter */ + (void)pUnkOuter; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW lpDSCEnumCallback, LPVOID lpContext) +{ + (void)lpDSCEnumCallback; /* unused parameter */ + (void)lpContext; /* unused parameter */ + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA lpDSCEnumCallback, LPVOID lpContext) +{ + (void)lpDSCEnumCallback; /* unused parameter */ + (void)lpContext; /* unused parameter */ + return E_NOTIMPL; +} + + +void PaWinDs_InitializeDSoundEntryPoints(void) +{ + paWinDsDSoundEntryPoints.hInstance_ = LoadLibrary("dsound.dll"); + if( paWinDsDSoundEntryPoints.hInstance_ != NULL ) + { + paWinDsDSoundEntryPoints.DirectSoundCreate = + (HRESULT (WINAPI *)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN)) + GetProcAddress( paWinDsDSoundEntryPoints.hInstance_, "DirectSoundCreate" ); + if( paWinDsDSoundEntryPoints.DirectSoundCreate == NULL ) + paWinDsDSoundEntryPoints.DirectSoundCreate = DummyDirectSoundCreate; + + paWinDsDSoundEntryPoints.DirectSoundEnumerateW = + (HRESULT (WINAPI *)(LPDSENUMCALLBACKW, LPVOID)) + GetProcAddress( paWinDsDSoundEntryPoints.hInstance_, "DirectSoundEnumerateW" ); + if( paWinDsDSoundEntryPoints.DirectSoundEnumerateW == NULL ) + paWinDsDSoundEntryPoints.DirectSoundEnumerateW = DummyDirectSoundEnumerateW; + + paWinDsDSoundEntryPoints.DirectSoundEnumerateA = + (HRESULT (WINAPI *)(LPDSENUMCALLBACKA, LPVOID)) + GetProcAddress( paWinDsDSoundEntryPoints.hInstance_, "DirectSoundEnumerateA" ); + if( paWinDsDSoundEntryPoints.DirectSoundEnumerateA == NULL ) + paWinDsDSoundEntryPoints.DirectSoundEnumerateA = DummyDirectSoundEnumerateA; + + paWinDsDSoundEntryPoints.DirectSoundCaptureCreate = + (HRESULT (WINAPI *)(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN)) + GetProcAddress( paWinDsDSoundEntryPoints.hInstance_, "DirectSoundCaptureCreate" ); + if( paWinDsDSoundEntryPoints.DirectSoundCaptureCreate == NULL ) + paWinDsDSoundEntryPoints.DirectSoundCaptureCreate = DummyDirectSoundCaptureCreate; + + paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateW = + (HRESULT (WINAPI *)(LPDSENUMCALLBACKW, LPVOID)) + GetProcAddress( paWinDsDSoundEntryPoints.hInstance_, "DirectSoundCaptureEnumerateW" ); + if( paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateW == NULL ) + paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateW = DummyDirectSoundCaptureEnumerateW; + + paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateA = + (HRESULT (WINAPI *)(LPDSENUMCALLBACKA, LPVOID)) + GetProcAddress( paWinDsDSoundEntryPoints.hInstance_, "DirectSoundCaptureEnumerateA" ); + if( paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateA == NULL ) + paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateA = DummyDirectSoundCaptureEnumerateA; + } + else + { + /* initialize with dummy entry points to make live easy when ds isn't present */ + paWinDsDSoundEntryPoints.DirectSoundCreate = DummyDirectSoundCreate; + paWinDsDSoundEntryPoints.DirectSoundEnumerateW = DummyDirectSoundEnumerateW; + paWinDsDSoundEntryPoints.DirectSoundEnumerateA = DummyDirectSoundEnumerateA; + paWinDsDSoundEntryPoints.DirectSoundCaptureCreate = DummyDirectSoundCaptureCreate; + paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateW = DummyDirectSoundCaptureEnumerateW; + paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateA = DummyDirectSoundCaptureEnumerateA; + } +} + + +void PaWinDs_TerminateDSoundEntryPoints(void) +{ + if( paWinDsDSoundEntryPoints.hInstance_ != NULL ) + { + /* ensure that we crash reliably if the entry points arent initialised */ + paWinDsDSoundEntryPoints.DirectSoundCreate = 0; + paWinDsDSoundEntryPoints.DirectSoundEnumerateW = 0; + paWinDsDSoundEntryPoints.DirectSoundEnumerateA = 0; + paWinDsDSoundEntryPoints.DirectSoundCaptureCreate = 0; + paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateW = 0; + paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateA = 0; + + FreeLibrary( paWinDsDSoundEntryPoints.hInstance_ ); + paWinDsDSoundEntryPoints.hInstance_ = NULL; + } +} \ No newline at end of file diff --git a/portaudio-v19/src/hostapi/dsound/pa_win_ds_dynlink.h b/portaudio-v19/src/hostapi/dsound/pa_win_ds_dynlink.h new file mode 100644 index 000000000..281287be3 --- /dev/null +++ b/portaudio-v19/src/hostapi/dsound/pa_win_ds_dynlink.h @@ -0,0 +1,82 @@ +#ifndef INCLUDED_PA_DSOUND_DYNLINK_H +#define INCLUDED_PA_DSOUND_DYNLINK_H +/* + * Interface for dynamically loading directsound and providing a dummy + * implementation if it isn't present. + * + * Author: Ross Bencina (some portions Phil Burk & Robert Marsanyi + * + * For PortAudio Portable Real-Time Audio Library + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2006 Phil Burk, Robert Marsanyi and Ross Bencina + * + * 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. + * + * 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. + * + * 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. + * + */ + +/* on Borland compilers, WIN32 doesn't seem to be defined by default, which + breaks DSound.h. Adding the define here fixes the problem. - rossb. */ +#ifdef __BORLANDC__ +#if !defined(WIN32) +#define WIN32 +#endif +#endif + +/* + We are only using DX3 in here, no need to polute the namespace - davidv +*/ +#define DIRECTSOUND_VERSION 0x0300 + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +typedef struct +{ + HINSTANCE hInstance_; + + HRESULT (WINAPI *DirectSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN); + HRESULT (WINAPI *DirectSoundEnumerateW)(LPDSENUMCALLBACKW, LPVOID); + HRESULT (WINAPI *DirectSoundEnumerateA)(LPDSENUMCALLBACKA, LPVOID); + + HRESULT (WINAPI *DirectSoundCaptureCreate)(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN); + HRESULT (WINAPI *DirectSoundCaptureEnumerateW)(LPDSENUMCALLBACKW, LPVOID); + HRESULT (WINAPI *DirectSoundCaptureEnumerateA)(LPDSENUMCALLBACKA, LPVOID); +}PaWinDsDSoundEntryPoints; + +extern PaWinDsDSoundEntryPoints paWinDsDSoundEntryPoints; + +void PaWinDs_InitializeDSoundEntryPoints(void); +void PaWinDs_TerminateDSoundEntryPoints(void); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* INCLUDED_PA_DSOUND_DYNLINK_H */ diff --git a/portaudio-v19/src/hostapi/jack/pa_jack.c b/portaudio-v19/src/hostapi/jack/pa_jack.c new file mode 100644 index 000000000..b18ee099c --- /dev/null +++ b/portaudio-v19/src/hostapi/jack/pa_jack.c @@ -0,0 +1,1724 @@ +/* + * $Id$ + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * JACK Implementation by Joshua Haberman + * + * Copyright (c) 2004 Stefan Westerfeld + * Copyright (c) 2004 Arve Knudsen + * Copyright (c) 2002 Joshua Haberman + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include /* EBUSY */ +#include /* sig_atomic_t */ +#include +#include + +#include +#include + +#include "pa_util.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_process.h" +#include "pa_allocation.h" +#include "pa_cpuload.h" +#include "../pablio/ringbuffer.c" + +static int aErr_; +static PaError paErr_; /* For use with ENSURE_PA */ +static pthread_t mainThread_; +static char *jackErr_ = NULL; + +#define STRINGIZE_HELPER(expr) #expr +#define STRINGIZE(expr) STRINGIZE_HELPER(expr) + +/* Check PaError */ +#define ENSURE_PA(expr) \ + do { \ + if( (paErr_ = (expr)) < paNoError ) \ + { \ + if( (paErr_) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \ + { \ + assert( jackErr_ ); \ + PaUtil_SetLastHostErrorInfo( paJACK, -1, jackErr_ ); \ + } \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = paErr_; \ + goto error; \ + } \ + } while( 0 ) + +#define UNLESS(expr, code) \ + do { \ + if( (expr) == 0 ) \ + { \ + if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \ + { \ + assert( jackErr_ ); \ + PaUtil_SetLastHostErrorInfo( paJACK, -1, jackErr_ ); \ + } \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = (code); \ + goto error; \ + } \ + } while( 0 ) + +#define ASSERT_CALL(expr, success) \ + aErr_ = (expr); \ + assert( aErr_ == success ); + +/* + * Functions that directly map to the PortAudio stream interface + */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +/*static PaTime GetStreamInputLatency( PaStream *stream );*/ +/*static PaTime GetStreamOutputLatency( PaStream *stream );*/ +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); + + +/* + * Data specific to this API + */ + +struct PaJackStream; + +typedef struct +{ + PaUtilHostApiRepresentation commonHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *deviceInfoMemory; + + jack_client_t *jack_client; + int jack_buffer_size; + PaHostApiIndex hostApiIndex; + + pthread_mutex_t mtx; + pthread_cond_t cond; + unsigned long inputBase, outputBase; + + /* For dealing with the process thread */ + volatile int xrun; /* Received xrun notification from JACK? */ + struct PaJackStream * volatile toAdd, * volatile toRemove; + struct PaJackStream *processQueue; + volatile sig_atomic_t jackIsDown; +} +PaJackHostApiRepresentation; + +/* PaJackStream - a stream data structure specifically for this implementation */ + +typedef struct PaJackStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilBufferProcessor bufferProcessor; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaJackHostApiRepresentation *hostApi; + + /* our input and output ports */ + jack_port_t **local_input_ports; + jack_port_t **local_output_ports; + + /* the input and output ports of the client we are connecting to */ + jack_port_t **remote_input_ports; + jack_port_t **remote_output_ports; + + int num_incoming_connections; + int num_outgoing_connections; + + jack_client_t *jack_client; + + /* The stream is running if it's still producing samples. + * The stream is active if samples it produced are still being heard. + */ + volatile sig_atomic_t is_running; + volatile sig_atomic_t is_active; + /* Used to signal processing thread that stream should start or stop, respectively */ + volatile sig_atomic_t doStart, doStop, doAbort; + + jack_nframes_t t0; + + PaUtilAllocationGroup *stream_memory; + + /* These are useful in the process callback */ + + int callbackResult; + int isSilenced; + int xrun; + + /* These are useful for the blocking API */ + + int isBlockingStream; + RingBuffer inFIFO; + RingBuffer outFIFO; + volatile sig_atomic_t data_available; + sem_t data_semaphore; + int bytesPerFrame; + int samplesPerFrame; + + struct PaJackStream *next; +} +PaJackStream; + +#define TRUE 1 +#define FALSE 0 + +/* + * Functions specific to this API + */ + +static int JackCallback( jack_nframes_t frames, void *userData ); + + +/* + * + * Implementation + * + */ + +/* ---- blocking emulation layer ---- */ + +/* Allocate buffer. */ +static PaError BlockingInitFIFO( RingBuffer *rbuf, long numFrames, long bytesPerFrame ) +{ + long numBytes = numFrames * bytesPerFrame; + char *buffer = (char *) malloc( numBytes ); + if( buffer == NULL ) return paInsufficientMemory; + memset( buffer, 0, numBytes ); + return (PaError) RingBuffer_Init( rbuf, numBytes, buffer ); +} + +/* Free buffer. */ +static PaError BlockingTermFIFO( RingBuffer *rbuf ) +{ + if( rbuf->buffer ) free( rbuf->buffer ); + rbuf->buffer = NULL; + return paNoError; +} + +static int +BlockingCallback( const void *inputBuffer, + void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + struct PaJackStream *stream = (PaJackStream *)userData; + long numBytes = stream->bytesPerFrame * framesPerBuffer; + + /* This may get called with NULL inputBuffer during initial setup. */ + if( inputBuffer != NULL ) + { + RingBuffer_Write( &stream->inFIFO, inputBuffer, numBytes ); + } + if( outputBuffer != NULL ) + { + int numRead = RingBuffer_Read( &stream->outFIFO, outputBuffer, numBytes ); + /* Zero out remainder of buffer if we run out of data. */ + memset( (char *)outputBuffer + numRead, 0, numBytes - numRead ); + } + + if( !stream->data_available ) + { + stream->data_available = 1; + sem_post( &stream->data_semaphore ); + } + return paContinue; +} + +static PaError +BlockingBegin( PaJackStream *stream, int minimum_buffer_size ) +{ + long doRead = 0; + long doWrite = 0; + PaError result = paNoError; + long numFrames; + + doRead = stream->local_input_ports != NULL; + doWrite = stream->local_output_ports != NULL; + /* */ + stream->samplesPerFrame = 2; + stream->bytesPerFrame = sizeof(float) * stream->samplesPerFrame; + /* */ + numFrames = 32; + while (numFrames < minimum_buffer_size) + numFrames *= 2; + + if( doRead ) + { + ENSURE_PA( BlockingInitFIFO( &stream->inFIFO, numFrames, stream->bytesPerFrame ) ); + } + if( doWrite ) + { + long numBytes; + + ENSURE_PA( BlockingInitFIFO( &stream->outFIFO, numFrames, stream->bytesPerFrame ) ); + + /* Make Write FIFO appear full initially. */ + numBytes = RingBuffer_GetWriteAvailable( &stream->outFIFO ); + RingBuffer_AdvanceWriteIndex( &stream->outFIFO, numBytes ); + } + + stream->data_available = 0; + sem_init( &stream->data_semaphore, 0, 0 ); + +error: + return result; +} + +static void +BlockingEnd( PaJackStream *stream ) +{ + BlockingTermFIFO( &stream->inFIFO ); + BlockingTermFIFO( &stream->outFIFO ); + + sem_destroy( &stream->data_semaphore ); +} + +static PaError BlockingReadStream( PaStream* s, void *data, unsigned long numFrames ) +{ + PaError result = paNoError; + PaJackStream *stream = (PaJackStream *)s; + + long bytesRead; + char *p = (char *) data; + long numBytes = stream->bytesPerFrame * numFrames; + while( numBytes > 0 ) + { + bytesRead = RingBuffer_Read( &stream->inFIFO, p, numBytes ); + numBytes -= bytesRead; + p += bytesRead; + if( numBytes > 0 ) + { + /* see write for an explanation */ + if( stream->data_available ) + stream->data_available = 0; + else + sem_wait( &stream->data_semaphore ); + } + } + + return result; +} + +static PaError BlockingWriteStream( PaStream* s, const void *data, unsigned long numFrames ) +{ + PaError result = paNoError; + PaJackStream *stream = (PaJackStream *)s; + long bytesWritten; + char *p = (char *) data; + long numBytes = stream->bytesPerFrame * numFrames; + while( numBytes > 0 ) + { + bytesWritten = RingBuffer_Write( &stream->outFIFO, p, numBytes ); + numBytes -= bytesWritten; + p += bytesWritten; + if( numBytes > 0 ) + { + /* we use the following algorithm: + * (1) write data + * (2) if some data didn't fit into the ringbuffer, set data_available to 0 + * to indicate to the audio that if space becomes available, we want to know + * (3) retry to write data (because it might be that between (1) and (2) + * new space in the buffer became available) + * (4) if this failed, we are sure that the buffer is really empty and + * we will definitely receive a notification when it becomes available + * thus we can safely sleep + * + * if the algorithm bailed out in step (3) before, it leaks a count of 1 + * on the semaphore; however, it doesn't matter, because if we block in (4), + * we also do it in a loop + */ + if( stream->data_available ) + stream->data_available = 0; + else + sem_wait( &stream->data_semaphore ); + } + } + + return result; +} + +static signed long +BlockingGetStreamReadAvailable( PaStream* s ) +{ + PaJackStream *stream = (PaJackStream *)s; + + int bytesFull = RingBuffer_GetReadAvailable( &stream->inFIFO ); + return bytesFull / stream->bytesPerFrame; +} + +static signed long +BlockingGetStreamWriteAvailable( PaStream* s ) +{ + PaJackStream *stream = (PaJackStream *)s; + + int bytesEmpty = RingBuffer_GetWriteAvailable( &stream->outFIFO ); + return bytesEmpty / stream->bytesPerFrame; +} + +static PaError +BlockingWaitEmpty( PaStream *s ) +{ + PaJackStream *stream = (PaJackStream *)s; + + while( RingBuffer_GetReadAvailable( &stream->outFIFO ) > 0 ) + { + stream->data_available = 0; + sem_wait( &stream->data_semaphore ); + } + return 0; +} + +/* ---- jack driver ---- */ + +/* BuildDeviceList(): + * + * The process of determining a list of PortAudio "devices" from + * JACK's client/port system is fairly involved, so it is separated + * into its own routine. + */ + +static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi ) +{ + /* Utility macros for the repetitive process of allocating memory */ + + /* ... MALLOC: allocate memory as part of the device list + * allocation group */ +#define MALLOC(size) \ + (PaUtil_GroupAllocateMemory( jackApi->deviceInfoMemory, (size) )) + + /* JACK has no concept of a device. To JACK, there are clients + * which have an arbitrary number of ports. To make this + * intelligible to PortAudio clients, we will group each JACK client + * into a device, and make each port of that client a channel */ + + PaError result = paNoError; + PaUtilHostApiRepresentation *commonApi = &jackApi->commonHostApiRep; + + const char **jack_ports = NULL; + char **client_names = NULL; + char *regex_pattern = alloca( jack_client_name_size() + 3 ); + int port_index, client_index, i; + double globalSampleRate; + regex_t port_regex; + unsigned long numClients = 0, numPorts = 0; + char *tmp_client_name = alloca( jack_client_name_size() ); + + commonApi->info.defaultInputDevice = paNoDevice; + commonApi->info.defaultOutputDevice = paNoDevice; + commonApi->info.deviceCount = 0; + + /* Parse the list of ports, using a regex to grab the client names */ + ASSERT_CALL( regcomp( &port_regex, "^[^:]*", REG_EXTENDED ), 0 ); + + /* since we are rebuilding the list of devices, free all memory + * associated with the previous list */ + PaUtil_FreeAllAllocations( jackApi->deviceInfoMemory ); + + /* We can only retrieve the list of clients indirectly, by first + * asking for a list of all ports, then parsing the port names + * according to the client_name:port_name convention (which is + * enforced by jackd) + * A: If jack_get_ports returns NULL, there's nothing for us to do */ + UNLESS( (jack_ports = jack_get_ports( jackApi->jack_client, "", "", 0 )) && jack_ports[0], paNoError ); + /* Find number of ports */ + while( jack_ports[numPorts] ) + ++numPorts; + /* At least there will be one port per client :) */ + UNLESS( client_names = alloca( numPorts * sizeof (char *) ), paInsufficientMemory ); + + /* Build a list of clients from the list of ports */ + for( numClients = 0, port_index = 0; jack_ports[port_index] != NULL; port_index++ ) + { + int client_seen = FALSE; + regmatch_t match_info; + const char *port = jack_ports[port_index]; + + /* extract the client name from the port name, using a regex + * that parses the clientname:portname syntax */ + UNLESS( !regexec( &port_regex, port, 1, &match_info, 0 ), paInternalError ); + assert(match_info.rm_eo - match_info.rm_so < jack_client_name_size()); + memcpy( tmp_client_name, port + match_info.rm_so, + match_info.rm_eo - match_info.rm_so ); + tmp_client_name[match_info.rm_eo - match_info.rm_so] = '\0'; + + /* do we know about this port's client yet? */ + for( i = 0; i < numClients; i++ ) + { + if( strcmp( tmp_client_name, client_names[i] ) == 0 ) + client_seen = TRUE; + } + + if (client_seen) + continue; /* A: Nothing to see here, move along */ + + UNLESS( client_names[numClients] = (char*)MALLOC(strlen(tmp_client_name) + 1), paInsufficientMemory ); + + /* The alsa_pcm client should go in spot 0. If this + * is the alsa_pcm client AND we are NOT about to put + * it in spot 0 put it in spot 0 and move whatever + * was already in spot 0 to the end. */ + if( strcmp( "alsa_pcm", tmp_client_name ) == 0 && numClients > 0 ) + { + /* alsa_pcm goes in spot 0 */ + strcpy( client_names[ numClients ], client_names[0] ); + strcpy( client_names[0], tmp_client_name ); + } + else + { + /* put the new client at the end of the client list */ + strcpy( client_names[ numClients ], tmp_client_name ); + } + ++numClients; + } + + /* Now we have a list of clients, which will become the list of + * PortAudio devices. */ + + /* there is one global sample rate all clients must conform to */ + + globalSampleRate = jack_get_sample_rate( jackApi->jack_client ); + UNLESS( commonApi->deviceInfos = (PaDeviceInfo**)MALLOC( sizeof(PaDeviceInfo*) * + numClients ), paInsufficientMemory ); + + assert( commonApi->info.deviceCount == 0 ); + + /* Create a PaDeviceInfo structure for every client */ + for( client_index = 0; client_index < numClients; client_index++ ) + { + PaDeviceInfo *curDevInfo; + const char **clientPorts = NULL; + + UNLESS( curDevInfo = (PaDeviceInfo*)MALLOC( sizeof(PaDeviceInfo) ), paInsufficientMemory ); + UNLESS( curDevInfo->name = (char*)MALLOC( strlen(client_names[client_index]) + 1 ), paInsufficientMemory ); + strcpy( (char *)curDevInfo->name, client_names[client_index] ); + + curDevInfo->structVersion = 2; + curDevInfo->hostApi = jackApi->hostApiIndex; + + /* JACK is very inflexible: there is one sample rate the whole + * system must run at, and all clients must speak IEEE float. */ + curDevInfo->defaultSampleRate = globalSampleRate; + + /* To determine how many input and output channels are available, + * we re-query jackd with more specific parameters. */ + + sprintf( regex_pattern, "%s:.*", client_names[client_index] ); + + /* ... what are your output ports (that we could input from)? */ + clientPorts = jack_get_ports( jackApi->jack_client, regex_pattern, + NULL, JackPortIsOutput); + curDevInfo->maxInputChannels = 0; + curDevInfo->defaultLowInputLatency = 0.; + curDevInfo->defaultHighInputLatency = 0.; + if( clientPorts ) + { + jack_port_t *p = jack_port_by_name( jackApi->jack_client, clientPorts[0] ); + curDevInfo->defaultLowInputLatency = curDevInfo->defaultHighInputLatency = + jack_port_get_latency( p ) / globalSampleRate; + + for( i = 0; clientPorts[i] != NULL; i++) + { + /* The number of ports returned is the number of output channels. + * We don't care what they are, we just care how many */ + curDevInfo->maxInputChannels++; + } + free(clientPorts); + } + + /* ... what are your input ports (that we could output to)? */ + clientPorts = jack_get_ports( jackApi->jack_client, regex_pattern, + NULL, JackPortIsInput); + curDevInfo->maxOutputChannels = 0; + curDevInfo->defaultLowOutputLatency = 0.; + curDevInfo->defaultHighOutputLatency = 0.; + if( clientPorts ) + { + jack_port_t *p = jack_port_by_name( jackApi->jack_client, clientPorts[0] ); + curDevInfo->defaultLowOutputLatency = curDevInfo->defaultHighOutputLatency = + jack_port_get_latency( p ) / globalSampleRate; + + for( i = 0; clientPorts[i] != NULL; i++) + { + /* The number of ports returned is the number of input channels. + * We don't care what they are, we just care how many */ + curDevInfo->maxOutputChannels++; + } + free(clientPorts); + } + + /* Add this client to the list of devices */ + commonApi->deviceInfos[client_index] = curDevInfo; + ++commonApi->info.deviceCount; + if( commonApi->info.defaultInputDevice == paNoDevice && curDevInfo->maxInputChannels > 0 ) + commonApi->info.defaultInputDevice = client_index; + if( commonApi->info.defaultOutputDevice == paNoDevice && curDevInfo->maxOutputChannels > 0 ) + commonApi->info.defaultOutputDevice = client_index; + } + +error: + regfree( &port_regex ); + free( jack_ports ); + return result; +} +#undef MALLOC + +static void UpdateSampleRate( PaJackStream *stream, double sampleRate ) +{ + /* XXX: Maybe not the cleanest way of going about this? */ + stream->cpuLoadMeasurer.samplingPeriod = stream->bufferProcessor.samplePeriod = 1. / sampleRate; + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; +} + +static void JackErrorCallback( const char *msg ) +{ + if( pthread_self() == mainThread_ ) + { + assert( msg ); + free( jackErr_ ); + jackErr_ = malloc( strlen( msg ) ); + sprintf( jackErr_, msg ); + } +} + +static void JackOnShutdown( void *arg ) +{ + PaJackHostApiRepresentation *jackApi = (PaJackHostApiRepresentation *)arg; + PaJackStream *stream = jackApi->processQueue; + + PA_DEBUG(( "%s: JACK server is shutting down\n", __FUNCTION__ )); + for( ; stream; stream = stream->next ) + { + stream->is_active = 0; + } + + /* Make sure that the main thread doesn't get stuck waiting on the condition */ + ASSERT_CALL( pthread_mutex_lock( &jackApi->mtx ), 0 ); + jackApi->jackIsDown = 1; + ASSERT_CALL( pthread_cond_signal( &jackApi->cond ), 0 ); + ASSERT_CALL( pthread_mutex_unlock( &jackApi->mtx ), 0 ); + +} + +static int JackSrCb( jack_nframes_t nframes, void *arg ) +{ + PaJackHostApiRepresentation *jackApi = (PaJackHostApiRepresentation *)arg; + double sampleRate = (double)nframes; + PaJackStream *stream = jackApi->processQueue; + + /* Update all streams in process queue */ + PA_DEBUG(( "%s: Acting on change in JACK samplerate: %f\n", __FUNCTION__, sampleRate )); + for( ; stream; stream = stream->next ) + { + if( stream->streamRepresentation.streamInfo.sampleRate != sampleRate ) + { + PA_DEBUG(( "%s: Updating samplerate\n", __FUNCTION__ )); + UpdateSampleRate( stream, sampleRate ); + } + } + + return 0; +} + +static int JackXRunCb(void *arg) { + PaJackHostApiRepresentation *hostApi = (PaJackHostApiRepresentation *)arg; + assert( hostApi ); + hostApi->xrun = TRUE; + PA_DEBUG(( "%s: JACK signalled xrun\n", __FUNCTION__ )); + return 0; +} + +PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, + PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *jackHostApi; + int activated = 0; + char *clientName; + int written; + *hostApi = NULL; /* Initialize to NULL */ + + UNLESS( jackHostApi = (PaJackHostApiRepresentation*) + PaUtil_AllocateMemory( sizeof(PaJackHostApiRepresentation) ), paInsufficientMemory ); + jackHostApi->deviceInfoMemory = NULL; + + mainThread_ = pthread_self(); + ASSERT_CALL( pthread_mutex_init( &jackHostApi->mtx, NULL ), 0 ); + ASSERT_CALL( pthread_cond_init( &jackHostApi->cond, NULL ), 0 ); + + /* Try to become a client of the JACK server. If we cannot do + * this, then this API cannot be used. */ + + clientName = alloca( jack_client_name_size() ); + written = snprintf( clientName, jack_client_name_size(), "PortAudio-%d", getpid() ); + assert( written < jack_client_name_size() ); + jackHostApi->jack_client = jack_client_new( clientName ); + if( jackHostApi->jack_client == NULL ) + { + /* the V19 development docs say that if an implementation + * detects that it cannot be used, it should return a NULL + * interface and paNoError */ + result = paNoError; + goto error; + } + + UNLESS( jackHostApi->deviceInfoMemory = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + jackHostApi->hostApiIndex = hostApiIndex; + + *hostApi = &jackHostApi->commonHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paJACK; + (*hostApi)->info.name = "JACK Audio Connection Kit"; + + /* Build a device list by querying the JACK server */ + + ENSURE_PA( BuildDeviceList( jackHostApi ) ); + + /* Register functions */ + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &jackHostApi->callbackStreamInterface, + CloseStream, StartStream, + StopStream, AbortStream, + IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &jackHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + BlockingReadStream, BlockingWriteStream, + BlockingGetStreamReadAvailable, BlockingGetStreamWriteAvailable ); + + jackHostApi->inputBase = jackHostApi->outputBase = 0; + jackHostApi->xrun = 0; + jackHostApi->toAdd = jackHostApi->toRemove = NULL; + jackHostApi->processQueue = NULL; + jackHostApi->jackIsDown = 0; + + jack_on_shutdown( jackHostApi->jack_client, JackOnShutdown, jackHostApi ); + jack_set_error_function( JackErrorCallback ); + jackHostApi->jack_buffer_size = jack_get_buffer_size ( jackHostApi->jack_client ); + UNLESS( !jack_set_sample_rate_callback( jackHostApi->jack_client, JackSrCb, jackHostApi ), paUnanticipatedHostError ); + UNLESS( !jack_set_xrun_callback( jackHostApi->jack_client, JackXRunCb, jackHostApi ), paUnanticipatedHostError ); + UNLESS( !jack_set_process_callback( jackHostApi->jack_client, JackCallback, jackHostApi ), paUnanticipatedHostError ); + UNLESS( !jack_activate( jackHostApi->jack_client ), paUnanticipatedHostError ); + activated = 1; + + return result; + +error: + if( activated ) + ASSERT_CALL( jack_deactivate( jackHostApi->jack_client ), 0 ); + + if( jackHostApi ) + { + if( jackHostApi->jack_client ) + ASSERT_CALL( jack_client_close( jackHostApi->jack_client ), 0 ); + + if( jackHostApi->deviceInfoMemory ) + { + PaUtil_FreeAllAllocations( jackHostApi->deviceInfoMemory ); + PaUtil_DestroyAllocationGroup( jackHostApi->deviceInfoMemory ); + } + + PaUtil_FreeMemory( jackHostApi ); + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaJackHostApiRepresentation *jackHostApi = (PaJackHostApiRepresentation*)hostApi; + + /* note: this automatically disconnects all ports, since a deactivated + * client is not allowed to have any ports connected */ + ASSERT_CALL( jack_deactivate( jackHostApi->jack_client ), 0 ); + + ASSERT_CALL( pthread_mutex_destroy( &jackHostApi->mtx ), 0 ); + ASSERT_CALL( pthread_cond_destroy( &jackHostApi->cond ), 0 ); + + ASSERT_CALL( jack_client_close( jackHostApi->jack_client ), 0 ); + + if( jackHostApi->deviceInfoMemory ) + { + PaUtil_FreeAllAllocations( jackHostApi->deviceInfoMemory ); + PaUtil_DestroyAllocationGroup( jackHostApi->deviceInfoMemory ); + } + + PaUtil_FreeMemory( jackHostApi ); + + free( jackErr_ ); +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount = 0, outputChannelCount = 0; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + /* + The following check is not necessary for JACK. + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + + Because the buffer adapter handles conversion between all standard + sample formats, the following checks are only required if paCustomFormat + is implemented, or under some other unusual conditions. + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + */ + + /* check that the device supports sampleRate */ + +#define ABS(x) ( (x) > 0 ? (x) : -(x) ) + if( ABS(sampleRate - jack_get_sample_rate(((PaJackHostApiRepresentation *) hostApi)->jack_client )) > 1 ) + return paInvalidSampleRate; +#undef ABS + + return paFormatIsSupported; +} + +/* Basic stream initialization */ +static PaError InitializeStream( PaJackStream *stream, PaJackHostApiRepresentation *hostApi, int numInputChannels, + int numOutputChannels ) +{ + PaError result = paNoError; + assert( stream ); + + memset( stream, 0, sizeof (PaJackStream) ); + UNLESS( stream->stream_memory = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + stream->jack_client = hostApi->jack_client; + stream->hostApi = hostApi; + + if( numInputChannels > 0 ) + { + UNLESS( stream->local_input_ports = + (jack_port_t**) PaUtil_GroupAllocateMemory( stream->stream_memory, sizeof(jack_port_t*) * numInputChannels ), + paInsufficientMemory ); + memset( stream->local_input_ports, 0, sizeof(jack_port_t*) * numInputChannels ); + UNLESS( stream->remote_output_ports = + (jack_port_t**) PaUtil_GroupAllocateMemory( stream->stream_memory, sizeof(jack_port_t*) * numInputChannels ), + paInsufficientMemory ); + memset( stream->remote_output_ports, 0, sizeof(jack_port_t*) * numInputChannels ); + } + if( numOutputChannels > 0 ) + { + UNLESS( stream->local_output_ports = + (jack_port_t**) PaUtil_GroupAllocateMemory( stream->stream_memory, sizeof(jack_port_t*) * numOutputChannels ), + paInsufficientMemory ); + memset( stream->local_output_ports, 0, sizeof(jack_port_t*) * numOutputChannels ); + UNLESS( stream->remote_input_ports = + (jack_port_t**) PaUtil_GroupAllocateMemory( stream->stream_memory, sizeof(jack_port_t*) * numOutputChannels ), + paInsufficientMemory ); + memset( stream->remote_input_ports, 0, sizeof(jack_port_t*) * numOutputChannels ); + } + + stream->num_incoming_connections = numInputChannels; + stream->num_outgoing_connections = numOutputChannels; + +error: + return result; +} + +/*! + * Free resources associated with stream, and eventually stream itself. + * + * Frees allocated memory, and closes opened pcms. + */ +static void CleanUpStream( PaJackStream *stream, int terminateStreamRepresentation, int terminateBufferProcessor ) +{ + int i; + assert( stream ); + + if( stream->isBlockingStream ) + BlockingEnd( stream ); + + for( i = 0; i < stream->num_incoming_connections; ++i ) + { + if( stream->local_input_ports[i] ) + ASSERT_CALL( jack_port_unregister( stream->jack_client, stream->local_input_ports[i] ), 0 ); + } + for( i = 0; i < stream->num_outgoing_connections; ++i ) + { + if( stream->local_output_ports[i] ) + ASSERT_CALL( jack_port_unregister( stream->jack_client, stream->local_output_ports[i] ), 0 ); + } + + if( terminateStreamRepresentation ) + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + if( terminateBufferProcessor ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + + if( stream->stream_memory ) + { + PaUtil_FreeAllAllocations( stream->stream_memory ); + PaUtil_DestroyAllocationGroup( stream->stream_memory ); + } + PaUtil_FreeMemory( stream ); +} + +static PaError WaitCondition( PaJackHostApiRepresentation *hostApi ) +{ + PaError result = paNoError; + int err = 0; + PaTime pt = PaUtil_GetTime(); + struct timespec ts; + + ts.tv_sec = (time_t) floor( pt + 1 ); + ts.tv_nsec = (long) ((pt - floor( pt )) * 1000000000); + /* XXX: Best enclose in loop, in case of spurious wakeups? */ + err = pthread_cond_timedwait( &hostApi->cond, &hostApi->mtx, &ts ); + + /* Make sure we didn't time out */ + UNLESS( err != ETIMEDOUT, paTimedOut ); + UNLESS( !err, paInternalError ); + +error: + return result; +} + +static PaError AddStream( PaJackStream *stream ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *hostApi = stream->hostApi; + /* Add to queue of streams that should be processed */ + ASSERT_CALL( pthread_mutex_lock( &hostApi->mtx ), 0 ); + if( !hostApi->jackIsDown ) + { + hostApi->toAdd = stream; + /* Unlock mutex and await signal from processing thread */ + result = WaitCondition( stream->hostApi ); + } + ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 ); + ENSURE_PA( result ); + + UNLESS( !hostApi->jackIsDown, paDeviceUnavailable ); + +error: + return result; +} + +/* Remove stream from processing queue */ +static PaError RemoveStream( PaJackStream *stream ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *hostApi = stream->hostApi; + + /* Add to queue over streams that should be processed */ + ASSERT_CALL( pthread_mutex_lock( &hostApi->mtx ), 0 ); + if( !hostApi->jackIsDown ) + { + hostApi->toRemove = stream; + /* Unlock mutex and await signal from processing thread */ + result = WaitCondition( stream->hostApi ); + } + ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 ); + ENSURE_PA( result ); + +error: + return result; +} + +/* Add stream to processing queue */ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *jackHostApi = (PaJackHostApiRepresentation*)hostApi; + PaJackStream *stream = NULL; + char *port_string = alloca( jack_port_name_size() ); + unsigned long regexSz = jack_client_name_size() + 3; + char *regex_pattern = alloca( regexSz ); + const char **jack_ports = NULL; + /* int jack_max_buffer_size = jack_get_buffer_size( jackHostApi->jack_client ); */ + int i; + int inputChannelCount, outputChannelCount; + const double jackSr = jack_get_sample_rate( jackHostApi->jack_client ); + PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0; + int bpInitialized = 0, srInitialized = 0; /* Initialized buffer processor and stream representation? */ + unsigned long ofs; + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + if( (streamFlags & paPrimeOutputBuffersUsingStreamCallback) != 0 ) + { + streamFlags &= ~paPrimeOutputBuffersUsingStreamCallback; + /*return paInvalidFlag;*/ /* This implementation does not support buffer priming */ + } + + if( framesPerBuffer != paFramesPerBufferUnspecified ) + { + /* Jack operates with power of two buffers, and we don't support non-integer buffer adaption (yet) */ + /*UNLESS( !(framesPerBuffer & (framesPerBuffer - 1)), paBufferTooBig );*/ /* TODO: Add descriptive error code? */ + } + + /* Preliminary checks */ + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + /* ... check that the sample rate exactly matches the ONE acceptable rate + * A: This rate isn't necessarily constant though? */ + +#define ABS(x) ( (x) > 0 ? (x) : -(x) ) + if( ABS(sampleRate - jackSr) > 1 ) + return paInvalidSampleRate; +#undef ABS + + UNLESS( stream = (PaJackStream*)PaUtil_AllocateMemory( sizeof(PaJackStream) ), paInsufficientMemory ); + ENSURE_PA( InitializeStream( stream, jackHostApi, inputChannelCount, outputChannelCount ) ); + + /* the blocking emulation, if necessary */ + stream->isBlockingStream = !streamCallback; + if( stream->isBlockingStream ) + { + float latency = 0.001; /* 1ms is the absolute minimum we support */ + int minimum_buffer_frames = 0; + + if( inputParameters && inputParameters->suggestedLatency > latency ) + latency = inputParameters->suggestedLatency; + else if( outputParameters && outputParameters->suggestedLatency > latency ) + latency = outputParameters->suggestedLatency; + + /* the latency the user asked for indicates the minimum buffer size in frames */ + minimum_buffer_frames = (int) (latency * jack_get_sample_rate( jackHostApi->jack_client )); + + /* we also need to be able to store at least three full jack buffers to avoid dropouts */ + if( jackHostApi->jack_buffer_size * 3 > minimum_buffer_frames ) + minimum_buffer_frames = jackHostApi->jack_buffer_size * 3; + + /* setup blocking API data structures (FIXME: can fail) */ + BlockingBegin( stream, minimum_buffer_frames ); + + /* install our own callback for the blocking API */ + streamCallback = BlockingCallback; + userData = stream; + + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &jackHostApi->blockingStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &jackHostApi->callbackStreamInterface, streamCallback, userData ); + } + srInitialized = 1; + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, jackSr ); + + /* create the JACK ports. We cannot connect them until audio + * processing begins */ + + /* Register a unique set of ports for this stream + * TODO: Robust allocation of new port names */ + + ofs = jackHostApi->inputBase; + for( i = 0; i < inputChannelCount; i++ ) + { + snprintf( port_string, jack_port_name_size(), "in_%lu", ofs + i ); + UNLESS( stream->local_input_ports[i] = jack_port_register( + jackHostApi->jack_client, port_string, + JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0 ), paInsufficientMemory ); + } + jackHostApi->inputBase += inputChannelCount; + + ofs = jackHostApi->outputBase; + for( i = 0; i < outputChannelCount; i++ ) + { + snprintf( port_string, jack_port_name_size(), "out_%lu", ofs + i ); + UNLESS( stream->local_output_ports[i] = jack_port_register( + jackHostApi->jack_client, port_string, + JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 ), paInsufficientMemory ); + } + jackHostApi->outputBase += outputChannelCount; + + /* look up the jack_port_t's for the remote ports. We could do + * this at stream start time, but doing it here ensures the + * name lookup only happens once. */ + + if( inputChannelCount > 0 ) + { + int err = 0; + + /* ... remote output ports (that we input from) */ + snprintf( regex_pattern, regexSz, "%s:.*", hostApi->deviceInfos[ inputParameters->device ]->name ); + UNLESS( jack_ports = jack_get_ports( jackHostApi->jack_client, regex_pattern, + NULL, JackPortIsOutput ), paUnanticipatedHostError ); + for( i = 0; i < inputChannelCount && jack_ports[i]; i++ ) + { + if( (stream->remote_output_ports[i] = jack_port_by_name( + jackHostApi->jack_client, jack_ports[i] )) == NULL ) + { + err = 1; + break; + } + } + free( jack_ports ); + UNLESS( !err, paInsufficientMemory ); + + /* Fewer ports than expected? */ + UNLESS( i == inputChannelCount, paInternalError ); + } + + if( outputChannelCount > 0 ) + { + int err = 0; + + /* ... remote input ports (that we output to) */ + snprintf( regex_pattern, regexSz, "%s:.*", hostApi->deviceInfos[ outputParameters->device ]->name ); + UNLESS( jack_ports = jack_get_ports( jackHostApi->jack_client, regex_pattern, + NULL, JackPortIsInput ), paUnanticipatedHostError ); + for( i = 0; i < outputChannelCount && jack_ports[i]; i++ ) + { + if( (stream->remote_input_ports[i] = jack_port_by_name( + jackHostApi->jack_client, jack_ports[i] )) == 0 ) + { + err = 1; + break; + } + } + free( jack_ports ); + UNLESS( !err , paInsufficientMemory ); + + /* Fewer ports than expected? */ + UNLESS( i == outputChannelCount, paInternalError ); + } + + ENSURE_PA( PaUtil_InitializeBufferProcessor( + &stream->bufferProcessor, + inputChannelCount, + inputSampleFormat, + paFloat32, /* hostInputSampleFormat */ + outputChannelCount, + outputSampleFormat, + paFloat32, /* hostOutputSampleFormat */ + jackSr, + streamFlags, + framesPerBuffer, + 0, /* Ignored */ + paUtilUnknownHostBufferSize, /* Buffer size may vary on JACK's discretion */ + streamCallback, + userData ) ); + bpInitialized = 1; + + if( stream->num_incoming_connections > 0 ) + stream->streamRepresentation.streamInfo.inputLatency = (jack_port_get_latency( stream->remote_output_ports[0] ) + - jack_get_buffer_size( jackHostApi->jack_client ) /* One buffer is not counted as latency */ + + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor )) / sampleRate; + if( stream->num_outgoing_connections > 0 ) + stream->streamRepresentation.streamInfo.outputLatency = (jack_port_get_latency( stream->remote_input_ports[0] ) + - jack_get_buffer_size( jackHostApi->jack_client ) /* One buffer is not counted as latency */ + + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor )) / sampleRate; + + stream->streamRepresentation.streamInfo.sampleRate = jackSr; + stream->t0 = jack_frame_time( jackHostApi->jack_client ); /* A: Time should run from Pa_OpenStream */ + + ENSURE_PA( AddStream( stream ) ); /* Add to queue over opened streams */ + + *s = (PaStream*)stream; + + return result; + +error: + if( stream ) + CleanUpStream( stream, srInitialized, bpInitialized ); + + return result; +} + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaJackStream *stream = (PaJackStream*)s; + + /* Remove this stream from the processing queue */ + ENSURE_PA( RemoveStream( stream ) ); + +error: + CleanUpStream( stream, 1, 1 ); + return result; +} + +static PaError RealProcess( PaJackStream *stream, jack_nframes_t frames ) +{ + PaError result = paNoError; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; + int chn; + int framesProcessed; + const double sr = jack_get_sample_rate( stream->jack_client ); /* Shouldn't change during the process callback */ + PaStreamCallbackFlags cbFlags = 0; + + /* If the user has returned !paContinue from the callback we'll want to flush the internal buffers, + * when these are empty we can finally mark the stream as inactive */ + if( stream->callbackResult != paContinue && + PaUtil_IsBufferProcessorOutputEmpty( &stream->bufferProcessor ) ) + { + stream->is_active = 0; + if( stream->streamRepresentation.streamFinishedCallback ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + PA_DEBUG(( "%s: Callback finished\n", __FUNCTION__ )); + + goto end; + } + + timeInfo.currentTime = (jack_frame_time( stream->jack_client ) - stream->t0) / sr; + if( stream->num_incoming_connections > 0 ) + timeInfo.inputBufferAdcTime = timeInfo.currentTime - jack_port_get_latency( stream->remote_output_ports[0] ) + / sr; + if( stream->num_outgoing_connections > 0 ) + timeInfo.outputBufferDacTime = timeInfo.currentTime + jack_port_get_latency( stream->remote_input_ports[0] ) + / sr; + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + if( stream->xrun ) + { + /* XXX: Any way to tell which of these occurred? */ + cbFlags = paOutputUnderflow | paInputOverflow; + stream->xrun = FALSE; + } + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, + cbFlags ); + + if( stream->num_incoming_connections > 0 ) + PaUtil_SetInputFrameCount( &stream->bufferProcessor, frames ); + if( stream->num_outgoing_connections > 0 ) + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, frames ); + + for( chn = 0; chn < stream->num_incoming_connections; chn++ ) + { + jack_default_audio_sample_t *channel_buf = (jack_default_audio_sample_t*) + jack_port_get_buffer( stream->local_input_ports[chn], + frames ); + + PaUtil_SetNonInterleavedInputChannel( &stream->bufferProcessor, + chn, + channel_buf ); + } + + for( chn = 0; chn < stream->num_outgoing_connections; chn++ ) + { + jack_default_audio_sample_t *channel_buf = (jack_default_audio_sample_t*) + jack_port_get_buffer( stream->local_output_ports[chn], + frames ); + + PaUtil_SetNonInterleavedOutputChannel( &stream->bufferProcessor, + chn, + channel_buf ); + } + + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, + &stream->callbackResult ); + /* We've specified a host buffer size mode where every frame should be consumed by the buffer processor */ + assert( framesProcessed == frames ); + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + +end: + return result; +} + +/* Alter the processing queue if necessary */ +static PaError UpdateQueue( PaJackHostApiRepresentation *hostApi ) +{ + PaError result = paNoError; + int queueModified = 0; + const double jackSr = jack_get_sample_rate( hostApi->jack_client ); + int err; + + if( (err = pthread_mutex_trylock( &hostApi->mtx )) != 0 ) + { + assert( err == EBUSY ); + return paNoError; + } + + if( hostApi->toAdd ) + { + if( hostApi->processQueue ) + { + PaJackStream *node = hostApi->processQueue; + /* Advance to end of queue */ + while( node->next ) + node = node->next; + + node->next = hostApi->toAdd; + } + else + hostApi->processQueue = (PaJackStream *)hostApi->toAdd; + + /* If necessary, update stream state */ + if( hostApi->toAdd->streamRepresentation.streamInfo.sampleRate != jackSr ) + UpdateSampleRate( hostApi->toAdd, jackSr ); + + hostApi->toAdd = NULL; + queueModified = 1; + } + if( hostApi->toRemove ) + { + int removed = 0; + PaJackStream *node = hostApi->processQueue, *prev = NULL; + assert( hostApi->processQueue ); + + while( node ) + { + if( node == hostApi->toRemove ) + { + if( prev ) + prev->next = node->next; + else + hostApi->processQueue = (PaJackStream *)node->next; + + removed = 1; + break; + } + + prev = node; + node = node->next; + } + UNLESS( removed, paInternalError ); + hostApi->toRemove = NULL; + PA_DEBUG(( "%s: Removed stream from processing queue\n", __FUNCTION__ )); + queueModified = 1; + } + + if( queueModified ) + { + /* Signal that we've done what was asked of us */ + ASSERT_CALL( pthread_cond_signal( &hostApi->cond ), 0 ); + } + +error: + ASSERT_CALL( pthread_mutex_unlock( &hostApi->mtx ), 0 ); + + return result; +} + +static int JackCallback( jack_nframes_t frames, void *userData ) +{ + PaError result = paNoError; + PaJackHostApiRepresentation *hostApi = (PaJackHostApiRepresentation *)userData; + PaJackStream *stream = NULL; + int xrun = hostApi->xrun; + hostApi->xrun = 0; + + assert( hostApi ); + + ENSURE_PA( UpdateQueue( hostApi ) ); + + /* Process each stream */ + stream = hostApi->processQueue; + for( ; stream; stream = stream->next ) + { + if( xrun ) /* Don't override if already set */ + stream->xrun = 1; + + /* See if this stream is to be started */ + if( stream->doStart ) + { + /* If we can't obtain a lock, we'll try next time */ + int err = pthread_mutex_trylock( &stream->hostApi->mtx ); + if( !err ) + { + if( stream->doStart ) /* Could potentially change before obtaining the lock */ + { + stream->is_active = 1; + stream->doStart = 0; + PA_DEBUG(( "%s: Starting stream\n", __FUNCTION__ )); + ASSERT_CALL( pthread_cond_signal( &stream->hostApi->cond ), 0 ); + stream->callbackResult = paContinue; + stream->isSilenced = 0; + } + + ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 ); + } + else + assert( err == EBUSY ); + } + else if( stream->doStop || stream->doAbort ) /* Should we stop/abort stream? */ + { + if( stream->callbackResult == paContinue ) /* Ok, make it stop */ + { + PA_DEBUG(( "%s: Stopping stream\n", __FUNCTION__ )); + stream->callbackResult = stream->doStop ? paComplete : paAbort; + } + } + + if( stream->is_active ) + ENSURE_PA( RealProcess( stream, frames ) ); + /* If we have just entered inactive state, silence output */ + if( !stream->is_active && !stream->isSilenced ) + { + int i; + + /* Silence buffer after entering inactive state */ + PA_DEBUG(( "Silencing the output\n" )); + for( i = 0; i < stream->num_outgoing_connections; ++i ) + { + jack_default_audio_sample_t *buffer = jack_port_get_buffer( stream->local_output_ports[i], frames ); + memset( buffer, 0, sizeof (jack_default_audio_sample_t) * frames ); + } + + stream->isSilenced = 1; + } + + if( stream->doStop || stream->doAbort ) + { + /* See if RealProcess has acted on the request */ + if( !stream->is_active ) /* Ok, signal to the main thread that we've carried out the operation */ + { + /* If we can't obtain a lock, we'll try next time */ + int err = pthread_mutex_trylock( &stream->hostApi->mtx ); + if( !err ) + { + stream->doStop = stream->doAbort = 0; + ASSERT_CALL( pthread_cond_signal( &stream->hostApi->cond ), 0 ); + ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 ); + } + else + assert( err == EBUSY ); + } + } + } + + return 0; +error: + return -1; +} + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaJackStream *stream = (PaJackStream*)s; + int i; + + /* Ready the processor */ + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + /* connect the ports */ + + /* NOTE: I would rather use jack_port_connect which uses jack_port_t's + * instead of port names, but it is not implemented yet. */ + if( stream->num_incoming_connections > 0 ) + { + for( i = 0; i < stream->num_incoming_connections; i++ ) + UNLESS( jack_connect( stream->jack_client, + jack_port_name( stream->remote_output_ports[i] ), + jack_port_name( stream->local_input_ports[i] ) ) == 0, paUnanticipatedHostError ); + } + + if( stream->num_outgoing_connections > 0 ) + { + for( i = 0; i < stream->num_outgoing_connections; i++ ) + UNLESS( jack_connect( stream->jack_client, + jack_port_name( stream->local_output_ports[i] ), + jack_port_name( stream->remote_input_ports[i] ) ) == 0, paUnanticipatedHostError ); + } + + stream->xrun = FALSE; + + /* Enable processing */ + + ASSERT_CALL( pthread_mutex_lock( &stream->hostApi->mtx ), 0 ); + stream->doStart = 1; + + /* Wait for stream to be started */ + result = WaitCondition( stream->hostApi ); + /* + do + { + err = pthread_cond_timedwait( &stream->hostApi->cond, &stream->hostApi->mtx, &ts ); + } while( !stream->is_active && !err ); + */ + if( result != paNoError ) /* Something went wrong, call off the stream start */ + { + stream->doStart = 0; + stream->is_active = 0; /* Cancel any processing */ + } + ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 ); + + ENSURE_PA( result ); + + stream->is_running = TRUE; + PA_DEBUG(( "%s: Stream started\n", __FUNCTION__ )); + +error: + return result; +} + +static PaError RealStop( PaJackStream *stream, int abort ) +{ + PaError result = paNoError; + int i; + + if( stream->isBlockingStream ) + BlockingWaitEmpty ( stream ); + + ASSERT_CALL( pthread_mutex_lock( &stream->hostApi->mtx ), 0 ); + if( abort ) + stream->doAbort = 1; + else + stream->doStop = 1; + + /* Wait for stream to be stopped */ + result = WaitCondition( stream->hostApi ); + ASSERT_CALL( pthread_mutex_unlock( &stream->hostApi->mtx ), 0 ); + ENSURE_PA( result ); + + UNLESS( !stream->is_active, paInternalError ); + + PA_DEBUG(( "%s: Stream stopped\n", __FUNCTION__ )); + +error: + stream->is_running = FALSE; + + /* Disconnect ports belonging to this stream */ + + if( !stream->hostApi->jackIsDown ) /* XXX: Well? */ + { + for( i = 0; i < stream->num_incoming_connections; i++ ) + { + UNLESS( !jack_port_lock( stream->jack_client, stream->local_input_ports[i] ), + paUnanticipatedHostError ); + if( jack_port_connected( stream->local_input_ports[i] ) ) + { + UNLESS( !jack_port_disconnect( stream->jack_client, stream->local_input_ports[i] ), + paUnanticipatedHostError ); + } + UNLESS( !jack_port_unlock( stream->jack_client, stream->local_input_ports[i] ), + paUnanticipatedHostError ); + } + for( i = 0; i < stream->num_outgoing_connections; i++ ) + { + UNLESS( !jack_port_lock( stream->jack_client, stream->local_output_ports[i] ), + paUnanticipatedHostError ); + if( jack_port_connected( stream->local_output_ports[i] ) ) + { + UNLESS( !jack_port_disconnect( stream->jack_client, stream->local_output_ports[i] ), + paUnanticipatedHostError ); + } + UNLESS( !jack_port_unlock( stream->jack_client, stream->local_output_ports[i] ), + paUnanticipatedHostError ); + } + } + + return result; +} + +static PaError StopStream( PaStream *s ) +{ + assert(s); + return RealStop( (PaJackStream *)s, 0 ); +} + +static PaError AbortStream( PaStream *s ) +{ + assert(s); + return RealStop( (PaJackStream *)s, 1 ); +} + +static PaError IsStreamStopped( PaStream *s ) +{ + PaJackStream *stream = (PaJackStream*)s; + return !stream->is_running; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaJackStream *stream = (PaJackStream*)s; + return stream->is_active; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + PaJackStream *stream = (PaJackStream*)s; + + /* A: Is this relevant?? --> TODO: what if we're recording-only? */ + return (jack_frame_time( stream->jack_client ) - stream->t0) / (PaTime)jack_get_sample_rate( stream->jack_client ); +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaJackStream *stream = (PaJackStream*)s; + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} diff --git a/portaudio-v19/src/hostapi/oss/low_latency_tip.txt b/portaudio-v19/src/hostapi/oss/low_latency_tip.txt new file mode 100644 index 0000000000000000000000000000000000000000..2d982b79baa6d943c1fae0c7122d190ebf46c6f4 GIT binary patch literal 3111 zcmb_e+in}l5zX^_MZtMka>JV_VPg}vVpflr&clN4ctL+YE&U7Sw$Nrvj#V9W!?cY$ zC`VjAku{{~Rhz%cu2sOcwF=P{YCodiN5gbJ8_|3=JEPZ&vp2N-oMqY46z(6RY;Pke z$K-9jli>L7sC9Nzb3>tG>YT;nPVE#zLoZ2p=y`+zuucjt4j znzm*?BwZ#ng2H1zTe6N`Z2Ruw#V&fWO%hDt8*A(&%LaudV*{1eZ3Uktl?S~8iB!hA z4iV=)QKv(NT|$s>@^F8*`uOqY?g59#vK(duiF%}_blL|h_!Ov5SQ!vkvB4hHI>iZ2 zZ@277mB=AIxn5q8_F3z=)O8I;2cDTWT-$Cq%(8oM2{3g{TfO6yivs4LYSN~S3BQd& zKGjIU5>{Id9SD$XKA8uE-U#Q32C}f&fTs)xe=|im9A&2K=wb4PVT7OkZGbtoAj*?b3 z)&=B4jfFNtg;*&23oUg{2ObQGF6fD#vlGlxpq}xv04oqiA>>-9I+1$hd6NAJRRvpk z09K`fJ+qKO;cSaH9tlIqH4n~)^h-u!y#lAcIIx8CX?cBxmn}P}sCj^`ACfMx5>^mA z&l|Ari2eB?2|Sb@FaMThtMVjLMJW7{eR^bPxF!)&tM;S8r^KAiAH}7*pz{}%)#9(Vj-Ggjm=Su)t=X{?UG_?nC7T#B#1!kJEZ|m7JR8qb zB&W=lX?eR`eLn-j=A5*XT1g-+ikZoEJmA5EC6 zRslDV-6O`az2ZDbyKe=hHX!}DzTlP(*gDAP6jnrvo;Q*zkZOD0q~9Kz3t5N|ZbF`Z zkH*;GM0gMlc9f;zgzr@d?P5CZx^7Zy6Q2@A1@9*4fJB1tlf`gB-}pgZ(=xT|Yj9oL zwt+e@Jmlw#kts96Y>^q0#>=R8k+T><*(G6x44v`pyYc)D&CeF+ujw~4JQ~rzO-h+D z{SIuxw)J{?>(KV#S0tO-OFwR;%D)z5GATU$E-g=g?!n_X9uukAhiZaH_+3#2I!Kh` zC$tz3`^S=DiQX(qNc3x)hkCI7@%rlihllI+PY>&x``f$a$ImxE-Ve#gJjcwFwi_x$ z*r_@KlS&1~fwQNx*=+V(8ery2YaM?`=!B@D7)F$Fsw-OiB`hipywcl>a8ro*2Yqdr z@|u-{As|nkv*=}X=+8c4On9hG@FIeiT))Lk{ZQHf-KH%aI6sh~q5O)B3ir8h8i1`NFBGL+-OowG}5Ic&Q9Z3qTP8RN+1(124i>TSCJz5w|)W&`}Qe zslm +#include +#include +#include +#include +#include +#include +#ifdef __linux__ +#include +#include +#else +/* This is the new preferred include instead of malloc.h */ +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#ifdef __FreeBSD__ +# include +# define DEVICE_NAME_BASE "/dev/dsp" +#elif defined __linux__ +# include +# define DEVICE_NAME_BASE "/dev/dsp" +#else +# include /* JH20010905 */ +# define DEVICE_NAME_BASE "/dev/audio" +#endif + +#include "portaudio.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" +#include "pa_unix_util.h" + +static int sysErr_; +static pthread_t mainThread_; + +/* Check return value of system call, and map it to PaError */ +#define ENSURE_(expr, code) \ + do { \ + if( UNLIKELY( (sysErr_ = (expr)) < 0 ) ) \ + { \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \ + { \ + PaUtil_SetLastHostErrorInfo( paALSA, sysErr_, strerror( errno ) ); \ + } \ + \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = (code); \ + goto error; \ + } \ + } while( 0 ); + +#ifndef AFMT_S16_NE +#define AFMT_S16_NE Get_AFMT_S16_NE() +/********************************************************************* + * Some versions of OSS do not define AFMT_S16_NE. So check CPU. + * PowerPC is Big Endian. X86 is Little Endian. + */ +static int Get_AFMT_S16_NE( void ) +{ + long testData = 1; + char *ptr = (char *) &testData; + int isLittle = ( *ptr == 1 ); /* Does address point to least significant byte? */ + return isLittle ? AFMT_S16_LE : AFMT_S16_BE; +} +#endif + +/* PaOSSHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + PaHostApiIndex hostApiIndex; +} +PaOSSHostApiRepresentation; + +/** Per-direction structure for PaOssStream. + * + * Aspect StreamChannels: In case the user requests to open the same device for both capture and playback, + * but with different number of channels we will have to adapt between the number of user and host + * channels for at least one direction, since the configuration space is the same for both directions + * of an OSS device. + */ +typedef struct +{ + int fd; + const char *devName; + int userChannelCount, hostChannelCount; + int userInterleaved; + void *buffer; + PaSampleFormat userFormat, hostFormat; + double latency; + unsigned long hostFrames, numBufs; + void **userBuffers; /* For non-interleaved blocking */ +} PaOssStreamComponent; + +/** Implementation specific representation of a PaStream. + * + */ +typedef struct PaOssStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + PaUtilThreading threading; + + int sharedDevice; + unsigned long framesPerHostBuffer; + int triggered; /* Have the devices been triggered yet (first start) */ + + int isActive; + int isStopped; + + int lastPosPtr; + double lastStreamBytes; + + int framesProcessed; + + double sampleRate; + + int callbackMode; + int callbackStop, callbackAbort; + + PaOssStreamComponent *capture, *playback; + unsigned long pollTimeout; + sem_t semaphore; +} +PaOssStream; + +typedef enum { + StreamMode_In, + StreamMode_Out +} StreamMode; + +/* prototypes for functions declared in this file */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); +static PaError BuildDeviceList( PaOSSHostApiRepresentation *hostApi ); + + +/** Initialize the OSS API implementation. + * + * This function will initialize host API datastructures and query host devices for information. + * + * Aspect DeviceCapabilities: Enumeration of host API devices is initiated from here + * + * Aspect FreeResources: If an error is encountered under way we have to free each resource allocated in this function, + * this happens with the usual "error" label. + */ +PaError PaOSS_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaOSSHostApiRepresentation *ossHostApi = NULL; + + PA_UNLESS( ossHostApi = (PaOSSHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaOSSHostApiRepresentation) ), + paInsufficientMemory ); + PA_UNLESS( ossHostApi->allocations = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + ossHostApi->hostApiIndex = hostApiIndex; + + /* Initialize host API structure */ + *hostApi = &ossHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paOSS; + (*hostApi)->info.name = "OSS"; + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PA_ENSURE( BuildDeviceList( ossHostApi ) ); + + PaUtil_InitializeStreamInterface( &ossHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &ossHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + mainThread_ = pthread_self(); + + return result; + +error: + if( ossHostApi ) + { + if( ossHostApi->allocations ) + { + PaUtil_FreeAllAllocations( ossHostApi->allocations ); + PaUtil_DestroyAllocationGroup( ossHostApi->allocations ); + } + + PaUtil_FreeMemory( ossHostApi ); + } + return result; +} + +PaError PaUtil_InitializeDeviceInfo( PaDeviceInfo *deviceInfo, const char *name, PaHostApiIndex hostApiIndex, int maxInputChannels, + int maxOutputChannels, PaTime defaultLowInputLatency, PaTime defaultLowOutputLatency, PaTime defaultHighInputLatency, + PaTime defaultHighOutputLatency, double defaultSampleRate, PaUtilAllocationGroup *allocations ) +{ + PaError result = paNoError; + + deviceInfo->structVersion = 2; + if( allocations ) + { + size_t len = strlen( name ) + 1; + PA_UNLESS( deviceInfo->name = PaUtil_GroupAllocateMemory( allocations, len ), paInsufficientMemory ); + strncpy( (char *)deviceInfo->name, name, len ); + } + else + deviceInfo->name = name; + + deviceInfo->hostApi = hostApiIndex; + deviceInfo->maxInputChannels = maxInputChannels; + deviceInfo->maxOutputChannels = maxOutputChannels; + deviceInfo->defaultLowInputLatency = defaultLowInputLatency; + deviceInfo->defaultLowOutputLatency = defaultLowOutputLatency; + deviceInfo->defaultHighInputLatency = defaultHighInputLatency; + deviceInfo->defaultHighOutputLatency = defaultHighOutputLatency; + deviceInfo->defaultSampleRate = defaultSampleRate; + +error: + return result; +} + +static PaError QueryDirection( const char *deviceName, StreamMode mode, double *defaultSampleRate, int *maxChannelCount, + double *defaultLowLatency, double *defaultHighLatency ) +{ + PaError result = paNoError; + int numChannels, maxNumChannels; + int busy = 0; + int devHandle = -1; + int sr; + *maxChannelCount = 0; /* Default value in case this fails */ + + if ( (devHandle = open( deviceName, (mode == StreamMode_In ? O_RDONLY : O_WRONLY) | O_NONBLOCK )) < 0 ) + { + if( errno == EBUSY || errno == EAGAIN ) + { + PA_DEBUG(( "%s: Device %s busy\n", __FUNCTION__, deviceName )); + } + else + { + PA_DEBUG(( "%s: Can't access device: %s\n", __FUNCTION__, strerror( errno ) )); + } + + return paDeviceUnavailable; + } + + /* Negotiate for the maximum number of channels for this device. PLB20010927 + * Consider up to 16 as the upper number of channels. + * Variable maxNumChannels should contain the actual upper limit after the call. + * Thanks to John Lazzaro and Heiko Purnhagen for suggestions. + */ + maxNumChannels = 0; + for( numChannels = 1; numChannels <= 16; numChannels++ ) + { + int temp = numChannels; + if( ioctl( devHandle, SNDCTL_DSP_CHANNELS, &temp ) < 0 ) + { + busy = EAGAIN == errno || EBUSY == errno; + /* ioctl() failed so bail out if we already have stereo */ + if( maxNumChannels >= 2 ) + break; + } + else + { + /* ioctl() worked but bail out if it does not support numChannels. + * We don't want to leave gaps in the numChannels supported. + */ + if( (numChannels > 2) && (temp != numChannels) ) + break; + if( temp > maxNumChannels ) + maxNumChannels = temp; /* Save maximum. */ + } + } + /* A: We're able to open a device for capture if it's busy playing back and vice versa, + * but we can't configure anything */ + if( 0 == maxNumChannels && busy ) + { + result = paDeviceUnavailable; + goto error; + } + + /* The above negotiation may fail for an old driver so try this older technique. */ + if( maxNumChannels < 1 ) + { + int stereo = 1; + if( ioctl( devHandle, SNDCTL_DSP_STEREO, &stereo ) < 0 ) + { + maxNumChannels = 1; + } + else + { + maxNumChannels = (stereo) ? 2 : 1; + } + PA_DEBUG(( "%s: use SNDCTL_DSP_STEREO, maxNumChannels = %d\n", __FUNCTION__, maxNumChannels )) + } + + /* During channel negotiation, the last ioctl() may have failed. This can + * also cause sample rate negotiation to fail. Hence the following, to return + * to a supported number of channels. SG20011005 */ + { + /* use most reasonable default value */ + int temp = PA_MIN( maxNumChannels, 2 ); + ENSURE_( ioctl( devHandle, SNDCTL_DSP_CHANNELS, &temp ), paUnanticipatedHostError ); + } + + /* Get supported sample rate closest to 44100 Hz */ + if( *defaultSampleRate < 0 ) + { + sr = 44100; + if( ioctl( devHandle, SNDCTL_DSP_SPEED, &sr ) < 0 ) + { + result = paUnanticipatedHostError; + goto error; + } + + *defaultSampleRate = sr; + } + + *maxChannelCount = maxNumChannels; + /* TODO */ + *defaultLowLatency = 512. / *defaultSampleRate; + *defaultHighLatency = 2048. / *defaultSampleRate; + +error: + if( devHandle >= 0 ) + close( devHandle ); + + return result; +} + +/** Query OSS device. + * + * This is where PaDeviceInfo objects are constructed and filled in with relevant information. + * + * Aspect DeviceCapabilities: The inferred device capabilities are recorded in a PaDeviceInfo object that is constructed + * in place. + */ +static PaError QueryDevice( char *deviceName, PaOSSHostApiRepresentation *ossApi, PaDeviceInfo **deviceInfo ) +{ + PaError result = paNoError; + double sampleRate = -1.; + int maxInputChannels, maxOutputChannels; + PaTime defaultLowInputLatency, defaultLowOutputLatency, defaultHighInputLatency, defaultHighOutputLatency; + PaError tmpRes = paNoError; + int busy = 0; + *deviceInfo = NULL; + + /* douglas: + we have to do this querying in a slightly different order. apparently + some sound cards will give you different info based on their settins. + e.g. a card might give you stereo at 22kHz but only mono at 44kHz. + the correct order for OSS is: format, channels, sample rate + */ + + /* Aspect StreamChannels: The number of channels supported for a device may depend on the mode it is + * opened in, it may have more channels available for capture than playback and vice versa. Therefore + * we will open the device in both read- and write-only mode to determine the supported number. + */ + if( (tmpRes = QueryDirection( deviceName, StreamMode_In, &sampleRate, &maxInputChannels, &defaultLowInputLatency, + &defaultHighInputLatency )) != paNoError ) + { + if( tmpRes != paDeviceUnavailable ) + { + PA_DEBUG(( "%s: Querying device %s for capture failed!\n", __FUNCTION__, deviceName )); + /* PA_ENSURE( tmpRes ); */ + } + ++busy; + } + if( (tmpRes = QueryDirection( deviceName, StreamMode_Out, &sampleRate, &maxOutputChannels, &defaultLowOutputLatency, + &defaultHighOutputLatency )) != paNoError ) + { + if( tmpRes != paDeviceUnavailable ) + { + PA_DEBUG(( "%s: Querying device %s for playback failed!\n", __FUNCTION__, deviceName )); + /* PA_ENSURE( tmpRes ); */ + } + ++busy; + } + assert( 0 <= busy && busy <= 2 ); + if( 2 == busy ) /* Both directions are unavailable to us */ + { + result = paDeviceUnavailable; + goto error; + } + + PA_UNLESS( *deviceInfo = PaUtil_GroupAllocateMemory( ossApi->allocations, sizeof (PaDeviceInfo) ), paInsufficientMemory ); + PA_ENSURE( PaUtil_InitializeDeviceInfo( *deviceInfo, deviceName, ossApi->hostApiIndex, maxInputChannels, maxOutputChannels, + defaultLowInputLatency, defaultLowOutputLatency, defaultHighInputLatency, defaultHighOutputLatency, sampleRate, + ossApi->allocations ) ); + +error: + return result; +} + +/** Query host devices. + * + * Loop over host devices and query their capabilitiesu + * + * Aspect DeviceCapabilities: This function calls QueryDevice on each device entry and receives a filled in PaDeviceInfo object + * per device, these are placed in the host api representation's deviceInfos array. + */ +static PaError BuildDeviceList( PaOSSHostApiRepresentation *ossApi ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *commonApi = &ossApi->inheritedHostApiRep; + int i; + int numDevices = 0, maxDeviceInfos = 1; + PaDeviceInfo **deviceInfos = NULL; + + /* These two will be set to the first working input and output device, respectively */ + commonApi->info.defaultInputDevice = paNoDevice; + commonApi->info.defaultOutputDevice = paNoDevice; + + /* Find devices by calling QueryDevice on each + * potential device names. When we find a valid one, + * add it to a linked list. + * A: Can there only be 10 devices? */ + + for( i = 0; i < 10; i++ ) + { + char deviceName[32]; + PaDeviceInfo *deviceInfo; + int testResult; + struct stat stbuf; + + if( i == 0 ) + snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE); + else + snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i); + + /* PA_DEBUG(("PaOSS BuildDeviceList: trying device %s\n", deviceName )); */ + if( stat( deviceName, &stbuf ) < 0 ) + { + if( ENOENT != errno ) + PA_DEBUG(( "%s: Error stat'ing %s: %s\n", __FUNCTION__, deviceName, strerror( errno ) )); + continue; + } + if( (testResult = QueryDevice( deviceName, ossApi, &deviceInfo )) != paNoError ) + { + if( testResult != paDeviceUnavailable ) + PA_ENSURE( testResult ); + + continue; + } + + ++numDevices; + if( !deviceInfos || numDevices > maxDeviceInfos ) + { + maxDeviceInfos *= 2; + PA_UNLESS( deviceInfos = (PaDeviceInfo **) realloc( deviceInfos, maxDeviceInfos * sizeof (PaDeviceInfo *) ), + paInsufficientMemory ); + } + { + int devIdx = numDevices - 1; + deviceInfos[devIdx] = deviceInfo; + + if( commonApi->info.defaultInputDevice == paNoDevice && deviceInfo->maxInputChannels > 0 ) + commonApi->info.defaultInputDevice = devIdx; + if( commonApi->info.defaultOutputDevice == paNoDevice && deviceInfo->maxOutputChannels > 0 ) + commonApi->info.defaultOutputDevice = devIdx; + } + } + + /* Make an array of PaDeviceInfo pointers out of the linked list */ + + PA_DEBUG(("PaOSS %s: Total number of devices found: %d\n", __FUNCTION__, numDevices)); + + commonApi->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + ossApi->allocations, sizeof(PaDeviceInfo*) * numDevices ); + memcpy( commonApi->deviceInfos, deviceInfos, numDevices * sizeof (PaDeviceInfo *) ); + + commonApi->info.deviceCount = numDevices; + +error: + free( deviceInfos ); + + return result; +} + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaOSSHostApiRepresentation *ossHostApi = (PaOSSHostApiRepresentation*)hostApi; + + if( ossHostApi->allocations ) + { + PaUtil_FreeAllAllocations( ossHostApi->allocations ); + PaUtil_DestroyAllocationGroup( ossHostApi->allocations ); + } + + PaUtil_FreeMemory( ossHostApi ); +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaError result = paNoError; + PaDeviceIndex device; + PaDeviceInfo *deviceInfo; + char *deviceName; + int inputChannelCount, outputChannelCount; + int tempDevHandle = -1; + int flags; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + if (inputChannelCount == 0 && outputChannelCount == 0) + return paInvalidChannelCount; + + /* if full duplex, make sure that they're the same device */ + + if (inputChannelCount > 0 && outputChannelCount > 0 && + inputParameters->device != outputParameters->device) + return paInvalidDevice; + + /* if full duplex, also make sure that they're the same number of channels */ + + if (inputChannelCount > 0 && outputChannelCount > 0 && + inputChannelCount != outputChannelCount) + return paInvalidChannelCount; + + /* open the device so we can do more tests */ + + if( inputChannelCount > 0 ) + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex(&device, inputParameters->device, hostApi); + if (result != paNoError) + return result; + } + else + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex(&device, outputParameters->device, hostApi); + if (result != paNoError) + return result; + } + + deviceInfo = hostApi->deviceInfos[device]; + deviceName = (char *)deviceInfo->name; + + flags = O_NONBLOCK; + if (inputChannelCount > 0 && outputChannelCount > 0) + flags |= O_RDWR; + else if (inputChannelCount > 0) + flags |= O_RDONLY; + else + flags |= O_WRONLY; + + ENSURE_( tempDevHandle = open( deviceInfo->name, flags ), paDeviceUnavailable ); + + /* PaOssStream_Configure will do the rest of the checking for us */ + /* PA_ENSURE( PaOssStream_Configure( tempDevHandle, deviceName, outputChannelCount, &sampleRate ) ); */ + + /* everything succeeded! */ + + error: + if( tempDevHandle >= 0 ) + close( tempDevHandle ); + + return result; +} + +/** Validate stream parameters. + * + * Aspect StreamChannels: We verify that the number of channels is within the allowed range for the device + */ +static PaError ValidateParameters( const PaStreamParameters *parameters, const PaDeviceInfo *deviceInfo, StreamMode mode ) +{ + int maxChans; + + assert( parameters ); + + if( parameters->device == paUseHostApiSpecificDeviceSpecification ) + { + return paInvalidDevice; + } + + maxChans = (mode == StreamMode_In ? deviceInfo->maxInputChannels : + deviceInfo->maxOutputChannels); + if( parameters->channelCount > maxChans ) + { + return paInvalidChannelCount; + } + + return paNoError; +} + +static PaError PaOssStreamComponent_Initialize( PaOssStreamComponent *component, const PaStreamParameters *parameters, + int callbackMode, int fd, const char *deviceName ) +{ + PaError result = paNoError; + assert( component ); + + memset( component, 0, sizeof (PaOssStreamComponent) ); + + component->fd = fd; + component->devName = deviceName; + component->userChannelCount = parameters->channelCount; + component->userFormat = parameters->sampleFormat; + component->latency = parameters->suggestedLatency; + component->userInterleaved = !(parameters->sampleFormat & paNonInterleaved); + + if( !callbackMode && !component->userInterleaved ) + { + /* Pre-allocate non-interleaved user provided buffers */ + PA_UNLESS( component->userBuffers = PaUtil_AllocateMemory( sizeof (void *) * component->userChannelCount ), + paInsufficientMemory ); + } + +error: + return result; +} + +static void PaOssStreamComponent_Terminate( PaOssStreamComponent *component ) +{ + assert( component ); + + if( component->fd >= 0 ) + close( component->fd ); + if( component->buffer ) + PaUtil_FreeMemory( component->buffer ); + + if( component->userBuffers ) + PaUtil_FreeMemory( component->userBuffers ); + + PaUtil_FreeMemory( component ); +} + +static PaError ModifyBlocking( int fd, int blocking ) +{ + PaError result = paNoError; + int fflags; + + ENSURE_( fflags = fcntl( fd, F_GETFL ), paUnanticipatedHostError ); + + if( blocking ) + fflags &= ~O_NONBLOCK; + else + fflags |= O_NONBLOCK; + + ENSURE_( fcntl( fd, F_SETFL, fflags ), paUnanticipatedHostError ); + +error: + return result; +} + +static PaError OpenDevices( const char *idevName, const char *odevName, int *idev, int *odev ) +{ + PaError result = paNoError; + int flags = O_NONBLOCK, duplex = 0; + int enableBits = 0; + *idev = *odev = -1; + + if( idevName && odevName ) + { + duplex = 1; + flags |= O_RDWR; + } + else if( idevName ) + flags |= O_RDONLY; + else + flags |= O_WRONLY; + + /* open first in nonblocking mode, in case it's busy... + * A: then unset the non-blocking attribute */ + assert( flags & O_NONBLOCK ); + if( idevName ) + { + ENSURE_( *idev = open( idevName, flags ), paDeviceUnavailable ); + PA_ENSURE( ModifyBlocking( *idev, 1 ) ); /* Blocking */ + + /* Initially disable */ + enableBits = ~PCM_ENABLE_INPUT; + ENSURE_( ioctl( *idev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + if( odevName ) + { + if( !idevName ) + { + ENSURE_( *odev = open( odevName, flags ), paDeviceUnavailable ); + PA_ENSURE( ModifyBlocking( *odev, 1 ) ); /* Blocking */ + + /* Initially disable */ + enableBits = ~PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( *odev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + else + { + ENSURE_( *odev = dup( *idev ), paUnanticipatedHostError ); + } + } + +error: + return result; +} + +static PaError PaOssStream_Initialize( PaOssStream *stream, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, + PaStreamCallback callback, void *userData, PaStreamFlags streamFlags, + PaOSSHostApiRepresentation *ossApi ) +{ + PaError result = paNoError; + int idev, odev; + PaUtilHostApiRepresentation *hostApi = &ossApi->inheritedHostApiRep; + const char *idevName = NULL, *odevName = NULL; + + assert( stream ); + + memset( stream, 0, sizeof (PaOssStream) ); + stream->isStopped = 1; + + PA_ENSURE( PaUtil_InitializeThreading( &stream->threading ) ); + + if( inputParameters && outputParameters ) + { + if( inputParameters->device == outputParameters->device ) + stream->sharedDevice = 1; + } + + if( inputParameters ) + idevName = hostApi->deviceInfos[inputParameters->device]->name; + if( outputParameters ) + odevName = hostApi->deviceInfos[outputParameters->device]->name; + PA_ENSURE( OpenDevices( idevName, odevName, &idev, &odev ) ); + if( inputParameters ) + { + PA_UNLESS( stream->capture = PaUtil_AllocateMemory( sizeof (PaOssStreamComponent) ), paInsufficientMemory ); + PA_ENSURE( PaOssStreamComponent_Initialize( stream->capture, inputParameters, callback != NULL, idev, idevName ) ); + } + if( outputParameters ) + { + PA_UNLESS( stream->playback = PaUtil_AllocateMemory( sizeof (PaOssStreamComponent) ), paInsufficientMemory ); + PA_ENSURE( PaOssStreamComponent_Initialize( stream->playback, outputParameters, callback != NULL, odev, odevName ) ); + } + + if( callback != NULL ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &ossApi->callbackStreamInterface, callback, userData ); + stream->callbackMode = 1; + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &ossApi->blockingStreamInterface, callback, userData ); + } + + ENSURE_( sem_init( &stream->semaphore, 0, 0 ), paInternalError ); + +error: + return result; +} + +static void PaOssStream_Terminate( PaOssStream *stream ) +{ + assert( stream ); + + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_TerminateThreading( &stream->threading ); + + if( stream->capture ) + PaOssStreamComponent_Terminate( stream->capture ); + if( stream->playback ) + PaOssStreamComponent_Terminate( stream->playback ); + + sem_destroy( &stream->semaphore ); + + PaUtil_FreeMemory( stream ); +} + +/** Translate from PA format to OSS native. + * + */ +static PaError Pa2OssFormat( PaSampleFormat paFormat, int *ossFormat ) +{ + switch( paFormat ) + { + case paUInt8: + *ossFormat = AFMT_U8; + break; + case paInt8: + *ossFormat = AFMT_S8; + break; + case paInt16: + *ossFormat = AFMT_S16_NE; + break; + default: + return paInternalError; /* This shouldn't happen */ + } + + return paNoError; +} + +/** Return the PA-compatible formats that this device can support. + * + */ +static PaError GetAvailableFormats( PaOssStreamComponent *component, PaSampleFormat *availableFormats ) +{ + PaError result = paNoError; + int mask = 0; + PaSampleFormat frmts = 0; + + ENSURE_( ioctl( component->fd, SNDCTL_DSP_GETFMTS, &mask ), paUnanticipatedHostError ); + if( mask & AFMT_U8 ) + frmts |= paUInt8; + if( mask & AFMT_S8 ) + frmts |= paInt8; + if( mask & AFMT_S16_NE ) + frmts |= paInt16; + else + result = paSampleFormatNotSupported; + + *availableFormats = frmts; + +error: + return result; +} + +static unsigned int PaOssStreamComponent_FrameSize( PaOssStreamComponent *component ) +{ + return Pa_GetSampleSize( component->hostFormat ) * component->hostChannelCount; +} + +/** Buffer size in bytes. + * + */ +static unsigned long PaOssStreamComponent_BufferSize( PaOssStreamComponent *component ) +{ + return PaOssStreamComponent_FrameSize( component ) * component->hostFrames * component->numBufs; +} + +static int CalcHigherLogTwo( int n ) +{ + int log2 = 0; + while( (1<userChannelCount; + int frgmt; + int numBufs; + int bytesPerBuf; + double bufSz; + unsigned long fragSz; + audio_buf_info bufInfo; + + /* We may have a situation where only one component (the master) is configured, if both point to the same device. + * In that case, the second component will copy settings from the other */ + if( !master ) + { + /* Aspect BufferSettings: If framesPerBuffer is unspecified we have to infer a suitable fragment size. + * The hardware need not respect the requested fragment size, so we may have to adapt. + */ + if( framesPerBuffer == paFramesPerBufferUnspecified ) + { + bufSz = component->latency * sampleRate; + fragSz = bufSz / 4; + } + else + { + fragSz = framesPerBuffer; + bufSz = component->latency * sampleRate + fragSz; /* Latency + 1 buffer */ + } + + PA_ENSURE( GetAvailableFormats( component, &availableFormats ) ); + hostFormat = PaUtil_SelectClosestAvailableFormat( availableFormats, component->userFormat ); + + /* OSS demands at least 2 buffers, and 16 bytes per buffer */ + numBufs = PA_MAX( bufSz / fragSz, 2 ); + bytesPerBuf = PA_MAX( fragSz * Pa_GetSampleSize( hostFormat ) * chans, 16 ); + + /* The fragment parameters are encoded like this: + * Most significant byte: number of fragments + * Least significant byte: exponent of fragment size (i.e., for 256, 8) + */ + frgmt = (numBufs << 16) + (CalcHigherLogTwo( bytesPerBuf ) & 0xffff); + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SETFRAGMENT, &frgmt ), paUnanticipatedHostError ); + + /* A: according to the OSS programmer's guide parameters should be set in this order: + * format, channels, rate */ + + /* This format should be deemed good before we get this far */ + PA_ENSURE( Pa2OssFormat( hostFormat, &temp ) ); + nativeFormat = temp; + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SETFMT, &temp ), paUnanticipatedHostError ); + PA_UNLESS( temp == nativeFormat, paInternalError ); + + /* try to set the number of channels */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_CHANNELS, &chans ), paSampleFormatNotSupported ); /* XXX: Should be paInvalidChannelCount? */ + /* It's possible that the minimum number of host channels is greater than what the user requested */ + PA_UNLESS( chans >= component->userChannelCount, paInvalidChannelCount ); + + /* try to set the sample rate */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SPEED, &sr ), paInvalidSampleRate ); + + /* reject if there's no sample rate within 1% of the one requested */ + if( (fabs( sampleRate - sr ) / sampleRate) > 0.01 ) + { + PA_DEBUG(("%s: Wanted %f, closest sample rate was %d\n", __FUNCTION__, sampleRate, sr )); + PA_ENSURE( paInvalidSampleRate ); + } + + ENSURE_( ioctl( component->fd, streamMode == StreamMode_In ? SNDCTL_DSP_GETISPACE : SNDCTL_DSP_GETOSPACE, &bufInfo ), + paUnanticipatedHostError ); + component->numBufs = bufInfo.fragstotal; + + /* This needs to be the last ioctl call before the first read/write, according to the OSS programmer's guide */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_GETBLKSIZE, &bytesPerBuf ), paUnanticipatedHostError ); + + component->hostFrames = bytesPerBuf / Pa_GetSampleSize( hostFormat ) / chans; + component->hostChannelCount = chans; + component->hostFormat = hostFormat; + } + else + { + component->hostFormat = master->hostFormat; + component->hostFrames = master->hostFrames; + component->hostChannelCount = master->hostChannelCount; + component->numBufs = master->numBufs; + } + + PA_UNLESS( component->buffer = PaUtil_AllocateMemory( PaOssStreamComponent_BufferSize( component ) ), + paInsufficientMemory ); + +error: + return result; +} + +static PaError PaOssStreamComponent_Read( PaOssStreamComponent *component, unsigned long *frames ) +{ + PaError result = paNoError; + size_t len = *frames * PaOssStreamComponent_FrameSize( component ); + ssize_t bytesRead; + + ENSURE_( bytesRead = read( component->fd, component->buffer, len ), paUnanticipatedHostError ); + *frames = bytesRead / PaOssStreamComponent_FrameSize( component ); + /* TODO: Handle condition where number of frames read doesn't equal number of frames requested */ + +error: + return result; +} + +static PaError PaOssStreamComponent_Write( PaOssStreamComponent *component, unsigned long *frames ) +{ + PaError result = paNoError; + size_t len = *frames * PaOssStreamComponent_FrameSize( component ); + ssize_t bytesWritten; + + ENSURE_( bytesWritten = write( component->fd, component->buffer, len ), paUnanticipatedHostError ); + *frames = bytesWritten / PaOssStreamComponent_FrameSize( component ); + /* TODO: Handle condition where number of frames written doesn't equal number of frames requested */ + +error: + return result; +} + +/** Configure the stream according to input/output parameters. + * + * Aspect StreamChannels: The minimum number of channels supported by the device may exceed that requested by + * the user, if so we'll record the actual number of host channels and adapt later. + */ +static PaError PaOssStream_Configure( PaOssStream *stream, double sampleRate, unsigned long framesPerBuffer, + double *inputLatency, double *outputLatency ) +{ + PaError result = paNoError; + int duplex = stream->capture && stream->playback; + unsigned long framesPerHostBuffer = 0; + + /* We should request full duplex first thing after opening the device */ + if( duplex && stream->sharedDevice ) + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETDUPLEX, 0 ), paUnanticipatedHostError ); + + if( stream->capture ) + { + PaOssStreamComponent *component = stream->capture; + PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_In, NULL ); + + assert( component->hostChannelCount > 0 ); + assert( component->hostFrames > 0 ); + + *inputLatency = component->hostFrames * (component->numBufs - 1) / sampleRate; + } + if( stream->playback ) + { + PaOssStreamComponent *component = stream->playback, *master = stream->sharedDevice ? stream->capture : NULL; + PA_ENSURE( PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_Out, + master ) ); + + assert( component->hostChannelCount > 0 ); + assert( component->hostFrames > 0 ); + + *outputLatency = component->hostFrames * (component->numBufs - 1) / sampleRate; + } + + if( duplex ) + framesPerHostBuffer = PA_MIN( stream->capture->hostFrames, stream->playback->hostFrames ); + else if( stream->capture ) + framesPerHostBuffer = stream->capture->hostFrames; + else if( stream->playback ) + framesPerHostBuffer = stream->playback->hostFrames; + + stream->framesPerHostBuffer = framesPerHostBuffer; + stream->pollTimeout = (int) ceil( 1e6 * framesPerHostBuffer / sampleRate ); /* Period in usecs, rounded up */ + + stream->sampleRate = stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + +error: + return result; +} + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +/** Open a PA OSS stream. + * + * Aspect StreamChannels: The number of channels is specified per direction (in/out), and can differ between the + * two. However, OSS doesn't support separate configuration spaces for capture and playback so if both + * directions are the same device we will demand the same number of channels. The number of channels can range + * from 1 to the maximum supported by the device. + * + * Aspect BufferSettings: If framesPerBuffer != paFramesPerBufferUnspecified the number of frames per callback + * must reflect this, in addition the host latency per device should approximate the corresponding + * suggestedLatency. Based on these constraints we need to determine a number of frames per host buffer that + * both capture and playback can agree on (they can be different devices), the buffer processor can adapt + * between host and user buffer size, but the ratio should preferably be integral. + */ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaOSSHostApiRepresentation *ossHostApi = (PaOSSHostApiRepresentation*)hostApi; + PaOssStream *stream = NULL; + int inputChannelCount = 0, outputChannelCount = 0; + PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0, inputHostFormat = 0, outputHostFormat = 0; + const PaDeviceInfo *inputDeviceInfo = 0, *outputDeviceInfo = 0; + int bpInitialized = 0; + double inLatency, outLatency; + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + if( inputParameters ) + { + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + inputDeviceInfo = hostApi->deviceInfos[inputParameters->device]; + PA_ENSURE( ValidateParameters( inputParameters, inputDeviceInfo, StreamMode_In ) ); + + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + } + if( outputParameters ) + { + outputDeviceInfo = hostApi->deviceInfos[outputParameters->device]; + PA_ENSURE( ValidateParameters( outputParameters, outputDeviceInfo, StreamMode_Out ) ); + + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + } + + /* Aspect StreamChannels: We currently demand that number of input and output channels are the same, if the same + * device is opened for both directions + */ + if( inputChannelCount > 0 && outputChannelCount > 0 ) + { + if( inputParameters->device == outputParameters->device ) + { + if( inputParameters->channelCount != outputParameters->channelCount ) + return paInvalidChannelCount; + } + } + + /* allocate and do basic initialization of the stream structure */ + PA_UNLESS( stream = (PaOssStream*)PaUtil_AllocateMemory( sizeof(PaOssStream) ), paInsufficientMemory ); + PA_ENSURE( PaOssStream_Initialize( stream, inputParameters, outputParameters, streamCallback, userData, streamFlags, ossHostApi ) ); + + PA_ENSURE( PaOssStream_Configure( stream, sampleRate, framesPerBuffer, &inLatency, &outLatency ) ); + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + if( inputParameters ) + { + inputHostFormat = stream->capture->hostFormat; + stream->streamRepresentation.streamInfo.inputLatency = inLatency + + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor ) / sampleRate; + } + if( outputParameters ) + { + outputHostFormat = stream->playback->hostFormat; + stream->streamRepresentation.streamInfo.outputLatency = outLatency + + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor ) / sampleRate; + } + + /* Initialize buffer processor with fixed host buffer size. + * Aspect StreamSampleFormat: Here we commit the user and host sample formats, PA infrastructure will + * convert between the two. + */ + PA_ENSURE( PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, inputHostFormat, outputChannelCount, outputSampleFormat, + outputHostFormat, sampleRate, streamFlags, framesPerBuffer, stream->framesPerHostBuffer, + paUtilFixedHostBufferSize, streamCallback, userData ) ); + bpInitialized = 1; + + *s = (PaStream*)stream; + + return result; + +error: + if( bpInitialized ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + if( stream ) + PaOssStream_Terminate( stream ); + + return result; +} + +/*! Poll on I/O filedescriptors. + + Poll till we've determined there's data for read or write. In the full-duplex case, + we don't want to hang around forever waiting for either input or output frames, so + whenever we have a timed out filedescriptor we check if we're nearing under/overrun + for the other direction (critical limit set at one buffer). If so, we exit the waiting + state, and go on with what we got. We align the number of frames on a host buffer + boundary because it is possible that the buffer size differs for the two directions and + the host buffer size is a compromise between the two. + */ +static PaError PaOssStream_WaitForFrames( PaOssStream *stream, unsigned long *frames ) +{ + PaError result = paNoError; + int pollPlayback = 0, pollCapture = 0; + int captureAvail = INT_MAX, playbackAvail = INT_MAX, commonAvail; + audio_buf_info bufInfo; + /* int ofs = 0, nfds = stream->nfds; */ + fd_set readFds, writeFds; + int nfds = 0; + struct timeval selectTimeval = {0, 0}; + unsigned long timeout = stream->pollTimeout; /* In usecs */ + int captureFd = -1, playbackFd = -1; + + assert( stream ); + assert( frames ); + + if( stream->capture ) + { + pollCapture = 1; + captureFd = stream->capture->fd; + /* stream->capture->pfd->events = POLLIN; */ + } + if( stream->playback ) + { + pollPlayback = 1; + playbackFd = stream->playback->fd; + /* stream->playback->pfd->events = POLLOUT; */ + } + + FD_ZERO( &readFds ); + FD_ZERO( &writeFds ); + + while( pollPlayback || pollCapture ) + { + pthread_testcancel(); + + /* select may modify the timeout parameter */ + selectTimeval.tv_usec = timeout; + nfds = 0; + + if( pollCapture ) + { + FD_SET( captureFd, &readFds ); + nfds = captureFd + 1; + } + if( pollPlayback ) + { + FD_SET( playbackFd, &writeFds ); + nfds = PA_MAX( nfds, playbackFd + 1 ); + } + ENSURE_( select( nfds, &readFds, &writeFds, NULL, &selectTimeval ), paUnanticipatedHostError ); + /* + if( poll( stream->pfds + ofs, nfds, stream->pollTimeout ) < 0 ) + { + + ENSURE_( -1, paUnanticipatedHostError ); + } + */ + pthread_testcancel(); + + if( pollCapture ) + { + if( FD_ISSET( captureFd, &readFds ) ) + { + FD_CLR( captureFd, &readFds ); + pollCapture = 0; + } + /* + if( stream->capture->pfd->revents & POLLIN ) + { + --nfds; + ++ofs; + pollCapture = 0; + } + */ + else if( stream->playback ) /* Timed out, go on with playback? */ + { + /*PA_DEBUG(( "%s: Trying to poll again for capture frames, pollTimeout: %d\n", + __FUNCTION__, stream->pollTimeout ));*/ + } + } + if( pollPlayback ) + { + if( FD_ISSET( playbackFd, &writeFds ) ) + { + FD_CLR( playbackFd, &writeFds ); + pollPlayback = 0; + } + /* + if( stream->playback->pfd->revents & POLLOUT ) + { + --nfds; + pollPlayback = 0; + } + */ + else if( stream->capture ) /* Timed out, go on with capture? */ + { + /*PA_DEBUG(( "%s: Trying to poll again for playback frames, pollTimeout: %d\n\n", + __FUNCTION__, stream->pollTimeout ));*/ + } + } + } + + if( stream->capture ) + { + ENSURE_( ioctl( captureFd, SNDCTL_DSP_GETISPACE, &bufInfo ), paUnanticipatedHostError ); + captureAvail = bufInfo.fragments * stream->capture->hostFrames; + if( !captureAvail ) + PA_DEBUG(( "%s: captureAvail: 0\n", __FUNCTION__ )); + + captureAvail = captureAvail == 0 ? INT_MAX : captureAvail; /* Disregard if zero */ + } + if( stream->playback ) + { + ENSURE_( ioctl( playbackFd, SNDCTL_DSP_GETOSPACE, &bufInfo ), paUnanticipatedHostError ); + playbackAvail = bufInfo.fragments * stream->playback->hostFrames; + if( !playbackAvail ) + { + PA_DEBUG(( "%s: playbackAvail: 0\n", __FUNCTION__ )); + } + + playbackAvail = playbackAvail == 0 ? INT_MAX : playbackAvail; /* Disregard if zero */ + } + + commonAvail = PA_MIN( captureAvail, playbackAvail ); + if( commonAvail == INT_MAX ) + commonAvail = 0; + commonAvail -= commonAvail % stream->framesPerHostBuffer; + + assert( commonAvail != INT_MAX ); + assert( commonAvail >= 0 ); + *frames = commonAvail; + +error: + return result; +} + +/** Prepare stream for capture/playback. + * + * In order to synchronize capture and playback properly we use the SETTRIGGER command. + */ +static PaError PaOssStream_Prepare( PaOssStream *stream ) +{ + PaError result = paNoError; + int enableBits = 0; + + if( stream->triggered ) + return result; + + if( stream->playback ) + { + size_t bufSz = PaOssStreamComponent_BufferSize( stream->playback ); + memset( stream->playback->buffer, 0, bufSz ); + + /* Looks like we have to turn off blocking before we try this, but if we don't fill the buffer + * OSS will complain. */ + PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); + while (1) + { + if( write( stream->playback->fd, stream->playback->buffer, bufSz ) < 0 ) + break; + } + PA_ENSURE( ModifyBlocking( stream->playback->fd, 1 ) ); + } + + if( stream->sharedDevice ) + { + enableBits = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + else + { + if( stream->capture ) + { + enableBits = PCM_ENABLE_INPUT; + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + if( stream->playback ) + { + enableBits = PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( stream->playback->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + } + + /* Ok, we have triggered the stream */ + stream->triggered = 1; + +error: + return result; +} + +/** Stop audio processing + * + */ +static PaError PaOssStream_Stop( PaOssStream *stream, int abort ) +{ + PaError result = paNoError; + + /* Looks like the only safe way to stop audio without reopening the device is SNDCTL_DSP_POST. + * Also disable capture/playback till the stream is started again */ + if( stream->capture ) + { + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); + } + if( stream->playback && !stream->sharedDevice ) + { + ENSURE_( ioctl( stream->playback->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); + } + +error: + return result; +} + +/** Clean up after thread exit. + * + * Aspect StreamState: If the user has registered a streamFinishedCallback it will be called here + */ +static void OnExit( void *data ) +{ + PaOssStream *stream = (PaOssStream *) data; + assert( data ); + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + PaOssStream_Stop( stream, stream->callbackAbort ); + + PA_DEBUG(( "OnExit: Stoppage\n" )); + + /* Eventually notify user all buffers have played */ + if( stream->streamRepresentation.streamFinishedCallback ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + + stream->callbackAbort = 0; /* Clear state */ + stream->isActive = 0; +} + +static PaError SetUpBuffers( PaOssStream *stream, unsigned long framesAvail ) +{ + PaError result = paNoError; + + if( stream->capture ) + { + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, stream->capture->buffer, + stream->capture->hostChannelCount ); + PaUtil_SetInputFrameCount( &stream->bufferProcessor, framesAvail ); + } + if( stream->playback ) + { + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, stream->playback->buffer, + stream->playback->hostChannelCount ); + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, framesAvail ); + } + + return result; +} + +/** Thread procedure for callback processing. + * + * Aspect StreamState: StartStream will wait on this to initiate audio processing, useful in case the + * callback should be used for buffer priming. When the stream is cancelled a separate function will + * take care of the transition to the Callback Finished state (the stream isn't considered Stopped + * before StopStream() or AbortStream() are called). + */ +static void *PaOSS_AudioThreadProc( void *userData ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)userData; + unsigned long framesAvail, framesProcessed; + int callbackResult = paContinue; + int triggered = stream->triggered; /* See if SNDCTL_DSP_TRIGGER has been issued already */ + int initiateProcessing = triggered; /* Already triggered? */ + PaStreamCallbackFlags cbFlags = 0; /* We might want to keep state across iterations */ + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* TODO: IMPLEMENT ME */ + + /* +#if ( SOUND_VERSION > 0x030904 ) + audio_errinfo errinfo; +#endif +*/ + + assert( stream ); + + pthread_cleanup_push( &OnExit, stream ); /* Execute OnExit when exiting */ + + /* The first time the stream is started we use SNDCTL_DSP_TRIGGER to accurately start capture and + * playback in sync, when the stream is restarted after being stopped we simply start by reading/ + * writing. + */ + PA_ENSURE( PaOssStream_Prepare( stream ) ); + + /* If we are to initiate processing implicitly by reading/writing data, we start off in blocking mode */ + if( initiateProcessing ) + { + /* Make sure devices are in blocking mode */ + if( stream->capture ) + ModifyBlocking( stream->capture->fd, 1 ); + if( stream->playback ) + ModifyBlocking( stream->playback->fd, 1 ); + } + + while( 1 ) + { + pthread_testcancel(); + + if( stream->callbackStop && callbackResult == paContinue ) + { + PA_DEBUG(( "Setting callbackResult to paComplete\n" )); + callbackResult = paComplete; + } + + /* Aspect StreamState: Because of the messy OSS scheme we can't explicitly trigger device start unless + * the stream has been recently started, we will have to go right ahead and read/write in blocking + * fashion to trigger operation. Therefore we begin with processing one host buffer before we switch + * to non-blocking mode. + */ + if( !initiateProcessing ) + { + PA_ENSURE( PaOssStream_WaitForFrames( stream, &framesAvail ) ); /* Wait on available frames */ + assert( framesAvail % stream->framesPerHostBuffer == 0 ); + } + else + { + framesAvail = stream->framesPerHostBuffer; + } + + while( framesAvail > 0 ) + { + unsigned long frames = framesAvail; + + pthread_testcancel(); + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + /* Read data */ + if ( stream->capture ) + { + PA_ENSURE( PaOssStreamComponent_Read( stream->capture, &frames ) ); + assert( frames == framesAvail ); + } + +#if ( SOUND_VERSION >= 0x030904 ) + /* + Check with OSS to see if there have been any under/overruns + since last time we checked. + */ + /* + if( ioctl( stream->deviceHandle, SNDCTL_DSP_GETERROR, &errinfo ) >= 0 ) + { + if( errinfo.play_underruns ) + cbFlags |= paOutputUnderflow ; + if( errinfo.record_underruns ) + cbFlags |= paInputUnderflow ; + } + else + PA_DEBUG(( "SNDCTL_DSP_GETERROR command failed: %s\n", strerror( errno ) )); + */ +#endif + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, + cbFlags ); + cbFlags = 0; + PA_ENSURE( SetUpBuffers( stream, framesAvail ) ); + + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, + &callbackResult ); + assert( framesProcessed == framesAvail ); + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + if ( stream->playback ) + { + frames = framesAvail; + + PA_ENSURE( PaOssStreamComponent_Write( stream->playback, &frames ) ); + assert( frames == framesAvail ); + + /* TODO: handle bytesWritten != bytesRequested (slippage?) */ + } + + framesAvail -= framesProcessed; + stream->framesProcessed += framesProcessed; + + if( callbackResult != paContinue ) + break; + } + + if( initiateProcessing || !triggered ) + { + /* Non-blocking */ + if( stream->capture ) + PA_ENSURE( ModifyBlocking( stream->capture->fd, 0 ) ); + if( stream->playback && !stream->sharedDevice ) + PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); + + initiateProcessing = 0; + sem_post( &stream->semaphore ); + } + + if( callbackResult != paContinue ) + { + stream->callbackAbort = callbackResult == paAbort; + if( stream->callbackAbort || PaUtil_IsBufferProcessorOutputEmpty( &stream->bufferProcessor ) ) + break; + } + } + + pthread_cleanup_pop( 1 ); + +error: + pthread_exit( NULL ); +} + +/** Close the stream. + * + */ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)s; + + assert( stream ); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaOssStream_Terminate( stream ); + + return result; +} + +/** Start the stream. + * + * Aspect StreamState: After returning, the stream shall be in the Active state, implying that an eventual + * callback will be repeatedly called in a separate thread. If a separate thread is started this function + * will block untill it has started processing audio, otherwise audio processing is started directly. + */ +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)s; + + stream->isActive = 1; + stream->isStopped = 0; + stream->lastPosPtr = 0; + stream->lastStreamBytes = 0; + stream->framesProcessed = 0; + + /* only use the thread for callback streams */ + if( stream->bufferProcessor.streamCallback ) + { + PA_ENSURE( PaUtil_StartThreading( &stream->threading, &PaOSS_AudioThreadProc, stream ) ); + sem_wait( &stream->semaphore ); + } + else + PA_ENSURE( PaOssStream_Prepare( stream ) ); + +error: + return result; +} + +static PaError RealStop( PaOssStream *stream, int abort ) +{ + PaError result = paNoError; + + if( stream->callbackMode ) + { + if( abort ) + stream->callbackAbort = 1; + else + stream->callbackStop = 1; + + PA_ENSURE( PaUtil_CancelThreading( &stream->threading, !abort, NULL ) ); + + stream->callbackStop = stream->callbackAbort = 0; + } + else + PA_ENSURE( PaOssStream_Stop( stream, abort ) ); + + stream->isStopped = 1; + +error: + return result; +} + +/** Stop the stream. + * + * Aspect StreamState: This will cause the stream to transition to the Stopped state, playing all enqueued + * buffers. + */ +static PaError StopStream( PaStream *s ) +{ + return RealStop( (PaOssStream *)s, 0 ); +} + +/** Abort the stream. + * + * Aspect StreamState: This will cause the stream to transition to the Stopped state, discarding all enqueued + * buffers. Note that the buffers are not currently correctly discarded, this is difficult without closing + * the OSS device. + */ +static PaError AbortStream( PaStream *s ) +{ + return RealStop( (PaOssStream *)s, 1 ); +} + +/** Is the stream in the Stopped state. + * + */ +static PaError IsStreamStopped( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return (stream->isStopped); +} + +/** Is the stream in the Active state. + * + */ +static PaError IsStreamActive( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return (stream->isActive); +} + +static PaTime GetStreamTime( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + count_info info; + int delta; + + if( stream->playback ) { + if( ioctl( stream->playback->fd, SNDCTL_DSP_GETOPTR, &info) == 0 ) { + delta = ( info.bytes - stream->lastPosPtr ) /* & 0x000FFFFF*/; + return (float)(stream->lastStreamBytes + delta) / PaOssStreamComponent_FrameSize( stream->playback ) / stream->sampleRate; + } + } + else { + if (ioctl( stream->capture->fd, SNDCTL_DSP_GETIPTR, &info) == 0) { + delta = (info.bytes - stream->lastPosPtr) /*& 0x000FFFFF*/; + return (float)(stream->lastStreamBytes + delta) / PaOssStreamComponent_FrameSize( stream->capture ) / stream->sampleRate; + } + } + + /* the ioctl failed, but we can still give a coarse estimate */ + + return stream->framesProcessed / stream->sampleRate; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaOssStream *stream = (PaOssStream*)s; + int bytesRequested, bytesRead; + unsigned long framesRequested; + void *userBuffer; + + /* If user input is non-interleaved, PaUtil_CopyInput will manipulate the channel pointers, + * so we copy the user provided pointers */ + if( stream->bufferProcessor.userInputIsInterleaved ) + userBuffer = buffer; + else /* Copy channels into local array */ + { + userBuffer = stream->capture->userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->capture->userChannelCount ); + } + + while( frames ) + { + framesRequested = PA_MIN( frames, stream->capture->hostFrames ); + + bytesRequested = framesRequested * PaOssStreamComponent_FrameSize( stream->capture ); + bytesRead = read( stream->capture->fd, stream->capture->buffer, bytesRequested ); + if ( bytesRequested != bytesRead ) + return paUnanticipatedHostError; + + PaUtil_SetInputFrameCount( &stream->bufferProcessor, stream->capture->hostFrames ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, stream->capture->buffer, stream->capture->hostChannelCount ); + PaUtil_CopyInput( &stream->bufferProcessor, &userBuffer, framesRequested ); + frames -= framesRequested; + } + return paNoError; +} + + +static PaError WriteStream( PaStream *s, const void *buffer, unsigned long frames ) +{ + PaOssStream *stream = (PaOssStream*)s; + int bytesRequested, bytesWritten; + unsigned long framesConverted; + const void *userBuffer; + + /* If user output is non-interleaved, PaUtil_CopyOutput will manipulate the channel pointers, + * so we copy the user provided pointers */ + if( stream->bufferProcessor.userOutputIsInterleaved ) + userBuffer = buffer; + else + { + /* Copy channels into local array */ + userBuffer = stream->playback->userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->playback->userChannelCount ); + } + + while( frames ) + { + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, stream->playback->hostFrames ); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, stream->playback->buffer, stream->playback->hostChannelCount ); + + framesConverted = PaUtil_CopyOutput( &stream->bufferProcessor, &userBuffer, frames ); + frames -= framesConverted; + + bytesRequested = framesConverted * PaOssStreamComponent_FrameSize( stream->playback ); + bytesWritten = write( stream->playback->fd, stream->playback->buffer, bytesRequested ); + + if ( bytesRequested != bytesWritten ) + return paUnanticipatedHostError; + } + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + audio_buf_info info; + + if( ioctl( stream->capture->fd, SNDCTL_DSP_GETISPACE, &info ) < 0 ) + return paUnanticipatedHostError; + return info.fragments * stream->capture->hostFrames; +} + + +/* TODO: Compute number of allocated bytes somewhere else, can we use ODELAY with capture */ +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + int delay = 0; + + if( ioctl( stream->playback->fd, SNDCTL_DSP_GETODELAY, &delay ) < 0 ) + return paUnanticipatedHostError; + + return (PaOssStreamComponent_BufferSize( stream->playback ) - delay) / PaOssStreamComponent_FrameSize( stream->playback ); +} + diff --git a/portaudio-v19/src/hostapi/oss/pa_unix_oss.c.orig b/portaudio-v19/src/hostapi/oss/pa_unix_oss.c.orig new file mode 100644 index 000000000..37a323e21 --- /dev/null +++ b/portaudio-v19/src/hostapi/oss/pa_unix_oss.c.orig @@ -0,0 +1,1924 @@ +/* + * $Id: pa_unix_oss.c 1016 2006-05-17 08:02:24Z aknudsen $ + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * OSS implementation by: + * Douglas Repetto + * Phil Burk + * Dominic Mazzoni + * Arve Knudsen + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __FreeBSD__ +# include +# define DEVICE_NAME_BASE "/dev/dsp" +#elif defined __linux__ +# include +# define DEVICE_NAME_BASE "/dev/dsp" +#else +# include /* JH20010905 */ +# define DEVICE_NAME_BASE "/dev/audio" +#endif + +#include "portaudio.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" +#include "pa_unix_util.h" + +static int sysErr_; +static pthread_t mainThread_; + +/* Check return value of system call, and map it to PaError */ +#define ENSURE_(expr, code) \ + do { \ + if( UNLIKELY( (sysErr_ = (expr)) < 0 ) ) \ + { \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \ + { \ + PaUtil_SetLastHostErrorInfo( paALSA, sysErr_, strerror( errno ) ); \ + } \ + \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = (code); \ + goto error; \ + } \ + } while( 0 ); + +#ifndef AFMT_S16_NE +#define AFMT_S16_NE Get_AFMT_S16_NE() +/********************************************************************* + * Some versions of OSS do not define AFMT_S16_NE. So check CPU. + * PowerPC is Big Endian. X86 is Little Endian. + */ +static int Get_AFMT_S16_NE( void ) +{ + long testData = 1; + char *ptr = (char *) &testData; + int isLittle = ( *ptr == 1 ); /* Does address point to least significant byte? */ + return isLittle ? AFMT_S16_LE : AFMT_S16_BE; +} +#endif + +/* PaOSSHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + PaHostApiIndex hostApiIndex; +} +PaOSSHostApiRepresentation; + +/** Per-direction structure for PaOssStream. + * + * Aspect StreamChannels: In case the user requests to open the same device for both capture and playback, + * but with different number of channels we will have to adapt between the number of user and host + * channels for at least one direction, since the configuration space is the same for both directions + * of an OSS device. + */ +typedef struct +{ + int fd; + const char *devName; + int userChannelCount, hostChannelCount; + int userInterleaved; + void *buffer; + PaSampleFormat userFormat, hostFormat; + double latency; + unsigned long hostFrames, numBufs; + void **userBuffers; /* For non-interleaved blocking */ +} PaOssStreamComponent; + +/** Implementation specific representation of a PaStream. + * + */ +typedef struct PaOssStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + PaUtilThreading threading; + + int sharedDevice; + unsigned long framesPerHostBuffer; + int triggered; /* Have the devices been triggered yet (first start) */ + + int isActive; + int isStopped; + + int lastPosPtr; + double lastStreamBytes; + + int framesProcessed; + + double sampleRate; + + int callbackMode; + int callbackStop, callbackAbort; + + PaOssStreamComponent *capture, *playback; + unsigned long pollTimeout; + sem_t semaphore; +} +PaOssStream; + +typedef enum { + StreamMode_In, + StreamMode_Out +} StreamMode; + +/* prototypes for functions declared in this file */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); +static PaError BuildDeviceList( PaOSSHostApiRepresentation *hostApi ); + + +/** Initialize the OSS API implementation. + * + * This function will initialize host API datastructures and query host devices for information. + * + * Aspect DeviceCapabilities: Enumeration of host API devices is initiated from here + * + * Aspect FreeResources: If an error is encountered under way we have to free each resource allocated in this function, + * this happens with the usual "error" label. + */ +PaError PaOSS_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + PaOSSHostApiRepresentation *ossHostApi = NULL; + + PA_UNLESS( ossHostApi = (PaOSSHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaOSSHostApiRepresentation) ), + paInsufficientMemory ); + PA_UNLESS( ossHostApi->allocations = PaUtil_CreateAllocationGroup(), paInsufficientMemory ); + ossHostApi->hostApiIndex = hostApiIndex; + + /* Initialize host API structure */ + *hostApi = &ossHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paOSS; + (*hostApi)->info.name = "OSS"; + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PA_ENSURE( BuildDeviceList( ossHostApi ) ); + + PaUtil_InitializeStreamInterface( &ossHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, + PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &ossHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + mainThread_ = pthread_self(); + + return result; + +error: + if( ossHostApi ) + { + if( ossHostApi->allocations ) + { + PaUtil_FreeAllAllocations( ossHostApi->allocations ); + PaUtil_DestroyAllocationGroup( ossHostApi->allocations ); + } + + PaUtil_FreeMemory( ossHostApi ); + } + return result; +} + +PaError PaUtil_InitializeDeviceInfo( PaDeviceInfo *deviceInfo, const char *name, PaHostApiIndex hostApiIndex, int maxInputChannels, + int maxOutputChannels, PaTime defaultLowInputLatency, PaTime defaultLowOutputLatency, PaTime defaultHighInputLatency, + PaTime defaultHighOutputLatency, double defaultSampleRate, PaUtilAllocationGroup *allocations ) +{ + PaError result = paNoError; + + deviceInfo->structVersion = 2; + if( allocations ) + { + size_t len = strlen( name ) + 1; + PA_UNLESS( deviceInfo->name = PaUtil_GroupAllocateMemory( allocations, len ), paInsufficientMemory ); + strncpy( (char *)deviceInfo->name, name, len ); + } + else + deviceInfo->name = name; + + deviceInfo->hostApi = hostApiIndex; + deviceInfo->maxInputChannels = maxInputChannels; + deviceInfo->maxOutputChannels = maxOutputChannels; + deviceInfo->defaultLowInputLatency = defaultLowInputLatency; + deviceInfo->defaultLowOutputLatency = defaultLowOutputLatency; + deviceInfo->defaultHighInputLatency = defaultHighInputLatency; + deviceInfo->defaultHighOutputLatency = defaultHighOutputLatency; + deviceInfo->defaultSampleRate = defaultSampleRate; + +error: + return result; +} + +static PaError QueryDirection( const char *deviceName, StreamMode mode, double *defaultSampleRate, int *maxChannelCount, + double *defaultLowLatency, double *defaultHighLatency ) +{ + PaError result = paNoError; + int numChannels, maxNumChannels; + int busy = 0; + int devHandle = -1; + int sr; + *maxChannelCount = 0; /* Default value in case this fails */ + + if ( (devHandle = open( deviceName, (mode == StreamMode_In ? O_RDONLY : O_WRONLY) | O_NONBLOCK )) < 0 ) + { + if( errno == EBUSY || errno == EAGAIN ) + { + PA_DEBUG(( "%s: Device %s busy\n", __FUNCTION__, deviceName )); + } + else + { + PA_DEBUG(( "%s: Can't access device: %s\n", __FUNCTION__, strerror( errno ) )); + } + + return paDeviceUnavailable; + } + + /* Negotiate for the maximum number of channels for this device. PLB20010927 + * Consider up to 16 as the upper number of channels. + * Variable maxNumChannels should contain the actual upper limit after the call. + * Thanks to John Lazzaro and Heiko Purnhagen for suggestions. + */ + maxNumChannels = 0; + for( numChannels = 1; numChannels <= 16; numChannels++ ) + { + int temp = numChannels; + if( ioctl( devHandle, SNDCTL_DSP_CHANNELS, &temp ) < 0 ) + { + busy = EAGAIN == errno || EBUSY == errno; + /* ioctl() failed so bail out if we already have stereo */ + if( maxNumChannels >= 2 ) + break; + } + else + { + /* ioctl() worked but bail out if it does not support numChannels. + * We don't want to leave gaps in the numChannels supported. + */ + if( (numChannels > 2) && (temp != numChannels) ) + break; + if( temp > maxNumChannels ) + maxNumChannels = temp; /* Save maximum. */ + } + } + /* A: We're able to open a device for capture if it's busy playing back and vice versa, + * but we can't configure anything */ + if( 0 == maxNumChannels && busy ) + { + result = paDeviceUnavailable; + goto error; + } + + /* The above negotiation may fail for an old driver so try this older technique. */ + if( maxNumChannels < 1 ) + { + int stereo = 1; + if( ioctl( devHandle, SNDCTL_DSP_STEREO, &stereo ) < 0 ) + { + maxNumChannels = 1; + } + else + { + maxNumChannels = (stereo) ? 2 : 1; + } + PA_DEBUG(( "%s: use SNDCTL_DSP_STEREO, maxNumChannels = %d\n", __FUNCTION__, maxNumChannels )) + } + + /* During channel negotiation, the last ioctl() may have failed. This can + * also cause sample rate negotiation to fail. Hence the following, to return + * to a supported number of channels. SG20011005 */ + { + /* use most reasonable default value */ + int temp = PA_MIN( maxNumChannels, 2 ); + ENSURE_( ioctl( devHandle, SNDCTL_DSP_CHANNELS, &temp ), paUnanticipatedHostError ); + } + + /* Get supported sample rate closest to 44100 Hz */ + if( *defaultSampleRate < 0 ) + { + sr = 44100; + if( ioctl( devHandle, SNDCTL_DSP_SPEED, &sr ) < 0 ) + { + result = paUnanticipatedHostError; + goto error; + } + + *defaultSampleRate = sr; + } + + *maxChannelCount = maxNumChannels; + /* TODO */ + *defaultLowLatency = 512. / *defaultSampleRate; + *defaultHighLatency = 2048. / *defaultSampleRate; + +error: + if( devHandle >= 0 ) + close( devHandle ); + + return result; +} + +/** Query OSS device. + * + * This is where PaDeviceInfo objects are constructed and filled in with relevant information. + * + * Aspect DeviceCapabilities: The inferred device capabilities are recorded in a PaDeviceInfo object that is constructed + * in place. + */ +static PaError QueryDevice( char *deviceName, PaOSSHostApiRepresentation *ossApi, PaDeviceInfo **deviceInfo ) +{ + PaError result = paNoError; + double sampleRate = -1.; + int maxInputChannels, maxOutputChannels; + PaTime defaultLowInputLatency, defaultLowOutputLatency, defaultHighInputLatency, defaultHighOutputLatency; + PaError tmpRes = paNoError; + int busy = 0; + *deviceInfo = NULL; + + /* douglas: + we have to do this querying in a slightly different order. apparently + some sound cards will give you different info based on their settins. + e.g. a card might give you stereo at 22kHz but only mono at 44kHz. + the correct order for OSS is: format, channels, sample rate + */ + + /* Aspect StreamChannels: The number of channels supported for a device may depend on the mode it is + * opened in, it may have more channels available for capture than playback and vice versa. Therefore + * we will open the device in both read- and write-only mode to determine the supported number. + */ + if( (tmpRes = QueryDirection( deviceName, StreamMode_In, &sampleRate, &maxInputChannels, &defaultLowInputLatency, + &defaultHighInputLatency )) != paNoError ) + { + if( tmpRes != paDeviceUnavailable ) + { + PA_DEBUG(( "%s: Querying device %s for capture failed!\n", __FUNCTION__, deviceName )); + /* PA_ENSURE( tmpRes ); */ + } + ++busy; + } + if( (tmpRes = QueryDirection( deviceName, StreamMode_Out, &sampleRate, &maxOutputChannels, &defaultLowOutputLatency, + &defaultHighOutputLatency )) != paNoError ) + { + if( tmpRes != paDeviceUnavailable ) + { + PA_DEBUG(( "%s: Querying device %s for playback failed!\n", __FUNCTION__, deviceName )); + /* PA_ENSURE( tmpRes ); */ + } + ++busy; + } + assert( 0 <= busy && busy <= 2 ); + if( 2 == busy ) /* Both directions are unavailable to us */ + { + result = paDeviceUnavailable; + goto error; + } + + PA_UNLESS( *deviceInfo = PaUtil_GroupAllocateMemory( ossApi->allocations, sizeof (PaDeviceInfo) ), paInsufficientMemory ); + PA_ENSURE( PaUtil_InitializeDeviceInfo( *deviceInfo, deviceName, ossApi->hostApiIndex, maxInputChannels, maxOutputChannels, + defaultLowInputLatency, defaultLowOutputLatency, defaultHighInputLatency, defaultHighOutputLatency, sampleRate, + ossApi->allocations ) ); + +error: + return result; +} + +/** Query host devices. + * + * Loop over host devices and query their capabilitiesu + * + * Aspect DeviceCapabilities: This function calls QueryDevice on each device entry and receives a filled in PaDeviceInfo object + * per device, these are placed in the host api representation's deviceInfos array. + */ +static PaError BuildDeviceList( PaOSSHostApiRepresentation *ossApi ) +{ + PaError result = paNoError; + PaUtilHostApiRepresentation *commonApi = &ossApi->inheritedHostApiRep; + int i; + int numDevices = 0, maxDeviceInfos = 1; + PaDeviceInfo **deviceInfos = NULL; + + /* These two will be set to the first working input and output device, respectively */ + commonApi->info.defaultInputDevice = paNoDevice; + commonApi->info.defaultOutputDevice = paNoDevice; + + /* Find devices by calling QueryDevice on each + * potential device names. When we find a valid one, + * add it to a linked list. + * A: Can there only be 10 devices? */ + + for( i = 0; i < 10; i++ ) + { + char deviceName[32]; + PaDeviceInfo *deviceInfo; + int testResult; + struct stat stbuf; + + if( i == 0 ) + snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE); + else + snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i); + + /* PA_DEBUG(("PaOSS BuildDeviceList: trying device %s\n", deviceName )); */ + if( stat( deviceName, &stbuf ) < 0 ) + { + if( ENOENT != errno ) + PA_DEBUG(( "%s: Error stat'ing %s: %s\n", __FUNCTION__, deviceName, strerror( errno ) )); + continue; + } + if( (testResult = QueryDevice( deviceName, ossApi, &deviceInfo )) != paNoError ) + { + if( testResult != paDeviceUnavailable ) + PA_ENSURE( testResult ); + + continue; + } + + ++numDevices; + if( !deviceInfos || numDevices > maxDeviceInfos ) + { + maxDeviceInfos *= 2; + PA_UNLESS( deviceInfos = (PaDeviceInfo **) realloc( deviceInfos, maxDeviceInfos * sizeof (PaDeviceInfo *) ), + paInsufficientMemory ); + } + { + int devIdx = numDevices - 1; + deviceInfos[devIdx] = deviceInfo; + + if( commonApi->info.defaultInputDevice == paNoDevice && deviceInfo->maxInputChannels > 0 ) + commonApi->info.defaultInputDevice = devIdx; + if( commonApi->info.defaultOutputDevice == paNoDevice && deviceInfo->maxOutputChannels > 0 ) + commonApi->info.defaultOutputDevice = devIdx; + } + } + + /* Make an array of PaDeviceInfo pointers out of the linked list */ + + PA_DEBUG(("PaOSS %s: Total number of devices found: %d\n", __FUNCTION__, numDevices)); + + commonApi->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + ossApi->allocations, sizeof(PaDeviceInfo*) * numDevices ); + memcpy( commonApi->deviceInfos, deviceInfos, numDevices * sizeof (PaDeviceInfo *) ); + + commonApi->info.deviceCount = numDevices; + +error: + free( deviceInfos ); + + return result; +} + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaOSSHostApiRepresentation *ossHostApi = (PaOSSHostApiRepresentation*)hostApi; + + if( ossHostApi->allocations ) + { + PaUtil_FreeAllAllocations( ossHostApi->allocations ); + PaUtil_DestroyAllocationGroup( ossHostApi->allocations ); + } + + PaUtil_FreeMemory( ossHostApi ); +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaError result = paNoError; + PaDeviceIndex device; + PaDeviceInfo *deviceInfo; + char *deviceName; + int inputChannelCount, outputChannelCount; + int tempDevHandle = -1; + int flags; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + } + else + { + outputChannelCount = 0; + } + + if (inputChannelCount == 0 && outputChannelCount == 0) + return paInvalidChannelCount; + + /* if full duplex, make sure that they're the same device */ + + if (inputChannelCount > 0 && outputChannelCount > 0 && + inputParameters->device != outputParameters->device) + return paInvalidDevice; + + /* if full duplex, also make sure that they're the same number of channels */ + + if (inputChannelCount > 0 && outputChannelCount > 0 && + inputChannelCount != outputChannelCount) + return paInvalidChannelCount; + + /* open the device so we can do more tests */ + + if( inputChannelCount > 0 ) + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex(&device, inputParameters->device, hostApi); + if (result != paNoError) + return result; + } + else + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex(&device, outputParameters->device, hostApi); + if (result != paNoError) + return result; + } + + deviceInfo = hostApi->deviceInfos[device]; + deviceName = (char *)deviceInfo->name; + + flags = O_NONBLOCK; + if (inputChannelCount > 0 && outputChannelCount > 0) + flags |= O_RDWR; + else if (inputChannelCount > 0) + flags |= O_RDONLY; + else + flags |= O_WRONLY; + + ENSURE_( tempDevHandle = open( deviceInfo->name, flags ), paDeviceUnavailable ); + + /* PaOssStream_Configure will do the rest of the checking for us */ + /* PA_ENSURE( PaOssStream_Configure( tempDevHandle, deviceName, outputChannelCount, &sampleRate ) ); */ + + /* everything succeeded! */ + + error: + if( tempDevHandle >= 0 ) + close( tempDevHandle ); + + return result; +} + +/** Validate stream parameters. + * + * Aspect StreamChannels: We verify that the number of channels is within the allowed range for the device + */ +static PaError ValidateParameters( const PaStreamParameters *parameters, const PaDeviceInfo *deviceInfo, StreamMode mode ) +{ + int maxChans; + + assert( parameters ); + + if( parameters->device == paUseHostApiSpecificDeviceSpecification ) + { + return paInvalidDevice; + } + + maxChans = (mode == StreamMode_In ? deviceInfo->maxInputChannels : + deviceInfo->maxOutputChannels); + if( parameters->channelCount > maxChans ) + { + return paInvalidChannelCount; + } + + return paNoError; +} + +static PaError PaOssStreamComponent_Initialize( PaOssStreamComponent *component, const PaStreamParameters *parameters, + int callbackMode, int fd, const char *deviceName ) +{ + PaError result = paNoError; + assert( component ); + + memset( component, 0, sizeof (PaOssStreamComponent) ); + + component->fd = fd; + component->devName = deviceName; + component->userChannelCount = parameters->channelCount; + component->userFormat = parameters->sampleFormat; + component->latency = parameters->suggestedLatency; + component->userInterleaved = !(parameters->sampleFormat & paNonInterleaved); + + if( !callbackMode && !component->userInterleaved ) + { + /* Pre-allocate non-interleaved user provided buffers */ + PA_UNLESS( component->userBuffers = PaUtil_AllocateMemory( sizeof (void *) * component->userChannelCount ), + paInsufficientMemory ); + } + +error: + return result; +} + +static void PaOssStreamComponent_Terminate( PaOssStreamComponent *component ) +{ + assert( component ); + + if( component->fd >= 0 ) + close( component->fd ); + if( component->buffer ) + PaUtil_FreeMemory( component->buffer ); + + if( component->userBuffers ) + PaUtil_FreeMemory( component->userBuffers ); + + PaUtil_FreeMemory( component ); +} + +static PaError ModifyBlocking( int fd, int blocking ) +{ + PaError result = paNoError; + int fflags; + + ENSURE_( fflags = fcntl( fd, F_GETFL ), paUnanticipatedHostError ); + + if( blocking ) + fflags &= ~O_NONBLOCK; + else + fflags |= O_NONBLOCK; + + ENSURE_( fcntl( fd, F_SETFL, fflags ), paUnanticipatedHostError ); + +error: + return result; +} + +static PaError OpenDevices( const char *idevName, const char *odevName, int *idev, int *odev ) +{ + PaError result = paNoError; + int flags = O_NONBLOCK, duplex = 0; + int enableBits = 0; + *idev = *odev = -1; + + if( idevName && odevName ) + { + duplex = 1; + flags |= O_RDWR; + } + else if( idevName ) + flags |= O_RDONLY; + else + flags |= O_WRONLY; + + /* open first in nonblocking mode, in case it's busy... + * A: then unset the non-blocking attribute */ + assert( flags & O_NONBLOCK ); + if( idevName ) + { + ENSURE_( *idev = open( idevName, flags ), paDeviceUnavailable ); + PA_ENSURE( ModifyBlocking( *idev, 1 ) ); /* Blocking */ + + /* Initially disable */ + enableBits = ~PCM_ENABLE_INPUT; + ENSURE_( ioctl( *idev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + if( odevName ) + { + if( !idevName ) + { + ENSURE_( *odev = open( odevName, flags ), paDeviceUnavailable ); + PA_ENSURE( ModifyBlocking( *odev, 1 ) ); /* Blocking */ + + /* Initially disable */ + enableBits = ~PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( *odev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + else + { + ENSURE_( *odev = dup( *idev ), paUnanticipatedHostError ); + } + } + +error: + return result; +} + +static PaError PaOssStream_Initialize( PaOssStream *stream, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, + PaStreamCallback callback, void *userData, PaStreamFlags streamFlags, + PaOSSHostApiRepresentation *ossApi ) +{ + PaError result = paNoError; + int idev, odev; + PaUtilHostApiRepresentation *hostApi = &ossApi->inheritedHostApiRep; + const char *idevName = NULL, *odevName = NULL; + + assert( stream ); + + memset( stream, 0, sizeof (PaOssStream) ); + stream->isStopped = 1; + + PA_ENSURE( PaUtil_InitializeThreading( &stream->threading ) ); + + if( inputParameters && outputParameters ) + { + if( inputParameters->device == outputParameters->device ) + stream->sharedDevice = 1; + } + + if( inputParameters ) + idevName = hostApi->deviceInfos[inputParameters->device]->name; + if( outputParameters ) + odevName = hostApi->deviceInfos[outputParameters->device]->name; + PA_ENSURE( OpenDevices( idevName, odevName, &idev, &odev ) ); + if( inputParameters ) + { + PA_UNLESS( stream->capture = PaUtil_AllocateMemory( sizeof (PaOssStreamComponent) ), paInsufficientMemory ); + PA_ENSURE( PaOssStreamComponent_Initialize( stream->capture, inputParameters, callback != NULL, idev, idevName ) ); + } + if( outputParameters ) + { + PA_UNLESS( stream->playback = PaUtil_AllocateMemory( sizeof (PaOssStreamComponent) ), paInsufficientMemory ); + PA_ENSURE( PaOssStreamComponent_Initialize( stream->playback, outputParameters, callback != NULL, odev, odevName ) ); + } + + if( callback != NULL ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &ossApi->callbackStreamInterface, callback, userData ); + stream->callbackMode = 1; + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &ossApi->blockingStreamInterface, callback, userData ); + } + + ENSURE_( sem_init( &stream->semaphore, 0, 0 ), paInternalError ); + +error: + return result; +} + +static void PaOssStream_Terminate( PaOssStream *stream ) +{ + assert( stream ); + + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_TerminateThreading( &stream->threading ); + + if( stream->capture ) + PaOssStreamComponent_Terminate( stream->capture ); + if( stream->playback ) + PaOssStreamComponent_Terminate( stream->playback ); + + sem_destroy( &stream->semaphore ); + + PaUtil_FreeMemory( stream ); +} + +/** Translate from PA format to OSS native. + * + */ +static PaError Pa2OssFormat( PaSampleFormat paFormat, int *ossFormat ) +{ + switch( paFormat ) + { + case paUInt8: + *ossFormat = AFMT_U8; + break; + case paInt8: + *ossFormat = AFMT_S8; + break; + case paInt16: + *ossFormat = AFMT_S16_NE; + break; + default: + return paInternalError; /* This shouldn't happen */ + } + + return paNoError; +} + +/** Return the PA-compatible formats that this device can support. + * + */ +static PaError GetAvailableFormats( PaOssStreamComponent *component, PaSampleFormat *availableFormats ) +{ + PaError result = paNoError; + int mask = 0; + PaSampleFormat frmts = 0; + + ENSURE_( ioctl( component->fd, SNDCTL_DSP_GETFMTS, &mask ), paUnanticipatedHostError ); + if( mask & AFMT_U8 ) + frmts |= paUInt8; + if( mask & AFMT_S8 ) + frmts |= paInt8; + if( mask & AFMT_S16_NE ) + frmts |= paInt16; + else + result = paSampleFormatNotSupported; + + *availableFormats = frmts; + +error: + return result; +} + +static unsigned int PaOssStreamComponent_FrameSize( PaOssStreamComponent *component ) +{ + return Pa_GetSampleSize( component->hostFormat ) * component->hostChannelCount; +} + +/** Buffer size in bytes. + * + */ +static unsigned long PaOssStreamComponent_BufferSize( PaOssStreamComponent *component ) +{ + return PaOssStreamComponent_FrameSize( component ) * component->hostFrames * component->numBufs; +} + +static int CalcHigherLogTwo( int n ) +{ + int log2 = 0; + while( (1<userChannelCount; + int frgmt; + int numBufs; + int bytesPerBuf; + double bufSz; + unsigned long fragSz; + audio_buf_info bufInfo; + + /* We may have a situation where only one component (the master) is configured, if both point to the same device. + * In that case, the second component will copy settings from the other */ + if( !master ) + { + /* Aspect BufferSettings: If framesPerBuffer is unspecified we have to infer a suitable fragment size. + * The hardware need not respect the requested fragment size, so we may have to adapt. + */ + if( framesPerBuffer == paFramesPerBufferUnspecified ) + { + bufSz = component->latency * sampleRate; + fragSz = bufSz / 4; + } + else + { + fragSz = framesPerBuffer; + bufSz = component->latency * sampleRate + fragSz; /* Latency + 1 buffer */ + } + + PA_ENSURE( GetAvailableFormats( component, &availableFormats ) ); + hostFormat = PaUtil_SelectClosestAvailableFormat( availableFormats, component->userFormat ); + + /* OSS demands at least 2 buffers, and 16 bytes per buffer */ + numBufs = PA_MAX( bufSz / fragSz, 2 ); + bytesPerBuf = PA_MAX( fragSz * Pa_GetSampleSize( hostFormat ) * chans, 16 ); + + /* The fragment parameters are encoded like this: + * Most significant byte: number of fragments + * Least significant byte: exponent of fragment size (i.e., for 256, 8) + */ + frgmt = (numBufs << 16) + (CalcHigherLogTwo( bytesPerBuf ) & 0xffff); + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SETFRAGMENT, &frgmt ), paUnanticipatedHostError ); + + /* A: according to the OSS programmer's guide parameters should be set in this order: + * format, channels, rate */ + + /* This format should be deemed good before we get this far */ + PA_ENSURE( Pa2OssFormat( hostFormat, &temp ) ); + nativeFormat = temp; + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SETFMT, &temp ), paUnanticipatedHostError ); + PA_UNLESS( temp == nativeFormat, paInternalError ); + + /* try to set the number of channels */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_CHANNELS, &chans ), paSampleFormatNotSupported ); /* XXX: Should be paInvalidChannelCount? */ + /* It's possible that the minimum number of host channels is greater than what the user requested */ + PA_UNLESS( chans >= component->userChannelCount, paInvalidChannelCount ); + + /* try to set the sample rate */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SPEED, &sr ), paInvalidSampleRate ); + + /* reject if there's no sample rate within 1% of the one requested */ + if( (fabs( sampleRate - sr ) / sampleRate) > 0.01 ) + { + PA_DEBUG(("%s: Wanted %f, closest sample rate was %d\n", __FUNCTION__, sampleRate, sr )); + PA_ENSURE( paInvalidSampleRate ); + } + + ENSURE_( ioctl( component->fd, streamMode == StreamMode_In ? SNDCTL_DSP_GETISPACE : SNDCTL_DSP_GETOSPACE, &bufInfo ), + paUnanticipatedHostError ); + component->numBufs = bufInfo.fragstotal; + + /* This needs to be the last ioctl call before the first read/write, according to the OSS programmer's guide */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_GETBLKSIZE, &bytesPerBuf ), paUnanticipatedHostError ); + + component->hostFrames = bytesPerBuf / Pa_GetSampleSize( hostFormat ) / chans; + component->hostChannelCount = chans; + component->hostFormat = hostFormat; + } + else + { + component->hostFormat = master->hostFormat; + component->hostFrames = master->hostFrames; + component->hostChannelCount = master->hostChannelCount; + component->numBufs = master->numBufs; + } + + PA_UNLESS( component->buffer = PaUtil_AllocateMemory( PaOssStreamComponent_BufferSize( component ) ), + paInsufficientMemory ); + +error: + return result; +} + +static PaError PaOssStreamComponent_Read( PaOssStreamComponent *component, unsigned long *frames ) +{ + PaError result = paNoError; + size_t len = *frames * PaOssStreamComponent_FrameSize( component ); + ssize_t bytesRead; + + ENSURE_( bytesRead = read( component->fd, component->buffer, len ), paUnanticipatedHostError ); + *frames = bytesRead / PaOssStreamComponent_FrameSize( component ); + /* TODO: Handle condition where number of frames read doesn't equal number of frames requested */ + +error: + return result; +} + +static PaError PaOssStreamComponent_Write( PaOssStreamComponent *component, unsigned long *frames ) +{ + PaError result = paNoError; + size_t len = *frames * PaOssStreamComponent_FrameSize( component ); + ssize_t bytesWritten; + + ENSURE_( bytesWritten = write( component->fd, component->buffer, len ), paUnanticipatedHostError ); + *frames = bytesWritten / PaOssStreamComponent_FrameSize( component ); + /* TODO: Handle condition where number of frames written doesn't equal number of frames requested */ + +error: + return result; +} + +/** Configure the stream according to input/output parameters. + * + * Aspect StreamChannels: The minimum number of channels supported by the device may exceed that requested by + * the user, if so we'll record the actual number of host channels and adapt later. + */ +static PaError PaOssStream_Configure( PaOssStream *stream, double sampleRate, unsigned long framesPerBuffer, + double *inputLatency, double *outputLatency ) +{ + PaError result = paNoError; + int duplex = stream->capture && stream->playback; + unsigned long framesPerHostBuffer = 0; + + /* We should request full duplex first thing after opening the device */ + if( duplex && stream->sharedDevice ) + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETDUPLEX, 0 ), paUnanticipatedHostError ); + + if( stream->capture ) + { + PaOssStreamComponent *component = stream->capture; + PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_In, NULL ); + + assert( component->hostChannelCount > 0 ); + assert( component->hostFrames > 0 ); + + *inputLatency = component->hostFrames * (component->numBufs - 1) / sampleRate; + } + if( stream->playback ) + { + PaOssStreamComponent *component = stream->playback, *master = stream->sharedDevice ? stream->capture : NULL; + PA_ENSURE( PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_Out, + master ) ); + + assert( component->hostChannelCount > 0 ); + assert( component->hostFrames > 0 ); + + *outputLatency = component->hostFrames * (component->numBufs - 1) / sampleRate; + } + + if( duplex ) + framesPerHostBuffer = PA_MIN( stream->capture->hostFrames, stream->playback->hostFrames ); + else if( stream->capture ) + framesPerHostBuffer = stream->capture->hostFrames; + else if( stream->playback ) + framesPerHostBuffer = stream->playback->hostFrames; + + stream->framesPerHostBuffer = framesPerHostBuffer; + stream->pollTimeout = (int) ceil( 1e6 * framesPerHostBuffer / sampleRate ); /* Period in usecs, rounded up */ + + stream->sampleRate = stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + +error: + return result; +} + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +/** Open a PA OSS stream. + * + * Aspect StreamChannels: The number of channels is specified per direction (in/out), and can differ between the + * two. However, OSS doesn't support separate configuration spaces for capture and playback so if both + * directions are the same device we will demand the same number of channels. The number of channels can range + * from 1 to the maximum supported by the device. + * + * Aspect BufferSettings: If framesPerBuffer != paFramesPerBufferUnspecified the number of frames per callback + * must reflect this, in addition the host latency per device should approximate the corresponding + * suggestedLatency. Based on these constraints we need to determine a number of frames per host buffer that + * both capture and playback can agree on (they can be different devices), the buffer processor can adapt + * between host and user buffer size, but the ratio should preferably be integral. + */ +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaOSSHostApiRepresentation *ossHostApi = (PaOSSHostApiRepresentation*)hostApi; + PaOssStream *stream = NULL; + int inputChannelCount = 0, outputChannelCount = 0; + PaSampleFormat inputSampleFormat = 0, outputSampleFormat = 0, inputHostFormat = 0, outputHostFormat = 0; + const PaDeviceInfo *inputDeviceInfo = 0, *outputDeviceInfo = 0; + int bpInitialized = 0; + double inLatency, outLatency; + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + if( inputParameters ) + { + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + inputDeviceInfo = hostApi->deviceInfos[inputParameters->device]; + PA_ENSURE( ValidateParameters( inputParameters, inputDeviceInfo, StreamMode_In ) ); + + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + } + if( outputParameters ) + { + outputDeviceInfo = hostApi->deviceInfos[outputParameters->device]; + PA_ENSURE( ValidateParameters( outputParameters, outputDeviceInfo, StreamMode_Out ) ); + + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + } + + /* Aspect StreamChannels: We currently demand that number of input and output channels are the same, if the same + * device is opened for both directions + */ + if( inputChannelCount > 0 && outputChannelCount > 0 ) + { + if( inputParameters->device == outputParameters->device ) + { + if( inputParameters->channelCount != outputParameters->channelCount ) + return paInvalidChannelCount; + } + } + + /* allocate and do basic initialization of the stream structure */ + PA_UNLESS( stream = (PaOssStream*)PaUtil_AllocateMemory( sizeof(PaOssStream) ), paInsufficientMemory ); + PA_ENSURE( PaOssStream_Initialize( stream, inputParameters, outputParameters, streamCallback, userData, streamFlags, ossHostApi ) ); + + PA_ENSURE( PaOssStream_Configure( stream, sampleRate, framesPerBuffer, &inLatency, &outLatency ) ); + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + if( inputParameters ) + { + inputHostFormat = stream->capture->hostFormat; + stream->streamRepresentation.streamInfo.inputLatency = inLatency + + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor ) / sampleRate; + } + if( outputParameters ) + { + outputHostFormat = stream->playback->hostFormat; + stream->streamRepresentation.streamInfo.outputLatency = outLatency + + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor ) / sampleRate; + } + + /* Initialize buffer processor with fixed host buffer size. + * Aspect StreamSampleFormat: Here we commit the user and host sample formats, PA infrastructure will + * convert between the two. + */ + PA_ENSURE( PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, inputHostFormat, outputChannelCount, outputSampleFormat, + outputHostFormat, sampleRate, streamFlags, framesPerBuffer, stream->framesPerHostBuffer, + paUtilFixedHostBufferSize, streamCallback, userData ) ); + bpInitialized = 1; + + *s = (PaStream*)stream; + + return result; + +error: + if( bpInitialized ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + if( stream ) + PaOssStream_Terminate( stream ); + + return result; +} + +/*! Poll on I/O filedescriptors. + + Poll till we've determined there's data for read or write. In the full-duplex case, + we don't want to hang around forever waiting for either input or output frames, so + whenever we have a timed out filedescriptor we check if we're nearing under/overrun + for the other direction (critical limit set at one buffer). If so, we exit the waiting + state, and go on with what we got. We align the number of frames on a host buffer + boundary because it is possible that the buffer size differs for the two directions and + the host buffer size is a compromise between the two. + */ +static PaError PaOssStream_WaitForFrames( PaOssStream *stream, unsigned long *frames ) +{ + PaError result = paNoError; + int pollPlayback = 0, pollCapture = 0; + int captureAvail = INT_MAX, playbackAvail = INT_MAX, commonAvail; + audio_buf_info bufInfo; + /* int ofs = 0, nfds = stream->nfds; */ + fd_set readFds, writeFds; + int nfds = 0; + struct timeval selectTimeval = {0, 0}; + unsigned long timeout = stream->pollTimeout; /* In usecs */ + int captureFd = -1, playbackFd = -1; + + assert( stream ); + assert( frames ); + + if( stream->capture ) + { + pollCapture = 1; + captureFd = stream->capture->fd; + /* stream->capture->pfd->events = POLLIN; */ + } + if( stream->playback ) + { + pollPlayback = 1; + playbackFd = stream->playback->fd; + /* stream->playback->pfd->events = POLLOUT; */ + } + + FD_ZERO( &readFds ); + FD_ZERO( &writeFds ); + + while( pollPlayback || pollCapture ) + { + pthread_testcancel(); + + /* select may modify the timeout parameter */ + selectTimeval.tv_usec = timeout; + nfds = 0; + + if( pollCapture ) + { + FD_SET( captureFd, &readFds ); + nfds = captureFd + 1; + } + if( pollPlayback ) + { + FD_SET( playbackFd, &writeFds ); + nfds = PA_MAX( nfds, playbackFd + 1 ); + } + ENSURE_( select( nfds, &readFds, &writeFds, NULL, &selectTimeval ), paUnanticipatedHostError ); + /* + if( poll( stream->pfds + ofs, nfds, stream->pollTimeout ) < 0 ) + { + + ENSURE_( -1, paUnanticipatedHostError ); + } + */ + pthread_testcancel(); + + if( pollCapture ) + { + if( FD_ISSET( captureFd, &readFds ) ) + { + FD_CLR( captureFd, &readFds ); + pollCapture = 0; + } + /* + if( stream->capture->pfd->revents & POLLIN ) + { + --nfds; + ++ofs; + pollCapture = 0; + } + */ + else if( stream->playback ) /* Timed out, go on with playback? */ + { + /*PA_DEBUG(( "%s: Trying to poll again for capture frames, pollTimeout: %d\n", + __FUNCTION__, stream->pollTimeout ));*/ + } + } + if( pollPlayback ) + { + if( FD_ISSET( playbackFd, &writeFds ) ) + { + FD_CLR( playbackFd, &writeFds ); + pollPlayback = 0; + } + /* + if( stream->playback->pfd->revents & POLLOUT ) + { + --nfds; + pollPlayback = 0; + } + */ + else if( stream->capture ) /* Timed out, go on with capture? */ + { + /*PA_DEBUG(( "%s: Trying to poll again for playback frames, pollTimeout: %d\n\n", + __FUNCTION__, stream->pollTimeout ));*/ + } + } + } + + if( stream->capture ) + { + ENSURE_( ioctl( captureFd, SNDCTL_DSP_GETISPACE, &bufInfo ), paUnanticipatedHostError ); + captureAvail = bufInfo.fragments * stream->capture->hostFrames; + if( !captureAvail ) + PA_DEBUG(( "%s: captureAvail: 0\n", __FUNCTION__ )); + + captureAvail = captureAvail == 0 ? INT_MAX : captureAvail; /* Disregard if zero */ + } + if( stream->playback ) + { + ENSURE_( ioctl( playbackFd, SNDCTL_DSP_GETOSPACE, &bufInfo ), paUnanticipatedHostError ); + playbackAvail = bufInfo.fragments * stream->playback->hostFrames; + if( !playbackAvail ) + { + PA_DEBUG(( "%s: playbackAvail: 0\n", __FUNCTION__ )); + } + + playbackAvail = playbackAvail == 0 ? INT_MAX : playbackAvail; /* Disregard if zero */ + } + + commonAvail = PA_MIN( captureAvail, playbackAvail ); + if( commonAvail == INT_MAX ) + commonAvail = 0; + commonAvail -= commonAvail % stream->framesPerHostBuffer; + + assert( commonAvail != INT_MAX ); + assert( commonAvail >= 0 ); + *frames = commonAvail; + +error: + return result; +} + +/** Prepare stream for capture/playback. + * + * In order to synchronize capture and playback properly we use the SETTRIGGER command. + */ +static PaError PaOssStream_Prepare( PaOssStream *stream ) +{ + PaError result = paNoError; + int enableBits = 0; + + if( stream->triggered ) + return result; + + if( stream->playback ) + { + size_t bufSz = PaOssStreamComponent_BufferSize( stream->playback ); + memset( stream->playback->buffer, 0, bufSz ); + + /* Looks like we have to turn off blocking before we try this, but if we don't fill the buffer + * OSS will complain. */ + PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); + while (1) + { + if( write( stream->playback->fd, stream->playback->buffer, bufSz ) < 0 ) + break; + } + PA_ENSURE( ModifyBlocking( stream->playback->fd, 1 ) ); + } + + if( stream->sharedDevice ) + { + enableBits = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + else + { + if( stream->capture ) + { + enableBits = PCM_ENABLE_INPUT; + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + if( stream->playback ) + { + enableBits = PCM_ENABLE_OUTPUT; + ENSURE_( ioctl( stream->playback->fd, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError ); + } + } + + /* Ok, we have triggered the stream */ + stream->triggered = 1; + +error: + return result; +} + +/** Stop audio processing + * + */ +static PaError PaOssStream_Stop( PaOssStream *stream, int abort ) +{ + PaError result = paNoError; + + /* Looks like the only safe way to stop audio without reopening the device is SNDCTL_DSP_POST. + * Also disable capture/playback till the stream is started again */ + if( stream->capture ) + { + ENSURE_( ioctl( stream->capture->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); + } + if( stream->playback && !stream->sharedDevice ) + { + ENSURE_( ioctl( stream->playback->fd, SNDCTL_DSP_POST, 0 ), paUnanticipatedHostError ); + } + +error: + return result; +} + +/** Clean up after thread exit. + * + * Aspect StreamState: If the user has registered a streamFinishedCallback it will be called here + */ +static void OnExit( void *data ) +{ + PaOssStream *stream = (PaOssStream *) data; + assert( data ); + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + PaOssStream_Stop( stream, stream->callbackAbort ); + + PA_DEBUG(( "OnExit: Stoppage\n" )); + + /* Eventually notify user all buffers have played */ + if( stream->streamRepresentation.streamFinishedCallback ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + + stream->callbackAbort = 0; /* Clear state */ + stream->isActive = 0; +} + +static PaError SetUpBuffers( PaOssStream *stream, unsigned long framesAvail ) +{ + PaError result = paNoError; + + if( stream->capture ) + { + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, stream->capture->buffer, + stream->capture->hostChannelCount ); + PaUtil_SetInputFrameCount( &stream->bufferProcessor, framesAvail ); + } + if( stream->playback ) + { + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, stream->playback->buffer, + stream->playback->hostChannelCount ); + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, framesAvail ); + } + + return result; +} + +/** Thread procedure for callback processing. + * + * Aspect StreamState: StartStream will wait on this to initiate audio processing, useful in case the + * callback should be used for buffer priming. When the stream is cancelled a separate function will + * take care of the transition to the Callback Finished state (the stream isn't considered Stopped + * before StopStream() or AbortStream() are called). + */ +static void *PaOSS_AudioThreadProc( void *userData ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)userData; + unsigned long framesAvail, framesProcessed; + int callbackResult = paContinue; + int triggered = stream->triggered; /* See if SNDCTL_DSP_TRIGGER has been issued already */ + int initiateProcessing = triggered; /* Already triggered? */ + PaStreamCallbackFlags cbFlags = 0; /* We might want to keep state across iterations */ + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* TODO: IMPLEMENT ME */ + + /* +#if ( SOUND_VERSION > 0x030904 ) + audio_errinfo errinfo; +#endif +*/ + + assert( stream ); + + pthread_cleanup_push( &OnExit, stream ); /* Execute OnExit when exiting */ + + /* The first time the stream is started we use SNDCTL_DSP_TRIGGER to accurately start capture and + * playback in sync, when the stream is restarted after being stopped we simply start by reading/ + * writing. + */ + PA_ENSURE( PaOssStream_Prepare( stream ) ); + + /* If we are to initiate processing implicitly by reading/writing data, we start off in blocking mode */ + if( initiateProcessing ) + { + /* Make sure devices are in blocking mode */ + if( stream->capture ) + ModifyBlocking( stream->capture->fd, 1 ); + if( stream->playback ) + ModifyBlocking( stream->playback->fd, 1 ); + } + + while( 1 ) + { + pthread_testcancel(); + + if( stream->callbackStop && callbackResult == paContinue ) + { + PA_DEBUG(( "Setting callbackResult to paComplete\n" )); + callbackResult = paComplete; + } + + /* Aspect StreamState: Because of the messy OSS scheme we can't explicitly trigger device start unless + * the stream has been recently started, we will have to go right ahead and read/write in blocking + * fashion to trigger operation. Therefore we begin with processing one host buffer before we switch + * to non-blocking mode. + */ + if( !initiateProcessing ) + { + PA_ENSURE( PaOssStream_WaitForFrames( stream, &framesAvail ) ); /* Wait on available frames */ + assert( framesAvail % stream->framesPerHostBuffer == 0 ); + } + else + { + framesAvail = stream->framesPerHostBuffer; + } + + while( framesAvail > 0 ) + { + unsigned long frames = framesAvail; + + pthread_testcancel(); + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + /* Read data */ + if ( stream->capture ) + { + PA_ENSURE( PaOssStreamComponent_Read( stream->capture, &frames ) ); + assert( frames == framesAvail ); + } + +#if ( SOUND_VERSION >= 0x030904 ) + /* + Check with OSS to see if there have been any under/overruns + since last time we checked. + */ + /* + if( ioctl( stream->deviceHandle, SNDCTL_DSP_GETERROR, &errinfo ) >= 0 ) + { + if( errinfo.play_underruns ) + cbFlags |= paOutputUnderflow ; + if( errinfo.record_underruns ) + cbFlags |= paInputUnderflow ; + } + else + PA_DEBUG(( "SNDCTL_DSP_GETERROR command failed: %s\n", strerror( errno ) )); + */ +#endif + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, + cbFlags ); + cbFlags = 0; + PA_ENSURE( SetUpBuffers( stream, framesAvail ) ); + + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, + &callbackResult ); + assert( framesProcessed == framesAvail ); + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + if ( stream->playback ) + { + frames = framesAvail; + + PA_ENSURE( PaOssStreamComponent_Write( stream->playback, &frames ) ); + assert( frames == framesAvail ); + + /* TODO: handle bytesWritten != bytesRequested (slippage?) */ + } + + framesAvail -= framesProcessed; + stream->framesProcessed += framesProcessed; + + if( callbackResult != paContinue ) + break; + } + + if( initiateProcessing || !triggered ) + { + /* Non-blocking */ + if( stream->capture ) + PA_ENSURE( ModifyBlocking( stream->capture->fd, 0 ) ); + if( stream->playback && !stream->sharedDevice ) + PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); + + initiateProcessing = 0; + sem_post( &stream->semaphore ); + } + + if( callbackResult != paContinue ) + { + stream->callbackAbort = callbackResult == paAbort; + if( stream->callbackAbort || PaUtil_IsBufferProcessorOutputEmpty( &stream->bufferProcessor ) ) + break; + } + } + + pthread_cleanup_pop( 1 ); + +error: + pthread_exit( NULL ); +} + +/** Close the stream. + * + */ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)s; + + assert( stream ); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaOssStream_Terminate( stream ); + + return result; +} + +/** Start the stream. + * + * Aspect StreamState: After returning, the stream shall be in the Active state, implying that an eventual + * callback will be repeatedly called in a separate thread. If a separate thread is started this function + * will block untill it has started processing audio, otherwise audio processing is started directly. + */ +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaOssStream *stream = (PaOssStream*)s; + + stream->isActive = 1; + stream->isStopped = 0; + stream->lastPosPtr = 0; + stream->lastStreamBytes = 0; + stream->framesProcessed = 0; + + /* only use the thread for callback streams */ + if( stream->bufferProcessor.streamCallback ) + { + PA_ENSURE( PaUtil_StartThreading( &stream->threading, &PaOSS_AudioThreadProc, stream ) ); + sem_wait( &stream->semaphore ); + } + else + PA_ENSURE( PaOssStream_Prepare( stream ) ); + +error: + return result; +} + +static PaError RealStop( PaOssStream *stream, int abort ) +{ + PaError result = paNoError; + + if( stream->callbackMode ) + { + if( abort ) + stream->callbackAbort = 1; + else + stream->callbackStop = 1; + + PA_ENSURE( PaUtil_CancelThreading( &stream->threading, !abort, NULL ) ); + + stream->callbackStop = stream->callbackAbort = 0; + } + else + PA_ENSURE( PaOssStream_Stop( stream, abort ) ); + + stream->isStopped = 1; + +error: + return result; +} + +/** Stop the stream. + * + * Aspect StreamState: This will cause the stream to transition to the Stopped state, playing all enqueued + * buffers. + */ +static PaError StopStream( PaStream *s ) +{ + return RealStop( (PaOssStream *)s, 0 ); +} + +/** Abort the stream. + * + * Aspect StreamState: This will cause the stream to transition to the Stopped state, discarding all enqueued + * buffers. Note that the buffers are not currently correctly discarded, this is difficult without closing + * the OSS device. + */ +static PaError AbortStream( PaStream *s ) +{ + return RealStop( (PaOssStream *)s, 1 ); +} + +/** Is the stream in the Stopped state. + * + */ +static PaError IsStreamStopped( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return (stream->isStopped); +} + +/** Is the stream in the Active state. + * + */ +static PaError IsStreamActive( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return (stream->isActive); +} + +static PaTime GetStreamTime( PaStream *s ) +{ + PaOssStream *stream = (PaOssStream*)s; + count_info info; + int delta; + + if( stream->playback ) { + if( ioctl( stream->playback->fd, SNDCTL_DSP_GETOPTR, &info) == 0 ) { + delta = ( info.bytes - stream->lastPosPtr ) /* & 0x000FFFFF*/; + return (float)(stream->lastStreamBytes + delta) / PaOssStreamComponent_FrameSize( stream->playback ) / stream->sampleRate; + } + } + else { + if (ioctl( stream->capture->fd, SNDCTL_DSP_GETIPTR, &info) == 0) { + delta = (info.bytes - stream->lastPosPtr) /*& 0x000FFFFF*/; + return (float)(stream->lastStreamBytes + delta) / PaOssStreamComponent_FrameSize( stream->capture ) / stream->sampleRate; + } + } + + /* the ioctl failed, but we can still give a coarse estimate */ + + return stream->framesProcessed / stream->sampleRate; +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaOssStream *stream = (PaOssStream*)s; + int bytesRequested, bytesRead; + unsigned long framesRequested; + void *userBuffer; + + /* If user input is non-interleaved, PaUtil_CopyInput will manipulate the channel pointers, + * so we copy the user provided pointers */ + if( stream->bufferProcessor.userInputIsInterleaved ) + userBuffer = buffer; + else /* Copy channels into local array */ + { + userBuffer = stream->capture->userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->capture->userChannelCount ); + } + + while( frames ) + { + framesRequested = PA_MIN( frames, stream->capture->hostFrames ); + + bytesRequested = framesRequested * PaOssStreamComponent_FrameSize( stream->capture ); + bytesRead = read( stream->capture->fd, stream->capture->buffer, bytesRequested ); + if ( bytesRequested != bytesRead ) + return paUnanticipatedHostError; + + PaUtil_SetInputFrameCount( &stream->bufferProcessor, stream->capture->hostFrames ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, 0, stream->capture->buffer, stream->capture->hostChannelCount ); + PaUtil_CopyInput( &stream->bufferProcessor, &userBuffer, framesRequested ); + frames -= framesRequested; + } + return paNoError; +} + + +static PaError WriteStream( PaStream *s, const void *buffer, unsigned long frames ) +{ + PaOssStream *stream = (PaOssStream*)s; + int bytesRequested, bytesWritten; + unsigned long framesConverted; + const void *userBuffer; + + /* If user output is non-interleaved, PaUtil_CopyOutput will manipulate the channel pointers, + * so we copy the user provided pointers */ + if( stream->bufferProcessor.userOutputIsInterleaved ) + userBuffer = buffer; + else + { + /* Copy channels into local array */ + userBuffer = stream->playback->userBuffers; + memcpy( (void *)userBuffer, buffer, sizeof (void *) * stream->playback->userChannelCount ); + } + + while( frames ) + { + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, stream->playback->hostFrames ); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, 0, stream->playback->buffer, stream->playback->hostChannelCount ); + + framesConverted = PaUtil_CopyOutput( &stream->bufferProcessor, &userBuffer, frames ); + frames -= framesConverted; + + bytesRequested = framesConverted * PaOssStreamComponent_FrameSize( stream->playback ); + bytesWritten = write( stream->playback->fd, stream->playback->buffer, bytesRequested ); + + if ( bytesRequested != bytesWritten ) + return paUnanticipatedHostError; + } + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + audio_buf_info info; + + if( ioctl( stream->capture->fd, SNDCTL_DSP_GETISPACE, &info ) < 0 ) + return paUnanticipatedHostError; + return info.fragments * stream->capture->hostFrames; +} + + +/* TODO: Compute number of allocated bytes somewhere else, can we use ODELAY with capture */ +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaOssStream *stream = (PaOssStream*)s; + int delay = 0; + + if( ioctl( stream->playback->fd, SNDCTL_DSP_GETODELAY, &delay ) < 0 ) + return paUnanticipatedHostError; + + return (PaOssStreamComponent_BufferSize( stream->playback ) - delay) / PaOssStreamComponent_FrameSize( stream->playback ); +} + diff --git a/portaudio-v19/src/hostapi/oss/recplay.c b/portaudio-v19/src/hostapi/oss/recplay.c new file mode 100644 index 000000000..9d4c78cfa --- /dev/null +++ b/portaudio-v19/src/hostapi/oss/recplay.c @@ -0,0 +1,114 @@ +/* + * recplay.c + * Phil Burk + * Minimal record and playback test. + * + */ +#include +#include +#include +#ifndef __STDC__ +/* #include */ +#endif /* __STDC__ */ +#include +#ifdef __STDC__ +#include +#else /* __STDC__ */ +#include +#endif /* __STDC__ */ +#include + +#define NUM_BYTES (64*1024) +#define BLOCK_SIZE (4*1024) + +#define AUDIO "/dev/dsp" + +char buffer[NUM_BYTES]; + +int audioDev = 0; + +main (int argc, char *argv[]) +{ + int numLeft; + char *ptr; + int num; + int samplesize; + + /********** RECORD ********************/ + /* Open audio device. */ + audioDev = open (AUDIO, O_RDONLY, 0); + if (audioDev == -1) + { + perror (AUDIO); + exit (-1); + } + + /* Set to 16 bit samples. */ + samplesize = 16; + ioctl(audioDev, SNDCTL_DSP_SAMPLESIZE, &samplesize); + if (samplesize != 16) + { + perror("Unable to set the sample size."); + exit(-1); + } + + /* Record in blocks */ + printf("Begin recording.\n"); + numLeft = NUM_BYTES; + ptr = buffer; + while( numLeft >= BLOCK_SIZE ) + { + if ( (num = read (audioDev, ptr, BLOCK_SIZE)) < 0 ) + { + perror (AUDIO); + exit (-1); + } + else + { + printf("Read %d bytes\n", num); + ptr += num; + numLeft -= num; + } + } + + close( audioDev ); + + /********** PLAYBACK ********************/ + /* Open audio device for writing. */ + audioDev = open (AUDIO, O_WRONLY, 0); + if (audioDev == -1) + { + perror (AUDIO); + exit (-1); + } + + /* Set to 16 bit samples. */ + samplesize = 16; + ioctl(audioDev, SNDCTL_DSP_SAMPLESIZE, &samplesize); + if (samplesize != 16) + { + perror("Unable to set the sample size."); + exit(-1); + } + + /* Play in blocks */ + printf("Begin playing.\n"); + numLeft = NUM_BYTES; + ptr = buffer; + while( numLeft >= BLOCK_SIZE ) + { + if ( (num = write (audioDev, ptr, BLOCK_SIZE)) < 0 ) + { + perror (AUDIO); + exit (-1); + } + else + { + printf("Wrote %d bytes\n", num); + ptr += num; + numLeft -= num; + } + } + + close( audioDev ); +} diff --git a/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.cpp b/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.cpp new file mode 100644 index 000000000..febab3f72 --- /dev/null +++ b/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.cpp @@ -0,0 +1,1770 @@ +/* + * Portable Audio I/O Library WASAPI implementation + * Copyright (c) 2006 David Viens + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief WASAPI implementation of support for a host API. + + @note This file is provided as a starting point for implementing support for + a new host API. IMPLEMENT ME comments are used to indicate functionality + which much be customised for each implementation. +*/ + + + +//these headers are only in Windows SDK CTP Feb 2006 and only work in VC 2005! +#if _MSC_VER >= 1400 +#include +#include //must be before other Wasapi headers +#include +#include +#include +#include +#include +#include // PKEY_Device_FriendlyName +#endif + + + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + + + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + + +/* IMPLEMENT ME: a macro like the following one should be used for reporting + host errors */ +#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \ + PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText ) + +/* PaWinWasapiHostApiRepresentation - host api datastructure specific to this implementation */ + + + +//dummy entry point for other compilers and sdks +//only in Windows SDK CTP Feb 2006 and only work in VC 2005! +#if _MSC_VER < 1400 + +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ){ + return paNoError; +} + +#else + + + + +#define MAX_STR_LEN 512 + +/* + These are fields that can be gathered from IDevice + and IAudioDevice PRIOR to Initialize, and done in first pass + i assume that neither of these will cause the Driver to "load", + but again, who knows how they implement their stuff + */ +typedef struct PaWinWasapiDeviceInfo +{ + //hmm is it wise to keep a reference until Terminate? + //TODO Check if that interface requires the driver to be loaded! + IMMDevice * device; + + //Fields filled from IDevice + //from GetId + WCHAR szDeviceID[MAX_STR_LEN]; + //from GetState + DWORD state; + + //Fields filled from IMMEndpoint'sGetDataFlow + EDataFlow flow; + + //Fields filled from IAudioDevice (_prior_ to Initialize) + //from GetDevicePeriod( + REFERENCE_TIME DefaultDevicePeriod; + REFERENCE_TIME MinimumDevicePeriod; + //from GetMixFormat + WAVEFORMATEX *MixFormat;//needs to be CoTaskMemFree'd after use! + +} PaWinWasapiDeviceInfo; + + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + /* implementation specific data goes here */ + + //in case we later need the synch + IMMDeviceEnumerator * enumerator; + + //this is the REAL number of devices, whether they are usefull to PA or not! + UINT deviceCount; + + WCHAR defaultRenderer [MAX_STR_LEN]; + WCHAR defaultCapturer [MAX_STR_LEN]; + + PaWinWasapiDeviceInfo *devInfo; +}PaWinWasapiHostApiRepresentation; + + +/* PaWinWasapiStream - a stream data structure specifically for this implementation */ + +typedef struct PaWinWasapiSubStream{ + IAudioClient *client; + WAVEFORMATEXTENSIBLE wavex; + UINT32 bufferSize; + REFERENCE_TIME latency; + REFERENCE_TIME period; + unsigned long framesPerHostCallback; /* just an example */ +}PaWinWasapiSubStream; + +typedef struct PaWinWasapiStream +{ /* IMPLEMENT ME: rename this */ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + /* IMPLEMENT ME: + - implementation specific data goes here + */ + + + //input + PaWinWasapiSubStream in; + IAudioCaptureClient *cclient; + + //output + PaWinWasapiSubStream out; + IAudioRenderClient *rclient; + + + bool running; + bool closeRequest; + + DWORD dwThreadId; + HANDLE hThread; + + GUID session; + +}PaWinWasapiStream; + +#define PRINT(x) PA_DEBUG(x); + +void +logAUDCLNT_E(HRESULT res){ + + char *text = 0; + switch(res){ + case S_OK: return; break; + case E_POINTER :text ="E_POINTER"; break; + case E_INVALIDARG :text ="E_INVALIDARG"; break; + case AUDCLNT_E_NOT_INITIALIZED :text ="AUDCLNT_E_NOT_INITIALIZED"; break; + case AUDCLNT_E_ALREADY_INITIALIZED :text ="AUDCLNT_E_ALREADY_INITIALIZED"; break; + case AUDCLNT_E_WRONG_ENDPOINT_TYPE :text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; break; + case AUDCLNT_E_DEVICE_INVALIDATED :text ="AUDCLNT_E_DEVICE_INVALIDATED"; break; + case AUDCLNT_E_NOT_STOPPED :text ="AUDCLNT_E_NOT_STOPPED"; break; + case AUDCLNT_E_BUFFER_TOO_LARGE :text ="AUDCLNT_E_BUFFER_TOO_LARGE"; break; + case AUDCLNT_E_OUT_OF_ORDER :text ="AUDCLNT_E_OUT_OF_ORDER"; break; + case AUDCLNT_E_UNSUPPORTED_FORMAT :text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; break; + case AUDCLNT_E_INVALID_SIZE :text ="AUDCLNT_E_INVALID_SIZE"; break; + case AUDCLNT_E_DEVICE_IN_USE :text ="AUDCLNT_E_DEVICE_IN_USE"; break; + case AUDCLNT_E_BUFFER_OPERATION_PENDING :text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; break; + case AUDCLNT_E_THREAD_NOT_REGISTERED :text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; break; + case AUDCLNT_E_NO_SINGLE_PROCESS :text ="AUDCLNT_E_NO_SINGLE_PROCESS"; break; + case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED :text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; break; + case AUDCLNT_E_ENDPOINT_CREATE_FAILED :text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; break; + default: + text =" dunno!"; + return ; + break; + + } + PRINT(("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text)); +} + +inline double +nano100ToMillis(const REFERENCE_TIME &ref){ + // 1 nano = 0.000000001 seconds + //100 nano = 0.0000001 seconds + //100 nano = 0.0001 milliseconds + return ((double)ref)*0.0001; +} + +inline double +nano100ToSeconds(const REFERENCE_TIME &ref){ + // 1 nano = 0.000000001 seconds + //100 nano = 0.0000001 seconds + //100 nano = 0.0001 milliseconds + return ((double)ref)*0.0000001; +} + +#ifndef IF_FAILED_JUMP +#define IF_FAILED_JUMP(hr, label) if(FAILED(hr)) goto label; +#endif + + + +//AVRT is the new "multimedia schedulling stuff" + +typedef BOOL (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER); +typedef BOOL (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE); +typedef BOOL (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE); +typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics) (LPCTSTR,LPDWORD); +typedef BOOL (WINAPI *FAvSetMmThreadPriority) (HANDLE,AVRT_PRIORITY); + +HMODULE hDInputDLL = 0; +FAvRtCreateThreadOrderingGroup pAvRtCreateThreadOrderingGroup=0; +FAvRtDeleteThreadOrderingGroup pAvRtDeleteThreadOrderingGroup=0; +FAvRtWaitOnThreadOrderingGroup pAvRtWaitOnThreadOrderingGroup=0; +FAvSetMmThreadCharacteristics pAvSetMmThreadCharacteristics=0; +FAvSetMmThreadPriority pAvSetMmThreadPriority=0; + +#define setupPTR(fun, type, name) { \ + fun = (type) GetProcAddress(hDInputDLL,name); \ + if(fun == NULL) { \ + PRINT(("GetProcAddr failed for %s" ,name)); \ + return false; \ + } \ + } \ + +bool +setupAVRT(){ + + hDInputDLL = LoadLibraryA("avrt.dll"); + if(hDInputDLL == NULL) + return false; + + setupPTR(pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup"); + setupPTR(pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup"); + setupPTR(pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup"); + setupPTR(pAvSetMmThreadCharacteristics, FAvSetMmThreadCharacteristics, "AvSetMmThreadCharacteristicsA"); + setupPTR(pAvSetMmThreadPriority, FAvSetMmThreadPriority, "AvSetMmThreadPriority"); + + return true; +} + + + +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + if (!setupAVRT()){ + PRINT(("Windows WASAPI : No AVRT! (not VISTA?)")); + return paNoError; + } + + CoInitialize(NULL); + + PaError result = paNoError; + PaWinWasapiHostApiRepresentation *paWasapi; + PaDeviceInfo *deviceInfoArray; + + paWasapi = (PaWinWasapiHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinWasapiHostApiRepresentation) ); + if( !paWasapi ){ + result = paInsufficientMemory; + goto error; + } + + paWasapi->allocations = PaUtil_CreateAllocationGroup(); + if( !paWasapi->allocations ){ + result = paInsufficientMemory; + goto error; + } + + *hostApi = &paWasapi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paWASAPI; + (*hostApi)->info.name = "Windows WASAPI"; + (*hostApi)->info.deviceCount = 0; //so far, we must investigate each + (*hostApi)->info.defaultInputDevice = paNoDevice; /* IMPLEMENT ME */ + (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */ + + + HRESULT hResult = S_OK; + IMMDeviceCollection* spEndpoints=0; + paWasapi->enumerator = 0; + + if (!setupAVRT()){ + PRINT(("Windows WASAPI : No AVRT! (not VISTA?)")); + goto error; + } + + hResult = CoCreateInstance( + __uuidof(MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER, + __uuidof(IMMDeviceEnumerator), + (void**)&paWasapi->enumerator); + + IF_FAILED_JUMP(hResult, error); + + //getting default device ids in the eMultimedia "role" + { + { + IMMDevice* defaultRenderer=0; + hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &defaultRenderer); + IF_FAILED_JUMP(hResult, error); + WCHAR* pszDeviceId = NULL; + hResult = defaultRenderer->GetId(&pszDeviceId); + IF_FAILED_JUMP(hResult, error); + StringCchCopyW(paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree(pszDeviceId); + defaultRenderer->Release(); + } + + { + IMMDevice* defaultCapturer=0; + hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eCapture, eMultimedia, &defaultCapturer); + IF_FAILED_JUMP(hResult, error); + WCHAR* pszDeviceId = NULL; + hResult = defaultCapturer->GetId(&pszDeviceId); + IF_FAILED_JUMP(hResult, error); + StringCchCopyW(paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree(pszDeviceId); + defaultCapturer->Release(); + } + } + + + hResult = paWasapi->enumerator->EnumAudioEndpoints(eAll, DEVICE_STATE_ACTIVE, &spEndpoints); + IF_FAILED_JUMP(hResult, error); + + hResult = spEndpoints->GetCount(&paWasapi->deviceCount); + IF_FAILED_JUMP(hResult, error); + + paWasapi->devInfo = new PaWinWasapiDeviceInfo[paWasapi->deviceCount]; + { + for (size_t step=0;stepdeviceCount;++step) + memset(&paWasapi->devInfo[step],0,sizeof(PaWinWasapiDeviceInfo)); + } + + + + if( paWasapi->deviceCount > 0 ) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + paWasapi->allocations, sizeof(PaDeviceInfo*) * paWasapi->deviceCount ); + if( !(*hostApi)->deviceInfos ){ + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + paWasapi->allocations, sizeof(PaDeviceInfo) * paWasapi->deviceCount ); + if( !deviceInfoArray ){ + result = paInsufficientMemory; + goto error; + } + + for( UINT i=0; i < paWasapi->deviceCount; ++i ){ + + PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + hResult = spEndpoints->Item(i, &paWasapi->devInfo[i].device); + IF_FAILED_JUMP(hResult, error); + + //getting ID + { + WCHAR* pszDeviceId = NULL; + hResult = paWasapi->devInfo[i].device->GetId(&pszDeviceId); + IF_FAILED_JUMP(hResult, error); + StringCchCopyW(paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree(pszDeviceId); + + if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer)==0){ + //we found the default input! + (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; + } + if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer)==0){ + //we found the default output! + (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount; + } + } + + DWORD state=0; + hResult = paWasapi->devInfo[i].device->GetState(&paWasapi->devInfo[i].state); + IF_FAILED_JUMP(hResult, error); + + if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE){ + PRINT(("WASAPI device:%d is not currently available (state:%d)\n",i,state)); + //spDevice->Release(); + //continue; + } + + { + IPropertyStore* spProperties; + hResult = paWasapi->devInfo[i].device->OpenPropertyStore(STGM_READ, &spProperties); + IF_FAILED_JUMP(hResult, error); + + //getting "Friendly" Name + { + PROPVARIANT value; + PropVariantInit(&value); + hResult = spProperties->GetValue(PKEY_Device_FriendlyName, &value); + IF_FAILED_JUMP(hResult, error); + deviceInfo->name = 0; + char* deviceName = (char*)PaUtil_GroupAllocateMemory( paWasapi->allocations, MAX_STR_LEN + 1 ); + if( !deviceName ){ + result = paInsufficientMemory; + goto error; + } + + wcstombs(deviceName, value.pwszVal,MAX_STR_LEN-1); //todo proper size + + deviceInfo->name = deviceName; + PropVariantClear(&value); + } + +#if 0 + DWORD numProps = 0; + hResult = spProperties->GetCount(&numProps); + IF_FAILED_JUMP(hResult, error); + { + for (DWORD i=0;iGetAt(i,&pkey); + + PROPVARIANT value; + PropVariantInit(&value); + hResult = spProperties->GetValue(pkey, &value); + + switch(value.vt){ + case 11: + PRINT(("property*%u*\n",value.ulVal)); + break; + case 19: + PRINT(("property*%d*\n",value.boolVal)); + break; + case 31: + { + char temp[512]; + wcstombs(temp, value.pwszVal,MAX_STR_LEN-1); + PRINT(("property*%s*\n",temp)); + } + break; + default:break; + } + + PropVariantClear(&value); + } + } +#endif + + /* These look interresting... but they are undocumented + PKEY_AudioEndpoint_FormFactor + PKEY_AudioEndpoint_ControlPanelPageProvider + PKEY_AudioEndpoint_Association + PKEY_AudioEndpoint_PhysicalSpeakerConfig + PKEY_AudioEngine_DeviceFormat + */ + spProperties->Release(); + } + + + //getting the Endpoint data + { + IMMEndpoint *endpoint=0; + hResult = paWasapi->devInfo[i].device->QueryInterface(__uuidof(IMMEndpoint),(void **)&endpoint); + if (SUCCEEDED(hResult)){ + hResult = endpoint->GetDataFlow(&paWasapi->devInfo[i].flow); + endpoint->Release(); + } + } + + //Getting a temporary IAudioDevice for more fields + //we make sure NOT to call Initialize yet! + { + IAudioClient *myClient=0; + + hResult = paWasapi->devInfo[i].device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); + IF_FAILED_JUMP(hResult, error); + + hResult = myClient->GetDevicePeriod( + &paWasapi->devInfo[i].DefaultDevicePeriod, + &paWasapi->devInfo[i].MinimumDevicePeriod); + IF_FAILED_JUMP(hResult, error); + + hResult = myClient->GetMixFormat(&paWasapi->devInfo[i].MixFormat); + + IF_FAILED_JUMP(hResult, error); + myClient->Release(); + } + + //we can now fill in portaudio device data + deviceInfo->maxInputChannels = 0; //for now + deviceInfo->maxOutputChannels = 0; //for now + + switch(paWasapi->devInfo[i].flow){ + case eRender: + //hum not exaclty maximum, more like "default" + deviceInfo->maxOutputChannels = paWasapi->devInfo[i].MixFormat->nChannels; + + deviceInfo->defaultHighOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod); + deviceInfo->defaultLowOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod); + break; + case eCapture: + //hum not exaclty maximum, more like "default" + deviceInfo->maxInputChannels = paWasapi->devInfo[i].MixFormat->nChannels; + + deviceInfo->defaultHighInputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod); + deviceInfo->defaultLowInputLatency = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod); + break; + default: + PRINT(("WASAPI device:%d bad Data FLow! \n",i)); + goto error; + break; + } + + deviceInfo->defaultSampleRate = (double)paWasapi->devInfo[i].MixFormat->nSamplesPerSec; + + (*hostApi)->deviceInfos[i] = deviceInfo; + ++(*hostApi)->info.deviceCount; + } + } + + spEndpoints->Release(); + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &paWasapi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &paWasapi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + + if (spEndpoints) + spEndpoints->Release(); + + if (paWasapi->enumerator) + paWasapi->enumerator->Release(); + + if( paWasapi ) + { + if( paWasapi->allocations ) + { + PaUtil_FreeAllAllocations( paWasapi->allocations ); + PaUtil_DestroyAllocationGroup( paWasapi->allocations ); + } + + PaUtil_FreeMemory( paWasapi ); + } + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; + + paWasapi->enumerator->Release(); + + for (UINT i=0;ideviceCount;++i){ + PaWinWasapiDeviceInfo *info = &paWasapi->devInfo[i]; + + if (info->device) + info->device->Release(); + + if (info->MixFormat) + CoTaskMemFree(info->MixFormat); + } + delete [] paWasapi->devInfo; + + CoUninitialize(); + + if( paWasapi->allocations ){ + PaUtil_FreeAllAllocations( paWasapi->allocations ); + PaUtil_DestroyAllocationGroup( paWasapi->allocations ); + } + + PaUtil_FreeMemory( paWasapi ); +} + +static void +LogWAVEFORMATEXTENSIBLE(const WAVEFORMATEXTENSIBLE &in){ + + const WAVEFORMATEX *old = (WAVEFORMATEX *)∈ + + switch (old->wFormatTag){ + case WAVE_FORMAT_EXTENSIBLE:{ + + PRINT(("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n")); + + if (in.SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){ + PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n")); + } + else if (in.SubFormat == KSDATAFORMAT_SUBTYPE_PCM){ + PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n")); + } + else{ + PRINT(("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n", + in.SubFormat.Data1, + in.SubFormat.Data2, + in.SubFormat.Data3, + (int)in.SubFormat.Data4[0], + (int)in.SubFormat.Data4[1], + (int)in.SubFormat.Data4[2], + (int)in.SubFormat.Data4[3], + (int)in.SubFormat.Data4[4], + (int)in.SubFormat.Data4[5], + (int)in.SubFormat.Data4[6], + (int)in.SubFormat.Data4[7])); + } + PRINT(("Samples.wValidBitsPerSample=%d\n", in.Samples.wValidBitsPerSample)); + PRINT(("dwChannelMask=0x%X\n",in.dwChannelMask)); + }break; + + case WAVE_FORMAT_PCM: PRINT(("wFormatTag=WAVE_FORMAT_PCM\n")); break; + case WAVE_FORMAT_IEEE_FLOAT: PRINT(("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); break; + default : PRINT(("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); break; + } + + PRINT(("nChannels =%d\n",old->nChannels)); + PRINT(("nSamplesPerSec =%d\n",old->nSamplesPerSec)); + PRINT(("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec)); + PRINT(("nBlockAlign =%d\n",old->nBlockAlign)); + PRINT(("wBitsPerSample =%d\n",old->wBitsPerSample)); + PRINT(("cbSize =%d\n",old->cbSize)); +} + + + +/* + WAVEFORMATXXX is always interleaved + */ +static PaSampleFormat +waveformatToPaFormat(const WAVEFORMATEXTENSIBLE &in){ + + const WAVEFORMATEX *old = (WAVEFORMATEX *)∈ + + switch (old->wFormatTag){ + + case WAVE_FORMAT_EXTENSIBLE: + { + if (in.SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){ + if (in.Samples.wValidBitsPerSample == 32) + return paFloat32; + else + return paCustomFormat; + } + else if (in.SubFormat == KSDATAFORMAT_SUBTYPE_PCM){ + switch (old->wBitsPerSample){ + case 32: return paInt32; break; + case 24: return paInt24;break; + case 8: return paUInt8;break; + case 16: return paInt16;break; + default: return paCustomFormat;break; + } + } + else + return paCustomFormat; + } + break; + + case WAVE_FORMAT_IEEE_FLOAT: + return paFloat32; + break; + + case WAVE_FORMAT_PCM: + { + switch (old->wBitsPerSample){ + case 32: return paInt32; break; + case 24: return paInt24;break; + case 8: return paUInt8;break; + case 16: return paInt16;break; + default: return paCustomFormat;break; + } + } + break; + + default: + return paCustomFormat; + break; + } + + return paCustomFormat; +} + + + +static PaError +waveformatFromParams(WAVEFORMATEXTENSIBLE &wav, + const PaStreamParameters * params, + double sampleRate){ + + size_t bytesPerSample = 0; + switch( params->sampleFormat & ~paNonInterleaved ){ + case paFloat32: + case paInt32: bytesPerSample=4;break; + case paInt16: bytesPerSample=2;break; + case paInt24: bytesPerSample=3;break; + case paInt8: + case paUInt8: bytesPerSample=1;break; + case paCustomFormat: + default: return paSampleFormatNotSupported;break; + } + + memset(&wav,0,sizeof(WAVEFORMATEXTENSIBLE)); + + WAVEFORMATEX *old = (WAVEFORMATEX *)&wav; + old->nChannels = (WORD)params->channelCount; + old->nSamplesPerSec = (DWORD)sampleRate; + old->wBitsPerSample = bytesPerSample*8; + old->nAvgBytesPerSec = old->nSamplesPerSec * old->nChannels * bytesPerSample; + old->nBlockAlign = (WORD)(old->nChannels * bytesPerSample); + + //WAVEFORMATEX + if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)){ + old->cbSize = 0; + old->wFormatTag = WAVE_FORMAT_PCM; + } + //WAVEFORMATEXTENSIBLE + else{ + old->wFormatTag = WAVE_FORMAT_EXTENSIBLE; + + old->cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX); + + if ((params->sampleFormat & ~paNonInterleaved) == paFloat32) + wav.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + else + wav.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + + wav.Samples.wValidBitsPerSample = old->wBitsPerSample; //no extra padding! + + switch(params->channelCount){ + case 1: wav.dwChannelMask = SPEAKER_FRONT_CENTER; break; + case 2: wav.dwChannelMask = 0x1 | 0x2; break; + case 4: wav.dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; break; + case 6: wav.dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; break; + case 8: wav.dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; break; + default: wav.dwChannelMask = 0; break; + } + } + + return paNoError; +} + + +enum PaWasapiFormatAnswer {PWFA_OK,PWFA_NO,PWFA_SUGGESTED}; + + +static PaWasapiFormatAnswer +IsFormatSupportedInternal(IAudioClient * myClient, WAVEFORMATEXTENSIBLE &wavex){ + + PaWasapiFormatAnswer answer = PWFA_OK; + + WAVEFORMATEX *closestMatch=0; + HRESULT hResult = myClient->IsFormatSupported( + //AUDCLNT_SHAREMODE_EXCLUSIVE, + AUDCLNT_SHAREMODE_SHARED, + (WAVEFORMATEX*)&wavex,&closestMatch); + + if (hResult == S_OK) + answer = PWFA_OK; + else if (closestMatch){ + WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*)closestMatch; + + if (closestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE) + memcpy(&wavex,closestMatch,sizeof(WAVEFORMATEXTENSIBLE)); + else + memcpy(&wavex,closestMatch,sizeof(WAVEFORMATEX)); + + CoTaskMemFree(closestMatch); + answer = PWFA_SUGGESTED; + + }else if (hResult != S_OK){ + logAUDCLNT_E(hResult); + answer = PWFA_NO; + } + + return answer; +} + + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; + + WAVEFORMATEXTENSIBLE wavex; + waveformatFromParams(wavex,inputParameters,sampleRate); + + IAudioClient *myClient=0; + HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); + if (hResult != S_OK){ + logAUDCLNT_E(hResult); + return paInvalidDevice; + } + + PaWasapiFormatAnswer answer = IsFormatSupportedInternal(myClient,wavex); + myClient->Release(); + + switch (answer){ + case PWFA_OK: break; + case PWFA_NO: return paSampleFormatNotSupported; + case PWFA_SUGGESTED: + { + PRINT(("Suggested format:")); + LogWAVEFORMATEXTENSIBLE(wavex); + if (wavex.Format.nSamplesPerSec == (DWORD)sampleRate){ + //no problem its a format issue only + } + else{ + return paInvalidSampleRate; + } + } + } + + + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support outputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; + + WAVEFORMATEXTENSIBLE wavex; + waveformatFromParams(wavex,outputParameters,sampleRate); + + IAudioClient *myClient=0; + HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); + if (hResult != S_OK){ + logAUDCLNT_E(hResult); + return paInvalidDevice; + } + + PaWasapiFormatAnswer answer = IsFormatSupportedInternal(myClient,wavex); + myClient->Release(); + + switch (answer){ + case PWFA_OK: break; + case PWFA_NO: return paSampleFormatNotSupported; + case PWFA_SUGGESTED: + { + PRINT(("Suggested format:")); + LogWAVEFORMATEXTENSIBLE(wavex); + if (wavex.Format.nSamplesPerSec == (DWORD)sampleRate){ + //no problem its a format issue only + } + else{ + return paInvalidSampleRate; + } + } + } + + + } + else + { + outputChannelCount = 0; + } + + + return paFormatIsSupported; +} + + + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; + PaWinWasapiStream *stream = 0; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + + + stream = (PaWinWasapiStream*)PaUtil_AllocateMemory( sizeof(PaWinWasapiStream) ); + if( !stream ){ + result = paInsufficientMemory; + goto error; + } + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + + PaWinWasapiDeviceInfo &info = paWasapi->devInfo[inputParameters->device]; + + HRESULT hResult = info.device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->in.client); + + if (hResult != S_OK) + return paInvalidDevice; + + waveformatFromParams(stream->in.wavex,outputParameters,sampleRate); + + PaWasapiFormatAnswer answer = IsFormatSupportedInternal(stream->in.client, + stream->in.wavex); + + switch (answer){ + case PWFA_OK: break; + case PWFA_NO: return paSampleFormatNotSupported; + case PWFA_SUGGESTED: + { + PRINT(("Suggested format:")); + LogWAVEFORMATEXTENSIBLE(stream->in.wavex); + if (stream->in.wavex.Format.nSamplesPerSec == (DWORD)sampleRate){ + //no problem its a format issue only + } + else{ + return paInvalidSampleRate; + } + } + } + + //stream->out.period = info.DefaultDevicePeriod; + stream->in.period = info.MinimumDevicePeriod; + + hResult = stream->in.client->Initialize( + AUDCLNT_SHAREMODE_SHARED, + //AUDCLNT_SHAREMODE_EXCLUSIVE, + 0, //no flags + stream->in.period*3, //tripple buffer + 0,//stream->out.period, + (WAVEFORMATEX*)&stream->in.wavex, + &stream->session + ); + + if (hResult != S_OK){ + logAUDCLNT_E(hResult); + return paInvalidDevice; + } + + hResult = stream->in.client->GetBufferSize(&stream->in.bufferSize); + if (hResult != S_OK) + return paInvalidDevice; + + hResult = stream->in.client->GetStreamLatency(&stream->in.latency); + if (hResult != S_OK) + return paInvalidDevice; + + double periodsPerSecond = 1.0/nano100ToSeconds(stream->in.period); + double samplesPerPeriod = (double)(stream->in.wavex.Format.nSamplesPerSec)/periodsPerSecond; + + //this is the number of samples that are required at each period + stream->in.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels + + /* IMPLEMENT ME - establish which host formats are available */ + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(stream->in.wavex), inputSampleFormat ); + } + else + { + inputChannelCount = 0; + inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support inputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + + PaWinWasapiDeviceInfo &info = paWasapi->devInfo[outputParameters->device]; + + HRESULT hResult = info.device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->out.client); + + if (hResult != S_OK) + return paInvalidDevice; + + waveformatFromParams(stream->out.wavex,outputParameters,sampleRate); + + PaWasapiFormatAnswer answer = IsFormatSupportedInternal(stream->out.client, + stream->out.wavex); + + switch (answer){ + case PWFA_OK: break; + case PWFA_NO: return paSampleFormatNotSupported; + case PWFA_SUGGESTED: + { + PRINT(("Suggested format:")); + LogWAVEFORMATEXTENSIBLE(stream->out.wavex); + if (stream->out.wavex.Format.nSamplesPerSec == (DWORD)sampleRate){ + //no problem its a format issue only + } + else{ + return paInvalidSampleRate; + } + } + } + + //stream->out.period = info.DefaultDevicePeriod; + stream->out.period = info.MinimumDevicePeriod; + + hResult = stream->out.client->Initialize( + AUDCLNT_SHAREMODE_SHARED, + //AUDCLNT_SHAREMODE_EXCLUSIVE, + 0, //no flags + stream->out.period*3, //tripple buffer + 0,//stream->out.period, + (WAVEFORMATEX*)&stream->out.wavex, + &stream->session + ); + + if (hResult != S_OK){ + logAUDCLNT_E(hResult); + return paInvalidDevice; + } + + hResult = stream->out.client->GetBufferSize(&stream->out.bufferSize); + if (hResult != S_OK) + return paInvalidDevice; + + hResult = stream->out.client->GetStreamLatency(&stream->out.latency); + if (hResult != S_OK) + return paInvalidDevice; + + double periodsPerSecond = 1.0/nano100ToSeconds(stream->out.period); + double samplesPerPeriod = (double)(stream->out.wavex.Format.nSamplesPerSec)/periodsPerSecond; + + //this is the number of samples that are required at each period + stream->out.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels + + /* IMPLEMENT ME - establish which host formats are available */ + hostOutputSampleFormat = + PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(stream->out.wavex), outputSampleFormat ); + } + else + { + outputChannelCount = 0; + outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ + } + + + + /* + IMPLEMENT ME: + + ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? ) + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + - alter sampleRate to a close allowable rate if possible / necessary + + - validate suggestedInputLatency and suggestedOutputLatency parameters, + use default values where necessary + */ + + + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + + + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &paWasapi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &paWasapi->blockingStreamInterface, streamCallback, userData ); + } + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + if (outputParameters && inputParameters){ + + //serious problem #1 + if (stream->in.period != stream->out.period){ + PRINT(("OpenStream: period discrepancy\n")); + goto error; + } + + //serious problem #2 + if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback){ + PRINT(("OpenStream: framesPerHostCallback discrepancy\n")); + goto error; + } + } + + unsigned long framesPerHostCallback = (outputParameters)? + stream->out.framesPerHostCallback: + stream->in.framesPerHostCallback; + + /* we assume a fixed host buffer size in this example, but the buffer processor + can also support bounded and unknown host buffer sizes by passing + paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of + paUtilFixedHostBufferSize below. */ + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerHostCallback, paUtilFixedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ) + goto error; + + + /* + IMPLEMENT ME: initialise the following fields with estimated or actual + values. + */ + stream->streamRepresentation.streamInfo.inputLatency = + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) + + ((inputParameters)?nano100ToSeconds(stream->in.latency) :0); + + stream->streamRepresentation.streamInfo.outputLatency = + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) + + ((outputParameters)?nano100ToSeconds(stream->out.latency) :0); + + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + + *s = (PaStream*)stream; + + + return result; + +error: + if( stream ) + PaUtil_FreeMemory( stream ); + + return result; +} + + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ + +#define SAFE_RELEASE(punk) \ + if ((punk) != NULL) \ + { (punk)->Release(); (punk) = NULL; } + +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + /* + IMPLEMENT ME: + - additional stream closing + cleanup + */ + + SAFE_RELEASE(stream->out.client); + SAFE_RELEASE(stream->in.client); + SAFE_RELEASE(stream->cclient); + SAFE_RELEASE(stream->rclient); + CloseHandle(stream->hThread); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); + + return result; +} + +VOID ProcThread(void *client); + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + HRESULT hResult=S_OK; + + if (stream->out.client){ + hResult = stream->out.client->GetService(__uuidof(IAudioRenderClient),(void**)&stream->rclient); + logAUDCLNT_E(hResult); + if (hResult!=S_OK) + return paUnanticipatedHostError; + } + + if (stream->in.client){ + hResult = stream->in.client->GetService(__uuidof(IAudioCaptureClient),(void**)&stream->cclient); + logAUDCLNT_E(hResult); + if (hResult!=S_OK) + return paUnanticipatedHostError; + } + + // Create a thread for this client. + stream->hThread = CreateThread( + NULL, // no security attribute + 0, // default stack size + (LPTHREAD_START_ROUTINE) ProcThread, + (LPVOID) stream, // thread parameter + 0, // not suspended + &stream->dwThreadId); // returns thread ID + + if (stream->hThread == NULL) + return paUnanticipatedHostError; + + return paNoError; +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + /* suppress unused variable warnings */ + stream->closeRequest = true; + //todo something MUCH better than this + while(stream->closeRequest) + Sleep(100); + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + stream->running = false; + + return result; +} + + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + /* suppress unused variable warnings */ + stream->closeRequest = true; + //todo something MUCH better than this + while(stream->closeRequest) + Sleep(100); + + /* IMPLEMENT ME, see portaudio.h for required behavior */ + + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + return !stream->running; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + return stream->running; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + //this is lame ds and mme does the same thing, quite useless method imho + //why dont we fetch the time in the pa callbacks? + //at least its doing to be clocked to something + return PaUtil_GetTime(); +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + + return 0; +} + + + +/* + ExampleHostProcessingLoop() illustrates the kind of processing which may + occur in a host implementation. + +*/ +static void WaspiHostProcessingLoop( void *inputBuffer, long inputFrames, + void *outputBuffer, long outputFrames, + void *userData ) +{ + PaWinWasapiStream *stream = (PaWinWasapiStream*)userData; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */ + int callbackResult; + unsigned long framesProcessed; + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + + /* + IMPLEMENT ME: + - generate timing information + - handle buffer slips + */ + + /* + If you need to byte swap or shift inputBuffer to convert it into a + portaudio format, do it here. + */ + + + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ ); + + /* + depending on whether the host buffers are interleaved, non-interleaved + or a mixture, you will want to call PaUtil_SetInterleaved*Channels(), + PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here. + */ + + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + PaUtil_SetInputFrameCount( &stream->bufferProcessor, inputFrames ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, + 0, /* first channel of inputBuffer is channel 0 */ + inputBuffer, + 0 ); /* 0 - use inputChannelCount passed to init buffer processor */ + } + + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, outputFrames); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, + 0, /* first channel of outputBuffer is channel 0 */ + outputBuffer, + 0 ); /* 0 - use outputChannelCount passed to init buffer processor */ + } + + /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing() + in general you would pass paContinue for normal operation, and + paComplete to drain the buffer processor's internal output buffer. + You can check whether the buffer processor's output buffer is empty + using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor ) + */ + callbackResult = paContinue; + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + + + /* + If you need to byte swap or shift outputBuffer to convert it to + host format, do it here. + */ + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + + if( callbackResult == paContinue ) + { + /* nothing special to do */ + } + else if( callbackResult == paAbort ) + { + /* IMPLEMENT ME - finish playback immediately */ + + /* once finished, call the finished callback */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + else + { + /* User callback has asked us to stop with paComplete or other non-zero value */ + + /* IMPLEMENT ME - finish playback once currently queued audio has completed */ + + /* once finished, call the finished callback */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } +} + + + +VOID +ProcThread(void *param){ + + HRESULT hResult; + + DWORD stuff=0; + HANDLE thCarac = pAvSetMmThreadCharacteristics("Pro Audio",&stuff); + if (!thCarac){ + PRINT(("AvSetMmThreadCharacteristics failed!\n")); + } + + BOOL prio = pAvSetMmThreadPriority(thCarac,AVRT_PRIORITY_NORMAL); + if (!prio){ + PRINT(("AvSetMmThreadPriority failed!\n")); + } + + + PaWinWasapiStream *stream = (PaWinWasapiStream*)param; + + HANDLE context; + GUID threadOrderGUID; + memset(&threadOrderGUID,0,sizeof(GUID)); + LARGE_INTEGER large; + + large.QuadPart = stream->out.period; + + BOOL ok = pAvRtCreateThreadOrderingGroup(&context, + &large, + &threadOrderGUID, +#ifdef _DEBUG + 0 //THREAD_ORDER_GROUP_INFINITE_TIMEOUT +#else + 0 //default is 5 times the 2nd param +#endif + //TEXT("Audio") + ); + + if (!ok){ + PRINT(("AvRtCreateThreadOrderingGroup failed!\n")); + } + + //debug + { + HANDLE hh = GetCurrentThread(); + int currprio = GetThreadPriority(hh); + DWORD currclass = GetPriorityClass(GetCurrentProcess()); + PRINT(("currprio 0x%X currclass 0x%X\n",currprio,currclass)); + } + + + //fill up initial buffer latency?? + + if (stream->out.client){ + hResult = stream->out.client->Start(); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + } + + stream->running = true; + + while(!stream->closeRequest){ + BOOL answer = pAvRtWaitOnThreadOrderingGroup(context); + if (!answer){ + PRINT(("AvRtWaitOnThreadOrderingGroup failed\n")); + } + + unsigned long usingBS = stream->out.framesPerHostCallback; + + UINT32 padding=0; + hResult = stream->out.client->GetCurrentPadding(&padding); + logAUDCLNT_E(hResult); + + //buffer full dont pursue + if (padding == stream->out.bufferSize) + continue; + + //if something is already inside + if (padding > 0){ + usingBS = stream->out.bufferSize-padding; + if (usingBS > stream->out.framesPerHostCallback){ + //PRINT(("underflow! %d\n",usingBS)); + } + else if (usingBS < stream->out.framesPerHostCallback){ + //PRINT(("overflow! %d\n",usingBS)); + } + } + else + usingBS = stream->out.framesPerHostCallback; + + + BYTE*indata =0; + BYTE*outdata=0; + + hResult = stream->rclient->GetBuffer(usingBS,&outdata); + + if (hResult != S_OK || !outdata) { + logAUDCLNT_E(hResult); + continue; + } + + WaspiHostProcessingLoop(indata, usingBS + ,outdata,usingBS,stream); + + hResult = stream->rclient->ReleaseBuffer(usingBS,0); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + + } + + + BOOL bRes = pAvRtDeleteThreadOrderingGroup(context); + if (!bRes){ + PRINT(("AvRtDeleteThreadOrderingGroup failure\n")); + } + + stream->closeRequest = false; +} + + + + +#endif //VC 2005 \ No newline at end of file diff --git a/portaudio-v19/src/hostapi/wdmks/pa_win_wdmks.c b/portaudio-v19/src/hostapi/wdmks/pa_win_wdmks.c new file mode 100644 index 000000000..34d0ee6e6 --- /dev/null +++ b/portaudio-v19/src/hostapi/wdmks/pa_win_wdmks.c @@ -0,0 +1,3269 @@ +/* + * $Id$ + * PortAudio Windows WDM-KS interface + * + * Author: Andrew Baldwin + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2004 Andrew Baldwin, Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + @brief Portaudio WDM-KS host API. + + @note This is the implementation of the Portaudio host API using the + Windows WDM/Kernel Streaming API in order to enable very low latency + playback and recording on all modern Windows platforms (e.g. 2K, XP) + Note: This API accesses the device drivers below the usual KMIXER + component which is normally used to enable multi-client mixing and + format conversion. That means that it will lock out all other users + of a device for the duration of active stream using those devices +*/ + +#include + +/* Debugging/tracing support */ + +#define PA_LOGE_ +#define PA_LOGL_ + +#ifdef __GNUC__ + #include + #define _WIN32_WINNT 0x0501 + #define WINVER 0x0501 +#endif + +#include /* strlen() */ +#include + +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" +#include "portaudio.h" + +#include +#include + + +#ifdef __GNUC__ + #undef PA_LOGE_ + #define PA_LOGE_ PA_DEBUG(("%s {\n",__FUNCTION__)) + #undef PA_LOGL_ + #define PA_LOGL_ PA_DEBUG(("} %s\n",__FUNCTION__)) + /* These defines are set in order to allow the WIndows DirectX + * headers to compile with a GCC compiler such as MinGW + * NOTE: The headers may generate a few warning in GCC, but + * they should compile */ + #define _INC_MMSYSTEM + #define _INC_MMREG + #define _NTRTL_ /* Turn off default definition of DEFINE_GUIDEX */ + #define DEFINE_GUID_THUNK(name,guid) DEFINE_GUID(name,guid) + #define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK( n, STATIC_##n ) + #if !defined( DEFINE_WAVEFORMATEX_GUID ) + #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 + #endif + #define WAVE_FORMAT_ADPCM 0x0002 + #define WAVE_FORMAT_IEEE_FLOAT 0x0003 + #define WAVE_FORMAT_ALAW 0x0006 + #define WAVE_FORMAT_MULAW 0x0007 + #define WAVE_FORMAT_MPEG 0x0050 + #define WAVE_FORMAT_DRM 0x0009 + #define DYNAMIC_GUID_THUNK(l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + #define DYNAMIC_GUID(data) DYNAMIC_GUID_THUNK(data) +#endif + +#ifdef _MSC_VER + #define DYNAMIC_GUID(data) {data} + #define _INC_MMREG + #define _NTRTL_ /* Turn off default definition of DEFINE_GUIDEX */ + #undef DEFINE_GUID + #define DEFINE_GUID(n,data) EXTERN_C const GUID n = {data} + #define DEFINE_GUID_THUNK(n,data) DEFINE_GUID(n,data) + #define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK(n, STATIC_##n) + #if !defined( DEFINE_WAVEFORMATEX_GUID ) + #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 + #endif + #define WAVE_FORMAT_ADPCM 0x0002 + #define WAVE_FORMAT_IEEE_FLOAT 0x0003 + #define WAVE_FORMAT_ALAW 0x0006 + #define WAVE_FORMAT_MULAW 0x0007 + #define WAVE_FORMAT_MPEG 0x0050 + #define WAVE_FORMAT_DRM 0x0009 +#endif + +#include +#include +#include +#include +#include + +/* These next definitions allow the use of the KSUSER DLL */ +typedef KSDDKAPI DWORD WINAPI KSCREATEPIN(HANDLE, PKSPIN_CONNECT, ACCESS_MASK, PHANDLE); +extern HMODULE DllKsUser; +extern KSCREATEPIN* FunctionKsCreatePin; + +/* Forward definition to break circular type reference between pin and filter */ +struct __PaWinWdmFilter; +typedef struct __PaWinWdmFilter PaWinWdmFilter; + +/* The Pin structure + * A pin is an input or output node, e.g. for audio flow */ +typedef struct __PaWinWdmPin +{ + HANDLE handle; + PaWinWdmFilter* parentFilter; + unsigned long pinId; + KSPIN_CONNECT* pinConnect; + unsigned long pinConnectSize; + KSDATAFORMAT_WAVEFORMATEX* ksDataFormatWfx; + KSPIN_COMMUNICATION communication; + KSDATARANGE* dataRanges; + KSMULTIPLE_ITEM* dataRangesItem; + KSPIN_DATAFLOW dataFlow; + KSPIN_CINSTANCES instances; + unsigned long frameSize; + int maxChannels; + unsigned long formats; + int bestSampleRate; +} +PaWinWdmPin; + +/* The Filter structure + * A filter has a number of pins and a "friendly name" */ +struct __PaWinWdmFilter +{ + HANDLE handle; + int pinCount; + PaWinWdmPin** pins; + TCHAR filterName[MAX_PATH]; + TCHAR friendlyName[MAX_PATH]; + int maxInputChannels; + int maxOutputChannels; + unsigned long formats; + int usageCount; + int bestSampleRate; +}; + +/* PaWinWdmHostApiRepresentation - host api datastructure specific to this implementation */ +typedef struct __PaWinWdmHostApiRepresentation +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup* allocations; + PaWinWdmFilter** filters; + int filterCount; +} +PaWinWdmHostApiRepresentation; + +typedef struct __PaWinWdmDeviceInfo +{ + PaDeviceInfo inheritedDeviceInfo; + PaWinWdmFilter* filter; +} +PaWinWdmDeviceInfo; + +typedef struct __DATAPACKET +{ + KSSTREAM_HEADER Header; + OVERLAPPED Signal; +} DATAPACKET; + +/* PaWinWdmStream - a stream data structure specifically for this implementation */ +typedef struct __PaWinWdmStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + PaWinWdmPin* recordingPin; + PaWinWdmPin* playbackPin; + char* hostBuffer; + unsigned long framesPerHostIBuffer; + unsigned long framesPerHostOBuffer; + int bytesPerInputFrame; + int bytesPerOutputFrame; + int streamStarted; + int streamActive; + int streamStop; + int streamAbort; + int oldProcessPriority; + HANDLE streamThread; + HANDLE events[5]; /* 2 play + 2 record packets + abort events */ + DATAPACKET packets[4]; /* 2 play + 2 record */ + PaStreamFlags streamFlags; + /* These values handle the case where the user wants to use fewer + * channels than the device has */ + int userInputChannels; + int deviceInputChannels; + int userOutputChannels; + int deviceOutputChannels; + int inputSampleSize; + int outputSampleSize; +} +PaWinWdmStream; + +#include + +HMODULE DllKsUser = NULL; +KSCREATEPIN* FunctionKsCreatePin = NULL; + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaWinWdm_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/* Low level I/O functions */ +static PaError WdmSyncIoctl(HANDLE handle, + unsigned long ioctlNumber, + void* inBuffer, + unsigned long inBufferCount, + void* outBuffer, + unsigned long outBufferCount, + unsigned long* bytesReturned); +static PaError WdmGetPropertySimple(HANDLE handle, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount, + void* instance, + unsigned long instanceCount); +static PaError WdmSetPropertySimple(HANDLE handle, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount, + void* instance, + unsigned long instanceCount); +static PaError WdmGetPinPropertySimple(HANDLE handle, + unsigned long pinId, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount); +static PaError WdmGetPinPropertyMulti(HANDLE handle, + unsigned long pinId, + const GUID* const guidPropertySet, + unsigned long property, + KSMULTIPLE_ITEM** ksMultipleItem); + +/** Pin management functions */ +static PaWinWdmPin* PinNew(PaWinWdmFilter* parentFilter, unsigned long pinId, PaError* error); +static void PinFree(PaWinWdmPin* pin); +static void PinClose(PaWinWdmPin* pin); +static PaError PinInstantiate(PaWinWdmPin* pin); +/*static PaError PinGetState(PaWinWdmPin* pin, KSSTATE* state); NOT USED */ +static PaError PinSetState(PaWinWdmPin* pin, KSSTATE state); +static PaError PinSetFormat(PaWinWdmPin* pin, const WAVEFORMATEX* format); +static PaError PinIsFormatSupported(PaWinWdmPin* pin, const WAVEFORMATEX* format); + +/* Filter management functions */ +static PaWinWdmFilter* FilterNew( + TCHAR* filterName, + TCHAR* friendlyName, + PaError* error); +static void FilterFree(PaWinWdmFilter* filter); +static PaWinWdmPin* FilterCreateRenderPin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error); +static PaWinWdmPin* FilterFindViableRenderPin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error); +static PaError FilterCanCreateRenderPin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex); +static PaWinWdmPin* FilterCreateCapturePin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error); +static PaWinWdmPin* FilterFindViableCapturePin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error); +static PaError FilterCanCreateCapturePin( + PaWinWdmFilter* filter, + const WAVEFORMATEX* pwfx); +static PaError FilterUse( + PaWinWdmFilter* filter); +static void FilterRelease( + PaWinWdmFilter* filter); + +/* Interface functions */ +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( + struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError OpenStream( + struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( + PaStream* stream, + void *buffer, + unsigned long frames ); +static PaError WriteStream( + PaStream* stream, + const void *buffer, + unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + +/* Utility functions */ +static unsigned long GetWfexSize(const WAVEFORMATEX* wfex); +static PaError BuildFilterList(PaWinWdmHostApiRepresentation* wdmHostApi); +static BOOL PinWrite(HANDLE h, DATAPACKET* p); +static BOOL PinRead(HANDLE h, DATAPACKET* p); +static void DuplicateFirstChannelInt16(void* buffer, int channels, int samples); +static void DuplicateFirstChannelInt24(void* buffer, int channels, int samples); +static DWORD WINAPI ProcessingThread(LPVOID pParam); + +/* Function bodies */ + +static unsigned long GetWfexSize(const WAVEFORMATEX* wfex) +{ + if( wfex->wFormatTag == WAVE_FORMAT_PCM ) + { + return sizeof( WAVEFORMATEX ); + } + else + { + return (sizeof( WAVEFORMATEX ) + wfex->cbSize); + } +} + +/* +Low level pin/filter access functions +*/ +static PaError WdmSyncIoctl( + HANDLE handle, + unsigned long ioctlNumber, + void* inBuffer, + unsigned long inBufferCount, + void* outBuffer, + unsigned long outBufferCount, + unsigned long* bytesReturned) +{ + PaError result = paNoError; + OVERLAPPED overlapped; + int boolResult; + unsigned long dummyBytesReturned; + unsigned long error; + + if( !bytesReturned ) + { + /* User a dummy as the caller hasn't supplied one */ + bytesReturned = &dummyBytesReturned; + } + + FillMemory((void *)&overlapped,sizeof(overlapped),0); + overlapped.hEvent = CreateEvent(NULL,FALSE,FALSE,NULL); + if( !overlapped.hEvent ) + { + result = paInsufficientMemory; + goto error; + } + overlapped.hEvent = (HANDLE)((DWORD_PTR)overlapped.hEvent | 0x1); + + boolResult = DeviceIoControl(handle, ioctlNumber, inBuffer, inBufferCount, + outBuffer, outBufferCount, bytesReturned, &overlapped); + if( !boolResult ) + { + error = GetLastError(); + if( error == ERROR_IO_PENDING ) + { + error = WaitForSingleObject(overlapped.hEvent,INFINITE); + if( error != WAIT_OBJECT_0 ) + { + result = paUnanticipatedHostError; + goto error; + } + } + else if((( error == ERROR_INSUFFICIENT_BUFFER ) || + ( error == ERROR_MORE_DATA )) && + ( ioctlNumber == IOCTL_KS_PROPERTY ) && + ( outBufferCount == 0 )) + { + boolResult = TRUE; + } + else + { + result = paUnanticipatedHostError; + } + } + if( !boolResult ) + *bytesReturned = 0; + +error: + if( overlapped.hEvent ) + { + CloseHandle( overlapped.hEvent ); + } + return result; +} + +static PaError WdmGetPropertySimple(HANDLE handle, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount, + void* instance, + unsigned long instanceCount) +{ + PaError result; + KSPROPERTY* ksProperty; + unsigned long propertyCount; + + propertyCount = sizeof(KSPROPERTY) + instanceCount; + ksProperty = (KSPROPERTY*)PaUtil_AllocateMemory( propertyCount ); + if( !ksProperty ) + { + return paInsufficientMemory; + } + + FillMemory((void*)ksProperty,sizeof(ksProperty),0); + ksProperty->Set = *guidPropertySet; + ksProperty->Id = property; + ksProperty->Flags = KSPROPERTY_TYPE_GET; + + if( instance ) + { + memcpy( (void*)(((char*)ksProperty)+sizeof(KSPROPERTY)), instance, instanceCount ); + } + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + ksProperty, + propertyCount, + value, + valueCount, + NULL); + + PaUtil_FreeMemory( ksProperty ); + return result; +} + +static PaError WdmSetPropertySimple( + HANDLE handle, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount, + void* instance, + unsigned long instanceCount) +{ + PaError result; + KSPROPERTY* ksProperty; + unsigned long propertyCount = 0; + + propertyCount = sizeof(KSPROPERTY) + instanceCount; + ksProperty = (KSPROPERTY*)PaUtil_AllocateMemory( propertyCount ); + if( !ksProperty ) + { + return paInsufficientMemory; + } + + ksProperty->Set = *guidPropertySet; + ksProperty->Id = property; + ksProperty->Flags = KSPROPERTY_TYPE_SET; + + if( instance ) + { + memcpy((void*)((char*)ksProperty + sizeof(KSPROPERTY)), instance, instanceCount); + } + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + ksProperty, + propertyCount, + value, + valueCount, + NULL); + + PaUtil_FreeMemory( ksProperty ); + return result; +} + +static PaError WdmGetPinPropertySimple( + HANDLE handle, + unsigned long pinId, + const GUID* const guidPropertySet, + unsigned long property, + void* value, + unsigned long valueCount) +{ + PaError result; + + KSP_PIN ksPProp; + ksPProp.Property.Set = *guidPropertySet; + ksPProp.Property.Id = property; + ksPProp.Property.Flags = KSPROPERTY_TYPE_GET; + ksPProp.PinId = pinId; + ksPProp.Reserved = 0; + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + &ksPProp, + sizeof(KSP_PIN), + value, + valueCount, + NULL); + + return result; +} + +static PaError WdmGetPinPropertyMulti( + HANDLE handle, + unsigned long pinId, + const GUID* const guidPropertySet, + unsigned long property, + KSMULTIPLE_ITEM** ksMultipleItem) +{ + PaError result; + unsigned long multipleItemSize = 0; + KSP_PIN ksPProp; + + ksPProp.Property.Set = *guidPropertySet; + ksPProp.Property.Id = property; + ksPProp.Property.Flags = KSPROPERTY_TYPE_GET; + ksPProp.PinId = pinId; + ksPProp.Reserved = 0; + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + &ksPProp.Property, + sizeof(KSP_PIN), + NULL, + 0, + &multipleItemSize); + if( result != paNoError ) + { + return result; + } + + *ksMultipleItem = (KSMULTIPLE_ITEM*)PaUtil_AllocateMemory( multipleItemSize ); + if( !*ksMultipleItem ) + { + return paInsufficientMemory; + } + + result = WdmSyncIoctl( + handle, + IOCTL_KS_PROPERTY, + &ksPProp, + sizeof(KSP_PIN), + (void*)*ksMultipleItem, + multipleItemSize, + NULL); + + if( result != paNoError ) + { + PaUtil_FreeMemory( ksMultipleItem ); + } + + return result; +} + + +/* +Create a new pin object belonging to a filter +The pin object holds all the configuration information about the pin +before it is opened, and then the handle of the pin after is opened +*/ +static PaWinWdmPin* PinNew(PaWinWdmFilter* parentFilter, unsigned long pinId, PaError* error) +{ + PaWinWdmPin* pin; + PaError result; + unsigned long i; + KSMULTIPLE_ITEM* item = NULL; + KSIDENTIFIER* identifier; + KSDATARANGE* dataRange; + + PA_LOGE_; + PA_DEBUG(("Creating pin %d:\n",pinId)); + + /* Allocate the new PIN object */ + pin = (PaWinWdmPin*)PaUtil_AllocateMemory( sizeof(PaWinWdmPin) ); + if( !pin ) + { + result = paInsufficientMemory; + goto error; + } + + /* Zero the pin object */ + /* memset( (void*)pin, 0, sizeof(PaWinWdmPin) ); */ + + pin->parentFilter = parentFilter; + pin->pinId = pinId; + + /* Allocate a connect structure */ + pin->pinConnectSize = sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT_WAVEFORMATEX); + pin->pinConnect = (KSPIN_CONNECT*)PaUtil_AllocateMemory( pin->pinConnectSize ); + if( !pin->pinConnect ) + { + result = paInsufficientMemory; + goto error; + } + + /* Configure the connect structure with default values */ + pin->pinConnect->Interface.Set = KSINTERFACESETID_Standard; + pin->pinConnect->Interface.Id = KSINTERFACE_STANDARD_STREAMING; + pin->pinConnect->Interface.Flags = 0; + pin->pinConnect->Medium.Set = KSMEDIUMSETID_Standard; + pin->pinConnect->Medium.Id = KSMEDIUM_TYPE_ANYINSTANCE; + pin->pinConnect->Medium.Flags = 0; + pin->pinConnect->PinId = pinId; + pin->pinConnect->PinToHandle = NULL; + pin->pinConnect->Priority.PriorityClass = KSPRIORITY_NORMAL; + pin->pinConnect->Priority.PrioritySubClass = 1; + pin->ksDataFormatWfx = (KSDATAFORMAT_WAVEFORMATEX*)(pin->pinConnect + 1); + pin->ksDataFormatWfx->DataFormat.FormatSize = sizeof(KSDATAFORMAT_WAVEFORMATEX); + pin->ksDataFormatWfx->DataFormat.Flags = 0; + pin->ksDataFormatWfx->DataFormat.Reserved = 0; + pin->ksDataFormatWfx->DataFormat.MajorFormat = KSDATAFORMAT_TYPE_AUDIO; + pin->ksDataFormatWfx->DataFormat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + pin->ksDataFormatWfx->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX; + + pin->frameSize = 0; /* Unknown until we instantiate pin */ + + /* Get the COMMUNICATION property */ + result = WdmGetPinPropertySimple( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_COMMUNICATION, + &pin->communication, + sizeof(KSPIN_COMMUNICATION)); + if( result != paNoError ) + goto error; + + if( /*(pin->communication != KSPIN_COMMUNICATION_SOURCE) &&*/ + (pin->communication != KSPIN_COMMUNICATION_SINK) && + (pin->communication != KSPIN_COMMUNICATION_BOTH) ) + { + PA_DEBUG(("Not source/sink\n")); + result = paInvalidDevice; + goto error; + } + + /* Get dataflow information */ + result = WdmGetPinPropertySimple( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_DATAFLOW, + &pin->dataFlow, + sizeof(KSPIN_DATAFLOW)); + + if( result != paNoError ) + goto error; + + /* Get the INTERFACE property list */ + result = WdmGetPinPropertyMulti( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_INTERFACES, + &item); + + if( result != paNoError ) + goto error; + + identifier = (KSIDENTIFIER*)(item+1); + + /* Check that at least one interface is STANDARD_STREAMING */ + result = paUnanticipatedHostError; + for( i = 0; i < item->Count; i++ ) + { + if( !memcmp( (void*)&identifier[i].Set, (void*)&KSINTERFACESETID_Standard, sizeof( GUID ) ) && + ( identifier[i].Id == KSINTERFACE_STANDARD_STREAMING ) ) + { + result = paNoError; + break; + } + } + + if( result != paNoError ) + { + PA_DEBUG(("No standard streaming\n")); + goto error; + } + + /* Don't need interfaces any more */ + PaUtil_FreeMemory( item ); + item = NULL; + + /* Get the MEDIUM properties list */ + result = WdmGetPinPropertyMulti( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_MEDIUMS, + &item); + + if( result != paNoError ) + goto error; + + identifier = (KSIDENTIFIER*)(item+1); /* Not actually necessary... */ + + /* Check that at least one medium is STANDARD_DEVIO */ + result = paUnanticipatedHostError; + for( i = 0; i < item->Count; i++ ) + { + if( !memcmp( (void*)&identifier[i].Set, (void*)&KSMEDIUMSETID_Standard, sizeof( GUID ) ) && + ( identifier[i].Id == KSMEDIUM_STANDARD_DEVIO ) ) + { + result = paNoError; + break; + } + } + + if( result != paNoError ) + { + PA_DEBUG(("No standard devio\n")); + goto error; + } + /* Don't need mediums any more */ + PaUtil_FreeMemory( item ); + item = NULL; + + /* Get DATARANGES */ + result = WdmGetPinPropertyMulti( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_DATARANGES, + &pin->dataRangesItem); + + if( result != paNoError ) + goto error; + + pin->dataRanges = (KSDATARANGE*)(pin->dataRangesItem +1); + + /* Check that at least one datarange supports audio */ + result = paUnanticipatedHostError; + dataRange = pin->dataRanges; + pin->maxChannels = 0; + pin->bestSampleRate = 0; + pin->formats = 0; + for( i = 0; i dataRangesItem->Count; i++) + { + PA_DEBUG(("DR major format %x\n",*(unsigned long*)(&(dataRange->MajorFormat)))); + /* Check that subformat is WAVEFORMATEX, PCM or WILDCARD */ + if( IS_VALID_WAVEFORMATEX_GUID(&dataRange->SubFormat) || + !memcmp((void*)&dataRange->SubFormat, (void*)&KSDATAFORMAT_SUBTYPE_PCM, sizeof ( GUID ) ) || + ( !memcmp((void*)&dataRange->SubFormat, (void*)&KSDATAFORMAT_SUBTYPE_WILDCARD, sizeof ( GUID ) ) && + ( !memcmp((void*)&dataRange->MajorFormat, (void*)&KSDATAFORMAT_TYPE_AUDIO, sizeof ( GUID ) ) ) ) ) + { + result = paNoError; + /* Record the maximum possible channels with this pin */ + PA_DEBUG(("MaxChannel: %d\n",pin->maxChannels)); + if( (int)((KSDATARANGE_AUDIO*)dataRange)->MaximumChannels > pin->maxChannels ) + { + pin->maxChannels = ((KSDATARANGE_AUDIO*)dataRange)->MaximumChannels; + /*PA_DEBUG(("MaxChannel: %d\n",pin->maxChannels));*/ + } + /* Record the formats (bit depths) that are supported */ + if( ((KSDATARANGE_AUDIO*)dataRange)->MinimumBitsPerSample <= 16 ) + { + pin->formats |= paInt16; + PA_DEBUG(("Format 16 bit supported\n")); + } + if( ((KSDATARANGE_AUDIO*)dataRange)->MaximumBitsPerSample >= 24 ) + { + pin->formats |= paInt24; + PA_DEBUG(("Format 24 bit supported\n")); + } + if( ( pin->bestSampleRate != 48000) && + (((KSDATARANGE_AUDIO*)dataRange)->MaximumSampleFrequency >= 48000) && + (((KSDATARANGE_AUDIO*)dataRange)->MinimumSampleFrequency <= 48000) ) + { + pin->bestSampleRate = 48000; + PA_DEBUG(("48kHz supported\n")); + } + else if(( pin->bestSampleRate != 48000) && ( pin->bestSampleRate != 44100 ) && + (((KSDATARANGE_AUDIO*)dataRange)->MaximumSampleFrequency >= 44100) && + (((KSDATARANGE_AUDIO*)dataRange)->MinimumSampleFrequency <= 44100) ) + { + pin->bestSampleRate = 44100; + PA_DEBUG(("44.1kHz supported\n")); + } + else + { + pin->bestSampleRate = ((KSDATARANGE_AUDIO*)dataRange)->MaximumSampleFrequency; + } + } + dataRange = (KSDATARANGE*)( ((char*)dataRange) + dataRange->FormatSize); + } + + if( result != paNoError ) + goto error; + + /* Get instance information */ + result = WdmGetPinPropertySimple( + parentFilter->handle, + pinId, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_CINSTANCES, + &pin->instances, + sizeof(KSPIN_CINSTANCES)); + + if( result != paNoError ) + goto error; + + /* Success */ + *error = paNoError; + PA_DEBUG(("Pin created successfully\n")); + PA_LOGL_; + return pin; + +error: + /* + Error cleanup + */ + PaUtil_FreeMemory( item ); + if( pin ) + { + PaUtil_FreeMemory( pin->pinConnect ); + PaUtil_FreeMemory( pin->dataRangesItem ); + PaUtil_FreeMemory( pin ); + } + *error = result; + PA_LOGL_; + return NULL; +} + +/* +Safely free all resources associated with the pin +*/ +static void PinFree(PaWinWdmPin* pin) +{ + PA_LOGE_; + if( pin ) + { + PinClose(pin); + if( pin->pinConnect ) + { + PaUtil_FreeMemory( pin->pinConnect ); + } + if( pin->dataRangesItem ) + { + PaUtil_FreeMemory( pin->dataRangesItem ); + } + PaUtil_FreeMemory( pin ); + } + PA_LOGL_; +} + +/* +If the pin handle is open, close it +*/ +static void PinClose(PaWinWdmPin* pin) +{ + PA_LOGE_; + if( pin == NULL ) + { + PA_DEBUG(("Closing NULL pin!")); + PA_LOGL_; + return; + } + if( pin->handle != NULL ) + { + PinSetState( pin, KSSTATE_PAUSE ); + PinSetState( pin, KSSTATE_STOP ); + CloseHandle( pin->handle ); + pin->handle = NULL; + FilterRelease(pin->parentFilter); + } + PA_LOGL_; +} + +/* +Set the state of this (instantiated) pin +*/ +static PaError PinSetState(PaWinWdmPin* pin, KSSTATE state) +{ + PaError result; + + PA_LOGE_; + if( pin == NULL ) + return paInternalError; + if( pin->handle == NULL ) + return paInternalError; + + result = WdmSetPropertySimple( + pin->handle, + &KSPROPSETID_Connection, + KSPROPERTY_CONNECTION_STATE, + &state, + sizeof(state), + NULL, + 0); + PA_LOGL_; + return result; +} + +static PaError PinInstantiate(PaWinWdmPin* pin) +{ + PaError result; + unsigned long createResult; + KSALLOCATOR_FRAMING ksaf; + KSALLOCATOR_FRAMING_EX ksafex; + + PA_LOGE_; + + if( pin == NULL ) + return paInternalError; + if(!pin->pinConnect) + return paInternalError; + + FilterUse(pin->parentFilter); + + createResult = FunctionKsCreatePin( + pin->parentFilter->handle, + pin->pinConnect, + GENERIC_WRITE | GENERIC_READ, + &pin->handle + ); + + PA_DEBUG(("Pin create result = %x\n",createResult)); + if( createResult != ERROR_SUCCESS ) + { + FilterRelease(pin->parentFilter); + pin->handle = NULL; + return paInvalidDevice; + } + + result = WdmGetPropertySimple( + pin->handle, + &KSPROPSETID_Connection, + KSPROPERTY_CONNECTION_ALLOCATORFRAMING, + &ksaf, + sizeof(ksaf), + NULL, + 0); + + if( result != paNoError ) + { + result = WdmGetPropertySimple( + pin->handle, + &KSPROPSETID_Connection, + KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX, + &ksafex, + sizeof(ksafex), + NULL, + 0); + if( result == paNoError ) + { + pin->frameSize = ksafex.FramingItem[0].FramingRange.Range.MinFrameSize; + } + } + else + { + pin->frameSize = ksaf.FrameSize; + } + + PA_LOGL_; + + return paNoError; +} + +/* NOT USED +static PaError PinGetState(PaWinWdmPin* pin, KSSTATE* state) +{ + PaError result; + + if( state == NULL ) + return paInternalError; + if( pin == NULL ) + return paInternalError; + if( pin->handle == NULL ) + return paInternalError; + + result = WdmGetPropertySimple( + pin->handle, + KSPROPSETID_Connection, + KSPROPERTY_CONNECTION_STATE, + state, + sizeof(KSSTATE), + NULL, + 0); + + return result; +} +*/ +static PaError PinSetFormat(PaWinWdmPin* pin, const WAVEFORMATEX* format) +{ + unsigned long size; + void* newConnect; + + PA_LOGE_; + + if( pin == NULL ) + return paInternalError; + if( format == NULL ) + return paInternalError; + + size = GetWfexSize(format) + sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT_WAVEFORMATEX) - sizeof(WAVEFORMATEX); + + if( pin->pinConnectSize != size ) + { + newConnect = PaUtil_AllocateMemory( size ); + if( newConnect == NULL ) + return paInsufficientMemory; + memcpy( newConnect, (void*)pin->pinConnect, min(pin->pinConnectSize,size) ); + PaUtil_FreeMemory( pin->pinConnect ); + pin->pinConnect = (KSPIN_CONNECT*)newConnect; + pin->pinConnectSize = size; + pin->ksDataFormatWfx = (KSDATAFORMAT_WAVEFORMATEX*)((KSPIN_CONNECT*)newConnect + 1); + pin->ksDataFormatWfx->DataFormat.FormatSize = size - sizeof(KSPIN_CONNECT); + } + + memcpy( (void*)&(pin->ksDataFormatWfx->WaveFormatEx), format, GetWfexSize(format) ); + pin->ksDataFormatWfx->DataFormat.SampleSize = (unsigned short)(format->nChannels * (format->wBitsPerSample / 8)); + + PA_LOGL_; + + return paNoError; +} + +static PaError PinIsFormatSupported(PaWinWdmPin* pin, const WAVEFORMATEX* format) +{ + KSDATARANGE_AUDIO* dataRange; + unsigned long count; + GUID guid = DYNAMIC_GUID( DEFINE_WAVEFORMATEX_GUID(format->wFormatTag) ); + PaError result = paInvalidDevice; + + PA_LOGE_; + + if( format->wFormatTag == WAVE_FORMAT_EXTENSIBLE ) + { + guid = ((WAVEFORMATEXTENSIBLE*)format)->SubFormat; + } + dataRange = (KSDATARANGE_AUDIO*)pin->dataRanges; + for(count = 0; countdataRangesItem->Count; count++) + { + if(( !memcmp(&(dataRange->DataRange.MajorFormat),&KSDATAFORMAT_TYPE_AUDIO,sizeof(GUID)) ) || + ( !memcmp(&(dataRange->DataRange.MajorFormat),&KSDATAFORMAT_TYPE_WILDCARD,sizeof(GUID)) )) + { + /* This is an audio or wildcard datarange... */ + if(( !memcmp(&(dataRange->DataRange.SubFormat),&KSDATAFORMAT_SUBTYPE_WILDCARD,sizeof(GUID)) ) || + ( !memcmp(&(dataRange->DataRange.SubFormat),&guid,sizeof(GUID)) )) + { + if(( !memcmp(&(dataRange->DataRange.Specifier),&KSDATAFORMAT_SPECIFIER_WILDCARD,sizeof(GUID)) ) || + ( !memcmp(&(dataRange->DataRange.Specifier),&KSDATAFORMAT_SPECIFIER_WAVEFORMATEX,sizeof(GUID) ))) + { + + PA_DEBUG(("Pin:%x, DataRange:%d\n",(void*)pin,count)); + PA_DEBUG(("\tFormatSize:%d, SampleSize:%d\n",dataRange->DataRange.FormatSize,dataRange->DataRange.SampleSize)); + PA_DEBUG(("\tMaxChannels:%d\n",dataRange->MaximumChannels)); + PA_DEBUG(("\tBits:%d-%d\n",dataRange->MinimumBitsPerSample,dataRange->MaximumBitsPerSample)); + PA_DEBUG(("\tSampleRate:%d-%d\n",dataRange->MinimumSampleFrequency,dataRange->MaximumSampleFrequency)); + + if( dataRange->MaximumChannels < format->nChannels ) + { + result = paInvalidChannelCount; + continue; + } + if( dataRange->MinimumBitsPerSample > format->wBitsPerSample ) + { + result = paSampleFormatNotSupported; + continue; + } + if( dataRange->MaximumBitsPerSample < format->wBitsPerSample ) + { + result = paSampleFormatNotSupported; + continue; + } + if( dataRange->MinimumSampleFrequency > format->nSamplesPerSec ) + { + result = paInvalidSampleRate; + continue; + } + if( dataRange->MaximumSampleFrequency < format->nSamplesPerSec ) + { + result = paInvalidSampleRate; + continue; + } + /* Success! */ + PA_LOGL_; + return paNoError; + } + } + } + dataRange = (KSDATARANGE_AUDIO*)( ((char*)dataRange) + dataRange->DataRange.FormatSize); + } + + PA_LOGL_; + + return result; +} + +/** + * Create a new filter object + */ +static PaWinWdmFilter* FilterNew(TCHAR* filterName, TCHAR* friendlyName, PaError* error) +{ + PaWinWdmFilter* filter; + PaError result; + int pinId; + int valid; + + + /* Allocate the new filter object */ + filter = (PaWinWdmFilter*)PaUtil_AllocateMemory( sizeof(PaWinWdmFilter) ); + if( !filter ) + { + result = paInsufficientMemory; + goto error; + } + + /* Zero the filter object - done by AllocateMemory */ + /* memset( (void*)filter, 0, sizeof(PaWinWdmFilter) ); */ + + /* Copy the filter name */ + _tcsncpy(filter->filterName, filterName, MAX_PATH); + + /* Copy the friendly name */ + _tcsncpy(filter->friendlyName, friendlyName, MAX_PATH); + + /* Open the filter handle */ + result = FilterUse(filter); + if( result != paNoError ) + { + goto error; + } + + /* Get pin count */ + result = WdmGetPinPropertySimple + ( + filter->handle, + 0, + &KSPROPSETID_Pin, + KSPROPERTY_PIN_CTYPES, + &filter->pinCount, + sizeof(filter->pinCount) + ); + + if( result != paNoError) + { + goto error; + } + + /* Allocate pointer array to hold the pins */ + filter->pins = (PaWinWdmPin**)PaUtil_AllocateMemory( sizeof(PaWinWdmPin*) * filter->pinCount ); + if( !filter->pins ) + { + result = paInsufficientMemory; + goto error; + } + + /* Create all the pins we can */ + filter->maxInputChannels = 0; + filter->maxOutputChannels = 0; + filter->bestSampleRate = 0; + + valid = 0; + for(pinId = 0; pinId < filter->pinCount; pinId++) + { + /* Create the pin with this Id */ + PaWinWdmPin* newPin; + newPin = PinNew(filter, pinId, &result); + if( result == paInsufficientMemory ) + goto error; + if( newPin != NULL ) + { + filter->pins[pinId] = newPin; + valid = 1; + + /* Get the max output channel count */ + if(( newPin->dataFlow == KSPIN_DATAFLOW_IN ) && + (( newPin->communication == KSPIN_COMMUNICATION_SINK) || + ( newPin->communication == KSPIN_COMMUNICATION_BOTH))) + { + if(newPin->maxChannels > filter->maxOutputChannels) + filter->maxOutputChannels = newPin->maxChannels; + filter->formats |= newPin->formats; + } + /* Get the max input channel count */ + if(( newPin->dataFlow == KSPIN_DATAFLOW_OUT ) && + (( newPin->communication == KSPIN_COMMUNICATION_SINK) || + ( newPin->communication == KSPIN_COMMUNICATION_BOTH))) + { + if(newPin->maxChannels > filter->maxInputChannels) + filter->maxInputChannels = newPin->maxChannels; + filter->formats |= newPin->formats; + } + + if(newPin->bestSampleRate > filter->bestSampleRate) + { + filter->bestSampleRate = newPin->bestSampleRate; + } + } + } + + if(( filter->maxInputChannels == 0) && ( filter->maxOutputChannels == 0)) + { + /* No input or output... not valid */ + valid = 0; + } + + if( !valid ) + { + /* No valid pin was found on this filter so we destroy it */ + result = paDeviceUnavailable; + goto error; + } + + /* Close the filter handle for now + * It will be opened later when needed */ + FilterRelease(filter); + + *error = paNoError; + return filter; + +error: + /* + Error cleanup + */ + if( filter ) + { + for( pinId = 0; pinId < filter->pinCount; pinId++ ) + PinFree(filter->pins[pinId]); + PaUtil_FreeMemory( filter->pins ); + if( filter->handle ) + CloseHandle( filter->handle ); + PaUtil_FreeMemory( filter ); + } + *error = result; + return NULL; +} + +/** + * Free a previously created filter + */ +static void FilterFree(PaWinWdmFilter* filter) +{ + int pinId; + PA_LOGL_; + if( filter ) + { + for( pinId = 0; pinId < filter->pinCount; pinId++ ) + PinFree(filter->pins[pinId]); + PaUtil_FreeMemory( filter->pins ); + if( filter->handle ) + CloseHandle( filter->handle ); + PaUtil_FreeMemory( filter ); + } + PA_LOGE_; +} + +/** + * Reopen the filter handle if necessary so it can be used + **/ +static PaError FilterUse(PaWinWdmFilter* filter) +{ + assert( filter ); + + PA_LOGE_; + if( filter->handle == NULL ) + { + /* Open the filter */ + filter->handle = CreateFile( + filter->filterName, + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + NULL); + + if( filter->handle == NULL ) + { + return paDeviceUnavailable; + } + } + filter->usageCount++; + PA_LOGL_; + return paNoError; +} + +/** + * Release the filter handle if nobody is using it + **/ +static void FilterRelease(PaWinWdmFilter* filter) +{ + assert( filter ); + assert( filter->usageCount > 0 ); + + PA_LOGE_; + filter->usageCount--; + if( filter->usageCount == 0 ) + { + if( filter->handle != NULL ) + { + CloseHandle( filter->handle ); + filter->handle = NULL; + } + } + PA_LOGL_; +} + +/** + * Create a render (playback) Pin using the supplied format + **/ +static PaWinWdmPin* FilterCreateRenderPin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error) +{ + PaError result; + PaWinWdmPin* pin; + + assert( filter ); + + pin = FilterFindViableRenderPin(filter,wfex,&result); + if(!pin) + { + goto error; + } + result = PinSetFormat(pin,wfex); + if( result != paNoError ) + { + goto error; + } + result = PinInstantiate(pin); + if( result != paNoError ) + { + goto error; + } + + *error = paNoError; + return pin; + +error: + *error = result; + return NULL; +} + +/** + * Find a pin that supports the given format + **/ +static PaWinWdmPin* FilterFindViableRenderPin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error) +{ + int pinId; + PaWinWdmPin* pin; + PaError result = paDeviceUnavailable; + *error = paNoError; + + assert( filter ); + + for( pinId = 0; pinIdpinCount; pinId++ ) + { + pin = filter->pins[pinId]; + if( pin != NULL ) + { + if(( pin->dataFlow == KSPIN_DATAFLOW_IN ) && + (( pin->communication == KSPIN_COMMUNICATION_SINK) || + ( pin->communication == KSPIN_COMMUNICATION_BOTH))) + { + result = PinIsFormatSupported( pin, wfex ); + if( result == paNoError ) + { + return pin; + } + } + } + } + + *error = result; + return NULL; +} + +/** + * Check if there is a pin that should playback + * with the supplied format + **/ +static PaError FilterCanCreateRenderPin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex) +{ + PaWinWdmPin* pin; + PaError result; + + assert ( filter ); + + pin = FilterFindViableRenderPin(filter,wfex,&result); + /* result will be paNoError if pin found + * or else an error code indicating what is wrong with the format + **/ + return result; +} + +/** + * Create a capture (record) Pin using the supplied format + **/ +static PaWinWdmPin* FilterCreateCapturePin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error) +{ + PaError result; + PaWinWdmPin* pin; + + assert( filter ); + + pin = FilterFindViableCapturePin(filter,wfex,&result); + if(!pin) + { + goto error; + } + + result = PinSetFormat(pin,wfex); + if( result != paNoError ) + { + goto error; + } + + result = PinInstantiate(pin); + if( result != paNoError ) + { + goto error; + } + + *error = paNoError; + return pin; + +error: + *error = result; + return NULL; +} + +/** + * Find a capture pin that supports the given format + **/ +static PaWinWdmPin* FilterFindViableCapturePin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex, + PaError* error) +{ + int pinId; + PaWinWdmPin* pin; + PaError result = paDeviceUnavailable; + *error = paNoError; + + assert( filter ); + + for( pinId = 0; pinIdpinCount; pinId++ ) + { + pin = filter->pins[pinId]; + if( pin != NULL ) + { + if(( pin->dataFlow == KSPIN_DATAFLOW_OUT ) && + (( pin->communication == KSPIN_COMMUNICATION_SINK) || + ( pin->communication == KSPIN_COMMUNICATION_BOTH))) + { + result = PinIsFormatSupported( pin, wfex ); + if( result == paNoError ) + { + return pin; + } + } + } + } + + *error = result; + return NULL; +} + +/** + * Check if there is a pin that should playback + * with the supplied format + **/ +static PaError FilterCanCreateCapturePin(PaWinWdmFilter* filter, + const WAVEFORMATEX* wfex) +{ + PaWinWdmPin* pin; + PaError result; + + assert ( filter ); + + pin = FilterFindViableCapturePin(filter,wfex,&result); + /* result will be paNoError if pin found + * or else an error code indicating what is wrong with the format + **/ + return result; +} + +/** + * Build the list of available filters + */ +static PaError BuildFilterList(PaWinWdmHostApiRepresentation* wdmHostApi) +{ + PaError result = paNoError; + HDEVINFO handle = NULL; + int device; + int invalidDevices; + int slot; + SP_DEVICE_INTERFACE_DATA interfaceData; + SP_DEVICE_INTERFACE_DATA aliasData; + SP_DEVINFO_DATA devInfoData; + int noError; + const int sizeInterface = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + (MAX_PATH * sizeof(WCHAR)); + unsigned char interfaceDetailsArray[sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + (MAX_PATH * sizeof(WCHAR))]; + SP_DEVICE_INTERFACE_DETAIL_DATA* devInterfaceDetails = (SP_DEVICE_INTERFACE_DETAIL_DATA*)interfaceDetailsArray; + TCHAR friendlyName[MAX_PATH]; + HKEY hkey; + DWORD sizeFriendlyName; + DWORD type; + PaWinWdmFilter* newFilter; + GUID* category = (GUID*)&KSCATEGORY_AUDIO; + GUID* alias_render = (GUID*)&KSCATEGORY_RENDER; + GUID* alias_capture = (GUID*)&KSCATEGORY_CAPTURE; + DWORD hasAlias; + + PA_LOGE_; + + devInterfaceDetails->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); + + /* Open a handle to search for devices (filters) */ + handle = SetupDiGetClassDevs(category,NULL,NULL,DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); + if( handle == NULL ) + { + return paUnanticipatedHostError; + } + PA_DEBUG(("Setup called\n")); + + /* First let's count the number of devices so we can allocate a list */ + invalidDevices = 0; + for( device = 0;;device++ ) + { + interfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + interfaceData.Reserved = 0; + aliasData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + aliasData.Reserved = 0; + noError = SetupDiEnumDeviceInterfaces(handle,NULL,category,device,&interfaceData); + PA_DEBUG(("Enum called\n")); + if( !noError ) + break; /* No more devices */ + + /* Check this one has the render or capture alias */ + hasAlias = 0; + noError = SetupDiGetDeviceInterfaceAlias(handle,&interfaceData,alias_render,&aliasData); + PA_DEBUG(("noError = %d\n",noError)); + if(noError) + { + if(aliasData.Flags && (!(aliasData.Flags & SPINT_REMOVED))) + { + PA_DEBUG(("Device %d has render alias\n",device)); + hasAlias |= 1; /* Has render alias */ + } + else + { + PA_DEBUG(("Device %d has no render alias\n",device)); + } + } + noError = SetupDiGetDeviceInterfaceAlias(handle,&interfaceData,alias_capture,&aliasData); + if(noError) + { + if(aliasData.Flags && (!(aliasData.Flags & SPINT_REMOVED))) + { + PA_DEBUG(("Device %d has capture alias\n",device)); + hasAlias |= 2; /* Has capture alias */ + } + else + { + PA_DEBUG(("Device %d has no capture alias\n",device)); + } + } + if(!hasAlias) + invalidDevices++; /* This was not a valid capture or render audio device */ + + } + /* Remember how many there are */ + wdmHostApi->filterCount = device-invalidDevices; + + PA_DEBUG(("Interfaces found: %d\n",device-invalidDevices)); + + /* Now allocate the list of pointers to devices */ + wdmHostApi->filters = (PaWinWdmFilter**)PaUtil_AllocateMemory( sizeof(PaWinWdmFilter*) * device ); + if( !wdmHostApi->filters ) + { + if(handle != NULL) + SetupDiDestroyDeviceInfoList(handle); + return paInsufficientMemory; + } + + /* Now create filter objects for each interface found */ + slot = 0; + for( device = 0;;device++ ) + { + interfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + interfaceData.Reserved = 0; + aliasData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + aliasData.Reserved = 0; + devInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + devInfoData.Reserved = 0; + + noError = SetupDiEnumDeviceInterfaces(handle,NULL,category,device,&interfaceData); + if( !noError ) + break; /* No more devices */ + + /* Check this one has the render or capture alias */ + hasAlias = 0; + noError = SetupDiGetDeviceInterfaceAlias(handle,&interfaceData,alias_render,&aliasData); + if(noError) + { + if(aliasData.Flags && (!(aliasData.Flags & SPINT_REMOVED))) + { + PA_DEBUG(("Device %d has render alias\n",device)); + hasAlias |= 1; /* Has render alias */ + } + } + noError = SetupDiGetDeviceInterfaceAlias(handle,&interfaceData,alias_capture,&aliasData); + if(noError) + { + if(aliasData.Flags && (!(aliasData.Flags & SPINT_REMOVED))) + { + PA_DEBUG(("Device %d has capture alias\n",device)); + hasAlias |= 2; /* Has capture alias */ + } + } + if(!hasAlias) + continue; /* This was not a valid capture or render audio device */ + + noError = SetupDiGetDeviceInterfaceDetail(handle,&interfaceData,devInterfaceDetails,sizeInterface,NULL,&devInfoData); + if( noError ) + { + /* Try to get the "friendly name" for this interface */ + sizeFriendlyName = sizeof(friendlyName); + /* Fix contributed by Ben Allison + * Removed KEY_SET_VALUE from flags on following call + * as its causes failure when running without admin rights + * and it was not required */ + hkey=SetupDiOpenDeviceInterfaceRegKey(handle,&interfaceData,0,KEY_QUERY_VALUE); + if(hkey!=INVALID_HANDLE_VALUE) + { + noError = RegQueryValueEx(hkey,TEXT("FriendlyName"),0,&type,(BYTE*)friendlyName,&sizeFriendlyName); + if( noError == ERROR_SUCCESS ) + { + PA_DEBUG(("Interface %d, Name: %s\n",device,friendlyName)); + RegCloseKey(hkey); + } + else + { + friendlyName[0] = 0; + } + } + newFilter = FilterNew(devInterfaceDetails->DevicePath,friendlyName,&result); + if( result == paNoError ) + { + PA_DEBUG(("Filter created\n")); + wdmHostApi->filters[slot] = newFilter; + slot++; + } + else + { + PA_DEBUG(("Filter NOT created\n")); + /* As there are now less filters than we initially thought + * we must reduce the count by one */ + wdmHostApi->filterCount--; + } + } + } + + /* Clean up */ + if(handle != NULL) + SetupDiDestroyDeviceInfoList(handle); + + return paNoError; +} + +PaError PaWinWdm_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i, deviceCount; + PaWinWdmHostApiRepresentation *wdmHostApi; + PaWinWdmDeviceInfo *deviceInfoArray; + PaWinWdmFilter* pFilter; + PaWinWdmDeviceInfo *wdmDeviceInfo; + PaDeviceInfo *deviceInfo; + + PA_LOGE_; + + /* + Attempt to load the KSUSER.DLL without which we cannot create pins + We will unload this on termination + */ + if(DllKsUser == NULL) + { + DllKsUser = LoadLibrary(TEXT("ksuser.dll")); + if(DllKsUser == NULL) + goto error; + } + + FunctionKsCreatePin = (KSCREATEPIN*)GetProcAddress(DllKsUser, "KsCreatePin"); + if(FunctionKsCreatePin == NULL) + goto error; + + wdmHostApi = (PaWinWdmHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinWdmHostApiRepresentation) ); + if( !wdmHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + wdmHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !wdmHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + result = BuildFilterList( wdmHostApi ); + if( result != paNoError ) + { + goto error; + } + deviceCount = wdmHostApi->filterCount; + + *hostApi = &wdmHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paWDMKS; + (*hostApi)->info.name = "Windows WDM-KS"; + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + + if( deviceCount > 0 ) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + wdmHostApi->allocations, sizeof(PaWinWdmDeviceInfo*) * deviceCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaWinWdmDeviceInfo*)PaUtil_GroupAllocateMemory( + wdmHostApi->allocations, sizeof(PaWinWdmDeviceInfo) * deviceCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + for( i=0; i < deviceCount; ++i ) + { + wdmDeviceInfo = &deviceInfoArray[i]; + deviceInfo = &wdmDeviceInfo->inheritedDeviceInfo; + pFilter = wdmHostApi->filters[i]; + if( pFilter == NULL ) + continue; + wdmDeviceInfo->filter = pFilter; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + deviceInfo->name = (char*)pFilter->friendlyName; + PA_DEBUG(("Device found name: %s\n",(char*)pFilter->friendlyName)); + deviceInfo->maxInputChannels = pFilter->maxInputChannels; + if(deviceInfo->maxInputChannels > 0) + { + /* Set the default input device to the first device we find with + * more than zero input channels + **/ + if((*hostApi)->info.defaultInputDevice == paNoDevice) + { + (*hostApi)->info.defaultInputDevice = i; + } + } + + deviceInfo->maxOutputChannels = pFilter->maxOutputChannels; + if(deviceInfo->maxOutputChannels > 0) + { + /* Set the default output device to the first device we find with + * more than zero output channels + **/ + if((*hostApi)->info.defaultOutputDevice == paNoDevice) + { + (*hostApi)->info.defaultOutputDevice = i; + } + } + + /* These low values are not very useful because + * a) The lowest latency we end up with can depend on many factors such + * as the device buffer sizes/granularities, sample rate, channels and format + * b) We cannot know the device buffer sizes until we try to open/use it at + * a particular setting + * So: we give 512x48000Hz frames as the default low input latency + **/ + deviceInfo->defaultLowInputLatency = (512.0/48000.0); + deviceInfo->defaultLowOutputLatency = (512.0/48000.0); + deviceInfo->defaultHighInputLatency = (4096.0/48000.0); + deviceInfo->defaultHighOutputLatency = (4096.0/48000.0); + deviceInfo->defaultSampleRate = (double)(pFilter->bestSampleRate); + + (*hostApi)->deviceInfos[i] = deviceInfo; + } + } + + (*hostApi)->info.deviceCount = deviceCount; + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &wdmHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &wdmHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + PA_LOGL_; + return result; + +error: + if( DllKsUser != NULL ) + { + FreeLibrary( DllKsUser ); + DllKsUser = NULL; + } + + if( wdmHostApi ) + { + PaUtil_FreeMemory( wdmHostApi->filters ); + if( wdmHostApi->allocations ) + { + PaUtil_FreeAllAllocations( wdmHostApi->allocations ); + PaUtil_DestroyAllocationGroup( wdmHostApi->allocations ); + } + PaUtil_FreeMemory( wdmHostApi ); + } + PA_LOGL_; + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaWinWdmHostApiRepresentation *wdmHostApi = (PaWinWdmHostApiRepresentation*)hostApi; + int i; + PA_LOGE_; + + if( wdmHostApi->filters ) + { + for( i=0; ifilterCount; i++) + { + if( wdmHostApi->filters[i] != NULL ) + { + FilterFree( wdmHostApi->filters[i] ); + wdmHostApi->filters[i] = NULL; + } + } + } + PaUtil_FreeMemory( wdmHostApi->filters ); + if( wdmHostApi->allocations ) + { + PaUtil_FreeAllAllocations( wdmHostApi->allocations ); + PaUtil_DestroyAllocationGroup( wdmHostApi->allocations ); + } + PaUtil_FreeMemory( wdmHostApi ); + PA_LOGL_; +} + +static void FillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount) +{ + PA_LOGE_; + PA_DEBUG(( "sampleFormat = %lx\n" , sampleFormat )); + PA_DEBUG(( "sampleRate = %f\n" , sampleRate )); + PA_DEBUG(( "chanelCount = %d\n", channelCount )); + + pwfext->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + pwfext->Format.nChannels = channelCount; + pwfext->Format.nSamplesPerSec = (int)sampleRate; + if(channelCount == 1) + pwfext->dwChannelMask = KSAUDIO_SPEAKER_DIRECTOUT; + else + pwfext->dwChannelMask = KSAUDIO_SPEAKER_STEREO; + if(sampleFormat == paFloat32) + { + pwfext->Format.nBlockAlign = channelCount * 4; + pwfext->Format.wBitsPerSample = 32; + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 32; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + } + else if(sampleFormat == paInt32) + { + pwfext->Format.nBlockAlign = channelCount * 4; + pwfext->Format.wBitsPerSample = 32; + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 32; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + } + else if(sampleFormat == paInt24) + { + pwfext->Format.nBlockAlign = channelCount * 3; + pwfext->Format.wBitsPerSample = 24; + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 24; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + } + else if(sampleFormat == paInt16) + { + pwfext->Format.nBlockAlign = channelCount * 2; + pwfext->Format.wBitsPerSample = 16; + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + pwfext->Samples.wValidBitsPerSample = 16; + pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + } + pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign; + + PA_LOGL_; +} + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaWinWdmHostApiRepresentation *wdmHostApi = (PaWinWdmHostApiRepresentation*)hostApi; + PaWinWdmFilter* pFilter; + int result = paFormatIsSupported; + WAVEFORMATEXTENSIBLE wfx; + + PA_LOGE_; + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + /* Check that the input format is supported */ + FillWFEXT(&wfx,paInt16,sampleRate,inputChannelCount); + + pFilter = wdmHostApi->filters[inputParameters->device]; + result = FilterCanCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx); + if( result != paNoError ) + { + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + result = FilterCanCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx); + if( result != paNoError ) + return result; + } + } + else + { + inputChannelCount = 0; + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support outputChannelCount */ + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + /* Check that the output format is supported */ + FillWFEXT(&wfx,paInt16,sampleRate,outputChannelCount); + + pFilter = wdmHostApi->filters[outputParameters->device]; + result = FilterCanCreateRenderPin(pFilter,(const WAVEFORMATEX*)&wfx); + if( result != paNoError ) + { + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + result = FilterCanCreateRenderPin(pFilter,(const WAVEFORMATEX*)&wfx); + if( result != paNoError ) + return result; + } + + } + else + { + outputChannelCount = 0; + } + + /* + IMPLEMENT ME: + + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported if necessary + + - check that the device supports sampleRate + + Because the buffer adapter handles conversion between all standard + sample formats, the following checks are only required if paCustomFormat + is implemented, or under some other unusual conditions. + + - check that input device can support inputSampleFormat, or that + we have the capability to convert from inputSampleFormat to + a native format + + - check that output device can support outputSampleFormat, or that + we have the capability to convert from outputSampleFormat to + a native format + */ + if((inputChannelCount == 0)&&(outputChannelCount == 0)) + result = paSampleFormatNotSupported; /* Not right error */ + + PA_LOGL_; + return result; +} + +/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result = paNoError; + PaWinWdmHostApiRepresentation *wdmHostApi = (PaWinWdmHostApiRepresentation*)hostApi; + PaWinWdmStream *stream = 0; + /* unsigned long framesPerHostBuffer; these may not be equivalent for all implementations */ + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + int userInputChannels,userOutputChannels; + int size; + PaWinWdmFilter* pFilter; + WAVEFORMATEXTENSIBLE wfx; + + PA_LOGE_; + PA_DEBUG(("OpenStream:sampleRate = %f\n",sampleRate)); + PA_DEBUG(("OpenStream:framesPerBuffer = %lu\n",framesPerBuffer)); + + if( inputParameters ) + { + userInputChannels = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that input device can support stream->userInputChannels */ + if( userInputChannels > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) + return paInvalidChannelCount; + + /* validate inputStreamInfo */ + if( inputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + } + else + { + userInputChannels = 0; + inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ + } + + if( outputParameters ) + { + userOutputChannels = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + + /* unless alternate device specification is supported, reject the use of + paUseHostApiSpecificDeviceSpecification */ + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + /* check that output device can support stream->userInputChannels */ + if( userOutputChannels > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) + return paInvalidChannelCount; + + /* validate outputStreamInfo */ + if( outputParameters->hostApiSpecificStreamInfo ) + return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ + + } + else + { + userOutputChannels = 0; + outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ + } + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + stream = (PaWinWdmStream*)PaUtil_AllocateMemory( sizeof(PaWinWdmStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + /* Zero the stream object */ + /* memset((void*)stream,0,sizeof(PaWinWdmStream)); */ + + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &wdmHostApi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &wdmHostApi->blockingStreamInterface, streamCallback, userData ); + } + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + /* Instantiate the input pin if necessary */ + if(userInputChannels > 0) + { + result = paSampleFormatNotSupported; + pFilter = wdmHostApi->filters[inputParameters->device]; + stream->userInputChannels = userInputChannels; + + if(((inputSampleFormat & ~paNonInterleaved) & pFilter->formats) != 0) + { /* inputSampleFormat is supported, so try to use it */ + hostInputSampleFormat = inputSampleFormat; + FillWFEXT(&wfx, hostInputSampleFormat, sampleRate, stream->userInputChannels); + stream->bytesPerInputFrame = wfx.Format.nBlockAlign; + stream->recordingPin = FilterCreateCapturePin(pFilter, (const WAVEFORMATEX*)&wfx, &result); + stream->deviceInputChannels = stream->userInputChannels; + } + + if(result != paNoError) + { /* Search through all PaSampleFormats to find one that works */ + hostInputSampleFormat = paFloat32; + + do { + FillWFEXT(&wfx, hostInputSampleFormat, sampleRate, stream->userInputChannels); + stream->bytesPerInputFrame = wfx.Format.nBlockAlign; + stream->recordingPin = FilterCreateCapturePin(pFilter, (const WAVEFORMATEX*)&wfx, &result); + stream->deviceInputChannels = stream->userInputChannels; + + if(stream->recordingPin == NULL) result = paSampleFormatNotSupported; + if(result != paNoError) hostInputSampleFormat <<= 1; + } + while(result != paNoError && hostInputSampleFormat <= paUInt8); + } + + if(result != paNoError) + { /* None of the PaSampleFormats worked. Set the hostInputSampleFormat to the best fit + * and try a PCM format. + **/ + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat( pFilter->formats, inputSampleFormat ); + + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + stream->recordingPin = FilterCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + if(stream->recordingPin == NULL) result = paSampleFormatNotSupported; + } + + if( result != paNoError ) + { + /* Some or all KS devices can only handle the exact number of channels + * they specify. But PortAudio clients expect to be able to + * at least specify mono I/O on a multi-channel device + * If this is the case, then we will do the channel mapping internally + **/ + if( stream->userInputChannels < pFilter->maxInputChannels ) + { + FillWFEXT(&wfx,hostInputSampleFormat,sampleRate,pFilter->maxInputChannels); + stream->bytesPerInputFrame = wfx.Format.nBlockAlign; + stream->recordingPin = FilterCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + stream->deviceInputChannels = pFilter->maxInputChannels; + + if( result != paNoError ) + { + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + stream->recordingPin = FilterCreateCapturePin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + } + } + } + + if(stream->recordingPin == NULL) + { + goto error; + } + + switch(hostInputSampleFormat) + { + case paInt16: stream->inputSampleSize = 2; break; + case paInt24: stream->inputSampleSize = 3; break; + case paInt32: + case paFloat32: stream->inputSampleSize = 4; break; + } + + stream->recordingPin->frameSize /= stream->bytesPerInputFrame; + PA_DEBUG(("Pin output frames: %d\n",stream->recordingPin->frameSize)); + } + else + { + stream->recordingPin = NULL; + stream->bytesPerInputFrame = 0; + } + + /* Instantiate the output pin if necessary */ + if(userOutputChannels > 0) + { + result = paSampleFormatNotSupported; + pFilter = wdmHostApi->filters[outputParameters->device]; + stream->userOutputChannels = userOutputChannels; + + if(((outputSampleFormat & ~paNonInterleaved) & pFilter->formats) != 0) + { + hostOutputSampleFormat = outputSampleFormat; + FillWFEXT(&wfx,hostOutputSampleFormat,sampleRate,stream->userOutputChannels); + stream->bytesPerOutputFrame = wfx.Format.nBlockAlign; + stream->playbackPin = FilterCreateRenderPin(pFilter,(WAVEFORMATEX*)&wfx,&result); + stream->deviceOutputChannels = stream->userOutputChannels; + } + + if(result != paNoError) + { + hostOutputSampleFormat = paFloat32; + + do { + FillWFEXT(&wfx,hostOutputSampleFormat,sampleRate,stream->userOutputChannels); + stream->bytesPerOutputFrame = wfx.Format.nBlockAlign; + stream->playbackPin = FilterCreateRenderPin(pFilter,(WAVEFORMATEX*)&wfx,&result); + stream->deviceOutputChannels = stream->userOutputChannels; + + if(stream->playbackPin == NULL) result = paSampleFormatNotSupported; + if(result != paNoError) hostOutputSampleFormat <<= 1; + } + while(result != paNoError && hostOutputSampleFormat <= paUInt8); + } + + if(result != paNoError) + { + hostOutputSampleFormat = + PaUtil_SelectClosestAvailableFormat( pFilter->formats, outputSampleFormat ); + + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + stream->playbackPin = FilterCreateRenderPin(pFilter,(WAVEFORMATEX*)&wfx,&result); + if(stream->playbackPin == NULL) result = paSampleFormatNotSupported; + } + + if( result != paNoError ) + { + /* Some or all KS devices can only handle the exact number of channels + * they specify. But PortAudio clients expect to be able to + * at least specify mono I/O on a multi-channel device + * If this is the case, then we will do the channel mapping internally + **/ + if( stream->userOutputChannels < pFilter->maxOutputChannels ) + { + FillWFEXT(&wfx,hostOutputSampleFormat,sampleRate,pFilter->maxOutputChannels); + stream->bytesPerOutputFrame = wfx.Format.nBlockAlign; + stream->playbackPin = FilterCreateRenderPin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + stream->deviceOutputChannels = pFilter->maxOutputChannels; + if( result != paNoError ) + { + /* Try a WAVE_FORMAT_PCM instead */ + wfx.Format.wFormatTag = WAVE_FORMAT_PCM; + wfx.Format.cbSize = 0; + wfx.Samples.wValidBitsPerSample = 0; + wfx.dwChannelMask = 0; + wfx.SubFormat = GUID_NULL; + stream->playbackPin = FilterCreateRenderPin(pFilter,(const WAVEFORMATEX*)&wfx,&result); + } + } + } + + if(stream->playbackPin == NULL) + { + goto error; + } + + switch(hostOutputSampleFormat) + { + case paInt16: stream->outputSampleSize = 2; break; + case paInt24: stream->outputSampleSize = 3; break; + case paInt32: + case paFloat32: stream->outputSampleSize = 4; break; + } + + stream->playbackPin->frameSize /= stream->bytesPerOutputFrame; + PA_DEBUG(("Pin output frames: %d\n",stream->playbackPin->frameSize)); + } + else + { + stream->playbackPin = NULL; + stream->bytesPerOutputFrame = 0; + } + + /* Calculate the framesPerHostXxxxBuffer size based upon the suggested latency values */ + + /* Record the buffer length */ + if(inputParameters) + { + /* Calculate the frames from the user's value - add a bit to round up */ + stream->framesPerHostIBuffer = (unsigned long)((inputParameters->suggestedLatency*sampleRate)+0.0001); + if(stream->framesPerHostIBuffer > (unsigned long)sampleRate) + { /* Upper limit is 1 second */ + stream->framesPerHostIBuffer = (unsigned long)sampleRate; + } + else if(stream->framesPerHostIBuffer < stream->recordingPin->frameSize) + { + stream->framesPerHostIBuffer = stream->recordingPin->frameSize; + } + PA_DEBUG(("Input frames chosen:%ld\n",stream->framesPerHostIBuffer)); + } + + if(outputParameters) + { + /* Calculate the frames from the user's value - add a bit to round up */ + stream->framesPerHostOBuffer = (unsigned long)((outputParameters->suggestedLatency*sampleRate)+0.0001); + if(stream->framesPerHostOBuffer > (unsigned long)sampleRate) + { /* Upper limit is 1 second */ + stream->framesPerHostOBuffer = (unsigned long)sampleRate; + } + else if(stream->framesPerHostOBuffer < stream->playbackPin->frameSize) + { + stream->framesPerHostOBuffer = stream->playbackPin->frameSize; + } + PA_DEBUG(("Output frames chosen:%ld\n",stream->framesPerHostOBuffer)); + } + + /* Host buffer size is bounded to the largest of the input and output + frame sizes */ + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + stream->userInputChannels, inputSampleFormat, hostInputSampleFormat, + stream->userOutputChannels, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + max(stream->framesPerHostOBuffer,stream->framesPerHostIBuffer), + paUtilBoundedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ) + goto error; + + stream->streamRepresentation.streamInfo.inputLatency = + ((double)stream->framesPerHostIBuffer) / sampleRate; + stream->streamRepresentation.streamInfo.outputLatency = + ((double)stream->framesPerHostOBuffer) / sampleRate; + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + PA_DEBUG(("BytesPerInputFrame = %d\n",stream->bytesPerInputFrame)); + PA_DEBUG(("BytesPerOutputFrame = %d\n",stream->bytesPerOutputFrame)); + + /* Allocate all the buffers for host I/O */ + size = 2 * (stream->framesPerHostIBuffer*stream->bytesPerInputFrame + stream->framesPerHostOBuffer*stream->bytesPerOutputFrame); + PA_DEBUG(("Buffer size = %d\n",size)); + stream->hostBuffer = (char*)PaUtil_AllocateMemory(size); + PA_DEBUG(("Buffer allocated\n")); + if( !stream->hostBuffer ) + { + PA_DEBUG(("Cannot allocate host buffer!\n")); + result = paInsufficientMemory; + goto error; + } + PA_DEBUG(("Buffer start = %p\n",stream->hostBuffer)); + /* memset(stream->hostBuffer,0,size); */ + + /* Set up the packets */ + stream->events[0] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[0]); /* Record buffer 1 */ + stream->events[1] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[1]); /* Record buffer 2 */ + stream->events[2] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[2]); /* Play buffer 1 */ + stream->events[3] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[3]); /* Play buffer 2 */ + stream->events[4] = CreateEvent(NULL, FALSE, FALSE, NULL); + ResetEvent(stream->events[4]); /* Abort event */ + if(stream->userInputChannels > 0) + { + DATAPACKET *p = &(stream->packets[0]); + p->Signal.hEvent = stream->events[0]; + p->Header.Data = stream->hostBuffer; + p->Header.FrameExtent = stream->framesPerHostIBuffer*stream->bytesPerInputFrame; + p->Header.DataUsed = 0; + p->Header.Size = sizeof(p->Header); + p->Header.PresentationTime.Numerator = 1; + p->Header.PresentationTime.Denominator = 1; + + p = &(stream->packets[1]); + p->Signal.hEvent = stream->events[1]; + p->Header.Data = stream->hostBuffer + stream->framesPerHostIBuffer*stream->bytesPerInputFrame; + p->Header.FrameExtent = stream->framesPerHostIBuffer*stream->bytesPerInputFrame; + p->Header.DataUsed = 0; + p->Header.Size = sizeof(p->Header); + p->Header.PresentationTime.Numerator = 1; + p->Header.PresentationTime.Denominator = 1; + } + if(stream->userOutputChannels > 0) + { + DATAPACKET *p = &(stream->packets[2]); + p->Signal.hEvent = stream->events[2]; + p->Header.Data = stream->hostBuffer + 2*stream->framesPerHostIBuffer*stream->bytesPerInputFrame; + p->Header.FrameExtent = stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.DataUsed = stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.Size = sizeof(p->Header); + p->Header.PresentationTime.Numerator = 1; + p->Header.PresentationTime.Denominator = 1; + + p = &(stream->packets[3]); + p->Signal.hEvent = stream->events[3]; + p->Header.Data = stream->hostBuffer + 2*stream->framesPerHostIBuffer*stream->bytesPerInputFrame + stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.FrameExtent = stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.DataUsed = stream->framesPerHostOBuffer*stream->bytesPerOutputFrame; + p->Header.Size = sizeof(p->Header); + p->Header.PresentationTime.Numerator = 1; + p->Header.PresentationTime.Denominator = 1; + } + + stream->streamStarted = 0; + stream->streamActive = 0; + stream->streamStop = 0; + stream->streamAbort = 0; + stream->streamFlags = streamFlags; + stream->oldProcessPriority = REALTIME_PRIORITY_CLASS; + + *s = (PaStream*)stream; + + PA_LOGL_; + return result; + +error: + size = 5; + while(size--) + { + if(stream->events[size] != NULL) + { + CloseHandle(stream->events[size]); + stream->events[size] = NULL; + } + } + if(stream->hostBuffer) + PaUtil_FreeMemory( stream->hostBuffer ); + + if(stream->playbackPin) + PinClose(stream->playbackPin); + if(stream->recordingPin) + PinClose(stream->recordingPin); + + if( stream ) + PaUtil_FreeMemory( stream ); + + PA_LOGL_; + return result; +} + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result = paNoError; + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int size; + + PA_LOGE_; + + assert(!stream->streamStarted); + assert(!stream->streamActive); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + size = 5; + while(size--) + { + if(stream->events[size] != NULL) + { + CloseHandle(stream->events[size]); + stream->events[size] = NULL; + } + } + if(stream->hostBuffer) + PaUtil_FreeMemory( stream->hostBuffer ); + + if(stream->playbackPin) + PinClose(stream->playbackPin); + if(stream->recordingPin) + PinClose(stream->recordingPin); + + PaUtil_FreeMemory( stream ); + + PA_LOGL_; + return result; +} + +/* +Write the supplied packet to the pin +Asynchronous +Should return false on success +*/ +static BOOL PinWrite(HANDLE h, DATAPACKET* p) +{ + unsigned long cbReturned = 0; + return DeviceIoControl(h,IOCTL_KS_WRITE_STREAM,NULL,0, + &p->Header,p->Header.Size,&cbReturned,&p->Signal); +} + +/* +Read to the supplied packet from the pin +Asynchronous +Should return false on success +*/ +static BOOL PinRead(HANDLE h, DATAPACKET* p) +{ + unsigned long cbReturned = 0; + return DeviceIoControl(h,IOCTL_KS_READ_STREAM,NULL,0, + &p->Header,p->Header.Size,&cbReturned,&p->Signal); +} + +/* +Copy the first interleaved channel of 16 bit data to the other channels +*/ +static void DuplicateFirstChannelInt16(void* buffer, int channels, int samples) +{ + unsigned short* data = (unsigned short*)buffer; + int channel; + unsigned short sourceSample; + while( samples-- ) + { + sourceSample = *data++; + channel = channels-1; + while( channel-- ) + { + *data++ = sourceSample; + } + } +} + +/* +Copy the first interleaved channel of 24 bit data to the other channels +*/ +static void DuplicateFirstChannelInt24(void* buffer, int channels, int samples) +{ + unsigned char* data = (unsigned char*)buffer; + int channel; + unsigned char sourceSample[3]; + while( samples-- ) + { + sourceSample[0] = data[0]; + sourceSample[1] = data[1]; + sourceSample[2] = data[2]; + data += 3; + channel = channels-1; + while( channel-- ) + { + data[0] = sourceSample[0]; + data[1] = sourceSample[1]; + data[2] = sourceSample[2]; + data += 3; + } + } +} + +/* +Copy the first interleaved channel of 32 bit data to the other channels +*/ +static void DuplicateFirstChannelInt32(void* buffer, int channels, int samples) +{ + unsigned long* data = (unsigned long*)buffer; + int channel; + unsigned long sourceSample; + while( samples-- ) + { + sourceSample = *data++; + channel = channels-1; + while( channel-- ) + { + *data++ = sourceSample; + } + } +} + +static DWORD WINAPI ProcessingThread(LPVOID pParam) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)pParam; + PaStreamCallbackTimeInfo ti; + int cbResult = paContinue; + int inbuf = 0; + int outbuf = 0; + int pending = 0; + PaError result; + unsigned long wait; + unsigned long eventSignaled; + int fillPlaybuf = 0; + int emptyRecordbuf = 0; + int framesProcessed; + unsigned long timeout; + int i; + int doChannelCopy; + int priming = 0; + PaStreamCallbackFlags underover = 0; + + PA_LOGE_; + + ti.inputBufferAdcTime = 0.0; + ti.currentTime = 0.0; + ti.outputBufferDacTime = 0.0; + + /* Get double buffering going */ + + /* Submit buffers */ + if(stream->playbackPin) + { + result = PinSetState(stream->playbackPin, KSSTATE_RUN); + + PA_DEBUG(("play state run = %d;",(int)result)); + SetEvent(stream->events[outbuf+2]); + outbuf = (outbuf+1)&1; + SetEvent(stream->events[outbuf+2]); + outbuf = (outbuf+1)&1; + pending += 2; + priming += 4; + } + if(stream->recordingPin) + { + result = PinSetState(stream->recordingPin, KSSTATE_RUN); + + PA_DEBUG(("recording state run = %d;",(int)result)); + PinRead(stream->recordingPin->handle,&stream->packets[inbuf]); + inbuf = (inbuf+1)&1; /* Increment and wrap */ + PinRead(stream->recordingPin->handle,&stream->packets[inbuf]); + inbuf = (inbuf+1)&1; /* Increment and wrap */ + /* FIXME - do error checking */ + pending += 2; + } + PA_DEBUG(("Out buffer len:%f\n",(2000*stream->framesPerHostOBuffer) / stream->streamRepresentation.streamInfo.sampleRate)); + PA_DEBUG(("In buffer len:%f\n",(2000*stream->framesPerHostIBuffer) / stream->streamRepresentation.streamInfo.sampleRate)); + timeout = max( + ((2000*(DWORD)stream->framesPerHostOBuffer) / (DWORD)stream->streamRepresentation.streamInfo.sampleRate), + ((2000*(DWORD)stream->framesPerHostIBuffer) / (DWORD)stream->streamRepresentation.streamInfo.sampleRate)); + timeout = max(timeout,1); + PA_DEBUG(("Timeout = %ld\n",timeout)); + + while(!stream->streamAbort) + { + fillPlaybuf = 0; + emptyRecordbuf = 0; + + /* Wait for next input or output buffer to be finished with*/ + assert(pending>0); + + if(stream->streamStop) + { + PA_DEBUG(("ss1:pending=%d ",pending)); + } + wait = WaitForMultipleObjects(5, stream->events, FALSE, 0); + if( wait == WAIT_TIMEOUT ) + { + /* No (under|over)flow has ocurred */ + wait = WaitForMultipleObjects(5, stream->events, FALSE, timeout); + eventSignaled = wait - WAIT_OBJECT_0; + } + else + { + eventSignaled = wait - WAIT_OBJECT_0; + if( eventSignaled < 2 ) + { + underover |= paInputOverflow; + PA_DEBUG(("Input overflow\n")); + } + else if(( eventSignaled < 4 )&&(!priming)) + { + underover |= paOutputUnderflow; + PA_DEBUG(("Output underflow\n")); + } + } + + if(stream->streamStop) + { + PA_DEBUG(("ss2:wait=%ld",wait)); + } + if(wait == WAIT_FAILED) + { + PA_DEBUG(("Wait fail = %ld! ",wait)); + break; + } + if(wait == WAIT_TIMEOUT) + { + continue; + } + + if(eventSignaled < 2) + { /* Recording input buffer has been filled */ + if(stream->playbackPin) + { + /* First check if also the next playback buffer has been signaled */ + wait = WaitForSingleObject(stream->events[outbuf+2],0); + if(wait == WAIT_OBJECT_0) + { + /* Yes, so do both buffers at same time */ + fillPlaybuf = 1; + pending--; + /* Was this an underflow situation? */ + if( underover ) + underover |= paOutputUnderflow; /* Yes! */ + } + } + emptyRecordbuf = 1; + pending--; + } + else if(eventSignaled < 4) + { /* Playback output buffer has been emptied */ + if(stream->recordingPin) + { + /* First check if also the next recording buffer has been signaled */ + wait = WaitForSingleObject(stream->events[inbuf],0); + if(wait == WAIT_OBJECT_0) + { /* Yes, so do both buffers at same time */ + emptyRecordbuf = 1; + pending--; + /* Was this an overflow situation? */ + if( underover ) + underover |= paInputOverflow; /* Yes! */ + } + } + fillPlaybuf = 1; + pending--; + } + else + { + /* Abort event! */ + assert(stream->streamAbort); /* Should have been set */ + PA_DEBUG(("ABORTING ")); + break; + } + ResetEvent(stream->events[eventSignaled]); + + if(stream->streamStop) + { + PA_DEBUG(("Stream stop! pending=%d",pending)); + cbResult = paComplete; /* Stop, but play remaining buffers */ + } + + /* Do necessary buffer processing (which will invoke user callback if necessary */ + doChannelCopy = 0; + if(cbResult==paContinue) + { + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + if((stream->bufferProcessor.hostInputFrameCount[0] + stream->bufferProcessor.hostInputFrameCount[1]) == + (stream->bufferProcessor.hostOutputFrameCount[0] + stream->bufferProcessor.hostOutputFrameCount[1]) ) + PaUtil_BeginBufferProcessing(&stream->bufferProcessor,&ti,underover); + underover = 0; /* Reset the (under|over)flow status */ + if(fillPlaybuf) + { + PaUtil_SetOutputFrameCount(&stream->bufferProcessor,0); + if( stream->userOutputChannels == 1 ) + { + /* Write the single user channel to the first interleaved block */ + PaUtil_SetOutputChannel(&stream->bufferProcessor,0,stream->packets[outbuf+2].Header.Data,stream->deviceOutputChannels); + /* We will do a copy to the other channels after the data has been written */ + doChannelCopy = 1; + } + else + { + for(i=0;iuserOutputChannels;i++) + { + /* Only write the user output channels. Leave the rest blank */ + PaUtil_SetOutputChannel(&stream->bufferProcessor,i,((unsigned char*)(stream->packets[outbuf+2].Header.Data))+(i*stream->outputSampleSize),stream->deviceOutputChannels); + } + } + } + if(emptyRecordbuf) + { + PaUtil_SetInputFrameCount(&stream->bufferProcessor,stream->packets[inbuf].Header.DataUsed/stream->bytesPerInputFrame); + for(i=0;iuserInputChannels;i++) + { + /* Only read as many channels as the user wants */ + PaUtil_SetInputChannel(&stream->bufferProcessor,i,((unsigned char*)(stream->packets[inbuf].Header.Data))+(i*stream->inputSampleSize),stream->deviceInputChannels); + } + } + /* Only call the EndBufferProcessing function is the total input frames == total output frames */ + if((stream->bufferProcessor.hostInputFrameCount[0] + stream->bufferProcessor.hostInputFrameCount[1]) == + (stream->bufferProcessor.hostOutputFrameCount[0] + stream->bufferProcessor.hostOutputFrameCount[1]) ) + framesProcessed = PaUtil_EndBufferProcessing(&stream->bufferProcessor,&cbResult); + else framesProcessed = 0; + if( doChannelCopy ) + { + /* Copy the first output channel to the other channels */ + switch(stream->outputSampleSize) + { + case 2: + DuplicateFirstChannelInt16(stream->packets[outbuf+2].Header.Data,stream->deviceOutputChannels,stream->framesPerHostOBuffer); + break; + case 3: + DuplicateFirstChannelInt24(stream->packets[outbuf+2].Header.Data,stream->deviceOutputChannels,stream->framesPerHostOBuffer); + break; + case 4: + DuplicateFirstChannelInt32(stream->packets[outbuf+2].Header.Data,stream->deviceOutputChannels,stream->framesPerHostOBuffer); + break; + default: + assert(0); /* Unsupported format! */ + break; + } + } + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + } + else + { + fillPlaybuf = 0; + emptyRecordbuf = 0; + } + + /* + if(cbResult != paContinue) + { + PA_DEBUG(("cbResult=%d, pending=%d:",cbResult,pending)); + } + */ + /* Submit buffers */ + if((fillPlaybuf)&&(cbResult!=paAbort)) + { + if(!PinWrite(stream->playbackPin->handle,&stream->packets[outbuf+2])) + outbuf = (outbuf+1)&1; /* Increment and wrap */ + pending++; + if( priming ) + priming--; /* Have to prime twice */ + } + if((emptyRecordbuf)&&(cbResult==paContinue)) + { + stream->packets[inbuf].Header.DataUsed = 0; /* Reset for reuse */ + PinRead(stream->recordingPin->handle,&stream->packets[inbuf]); + inbuf = (inbuf+1)&1; /* Increment and wrap */ + pending++; + } + if(pending==0) + { + PA_DEBUG(("pending==0 finished...;")); + break; + } + if((!stream->playbackPin)&&(cbResult!=paContinue)) + { + PA_DEBUG(("record only cbResult=%d...;",cbResult)); + break; + } + } + + PA_DEBUG(("Finished thread")); + + /* Finished, either normally or aborted */ + if(stream->playbackPin) + { + result = PinSetState(stream->playbackPin, KSSTATE_PAUSE); + result = PinSetState(stream->playbackPin, KSSTATE_STOP); + } + if(stream->recordingPin) + { + result = PinSetState(stream->recordingPin, KSSTATE_PAUSE); + result = PinSetState(stream->recordingPin, KSSTATE_STOP); + } + + stream->streamActive = 0; + + if((!stream->streamStop)&&(!stream->streamAbort)) + { + /* Invoke the user stream finished callback */ + /* Only do it from here if not being stopped/aborted by user */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + stream->streamStop = 0; + stream->streamAbort = 0; + + /* Reset process priority if necessary */ + if(stream->oldProcessPriority != REALTIME_PRIORITY_CLASS) + { + SetPriorityClass(GetCurrentProcess(),stream->oldProcessPriority); + stream->oldProcessPriority = REALTIME_PRIORITY_CLASS; + } + + PA_LOGL_; + ExitThread(0); + return 0; +} + +static PaError StartStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinWdmStream *stream = (PaWinWdmStream*)s; + DWORD dwID; + BOOL ret; + int size; + + PA_LOGE_; + + stream->streamStop = 0; + stream->streamAbort = 0; + size = 5; + while(size--) + { + if(stream->events[size] != NULL) + { + ResetEvent(stream->events[size]); + } + } + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + stream->oldProcessPriority = GetPriorityClass(GetCurrentProcess()); + /* Uncomment the following line to enable dynamic boosting of the process + * priority to real time for best low latency support + * Disabled by default because RT processes can easily block the OS */ + /*ret = SetPriorityClass(GetCurrentProcess(),REALTIME_PRIORITY_CLASS); + PA_DEBUG(("Class ret = %d;",ret));*/ + + stream->streamStarted = 1; + stream->streamThread = CreateThread(NULL, 0, ProcessingThread, stream, 0, &dwID); + if(stream->streamThread == NULL) + { + stream->streamStarted = 0; + result = paInsufficientMemory; + goto end; + } + ret = SetThreadPriority(stream->streamThread,THREAD_PRIORITY_TIME_CRITICAL); + PA_DEBUG(("Priority ret = %d;",ret)); + /* Make the stream active */ + stream->streamActive = 1; + +end: + PA_LOGL_; + return result; +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int doCb = 0; + + PA_LOGE_; + + if(stream->streamActive) + { + doCb = 1; + stream->streamStop = 1; + while(stream->streamActive) + { + PA_DEBUG(("W.")); + Sleep(10); /* Let thread sleep for 10 msec */ + } + } + + PA_DEBUG(("Terminating thread")); + if(stream->streamStarted && stream->streamThread) + { + TerminateThread(stream->streamThread,0); + stream->streamThread = NULL; + } + + stream->streamStarted = 0; + + if(stream->oldProcessPriority != REALTIME_PRIORITY_CLASS) + { + SetPriorityClass(GetCurrentProcess(),stream->oldProcessPriority); + stream->oldProcessPriority = REALTIME_PRIORITY_CLASS; + } + + if(doCb) + { + /* Do user callback now after all state has been reset */ + /* This means it should be safe for the called function */ + /* to invoke e.g. StartStream */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + + PA_LOGL_; + return result; +} + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int doCb = 0; + + PA_LOGE_; + + if(stream->streamActive) + { + doCb = 1; + stream->streamAbort = 1; + SetEvent(stream->events[4]); /* Signal immediately */ + while(stream->streamActive) + { + Sleep(10); + } + } + + if(stream->streamStarted && stream->streamThread) + { + TerminateThread(stream->streamThread,0); + stream->streamThread = NULL; + } + + stream->streamStarted = 0; + + if(stream->oldProcessPriority != REALTIME_PRIORITY_CLASS) + { + SetPriorityClass(GetCurrentProcess(),stream->oldProcessPriority); + stream->oldProcessPriority = REALTIME_PRIORITY_CLASS; + } + + if(doCb) + { + /* Do user callback now after all state has been reset */ + /* This means it should be safe for the called function */ + /* to invoke e.g. StartStream */ + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + + stream->streamActive = 0; + stream->streamStarted = 0; + + PA_LOGL_; + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int result = 0; + + PA_LOGE_; + + if(!stream->streamStarted) + result = 1; + + PA_LOGL_; + return result; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + int result = 0; + + PA_LOGE_; + + if(stream->streamActive) + result = 1; + + PA_LOGL_; + return result; +} + + +static PaTime GetStreamTime( PaStream* s ) +{ + PA_LOGE_; + PA_LOGL_; + (void)s; + return PaUtil_GetTime(); +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + double result; + PA_LOGE_; + result = PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); + PA_LOGL_; + return result; +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + + PA_LOGE_; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + PA_LOGL_; + return paNoError; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + + PA_LOGE_; + + /* suppress unused variable warnings */ + (void) buffer; + (void) frames; + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + PA_LOGL_; + return paNoError; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + + PA_LOGE_; + + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + PA_LOGL_; + return 0; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaWinWdmStream *stream = (PaWinWdmStream*)s; + + PA_LOGE_; + /* suppress unused variable warnings */ + (void) stream; + + /* IMPLEMENT ME, see portaudio.h for required behavior*/ + PA_LOGL_; + return 0; +} \ No newline at end of file diff --git a/portaudio-v19/src/hostapi/wdmks/readme.txt b/portaudio-v19/src/hostapi/wdmks/readme.txt new file mode 100644 index 000000000..1a381fe79 --- /dev/null +++ b/portaudio-v19/src/hostapi/wdmks/readme.txt @@ -0,0 +1,82 @@ +Notes about WDM-KS host API +--------------------------- + +Status history +-------------- +10th November 2005: +Made following changes: + * OpenStream: Try all PaSampleFormats internally if the the chosen + format is not supported natively. This fixed several problems + with soundcards that soundcards that did not take kindly to + using 24-bit 3-byte formats. + * OpenStream: Make the minimum framesPerHostIBuffer (and framesPerHostOBuffer) + the default frameSize for the playback/recording pin. + * ProcessingThread: Added a switch to only call PaUtil_EndBufferProcessing + if the total input frames equals the total output frames + +5th September 2004: +This is the first public version of the code. It should be considered +an alpha release with zero guarantee not to crash on any particular +system. So far it has only been tested in the author's development +environment, which means a Win2k/SP2 PIII laptop with integrated +SoundMAX driver and USB Tascam US-428 compiled with both MinGW +(GCC 3.3) and MSVC++6 using the MS DirectX 9 SDK. +It has been most widely tested with the MinGW build, with most of the +test programs (particularly paqa_devs and paqa_errs) passing. +There are some notable failures: patest_out_underflow and both of the +blocking I/O tests (as blocking I/O is not implemented). +At this point the code needs to be tested with a much wider variety +of configurations and feedback provided from testers regarding +both working and failing cases. + +What is the WDM-KS host API? +---------------------------- +PortAudio for Windows currently has 3 functional host implementations. +MME uses the oldest Windows audio API which does not offer good +play/record latency. +DirectX improves this, but still imposes a penalty +of 10s of milliseconds due to the system mixing of streams from +multiple applications. +ASIO offers very good latency, but requires special drivers which are +not always available for cheaper audio hardware. Also, when ASIO +drivers are available, they are not always so robust because they +bypass all of the standardised Windows device driver architecture +and hit the hardware their own way. +Alternatively there are a couple of free (but closed source) ASIO +implementations which connect to the lower level Windows +"Kernel Streaming" API, but again these require special installation +by the user, and can be limited in functionality or difficult to use. + +This is where the PortAudio "WDM-KS" host implementation comes in. +It directly connects PortAudio to the same Kernel Streaming API which +those ASIO bridges use. This avoids the mixing penatly of DirectX, +giving at least as good latency as any ASIO driver, but it has the +advantage of working with ANY Windows audio hardware which is available +through the normal MME/DirectX routes without the user requiring +any additional device drivers to be installed, and allowing all +device selection to be done through the normal PortAudio API. + +Note that in general you should only be using this host API if your +application has a real requirement for very low latency audio (<20ms), +either because you are generating sounds in real-time based upon +user input, or you a processing recorded audio in real time. + +The only thing to be aware of is that using the KS interface will +block that device from being used by the rest of system through +the higher level APIs, or conversely, if the system is using +a device, the KS API will not be able to use it. MS recommend that +you should keep the device open only when your application has focus. +In PortAudio terms, this means having a stream Open on a WDMKS device. + +Usage +----- +To add the WDMKS backend to your program which is already using +PortAudio, you must undefine PA_NO_WDMKS from your build file, +and include the pa_win_wdmks\pa_win_wdmks.c into your build. +The file should compile in both C and C++. +You will need a DirectX SDK installed on your system for the +ks.h and ksmedia.h header files. +You will need to link to the system "setupapi" library. +Note that if you use MinGW, you will get more warnings from +the DX header files when using GCC(C), and still a few warnings +with G++(CPP). \ No newline at end of file diff --git a/portaudio-v19/src/hostapi/wmme/pa_win_wmme.c b/portaudio-v19/src/hostapi/wmme/pa_win_wmme.c new file mode 100644 index 000000000..7167c08f4 --- /dev/null +++ b/portaudio-v19/src/hostapi/wmme/pa_win_wmme.c @@ -0,0 +1,3634 @@ +/* + * $Id$ + * pa_win_wmme.c + * Implementation of PortAudio for Windows MultiMedia Extensions (WMME) + * + * PortAudio Portable Real-Time Audio Library + * Latest Version at: http://www.portaudio.com + * + * Authors: Ross Bencina and Phil Burk + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +/* Modification History: + PLB = Phil Burk + JM = Julien Maillard + RDB = Ross Bencina + PLB20010402 - sDevicePtrs now allocates based on sizeof(pointer) + PLB20010413 - check for excessive numbers of channels + PLB20010422 - apply Mike Berry's changes for CodeWarrior on PC + including conditional inclusion of memory.h, + and explicit typecasting on memory allocation + PLB20010802 - use GlobalAlloc for sDevicesPtr instead of PaHost_AllocFastMemory + PLB20010816 - pass process instead of thread to SetPriorityClass() + PLB20010927 - use number of frames instead of real-time for CPULoad calculation. + JM20020118 - prevent hung thread when buffers underflow. + PLB20020321 - detect Win XP versus NT, 9x; fix DBUG typo; removed init of CurrentCount + RDB20020411 - various renaming cleanups, factored streamData alloc and cpu usage init + RDB20020417 - stopped counting WAVE_MAPPER when there were no real devices + refactoring, renaming and fixed a few edge case bugs + RDB20020531 - converted to V19 framework + ** NOTE maintanance history is now stored in CVS ** +*/ + +/** @file + + @todo Fix buffer catch up code, can sometimes get stuck (perhaps fixed now, + needs to be reviewed and tested.) + + @todo implement paInputUnderflow, paOutputOverflow streamCallback statusFlags, paNeverDropInput. + + @todo BUG: PA_MME_SET_LAST_WAVEIN/OUT_ERROR is used in functions which may + be called asynchronously from the callback thread. this is bad. + + @todo implement inputBufferAdcTime in callback thread + + @todo review/fix error recovery and cleanup in marked functions + + @todo implement timeInfo for stream priming + + @todo handle the case where the callback returns paAbort or paComplete during stream priming. + + @todo review input overflow and output underflow handling in ReadStream and WriteStream + +Non-critical stuff for the future: + + @todo Investigate supporting host buffer formats > 16 bits + + @todo define UNICODE and _UNICODE in the project settings and see what breaks + +*/ + +/* + How it works: + + For both callback and blocking read/write streams we open the MME devices + in CALLBACK_EVENT mode. In this mode, MME signals an Event object whenever + it has finished with a buffer (either filled it for input, or played it + for output). Where necessary we block waiting for Event objects using + WaitMultipleObjects(). + + When implementing a PA callback stream, we set up a high priority thread + which waits on the MME buffer Events and drains/fills the buffers when + they are ready. + + When implementing a PA blocking read/write stream, we simply wait on these + Events (when necessary) inside the ReadStream() and WriteStream() functions. +*/ + +#include +#include +#include +#include +#include +#include +#include +/* PLB20010422 - "memory.h" doesn't work on CodeWarrior for PC. Thanks Mike Berry for the mod. */ +#ifndef __MWERKS__ +#include +#include +#endif /* __MWERKS__ */ + +#include "portaudio.h" +#include "pa_trace.h" +#include "pa_util.h" +#include "pa_allocation.h" +#include "pa_hostapi.h" +#include "pa_stream.h" +#include "pa_cpuload.h" +#include "pa_process.h" + +#include "pa_win_wmme.h" + +#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ +#pragma comment(lib, "winmm.lib") +#endif + +/* + provided in newer platform sdks + */ +#ifndef DWORD_PTR +#define DWORD_PTR DWORD +#endif + +/************************************************* Constants ********/ + +#define PA_MME_USE_HIGH_DEFAULT_LATENCY_ (0) /* For debugging glitches. */ + +#if PA_MME_USE_HIGH_DEFAULT_LATENCY_ + #define PA_MME_WIN_9X_DEFAULT_LATENCY_ (0.4) + #define PA_MME_MIN_HOST_OUTPUT_BUFFER_COUNT_ (4) + #define PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_ (4) + #define PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_HALF_DUPLEX_ (4) + #define PA_MME_MIN_HOST_BUFFER_FRAMES_WHEN_UNSPECIFIED_ (16) + #define PA_MME_MAX_HOST_BUFFER_SECS_ (0.3) /* Do not exceed unless user buffer exceeds */ + #define PA_MME_MAX_HOST_BUFFER_BYTES_ (32 * 1024) /* Has precedence over PA_MME_MAX_HOST_BUFFER_SECS_, some drivers are known to crash with buffer sizes > 32k */ +#else + #define PA_MME_WIN_9X_DEFAULT_LATENCY_ (0.2) + #define PA_MME_MIN_HOST_OUTPUT_BUFFER_COUNT_ (2) + #define PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_ (3) + #define PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_HALF_DUPLEX_ (2) + #define PA_MME_MIN_HOST_BUFFER_FRAMES_WHEN_UNSPECIFIED_ (16) + #define PA_MME_MAX_HOST_BUFFER_SECS_ (0.1) /* Do not exceed unless user buffer exceeds */ + #define PA_MME_MAX_HOST_BUFFER_BYTES_ (32 * 1024) /* Has precedence over PA_MME_MAX_HOST_BUFFER_SECS_, some drivers are known to crash with buffer sizes > 32k */ +#endif + +/* Use higher latency for NT because it is even worse at real-time + operation than Win9x. +*/ +#define PA_MME_WIN_NT_DEFAULT_LATENCY_ (PA_MME_WIN_9X_DEFAULT_LATENCY_ * 2) +#define PA_MME_WIN_WDM_DEFAULT_LATENCY_ (PA_MME_WIN_9X_DEFAULT_LATENCY_) + + +#define PA_MME_MIN_TIMEOUT_MSEC_ (1000) + +static const char constInputMapperSuffix_[] = " - Input"; +static const char constOutputMapperSuffix_[] = " - Output"; + +/********************************************************************/ + +typedef struct PaWinMmeStream PaWinMmeStream; /* forward declaration */ + +/* prototypes for functions declared in this file */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); + + +/* macros for setting last host error information */ + +#ifdef UNICODE + +#define PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ) \ + { \ + wchar_t mmeErrorTextWide[ MAXERRORLENGTH ]; \ + char mmeErrorText[ MAXERRORLENGTH ]; \ + waveInGetErrorText( mmresult, mmeErrorTextWide, MAXERRORLENGTH ); \ + WideCharToMultiByte( CP_ACP, WC_COMPOSITECHECK | WC_DEFAULTCHAR,\ + mmeErrorTextWide, -1, mmeErrorText, MAXERRORLENGTH, NULL, NULL ); \ + PaUtil_SetLastHostErrorInfo( paMME, mmresult, mmeErrorText ); \ + } + +#define PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ) \ + { \ + wchar_t mmeErrorTextWide[ MAXERRORLENGTH ]; \ + char mmeErrorText[ MAXERRORLENGTH ]; \ + waveOutGetErrorText( mmresult, mmeErrorTextWide, MAXERRORLENGTH ); \ + WideCharToMultiByte( CP_ACP, WC_COMPOSITECHECK | WC_DEFAULTCHAR,\ + mmeErrorTextWide, -1, mmeErrorText, MAXERRORLENGTH, NULL, NULL ); \ + PaUtil_SetLastHostErrorInfo( paMME, mmresult, mmeErrorText ); \ + } + +#else /* !UNICODE */ + +#define PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ) \ + { \ + char mmeErrorText[ MAXERRORLENGTH ]; \ + waveInGetErrorText( mmresult, mmeErrorText, MAXERRORLENGTH ); \ + PaUtil_SetLastHostErrorInfo( paMME, mmresult, mmeErrorText ); \ + } + +#define PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ) \ + { \ + char mmeErrorText[ MAXERRORLENGTH ]; \ + waveOutGetErrorText( mmresult, mmeErrorText, MAXERRORLENGTH ); \ + PaUtil_SetLastHostErrorInfo( paMME, mmresult, mmeErrorText ); \ + } + +#endif /* UNICODE */ + + +static void PaMme_SetLastSystemError( DWORD errorCode ) +{ + char *lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + errorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + PaUtil_SetLastHostErrorInfo( paMME, errorCode, lpMsgBuf ); + LocalFree( lpMsgBuf ); +} + +#define PA_MME_SET_LAST_SYSTEM_ERROR( errorCode ) \ + PaMme_SetLastSystemError( errorCode ) + + +/* PaError returning wrappers for some commonly used win32 functions + note that we allow passing a null ptr to have no effect. +*/ + +static PaError CreateEventWithPaError( HANDLE *handle, + LPSECURITY_ATTRIBUTES lpEventAttributes, + BOOL bManualReset, + BOOL bInitialState, + LPCTSTR lpName ) +{ + PaError result = paNoError; + + *handle = NULL; + + *handle = CreateEvent( lpEventAttributes, bManualReset, bInitialState, lpName ); + if( *handle == NULL ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + + return result; +} + + +static PaError ResetEventWithPaError( HANDLE handle ) +{ + PaError result = paNoError; + + if( handle ) + { + if( ResetEvent( handle ) == 0 ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + } + + return result; +} + + +static PaError CloseHandleWithPaError( HANDLE handle ) +{ + PaError result = paNoError; + + if( handle ) + { + if( CloseHandle( handle ) == 0 ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + } + + return result; +} + + +/* PaWinMmeHostApiRepresentation - host api datastructure specific to this implementation */ + +typedef struct +{ + PaUtilHostApiRepresentation inheritedHostApiRep; + PaUtilStreamInterface callbackStreamInterface; + PaUtilStreamInterface blockingStreamInterface; + + PaUtilAllocationGroup *allocations; + + int inputDeviceCount, outputDeviceCount; + + /** winMmeDeviceIds is an array of WinMme device ids. + fields in the range [0, inputDeviceCount) are input device ids, + and [inputDeviceCount, inputDeviceCount + outputDeviceCount) are output + device ids. + */ + UINT *winMmeDeviceIds; +} +PaWinMmeHostApiRepresentation; + + +typedef struct +{ + PaDeviceInfo inheritedDeviceInfo; + DWORD dwFormats; /**<< standard formats bitmask from the WAVEINCAPS and WAVEOUTCAPS structures */ +} +PaWinMmeDeviceInfo; + + +/************************************************************************* + * Returns recommended device ID. + * On the PC, the recommended device can be specified by the user by + * setting an environment variable. For example, to use device #1. + * + * set PA_RECOMMENDED_OUTPUT_DEVICE=1 + * + * The user should first determine the available device ID by using + * the supplied application "pa_devs". + */ +#define PA_ENV_BUF_SIZE_ (32) +#define PA_REC_IN_DEV_ENV_NAME_ ("PA_RECOMMENDED_INPUT_DEVICE") +#define PA_REC_OUT_DEV_ENV_NAME_ ("PA_RECOMMENDED_OUTPUT_DEVICE") +static PaDeviceIndex GetEnvDefaultDeviceID( char *envName ) +{ + PaDeviceIndex recommendedIndex = paNoDevice; + DWORD hresult; + char envbuf[PA_ENV_BUF_SIZE_]; + +#ifndef WIN32_PLATFORM_PSPC /* no GetEnvironmentVariable on PocketPC */ + + /* Let user determine default device by setting environment variable. */ + hresult = GetEnvironmentVariable( envName, envbuf, PA_ENV_BUF_SIZE_ ); + if( (hresult > 0) && (hresult < PA_ENV_BUF_SIZE_) ) + { + recommendedIndex = atoi( envbuf ); + } +#endif + + return recommendedIndex; +} + + +static void InitializeDefaultDeviceIdsFromEnv( PaWinMmeHostApiRepresentation *hostApi ) +{ + PaDeviceIndex device; + + /* input */ + device = GetEnvDefaultDeviceID( PA_REC_IN_DEV_ENV_NAME_ ); + if( device != paNoDevice && + ( device >= 0 && device < hostApi->inheritedHostApiRep.info.deviceCount ) && + hostApi->inheritedHostApiRep.deviceInfos[ device ]->maxInputChannels > 0 ) + { + hostApi->inheritedHostApiRep.info.defaultInputDevice = device; + } + + /* output */ + device = GetEnvDefaultDeviceID( PA_REC_OUT_DEV_ENV_NAME_ ); + if( device != paNoDevice && + ( device >= 0 && device < hostApi->inheritedHostApiRep.info.deviceCount ) && + hostApi->inheritedHostApiRep.deviceInfos[ device ]->maxOutputChannels > 0 ) + { + hostApi->inheritedHostApiRep.info.defaultOutputDevice = device; + } +} + + +/** Convert external PA ID to a windows multimedia device ID +*/ +static UINT LocalDeviceIndexToWinMmeDeviceId( PaWinMmeHostApiRepresentation *hostApi, PaDeviceIndex device ) +{ + assert( device >= 0 && device < hostApi->inputDeviceCount + hostApi->outputDeviceCount ); + + return hostApi->winMmeDeviceIds[ device ]; +} + + +static PaError QueryInputWaveFormatEx( int deviceId, WAVEFORMATEX *waveFormatEx ) +{ + MMRESULT mmresult; + + switch( mmresult = waveInOpen( NULL, deviceId, waveFormatEx, 0, 0, WAVE_FORMAT_QUERY ) ) + { + case MMSYSERR_NOERROR: + return paNoError; + case MMSYSERR_ALLOCATED: /* Specified resource is already allocated. */ + return paDeviceUnavailable; + case MMSYSERR_NODRIVER: /* No device driver is present. */ + return paDeviceUnavailable; + case MMSYSERR_NOMEM: /* Unable to allocate or lock memory. */ + return paInsufficientMemory; + case WAVERR_BADFORMAT: /* Attempted to open with an unsupported waveform-audio format. */ + return paSampleFormatNotSupported; + + case MMSYSERR_BADDEVICEID: /* Specified device identifier is out of range. */ + /* falls through */ + default: + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + return paUnanticipatedHostError; + } +} + + +static PaError QueryOutputWaveFormatEx( int deviceId, WAVEFORMATEX *waveFormatEx ) +{ + MMRESULT mmresult; + + switch( mmresult = waveOutOpen( NULL, deviceId, waveFormatEx, 0, 0, WAVE_FORMAT_QUERY ) ) + { + case MMSYSERR_NOERROR: + return paNoError; + case MMSYSERR_ALLOCATED: /* Specified resource is already allocated. */ + return paDeviceUnavailable; + case MMSYSERR_NODRIVER: /* No device driver is present. */ + return paDeviceUnavailable; + case MMSYSERR_NOMEM: /* Unable to allocate or lock memory. */ + return paInsufficientMemory; + case WAVERR_BADFORMAT: /* Attempted to open with an unsupported waveform-audio format. */ + return paSampleFormatNotSupported; + + case MMSYSERR_BADDEVICEID: /* Specified device identifier is out of range. */ + /* falls through */ + default: + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + return paUnanticipatedHostError; + } +} + + +static PaError QueryFormatSupported( PaDeviceInfo *deviceInfo, + PaError (*waveFormatExQueryFunction)(int, WAVEFORMATEX*), + int winMmeDeviceId, int channels, double sampleRate ) +{ + PaWinMmeDeviceInfo *winMmeDeviceInfo = (PaWinMmeDeviceInfo*)deviceInfo; + WAVEFORMATEX waveFormatEx; + + if( sampleRate == 11025.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1S16)) ) ){ + + return paNoError; + } + + if( sampleRate == 22050.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2S16)) ) ){ + + return paNoError; + } + + if( sampleRate == 44100.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4S16)) ) ){ + + return paNoError; + } + + waveFormatEx.wFormatTag = WAVE_FORMAT_PCM; + waveFormatEx.nChannels = (WORD)channels; + waveFormatEx.nSamplesPerSec = (DWORD)sampleRate; + waveFormatEx.nAvgBytesPerSec = waveFormatEx.nSamplesPerSec * channels * sizeof(short); + waveFormatEx.nBlockAlign = (WORD)(channels * sizeof(short)); + waveFormatEx.wBitsPerSample = 16; + waveFormatEx.cbSize = 0; + + return waveFormatExQueryFunction( winMmeDeviceId, &waveFormatEx ); +} + + +#define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ (13) /* must match array length below */ +static double defaultSampleRateSearchOrder_[] = + { 44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, 192000.0, + 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 }; + +static void DetectDefaultSampleRate( PaWinMmeDeviceInfo *winMmeDeviceInfo, int winMmeDeviceId, + PaError (*waveFormatExQueryFunction)(int, WAVEFORMATEX*), int maxChannels ) +{ + PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; + int i; + + deviceInfo->defaultSampleRate = 0.; + + for( i=0; i < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++i ) + { + double sampleRate = defaultSampleRateSearchOrder_[ i ]; + PaError paerror = QueryFormatSupported( deviceInfo, waveFormatExQueryFunction, winMmeDeviceId, maxChannels, sampleRate ); + if( paerror == paNoError ) + { + deviceInfo->defaultSampleRate = sampleRate; + break; + } + } +} + + +static PaError InitializeInputDeviceInfo( PaWinMmeHostApiRepresentation *winMmeHostApi, + PaWinMmeDeviceInfo *winMmeDeviceInfo, UINT winMmeInputDeviceId, int *success ) +{ + PaError result = paNoError; + char *deviceName; /* non-const ptr */ + MMRESULT mmresult; + WAVEINCAPS wic; + PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; + + *success = 0; + + mmresult = waveInGetDevCaps( winMmeInputDeviceId, &wic, sizeof( WAVEINCAPS ) ); + if( mmresult == MMSYSERR_NOMEM ) + { + result = paInsufficientMemory; + goto error; + } + else if( mmresult != MMSYSERR_NOERROR ) + { + /* instead of returning paUnanticipatedHostError we return + paNoError, but leave success set as 0. This allows + Pa_Initialize to just ignore this device, without failing + the entire initialisation process. + */ + return paNoError; + } + + if( winMmeInputDeviceId == WAVE_MAPPER ) + { + /* Append I/O suffix to WAVE_MAPPER device. */ + deviceName = (char *)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, strlen( wic.szPname ) + 1 + sizeof(constInputMapperSuffix_) ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, wic.szPname ); + strcat( deviceName, constInputMapperSuffix_ ); + } + else + { + deviceName = (char*)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, strlen( wic.szPname ) + 1 ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, wic.szPname ); + } + deviceInfo->name = deviceName; + + deviceInfo->maxInputChannels = wic.wChannels; + /* Sometimes a device can return a rediculously large number of channels. + * This happened with an SBLive card on a Windows ME box. + * If that happens, then force it to 2 channels. PLB20010413 + */ + if( (deviceInfo->maxInputChannels < 1) || (deviceInfo->maxInputChannels > 256) ) + { + PA_DEBUG(("Pa_GetDeviceInfo: Num input channels reported as %d! Changed to 2.\n", deviceInfo->maxInputChannels )); + deviceInfo->maxInputChannels = 2; + } + + winMmeDeviceInfo->dwFormats = wic.dwFormats; + + DetectDefaultSampleRate( winMmeDeviceInfo, winMmeInputDeviceId, + QueryInputWaveFormatEx, deviceInfo->maxInputChannels ); + + *success = 1; + +error: + return result; +} + + +static PaError InitializeOutputDeviceInfo( PaWinMmeHostApiRepresentation *winMmeHostApi, + PaWinMmeDeviceInfo *winMmeDeviceInfo, UINT winMmeOutputDeviceId, int *success ) +{ + PaError result = paNoError; + char *deviceName; /* non-const ptr */ + MMRESULT mmresult; + WAVEOUTCAPS woc; + PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; + + *success = 0; + + mmresult = waveOutGetDevCaps( winMmeOutputDeviceId, &woc, sizeof( WAVEOUTCAPS ) ); + if( mmresult == MMSYSERR_NOMEM ) + { + result = paInsufficientMemory; + goto error; + } + else if( mmresult != MMSYSERR_NOERROR ) + { + /* instead of returning paUnanticipatedHostError we return + paNoError, but leave success set as 0. This allows + Pa_Initialize to just ignore this device, without failing + the entire initialisation process. + */ + return paNoError; + } + + if( winMmeOutputDeviceId == WAVE_MAPPER ) + { + /* Append I/O suffix to WAVE_MAPPER device. */ + deviceName = (char *)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, strlen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, woc.szPname ); + strcat( deviceName, constOutputMapperSuffix_ ); + } + else + { + deviceName = (char*)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, strlen( woc.szPname ) + 1 ); + if( !deviceName ) + { + result = paInsufficientMemory; + goto error; + } + strcpy( deviceName, woc.szPname ); + } + deviceInfo->name = deviceName; + + deviceInfo->maxOutputChannels = woc.wChannels; + /* Sometimes a device can return a rediculously large number of channels. + * This happened with an SBLive card on a Windows ME box. + * It also happens on Win XP! + */ + if( (deviceInfo->maxOutputChannels < 1) || (deviceInfo->maxOutputChannels > 256) ) + { + PA_DEBUG(("Pa_GetDeviceInfo: Num output channels reported as %d! Changed to 2.\n", deviceInfo->maxOutputChannels )); + deviceInfo->maxOutputChannels = 2; + } + + winMmeDeviceInfo->dwFormats = woc.dwFormats; + + DetectDefaultSampleRate( winMmeDeviceInfo, winMmeOutputDeviceId, + QueryOutputWaveFormatEx, deviceInfo->maxOutputChannels ); + + *success = 1; + +error: + return result; +} + + +static void GetDefaultLatencies( PaTime *defaultLowLatency, PaTime *defaultHighLatency ) +{ + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize = sizeof( osvi ); + GetVersionEx( &osvi ); + + /* Check for NT */ + if( (osvi.dwMajorVersion == 4) && (osvi.dwPlatformId == 2) ) + { + *defaultLowLatency = PA_MME_WIN_NT_DEFAULT_LATENCY_; + } + else if(osvi.dwMajorVersion >= 5) + { + *defaultLowLatency = PA_MME_WIN_WDM_DEFAULT_LATENCY_; + } + else + { + *defaultLowLatency = PA_MME_WIN_9X_DEFAULT_LATENCY_; + } + + *defaultHighLatency = *defaultLowLatency * 2; +} + + +PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) +{ + PaError result = paNoError; + int i; + PaWinMmeHostApiRepresentation *winMmeHostApi; + int inputDeviceCount, outputDeviceCount, maximumPossibleDeviceCount; + PaWinMmeDeviceInfo *deviceInfoArray; + int deviceInfoInitializationSucceeded; + PaTime defaultLowLatency, defaultHighLatency; + + winMmeHostApi = (PaWinMmeHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinMmeHostApiRepresentation) ); + if( !winMmeHostApi ) + { + result = paInsufficientMemory; + goto error; + } + + winMmeHostApi->allocations = PaUtil_CreateAllocationGroup(); + if( !winMmeHostApi->allocations ) + { + result = paInsufficientMemory; + goto error; + } + + *hostApi = &winMmeHostApi->inheritedHostApiRep; + (*hostApi)->info.structVersion = 1; + (*hostApi)->info.type = paMME; + (*hostApi)->info.name = "MME"; + + + /* initialise device counts and default devices under the assumption that + there are no devices. These values are incremented below if and when + devices are successfully initialized. + */ + (*hostApi)->info.deviceCount = 0; + (*hostApi)->info.defaultInputDevice = paNoDevice; + (*hostApi)->info.defaultOutputDevice = paNoDevice; + winMmeHostApi->inputDeviceCount = 0; + winMmeHostApi->outputDeviceCount = 0; + + + maximumPossibleDeviceCount = 0; + + inputDeviceCount = waveInGetNumDevs(); + if( inputDeviceCount > 0 ) + maximumPossibleDeviceCount += inputDeviceCount + 1; /* assume there is a WAVE_MAPPER */ + + outputDeviceCount = waveOutGetNumDevs(); + if( outputDeviceCount > 0 ) + maximumPossibleDeviceCount += outputDeviceCount + 1; /* assume there is a WAVE_MAPPER */ + + + if( maximumPossibleDeviceCount > 0 ){ + + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, sizeof(PaDeviceInfo*) * maximumPossibleDeviceCount ); + if( !(*hostApi)->deviceInfos ) + { + result = paInsufficientMemory; + goto error; + } + + /* allocate all device info structs in a contiguous block */ + deviceInfoArray = (PaWinMmeDeviceInfo*)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, sizeof(PaWinMmeDeviceInfo) * maximumPossibleDeviceCount ); + if( !deviceInfoArray ) + { + result = paInsufficientMemory; + goto error; + } + + winMmeHostApi->winMmeDeviceIds = (UINT*)PaUtil_GroupAllocateMemory( + winMmeHostApi->allocations, sizeof(int) * maximumPossibleDeviceCount ); + if( !winMmeHostApi->winMmeDeviceIds ) + { + result = paInsufficientMemory; + goto error; + } + + GetDefaultLatencies( &defaultLowLatency, &defaultHighLatency ); + + if( inputDeviceCount > 0 ){ + /* -1 is the WAVE_MAPPER */ + for( i = -1; i < inputDeviceCount; ++i ){ + UINT winMmeDeviceId = (UINT)((i==-1) ? WAVE_MAPPER : i); + PaWinMmeDeviceInfo *wmmeDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ]; + PaDeviceInfo *deviceInfo = &wmmeDeviceInfo->inheritedDeviceInfo; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + deviceInfo->maxInputChannels = 0; + deviceInfo->maxOutputChannels = 0; + + deviceInfo->defaultLowInputLatency = defaultLowLatency; + deviceInfo->defaultLowOutputLatency = defaultLowLatency; + deviceInfo->defaultHighInputLatency = defaultHighLatency; + deviceInfo->defaultHighOutputLatency = defaultHighLatency; + + result = InitializeInputDeviceInfo( winMmeHostApi, wmmeDeviceInfo, + winMmeDeviceId, &deviceInfoInitializationSucceeded ); + if( result != paNoError ) + goto error; + + if( deviceInfoInitializationSucceeded ){ + if( (*hostApi)->info.defaultInputDevice == paNoDevice ) + (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; + + winMmeHostApi->winMmeDeviceIds[ (*hostApi)->info.deviceCount ] = winMmeDeviceId; + (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo; + + winMmeHostApi->inputDeviceCount++; + (*hostApi)->info.deviceCount++; + } + } + } + + if( outputDeviceCount > 0 ){ + /* -1 is the WAVE_MAPPER */ + for( i = -1; i < outputDeviceCount; ++i ){ + UINT winMmeDeviceId = (UINT)((i==-1) ? WAVE_MAPPER : i); + PaWinMmeDeviceInfo *wmmeDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ]; + PaDeviceInfo *deviceInfo = &wmmeDeviceInfo->inheritedDeviceInfo; + deviceInfo->structVersion = 2; + deviceInfo->hostApi = hostApiIndex; + + deviceInfo->maxInputChannels = 0; + deviceInfo->maxOutputChannels = 0; + + deviceInfo->defaultLowInputLatency = defaultLowLatency; + deviceInfo->defaultLowOutputLatency = defaultLowLatency; + deviceInfo->defaultHighInputLatency = defaultHighLatency; + deviceInfo->defaultHighOutputLatency = defaultHighLatency; + + result = InitializeOutputDeviceInfo( winMmeHostApi, wmmeDeviceInfo, + winMmeDeviceId, &deviceInfoInitializationSucceeded ); + if( result != paNoError ) + goto error; + + if( deviceInfoInitializationSucceeded ){ + if( (*hostApi)->info.defaultOutputDevice == paNoDevice ) + (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount; + + winMmeHostApi->winMmeDeviceIds[ (*hostApi)->info.deviceCount ] = winMmeDeviceId; + (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo; + + winMmeHostApi->outputDeviceCount++; + (*hostApi)->info.deviceCount++; + } + } + } + } + + + InitializeDefaultDeviceIdsFromEnv( winMmeHostApi ); + + (*hostApi)->Terminate = Terminate; + (*hostApi)->OpenStream = OpenStream; + (*hostApi)->IsFormatSupported = IsFormatSupported; + + PaUtil_InitializeStreamInterface( &winMmeHostApi->callbackStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, GetStreamCpuLoad, + PaUtil_DummyRead, PaUtil_DummyWrite, + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); + + PaUtil_InitializeStreamInterface( &winMmeHostApi->blockingStreamInterface, CloseStream, StartStream, + StopStream, AbortStream, IsStreamStopped, IsStreamActive, + GetStreamTime, PaUtil_DummyGetCpuLoad, + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); + + return result; + +error: + if( winMmeHostApi ) + { + if( winMmeHostApi->allocations ) + { + PaUtil_FreeAllAllocations( winMmeHostApi->allocations ); + PaUtil_DestroyAllocationGroup( winMmeHostApi->allocations ); + } + + PaUtil_FreeMemory( winMmeHostApi ); + } + + return result; +} + + +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) +{ + PaWinMmeHostApiRepresentation *winMmeHostApi = (PaWinMmeHostApiRepresentation*)hostApi; + + if( winMmeHostApi->allocations ) + { + PaUtil_FreeAllAllocations( winMmeHostApi->allocations ); + PaUtil_DestroyAllocationGroup( winMmeHostApi->allocations ); + } + + PaUtil_FreeMemory( winMmeHostApi ); +} + + +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ) +{ + PaWinMmeHostApiRepresentation *winMmeHostApi = (PaWinMmeHostApiRepresentation*)hostApi; + PaDeviceInfo *inputDeviceInfo, *outputDeviceInfo; + int inputChannelCount, outputChannelCount; + int inputMultipleDeviceChannelCount, outputMultipleDeviceChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + PaWinMmeStreamInfo *inputStreamInfo, *outputStreamInfo; + UINT winMmeInputDeviceId, winMmeOutputDeviceId; + unsigned int i; + PaError paerror; + + /* The calls to QueryFormatSupported below are intended to detect invalid + sample rates. If we assume that the channel count and format are OK, + then the only thing that could fail is the sample rate. This isn't + strictly true, but I can't think of a better way to test that the + sample rate is valid. + */ + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + inputStreamInfo = inputParameters->hostApiSpecificStreamInfo; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( inputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification + && inputStreamInfo && (inputStreamInfo->flags & paWinMmeUseMultipleDevices) ) + { + inputMultipleDeviceChannelCount = 0; + for( i=0; i< inputStreamInfo->deviceCount; ++i ) + { + inputMultipleDeviceChannelCount += inputStreamInfo->devices[i].channelCount; + + inputDeviceInfo = hostApi->deviceInfos[ inputStreamInfo->devices[i].device ]; + + /* check that input device can support inputChannelCount */ + if( inputStreamInfo->devices[i].channelCount <= 0 + || inputStreamInfo->devices[i].channelCount > inputDeviceInfo->maxInputChannels ) + return paInvalidChannelCount; + + /* test for valid sample rate, see comment above */ + winMmeInputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, inputStreamInfo->devices[i].device ); + paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, winMmeInputDeviceId, inputStreamInfo->devices[i].channelCount, sampleRate ); + if( paerror != paNoError ) + return paInvalidSampleRate; + } + + if( inputMultipleDeviceChannelCount != inputChannelCount ) + return paIncompatibleHostApiSpecificStreamInfo; + } + else + { + if( inputStreamInfo && (inputStreamInfo->flags & paWinMmeUseMultipleDevices) ) + return paIncompatibleHostApiSpecificStreamInfo; /* paUseHostApiSpecificDeviceSpecification was not supplied as the input device */ + + inputDeviceInfo = hostApi->deviceInfos[ inputParameters->device ]; + + /* check that input device can support inputChannelCount */ + if( inputChannelCount > inputDeviceInfo->maxInputChannels ) + return paInvalidChannelCount; + + /* test for valid sample rate, see comment above */ + winMmeInputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, inputParameters->device ); + paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, winMmeInputDeviceId, inputChannelCount, sampleRate ); + if( paerror != paNoError ) + return paInvalidSampleRate; + } + } + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + outputStreamInfo = outputParameters->hostApiSpecificStreamInfo; + + /* all standard sample formats are supported by the buffer adapter, + this implementation doesn't support any custom sample formats */ + if( outputSampleFormat & paCustomFormat ) + return paSampleFormatNotSupported; + + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification + && outputStreamInfo && (outputStreamInfo->flags & paWinMmeUseMultipleDevices) ) + { + outputMultipleDeviceChannelCount = 0; + for( i=0; i< outputStreamInfo->deviceCount; ++i ) + { + outputMultipleDeviceChannelCount += outputStreamInfo->devices[i].channelCount; + + outputDeviceInfo = hostApi->deviceInfos[ outputStreamInfo->devices[i].device ]; + + /* check that output device can support outputChannelCount */ + if( outputStreamInfo->devices[i].channelCount <= 0 + || outputStreamInfo->devices[i].channelCount > outputDeviceInfo->maxOutputChannels ) + return paInvalidChannelCount; + + /* test for valid sample rate, see comment above */ + winMmeOutputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, outputStreamInfo->devices[i].device ); + paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, winMmeOutputDeviceId, outputStreamInfo->devices[i].channelCount, sampleRate ); + if( paerror != paNoError ) + return paInvalidSampleRate; + } + + if( outputMultipleDeviceChannelCount != outputChannelCount ) + return paIncompatibleHostApiSpecificStreamInfo; + } + else + { + if( outputStreamInfo && (outputStreamInfo->flags & paWinMmeUseMultipleDevices) ) + return paIncompatibleHostApiSpecificStreamInfo; /* paUseHostApiSpecificDeviceSpecification was not supplied as the output device */ + + outputDeviceInfo = hostApi->deviceInfos[ outputParameters->device ]; + + /* check that output device can support outputChannelCount */ + if( outputChannelCount > outputDeviceInfo->maxOutputChannels ) + return paInvalidChannelCount; + + /* test for valid sample rate, see comment above */ + winMmeOutputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, outputParameters->device ); + paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, winMmeOutputDeviceId, outputChannelCount, sampleRate ); + if( paerror != paNoError ) + return paInvalidSampleRate; + } + } + + /* + - if a full duplex stream is requested, check that the combination + of input and output parameters is supported + + - check that the device supports sampleRate + + for mme all we can do is test that the input and output devices + support the requested sample rate and number of channels. we + cannot test for full duplex compatibility. + */ + + return paFormatIsSupported; +} + + + +static void SelectBufferSizeAndCount( unsigned long baseBufferSize, + unsigned long requestedLatency, + unsigned long baseBufferCount, unsigned long minimumBufferCount, + unsigned long maximumBufferSize, unsigned long *hostBufferSize, + unsigned long *hostBufferCount ) +{ + unsigned long sizeMultiplier, bufferCount, latency; + unsigned long nextLatency, nextBufferSize; + int baseBufferSizeIsPowerOfTwo; + + sizeMultiplier = 1; + bufferCount = baseBufferCount; + + /* count-1 below because latency is always determined by one less + than the total number of buffers. + */ + latency = (baseBufferSize * sizeMultiplier) * (bufferCount-1); + + if( latency > requestedLatency ) + { + + /* reduce number of buffers without falling below suggested latency */ + + nextLatency = (baseBufferSize * sizeMultiplier) * (bufferCount-2); + while( bufferCount > minimumBufferCount && nextLatency >= requestedLatency ) + { + --bufferCount; + nextLatency = (baseBufferSize * sizeMultiplier) * (bufferCount-2); + } + + }else if( latency < requestedLatency ){ + + baseBufferSizeIsPowerOfTwo = (! (baseBufferSize & (baseBufferSize - 1))); + if( baseBufferSizeIsPowerOfTwo ){ + + /* double size of buffers without exceeding requestedLatency */ + + nextBufferSize = (baseBufferSize * (sizeMultiplier*2)); + nextLatency = nextBufferSize * (bufferCount-1); + while( nextBufferSize <= maximumBufferSize + && nextLatency < requestedLatency ) + { + sizeMultiplier *= 2; + nextBufferSize = (baseBufferSize * (sizeMultiplier*2)); + nextLatency = nextBufferSize * (bufferCount-1); + } + + }else{ + + /* increase size of buffers upto first excess of requestedLatency */ + + nextBufferSize = (baseBufferSize * (sizeMultiplier+1)); + nextLatency = nextBufferSize * (bufferCount-1); + while( nextBufferSize <= maximumBufferSize + && nextLatency < requestedLatency ) + { + ++sizeMultiplier; + nextBufferSize = (baseBufferSize * (sizeMultiplier+1)); + nextLatency = nextBufferSize * (bufferCount-1); + } + + if( nextLatency < requestedLatency ) + ++sizeMultiplier; + } + + /* increase number of buffers until requestedLatency is reached */ + + latency = (baseBufferSize * sizeMultiplier) * (bufferCount-1); + while( latency < requestedLatency ) + { + ++bufferCount; + latency = (baseBufferSize * sizeMultiplier) * (bufferCount-1); + } + } + + *hostBufferSize = baseBufferSize * sizeMultiplier; + *hostBufferCount = bufferCount; +} + + +static void ReselectBufferCount( unsigned long bufferSize, + unsigned long requestedLatency, + unsigned long baseBufferCount, unsigned long minimumBufferCount, + unsigned long *hostBufferCount ) +{ + unsigned long bufferCount, latency; + unsigned long nextLatency; + + bufferCount = baseBufferCount; + + /* count-1 below because latency is always determined by one less + than the total number of buffers. + */ + latency = bufferSize * (bufferCount-1); + + if( latency > requestedLatency ) + { + /* reduce number of buffers without falling below suggested latency */ + + nextLatency = bufferSize * (bufferCount-2); + while( bufferCount > minimumBufferCount && nextLatency >= requestedLatency ) + { + --bufferCount; + nextLatency = bufferSize * (bufferCount-2); + } + + }else if( latency < requestedLatency ){ + + /* increase number of buffers until requestedLatency is reached */ + + latency = bufferSize * (bufferCount-1); + while( latency < requestedLatency ) + { + ++bufferCount; + latency = bufferSize * (bufferCount-1); + } + } + + *hostBufferCount = bufferCount; +} + + +/* CalculateBufferSettings() fills the framesPerHostInputBuffer, hostInputBufferCount, + framesPerHostOutputBuffer and hostOutputBufferCount parameters based on the values + of the other parameters. +*/ + +static PaError CalculateBufferSettings( + unsigned long *framesPerHostInputBuffer, unsigned long *hostInputBufferCount, + unsigned long *framesPerHostOutputBuffer, unsigned long *hostOutputBufferCount, + int inputChannelCount, PaSampleFormat hostInputSampleFormat, + PaTime suggestedInputLatency, PaWinMmeStreamInfo *inputStreamInfo, + int outputChannelCount, PaSampleFormat hostOutputSampleFormat, + PaTime suggestedOutputLatency, PaWinMmeStreamInfo *outputStreamInfo, + double sampleRate, unsigned long framesPerBuffer ) +{ + PaError result = paNoError; + int effectiveInputChannelCount, effectiveOutputChannelCount; + int hostInputFrameSize = 0; + unsigned int i; + + if( inputChannelCount > 0 ) + { + int hostInputSampleSize = Pa_GetSampleSize( hostInputSampleFormat ); + if( hostInputSampleSize < 0 ) + { + result = hostInputSampleSize; + goto error; + } + + if( inputStreamInfo + && ( inputStreamInfo->flags & paWinMmeUseMultipleDevices ) ) + { + /* set effectiveInputChannelCount to the largest number of + channels on any one device. + */ + effectiveInputChannelCount = 0; + for( i=0; i< inputStreamInfo->deviceCount; ++i ) + { + if( inputStreamInfo->devices[i].channelCount > effectiveInputChannelCount ) + effectiveInputChannelCount = inputStreamInfo->devices[i].channelCount; + } + } + else + { + effectiveInputChannelCount = inputChannelCount; + } + + hostInputFrameSize = hostInputSampleSize * effectiveInputChannelCount; + + if( inputStreamInfo + && ( inputStreamInfo->flags & paWinMmeUseLowLevelLatencyParameters ) ) + { + if( inputStreamInfo->bufferCount <= 0 + || inputStreamInfo->framesPerBuffer <= 0 ) + { + result = paIncompatibleHostApiSpecificStreamInfo; + goto error; + } + + *framesPerHostInputBuffer = inputStreamInfo->framesPerBuffer; + *hostInputBufferCount = inputStreamInfo->bufferCount; + } + else + { + unsigned long hostBufferSizeBytes, hostBufferCount; + unsigned long minimumBufferCount = (outputChannelCount > 0) + ? PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_ + : PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_HALF_DUPLEX_; + + unsigned long maximumBufferSize = (long) ((PA_MME_MAX_HOST_BUFFER_SECS_ * sampleRate) * hostInputFrameSize); + if( maximumBufferSize > PA_MME_MAX_HOST_BUFFER_BYTES_ ) + maximumBufferSize = PA_MME_MAX_HOST_BUFFER_BYTES_; + + /* compute the following in bytes, then convert back to frames */ + + SelectBufferSizeAndCount( + ((framesPerBuffer == paFramesPerBufferUnspecified) + ? PA_MME_MIN_HOST_BUFFER_FRAMES_WHEN_UNSPECIFIED_ + : framesPerBuffer ) * hostInputFrameSize, /* baseBufferSize */ + ((unsigned long)(suggestedInputLatency * sampleRate)) * hostInputFrameSize, /* suggestedLatency */ + 4, /* baseBufferCount */ + minimumBufferCount, maximumBufferSize, + &hostBufferSizeBytes, &hostBufferCount ); + + *framesPerHostInputBuffer = hostBufferSizeBytes / hostInputFrameSize; + *hostInputBufferCount = hostBufferCount; + } + } + else + { + *framesPerHostInputBuffer = 0; + *hostInputBufferCount = 0; + } + + if( outputChannelCount > 0 ) + { + if( outputStreamInfo + && ( outputStreamInfo->flags & paWinMmeUseLowLevelLatencyParameters ) ) + { + if( outputStreamInfo->bufferCount <= 0 + || outputStreamInfo->framesPerBuffer <= 0 ) + { + result = paIncompatibleHostApiSpecificStreamInfo; + goto error; + } + + *framesPerHostOutputBuffer = outputStreamInfo->framesPerBuffer; + *hostOutputBufferCount = outputStreamInfo->bufferCount; + + + if( inputChannelCount > 0 ) /* full duplex */ + { + if( *framesPerHostInputBuffer != *framesPerHostOutputBuffer ) + { + if( inputStreamInfo + && ( inputStreamInfo->flags & paWinMmeUseLowLevelLatencyParameters ) ) + { + /* a custom StreamInfo was used for specifying both input + and output buffer sizes, the larger buffer size + must be a multiple of the smaller buffer size */ + + if( *framesPerHostInputBuffer < *framesPerHostOutputBuffer ) + { + if( *framesPerHostOutputBuffer % *framesPerHostInputBuffer != 0 ) + { + result = paIncompatibleHostApiSpecificStreamInfo; + goto error; + } + } + else + { + assert( *framesPerHostInputBuffer > *framesPerHostOutputBuffer ); + if( *framesPerHostInputBuffer % *framesPerHostOutputBuffer != 0 ) + { + result = paIncompatibleHostApiSpecificStreamInfo; + goto error; + } + } + } + else + { + /* a custom StreamInfo was not used for specifying the input buffer size, + so use the output buffer size, and approximately the same latency. */ + + *framesPerHostInputBuffer = *framesPerHostOutputBuffer; + *hostInputBufferCount = (((unsigned long)(suggestedInputLatency * sampleRate)) / *framesPerHostInputBuffer) + 1; + + if( *hostInputBufferCount < PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_ ) + *hostInputBufferCount = PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_; + } + } + } + } + else + { + unsigned long hostBufferSizeBytes, hostBufferCount; + unsigned long minimumBufferCount = PA_MME_MIN_HOST_OUTPUT_BUFFER_COUNT_; + unsigned long maximumBufferSize; + int hostOutputFrameSize; + int hostOutputSampleSize; + + hostOutputSampleSize = Pa_GetSampleSize( hostOutputSampleFormat ); + if( hostOutputSampleSize < 0 ) + { + result = hostOutputSampleSize; + goto error; + } + + if( outputStreamInfo + && ( outputStreamInfo->flags & paWinMmeUseMultipleDevices ) ) + { + /* set effectiveOutputChannelCount to the largest number of + channels on any one device. + */ + effectiveOutputChannelCount = 0; + for( i=0; i< outputStreamInfo->deviceCount; ++i ) + { + if( outputStreamInfo->devices[i].channelCount > effectiveOutputChannelCount ) + effectiveOutputChannelCount = outputStreamInfo->devices[i].channelCount; + } + } + else + { + effectiveOutputChannelCount = outputChannelCount; + } + + hostOutputFrameSize = hostOutputSampleSize * effectiveOutputChannelCount; + + maximumBufferSize = (long) ((PA_MME_MAX_HOST_BUFFER_SECS_ * sampleRate) * hostOutputFrameSize); + if( maximumBufferSize > PA_MME_MAX_HOST_BUFFER_BYTES_ ) + maximumBufferSize = PA_MME_MAX_HOST_BUFFER_BYTES_; + + + /* compute the following in bytes, then convert back to frames */ + + SelectBufferSizeAndCount( + ((framesPerBuffer == paFramesPerBufferUnspecified) + ? PA_MME_MIN_HOST_BUFFER_FRAMES_WHEN_UNSPECIFIED_ + : framesPerBuffer ) * hostOutputFrameSize, /* baseBufferSize */ + ((unsigned long)(suggestedOutputLatency * sampleRate)) * hostOutputFrameSize, /* suggestedLatency */ + 4, /* baseBufferCount */ + minimumBufferCount, + maximumBufferSize, + &hostBufferSizeBytes, &hostBufferCount ); + + *framesPerHostOutputBuffer = hostBufferSizeBytes / hostOutputFrameSize; + *hostOutputBufferCount = hostBufferCount; + + + if( inputChannelCount > 0 ) + { + /* ensure that both input and output buffer sizes are the same. + if they don't match at this stage, choose the smallest one + and use that for input and output + */ + + if( *framesPerHostOutputBuffer != *framesPerHostInputBuffer ) + { + if( framesPerHostInputBuffer < framesPerHostOutputBuffer ) + { + unsigned long framesPerHostBuffer = *framesPerHostInputBuffer; + + minimumBufferCount = PA_MME_MIN_HOST_OUTPUT_BUFFER_COUNT_; + ReselectBufferCount( + framesPerHostBuffer * hostOutputFrameSize, /* bufferSize */ + ((unsigned long)(suggestedOutputLatency * sampleRate)) * hostOutputFrameSize, /* suggestedLatency */ + 4, /* baseBufferCount */ + minimumBufferCount, + &hostBufferCount ); + + *framesPerHostOutputBuffer = framesPerHostBuffer; + *hostOutputBufferCount = hostBufferCount; + } + else + { + unsigned long framesPerHostBuffer = *framesPerHostOutputBuffer; + + minimumBufferCount = PA_MME_MIN_HOST_INPUT_BUFFER_COUNT_FULL_DUPLEX_; + ReselectBufferCount( + framesPerHostBuffer * hostInputFrameSize, /* bufferSize */ + ((unsigned long)(suggestedInputLatency * sampleRate)) * hostInputFrameSize, /* suggestedLatency */ + 4, /* baseBufferCount */ + minimumBufferCount, + &hostBufferCount ); + + *framesPerHostInputBuffer = framesPerHostBuffer; + *hostInputBufferCount = hostBufferCount; + } + } + } + } + } + else + { + *framesPerHostOutputBuffer = 0; + *hostOutputBufferCount = 0; + } + +error: + return result; +} + + +typedef struct +{ + HANDLE bufferEvent; + void *waveHandles; + unsigned int deviceCount; + /* unsigned int channelCount; */ + WAVEHDR **waveHeaders; /* waveHeaders[device][buffer] */ + unsigned int bufferCount; + unsigned int currentBufferIndex; + unsigned int framesPerBuffer; + unsigned int framesUsedInCurrentBuffer; +}PaWinMmeSingleDirectionHandlesAndBuffers; + +/* prototypes for functions operating on PaWinMmeSingleDirectionHandlesAndBuffers */ + +static void InitializeSingleDirectionHandlesAndBuffers( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ); +static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostApi, + PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long bytesPerHostSample, + double sampleRate, PaWinMmeDeviceAndChannelCount *devices, + unsigned int deviceCount, int isInput ); +static PaError TerminateWaveHandles( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, int isInput, int currentlyProcessingAnError ); +static PaError InitializeWaveHeaders( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long hostBufferCount, + PaSampleFormat hostSampleFormat, + unsigned long framesPerHostBuffer, + PaWinMmeDeviceAndChannelCount *devices, + int isInput ); +static void TerminateWaveHeaders( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, int isInput ); + + +static void InitializeSingleDirectionHandlesAndBuffers( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ) +{ + handlesAndBuffers->bufferEvent = 0; + handlesAndBuffers->waveHandles = 0; + handlesAndBuffers->deviceCount = 0; + handlesAndBuffers->waveHeaders = 0; + handlesAndBuffers->bufferCount = 0; +} + +static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostApi, + PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long bytesPerHostSample, + double sampleRate, PaWinMmeDeviceAndChannelCount *devices, + unsigned int deviceCount, int isInput ) +{ + PaError result; + MMRESULT mmresult; + unsigned long bytesPerFrame; + WAVEFORMATEX wfx; + signed int i; + + /* for error cleanup we expect that InitializeSingleDirectionHandlesAndBuffers() + has already been called to zero some fields */ + + result = CreateEventWithPaError( &handlesAndBuffers->bufferEvent, NULL, FALSE, FALSE, NULL ); + if( result != paNoError ) goto error; + + if( isInput ) + handlesAndBuffers->waveHandles = (void*)PaUtil_AllocateMemory( sizeof(HWAVEIN) * deviceCount ); + else + handlesAndBuffers->waveHandles = (void*)PaUtil_AllocateMemory( sizeof(HWAVEOUT) * deviceCount ); + if( !handlesAndBuffers->waveHandles ) + { + result = paInsufficientMemory; + goto error; + } + + handlesAndBuffers->deviceCount = deviceCount; + + for( i = 0; i < (signed int)deviceCount; ++i ) + { + if( isInput ) + ((HWAVEIN*)handlesAndBuffers->waveHandles)[i] = 0; + else + ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i] = 0; + } + + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nSamplesPerSec = (DWORD) sampleRate; + wfx.cbSize = 0; + + for( i = 0; i < (signed int)deviceCount; ++i ) + { + UINT winMmeDeviceId; + + winMmeDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, devices[i].device ); + wfx.nChannels = (WORD)devices[i].channelCount; + + bytesPerFrame = wfx.nChannels * bytesPerHostSample; + + wfx.nAvgBytesPerSec = (DWORD)(bytesPerFrame * sampleRate); + wfx.nBlockAlign = (WORD)bytesPerFrame; + wfx.wBitsPerSample = (WORD)((bytesPerFrame/wfx.nChannels) * 8); + + /* REVIEW: consider not firing an event for input when a full duplex + stream is being used. this would probably depend on the + neverDropInput flag. */ + + if( isInput ) + mmresult = waveInOpen( &((HWAVEIN*)handlesAndBuffers->waveHandles)[i], winMmeDeviceId, &wfx, + (DWORD_PTR)handlesAndBuffers->bufferEvent, (DWORD_PTR)0, CALLBACK_EVENT ); + else + mmresult = waveOutOpen( &((HWAVEOUT*)handlesAndBuffers->waveHandles)[i], winMmeDeviceId, &wfx, + (DWORD_PTR)handlesAndBuffers->bufferEvent, (DWORD_PTR)0, CALLBACK_EVENT ); + + if( mmresult != MMSYSERR_NOERROR ) + { + switch( mmresult ) + { + case MMSYSERR_ALLOCATED: /* Specified resource is already allocated. */ + result = paDeviceUnavailable; + break; + case MMSYSERR_NODRIVER: /* No device driver is present. */ + result = paDeviceUnavailable; + break; + case MMSYSERR_NOMEM: /* Unable to allocate or lock memory. */ + result = paInsufficientMemory; + break; + + case MMSYSERR_BADDEVICEID: /* Specified device identifier is out of range. */ + /* falls through */ + case WAVERR_BADFORMAT: /* Attempted to open with an unsupported waveform-audio format. */ + /* falls through */ + default: + result = paUnanticipatedHostError; + if( isInput ) + { + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + } + else + { + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + } + } + goto error; + } + } + + return result; + +error: + TerminateWaveHandles( handlesAndBuffers, isInput, 1 /* currentlyProcessingAnError */ ); + + return result; +} + + +static PaError TerminateWaveHandles( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, int isInput, int currentlyProcessingAnError ) +{ + PaError result = paNoError; + MMRESULT mmresult; + signed int i; + + if( handlesAndBuffers->waveHandles ) + { + for( i = handlesAndBuffers->deviceCount-1; i >= 0; --i ) + { + if( isInput ) + { + if( ((HWAVEIN*)handlesAndBuffers->waveHandles)[i] ) + mmresult = waveInClose( ((HWAVEIN*)handlesAndBuffers->waveHandles)[i] ); + else + mmresult = MMSYSERR_NOERROR; + } + else + { + if( ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i] ) + mmresult = waveOutClose( ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i] ); + else + mmresult = MMSYSERR_NOERROR; + } + + if( mmresult != MMSYSERR_NOERROR && + !currentlyProcessingAnError ) /* don't update the error state if we're already processing an error */ + { + result = paUnanticipatedHostError; + if( isInput ) + { + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + } + else + { + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + } + /* note that we don't break here, we try to continue closing devices */ + } + } + + PaUtil_FreeMemory( handlesAndBuffers->waveHandles ); + handlesAndBuffers->waveHandles = 0; + } + + if( handlesAndBuffers->bufferEvent ) + { + result = CloseHandleWithPaError( handlesAndBuffers->bufferEvent ); + handlesAndBuffers->bufferEvent = 0; + } + + return result; +} + + +static PaError InitializeWaveHeaders( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long hostBufferCount, + PaSampleFormat hostSampleFormat, + unsigned long framesPerHostBuffer, + PaWinMmeDeviceAndChannelCount *devices, + int isInput ) +{ + PaError result = paNoError; + MMRESULT mmresult; + WAVEHDR *deviceWaveHeaders; + signed int i, j; + + /* for error cleanup we expect that InitializeSingleDirectionHandlesAndBuffers() + has already been called to zero some fields */ + + + /* allocate an array of pointers to arrays of wave headers, one array of + wave headers per device */ + handlesAndBuffers->waveHeaders = (WAVEHDR**)PaUtil_AllocateMemory( sizeof(WAVEHDR*) * handlesAndBuffers->deviceCount ); + if( !handlesAndBuffers->waveHeaders ) + { + result = paInsufficientMemory; + goto error; + } + + for( i = 0; i < (signed int)handlesAndBuffers->deviceCount; ++i ) + handlesAndBuffers->waveHeaders[i] = 0; + + handlesAndBuffers->bufferCount = hostBufferCount; + + for( i = 0; i < (signed int)handlesAndBuffers->deviceCount; ++i ) + { + int bufferBytes = Pa_GetSampleSize( hostSampleFormat ) * + framesPerHostBuffer * devices[i].channelCount; + if( bufferBytes < 0 ) + { + result = paInternalError; + goto error; + } + + /* Allocate an array of wave headers for device i */ + deviceWaveHeaders = (WAVEHDR *) PaUtil_AllocateMemory( sizeof(WAVEHDR)*hostBufferCount ); + if( !deviceWaveHeaders ) + { + result = paInsufficientMemory; + goto error; + } + + for( j=0; j < (signed int)hostBufferCount; ++j ) + deviceWaveHeaders[j].lpData = 0; + + handlesAndBuffers->waveHeaders[i] = deviceWaveHeaders; + + /* Allocate a buffer for each wave header */ + for( j=0; j < (signed int)hostBufferCount; ++j ) + { + deviceWaveHeaders[j].lpData = (char *)PaUtil_AllocateMemory( bufferBytes ); + if( !deviceWaveHeaders[j].lpData ) + { + result = paInsufficientMemory; + goto error; + } + deviceWaveHeaders[j].dwBufferLength = bufferBytes; + deviceWaveHeaders[j].dwUser = 0xFFFFFFFF; /* indicates that *PrepareHeader() has not yet been called, for error clean up code */ + + if( isInput ) + { + mmresult = waveInPrepareHeader( ((HWAVEIN*)handlesAndBuffers->waveHandles)[i], &deviceWaveHeaders[j], sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + goto error; + } + } + else /* output */ + { + mmresult = waveOutPrepareHeader( ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i], &deviceWaveHeaders[j], sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + goto error; + } + } + deviceWaveHeaders[j].dwUser = devices[i].channelCount; + } + } + + return result; + +error: + TerminateWaveHeaders( handlesAndBuffers, isInput ); + + return result; +} + + +static void TerminateWaveHeaders( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, int isInput ) +{ + signed int i, j; + WAVEHDR *deviceWaveHeaders; + + if( handlesAndBuffers->waveHeaders ) + { + for( i = handlesAndBuffers->deviceCount-1; i >= 0 ; --i ) + { + deviceWaveHeaders = handlesAndBuffers->waveHeaders[i]; /* wave headers for device i */ + if( deviceWaveHeaders ) + { + for( j = handlesAndBuffers->bufferCount-1; j >= 0; --j ) + { + if( deviceWaveHeaders[j].lpData ) + { + if( deviceWaveHeaders[j].dwUser != 0xFFFFFFFF ) + { + if( isInput ) + waveInUnprepareHeader( ((HWAVEIN*)handlesAndBuffers->waveHandles)[i], &deviceWaveHeaders[j], sizeof(WAVEHDR) ); + else + waveOutUnprepareHeader( ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i], &deviceWaveHeaders[j], sizeof(WAVEHDR) ); + } + + PaUtil_FreeMemory( deviceWaveHeaders[j].lpData ); + } + } + + PaUtil_FreeMemory( deviceWaveHeaders ); + } + } + + PaUtil_FreeMemory( handlesAndBuffers->waveHeaders ); + handlesAndBuffers->waveHeaders = 0; + } +} + + + +/* PaWinMmeStream - a stream data structure specifically for this implementation */ +/* note that struct PaWinMmeStream is typedeffed to PaWinMmeStream above. */ +struct PaWinMmeStream +{ + PaUtilStreamRepresentation streamRepresentation; + PaUtilCpuLoadMeasurer cpuLoadMeasurer; + PaUtilBufferProcessor bufferProcessor; + + int primeStreamUsingCallback; + + PaWinMmeSingleDirectionHandlesAndBuffers input; + PaWinMmeSingleDirectionHandlesAndBuffers output; + + /* Processing thread management -------------- */ + HANDLE abortEvent; + HANDLE processingThread; + DWORD processingThreadId; + + char throttleProcessingThreadOnOverload; /* 0 -> don't throtte, non-0 -> throttle */ + int processingThreadPriority; + int highThreadPriority; + int throttledThreadPriority; + unsigned long throttledSleepMsecs; + + int isStopped; + volatile int isActive; + volatile int stopProcessing; /* stop thread once existing buffers have been returned */ + volatile int abortProcessing; /* stop thread immediately */ + + DWORD allBuffersDurationMs; /* used to calculate timeouts */ +}; + +/* updates deviceCount if PaWinMmeUseMultipleDevices is used */ + +static PaError ValidateWinMmeSpecificStreamInfo( + const PaStreamParameters *streamParameters, + const PaWinMmeStreamInfo *streamInfo, + char *throttleProcessingThreadOnOverload, + unsigned long *deviceCount ) +{ + if( streamInfo ) + { + if( streamInfo->size != sizeof( PaWinMmeStreamInfo ) + || streamInfo->version != 1 ) + { + return paIncompatibleHostApiSpecificStreamInfo; + } + + if( streamInfo->flags & paWinMmeDontThrottleOverloadedProcessingThread ) + *throttleProcessingThreadOnOverload = 0; + + if( streamInfo->flags & paWinMmeUseMultipleDevices ) + { + if( streamParameters->device != paUseHostApiSpecificDeviceSpecification ) + return paInvalidDevice; + + *deviceCount = streamInfo->deviceCount; + } + } + + return paNoError; +} + +static PaError RetrieveDevicesFromStreamParameters( + struct PaUtilHostApiRepresentation *hostApi, + const PaStreamParameters *streamParameters, + const PaWinMmeStreamInfo *streamInfo, + PaWinMmeDeviceAndChannelCount *devices, + unsigned long deviceCount ) +{ + PaError result = paNoError; + unsigned int i; + int totalChannelCount; + PaDeviceIndex hostApiDevice; + + if( streamInfo && streamInfo->flags & paWinMmeUseMultipleDevices ) + { + totalChannelCount = 0; + for( i=0; i < deviceCount; ++i ) + { + /* validate that the device number is within range */ + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, + streamInfo->devices[i].device, hostApi ); + if( result != paNoError ) + return result; + + devices[i].device = hostApiDevice; + devices[i].channelCount = streamInfo->devices[i].channelCount; + + totalChannelCount += devices[i].channelCount; + } + + if( totalChannelCount != streamParameters->channelCount ) + { + /* channelCount must match total channels specified by multiple devices */ + return paInvalidChannelCount; /* REVIEW use of this error code */ + } + } + else + { + devices[0].device = streamParameters->device; + devices[0].channelCount = streamParameters->channelCount; + } + + return result; +} + +static PaError ValidateInputChannelCounts( + struct PaUtilHostApiRepresentation *hostApi, + PaWinMmeDeviceAndChannelCount *devices, + unsigned long deviceCount ) +{ + unsigned int i; + + for( i=0; i < deviceCount; ++i ) + { + if( devices[i].channelCount < 1 || devices[i].channelCount + > hostApi->deviceInfos[ devices[i].device ]->maxInputChannels ) + return paInvalidChannelCount; + } + + return paNoError; +} + +static PaError ValidateOutputChannelCounts( + struct PaUtilHostApiRepresentation *hostApi, + PaWinMmeDeviceAndChannelCount *devices, + unsigned long deviceCount ) +{ + unsigned int i; + + for( i=0; i < deviceCount; ++i ) + { + if( devices[i].channelCount < 1 || devices[i].channelCount + > hostApi->deviceInfos[ devices[i].device ]->maxOutputChannels ) + return paInvalidChannelCount; + } + + return paNoError; +} + + +/* the following macros are intended to improve the readability of the following code */ +#define PA_IS_INPUT_STREAM_( stream ) ( stream ->input.waveHandles ) +#define PA_IS_OUTPUT_STREAM_( stream ) ( stream ->output.waveHandles ) +#define PA_IS_FULL_DUPLEX_STREAM_( stream ) ( stream ->input.waveHandles && stream ->output.waveHandles ) +#define PA_IS_HALF_DUPLEX_STREAM_( stream ) ( !(stream ->input.waveHandles && stream ->output.waveHandles) ) + +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, + PaStream** s, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ) +{ + PaError result; + PaWinMmeHostApiRepresentation *winMmeHostApi = (PaWinMmeHostApiRepresentation*)hostApi; + PaWinMmeStream *stream = 0; + int bufferProcessorIsInitialized = 0; + int streamRepresentationIsInitialized = 0; + PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; + int inputChannelCount, outputChannelCount; + PaSampleFormat inputSampleFormat, outputSampleFormat; + double suggestedInputLatency, suggestedOutputLatency; + PaWinMmeStreamInfo *inputStreamInfo, *outputStreamInfo; + unsigned long framesPerHostInputBuffer; + unsigned long hostInputBufferCount; + unsigned long framesPerHostOutputBuffer; + unsigned long hostOutputBufferCount; + unsigned long framesPerBufferProcessorCall; + PaWinMmeDeviceAndChannelCount *inputDevices = 0; /* contains all devices and channel counts as local host api ids, even when PaWinMmeUseMultipleDevices is not used */ + unsigned long inputDeviceCount = 0; + PaWinMmeDeviceAndChannelCount *outputDevices = 0; + unsigned long outputDeviceCount = 0; /* contains all devices and channel counts as local host api ids, even when PaWinMmeUseMultipleDevices is not used */ + char throttleProcessingThreadOnOverload = 1; + + + if( inputParameters ) + { + inputChannelCount = inputParameters->channelCount; + inputSampleFormat = inputParameters->sampleFormat; + suggestedInputLatency = inputParameters->suggestedLatency; + + inputDeviceCount = 1; + + /* validate input hostApiSpecificStreamInfo */ + inputStreamInfo = (PaWinMmeStreamInfo*)inputParameters->hostApiSpecificStreamInfo; + result = ValidateWinMmeSpecificStreamInfo( inputParameters, inputStreamInfo, + &throttleProcessingThreadOnOverload, + &inputDeviceCount ); + if( result != paNoError ) return result; + + inputDevices = (PaWinMmeDeviceAndChannelCount*)alloca( sizeof(PaWinMmeDeviceAndChannelCount) * inputDeviceCount ); + if( !inputDevices ) return paInsufficientMemory; + + result = RetrieveDevicesFromStreamParameters( hostApi, inputParameters, inputStreamInfo, inputDevices, inputDeviceCount ); + if( result != paNoError ) return result; + + result = ValidateInputChannelCounts( hostApi, inputDevices, inputDeviceCount ); + if( result != paNoError ) return result; + + hostInputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, inputSampleFormat ); + } + else + { + inputChannelCount = 0; + inputSampleFormat = 0; + suggestedInputLatency = 0.; + inputStreamInfo = 0; + hostInputSampleFormat = 0; + } + + + if( outputParameters ) + { + outputChannelCount = outputParameters->channelCount; + outputSampleFormat = outputParameters->sampleFormat; + suggestedOutputLatency = outputParameters->suggestedLatency; + + outputDeviceCount = 1; + + /* validate output hostApiSpecificStreamInfo */ + outputStreamInfo = (PaWinMmeStreamInfo*)outputParameters->hostApiSpecificStreamInfo; + result = ValidateWinMmeSpecificStreamInfo( outputParameters, outputStreamInfo, + &throttleProcessingThreadOnOverload, + &outputDeviceCount ); + if( result != paNoError ) return result; + + outputDevices = (PaWinMmeDeviceAndChannelCount*)alloca( sizeof(PaWinMmeDeviceAndChannelCount) * outputDeviceCount ); + if( !outputDevices ) return paInsufficientMemory; + + result = RetrieveDevicesFromStreamParameters( hostApi, outputParameters, outputStreamInfo, outputDevices, outputDeviceCount ); + if( result != paNoError ) return result; + + result = ValidateOutputChannelCounts( hostApi, outputDevices, outputDeviceCount ); + if( result != paNoError ) return result; + + hostOutputSampleFormat = + PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, outputSampleFormat ); + } + else + { + outputChannelCount = 0; + outputSampleFormat = 0; + outputStreamInfo = 0; + hostOutputSampleFormat = 0; + suggestedOutputLatency = 0.; + } + + + /* + IMPLEMENT ME: + - alter sampleRate to a close allowable rate if possible / necessary + */ + + + /* validate platform specific flags */ + if( (streamFlags & paPlatformSpecificFlags) != 0 ) + return paInvalidFlag; /* unexpected platform specific flag */ + + + result = CalculateBufferSettings( &framesPerHostInputBuffer, &hostInputBufferCount, + &framesPerHostOutputBuffer, &hostOutputBufferCount, + inputChannelCount, hostInputSampleFormat, suggestedInputLatency, inputStreamInfo, + outputChannelCount, hostOutputSampleFormat, suggestedOutputLatency, outputStreamInfo, + sampleRate, framesPerBuffer ); + if( result != paNoError ) goto error; + + + stream = (PaWinMmeStream*)PaUtil_AllocateMemory( sizeof(PaWinMmeStream) ); + if( !stream ) + { + result = paInsufficientMemory; + goto error; + } + + InitializeSingleDirectionHandlesAndBuffers( &stream->input ); + InitializeSingleDirectionHandlesAndBuffers( &stream->output ); + + stream->abortEvent = 0; + stream->processingThread = 0; + + stream->throttleProcessingThreadOnOverload = throttleProcessingThreadOnOverload; + + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + ( (streamCallback) + ? &winMmeHostApi->callbackStreamInterface + : &winMmeHostApi->blockingStreamInterface ), + streamCallback, userData ); + streamRepresentationIsInitialized = 1; + + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); + + + if( inputParameters && outputParameters ) /* full duplex */ + { + if( framesPerHostInputBuffer < framesPerHostOutputBuffer ) + { + assert( (framesPerHostOutputBuffer % framesPerHostInputBuffer) == 0 ); /* CalculateBufferSettings() should guarantee this condition */ + + framesPerBufferProcessorCall = framesPerHostInputBuffer; + } + else + { + assert( (framesPerHostInputBuffer % framesPerHostOutputBuffer) == 0 ); /* CalculateBufferSettings() should guarantee this condition */ + + framesPerBufferProcessorCall = framesPerHostOutputBuffer; + } + } + else if( inputParameters ) + { + framesPerBufferProcessorCall = framesPerHostInputBuffer; + } + else if( outputParameters ) + { + framesPerBufferProcessorCall = framesPerHostOutputBuffer; + } + + stream->input.framesPerBuffer = framesPerHostInputBuffer; + stream->output.framesPerBuffer = framesPerHostOutputBuffer; + + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerBufferProcessorCall, paUtilFixedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ) goto error; + + bufferProcessorIsInitialized = 1; + + stream->streamRepresentation.streamInfo.inputLatency = + (double)(PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) + +(framesPerHostInputBuffer * (hostInputBufferCount-1))) / sampleRate; + stream->streamRepresentation.streamInfo.outputLatency = + (double)(PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) + +(framesPerHostOutputBuffer * (hostOutputBufferCount-1))) / sampleRate; + stream->streamRepresentation.streamInfo.sampleRate = sampleRate; + + stream->primeStreamUsingCallback = ( (streamFlags&paPrimeOutputBuffersUsingStreamCallback) && streamCallback ) ? 1 : 0; + + /* time to sleep when throttling due to >100% cpu usage. + -a quater of a buffer's duration */ + stream->throttledSleepMsecs = + (unsigned long)(stream->bufferProcessor.framesPerHostBuffer * + stream->bufferProcessor.samplePeriod * .25 * 1000); + + stream->isStopped = 1; + stream->isActive = 0; + + + /* for maximum compatibility with multi-device multichannel drivers, + we first open all devices, then we prepare all buffers, finally + we start all devices ( in StartStream() ). teardown in reverse order. + */ + + if( inputParameters ) + { + result = InitializeWaveHandles( winMmeHostApi, &stream->input, + stream->bufferProcessor.bytesPerHostInputSample, sampleRate, + inputDevices, inputDeviceCount, 1 /* isInput */ ); + if( result != paNoError ) goto error; + } + + if( outputParameters ) + { + result = InitializeWaveHandles( winMmeHostApi, &stream->output, + stream->bufferProcessor.bytesPerHostOutputSample, sampleRate, + outputDevices, outputDeviceCount, 0 /* isInput */ ); + if( result != paNoError ) goto error; + } + + if( inputParameters ) + { + result = InitializeWaveHeaders( &stream->input, hostInputBufferCount, + hostInputSampleFormat, framesPerHostInputBuffer, inputDevices, 1 /* isInput */ ); + if( result != paNoError ) goto error; + } + + if( outputParameters ) + { + result = InitializeWaveHeaders( &stream->output, hostOutputBufferCount, + hostOutputSampleFormat, framesPerHostOutputBuffer, outputDevices, 0 /* not isInput */ ); + if( result != paNoError ) goto error; + + stream->allBuffersDurationMs = (DWORD) (1000.0 * (framesPerHostOutputBuffer * stream->output.bufferCount) / sampleRate); + } + else + { + stream->allBuffersDurationMs = (DWORD) (1000.0 * (framesPerHostInputBuffer * stream->input.bufferCount) / sampleRate); + } + + + if( streamCallback ) + { + /* abort event is only needed for callback streams */ + result = CreateEventWithPaError( &stream->abortEvent, NULL, TRUE, FALSE, NULL ); + if( result != paNoError ) goto error; + } + + *s = (PaStream*)stream; + + return result; + +error: + + if( stream ) + { + if( stream->abortEvent ) + CloseHandle( stream->abortEvent ); + + TerminateWaveHeaders( &stream->output, 0 /* not isInput */ ); + TerminateWaveHeaders( &stream->input, 1 /* isInput */ ); + + TerminateWaveHandles( &stream->output, 0 /* not isInput */, 1 /* currentlyProcessingAnError */ ); + TerminateWaveHandles( &stream->input, 1 /* isInput */, 1 /* currentlyProcessingAnError */ ); + + if( bufferProcessorIsInitialized ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + + if( streamRepresentationIsInitialized ) + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + + PaUtil_FreeMemory( stream ); + } + + return result; +} + + +/* return non-zero if all current buffers are done */ +static int BuffersAreDone( WAVEHDR **waveHeaders, unsigned int deviceCount, int bufferIndex ) +{ + unsigned int i; + + for( i=0; i < deviceCount; ++i ) + { + if( !(waveHeaders[i][ bufferIndex ].dwFlags & WHDR_DONE) ) + { + return 0; + } + } + + return 1; +} + +static int CurrentInputBuffersAreDone( PaWinMmeStream *stream ) +{ + return BuffersAreDone( stream->input.waveHeaders, stream->input.deviceCount, stream->input.currentBufferIndex ); +} + +static int CurrentOutputBuffersAreDone( PaWinMmeStream *stream ) +{ + return BuffersAreDone( stream->output.waveHeaders, stream->output.deviceCount, stream->output.currentBufferIndex ); +} + + +/* return non-zero if any buffers are queued */ +static int NoBuffersAreQueued( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ) +{ + unsigned int i, j; + + if( handlesAndBuffers->waveHandles ) + { + for( i=0; i < handlesAndBuffers->bufferCount; ++i ) + { + for( j=0; j < handlesAndBuffers->deviceCount; ++j ) + { + if( !( handlesAndBuffers->waveHeaders[ j ][ i ].dwFlags & WHDR_DONE) ) + { + return 0; + } + } + } + } + + return 1; +} + + +#define PA_CIRCULAR_INCREMENT_( current, max )\ + ( (((current) + 1) >= (max)) ? (0) : (current+1) ) + +#define PA_CIRCULAR_DECREMENT_( current, max )\ + ( ((current) == 0) ? ((max)-1) : (current-1) ) + + +static signed long GetAvailableFrames( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ) +{ + signed long result = 0; + unsigned int i; + + if( BuffersAreDone( handlesAndBuffers->waveHeaders, handlesAndBuffers->deviceCount, handlesAndBuffers->currentBufferIndex ) ) + { + /* we could calculate the following in O(1) if we kept track of the + last done buffer */ + result = handlesAndBuffers->framesPerBuffer - handlesAndBuffers->framesUsedInCurrentBuffer; + + i = PA_CIRCULAR_INCREMENT_( handlesAndBuffers->currentBufferIndex, handlesAndBuffers->bufferCount ); + while( i != handlesAndBuffers->currentBufferIndex ) + { + if( BuffersAreDone( handlesAndBuffers->waveHeaders, handlesAndBuffers->deviceCount, i ) ) + { + result += handlesAndBuffers->framesPerBuffer; + i = PA_CIRCULAR_INCREMENT_( i, handlesAndBuffers->bufferCount ); + } + else + break; + } + } + + return result; +} + + +static PaError AdvanceToNextInputBuffer( PaWinMmeStream *stream ) +{ + PaError result = paNoError; + MMRESULT mmresult; + unsigned int i; + + for( i=0; i < stream->input.deviceCount; ++i ) + { + mmresult = waveInAddBuffer( ((HWAVEIN*)stream->input.waveHandles)[i], + &stream->input.waveHeaders[i][ stream->input.currentBufferIndex ], + sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + } + } + + stream->input.currentBufferIndex = + PA_CIRCULAR_INCREMENT_( stream->input.currentBufferIndex, stream->input.bufferCount ); + + stream->input.framesUsedInCurrentBuffer = 0; + + return result; +} + + +static PaError AdvanceToNextOutputBuffer( PaWinMmeStream *stream ) +{ + PaError result = paNoError; + MMRESULT mmresult; + unsigned int i; + + for( i=0; i < stream->output.deviceCount; ++i ) + { + mmresult = waveOutWrite( ((HWAVEOUT*)stream->output.waveHandles)[i], + &stream->output.waveHeaders[i][ stream->output.currentBufferIndex ], + sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + } + } + + stream->output.currentBufferIndex = + PA_CIRCULAR_INCREMENT_( stream->output.currentBufferIndex, stream->output.bufferCount ); + + stream->output.framesUsedInCurrentBuffer = 0; + + return result; +} + + +/* requeue all but the most recent input with the driver. Used for catching + up after a total input buffer underrun */ +static PaError CatchUpInputBuffers( PaWinMmeStream *stream ) +{ + PaError result = paNoError; + unsigned int i; + + for( i=0; i < stream->input.bufferCount - 1; ++i ) + { + result = AdvanceToNextInputBuffer( stream ); + if( result != paNoError ) + break; + } + + return result; +} + + +/* take the most recent output and duplicate it to all other output buffers + and requeue them. Used for catching up after a total output buffer underrun. +*/ +static PaError CatchUpOutputBuffers( PaWinMmeStream *stream ) +{ + PaError result = paNoError; + unsigned int i, j; + unsigned int previousBufferIndex = + PA_CIRCULAR_DECREMENT_( stream->output.currentBufferIndex, stream->output.bufferCount ); + + for( i=0; i < stream->output.bufferCount - 1; ++i ) + { + for( j=0; j < stream->output.deviceCount; ++j ) + { + if( stream->output.waveHeaders[j][ stream->output.currentBufferIndex ].lpData + != stream->output.waveHeaders[j][ previousBufferIndex ].lpData ) + { + CopyMemory( stream->output.waveHeaders[j][ stream->output.currentBufferIndex ].lpData, + stream->output.waveHeaders[j][ previousBufferIndex ].lpData, + stream->output.waveHeaders[j][ stream->output.currentBufferIndex ].dwBufferLength ); + } + } + + result = AdvanceToNextOutputBuffer( stream ); + if( result != paNoError ) + break; + } + + return result; +} + + +static DWORD WINAPI ProcessingThreadProc( void *pArg ) +{ + PaWinMmeStream *stream = (PaWinMmeStream *)pArg; + HANDLE events[3]; + int eventCount = 0; + DWORD result = paNoError; + DWORD waitResult; + DWORD timeout = (unsigned long)(stream->allBuffersDurationMs * 0.5); + int hostBuffersAvailable; + signed int hostInputBufferIndex, hostOutputBufferIndex; + PaStreamCallbackFlags statusFlags; + int callbackResult; + int done = 0; + unsigned int channel, i; + unsigned long framesProcessed; + + /* prepare event array for call to WaitForMultipleObjects() */ + if( stream->input.bufferEvent ) + events[eventCount++] = stream->input.bufferEvent; + if( stream->output.bufferEvent ) + events[eventCount++] = stream->output.bufferEvent; + events[eventCount++] = stream->abortEvent; + + statusFlags = 0; /** @todo support paInputUnderflow, paOutputOverflow and paNeverDropInput */ + + /* loop until something causes us to stop */ + do{ + /* wait for MME to signal that a buffer is available, or for + the PA abort event to be signaled. + + When this indicates that one or more buffers are available + NoBuffersAreQueued() and Current*BuffersAreDone are used below to + poll for additional done buffers. NoBuffersAreQueued() will fail + to identify an underrun/overflow if the driver doesn't mark all done + buffers prior to signalling the event. Some drivers do this + (eg RME Digi96, and others don't eg VIA PC 97 input). This isn't a + huge problem, it just means that we won't always be able to detect + underflow/overflow. + */ + waitResult = WaitForMultipleObjects( eventCount, events, FALSE /* wait all = FALSE */, timeout ); + if( waitResult == WAIT_FAILED ) + { + result = paUnanticipatedHostError; + /** @todo FIXME/REVIEW: can't return host error info from an asyncronous thread */ + done = 1; + } + else if( waitResult == WAIT_TIMEOUT ) + { + /* if a timeout is encountered, continue */ + } + + if( stream->abortProcessing ) + { + /* Pa_AbortStream() has been called, stop processing immediately */ + done = 1; + } + else if( stream->stopProcessing ) + { + /* Pa_StopStream() has been called or the user callback returned + non-zero, processing will continue until all output buffers + are marked as done. The stream will stop immediately if it + is input-only. + */ + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + if( NoBuffersAreQueued( &stream->output ) ) + done = 1; /* Will cause thread to return. */ + } + else + { + /* input only stream */ + done = 1; /* Will cause thread to return. */ + } + } + else + { + hostBuffersAvailable = 1; + + /* process all available host buffers */ + do + { + hostInputBufferIndex = -1; + hostOutputBufferIndex = -1; + + if( PA_IS_INPUT_STREAM_(stream) ) + { + if( CurrentInputBuffersAreDone( stream ) ) + { + if( NoBuffersAreQueued( &stream->input ) ) + { + /** @todo + if all of the other buffers are also ready then + we discard all but the most recent. This is an + input buffer overflow. FIXME: these buffers should + be passed to the callback in a paNeverDropInput + stream. + + note that it is also possible for an input overflow + to happen while the callback is processing a buffer. + that is handled further down. + */ + result = CatchUpInputBuffers( stream ); + if( result != paNoError ) + done = 1; + + statusFlags |= paInputOverflow; + } + + hostInputBufferIndex = stream->input.currentBufferIndex; + } + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + if( CurrentOutputBuffersAreDone( stream ) ) + { + /* ok, we have an output buffer */ + + if( NoBuffersAreQueued( &stream->output ) ) + { + /* + if all of the other buffers are also ready, catch up by copying + the most recently generated buffer into all but one of the output + buffers. + + note that this catch up code only handles the case where all + buffers have been played out due to this thread not having + woken up at all. a more common case occurs when this thread + is woken up, processes one buffer, but takes too long, and as + a result all the other buffers have become un-queued. that + case is handled further down. + */ + + result = CatchUpOutputBuffers( stream ); + if( result != paNoError ) + done = 1; + + statusFlags |= paOutputUnderflow; + } + + hostOutputBufferIndex = stream->output.currentBufferIndex; + } + } + + + if( (PA_IS_FULL_DUPLEX_STREAM_(stream) && hostInputBufferIndex != -1 && hostOutputBufferIndex != -1) || + (PA_IS_HALF_DUPLEX_STREAM_(stream) && ( hostInputBufferIndex != -1 || hostOutputBufferIndex != -1 ) ) ) + { + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /** @todo implement inputBufferAdcTime */ + + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + /* set timeInfo.currentTime and calculate timeInfo.outputBufferDacTime + from the current wave out position */ + MMTIME mmtime; + double timeBeforeGetPosition, timeAfterGetPosition; + double time; + long framesInBufferRing; + long writePosition; + long playbackPosition; + HWAVEOUT firstWaveOutDevice = ((HWAVEOUT*)stream->output.waveHandles)[0]; + + mmtime.wType = TIME_SAMPLES; + timeBeforeGetPosition = PaUtil_GetTime(); + waveOutGetPosition( firstWaveOutDevice, &mmtime, sizeof(MMTIME) ); + timeAfterGetPosition = PaUtil_GetTime(); + + timeInfo.currentTime = timeAfterGetPosition; + + /* approximate time at which wave out position was measured + as half way between timeBeforeGetPosition and timeAfterGetPosition */ + time = timeBeforeGetPosition + (timeAfterGetPosition - timeBeforeGetPosition) * .5; + + framesInBufferRing = stream->output.bufferCount * stream->bufferProcessor.framesPerHostBuffer; + playbackPosition = mmtime.u.sample % framesInBufferRing; + + writePosition = stream->output.currentBufferIndex * stream->bufferProcessor.framesPerHostBuffer + + stream->output.framesUsedInCurrentBuffer; + + if( playbackPosition >= writePosition ){ + timeInfo.outputBufferDacTime = + time + ((double)( writePosition + (framesInBufferRing - playbackPosition) ) * stream->bufferProcessor.samplePeriod ); + }else{ + timeInfo.outputBufferDacTime = + time + ((double)( writePosition - playbackPosition ) * stream->bufferProcessor.samplePeriod ); + } + } + + + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, statusFlags ); + + /* reset status flags once they have been passed to the buffer processor */ + statusFlags = 0; + + if( PA_IS_INPUT_STREAM_(stream) ) + { + PaUtil_SetInputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + + channel = 0; + for( i=0; iinput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->input.waveHeaders[i][ hostInputBufferIndex ].dwUser; + + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, channel, + stream->input.waveHeaders[i][ hostInputBufferIndex ].lpData + + stream->input.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostInputSample, + channelCount ); + + + channel += channelCount; + } + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + + channel = 0; + for( i=0; ioutput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->output.waveHeaders[i][ hostOutputBufferIndex ].dwUser; + + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, channel, + stream->output.waveHeaders[i][ hostOutputBufferIndex ].lpData + + stream->output.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostOutputSample, + channelCount ); + + channel += channelCount; + } + } + + callbackResult = paContinue; + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + + stream->input.framesUsedInCurrentBuffer += framesProcessed; + stream->output.framesUsedInCurrentBuffer += framesProcessed; + + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); + + if( callbackResult == paContinue ) + { + /* nothing special to do */ + } + else if( callbackResult == paAbort ) + { + stream->abortProcessing = 1; + done = 1; + /** @todo FIXME: should probably reset the output device immediately once the callback returns paAbort */ + result = paNoError; + } + else + { + /* User callback has asked us to stop with paComplete or other non-zero value */ + stream->stopProcessing = 1; /* stop once currently queued audio has finished */ + result = paNoError; + } + + + if( PA_IS_INPUT_STREAM_(stream) + && stream->stopProcessing == 0 && stream->abortProcessing == 0 + && stream->input.framesUsedInCurrentBuffer == stream->input.framesPerBuffer ) + { + if( NoBuffersAreQueued( &stream->input ) ) + { + /** @todo need to handle PaNeverDropInput here where necessary */ + result = CatchUpInputBuffers( stream ); + if( result != paNoError ) + done = 1; + + statusFlags |= paInputOverflow; + } + + result = AdvanceToNextInputBuffer( stream ); + if( result != paNoError ) + done = 1; + } + + + if( PA_IS_OUTPUT_STREAM_(stream) && !stream->abortProcessing ) + { + if( stream->stopProcessing && + stream->output.framesUsedInCurrentBuffer < stream->output.framesPerBuffer ) + { + /* zero remaining samples in output output buffer and flush */ + + stream->output.framesUsedInCurrentBuffer += PaUtil_ZeroOutput( &stream->bufferProcessor, + stream->output.framesPerBuffer - stream->output.framesUsedInCurrentBuffer ); + + /* we send the entire buffer to the output devices, but we could + just send a partial buffer, rather than zeroing the unused + samples. + */ + } + + if( stream->output.framesUsedInCurrentBuffer == stream->output.framesPerBuffer ) + { + /* check for underflow before enquing the just-generated buffer, + but recover from underflow after enquing it. This ensures + that the most recent audio segment is repeated */ + int outputUnderflow = NoBuffersAreQueued( &stream->output ); + + result = AdvanceToNextOutputBuffer( stream ); + if( result != paNoError ) + done = 1; + + if( outputUnderflow && !done && !stream->stopProcessing ) + { + /* Recover from underflow in the case where the + underflow occured while processing the buffer + we just finished */ + + result = CatchUpOutputBuffers( stream ); + if( result != paNoError ) + done = 1; + + statusFlags |= paOutputUnderflow; + } + } + } + + if( stream->throttleProcessingThreadOnOverload != 0 ) + { + if( stream->stopProcessing || stream->abortProcessing ) + { + if( stream->processingThreadPriority != stream->highThreadPriority ) + { + SetThreadPriority( stream->processingThread, stream->highThreadPriority ); + stream->processingThreadPriority = stream->highThreadPriority; + } + } + else if( PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ) > 1. ) + { + if( stream->processingThreadPriority != stream->throttledThreadPriority ) + { + SetThreadPriority( stream->processingThread, stream->throttledThreadPriority ); + stream->processingThreadPriority = stream->throttledThreadPriority; + } + + /* sleep to give other processes a go */ + Sleep( stream->throttledSleepMsecs ); + } + else + { + if( stream->processingThreadPriority != stream->highThreadPriority ) + { + SetThreadPriority( stream->processingThread, stream->highThreadPriority ); + stream->processingThreadPriority = stream->highThreadPriority; + } + } + } + } + else + { + hostBuffersAvailable = 0; + } + } + while( hostBuffersAvailable && + stream->stopProcessing == 0 && + stream->abortProcessing == 0 && + !done ); + } + } + while( !done ); + + stream->isActive = 0; + + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + + PaUtil_ResetCpuLoadMeasurer( &stream->cpuLoadMeasurer ); + + return result; +} + + +/* + When CloseStream() is called, the multi-api layer ensures that + the stream has already been stopped or aborted. +*/ +static PaError CloseStream( PaStream* s ) +{ + PaError result; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + result = CloseHandleWithPaError( stream->abortEvent ); + if( result != paNoError ) goto error; + + TerminateWaveHeaders( &stream->output, 0 /* not isInput */ ); + TerminateWaveHeaders( &stream->input, 1 /* isInput */ ); + + TerminateWaveHandles( &stream->output, 0 /* not isInput */, 0 /* not currentlyProcessingAnError */ ); + TerminateWaveHandles( &stream->input, 1 /* isInput */, 0 /* not currentlyProcessingAnError */ ); + + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); + +error: + /** @todo REVIEW: what is the best way to clean up a stream if an error is detected? */ + return result; +} + + +static PaError StartStream( PaStream *s ) +{ + PaError result; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + MMRESULT mmresult; + unsigned int i, j; + int callbackResult; + unsigned int channel; + unsigned long framesProcessed; + PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /** @todo implement this for stream priming */ + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + if( PA_IS_INPUT_STREAM_(stream) ) + { + for( i=0; iinput.bufferCount; ++i ) + { + for( j=0; jinput.deviceCount; ++j ) + { + mmresult = waveInAddBuffer( ((HWAVEIN*)stream->input.waveHandles)[j], &stream->input.waveHeaders[j][i], sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + goto error; + } + } + } + stream->input.currentBufferIndex = 0; + stream->input.framesUsedInCurrentBuffer = 0; + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + for( i=0; ioutput.deviceCount; ++i ) + { + if( (mmresult = waveOutPause( ((HWAVEOUT*)stream->output.waveHandles)[i] )) != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + goto error; + } + } + + for( i=0; ioutput.bufferCount; ++i ) + { + if( stream->primeStreamUsingCallback ) + { + + stream->output.framesUsedInCurrentBuffer = 0; + do{ + + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, + &timeInfo, + paPrimingOutput | ((stream->input.bufferCount > 0 ) ? paInputUnderflow : 0)); + + if( stream->input.bufferCount > 0 ) + PaUtil_SetNoInput( &stream->bufferProcessor ); + + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, 0 /* default to host buffer size */ ); + + channel = 0; + for( j=0; joutput.deviceCount; ++j ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->output.waveHeaders[j][i].dwUser; + + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, channel, + stream->output.waveHeaders[j][i].lpData + + stream->output.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostOutputSample, + channelCount ); + + /* we have stored the number of channels in the buffer in dwUser */ + channel += channelCount; + } + + callbackResult = paContinue; + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); + stream->output.framesUsedInCurrentBuffer += framesProcessed; + + if( callbackResult != paContinue ) + { + /** @todo fix this, what do we do if callback result is non-zero during stream + priming? + + for complete: play out primed waveHeaders as usual + for abort: clean up immediately. + */ + } + + }while( stream->output.framesUsedInCurrentBuffer != stream->output.framesPerBuffer ); + + } + else + { + for( j=0; joutput.deviceCount; ++j ) + { + ZeroMemory( stream->output.waveHeaders[j][i].lpData, stream->output.waveHeaders[j][i].dwBufferLength ); + } + } + + /* we queue all channels of a single buffer frame (accross all + devices, because some multidevice multichannel drivers work + better this way */ + for( j=0; joutput.deviceCount; ++j ) + { + mmresult = waveOutWrite( ((HWAVEOUT*)stream->output.waveHandles)[j], &stream->output.waveHeaders[j][i], sizeof(WAVEHDR) ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + goto error; + } + } + } + stream->output.currentBufferIndex = 0; + stream->output.framesUsedInCurrentBuffer = 0; + } + + + stream->isStopped = 0; + stream->isActive = 1; + stream->stopProcessing = 0; + stream->abortProcessing = 0; + + result = ResetEventWithPaError( stream->input.bufferEvent ); + if( result != paNoError ) goto error; + + result = ResetEventWithPaError( stream->output.bufferEvent ); + if( result != paNoError ) goto error; + + + if( stream->streamRepresentation.streamCallback ) + { + /* callback stream */ + + result = ResetEventWithPaError( stream->abortEvent ); + if( result != paNoError ) goto error; + + /* Create thread that waits for audio buffers to be ready for processing. */ + stream->processingThread = CreateThread( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ); + if( !stream->processingThread ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + goto error; + } + + /** @todo could have mme specific stream parameters to allow the user + to set the callback thread priorities */ + stream->highThreadPriority = THREAD_PRIORITY_TIME_CRITICAL; + stream->throttledThreadPriority = THREAD_PRIORITY_NORMAL; + + if( !SetThreadPriority( stream->processingThread, stream->highThreadPriority ) ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_SYSTEM_ERROR( GetLastError() ); + goto error; + } + stream->processingThreadPriority = stream->highThreadPriority; + } + else + { + /* blocking read/write stream */ + + } + + if( PA_IS_INPUT_STREAM_(stream) ) + { + for( i=0; i < stream->input.deviceCount; ++i ) + { + mmresult = waveInStart( ((HWAVEIN*)stream->input.waveHandles)[i] ); + PA_DEBUG(("Pa_StartStream: waveInStart returned = 0x%X.\n", mmresult)); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + goto error; + } + } + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + for( i=0; i < stream->output.deviceCount; ++i ) + { + if( (mmresult = waveOutRestart( ((HWAVEOUT*)stream->output.waveHandles)[i] )) != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + goto error; + } + } + } + + return result; + +error: + /** @todo FIXME: implement recovery as best we can + This should involve rolling back to a state as-if this function had never been called + */ + return result; +} + + +static PaError StopStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + int timeout; + DWORD waitResult; + MMRESULT mmresult; + signed int hostOutputBufferIndex; + unsigned int channel, waitCount, i; + + /** @todo + REVIEW: the error checking in this function needs review. the basic + idea is to return from this function in a known state - for example + there is no point avoiding calling waveInReset just because + the thread times out. + */ + + if( stream->processingThread ) + { + /* callback stream */ + + /* Tell processing thread to stop generating more data and to let current data play out. */ + stream->stopProcessing = 1; + + /* Calculate timeOut longer than longest time it could take to return all buffers. */ + timeout = (int)(stream->allBuffersDurationMs * 1.5); + if( timeout < PA_MME_MIN_TIMEOUT_MSEC_ ) + timeout = PA_MME_MIN_TIMEOUT_MSEC_; + + PA_DEBUG(("WinMME StopStream: waiting for background thread.\n")); + + waitResult = WaitForSingleObject( stream->processingThread, timeout ); + if( waitResult == WAIT_TIMEOUT ) + { + /* try to abort */ + stream->abortProcessing = 1; + SetEvent( stream->abortEvent ); + waitResult = WaitForSingleObject( stream->processingThread, timeout ); + if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WinMME StopStream: timed out while waiting for background thread to finish.\n")); + result = paTimedOut; + } + } + + CloseHandle( stream->processingThread ); + stream->processingThread = NULL; + } + else + { + /* blocking read / write stream */ + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + if( stream->output.framesUsedInCurrentBuffer > 0 ) + { + /* there are still unqueued frames in the current buffer, so flush them */ + + hostOutputBufferIndex = stream->output.currentBufferIndex; + + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, + stream->output.framesPerBuffer - stream->output.framesUsedInCurrentBuffer ); + + channel = 0; + for( i=0; ioutput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->output.waveHeaders[i][ hostOutputBufferIndex ].dwUser; + + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, channel, + stream->output.waveHeaders[i][ hostOutputBufferIndex ].lpData + + stream->output.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostOutputSample, + channelCount ); + + channel += channelCount; + } + + PaUtil_ZeroOutput( &stream->bufferProcessor, + stream->output.framesPerBuffer - stream->output.framesUsedInCurrentBuffer ); + + /* we send the entire buffer to the output devices, but we could + just send a partial buffer, rather than zeroing the unused + samples. + */ + AdvanceToNextOutputBuffer( stream ); + } + + + timeout = (stream->allBuffersDurationMs / stream->output.bufferCount) + 1; + if( timeout < PA_MME_MIN_TIMEOUT_MSEC_ ) + timeout = PA_MME_MIN_TIMEOUT_MSEC_; + + waitCount = 0; + while( !NoBuffersAreQueued( &stream->output ) && waitCount <= stream->output.bufferCount ) + { + /* wait for MME to signal that a buffer is available */ + waitResult = WaitForSingleObject( stream->output.bufferEvent, timeout ); + if( waitResult == WAIT_FAILED ) + { + break; + } + else if( waitResult == WAIT_TIMEOUT ) + { + /* keep waiting */ + } + + ++waitCount; + } + } + } + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + for( i =0; i < stream->output.deviceCount; ++i ) + { + mmresult = waveOutReset( ((HWAVEOUT*)stream->output.waveHandles)[i] ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + } + } + } + + if( PA_IS_INPUT_STREAM_(stream) ) + { + for( i=0; i < stream->input.deviceCount; ++i ) + { + mmresult = waveInReset( ((HWAVEIN*)stream->input.waveHandles)[i] ); + if( mmresult != MMSYSERR_NOERROR ) + { + result = paUnanticipatedHostError; + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + } + } + } + + stream->isStopped = 1; + stream->isActive = 0; + + return result; +} + + +static PaError AbortStream( PaStream *s ) +{ + PaError result = paNoError; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + int timeout; + DWORD waitResult; + MMRESULT mmresult; + unsigned int i; + + /** @todo + REVIEW: the error checking in this function needs review. the basic + idea is to return from this function in a known state - for example + there is no point avoiding calling waveInReset just because + the thread times out. + */ + + if( stream->processingThread ) + { + /* callback stream */ + + /* Tell processing thread to abort immediately */ + stream->abortProcessing = 1; + SetEvent( stream->abortEvent ); + } + + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + for( i =0; i < stream->output.deviceCount; ++i ) + { + mmresult = waveOutReset( ((HWAVEOUT*)stream->output.waveHandles)[i] ); + if( mmresult != MMSYSERR_NOERROR ) + { + PA_MME_SET_LAST_WAVEOUT_ERROR( mmresult ); + return paUnanticipatedHostError; + } + } + } + + if( PA_IS_INPUT_STREAM_(stream) ) + { + for( i=0; i < stream->input.deviceCount; ++i ) + { + mmresult = waveInReset( ((HWAVEIN*)stream->input.waveHandles)[i] ); + if( mmresult != MMSYSERR_NOERROR ) + { + PA_MME_SET_LAST_WAVEIN_ERROR( mmresult ); + return paUnanticipatedHostError; + } + } + } + + + if( stream->processingThread ) + { + /* callback stream */ + + PA_DEBUG(("WinMME AbortStream: waiting for background thread.\n")); + + /* Calculate timeOut longer than longest time it could take to return all buffers. */ + timeout = (int)(stream->allBuffersDurationMs * 1.5); + if( timeout < PA_MME_MIN_TIMEOUT_MSEC_ ) + timeout = PA_MME_MIN_TIMEOUT_MSEC_; + + waitResult = WaitForSingleObject( stream->processingThread, timeout ); + if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WinMME AbortStream: timed out while waiting for background thread to finish.\n")); + return paTimedOut; + } + + CloseHandle( stream->processingThread ); + stream->processingThread = NULL; + } + + stream->isStopped = 1; + stream->isActive = 0; + + return result; +} + + +static PaError IsStreamStopped( PaStream *s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + return stream->isStopped; +} + + +static PaError IsStreamActive( PaStream *s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + return stream->isActive; +} + + +static PaTime GetStreamTime( PaStream *s ) +{ + (void) s; /* unused parameter */ + + return PaUtil_GetTime(); +} + + +static double GetStreamCpuLoad( PaStream* s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); +} + + +/* + As separate stream interfaces are used for blocking and callback + streams, the following functions can be guaranteed to only be called + for blocking streams. +*/ + +static PaError ReadStream( PaStream* s, + void *buffer, + unsigned long frames ) +{ + PaError result = paNoError; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + void *userBuffer; + unsigned long framesRead = 0; + unsigned long framesProcessed; + signed int hostInputBufferIndex; + DWORD waitResult; + DWORD timeout = (unsigned long)(stream->allBuffersDurationMs * 0.5); + unsigned int channel, i; + + if( PA_IS_INPUT_STREAM_(stream) ) + { + /* make a local copy of the user buffer pointer(s). this is necessary + because PaUtil_CopyInput() advances these pointers every time + it is called. + */ + if( stream->bufferProcessor.userInputIsInterleaved ) + { + userBuffer = buffer; + } + else + { + userBuffer = alloca( sizeof(void*) * stream->bufferProcessor.inputChannelCount ); + if( !userBuffer ) + return paInsufficientMemory; + for( i = 0; ibufferProcessor.inputChannelCount; ++i ) + ((void**)userBuffer)[i] = ((void**)buffer)[i]; + } + + do{ + if( CurrentInputBuffersAreDone( stream ) ) + { + if( NoBuffersAreQueued( &stream->input ) ) + { + /** @todo REVIEW: consider what to do if the input overflows. + do we requeue all of the buffers? should we be running + a thread to make sure they are always queued? */ + + result = paInputOverflowed; + } + + hostInputBufferIndex = stream->input.currentBufferIndex; + + PaUtil_SetInputFrameCount( &stream->bufferProcessor, + stream->input.framesPerBuffer - stream->input.framesUsedInCurrentBuffer ); + + channel = 0; + for( i=0; iinput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->input.waveHeaders[i][ hostInputBufferIndex ].dwUser; + + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, channel, + stream->input.waveHeaders[i][ hostInputBufferIndex ].lpData + + stream->input.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostInputSample, + channelCount ); + + channel += channelCount; + } + + framesProcessed = PaUtil_CopyInput( &stream->bufferProcessor, &userBuffer, frames - framesRead ); + + stream->input.framesUsedInCurrentBuffer += framesProcessed; + if( stream->input.framesUsedInCurrentBuffer == stream->input.framesPerBuffer ) + { + result = AdvanceToNextInputBuffer( stream ); + if( result != paNoError ) + break; + } + + framesRead += framesProcessed; + + }else{ + /* wait for MME to signal that a buffer is available */ + waitResult = WaitForSingleObject( stream->input.bufferEvent, timeout ); + if( waitResult == WAIT_FAILED ) + { + result = paUnanticipatedHostError; + break; + } + else if( waitResult == WAIT_TIMEOUT ) + { + /* if a timeout is encountered, continue, + perhaps we should give up eventually + */ + } + } + }while( framesRead < frames ); + } + else + { + result = paCanNotReadFromAnOutputOnlyStream; + } + + return result; +} + + +static PaError WriteStream( PaStream* s, + const void *buffer, + unsigned long frames ) +{ + PaError result = paNoError; + PaWinMmeStream *stream = (PaWinMmeStream*)s; + const void *userBuffer; + unsigned long framesWritten = 0; + unsigned long framesProcessed; + signed int hostOutputBufferIndex; + DWORD waitResult; + DWORD timeout = (unsigned long)(stream->allBuffersDurationMs * 0.5); + unsigned int channel, i; + + + if( PA_IS_OUTPUT_STREAM_(stream) ) + { + /* make a local copy of the user buffer pointer(s). this is necessary + because PaUtil_CopyOutput() advances these pointers every time + it is called. + */ + if( stream->bufferProcessor.userOutputIsInterleaved ) + { + userBuffer = buffer; + } + else + { + userBuffer = alloca( sizeof(void*) * stream->bufferProcessor.outputChannelCount ); + if( !userBuffer ) + return paInsufficientMemory; + for( i = 0; ibufferProcessor.outputChannelCount; ++i ) + ((const void**)userBuffer)[i] = ((const void**)buffer)[i]; + } + + do{ + if( CurrentOutputBuffersAreDone( stream ) ) + { + if( NoBuffersAreQueued( &stream->output ) ) + { + /** @todo REVIEW: consider what to do if the output + underflows. do we requeue all the existing buffers with + zeros? should we run a separate thread to keep the buffers + enqueued at all times? */ + + result = paOutputUnderflowed; + } + + hostOutputBufferIndex = stream->output.currentBufferIndex; + + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, + stream->output.framesPerBuffer - stream->output.framesUsedInCurrentBuffer ); + + channel = 0; + for( i=0; ioutput.deviceCount; ++i ) + { + /* we have stored the number of channels in the buffer in dwUser */ + int channelCount = stream->output.waveHeaders[i][ hostOutputBufferIndex ].dwUser; + + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, channel, + stream->output.waveHeaders[i][ hostOutputBufferIndex ].lpData + + stream->output.framesUsedInCurrentBuffer * channelCount * + stream->bufferProcessor.bytesPerHostOutputSample, + channelCount ); + + channel += channelCount; + } + + framesProcessed = PaUtil_CopyOutput( &stream->bufferProcessor, &userBuffer, frames - framesWritten ); + + stream->output.framesUsedInCurrentBuffer += framesProcessed; + if( stream->output.framesUsedInCurrentBuffer == stream->output.framesPerBuffer ) + { + result = AdvanceToNextOutputBuffer( stream ); + if( result != paNoError ) + break; + } + + framesWritten += framesProcessed; + } + else + { + /* wait for MME to signal that a buffer is available */ + waitResult = WaitForSingleObject( stream->output.bufferEvent, timeout ); + if( waitResult == WAIT_FAILED ) + { + result = paUnanticipatedHostError; + break; + } + else if( waitResult == WAIT_TIMEOUT ) + { + /* if a timeout is encountered, continue, + perhaps we should give up eventually + */ + } + } + }while( framesWritten < frames ); + } + else + { + result = paCanNotWriteToAnInputOnlyStream; + } + + return result; +} + + +static signed long GetStreamReadAvailable( PaStream* s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + if( PA_IS_INPUT_STREAM_(stream) ) + return GetAvailableFrames( &stream->input ); + else + return paCanNotReadFromAnOutputOnlyStream; +} + + +static signed long GetStreamWriteAvailable( PaStream* s ) +{ + PaWinMmeStream *stream = (PaWinMmeStream*)s; + + if( PA_IS_OUTPUT_STREAM_(stream) ) + return GetAvailableFrames( &stream->output ); + else + return paCanNotWriteToAnInputOnlyStream; +} + + +/* NOTE: the following functions are MME-stream specific, and are called directly + by client code. We need to check for many more error conditions here because + we don't have the benefit of pa_front.c's parameter checking. +*/ + +static PaError GetWinMMEStreamPointer( PaWinMmeStream **stream, PaStream *s ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaWinMmeHostApiRepresentation *winMmeHostApi; + + result = PaUtil_ValidateStreamPointer( s ); + if( result != paNoError ) + return result; + + result = PaUtil_GetHostApiRepresentation( &hostApi, paMME ); + if( result != paNoError ) + return result; + + winMmeHostApi = (PaWinMmeHostApiRepresentation*)hostApi; + + /* note, the following would be easier if there was a generic way of testing + that a stream belongs to a specific host API */ + + if( PA_STREAM_REP( s )->streamInterface == &winMmeHostApi->callbackStreamInterface + || PA_STREAM_REP( s )->streamInterface == &winMmeHostApi->blockingStreamInterface ) + { + /* s is a WinMME stream */ + *stream = (PaWinMmeStream *)s; + return paNoError; + } + else + { + return paIncompatibleStreamHostApi; + } +} + + +int PaWinMME_GetStreamInputHandleCount( PaStream* s ) +{ + PaWinMmeStream *stream; + PaError result = GetWinMMEStreamPointer( &stream, s ); + + if( result == paNoError ) + return (PA_IS_INPUT_STREAM_(stream)) ? stream->input.deviceCount : 0; + else + return result; +} + + +HWAVEIN PaWinMME_GetStreamInputHandle( PaStream* s, int handleIndex ) +{ + PaWinMmeStream *stream; + PaError result = GetWinMMEStreamPointer( &stream, s ); + + if( result == paNoError + && PA_IS_INPUT_STREAM_(stream) + && handleIndex >= 0 + && (unsigned int)handleIndex < stream->input.deviceCount ) + return ((HWAVEIN*)stream->input.waveHandles)[handleIndex]; + else + return 0; +} + + +int PaWinMME_GetStreamOutputHandleCount( PaStream* s) +{ + PaWinMmeStream *stream; + PaError result = GetWinMMEStreamPointer( &stream, s ); + + if( result == paNoError ) + return (PA_IS_OUTPUT_STREAM_(stream)) ? stream->output.deviceCount : 0; + else + return result; +} + + +HWAVEOUT PaWinMME_GetStreamOutputHandle( PaStream* s, int handleIndex ) +{ + PaWinMmeStream *stream; + PaError result = GetWinMMEStreamPointer( &stream, s ); + + if( result == paNoError + && PA_IS_OUTPUT_STREAM_(stream) + && handleIndex >= 0 + && (unsigned int)handleIndex < stream->output.deviceCount ) + return ((HWAVEOUT*)stream->output.waveHandles)[handleIndex]; + else + return 0; +} + + + + + diff --git a/portaudio-v19/src/os/mac_osx/pa_mac_hostapis.c b/portaudio-v19/src/os/mac_osx/pa_mac_hostapis.c new file mode 100644 index 000000000..f8306c302 --- /dev/null +++ b/portaudio-v19/src/os/mac_osx/pa_mac_hostapis.c @@ -0,0 +1,79 @@ +/* + * $Id$ + * Portable Audio I/O Library Windows initialization table + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file +Mac OS host API initialization function table. +*/ + + +#include "pa_hostapi.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaMacSm_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaMacAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +PaUtilHostApiInitializer *paHostApiInitializers[] = +{ +#ifdef PA_USE_COREAUDIO + PaMacCore_Initialize, +#endif + +#ifdef PA_USE_SM + PaMacSm_Initialize, +#endif + +#ifdef PA_USE_JACK + PaJack_Initialize, +#endif + +#ifdef PA_USE_ASIO + PaMacAsio_Initialize, +#endif + + PaSkeleton_Initialize, /* just for testing */ + + 0 /* NULL terminated array */ +}; + + +int paDefaultHostApiIndex = 0; diff --git a/portaudio-v19/src/os/unix/pa_unix_hostapis.c b/portaudio-v19/src/os/unix/pa_unix_hostapis.c new file mode 100644 index 000000000..cbd4befae --- /dev/null +++ b/portaudio-v19/src/os/unix/pa_unix_hostapis.c @@ -0,0 +1,68 @@ +/* + * $Id$ + * Portable Audio I/O Library UNIX initialization table + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + + +#include "pa_hostapi.h" + +PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaAlsa_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaOSS_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +/* Added for IRIX, Pieter, oct 2, 2003: */ +PaError PaSGI_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +/* Linux AudioScience HPI */ +PaError PaAsiHpi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + + +PaUtilHostApiInitializer *paHostApiInitializers[] = + { +#ifdef PA_USE_OSS + PaOSS_Initialize, +#endif + +#ifdef PA_USE_ALSA + PaAlsa_Initialize, +#endif + +#ifdef PA_USE_JACK + PaJack_Initialize, +#endif + /* Added for IRIX, Pieter, oct 2, 2003: */ +#ifdef PA_USE_SGI + PaSGI_Initialize, +#endif + +#ifdef PA_USE_ASIHPI + PaAsiHpi_Initialize, +#endif + 0 /* NULL terminated array */ + }; + +int paDefaultHostApiIndex = 0; diff --git a/portaudio-v19/src/os/unix/pa_unix_util.c b/portaudio-v19/src/os/unix/pa_unix_util.c new file mode 100644 index 000000000..d4b137127 --- /dev/null +++ b/portaudio-v19/src/os/unix/pa_unix_util.c @@ -0,0 +1,672 @@ +/* + * $Id$ + * Portable Audio I/O Library + * UNIX platform-specific support functions + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2000 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + + +#include +#include +#include +#include +#include +#include +#include /* For memset */ +#include +#include + +#include "pa_util.h" +#include "pa_unix_util.h" + +/* + Track memory allocations to avoid leaks. + */ + +#if PA_TRACK_MEMORY +static int numAllocations_ = 0; +#endif + + +void *PaUtil_AllocateMemory( long size ) +{ + void *result = malloc( size ); + +#if PA_TRACK_MEMORY + if( result != NULL ) numAllocations_ += 1; +#endif + return result; +} + + +void PaUtil_FreeMemory( void *block ) +{ + if( block != NULL ) + { + free( block ); +#if PA_TRACK_MEMORY + numAllocations_ -= 1; +#endif + + } +} + + +int PaUtil_CountCurrentlyAllocatedBlocks( void ) +{ +#if PA_TRACK_MEMORY + return numAllocations_; +#else + return 0; +#endif +} + + +void Pa_Sleep( long msec ) +{ +#ifdef HAVE_NANOSLEEP + struct timespec req = {0}, rem = {0}; + PaTime time = msec / 1.e3; + req.tv_sec = (time_t)time; + assert(time - req.tv_sec < 1.0); + req.tv_nsec = (long)((time - req.tv_sec) * 1.e9); + nanosleep(&req, &rem); + /* XXX: Try sleeping the remaining time (contained in rem) if interrupted by a signal? */ +#else + while( msec > 999 ) /* For OpenBSD and IRIX, argument */ + { /* to usleep must be < 1000000. */ + usleep( 999000 ); + msec -= 999; + } + usleep( msec * 1000 ); +#endif +} + +/* *** NOT USED YET: *** +static int usePerformanceCounter_; +static double microsecondsPerTick_; +*/ + +void PaUtil_InitializeClock( void ) +{ + /* TODO */ +} + + +PaTime PaUtil_GetTime( void ) +{ +#ifdef HAVE_CLOCK_GETTIME + struct timespec tp; + clock_gettime(CLOCK_REALTIME, &tp); + return (PaTime)(tp.tv_sec + tp.tv_nsec / 1.e9); +#else + struct timeval tv; + gettimeofday( &tv, NULL ); + return (PaTime) tv.tv_usec / 1000000. + tv.tv_sec; +#endif +} + +PaError PaUtil_InitializeThreading( PaUtilThreading *threading ) +{ + (void) paUtilErr_; + return paNoError; +} + +void PaUtil_TerminateThreading( PaUtilThreading *threading ) +{ +} + +PaError PaUtil_StartThreading( PaUtilThreading *threading, void *(*threadRoutine)(void *), void *data ) +{ + pthread_create( &threading->callbackThread, NULL, threadRoutine, data ); + return paNoError; +} + +PaError PaUtil_CancelThreading( PaUtilThreading *threading, int wait, PaError *exitResult ) +{ + PaError result = paNoError; + void *pret; + + if( exitResult ) + *exitResult = paNoError; + + /* Only kill the thread if it isn't in the process of stopping (flushing adaptation buffers) */ + if( !wait ) + pthread_cancel( threading->callbackThread ); /* XXX: Safe to call this if the thread has exited on its own? */ + pthread_join( threading->callbackThread, &pret ); + +#ifdef PTHREAD_CANCELED + if( pret && PTHREAD_CANCELED != pret ) +#else + /* !wait means the thread may have been canceled */ + if( pret && wait ) +#endif + { + if( exitResult ) + *exitResult = *(PaError *) pret; + free( pret ); + } + + return result; +} + +/* Threading */ +/* paUnixMainThread + * We have to be a bit careful with defining this global variable, + * as explained below. */ +#ifdef __apple__ +/* apple/gcc has a "problem" with global vars and dynamic libs. + Initializing it seems to fix the problem. + Described a bit in this thread: + http://gcc.gnu.org/ml/gcc/2005-06/msg00179.html +*/ +pthread_t paUnixMainThread = 0; +#else +/*pthreads are opaque. We don't know that asigning it an int value + always makes sense, so we don't initialize it unless we have to.*/ +pthread_t paUnixMainThread = 0; +#endif + +PaError PaUnixThreading_Initialize() +{ + paUnixMainThread = pthread_self(); + return paNoError; +} + +#if 0 +PaError PaUnixThread_Initialize( PaUnixThread* self ) +{ + th->watchdogRunning = 0; + th->rtSched = 0; + th->callbackTime = 0; + th->callbackCpuTime = 0; + th->useWatchdog = 1; + th->throttledSleepTime = 0; + th->cpuLoadMeasurer = clm; + + th->rtPrio = (sched_get_priority_max( SCHED_FIFO ) - sched_get_priority_min( SCHED_FIFO )) / 2 + + sched_get_priority_min( SCHED_FIFO ); +} +#endif + +PaError PaUnixThread_New( PaUnixThread* self, void* (*threadFunc)( void* ), void* threadArg, PaTime waitForChild ) +{ + PaError result = paNoError; + pthread_attr_t attr; + int started = 0; + + memset( self, 0, sizeof (PaUnixThread) ); + PaUnixMutex_Initialize( &self->mtx ); + PA_ASSERT_CALL( pthread_cond_init( &self->cond, NULL ), 0 ); + + self->parentWaiting = 0 != waitForChild; + + /* Spawn thread */ + +#if 0 && defined _POSIX_MEMLOCK && (_POSIX_MEMLOCK != -1) + if( th->rtSched ) + { + if( mlockall( MCL_CURRENT | MCL_FUTURE ) < 0 ) + { + int savedErrno = errno; /* In case errno gets overwritten */ + assert( savedErrno != EINVAL ); /* Most likely a programmer error */ + PA_UNLESS( (savedErrno == EPERM), paInternalError ); + PA_DEBUG(( "%s: Failed locking memory\n", __FUNCTION__ )); + } + else + PA_DEBUG(( "%s: Successfully locked memory\n", __FUNCTION__ )); + } +#endif + + PA_UNLESS( !pthread_attr_init( &attr ), paInternalError ); + /* Priority relative to other processes */ + PA_UNLESS( !pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ), paInternalError ); + + PA_UNLESS( !pthread_create( &self->thread, &attr, threadFunc, threadArg ), paInternalError ); + started = 1; + +#if 0 + if( th->rtSched ) + { + if( th->useWatchdog ) + { + int err; + struct sched_param wdSpm = { 0 }; + /* Launch watchdog, watchdog sets callback thread priority */ + int prio = PA_MIN( th->rtPrio + 4, sched_get_priority_max( SCHED_FIFO ) ); + wdSpm.sched_priority = prio; + + PA_UNLESS( !pthread_attr_init( &attr ), paInternalError ); + PA_UNLESS( !pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ), paInternalError ); + PA_UNLESS( !pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ), paInternalError ); + PA_UNLESS( !pthread_attr_setschedpolicy( &attr, SCHED_FIFO ), paInternalError ); + PA_UNLESS( !pthread_attr_setschedparam( &attr, &wdSpm ), paInternalError ); + if( (err = pthread_create( &th->watchdogThread, &attr, &WatchdogFunc, th )) ) + { + PA_UNLESS( err == EPERM, paInternalError ); + /* Permission error, go on without realtime privileges */ + PA_DEBUG(( "Failed bumping priority\n" )); + } + else + { + int policy; + th->watchdogRunning = 1; + PA_ENSURE_SYSTEM( pthread_getschedparam( th->watchdogThread, &policy, &wdSpm ), 0 ); + /* Check if priority is right, policy could potentially differ from SCHED_FIFO (but that's alright) */ + if( wdSpm.sched_priority != prio ) + { + PA_DEBUG(( "Watchdog priority not set correctly (%d)\n", wdSpm.sched_priority )); + PA_ENSURE( paInternalError ); + } + } + } + else + PA_ENSURE( BoostPriority( th ) ); + } +#endif + + if( self->parentWaiting ) + { + PaTime till; + struct timespec ts; + int res = 0; + PaTime now; + + PA_ENSURE( PaUnixMutex_Lock( &self->mtx ) ); + + /* Wait for stream to be started */ + now = PaUtil_GetTime(); + till = now + waitForChild; + + while( self->parentWaiting && !res ) + { + if( waitForChild > 0 ) + { + ts.tv_sec = (time_t) floor( till ); + ts.tv_nsec = (long) ((till - floor( till )) * 1e9); + res = pthread_cond_timedwait( &self->cond, &self->mtx.mtx, &ts ); + } + else + { + res = pthread_cond_wait( &self->cond, &self->mtx.mtx ); + } + } + + PA_ENSURE( PaUnixMutex_Unlock( &self->mtx ) ); + + PA_UNLESS( !res || ETIMEDOUT == res, paInternalError ); + PA_DEBUG(( "%s: Waited for %g seconds for stream to start\n", __FUNCTION__, PaUtil_GetTime() - now )); + if( ETIMEDOUT == res ) + { + PA_ENSURE( paTimedOut ); + } + } + +end: + return result; +error: + if( started ) + { + PaUnixThread_Terminate( self, 0, NULL ); + } + + goto end; +} + +PaError PaUnixThread_Terminate( PaUnixThread* self, int wait, PaError* exitResult ) +{ + PaError result = paNoError; + void* pret; + + if( exitResult ) + { + *exitResult = paNoError; + } +#if 0 + if( watchdogExitResult ) + *watchdogExitResult = paNoError; + + if( th->watchdogRunning ) + { + pthread_cancel( th->watchdogThread ); + PA_ENSURE_SYSTEM( pthread_join( th->watchdogThread, &pret ), 0 ); + + if( pret && pret != PTHREAD_CANCELED ) + { + if( watchdogExitResult ) + *watchdogExitResult = *(PaError *) pret; + free( pret ); + } + } +#endif + + /* Only kill the thread if it isn't in the process of stopping (flushing adaptation buffers) */ + /* TODO: Make join time out */ + self->stopRequested = wait; + if( !wait ) + { + PA_DEBUG(( "%s: Canceling thread %d\n", __FUNCTION__, self->thread )); + /* XXX: Safe to call this if the thread has exited on its own? */ + pthread_cancel( self->thread ); + } + PA_DEBUG(( "%s: Joining thread %d\n", __FUNCTION__, self->thread )); + PA_ENSURE_SYSTEM( pthread_join( self->thread, &pret ), 0 ); + + if( pret && PTHREAD_CANCELED != pret ) + { + if( exitResult ) + { + *exitResult = *(PaError*)pret; + } + free( pret ); + } + +error: + PA_ASSERT_CALL( PaUnixMutex_Terminate( &self->mtx ), paNoError ); + PA_ASSERT_CALL( pthread_cond_destroy( &self->cond ), 0 ); + + return result; +} + +PaError PaUnixThread_PrepareNotify( PaUnixThread* self ) +{ + PaError result = paNoError; + PA_UNLESS( self->parentWaiting, paInternalError ); + + PA_ENSURE( PaUnixMutex_Lock( &self->mtx ) ); + self->locked = 1; + +error: + return result; +} + +PaError PaUnixThread_NotifyParent( PaUnixThread* self ) +{ + PaError result = paNoError; + PA_UNLESS( self->parentWaiting, paInternalError ); + + if( !self->locked ) + { + PA_ENSURE( PaUnixMutex_Lock( &self->mtx ) ); + self->locked = 1; + } + self->parentWaiting = 0; + pthread_cond_signal( &self->cond ); + PA_ENSURE( PaUnixMutex_Unlock( &self->mtx ) ); + self->locked = 0; + +error: + return result; +} + +int PaUnixThread_StopRequested( PaUnixThread* self ) +{ + return self->stopRequested; +} + +PaError PaUnixMutex_Initialize( PaUnixMutex* self ) +{ + PaError result = paNoError; + PA_ASSERT_CALL( pthread_mutex_init( &self->mtx, NULL ), 0 ); + return result; +} + +PaError PaUnixMutex_Terminate( PaUnixMutex* self ) +{ + PaError result = paNoError; + PA_ASSERT_CALL( pthread_mutex_destroy( &self->mtx ), 0 ); + return result; +} + +/** Lock mutex. + * + * We're disabling thread cancellation while the thread is holding a lock, so mutexes are + * properly unlocked at termination time. + */ +PaError PaUnixMutex_Lock( PaUnixMutex* self ) +{ + PaError result = paNoError; + int oldState; + + PA_ENSURE_SYSTEM( pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &oldState ), 0 ); + PA_ENSURE_SYSTEM( pthread_mutex_lock( &self->mtx ), 0 ); + +error: + return result; +} + +/** Unlock mutex. + * + * Thread cancellation is enabled again after the mutex is properly unlocked. + */ +PaError PaUnixMutex_Unlock( PaUnixMutex* self ) +{ + PaError result = paNoError; + int oldState; + + PA_ENSURE_SYSTEM( pthread_mutex_unlock( &self->mtx ), 0 ); + PA_ENSURE_SYSTEM( pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, &oldState ), 0 ); + +error: + return result; +} + +#if 0 +/* Threading utility struct */ +typedef struct PaAlsaThreading +{ + pthread_t watchdogThread; + pthread_t callbackThread; + int watchdogRunning; + int rtSched; + int rtPrio; + int useWatchdog; + unsigned long throttledSleepTime; + volatile PaTime callbackTime; + volatile PaTime callbackCpuTime; + PaUtilCpuLoadMeasurer *cpuLoadMeasurer; +} PaAlsaThreading; + +static void OnWatchdogExit( void *userData ) +{ + PaAlsaThreading *th = (PaAlsaThreading *) userData; + struct sched_param spm = { 0 }; + assert( th ); + + PA_ASSERT_CALL( pthread_setschedparam( th->callbackThread, SCHED_OTHER, &spm ), 0 ); /* Lower before exiting */ + PA_DEBUG(( "Watchdog exiting\n" )); +} + +static PaError BoostPriority( PaAlsaThreading *th ) +{ + PaError result = paNoError; + struct sched_param spm = { 0 }; + spm.sched_priority = th->rtPrio; + + assert( th ); + + if( pthread_setschedparam( th->callbackThread, SCHED_FIFO, &spm ) != 0 ) + { + PA_UNLESS( errno == EPERM, paInternalError ); /* Lack permission to raise priority */ + PA_DEBUG(( "Failed bumping priority\n" )); + result = 0; + } + else + result = 1; /* Success */ +error: + return result; +} + +static void *WatchdogFunc( void *userData ) +{ + PaError result = paNoError, *pres = NULL; + int err; + PaAlsaThreading *th = (PaAlsaThreading *) userData; + unsigned intervalMsec = 500; + const PaTime maxSeconds = 3.; /* Max seconds between callbacks */ + PaTime timeThen = PaUtil_GetTime(), timeNow, timeElapsed, cpuTimeThen, cpuTimeNow, cpuTimeElapsed; + double cpuLoad, avgCpuLoad = 0.; + int throttled = 0; + + assert( th ); + + /* Execute OnWatchdogExit when exiting */ + pthread_cleanup_push( &OnWatchdogExit, th ); + + /* Boost priority of callback thread */ + PA_ENSURE( result = BoostPriority( th ) ); + if( !result ) + { + /* Boost failed, might as well exit */ + pthread_exit( NULL ); + } + + cpuTimeThen = th->callbackCpuTime; + { + int policy; + struct sched_param spm = { 0 }; + pthread_getschedparam( pthread_self(), &policy, &spm ); + PA_DEBUG(( "%s: Watchdog priority is %d\n", __FUNCTION__, spm.sched_priority )); + } + + while( 1 ) + { + double lowpassCoeff = 0.9, lowpassCoeff1 = 0.99999 - lowpassCoeff; + + /* Test before and after in case whatever underlying sleep call isn't interrupted by pthread_cancel */ + pthread_testcancel(); + Pa_Sleep( intervalMsec ); + pthread_testcancel(); + + if( PaUtil_GetTime() - th->callbackTime > maxSeconds ) + { + PA_DEBUG(( "Watchdog: Terminating callback thread\n" )); + /* Tell thread to terminate */ + err = pthread_kill( th->callbackThread, SIGKILL ); + pthread_exit( NULL ); + } + + PA_DEBUG(( "%s: PortAudio reports CPU load: %g\n", __FUNCTION__, PaUtil_GetCpuLoad( th->cpuLoadMeasurer ) )); + + /* Check if we should throttle, or unthrottle :P */ + cpuTimeNow = th->callbackCpuTime; + cpuTimeElapsed = cpuTimeNow - cpuTimeThen; + cpuTimeThen = cpuTimeNow; + + timeNow = PaUtil_GetTime(); + timeElapsed = timeNow - timeThen; + timeThen = timeNow; + cpuLoad = cpuTimeElapsed / timeElapsed; + avgCpuLoad = avgCpuLoad * lowpassCoeff + cpuLoad * lowpassCoeff1; + /* + if( throttled ) + PA_DEBUG(( "Watchdog: CPU load: %g, %g\n", avgCpuLoad, cpuTimeElapsed )); + */ + if( PaUtil_GetCpuLoad( th->cpuLoadMeasurer ) > .925 ) + { + static int policy; + static struct sched_param spm = { 0 }; + static const struct sched_param defaultSpm = { 0 }; + PA_DEBUG(( "%s: Throttling audio thread, priority %d\n", __FUNCTION__, spm.sched_priority )); + + pthread_getschedparam( th->callbackThread, &policy, &spm ); + if( !pthread_setschedparam( th->callbackThread, SCHED_OTHER, &defaultSpm ) ) + { + throttled = 1; + } + else + PA_DEBUG(( "Watchdog: Couldn't lower priority of audio thread: %s\n", strerror( errno ) )); + + /* Give other processes a go, before raising priority again */ + PA_DEBUG(( "%s: Watchdog sleeping for %lu msecs before unthrottling\n", __FUNCTION__, th->throttledSleepTime )); + Pa_Sleep( th->throttledSleepTime ); + + /* Reset callback priority */ + if( pthread_setschedparam( th->callbackThread, SCHED_FIFO, &spm ) != 0 ) + { + PA_DEBUG(( "%s: Couldn't raise priority of audio thread: %s\n", __FUNCTION__, strerror( errno ) )); + } + + if( PaUtil_GetCpuLoad( th->cpuLoadMeasurer ) >= .99 ) + intervalMsec = 50; + else + intervalMsec = 100; + + /* + lowpassCoeff = .97; + lowpassCoeff1 = .99999 - lowpassCoeff; + */ + } + else if( throttled && avgCpuLoad < .8 ) + { + intervalMsec = 500; + throttled = 0; + + /* + lowpassCoeff = .9; + lowpassCoeff1 = .99999 - lowpassCoeff; + */ + } + } + + pthread_cleanup_pop( 1 ); /* Execute cleanup on exit */ + +error: + /* Shouldn't get here in the normal case */ + + /* Pass on error code */ + pres = malloc( sizeof (PaError) ); + *pres = result; + + pthread_exit( pres ); +} + +static void CallbackUpdate( PaAlsaThreading *th ) +{ + th->callbackTime = PaUtil_GetTime(); + th->callbackCpuTime = PaUtil_GetCpuLoad( th->cpuLoadMeasurer ); +} +#endif + +/* +static void *CanaryFunc( void *userData ) +{ + const unsigned intervalMsec = 1000; + PaUtilThreading *th = (PaUtilThreading *) userData; + + while( 1 ) + { + th->canaryTime = PaUtil_GetTime(); + + pthread_testcancel(); + Pa_Sleep( intervalMsec ); + } + + pthread_exit( NULL ); +} +*/ diff --git a/portaudio-v19/src/os/unix/pa_unix_util.h b/portaudio-v19/src/os/unix/pa_unix_util.h new file mode 100644 index 000000000..49bfedf8f --- /dev/null +++ b/portaudio-v19/src/os/unix/pa_unix_util.h @@ -0,0 +1,179 @@ +#ifndef PA_UNIX_UTIL_H +#define PA_UNIX_UTIL_H + +#include "pa_cpuload.h" +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#define PA_MIN(x,y) ( (x) < (y) ? (x) : (y) ) +#define PA_MAX(x,y) ( (x) > (y) ? (x) : (y) ) + +/* Utilize GCC branch prediction for error tests */ +#if defined __GNUC__ && __GNUC__ >= 3 +#define UNLIKELY(expr) __builtin_expect( (expr), 0 ) +#else +#define UNLIKELY(expr) (expr) +#endif + +#define STRINGIZE_HELPER(expr) #expr +#define STRINGIZE(expr) STRINGIZE_HELPER(expr) + +#define PA_UNLESS(expr, code) \ + do { \ + if( UNLIKELY( (expr) == 0 ) ) \ + { \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = (code); \ + goto error; \ + } \ + } while (0); + +static PaError paUtilErr_; /* Used with PA_ENSURE */ + +/* Check PaError */ +#define PA_ENSURE(expr) \ + do { \ + if( UNLIKELY( (paUtilErr_ = (expr)) < paNoError ) ) \ + { \ + PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ + result = paUtilErr_; \ + goto error; \ + } \ + } while (0); + +#define PA_ASSERT_CALL(expr, success) \ + paUtilErr_ = (expr); \ + assert( success == paUtilErr_ ); + +#define PA_ENSURE_SYSTEM(expr, success) \ + do { \ + if( UNLIKELY( (paUtilErr_ = (expr)) != success ) ) \ + { \ + /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ + if( pthread_equal(pthread_self(), paUnixMainThread) ) \ + { \ + PaUtil_SetLastHostErrorInfo( paALSA, paUtilErr_, strerror( paUtilErr_ ) ); \ + } \ + PaUtil_DebugPrint( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" ); \ + result = paUnanticipatedHostError; \ + goto error; \ + } \ + } while( 0 ); + +typedef struct { + pthread_t callbackThread; +} PaUtilThreading; + +PaError PaUtil_InitializeThreading( PaUtilThreading *threading ); +void PaUtil_TerminateThreading( PaUtilThreading *threading ); +PaError PaUtil_StartThreading( PaUtilThreading *threading, void *(*threadRoutine)(void *), void *data ); +PaError PaUtil_CancelThreading( PaUtilThreading *threading, int wait, PaError *exitResult ); + +/* State accessed by utility functions */ + +/* +void PaUnix_SetRealtimeScheduling( int rt ); + +void PaUtil_InitializeThreading( PaUtilThreading *th, PaUtilCpuLoadMeasurer *clm ); + +PaError PaUtil_CreateCallbackThread( PaUtilThreading *th, void *(*CallbackThreadFunc)( void * ), PaStream *s ); + +PaError PaUtil_KillCallbackThread( PaUtilThreading *th, PaError *exitResult ); + +void PaUtil_CallbackUpdate( PaUtilThreading *th ); +*/ + +extern pthread_t paUnixMainThread; + +typedef struct +{ + pthread_mutex_t mtx; +} PaUnixMutex; + +PaError PaUnixMutex_Initialize( PaUnixMutex* self ); +PaError PaUnixMutex_Terminate( PaUnixMutex* self ); +PaError PaUnixMutex_Lock( PaUnixMutex* self ); +PaError PaUnixMutex_Unlock( PaUnixMutex* self ); + +typedef struct +{ + pthread_t thread; + int parentWaiting; + int stopRequested; + int locked; + PaUnixMutex mtx; + pthread_cond_t cond; + volatile sig_atomic_t stopRequest; +} PaUnixThread; + +/** Initialize global threading state. + */ +PaError PaUnixThreading_Initialize(); + +/** Perish, passing on eventual error code. + * + * A thin wrapper around pthread_exit, will automatically pass on any error code to the joining thread. + * If the result indicates an error, i.e. it is not equal to paNoError, this function will automatically + * allocate a pointer so the error is passed on with pthread_exit. If the result indicates that all is + * well however, only a NULL pointer will be handed to pthread_exit. Thus, the joining thread should + * check whether a non-NULL result pointer is obtained from pthread_join and make sure to free it. + * @param result: The error code to pass on to the joining thread. + */ +#define PaUnixThreading_EXIT(result) \ + do { \ + PaError* pres = NULL; \ + if( paNoError != (result) ) \ + { \ + pres = malloc( sizeof (PaError) ); \ + *pres = (result); \ + } \ + pthread_exit( pres ); \ + } while (0); + +/** Spawn a thread. + * + * Intended for spawning the callback thread from the main thread. This function can even block (for a certain + * time or indefinitely) untill notified by the callback thread (using PaUnixThread_NotifyParent), which can be + * useful in order to make sure that callback has commenced before returning from Pa_StartStream. + * @param threadFunc: The function to be executed in the child thread. + * @param waitForChild: If not 0, wait for child thread to call PaUnixThread_NotifyParent. Less than 0 means + * wait for ever, greater than 0 wait for the specified time. + * @return: If timed out waiting on child, paTimedOut. + */ +PaError PaUnixThread_New( PaUnixThread* self, void* (*threadFunc)( void* ), void* threadArg, PaTime waitForChild ); + +/** Terminate thread. + * + * @param wait: If true, request that background thread stop and wait untill it does, else cancel it. + * @param exitResult: If non-null this will upon return contain the exit status of the thread. + */ +PaError PaUnixThread_Terminate( PaUnixThread* self, int wait, PaError* exitResult ); + +/** Prepare to notify waiting parent thread. + * + * An internal lock must be held before the parent is notified in PaUnixThread_NotifyParent, call this to + * acquire it beforehand. + * @return: If parent is not waiting, paInternalError. + */ +PaError PaUnixThread_PrepareNotify( PaUnixThread* self ); + +/** Notify waiting parent thread. + * + * @return: If parent timed out waiting, paTimedOut. If parent was never waiting, paInternalError. + */ +PaError PaUnixThread_NotifyParent( PaUnixThread* self ); + +/** Has the parent thread requested this thread to stop? + */ +int PaUnixThread_StopRequested( PaUnixThread* self ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif diff --git a/portaudio-v19/src/os/win/pa_win_hostapis.c b/portaudio-v19/src/os/win/pa_win_hostapis.c new file mode 100644 index 000000000..acdaf9aa6 --- /dev/null +++ b/portaudio-v19/src/os/win/pa_win_hostapis.c @@ -0,0 +1,91 @@ +/* + * $Id$ + * Portable Audio I/O Library Windows initialization table + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2002 Ross Bencina, Phil Burk + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + Win32 host API initialization function table. + + @todo Consider using PA_USE_WMME etc instead of PA_NO_WMME. This is what + the Unix version does, we should consider being consistent. +*/ + + +#include "pa_hostapi.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaWinDs_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaWinWdm_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +PaUtilHostApiInitializer *paHostApiInitializers[] = + { + +#ifndef PA_NO_WMME + PaWinMme_Initialize, +#endif + +#ifndef PA_NO_DS + PaWinDs_Initialize, +#endif + +#ifndef PA_NO_ASIO + PaAsio_Initialize, +#endif + +/* +#ifndef PA_NO_WASAPI + PaWinWasapi_Initialize, +#endif + +#ifndef PA_NO_WDMKS + PaWinWdm_Initialize, +#endif +*/ + + PaSkeleton_Initialize, /* just for testing */ + + 0 /* NULL terminated array */ + }; + + +int paDefaultHostApiIndex = 0; + diff --git a/portaudio-v19/src/os/win/pa_win_util.c b/portaudio-v19/src/os/win/pa_win_util.c new file mode 100644 index 000000000..32d0dbb98 --- /dev/null +++ b/portaudio-v19/src/os/win/pa_win_util.c @@ -0,0 +1,134 @@ +/* + * $Id$ + * Portable Audio I/O Library + * Win32 platform-specific support functions + * + * Based on the Open Source API proposed by Ross Bencina + * Copyright (c) 1999-2000 Ross Bencina + * + * 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. + * + * 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. + * + * 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. + */ + +/** @file + Win32 platform-specific support functions. + + @todo Implement workaround for QueryPerformanceCounter() skipping forward + bug. (see msdn kb Q274323). +*/ + +#include +#include /* for timeGetTime() */ + +#include "pa_util.h" + + +/* + Track memory allocations to avoid leaks. + */ + +#if PA_TRACK_MEMORY +static int numAllocations_ = 0; +#endif + + +void *PaUtil_AllocateMemory( long size ) +{ + void *result = GlobalAlloc( GPTR, size ); + +#if PA_TRACK_MEMORY + if( result != NULL ) numAllocations_ += 1; +#endif + return result; +} + + +void PaUtil_FreeMemory( void *block ) +{ + if( block != NULL ) + { + GlobalFree( block ); +#if PA_TRACK_MEMORY + numAllocations_ -= 1; +#endif + + } +} + + +int PaUtil_CountCurrentlyAllocatedBlocks( void ) +{ +#if PA_TRACK_MEMORY + return numAllocations_; +#else + return 0; +#endif +} + + +void Pa_Sleep( long msec ) +{ + Sleep( msec ); +} + +static int usePerformanceCounter_; +static double secondsPerTick_; + +void PaUtil_InitializeClock( void ) +{ + LARGE_INTEGER ticksPerSecond; + + if( QueryPerformanceFrequency( &ticksPerSecond ) != 0 ) + { + usePerformanceCounter_ = 1; + secondsPerTick_ = 1.0 / (double)ticksPerSecond.QuadPart; + } + else + { + usePerformanceCounter_ = 0; + } +} + + +double PaUtil_GetTime( void ) +{ + LARGE_INTEGER time; + + if( usePerformanceCounter_ ) + { + /* FIXME: + according to this knowledge-base article, QueryPerformanceCounter + can skip forward by seconds! + http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q274323& + + it may be better to use the rtdsc instruction using inline asm, + however then a method is needed to calculate a ticks/seconds ratio. + */ + QueryPerformanceCounter( &time ); + return time.QuadPart * secondsPerTick_; + } + else + { + return timeGetTime() * .001; + } +} diff --git a/portaudio-v19/src/os/win/pa_x86_plain_converters.c b/portaudio-v19/src/os/win/pa_x86_plain_converters.c new file mode 100644 index 000000000..98442a8c6 --- /dev/null +++ b/portaudio-v19/src/os/win/pa_x86_plain_converters.c @@ -0,0 +1,1167 @@ +#include "pa_x86_plain_converters.h" + +#include "pa_converters.h" +#include "pa_dither.h" + +/* + plain intel assemby versions of standard pa converter functions. + + the main reason these versions are faster than the equivalent C versions + is that float -> int casting is expensive in C on x86 because the rounding + mode needs to be changed for every cast. these versions only set + the rounding mode once outside the loop. + + small additional speed gains are made by the way that clamping is + implemented. + +TODO: + o- inline dither code + o- implement Dither only (no-clip) versions + o- implement int8 and uint8 versions + o- test thouroughly + + o- the packed 24 bit functions could benefit from unrolling and avoiding + byte and word sized register access. +*/ + +/* -------------------------------------------------------------------------- */ + +/* +#define PA_CLIP_( val, min, max )\ + { val = ((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val)); } +*/ + +/* + the following notes were used to determine whether a floating point + value should be saturated (ie >1 or <-1) by loading it into an integer + register. these should be rewritten so that they make sense. + + an ieee floating point value + + 1.xxxxxxxxxxxxxxxxxxxx? + + + is less than or equal to 1 and greater than or equal to -1 either: + + if the mantissa is 0 and the unbiased exponent is 0 + + OR + + if the unbiased exponent < 0 + + this translates to: + + if the mantissa is 0 and the biased exponent is 7F + + or + + if the biased exponent is less than 7F + + + therefore the value is greater than 1 or less than -1 if + + the mantissa is not 0 and the biased exponent is 7F + + or + + if the biased exponent is greater than 7F + + + in other words, if we mask out the sign bit, the value is + greater than 1 or less than -1 if its integer representation is greater than: + + 0 01111111 0000 0000 0000 0000 0000 000 + + 0011 1111 1000 0000 0000 0000 0000 0000 => 0x3F800000 +*/ + +/* -------------------------------------------------------------------------- */ + +static const short fpuControlWord_ = 0x033F; /*round to nearest, 64 bit precision, all exceptions masked*/ +static const double int32Scaler_ = 0x7FFFFFFF; +static const double ditheredInt32Scaler_ = 0x7FFFFFFE; +static const double int24Scaler_ = 0x7FFFFF; +static const double ditheredInt24Scaler_ = 0x7FFFFE; +static const double int16Scaler_ = 0x7FFF; +static const double ditheredInt16Scaler_ = 0x7FFE; + +#define PA_DITHER_BITS_ (15) +/* Multiply by PA_FLOAT_DITHER_SCALE_ to get a float between -2.0 and +1.99999 */ +#define PA_FLOAT_DITHER_SCALE_ (1.0 / ((1< source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 and int32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int32Scaler_ // stack: (int)0x7FFFFFFF + + Float32_To_Int32_loop: + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFFFFFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFFFFFF, (int)0x7FFFFFFF + /* + note: we could store to a temporary qword here which would cause + wraparound distortion instead of int indefinite 0x10. that would + be more work, and given that not enabling clipping is only advisable + when you know that your signal isn't going to clip it isn't worth it. + */ + fistp dword ptr [edi] // pop st(0) into dest, stack: (int)0x7FFFFFFF + + add edi, ebx // increment destination ptr + //lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int32_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + signed long *dest = (signed long*)destinationBuffer; + (void) ditherGenerator; // unused parameter + + while( count-- ) + { + // REVIEW + double scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648., 2147483647. ); + *dest = (signed long) scaled; + + src += sourceStride; + dest += destinationStride; + } +*/ + + short savedFpuControlWord; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 and int32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int32Scaler_ // stack: (int)0x7FFFFFFF + + Float32_To_Int32_Clip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int32_Clip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFFFFFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFFFFFF, (int)0x7FFFFFFF + fistp dword ptr [edi] // pop st(0) into dest, stack: (int)0x7FFFFFFF + jmp Float32_To_Int32_Clip_stored + + Float32_To_Int32_Clip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add edx, 0x7FFFFFFF // convert to maximum range integers + mov dword ptr [edi], edx + + Float32_To_Int32_Clip_stored: + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int32_Clip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int32_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ + /* + float *src = (float*)sourceBuffer; + signed long *dest = (signed long*)destinationBuffer; + + while( count-- ) + { + // REVIEW + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + // use smaller scaler to prevent overflow when we add the dither + double dithered = ((double)*src * (2147483646.0)) + dither; + PA_CLIP_( dithered, -2147483648., 2147483647. ); + *dest = (signed long) dithered; + + + src += sourceStride; + dest += destinationStride; + } + */ + + short savedFpuControlWord; + + // spill storage: + signed long sourceByteStride; + signed long highpassedDither; + + // dither state: + unsigned long ditherPrevious = ditherGenerator->previous; + unsigned long ditherRandSeed1 = ditherGenerator->randSeed1; + unsigned long ditherRandSeed2 = ditherGenerator->randSeed2; + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 and int32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld ditheredInt32Scaler_ // stack: int scaler + + Float32_To_Int32_DitherClip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int32_DitherClip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, int scaler + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*(int scaler), int scaler + + /* + // call PaUtil_GenerateFloatTriangularDither with C calling convention + mov sourceByteStride, eax // save eax + mov sourceEnd, ecx // save ecx + push ditherGenerator // pass ditherGenerator parameter on stack + call PaUtil_GenerateFloatTriangularDither // stack: dither, value*(int scaler), int scaler + pop edx // clear parameter off stack + mov ecx, sourceEnd // restore ecx + mov eax, sourceByteStride // restore eax + */ + + // generate dither + mov sourceByteStride, eax // save eax + mov edx, 196314165 + mov eax, ditherRandSeed1 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov ditherRandSeed1, eax + mov edx, 196314165 + mov eax, ditherRandSeed2 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov edx, ditherRandSeed1 + shr edx, PA_DITHER_SHIFT_ + mov ditherRandSeed2, eax + shr eax, PA_DITHER_SHIFT_ + //add eax, edx // eax -> current + lea eax, [eax+edx] + mov edx, ditherPrevious + neg edx + lea edx, [eax+edx] // highpass = current - previous + mov highpassedDither, edx + mov ditherPrevious, eax // previous = current + mov eax, sourceByteStride // restore eax + fild highpassedDither + fmul const_float_dither_scale_ + // end generate dither, dither signal in st(0) + + faddp st(1), st(0) // stack: dither + value*(int scaler), int scaler + fistp dword ptr [edi] // pop st(0) into dest, stack: int scaler + jmp Float32_To_Int32_DitherClip_stored + + Float32_To_Int32_DitherClip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add edx, 0x7FFFFFFF // convert to maximum range integers + mov dword ptr [edi], edx + + Float32_To_Int32_DitherClip_stored: + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int32_DitherClip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } + + ditherGenerator->previous = ditherPrevious; + ditherGenerator->randSeed1 = ditherRandSeed1; + ditherGenerator->randSeed2 = ditherRandSeed2; +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + signed long temp; + + (void) ditherGenerator; // unused parameter + + while( count-- ) + { + // convert to 32 bit and drop the low 8 bits + double scaled = *src * 0x7FFFFFFF; + temp = (signed long) scaled; + + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); + + src += sourceStride; + dest += destinationStride * 3; + } +*/ + + short savedFpuControlWord; + + signed long tempInt32; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov edx, 3 // sizeof int24 + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int24Scaler_ // stack: (int)0x7FFFFF + + Float32_To_Int24_loop: + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFFFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFFFF, (int)0x7FFFFF + fistp tempInt32 // pop st(0) into tempInt32, stack: (int)0x7FFFFF + mov edx, tempInt32 + + mov byte ptr [edi], DL + shr edx, 8 + //mov byte ptr [edi+1], DL + //mov byte ptr [edi+2], DH + mov word ptr [edi+1], DX + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int24_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + signed long temp; + + (void) ditherGenerator; // unused parameter + + while( count-- ) + { + // convert to 32 bit and drop the low 8 bits + double scaled = *src * 0x7FFFFFFF; + PA_CLIP_( scaled, -2147483648., 2147483647. ); + temp = (signed long) scaled; + + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); + + src += sourceStride; + dest += destinationStride * 3; + } +*/ + + short savedFpuControlWord; + + signed long tempInt32; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov edx, 3 // sizeof int24 + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int24Scaler_ // stack: (int)0x7FFFFF + + Float32_To_Int24_Clip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int24_Clip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFFFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFFFF, (int)0x7FFFFF + fistp tempInt32 // pop st(0) into tempInt32, stack: (int)0x7FFFFF + mov edx, tempInt32 + jmp Float32_To_Int24_Clip_store + + Float32_To_Int24_Clip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add edx, 0x7FFFFF // convert to maximum range integers + + Float32_To_Int24_Clip_store: + + mov byte ptr [edi], DL + shr edx, 8 + //mov byte ptr [edi+1], DL + //mov byte ptr [edi+2], DH + mov word ptr [edi+1], DX + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int24_Clip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int24_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + unsigned char *dest = (unsigned char*)destinationBuffer; + signed long temp; + + while( count-- ) + { + // convert to 32 bit and drop the low 8 bits + + // FIXME: the dither amplitude here appears to be too small by 8 bits + double dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + // use smaller scaler to prevent overflow when we add the dither + double dithered = ((double)*src * (2147483646.0)) + dither; + PA_CLIP_( dithered, -2147483648., 2147483647. ); + + temp = (signed long) dithered; + + dest[0] = (unsigned char)(temp >> 8); + dest[1] = (unsigned char)(temp >> 16); + dest[2] = (unsigned char)(temp >> 24); + + src += sourceStride; + dest += destinationStride * 3; + } +*/ + + short savedFpuControlWord; + + // spill storage: + signed long sourceByteStride; + signed long highpassedDither; + + // dither state: + unsigned long ditherPrevious = ditherGenerator->previous; + unsigned long ditherRandSeed1 = ditherGenerator->randSeed1; + unsigned long ditherRandSeed2 = ditherGenerator->randSeed2; + + signed long tempInt32; + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx + + mov ecx, count + imul ecx, eax + add ecx, esi + + mov edi, destinationBuffer + + mov edx, 3 // sizeof int24 + mov ebx, destinationStride + imul ebx, edx + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld ditheredInt24Scaler_ // stack: int scaler + + Float32_To_Int24_DitherClip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int24_DitherClip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, int scaler + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*(int scaler), int scaler + + /* + // call PaUtil_GenerateFloatTriangularDither with C calling convention + mov sourceByteStride, eax // save eax + mov sourceEnd, ecx // save ecx + push ditherGenerator // pass ditherGenerator parameter on stack + call PaUtil_GenerateFloatTriangularDither // stack: dither, value*(int scaler), int scaler + pop edx // clear parameter off stack + mov ecx, sourceEnd // restore ecx + mov eax, sourceByteStride // restore eax + */ + + // generate dither + mov sourceByteStride, eax // save eax + mov edx, 196314165 + mov eax, ditherRandSeed1 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov ditherRandSeed1, eax + mov edx, 196314165 + mov eax, ditherRandSeed2 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov edx, ditherRandSeed1 + shr edx, PA_DITHER_SHIFT_ + mov ditherRandSeed2, eax + shr eax, PA_DITHER_SHIFT_ + //add eax, edx // eax -> current + lea eax, [eax+edx] + mov edx, ditherPrevious + neg edx + lea edx, [eax+edx] // highpass = current - previous + mov highpassedDither, edx + mov ditherPrevious, eax // previous = current + mov eax, sourceByteStride // restore eax + fild highpassedDither + fmul const_float_dither_scale_ + // end generate dither, dither signal in st(0) + + faddp st(1), st(0) // stack: dither * value*(int scaler), int scaler + fistp tempInt32 // pop st(0) into tempInt32, stack: int scaler + mov edx, tempInt32 + jmp Float32_To_Int24_DitherClip_store + + Float32_To_Int24_DitherClip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add edx, 0x7FFFFF // convert to maximum range integers + + Float32_To_Int24_DitherClip_store: + + mov byte ptr [edi], DL + shr edx, 8 + //mov byte ptr [edi+1], DL + //mov byte ptr [edi+2], DH + mov word ptr [edi+1], DX + + //add edi, ebx // increment destination ptr + lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int24_DitherClip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } + + ditherGenerator->previous = ditherPrevious; + ditherGenerator->randSeed1 = ditherRandSeed1; + ditherGenerator->randSeed2 = ditherRandSeed2; +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + signed short *dest = (signed short*)destinationBuffer; + (void)ditherGenerator; // unused parameter + + while( count-- ) + { + + short samp = (short) (*src * (32767.0f)); + *dest = samp; + + src += sourceStride; + dest += destinationStride; + } +*/ + + short savedFpuControlWord; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx // source byte stride + + mov ecx, count + imul ecx, eax + add ecx, esi // source end ptr = count * source byte stride + source ptr + + mov edi, destinationBuffer + + mov edx, 2 // sizeof int16 + mov ebx, destinationStride + imul ebx, edx // destination byte stride + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int16Scaler_ // stack: (int)0x7FFF + + Float32_To_Int16_loop: + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFF, (int)0x7FFF + fistp word ptr [edi] // store scaled int into dest, stack: (int)0x7FFF + + add edi, ebx // increment destination ptr + //lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int16_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_Clip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + signed short *dest = (signed short*)destinationBuffer; + (void)ditherGenerator; // unused parameter + + while( count-- ) + { + long samp = (signed long) (*src * (32767.0f)); + PA_CLIP_( samp, -0x8000, 0x7FFF ); + *dest = (signed short) samp; + + src += sourceStride; + dest += destinationStride; + } +*/ + + short savedFpuControlWord; + + (void) ditherGenerator; /* unused parameter */ + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx // source byte stride + + mov ecx, count + imul ecx, eax + add ecx, esi // source end ptr = count * source byte stride + source ptr + + mov edi, destinationBuffer + + mov edx, 2 // sizeof int16 + mov ebx, destinationStride + imul ebx, edx // destination byte stride + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld int16Scaler_ // stack: (int)0x7FFF + + Float32_To_Int16_Clip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int16_Clip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, (int)0x7FFF + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*0x7FFF, (int)0x7FFF + fistp word ptr [edi] // store scaled int into dest, stack: (int)0x7FFF + jmp Float32_To_Int16_Clip_stored + + Float32_To_Int16_Clip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add dx, 0x7FFF // convert to maximum range integers + mov word ptr [edi], dx // store clamped into into dest + + Float32_To_Int16_Clip_stored: + + add edi, ebx // increment destination ptr + //lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int16_Clip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } +} + +/* -------------------------------------------------------------------------- */ + +static void Float32_To_Int16_DitherClip( + void *destinationBuffer, signed int destinationStride, + void *sourceBuffer, signed int sourceStride, + unsigned int count, PaUtilTriangularDitherGenerator *ditherGenerator ) +{ +/* + float *src = (float*)sourceBuffer; + signed short *dest = (signed short*)destinationBuffer; + (void)ditherGenerator; // unused parameter + + while( count-- ) + { + + float dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator ); + // use smaller scaler to prevent overflow when we add the dither + float dithered = (*src * (32766.0f)) + dither; + signed long samp = (signed long) dithered; + PA_CLIP_( samp, -0x8000, 0x7FFF ); + *dest = (signed short) samp; + + src += sourceStride; + dest += destinationStride; + } +*/ + + short savedFpuControlWord; + + // spill storage: + signed long sourceByteStride; + signed long highpassedDither; + + // dither state: + unsigned long ditherPrevious = ditherGenerator->previous; + unsigned long ditherRandSeed1 = ditherGenerator->randSeed1; + unsigned long ditherRandSeed2 = ditherGenerator->randSeed2; + + __asm{ + // esi -> source ptr + // eax -> source byte stride + // edi -> destination ptr + // ebx -> destination byte stride + // ecx -> source end ptr + // edx -> temp + + mov esi, sourceBuffer + + mov edx, 4 // sizeof float32 + mov eax, sourceStride + imul eax, edx // source byte stride + + mov ecx, count + imul ecx, eax + add ecx, esi // source end ptr = count * source byte stride + source ptr + + mov edi, destinationBuffer + + mov edx, 2 // sizeof int16 + mov ebx, destinationStride + imul ebx, edx // destination byte stride + + fwait + fstcw savedFpuControlWord + fldcw fpuControlWord_ + + fld ditheredInt16Scaler_ // stack: int scaler + + Float32_To_Int16_DitherClip_loop: + + mov edx, dword ptr [esi] // load floating point value into integer register + + and edx, 0x7FFFFFFF // mask off sign + cmp edx, 0x3F800000 // greater than 1.0 or less than -1.0 + + jg Float32_To_Int16_DitherClip_clamp + + // load unscaled value into st(0) + fld dword ptr [esi] // stack: value, int scaler + add esi, eax // increment source ptr + //lea esi, [esi+eax] + fmul st(0), st(1) // st(0) *= st(1), stack: value*(int scaler), int scaler + + /* + // call PaUtil_GenerateFloatTriangularDither with C calling convention + mov sourceByteStride, eax // save eax + mov sourceEnd, ecx // save ecx + push ditherGenerator // pass ditherGenerator parameter on stack + call PaUtil_GenerateFloatTriangularDither // stack: dither, value*(int scaler), int scaler + pop edx // clear parameter off stack + mov ecx, sourceEnd // restore ecx + mov eax, sourceByteStride // restore eax + */ + + // generate dither + mov sourceByteStride, eax // save eax + mov edx, 196314165 + mov eax, ditherRandSeed1 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov ditherRandSeed1, eax + mov edx, 196314165 + mov eax, ditherRandSeed2 + mul edx // eax:edx = eax * 196314165 + //add eax, 907633515 + lea eax, [eax+907633515] + mov edx, ditherRandSeed1 + shr edx, PA_DITHER_SHIFT_ + mov ditherRandSeed2, eax + shr eax, PA_DITHER_SHIFT_ + //add eax, edx // eax -> current + lea eax, [eax+edx] // current = randSeed1>>x + randSeed2>>x + mov edx, ditherPrevious + neg edx + lea edx, [eax+edx] // highpass = current - previous + mov highpassedDither, edx + mov ditherPrevious, eax // previous = current + mov eax, sourceByteStride // restore eax + fild highpassedDither + fmul const_float_dither_scale_ + // end generate dither, dither signal in st(0) + + faddp st(1), st(0) // stack: dither * value*(int scaler), int scaler + fistp word ptr [edi] // store scaled int into dest, stack: int scaler + jmp Float32_To_Int16_DitherClip_stored + + Float32_To_Int16_DitherClip_clamp: + mov edx, dword ptr [esi] // load floating point value into integer register + shr edx, 31 // move sign bit into bit 0 + add esi, eax // increment source ptr + //lea esi, [esi+eax] + add dx, 0x7FFF // convert to maximum range integers + mov word ptr [edi], dx // store clamped into into dest + + Float32_To_Int16_DitherClip_stored: + + add edi, ebx // increment destination ptr + //lea edi, [edi+ebx] + + cmp esi, ecx // has src ptr reached end? + jne Float32_To_Int16_DitherClip_loop + + ffree st(0) + fincstp + + fwait + fnclex + fldcw savedFpuControlWord + } + + ditherGenerator->previous = ditherPrevious; + ditherGenerator->randSeed1 = ditherRandSeed1; + ditherGenerator->randSeed2 = ditherRandSeed2; +} + +/* -------------------------------------------------------------------------- */ + +void PaUtil_InitializeX86PlainConverters( void ) +{ + paConverters.Float32_To_Int32 = Float32_To_Int32; + paConverters.Float32_To_Int32_Clip = Float32_To_Int32_Clip; + paConverters.Float32_To_Int32_DitherClip = Float32_To_Int32_DitherClip; + + paConverters.Float32_To_Int24 = Float32_To_Int24; + paConverters.Float32_To_Int24_Clip = Float32_To_Int24_Clip; + paConverters.Float32_To_Int24_DitherClip = Float32_To_Int24_DitherClip; + + paConverters.Float32_To_Int16 = Float32_To_Int16; + paConverters.Float32_To_Int16_Clip = Float32_To_Int16_Clip; + paConverters.Float32_To_Int16_DitherClip = Float32_To_Int16_DitherClip; +} + +/* -------------------------------------------------------------------------- */ diff --git a/portaudio-v19/src/os/win/pa_x86_plain_converters.h b/portaudio-v19/src/os/win/pa_x86_plain_converters.h new file mode 100644 index 000000000..f56c710fd --- /dev/null +++ b/portaudio-v19/src/os/win/pa_x86_plain_converters.h @@ -0,0 +1,19 @@ +#ifndef PA_X86_PLAIN_CONVERTERS_H +#define PA_X86_PLAIN_CONVERTERS_H + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** + @brief Install optimised converter functions suitable for all IA32 processors +*/ +void PaUtil_InitializeX86PlainConverters( void ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PA_X86_PLAIN_CONVERTERS_H */ From 226f768092112ede379402644e2922fa160e8aba Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 9 Aug 2006 20:04:28 +0000 Subject: [PATCH 188/811] - Make sure compiled python code gets cleaned as well git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@248 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 07538ba30..c3e697113 100644 --- a/Makefile.in +++ b/Makefile.in @@ -124,5 +124,5 @@ wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py .PHONY : clean clean: - ${RM} -f *.o *.so *~ JT65code wsjt6 + ${RM} -f *.o *.pyc *.so *~ JT65code wsjt6 (cd portaudio-v19;${MAKE} clean) From 39f88b793deecc35151e5c9e2ee5a671a5cbd312 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 9 Aug 2006 20:08:01 +0000 Subject: [PATCH 189/811] - Add missing bits of portaudio git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@249 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- portaudio-v19/COMPILING.DARWIN | 1 + portaudio-v19/Makefile.darwin | 220 + portaudio-v19/bindings/cpp/AUTHORS | 0 portaudio-v19/bindings/cpp/COPYING | 340 + portaudio-v19/bindings/cpp/ChangeLog | 178 + portaudio-v19/bindings/cpp/INSTALL | 236 + portaudio-v19/bindings/cpp/Makefile.am | 7 + portaudio-v19/bindings/cpp/Makefile.in | 640 + portaudio-v19/bindings/cpp/NEWS | 0 portaudio-v19/bindings/cpp/README | 0 portaudio-v19/bindings/cpp/SConscript | 64 + portaudio-v19/bindings/cpp/aclocal.m4 | 7336 ++++++ portaudio-v19/bindings/cpp/bin/Makefile.am | 9 + portaudio-v19/bindings/cpp/bin/Makefile.in | 468 + .../bindings/cpp/build/gnu/Makefile.in | 106 + .../bindings/cpp/build/gnu/OUT_OF_DATE | 0 .../bindings/cpp/build/gnu/aclocal.m4 | 57 + .../bindings/cpp/build/gnu/config.guess | 1308 + .../bindings/cpp/build/gnu/config.sub | 1505 ++ .../bindings/cpp/build/gnu/configure | 4297 ++++ .../bindings/cpp/build/gnu/configure.ac | 214 + .../bindings/cpp/build/gnu/install-sh | 251 + .../bindings/cpp/build/vc6/devs_example.dsp | 248 + .../bindings/cpp/build/vc6/devs_example.dsw | 44 + .../bindings/cpp/build/vc6/sine_example.dsp | 252 + .../bindings/cpp/build/vc6/sine_example.dsw | 44 + .../bindings/cpp/build/vc6/static_library.dsp | 395 + .../bindings/cpp/build/vc6/static_library.dsw | 29 + .../bindings/cpp/build/vc7/OUT_OF_DATE | 0 .../bindings/cpp/build/vc7_1/devs_example.sln | 30 + .../cpp/build/vc7_1/devs_example.vcproj | 195 + .../bindings/cpp/build/vc7_1/sine_example.sln | 30 + .../cpp/build/vc7_1/sine_example.vcproj | 327 + .../cpp/build/vc7_1/static_library.sln | 21 + .../cpp/build/vc7_1/static_library.vcproj | 218 + portaudio-v19/bindings/cpp/configure | 20242 ++++++++++++++++ portaudio-v19/bindings/cpp/configure.ac | 54 + portaudio-v19/bindings/cpp/doc/Makefile.am | 5 + portaudio-v19/bindings/cpp/doc/Makefile.in | 324 + portaudio-v19/bindings/cpp/doc/README | 34 + portaudio-v19/bindings/cpp/doc/config.doxy | 211 + .../bindings/cpp/doc/config.doxy.linux | 210 + portaudio-v19/bindings/cpp/example/devs.cxx | 177 + portaudio-v19/bindings/cpp/example/sine.cxx | 137 + .../bindings/cpp/include/Makefile.am | 22 + .../bindings/cpp/include/Makefile.in | 421 + .../portaudiocpp/AsioDeviceAdapter.hxx | 44 + .../cpp/include/portaudiocpp/AutoSystem.hxx | 62 + .../include/portaudiocpp/BlockingStream.hxx | 45 + .../portaudiocpp/CFunCallbackStream.hxx | 49 + .../portaudiocpp/CallbackInterface.hxx | 45 + .../include/portaudiocpp/CallbackStream.hxx | 40 + .../portaudiocpp/CppFunCallbackStream.hxx | 86 + .../cpp/include/portaudiocpp/Device.hxx | 91 + .../DirectionSpecificStreamParameters.hxx | 77 + .../cpp/include/portaudiocpp/Exception.hxx | 108 + .../cpp/include/portaudiocpp/HostApi.hxx | 76 + .../portaudiocpp/InterfaceCallbackStream.hxx | 49 + .../portaudiocpp/MemFunCallbackStream.hxx | 107 + .../cpp/include/portaudiocpp/PortAudioCpp.hxx | 109 + .../include/portaudiocpp/SampleDataFormat.hxx | 35 + .../cpp/include/portaudiocpp/Stream.hxx | 82 + .../include/portaudiocpp/StreamParameters.hxx | 77 + .../cpp/include/portaudiocpp/System.hxx | 107 + .../portaudiocpp/SystemDeviceIterator.hxx | 66 + .../portaudiocpp/SystemHostApiIterator.hxx | 61 + portaudio-v19/bindings/cpp/lib/Makefile.am | 26 + portaudio-v19/bindings/cpp/lib/Makefile.in | 613 + portaudio-v19/bindings/cpp/portaudiocpp.pc.in | 12 + .../source/portaudiocpp/AsioDeviceAdapter.cxx | 83 + .../source/portaudiocpp/BlockingStream.cxx | 100 + .../portaudiocpp/CFunCallbackStream.cxx | 41 + .../source/portaudiocpp/CallbackInterface.cxx | 25 + .../source/portaudiocpp/CallbackStream.cxx | 20 + .../portaudiocpp/CppFunCallbackStream.cxx | 81 + .../cpp/source/portaudiocpp/Device.cxx | 168 + .../DirectionSpecificStreamParameters.cxx | 163 + .../cpp/source/portaudiocpp/Exception.cxx | 123 + .../cpp/source/portaudiocpp/HostApi.cxx | 121 + .../portaudiocpp/InterfaceCallbackStream.cxx | 45 + .../portaudiocpp/MemFunCallbackStream.cxx | 4 + .../cpp/source/portaudiocpp/Stream.cxx | 195 + .../source/portaudiocpp/StreamParameters.cxx | 165 + .../cpp/source/portaudiocpp/System.cxx | 308 + .../portaudiocpp/SystemDeviceIterator.cxx | 60 + .../portaudiocpp/SystemHostApiIterator.cxx | 59 + portaudio-v19/depcomp | 530 + portaudio-v19/libtool | 7930 ++++++ portaudio-v19/ltmain.sh | 6971 ++++++ portaudio-v19/missing | 360 + portaudio-v19/portaudio-2.0.pc.in | 12 + portaudio-v19/test/README.txt | 60 + portaudio-v19/test/debug_convert.c | 131 + portaudio-v19/test/debug_dither_calc.c | 55 + portaudio-v19/test/debug_dual.c | 183 + portaudio-v19/test/debug_multi_in.c | 179 + portaudio-v19/test/debug_multi_out.c | 144 + portaudio-v19/test/debug_record.c | 339 + portaudio-v19/test/debug_record_reuse.c | 351 + portaudio-v19/test/debug_sine.c | 192 + portaudio-v19/test/debug_sine_amp.c | 157 + portaudio-v19/test/debug_sine_formats.c | 202 + portaudio-v19/test/debug_srate.c | 265 + portaudio-v19/test/debug_test1.c | 114 + portaudio-v19/test/pa_devs.c | 230 + portaudio-v19/test/pa_fuzz.c | 168 + portaudio-v19/test/pa_minlat.c | 187 + portaudio-v19/test/paqa_devs.c | 347 + portaudio-v19/test/paqa_errs.c | 380 + portaudio-v19/test/patest1.c | 192 + portaudio-v19/test/patest_buffer.c | 192 + portaudio-v19/test/patest_callbackstop.c | 221 + portaudio-v19/test/patest_clip.c | 178 + portaudio-v19/test/patest_dither.c | 178 + portaudio-v19/test/patest_hang.c | 152 + portaudio-v19/test/patest_in_overflow.c | 224 + portaudio-v19/test/patest_latency.c | 182 + portaudio-v19/test/patest_leftright.c | 173 + portaudio-v19/test/patest_longsine.c | 140 + portaudio-v19/test/patest_many.c | 198 + portaudio-v19/test/patest_maxsines.c | 204 + portaudio-v19/test/patest_mono.c | 145 + .../test/patest_mono_asio_channel_select.c | 155 + portaudio-v19/test/patest_multi_sine.c | 194 + portaudio-v19/test/patest_out_underflow.c | 217 + portaudio-v19/test/patest_pink.c | 269 + portaudio-v19/test/patest_prime.c | 223 + portaudio-v19/test/patest_read_record.c | 229 + portaudio-v19/test/patest_read_write_wire.c | 195 + portaudio-v19/test/patest_record.c | 337 + portaudio-v19/test/patest_ringmix.c | 79 + portaudio-v19/test/patest_saw.c | 125 + portaudio-v19/test/patest_sine.c | 151 + portaudio-v19/test/patest_sine8.c | 212 + portaudio-v19/test/patest_sine_formats.c | 196 + portaudio-v19/test/patest_sine_time.c | 208 + portaudio-v19/test/patest_start_stop.c | 162 + portaudio-v19/test/patest_stop.c | 313 + portaudio-v19/test/patest_stop_playout.c | 432 + portaudio-v19/test/patest_sync.c | 259 + portaudio-v19/test/patest_timing.c | 165 + portaudio-v19/test/patest_toomanysines.c | 173 + portaudio-v19/test/patest_two_rates.c | 168 + portaudio-v19/test/patest_underflow.c | 150 + portaudio-v19/test/patest_wire.c | 284 + portaudio-v19/test/patest_write_sine.c | 147 + portaudio-v19/test/patest_write_stop.c | 158 + 147 files changed, 71802 insertions(+) create mode 100644 portaudio-v19/COMPILING.DARWIN create mode 100644 portaudio-v19/Makefile.darwin create mode 100644 portaudio-v19/bindings/cpp/AUTHORS create mode 100644 portaudio-v19/bindings/cpp/COPYING create mode 100644 portaudio-v19/bindings/cpp/ChangeLog create mode 100644 portaudio-v19/bindings/cpp/INSTALL create mode 100644 portaudio-v19/bindings/cpp/Makefile.am create mode 100644 portaudio-v19/bindings/cpp/Makefile.in create mode 100644 portaudio-v19/bindings/cpp/NEWS create mode 100644 portaudio-v19/bindings/cpp/README create mode 100644 portaudio-v19/bindings/cpp/SConscript create mode 100644 portaudio-v19/bindings/cpp/aclocal.m4 create mode 100644 portaudio-v19/bindings/cpp/bin/Makefile.am create mode 100644 portaudio-v19/bindings/cpp/bin/Makefile.in create mode 100644 portaudio-v19/bindings/cpp/build/gnu/Makefile.in create mode 100644 portaudio-v19/bindings/cpp/build/gnu/OUT_OF_DATE create mode 100644 portaudio-v19/bindings/cpp/build/gnu/aclocal.m4 create mode 100644 portaudio-v19/bindings/cpp/build/gnu/config.guess create mode 100644 portaudio-v19/bindings/cpp/build/gnu/config.sub create mode 100644 portaudio-v19/bindings/cpp/build/gnu/configure create mode 100644 portaudio-v19/bindings/cpp/build/gnu/configure.ac create mode 100644 portaudio-v19/bindings/cpp/build/gnu/install-sh create mode 100644 portaudio-v19/bindings/cpp/build/vc6/devs_example.dsp create mode 100644 portaudio-v19/bindings/cpp/build/vc6/devs_example.dsw create mode 100644 portaudio-v19/bindings/cpp/build/vc6/sine_example.dsp create mode 100644 portaudio-v19/bindings/cpp/build/vc6/sine_example.dsw create mode 100644 portaudio-v19/bindings/cpp/build/vc6/static_library.dsp create mode 100644 portaudio-v19/bindings/cpp/build/vc6/static_library.dsw create mode 100644 portaudio-v19/bindings/cpp/build/vc7/OUT_OF_DATE create mode 100644 portaudio-v19/bindings/cpp/build/vc7_1/devs_example.sln create mode 100644 portaudio-v19/bindings/cpp/build/vc7_1/devs_example.vcproj create mode 100644 portaudio-v19/bindings/cpp/build/vc7_1/sine_example.sln create mode 100644 portaudio-v19/bindings/cpp/build/vc7_1/sine_example.vcproj create mode 100644 portaudio-v19/bindings/cpp/build/vc7_1/static_library.sln create mode 100644 portaudio-v19/bindings/cpp/build/vc7_1/static_library.vcproj create mode 100755 portaudio-v19/bindings/cpp/configure create mode 100644 portaudio-v19/bindings/cpp/configure.ac create mode 100644 portaudio-v19/bindings/cpp/doc/Makefile.am create mode 100644 portaudio-v19/bindings/cpp/doc/Makefile.in create mode 100644 portaudio-v19/bindings/cpp/doc/README create mode 100644 portaudio-v19/bindings/cpp/doc/config.doxy create mode 100644 portaudio-v19/bindings/cpp/doc/config.doxy.linux create mode 100644 portaudio-v19/bindings/cpp/example/devs.cxx create mode 100644 portaudio-v19/bindings/cpp/example/sine.cxx create mode 100644 portaudio-v19/bindings/cpp/include/Makefile.am create mode 100644 portaudio-v19/bindings/cpp/include/Makefile.in create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/AsioDeviceAdapter.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/AutoSystem.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/BlockingStream.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/CFunCallbackStream.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/CallbackInterface.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/CallbackStream.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/CppFunCallbackStream.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/Device.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/Exception.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/HostApi.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/InterfaceCallbackStream.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/MemFunCallbackStream.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/PortAudioCpp.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/SampleDataFormat.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/Stream.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/StreamParameters.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/System.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx create mode 100644 portaudio-v19/bindings/cpp/include/portaudiocpp/SystemHostApiIterator.hxx create mode 100644 portaudio-v19/bindings/cpp/lib/Makefile.am create mode 100644 portaudio-v19/bindings/cpp/lib/Makefile.in create mode 100644 portaudio-v19/bindings/cpp/portaudiocpp.pc.in create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/AsioDeviceAdapter.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/BlockingStream.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/CFunCallbackStream.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/CallbackStream.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/CppFunCallbackStream.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/Device.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/DirectionSpecificStreamParameters.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/Exception.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/HostApi.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/InterfaceCallbackStream.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/MemFunCallbackStream.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/Stream.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/StreamParameters.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/System.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx create mode 100644 portaudio-v19/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx create mode 100755 portaudio-v19/depcomp create mode 100755 portaudio-v19/libtool create mode 100644 portaudio-v19/ltmain.sh create mode 100755 portaudio-v19/missing create mode 100644 portaudio-v19/portaudio-2.0.pc.in create mode 100644 portaudio-v19/test/README.txt create mode 100644 portaudio-v19/test/debug_convert.c create mode 100644 portaudio-v19/test/debug_dither_calc.c create mode 100644 portaudio-v19/test/debug_dual.c create mode 100644 portaudio-v19/test/debug_multi_in.c create mode 100644 portaudio-v19/test/debug_multi_out.c create mode 100644 portaudio-v19/test/debug_record.c create mode 100644 portaudio-v19/test/debug_record_reuse.c create mode 100644 portaudio-v19/test/debug_sine.c create mode 100644 portaudio-v19/test/debug_sine_amp.c create mode 100644 portaudio-v19/test/debug_sine_formats.c create mode 100644 portaudio-v19/test/debug_srate.c create mode 100644 portaudio-v19/test/debug_test1.c create mode 100644 portaudio-v19/test/pa_devs.c create mode 100644 portaudio-v19/test/pa_fuzz.c create mode 100644 portaudio-v19/test/pa_minlat.c create mode 100644 portaudio-v19/test/paqa_devs.c create mode 100644 portaudio-v19/test/paqa_errs.c create mode 100644 portaudio-v19/test/patest1.c create mode 100644 portaudio-v19/test/patest_buffer.c create mode 100644 portaudio-v19/test/patest_callbackstop.c create mode 100644 portaudio-v19/test/patest_clip.c create mode 100644 portaudio-v19/test/patest_dither.c create mode 100644 portaudio-v19/test/patest_hang.c create mode 100644 portaudio-v19/test/patest_in_overflow.c create mode 100644 portaudio-v19/test/patest_latency.c create mode 100644 portaudio-v19/test/patest_leftright.c create mode 100644 portaudio-v19/test/patest_longsine.c create mode 100644 portaudio-v19/test/patest_many.c create mode 100644 portaudio-v19/test/patest_maxsines.c create mode 100644 portaudio-v19/test/patest_mono.c create mode 100644 portaudio-v19/test/patest_mono_asio_channel_select.c create mode 100644 portaudio-v19/test/patest_multi_sine.c create mode 100644 portaudio-v19/test/patest_out_underflow.c create mode 100644 portaudio-v19/test/patest_pink.c create mode 100644 portaudio-v19/test/patest_prime.c create mode 100644 portaudio-v19/test/patest_read_record.c create mode 100644 portaudio-v19/test/patest_read_write_wire.c create mode 100644 portaudio-v19/test/patest_record.c create mode 100644 portaudio-v19/test/patest_ringmix.c create mode 100644 portaudio-v19/test/patest_saw.c create mode 100644 portaudio-v19/test/patest_sine.c create mode 100644 portaudio-v19/test/patest_sine8.c create mode 100644 portaudio-v19/test/patest_sine_formats.c create mode 100644 portaudio-v19/test/patest_sine_time.c create mode 100644 portaudio-v19/test/patest_start_stop.c create mode 100644 portaudio-v19/test/patest_stop.c create mode 100644 portaudio-v19/test/patest_stop_playout.c create mode 100644 portaudio-v19/test/patest_sync.c create mode 100644 portaudio-v19/test/patest_timing.c create mode 100644 portaudio-v19/test/patest_toomanysines.c create mode 100644 portaudio-v19/test/patest_two_rates.c create mode 100644 portaudio-v19/test/patest_underflow.c create mode 100644 portaudio-v19/test/patest_wire.c create mode 100644 portaudio-v19/test/patest_write_sine.c create mode 100644 portaudio-v19/test/patest_write_stop.c diff --git a/portaudio-v19/COMPILING.DARWIN b/portaudio-v19/COMPILING.DARWIN new file mode 100644 index 000000000..6d7aa8714 --- /dev/null +++ b/portaudio-v19/COMPILING.DARWIN @@ -0,0 +1 @@ +To compile on darwin, you will need to use the darwin makefile, gcc 3.3 or later and the universal SDK. for more info, see http://portaudio.com/trac/wiki/TutorialDir/Compile/MacintoshCoreAudio diff --git a/portaudio-v19/Makefile.darwin b/portaudio-v19/Makefile.darwin new file mode 100644 index 000000000..57198c657 --- /dev/null +++ b/portaudio-v19/Makefile.darwin @@ -0,0 +1,220 @@ +# +# PortAudio V19 Makefile.darwin +# +# Bjorn Roche of XO Audio (www.xoaudio.com) +# Based on autoconf's makefile, created from Makefile generated by +# autoconf. Autoconf files written by by Dominic Mazzoni with modifications +# by Mikael Magnusson. +# + +top_srcdir = . +srcdir = . + +top_builddir = . +OPT_LEVEL := -O2 +PREFIX = /usr/local +prefix = $(PREFIX) +exec_prefix = ${prefix} +bindir = ${exec_prefix}/bin +libdir = ${exec_prefix}/lib +includedir = ${prefix}/include +CC = gcc +CFLAGS = -g -std=gnu99 -Werror -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3 $(OPT_LEVEL) -Wall -pedantic -pipe -fPIC -DPA_BIG_ENDIAN -Ipa_common -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DPA_USE_COREAUDIO=1 -Iinclude -Isrc/common +LIBS = -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon +AR = /usr/bin/ar +RANLIB = ranlib +LIBTOOL = $(SHELL) $(top_builddir)/libtool +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +SHARED_FLAGS = -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3 +DLL_LIBS = +CXXFLAGS = -g $(OPT_LEVEL) +NASM = +NASMOPT = +LN_S = ln -s +LT_RELEASE=@LT_RELEASE@ +LT_CURRENT=2 +LT_REVISION=0 +LT_AGE=0 + + +OTHER_OBJS = src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/ringbuffer.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o + +PALIB = libportaudio.a +PADLL = libportaudio +PADLLV_MIN = 19 +PADLLV = 0.0.19 +PADLLEXT = .dylib +PASHLIBNAME = $(PADLL).$(PADLLV)$(PADLLEXT) +PAINC = include/portaudio.h +PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined -export -symbols-regex "Pa_.*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) + +COMMON_OBJS = \ + src/common/pa_allocation.o \ + src/common/pa_converters.o \ + src/common/pa_cpuload.o \ + src/common/pa_dither.o \ + src/common/pa_front.o \ + src/common/pa_process.o \ + src/common/pa_skeleton.o \ + src/common/pa_stream.o \ + src/common/pa_trace.o + +TESTS = \ + bin/paqa_devs \ + bin/paqa_errs \ + bin/patest1 \ + bin/patest_buffer \ + bin/patest_callbackstop \ + bin/patest_clip \ + bin/patest_dither \ + bin/patest_hang \ + bin/patest_in_overflow \ + bin/patest_latency \ + bin/patest_leftright \ + bin/patest_longsine \ + bin/patest_many \ + bin/patest_maxsines \ + bin/patest_multi_sine \ + bin/patest_out_underflow \ + bin/patest_pink \ + bin/patest_prime \ + bin/patest_read_record \ + bin/patest_read_write_wire \ + bin/patest_record \ + bin/patest_ringmix \ + bin/patest_saw \ + bin/patest_sine8 \ + bin/patest_sine \ + bin/patest_sine_formats \ + bin/patest_sine_time \ + bin/patest_start_stop \ + bin/patest_stop \ + bin/patest_sync \ + bin/patest_timing \ + bin/patest_toomanysines \ + bin/patest_underflow \ + bin/patest_wire \ + bin/patest_write_sine \ + bin/patest_write_stop \ + bin/pa_devs \ + bin/pa_fuzz \ + bin/pa_minlat + +# Most of these don't compile yet. Put them in TESTS, above, if +# you want to try to compile them... +ALL_TESTS = \ + $(TESTS) \ + bin/debug_convert \ + bin/debug_dither_calc \ + bin/debug_dual \ + bin/debug_multi_in \ + bin/debug_multi_out \ + bin/debug_record \ + bin/debug_record_reuse \ + bin/debug_sine_amp \ + bin/debug_sine \ + bin/debug_sine_formats \ + bin/debug_srate \ + bin/debug_test1 \ + bin/pa_devs \ + bin/pa_fuzz \ + bin/pa_minlat \ + bin/paqa_devs \ + bin/paqa_errs \ + bin/patest1 \ + bin/patest_buffer \ + bin/patest_clip \ + bin/patest_dither \ + bin/patest_hang \ + bin/patest_in_overflow \ + bin/patest_latency \ + bin/patest_leftright \ + bin/patest_longsine \ + bin/patest_many \ + bin/patest_maxsines \ + bin/patest_multi_sine \ + bin/patest_out_underflow \ + bin/patest_pink \ + bin/patest_read_record \ + bin/patest_record \ + bin/patest_ringmix \ + bin/patest_saw \ + bin/patest_sine8 \ + bin/patest_sine \ + bin/patest_sine_formats \ + bin/patest_sine_time \ + bin/patest_start_stop \ + bin/patest_stop \ + bin/patest_sync \ + bin/patest_timing \ + bin/patest_toomanysines \ + bin/patest_underflow \ + bin/patest_wire \ + bin/patest_write_sine + +OBJS = $(COMMON_OBJS) $(OTHER_OBJS) + +#LTOBJS:= $(OBJS:.o=.lo) + +all: lib/$(PALIB) lib/$(PASHLIBNAME) tests + +tests: bin/ $(TESTS) + +lib/$(PALIB): lib/ $(OBJS) Makefile.darwin $(PAINC) + -rm lib/$(PALIB) + $(AR) ruv lib/$(PALIB) $(OBJS) + $(RANLIB) lib/$(PALIB) + +lib/$(PASHLIBNAME): lib/ $(OBJS) Makefile.darwin $(PAINC) + $(CC) $(SHARED_FLAGS) -o lib/$(PASHLIBNAME) $(OBJS) $(DLL_LIBS) -install_name $(PREFIX)/lib/$(PASHLIBNAME) -compatibility_version $(PADLLV) -current_version $(PADLLV) + +$(TESTS): bin/%: lib/$(PALIB) Makefile.darwin $(PAINC) test/%.c + $(CC) -o $@ $(CFLAGS) test/$*.c lib/$(PALIB) $(LIBS) + +install: lib/$(PALIB) lib/$(PASHLIBNAME) portaudio-2.0.pc + $(INSTALL) -d $(PREFIX)/lib + $(INSTALL) -m 644 lib/$(PASHLIBNAME) $(PREFIX)/lib/$(PASHLIBNAME) + $(INSTALL) -m 644 lib/$(PALIB) $(PREFIX)/lib/$(PALIB) + cd $(PREFIX)/lib && rm -f $(PADLL)$(PADLLEXT) && ln -s $(PASHLIBNAME) $(PADLL)$(PADLLEXT) + $(INSTALL) -d $(PREFIX)/include + $(INSTALL) -m 644 include/portaudio.h $(PREFIX)/include/portaudio.h + $(INSTALL) -d $(PREFIX)/lib/pkgconfig + $(INSTALL) -m 644 portaudio-2.0.pc $(PREFIX)/lib/pkgconfig/portaudio-2.0.pc + @echo "" + @echo "------------------------------------------------------------" + @echo "PortAudio was successfully installed." + @echo "" + @echo "On some systems (e.g. Linux) you should run 'ldconfig' now" + @echo "to make the shared object available. You may also need to" + @echo "modify your LD_LIBRARY_PATH environment variable to include" + @echo "the directory $(PREFIX)/lib" + @echo "------------------------------------------------------------" + @echo "" + +uninstall: + rm -f $(PREFIX)/lib/$(PASHLIBNAME) + rm -f $(PREFIX)/lib/$(PALIB) + rm -f $(PREFIX)/lib/$(PADLL)$(PADLLEXT) + rm -f $(PREFIX)/include/portaudio.h + +clean: + rm -f $(OBJS) $(TESTS) lib/$(PALIB) lib/$(PASHLIBNAME) + +%.o: %.c Makefile.darwin $(PAINC) + $(CC) -c $(CFLAGS) $< -o $@ + +%.o: %.cpp Makefile.darwin $(PAINC) + $(CXX) -c $(CXXFLAGS) $< -o $@ + +%.o: %.asm + $(NASM) $(NASMOPT) -o $@ $< + +bin: + mkdir bin + +lib: + mkdir lib + + + diff --git a/portaudio-v19/bindings/cpp/AUTHORS b/portaudio-v19/bindings/cpp/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/portaudio-v19/bindings/cpp/COPYING b/portaudio-v19/bindings/cpp/COPYING new file mode 100644 index 000000000..623b6258a --- /dev/null +++ b/portaudio-v19/bindings/cpp/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, 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 software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, 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 redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +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 give any other recipients of the Program a copy of this License +along with the Program. + +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 Program or any portion +of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +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 Program, 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 Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) 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; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, 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 executable. 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. + +If distribution of executable or 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 counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program 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. + + 5. 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 Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program 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. + + 7. 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 Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program 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 Program. + +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. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program 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. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 Program +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 Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, 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 + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), 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 Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. 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. + + + Copyright (C) + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/portaudio-v19/bindings/cpp/ChangeLog b/portaudio-v19/bindings/cpp/ChangeLog new file mode 100644 index 000000000..0201a0f0f --- /dev/null +++ b/portaudio-v19/bindings/cpp/ChangeLog @@ -0,0 +1,178 @@ +Note: Because PortAudioCpp is now in the main PortAudio SVN repository, having these per-release changelogs probably doesn't make much sense anymore. Perhaps it's better to just note mayor changes by date from now on. + +PortAudioCpp v19 revision 16 06/05/22: + + mblaauw: + - Added up-to-date MSVC 6.0 projects created by David Moore. Besides MSVC 6.0 users, MSVC 7.0 users may use these projects and automatically convert them to MSVC 7.0 projects. + - Changed the code and projects (MSVC 7.1 only) to be up-to-date with PortAudio's new directory structure. + - Added equivalents of the PaAsio_GetInputChannelName() and PaAsio_GetOutputChannelName() functions to the AsioDeviceAdapter wrapper-class (missing functions pointed out by David Moore). + - Added code to PortAudio's main SVN repository. + +PortAudioCpp v19 revision 15 (unknown release date): + + mblaauw: + - Changed some exception handling code in HostApi's constructor. + - Added accessors to PortAudio PaStream from PortAudioCpp Stream (their absense being pointed out + by Tom Jordan). + - Fixed a bug/typo in MemFunToCallbackInterfaceAdapter::init() thanks to Fredrik Viklund. + - Fixed issue with concrete Stream classes possibly throwing an exception and fixed documentation w.r.t. this. + - Moved files to portaudio/binding/cpp/. Made new msvc 7.1 projects to reflect the change and removed msvc 6.0 + and 7.0 projects (because I can no longer maintain them myself). Gnu projects will probably need updating. + +PortAudioCpp v19 revision 14 03/10/24: + + mblaauw: + - Fixed some error handling bugs in Stream and System (pointed out by Tom Jordan). + - Updated documentation a little (main page). + - Fixed order of members so initializer list was in the right order in + StreamParameters (pointed out by Ludwig Schwardt). + - Added new lines at EOF's (as indicated by Ludwig Schwardt). + +PortAudioCpp v19 revision 13 03/10/19: + + lschwardt: + - Added build files for GNU/Linux. + - Fixed bug in Exception where the inherited what() member function (and destructor) had looser + exception specification (namely no exception specification, i.e. could throw anything) than + the std::exception base class's what() member function (which had throw(), i.e. no-throw guarantee). + - Changed the iterators so that they have a set of public typedefs instead of deriving the C++ standard + library std::iterator<> struct. G++ 2.95 doesn't support std::exception<> and composition-by-aggregation + is prefered over composition-by-inheritance in this case. + - Changed some minor things to avoid G++ warning messages. + + mblaauw: + - Renamed this file (/WHATSNEW.txt) to /CHANGELOG. + - Renamed /PA_ISSUES.txt to /PA_ISSUES. + - Added /INSTALL file with some build info for GNU/Linux and VC6. + - Added MSVC 6.0 projects for building PortAudioCpp as a staticly or dynamically linkable library. + - Moved build files to /build/(gnu/ or vc6/). + - Moved Doxygen configuration files to /doc/ and output to /doc/api_reference/. + - Added a /doc/README with some info how to generate Doxygen documentation. + +PortAudioCpp v19 revision 12 03/09/02: + + mblaauw: + - Updated code to reflect changes on V19-devel CVS branch. + - Fixed some typos in the documentation. + +PortAudioCpp v19 revision 11 03/07/31: + + mblaauw: + - Renamed SingleDirecionStreamParameters to DirectionSpecificStreamParameters. + - Implemented BlockingStream. + - Updated code to reflect recent changes to PortAudio V19-devel. + - Fixed a potential memory leak when an exception was thrown in the HostApi + constructor. + - Renamed ``Latency'' to ``BufferSize'' in AsioDeviceAdapter. + - Updated class documentation. + +PortAudioCpp v19 revision 10 03/07/18: + + mblaauw: + - SingleDirectionStreamParameters now has a (static) null() method. + - StreamParameters uses references for the direction-specific stream parameters + instead of pointers (use null() method (above) instead of NULL). + - StreamParameters and SingleDirectionStreamParameters must now be fully specified + and now default values are used (because this was not very useful in general and + only made things more complex). + - Updated documentation. + +PortAudioCpp v19 revision 09 03/06/25: + + mblaauw: + - Changed some things in SingleDirectionStreamParameters to ease it's usage. + - Placed all SingleDirectionStreamParameters stuff into a separate file. + + Totally redid the callback stuff, now it's less ackward and supports C++ functions. + +PortAudioCpp v19 revision 08 03/06/20: + + mblaauw: + - Made deconstructors for Device and HostApi private. + + Added a AsioDeviceWrapper host api specific device extension class. + - Refactored Exception into a Exception base class and PaException and PaCppException + derived classes. + - Added ASIO specific device info to the devs.cxx example. + - Fixed a bug in System::hostApiCount() and System::defaultHostApi(). + + Moved Device::null to System::nullDevice. + - Fixed some bugs in Device and System. + +PortAudioCpp v19 revision 07 03/06/08: + + mblaauw: + - Updated some doxy comments. + + Renamed CbXyz to CallbackXyz. + + Renamed all ``configurations'' to ``parameters''. + + Renamed HalfDuplexStreamConfiguration to SingleDirectionStreamConfiguration. + - Renamed SingleDirectionStreamParameters::streamParameters() to + SingleDirectionStreamParameters::paSteamParameters. + - Added a non-constant version of SingleDirectionStreamParameters::paStreamParameters(). + - A few improvements to SingleDirectionStreamParameters. + - Allowed AutoSystem to be created without initializing the System singleton + (using a ctor flag). + - Added a BlockingStream class (not implemented for now). + - Fixed many bugs in the implementation of the iterators. + - Fixed a bug in Device::operator==(). + + Added a C++ version of the patest_sine.c test/example. + - Added a ctor for StreamParameters for a default half-duplex stream. + - Added SingleDirectionStreamParameters::setDevice() and setNumChannels(). + - Renamed System::numHostApis() to System::hostApiCount(). + + Rewrote the iterators and related classes. They are now fully STL compliant. The System now + has a static array of all HostApis and all Devices. Only the System can create HostApis and + Devices and they are non-copyable now. All HostApis and Devices are now passed by-reference. + - Renamed (System::) getVersion() to version() and getVersionText() to versionText(). + - Renamed (Device::) numXyzChannels() to maxXyzChannels(). + - Changed some stuff in StreamParameters. + + Added a C++ version of the patest_devs.c test/example. + +PortAudioCpp v19 revision 06 03/06/04: + + mblaauw: + + Added this file to the project (roughly, a `+' denotes a major change, a `-' a minor change). + - Added System::deviceByIndex(), useful when a Device's index is stored for instance. + - Renamed System::hostApiFromTypeId() to System::hostApiByTypeId(). + - Updated and added some Doxygen documentation. + - Made Stream::usedIntputLatency(), Stream::usedOutputLatency() and + Stream::usedSampleRate() throw an paInternalError equivalent exception instead of paBadStreamPtr. + - Changed exception handling in Stream::open() functions. They now follow the PA error handling + mechanism better and a couple of bugs regarding ownership of objects were fixed. + - Renamed Device::isDefaultXyzDevice() to Device::isSystemDefaultXyzDevice(). + - Added Device::isHostApiDefaultXyzDevice(). + - Added StreamConfiguration::unsetFlag(). + - Removed CUSTOM from SampleDataFormat. + - System::hostApiByTypeId() now throws an paInternalError if the type id was out-of-range; this + is a temporary work-around (see comments). + - Changed CbInterface to use paCallbackFun() instead of operator()(). + - Renamed ``object'' to ``instance'' in CbMemFunAdapter.hxx. + - Added StreamConfiguration::setXyzHostApiSpecificSampleFormat(). + - Added StreamConfiguration::isXyzSampleFormatHostApiSpecific(). + - Changed error handling in System::terminate(), it can now throw an Exception. + - Added error handling in System::defaultHostApi(). + - Added error handling in System::hostApisEnd(). + - Changed some (but probably not all) C casts to C++ casts to avoid confusion with a + certain Python person. + - Renamed RaiiSystem to AutoSystem (class and file) as this is a come common convention. + - Renamed System::numDevices() to System::deviceCount() to be more compatible with PortAudio + (although PortAudio uses Pa_CountDevices() instead, see comment). + - Renamed HostApi::numDevices() to HostApi::deviceCount(). + - Changed INC_ to INCLUDED_ in the header multiple include guards. + - Changed the order of functions in the StreamConfiguration class' header. + - Written some more info in PortAudioCpp.hxx (Doxygen). + - Added CallbackStream.hxx and CallbackStream.cxx files. + + Refactored StreamConfiguration to remove the duplication which was there. There is now a + HalfDuplexStreamConfiguration class. Also made some improvements to these classes while + doing the refactoring. + + Moved all code files to source/portaudiocpp/ and changed includes. + + Moved all header files to include/portaudiocpp/ to easy a binary build if needed. The project + must be set to have .../include/ as a path to look for includes. + + Refactored the Stream class into a Stream base class and a CallbackStream derived class. + - Renamed Stream::usingXyz() to Stream::xyz(). + - Updated some doxy comments. + - Changed ``using namespace portaudio'' in .cxx files to ``namespace portaudio { ... }''. + +PortAudioCpp v19 revision 05 03/04/09: + + mblaauw: + - Initial release on the PortAudio mailinglist. + + + diff --git a/portaudio-v19/bindings/cpp/INSTALL b/portaudio-v19/bindings/cpp/INSTALL new file mode 100644 index 000000000..23e5f25d0 --- /dev/null +++ b/portaudio-v19/bindings/cpp/INSTALL @@ -0,0 +1,236 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/portaudio-v19/bindings/cpp/Makefile.am b/portaudio-v19/bindings/cpp/Makefile.am new file mode 100644 index 000000000..b10449cef --- /dev/null +++ b/portaudio-v19/bindings/cpp/Makefile.am @@ -0,0 +1,7 @@ +SUBDIRS = lib include bin +#doc + +EXTRA_DIST = portaudiocpp.pc + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = portaudiocpp.pc diff --git a/portaudio-v19/bindings/cpp/Makefile.in b/portaudio-v19/bindings/cpp/Makefile.in new file mode 100644 index 000000000..7e0129cfe --- /dev/null +++ b/portaudio-v19/bindings/cpp/Makefile.in @@ -0,0 +1,640 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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@ +DIST_COMMON = README $(am__configure_deps) \ + $(srcdir)/../../config.guess $(srcdir)/../../config.sub \ + $(srcdir)/../../install-sh $(srcdir)/../../ltmain.sh \ + $(srcdir)/../../missing $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/portaudiocpp.pc.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = portaudiocpp.pc +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-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)$(pkgconfigdir)" +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgconfig_DATA) +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_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@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_INCLUDES = @DEFAULT_INCLUDES@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +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@ +PORTAUDIO_ROOT = @PORTAUDIO_ROOT@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +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@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = lib include bin +#doc +EXTRA_DIST = portaudiocpp.pc +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = portaudiocpp.pc +all: all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +portaudiocpp.pc: $(top_builddir)/config.status $(srcdir)/portaudiocpp.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +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" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @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; } \ + END { 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; } \ + END { 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=; \ + 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; } \ + END { 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) + mkdir $(distdir) + $(mkdir_p) $(distdir)/. $(distdir)/../.. + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + 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" \ + distdir) \ + || exit 1; \ + fi; \ + done + -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 $(SHELL) $(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-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.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 '1{h;s/./=/g;p;x;}' -e '$${p;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 $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(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." +clean: clean-recursive + +clean-am: 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-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +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-info-am uninstall-pkgconfigDATA + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-libtool clean-recursive \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-libtool distclean-recursive \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-pkgconfigDATA \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am \ + uninstall-pkgconfigDATA + +# 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: diff --git a/portaudio-v19/bindings/cpp/NEWS b/portaudio-v19/bindings/cpp/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/portaudio-v19/bindings/cpp/README b/portaudio-v19/bindings/cpp/README new file mode 100644 index 000000000..e69de29bb diff --git a/portaudio-v19/bindings/cpp/SConscript b/portaudio-v19/bindings/cpp/SConscript new file mode 100644 index 000000000..2bad5ee68 --- /dev/null +++ b/portaudio-v19/bindings/cpp/SConscript @@ -0,0 +1,64 @@ +import os.path + +Import("env", "buildDir") +env.Append(CPPPATH="include") + +ApiVer = "0.0.12" +Major, Minor, Micro = [int(c) for c in ApiVer.split(".")] + +sharedLibs = [] +staticLibs = [] +Import("Platform", "Posix") +if Platform in Posix: + env["SHLIBSUFFIX"] = ".so.%d.%d.%d" % (Major, Minor, Micro) + soFile = "libportaudiocpp.so" + env.AppendUnique(SHLINKFLAGS="-Wl,-soname=%s.%d" % (soFile, Major)) + + # Create symlinks + def symlink(env, target, source): + trgt = str(target[0]) + src = str(source[0]) + if os.path.islink(trgt) or os.path.exists(trgt): + os.remove(trgt) + os.symlink(os.path.basename(src), trgt) + lnk0 = env.Command(soFile + ".%d" % (Major), soFile + ".%d.%d.%d" % (Major, Minor, Micro), symlink) + lnk1 = env.Command(soFile, soFile + ".%d" % (Major), symlink) + sharedLibs.append(lnk0) + sharedLibs.append(lnk1) + +src = [os.path.join("source", "portaudiocpp", "%s.cxx" % f) for f in ("BlockingStream", "CallbackInterface", \ + "CallbackStream", "CFunCallbackStream","CppFunCallbackStream", "Device", + "DirectionSpecificStreamParameters", "Exception", "HostApi", "InterfaceCallbackStream", + "MemFunCallbackStream", "Stream", "StreamParameters", "System", "SystemDeviceIterator", + "SystemHostApiIterator")] +env.Append(LIBS="portaudio", LIBPATH=buildDir) +sharedLib = env.SharedLibrary("portaudiocpp", src, LIBS=["portaudio"]) +staticLib = env.Library("portaudiocpp", src, LIBS=["portaudio"]) +sharedLibs.append(sharedLib) +staticLibs.append(staticLib) + +headers = Split("""AutoSystem.hxx + BlockingStream.hxx + CallbackInterface.hxx + CallbackStream.hxx + CFunCallbackStream.hxx + CppFunCallbackStream.hxx + Device.hxx + DirectionSpecificStreamParameters.hxx + Exception.hxx + HostApi.hxx + InterfaceCallbackStream.hxx + MemFunCallbackStream.hxx + PortAudioCpp.hxx + SampleDataFormat.hxx + Stream.hxx + StreamParameters.hxx + SystemDeviceIterator.hxx + SystemHostApiIterator.hxx + System.hxx + """) +if env["PLATFORM"] == "win32": + headers.append("AsioDeviceAdapter.hxx") +headers = [File(os.path.join("include", "portaudiocpp", h)) for h in headers] + +Return("sharedLibs", "staticLibs", "headers") diff --git a/portaudio-v19/bindings/cpp/aclocal.m4 b/portaudio-v19/bindings/cpp/aclocal.m4 new file mode 100644 index 000000000..38a7545a7 --- /dev/null +++ b/portaudio-v19/bindings/cpp/aclocal.m4 @@ -0,0 +1,7336 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# 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. + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 48 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' +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 1s/^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 MSVC, +# 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 "$LTCFLAGS" && LTCFLAGS=$CFLAGS +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="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# 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 + +# Check if we have a version mismatch between libtool.m4 and ltmain.sh. +# +# Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined. +# We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually +# calls AC_LIBTOOL_CONFIG and creates libtool. +# +_LT_VERSION_CHECK + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_VERSION_CHECK +# ----------------- +AC_DEFUN([_LT_VERSION_CHECK], +[AC_MSG_CHECKING([for correct ltmain.sh version]) +if test "x$ltmain" = "x" ; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ + +*** @<:@Gentoo@:>@ sanity check failed! *** +*** \$ltmain is not defined, please check the patch for consistency! *** +]) +fi +gentoo_lt_version="1.5.22" +gentoo_ltmain_version=`sed -n '/^[[ ]]*VERSION=/{s/^[[ ]]*VERSION=//;p;q;}' "$ltmain"` +if test "x$gentoo_lt_version" != "x$gentoo_ltmain_version" ; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ + +*** @<:@Gentoo@:>@ sanity check failed! *** +*** libtool.m4 and ltmain.sh have a version mismatch! *** +*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) *** + +Please run: + + libtoolize --copy --force + +if appropriate, please contact the maintainer of this +package (or your distribution) for help. +]) +else + AC_MSG_RESULT(yes) +fi +])# _LT_VERSION_CHECK + + +# _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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _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 </dev/null 2>&1 && unset CDPATH + +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*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + 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 linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm 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 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # 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. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + 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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + 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_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# 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 + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + 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" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; 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 DLLs +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 <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +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 variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +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*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | 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_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + 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 +# AC_CONFIG_SUBDIRS is not called here. 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 +# AC_CONFIG_SUBDIRS is not called here. 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 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([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# 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 + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +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 + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +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([_LT_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_shlibpath_var, $1)=unsupported +_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=cpp + +# 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 + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_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_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_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' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + 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)=unsupported + _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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + 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_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _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)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP '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 $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + 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 $libobjs $deplibs $compiler_flags -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 -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + 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 | dragonfly*) + # 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | 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 + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _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*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $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 + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _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' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_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::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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' + _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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_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~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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' + _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 + ;; + 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(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_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~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_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. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_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" + +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_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 < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$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 , 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 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +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 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'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + 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'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# 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='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + 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 < $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 < 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 <> 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)= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + 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 | dragonfly*) + # 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)='${wl}-a ${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)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_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* | ecpc*) + # 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' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_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*) + ;; + 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 + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _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' + ;; + esac + ;; + 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' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + 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_basename 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' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + 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' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + 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*) + _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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _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' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + 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 + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# 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 '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[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= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + 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}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_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 + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + 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 <&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 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 says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${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)=unsupported + _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 '\''/^[[BCDGRS]] /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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_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 "$lt_prog_compiler_static"; 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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_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_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_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' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _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 + ;; + + bsdi[[45]]*) + _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)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `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' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + 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_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _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)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _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 $libobjs $deplibs $compiler_flags -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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + 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 | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _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 $libobjs $deplibs $compiler_flags~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*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_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 + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _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 $libobjs $deplibs $compiler_flags ${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 $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _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 $libobjs $deplibs $compiler_flags' + _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 $libobjs $deplibs $compiler_flags $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} $libobjs $deplibs $compiler_flags ${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} $libobjs $deplibs $compiler_flags ${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 ${output_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)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_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~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _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]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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 $libobjs $deplibs $compiler_flags' + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + +# +# 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) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $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 +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #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 +# 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 && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + 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/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_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; 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. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# 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 +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +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= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='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. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# 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". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/portaudio-v19/bindings/cpp/bin/Makefile.am b/portaudio-v19/bindings/cpp/bin/Makefile.am new file mode 100644 index 000000000..5f97f9445 --- /dev/null +++ b/portaudio-v19/bindings/cpp/bin/Makefile.am @@ -0,0 +1,9 @@ +BINDIR = $(top_srcdir)/example +LIBDIR = $(top_builddir)/lib + +noinst_PROGRAMS = devs sine + +LDADD = $(LIBDIR)/libportaudiocpp.la + +devs_SOURCES = $(BINDIR)/devs.cxx +sine_SOURCES = $(BINDIR)/sine.cxx diff --git a/portaudio-v19/bindings/cpp/bin/Makefile.in b/portaudio-v19/bindings/cpp/bin/Makefile.in new file mode 100644 index 000000000..820fb4146 --- /dev/null +++ b/portaudio-v19/bindings/cpp/bin/Makefile.in @@ -0,0 +1,468 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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@ +noinst_PROGRAMS = devs$(EXEEXT) sine$(EXEEXT) +subdir = bin +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_devs_OBJECTS = devs.$(OBJEXT) +devs_OBJECTS = $(am_devs_OBJECTS) +devs_LDADD = $(LDADD) +devs_DEPENDENCIES = $(LIBDIR)/libportaudiocpp.la +am_sine_OBJECTS = sine.$(OBJEXT) +sine_OBJECTS = $(am_sine_OBJECTS) +sine_LDADD = $(LDADD) +sine_DEPENDENCIES = $(LIBDIR)/libportaudiocpp.la +depcomp = $(SHELL) $(top_srcdir)/../../depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(devs_SOURCES) $(sine_SOURCES) +DIST_SOURCES = $(devs_SOURCES) $(sine_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_INCLUDES = @DEFAULT_INCLUDES@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +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@ +PORTAUDIO_ROOT = @PORTAUDIO_ROOT@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +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@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +BINDIR = $(top_srcdir)/example +LIBDIR = $(top_builddir)/lib +LDADD = $(LIBDIR)/libportaudiocpp.la +devs_SOURCES = $(BINDIR)/devs.cxx +sine_SOURCES = $(BINDIR)/sine.cxx +all: all-am + +.SUFFIXES: +.SUFFIXES: .cxx .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bin/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu bin/Makefile +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +devs$(EXEEXT): $(devs_OBJECTS) $(devs_DEPENDENCIES) + @rm -f devs$(EXEEXT) + $(CXXLINK) $(devs_LDFLAGS) $(devs_OBJECTS) $(devs_LDADD) $(LIBS) +sine$(EXEEXT): $(sine_OBJECTS) $(sine_DEPENDENCIES) + @rm -f sine$(EXEEXT) + $(CXXLINK) $(sine_LDFLAGS) $(sine_OBJECTS) $(sine_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sine.Po@am__quote@ + +.cxx.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cxx.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cxx.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +devs.o: $(BINDIR)/devs.cxx +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT devs.o -MD -MP -MF "$(DEPDIR)/devs.Tpo" -c -o devs.o `test -f '$(BINDIR)/devs.cxx' || echo '$(srcdir)/'`$(BINDIR)/devs.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/devs.Tpo" "$(DEPDIR)/devs.Po"; else rm -f "$(DEPDIR)/devs.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(BINDIR)/devs.cxx' object='devs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o devs.o `test -f '$(BINDIR)/devs.cxx' || echo '$(srcdir)/'`$(BINDIR)/devs.cxx + +devs.obj: $(BINDIR)/devs.cxx +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT devs.obj -MD -MP -MF "$(DEPDIR)/devs.Tpo" -c -o devs.obj `if test -f '$(BINDIR)/devs.cxx'; then $(CYGPATH_W) '$(BINDIR)/devs.cxx'; else $(CYGPATH_W) '$(srcdir)/$(BINDIR)/devs.cxx'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/devs.Tpo" "$(DEPDIR)/devs.Po"; else rm -f "$(DEPDIR)/devs.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(BINDIR)/devs.cxx' object='devs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o devs.obj `if test -f '$(BINDIR)/devs.cxx'; then $(CYGPATH_W) '$(BINDIR)/devs.cxx'; else $(CYGPATH_W) '$(srcdir)/$(BINDIR)/devs.cxx'; fi` + +sine.o: $(BINDIR)/sine.cxx +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sine.o -MD -MP -MF "$(DEPDIR)/sine.Tpo" -c -o sine.o `test -f '$(BINDIR)/sine.cxx' || echo '$(srcdir)/'`$(BINDIR)/sine.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/sine.Tpo" "$(DEPDIR)/sine.Po"; else rm -f "$(DEPDIR)/sine.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(BINDIR)/sine.cxx' object='sine.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sine.o `test -f '$(BINDIR)/sine.cxx' || echo '$(srcdir)/'`$(BINDIR)/sine.cxx + +sine.obj: $(BINDIR)/sine.cxx +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sine.obj -MD -MP -MF "$(DEPDIR)/sine.Tpo" -c -o sine.obj `if test -f '$(BINDIR)/sine.cxx'; then $(CYGPATH_W) '$(BINDIR)/sine.cxx'; else $(CYGPATH_W) '$(srcdir)/$(BINDIR)/sine.cxx'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/sine.Tpo" "$(DEPDIR)/sine.Po"; else rm -f "$(DEPDIR)/sine.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(BINDIR)/sine.cxx' object='sine.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sine.obj `if test -f '$(BINDIR)/sine.cxx'; then $(CYGPATH_W) '$(BINDIR)/sine.cxx'; else $(CYGPATH_W) '$(srcdir)/$(BINDIR)/sine.cxx'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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; } \ + END { 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; } \ + END { 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=; \ + 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; } \ + END { 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)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + 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: +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 + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +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-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS 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-exec \ + install-exec-am install-info install-info-am install-man \ + 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-info-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: diff --git a/portaudio-v19/bindings/cpp/build/gnu/Makefile.in b/portaudio-v19/bindings/cpp/build/gnu/Makefile.in new file mode 100644 index 000000000..0bc6f28e7 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/gnu/Makefile.in @@ -0,0 +1,106 @@ +# +# Makefile template for PortAudioCpp +# Ludwig Schwardt +# 01/10/2003 +# +# Not much to edit here - rather check configure.ac +# + +PREFIX = @prefix@ +CC = @CC@ +CXX = @CXX@ +CFLAGS = @CFLAGS@ @DEFS@ +CXXFLAGS = @CXXFLAGS@ +SHARED_FLAGS = @SHARED_FLAGS@ +LIBS = @LIBS@ +DLL_LIBS = @DLL_LIBS@ +AR = @AR@ +RANLIB = @RANLIB@ +INSTALL = @INSTALL@ + +PACPP_ROOT = @PACPP_ROOT@ +PORTAUDIO = @PORTAUDIO@ +PADLL = @PADLL@ +PACPP_DLL = @PACPP_DLL@ +PALIB = libportaudio.a +PACPP_LIB = libportaudiocpp.a +PACPP_DLLV = $(PACPP_DLL).0.0.12 + +SRCDIR = $(PACPP_ROOT)/source/portaudiocpp +BINDIR = $(PACPP_ROOT)/example +LIBDIR = $(PACPP_ROOT)/lib +DOCDIR = $(PACPP_ROOT)/doc + +OBJS = \ + $(SRCDIR)/BlockingStream.o \ + $(SRCDIR)/CallbackInterface.o \ + $(SRCDIR)/CallbackStream.o \ + $(SRCDIR)/CFunCallbackStream.o \ + $(SRCDIR)/CppFunCallbackStream.o \ + $(SRCDIR)/Device.o \ + $(SRCDIR)/DirectionSpecificStreamParameters.o \ + $(SRCDIR)/Exception.o \ + $(SRCDIR)/HostApi.o \ + $(SRCDIR)/InterfaceCallbackStream.o \ + $(SRCDIR)/MemFunCallbackStream.o \ + $(SRCDIR)/Stream.o \ + $(SRCDIR)/StreamParameters.o \ + $(SRCDIR)/System.o \ + $(SRCDIR)/SystemDeviceIterator.o \ + $(SRCDIR)/SystemHostApiIterator.o + +# Not supported yet +# $(SRCDIR)/AsioDeviceAdapter.o + +EXAMPLES = \ + $(BINDIR)/devs \ + $(BINDIR)/sine + +.PHONY: all clean docs + +all: $(EXAMPLES) $(LIBDIR)/$(PACPP_LIB) $(LIBDIR)/$(PACPP_DLL) + +clean: + rm -rf $(SRCDIR)/*.o $(BINDIR)/*.o $(EXAMPLES) $(LIBDIR) $(DOCDIR)/api_reference + rm -rf autom4te.cache config.status config.log + +docs: + cd $(DOCDIR); doxygen config.doxy.linux + +%.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ + +%.o: %.cxx + $(CXX) -c $(CXXFLAGS) $< -o $@ + + +$(EXAMPLES): $(BINDIR)/%: $(BINDIR)/%.o $(OBJS) + $(CXX) $^ -o $@ $(LIBS) + +$(LIBDIR)/$(PACPP_LIB): $(LIBDIR) $(OBJS) + $(AR) ruv $(LIBDIR)/$(PACPP_LIB) $(OBJS) + $(RANLIB) $(LIBDIR)/$(PACPP_LIB) + +$(LIBDIR)/$(PACPP_DLLV): $(LIBDIR) $(OBJS) + $(CXX) $(SHARED_FLAGS) -o $(LIBDIR)/$(PACPP_DLLV) $(OBJS) $(DLL_LIBS) + +$(LIBDIR)/$(PACPP_DLL): $(LIBDIR) $(OBJS) + $(CXX) $(SHARED_FLAGS) -o $(LIBDIR)/$(PACPP_DLL) $(OBJS) $(DLL_LIBS) + +#install: $(LIBDIR)/$(PACPP_LIB) $(LIBDIR)/$(PACPP_DLLV) +# $(INSTALL) -m 644 $(LIBDIR)/$(PACPP_DLLV) $(PREFIX)/lib/$(PACPP_DLLV) +# $(INSTALL) -m 644 $(LIBDIR)/$(PACPP_LIB) $(PREFIX)/lib/$(PACPP_LIB) +# cd $(PREFIX)/lib && rm -f $(PACPP_DLL) && ln -s $(PACPP_DLLV) $(PACPP_DLL) +# @echo "" +# @echo "------------------------------------------------------------" +# @echo "PortAudioCpp was successfully installed." +# @echo "" +# @echo "On some systems (e.g. Linux) you should run 'ldconfig' now" +# @echo "to make the shared object available. You may also need to" +# @echo "modify your LD_LIBRARY_PATH environment variable to include" +# @echo "the directory $(PREFIX)/lib" +# @echo "------------------------------------------------------------" +# @echo "" + +$(LIBDIR): + mkdir $(LIBDIR) diff --git a/portaudio-v19/bindings/cpp/build/gnu/OUT_OF_DATE b/portaudio-v19/bindings/cpp/build/gnu/OUT_OF_DATE new file mode 100644 index 000000000..e69de29bb diff --git a/portaudio-v19/bindings/cpp/build/gnu/aclocal.m4 b/portaudio-v19/bindings/cpp/build/gnu/aclocal.m4 new file mode 100644 index 000000000..c80e0acfc --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/gnu/aclocal.m4 @@ -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/portaudio-v19/bindings/cpp/build/gnu/config.guess b/portaudio-v19/bindings/cpp/build/gnu/config.guess new file mode 100644 index 000000000..297e5c30f --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/gnu/config.guess @@ -0,0 +1,1308 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-10-05' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-unknown ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + sparc*) machine=`uname -p`-unknown ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE}" in + i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + 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 + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # 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. + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + 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 i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in + big) echo mips-unknown-linux-gnu && exit 0 ;; + little) echo mipsel-unknown-linux-gnu && exit 0 ;; + esac + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + cat >$dummy.c < +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-pc-linux-gnu\n", argv[1]); +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-pc-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/portaudio-v19/bindings/cpp/build/gnu/config.sub b/portaudio-v19/bindings/cpp/build/gnu/config.sub new file mode 100644 index 000000000..6eea72728 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/gnu/config.sub @@ -0,0 +1,1505 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-07-17' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/portaudio-v19/bindings/cpp/build/gnu/configure b/portaudio-v19/bindings/cpp/build/gnu/configure new file mode 100644 index 000000000..69070c66d --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/gnu/configure @@ -0,0 +1,4297 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.57 for PortAudioCpp 12. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# 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 Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + 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=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # 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 before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, 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 + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='PortAudioCpp' +PACKAGE_TARNAME='portaudiocpp' +PACKAGE_VERSION='12' +PACKAGE_STRING='PortAudioCpp 12' +PACKAGE_BUGREPORT='' + +ac_unique_file="../../include/portaudiocpp/PortAudioCpp.hxx" +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX LN_S RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AR PACPP_ROOT PORTAUDIO PADLL PACPP_DLL PACPP_INC SHARED_FLAGS DLL_LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os PKG_CONFIG JACK_CFLAGS JACK_LIBS LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -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 ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# 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 + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + 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 + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS + +# +# 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 PortAudioCpp 12 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 \`..'] + +_ACEOF + + cat <<_ACEOF +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] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --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] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of PortAudioCpp 12:";; + esac + cat <<\_ACEOF + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-alsa (default=auto) + --with-jack (default=auto) + --with-oss (default=yes) + --with-host_os (no default) + --with-winapi ((wmme/directx/asio) default=wmme) + --with-macapi (asio) default=asio) + --with-asiodir (default=/usr/local/asiosdk2) + --with-dxdir (default=/usr/local/dx7sdk) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ 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 +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style 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 + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd "$ac_popdir" + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +PortAudioCpp configure 12 +generated by GNU Autoconf 2.57 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +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 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by PortAudioCpp $as_me 12, which was +generated by GNU Autoconf 2.57. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +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` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&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_sep= +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=`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_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + 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: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +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, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf 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 -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >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 explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +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 + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +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 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`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 + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +###### Top-level directory of pacpp +###### This makes it easy to shuffle the build directories +###### Also edit AC_CONFIG_SRCDIR above (wouldn't accept this variable)! +PACPP_ROOT="../.." + +###### +###### SET THIS TO PORTAUDIO DIRECTORY +###### +PORTAUDIO="$PACPP_ROOT/../portaudio" + +# Various other variables and flags + +PACPP_INC="$PACPP_ROOT/include" +INCLUDES="-I$PACPP_INC -I$PORTAUDIO -I$PORTAUDIO/pa_common" +CFLAGS="-g -O2 -Wall -ansi -pedantic $INCLUDES" +CXXFLAGS="$CFLAGS" +PALIBDIR="$PORTAUDIO/lib" + +# Checks for programs + +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +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 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +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. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* 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.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. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +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 +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&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' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + 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 + { { 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 +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 +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + 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 | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +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 +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +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 +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$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 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* 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; +} +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 +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext 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 + +ac_ext=cc +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 -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$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 +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +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 + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# 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" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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/* | \ + /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 $as_executable_p "$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 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$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' + +# Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $AR in + [\\/]* | ?:[\\/]*) + ac_cv_path_AR="$AR" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_AR" && ac_cv_path_AR="no" + ;; +esac +fi +AR=$ac_cv_path_AR + +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if [ $AR = "no" ] ; then + { { echo "$as_me:$LINENO: error: \"Could not find ar - needed to create a library\"" >&5 +echo "$as_me: error: \"Could not find ar - needed to create a library\"" >&2;} + { (exit 1); exit 1; }; }; +fi + +# This must be one of the first tests we do or it will fail... + +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + + +# Transfer these variables to the Makefile + + + + + + + + + +##################### CHECK FOR INSTALLED PACKAGES ############################ + +# checks for various host APIs and arguments to configure that +# turn them on or off + +echo "$as_me:$LINENO: checking for snd_pcm_open in -lasound" >&5 +echo $ECHO_N "checking for snd_pcm_open in -lasound... $ECHO_C" >&6 +if test "${ac_cv_lib_asound_snd_pcm_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char snd_pcm_open (); +int +main () +{ +snd_pcm_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_asound_snd_pcm_open=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_asound_snd_pcm_open=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_pcm_open" >&5 +echo "${ECHO_T}$ac_cv_lib_asound_snd_pcm_open" >&6 +if test $ac_cv_lib_asound_snd_pcm_open = yes; then + have_alsa=yes +else + have_alsa=no +fi + + +# Determine the host description for the subsequent test. +# PKG_CHECK_MODULES seems to check and set the host variable also, but +# that then requires pkg-config availability which is not standard on +# MinGW systems and can be a pain to install. +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + + + + succeeded=no + + if test -z "$PKG_CONFIG"; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + 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 + echo "$as_me:$LINENO: checking for jack" >&5 +echo $ECHO_N "checking for jack... $ECHO_C" >&6 + + if $PKG_CONFIG --exists "jack" ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + succeeded=yes + + echo "$as_me:$LINENO: checking JACK_CFLAGS" >&5 +echo $ECHO_N "checking JACK_CFLAGS... $ECHO_C" >&6 + JACK_CFLAGS=`$PKG_CONFIG --cflags "jack"` + echo "$as_me:$LINENO: result: $JACK_CFLAGS" >&5 +echo "${ECHO_T}$JACK_CFLAGS" >&6 + + echo "$as_me:$LINENO: checking JACK_LIBS" >&5 +echo $ECHO_N "checking JACK_LIBS... $ECHO_C" >&6 + JACK_LIBS=`$PKG_CONFIG --libs "jack"` + echo "$as_me:$LINENO: result: $JACK_LIBS" >&5 +echo "${ECHO_T}$JACK_LIBS" >&6 + else + JACK_CFLAGS="" + JACK_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + JACK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "jack"` + + fi + + + + 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 + have_jack=yes + else + have_jack=no + fi + + + +# Check whether --with-alsa or --without-alsa was given. +if test "${with_alsa+set}" = set; then + withval="$with_alsa" + with_alsa=$withval +else + with_alsa="yes" +fi; + + +# Check whether --with-jack or --without-jack was given. +if test "${with_jack+set}" = set; then + withval="$with_jack" + with_jack=$withval +else + with_jack="yes" +fi; + + +# Check whether --with-oss or --without-oss was given. +if test "${with_oss+set}" = set; then + withval="$with_oss" + with_oss=$withval +else + with_oss="yes" +fi; + + +# Check whether --with-host_os or --without-host_os was given. +if test "${with_host_os+set}" = set; then + withval="$with_host_os" + host_os=$withval +fi; + + +# Check whether --with-winapi or --without-winapi was given. +if test "${with_winapi+set}" = set; then + withval="$with_winapi" + with_winapi=$withval +else + with_winapi="wmme" +fi; + +# Mac API added for ASIO, can have other api's listed + +# Check whether --with-macapi or --without-macapi was given. +if test "${with_macapi+set}" = set; then + withval="$with_macapi" + with_macapi=$withval +else + with_macapi="asio" +fi; + + +# Check whether --with-asiodir or --without-asiodir was given. +if test "${with_asiodir+set}" = set; then + withval="$with_asiodir" + with_asiodir=$withval +else + with_asiodir="/usr/local/asiosdk2" +fi; + + +# Check whether --with-dxdir or --without-dxdir was given. +if test "${with_dxdir+set}" = set; then + withval="$with_dxdir" + with_dxdir=$withval +else + with_dxdir="/usr/local/dx7sdk" +fi; + + +##################### HOST-SPECIFIC LIBRARY SETTINGS ########################## + +case "${host_os}" in + darwin* ) + # Mac OS X configuration + + LIBS="-framework AudioUnit -framework AudioToolbox -framework CoreAudio"; + PADLL="libportaudio.dylib"; + PACPP_DLL="libportaudiocpp.dylib"; + SHARED_FLAGS="-framework AudioUnit -framework AudioToolbox"; + SHARED_FLAGS="$SHARED_FLAGS -framework CoreAudio -dynamiclib"; + if [ $with_macapi = "asio" ] ; then + if [ $with_asiodir ] ; then + ASIODIR="$with_asiodir"; + else + ASIODIR="/usr/local/asiosdk2"; + fi + echo "ASIODIR: $ASIODIR"; + fi + ;; + + mingw* ) + # MingW configuration + + echo "WINAPI: $with_winapi" + if [ $with_winapi = "directx" ] ; then + if [ $with_dxdir ] ; then + DXDIR="$with_dxdir"; + else + DXDIR="/usr/local/dx7sdk"; + fi + echo "DXDIR: $DXDIR" + LIBS="-L$PALIBDIR -lportaudio" + LIBS="$LIBS -lwinmm -lm -ldsound -lole32"; + PADLL="portaudio.dll"; + PACPP_DLL="portaudiocpp.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -ldsound -lole32"; + CFLAGS="$CFLAGS -DPA_NO_WMME -DPA_NO_ASIO"; + CXXFLAGS="$CFLAGS" + elif [ $with_winapi = "asio" ] ; then + if [ $with_asiodir ] ; then + ASIODIR="$with_asiodir"; + else + ASIODIR="/usr/local/asiosdk2"; + fi + echo "ASIODIR: $ASIODIR" + + LIBS="-L$PALIBDIR -lportaudio" + LIBS="$LIBS -lwinmm -lm -lstdc++ -lole32 -luuid"; + PADLL="portaudio.dll"; + PACPP_DLL="portaudiocpp.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -DPA_NO_WMME -DPA_NO_DS -DWINDOWS"; + CXXFLAGS="$CFLAGS"; + else # WMME default + LIBS="-L$PALIBDIR -lportaudio" + LIBS="$LIBS -lwinmm -lm -lstdc++ -lole32 -luuid"; + PADLL="portaudio.dll"; + PACPP_DLL="portaudiocpp.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm"; + CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_ASIO"; + CXXFLAGS="$CFLAGS"; + fi + ;; + + cygwin* ) + # Cygwin configuration + + LIBS="-L$PALIBDIR -lportaudio" + LIBS="$LIBS -lwinmm -lm"; + PADLL="portaudio.dll"; + PACPP_DLL="portaudiocpp.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm"; + ;; + + *) + # Unix OSS configuration + + +echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_create (); +int +main () +{ +pthread_create (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_pthread_create=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread_pthread_create=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6 +if test $ac_cv_lib_pthread_pthread_create = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +else + { { echo "$as_me:$LINENO: error: libpthread not found!" >&5 +echo "$as_me: error: libpthread not found!" >&2;} + { (exit 1); exit 1; }; } +fi + + + LIBS="$LIBS -L$PALIBDIR -lportaudio" + + if [ $have_jack = "yes" ] && [ $with_jack != "no" ] ; then + LIBS="$LIBS $JACK_LIBS" + CFLAGS="$CFLAGS $JACK_CFLAGS" + cat >>confdefs.h <<\_ACEOF +#define PA_USE_JACK 1 +_ACEOF + + fi + + if [ $have_alsa = "yes" ] && [ $with_alsa != "no" ] ; then + LIBS="$LIBS -lasound" + cat >>confdefs.h <<\_ACEOF +#define PA_USE_ALSA 1 +_ACEOF + + fi + + if [ $with_oss != "no" ] ; then + cat >>confdefs.h <<\_ACEOF +#define PA_USE_OSS 1 +_ACEOF + + fi + LIBS="$LIBS -lm -lpthread"; + PADLL="libportaudio.so"; + PACPP_DLL="libportaudiocpp.so"; + SHARED_FLAGS="-shared"; +esac + + 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, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +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_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $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 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + 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=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # 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 before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, 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 + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by PortAudioCpp $as_me 12, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet 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 + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +PortAudioCpp config.status 12 +configured by $0, generated by GNU Autoconf 2.57, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + 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 +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +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 +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $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 -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@LN_S@,$LN_S,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@AR@,$AR,;t t +s,@PACPP_ROOT@,$PACPP_ROOT,;t t +s,@PORTAUDIO@,$PORTAUDIO,;t t +s,@PADLL@,$PADLL,;t t +s,@PACPP_DLL@,$PACPP_DLL,;t t +s,@PACPP_INC@,$PACPP_INC,;t t +s,@SHARED_FLAGS@,$SHARED_FLAGS,;t t +s,@DLL_LIBS@,$DLL_LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@JACK_CFLAGS@,$JACK_CFLAGS,;t t +s,@JACK_LIBS@,$JACK_LIBS,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# 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 + diff --git a/portaudio-v19/bindings/cpp/build/gnu/configure.ac b/portaudio-v19/bindings/cpp/build/gnu/configure.ac new file mode 100644 index 000000000..5457c5342 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/gnu/configure.ac @@ -0,0 +1,214 @@ +# +# PortAudioCpp V19 autoconf input file +# Shamelessly ripped from the PortAudio one by Dominic Mazzoni +# Ludwig Schwardt +# + +# Require autoconf >= 2.13 +AC_PREREQ(2.13) + +AC_INIT([PortAudioCpp], [12]) +AC_CONFIG_SRCDIR([../../include/portaudiocpp/PortAudioCpp.hxx]) + +###### Top-level directory of pacpp +###### This makes it easy to shuffle the build directories +###### Also edit AC_CONFIG_SRCDIR above (wouldn't accept this variable)! +PACPP_ROOT="../.." + +###### +###### SET THIS TO PORTAUDIO DIRECTORY +###### +PORTAUDIO="$PACPP_ROOT/../portaudio" + +# Various other variables and flags + +PACPP_INC="$PACPP_ROOT/include" +INCLUDES="-I$PACPP_INC -I$PORTAUDIO -I$PORTAUDIO/pa_common" +CFLAGS="-g -O2 -Wall -ansi -pedantic $INCLUDES" +CXXFLAGS="$CFLAGS" +PALIBDIR="$PORTAUDIO/lib" + +# Checks for programs + +AC_PROG_CC +AC_PROG_CXX +AC_PROG_LN_S +AC_PROG_RANLIB +AC_PROG_INSTALL +AC_PATH_PROG(AR, ar, no) +if [[ $AR = "no" ]] ; then + AC_MSG_ERROR("Could not find ar - needed to create a library"); +fi + +# This must be one of the first tests we do or it will fail... +AC_C_BIGENDIAN + +# Transfer these variables to the Makefile +AC_SUBST(PACPP_ROOT) +AC_SUBST(PORTAUDIO) +AC_SUBST(PADLL) +AC_SUBST(PACPP_DLL) +AC_SUBST(PACPP_INC) +AC_SUBST(SHARED_FLAGS) +AC_SUBST(DLL_LIBS) +AC_SUBST(CXXFLAGS) + +##################### CHECK FOR INSTALLED PACKAGES ############################ + +# checks for various host APIs and arguments to configure that +# turn them on or off + +AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) + +# Determine the host description for the subsequent test. +# PKG_CHECK_MODULES seems to check and set the host variable also, but +# that then requires pkg-config availability which is not standard on +# MinGW systems and can be a pain to install. +AC_CANONICAL_HOST + +PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) + +AC_ARG_WITH(alsa, + [ --with-alsa (default=auto)], + with_alsa=$withval, with_alsa="yes") + +AC_ARG_WITH(jack, + [ --with-jack (default=auto)], + with_jack=$withval, with_jack="yes") + +AC_ARG_WITH(oss, + [ --with-oss (default=yes)], + with_oss=$withval, with_oss="yes") + +AC_ARG_WITH(host_os, + [ --with-host_os (no default)], + host_os=$withval) + +AC_ARG_WITH(winapi, + [ --with-winapi ((wmme/directx/asio) default=wmme)], + with_winapi=$withval, with_winapi="wmme") + +# Mac API added for ASIO, can have other api's listed +AC_ARG_WITH(macapi, + [ --with-macapi (asio) default=asio)], + with_macapi=$withval, with_macapi="asio") + +AC_ARG_WITH(asiodir, + [ --with-asiodir (default=/usr/local/asiosdk2)], + with_asiodir=$withval, with_asiodir="/usr/local/asiosdk2") + +AC_ARG_WITH(dxdir, + [ --with-dxdir (default=/usr/local/dx7sdk)], + with_dxdir=$withval, with_dxdir="/usr/local/dx7sdk") + + +##################### HOST-SPECIFIC LIBRARY SETTINGS ########################## + +case "${host_os}" in + darwin* ) + # Mac OS X configuration + + LIBS="-framework AudioUnit -framework AudioToolbox -framework CoreAudio"; + PADLL="libportaudio.dylib"; + PACPP_DLL="libportaudiocpp.dylib"; + SHARED_FLAGS="-framework AudioUnit -framework AudioToolbox"; + SHARED_FLAGS="$SHARED_FLAGS -framework CoreAudio -dynamiclib"; + if [[ $with_macapi = "asio" ]] ; then + if [[ $with_asiodir ]] ; then + ASIODIR="$with_asiodir"; + else + ASIODIR="/usr/local/asiosdk2"; + fi + echo "ASIODIR: $ASIODIR"; + fi + ;; + + mingw* ) + # MingW configuration + + echo "WINAPI: $with_winapi" + if [[ $with_winapi = "directx" ]] ; then + if [[ $with_dxdir ]] ; then + DXDIR="$with_dxdir"; + else + DXDIR="/usr/local/dx7sdk"; + fi + echo "DXDIR: $DXDIR" + LIBS="-L$PALIBDIR -lportaudio" + LIBS="$LIBS -lwinmm -lm -ldsound -lole32"; + PADLL="portaudio.dll"; + PACPP_DLL="portaudiocpp.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -ldsound -lole32"; + CFLAGS="$CFLAGS -DPA_NO_WMME -DPA_NO_ASIO"; + CXXFLAGS="$CFLAGS" + elif [[ $with_winapi = "asio" ]] ; then + if [[ $with_asiodir ]] ; then + ASIODIR="$with_asiodir"; + else + ASIODIR="/usr/local/asiosdk2"; + fi + echo "ASIODIR: $ASIODIR" + + LIBS="-L$PALIBDIR -lportaudio" + LIBS="$LIBS -lwinmm -lm -lstdc++ -lole32 -luuid"; + PADLL="portaudio.dll"; + PACPP_DLL="portaudiocpp.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid"; + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -DPA_NO_WMME -DPA_NO_DS -DWINDOWS"; + CXXFLAGS="$CFLAGS"; + else # WMME default + LIBS="-L$PALIBDIR -lportaudio" + LIBS="$LIBS -lwinmm -lm -lstdc++ -lole32 -luuid"; + PADLL="portaudio.dll"; + PACPP_DLL="portaudiocpp.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm"; + CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_ASIO"; + CXXFLAGS="$CFLAGS"; + fi + ;; + + cygwin* ) + # Cygwin configuration + + LIBS="-L$PALIBDIR -lportaudio" + LIBS="$LIBS -lwinmm -lm"; + PADLL="portaudio.dll"; + PACPP_DLL="portaudiocpp.dll"; + SHARED_FLAGS="-shared -mthreads"; + DLL_LIBS="-lwinmm"; + ;; + + *) + # Unix OSS configuration + + AC_CHECK_LIB(pthread, pthread_create, + , + AC_MSG_ERROR([libpthread not found!])) + + LIBS="$LIBS -L$PALIBDIR -lportaudio" + + if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then + LIBS="$LIBS $JACK_LIBS" + CFLAGS="$CFLAGS $JACK_CFLAGS" + AC_DEFINE(PA_USE_JACK) + fi + + if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then + LIBS="$LIBS -lasound" + AC_DEFINE(PA_USE_ALSA) + fi + + if [[ $with_oss != "no" ]] ; then + AC_DEFINE(PA_USE_OSS) + fi + LIBS="$LIBS -lm -lpthread"; + PADLL="libportaudio.so"; + PACPP_DLL="libportaudiocpp.so"; + SHARED_FLAGS="-shared"; +esac + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/portaudio-v19/bindings/cpp/build/gnu/install-sh b/portaudio-v19/bindings/cpp/build/gnu/install-sh new file mode 100644 index 000000000..e9de23842 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/gnu/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# 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}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# 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 $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/portaudio-v19/bindings/cpp/build/vc6/devs_example.dsp b/portaudio-v19/bindings/cpp/build/vc6/devs_example.dsp new file mode 100644 index 000000000..af2684777 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc6/devs_example.dsp @@ -0,0 +1,248 @@ +# Microsoft Developer Studio Project File - Name="devs_example" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=devs_example - 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 "devs_example.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 "devs_example.mak" CFG="devs_example - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "devs_example - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "devs_example - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "devs_example - 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 Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /GX /O2 /I "../../include/" /I "../../../../include/" /I "../../../../src/common/" /I "../../../../../asiosdk2/common/" /I "../../../../../asiosdk2/host/" /I "../../../../../asiosdk2/host/pc/" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 portaudiocpp-vc6-r.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../../bin/devs_example.exe" /libpath:"../../lib" + +!ELSEIF "$(CFG)" == "devs_example - 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 Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include/" /I "../../../../include/" /I "../../../../src/common/" /I "../../../../../asiosdk2/common/" /I "../../../../../asiosdk2/host/" /I "../../../../../asiosdk2/host/pc/" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 portaudiocpp-vc6-d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../bin/devs_example.exe" /pdbtype:sept /libpath:"../../lib" + +!ENDIF + +# Begin Target + +# Name "devs_example - Win32 Release" +# Name "devs_example - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\..\pa_asio\iasiothiscallresolver.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_allocation.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\pa_asio\pa_asio.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_converters.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_cpuload.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_dither.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_front.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_process.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_skeleton.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_stream.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_trace.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\hostapi\dsound\pa_win_ds.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\hostapi\dsound\pa_win_ds_dynlink.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\os\win\pa_win_hostapis.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\os\win\pa_win_util.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\hostapi\wmme\pa_win_wmme.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\os\win\pa_x86_plain_converters.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\..\pa_asio\iasiothiscallresolver.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_allocation.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_converters.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_cpuload.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_dither.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_endianness.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_hostapi.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_process.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_stream.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_trace.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_types.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_util.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\hostapi\dsound\pa_win_ds_dynlink.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\os\win\pa_x86_plain_converters.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "Example Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\example\devs.cxx +# End Source File +# End Group +# Begin Group "ASIO 2 SDK" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\..\..\asiosdk2\common\asio.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\..\asiosdk2\host\asiodrivers.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\..\asiosdk2\host\pc\asiolist.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/portaudio-v19/bindings/cpp/build/vc6/devs_example.dsw b/portaudio-v19/bindings/cpp/build/vc6/devs_example.dsw new file mode 100644 index 000000000..480c4d54e --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc6/devs_example.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "devs_example"=".\devs_example.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name static_library + End Project Dependency +}}} + +############################################################################### + +Project: "static_library"=".\static_library.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/portaudio-v19/bindings/cpp/build/vc6/sine_example.dsp b/portaudio-v19/bindings/cpp/build/vc6/sine_example.dsp new file mode 100644 index 000000000..2539cbd8d --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc6/sine_example.dsp @@ -0,0 +1,252 @@ +# Microsoft Developer Studio Project File - Name="sine_example" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=sine_example - 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 "sine_example.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 "sine_example.mak" CFG="sine_example - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "sine_example - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "sine_example - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "sine_example - 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 Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /GX /O2 /I "../../include/" /I "../../../../include/" /I "../../../../src/common/" /I "../../../../../asiosdk2/common/" /I "../../../../../asiosdk2/host/" /I "../../../../../asiosdk2/host/pc/" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 portaudiocpp-vc6-r.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../../bin/sine_example.exe" /libpath:"../../lib" + +!ELSEIF "$(CFG)" == "sine_example - 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 Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include/" /I "../../../../include/" /I "../../../../src/common/" /I "../../../../../asiosdk2/common/" /I "../../../../../asiosdk2/host/" /I "../../../../../asiosdk2/host/pc/" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 portaudiocpp-vc6-d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../bin/sine_example.exe" /pdbtype:sept /libpath:"../../lib" + +!ENDIF + +# Begin Target + +# Name "sine_example - Win32 Release" +# Name "sine_example - Win32 Debug" +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\..\pa_asio\iasiothiscallresolver.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_allocation.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_converters.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_cpuload.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_dither.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_endianness.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_hostapi.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_process.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_stream.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_trace.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_types.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_util.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\hostapi\dsound\pa_win_ds_dynlink.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\os\win\pa_x86_plain_converters.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "Example Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\example\sine.cxx +# End Source File +# End Group +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\..\pa_asio\iasiothiscallresolver.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_allocation.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\pa_asio\pa_asio.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_converters.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_cpuload.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_dither.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_front.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_process.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_skeleton.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_stream.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\common\pa_trace.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\hostapi\dsound\pa_win_ds.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\hostapi\dsound\pa_win_ds_dynlink.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\os\win\pa_win_hostapis.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\os\win\pa_win_util.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\hostapi\wasapi\pa_win_wasapi.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\hostapi\wmme\pa_win_wmme.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\src\os\win\pa_x86_plain_converters.c +# End Source File +# End Group +# Begin Group "ASIO 2 SDK" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\..\..\asiosdk2\common\asio.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\..\asiosdk2\host\asiodrivers.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\..\asiosdk2\host\pc\asiolist.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/portaudio-v19/bindings/cpp/build/vc6/sine_example.dsw b/portaudio-v19/bindings/cpp/build/vc6/sine_example.dsw new file mode 100644 index 000000000..04c4714c8 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc6/sine_example.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "sine_example"=".\sine_example.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name static_library + End Project Dependency +}}} + +############################################################################### + +Project: "static_library"=".\static_library.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/portaudio-v19/bindings/cpp/build/vc6/static_library.dsp b/portaudio-v19/bindings/cpp/build/vc6/static_library.dsp new file mode 100644 index 000000000..d33ba9fe9 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc6/static_library.dsp @@ -0,0 +1,395 @@ +# Microsoft Developer Studio Project File - Name="static_library" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=static_library - 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 "static_library.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 "static_library.mak" CFG="static_library - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "static_library - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "static_library - 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)" == "static_library - 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 /MTd /W3 /GX /O2 /I "../../include/" /I "../../../../include/" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"../../lib/portaudiocpp-vc6-r.lib" + +!ELSEIF "$(CFG)" == "static_library - 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 /MDd /W3 /Gm /GX /ZI /Od /I "../../include/" /I "../../../../include/" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"../../lib/portaudiocpp-vc6-d.lib" + +!ENDIF + +# Begin Target + +# Name "static_library - Win32 Release" +# Name "static_library - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\AsioDeviceAdapter.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\BlockingStream.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\CallbackInterface.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\CallbackStream.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\CFunCallbackStream.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\CppFunCallbackStream.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\Device.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\DirectionSpecificStreamParameters.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\Exception.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\HostApi.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\InterfaceCallbackStream.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\MemFunCallbackStream.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\Stream.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\StreamParameters.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\System.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\SystemDeviceIterator.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\source\portaudiocpp\SystemHostApiIterator.cxx + +!IF "$(CFG)" == "static_library - Win32 Release" + +!ELSEIF "$(CFG)" == "static_library - Win32 Debug" + +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\AsioDeviceAdapter.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\AutoSystem.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\BlockingStream.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\CallbackInterface.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\CallbackStream.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\CFunCallbackStream.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\CppFunCallbackStream.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\Device.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\DirectionSpecificStreamParameters.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\Exception.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\HostApi.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\InterfaceCallbackStream.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\MemFunCallbackStream.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\PortAudioCpp.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\SampleDataFormat.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\Stream.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\StreamParameters.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\System.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\SystemDeviceIterator.hxx +# End Source File +# Begin Source File + +SOURCE=..\..\include\portaudiocpp\SystemHostApiIterator.hxx +# End Source File +# End Group +# End Target +# End Project diff --git a/portaudio-v19/bindings/cpp/build/vc6/static_library.dsw b/portaudio-v19/bindings/cpp/build/vc6/static_library.dsw new file mode 100644 index 000000000..cb9d09054 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc6/static_library.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "static_library"=".\static_library.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/portaudio-v19/bindings/cpp/build/vc7/OUT_OF_DATE b/portaudio-v19/bindings/cpp/build/vc7/OUT_OF_DATE new file mode 100644 index 000000000..e69de29bb diff --git a/portaudio-v19/bindings/cpp/build/vc7_1/devs_example.sln b/portaudio-v19/bindings/cpp/build/vc7_1/devs_example.sln new file mode 100644 index 000000000..c443bce5b --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc7_1/devs_example.sln @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "devs_example", "devs_example.vcproj", "{1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}" + ProjectSection(ProjectDependencies) = postProject + {D18EA0C9-8C65-441D-884C-55EB43A84F2A} = {D18EA0C9-8C65-441D-884C-55EB43A84F2A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "static_library", "static_library.vcproj", "{D18EA0C9-8C65-441D-884C-55EB43A84F2A}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}.Debug.ActiveCfg = Debug|Win32 + {1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}.Debug.Build.0 = Debug|Win32 + {1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}.Release.ActiveCfg = Release|Win32 + {1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}.Release.Build.0 = Release|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Debug.ActiveCfg = Debug|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Debug.Build.0 = Debug|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Release.ActiveCfg = Release|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/portaudio-v19/bindings/cpp/build/vc7_1/devs_example.vcproj b/portaudio-v19/bindings/cpp/build/vc7_1/devs_example.vcproj new file mode 100644 index 000000000..fc065f8de --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc7_1/devs_example.vcproj @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/portaudio-v19/bindings/cpp/build/vc7_1/sine_example.sln b/portaudio-v19/bindings/cpp/build/vc7_1/sine_example.sln new file mode 100644 index 000000000..7be7c583c --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc7_1/sine_example.sln @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sine_example", "sine_example.vcproj", "{1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}" + ProjectSection(ProjectDependencies) = postProject + {D18EA0C9-8C65-441D-884C-55EB43A84F2A} = {D18EA0C9-8C65-441D-884C-55EB43A84F2A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "static_library", "static_library.vcproj", "{D18EA0C9-8C65-441D-884C-55EB43A84F2A}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}.Debug.ActiveCfg = Debug|Win32 + {1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}.Debug.Build.0 = Debug|Win32 + {1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}.Release.ActiveCfg = Release|Win32 + {1B9A038D-80A3-4DBD-9F0D-AF10B49B863A}.Release.Build.0 = Release|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Debug.ActiveCfg = Debug|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Debug.Build.0 = Debug|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Release.ActiveCfg = Release|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/portaudio-v19/bindings/cpp/build/vc7_1/sine_example.vcproj b/portaudio-v19/bindings/cpp/build/vc7_1/sine_example.vcproj new file mode 100644 index 000000000..b1c7b6209 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc7_1/sine_example.vcproj @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/portaudio-v19/bindings/cpp/build/vc7_1/static_library.sln b/portaudio-v19/bindings/cpp/build/vc7_1/static_library.sln new file mode 100644 index 000000000..36f2ac1a4 --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc7_1/static_library.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "static_library", "static_library.vcproj", "{D18EA0C9-8C65-441D-884C-55EB43A84F2A}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Debug.ActiveCfg = Debug|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Debug.Build.0 = Debug|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Release.ActiveCfg = Release|Win32 + {D18EA0C9-8C65-441D-884C-55EB43A84F2A}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/portaudio-v19/bindings/cpp/build/vc7_1/static_library.vcproj b/portaudio-v19/bindings/cpp/build/vc7_1/static_library.vcproj new file mode 100644 index 000000000..d67324ead --- /dev/null +++ b/portaudio-v19/bindings/cpp/build/vc7_1/static_library.vcproj @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/portaudio-v19/bindings/cpp/configure b/portaudio-v19/bindings/cpp/configure new file mode 100755 index 000000000..faca7c46e --- /dev/null +++ b/portaudio-v19/bindings/cpp/configure @@ -0,0 +1,20242 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for PortAudioCpp 12. +# +# Copyright (C) 2003 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 Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + 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=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # 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 before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, 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 + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# 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'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + + +# 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 </dev/null 2>&1 && unset CDPATH + +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 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='PortAudioCpp' +PACKAGE_TARNAME='portaudiocpp' +PACKAGE_VERSION='12' +PACKAGE_STRING='PortAudioCpp 12' +PACKAGE_BUGREPORT='' + +ac_unique_file="include/portaudiocpp/PortAudioCpp.hxx" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL DEFAULT_INCLUDES PORTAUDIO_ROOT LT_VERSION_INFO LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -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 ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# 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 + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + 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 + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS + +# +# 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 PortAudioCpp 12 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 \`..'] + +_ACEOF + + cat <<_ACEOF +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] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --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] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_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] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of PortAudioCpp 12:";; + esac + cat <<\_ACEOF + +Optional Features: + --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-shared[=PKGS] + build shared libraries [default=yes] + --enable-static[=PKGS] + build static libraries [default=yes] + --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 if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + 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 +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style 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 + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +PortAudioCpp configure 12 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 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 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by PortAudioCpp $as_me 12, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +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` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&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_sep= +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=`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_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + 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: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +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, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf 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 -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >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 explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +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 + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +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 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`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 + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +am__api_version="1.9" +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# 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. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$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' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&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". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +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 + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}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 $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# 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= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='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. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +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='portaudiocpp' + VERSION='12' + + +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-"$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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(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 -' + + + + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-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; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$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 + + + +###### Top-level directory of pacpp +###### This makes it easy to shuffle the build directories +###### Also edit AC_CONFIG_SRCDIR above (wouldn't accept this variable)! +PACPP_ROOT="\$(top_srcdir)" +PORTAUDIO_ROOT="../.." + +# Various other variables and flags +DEFAULT_INCLUDES="-I$PACPP_ROOT/include -I$PACPP_ROOT/$PORTAUDIO_ROOT/include" +CFLAGS=${CFLAGS-"-g -O2 -Wall -ansi -pedantic"} +CXXFLAGS=${CXXFLAGS-"${CFLAGS}"} + +LT_VERSION_INFO="0:12:0" + +# Checks for programs + +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +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 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +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. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + 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.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. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +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 +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&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' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + 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 + { { 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 +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 +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + 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 | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +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 +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +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 +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$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 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=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 +#include +#include +#include +/* 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 -std1 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 -std1. */ +int osf4_cc_array ['\x00' == 0 ? 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 +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext 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 +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. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&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 + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-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= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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/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 +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$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=cc +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 -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$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 +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +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= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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/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 +echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$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 + + + + +# Check whether --enable-shared or --disable-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=yes +fi; + +# Check whether --enable-static or --disable-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-fast-install or --disable-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; + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + + +# Check whether --with-gnu-ld or --without-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. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$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' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + ;; + +bsdi[45]*) + 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*) + # func_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='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +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*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check whether --enable-libtool-lock or --disable-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=$? + 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 4179 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + 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=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*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" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + 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 +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$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 + ;; +sparc*-*solaris*) + # 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=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-cygwin* | *-*-mingw* | *-*-pw32*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_DLLTOOL" && ac_cv_prog_ac_ct_DLLTOOL="false" +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +echo "${ECHO_T}$ac_ct_DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DLLTOOL=$ac_ct_DLLTOOL +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AS" && ac_cv_prog_ac_ct_AS="false" +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +echo "${ECHO_T}$ac_ct_AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AS=$ac_ct_AS +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_OBJDUMP" && ac_cv_prog_ac_ct_OBJDUMP="false" +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +echo "${ECHO_T}$ac_ct_OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + OBJDUMP=$ac_ct_OBJDUMP +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; + +esac + +need_locks="$enable_libtool_lock" + + +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 +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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 + echo $ECHO_N "(cached) $ECHO_C" >&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 to if __STDC__ is defined, since + # 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 +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + 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 non-existent 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 +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$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 to if __STDC__ is defined, since + # 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 +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + 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 non-existent 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 +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +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 + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f 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 + +_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 + +_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 +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------- ## +## Report this to the PortAudioCpp lists. ## +## --------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +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 +echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 to if __STDC__ is defined, since + # 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 +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + 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 non-existent 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 +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$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 to if __STDC__ is defined, since + # 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 +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + 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 non-existent 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 +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +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_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 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:5556:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + 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 +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$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 + +G77=`test $ac_compiler_gnu = yes && echo yes` +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 +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # 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. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 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'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + 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'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# 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='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + 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 <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + 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=$? + 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 < 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 <> 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=$? + 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 + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$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 1s/^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 MSVC, +# 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +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 "$LTCFLAGS" && LTCFLAGS=$CFLAGS +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="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# 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 + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +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 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +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 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=yes + +# Check whether --enable-libtool-lock or --disable-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 or --without-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 + +# Check if we have a version mismatch between libtool.m4 and ltmain.sh. +# +# Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined. +# We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually +# calls AC_LIBTOOL_CONFIG and creates libtool. +# +echo "$as_me:$LINENO: checking for correct ltmain.sh version" >&5 +echo $ECHO_N "checking for correct ltmain.sh version... $ECHO_C" >&6 +if test "x$ltmain" = "x" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: + +*** [Gentoo] sanity check failed! *** +*** \$ltmain is not defined, please check the patch for consistency! *** +" >&5 +echo "$as_me: error: + +*** [Gentoo] sanity check failed! *** +*** \$ltmain is not defined, please check the patch for consistency! *** +" >&2;} + { (exit 1); exit 1; }; } +fi +gentoo_lt_version="1.5.22" +gentoo_ltmain_version=`sed -n '/^[ ]*VERSION=/{s/^[ ]*VERSION=//;p;q;}' "$ltmain"` +if test "x$gentoo_lt_version" != "x$gentoo_ltmain_version" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: + +*** [Gentoo] sanity check failed! *** +*** libtool.m4 and ltmain.sh have a version mismatch! *** +*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) *** + +Please run: + + libtoolize --copy --force + +if appropriate, please contact the maintainer of this +package (or your distribution) for help. +" >&5 +echo "$as_me: error: + +*** [Gentoo] sanity check failed! *** +*** libtool.m4 and ltmain.sh have a version mismatch! *** +*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) *** + +Please run: + + libtoolize --copy --force + +if appropriate, please contact the maintainer of this +package (or your distribution) for help. +" >&2;} + { (exit 1); exit 1; }; } +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +fi + + +# 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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6680: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6684: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$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= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&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' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + 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_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + 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' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6948: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6952: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$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 + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7052: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7056: \$? = $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 + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$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 + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + 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}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + 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 + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&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 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 says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${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=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + 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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + 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 "$lt_prog_compiler_static"; 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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + ;; + + bsdi[45]*) + 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=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `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*) + 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 + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + 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 | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~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*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + 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 + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + 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 $libobjs $deplibs $compiler_flags ${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 $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + 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 $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags $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} $libobjs $deplibs $compiler_flags ${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} $libobjs $deplibs $compiler_flags ${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 ${output_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=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + 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].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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 $libobjs $deplibs $compiler_flags' + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +# +# 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$? + 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 + pic_flag=$lt_prog_compiler_pic + 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=$? + 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* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$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= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}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" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = 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 + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 declares shl_load. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +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 +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +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 +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = 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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$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 library types will actually be built +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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" + { echo "$as_me:$LINENO: creating $ofile" >&5 +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 , 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 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +CC="$lt_save_CC" + + +# Check whether --with-tags or --without-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 + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +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 + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + 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 + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +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 + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +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" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +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_shlibpath_var_CXX=unsupported +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=cpp + +# 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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# 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 or --without-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. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + 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=unsupported + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + 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 + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP '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 $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + 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 $libobjs $deplibs $compiler_flags -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 -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + 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 + ;; + freebsd[12]*) + # 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 | dragonfly*) + # 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | 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 + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + 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*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $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 + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + 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' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + 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::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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_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 + ;; + 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++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + 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} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$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. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + 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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${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 $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + 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 +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + 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) + # 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 + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +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= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&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= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + 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 | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${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='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_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* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_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*) + ;; + 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 + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:11874: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:11878: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$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 + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:11978: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:11982: \$? = $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 + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$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 + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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 '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$? + 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 + pic_flag=$lt_prog_compiler_pic_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=$? + 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* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$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 + + +# 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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&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' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + 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_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + 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' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13585: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:13589: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$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 + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13689: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:13693: \$? = $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 + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$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 + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + 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}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + 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 + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&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 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 says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${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=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + 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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${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" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + 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 "$lt_prog_compiler_static"; 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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + ;; + + bsdi[45]*) + 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=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `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_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + 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 + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + 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 | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~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*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + 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 + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + 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 $libobjs $deplibs $compiler_flags ${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 $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + 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 $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags $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} $libobjs $deplibs $compiler_flags ${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} $libobjs $deplibs $compiler_flags ${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 ${output_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=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + 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].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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 $libobjs $deplibs $compiler_flags' + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$? + 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 + pic_flag=$lt_prog_compiler_pic_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=$? + 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* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$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 + + +# 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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15929: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15933: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$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= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&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' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_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 + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + 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_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + 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' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16197: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16201: \$? = $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 other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$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 + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16301: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:16305: \$? = $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 + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$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 + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + 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}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + 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 + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&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 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 says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${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=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + 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 $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${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" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + 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 "$lt_prog_compiler_static"; 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 + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + ;; + + bsdi[45]*) + 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=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `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_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + 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 + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + 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 $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + 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 | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~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*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + 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 + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + 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 $libobjs $deplibs $compiler_flags ${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 $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + 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 $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags $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} $libobjs $deplibs $compiler_flags ${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} $libobjs $deplibs $compiler_flags ${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 ${output_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=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + 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 $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + 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].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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 $libobjs $deplibs $compiler_flags' + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&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=$? + 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 + pic_flag=$lt_prog_compiler_pic_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=$? + 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* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + 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 ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + 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 +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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 + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".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~ + chmod a+x \$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 + ;; + + linux*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + else + $archive_expsym_cmds="$archive_cmds" + fi + else + ld_shlibs=no + fi + ;; + + *) + 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_cmds='`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* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + 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 + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=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 + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +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 +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&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 +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$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 + + +# 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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +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"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_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 LTCFLAGS NM \ + SED SHELL STRIP \ + 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 +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# 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 + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# 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=$lt_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_cmds='$shrext_cmds' + +# 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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +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" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +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' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + + +# Transfer these variables to the Makefile + + + + + + ac_config_files="$ac_config_files Makefile lib/Makefile include/Makefile bin/Makefile doc/Makefile portaudiocpp.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, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +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_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +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 + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +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 + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +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 + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +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_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $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 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + 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=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # 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 before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, 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 + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# 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'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by PortAudioCpp $as_me 12, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet 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 ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +PortAudioCpp config.status 12 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + 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 +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "portaudiocpp.pc" ) CONFIG_FILES="$CONFIG_FILES portaudiocpp.pc" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +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 to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $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 -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@CXXDEPMODE@,$CXXDEPMODE,;t t +s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t +s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@EGREP@,$EGREP,;t t +s,@LN_S@,$LN_S,;t t +s,@ECHO@,$ECHO,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@DLLTOOL@,$DLLTOOL,;t t +s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t +s,@AS@,$AS,;t t +s,@ac_ct_AS@,$ac_ct_AS,;t t +s,@OBJDUMP@,$OBJDUMP,;t t +s,@ac_ct_OBJDUMP@,$ac_ct_OBJDUMP,;t t +s,@CPP@,$CPP,;t t +s,@CXXCPP@,$CXXCPP,;t t +s,@F77@,$F77,;t t +s,@FFLAGS@,$FFLAGS,;t t +s,@ac_ct_F77@,$ac_ct_F77,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@DEFAULT_INCLUDES@,$DEFAULT_INCLUDES,;t t +s,@PORTAUDIO_ROOT@,$PORTAUDIO_ROOT,;t t +s,@LT_VERSION_INFO@,$LT_VERSION_INFO,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +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=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# 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 + diff --git a/portaudio-v19/bindings/cpp/configure.ac b/portaudio-v19/bindings/cpp/configure.ac new file mode 100644 index 000000000..100656ac4 --- /dev/null +++ b/portaudio-v19/bindings/cpp/configure.ac @@ -0,0 +1,54 @@ +# +# PortAudioCpp V19 autoconf input file +# Shamelessly ripped from the PortAudio one by Dominic Mazzoni +# Ludwig Schwardt +# Customized for automake by Mikael Magnusson +# + +# Require autoconf >= 2.13 +AC_PREREQ(2.13) + +m4_define([lt_current], [0]) +m4_define([lt_revision], [12]) +m4_define([lt_age], [0]) + +AC_INIT([PortAudioCpp], [12]) +AC_CONFIG_SRCDIR([include/portaudiocpp/PortAudioCpp.hxx]) +AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE + +###### Top-level directory of pacpp +###### This makes it easy to shuffle the build directories +###### Also edit AC_CONFIG_SRCDIR above (wouldn't accept this variable)! +PACPP_ROOT="\$(top_srcdir)" +PORTAUDIO_ROOT="../.." + +# Various other variables and flags +DEFAULT_INCLUDES="-I$PACPP_ROOT/include -I$PACPP_ROOT/$PORTAUDIO_ROOT/include" +CFLAGS=${CFLAGS-"-g -O2 -Wall -ansi -pedantic"} +CXXFLAGS=${CXXFLAGS-"${CFLAGS}"} + +LT_VERSION_INFO="lt_current:lt_revision:lt_age" + +# Checks for programs + +AC_PROG_CC +AC_PROG_CXX +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL + +# Transfer these variables to the Makefile +AC_SUBST(DEFAULT_INCLUDES) +AC_SUBST(PORTAUDIO_ROOT) +AC_SUBST(CXXFLAGS) +AC_SUBST(LT_VERSION_INFO) + +AC_CONFIG_FILES([ + Makefile + lib/Makefile + include/Makefile + bin/Makefile + doc/Makefile + portaudiocpp.pc + ]) +AC_OUTPUT diff --git a/portaudio-v19/bindings/cpp/doc/Makefile.am b/portaudio-v19/bindings/cpp/doc/Makefile.am new file mode 100644 index 000000000..7eb81ba30 --- /dev/null +++ b/portaudio-v19/bindings/cpp/doc/Makefile.am @@ -0,0 +1,5 @@ +PACPP_ROOT = . +#INCLUDES = -I$(srcdir)/$(PACPP_ROOT)/include -I$(top_srcdir)/include + +docs: + doxygen $(srcdir)/config.doxy.linux diff --git a/portaudio-v19/bindings/cpp/doc/Makefile.in b/portaudio-v19/bindings/cpp/doc/Makefile.in new file mode 100644 index 000000000..da3d71241 --- /dev/null +++ b/portaudio-v19/bindings/cpp/doc/Makefile.in @@ -0,0 +1,324 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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@ +subdir = doc +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_INCLUDES = @DEFAULT_INCLUDES@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +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@ +PORTAUDIO_ROOT = @PORTAUDIO_ROOT@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +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@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +PACPP_ROOT = . +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + 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 +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 + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +#INCLUDES = -I$(srcdir)/$(PACPP_ROOT)/include -I$(top_srcdir)/include + +docs: + doxygen $(srcdir)/config.doxy.linux +# 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: diff --git a/portaudio-v19/bindings/cpp/doc/README b/portaudio-v19/bindings/cpp/doc/README new file mode 100644 index 000000000..efeaa72b6 --- /dev/null +++ b/portaudio-v19/bindings/cpp/doc/README @@ -0,0 +1,34 @@ +GNU/Linux: +---------- + +1) Download and install a recent version of Doxygen (preferably version 1.3.3 or +later). See http://www.doxygen.org/. +2) Download and install a recent version of GraphViz. See +http://www.research.att.com/sw/tools/graphviz/. +3) Run ``doxygen config.doxy.linux'' in this directory or load and generate the file +config.doxy.linux from the Doxywizard application. Or alternatively ``make docs'' can +be run from the build/gnu folder. + +The generated html documentation will be placed in /doc/api_reference/. To open +the main page of the documentation, open the file /doc/api_reference/index.html in +an html browser. + + +Windows: +-------- + +1) Download and install a recent Doxygen (preferably version 1.3.4 or later). See +http://www.doxygen.org/. +2) Download and install a recent version of GraphViz. See +http://www.research.att.com/sw/tools/graphviz/. +3) If needed, edit the config.doxy file in an ascii text editor so that +``DOT_PATH'' variable points to the folder where GraphViz is installed. +4) Run ``doxygen config.doxy'' in this directory or load and generate the file +config.doxy from the Doxywizard application. + +The generated html documentation will be placed in /doc/api_reference/. To open +the main page of the documentation, open the file /doc/api_reference/index.html in +an html browser. + + + diff --git a/portaudio-v19/bindings/cpp/doc/config.doxy b/portaudio-v19/bindings/cpp/doc/config.doxy new file mode 100644 index 000000000..0bfe9d311 --- /dev/null +++ b/portaudio-v19/bindings/cpp/doc/config.doxy @@ -0,0 +1,211 @@ +# Doxyfile 1.3.6 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = PortAudioCpp +PROJECT_NUMBER = 2.0 +OUTPUT_DIRECTORY = ./ +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = YES +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +SHORT_NAMES = YES +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +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 = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +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_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +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 = YES +WARN_IF_DOC_ERROR = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../source \ + ../include +FILE_PATTERNS = *.hxx \ + *.cxx +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 = 2 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = api_reference +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +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 = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +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 = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# 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 = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions 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 = YES +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = "c:/Program Files/ATT/Graphviz/bin/" +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 0 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/portaudio-v19/bindings/cpp/doc/config.doxy.linux b/portaudio-v19/bindings/cpp/doc/config.doxy.linux new file mode 100644 index 000000000..38079f695 --- /dev/null +++ b/portaudio-v19/bindings/cpp/doc/config.doxy.linux @@ -0,0 +1,210 @@ +# Doxyfile 1.3.3 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = PortAudioCpp +PROJECT_NUMBER = 2.0 +OUTPUT_DIRECTORY = ./ +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = YES +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +SHORT_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 4 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SHOW_USED_FILES = YES +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../source \ + ../include +FILE_PATTERNS = *.hxx \ + *.cxx +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 = 2 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = api_reference +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +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 = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +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 = +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 = YES +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = "/usr/bin/dot" +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 +CGI_NAME = search.cgi +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = /usr/local/bin/ +EXT_DOC_PATHS = diff --git a/portaudio-v19/bindings/cpp/example/devs.cxx b/portaudio-v19/bindings/cpp/example/devs.cxx new file mode 100644 index 000000000..31a560f88 --- /dev/null +++ b/portaudio-v19/bindings/cpp/example/devs.cxx @@ -0,0 +1,177 @@ +#include +#include "portaudiocpp/PortAudioCpp.hxx" + +#ifdef WIN32 +#include "portaudiocpp/AsioDeviceAdapter.hxx" +#endif + +// --------------------------------------------------------------------------------------- + +void printSupportedStandardSampleRates( + const portaudio::DirectionSpecificStreamParameters &inputParameters, + const portaudio::DirectionSpecificStreamParameters &outputParameters) +{ + static double STANDARD_SAMPLE_RATES[] = { + 8000.0, 9600.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 32000.0, + 44100.0, 48000.0, 88200.0, 96000.0, -1 }; // negative terminated list + + int printCount = 0; + + for (int i = 0; STANDARD_SAMPLE_RATES[i] > 0; ++i) + { + portaudio::StreamParameters tmp = portaudio::StreamParameters(inputParameters, outputParameters, STANDARD_SAMPLE_RATES[i], 0, paNoFlag); + + if (tmp.isSupported()) + { + if (printCount == 0) + { + std::cout << " " << STANDARD_SAMPLE_RATES[i]; // 8.2 + printCount = 1; + } + else if (printCount == 4) + { + std::cout << "," << std::endl; + std::cout << " " << STANDARD_SAMPLE_RATES[i]; // 8.2 + printCount = 1; + } + else + { + std::cout << ", " << STANDARD_SAMPLE_RATES[i]; // 8.2 + ++printCount; + } + } + } + + if (printCount == 0) + std::cout << "None" << std::endl; + else + std::cout << std::endl; +} + +// --------------------------------------------------------------------------------------- + +int main(int, char*[]); +int main(int, char*[]) +{ + try + { + portaudio::AutoSystem autoSys; + + portaudio::System &sys = portaudio::System::instance(); + + std::cout << "PortAudio version number = " << sys.version() << std::endl; + std::cout << "PortAudio version text = '" << sys.versionText() << "'" << std::endl; + + int numDevices = sys.deviceCount(); + std::cout << "Number of devices = " << numDevices << std::endl; + + for (portaudio::System::DeviceIterator i = sys.devicesBegin(); i != sys.devicesEnd(); ++i) + { + std::cout << "--------------------------------------- device #" << (*i).index() << std::endl; + + // Mark global and API specific default devices: + bool defaultDisplayed = false; + + if ((*i).isSystemDefaultInputDevice()) + { + std::cout << "[ Default Input"; + defaultDisplayed = true; + } + else if ((*i).isHostApiDefaultInputDevice()) + { + std::cout << "[ Default " << (*i).hostApi().name() << " Input"; + defaultDisplayed = true; + } + + if ((*i).isSystemDefaultOutputDevice()) + { + std::cout << (defaultDisplayed ? "," : "["); + std::cout << " Default Output"; + defaultDisplayed = true; + } + else if ((*i).isHostApiDefaultOutputDevice()) + { + std::cout << (defaultDisplayed ? "," : "["); + std::cout << " Default " << (*i).hostApi().name() << " Output"; + defaultDisplayed = true; + } + + if (defaultDisplayed) + std::cout << " ]" << std::endl; + + // Print device info: + std::cout << "Name = " << (*i).name() << std::endl; + std::cout << "Host API = " << (*i).hostApi().name() << std::endl; + std::cout << "Max inputs = " << (*i).maxInputChannels() << ", Max outputs = " << (*i).maxOutputChannels() << std::endl; + + std::cout << "Default low input latency = " << (*i).defaultLowInputLatency() << std::endl; // 8.3 + std::cout << "Default low output latency = " << (*i).defaultLowOutputLatency() << std::endl; // 8.3 + std::cout << "Default high input latency = " << (*i).defaultHighInputLatency() << std::endl; // 8.3 + std::cout << "Default high output latency = " << (*i).defaultHighOutputLatency() << std::endl; // 8.3 + +#ifdef WIN32 + // ASIO specific latency information: + if ((*i).hostApi().typeId() == paASIO) + { + portaudio::AsioDeviceAdapter asioDevice((*i)); + + std::cout << "ASIO minimum buffer size = " << asioDevice.minBufferSize() << std::endl; + std::cout << "ASIO maximum buffer size = " << asioDevice.maxBufferSize() << std::endl; + std::cout << "ASIO preferred buffer size = " << asioDevice.preferredBufferSize() << std::endl; + + if (asioDevice.granularity() == -1) + std::cout << "ASIO buffer granularity = power of 2" << std::endl; + else + std::cout << "ASIO buffer granularity = " << asioDevice.granularity() << std::endl; + } +#endif // WIN32 + + std::cout << "Default sample rate = " << (*i).defaultSampleRate() << std::endl; // 8.2 + + // Poll for standard sample rates: + portaudio::DirectionSpecificStreamParameters inputParameters((*i), (*i).maxInputChannels(), portaudio::INT16, true, 0.0, NULL); + portaudio::DirectionSpecificStreamParameters outputParameters((*i), (*i).maxOutputChannels(), portaudio::INT16, true, 0.0, NULL); + + if (inputParameters.numChannels() > 0) + { + std::cout << "Supported standard sample rates" << std::endl; + std::cout << " for half-duplex 16 bit " << inputParameters.numChannels() << " channel input = " << std::endl; + printSupportedStandardSampleRates(inputParameters, portaudio::DirectionSpecificStreamParameters::null()); + } + + if (outputParameters.numChannels() > 0) + { + std::cout << "Supported standard sample rates" << std::endl; + std::cout << " for half-duplex 16 bit " << outputParameters.numChannels() << " channel output = " << std::endl; + printSupportedStandardSampleRates(portaudio::DirectionSpecificStreamParameters::null(), outputParameters); + } + + if (inputParameters.numChannels() > 0 && outputParameters.numChannels() > 0) + { + std::cout << "Supported standard sample rates" << std::endl; + std::cout << " for full-duplex 16 bit " << inputParameters.numChannels() << " channel input, " << outputParameters.numChannels() << " channel output = " << std::endl; + printSupportedStandardSampleRates(inputParameters, outputParameters); + } + } + + std::cout << "----------------------------------------------" << std::endl; + } + catch (const portaudio::PaException &e) + { + std::cout << "A PortAudio error occured: " << e.paErrorText() << std::endl; + } + catch (const portaudio::PaCppException &e) + { + std::cout << "A PortAudioCpp error occured: " << e.what() << std::endl; + } + catch (const std::exception &e) + { + std::cout << "A generic exception occured: " << e.what() << std::endl; + } + catch (...) + { + std::cout << "An unknown exception occured." << std::endl; + } + + return 0; +} diff --git a/portaudio-v19/bindings/cpp/example/sine.cxx b/portaudio-v19/bindings/cpp/example/sine.cxx new file mode 100644 index 000000000..577a24724 --- /dev/null +++ b/portaudio-v19/bindings/cpp/example/sine.cxx @@ -0,0 +1,137 @@ +// --------------------------------------------------------------------------------------- + +#include +#include +#include +#include +#include "portaudiocpp/PortAudioCpp.hxx" + +// --------------------------------------------------------------------------------------- + +// Some constants: +const int NUM_SECONDS = 5; +const double SAMPLE_RATE = 44100.0; +const int FRAMES_PER_BUFFER = 64; +const int TABLE_SIZE = 200; + +// --------------------------------------------------------------------------------------- + +// SineGenerator class: +class SineGenerator +{ +public: + SineGenerator(int tableSize) : tableSize_(tableSize), leftPhase_(0), rightPhase_(0) + { + const double PI = 3.14159265; + table_ = new float[tableSize]; + for (int i = 0; i < tableSize; ++i) + { + table_[i] = 0.125f * (float)sin(((double)i/(double)tableSize)*PI*2.); + } + } + + ~SineGenerator() + { + delete[] table_; + } + + int generate(const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags) + { + assert(outputBuffer != NULL); + + float **out = static_cast(outputBuffer); + + for (unsigned int i = 0; i < framesPerBuffer; ++i) + { + out[0][i] = table_[leftPhase_]; + out[1][i] = table_[rightPhase_]; + + leftPhase_ += 1; + if (leftPhase_ >= tableSize_) + leftPhase_ -= tableSize_; + + rightPhase_ += 3; + if (rightPhase_ >= tableSize_) + rightPhase_ -= tableSize_; + } + + return paContinue; + } + +private: + float *table_; + int tableSize_; + int leftPhase_; + int rightPhase_; +}; + +// --------------------------------------------------------------------------------------- + +// main: +int main(int, char *[]); +int main(int, char *[]) +{ + try + { + // Create a SineGenerator object: + SineGenerator sineGenerator(TABLE_SIZE); + + std::cout << "Setting up PortAudio..." << std::endl; + + // Set up the System: + portaudio::AutoSystem autoSys; + portaudio::System &sys = portaudio::System::instance(); + + // Set up the parameters required to open a (Callback)Stream: + portaudio::DirectionSpecificStreamParameters outParams(sys.defaultOutputDevice(), 2, portaudio::FLOAT32, false, sys.defaultOutputDevice().defaultLowOutputLatency(), NULL); + portaudio::StreamParameters params(portaudio::DirectionSpecificStreamParameters::null(), outParams, SAMPLE_RATE, FRAMES_PER_BUFFER, paClipOff); + + std::cout << "Opening stereo output stream..." << std::endl; + + // Create (and open) a new Stream, using the SineGenerator::generate function as a callback: + portaudio::MemFunCallbackStream stream(params, sineGenerator, &SineGenerator::generate); + + std::cout << "Starting playback for " << NUM_SECONDS << " seconds." << std::endl; + + // Start the Stream (audio playback starts): + stream.start(); + + // Wait for 5 seconds: + sys.sleep(NUM_SECONDS * 1000); + + std::cout << "Closing stream..." < + +#include "portaudio.h" + +#include "portaudiocpp/SampleDataFormat.hxx" + +// --------------------------------------------------------------------------------------- + +// Forward declaration(s): +namespace portaudio +{ + class System; + class HostApi; +} + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + ////// + /// @brief Class which represents a PortAudio device in the System. + /// + /// A single physical device in the system may have multiple PortAudio + /// Device representations using different HostApi 's though. A Device + /// can be half-duplex or full-duplex. A half-duplex Device can be used + /// to create a half-duplex Stream. A full-duplex Device can be used to + /// create a full-duplex Stream. If supported by the HostApi, two + /// half-duplex Devices can even be used to create a full-duplex Stream. + /// + /// Note that Device objects are very light-weight and can be passed around + /// by-value. + ////// + class Device + { + public: + // query info: name, max in channels, max out channels, + // default low/hight input/output latency, default sample rate + PaDeviceIndex index() const; + const char *name() const; + int maxInputChannels() const; + int maxOutputChannels() const; + PaTime defaultLowInputLatency() const; + PaTime defaultHighInputLatency() const; + PaTime defaultLowOutputLatency() const; + PaTime defaultHighOutputLatency() const; + double defaultSampleRate() const; + + bool isInputOnlyDevice() const; // extended + bool isOutputOnlyDevice() const; // extended + bool isFullDuplexDevice() const; // extended + bool isSystemDefaultInputDevice() const; // extended + bool isSystemDefaultOutputDevice() const; // extended + bool isHostApiDefaultInputDevice() const; // extended + bool isHostApiDefaultOutputDevice() const; // extended + + bool operator==(const Device &rhs); + bool operator!=(const Device &rhs); + + // host api reference + HostApi &hostApi(); + const HostApi &hostApi() const; + + private: + PaDeviceIndex index_; + const PaDeviceInfo *info_; + + private: + friend class System; + + explicit Device(PaDeviceIndex index); + ~Device(); + + Device(const Device &); // non-copyable + Device &operator=(const Device &); // non-copyable + }; + + // ----------------------------------------------------------------------------------- + +} // namespace portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_DEVICE_HXX + diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx new file mode 100644 index 000000000..dd5ae0b90 --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx @@ -0,0 +1,77 @@ +#ifndef INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX +#define INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX + +// --------------------------------------------------------------------------------------- + +#include + +#include "portaudio.h" + +#include "portaudiocpp/System.hxx" +#include "portaudiocpp/SampleDataFormat.hxx" + +// --------------------------------------------------------------------------------------- + +// Forward declaration(s): +namespace portaudio +{ + class Device; +} + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + ////// + /// @brief All parameters for one direction (either in or out) of a Stream. Together with + /// parameters common to both directions, two DirectionSpecificStreamParameters can make up + /// a StreamParameters object which contains all parameters for a Stream. + ////// + class DirectionSpecificStreamParameters + { + public: + static DirectionSpecificStreamParameters null(); + + DirectionSpecificStreamParameters(); + DirectionSpecificStreamParameters(const Device &device, int numChannels, SampleDataFormat format, + bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo); + + // Set up methods: + void setDevice(const Device &device); + void setNumChannels(int numChannels); + + void setSampleFormat(SampleDataFormat format, bool interleaved = true); + void setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved = true); + + void setSuggestedLatency(PaTime latency); + + void setHostApiSpecificStreamInfo(void *streamInfo); + + // Accessor methods: + PaStreamParameters *paStreamParameters(); + const PaStreamParameters *paStreamParameters() const; + + Device &device() const; + int numChannels() const; + + SampleDataFormat sampleFormat() const; + bool isSampleFormatInterleaved() const; + bool isSampleFormatHostApiSpecific() const; + PaSampleFormat hostApiSpecificSampleFormat() const; + + PaTime suggestedLatency() const; + + void *hostApiSpecificStreamInfo() const; + + private: + PaStreamParameters paStreamParameters_; + }; + + +} // namespace portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/Exception.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/Exception.hxx new file mode 100644 index 000000000..a70c2f1d6 --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/Exception.hxx @@ -0,0 +1,108 @@ +#ifndef INCLUDED_PORTAUDIO_EXCEPTION_HXX +#define INCLUDED_PORTAUDIO_EXCEPTION_HXX + +// --------------------------------------------------------------------------------------- + +#include + +#include "portaudio.h" + +// --------------------------------------------------------------------------------------- + +namespace portaudio +{ + + ////// + /// @brief Base class for all exceptions PortAudioCpp can throw. + /// + /// Class is derived from std::exception. + ////// + class Exception : public std::exception + { + public: + virtual ~Exception() throw() {} + + virtual const char *what() const throw() = 0; + }; + + // ----------------------------------------------------------------------------------- + + ////// + /// @brief Wrapper for PortAudio error codes to C++ exceptions. + /// + /// It wraps up PortAudio's error handling mechanism using + /// C++ exceptions and is derived from std::exception for + /// easy exception handling and to ease integration with + /// other code. + /// + /// To know what exceptions each function may throw, look up + /// the errors that can occure in the PortAudio documentation + /// for the equivalent functions. + /// + /// Some functions are likely to throw an exception (such as + /// Stream::open(), etc) and these should always be called in + /// try{} catch{} blocks and the thrown exceptions should be + /// handled properly (ie. the application shouldn't just abort, + /// but merely display a warning dialog to the user or something). + /// However nearly all functions in PortAudioCpp are capable + /// of throwing exceptions. When a function like Stream::isStopped() + /// throws an exception, it's such an exceptional state that it's + /// not likely that it can be recovered. PaExceptions such as these + /// can ``safely'' be left to be handled by some outer catch-all-like + /// mechanism for unrecoverable errors. + ////// + class PaException : public Exception + { + public: + explicit PaException(PaError error); + + const char *what() const throw(); + + PaError paError() const; + const char *paErrorText() const; + + bool isHostApiError() const; // extended + long lastHostApiError() const; + const char *lastHostApiErrorText() const; + + bool operator==(const PaException &rhs) const; + bool operator!=(const PaException &rhs) const; + + private: + PaError error_; + }; + + // ----------------------------------------------------------------------------------- + + ////// + /// @brief Exceptions specific to PortAudioCpp (ie. exceptions which do not have an + /// equivalent PortAudio error code). + ////// + class PaCppException : public Exception + { + public: + enum ExceptionSpecifier + { + UNABLE_TO_ADAPT_DEVICE + }; + + PaCppException(ExceptionSpecifier specifier); + + const char *what() const throw(); + + ExceptionSpecifier specifier() const; + + bool operator==(const PaCppException &rhs) const; + bool operator!=(const PaCppException &rhs) const; + + private: + ExceptionSpecifier specifier_; + }; + + +} // namespace portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_EXCEPTION_HXX + diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/HostApi.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/HostApi.hxx new file mode 100644 index 000000000..899fc42d7 --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/HostApi.hxx @@ -0,0 +1,76 @@ +#ifndef INCLUDED_PORTAUDIO_HOSTAPI_HXX +#define INCLUDED_PORTAUDIO_HOSTAPI_HXX + +// --------------------------------------------------------------------------------------- + +#include "portaudio.h" + +#include "portaudiocpp/System.hxx" + +// --------------------------------------------------------------------------------------- + +// Forward declaration(s): +namespace portaudio +{ + class Device; +} + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + + ////// + /// @brief HostApi represents a host API (usually type of driver) in the System. + /// + /// A single System can support multiple HostApi's each one typically having + /// a set of Devices using that HostApi (usually driver type). All Devices in + /// the HostApi can be enumerated and the default input/output Device for this + /// HostApi can be retreived. + ////// + class HostApi + { + public: + typedef System::DeviceIterator DeviceIterator; + + // query info: id, name, numDevices + PaHostApiTypeId typeId() const; + PaHostApiIndex index() const; + const char *name() const; + int deviceCount() const; + + // iterate devices + DeviceIterator devicesBegin(); + DeviceIterator devicesEnd(); + + // default devices + Device &defaultInputDevice() const; + Device &defaultOutputDevice() const; + + // comparison operators + bool operator==(const HostApi &rhs) const; + bool operator!=(const HostApi &rhs) const; + + private: + const PaHostApiInfo *info_; + Device **devices_; + + private: + friend class System; + + explicit HostApi(PaHostApiIndex index); + ~HostApi(); + + HostApi(const HostApi &); // non-copyable + HostApi &operator=(const HostApi &); // non-copyable + }; + + +} + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_HOSTAPI_HXX + diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/InterfaceCallbackStream.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/InterfaceCallbackStream.hxx new file mode 100644 index 000000000..e496dd272 --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/InterfaceCallbackStream.hxx @@ -0,0 +1,49 @@ +#ifndef INCLUDED_PORTAUDIO_INTERFACECALLBACKSTREAM_HXX +#define INCLUDED_PORTAUDIO_INTERFACECALLBACKSTREAM_HXX + +// --------------------------------------------------------------------------------------- + +#include "portaudio.h" + +#include "portaudiocpp/CallbackStream.hxx" + +// --------------------------------------------------------------------------------------- + +// Forward declaration(s) +namespace portaudio +{ + class StreamParameters; + class CallbackInterface; +} + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + + ////// + /// @brief Callback stream using an instance of an object that's derived from the CallbackInterface + /// interface. + ////// + class InterfaceCallbackStream : public CallbackStream + { + public: + InterfaceCallbackStream(); + InterfaceCallbackStream(const StreamParameters ¶meters, CallbackInterface &instance); + ~InterfaceCallbackStream(); + + void open(const StreamParameters ¶meters, CallbackInterface &instance); + + private: + InterfaceCallbackStream(const InterfaceCallbackStream &); // non-copyable + InterfaceCallbackStream &operator=(const InterfaceCallbackStream &); // non-copyable + }; + + +} // portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_INTERFACECALLBACKSTREAM_HXX diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/MemFunCallbackStream.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/MemFunCallbackStream.hxx new file mode 100644 index 000000000..a9e50ca63 --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/MemFunCallbackStream.hxx @@ -0,0 +1,107 @@ +#ifndef INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX +#define INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX + +// --------------------------------------------------------------------------------------- + +#include "portaudio.h" + +#include "portaudiocpp/CallbackStream.hxx" +#include "portaudiocpp/CallbackInterface.hxx" +#include "portaudiocpp/StreamParameters.hxx" +#include "portaudiocpp/Exception.hxx" +#include "portaudiocpp/InterfaceCallbackStream.hxx" + +// --------------------------------------------------------------------------------------- + +namespace portaudio +{ + + + ////// + /// @brief Callback stream using a class's member function as a callback. Template argument T is the type of the + /// class of which a member function is going to be used. + /// + /// Example usage: + /// @verbatim MemFunCallback stream = MemFunCallbackStream(parameters, *this, &MyClass::myCallbackFunction); @endverbatim + ////// + template + class MemFunCallbackStream : public CallbackStream + { + public: + typedef int (T::*CallbackFunPtr)(const void *, void *, unsigned long, const PaStreamCallbackTimeInfo *, + PaStreamCallbackFlags); + + // ------------------------------------------------------------------------------- + + MemFunCallbackStream() + { + } + + MemFunCallbackStream(const StreamParameters ¶meters, T &instance, CallbackFunPtr memFun) : adapter_(instance, memFun) + { + open(parameters); + } + + ~MemFunCallbackStream() + { + close(); + } + + void open(const StreamParameters ¶meters, T &instance, CallbackFunPtr memFun) + { + // XXX: need to check if already open? + + adapter_.init(instance, memFun); + open(parameters); + } + + private: + MemFunCallbackStream(const MemFunCallbackStream &); // non-copyable + MemFunCallbackStream &operator=(const MemFunCallbackStream &); // non-copyable + + ////// + /// @brief Inner class which adapts a member function callback to a CallbackInterface compliant + /// class (so it can be adapted using the paCallbackAdapter function). + ////// + class MemFunToCallbackInterfaceAdapter : public CallbackInterface + { + public: + MemFunToCallbackInterfaceAdapter() {} + MemFunToCallbackInterfaceAdapter(T &instance, CallbackFunPtr memFun) : instance_(&instance), memFun_(memFun) {} + + void init(T &instance, CallbackFunPtr memFun) + { + instance_ = &instance; + memFun_ = memFun; + } + + int paCallbackFun(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, + const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags) + { + return (instance_->*memFun_)(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags); + } + + private: + T *instance_; + CallbackFunPtr memFun_; + }; + + MemFunToCallbackInterfaceAdapter adapter_; + + void open(const StreamParameters ¶meters) + { + PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), + parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::callbackInterfaceToPaCallbackAdapter, + static_cast(&adapter_)); + + if (err != paNoError) + throw PaException(err); + } + }; + + +} // portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/PortAudioCpp.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/PortAudioCpp.hxx new file mode 100644 index 000000000..f11e7fb9f --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/PortAudioCpp.hxx @@ -0,0 +1,109 @@ +#ifndef INCLUDED_PORTAUDIO_PORTAUDIOCPP_HXX +#define INCLUDED_PORTAUDIO_PORTAUDIOCPP_HXX + +// --------------------------------------------------------------------------------------- + +////// +/// @mainpage PortAudioCpp +/// +///

    PortAudioCpp - A Native C++ Binding of PortAudio V19

    +///

    PortAudio

    +///

    +/// PortAudio is a portable and mature C API for accessing audio hardware. It offers both callback-based and blocking +/// style input and output, deals with sample data format conversions, dithering and much more. There are a large number +/// of implementations available for various platforms including Windows MME, Windows DirectX, Windows and MacOS (Classic) +/// ASIO, MacOS Classic SoundManager, MacOS X CoreAudio, OSS (Linux), Linux ALSA, JACK (MacOS X and Linux) and SGI Irix +/// AL. Note that, currently not all of these implementations are equally complete or up-to-date (as PortAudio V19 is +/// still in development). Because PortAudio has a C API, it can easily be called from a variety of other programming +/// languages. +///

    +///

    PortAudioCpp

    +///

    +/// Although, it is possible to use PortAudio's C API from within a C++ program, this is usually a little awkward +/// as procedural and object-oriented paradigms need to be mixed. PortAudioCpp aims to resolve this by encapsulating +/// PortAudio's C API to form an equivalent object-oriented C++ API. It provides a more natural integration of PortAudio +/// into C++ programs as well as a more structured interface. PortAudio's concepts were preserved as much as possible and +/// no additional features were added except for some `convenience methods'. +///

    +///

    +/// PortAudioCpp's main features are: +///

      +///
    • Structured object model.
    • +///
    • C++ exception handling instead of C-style error return codes.
    • +///
    • Handling of callbacks using free functions (C and C++), static functions, member functions or instances of classes +/// derived from a given interface.
    • +///
    • STL compliant iterators to host APIs and devices.
    • +///
    • Some additional convenience functions to more easily set up and use PortAudio.
    • +///
    +///

    +///

    +/// PortAudioCpp requires a recent version of the PortAudio V19 source code. This can be obtained from CVS or as a snapshot +/// from the website. The examples also require the ASIO 2 SDK which can be obtained from the Steinberg website. Alternatively, the +/// examples can easily be modified to compile without needing ASIO. +///

    +///

    +/// Supported platforms: +///

      +///
    • Microsoft Visual C++ 6.0, 7.0 (.NET 2002) and 7.1 (.NET 2003).
    • +///
    • GNU G++ 2.95 and G++ 3.3.
    • +///
    +/// Other platforms should be easily supported as PortAudioCpp is platform-independent and (reasonably) C++ standard compliant. +///

    +///

    +/// This documentation mainly provides information specific to PortAudioCpp. For a more complete explaination of all of the +/// concepts used, please consult the PortAudio documentation. +///

    +///

    +/// PortAudioCpp was developed by Merlijn Blaauw with many great suggestions and help from Ross Bencina. Ludwig Schwardt provided +/// GNU/Linux build files and checked G++ compatibility. PortAudioCpp may be used under the same licensing, conditions and +/// warranty as PortAudio. See the PortAudio license for more details. +///

    +///

    Links

    +///

    +/// Official PortAudio site.
    +///

    +////// + +// --------------------------------------------------------------------------------------- + +////// +/// @namespace portaudio +/// +/// To avoid name collision, everything in PortAudioCpp is in the portaudio +/// namespace. If this name is too long it's usually pretty safe to use an +/// alias like ``namespace pa = portaudio;''. +////// + +// --------------------------------------------------------------------------------------- + +////// +/// @file PortAudioCpp.hxx +/// An include-all header file (for lazy programmers and using pre-compiled headers). +////// + +// --------------------------------------------------------------------------------------- + +#include "portaudio.h" + +#include "portaudiocpp/AutoSystem.hxx" +#include "portaudiocpp/BlockingStream.hxx" +#include "portaudiocpp/CallbackInterface.hxx" +#include "portaudiocpp/CallbackStream.hxx" +#include "portaudiocpp/CFunCallbackStream.hxx" +#include "portaudiocpp/CppFunCallbackStream.hxx" +#include "portaudiocpp/Device.hxx" +#include "portaudiocpp/Exception.hxx" +#include "portaudiocpp/HostApi.hxx" +#include "portaudiocpp/InterfaceCallbackStream.hxx" +#include "portaudiocpp/MemFunCallbackStream.hxx" +#include "portaudiocpp/SampleDataFormat.hxx" +#include "portaudiocpp/DirectionSpecificStreamParameters.hxx" +#include "portaudiocpp/Stream.hxx" +#include "portaudiocpp/StreamParameters.hxx" +#include "portaudiocpp/System.hxx" +#include "portaudiocpp/SystemDeviceIterator.hxx" +#include "portaudiocpp/SystemHostApiIterator.hxx" + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_PORTAUDIOCPP_HXX diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/SampleDataFormat.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/SampleDataFormat.hxx new file mode 100644 index 000000000..a7e25b241 --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/SampleDataFormat.hxx @@ -0,0 +1,35 @@ +#ifndef INCLUDED_PORTAUDIO_SAMPLEDATAFORMAT_HXX +#define INCLUDED_PORTAUDIO_SAMPLEDATAFORMAT_HXX + +// --------------------------------------------------------------------------------------- + +#include "portaudio.h" + +// --------------------------------------------------------------------------------------- + +namespace portaudio +{ + + + ////// + /// @brief PortAudio sample data formats. + /// + /// Small helper enum to wrap the PortAudio defines. + ////// + enum SampleDataFormat + { + INVALID_FORMAT = 0, + FLOAT32 = paFloat32, + INT32 = paInt32, + INT24 = paInt24, + INT16 = paInt16, + INT8 = paInt8, + UINT8 = paUInt8 + }; + + +} // namespace portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_SAMPLEDATAFORMAT_HXX diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/Stream.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/Stream.hxx new file mode 100644 index 000000000..8a255ec76 --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/Stream.hxx @@ -0,0 +1,82 @@ +#ifndef INCLUDED_PORTAUDIO_STREAM_HXX +#define INCLUDED_PORTAUDIO_STREAM_HXX + +#include "portaudio.h" + +// --------------------------------------------------------------------------------------- + +// Forward declaration(s): +namespace portaudio +{ + class StreamParameters; +} + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + + ////// + /// @brief A Stream represents an active or inactive input and/or output data + /// stream in the System. + /// + /// Concrete Stream classes should ensure themselves being in a closed state at + /// destruction (i.e. by calling their own close() method in their deconstructor). + /// Following good C++ programming practices, care must be taken to ensure no + /// exceptions are thrown by the deconstructor of these classes. As a consequence, + /// clients need to explicitly call close() to ensure the stream closed successfully. + /// + /// The Stream object can be used to manipulate the Stream's state. Also, time-constant + /// and time-varying information about the Stream can be retreived. + ////// + class Stream + { + public: + // Opening/closing: + virtual ~Stream(); + + virtual void close(); + bool isOpen() const; + + // Additional set up: + void setStreamFinishedCallback(PaStreamFinishedCallback *callback); + + // State management: + void start(); + void stop(); + void abort(); + + bool isStopped() const; + bool isActive() const; + + // Stream info (time-constant, but might become time-variant soon): + PaTime inputLatency() const; + PaTime outputLatency() const; + double sampleRate() const; + + // Stream info (time-varying): + PaTime time() const; + + // Accessors for PortAudio PaStream, useful for interfacing + // with PortAudio add-ons (such as PortMixer) for instance: + const PaStream *paStream() const; + PaStream *paStream(); + + protected: + Stream(); // abstract class + + PaStream *stream_; + + private: + Stream(const Stream &); // non-copyable + Stream &operator=(const Stream &); // non-copyable + }; + + +} // namespace portaudio + + +#endif // INCLUDED_PORTAUDIO_STREAM_HXX + diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/StreamParameters.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/StreamParameters.hxx new file mode 100644 index 000000000..2b6aa2ef4 --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/StreamParameters.hxx @@ -0,0 +1,77 @@ +#ifndef INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX +#define INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX + +// --------------------------------------------------------------------------------------- + +#include "portaudio.h" + +#include "portaudiocpp/DirectionSpecificStreamParameters.hxx" + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + ////// + /// @brief The entire set of parameters needed to configure and open + /// a Stream. + /// + /// It contains parameters of input, output and shared parameters. + /// Using the isSupported() method, the StreamParameters can be + /// checked if opening a Stream using this StreamParameters would + /// succeed or not. Accessors are provided to higher-level parameters + /// aswell as the lower-level parameters which are mainly intended for + /// internal use. + ////// + class StreamParameters + { + public: + StreamParameters(); + StreamParameters(const DirectionSpecificStreamParameters &inputParameters, + const DirectionSpecificStreamParameters &outputParameters, double sampleRate, + unsigned long framesPerBuffer, PaStreamFlags flags); + + // Set up for direction-specific: + void setInputParameters(const DirectionSpecificStreamParameters ¶meters); + void setOutputParameters(const DirectionSpecificStreamParameters ¶meters); + + // Set up for common parameters: + void setSampleRate(double sampleRate); + void setFramesPerBuffer(unsigned long framesPerBuffer); + void setFlag(PaStreamFlags flag); + void unsetFlag(PaStreamFlags flag); + void clearFlags(); + + // Validation: + bool isSupported() const; + + // Accessors (direction-specific): + DirectionSpecificStreamParameters &inputParameters(); + const DirectionSpecificStreamParameters &inputParameters() const; + DirectionSpecificStreamParameters &outputParameters(); + const DirectionSpecificStreamParameters &outputParameters() const; + + // Accessors (common): + double sampleRate() const; + unsigned long framesPerBuffer() const; + PaStreamFlags flags() const; + bool isFlagSet(PaStreamFlags flag) const; + + private: + // Half-duplex specific parameters: + DirectionSpecificStreamParameters inputParameters_; + DirectionSpecificStreamParameters outputParameters_; + + // Common parameters: + double sampleRate_; + unsigned long framesPerBuffer_; + PaStreamFlags flags_; + }; + + +} // namespace portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/System.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/System.hxx new file mode 100644 index 000000000..f5fb7132a --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/System.hxx @@ -0,0 +1,107 @@ +#ifndef INCLUDED_PORTAUDIO_SYSTEM_HXX +#define INCLUDED_PORTAUDIO_SYSTEM_HXX + +// --------------------------------------------------------------------------------------- + +#include "portaudio.h" + +// --------------------------------------------------------------------------------------- + +// Forward declaration(s): +namespace portaudio +{ + class Device; + class Stream; + class HostApi; +} + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + + ////// + /// @brief System singleton which represents the PortAudio system. + /// + /// The System is used to initialize/terminate PortAudio and provide + /// a single acccess point to the PortAudio System (instance()). + /// It can be used to iterate through all HostApi 's in the System as + /// well as all devices in the System. It also provides some utility + /// functionality of PortAudio. + /// + /// Terminating the System will also abort and close the open streams. + /// The Stream objects will need to be deallocated by the client though + /// (it's usually a good idea to have them cleaned up automatically). + ////// + class System + { + public: + class HostApiIterator; // forward declaration + class DeviceIterator; // forward declaration + + // ------------------------------------------------------------------------------- + + static int version(); + static const char *versionText(); + + static void initialize(); + static void terminate(); + + static System &instance(); + static bool exists(); + + // ------------------------------------------------------------------------------- + + // host apis: + HostApiIterator hostApisBegin(); + HostApiIterator hostApisEnd(); + + HostApi &defaultHostApi(); + + HostApi &hostApiByTypeId(PaHostApiTypeId type); + HostApi &hostApiByIndex(PaHostApiIndex index); + + int hostApiCount(); + + // ------------------------------------------------------------------------------- + + // devices: + DeviceIterator devicesBegin(); + DeviceIterator devicesEnd(); + + Device &defaultInputDevice(); + Device &defaultOutputDevice(); + + Device &deviceByIndex(PaDeviceIndex index); + + int deviceCount(); + + static Device &nullDevice(); + + // ------------------------------------------------------------------------------- + + // misc: + void sleep(long msec); + int sizeOfSample(PaSampleFormat format); + + private: + System(); + ~System(); + + static System *instance_; + static int initCount_; + + static HostApi **hostApis_; + static Device **devices_; + + static Device *nullDevice_; + }; + + +} // namespace portaudio + + +#endif // INCLUDED_PORTAUDIO_SYSTEM_HXX + diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx new file mode 100644 index 000000000..613fc3db5 --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx @@ -0,0 +1,66 @@ +#ifndef INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX +#define INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX + +// --------------------------------------------------------------------------------------- + +#include +#include + +#include "portaudiocpp/System.hxx" + +// --------------------------------------------------------------------------------------- + +// Forward declaration(s): +namespace portaudio +{ + class Device; + class HostApi; +} + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + + ////// + /// @brief Iterator class for iterating through all Devices in a System. + /// + /// Devices will be iterated by iterating all Devices in each + /// HostApi in the System. Compliant with the STL bidirectional + /// iterator concept. + ////// + class System::DeviceIterator + { + public: + typedef std::bidirectional_iterator_tag iterator_category; + typedef Device value_type; + typedef ptrdiff_t difference_type; + typedef Device * pointer; + typedef Device & reference; + + Device &operator*() const; + Device *operator->() const; + + DeviceIterator &operator++(); + DeviceIterator operator++(int); + DeviceIterator &operator--(); + DeviceIterator operator--(int); + + bool operator==(const DeviceIterator &rhs); + bool operator!=(const DeviceIterator &rhs); + + private: + friend class System; + friend class HostApi; + Device **ptr_; + }; + + +} // namespace portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX + diff --git a/portaudio-v19/bindings/cpp/include/portaudiocpp/SystemHostApiIterator.hxx b/portaudio-v19/bindings/cpp/include/portaudiocpp/SystemHostApiIterator.hxx new file mode 100644 index 000000000..b9b13b85e --- /dev/null +++ b/portaudio-v19/bindings/cpp/include/portaudiocpp/SystemHostApiIterator.hxx @@ -0,0 +1,61 @@ +#ifndef INCLUDED_PORTAUDIO_SYSTEMHOSTAPIITERATOR_HXX +#define INCLUDED_PORTAUDIO_SYSTEMHOSTAPIITERATOR_HXX + +// --------------------------------------------------------------------------------------- + +#include +#include + +#include "portaudiocpp/System.hxx" + +// --------------------------------------------------------------------------------------- + +// Forward declaration(s): +namespace portaudio +{ + class HostApi; +} + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + + ////// + /// @brief Iterator class for iterating through all HostApis in a System. + /// + /// Compliant with the STL bidirectional iterator concept. + ////// + class System::HostApiIterator + { + public: + typedef std::bidirectional_iterator_tag iterator_category; + typedef Device value_type; + typedef ptrdiff_t difference_type; + typedef HostApi * pointer; + typedef HostApi & reference; + + HostApi &operator*() const; + HostApi *operator->() const; + + HostApiIterator &operator++(); + HostApiIterator operator++(int); + HostApiIterator &operator--(); + HostApiIterator operator--(int); + + bool operator==(const HostApiIterator &rhs); + bool operator!=(const HostApiIterator &rhs); + + private: + friend class System; + HostApi **ptr_; + }; + + +} // namespace portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_SYSTEMHOSTAPIITERATOR_HXX diff --git a/portaudio-v19/bindings/cpp/lib/Makefile.am b/portaudio-v19/bindings/cpp/lib/Makefile.am new file mode 100644 index 000000000..a27f7c566 --- /dev/null +++ b/portaudio-v19/bindings/cpp/lib/Makefile.am @@ -0,0 +1,26 @@ +SRCDIR = $(top_srcdir)/source/portaudiocpp + +lib_LTLIBRARIES = libportaudiocpp.la + +LDADD = libportaudiocpp.la + +libportaudiocpp_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -no-undefined + +libportaudiocpp_la_LIBADD = $(top_builddir)/$(PORTAUDIO_ROOT)/lib/libportaudio.la +libportaudiocpp_la_SOURCES = \ + $(SRCDIR)/BlockingStream.cxx \ + $(SRCDIR)/CallbackInterface.cxx \ + $(SRCDIR)/CallbackStream.cxx \ + $(SRCDIR)/CFunCallbackStream.cxx \ + $(SRCDIR)/CppFunCallbackStream.cxx \ + $(SRCDIR)/Device.cxx \ + $(SRCDIR)/DirectionSpecificStreamParameters.cxx \ + $(SRCDIR)/Exception.cxx \ + $(SRCDIR)/HostApi.cxx \ + $(SRCDIR)/InterfaceCallbackStream.cxx \ + $(SRCDIR)/MemFunCallbackStream.cxx \ + $(SRCDIR)/Stream.cxx \ + $(SRCDIR)/StreamParameters.cxx \ + $(SRCDIR)/System.cxx \ + $(SRCDIR)/SystemDeviceIterator.cxx \ + $(SRCDIR)/SystemHostApiIterator.cxx diff --git a/portaudio-v19/bindings/cpp/lib/Makefile.in b/portaudio-v19/bindings/cpp/lib/Makefile.in new file mode 100644 index 000000000..5c5a68b7e --- /dev/null +++ b/portaudio-v19/bindings/cpp/lib/Makefile.in @@ -0,0 +1,613 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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@ +subdir = lib +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +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)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libportaudiocpp_la_DEPENDENCIES = \ + $(top_builddir)/$(PORTAUDIO_ROOT)/lib/libportaudio.la +am_libportaudiocpp_la_OBJECTS = BlockingStream.lo CallbackInterface.lo \ + CallbackStream.lo CFunCallbackStream.lo \ + CppFunCallbackStream.lo Device.lo \ + DirectionSpecificStreamParameters.lo Exception.lo HostApi.lo \ + InterfaceCallbackStream.lo MemFunCallbackStream.lo Stream.lo \ + StreamParameters.lo System.lo SystemDeviceIterator.lo \ + SystemHostApiIterator.lo +libportaudiocpp_la_OBJECTS = $(am_libportaudiocpp_la_OBJECTS) +depcomp = $(SHELL) $(top_srcdir)/../../depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libportaudiocpp_la_SOURCES) +DIST_SOURCES = $(libportaudiocpp_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_INCLUDES = @DEFAULT_INCLUDES@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +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@ +PORTAUDIO_ROOT = @PORTAUDIO_ROOT@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +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@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SRCDIR = $(top_srcdir)/source/portaudiocpp +lib_LTLIBRARIES = libportaudiocpp.la +LDADD = libportaudiocpp.la +libportaudiocpp_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -no-undefined +libportaudiocpp_la_LIBADD = $(top_builddir)/$(PORTAUDIO_ROOT)/lib/libportaudio.la +libportaudiocpp_la_SOURCES = \ + $(SRCDIR)/BlockingStream.cxx \ + $(SRCDIR)/CallbackInterface.cxx \ + $(SRCDIR)/CallbackStream.cxx \ + $(SRCDIR)/CFunCallbackStream.cxx \ + $(SRCDIR)/CppFunCallbackStream.cxx \ + $(SRCDIR)/Device.cxx \ + $(SRCDIR)/DirectionSpecificStreamParameters.cxx \ + $(SRCDIR)/Exception.cxx \ + $(SRCDIR)/HostApi.cxx \ + $(SRCDIR)/InterfaceCallbackStream.cxx \ + $(SRCDIR)/MemFunCallbackStream.cxx \ + $(SRCDIR)/Stream.cxx \ + $(SRCDIR)/StreamParameters.cxx \ + $(SRCDIR)/System.cxx \ + $(SRCDIR)/SystemDeviceIterator.cxx \ + $(SRCDIR)/SystemHostApiIterator.cxx + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cxx .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --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 +libportaudiocpp.la: $(libportaudiocpp_la_OBJECTS) $(libportaudiocpp_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libportaudiocpp_la_LDFLAGS) $(libportaudiocpp_la_OBJECTS) $(libportaudiocpp_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BlockingStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CFunCallbackStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CallbackInterface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CallbackStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CppFunCallbackStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DirectionSpecificStreamParameters.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Exception.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HostApi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InterfaceCallbackStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MemFunCallbackStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StreamParameters.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/System.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SystemDeviceIterator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SystemHostApiIterator.Plo@am__quote@ + +.cxx.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cxx.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cxx.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +BlockingStream.lo: $(SRCDIR)/BlockingStream.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT BlockingStream.lo -MD -MP -MF "$(DEPDIR)/BlockingStream.Tpo" -c -o BlockingStream.lo `test -f '$(SRCDIR)/BlockingStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/BlockingStream.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/BlockingStream.Tpo" "$(DEPDIR)/BlockingStream.Plo"; else rm -f "$(DEPDIR)/BlockingStream.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/BlockingStream.cxx' object='BlockingStream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o BlockingStream.lo `test -f '$(SRCDIR)/BlockingStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/BlockingStream.cxx + +CallbackInterface.lo: $(SRCDIR)/CallbackInterface.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CallbackInterface.lo -MD -MP -MF "$(DEPDIR)/CallbackInterface.Tpo" -c -o CallbackInterface.lo `test -f '$(SRCDIR)/CallbackInterface.cxx' || echo '$(srcdir)/'`$(SRCDIR)/CallbackInterface.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/CallbackInterface.Tpo" "$(DEPDIR)/CallbackInterface.Plo"; else rm -f "$(DEPDIR)/CallbackInterface.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/CallbackInterface.cxx' object='CallbackInterface.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CallbackInterface.lo `test -f '$(SRCDIR)/CallbackInterface.cxx' || echo '$(srcdir)/'`$(SRCDIR)/CallbackInterface.cxx + +CallbackStream.lo: $(SRCDIR)/CallbackStream.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CallbackStream.lo -MD -MP -MF "$(DEPDIR)/CallbackStream.Tpo" -c -o CallbackStream.lo `test -f '$(SRCDIR)/CallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/CallbackStream.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/CallbackStream.Tpo" "$(DEPDIR)/CallbackStream.Plo"; else rm -f "$(DEPDIR)/CallbackStream.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/CallbackStream.cxx' object='CallbackStream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CallbackStream.lo `test -f '$(SRCDIR)/CallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/CallbackStream.cxx + +CFunCallbackStream.lo: $(SRCDIR)/CFunCallbackStream.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CFunCallbackStream.lo -MD -MP -MF "$(DEPDIR)/CFunCallbackStream.Tpo" -c -o CFunCallbackStream.lo `test -f '$(SRCDIR)/CFunCallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/CFunCallbackStream.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/CFunCallbackStream.Tpo" "$(DEPDIR)/CFunCallbackStream.Plo"; else rm -f "$(DEPDIR)/CFunCallbackStream.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/CFunCallbackStream.cxx' object='CFunCallbackStream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CFunCallbackStream.lo `test -f '$(SRCDIR)/CFunCallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/CFunCallbackStream.cxx + +CppFunCallbackStream.lo: $(SRCDIR)/CppFunCallbackStream.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CppFunCallbackStream.lo -MD -MP -MF "$(DEPDIR)/CppFunCallbackStream.Tpo" -c -o CppFunCallbackStream.lo `test -f '$(SRCDIR)/CppFunCallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/CppFunCallbackStream.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/CppFunCallbackStream.Tpo" "$(DEPDIR)/CppFunCallbackStream.Plo"; else rm -f "$(DEPDIR)/CppFunCallbackStream.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/CppFunCallbackStream.cxx' object='CppFunCallbackStream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CppFunCallbackStream.lo `test -f '$(SRCDIR)/CppFunCallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/CppFunCallbackStream.cxx + +Device.lo: $(SRCDIR)/Device.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Device.lo -MD -MP -MF "$(DEPDIR)/Device.Tpo" -c -o Device.lo `test -f '$(SRCDIR)/Device.cxx' || echo '$(srcdir)/'`$(SRCDIR)/Device.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Device.Tpo" "$(DEPDIR)/Device.Plo"; else rm -f "$(DEPDIR)/Device.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/Device.cxx' object='Device.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Device.lo `test -f '$(SRCDIR)/Device.cxx' || echo '$(srcdir)/'`$(SRCDIR)/Device.cxx + +DirectionSpecificStreamParameters.lo: $(SRCDIR)/DirectionSpecificStreamParameters.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DirectionSpecificStreamParameters.lo -MD -MP -MF "$(DEPDIR)/DirectionSpecificStreamParameters.Tpo" -c -o DirectionSpecificStreamParameters.lo `test -f '$(SRCDIR)/DirectionSpecificStreamParameters.cxx' || echo '$(srcdir)/'`$(SRCDIR)/DirectionSpecificStreamParameters.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/DirectionSpecificStreamParameters.Tpo" "$(DEPDIR)/DirectionSpecificStreamParameters.Plo"; else rm -f "$(DEPDIR)/DirectionSpecificStreamParameters.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/DirectionSpecificStreamParameters.cxx' object='DirectionSpecificStreamParameters.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DirectionSpecificStreamParameters.lo `test -f '$(SRCDIR)/DirectionSpecificStreamParameters.cxx' || echo '$(srcdir)/'`$(SRCDIR)/DirectionSpecificStreamParameters.cxx + +Exception.lo: $(SRCDIR)/Exception.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Exception.lo -MD -MP -MF "$(DEPDIR)/Exception.Tpo" -c -o Exception.lo `test -f '$(SRCDIR)/Exception.cxx' || echo '$(srcdir)/'`$(SRCDIR)/Exception.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Exception.Tpo" "$(DEPDIR)/Exception.Plo"; else rm -f "$(DEPDIR)/Exception.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/Exception.cxx' object='Exception.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Exception.lo `test -f '$(SRCDIR)/Exception.cxx' || echo '$(srcdir)/'`$(SRCDIR)/Exception.cxx + +HostApi.lo: $(SRCDIR)/HostApi.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT HostApi.lo -MD -MP -MF "$(DEPDIR)/HostApi.Tpo" -c -o HostApi.lo `test -f '$(SRCDIR)/HostApi.cxx' || echo '$(srcdir)/'`$(SRCDIR)/HostApi.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/HostApi.Tpo" "$(DEPDIR)/HostApi.Plo"; else rm -f "$(DEPDIR)/HostApi.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/HostApi.cxx' object='HostApi.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o HostApi.lo `test -f '$(SRCDIR)/HostApi.cxx' || echo '$(srcdir)/'`$(SRCDIR)/HostApi.cxx + +InterfaceCallbackStream.lo: $(SRCDIR)/InterfaceCallbackStream.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InterfaceCallbackStream.lo -MD -MP -MF "$(DEPDIR)/InterfaceCallbackStream.Tpo" -c -o InterfaceCallbackStream.lo `test -f '$(SRCDIR)/InterfaceCallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/InterfaceCallbackStream.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/InterfaceCallbackStream.Tpo" "$(DEPDIR)/InterfaceCallbackStream.Plo"; else rm -f "$(DEPDIR)/InterfaceCallbackStream.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/InterfaceCallbackStream.cxx' object='InterfaceCallbackStream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InterfaceCallbackStream.lo `test -f '$(SRCDIR)/InterfaceCallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/InterfaceCallbackStream.cxx + +MemFunCallbackStream.lo: $(SRCDIR)/MemFunCallbackStream.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MemFunCallbackStream.lo -MD -MP -MF "$(DEPDIR)/MemFunCallbackStream.Tpo" -c -o MemFunCallbackStream.lo `test -f '$(SRCDIR)/MemFunCallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/MemFunCallbackStream.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/MemFunCallbackStream.Tpo" "$(DEPDIR)/MemFunCallbackStream.Plo"; else rm -f "$(DEPDIR)/MemFunCallbackStream.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/MemFunCallbackStream.cxx' object='MemFunCallbackStream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MemFunCallbackStream.lo `test -f '$(SRCDIR)/MemFunCallbackStream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/MemFunCallbackStream.cxx + +Stream.lo: $(SRCDIR)/Stream.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Stream.lo -MD -MP -MF "$(DEPDIR)/Stream.Tpo" -c -o Stream.lo `test -f '$(SRCDIR)/Stream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/Stream.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Stream.Tpo" "$(DEPDIR)/Stream.Plo"; else rm -f "$(DEPDIR)/Stream.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/Stream.cxx' object='Stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Stream.lo `test -f '$(SRCDIR)/Stream.cxx' || echo '$(srcdir)/'`$(SRCDIR)/Stream.cxx + +StreamParameters.lo: $(SRCDIR)/StreamParameters.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT StreamParameters.lo -MD -MP -MF "$(DEPDIR)/StreamParameters.Tpo" -c -o StreamParameters.lo `test -f '$(SRCDIR)/StreamParameters.cxx' || echo '$(srcdir)/'`$(SRCDIR)/StreamParameters.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/StreamParameters.Tpo" "$(DEPDIR)/StreamParameters.Plo"; else rm -f "$(DEPDIR)/StreamParameters.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/StreamParameters.cxx' object='StreamParameters.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o StreamParameters.lo `test -f '$(SRCDIR)/StreamParameters.cxx' || echo '$(srcdir)/'`$(SRCDIR)/StreamParameters.cxx + +System.lo: $(SRCDIR)/System.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT System.lo -MD -MP -MF "$(DEPDIR)/System.Tpo" -c -o System.lo `test -f '$(SRCDIR)/System.cxx' || echo '$(srcdir)/'`$(SRCDIR)/System.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/System.Tpo" "$(DEPDIR)/System.Plo"; else rm -f "$(DEPDIR)/System.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/System.cxx' object='System.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o System.lo `test -f '$(SRCDIR)/System.cxx' || echo '$(srcdir)/'`$(SRCDIR)/System.cxx + +SystemDeviceIterator.lo: $(SRCDIR)/SystemDeviceIterator.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SystemDeviceIterator.lo -MD -MP -MF "$(DEPDIR)/SystemDeviceIterator.Tpo" -c -o SystemDeviceIterator.lo `test -f '$(SRCDIR)/SystemDeviceIterator.cxx' || echo '$(srcdir)/'`$(SRCDIR)/SystemDeviceIterator.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SystemDeviceIterator.Tpo" "$(DEPDIR)/SystemDeviceIterator.Plo"; else rm -f "$(DEPDIR)/SystemDeviceIterator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/SystemDeviceIterator.cxx' object='SystemDeviceIterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SystemDeviceIterator.lo `test -f '$(SRCDIR)/SystemDeviceIterator.cxx' || echo '$(srcdir)/'`$(SRCDIR)/SystemDeviceIterator.cxx + +SystemHostApiIterator.lo: $(SRCDIR)/SystemHostApiIterator.cxx +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SystemHostApiIterator.lo -MD -MP -MF "$(DEPDIR)/SystemHostApiIterator.Tpo" -c -o SystemHostApiIterator.lo `test -f '$(SRCDIR)/SystemHostApiIterator.cxx' || echo '$(srcdir)/'`$(SRCDIR)/SystemHostApiIterator.cxx; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SystemHostApiIterator.Tpo" "$(DEPDIR)/SystemHostApiIterator.Plo"; else rm -f "$(DEPDIR)/SystemHostApiIterator.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SRCDIR)/SystemHostApiIterator.cxx' object='SystemHostApiIterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SystemHostApiIterator.lo `test -f '$(SRCDIR)/SystemHostApiIterator.cxx' || echo '$(srcdir)/'`$(SRCDIR)/SystemHostApiIterator.cxx + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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; } \ + END { 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; } \ + END { 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=; \ + 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; } \ + END { 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)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + 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) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; 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 + +clean-am: 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-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +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-info-am uninstall-libLTLIBRARIES + +.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-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man 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-info-am \ + uninstall-libLTLIBRARIES + +# 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: diff --git a/portaudio-v19/bindings/cpp/portaudiocpp.pc.in b/portaudio-v19/bindings/cpp/portaudiocpp.pc.in new file mode 100644 index 000000000..8b126d131 --- /dev/null +++ b/portaudio-v19/bindings/cpp/portaudiocpp.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: PortAudioCpp +Description: Portable audio I/O C++ bindings +Version: 12 +Requires: portaudio-2.0 + +Libs: -L${libdir} -lportaudiocpp +Cflags: -I${includedir} diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/AsioDeviceAdapter.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/AsioDeviceAdapter.cxx new file mode 100644 index 000000000..c4ee25f63 --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/AsioDeviceAdapter.cxx @@ -0,0 +1,83 @@ +#include "portaudiocpp/AsioDeviceAdapter.hxx" + +#include "portaudio.h" +#include "pa_asio.h" + +#include "portaudiocpp/Device.hxx" +#include "portaudiocpp/HostApi.hxx" +#include "portaudiocpp/Exception.hxx" + +namespace portaudio +{ + AsioDeviceAdapter::AsioDeviceAdapter(Device &device) + { + if (device.hostApi().typeId() != paASIO) + throw PaCppException(PaCppException::UNABLE_TO_ADAPT_DEVICE); + + device_ = &device; + + PaError err = PaAsio_GetAvailableLatencyValues(device_->index(), &minBufferSize_, &maxBufferSize_, + &preferredBufferSize_, &granularity_); + + if (err != paNoError) + throw PaException(err); + + } + + Device &AsioDeviceAdapter::device() + { + return *device_; + } + + long AsioDeviceAdapter::minBufferSize() const + { + return minBufferSize_; + } + + long AsioDeviceAdapter::maxBufferSize() const + { + return maxBufferSize_; + } + + long AsioDeviceAdapter::preferredBufferSize() const + { + return preferredBufferSize_; + } + + long AsioDeviceAdapter::granularity() const + { + return granularity_; + } + + void AsioDeviceAdapter::showControlPanel(void *systemSpecific) + { + PaError err = PaAsio_ShowControlPanel(device_->index(), systemSpecific); + + if (err != paNoError) + throw PaException(err); + } + + const char *AsioDeviceAdapter::inputChannelName(int channelIndex) const + { + const char *channelName; + PaError err = PaAsio_GetInputChannelName(device_->index(), channelIndex, &channelName); + + if (err != paNoError) + throw PaException(err); + + return channelName; + } + + const char *AsioDeviceAdapter::outputChannelName(int channelIndex) const + { + const char *channelName; + PaError err = PaAsio_GetOutputChannelName(device_->index(), channelIndex, &channelName); + + if (err != paNoError) + throw PaException(err); + + return channelName; + } +} + + diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/BlockingStream.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/BlockingStream.cxx new file mode 100644 index 000000000..c21535f06 --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/BlockingStream.cxx @@ -0,0 +1,100 @@ +#include "portaudiocpp/BlockingStream.hxx" + +#include "portaudio.h" + +#include "portaudiocpp/StreamParameters.hxx" +#include "portaudiocpp/Exception.hxx" + +namespace portaudio +{ + + // -------------------------------------------------------------------------------------- + + BlockingStream::BlockingStream() + { + } + + BlockingStream::BlockingStream(const StreamParameters ¶meters) + { + open(parameters); + } + + BlockingStream::~BlockingStream() + { + try + { + close(); + } + catch (...) + { + // ignore all errors + } + } + + // -------------------------------------------------------------------------------------- + + void BlockingStream::open(const StreamParameters ¶meters) + { + PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), + parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), NULL, NULL); + + if (err != paNoError) + { + throw PaException(err); + } + } + + // -------------------------------------------------------------------------------------- + + void BlockingStream::read(void *buffer, unsigned long numFrames) + { + PaError err = Pa_ReadStream(stream_, buffer, numFrames); + + if (err != paNoError) + { + throw PaException(err); + } + } + + void BlockingStream::write(const void *buffer, unsigned long numFrames) + { + PaError err = Pa_WriteStream(stream_, buffer, numFrames); + + if (err != paNoError) + { + throw PaException(err); + } + } + + // -------------------------------------------------------------------------------------- + + signed long BlockingStream::availableReadSize() const + { + signed long avail = Pa_GetStreamReadAvailable(stream_); + + if (avail < 0) + { + throw PaException(avail); + } + + return avail; + } + + signed long BlockingStream::availableWriteSize() const + { + signed long avail = Pa_GetStreamWriteAvailable(stream_); + + if (avail < 0) + { + throw PaException(avail); + } + + return avail; + } + + // -------------------------------------------------------------------------------------- + +} // portaudio + + + diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/CFunCallbackStream.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/CFunCallbackStream.cxx new file mode 100644 index 000000000..fd2fb53be --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/CFunCallbackStream.cxx @@ -0,0 +1,41 @@ +#include "portaudiocpp/CFunCallbackStream.hxx" + +#include "portaudiocpp/StreamParameters.hxx" +#include "portaudiocpp/Exception.hxx" + +namespace portaudio +{ + CFunCallbackStream::CFunCallbackStream() + { + } + + CFunCallbackStream::CFunCallbackStream(const StreamParameters ¶meters, PaStreamCallback *funPtr, void *userData) + { + open(parameters, funPtr, userData); + } + + CFunCallbackStream::~CFunCallbackStream() + { + try + { + close(); + } + catch (...) + { + // ignore all errors + } + } + + // ---------------------------------------------------------------------------------== + + void CFunCallbackStream::open(const StreamParameters ¶meters, PaStreamCallback *funPtr, void *userData) + { + PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), + parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), funPtr, userData); + + if (err != paNoError) + { + throw PaException(err); + } + } +} diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx new file mode 100644 index 000000000..7e343122f --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx @@ -0,0 +1,25 @@ +#include "portaudiocpp/CallbackInterface.hxx" + +namespace portaudio +{ + + namespace impl + { + + ////// + /// Adapts any CallbackInterface object to a C-callable function (ie this function). A + /// pointer to the object should be passed as ``userData'' when setting up the callback. + ////// + int callbackInterfaceToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, + const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData) + { + CallbackInterface *cb = static_cast(userData); + return cb->paCallbackFun(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags); + } + + + } // namespace impl + +} // namespace portaudio + + diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/CallbackStream.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/CallbackStream.cxx new file mode 100644 index 000000000..4204dbba9 --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/CallbackStream.cxx @@ -0,0 +1,20 @@ +#include "portaudiocpp/CallbackStream.hxx" + +namespace portaudio +{ + CallbackStream::CallbackStream() + { + } + + CallbackStream::~CallbackStream() + { + } + + // ----------------------------------------------------------------------------------- + + double CallbackStream::cpuLoad() const + { + return Pa_GetStreamCpuLoad(stream_); + } + +} // namespace portaudio diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/CppFunCallbackStream.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/CppFunCallbackStream.cxx new file mode 100644 index 000000000..95381398e --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/CppFunCallbackStream.cxx @@ -0,0 +1,81 @@ +#include "portaudiocpp/CppFunCallbackStream.hxx" + +#include "portaudiocpp/StreamParameters.hxx" +#include "portaudiocpp/Exception.hxx" + +namespace portaudio +{ + namespace impl + { + ////// + /// Adapts any a C++ callback to a C-callable function (ie this function). A + /// pointer to a struct with the C++ function pointer and the actual user data should be + /// passed as the ``userData'' parameter when setting up the callback. + ////// + int cppCallbackToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, + const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData) + { + FunCallbackStream::CppToCCallbackData *data = static_cast(userData); + return data->funPtr(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags, data->userData); + } + } + + // ----------------------------------------------------------------------------------- + + FunCallbackStream::CppToCCallbackData::CppToCCallbackData() + { + } + + FunCallbackStream::CppToCCallbackData::CppToCCallbackData(CallbackFunPtr funPtr, void *userData) : funPtr(funPtr), userData(userData) + { + } + + void FunCallbackStream::CppToCCallbackData::init(CallbackFunPtr funPtr, void *userData) + { + this->funPtr = funPtr; + this->userData = userData; + } + + // ----------------------------------------------------------------------------------- + + FunCallbackStream::FunCallbackStream() + { + } + + FunCallbackStream::FunCallbackStream(const StreamParameters ¶meters, CallbackFunPtr funPtr, void *userData) : adapterData_(funPtr, userData) + { + open(parameters); + } + + FunCallbackStream::~FunCallbackStream() + { + try + { + close(); + } + catch (...) + { + // ignore all errors + } + } + + void FunCallbackStream::open(const StreamParameters ¶meters, CallbackFunPtr funPtr, void *userData) + { + adapterData_.init(funPtr, userData); + open(parameters); + } + + void FunCallbackStream::open(const StreamParameters ¶meters) + { + PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), + parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::cppCallbackToPaCallbackAdapter, + static_cast(&adapterData_)); + + if (err != paNoError) + { + throw PaException(err); + } + } + + // ----------------------------------------------------------------------------------- +} diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/Device.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/Device.cxx new file mode 100644 index 000000000..cd7eb7cbd --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/Device.cxx @@ -0,0 +1,168 @@ +#include "portaudiocpp/Device.hxx" + +#include + +#include "portaudiocpp/HostApi.hxx" +#include "portaudiocpp/System.hxx" +#include "portaudiocpp/Exception.hxx" + +namespace portaudio +{ + + // ------------------------------------------------------------------------------- + + Device::Device(PaDeviceIndex index) : index_(index) + { + if (index == paNoDevice) + info_ = NULL; + else + info_ = Pa_GetDeviceInfo(index); + } + + Device::~Device() + { + } + + PaDeviceIndex Device::index() const + { + return index_; + } + + const char *Device::name() const + { + if (info_ == NULL) + return ""; + + return info_->name; + } + + int Device::maxInputChannels() const + { + if (info_ == NULL) + return 0; + + return info_->maxInputChannels; + } + + int Device::maxOutputChannels() const + { + if (info_ == NULL) + return 0; + + return info_->maxOutputChannels; + } + + PaTime Device::defaultLowInputLatency() const + { + if (info_ == NULL) + return static_cast(0.0); + + return info_->defaultLowInputLatency; + } + + PaTime Device::defaultHighInputLatency() const + { + if (info_ == NULL) + return static_cast(0.0); + + return info_->defaultHighInputLatency; + } + + PaTime Device::defaultLowOutputLatency() const + { + if (info_ == NULL) + return static_cast(0.0); + + return info_->defaultLowOutputLatency; + } + + PaTime Device::defaultHighOutputLatency() const + { + if (info_ == NULL) + return static_cast(0.0); + + return info_->defaultHighOutputLatency; + } + + double Device::defaultSampleRate() const + { + if (info_ == NULL) + return 0.0; + + return info_->defaultSampleRate; + } + + // ------------------------------------------------------------------------------- + + bool Device::isInputOnlyDevice() const + { + return (maxOutputChannels() == 0); + } + + bool Device::isOutputOnlyDevice() const + { + return (maxInputChannels() == 0); + } + + bool Device::isFullDuplexDevice() const + { + return (maxInputChannels() > 0 && maxOutputChannels() > 0); + } + + bool Device::isSystemDefaultInputDevice() const + { + return (System::instance().defaultInputDevice() == *this); + } + + bool Device::isSystemDefaultOutputDevice() const + { + return (System::instance().defaultOutputDevice() == *this); + } + + bool Device::isHostApiDefaultInputDevice() const + { + return (hostApi().defaultInputDevice() == *this); + } + + bool Device::isHostApiDefaultOutputDevice() const + { + return (hostApi().defaultOutputDevice() == *this); + } + + // ------------------------------------------------------------------------------- + + bool Device::operator==(const Device &rhs) + { + return (index_ == rhs.index_); + } + + bool Device::operator!=(const Device &rhs) + { + return !(*this == rhs); + } + + // ------------------------------------------------------------------------------- + + HostApi &Device::hostApi() + { + // NOTE: will cause an exception when called for the null device + if (info_ == NULL) + throw PaException(paInternalError); + + return System::instance().hostApiByIndex(info_->hostApi); + } + + const HostApi &Device::hostApi() const + { + // NOTE; will cause an exception when called for the null device + if (info_ == NULL) + throw PaException(paInternalError); + + return System::instance().hostApiByIndex(info_->hostApi); + } + + // ------------------------------------------------------------------------------- + +} // namespace portaudio + + diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/DirectionSpecificStreamParameters.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/DirectionSpecificStreamParameters.cxx new file mode 100644 index 000000000..d3c307c31 --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/DirectionSpecificStreamParameters.cxx @@ -0,0 +1,163 @@ +#include "portaudiocpp/DirectionSpecificStreamParameters.hxx" + +#include "portaudiocpp/Device.hxx" + +namespace portaudio +{ + + // ----------------------------------------------------------------------------------- + + ////// + /// Returns a `nil' DirectionSpecificStreamParameters object. This can be used to + /// specify that one direction of a Stream is not required (i.e. when creating + /// a half-duplex Stream). All fields of the null DirectionSpecificStreamParameters + /// object are invalid except for the device and the number of channel, which are set + /// to paNoDevice and 0 respectively. + ////// + DirectionSpecificStreamParameters DirectionSpecificStreamParameters::null() + { + DirectionSpecificStreamParameters tmp; + tmp.paStreamParameters_.device = paNoDevice; + tmp.paStreamParameters_.channelCount = 0; + return tmp; + } + + // ----------------------------------------------------------------------------------- + + ////// + /// Default constructor -- all parameters will be uninitialized. + ////// + DirectionSpecificStreamParameters::DirectionSpecificStreamParameters() + { + } + + ////// + /// Constructor which sets all required fields. + ////// + DirectionSpecificStreamParameters::DirectionSpecificStreamParameters(const Device &device, int numChannels, + SampleDataFormat format, bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo) + { + setDevice(device); + setNumChannels(numChannels); + setSampleFormat(format, interleaved); + setSuggestedLatency(suggestedLatency); + setHostApiSpecificStreamInfo(hostApiSpecificStreamInfo); + } + + // ----------------------------------------------------------------------------------- + + void DirectionSpecificStreamParameters::setDevice(const Device &device) + { + paStreamParameters_.device = device.index(); + } + + void DirectionSpecificStreamParameters::setNumChannels(int numChannels) + { + paStreamParameters_.channelCount = numChannels; + } + + void DirectionSpecificStreamParameters::setSampleFormat(SampleDataFormat format, bool interleaved) + { + paStreamParameters_.sampleFormat = static_cast(format); + + if (!interleaved) + paStreamParameters_.sampleFormat |= paNonInterleaved; + } + + void DirectionSpecificStreamParameters::setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved) + { + paStreamParameters_.sampleFormat = format; + + paStreamParameters_.sampleFormat |= paCustomFormat; + + if (!interleaved) + paStreamParameters_.sampleFormat |= paNonInterleaved; + } + + void DirectionSpecificStreamParameters::setSuggestedLatency(PaTime latency) + { + paStreamParameters_.suggestedLatency = latency; + } + + void DirectionSpecificStreamParameters::setHostApiSpecificStreamInfo(void *streamInfo) + { + paStreamParameters_.hostApiSpecificStreamInfo = streamInfo; + } + + // ----------------------------------------------------------------------------------- + + PaStreamParameters *DirectionSpecificStreamParameters::paStreamParameters() + { + if (paStreamParameters_.channelCount > 0 && paStreamParameters_.device != paNoDevice) + return &paStreamParameters_; + else + return NULL; + } + + const PaStreamParameters *DirectionSpecificStreamParameters::paStreamParameters() const + { + if (paStreamParameters_.channelCount > 0 && paStreamParameters_.device != paNoDevice) + return &paStreamParameters_; + else + return NULL; + } + + Device &DirectionSpecificStreamParameters::device() const + { + return System::instance().deviceByIndex(paStreamParameters_.device); + } + + int DirectionSpecificStreamParameters::numChannels() const + { + return paStreamParameters_.channelCount; + } + + ////// + /// Returns the (non host api-specific) sample format, without including + /// the paNonInterleaved flag. If the sample format is host api-spefific, + /// INVALID_FORMAT (0) will be returned. + ////// + SampleDataFormat DirectionSpecificStreamParameters::sampleFormat() const + { + if (isSampleFormatHostApiSpecific()) + return INVALID_FORMAT; + else + return static_cast(paStreamParameters_.sampleFormat & ~paNonInterleaved); + } + + bool DirectionSpecificStreamParameters::isSampleFormatInterleaved() const + { + return ((paStreamParameters_.sampleFormat & paNonInterleaved) == 0); + } + + bool DirectionSpecificStreamParameters::isSampleFormatHostApiSpecific() const + { + return ((paStreamParameters_.sampleFormat & paCustomFormat) == 0); + } + + ////// + /// Returns the host api-specific sample format, without including any + /// paCustomFormat or paNonInterleaved flags. Will return 0 if the sample format is + /// not host api-specific. + ////// + PaSampleFormat DirectionSpecificStreamParameters::hostApiSpecificSampleFormat() const + { + if (isSampleFormatHostApiSpecific()) + return paStreamParameters_.sampleFormat & ~paCustomFormat & ~paNonInterleaved; + else + return 0; + } + + PaTime DirectionSpecificStreamParameters::suggestedLatency() const + { + return paStreamParameters_.suggestedLatency; + } + + void *DirectionSpecificStreamParameters::hostApiSpecificStreamInfo() const + { + return paStreamParameters_.hostApiSpecificStreamInfo; + } + + // ----------------------------------------------------------------------------------- + +} // namespace portaudio diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/Exception.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/Exception.cxx new file mode 100644 index 000000000..2e7e70137 --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/Exception.cxx @@ -0,0 +1,123 @@ +#include "portaudiocpp/Exception.hxx" + +namespace portaudio +{ + // ----------------------------------------------------------------------------------- + // PaException: + // ----------------------------------------------------------------------------------- + + ////// + /// Wraps a PortAudio error into a PortAudioCpp PaException. + ////// + PaException::PaException(PaError error) : error_(error) + { + } + + // ----------------------------------------------------------------------------------- + + ////// + /// Alias for paErrorText(), to have std::exception compliance. + ////// + const char *PaException::what() const throw() + { + return paErrorText(); + } + + // ----------------------------------------------------------------------------------- + + ////// + /// Returns the PortAudio error code (PaError). + ////// + PaError PaException::paError() const + { + return error_; + } + + ////// + /// Returns the error as a (zero-terminated) text string. + ////// + const char *PaException::paErrorText() const + { + return Pa_GetErrorText(error_); + } + + ////// + /// Returns true is the error is a HostApi error. + ////// + bool PaException::isHostApiError() const + { + return (error_ == paUnanticipatedHostError); + } + + ////// + /// Returns the last HostApi error (which is the current one if + /// isHostApiError() returns true) as an error code. + ////// + long PaException::lastHostApiError() const + { + return Pa_GetLastHostErrorInfo()->errorCode; + } + + ////// + /// Returns the last HostApi error (which is the current one if + /// isHostApiError() returns true) as a (zero-terminated) text + /// string, if it's available. + ////// + const char *PaException::lastHostApiErrorText() const + { + return Pa_GetLastHostErrorInfo()->errorText; + } + + // ----------------------------------------------------------------------------------- + + bool PaException::operator==(const PaException &rhs) const + { + return (error_ == rhs.error_); + } + + bool PaException::operator!=(const PaException &rhs) const + { + return !(*this == rhs); + } + + // ----------------------------------------------------------------------------------- + // PaCppException: + // ----------------------------------------------------------------------------------- + + PaCppException::PaCppException(ExceptionSpecifier specifier) : specifier_(specifier) + { + } + + const char *PaCppException::what() const throw() + { + switch (specifier_) + { + case UNABLE_TO_ADAPT_DEVICE: + { + return "Unable to adapt the given device to the specified host api specific device extension"; + } + } + + return "Unknown exception"; + } + + PaCppException::ExceptionSpecifier PaCppException::specifier() const + { + return specifier_; + } + + bool PaCppException::operator==(const PaCppException &rhs) const + { + return (specifier_ == rhs.specifier_); + } + + bool PaCppException::operator!=(const PaCppException &rhs) const + { + return !(*this == rhs); + } + + // ----------------------------------------------------------------------------------- + +} // namespace portaudio + + diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/HostApi.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/HostApi.cxx new file mode 100644 index 000000000..c6ae019ad --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/HostApi.cxx @@ -0,0 +1,121 @@ +#include "portaudiocpp/HostApi.hxx" + +#include "portaudiocpp/System.hxx" +#include "portaudiocpp/Device.hxx" +#include "portaudiocpp/SystemDeviceIterator.hxx" +#include "portaudiocpp/Exception.hxx" + +namespace portaudio +{ + + // ----------------------------------------------------------------------------------- + + HostApi::HostApi(PaHostApiIndex index) : devices_(NULL) + { + try + { + info_ = Pa_GetHostApiInfo(index); + + // Create and populate devices array: + int numDevices = deviceCount(); + + devices_ = new Device*[numDevices]; + + for (int i = 0; i < numDevices; ++i) + { + PaDeviceIndex deviceIndex = Pa_HostApiDeviceIndexToDeviceIndex(index, i); + + if (deviceIndex < 0) + { + throw PaException(deviceIndex); + } + + devices_[i] = &System::instance().deviceByIndex(deviceIndex); + } + } + catch (const std::exception &e) + { + // Delete any (partially) constructed objects (deconstructor isn't called): + delete[] devices_; // devices_ is either NULL or valid + + // Re-throw exception: + throw e; + } + } + + HostApi::~HostApi() + { + // Destroy devices array: + delete[] devices_; + } + + // ----------------------------------------------------------------------------------- + + PaHostApiTypeId HostApi::typeId() const + { + return info_->type; + } + + PaHostApiIndex HostApi::index() const + { + PaHostApiIndex index = Pa_HostApiTypeIdToHostApiIndex(typeId()); + + if (index < 0) + throw PaException(index); + + return index; + } + + const char *HostApi::name() const + { + return info_->name; + } + + int HostApi::deviceCount() const + { + return info_->deviceCount; + } + + // ----------------------------------------------------------------------------------- + + HostApi::DeviceIterator HostApi::devicesBegin() + { + DeviceIterator tmp; + tmp.ptr_ = &devices_[0]; // begin (first element) + return tmp; + } + + HostApi::DeviceIterator HostApi::devicesEnd() + { + DeviceIterator tmp; + tmp.ptr_ = &devices_[deviceCount()]; // end (one past last element) + return tmp; + } + + // ----------------------------------------------------------------------------------- + + Device &HostApi::defaultInputDevice() const + { + return System::instance().deviceByIndex(info_->defaultInputDevice); + } + + Device &HostApi::defaultOutputDevice() const + { + return System::instance().deviceByIndex(info_->defaultOutputDevice); + } + + // ----------------------------------------------------------------------------------- + + bool HostApi::operator==(const HostApi &rhs) const + { + return (typeId() == rhs.typeId()); + } + + bool HostApi::operator!=(const HostApi &rhs) const + { + return !(*this == rhs); + } + + // ----------------------------------------------------------------------------------- + +} // namespace portaudio diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/InterfaceCallbackStream.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/InterfaceCallbackStream.cxx new file mode 100644 index 000000000..09e02de67 --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/InterfaceCallbackStream.cxx @@ -0,0 +1,45 @@ +#include "portaudiocpp/InterfaceCallbackStream.hxx" + +#include "portaudiocpp/StreamParameters.hxx" +#include "portaudiocpp/Exception.hxx" +#include "portaudiocpp/CallbackInterface.hxx" + +namespace portaudio +{ + + // ---------------------------------------------------------------------------------== + + InterfaceCallbackStream::InterfaceCallbackStream() + { + } + + InterfaceCallbackStream::InterfaceCallbackStream(const StreamParameters ¶meters, CallbackInterface &instance) + { + open(parameters, instance); + } + + InterfaceCallbackStream::~InterfaceCallbackStream() + { + try + { + close(); + } + catch (...) + { + // ignore all errors + } + } + + // ---------------------------------------------------------------------------------== + + void InterfaceCallbackStream::open(const StreamParameters ¶meters, CallbackInterface &instance) + { + PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), + parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::callbackInterfaceToPaCallbackAdapter, static_cast(&instance)); + + if (err != paNoError) + { + throw PaException(err); + } + } +} diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/MemFunCallbackStream.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/MemFunCallbackStream.cxx new file mode 100644 index 000000000..113fe5a4d --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/MemFunCallbackStream.cxx @@ -0,0 +1,4 @@ +#include "portaudiocpp/MemFunCallbackStream.hxx" + +// (... template class ...) + diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/Stream.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/Stream.cxx new file mode 100644 index 000000000..3b21f0908 --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/Stream.cxx @@ -0,0 +1,195 @@ +#include "portaudiocpp/Stream.hxx" + +#include + +#include "portaudiocpp/Exception.hxx" +#include "portaudiocpp/System.hxx" + +namespace portaudio +{ + + // ----------------------------------------------------------------------------------- + + Stream::Stream() : stream_(NULL) + { + } + + Stream::~Stream() + { + // (can't call close here, + // the derived class should atleast call + // close() in it's deconstructor) + } + + // ----------------------------------------------------------------------------------- + + ////// + /// Closes the Stream if it's open, else does nothing. + ////// + void Stream::close() + { + if (isOpen() && System::exists()) + { + PaError err = Pa_CloseStream(stream_); + stream_ = NULL; + + if (err != paNoError) + throw PaException(err); + } + } + + ////// + /// Returns true if the Stream is open. + ////// + bool Stream::isOpen() const + { + return (stream_ != NULL); + } + + // ----------------------------------------------------------------------------------- + + void Stream::setStreamFinishedCallback(PaStreamFinishedCallback *callback) + { + PaError err = Pa_SetStreamFinishedCallback(stream_, callback); + + if (err != paNoError) + throw PaException(err); + } + + // ----------------------------------------------------------------------------------- + + void Stream::start() + { + PaError err = Pa_StartStream(stream_); + + if (err != paNoError) + throw PaException(err); + } + + void Stream::stop() + { + PaError err = Pa_StopStream(stream_); + + if (err != paNoError) + throw PaException(err); + } + + void Stream::abort() + { + PaError err = Pa_AbortStream(stream_); + + if (err != paNoError) + throw PaException(err); + } + + bool Stream::isStopped() const + { + PaError ret = Pa_IsStreamStopped(stream_); + + if (ret < 0) + throw PaException(ret); + + return (ret == 1); + } + + bool Stream::isActive() const + { + PaError ret = Pa_IsStreamActive(stream_); + + if (ret < 0) + throw PaException(ret); + + return (ret == 1); + } + + // ----------------------------------------------------------------------------------- + + ////// + /// Returns the best known input latency for the Stream. This value may differ from the + /// suggested input latency set in the StreamParameters. Includes all sources of + /// latency known to PortAudio such as internal buffering, and Host API reported latency. + /// Doesn't include any estimates of unknown latency. + ////// + PaTime Stream::inputLatency() const + { + const PaStreamInfo *info = Pa_GetStreamInfo(stream_); + if (info == NULL) + { + throw PaException(paInternalError); + return PaTime(0.0); + } + + return info->inputLatency; + } + + ////// + /// Returns the best known output latency for the Stream. This value may differ from the + /// suggested output latency set in the StreamParameters. Includes all sources of + /// latency known to PortAudio such as internal buffering, and Host API reported latency. + /// Doesn't include any estimates of unknown latency. + ////// + PaTime Stream::outputLatency() const + { + const PaStreamInfo *info = Pa_GetStreamInfo(stream_); + if (info == NULL) + { + throw PaException(paInternalError); + return PaTime(0.0); + } + + return info->outputLatency; + } + + ////// + /// Returns the sample rate of the Stream. Usually this will be the + /// best known estimate of the used sample rate. For instance when opening a + /// Stream setting 44100.0 Hz in the StreamParameters, the actual sample + /// rate might be something like 44103.2 Hz (due to imperfections in the + /// sound card hardware). + ////// + double Stream::sampleRate() const + { + const PaStreamInfo *info = Pa_GetStreamInfo(stream_); + if (info == NULL) + { + throw PaException(paInternalError); + return 0.0; + } + + return info->sampleRate; + } + + // ----------------------------------------------------------------------------------- + + PaTime Stream::time() const + { + return Pa_GetStreamTime(stream_); + } + + // ----------------------------------------------------------------------------------- + + ////// + /// Accessor (const) for PortAudio PaStream pointer, useful for interfacing with + /// PortAudio add-ons such as PortMixer for instance. Normally accessing this + /// pointer should not be needed as PortAudioCpp aims to provide all of PortAudio's + /// functionality. + ////// + const PaStream *Stream::paStream() const + { + return stream_; + } + + ////// + /// Accessor (non-const) for PortAudio PaStream pointer, useful for interfacing with + /// PortAudio add-ons such as PortMixer for instance. Normally accessing this + /// pointer should not be needed as PortAudioCpp aims to provide all of PortAudio's + /// functionality. + ////// + PaStream *Stream::paStream() + { + return stream_; + } + + // ----------------------------------------------------------------------------------- + +} // namespace portaudio diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/StreamParameters.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/StreamParameters.cxx new file mode 100644 index 000000000..670873bfd --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/StreamParameters.cxx @@ -0,0 +1,165 @@ +#include "portaudiocpp/StreamParameters.hxx" + +#include + +#include "portaudiocpp/Device.hxx" + +namespace portaudio +{ + // ----------------------------------------------------------------------------------- + + ////// + /// Default constructor; does nothing. + ////// + StreamParameters::StreamParameters() + { + } + + ////// + /// Sets up the all parameters needed to open either a half-duplex or full-duplex Stream. + /// + /// @param inputParameters The parameters for the input direction of the to-be opened + /// Stream or DirectionSpecificStreamParameters::null() for an output-only Stream. + /// @param outputParameters The parameters for the output direction of the to-be opened + /// Stream or DirectionSpecificStreamParameters::null() for an input-only Stream. + /// @param sampleRate The to-be opened Stream's sample rate in Hz. + /// @param framesPerBuffer The number of frames per buffer for a CallbackStream, or + /// the preferred buffer granularity for a BlockingStream. + /// @param flags The flags for the to-be opened Stream; default paNoFlag. + ////// + StreamParameters::StreamParameters(const DirectionSpecificStreamParameters &inputParameters, + const DirectionSpecificStreamParameters &outputParameters, double sampleRate, unsigned long framesPerBuffer, + PaStreamFlags flags) : inputParameters_(inputParameters), outputParameters_(outputParameters), + sampleRate_(sampleRate), framesPerBuffer_(framesPerBuffer), flags_(flags) + { + } + + // ----------------------------------------------------------------------------------- + + ////// + /// Sets the requested sample rate. If this sample rate isn't supported by the hardware, the + /// Stream will fail to open. The real-life sample rate used might differ slightly due to + /// imperfections in the sound card hardware; use Stream::sampleRate() to retreive the + /// best known estimate for this value. + ////// + void StreamParameters::setSampleRate(double sampleRate) + { + sampleRate_ = sampleRate; + } + + ////// + /// Either the number of frames per buffer for a CallbackStream, or + /// the preferred buffer granularity for a BlockingStream. See PortAudio + /// documentation. + ////// + void StreamParameters::setFramesPerBuffer(unsigned long framesPerBuffer) + { + framesPerBuffer_ = framesPerBuffer; + } + + ////// + /// Sets the specified flag or does nothing when the flag is already set. Doesn't + /// `unset' any previously existing flags (use clearFlags() for that). + ////// + void StreamParameters::setFlag(PaStreamFlags flag) + { + flags_ |= flag; + } + + ////// + /// Unsets the specified flag or does nothing if the flag isn't set. Doesn't affect + /// any other flags. + ////// + void StreamParameters::unsetFlag(PaStreamFlags flag) + { + flags_ &= ~flag; + } + + ////// + /// Clears or `unsets' all set flags. + ////// + void StreamParameters::clearFlags() + { + flags_ = paNoFlag; + } + + // ----------------------------------------------------------------------------------- + + void StreamParameters::setInputParameters(const DirectionSpecificStreamParameters ¶meters) + { + inputParameters_ = parameters; + } + + void StreamParameters::setOutputParameters(const DirectionSpecificStreamParameters ¶meters) + { + outputParameters_ = parameters; + } + + // ----------------------------------------------------------------------------------- + + bool StreamParameters::isSupported() const + { + return (Pa_IsFormatSupported(inputParameters_.paStreamParameters(), + outputParameters_.paStreamParameters(), sampleRate_) == paFormatIsSupported); + } + + // ----------------------------------------------------------------------------------- + + double StreamParameters::sampleRate() const + { + return sampleRate_; + } + + unsigned long StreamParameters::framesPerBuffer() const + { + return framesPerBuffer_; + } + + ////// + /// Returns all currently set flags as a binary combined + /// integer value (PaStreamFlags). Use isFlagSet() to + /// avoid dealing with the bitmasks. + ////// + PaStreamFlags StreamParameters::flags() const + { + return flags_; + } + + ////// + /// Returns true if the specified flag is currently set + /// or false if it isn't. + ////// + bool StreamParameters::isFlagSet(PaStreamFlags flag) const + { + return ((flags_ & flag) != 0); + } + + // ----------------------------------------------------------------------------------- + + DirectionSpecificStreamParameters &StreamParameters::inputParameters() + { + return inputParameters_; + } + + const DirectionSpecificStreamParameters &StreamParameters::inputParameters() const + { + return inputParameters_; + } + + DirectionSpecificStreamParameters &StreamParameters::outputParameters() + { + return outputParameters_; + } + + const DirectionSpecificStreamParameters &StreamParameters::outputParameters() const + { + return outputParameters_; + } + + // ----------------------------------------------------------------------------------- +} // namespace portaudio + + + + + diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/System.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/System.cxx new file mode 100644 index 000000000..692c7a10a --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/System.cxx @@ -0,0 +1,308 @@ +#include "portaudiocpp/System.hxx" + +#include +#include + +#include "portaudiocpp/HostApi.hxx" +#include "portaudiocpp/Device.hxx" +#include "portaudiocpp/Stream.hxx" +#include "portaudiocpp/Exception.hxx" +#include "portaudiocpp/SystemHostApiIterator.hxx" +#include "portaudiocpp/SystemDeviceIterator.hxx" + +namespace portaudio +{ + // ----------------------------------------------------------------------------------- + + // Static members: + System *System::instance_ = NULL; + int System::initCount_ = 0; + HostApi **System::hostApis_ = NULL; + Device **System::devices_ = NULL; + Device *System::nullDevice_ = NULL; + + // ----------------------------------------------------------------------------------- + + int System::version() + { + return Pa_GetVersion(); + } + + const char *System::versionText() + { + return Pa_GetVersionText(); + } + + void System::initialize() + { + ++initCount_; + + if (initCount_ == 1) + { + // Create singleton: + assert(instance_ == NULL); + instance_ = new System(); + + // Initialize the PortAudio system: + { + PaError err = Pa_Initialize(); + + if (err != paNoError) + throw PaException(err); + } + + // Create and populate device array: + { + int numDevices = instance().deviceCount(); + + devices_ = new Device*[numDevices]; + + for (int i = 0; i < numDevices; ++i) + devices_[i] = new Device(i); + } + + // Create and populate host api array: + { + int numHostApis = instance().hostApiCount(); + + hostApis_ = new HostApi*[numHostApis]; + + for (int i = 0; i < numHostApis; ++i) + hostApis_[i] = new HostApi(i); + } + + // Create null device: + nullDevice_ = new Device(paNoDevice); + } + } + + void System::terminate() + { + PaError err = paNoError; + + if (initCount_ == 1) + { + // Destroy null device: + delete nullDevice_; + + // Destroy host api array: + { + if (hostApis_ != NULL) + { + int numHostApis = instance().hostApiCount(); + + for (int i = 0; i < numHostApis; ++i) + delete hostApis_[i]; + + delete[] hostApis_; + hostApis_ = NULL; + } + } + + // Destroy device array: + { + if (devices_ != NULL) + { + int numDevices = instance().deviceCount(); + + for (int i = 0; i < numDevices; ++i) + delete devices_[i]; + + delete[] devices_; + devices_ = NULL; + } + } + + // Terminate the PortAudio system: + assert(instance_ != NULL); + err = Pa_Terminate(); + + // Destroy singleton: + delete instance_; + instance_ = NULL; + } + + if (initCount_ > 0) + --initCount_; + + if (err != paNoError) + throw PaException(err); + } + + + System &System::instance() + { + assert(exists()); + + return *instance_; + } + + bool System::exists() + { + return (instance_ != NULL); + } + + // ----------------------------------------------------------------------------------- + + System::HostApiIterator System::hostApisBegin() + { + System::HostApiIterator tmp; + tmp.ptr_ = &hostApis_[0]; // begin (first element) + return tmp; + } + + System::HostApiIterator System::hostApisEnd() + { + int count = hostApiCount(); + + System::HostApiIterator tmp; + tmp.ptr_ = &hostApis_[count]; // end (one past last element) + return tmp; + } + + HostApi &System::defaultHostApi() + { + PaHostApiIndex defaultHostApi = Pa_GetDefaultHostApi(); + + if (defaultHostApi < 0) + throw PaException(defaultHostApi); + + return *hostApis_[defaultHostApi]; + } + + HostApi &System::hostApiByTypeId(PaHostApiTypeId type) + { + PaHostApiIndex index = Pa_HostApiTypeIdToHostApiIndex(type); + + if (index < 0) + throw PaException(index); + + return *hostApis_[index]; + } + + HostApi &System::hostApiByIndex(PaHostApiIndex index) + { + if (index < 0 || index >= hostApiCount()) + throw PaException(paInternalError); + + return *hostApis_[index]; + } + + int System::hostApiCount() + { + PaHostApiIndex count = Pa_GetHostApiCount(); + + if (count < 0) + throw PaException(count); + + return count; + } + + // ----------------------------------------------------------------------------------- + + System::DeviceIterator System::devicesBegin() + { + DeviceIterator tmp; + tmp.ptr_ = &devices_[0]; + + return tmp; + } + + System::DeviceIterator System::devicesEnd() + { + int count = deviceCount(); + + DeviceIterator tmp; + tmp.ptr_ = &devices_[count]; + + return tmp; + } + + ////// + /// Returns the System's default input Device, or the null Device if none + /// was available. + ////// + Device &System::defaultInputDevice() + { + PaDeviceIndex index = Pa_GetDefaultInputDevice(); + return deviceByIndex(index); + } + + ////// + /// Returns the System's default output Device, or the null Device if none + /// was available. + ////// + Device &System::defaultOutputDevice() + { + PaDeviceIndex index = Pa_GetDefaultOutputDevice(); + return deviceByIndex(index); + } + + ////// + /// Returns the Device for the given index. + /// Will throw a paInternalError equivalent PaException if the given index + /// is out of range. + ////// + Device &System::deviceByIndex(PaDeviceIndex index) + { + if (index < -1 || index >= deviceCount()) + { + throw PaException(paInternalError); + } + + if (index == -1) + return System::instance().nullDevice(); + + return *devices_[index]; + } + + int System::deviceCount() + { + PaDeviceIndex count = Pa_GetDeviceCount(); + + if (count < 0) + throw PaException(count); + + return count; + } + + Device &System::nullDevice() + { + return *nullDevice_; + } + + // ----------------------------------------------------------------------------------- + + void System::sleep(long msec) + { + Pa_Sleep(msec); + } + + int System::sizeOfSample(PaSampleFormat format) + { + PaError err = Pa_GetSampleSize(format); + if (err < 0) + { + throw PaException(err); + return 0; + } + + return err; + } + + // ----------------------------------------------------------------------------------- + + System::System() + { + // (left blank intentionally) + } + + System::~System() + { + // (left blank intentionally) + } + + // ----------------------------------------------------------------------------------- + +} // namespace portaudio + diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx new file mode 100644 index 000000000..c3c00f70e --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx @@ -0,0 +1,60 @@ +#include "portaudiocpp/SystemDeviceIterator.hxx" + +namespace portaudio +{ + // ----------------------------------------------------------------------------------- + + Device &System::DeviceIterator::operator*() const + { + return **ptr_; + } + + Device *System::DeviceIterator::operator->() const + { + return &**this; + } + + // ----------------------------------------------------------------------------------- + + System::DeviceIterator &System::DeviceIterator::operator++() + { + ++ptr_; + return *this; + } + + System::DeviceIterator System::DeviceIterator::operator++(int) + { + System::DeviceIterator prev = *this; + ++*this; + return prev; + } + + System::DeviceIterator &System::DeviceIterator::operator--() + { + --ptr_; + return *this; + } + + System::DeviceIterator System::DeviceIterator::operator--(int) + { + System::DeviceIterator prev = *this; + --*this; + return prev; + } + + // ----------------------------------------------------------------------------------- + + bool System::DeviceIterator::operator==(const System::DeviceIterator &rhs) + { + return (ptr_ == rhs.ptr_); + } + + bool System::DeviceIterator::operator!=(const System::DeviceIterator &rhs) + { + return !(*this == rhs); + } + + // ----------------------------------------------------------------------------------- +} // namespace portaudio + + diff --git a/portaudio-v19/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx b/portaudio-v19/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx new file mode 100644 index 000000000..f34ca40c9 --- /dev/null +++ b/portaudio-v19/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx @@ -0,0 +1,59 @@ +#include "portaudiocpp/SystemHostApiIterator.hxx" + +namespace portaudio +{ + // ----------------------------------------------------------------------------------- + + HostApi &System::HostApiIterator::operator*() const + { + return **ptr_; + } + + HostApi *System::HostApiIterator::operator->() const + { + return &**this; + } + + // ----------------------------------------------------------------------------------- + + System::HostApiIterator &System::HostApiIterator::operator++() + { + ++ptr_; + return *this; + } + + System::HostApiIterator System::HostApiIterator::operator++(int) + { + System::HostApiIterator prev = *this; + ++*this; + return prev; + } + + System::HostApiIterator &System::HostApiIterator::operator--() + { + --ptr_; + return *this; + } + + System::HostApiIterator System::HostApiIterator::operator--(int) + { + System::HostApiIterator prev = *this; + --*this; + return prev; + } + + // ----------------------------------------------------------------------------------- + + bool System::HostApiIterator::operator==(const System::HostApiIterator &rhs) + { + return (ptr_ == rhs.ptr_); + } + + bool System::HostApiIterator::operator!=(const System::HostApiIterator &rhs) + { + return !(*this == rhs); + } + + // ----------------------------------------------------------------------------------- +} // namespace portaudio + diff --git a/portaudio-v19/depcomp b/portaudio-v19/depcomp new file mode 100755 index 000000000..04701da53 --- /dev/null +++ b/portaudio-v19/depcomp @@ -0,0 +1,530 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2005-07-09.11 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. + +# 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. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mecanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# 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/portaudio-v19/libtool b/portaudio-v19/libtool new file mode 100755 index 000000000..745ec3044 --- /dev/null +++ b/portaudio-v19/libtool @@ -0,0 +1,7930 @@ +#! /usr/local/bin/bash + +# libtoolT - Provide generalized library-building support services. +# Generated automatically by (GNU ) +# 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 , 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="/usr/bin/sed" + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="/usr/bin/sed -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags=" CXX F77" + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host night.db.net: + +# Shell to use when invoking shell scripts. +SHELL="/usr/local/bin/bash" + +# Whether or not to build shared libraries. +build_libtool_libs=yes + +# 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=i386-unknown-freebsd7.0 +host_os=freebsd7.0 + +# The build system. +build_alias= +build=i386-unknown-freebsd7.0 +build_os=freebsd7.0 + +# An echo program that does not interpret backslashes. +echo="echo" + +# The archiver. +AR="ar" +AR_FLAGS="cru" + +# A C compiler. +LTCC="gcc" + +# LTCC compiler flags. +LTCFLAGS="-g -O2" + +# A language-specific compiler. +CC="gcc" + +# Is the compiler the GNU C compiler? +with_gcc=yes + +# An ERE matcher. +EGREP="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_cmds='.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=196608 + +# 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=unknown + +# Whether dlopen of programs is supported. +dlopen_self=unknown + +# 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=freebsd-elf + +# 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} \$libname\${shared_ext}" + +# The coded name of the library, if different from the real name. +soname_spec="" + +# 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="chmod 644 \$oldlib~\$RANLIB \$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 \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" +archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${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="" + +# 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/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/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=yes + +# 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_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=" /usr/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, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 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. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# define SED for historic ltconfig's generated by Libtool 1.3 +test -z "$SED" && SED=sed + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + +# 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 +# Same for EGREP, and just to be sure, do LTCC as well +if test "X$EGREP" = X ; then + EGREP=egrep +fi +if test "X$LTCC" = X ; then + LTCC=${CC-gcc} +fi + +# 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 "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +if test -z "$max_cmd_len"; then + i=0 + testring="ABCD" + new_result= + + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + 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. + max_cmd_len=`expr $max_cmd_len \/ 2` +fi + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# 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. +func_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 | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + 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 +} + + +# func_infer_tag arg +# 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. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ 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` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # 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$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + # user sometimes does CC=-gcc so we need to match that to 'gcc' + trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"` + # and sometimes libtool has CC=-gcc but user does CC=gcc + extendcc=${host}-${CC} + # and sometimes libtool has CC=-gcc but user has CC=-gcc + # (Gentoo-specific hack because we always export $CHOST) + mungedcc=${CHOST-${host}}-${trimedcc} + case "$@ " in + "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\ + "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*) + tagname=CC + break ;; + "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\ + "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\ + "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\ + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # 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 $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# 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" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + 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$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + 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) 2005 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 $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # 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" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --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 $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# 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 $EXIT_FAILURE + 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_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + 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 $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=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, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them 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 $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # 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 $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE" 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 $EXIT_FAILURE" 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 "$srcfile" "$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 $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $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 </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 $EXIT_FAILURE + 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 <> ${libobj}T </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 $EXIT_FAILURE + 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 <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + fi + build_libtool_libs=no + build_old_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" + 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 $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$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 $EXIT_FAILURE + 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 + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + ;; + 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 + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + 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 $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + 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 + absdir="$dir" + notinst_path="$notinst_path $dir" + 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*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # 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 -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -pg pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) + + # 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" + compiler_flags="$compiler_flags $arg" + 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 ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -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 $EXIT_FAILURE + ;; + 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 + ;; + + # 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 + ;; + + *.$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 $EXIT_FAILURE + 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 + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + 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 $EXIT_FAILURE + 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 + ;; + 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 $EXIT_FAILURE + 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 + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $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 $EXIT_FAILURE + ;; + *.$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 duplications 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 + 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 $EXIT_FAILURE + ;; + 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 + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + 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 $std_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 + -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" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $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) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; 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' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 + avoidtemprpath= + + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + 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" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + 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" + tmp_libs= + for deplib in $dependency_libs; do + 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 + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + 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 $EXIT_FAILURE + 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" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + 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 + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_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='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) 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 | + $EGREP ": [^:]* 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="$add_dir -L$inst_prefix_dir$libdir" + ;; + 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 $EXIT_FAILURE + 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="$add_dir -L$inst_prefix_dir$libdir" + ;; + 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 + 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 $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $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 + fi + path="" + ;; + *) + 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 + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + 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_cmds\" + 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 $EXIT_FAILURE + 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_cmds\" + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + 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 $EXIT_FAILURE + 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="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$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 $EXIT_FAILURE + ;; + 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) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + 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 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 -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # 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 </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 + # It is ok to link against an archive when + # building a shared library. + if $AR -t $potlib > /dev/null 2>&1; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + 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 / -framework System /'` + ;; + 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 + # Done checking deplibs! + deplibs=$newdeplibs + fi + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # 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 && 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_cmds\" + 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" + linknames= + 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 + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + 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=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + 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 + + # 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 test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + 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 + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # 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/$output_la-${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" : ".*" 2>/dev/null` && + 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/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${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 reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${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 "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + 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" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_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 $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + 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 $EXIT_FAILURE + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + 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" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + 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 $EXIT_SUCCESS + 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" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + ;; + + 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 / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + 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 + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + 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*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + 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/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + 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 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. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + 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 $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -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. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + else + 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}%"` + fi + ;; + * ) + 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}%"` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + 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 + + 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" + exit_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 $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 $EXIT_SUCCESS + 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 $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --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 + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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 '/' +# define PATH_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 +# ifndef PATH_SEPARATOR_2 +# define PATH_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 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(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 (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* 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; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +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 +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +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 $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 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. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +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 $EXIT_FAILURE + 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. + + # Make sure env LD_LIBRARY_PATH does not mess us up + if test -n \"\${LD_LIBRARY_PATH+set}\"; then + export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH + fi +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + 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 + + # 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" : ".*" 2>/dev/null` && + 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 + eval cmd=\"$cmd\" + 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 $progpath $preserve_args --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 $EXIT_FAILURE + fi + if test "X$EGREP" = X ; then + EGREP=egrep + fi + # We do not want portage's install root ($D) present. Check only for + # this if the .la is being installed. + if test "$installed" = yes && test "$D"; then + eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + else + mynewdependency_lib="$libdir/$name" + fi + # Do not add duplicates + if test "$mynewdependency_lib"; then + my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` + if test -z "$my_little_ninja_foo_1"; then + newdependency_libs="$newdependency_libs $mynewdependency_lib" + fi + fi + ;; + *) + if test "$installed" = yes; then + # Rather use S=WORKDIR if our version of portage supports it. + # This is because some ebuild (gcc) do not use $S as buildroot. + if test "$PWORKDIR"; then + S="$PWORKDIR" + fi + # We do not want portage's build root ($S) present. + my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"` + # We do not want portage's install root ($D) present. + my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"` + if test -n "$my_little_ninja_foo_2" && test "$S"; then + mynewdependency_lib="" + elif test -n "$my_little_ninja_foo_3" && test "$D"; then + eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + else + mynewdependency_lib="$deplib" + fi + else + mynewdependency_lib="$deplib" + fi + # Do not add duplicates + if test "$mynewdependency_lib"; then + my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` + if test -z "$my_little_ninja_foo_4"; then + newdependency_libs="$newdependency_libs $mynewdependency_lib" + fi + fi + ;; + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + 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 + # Do not add duplicates + if test "$installed" = yes && test "$D"; then + install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + fi + $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; 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 $EXIT_SUCCESS + ;; + + # 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" | 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) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -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 $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + ;; + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_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 $EXIT_FAILURE + ;; + 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 $EXIT_SUCCESS + ;; + + *) + # 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= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + 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 $EXIT_FAILURE + 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= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + 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 anyway + 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 "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + 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. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $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 "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_SUCCESS + 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 $EXIT_FAILURE + 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" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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. + ;; + esac + 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 $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +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 ." + exit $EXIT_SUCCESS + ;; + +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 + -precious-files-regex REGEX + don't remove output files matching REGEX + -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 $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# 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 +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### 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 night.db.net: + +# Shell to use when invoking shell scripts. +SHELL="/usr/local/bin/bash" + +# Whether or not to build shared libraries. +build_libtool_libs=yes + +# 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=i386-unknown-freebsd7.0 +host_os=freebsd7.0 + +# The build system. +build_alias= +build=i386-unknown-freebsd7.0 +build_os=freebsd7.0 + +# An echo program that does not interpret backslashes. +echo="echo" + +# The archiver. +AR="ar" +AR_FLAGS="cru" + +# A C compiler. +LTCC="gcc" + +# LTCC compiler flags. +LTCFLAGS="-g -O2" + +# A language-specific compiler. +CC="g++" + +# Is the compiler the GNU C compiler? +with_gcc=yes + +# An ERE matcher. +EGREP="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_cmds='.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=196608 + +# 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=unknown + +# Whether dlopen of programs is supported. +dlopen_self=unknown + +# 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=freebsd-elf + +# 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} \$libname\${shared_ext}" + +# The coded name of the library, if different from the real name. +soname_spec="" + +# 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="chmod 644 \$oldlib~\$RANLIB \$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 \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" +archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${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/crti.o /usr/lib/crtbeginS.o" + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects="/usr/lib/crtendS.o /usr/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_pic -lgcc_pic" + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path="-L/usr/lib" + +# 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="" + +# 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/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/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=yes + +# 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_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=" /usr/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 + +# ### BEGIN LIBTOOL TAG CONFIG: F77 + +# Libtool was configured on host night.db.net: + +# Shell to use when invoking shell scripts. +SHELL="/usr/local/bin/bash" + +# Whether or not to build shared libraries. +build_libtool_libs=yes + +# 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=i386-unknown-freebsd7.0 +host_os=freebsd7.0 + +# The build system. +build_alias= +build=i386-unknown-freebsd7.0 +build_os=freebsd7.0 + +# An echo program that does not interpret backslashes. +echo="echo" + +# The archiver. +AR="ar" +AR_FLAGS="cru" + +# A C compiler. +LTCC="gcc" + +# LTCC compiler flags. +LTCFLAGS="-g -O2" + +# A language-specific compiler. +CC="f77" + +# Is the compiler the GNU C compiler? +with_gcc=yes + +# An ERE matcher. +EGREP="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_cmds='.so' + +# Executable file suffix (normally ""). +exeext="" + +# Additional compiler flags for building library objects. +pic_flag=" -fPIC" +pic_mode=default + +# What is the maximum length of a command? +max_cmd_len=196608 + +# 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=unknown + +# Whether dlopen of programs is supported. +dlopen_self=unknown + +# 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="" + +# 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=freebsd-elf + +# 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} \$libname\${shared_ext}" + +# The coded name of the library, if different from the real name. +soname_spec="" + +# 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="chmod 644 \$oldlib~\$RANLIB \$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 \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" +archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${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="" + +# 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/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/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=yes + +# 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_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=" /usr/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 TAG CONFIG: F77 + diff --git a/portaudio-v19/ltmain.sh b/portaudio-v19/ltmain.sh new file mode 100644 index 000000000..8f7a6ac10 --- /dev/null +++ b/portaudio-v19/ltmain.sh @@ -0,0 +1,6971 @@ +# 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, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 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. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# define SED for historic ltconfig's generated by Libtool 1.3 +test -z "$SED" && SED=sed + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + +# 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 +# Same for EGREP, and just to be sure, do LTCC as well +if test "X$EGREP" = X ; then + EGREP=egrep +fi +if test "X$LTCC" = X ; then + LTCC=${CC-gcc} +fi + +# 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 "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +if test -z "$max_cmd_len"; then + i=0 + testring="ABCD" + new_result= + + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + 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. + max_cmd_len=`expr $max_cmd_len \/ 2` +fi + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# 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. +func_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 | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + 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 +} + + +# func_infer_tag arg +# 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. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ 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` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # 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$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + # user sometimes does CC=-gcc so we need to match that to 'gcc' + trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"` + # and sometimes libtool has CC=-gcc but user does CC=gcc + extendcc=${host}-${CC} + # and sometimes libtool has CC=-gcc but user has CC=-gcc + # (Gentoo-specific hack because we always export $CHOST) + mungedcc=${CHOST-${host}}-${trimedcc} + case "$@ " in + "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\ + "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*) + tagname=CC + break ;; + "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\ + "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\ + "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\ + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # 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 $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# 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" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + 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$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + 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) 2005 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 $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # 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" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --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 $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# 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 $EXIT_FAILURE + 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_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + 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 $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=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, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them 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 $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # 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 $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE" 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 $EXIT_FAILURE" 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 "$srcfile" "$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 $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $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 </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 $EXIT_FAILURE + 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 <> ${libobj}T </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 $EXIT_FAILURE + 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 <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + fi + build_libtool_libs=no + build_old_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" + 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 $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$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 $EXIT_FAILURE + 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 + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + ;; + 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 + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + 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 $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + 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 + absdir="$dir" + notinst_path="$notinst_path $dir" + 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*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # 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 -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -pg pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) + + # 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" + compiler_flags="$compiler_flags $arg" + 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 ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -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 $EXIT_FAILURE + ;; + 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 + ;; + + # 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 + ;; + + *.$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 $EXIT_FAILURE + 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 + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + 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 $EXIT_FAILURE + 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 + ;; + 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 $EXIT_FAILURE + 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 + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $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 $EXIT_FAILURE + ;; + *.$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 duplications 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 + 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 $EXIT_FAILURE + ;; + 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 + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + 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 $std_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 + -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" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $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) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; 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' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 + avoidtemprpath= + + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + 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" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + 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" + tmp_libs= + for deplib in $dependency_libs; do + 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 + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + 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 $EXIT_FAILURE + 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" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + 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 + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_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='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) 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 | + $EGREP ": [^:]* 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="$add_dir -L$inst_prefix_dir$libdir" + ;; + 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 $EXIT_FAILURE + 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="$add_dir -L$inst_prefix_dir$libdir" + ;; + 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 + 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 $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $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 + fi + path="" + ;; + *) + 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 + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + 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_cmds\" + 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 $EXIT_FAILURE + 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_cmds\" + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + 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 $EXIT_FAILURE + 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="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$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 $EXIT_FAILURE + ;; + 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) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + 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 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 -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # 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 </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 + # It is ok to link against an archive when + # building a shared library. + if $AR -t $potlib > /dev/null 2>&1; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + 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 / -framework System /'` + ;; + 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 + # Done checking deplibs! + deplibs=$newdeplibs + fi + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # 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 && 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_cmds\" + 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" + linknames= + 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 + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + 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=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + 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 + + # 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 test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + 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 + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # 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/$output_la-${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" : ".*" 2>/dev/null` && + 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/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${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 reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${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 "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + 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" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_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 $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + 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 $EXIT_FAILURE + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + 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" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + 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 $EXIT_SUCCESS + 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" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + ;; + + 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 / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + 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 + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + 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*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + 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/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + 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 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. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + 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 $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -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. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + else + 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}%"` + fi + ;; + * ) + 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}%"` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + 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 + + 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" + exit_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 $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 $EXIT_SUCCESS + 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 $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --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 + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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 '/' +# define PATH_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 +# ifndef PATH_SEPARATOR_2 +# define PATH_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 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(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 (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* 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; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +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 +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +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 $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 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. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +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 $EXIT_FAILURE + 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. + + # Make sure env LD_LIBRARY_PATH does not mess us up + if test -n \"\${LD_LIBRARY_PATH+set}\"; then + export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH + fi +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + 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 + + # 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" : ".*" 2>/dev/null` && + 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 + eval cmd=\"$cmd\" + 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 $progpath $preserve_args --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 $EXIT_FAILURE + fi + if test "X$EGREP" = X ; then + EGREP=egrep + fi + # We do not want portage's install root ($D) present. Check only for + # this if the .la is being installed. + if test "$installed" = yes && test "$D"; then + eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + else + mynewdependency_lib="$libdir/$name" + fi + # Do not add duplicates + if test "$mynewdependency_lib"; then + my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` + if test -z "$my_little_ninja_foo_1"; then + newdependency_libs="$newdependency_libs $mynewdependency_lib" + fi + fi + ;; + *) + if test "$installed" = yes; then + # Rather use S=WORKDIR if our version of portage supports it. + # This is because some ebuild (gcc) do not use $S as buildroot. + if test "$PWORKDIR"; then + S="$PWORKDIR" + fi + # We do not want portage's build root ($S) present. + my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"` + # We do not want portage's install root ($D) present. + my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"` + if test -n "$my_little_ninja_foo_2" && test "$S"; then + mynewdependency_lib="" + elif test -n "$my_little_ninja_foo_3" && test "$D"; then + eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + else + mynewdependency_lib="$deplib" + fi + else + mynewdependency_lib="$deplib" + fi + # Do not add duplicates + if test "$mynewdependency_lib"; then + my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` + if test -z "$my_little_ninja_foo_4"; then + newdependency_libs="$newdependency_libs $mynewdependency_lib" + fi + fi + ;; + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + 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 + # Do not add duplicates + if test "$installed" = yes && test "$D"; then + install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + fi + $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; 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 $EXIT_SUCCESS + ;; + + # 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" | 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) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -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 $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + ;; + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_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 $EXIT_FAILURE + ;; + 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 $EXIT_SUCCESS + ;; + + *) + # 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= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + 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 $EXIT_FAILURE + 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= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + 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 anyway + 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 "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + 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. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $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 "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_SUCCESS + 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 $EXIT_FAILURE + 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" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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. + ;; + esac + 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 $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +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 ." + exit $EXIT_SUCCESS + ;; + +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 + -precious-files-regex REGEX + don't remove output files matching REGEX + -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 $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# 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 +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/portaudio-v19/missing b/portaudio-v19/missing new file mode 100755 index 000000000..894e786e1 --- /dev/null +++ b/portaudio-v19/missing @@ -0,0 +1,360 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-06-08.21 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 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., 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. + +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 ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + 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." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + 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/portaudio-v19/portaudio-2.0.pc.in b/portaudio-v19/portaudio-2.0.pc.in new file mode 100644 index 000000000..f5c196913 --- /dev/null +++ b/portaudio-v19/portaudio-2.0.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: PortAudio +Description: Portable audio I/O +Requires: +Version: 19 + +Libs: -L${libdir} -lportaudio @LIBS@ +Cflags: -I${includedir} @THREAD_CFLAGS@ diff --git a/portaudio-v19/test/README.txt b/portaudio-v19/test/README.txt new file mode 100644 index 000000000..f3a0b8226 --- /dev/null +++ b/portaudio-v19/test/README.txt @@ -0,0 +1,60 @@ +This directory contains various programs to test PortAudio. The files +named patest_* are tests, the files named debug_* are just scratch +files that may or may not work. + +All following tests are up to date with the V19 API. They should all compile +(without any warnings on GCC 3.3). Note that this does not necissarily mean that +the tests pass, just that they compile. + + x- paqa_devs.c + x- paqa_errs.c (needs reviewing) + x- patest1.c + x- patest_buffer.c + x- patest_callbackstop.c + x- patest_clip.c (last test fails, dither doesn't currently force clip in V19) + x- patest_dither.c + x- patest_hang.c + x- patest_latency.c + x- patest_leftright.c + x- patest_longsine.c + x- patest_many.c + x- patest_maxsines.c + o- patest_mono.c + x- patest_multi_sine.c + x- patest_pink.c + x- patest_prime.c + x- patest_read_record.c + x- patest_record.c + x- patest_ringmix.c + x- patest_saw.c + x- patest_sine.c + x- patest_sine8.c + x- patest_sine_formats.c + x- patest_sine_time.c + x- patest_start_stop.c + x- patest_stop.c + x- patest_sync.c + x- patest_toomanysines.c + o- patest_two_rates.c + x- patest_underflow.c + x- patest_wire.c + x- patest_write_sine.c + x- pa_devs.c + x- pa_fuzz.c + x- pa_minlat.c + +The debug_ files are still in V18 format and may need some V19 adaption. +Feel free to fix them, most simply require adjusting to the new API. + +o- pa_tests/debug_convert.c +o- pa_tests/debug_dither_calc.c +o- pa_tests/debug_dual.c +o- pa_tests/debug_multi_in.c +o- pa_tests/debug_multi_out.c +o- pa_tests/debug_record.c +o- pa_tests/debug_record_reuse.c +o- pa_tests/debug_sine.c +o- pa_tests/debug_sine_amp.c +o- pa_tests/debug_sine_formats.c +o- pa_tests/debug_srate.c +o- pa_tests/debug_test1.c diff --git a/portaudio-v19/test/debug_convert.c b/portaudio-v19/test/debug_convert.c new file mode 100644 index 000000000..a17b556e4 --- /dev/null +++ b/portaudio-v19/test/debug_convert.c @@ -0,0 +1,131 @@ +/* + * $Id$ + * Convert tagged values. + * + * Author: Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +//#define OUTPUT_DEVICE (11) +#define NUM_SECONDS (8) +#define SLEEP_DUR (800) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) + +#define NUM_BUFFERS (0) + +typedef struct +{ + unsigned int framesToGo; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + short *out = (short*)outputBuffer; + int i; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + if( data->framesToGo < framesPerBuffer ) finished = 1; + + for( i=0; i +#include +#include "portaudio.h" +#include "pa_host.h" + +/*******************************************************************/ +int main(void); +int main(void) +{ + long max,min; + int i; + + for( i=0; i<10000; i++ ) + { + long dither = PaConvert_TriangularDither(); + // printf("dither = 0x%08X\n", dither ); + if( dither < min ) min = dither; + else if( dither > max ) max = dither; + } + printf("min = 0x%08X = %d, max = 0x%08X = %d\n", min, min, max, max ); +} diff --git a/portaudio-v19/test/debug_dual.c b/portaudio-v19/test/debug_dual.c new file mode 100644 index 000000000..35ba032d0 --- /dev/null +++ b/portaudio-v19/test/debug_dual.c @@ -0,0 +1,183 @@ +/* + * $Id$ + * debug_dual.c + * Try to open TWO streams on separate cards. + * Play a sine sweep using the Portable Audio api for several seconds. + * Hacked test for debugging PA. + * + * Author: Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#define DEV_ID_1 (13) +#define DEV_ID_2 (15) +#define NUM_SECONDS (8) +#define SLEEP_DUR (800) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#if 0 +#define MIN_LATENCY_MSEC (200) +#define NUM_BUFFERS ((MIN_LATENCY_MSEC * SAMPLE_RATE) / (FRAMES_PER_BUFFER * 1000)) +#else +#define NUM_BUFFERS (0) +#endif +#define MIN_FREQ (100.0f) +#define MAX_FREQ (4000.0f) +#define FREQ_SCALAR (1.00002f) +#define CalcPhaseIncrement(freq) (freq/SAMPLE_RATE) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (400) +typedef struct +{ + float sine[TABLE_SIZE + 1]; // add one for guard point for interpolation + float phase_increment; + float left_phase; + float right_phase; +} +paTestData; +/* Convert phase between and 1.0 to sine value + * using linear interpolation. + */ +float LookupSine( paTestData *data, float phase ); +float LookupSine( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->sine[index]; + float hi = data->sine[index+1]; + float val = lo + fract*(hi-lo); + return val; +} +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + + for( i=0; ileft_phase); /* left */ + *out++ = LookupSine(data, data->right_phase); /* right */ + data->left_phase += data->phase_increment; + if( data->left_phase >= 1.0f ) data->left_phase -= 1.0f; + data->right_phase += (data->phase_increment * 1.5f); /* fifth above */ + if( data->right_phase >= 1.0f ) data->right_phase -= 1.0f; + /* sweep frequency then start over. */ + data->phase_increment *= FREQ_SCALAR; + if( data->phase_increment > CalcPhaseIncrement(MAX_FREQ) ) data->phase_increment = CalcPhaseIncrement(MIN_FREQ); + } + return 0; +} + +PaError TestStart( PortAudioStream **streamPtr, PaDeviceID devID, + paTestData *data ); +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream1, *stream2; + PaError err; + paTestData DATA1, DATA2; + printf("PortAudio Test: DUAL sine sweep. ask for %d buffers\n", NUM_BUFFERS ); + err = Pa_Initialize(); + if( err != paNoError ) goto error; + err = TestStart( &stream1, DEV_ID_1, &DATA1 ); + if( err != paNoError ) goto error; + err = TestStart( &stream2, DEV_ID_2, &DATA2 ); + if( err != paNoError ) goto error; + printf("Hit ENTER\n"); + getchar(); + err = Pa_StopStream( stream1 ); + if( err != paNoError ) goto error; + err = Pa_StopStream( stream2 ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} +PaError TestStart( PortAudioStream **streamPtr, PaDeviceID devID, paTestData *data ) +{ + PortAudioStream *stream; + PaError err; + int i; + /* initialise sinusoidal wavetable */ + for( i=0; isine[i] = (float) sin( ((double)i/(double)TABLE_SIZE) * M_PI * 2. ); + } + data->sine[TABLE_SIZE] = data->sine[0]; // set guard point + data->left_phase = data->right_phase = 0.0; + data->phase_increment = CalcPhaseIncrement(MIN_FREQ); + printf("PortAudio Test: output device = %d\n", devID ); + err = Pa_OpenStream( + &stream, + paNoDevice, + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + devID, + 2, /* stereo output */ + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + NUM_BUFFERS, /* number of buffers, if zero then use default minimum */ + paClipOff|paDitherOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + *streamPtr = stream; + return 0; +error: + return err; +} diff --git a/portaudio-v19/test/debug_multi_in.c b/portaudio-v19/test/debug_multi_in.c new file mode 100644 index 000000000..def729c1b --- /dev/null +++ b/portaudio-v19/test/debug_multi_in.c @@ -0,0 +1,179 @@ +/* + * $Id$ + * debug_multi_in.c + * Pass output from each of multiple channels + * to a stereo output using the Portable Audio api. + * Hacked test for debugging PA. + * + * Author: Phil Burk http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +//#define INPUT_DEVICE_NAME ("EWS88 MT Interleaved Rec") +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +//#define OUTPUT_DEVICE (18) +#define SAMPLE_RATE (22050) +#define FRAMES_PER_BUFFER (256) +#define MIN_LATENCY_MSEC (400) +#define NUM_BUFFERS ((MIN_LATENCY_MSEC * SAMPLE_RATE) / (FRAMES_PER_BUFFER * 1000)) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +typedef struct +{ + int liveChannel; + int numChannels; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float *in = (float*)inputBuffer; + int i; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + if( in == NULL ) return 0; + for( i=0; i<(int)framesPerBuffer; i++ ) + { + /* Copy one channel of input to output. */ + *out++ = in[data->liveChannel]; + *out++ = in[data->liveChannel]; + in += data->numChannels; + } + return 0; +} +/*******************************************************************/ +int PaFindDeviceByName( const char *name ) +{ + int i; + int numDevices; + const PaDeviceInfo *pdi; + int len = strlen( name ); + PaDeviceID result = paNoDevice; + numDevices = Pa_CountDevices(); + for( i=0; iname, len ) == 0 ) + { + result = i; + break; + } + } + return result; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream; + PaError err; + paTestData data; + int i; + PaDeviceID inputDevice; + const PaDeviceInfo *pdi; + printf("PortAudio Test: input signal from each channel. %d buffers\n", NUM_BUFFERS ); + data.liveChannel = 0; + err = Pa_Initialize(); + if( err != paNoError ) goto error; +#ifdef INPUT_DEVICE_NAME + printf("Try to use device: %s\n", INPUT_DEVICE_NAME ); + inputDevice = PaFindDeviceByName(INPUT_DEVICE_NAME); + if( inputDevice == paNoDevice ) + { + printf("Could not find %s. Using default instead.\n", INPUT_DEVICE_NAME ); + inputDevice = Pa_GetDefaultInputDeviceID(); + } +#else + printf("Using default input device.\n"); + inputDevice = Pa_GetDefaultInputDeviceID(); +#endif + pdi = Pa_GetDeviceInfo( inputDevice ); + if( pdi == NULL ) + { + printf("Could not get device info!\n"); + goto error; + } + data.numChannels = pdi->maxInputChannels; + printf("Input Device name is %s\n", pdi->name ); + printf("Input Device has %d channels.\n", pdi->maxInputChannels); + err = Pa_OpenStream( + &stream, + inputDevice, + pdi->maxInputChannels, + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + 2, + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + NUM_BUFFERS, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + data.liveChannel = 0; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + for( i=0; i +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#define FREQ_INCR (300.0 / SAMPLE_RATE) +#define MAX_CHANNELS (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ + int numChannels; + double phases[MAX_CHANNELS]; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int frameIndex, channelIndex; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + for( channelIndex=0; channelIndexnumChannels; channelIndex++ ) + { + /* Output sine wave on every channel. */ + *out++ = (float) sin(data->phases[channelIndex]); + + /* Play each channel at a higher frequency. */ + data->phases[channelIndex] += FREQ_INCR * (4 + channelIndex); + if( data->phases[channelIndex] >= (2.0 * M_PI) ) data->phases[channelIndex] -= (2.0 * M_PI); + } + } + + return 0; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream; + PaError err; + const PaDeviceInfo *pdi; + paTestData data = {0}; + printf("PortAudio Test: output sine wave on each channel.\n" ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + pdi = Pa_GetDeviceInfo( OUTPUT_DEVICE ); + data.numChannels = pdi->maxOutputChannels; + if( data.numChannels > MAX_CHANNELS ) data.numChannels = MAX_CHANNELS; + printf("Number of Channels = %d\n", data.numChannels ); + + err = Pa_OpenStream( + &stream, + paNoDevice, /* default input device */ + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + data.numChannels, + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Hit ENTER to stop sound.\n"); + fflush(stdout); + getchar(); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + Pa_CloseStream( stream ); + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/debug_record.c b/portaudio-v19/test/debug_record.c new file mode 100644 index 000000000..57b11f581 --- /dev/null +++ b/portaudio-v19/test/debug_record.c @@ -0,0 +1,339 @@ +/* + * $Id$ + * debug_record.c + * Record input into an array. + * Save array to a file. + * Based on patest_record.c but with various ugly debug hacks thrown in. + * + * Author: Phil Burk http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +#define SAMPLE_RATE (22050) +#define NUM_SECONDS (10) +#define SLEEP_DUR_MSEC (200) +#define FRAMES_PER_BUFFER (1<<10) +#define NUM_REC_BUFS (0) + +#if 1 +#define PA_SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#else +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#endif + +typedef struct +{ + long frameIndex; /* Index into sample array. */ + long maxFrameIndex; + long samplesPerFrame; + long numSamples; + SAMPLE *recordedSamples; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int recordCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = (SAMPLE*)inputBuffer; + SAMPLE *wptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; + long framesToCalc; + unsigned long i; + int finished; + unsigned long framesLeft = data->maxFrameIndex - data->frameIndex; + + (void) outputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( framesLeft < framesPerBuffer ) + { + framesToCalc = framesLeft; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + finished = 0; + } + if( inputBuffer == NULL ) + { + for( i=0; iframeIndex += framesToCalc; + return finished; +} +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int playCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; + SAMPLE *wptr = (SAMPLE*)outputBuffer; + unsigned long i; + int finished; + unsigned int framesLeft = data->maxFrameIndex - data->frameIndex; + if( outputBuffer == NULL ) return 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( framesLeft < framesPerBuffer ) + { + /* final buffer... */ + for( i=0; iframeIndex += framesLeft; + finished = 1; + } + else + { + for( i=0; iframeIndex += framesPerBuffer; + finished = 0; + } + return finished; +} + +/****************************************************************/ +PaError TestRecording( paTestData *dataPtr ) +{ + PortAudioStream *stream; + PaError err; + int i; + + /* Record some audio. */ + err = Pa_OpenStream( + &stream, + Pa_GetDefaultInputDeviceID(), + dataPtr->samplesPerFrame, /* stereo input */ + PA_SAMPLE_TYPE, + NULL, + paNoDevice, + 0, + PA_SAMPLE_TYPE, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + NUM_REC_BUFS, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + recordCallback, + dataPtr ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Now recording!\n"); fflush(stdout); + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + if( Pa_StreamActive( stream ) <= 0) + { + printf("Stream inactive!\n"); + break; + } + if( dataPtr->maxFrameIndex <= dataPtr->frameIndex ) + { + printf("Buffer recording complete.\n"); + break; + } + Pa_Sleep(100); + printf("index = %d\n", dataPtr->frameIndex ); fflush(stdout); + } + + printf("Finished loop. Close stream.\n"); fflush(stdout); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + printf("Done.\n"); fflush(stdout); + { + SAMPLE max = 0; + SAMPLE posVal; + int i; + for( i=0; inumSamples; i++ ) + { + posVal = dataPtr->recordedSamples[i]; + if( posVal < 0 ) posVal = -posVal; + if( posVal > max ) max = posVal; + } + printf("Largest recorded sample = %d\n", max ); + } + /* Write recorded data to a file. */ +#if 0 + { + FILE *fid; + fid = fopen("recorded.raw", "wb"); + if( fid == NULL ) + { + printf("Could not open file."); + } + else + { + fwrite( dataPtr->recordedSamples, dataPtr->samplesPerFrame * sizeof(SAMPLE), totalFrames, fid ); + fclose( fid ); + printf("Wrote data to 'recorded.raw'\n"); + } + } +#endif + +error: + return err; +} + +/****************************************************************/ +PaError TestPlayback( paTestData *dataPtr ) +{ + PortAudioStream *stream; + PaError err; + int i; + + /* Playback recorded data. */ + dataPtr->frameIndex = 0; + printf("Begin playback.\n"); fflush(stdout); + err = Pa_OpenStream( + &stream, + paNoDevice, + 0, /* NO input */ + PA_SAMPLE_TYPE, + NULL, + Pa_GetDefaultOutputDeviceID(), + dataPtr->samplesPerFrame, /* stereo output */ + PA_SAMPLE_TYPE, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + playCallback, + dataPtr ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Waiting for playback to finish.\n"); fflush(stdout); + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + Pa_Sleep(100); + printf("index = %d\n", dataPtr->frameIndex ); + } + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + +error: + return err; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData data; + long totalFrames; + long numBytes; + long i; + printf("patest_record.c\n"); fflush(stdout); + + data.frameIndex = 0; + data.samplesPerFrame = 2; + data.maxFrameIndex = totalFrames = NUM_SECONDS*SAMPLE_RATE; + + printf("totalFrames = %d\n", totalFrames ); fflush(stdout); + data.numSamples = totalFrames * data.samplesPerFrame; + + numBytes = data.numSamples * sizeof(SAMPLE); + data.recordedSamples = (SAMPLE *) malloc( numBytes ); + if( data.recordedSamples == NULL ) + { + printf("Could not allocate record array.\n"); + exit(1); + } + for( i=0; i +#include +#include +#include "portaudio.h" +#define SAMPLE_RATE (22050) +#define NUM_SECONDS (4) +#define SLEEP_DUR_MSEC (200) +#define FRAMES_PER_BUFFER (256) +#define NUM_REC_BUFS (0) + +#if 1 +#define PA_SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#else +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#endif + +typedef struct +{ + long frameIndex; /* Index into sample array. */ + long maxFrameIndex; + long samplesPerFrame; + long numSamples; + PortAudioStream *outputStream; + PortAudioStream *inputStream; + SAMPLE *recordedSamples; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int recordCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = (SAMPLE*)inputBuffer; + SAMPLE *wptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; + long framesToCalc; + unsigned long i; + int finished; + unsigned long framesLeft = data->maxFrameIndex - data->frameIndex; + + (void) outputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( framesLeft < framesPerBuffer ) + { + framesToCalc = framesLeft; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + finished = 0; + } + if( inputBuffer == NULL ) + { + for( i=0; iframeIndex += framesToCalc; + return finished; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int playCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; + SAMPLE *wptr = (SAMPLE*)outputBuffer; + unsigned long i; + int finished; + unsigned int framesLeft = data->maxFrameIndex - data->frameIndex; + if( outputBuffer == NULL ) return 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( framesLeft < framesPerBuffer ) + { + /* final buffer... */ + for( i=0; iframeIndex += framesLeft; + finished = 1; + } + else + { + for( i=0; iframeIndex += framesPerBuffer; + finished = 0; + } + return finished; +} + +/****************************************************************/ +PaError TestRecording( paTestData *dataPtr ) +{ + PaError err; + int i; + int lastIndex = 0; + +/* Open input stream if not already open. */ + if( dataPtr->inputStream == NULL ) + { + /* Record some audio. */ + err = Pa_OpenStream( + &dataPtr->inputStream, + Pa_GetDefaultInputDeviceID(), + dataPtr->samplesPerFrame, /* stereo input */ + PA_SAMPLE_TYPE, + NULL, + paNoDevice, + 0, + PA_SAMPLE_TYPE, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + NUM_REC_BUFS, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + recordCallback, + dataPtr ); + if( err != paNoError ) goto error; + } + + dataPtr->frameIndex = 0; + + err = Pa_StartStream( dataPtr->inputStream ); + if( err != paNoError ) goto error; + + printf("Now recording!\n"); fflush(stdout); + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + int frameIndex, delta; + Pa_Sleep(SLEEP_DUR_MSEC); + + frameIndex = dataPtr->frameIndex; + if( Pa_StreamActive( dataPtr->inputStream ) <= 0) + { + printf("Stream inactive!\n"); + break; + } + if( dataPtr->maxFrameIndex <= frameIndex ) + { + printf("Buffer recording complete.\n"); + break; + } + + delta = frameIndex - lastIndex; + lastIndex = frameIndex; + printf("index = %d, delta = %d\n", frameIndex, delta ); fflush(stdout); + } + + err = Pa_StopStream( dataPtr->inputStream ); + if( err != paNoError ) goto error; + + printf("Done.\n"); fflush(stdout); + +error: + return err; +} + +/****************************************************************/ +PaError TestPlayback( paTestData *dataPtr ) +{ + PaError err; + int i; + int lastIndex = 0; + + /* Playback recorded data. */ + dataPtr->frameIndex = 0; + printf("Begin playback.\n"); fflush(stdout); + +/* Open output stream if not already open. */ + if( dataPtr->outputStream == NULL ) + { + err = Pa_OpenStream( + &dataPtr->outputStream, + paNoDevice, + 0, /* NO input */ + PA_SAMPLE_TYPE, + NULL, + Pa_GetDefaultOutputDeviceID(), + dataPtr->samplesPerFrame, /* stereo output */ + PA_SAMPLE_TYPE, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + playCallback, + dataPtr ); + if( err != paNoError ) goto error; + } + + err = Pa_StartStream( dataPtr->outputStream ); + if( err != paNoError ) goto error; + + printf("Waiting for playback to finish.\n"); fflush(stdout); + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + int frameIndex, delta; + Pa_Sleep(SLEEP_DUR_MSEC); + frameIndex = dataPtr->frameIndex; + delta = frameIndex - lastIndex; + lastIndex = frameIndex; + printf("index = %d, delta = %d\n", frameIndex, delta ); fflush(stdout); + } + + err = Pa_StopStream( dataPtr->outputStream ); + if( err != paNoError ) goto error; + +error: + return err; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData data = { 0 }; + long totalFrames; + long numBytes; + long i; + printf("patest_record.c\n"); fflush(stdout); + +/* Set up test data structure and sample array. */ + data.frameIndex = 0; + data.samplesPerFrame = 2; + data.maxFrameIndex = totalFrames = NUM_SECONDS*SAMPLE_RATE; + + printf("totalFrames = %d\n", totalFrames ); fflush(stdout); + data.numSamples = totalFrames * data.samplesPerFrame; + + numBytes = data.numSamples * sizeof(SAMPLE); + data.recordedSamples = (SAMPLE *) malloc( numBytes ); + if( data.recordedSamples == NULL ) + { + printf("Could not allocate record array.\n"); + exit(1); + } + for( i=0; i + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +//#define OUTPUT_DEVICE (11) +#define NUM_SECONDS (8) +#define SLEEP_DUR (800) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#if 0 +#define MIN_LATENCY_MSEC (200) +#define NUM_BUFFERS ((MIN_LATENCY_MSEC * SAMPLE_RATE) / (FRAMES_PER_BUFFER * 1000)) +#else +#define NUM_BUFFERS (0) +#endif +#define MIN_FREQ (100.0f) +#define MAX_FREQ (4000.0f) +#define FREQ_SCALAR (1.00002f) +#define CalcPhaseIncrement(freq) (freq/SAMPLE_RATE) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (400) +typedef struct +{ + float sine[TABLE_SIZE + 1]; // add one for guard point for interpolation + float phase_increment; + float left_phase; + float right_phase; + unsigned int framesToGo; +} +paTestData; +/* Convert phase between and 1.0 to sine value + * using linear interpolation. + */ +float LookupSine( paTestData *data, float phase ); +float LookupSine( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->sine[index]; + float hi = data->sine[index+1]; + float val = lo + fract*(hi-lo); + return val; +} +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int framesToCalc; + int i; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + if( data->framesToGo < framesPerBuffer ) + { + framesToCalc = data->framesToGo; + data->framesToGo = 0; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + data->framesToGo -= framesPerBuffer; + } + + for( i=0; ileft_phase); /* left */ + *out++ = LookupSine(data, data->right_phase); /* right */ + data->left_phase += data->phase_increment; + if( data->left_phase >= 1.0f ) data->left_phase -= 1.0f; + data->right_phase += (data->phase_increment * 1.5f); /* fifth above */ + if( data->right_phase >= 1.0f ) data->right_phase -= 1.0f; + /* sweep frequency then start over. */ + data->phase_increment *= FREQ_SCALAR; + if( data->phase_increment > CalcPhaseIncrement(MAX_FREQ) ) data->phase_increment = CalcPhaseIncrement(MIN_FREQ); + } + /* zero remainder of final buffer */ + for( ; i<(int)framesPerBuffer; i++ ) + { + *out++ = 0; /* left */ + *out++ = 0; /* right */ + } + return finished; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream; + PaError err; + paTestData data; + int i; + int totalSamps; + printf("PortAudio Test: output sine sweep. ask for %d buffers\n", NUM_BUFFERS ); + /* initialise sinusoidal wavetable */ + for( i=0; i +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#define FREQ_INCR (300.0 / SAMPLE_RATE) +#define MAX_CHANNELS (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ + int numChannels; + double phases[MAX_CHANNELS]; + float amplitude; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int frameIndex, channelIndex; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + for( channelIndex=0; channelIndexnumChannels; channelIndex++ ) + { + /* Output sine wave on every channel. */ + *out++ = (float) ( data->amplitude * sin(data->phases[channelIndex]) ); + + /* Play each channel at a higher frequency. */ + data->phases[channelIndex] += FREQ_INCR * (4 + channelIndex); + if( data->phases[channelIndex] >= (2.0 * M_PI) ) data->phases[channelIndex] -= (2.0 * M_PI); + } + } + + return 0; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + char pad[256]; + PortAudioStream *stream; + PaError err; + const PaDeviceInfo *pdi; + paTestData data = {0}; + printf("PortAudio Test: output sine wave on each channel.\n" ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + pdi = Pa_GetDeviceInfo( OUTPUT_DEVICE ); + data.numChannels = pdi->maxOutputChannels; + if( data.numChannels > MAX_CHANNELS ) data.numChannels = MAX_CHANNELS; + printf("Number of Channels = %d\n", data.numChannels ); + data.amplitude = 1.0; + + err = Pa_OpenStream( + &stream, + paNoDevice, /* default input device */ + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + data.numChannels, + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + do + { + printf("Current amplitude = %f\n", data.amplitude ); + printf("Enter new amplitude or 'q' to quit.\n"); + fflush(stdout); + gets( pad ); + if( pad[0] != 'q' ) + { + // I tried to use atof but it seems to be broken on Mac OS X 10.1 + float amp; + sscanf( pad, "%f", & ); + data.amplitude = amp; + } + } while( pad[0] != 'q' ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + Pa_CloseStream( stream ); + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/debug_sine_formats.c b/portaudio-v19/test/debug_sine_formats.c new file mode 100644 index 000000000..a1fce567c --- /dev/null +++ b/portaudio-v19/test/debug_sine_formats.c @@ -0,0 +1,202 @@ +/* + * $Id$ + * patest_sine_formats.c + * Play a sine wave using the Portable Audio api for several seconds. + * Test various data formats. + * + * Author: Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (10) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) + +#define LEFT_FREQ (SAMPLE_RATE/512.0) /* So we hit 1.0 */ +#define RIGHT_FREQ (500.0) + +#define AMPLITUDE (1.0) + +/* Select ONE format for testing. */ +#define TEST_UINT8 (1) +#define TEST_INT8 (0) +#define TEST_INT16 (0) +#define TEST_FLOAT32 (0) + +#if TEST_UINT8 +#define TEST_FORMAT paUInt8 +typedef unsigned char SAMPLE_t; +#define SAMPLE_ZERO (0x80) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(127.0 * (x))) +#define FORMAT_NAME "Unsigned 8 Bit" + +#elif TEST_INT8 +#define TEST_FORMAT paInt8 +typedef char SAMPLE_t; +#define SAMPLE_ZERO (0) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(127.0 * (x))) +#define FORMAT_NAME "Signed 8 Bit" + +#elif TEST_INT16 +#define TEST_FORMAT paInt16 +typedef short SAMPLE_t; +#define SAMPLE_ZERO (0) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(32767 * (x))) +#define FORMAT_NAME "Signed 16 Bit" + +#elif TEST_FLOAT32 +#define TEST_FORMAT paFloat32 +typedef float SAMPLE_t; +#define SAMPLE_ZERO (0.0) +#define DOUBLE_TO_SAMPLE(x) ((SAMPLE_t)(x)) +#define FORMAT_NAME "Float 32 Bit" +#endif + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + + +typedef struct +{ + double left_phase; + double right_phase; + unsigned int framesToGo; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE_t *out = (SAMPLE_t *)outputBuffer; + SAMPLE_t sample; + int i; + int framesToCalc; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + if( data->framesToGo < framesPerBuffer ) + { + framesToCalc = data->framesToGo; + data->framesToGo = 0; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + data->framesToGo -= framesPerBuffer; + } + + for( i=0; ileft_phase += (LEFT_FREQ / SAMPLE_RATE); + if( data->left_phase > 1.0) data->left_phase -= 1.0; + sample = DOUBLE_TO_SAMPLE( AMPLITUDE * sin( (data->left_phase * M_PI * 2. ))); /**/ + *out++ = sample; +/* *out++ = sample; /**/ +/* *out++ = 0; /**/ + + data->right_phase += (RIGHT_FREQ / SAMPLE_RATE); + if( data->right_phase > 1.0) data->right_phase -= 1.0; + *out++ = DOUBLE_TO_SAMPLE( AMPLITUDE * sin( (data->right_phase * M_PI * 2. ))); /**/ +/* *out++ = 0; /* */ + } + /* zero remainder of final buffer */ + for( ; i<(int)framesPerBuffer; i++ ) + { + *out++ = SAMPLE_ZERO; /* left */ + *out++ = SAMPLE_ZERO; /* right */ + } + return finished; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PortAudioStream *stream; + PaError err; + paTestData data; + int totalSamps; + + printf("PortAudio Test: output " FORMAT_NAME "\n"); + + + data.left_phase = data.right_phase = 0.0; + data.framesToGo = totalSamps = NUM_SECONDS * SAMPLE_RATE; /* Play for a few seconds. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + err = Pa_OpenStream( + &stream, + paNoDevice,/* default input device */ + 0, /* no input */ + TEST_FORMAT, + NULL, + Pa_GetDefaultOutputDeviceID(), /* default output device */ + 2, /* stereo output */ + TEST_FORMAT, + NULL, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Waiting %d seconds for sound to finish.\n", NUM_SECONDS ); + while( Pa_StreamActive( stream ) ) Pa_Sleep(10); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + + printf("PortAudio Test Finished: " FORMAT_NAME "\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/debug_srate.c b/portaudio-v19/test/debug_srate.c new file mode 100644 index 000000000..07371f28e --- /dev/null +++ b/portaudio-v19/test/debug_srate.c @@ -0,0 +1,265 @@ +/* + * $Id$ + * debug_record_reuse.c + * Record input into an array. + * Save array to a file. + * Based on patest_record.c but with various ugly debug hacks thrown in. + * Loop twice and reuse same streams. + * + * Author: Phil Burk http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" + +#define EWS88MT_12_REC (1) +#define EWS88MT_12_PLAY (10) +#define SBLIVE_REC (2) +#define SBLIVE_PLAY (11) + +#if 0 +#define INPUT_DEVICE_ID Pa_GetDefaultInputDeviceID() +#define OUTPUT_DEVICE_ID Pa_GetDefaultOutputDeviceID() +#else +#define INPUT_DEVICE_ID (EWS88MT_12_REC) +#define OUTPUT_DEVICE_ID (SBLIVE_PLAY) +#endif + +#define INPUT_SAMPLE_RATE (22050.0) +#define OUTPUT_SAMPLE_RATE (22050.0) +#define NUM_SECONDS (4) +#define SLEEP_DUR_MSEC (1000) +#define FRAMES_PER_BUFFER (64) +#define NUM_REC_BUFS (0) +#define SAMPLES_PER_FRAME (2) + +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; + +typedef struct +{ + long frameIndex; /* Index into sample array. */ +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int recordCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData *) userData; + (void) outputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( inputBuffer != NULL ) + { + data->frameIndex += framesPerBuffer; + } + return 0; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int playCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData *) userData; + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; + + if( outputBuffer != NULL ) + { + data->frameIndex += framesPerBuffer; + } + return 0; +} + +/****************************************************************/ +PaError MeasureStreamRate( PortAudioStream *stream, paTestData *dataPtr, double *ratePtr ) +{ + PaError err; + int i; + int totalFrames = 0; + int totalMSec = 0; + + dataPtr->frameIndex = 0; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + for( i=0; i<(NUM_SECONDS*1000/SLEEP_DUR_MSEC); i++ ) + { + int delta, endIndex; + + int startIndex = dataPtr->frameIndex; + Pa_Sleep(SLEEP_DUR_MSEC); + endIndex = dataPtr->frameIndex; + + delta = endIndex - startIndex; + totalFrames += delta; + totalMSec += SLEEP_DUR_MSEC; + + printf("index = %d, delta = %d\n", endIndex, delta ); fflush(stdout); + } + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + *ratePtr = (totalFrames * 1000.0) / totalMSec; + +error: + return err; +} + +void ReportRate( double measuredRate, double expectedRate ) +{ + double error; + + error = (measuredRate - expectedRate) / expectedRate; + error = (error < 0 ) ? -error : error; + + printf("Measured rate = %6.1f, expected rate = %6.1f\n", + measuredRate, expectedRate ); + if( error > 0.1 ) + { + printf("ERROR: unexpected rate! --------------------- ERROR!\n"); + } + else + { + printf("SUCCESS: rate within tolerance!\n"); + } +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData data = { 0 }; + long i; + double rate; + const PaDeviceInfo *pdi; + + PortAudioStream *outputStream; + PortAudioStream *inputStream; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + + pdi = Pa_GetDeviceInfo( INPUT_DEVICE_ID ); + printf("Input device = %s\n", pdi->name ); + pdi = Pa_GetDeviceInfo( OUTPUT_DEVICE_ID ); + printf("Output device = %s\n", pdi->name ); + +/* Open input stream. */ + err = Pa_OpenStream( + &inputStream, + INPUT_DEVICE_ID, + SAMPLES_PER_FRAME, /* stereo input */ + PA_SAMPLE_TYPE, + NULL, + paNoDevice, + 0, + PA_SAMPLE_TYPE, + NULL, + INPUT_SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + NUM_REC_BUFS, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + recordCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_OpenStream( + &outputStream, + paNoDevice, + 0, /* NO input */ + PA_SAMPLE_TYPE, + NULL, + OUTPUT_DEVICE_ID, + SAMPLES_PER_FRAME, /* stereo output */ + PA_SAMPLE_TYPE, + NULL, + OUTPUT_SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + playCallback, + &data ); + if( err != paNoError ) goto error; + +/* Record and playback multiple times. */ + for( i=0; i<2; i++ ) + { + printf("Measuring INPUT ------------------------- \n"); + err = MeasureStreamRate( inputStream, &data, &rate ); + if( err != paNoError ) goto error; + ReportRate( rate, INPUT_SAMPLE_RATE ); + + printf("Measuring OUTPUT ------------------------- \n"); + err = MeasureStreamRate( outputStream, &data, &rate ); + if( err != paNoError ) goto error; + ReportRate( rate, OUTPUT_SAMPLE_RATE ); + } + +/* Clean up. */ + err = Pa_CloseStream( inputStream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( outputStream ); + if( err != paNoError ) goto error; + + if( err != paNoError ) goto error; + + Pa_Terminate(); + + printf("Test complete.\n"); fflush(stdout); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + if( err == paHostError ) + { + fprintf( stderr, "Host Error number: %d\n", Pa_GetHostError() ); + } + return -1; +} diff --git a/portaudio-v19/test/debug_test1.c b/portaudio-v19/test/debug_test1.c new file mode 100644 index 000000000..1321f62c8 --- /dev/null +++ b/portaudio-v19/test/debug_test1.c @@ -0,0 +1,114 @@ +/* + * $Id$ + patest1.c + Ring modulate the audio input with a 441hz sine wave for 20 seconds + using the Portable Audio api + Author: Ross Bencina + Modifications: + April 5th, 2001 - PLB - Check for NULL inputBuffer. +*/ +#include +#include +#include "portaudio.h" +#ifndef M_PI +#define M_PI (3.14159265) +#endif +typedef struct +{ + float sine[100]; + int phase; + int sampsToGo; +} +patest1data; +static int patest1Callback( void *inputBuffer, void *outputBuffer, + unsigned long bufferFrames, + PaTimestamp outTime, void *userData ) +{ + patest1data *data = (patest1data*)userData; + float *in = (float*)inputBuffer; + float *out = (float*)outputBuffer; + int framesToCalc = bufferFrames; + unsigned long i; + int finished = 0; + if(inputBuffer == NULL) return 0; + if( data->sampsToGo < bufferFrames ) + { + finished = 1; + } + for( i=0; iphase >= 100 ) + data->phase = 0; + } + data->sampsToGo -= bufferFrames; + /* zero remainder of final buffer if not already done */ + for( ; i +#include +#include "portaudio.h" + +#ifdef WIN32 +#ifndef PA_NO_ASIO +#include "pa_asio.h" +#endif +#endif + +/*******************************************************************/ +static void PrintSupportedStandardSampleRates( + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters ) +{ + static double standardSampleRates[] = { + 8000.0, 9600.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 32000.0, + 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, -1 /* negative terminated list */ + }; + int i, printCount; + PaError err; + + printCount = 0; + for( i=0; standardSampleRates[i] > 0; i++ ) + { + err = Pa_IsFormatSupported( inputParameters, outputParameters, standardSampleRates[i] ); + if( err == paFormatIsSupported ) + { + if( printCount == 0 ) + { + printf( "\t%8.2f", standardSampleRates[i] ); + printCount = 1; + } + else if( printCount == 4 ) + { + printf( ",\n\t%8.2f", standardSampleRates[i] ); + printCount = 1; + } + else + { + printf( ", %8.2f", standardSampleRates[i] ); + ++printCount; + } + } + } + if( !printCount ) + printf( "None\n" ); + else + printf( "\n" ); +} +/*******************************************************************/ +int main(void); +int main(void) +{ + int i, numDevices, defaultDisplayed; + const PaDeviceInfo *deviceInfo; + PaStreamParameters inputParameters, outputParameters; + PaError err; + + + Pa_Initialize(); + + printf( "PortAudio version number = %d\nPortAudio version text = '%s'\n", + Pa_GetVersion(), Pa_GetVersionText() ); + + + numDevices = Pa_GetDeviceCount(); + if( numDevices < 0 ) + { + printf( "ERROR: Pa_CountDevices returned 0x%x\n", numDevices ); + err = numDevices; + goto error; + } + + printf( "Number of devices = %d\n", numDevices ); + for( i=0; ihostApi )->defaultInputDevice ) + { + const PaHostApiInfo *hostInfo = Pa_GetHostApiInfo( deviceInfo->hostApi ); + printf( "[ Default %s Input", hostInfo->name ); + defaultDisplayed = 1; + } + + if( i == Pa_GetDefaultOutputDevice() ) + { + printf( (defaultDisplayed ? "," : "[") ); + printf( " Default Output" ); + defaultDisplayed = 1; + } + else if( i == Pa_GetHostApiInfo( deviceInfo->hostApi )->defaultOutputDevice ) + { + const PaHostApiInfo *hostInfo = Pa_GetHostApiInfo( deviceInfo->hostApi ); + printf( (defaultDisplayed ? "," : "[") ); + printf( " Default %s Output", hostInfo->name ); + defaultDisplayed = 1; + } + + if( defaultDisplayed ) + printf( " ]\n" ); + + /* print device info fields */ + printf( "Name = %s\n", deviceInfo->name ); + printf( "Host API = %s\n", Pa_GetHostApiInfo( deviceInfo->hostApi )->name ); + printf( "Max inputs = %d", deviceInfo->maxInputChannels ); + printf( ", Max outputs = %d\n", deviceInfo->maxOutputChannels ); + + printf( "Default low input latency = %8.3f\n", deviceInfo->defaultLowInputLatency ); + printf( "Default low output latency = %8.3f\n", deviceInfo->defaultLowOutputLatency ); + printf( "Default high input latency = %8.3f\n", deviceInfo->defaultHighInputLatency ); + printf( "Default high output latency = %8.3f\n", deviceInfo->defaultHighOutputLatency ); + +#ifdef WIN32 +#ifndef PA_NO_ASIO +/* ASIO specific latency information */ + if( Pa_GetHostApiInfo( deviceInfo->hostApi )->type == paASIO ){ + long minLatency, maxLatency, preferredLatency, granularity; + + err = PaAsio_GetAvailableLatencyValues( i, + &minLatency, &maxLatency, &preferredLatency, &granularity ); + + printf( "ASIO minimum buffer size = %ld\n", minLatency ); + printf( "ASIO maximum buffer size = %ld\n", maxLatency ); + printf( "ASIO preferred buffer size = %ld\n", preferredLatency ); + + if( granularity == -1 ) + printf( "ASIO buffer granularity = power of 2\n" ); + else + printf( "ASIO buffer granularity = %ld\n", granularity ); + } +#endif /* !PA_NO_ASIO */ +#endif /* WIN32 */ + + printf( "Default sample rate = %8.2f\n", deviceInfo->defaultSampleRate ); + + /* poll for standard sample rates */ + inputParameters.device = i; + inputParameters.channelCount = deviceInfo->maxInputChannels; + inputParameters.sampleFormat = paInt16; + inputParameters.suggestedLatency = 0; /* ignored by Pa_IsFormatSupported() */ + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = i; + outputParameters.channelCount = deviceInfo->maxOutputChannels; + outputParameters.sampleFormat = paInt16; + outputParameters.suggestedLatency = 0; /* ignored by Pa_IsFormatSupported() */ + outputParameters.hostApiSpecificStreamInfo = NULL; + + if( inputParameters.channelCount > 0 ) + { + printf("Supported standard sample rates\n for half-duplex 16 bit %d channel input = \n", + inputParameters.channelCount ); + PrintSupportedStandardSampleRates( &inputParameters, NULL ); + } + + if( outputParameters.channelCount > 0 ) + { + printf("Supported standard sample rates\n for half-duplex 16 bit %d channel output = \n", + outputParameters.channelCount ); + PrintSupportedStandardSampleRates( NULL, &outputParameters ); + } + + if( inputParameters.channelCount > 0 && outputParameters.channelCount > 0 ) + { + printf("Supported standard sample rates\n for full-duplex 16 bit %d channel input, %d channel output = \n", + inputParameters.channelCount, outputParameters.channelCount ); + PrintSupportedStandardSampleRates( &inputParameters, &outputParameters ); + } + } + + Pa_Terminate(); + + printf("----------------------------------------------\n"); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/pa_fuzz.c b/portaudio-v19/test/pa_fuzz.c new file mode 100644 index 000000000..127c2e3e6 --- /dev/null +++ b/portaudio-v19/test/pa_fuzz.c @@ -0,0 +1,168 @@ +/** @file pa_fuzz.c + @brief Distort input like a fuzz boz. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +/* +** Note that many of the older ISA sound cards on PCs do NOT support +** full duplex audio (simultaneous record and playback). +** And some only support full duplex at lower sample rates. +*/ +#define SAMPLE_RATE (44100) +#define PA_SAMPLE_TYPE paFloat32 +#define FRAMES_PER_BUFFER (64) + +typedef float SAMPLE; + +float CubicAmplifier( float input ); +static int fuzzCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + +/* Non-linear amplifier with soft distortion curve. */ +float CubicAmplifier( float input ) +{ + float output, temp; + if( input < 0.0 ) + { + temp = input + 1.0f; + output = (temp * temp * temp) - 1.0f; + } + else + { + temp = input - 1.0f; + output = (temp * temp * temp) + 1.0f; + } + + return output; +} +#define FUZZ(x) CubicAmplifier(CubicAmplifier(CubicAmplifier(CubicAmplifier(x)))) + +static int gNumNoInputs = 0; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int fuzzCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + SAMPLE *out = (SAMPLE*)outputBuffer; + const SAMPLE *in = (const SAMPLE*)inputBuffer; + unsigned int i; + (void) timeInfo; /* Prevent unused variable warnings. */ + (void) statusFlags; + (void) userData; + + if( inputBuffer == NULL ) + { + for( i=0; idefaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = PA_SAMPLE_TYPE; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + &inputParameters, + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + 0, /* paClipOff, */ /* we won't output out of range samples so don't bother clipping them */ + fuzzCallback, + NULL ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Hit ENTER to stop program.\n"); + getchar(); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + printf("Finished. gNumNoInputs = %d\n", gNumNoInputs ); + Pa_Terminate(); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return -1; +} diff --git a/portaudio-v19/test/pa_minlat.c b/portaudio-v19/test/pa_minlat.c new file mode 100644 index 000000000..8400dfd27 --- /dev/null +++ b/portaudio-v19/test/pa_minlat.c @@ -0,0 +1,187 @@ +/** @file pa_minlat.c + @brief Experiment with different numbers of buffers to determine the + minimum latency for a computer. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include +#include +#include "portaudio.h" + +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +#define DEFAULT_BUFFER_SIZE (32) + +typedef struct +{ + double left_phase; + double right_phase; +} +paTestData; + +/* Very simple synthesis routine to generate two sine waves. */ +static int paminlatCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + double left_phaseInc = 0.02; + double right_phaseInc = 0.06; + + double left_phase = data->left_phase; + double right_phase = data->right_phase; + + for( i=0; i TWOPI ) left_phase -= TWOPI; + *out++ = (float) sin( left_phase ); + + right_phase += right_phaseInc; + if( right_phase > TWOPI ) right_phase -= TWOPI; + *out++ = (float) sin( right_phase ); + } + + data->left_phase = left_phase; + data->right_phase = right_phase; + return 0; +} + +int main( int argc, char **argv ); +int main( int argc, char **argv ) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int go; + int outLatency = 0; + int minLatency = DEFAULT_BUFFER_SIZE * 2; + int framesPerBuffer; + double sampleRate = 44100.0; + char str[256]; + + printf("pa_minlat - Determine minimum latency for your computer.\n"); + printf(" usage: pa_minlat {userBufferSize}\n"); + printf(" for example: pa_minlat 64\n"); + printf("Adjust your stereo until you hear a smooth tone in each speaker.\n"); + printf("Then try to find the smallest number of frames that still sounds smooth.\n"); + printf("Note that the sound will stop momentarily when you change the number of buffers.\n"); + + /* Get bufferSize from command line. */ + framesPerBuffer = ( argc > 1 ) ? atol( argv[1] ) : DEFAULT_BUFFER_SIZE; + printf("Frames per buffer = %d\n", framesPerBuffer ); + + data.left_phase = data.right_phase = 0.0; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outLatency = sampleRate * 200.0 / 1000.0; /* 200 msec. */ + + /* Try different numBuffers in a loop. */ + go = 1; + while( go ) + { + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Default output device. */ + outputParameters.channelCount = 2; /* Stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output. */ + outputParameters.suggestedLatency = (double)outLatency / sampleRate; /* In seconds. */ + outputParameters.hostApiSpecificStreamInfo = NULL; + + printf("Latency = %d frames = %6.1f msec.\n", outLatency, outputParameters.suggestedLatency * 1000.0 ); + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + sampleRate, + framesPerBuffer, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + paminlatCallback, + &data ); + if( err != paNoError ) goto error; + if( stream == NULL ) goto error; + + /* Start audio. */ + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + /* Ask user for a new nlatency. */ + printf("\nMove windows around to see if the sound glitches.\n"); + printf("Latency now %d, enter new number of frames, or 'q' to quit: ", outLatency ); + fgets( str, 256, stdin ); + { + /* Get rid of newline */ + size_t l = strlen( str ) - 1; + if( str[ l ] == '\n') + str[ l ] = '\0'; + } + if( str[0] == 'q' ) go = 0; + else + { + outLatency = atol( str ); + if( outLatency < minLatency ) + { + printf( "Latency below minimum of %d! Set to minimum!!!\n", minLatency ); + outLatency = minLatency; + } + } + /* Stop sound until ENTER hit. */ + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + } + printf("A good setting for latency would be somewhat higher than\n"); + printf("the minimum latency that worked.\n"); + printf("PortAudio: Test finished.\n"); + Pa_Terminate(); + return 0; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return 1; +} diff --git a/portaudio-v19/test/paqa_devs.c b/portaudio-v19/test/paqa_devs.c new file mode 100644 index 000000000..f52143c19 --- /dev/null +++ b/portaudio-v19/test/paqa_devs.c @@ -0,0 +1,347 @@ +/** @file paqa_devs.c + @brief Self Testing Quality Assurance app for PortAudio + Try to open each device and run through all the + possible configurations. + + @author Phil Burk http://www.softsynth.com + + Pieter adapted to V19 API. Test now relies heavily on + Pa_IsFormatSupported(). Uses same 'standard' sample rates + as in test pa_devs.c. +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#include "pa_trace.h" + +/****************************************** Definitions ***********/ +#define MODE_INPUT (0) +#define MODE_OUTPUT (1) + +typedef struct PaQaData +{ + unsigned long framesLeft; + int numChannels; + int bytesPerSample; + int mode; + short sawPhase; + PaSampleFormat format; +} +PaQaData; + +/****************************************** Prototypes ***********/ +static void TestDevices( int mode ); +static void TestFormats( int mode, PaDeviceIndex deviceID, double sampleRate, + int numChannels ); +static int TestAdvance( int mode, PaDeviceIndex deviceID, double sampleRate, + int numChannels, PaSampleFormat format ); +static int QaCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + +/****************************************** Globals ***********/ +static int gNumPassed = 0; +static int gNumFailed = 0; + +/****************************************** Macros ***********/ +/* Print ERROR if it fails. Tally success or failure. */ +/* Odd do-while wrapper seems to be needed for some compilers. */ +#define EXPECT(_exp) \ + do \ + { \ + if ((_exp)) {\ + /* printf("SUCCESS for %s\n", #_exp ); */ \ + gNumPassed++; \ + } \ + else { \ + printf("ERROR - 0x%x - %s for %s\n", result, \ + ((result == 0) ? "-" : Pa_GetErrorText(result)), \ + #_exp ); \ + gNumFailed++; \ + goto error; \ + } \ + } while(0) + +/*******************************************************************/ +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int QaCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + unsigned long i; + short phase; + PaQaData *data = (PaQaData *) userData; + (void) inputBuffer; + + /* Play simle sawtooth wave. */ + if( data->mode == MODE_OUTPUT ) + { + phase = data->sawPhase; + switch( data->format ) + { + case paFloat32: + { + float *out = (float *) outputBuffer; + for( i=0; inumChannels == 2 ) + { + *out++ = (float) (phase * (1.0 / 32768.0)); + } + } + } + break; + + case paInt32: + { + int *out = (int *) outputBuffer; + for( i=0; inumChannels == 2 ) + { + *out++ = ((int) phase ) << 16; + } + } + } + break; + case paInt16: + { + short *out = (short *) outputBuffer; + for( i=0; inumChannels == 2 ) + { + *out++ = phase; + } + } + } + break; + + default: + { + unsigned char *out = (unsigned char *) outputBuffer; + unsigned long numBytes = framesPerBuffer * data->numChannels * data->bytesPerSample; + for( i=0; isawPhase = phase; + } + /* Are we through yet? */ + if( data->framesLeft > framesPerBuffer ) + { + PaUtil_AddTraceMessage("QaCallback: running. framesLeft", data->framesLeft ); + data->framesLeft -= framesPerBuffer; + return 0; + } + else + { + PaUtil_AddTraceMessage("QaCallback: DONE! framesLeft", data->framesLeft ); + data->framesLeft = 0; + return 1; + } +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError result; + EXPECT( ((result=Pa_Initialize()) == 0) ); + printf("Test OUTPUT ---------------\n"); + TestDevices( MODE_OUTPUT ); + printf("Test INPUT ---------------\n"); + TestDevices( MODE_INPUT ); +error: + Pa_Terminate(); + printf("QA Report: %d passed, %d failed.\n", gNumPassed, gNumFailed ); + return 0; +} + +/******************************************************************* +* Try each output device, through its full range of capabilities. */ +static void TestDevices( int mode ) +{ + int id, jc, i; + int maxChannels; + const PaDeviceInfo *pdi; + static double standardSampleRates[] = { 8000.0, 9600.0, 11025.0, 12000.0, + 16000.0, 22050.0, 24000.0, + 32000.0, 44100.0, 48000.0, + 88200.0, 96000.0, + -1.0 }; /* Negative terminated list. */ + int numDevices = Pa_GetDeviceCount(); + for( id=0; idmaxInputChannels : pdi->maxOutputChannels); + + for( jc=1; jc<=maxChannels; jc++ ) + { + printf("Name = %s\n", pdi->name ); + /* Try each standard sample rate. */ + for( i=0; standardSampleRates[i] > 0; i++ ) + { + TestFormats( mode, (PaDeviceIndex)id, standardSampleRates[i], jc ); + } + } + } +} + +/*******************************************************************/ +static void TestFormats( int mode, PaDeviceIndex deviceID, double sampleRate, + int numChannels ) +{ + TestAdvance( mode, deviceID, sampleRate, numChannels, paFloat32 ); + TestAdvance( mode, deviceID, sampleRate, numChannels, paInt16 ); + TestAdvance( mode, deviceID, sampleRate, numChannels, paInt32 ); + /* TestAdvance( mode, deviceID, sampleRate, numChannels, paInt24 ); */ +} + +/*******************************************************************/ +static int TestAdvance( int mode, PaDeviceIndex deviceID, double sampleRate, + int numChannels, PaSampleFormat format ) +{ + PaStreamParameters inputParameters, outputParameters, *ipp, *opp; + PaStream *stream = NULL; + PaError result = paNoError; + PaQaData myData; + #define FRAMES_PER_BUFFER (64) + + /* Setup data for synthesis thread. */ + myData.framesLeft = (unsigned long) (sampleRate * 100); /* 100 seconds */ + myData.numChannels = numChannels; + myData.mode = mode; + myData.format = format; + switch( format ) + { + case paFloat32: + case paInt32: + case paInt24: + myData.bytesPerSample = 4; + break; +/* case paPackedInt24: + myData.bytesPerSample = 3; + break; */ + default: + myData.bytesPerSample = 2; + break; + } + + if( mode == MODE_INPUT ) + { + inputParameters.device = deviceID; + inputParameters.channelCount = numChannels; + inputParameters.sampleFormat = format; + inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + ipp = &inputParameters; + } + else + ipp = NULL; + if( mode == MODE_OUTPUT ) /* Pa_GetDeviceInfo(paNoDevice) COREDUMPS!!! */ + { + outputParameters.device = deviceID; + outputParameters.channelCount = numChannels; + outputParameters.sampleFormat = format; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + opp = &outputParameters; + } + else + opp = NULL; + + if(paFormatIsSupported == Pa_IsFormatSupported( ipp, opp, sampleRate )) + { + printf("------ TestAdvance: %s, device = %d, rate = %g, numChannels = %d, format = %lu -------\n", + ( mode == MODE_INPUT ) ? "INPUT" : "OUTPUT", + deviceID, sampleRate, numChannels, (unsigned long)format); + EXPECT( ((result = Pa_OpenStream( &stream, + ipp, + opp, + sampleRate, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + QaCallback, + &myData ) ) == 0) ); + if( stream ) + { + PaTime oldStamp, newStamp; + unsigned long oldFrames; + int minDelay = ( mode == MODE_INPUT ) ? 1000 : 400; + /* Was: + int minNumBuffers = Pa_GetMinNumBuffers( FRAMES_PER_BUFFER, sampleRate ); + int msec = (int) ((minNumBuffers * 3 * 1000.0 * FRAMES_PER_BUFFER) / sampleRate); + */ + int msec = (int)( 3.0 * + (( mode == MODE_INPUT ) ? inputParameters.suggestedLatency : outputParameters.suggestedLatency )); + if( msec < minDelay ) msec = minDelay; + printf("msec = %d\n", msec); /**/ + EXPECT( ((result=Pa_StartStream( stream )) == 0) ); + /* Check to make sure PortAudio is advancing timeStamp. */ + oldStamp = Pa_GetStreamTime(stream); + Pa_Sleep(msec); + newStamp = Pa_GetStreamTime(stream); + printf("oldStamp = %g,newStamp = %g\n", oldStamp, newStamp ); /**/ + EXPECT( (oldStamp < newStamp) ); + /* Check to make sure callback is decrementing framesLeft. */ + oldFrames = myData.framesLeft; + Pa_Sleep(msec); + printf("oldFrames = %lu, myData.framesLeft = %lu\n", oldFrames, myData.framesLeft ); /**/ + EXPECT( (oldFrames > myData.framesLeft) ); + EXPECT( ((result=Pa_CloseStream( stream )) == 0) ); + stream = NULL; + } + } +error: + if( stream != NULL ) Pa_CloseStream( stream ); + return result; +} diff --git a/portaudio-v19/test/paqa_errs.c b/portaudio-v19/test/paqa_errs.c new file mode 100644 index 000000000..3f9077173 --- /dev/null +++ b/portaudio-v19/test/paqa_errs.c @@ -0,0 +1,380 @@ +/** @file paqa_errs.c + @brief Self Testing Quality Assurance app for PortAudio + Do lots of bad things to test error reporting. + @author Phil Burk http://www.softsynth.com + Pieter Suurmond adapted to V19 API. +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include + +#include "portaudio.h" + +/*--------- Definitions ---------*/ +#define MODE_INPUT (0) +#define MODE_OUTPUT (1) +#define FRAMES_PER_BUFFER (64) +#define SAMPLE_RATE (44100.0) + +typedef struct PaQaData +{ + unsigned long framesLeft; + int numChannels; + int bytesPerSample; + int mode; +} +PaQaData; + +static int gNumPassed = 0; /* Two globals */ +static int gNumFailed = 0; + +/*------------------- Macros ------------------------------*/ +/* Print ERROR if it fails. Tally success or failure. Odd */ +/* do-while wrapper seems to be needed for some compilers. */ + +#define EXPECT(_exp) \ + do \ + { \ + if ((_exp)) {\ + gNumPassed++; \ + } \ + else { \ + printf("\nERROR - 0x%x - %s for %s\n", result, Pa_GetErrorText(result), #_exp ); \ + gNumFailed++; \ + goto error; \ + } \ + } while(0) + +#define HOPEFOR(_exp) \ + do \ + { \ + if ((_exp)) {\ + gNumPassed++; \ + } \ + else { \ + printf("\nERROR - 0x%x - %s for %s\n", result, Pa_GetErrorText(result), #_exp ); \ + gNumFailed++; \ + } \ + } while(0) + +/*-------------------------------------------------------------------------*/ +/* This routine will be called by the PortAudio engine when audio is needed. + It may be called at interrupt level on some machines so don't do anything + that could mess up the system like calling malloc() or free(). +*/ +static int QaCallback( const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData ) +{ + unsigned long i; + unsigned char* out = (unsigned char *) outputBuffer; + PaQaData* data = (PaQaData *) userData; + + (void)inputBuffer; /* Prevent "unused variable" warnings. */ + + /* Zero out buffer so we don't hear terrible noise. */ + if( data->mode == MODE_OUTPUT ) + { + unsigned long numBytes = framesPerBuffer * data->numChannels * data->bytesPerSample; + for( i=0; iframesLeft > framesPerBuffer ) + { + data->framesLeft -= framesPerBuffer; + return 0; + } + else + { + data->framesLeft = 0; + return 1; + } +} + +static PaDeviceIndex FindInputOnlyDevice(void) +{ + PaDeviceIndex result = Pa_GetDefaultInputDevice(); + if( result != paNoDevice && Pa_GetDeviceInfo(result)->maxOutputChannels == 0 ) + return result; + + for( result = 0; result < Pa_GetDeviceCount(); ++result ) + { + if( Pa_GetDeviceInfo(result)->maxOutputChannels == 0 ) + return result; + } + + return paNoDevice; +} + +static PaDeviceIndex FindOutputOnlyDevice(void) +{ + PaDeviceIndex result = Pa_GetDefaultOutputDevice(); + if( result != paNoDevice && Pa_GetDeviceInfo(result)->maxInputChannels == 0 ) + return result; + + for( result = 0; result < Pa_GetDeviceCount(); ++result ) + { + if( Pa_GetDeviceInfo(result)->maxInputChannels == 0 ) + return result; + } + + return paNoDevice; +} + +/*-------------------------------------------------------------------------------------------------*/ +static int TestBadOpens( void ) +{ + PaStream* stream = NULL; + PaError result; + PaQaData myData; + PaStreamParameters ipp, opp; + + /* Setup data for synthesis thread. */ + myData.framesLeft = (unsigned long) (SAMPLE_RATE * 100); /* 100 seconds */ + myData.numChannels = 1; + myData.mode = MODE_OUTPUT; + + /*----------------------------- No devices specified: */ + ipp.device = opp.device = paNoDevice; + ipp.channelCount = opp.channelCount = 0; /* Also no channels. */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + /* Take the low latency of the default device for all subsequent tests. */ + ipp.suggestedLatency = Pa_GetDeviceInfo(Pa_GetDefaultInputDevice())->defaultLowInputLatency; + opp.suggestedLatency = Pa_GetDeviceInfo(Pa_GetDefaultOutputDevice())->defaultLowOutputLatency; + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- No devices specified #2: */ + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, NULL, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- Out of range input device specified: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = Pa_GetDeviceCount(); /* And no output device, and no channels. */ + opp.channelCount = 0; opp.device = paNoDevice; + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, NULL, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- Out of range output device specified: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; /* And no input device, and no channels. */ + opp.channelCount = 0; opp.device = Pa_GetDeviceCount(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- Zero input channels: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = Pa_GetDefaultInputDevice(); + opp.channelCount = 0; opp.device = paNoDevice; /* And no output device, and no output channels. */ + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, NULL, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidChannelCount)); + + /*----------------------------- Zero output channels: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; /* And no input device, and no input channels. */ + opp.channelCount = 0; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidChannelCount)); + + /*----------------------------- Nonzero input and output channels but no output device: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 2; ipp.device = Pa_GetDefaultInputDevice(); /* Both stereo. */ + opp.channelCount = 2; opp.device = paNoDevice; + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- Nonzero input and output channels but no input device: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 2; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidDevice)); + + /*----------------------------- NULL stream pointer: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; /* Output is more likely than input. */ + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); /* Only 2 output channels. */ + HOPEFOR(((result = Pa_OpenStream(NULL, &ipp, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paBadStreamPtr)); + + /*----------------------------- Low sample rate: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + 1.0, FRAMES_PER_BUFFER, /* 1 cycle per second (1 Hz) is too low. */ + paClipOff, QaCallback, &myData )) == paInvalidSampleRate)); + + /*----------------------------- High sample rate: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + 10000000.0, FRAMES_PER_BUFFER, /* 10^6 cycles per second (10 MHz) is too high. */ + paClipOff, QaCallback, &myData )) == paInvalidSampleRate)); + + /*----------------------------- NULL callback: */ + /* NULL callback is valid in V19 -- it means use blocking read/write stream + + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, + NULL, + &myData )) == paNullCallback)); + */ + + /*----------------------------- Bad flag: */ + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; + opp.channelCount = 2; opp.device = Pa_GetDefaultOutputDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + 255, /* Is 8 maybe legal V19 API? */ + QaCallback, &myData )) == paInvalidFlag)); + + /*----------------------------- using input device as output device: */ + if( FindInputOnlyDevice() != paNoDevice ) + { + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 0; ipp.device = paNoDevice; /* And no input device, and no channels. */ + opp.channelCount = 2; opp.device = FindInputOnlyDevice(); + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, &opp, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidChannelCount)); + } + + /*----------------------------- using output device as input device: */ + if( FindOutputOnlyDevice() != paNoDevice ) + { + ipp.hostApiSpecificStreamInfo = opp.hostApiSpecificStreamInfo = NULL; + ipp.sampleFormat = opp.sampleFormat = paFloat32; + ipp.channelCount = 2; ipp.device = FindOutputOnlyDevice(); + opp.channelCount = 0; opp.device = paNoDevice; /* And no output device, and no channels. */ + HOPEFOR(((result = Pa_OpenStream(&stream, &ipp, NULL, + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paInvalidChannelCount)); + + } + + if( stream != NULL ) Pa_CloseStream( stream ); + return result; +} + +/*-----------------------------------------------------------------------------------------*/ +static int TestBadActions( void ) +{ + PaStream* stream = NULL; + PaError result; + PaQaData myData; + PaStreamParameters opp; + + /* Setup data for synthesis thread. */ + myData.framesLeft = (unsigned long)(SAMPLE_RATE * 100); /* 100 seconds */ + myData.numChannels = 1; + myData.mode = MODE_OUTPUT; + + opp.device = Pa_GetDefaultOutputDevice(); /* Default output. */ + opp.channelCount = 2; /* Stereo output. */ + opp.hostApiSpecificStreamInfo = NULL; + opp.sampleFormat = paFloat32; + opp.suggestedLatency = Pa_GetDeviceInfo(opp.device)->defaultLowOutputLatency; + + HOPEFOR(((result = Pa_OpenStream(&stream, NULL, /* Take NULL as input parame- */ + &opp, /* ters, meaning try only output. */ + SAMPLE_RATE, FRAMES_PER_BUFFER, + paClipOff, QaCallback, &myData )) == paNoError)); + + HOPEFOR(((result = Pa_StartStream(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_StopStream(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_IsStreamStopped(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_IsStreamActive(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_CloseStream(NULL)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_SetStreamFinishedCallback(NULL, NULL)) == paBadStreamPtr)); + HOPEFOR(((result = !Pa_GetStreamInfo(NULL)))); + HOPEFOR(((result = Pa_GetStreamTime(NULL)) == 0.0)); + HOPEFOR(((result = Pa_GetStreamCpuLoad(NULL)) == 0.0)); + HOPEFOR(((result = Pa_ReadStream(NULL, NULL, 0)) == paBadStreamPtr)); + HOPEFOR(((result = Pa_WriteStream(NULL, NULL, 0)) == paBadStreamPtr)); + + /** @todo test Pa_GetStreamReadAvailable and Pa_GetStreamWriteAvailable */ + + if (stream != NULL) Pa_CloseStream(stream); + return result; +} + +/*---------------------------------------------------------------------*/ +int main(void); +int main(void) +{ + PaError result; + + EXPECT(((result = Pa_Initialize()) == paNoError)); + TestBadOpens(); + TestBadActions(); +error: + Pa_Terminate(); + printf("QA Report: %d passed, %d failed.\n", gNumPassed, gNumFailed); + return 0; +} diff --git a/portaudio-v19/test/patest1.c b/portaudio-v19/test/patest1.c new file mode 100644 index 000000000..15fdfdd3d --- /dev/null +++ b/portaudio-v19/test/patest1.c @@ -0,0 +1,192 @@ +/** @file patest1.c + @brief Ring modulate the audio input with a sine wave for 20 seconds. + @author Ross Bencina +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define SAMPLE_RATE (44100) + +typedef struct +{ + float sine[100]; + int phase; + int sampsToGo; +} +patest1data; + +static int patest1Callback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + patest1data *data = (patest1data*)userData; + float *in = (float*)inputBuffer; + float *out = (float*)outputBuffer; + int framesToCalc = framesPerBuffer; + unsigned long i = 0; + int finished; + + if( data->sampsToGo < framesPerBuffer ) + { + framesToCalc = data->sampsToGo; + finished = paComplete; + } + else + { + finished = paContinue; + } + + for( ; isine[data->phase]; /* left */ + *out++ = *in++ * data->sine[data->phase++]; /* right */ + if( data->phase >= 100 ) + data->phase = 0; + } + + data->sampsToGo -= framesToCalc; + + /* zero remainder of final buffer if not already done */ + for( ; idefaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + &inputParameters, + &outputParameters, + (double)SAMPLE_RATE, /* Samplerate in Hertz. */ + 512, /* Small buffers */ + paClipOff, /* We won't output out of range samples so don't bother clipping them. */ + patest1Callback, + &data ); + if( err != paNoError ) goto done; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto done; + + printf( "Press any key to end.\n" ); fflush(stdout); + + getc( stdin ); /* wait for input before exiting */ + + err = Pa_AbortStream( stream ); + if( err != paNoError ) goto done; + + printf( "Waiting for stream to complete...\n" ); + + /* sleep until playback has finished */ + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(1000); + if( err < 0 ) goto done; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto done; + +done: + Pa_Terminate(); + + if( err != paNoError ) + { + fprintf( stderr, "An error occured while using portaudio\n" ); + if( err == paUnanticipatedHostError ) + { + fprintf( stderr, " unanticipated host error.\n"); + herr = Pa_GetLastHostErrorInfo(); + if (herr) + { + fprintf( stderr, " Error number: %ld\n", herr->errorCode ); + if (herr->errorText) + fprintf( stderr, " Error text: %s\n", herr->errorText ); + } + else + fprintf( stderr, " Pa_GetLastHostErrorInfo() failed!\n" ); + } + else + { + fprintf( stderr, " Error number: %d\n", err ); + fprintf( stderr, " Error text: %s\n", Pa_GetErrorText( err ) ); + } + + err = 1; /* Always return 0 or 1, but no other return codes. */ + } + + printf( "bye\n" ); + + return err; +} diff --git a/portaudio-v19/test/patest_buffer.c b/portaudio-v19/test/patest_buffer.c new file mode 100644 index 000000000..120c23fa5 --- /dev/null +++ b/portaudio-v19/test/patest_buffer.c @@ -0,0 +1,192 @@ +/** @file patest_buffer.c + @brief Test opening streams with different buffer sizes. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +#define NUM_SECONDS (3) +#define SAMPLE_RATE (44100) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) + +#define BUFFER_TABLE 14 +long buffer_table[] = {paFramesPerBufferUnspecified,16,32,64,128,200,256,500,512,600,723,1000,1024,2345}; + +typedef struct +{ + short sine[TABLE_SIZE]; + int left_phase; + int right_phase; + unsigned int sampsToGo; +} +paTestData; +PaError TestOnce( int buffersize, PaDeviceIndex ); + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patest1Callback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + short *out = (short*)outputBuffer; + unsigned int i; + int finished = 0; + (void) inputBuffer; /* Prevent "unused variable" warnings. */ + + if( data->sampsToGo < framesPerBuffer ) + { + /* final buffer... */ + + for( i=0; isampsToGo; i++ ) + { + *out++ = data->sine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + /* zero remainder of final buffer */ + for( ; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + data->sampsToGo -= framesPerBuffer; + } + return finished; +} + +/*******************************************************************/ +int main(int argc, char **args); +int main(int argc, char **args) +{ + int i; + int device = -1; + PaError err; + printf("Test opening streams with different buffer sizes\n"); + if( argc > 1 ) { + device=atoi( args[1] ); + printf("Using device number %d.\n\n", device ); + } else { + printf("Using default device.\n\n" ); + } + + for (i = 0 ; i < BUFFER_TABLE; i++) + { + printf("Buffer size %ld\n", buffer_table[i]); + err = TestOnce(buffer_table[i], device); + if( err < 0 ) return 0; + + } + return 0; +} + + +PaError TestOnce( int buffersize, PaDeviceIndex device ) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + int totalSamps; + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + buffersize, /* frames per buffer */ + (paClipOff | paDitherOff), + patest1Callback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Waiting for sound to finish.\n"); + Pa_Sleep(1000*NUM_SECONDS); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + return paNoError; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + fprintf( stderr, "Host Error message: %s\n", Pa_GetLastHostErrorInfo()->errorText ); + return err; +} diff --git a/portaudio-v19/test/patest_callbackstop.c b/portaudio-v19/test/patest_callbackstop.c new file mode 100644 index 000000000..2da642e43 --- /dev/null +++ b/portaudio-v19/test/patest_callbackstop.c @@ -0,0 +1,221 @@ +/** @file patest_callbackstop.c + @brief Test the paComplete callback result code. + @author Ross Bencina +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define NUM_LOOPS (4) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (67) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int phase; + unsigned long generatedFramesCount; + volatile int callbackReturnedPaComplete; + volatile int callbackInvokedAfterReturningPaComplete; +} +TestData; + +/* + This routine will be called by the PortAudio stream when audio is needed. + It may be called at interrupt level on some machines so don't do anything + that could mess up the system like calling malloc() or free(). +*/ +static int TestCallback( const void *input, void *output, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + TestData *data = (TestData*)userData; + float *out = (float*)output; + unsigned long i; + float x; + + (void) input; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + + + if( data->callbackReturnedPaComplete ) + data->callbackInvokedAfterReturningPaComplete = 1; + + for( i=0; isine[ data->phase++ ]; + if( data->phase >= TABLE_SIZE ) + data->phase -= TABLE_SIZE; + + *out++ = x; /* left */ + *out++ = x; /* right */ + } + + data->generatedFramesCount += frameCount; + if( data->generatedFramesCount >= (NUM_SECONDS * SAMPLE_RATE) ) + { + data->callbackReturnedPaComplete = 1; + return paComplete; + } + else + { + return paContinue; + } +} + +/*----------------------------------------------------------------------------*/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + TestData data; + int i, j; + + + printf( "PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", + SAMPLE_RATE, FRAMES_PER_BUFFER ); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* output will be in-range, so no need to clip */ + TestCallback, + &data ); + if( err != paNoError ) goto error; + + printf("Repeating test %d times.\n", NUM_LOOPS ); + + for( i=0; i < NUM_LOOPS; ++i ) + { + data.phase = 0; + data.generatedFramesCount = 0; + data.callbackReturnedPaComplete = 0; + data.callbackInvokedAfterReturningPaComplete = 0; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); + + /* wait for the callback to complete generating NUM_SECONDS of tone */ + + do + { + Pa_Sleep( 500 ); + } + while( !data.callbackReturnedPaComplete ); + + printf( "Callback returned paComplete.\n" ); + printf( "Waiting for buffers to finish playing...\n" ); + + /* wait for stream to become inactive, + or for a timeout of approximately NUM_SECONDS + */ + + j = 0; + while( (err = Pa_IsStreamActive( stream )) == 1 && j < NUM_SECONDS * 2 ) + { + printf(".\n" ); + Pa_Sleep( 500 ); + ++j; + } + + if( err < 0 ) + { + goto error; + } + else if( err == 1 ) + { + printf( "TEST FAILED: Timed out waiting for buffers to finish playing.\n" ); + } + else + { + printf("Buffers finished.\n" ); + } + + if( data.callbackInvokedAfterReturningPaComplete ) + { + printf( "TEST FAILED: Callback was invoked after returning paComplete.\n" ); + } + + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + } + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_clip.c b/portaudio-v19/test/patest_clip.c new file mode 100644 index 000000000..1d17d11b2 --- /dev/null +++ b/portaudio-v19/test/patest_clip.c @@ -0,0 +1,178 @@ +/** @file patest_clip.c + @brief Play a sine wave for several seconds at an amplitude + that would require clipping. + + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (4) +#define SAMPLE_RATE (44100) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) + +typedef struct paTestData +{ + float sine[TABLE_SIZE]; + float amplitude; + int left_phase; + int right_phase; +} +paTestData; + +PaError PlaySine( paTestData *data, unsigned long flags, float amplitude ); + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int sineCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float amplitude = data->amplitude; + unsigned int i; + (void) inputBuffer; /* Prevent "unused variable" warnings. */ + (void) timeInfo; + (void) statusFlags; + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = amplitude * data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + return 0; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData data; + int i; + + printf("PortAudio Test: output sine wave with and without clipping.\n"); + /* initialise sinusoidal wavetable */ + for( i=0; ileft_phase = data->right_phase = 0; + data->amplitude = amplitude; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + 1024, + flags, + sineCallback, + data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + Pa_Sleep( NUM_SECONDS * 1000 ); + printf("CPULoad = %8.6f\n", Pa_GetStreamCpuLoad( stream ) ); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + return paNoError; +error: + return err; +} diff --git a/portaudio-v19/test/patest_dither.c b/portaudio-v19/test/patest_dither.c new file mode 100644 index 000000000..10f03e42b --- /dev/null +++ b/portaudio-v19/test/patest_dither.c @@ -0,0 +1,178 @@ +/** @file patest_dither.c + @brief Attempt to hear difference between dithered and non-dithered signal. + + This only has an effect if the native format is 16 bit. + + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include + +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define SAMPLE_RATE (44100) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) + +typedef struct paTestData +{ + float sine[TABLE_SIZE]; + float amplitude; + int left_phase; + int right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int sineCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo, + PaStreamCallbackFlags statusFlags, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float amplitude = data->amplitude; + unsigned int i; + (void) inputBuffer; + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = amplitude * data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + return 0; +} + +/*****************************************************************************/ +/* + V18 version did not call Pa_Terminate() if Pa_Initialize() failed. + This V19 version ALWAYS calls Pa_Terminate(). PS. +*/ +PaError PlaySine( paTestData *data, PaStreamFlags flags, float amplitude ); +PaError PlaySine( paTestData *data, PaStreamFlags flags, float amplitude ) +{ + PaStream* stream; + PaStreamParameters outputParameters; + PaError err; + + data->left_phase = data->right_phase = 0; + data->amplitude = amplitude; + + err = Pa_Initialize(); + if (err != paNoError) + goto done; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output. */ + /* When you change this, also */ + /* adapt the callback routine! */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device ) + ->defaultLowOutputLatency; /* Low latency. */ + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, + SAMPLE_RATE, + 1024, /* frames per buffer */ + flags, + sineCallback, + (void*)data ); + if (err != paNoError) + goto done; + + err = Pa_StartStream( stream ); + if (err != paNoError) + goto done; + + Pa_Sleep( NUM_SECONDS * 1000 ); + printf("CPULoad = %8.6f\n", Pa_GetStreamCpuLoad(stream)); + + err = Pa_CloseStream( stream ); +done: + Pa_Sleep( 250 ); /* Just a small silence. */ + Pa_Terminate(); + return err; +} + + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + paTestData DATA; + int i; + float amplitude = 4.0 / (1<<15); + + printf("PortAudio Test: output EXTREMELY QUIET sine wave with and without dithering.\n"); + /* initialise sinusoidal wavetable */ + for( i=0; i + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include + +#include "portaudio.h" + +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +typedef struct paTestData +{ + int sleepFor; + double phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + double phaseInc = 0.02; + double phase = data->phase; + + (void) inputBuffer; /* Prevent unused argument warning. */ + + for( i=0; i TWOPI ) phase -= TWOPI; + /* This is not a very efficient way to calc sines. */ + *out++ = (float) sin( phase ); /* mono */ + } + + if( data->sleepFor > 0 ) + { + Pa_Sleep( data->sleepFor ); + } + + data->phase = phase; + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream* stream; + PaStreamParameters outputParameters; + PaError err; + int i; + paTestData data = {0}; + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", + SAMPLE_RATE, FRAMES_PER_BUFFER ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Default output device. */ + outputParameters.channelCount = 1; /* Mono output. */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point. */ + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device) + ->defaultLowOutputLatency; + err = Pa_OpenStream(&stream, + NULL, /* No input. */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* No out of range samples. */ + patestCallback, + &data); + if (err != paNoError) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + /* Gradually increase sleep time. */ + /* Was: for( i=0; i<10000; i+= 1000 ) */ + for(i=0; i <= 1000; i += 100) + { + printf("Sleep for %d milliseconds in audio callback.\n", i ); + data.sleepFor = i; + Pa_Sleep( ((i<1000) ? 1000 : i) ); + } + + printf("Suffer for 10 seconds.\n"); + Pa_Sleep( 10000 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_in_overflow.c b/portaudio-v19/test/patest_in_overflow.c new file mode 100644 index 000000000..a0be2c6a1 --- /dev/null +++ b/portaudio-v19/test/patest_in_overflow.c @@ -0,0 +1,224 @@ +/** @file patest_in_overflow.c + @brief Count input overflows (using paInputOverflow flag) under + overloaded and normal conditions. + This test uses the same method to overload the stream as does + patest_out_underflow.c -- it generates sine waves until the cpu load + exceeds a certain level. However this test is only concerned with + input and so doesn't ouput any sound. + + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2004 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define MAX_SINES (500) +#define MAX_LOAD (1.2) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +typedef struct paTestData +{ + int sineCount; + double phases[MAX_SINES]; + int countOverflows; + int inputOverflowCount; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float out; /* variable to hold dummy output */ + unsigned long i; + int j; + int finished = paContinue; + (void) timeInfo; /* Prevent unused variable warning. */ + (void) inputBuffer; /* Prevent unused variable warning. */ + (void) outputBuffer; /* Prevent unused variable warning. */ + + if( data->countOverflows && (statusFlags & paInputOverflow) ) + data->inputOverflowCount++; + + for( i=0; isineCount; j++ ) + { + /* Advance phase of next oscillator. */ + phase = data->phases[j]; + phase += phaseInc; + if( phase > TWOPI ) phase -= TWOPI; + + phaseInc *= 1.02; + if( phaseInc > 0.5 ) phaseInc *= 0.5; + + /* This is not a very efficient way to calc sines. */ + output += (float) sin( phase ); + data->phases[j] = phase; + } + /* this is an input-only stream so we don't actually use the output */ + out = (float) (output / data->sineCount); + (void) out; /* suppress unused variable warning*/ + } + + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters inputParameters; + PaStream *stream; + PaError err; + int safeSineCount, stressedSineCount; + int safeOverflowCount, stressedOverflowCount; + paTestData data = {0}; + double load; + + + printf("PortAudio Test: input only, no sound output. Load callback by performing calculations, count input overflows. SR = %d, BufSize = %d. MAX_LOAD = %f\n", + SAMPLE_RATE, FRAMES_PER_BUFFER, (float)MAX_LOAD ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */ + inputParameters.channelCount = 1; /* mono output */ + inputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + &inputParameters, + NULL, /* no output */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Establishing load conditions...\n" ); + + /* Determine number of sines required to get to 50% */ + do + { + data.sineCount++; + Pa_Sleep( 100 ); + + load = Pa_GetStreamCpuLoad( stream ); + printf("sineCount = %d, CPU load = %f\n", data.sineCount, load ); + } + while( load < 0.5 && data.sineCount < (MAX_SINES-1)); + + safeSineCount = data.sineCount; + + /* Calculate target stress value then ramp up to that level*/ + stressedSineCount = (int) (2.0 * data.sineCount * MAX_LOAD ); + if( stressedSineCount > MAX_SINES ) + stressedSineCount = MAX_SINES; + for( ; data.sineCount < stressedSineCount; data.sineCount++ ) + { + Pa_Sleep( 100 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("STRESSING: sineCount = %d, CPU load = %f\n", data.sineCount, load ); + } + + printf("Counting overflows for 5 seconds.\n"); + data.countOverflows = 1; + Pa_Sleep( 5000 ); + + stressedOverflowCount = data.inputOverflowCount; + + data.countOverflows = 0; + data.sineCount = safeSineCount; + + printf("Resuming safe load...\n"); + Pa_Sleep( 1500 ); + data.inputOverflowCount = 0; + Pa_Sleep( 1500 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("sineCount = %d, CPU load = %f\n", data.sineCount, load ); + + printf("Counting overflows for 5 seconds.\n"); + data.countOverflows = 1; + Pa_Sleep( 5000 ); + + safeOverflowCount = data.inputOverflowCount; + + printf("Stop stream.\n"); + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + + if( stressedOverflowCount == 0 ) + printf("Test failed, no input overflows detected under stress.\n"); + else if( safeOverflowCount != 0 ) + printf("Test failed, %d unexpected overflows detected under safe load.\n", safeOverflowCount); + else + printf("Test passed, %d expected input overflows detected under stress, 0 unexpected overflows detected under safe load.\n", stressedOverflowCount ); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_latency.c b/portaudio-v19/test/patest_latency.c new file mode 100644 index 000000000..f4225112a --- /dev/null +++ b/portaudio-v19/test/patest_latency.c @@ -0,0 +1,182 @@ +/** @file + @brief Hear the latency caused by big buffers. + Play a sine wave and change frequency based on letter input. + @author Phil Burk , and Darren Gibbs +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDevice()) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (64) + +#define MIN_FREQ (100.0f) +#define CalcPhaseIncrement(freq) ((freq)/SAMPLE_RATE) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (400) + +typedef struct +{ + float sine[TABLE_SIZE + 1]; /* add one for guard point for interpolation */ + float phase_increment; + float left_phase; + float right_phase; +} +paTestData; + +float LookupSine( paTestData *data, float phase ); +/* Convert phase between and 1.0 to sine value + * using linear interpolation. + */ +float LookupSine( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->sine[index]; + float hi = data->sine[index+1]; + float val = lo + fract*(hi-lo); + return val; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int i; + + (void) inputBuffer; /* Prevent unused variable warning. */ + + for( i=0; ileft_phase); /* left */ + *out++ = LookupSine(data, data->right_phase); /* right */ + data->left_phase += data->phase_increment; + if( data->left_phase >= 1.0f ) data->left_phase -= 1.0f; + data->right_phase += (data->phase_increment * 1.5f); /* fifth above */ + if( data->right_phase >= 1.0f ) data->right_phase -= 1.0f; + } + return 0; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream *stream; + PaStreamParameters outputParameters; + PaError err; + paTestData data; + int i; + int done = 0; + + printf("PortAudio Test: enter letter then hit ENTER.\n" ); + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + printf("Requested output latency = %.4f seconds.\n", outputParameters.suggestedLatency ); + printf("%d frames per buffer.\n.", FRAMES_PER_BUFFER ); + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff|paDitherOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Play ASCII keyboard. Hit 'q' to stop. (Use RETURN key on Mac)\n"); + fflush(stdout); + while ( !done ) + { + float freq; + int index; + char c; + do + { + c = getchar(); + } + while( c < ' '); /* Strip white space and control chars. */ + + if( c == 'q' ) done = 1; + index = c % 26; + freq = MIN_FREQ + (index * 40.0); + data.phase_increment = CalcPhaseIncrement(freq); + } + printf("Call Pa_StopStream()\n"); + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_leftright.c b/portaudio-v19/test/patest_leftright.c new file mode 100644 index 000000000..158223649 --- /dev/null +++ b/portaudio-v19/test/patest_leftright.c @@ -0,0 +1,173 @@ +/** @file patest_leftright.c + @brief Play different tone sine waves that + alternate between left and right channel. + + The low tone should be on the left channel. + + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (8) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; + int toggle; + int countDown; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, + void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + /* Prevent unused variable warnings. */ + (void) inputBuffer; + + for( i=0; itoggle ) + { + *out++ = data->sine[data->left_phase]; /* left */ + *out++ = 0; /* right */ + } + else + { + *out++ = 0; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + } + + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + + if( data->countDown < 0 ) + { + data->countDown = SAMPLE_RATE; + data->toggle = !data->toggle; + } + data->countDown -= framesPerBuffer; + + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream *stream; + PaStreamParameters outputParameters; + PaError err; + paTestData data; + int i; + int timeout; + + printf("Play different tone sine waves that alternate between left and right channel.\n"); + printf("The low tone should be on the left channel.\n"); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, /* As above. */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for several seconds.\n"); + timeout = NUM_SECONDS * 4; + while( timeout > 0 ) + { + Pa_Sleep( 300 ); /*(Irix very much likes sleeps <= 1000 ms.)*/ + timeout -= 1; + } + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_longsine.c b/portaudio-v19/test/patest_longsine.c new file mode 100644 index 000000000..3a6ec39ef --- /dev/null +++ b/portaudio-v19/test/patest_longsine.c @@ -0,0 +1,140 @@ +/** @file patest_longsine.c + @brief Play a sine wave until ENTER hit. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include + +#include "portaudio.h" + +#define SAMPLE_RATE (44100) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback(const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + (void) inputBuffer; /* Prevent unused argument warning. */ + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + return 0; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + printf("PortAudio Test: output sine wave.\n"); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, /* As above. */ + SAMPLE_RATE, + 256, /* Frames per buffer. */ + paClipOff, /* No out of range samples expected. */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Hit ENTER to stop program.\n"); + getchar(); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + + printf("Test finished.\n"); + return err; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_many.c b/portaudio-v19/test/patest_many.c new file mode 100644 index 000000000..6a678467b --- /dev/null +++ b/portaudio-v19/test/patest_many.c @@ -0,0 +1,198 @@ +/** @file patest_many.c + @brief Start and stop the PortAudio Driver multiple times. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include +#include "portaudio.h" +#define NUM_SECONDS (1) +#define SAMPLE_RATE (44100) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (200) +typedef struct +{ + short sine[TABLE_SIZE]; + int left_phase; + int right_phase; + unsigned int sampsToGo; +} +paTestData; +PaError TestOnce( void ); +static int patest1Callback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patest1Callback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + short *out = (short*)outputBuffer; + unsigned int i; + int finished = 0; + (void) inputBuffer; /* Prevent "unused variable" warnings. */ + + if( data->sampsToGo < framesPerBuffer ) + { + /* final buffer... */ + + for( i=0; isampsToGo; i++ ) + { + *out++ = data->sine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + /* zero remainder of final buffer */ + for( ; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + data->sampsToGo -= framesPerBuffer; + } + return finished; +} +/*******************************************************************/ +#ifdef MACINTOSH +int main(void); +int main(void) +{ + int i; + PaError err; + int numLoops = 10; + printf("Loop %d times.\n", numLoops ); + for( i=0; i 1 ) + { + numLoops = atoi(argv[1]); + } + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + 1024, /* frames per buffer */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patest1Callback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Waiting for sound to finish.\n"); + Pa_Sleep(1000); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + return paNoError; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_maxsines.c b/portaudio-v19/test/patest_maxsines.c new file mode 100644 index 000000000..56592ea47 --- /dev/null +++ b/portaudio-v19/test/patest_maxsines.c @@ -0,0 +1,204 @@ +/** @file patest_maxsines.c + @brief How many sine waves can we calculate and play in less than 80% CPU Load. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define MAX_SINES (500) +#define MAX_USAGE (0.8) +#define SAMPLE_RATE (44100) +#define FREQ_TO_PHASE_INC(freq) (freq/(float)SAMPLE_RATE) + +#define MIN_PHASE_INC FREQ_TO_PHASE_INC(200.0f) +#define MAX_PHASE_INC (MIN_PHASE_INC * (1 << 5)) + +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +#define TABLE_SIZE (512) + +typedef struct paTestData +{ + int numSines; + float sine[TABLE_SIZE + 1]; /* add one for guard point for interpolation */ + float phases[MAX_SINES]; +} +paTestData; + +/* Convert phase between and 1.0 to sine value + * using linear interpolation. + */ +float LookupSine( paTestData *data, float phase ); +float LookupSine( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->sine[index]; + float hi = data->sine[index+1]; + float val = lo + fract*(hi-lo); + return val; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback(const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float outSample; + float scaler; + int numForScale; + unsigned long i; + int j; + int finished = 0; + (void) inputBuffer; /* Prevent unused argument warning. */ + + /* Determine amplitude scaling factor */ + numForScale = data->numSines; + if( numForScale < 8 ) numForScale = 8; /* prevent pops at beginning */ + scaler = 1.0f / numForScale; + + for( i=0; inumSines; j++ ) + { + /* Advance phase of next oscillator. */ + phase = data->phases[j]; + phase += phaseInc; + if( phase >= 1.0 ) phase -= 1.0; + + output += LookupSine(data, phase); + data->phases[j] = phase; + + phaseInc *= 1.02f; + if( phaseInc > MAX_PHASE_INC ) phaseInc = MIN_PHASE_INC; + } + + outSample = (float) (output * scaler); + *out++ = outSample; /* Left */ + *out++ = outSample; /* Right */ + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + int i; + PaStream* stream; + PaStreamParameters outputParameters; + PaError err; + paTestData data = {0}; + double load; + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultHighOutputLatency; + err = Pa_OpenStream(&stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* No out of range samples should occur. */ + patestCallback, + &data); + if( err != paNoError ) + goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) + goto error; + + /* Play an increasing number of sine waves until we hit MAX_USAGE */ + do { + data.numSines++; + Pa_Sleep(200); + load = Pa_GetStreamCpuLoad(stream); + printf("numSines = %d, CPU load = %f\n", data.numSines, load ); + fflush(stdout); + } while((load < MAX_USAGE) && (data.numSines < MAX_SINES)); + + Pa_Sleep(2000); /* Stay for 2 seconds around 80% CPU. */ + + err = Pa_StopStream( stream ); + if( err != paNoError ) + goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) + goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_mono.c b/portaudio-v19/test/patest_mono.c new file mode 100644 index 000000000..e7b57362f --- /dev/null +++ b/portaudio-v19/test/patest_mono.c @@ -0,0 +1,145 @@ +/* + * $Id$ + * patest_sine.c + * Play a monophonic sine wave using the Portable Audio api for several seconds. + * + * Authors: + * Ross Bencina + * Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (10) +#define SAMPLE_RATE (44100) +#define AMPLITUDE (0.8) +#define FRAMES_PER_BUFFER (64) +#define OUTPUT_DEVICE Pa_GetDefaultOutputDevice() + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + /* avoid unused variable warnings */ + (void) inputBuffer; + (void) timeInfo; + (void) statusFlags; + for( i=0; isine[data->phase]; /* left */ + data->phase += 1; + if( data->phase >= TABLE_SIZE ) data->phase -= TABLE_SIZE; + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + printf("PortAudio Test: output MONO sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); fflush(stdout); + Pa_Sleep( NUM_SECONDS * 1000 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} \ No newline at end of file diff --git a/portaudio-v19/test/patest_mono_asio_channel_select.c b/portaudio-v19/test/patest_mono_asio_channel_select.c new file mode 100644 index 000000000..4c4ffccdf --- /dev/null +++ b/portaudio-v19/test/patest_mono_asio_channel_select.c @@ -0,0 +1,155 @@ +/* + * $Id$ + * patest_sine.c + * Play a monophonic sine wave using the Portable Audio api for several seconds. + * + * Authors: + * Ross Bencina + * Phil Burk + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#include "pa_asio.h" + +#define NUM_SECONDS (10) +#define SAMPLE_RATE (44100) +#define AMPLITUDE (0.8) +#define FRAMES_PER_BUFFER (64) +#define OUTPUT_DEVICE Pa_GetDefaultOutputDevice() + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + /* avoid unused variable warnings */ + (void) inputBuffer; + (void) timeInfo; + (void) statusFlags; + for( i=0; isine[data->phase]; /* left */ + data->phase += 1; + if( data->phase >= TABLE_SIZE ) data->phase -= TABLE_SIZE; + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaAsioStreamInfo asioOutputInfo; + PaStream *stream; + PaError err; + paTestData data; + int outputChannelSelectors[1]; + int i; + printf("PortAudio Test: output MONO sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + + asioOutputInfo.size = sizeof(PaAsioStreamInfo); + asioOutputInfo.hostApiType = paASIO; + asioOutputInfo.version = 1; + asioOutputInfo.flags = paAsioUseChannelSelectors; + outputChannelSelectors[0] = 1; /* select the second (right) ASIO device channel */ + asioOutputInfo.channelSelectors = outputChannelSelectors; + outputParameters.hostApiSpecificStreamInfo = &asioOutputInfo; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); fflush(stdout); + Pa_Sleep( NUM_SECONDS * 1000 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_multi_sine.c b/portaudio-v19/test/patest_multi_sine.c new file mode 100644 index 000000000..161c88222 --- /dev/null +++ b/portaudio-v19/test/patest_multi_sine.c @@ -0,0 +1,194 @@ +/** @file patest_multi_sine.c + @brief Play a different sine wave on each channel. + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include + +#include "portaudio.h" + +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#define FREQ_INCR (300.0 / SAMPLE_RATE) +#define MAX_CHANNELS (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ + short interleaved; /* Nonzero for interleaved / zero for non-interleaved. */ + int numChannels; /* Actually used. */ + double phases[MAX_CHANNELS]; /* Each channel gets its' own frequency. */ +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback(const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData) +{ + int frameIndex, channelIndex; + float** outputs = (float**)outputBuffer; + paTestData* data = (paTestData*)userData; + + (void) inputBuffer; /* Prevent unused arg warning. */ + if (data->interleaved) + { + float *out = (float*)outputBuffer; /* interleaved version */ + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + for( channelIndex=0; channelIndexnumChannels; channelIndex++ ) + { + /* Output sine wave on every channel. */ + *out++ = (float) sin(data->phases[channelIndex]); + + /* Play each channel at a higher frequency. */ + data->phases[channelIndex] += FREQ_INCR * (4 + channelIndex); + if( data->phases[channelIndex] >= (2.0 * M_PI) ) data->phases[channelIndex] -= (2.0 * M_PI); + } + } + } + else + { + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + for( channelIndex=0; channelIndexnumChannels; channelIndex++ ) + { + /* Output sine wave on every channel. */ + outputs[channelIndex][frameIndex] = (float) sin(data->phases[channelIndex]); + + /* Play each channel at a higher frequency. */ + data->phases[channelIndex] += FREQ_INCR * (4 + channelIndex); + if( data->phases[channelIndex] >= (2.0 * M_PI) ) data->phases[channelIndex] -= (2.0 * M_PI); + } + } + } + return 0; +} + +/*******************************************************************/ +int test(short interleaved) +{ + PaStream* stream; + PaStreamParameters outputParameters; + PaError err; + const PaDeviceInfo* pdi; + paTestData data; + short n; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Default output device, max channels. */ + pdi = Pa_GetDeviceInfo(outputParameters.device); + outputParameters.channelCount = pdi->maxOutputChannels; + if (outputParameters.channelCount > MAX_CHANNELS) + outputParameters.channelCount = MAX_CHANNELS; + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = pdi->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + data.interleaved = interleaved; + data.numChannels = outputParameters.channelCount; + for (n = 0; n < data.numChannels; n++) + data.phases[n] = 0.0; /* Phases wrap and maybe don't need initialisation. */ + printf("%d ", data.numChannels); + if (interleaved) + printf("interleaved "); + else + { + printf(" non-interleaved "); + outputParameters.sampleFormat |= paNonInterleaved; + } + printf("channels.\n"); + + err = Pa_OpenStream(&stream, + NULL, /* No input. */ + &outputParameters, + SAMPLE_RATE, /* Sample rate. */ + FRAMES_PER_BUFFER, /* Frames per buffer. */ + paClipOff, /* Samples never out of range, no clipping. */ + patestCallback, + &data); + if (err == paNoError) + { + err = Pa_StartStream(stream); + if (err == paNoError) + { + printf("Hit ENTER to stop this test.\n"); + getchar(); + err = Pa_StopStream(stream); + } + Pa_CloseStream( stream ); + } + return err; +} + + +/*******************************************************************/ +int main(void) +{ + PaError err; + + printf("PortAudio Test: output sine wave on each channel.\n" ); + + err = Pa_Initialize(); + if (err != paNoError) + goto done; + + err = test(1); /* 1 means interleaved. */ + if (err != paNoError) + goto done; + + err = test(0); /* 0 means not interleaved. */ + if (err != paNoError) + goto done; + + printf("Test finished.\n"); +done: + if (err) + { + fprintf(stderr, "An error occured while using the portaudio stream\n"); + fprintf(stderr, "Error number: %d\n", err ); + fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(err)); + } + Pa_Terminate(); + return 0; +} diff --git a/portaudio-v19/test/patest_out_underflow.c b/portaudio-v19/test/patest_out_underflow.c new file mode 100644 index 000000000..8e6f27897 --- /dev/null +++ b/portaudio-v19/test/patest_out_underflow.c @@ -0,0 +1,217 @@ +/** @file patest_out_underflow.c + @brief Count output underflows (using paOutputUnderflow flag) + under overloaded and normal conditions. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2004 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define MAX_SINES (500) +#define MAX_LOAD (1.2) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +typedef struct paTestData +{ + int sineCount; + double phases[MAX_SINES]; + int countUnderflows; + int outputUnderflowCount; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int j; + int finished = paContinue; + (void) timeInfo; /* Prevent unused variable warning. */ + (void) inputBuffer; /* Prevent unused variable warning. */ + + + if( data->countUnderflows && (statusFlags & paOutputUnderflow) ) + data->outputUnderflowCount++; + + for( i=0; isineCount; j++ ) + { + /* Advance phase of next oscillator. */ + phase = data->phases[j]; + phase += phaseInc; + if( phase > TWOPI ) phase -= TWOPI; + + phaseInc *= 1.02; + if( phaseInc > 0.5 ) phaseInc *= 0.5; + + /* This is not a very efficient way to calc sines. */ + output += (float) sin( phase ); + data->phases[j] = phase; + } + *out++ = (float) (output / data->sineCount); + } + + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + int safeSineCount, stressedSineCount; + int safeUnderflowCount, stressedUnderflowCount; + paTestData data = {0}; + double load; + + + printf("PortAudio Test: output sine waves, count underflows. SR = %d, BufSize = %d. MAX_LOAD = %f\n", + SAMPLE_RATE, FRAMES_PER_BUFFER, (float)MAX_LOAD ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 1; /* mono output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Establishing load conditions...\n" ); + + /* Determine number of sines required to get to 50% */ + do + { + data.sineCount++; + Pa_Sleep( 100 ); + + load = Pa_GetStreamCpuLoad( stream ); + printf("sineCount = %d, CPU load = %f\n", data.sineCount, load ); + } + while( load < 0.5 && data.sineCount < (MAX_SINES-1)); + + safeSineCount = data.sineCount; + + /* Calculate target stress value then ramp up to that level*/ + stressedSineCount = (int) (2.0 * data.sineCount * MAX_LOAD ); + if( stressedSineCount > MAX_SINES ) + stressedSineCount = MAX_SINES; + for( ; data.sineCount < stressedSineCount; data.sineCount++ ) + { + Pa_Sleep( 100 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("STRESSING: sineCount = %d, CPU load = %f\n", data.sineCount, load ); + } + + printf("Counting underflows for 5 seconds.\n"); + data.countUnderflows = 1; + Pa_Sleep( 5000 ); + + stressedUnderflowCount = data.outputUnderflowCount; + + data.countUnderflows = 0; + data.sineCount = safeSineCount; + + printf("Resuming safe load...\n"); + Pa_Sleep( 1500 ); + data.outputUnderflowCount = 0; + Pa_Sleep( 1500 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("sineCount = %d, CPU load = %f\n", data.sineCount, load ); + + printf("Counting underflows for 5 seconds.\n"); + data.countUnderflows = 1; + Pa_Sleep( 5000 ); + + safeUnderflowCount = data.outputUnderflowCount; + + printf("Stop stream.\n"); + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + + if( stressedUnderflowCount == 0 ) + printf("Test failed, no output underflows detected under stress.\n"); + else if( safeUnderflowCount != 0 ) + printf("Test failed, %d unexpected underflows detected under safe load.\n", safeUnderflowCount); + else + printf("Test passed, %d expected output underflows detected under stress, 0 unexpected underflows detected under safe load.\n", stressedUnderflowCount ); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_pink.c b/portaudio-v19/test/patest_pink.c new file mode 100644 index 000000000..f2db85d9c --- /dev/null +++ b/portaudio-v19/test/patest_pink.c @@ -0,0 +1,269 @@ +/** @file patest_pink.c + @brief Generate Pink Noise using Gardner method. + + Optimization suggested by James McCartney uses a tree + to select which random value to replace. +
    +	x x x x x x x x x x x x x x x x 
    +	x   x   x   x   x   x   x   x   
    +	x       x       x       x       
    +	 x               x               
    +	   x   
    +
    + Tree is generated by counting trailing zeros in an increasing index. + When the index is zero, no random number is selected. + + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +#define PINK_MAX_RANDOM_ROWS (30) +#define PINK_RANDOM_BITS (24) +#define PINK_RANDOM_SHIFT ((sizeof(long)*8)-PINK_RANDOM_BITS) + +typedef struct +{ + long pink_Rows[PINK_MAX_RANDOM_ROWS]; + long pink_RunningSum; /* Used to optimize summing of generators. */ + int pink_Index; /* Incremented each sample. */ + int pink_IndexMask; /* Index wrapped by ANDing with this mask. */ + float pink_Scalar; /* Used to scale within range of -1.0 to +1.0 */ +} +PinkNoise; + +/* Prototypes */ +static unsigned long GenerateRandomNumber( void ); +void InitializePinkNoise( PinkNoise *pink, int numRows ); +float GeneratePinkNoise( PinkNoise *pink ); + +/************************************************************/ +/* Calculate pseudo-random 32 bit number based on linear congruential method. */ +static unsigned long GenerateRandomNumber( void ) +{ + /* Change this seed for different random sequences. */ + static unsigned long randSeed = 22222; + randSeed = (randSeed * 196314165) + 907633515; + return randSeed; +} + +/************************************************************/ +/* Setup PinkNoise structure for N rows of generators. */ +void InitializePinkNoise( PinkNoise *pink, int numRows ) +{ + int i; + long pmax; + pink->pink_Index = 0; + pink->pink_IndexMask = (1<pink_Scalar = 1.0f / pmax; + /* Initialize rows. */ + for( i=0; ipink_Rows[i] = 0; + pink->pink_RunningSum = 0; +} + +#define PINK_MEASURE +#ifdef PINK_MEASURE +float pinkMax = -999.0; +float pinkMin = 999.0; +#endif + +/* Generate Pink noise values between -1.0 and +1.0 */ +float GeneratePinkNoise( PinkNoise *pink ) +{ + long newRandom; + long sum; + float output; + /* Increment and mask index. */ + pink->pink_Index = (pink->pink_Index + 1) & pink->pink_IndexMask; + /* If index is zero, don't update any random values. */ + if( pink->pink_Index != 0 ) + { + /* Determine how many trailing zeros in PinkIndex. */ + /* This algorithm will hang if n==0 so test first. */ + int numZeros = 0; + int n = pink->pink_Index; + while( (n & 1) == 0 ) + { + n = n >> 1; + numZeros++; + } + /* Replace the indexed ROWS random value. + * Subtract and add back to RunningSum instead of adding all the random + * values together. Only one changes each time. + */ + pink->pink_RunningSum -= pink->pink_Rows[numZeros]; + newRandom = ((long)GenerateRandomNumber()) >> PINK_RANDOM_SHIFT; + pink->pink_RunningSum += newRandom; + pink->pink_Rows[numZeros] = newRandom; + } + + /* Add extra white noise value. */ + newRandom = ((long)GenerateRandomNumber()) >> PINK_RANDOM_SHIFT; + sum = pink->pink_RunningSum + newRandom; + /* Scale to range of -1.0 to 0.9999. */ + output = pink->pink_Scalar * sum; +#ifdef PINK_MEASURE + /* Check Min/Max */ + if( output > pinkMax ) pinkMax = output; + else if( output < pinkMin ) pinkMin = output; +#endif + return output; +} + +/*******************************************************************/ +#define PINK_TEST +#ifdef PINK_TEST + +/* Context for callback routine. */ +typedef struct +{ + PinkNoise leftPink; + PinkNoise rightPink; + unsigned int sampsToGo; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback(const void* inputBuffer, + void* outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void* userData) +{ + int finished; + int i; + int numFrames; + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + (void) inputBuffer; /* Prevent "unused variable" warnings. */ + + /* Are we almost at end. */ + if( data->sampsToGo < framesPerBuffer ) + { + numFrames = data->sampsToGo; + finished = 1; + } + else + { + numFrames = framesPerBuffer; + finished = 0; + } + for( i=0; ileftPink ); + *out++ = GeneratePinkNoise( &data->rightPink ); + } + data->sampsToGo -= numFrames; + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream* stream; + PaError err; + paTestData data; + PaStreamParameters outputParameters; + int totalSamps; + static const double SR = 44100.0; + static const int FPB = 2048; /* Frames per buffer: 46 ms buffers. */ + + /* Initialize two pink noise signals with different numbers of rows. */ + InitializePinkNoise( &data.leftPink, 12 ); + InitializePinkNoise( &data.rightPink, 16 ); + + /* Look at a few values. */ + { + int i; + float pink; + for( i=0; i<20; i++ ) + { + pink = GeneratePinkNoise( &data.leftPink ); + printf("Pink = %f\n", pink ); + } + } + + data.sampsToGo = totalSamps = (int)(60.0 * SR); /* Play a whole minute. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + /* Open a stereo PortAudio stream so we can hear the result. */ + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Take the default output device. */ + outputParameters.channelCount = 2; /* Stereo output, most likely supported. */ + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output. */ + outputParameters.suggestedLatency = + Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency; + err = Pa_OpenStream(&stream, + NULL, /* No input. */ + &outputParameters, + SR, /* Sample rate. */ + FPB, /* Frames per buffer. */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Stereo pink noise for one minute...\n"); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(100); + if( err < 0 ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; +#ifdef PINK_MEASURE + printf("Pink min = %f, max = %f\n", pinkMin, pinkMax ); +#endif + Pa_Terminate(); + return 0; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return 0; +} +#endif /* PINK_TEST */ diff --git a/portaudio-v19/test/patest_prime.c b/portaudio-v19/test/patest_prime.c new file mode 100644 index 000000000..47d1f5f56 --- /dev/null +++ b/portaudio-v19/test/patest_prime.c @@ -0,0 +1,223 @@ +/** @file patest_prime.c + @brief Test stream priming mode. + @author Ross Bencina http://www.audiomulch.com/~rossb +*/ + +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" +#include "pa_util.h" + +#define NUM_BEEPS (3) +#define SAMPLE_RATE (44100) +#define SAMPLE_PERIOD (1.0/44100.0) +#define FRAMES_PER_BUFFER (256) +#define BEEP_DURATION (400) +#define IDLE_DURATION (SAMPLE_RATE*2) /* 2 seconds */ +#define SLEEP_MSEC (50) + +#define STATE_BKG_IDLE (0) +#define STATE_BKG_BEEPING (1) + +typedef struct +{ + float leftPhase; + float rightPhase; + int state; + int beepCountdown; + int idleCountdown; +} +paTestData; + +static void InitializeTestData( paTestData *testData ) +{ + testData->leftPhase = 0; + testData->rightPhase = 0; + testData->state = STATE_BKG_BEEPING; + testData->beepCountdown = BEEP_DURATION; + testData->idleCountdown = IDLE_DURATION; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo, + PaStreamCallbackFlags statusFlags, void *userData ) +{ + /* Cast data passed through stream to our structure. */ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + int result = paContinue; + + /* supress unused parameter warnings */ + (void) inputBuffer; + (void) timeInfo; + (void) statusFlags; + + for( i=0; istate ) + { + case STATE_BKG_IDLE: + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + --data->idleCountdown; + + if( data->idleCountdown <= 0 ) result = paComplete; + break; + + case STATE_BKG_BEEPING: + if( data->beepCountdown <= 0 ) + { + data->state = STATE_BKG_IDLE; + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + } + else + { + /* Play sawtooth wave. */ + *out++ = data->leftPhase; /* left */ + *out++ = data->rightPhase; /* right */ + /* Generate simple sawtooth phaser that ranges between -1.0 and 1.0. */ + data->leftPhase += 0.01f; + /* When signal reaches top, drop back down. */ + if( data->leftPhase >= 1.0f ) data->leftPhase -= 2.0f; + /* higher pitch so we can distinguish left and right. */ + data->rightPhase += 0.03f; + if( data->rightPhase >= 1.0f ) data->rightPhase -= 2.0f; + } + --data->beepCountdown; + break; + } + } + + return result; +} + +/*******************************************************************/ +static PaError DoTest( int flags ) +{ + PaStream *stream; + PaError err; + paTestData data; + PaStreamParameters outputParameters; + + InitializeTestData( &data ); + + outputParameters.device = Pa_GetDefaultOutputDevice(); + outputParameters.channelCount = 2; + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.sampleFormat = paFloat32; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency; + + /* Open an audio I/O stream. */ + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + paClipOff | flags, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("hear \"BEEP\"\n" ); + fflush(stdout); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(SLEEP_MSEC); + if( err < 0 ) goto error; + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + return err; +error: + return err; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err = paNoError; + int i; + + /* Initialize library before making any other calls. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + printf("PortAudio Test: Testing stream playback with no priming.\n"); + printf("PortAudio Test: you should see BEEP before you hear it.\n"); + printf("BEEP %d times.\n", NUM_BEEPS ); + + for( i=0; i< NUM_BEEPS; ++i ) + { + err = DoTest( 0 ); + if( err != paNoError ) + goto error; + } + + printf("PortAudio Test: Testing stream playback with priming.\n"); + printf("PortAudio Test: you should see BEEP around the same time you hear it.\n"); + for( i=0; i< NUM_BEEPS; ++i ) + { + err = DoTest( paPrimeOutputBuffersUsingStreamCallback ); + if( err != paNoError ) + goto error; + } + + printf("Test finished.\n"); + + Pa_Terminate(); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_read_record.c b/portaudio-v19/test/patest_read_record.c new file mode 100644 index 000000000..5e9ca0109 --- /dev/null +++ b/portaudio-v19/test/patest_read_record.c @@ -0,0 +1,229 @@ +/** @file patest_read_record.c + @brief Record input into an array; Save array to a file; Playback recorded + data. Implemented using the blocking API (Pa_ReadStream(), Pa_WriteStream() ) + @author Phil Burk http://www.softsynth.com + @author Ross Bencina rossb@audiomulch.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +/* #define SAMPLE_RATE (17932) // Test failure to open with this value. */ +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) +#define NUM_SECONDS (5) +#define NUM_CHANNELS (2) +/* #define DITHER_FLAG (paDitherOff) */ +#define DITHER_FLAG (0) /**/ + +/* Select sample format. */ +#if 1 +#define PA_SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#define SAMPLE_SILENCE (0.0f) +#define PRINTF_S_FORMAT "%.8f" +#elif 1 +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#elif 0 +#define PA_SAMPLE_TYPE paInt8 +typedef char SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#else +#define PA_SAMPLE_TYPE paUInt8 +typedef unsigned char SAMPLE; +#define SAMPLE_SILENCE (128) +#define PRINTF_S_FORMAT "%d" +#endif + + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters inputParameters, outputParameters; + PaStream *stream; + PaError err; + SAMPLE *recordedSamples; + int i; + int totalFrames; + int numSamples; + int numBytes; + SAMPLE max, average, val; + + + printf("patest_read_record.c\n"); fflush(stdout); + + totalFrames = NUM_SECONDS * SAMPLE_RATE; /* Record for a few seconds. */ + numSamples = totalFrames * NUM_CHANNELS; + + numBytes = numSamples * sizeof(SAMPLE); + recordedSamples = (SAMPLE *) malloc( numBytes ); + if( recordedSamples == NULL ) + { + printf("Could not allocate record array.\n"); + exit(1); + } + for( i=0; idefaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + /* Record some audio. -------------------------------------------- */ + err = Pa_OpenStream( + &stream, + &inputParameters, + NULL, /* &outputParameters, */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Now recording!!\n"); fflush(stdout); + + err = Pa_ReadStream( stream, recordedSamples, totalFrames ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + /* Measure maximum peak amplitude. */ + max = 0; + average = 0; + for( i=0; i max ) + { + max = val; + } + average += val; + } + + average = average / numSamples; + + printf("Sample max amplitude = "PRINTF_S_FORMAT"\n", max ); + printf("Sample average = "PRINTF_S_FORMAT"\n", average ); +/* Was as below. Better choose at compile time because this + keeps generating compiler-warnings: + if( PA_SAMPLE_TYPE == paFloat32 ) + { + printf("sample max amplitude = %f\n", max ); + printf("sample average = %f\n", average ); + } + else + { + printf("sample max amplitude = %d\n", max ); + printf("sample average = %d\n", average ); + } +*/ + /* Write recorded data to a file. */ +#if 0 + { + FILE *fid; + fid = fopen("recorded.raw", "wb"); + if( fid == NULL ) + { + printf("Could not open file."); + } + else + { + fwrite( recordedSamples, NUM_CHANNELS * sizeof(SAMPLE), totalFrames, fid ); + fclose( fid ); + printf("Wrote data to 'recorded.raw'\n"); + } + } +#endif + + /* Playback recorded data. -------------------------------------------- */ + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = NUM_CHANNELS; + outputParameters.sampleFormat = PA_SAMPLE_TYPE; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + printf("Begin playback.\n"); fflush(stdout); + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + if( stream ) + { + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Waiting for playback to finish.\n"); fflush(stdout); + + err = Pa_WriteStream( stream, recordedSamples, totalFrames ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + printf("Done.\n"); fflush(stdout); + } + free( recordedSamples ); + + Pa_Terminate(); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return -1; +} + diff --git a/portaudio-v19/test/patest_read_write_wire.c b/portaudio-v19/test/patest_read_write_wire.c new file mode 100644 index 000000000..0176ce4a6 --- /dev/null +++ b/portaudio-v19/test/patest_read_write_wire.c @@ -0,0 +1,195 @@ +/** @file patest_read_write_wire.c + @brief Tests full duplex blocking I/O by passing input straight to output. + @author Bjorn Roche. XO Audio LLC for Z-Systems Engineering. + @author based on code by: Phil Burk http://www.softsynth.com + @author based on code by: Ross Bencina rossb@audiomulch.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +/* #define SAMPLE_RATE (17932) // Test failure to open with this value. */ +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) +#define NUM_CHANNELS (2) +/* #define DITHER_FLAG (paDitherOff) */ +#define DITHER_FLAG (0) /**/ + +/* Select sample format. */ +#if 1 +#define PA_SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#define SAMPLE_SILENCE (0.0f) +#define PRINTF_S_FORMAT "%.8f" +#elif 1 +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#elif 0 +#define PA_SAMPLE_TYPE paInt8 +typedef char SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#else +#define PA_SAMPLE_TYPE paUInt8 +typedef unsigned char SAMPLE; +#define SAMPLE_SILENCE (128) +#define PRINTF_S_FORMAT "%d" +#endif + + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters inputParameters, outputParameters; + PaStream *stream = NULL; + PaError err; + SAMPLE *sampleBlock; + int i; + int numBytes; + + + printf("patest_read_write_wire.c\n"); fflush(stdout); + + numBytes = FRAMES_PER_BUFFER * NUM_CHANNELS * sizeof(SAMPLE); + sampleBlock = (SAMPLE *) malloc( numBytes ); + if( sampleBlock == NULL ) + { + printf("Could not allocate record array.\n"); + exit(1); + } + for( i=0; idefaultLowInputLatency ); + printf( "Input HL: %g s\n", Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency ); + inputParameters.channelCount = NUM_CHANNELS; + inputParameters.sampleFormat = PA_SAMPLE_TYPE; + inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency ; + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + printf( "Output device # %d.\n", outputParameters.device ); + printf( "Output LL: %g s\n", Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency ); + printf( "Output HL: %g s\n", Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency ); + outputParameters.channelCount = NUM_CHANNELS; + outputParameters.sampleFormat = PA_SAMPLE_TYPE; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + /* -- setup -- */ + + err = Pa_OpenStream( + &stream, + &inputParameters, + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + printf("Wire on. Will run one minute.\n"); fflush(stdout); + + for( i=0; i<(60*SAMPLE_RATE)/FRAMES_PER_BUFFER; ++i ) + { + err = Pa_WriteStream( stream, sampleBlock, FRAMES_PER_BUFFER ); + if( err ) goto xrun; + err = Pa_ReadStream( stream, sampleBlock, FRAMES_PER_BUFFER ); + if( err ) goto xrun; + } + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + for( i=0; i +#include +#include "portaudio.h" + +/* #define SAMPLE_RATE (17932) // Test failure to open with this value. */ +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) +#define NUM_SECONDS (5) +#define NUM_CHANNELS (2) +/* #define DITHER_FLAG (paDitherOff) */ +#define DITHER_FLAG (0) /**/ + +/* Select sample format. */ +#if 1 +#define PA_SAMPLE_TYPE paFloat32 +typedef float SAMPLE; +#define SAMPLE_SILENCE (0.0f) +#define PRINTF_S_FORMAT "%.8f" +#elif 1 +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#elif 0 +#define PA_SAMPLE_TYPE paInt8 +typedef char SAMPLE; +#define SAMPLE_SILENCE (0) +#define PRINTF_S_FORMAT "%d" +#else +#define PA_SAMPLE_TYPE paUInt8 +typedef unsigned char SAMPLE; +#define SAMPLE_SILENCE (128) +#define PRINTF_S_FORMAT "%d" +#endif + +typedef struct +{ + int frameIndex; /* Index into sample array. */ + int maxFrameIndex; + SAMPLE *recordedSamples; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int recordCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + const SAMPLE *rptr = (const SAMPLE*)inputBuffer; + SAMPLE *wptr = &data->recordedSamples[data->frameIndex * NUM_CHANNELS]; + long framesToCalc; + long i; + int finished; + unsigned long framesLeft = data->maxFrameIndex - data->frameIndex; + + (void) outputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + (void) userData; + + if( framesLeft < framesPerBuffer ) + { + framesToCalc = framesLeft; + finished = paComplete; + } + else + { + framesToCalc = framesPerBuffer; + finished = paContinue; + } + + if( inputBuffer == NULL ) + { + for( i=0; iframeIndex += framesToCalc; + return finished; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int playCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = &data->recordedSamples[data->frameIndex * NUM_CHANNELS]; + SAMPLE *wptr = (SAMPLE*)outputBuffer; + unsigned int i; + int finished; + unsigned int framesLeft = data->maxFrameIndex - data->frameIndex; + + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + (void) userData; + + if( framesLeft < framesPerBuffer ) + { + /* final buffer... */ + for( i=0; iframeIndex += framesLeft; + finished = paComplete; + } + else + { + for( i=0; iframeIndex += framesPerBuffer; + finished = paContinue; + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters inputParameters, + outputParameters; + PaStream* stream; + PaError err = paNoError; + paTestData data; + int i; + int totalFrames; + int numSamples; + int numBytes; + SAMPLE max, val; + double average; + + printf("patest_record.c\n"); fflush(stdout); + + data.maxFrameIndex = totalFrames = NUM_SECONDS * SAMPLE_RATE; /* Record for a few seconds. */ + data.frameIndex = 0; + numSamples = totalFrames * NUM_CHANNELS; + numBytes = numSamples * sizeof(SAMPLE); + data.recordedSamples = (SAMPLE *) malloc( numBytes ); /* From now on, recordedSamples is initialised. */ + if( data.recordedSamples == NULL ) + { + printf("Could not allocate record array.\n"); + goto done; + } + for( i=0; idefaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + /* Record some audio. -------------------------------------------- */ + err = Pa_OpenStream( + &stream, + &inputParameters, + NULL, /* &outputParameters, */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + recordCallback, + &data ); + if( err != paNoError ) goto done; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto done; + printf("Now recording!!\n"); fflush(stdout); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) + { + Pa_Sleep(1000); + printf("index = %d\n", data.frameIndex ); fflush(stdout); + } + if( err < 0 ) goto done; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto done; + + /* Measure maximum peak amplitude. */ + max = 0; + average = 0.0; + for( i=0; i max ) + { + max = val; + } + average += val; + } + + average = average / (double)numSamples; + + printf("sample max amplitude = "PRINTF_S_FORMAT"\n", max ); + printf("sample average = %lf\n", average ); + + /* Write recorded data to a file. */ +#if 0 + { + FILE *fid; + fid = fopen("recorded.raw", "wb"); + if( fid == NULL ) + { + printf("Could not open file."); + } + else + { + fwrite( data.recordedSamples, NUM_CHANNELS * sizeof(SAMPLE), totalFrames, fid ); + fclose( fid ); + printf("Wrote data to 'recorded.raw'\n"); + } + } +#endif + + /* Playback recorded data. -------------------------------------------- */ + data.frameIndex = 0; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = PA_SAMPLE_TYPE; + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + printf("Begin playback.\n"); fflush(stdout); + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + playCallback, + &data ); + if( err != paNoError ) goto done; + + if( stream ) + { + err = Pa_StartStream( stream ); + if( err != paNoError ) goto done; + + printf("Waiting for playback to finish.\n"); fflush(stdout); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(100); + if( err < 0 ) goto done; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto done; + + printf("Done.\n"); fflush(stdout); + } + +done: + Pa_Terminate(); + if( data.recordedSamples ) /* Sure it is NULL or valid. */ + free( data.recordedSamples ); + if( err != paNoError ) + { + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + err = 1; /* Always return 0 or 1, but no other return codes. */ + } + return err; +} + diff --git a/portaudio-v19/test/patest_ringmix.c b/portaudio-v19/test/patest_ringmix.c new file mode 100644 index 000000000..1df062388 --- /dev/null +++ b/portaudio-v19/test/patest_ringmix.c @@ -0,0 +1,79 @@ +/** @file patest_ringmix.c + @brief Ring modulate inputs to left output, mix inputs to right output. +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + + +#include "stdio.h" +#include "portaudio.h" +/* This will be called asynchronously by the PortAudio engine. */ +static int myCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + const float *in = (const float *) inputBuffer; + float *out = (float *) outputBuffer; + float leftInput, rightInput; + unsigned int i; + + /* Read input buffer, process data, and fill output buffer. */ + for( i=0; i +#include +#include "portaudio.h" +#define NUM_SECONDS (4) +#define SAMPLE_RATE (44100) + +typedef struct +{ + float left_phase; + float right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + /* Cast data passed through stream to our structure. */ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + (void) inputBuffer; /* Prevent unused variable warning. */ + + for( i=0; ileft_phase; /* left */ + *out++ = data->right_phase; /* right */ + /* Generate simple sawtooth phaser that ranges between -1.0 and 1.0. */ + data->left_phase += 0.01f; + /* When signal reaches top, drop back down. */ + if( data->left_phase >= 1.0f ) data->left_phase -= 2.0f; + /* higher pitch so we can distinguish left and right. */ + data->right_phase += 0.03f; + if( data->right_phase >= 1.0f ) data->right_phase -= 2.0f; + } + return 0; +} + +/*******************************************************************/ +static paTestData data; +int main(void); +int main(void) +{ + PaStream *stream; + PaError err; + + printf("PortAudio Test: output sawtooth wave.\n"); + /* Initialize our data for use by callback. */ + data.left_phase = data.right_phase = 0.0; + /* Initialize library before making any other calls. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + /* Open an audio I/O stream. */ + err = Pa_OpenDefaultStream( &stream, + 0, /* no input channels */ + 2, /* stereo output */ + paFloat32, /* 32 bit floating point output */ + SAMPLE_RATE, + 256, /* frames per buffer */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + /* Sleep for several seconds. */ + Pa_Sleep(NUM_SECONDS*1000); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_sine.c b/portaudio-v19/test/patest_sine.c new file mode 100644 index 000000000..c952b5805 --- /dev/null +++ b/portaudio-v19/test/patest_sine.c @@ -0,0 +1,151 @@ +/** @file patest_sine.c + @brief Play a sine wave for several seconds. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + + (void) timeInfo; /* Prevent unused variable warnings. */ + (void) statusFlags; + (void) inputBuffer; + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + + return paContinue; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); + Pa_Sleep( NUM_SECONDS * 1000 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_sine8.c b/portaudio-v19/test/patest_sine8.c new file mode 100644 index 000000000..5a9d1fe72 --- /dev/null +++ b/portaudio-v19/test/patest_sine8.c @@ -0,0 +1,212 @@ +/** @file patest_sine8.c + @brief Test 8 bit data: play a sine wave for several seconds. + @author Ross Bencina +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ + +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (8) +#define SAMPLE_RATE (44100) +#define TABLE_SIZE (200) +#define TEST_UNSIGNED (0) + +#if TEST_UNSIGNED +#define TEST_FORMAT paUInt8 +#else +#define TEST_FORMAT paInt8 +#endif + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ +#if TEST_UNSIGNED + unsigned char sine[TABLE_SIZE]; +#else + char sine[TABLE_SIZE]; +#endif + int left_phase; + int right_phase; + unsigned int framesToGo; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + char *out = (char*)outputBuffer; + int i; + int framesToCalc; + int finished = 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + + if( data->framesToGo < framesPerBuffer ) + { + framesToCalc = data->framesToGo; + data->framesToGo = 0; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + data->framesToGo -= framesPerBuffer; + } + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + /* zero remainder of final buffer */ + for( ; i<(int)framesPerBuffer; i++ ) + { +#if TEST_UNSIGNED + *out++ = (unsigned char) 0x80; /* left */ + *out++ = (unsigned char) 0x80; /* right */ +#else + *out++ = 0; /* left */ + *out++ = 0; /* right */ +#endif + + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream* stream; + PaError err; + paTestData data; + PaTime streamOpened; + int i, totalSamps; + +#if TEST_UNSIGNED + printf("PortAudio Test: output UNsigned 8 bit sine wave.\n"); +#else + printf("PortAudio Test: output signed 8 bit sine wave.\n"); +#endif + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, + SAMPLE_RATE, + 256, /* Frames per buffer. */ + paClipOff, /* We won't output out of range samples so don't bother clipping them. */ + patestCallback, + &data ); + if( err != paNoError ) + goto error; + + streamOpened = Pa_GetStreamTime( stream ); /* Time in seconds when stream was opened (approx). */ + + err = Pa_StartStream( stream ); + if( err != paNoError ) + goto error; + + /* Watch until sound is halfway finished. */ + /* (Was ( Pa_StreamTime( stream ) < (totalSamps/2) ) in V18. */ + while( (Pa_GetStreamTime( stream ) - streamOpened) < (PaTime)NUM_SECONDS / 2.0 ) + Pa_Sleep(10); + + /* Stop sound until ENTER hit. (Hu? don't see any keyboard-input here.) */ + err = Pa_StopStream( stream ); + if( err != paNoError ) + goto error; + + printf("Pause for 2 seconds.\n"); + Pa_Sleep( 2000 ); + + err = Pa_StartStream( stream ); + if( err != paNoError ) + goto error; + + printf("Waiting for sound to finish.\n"); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) + Pa_Sleep(100); + if( err < 0 ) + goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) + goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_sine_formats.c b/portaudio-v19/test/patest_sine_formats.c new file mode 100644 index 000000000..448a4ebe9 --- /dev/null +++ b/portaudio-v19/test/patest_sine_formats.c @@ -0,0 +1,196 @@ +/** @file patest_sine_formats.c + @brief Play a sine wave for several seconds. Test various data formats. + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (10) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#define LEFT_FREQ (SAMPLE_RATE/256.0) /* So we hit 1.0 */ +#define RIGHT_FREQ (500.0) +#define AMPLITUDE (1.0) + +/* Select ONE format for testing. */ +#define TEST_UINT8 (0) +#define TEST_INT8 (0) +#define TEST_INT16 (1) +#define TEST_FLOAT32 (0) + +#if TEST_UINT8 +#define TEST_FORMAT paUInt8 +typedef unsigned char SAMPLE_t; +#define SAMPLE_ZERO (0x80) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(127.0 * (x))) +#define FORMAT_NAME "Unsigned 8 Bit" + +#elif TEST_INT8 +#define TEST_FORMAT paInt8 +typedef char SAMPLE_t; +#define SAMPLE_ZERO (0) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(127.0 * (x))) +#define FORMAT_NAME "Signed 8 Bit" + +#elif TEST_INT16 +#define TEST_FORMAT paInt16 +typedef short SAMPLE_t; +#define SAMPLE_ZERO (0) +#define DOUBLE_TO_SAMPLE(x) (SAMPLE_ZERO + (SAMPLE_t)(32767 * (x))) +#define FORMAT_NAME "Signed 16 Bit" + +#elif TEST_FLOAT32 +#define TEST_FORMAT paFloat32 +typedef float SAMPLE_t; +#define SAMPLE_ZERO (0.0) +#define DOUBLE_TO_SAMPLE(x) ((SAMPLE_t)(x)) +#define FORMAT_NAME "Float 32 Bit" +#endif + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + + +typedef struct +{ + double left_phase; + double right_phase; + unsigned int framesToGo; +} +paTestData; +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, + void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + SAMPLE_t *out = (SAMPLE_t *)outputBuffer; + int i; + int framesToCalc; + int finished = 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + + if( data->framesToGo < framesPerBuffer ) + { + framesToCalc = data->framesToGo; + data->framesToGo = 0; + finished = 1; + } + else + { + framesToCalc = framesPerBuffer; + data->framesToGo -= framesPerBuffer; + } + + for( i=0; ileft_phase += (LEFT_FREQ / SAMPLE_RATE); + if( data->left_phase > 1.0) data->left_phase -= 1.0; + *out++ = DOUBLE_TO_SAMPLE( AMPLITUDE * sin( (data->left_phase * M_PI * 2. ))); + + data->right_phase += (RIGHT_FREQ / SAMPLE_RATE); + if( data->right_phase > 1.0) data->right_phase -= 1.0; + *out++ = DOUBLE_TO_SAMPLE( AMPLITUDE * sin( (data->right_phase * M_PI * 2. ))); + } + /* zero remainder of final buffer */ + for( ; i<(int)framesPerBuffer; i++ ) + { + *out++ = SAMPLE_ZERO; /* left */ + *out++ = SAMPLE_ZERO; /* right */ + } + return finished; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream *stream; + PaStreamParameters outputParameters; + PaError err; + paTestData data; + int totalSamps; + + printf("PortAudio Test: output " FORMAT_NAME "\n"); + + data.left_phase = data.right_phase = 0.0; + data.framesToGo = totalSamps = NUM_SECONDS * SAMPLE_RATE; /* Play for a few seconds. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* Default output device. */ + outputParameters.channelCount = 2; /* Stereo output */ + outputParameters.sampleFormat = TEST_FORMAT; /* Selected above. */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( &stream, + NULL, /* No input. */ + &outputParameters, /* As above. */ + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Waiting %d seconds for sound to finish.\n", NUM_SECONDS ); + + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) Pa_Sleep(100); + if( err < 0 ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + + printf("PortAudio Test Finished: " FORMAT_NAME "\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_sine_time.c b/portaudio-v19/test/patest_sine_time.c new file mode 100644 index 000000000..cf45275fe --- /dev/null +++ b/portaudio-v19/test/patest_sine_time.c @@ -0,0 +1,208 @@ +/** @file patest_sine_time.c + @brief Play a sine wave for several seconds, pausing in the middle. + Uses the Pa_GetStreamTime() call. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include + +#include "portaudio.h" +#include "pa_util.h" + +#define NUM_SECONDS (8) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +#define TABLE_SIZE (200) + +typedef struct +{ + double left_phase; + double right_phase; + volatile PaTime outTime; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + + double left_phaseInc = 0.02; + double right_phaseInc = 0.06; + + double left_phase = data->left_phase; + double right_phase = data->right_phase; + + (void) statusFlags; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + data->outTime = timeInfo->outputBufferDacTime; + + for( i=0; i TWOPI ) left_phase -= TWOPI; + *out++ = (float) sin( left_phase ); + + right_phase += right_phaseInc; + if( right_phase > TWOPI ) right_phase -= TWOPI; + *out++ = (float) sin( right_phase ); + } + + data->left_phase = left_phase; + data->right_phase = right_phase; + + return paContinue; +} + +/*******************************************************************/ +static void ReportStreamTime( PaStream *stream, paTestData *data ); +static void ReportStreamTime( PaStream *stream, paTestData *data ) +{ + PaTime streamTime, latency, outTime; + + streamTime = Pa_GetStreamTime( stream ); + outTime = data->outTime; + if( outTime < 0.0 ) + { + printf("Stream time = %8.1f\n", streamTime ); + } + else + { + latency = outTime - streamTime; + printf("Stream time = %8.4f, outTime = %8.4f, latency = %8.4f\n", + streamTime, outTime, latency ); + } + fflush(stdout); +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + PaTime startTime; + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + data.left_phase = data.right_phase = 0; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + /* Watch until sound is halfway finished. */ + printf("Play for %d seconds.\n", NUM_SECONDS/2 ); fflush(stdout); + + data.outTime = -1.0; /* mark time for callback as undefined */ + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + startTime = Pa_GetStreamTime( stream ); + + do + { + ReportStreamTime( stream, &data ); + Pa_Sleep(100); + } while( (Pa_GetStreamTime( stream ) - startTime) < (NUM_SECONDS/2) ); + + /* Stop sound for 2 seconds. */ + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + printf("Pause for 2 seconds.\n"); fflush(stdout); + Pa_Sleep( 2000 ); + + data.outTime = -1.0; /* mark time for callback as undefined */ + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + startTime = Pa_GetStreamTime( stream ); + + printf("Play until sound is finished.\n"); fflush(stdout); + do + { + ReportStreamTime( stream, &data ); + Pa_Sleep(100); + } while( (Pa_GetStreamTime( stream ) - startTime) < (NUM_SECONDS/2) ); + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_start_stop.c b/portaudio-v19/test/patest_start_stop.c new file mode 100644 index 000000000..03ade1721 --- /dev/null +++ b/portaudio-v19/test/patest_start_stop.c @@ -0,0 +1,162 @@ +/** @file patest_start_stop.c + @brief Play a sine wave for several seconds + - start and stop the stream multiple times. + + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE Pa_GetDefaultOutputDevice() /* default output device */ + +#define NUM_SECONDS (3) +#define NUM_LOOPS (4) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (400) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + + (void) timeInfo; /* Prevent unused variable warnings. */ + (void) statusFlags; + (void) inputBuffer; + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + + return paContinue; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + + for( i=0; i +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDevice()) +#define SLEEP_DUR (200) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (256) +#define LATENCY_SECONDS (3.f) +#define FRAMES_PER_NOTE (SAMPLE_RATE/2) +#define MAX_REPEATS (2) +#define FUNDAMENTAL (400.0f / SAMPLE_RATE) +#define NOTE_0 (FUNDAMENTAL * 1.0f / 1.0f) +#define NOTE_1 (FUNDAMENTAL * 5.0f / 4.0f) +#define NOTE_2 (FUNDAMENTAL * 4.0f / 3.0f) +#define NOTE_3 (FUNDAMENTAL * 3.0f / 2.0f) +#define NOTE_4 (FUNDAMENTAL * 2.0f / 1.0f) +#define MODE_FINISH (0) +#define MODE_STOP (1) +#define MODE_ABORT (2) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TABLE_SIZE (400) + +typedef struct +{ + float waveform[TABLE_SIZE + 1]; /* Add one for guard point for interpolation. */ + float phase_increment; + float phase; + float *tune; + int notesPerTune; + int frameCounter; + int noteCounter; + int repeatCounter; + PaTime outTime; + int stopMode; + int done; +} +paTestData; + +/************* Prototypes *****************************/ +int TestStopMode( paTestData *data ); +float LookupWaveform( paTestData *data, float phase ); + +/****************************************************** + * Convert phase between 0.0 and 1.0 to waveform value + * using linear interpolation. + */ +float LookupWaveform( paTestData *data, float phase ) +{ + float fIndex = phase*TABLE_SIZE; + int index = (int) fIndex; + float fract = fIndex - index; + float lo = data->waveform[index]; + float hi = data->waveform[index+1]; + float val = lo + fract*(hi-lo); + return val; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + float value; + unsigned int i = 0; + int finished = paContinue; + + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + + + /* data->outTime = outTime; */ + + if( !data->done ) + { + for( i=0; iframeCounter >= FRAMES_PER_NOTE ) + { + data->noteCounter += 1; + data->frameCounter = 0; + /* Are we done with this tune? */ + if( data->noteCounter >= data->notesPerTune ) + { + data->noteCounter = 0; + data->repeatCounter += 1; + /* Are we totally done? */ + if( data->repeatCounter >= MAX_REPEATS ) + { + data->done = 1; + if( data->stopMode == MODE_FINISH ) + { + finished = paComplete; + break; + } + } + } + data->phase_increment = data->tune[data->noteCounter]; + } + value = LookupWaveform(data, data->phase); + *out++ = value; /* left */ + *out++ = value; /* right */ + data->phase += data->phase_increment; + if( data->phase >= 1.0f ) data->phase -= 1.0f; + + data->frameCounter += 1; + } + } + /* zero remainder of final buffer */ + for( ; idone = 0; + data->phase = 0.0; + data->frameCounter = 0; + data->noteCounter = 0; + data->repeatCounter = 0; + data->phase_increment = data->tune[data->noteCounter]; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = OUTPUT_DEVICE; + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = LATENCY_SECONDS; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + if( data->stopMode == MODE_FINISH ) + { + while( ( err = Pa_IsStreamActive( stream ) ) == 1 ) + { + /*printf("outTime = %g, note# = %d, repeat# = %d\n", data->outTime, + data->noteCounter, data->repeatCounter ); + fflush(stdout); */ + Pa_Sleep( SLEEP_DUR ); + } + if( err < 0 ) goto error; + } + else + { + while( data->repeatCounter < MAX_REPEATS ) + { + /*printf("outTime = %g, note# = %d, repeat# = %d\n", data->outTime, + data->noteCounter, data->repeatCounter ); + fflush(stdout); */ + Pa_Sleep( SLEEP_DUR ); + } + } + + if( data->stopMode == MODE_ABORT ) + { + printf("Call Pa_AbortStream()\n"); + err = Pa_AbortStream( stream ); + } + else + { + printf("Call Pa_StopStream()\n"); + err = Pa_StopStream( stream ); + } + if( err != paNoError ) goto error; + + printf("Call Pa_CloseStream()\n"); fflush(stdout); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_stop_playout.c b/portaudio-v19/test/patest_stop_playout.c new file mode 100644 index 000000000..41134d581 --- /dev/null +++ b/portaudio-v19/test/patest_stop_playout.c @@ -0,0 +1,432 @@ +/** @file patest_stop_playout.c + @brief Test whether all queued samples are played when Pa_StopStream() + is used with a callback or read/write stream, or when the callback + returns paComplete. + @author Ross Bencina +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2004 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) + +#define TONE_SECONDS (1) /* long tone */ +#define TONE_FADE_SECONDS (.04) /* fades at start and end of long tone */ +#define GAP_SECONDS (.25) /* gap between long tone and blip */ +#define BLIP_SECONDS (.035) /* short blip */ + +#define NUM_REPEATS (3) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (2048) +typedef struct +{ + float sine[TABLE_SIZE+1]; + + int repeatCount; + + double phase; + double lowIncrement, highIncrement; + + int gap1Length, toneLength, toneFadesLength, gap2Length, blipLength; + int gap1Countdown, toneCountdown, gap2Countdown, blipCountdown; +} +TestData; + + +static void RetriggerTestSignalGenerator( TestData *data ) +{ + data->phase = 0.; + data->gap1Countdown = data->gap1Length; + data->toneCountdown = data->toneLength; + data->gap2Countdown = data->gap2Length; + data->blipCountdown = data->blipLength; +} + + +static void ResetTestSignalGenerator( TestData *data ) +{ + data->repeatCount = 0; + RetriggerTestSignalGenerator( data ); +} + + +static void InitTestSignalGenerator( TestData *data ) +{ + int signalLengthModBufferLength, i; + + /* initialise sinusoidal wavetable */ + for( i=0; isine[i] = (float) sin( ((double)i/(double)TABLE_SIZE) * M_PI * 2. ); + } + data->sine[TABLE_SIZE] = data->sine[0]; /* guard point for linear interpolation */ + + + + data->lowIncrement = (330. / SAMPLE_RATE) * TABLE_SIZE; + data->highIncrement = (1760. / SAMPLE_RATE) * TABLE_SIZE; + + data->gap1Length = GAP_SECONDS * SAMPLE_RATE; + data->toneLength = TONE_SECONDS * SAMPLE_RATE; + data->toneFadesLength = TONE_FADE_SECONDS * SAMPLE_RATE; + data->gap2Length = GAP_SECONDS * SAMPLE_RATE; + data->blipLength = BLIP_SECONDS * SAMPLE_RATE; + + /* adjust signal length to be a multiple of the buffer length */ + signalLengthModBufferLength = (data->gap1Length + data->toneLength + data->gap2Length + data->blipLength) % FRAMES_PER_BUFFER; + if( signalLengthModBufferLength > 0 ) + data->toneLength += signalLengthModBufferLength; + + ResetTestSignalGenerator( data ); +} + + +#define MIN( a, b ) (((a)<(b))?(a):(b)) + +static void GenerateTestSignal( TestData *data, float *stereo, int frameCount ) +{ + int framesGenerated = 0; + float output; + long index; + float fraction; + int count, i; + + while( framesGenerated < frameCount && data->repeatCount < NUM_REPEATS ) + { + if( framesGenerated < frameCount && data->gap1Countdown > 0 ){ + count = MIN( frameCount - framesGenerated, data->gap1Countdown ); + for( i=0; i < count; ++i ) + { + *stereo++ = 0.f; + *stereo++ = 0.f; + } + + data->gap1Countdown -= count; + framesGenerated += count; + } + + if( framesGenerated < frameCount && data->toneCountdown > 0 ){ + count = MIN( frameCount - framesGenerated, data->toneCountdown ); + for( i=0; i < count; ++i ) + { + /* tone with data->lowIncrement phase increment */ + index = (long)data->phase; + fraction = data->phase - index; + output = data->sine[ index ] + (data->sine[ index + 1 ] - data->sine[ index ]) * fraction; + + data->phase += data->lowIncrement; + while( data->phase >= TABLE_SIZE ) + data->phase -= TABLE_SIZE; + + /* apply fade to ends */ + + if( data->toneCountdown < data->toneFadesLength ) + { + /* cosine-bell fade out at end */ + output *= (-cos(((float)data->toneCountdown / (float)data->toneFadesLength) * M_PI) + 1.) * .5; + } + else if( data->toneCountdown > data->toneLength - data->toneFadesLength ) + { + /* cosine-bell fade in at start */ + output *= (cos(((float)(data->toneCountdown - (data->toneLength - data->toneFadesLength)) / (float)data->toneFadesLength) * M_PI) + 1.) * .5; + } + + output *= .5; /* play tone half as loud as blip */ + + *stereo++ = output; + *stereo++ = output; + + data->toneCountdown--; + } + + framesGenerated += count; + } + + if( framesGenerated < frameCount && data->gap2Countdown > 0 ){ + count = MIN( frameCount - framesGenerated, data->gap2Countdown ); + for( i=0; i < count; ++i ) + { + *stereo++ = 0.f; + *stereo++ = 0.f; + } + + data->gap2Countdown -= count; + framesGenerated += count; + } + + if( framesGenerated < frameCount && data->blipCountdown > 0 ){ + count = MIN( frameCount - framesGenerated, data->blipCountdown ); + for( i=0; i < count; ++i ) + { + /* tone with data->highIncrement phase increment */ + index = (long)data->phase; + fraction = data->phase - index; + output = data->sine[ index ] + (data->sine[ index + 1 ] - data->sine[ index ]) * fraction; + + data->phase += data->highIncrement; + while( data->phase >= TABLE_SIZE ) + data->phase -= TABLE_SIZE; + + /* cosine-bell envelope over whole blip */ + output *= (-cos( ((float)data->blipCountdown / (float)data->blipLength) * 2. * M_PI) + 1.) * .5; + + *stereo++ = output; + *stereo++ = output; + + data->blipCountdown--; + } + + framesGenerated += count; + } + + + if( data->blipCountdown == 0 ) + { + RetriggerTestSignalGenerator( data ); + data->repeatCount++; + } + } + + if( framesGenerated < frameCount ) + { + count = frameCount - framesGenerated; + for( i=0; i < count; ++i ) + { + *stereo++ = 0.f; + *stereo++ = 0.f; + } + } +} + + +static int IsTestSignalFinished( TestData *data ) +{ + if( data->repeatCount >= NUM_REPEATS ) + return 1; + else + return 0; +} + + +static int TestCallback1( const void *inputBuffer, void *outputBuffer, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + + GenerateTestSignal( (TestData*)userData, (float*)outputBuffer, frameCount ); + + if( IsTestSignalFinished( (TestData*)userData ) ) + return paComplete; + else + return paContinue; +} + + +volatile int testCallback2Finished = 0; + +static int TestCallback2( const void *inputBuffer, void *outputBuffer, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) timeInfo; + (void) statusFlags; + + GenerateTestSignal( (TestData*)userData, (float*)outputBuffer, frameCount ); + + if( IsTestSignalFinished( (TestData*)userData ) ) + testCallback2Finished = 1; + + return paContinue; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + TestData data; + float writeBuffer[ FRAMES_PER_BUFFER * 2 ]; + + printf("PortAudio Test: check that stopping stream plays out all queued samples. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + InitTestSignalGenerator( &data ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 2; /* stereo output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + +/* test paComplete ---------------------------------------------------------- */ + + ResetTestSignalGenerator( &data ); + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + TestCallback1, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + + printf("\nPlaying 'tone-blip' %d times using callback, stops by returning paComplete from callback.\n", NUM_REPEATS ); + printf("If final blip is not intact, callback+paComplete implementation may be faulty.\n\n" ); + + while( (err = Pa_IsStreamActive( stream )) == 1 ) + Pa_Sleep( 5 ); + + if( err != 0 ) goto error; + + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Sleep( 500 ); + +/* test Pa_StopStream() with callback --------------------------------------- */ + + ResetTestSignalGenerator( &data ); + + testCallback2Finished = 0; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + TestCallback2, + &data ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + + printf("\nPlaying 'tone-blip' %d times using callback, stops by calling Pa_StopStream.\n", NUM_REPEATS ); + printf("If final blip is not intact, callback+Pa_StopStream implementation may be faulty.\n\n" ); + + /* note that polling a volatile flag is not a good way to synchronise with + the callback, but it's the best we can do portably. */ + while( !testCallback2Finished ) + Pa_Sleep( 2 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Sleep( 500 ); + +/* test Pa_StopStream() with Pa_WriteStream --------------------------------- */ + + ResetTestSignalGenerator( &data ); + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + + printf("\nPlaying 'tone-blip' %d times using Pa_WriteStream, stops by calling Pa_StopStream.\n", NUM_REPEATS ); + printf("If final blip is not intact, Pa_WriteStream+Pa_StopStream implementation may be faulty.\n\n" ); + + do{ + GenerateTestSignal( &data, writeBuffer, FRAMES_PER_BUFFER ); + err = Pa_WriteStream( stream, writeBuffer, FRAMES_PER_BUFFER ); + if( err != paNoError ) goto error; + + }while( !IsTestSignalFinished( &data ) ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + +/* -------------------------------------------------------------------------- */ + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_sync.c b/portaudio-v19/test/patest_sync.c new file mode 100644 index 000000000..6dc13ee7c --- /dev/null +++ b/portaudio-v19/test/patest_sync.c @@ -0,0 +1,259 @@ +/** @file patest_sync.c + @brief Test time stamping and synchronization of audio and video. + + A high latency is used so we can hear the difference in time. + Random durations are used so we know we are hearing the right beep + and not the one before or after. + + Sequence of events: + -# Foreground requests a beep. + -# Background randomly schedules a beep. + -# Foreground waits for the beep to be heard based on PaUtil_GetTime(). + -# Foreground outputs video (printf) in sync with audio. + -# Repeat. + + @author Phil Burk http://www.softsynth.com +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" +#include "pa_util.h" +#define NUM_BEEPS (6) +#define SAMPLE_RATE (44100) +#define SAMPLE_PERIOD (1.0/44100.0) +#define FRAMES_PER_BUFFER (256) +#define BEEP_DURATION (400) +#define LATENCY_MSEC (2000) +#define SLEEP_MSEC (10) +#define TIMEOUT_MSEC (15000) + +#define STATE_BKG_IDLE (0) +#define STATE_BKG_PENDING (1) +#define STATE_BKG_BEEPING (2) +typedef struct +{ + float left_phase; + float right_phase; + int state; + volatile int requestBeep; /* Set by foreground, cleared by background. */ + PaTime beepTime; + int beepCount; + double latency; /* For debugging. */ +} +paTestData; + +static unsigned long GenerateRandomNumber( void ); +/************************************************************/ +/* Calculate pseudo-random 32 bit number based on linear congruential method. */ +static unsigned long GenerateRandomNumber( void ) +{ + static unsigned long randSeed = 99887766; /* Change this for different random sequences. */ + randSeed = (randSeed * 196314165) + 907633515; + return randSeed; +} + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo, + PaStreamCallbackFlags statusFlags, void *userData ) +{ + /* Cast data passed through stream to our structure. */ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned int i; + (void) inputBuffer; + + data->latency = timeInfo->outputBufferDacTime - timeInfo->currentTime; + + for( i=0; istate ) + { + case STATE_BKG_IDLE: + /* Schedule beep at some random time in the future. */ + if( data->requestBeep ) + { + int random = GenerateRandomNumber() >> 14; + data->beepTime = timeInfo->outputBufferDacTime + (( (double)(random + SAMPLE_RATE)) * SAMPLE_PERIOD ); + data->state = STATE_BKG_PENDING; + } + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + break; + + case STATE_BKG_PENDING: + if( (timeInfo->outputBufferDacTime + (i*SAMPLE_PERIOD)) >= data->beepTime ) + { + data->state = STATE_BKG_BEEPING; + data->beepCount = BEEP_DURATION; + data->left_phase = data->right_phase = 0.0; + } + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + break; + + case STATE_BKG_BEEPING: + if( data->beepCount <= 0 ) + { + data->state = STATE_BKG_IDLE; + data->requestBeep = 0; + *out++ = 0.0; /* left */ + *out++ = 0.0; /* right */ + } + else + { + /* Play sawtooth wave. */ + *out++ = data->left_phase; /* left */ + *out++ = data->right_phase; /* right */ + /* Generate simple sawtooth phaser that ranges between -1.0 and 1.0. */ + data->left_phase += 0.01f; + /* When signal reaches top, drop back down. */ + if( data->left_phase >= 1.0f ) data->left_phase -= 2.0f; + /* higher pitch so we can distinguish left and right. */ + data->right_phase += 0.03f; + if( data->right_phase >= 1.0f ) data->right_phase -= 2.0f; + } + data->beepCount -= 1; + break; + + default: + data->state = STATE_BKG_IDLE; + break; + } + } + return 0; +} +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStream *stream; + PaError err; + paTestData DATA; + int i, timeout; + PaTime previousTime; + PaStreamParameters outputParameters; + printf("PortAudio Test: you should see BEEP at the same time you hear it.\n"); + printf("Wait for a few seconds random delay between BEEPs.\n"); + printf("BEEP %d times.\n", NUM_BEEPS ); + /* Initialize our DATA for use by callback. */ + DATA.left_phase = DATA.right_phase = 0.0; + DATA.state = STATE_BKG_IDLE; + DATA.requestBeep = 0; + /* Initialize library before making any other calls. */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); + outputParameters.channelCount = 2; + outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.sampleFormat = paFloat32; + outputParameters.suggestedLatency = (double)LATENCY_MSEC / 1000; + + /* Open an audio I/O stream. */ + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, /* frames per buffer */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &DATA ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("started\n"); + fflush(stdout); + + previousTime = Pa_GetStreamTime( stream ); + for( i=0; i 0 ) ) Pa_Sleep(SLEEP_MSEC); + if( timeout <= 0 ) + { + fprintf( stderr, "Timed out waiting for background to acknowledge request.\n" ); + goto error; + } + printf("calc beep for %9.3f, latency = %6.3f\n", DATA.beepTime, DATA.latency ); + fflush(stdout); + + /* Wait for scheduled beep time. */ + timeout = TIMEOUT_MSEC + (10000/SLEEP_MSEC); + while( (Pa_GetStreamTime( stream ) < DATA.beepTime) && (timeout-- > 0 ) ) + { + Pa_Sleep(SLEEP_MSEC); + } + if( timeout <= 0 ) + { + fprintf( stderr, "Timed out waiting for time. Now = %9.3f, Beep for %9.3f.\n", + PaUtil_GetTime(), DATA.beepTime ); + goto error; + } + + /* Beep should be sounding now so print synchronized BEEP. */ + printf("hear \"BEEP\" at %9.3f, delta = %9.3f\n", + Pa_GetStreamTime( stream ), (DATA.beepTime - previousTime) ); + fflush(stdout); + + previousTime = DATA.beepTime; + } + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_timing.c b/portaudio-v19/test/patest_timing.c new file mode 100644 index 000000000..72eb9c27a --- /dev/null +++ b/portaudio-v19/test/patest_timing.c @@ -0,0 +1,165 @@ +/** @file patest_timing.c + @brief Play a sine wave for several seconds, and spits out a ton of timing info while it's at it. Based on patet_sine.c + @author Bjorn Roche + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (64) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + PaStream *stream; + PaTime start; + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + + (void) timeInfo; /* Prevent unused variable warnings. */ + (void) statusFlags; + (void) inputBuffer; + + printf( "Timing info given to callback: Adc: %g, Current: %g, Dac: %g\n", + timeInfo->inputBufferAdcTime, + timeInfo->currentTime, + timeInfo->outputBufferDacTime ); + + printf( "getStreamTime() returns: %g\n", Pa_GetStreamTime(data->stream)-data->start ); + + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + + return paContinue; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + data.stream = stream; + data.start = Pa_GetStreamTime(stream); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + data.start = Pa_GetStreamTime(stream); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); + Pa_Sleep( NUM_SECONDS * 1000 ); + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + printf("The tone should have been heard for about 5 seconds and all the timing info above should report that about 5 seconds elapsed (except Adc, which is undefined since there was no input device opened).\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_toomanysines.c b/portaudio-v19/test/patest_toomanysines.c new file mode 100644 index 000000000..b7b22667c --- /dev/null +++ b/portaudio-v19/test/patest_toomanysines.c @@ -0,0 +1,173 @@ +/** @file patest_toomanysines.c + @brief Play more sine waves than we can handle in real time as a stress test. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define MAX_SINES (500) +#define MAX_LOAD (1.2) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (512) +#ifndef M_PI +#define M_PI (3.14159265) +#endif +#define TWOPI (M_PI * 2.0) + +typedef struct paTestData +{ + int numSines; + double phases[MAX_SINES]; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int j; + int finished = 0; + (void) inputBuffer; /* Prevent unused variable warning. */ + + for( i=0; inumSines; j++ ) + { + /* Advance phase of next oscillator. */ + phase = data->phases[j]; + phase += phaseInc; + if( phase > TWOPI ) phase -= TWOPI; + + phaseInc *= 1.02; + if( phaseInc > 0.5 ) phaseInc *= 0.5; + + /* This is not a very efficient way to calc sines. */ + output += (float) sin( phase ); + data->phases[j] = phase; + } + *out++ = (float) (output / data->numSines); + } + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + int numStress; + paTestData data = {0}; + double load; + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d. MAX_LOAD = %f\n", + SAMPLE_RATE, FRAMES_PER_BUFFER, MAX_LOAD ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ + outputParameters.channelCount = 1; /* mono output */ + outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + /* Determine number of sines required to get to 50% */ + do + { + data.numSines++; + Pa_Sleep( 100 ); + + load = Pa_GetStreamCpuLoad( stream ); + printf("numSines = %d, CPU load = %f\n", data.numSines, load ); + } + while( load < 0.5 ); + + /* Calculate target stress value then ramp up to that level*/ + numStress = (int) (2.0 * data.numSines * MAX_LOAD ); + for( ; data.numSines < numStress; data.numSines++ ) + { + Pa_Sleep( 200 ); + load = Pa_GetStreamCpuLoad( stream ); + printf("STRESSING: numSines = %d, CPU load = %f\n", data.numSines, load ); + } + + printf("Suffer for 5 seconds.\n"); + Pa_Sleep( 5000 ); + + printf("Stop stream.\n"); + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_two_rates.c b/portaudio-v19/test/patest_two_rates.c new file mode 100644 index 000000000..99532411f --- /dev/null +++ b/portaudio-v19/test/patest_two_rates.c @@ -0,0 +1,168 @@ +/* + * $Id$ + * patest_two_rates.c + * Play two streams at different rates to make sure they don't interfere. + * + * Author: Phil Burk http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) +#define SAMPLE_RATE_1 (44100) +#define SAMPLE_RATE_2 (44100) +#define FRAMES_PER_BUFFER (256) +#define FREQ_INCR (0.1) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +typedef struct +{ + double phase; + double numFrames; +} paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + int frameIndex, channelIndex; + int finished = 0; + (void) outTime; /* Prevent unused variable warnings. */ + (void) inputBuffer; + + for( frameIndex=0; frameIndex<(int)framesPerBuffer; frameIndex++ ) + { + /* Generate sine wave. */ + float value = (float) 0.3 * sin(data->phase); + /* Stereo - two channels. */ + *out++ = value; + *out++ = value; + + data->phase += FREQ_INCR; + if( data->phase >= (2.0 * M_PI) ) data->phase -= (2.0 * M_PI); + } + + return 0; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + PortAudioStream *stream1; + PortAudioStream *stream2; + paTestData data1 = {0}; + paTestData data2 = {0}; + printf("PortAudio Test: two rates.\n" ); + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + /* Start first stream. **********************/ + err = Pa_OpenStream( + &stream1, + paNoDevice, /* default input device */ + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + 2, /* Stereo */ + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE_1, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data1 ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream1 ); + if( err != paNoError ) goto error; + + Pa_Sleep( 3 * 1000 ); + + /* Start second stream. **********************/ + err = Pa_OpenStream( + &stream2, + paNoDevice, /* default input device */ + 0, /* no input */ + paFloat32, /* 32 bit floating point input */ + NULL, + OUTPUT_DEVICE, + 2, /* Stereo */ + paFloat32, /* 32 bit floating point output */ + NULL, + SAMPLE_RATE_2, + FRAMES_PER_BUFFER, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data2 ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream2 ); + if( err != paNoError ) goto error; + + Pa_Sleep( 3 * 1000 ); + + err = Pa_StopStream( stream2 ); + if( err != paNoError ) goto error; + + Pa_Sleep( 3 * 1000 ); + + err = Pa_StopStream( stream1 ); + if( err != paNoError ) goto error; + + Pa_CloseStream( stream2 ); + Pa_CloseStream( stream1 ); + + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_underflow.c b/portaudio-v19/test/patest_underflow.c new file mode 100644 index 000000000..1fd164ad9 --- /dev/null +++ b/portaudio-v19/test/patest_underflow.c @@ -0,0 +1,150 @@ +/** @file patest_underflow.c + @brief Simulate an output buffer underflow condition. + Tests whether the stream can be stopped when underflowing buffers. + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (20) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (2048) +#define MSEC_PER_BUFFER ( (FRAMES_PER_BUFFER * 1000) / SAMPLE_RATE ) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) +typedef struct +{ + float sine[TABLE_SIZE]; + int left_phase; + int right_phase; + int sleepTime; +} +paTestData; + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int patestCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + float *out = (float*)outputBuffer; + unsigned long i; + int finished = 0; + (void) inputBuffer; /* Prevent unused variable warnings. */ + for( i=0; isine[data->left_phase]; /* left */ + *out++ = data->sine[data->right_phase]; /* right */ + data->left_phase += 1; + if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE; + data->right_phase += 3; /* higher pitch so we can distinguish left and right. */ + if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE; + } + + /* Cause underflow to occur. */ + if( data->sleepTime > 0 ) Pa_Sleep( data->sleepTime ); + data->sleepTime += 1; + + return finished; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + paTestData data; + int i; + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + patestCallback, + &data ); + if( err != paNoError ) goto error; + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + while( data.sleepTime < (2 * MSEC_PER_BUFFER) ) + { + printf("SleepTime = %d\n", data.sleepTime ); + Pa_Sleep( data.sleepTime ); + } + + printf("Try to stop stream.\n"); + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + printf("Test finished.\n"); + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_wire.c b/portaudio-v19/test/patest_wire.c new file mode 100644 index 000000000..d83ce22d6 --- /dev/null +++ b/portaudio-v19/test/patest_wire.c @@ -0,0 +1,284 @@ +/** @file patest_wire.c + @brief Pass input directly to output. + + Note that some HW devices, for example many ISA audio cards + on PCs, do NOT support full duplex! For a PC, you normally need + a PCI based audio card such as the SBLive. + + @author Phil Burk http://www.softsynth.com + + While adapting to V19-API, I excluded configs with framesPerCallback=0 + because of an assert in file pa_common/pa_process.c. Pieter, Oct 9, 2003. + +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define SAMPLE_RATE (44100) + +typedef struct WireConfig_s +{ + int isInputInterleaved; + int isOutputInterleaved; + int numInputChannels; + int numOutputChannels; + int framesPerCallback; +} WireConfig_t; + +#define USE_FLOAT_INPUT (1) +#define USE_FLOAT_OUTPUT (1) + +/* Latencies set to defaults. */ + +#if USE_FLOAT_INPUT + #define INPUT_FORMAT paFloat32 + typedef float INPUT_SAMPLE; +#else + #define INPUT_FORMAT paInt16 + typedef short INPUT_SAMPLE; +#endif + +#if USE_FLOAT_OUTPUT + #define OUTPUT_FORMAT paFloat32 + typedef float OUTPUT_SAMPLE; +#else + #define OUTPUT_FORMAT paInt16 + typedef short OUTPUT_SAMPLE; +#endif + +double gInOutScaler = 1.0; +#define CONVERT_IN_TO_OUT(in) ((OUTPUT_SAMPLE) ((in) * gInOutScaler)) + +#define INPUT_DEVICE (Pa_GetDefaultInputDevice()) +#define OUTPUT_DEVICE (Pa_GetDefaultOutputDevice()) + +static PaError TestConfiguration( WireConfig_t *config ); + +static int wireCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + +/* This routine will be called by the PortAudio engine when audio is needed. +** It may be called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ + +static int wireCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + INPUT_SAMPLE *in; + OUTPUT_SAMPLE *out; + int inStride; + int outStride; + int inDone = 0; + int outDone = 0; + WireConfig_t *config = (WireConfig_t *) userData; + unsigned int i; + int inChannel, outChannel; + + /* This may get called with NULL inputBuffer during initial setup. */ + if( inputBuffer == NULL) return 0; + + inChannel=0, outChannel=0; + while( !(inDone && outDone) ) + { + if( config->isInputInterleaved ) + { + in = ((INPUT_SAMPLE*)inputBuffer) + inChannel; + inStride = config->numInputChannels; + } + else + { + in = ((INPUT_SAMPLE**)inputBuffer)[inChannel]; + inStride = 1; + } + + if( config->isOutputInterleaved ) + { + out = ((OUTPUT_SAMPLE*)outputBuffer) + outChannel; + outStride = config->numOutputChannels; + } + else + { + out = ((OUTPUT_SAMPLE**)outputBuffer)[outChannel]; + outStride = 1; + } + + for( i=0; inumInputChannels - 1)) inChannel++; + else inDone = 1; + if(outChannel < (config->numOutputChannels - 1)) outChannel++; + else outDone = 1; + } + return 0; +} + +/*******************************************************************/ +int main(void); +int main(void) +{ + PaError err; + WireConfig_t CONFIG; + WireConfig_t *config = &CONFIG; + int configIndex = 0;; + + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + printf("Please connect audio signal to input and listen for it on output!\n"); + printf("input format = %lu\n", INPUT_FORMAT ); + printf("output format = %lu\n", OUTPUT_FORMAT ); + printf("input device ID = %d\n", INPUT_DEVICE ); + printf("output device ID = %d\n", OUTPUT_DEVICE ); + + if( INPUT_FORMAT == OUTPUT_FORMAT ) + { + gInOutScaler = 1.0; + } + else if( (INPUT_FORMAT == paInt16) && (OUTPUT_FORMAT == paFloat32) ) + { + gInOutScaler = 1.0/32768.0; + } + else if( (INPUT_FORMAT == paFloat32) && (OUTPUT_FORMAT == paInt16) ) + { + gInOutScaler = 32768.0; + } + + for( config->isInputInterleaved = 0; config->isInputInterleaved < 2; config->isInputInterleaved++ ) + { + for( config->isOutputInterleaved = 0; config->isOutputInterleaved < 2; config->isOutputInterleaved++ ) + { + for( config->numInputChannels = 1; config->numInputChannels < 3; config->numInputChannels++ ) + { + for( config->numOutputChannels = 1; config->numOutputChannels < 3; config->numOutputChannels++ ) + { + /* If framesPerCallback = 0, assertion fails in file pa_common/pa_process.c, line 1413: EX. */ + for( config->framesPerCallback = 64; config->framesPerCallback < 129; config->framesPerCallback += 64 ) + { + printf("-----------------------------------------------\n" ); + printf("Configuration #%d\n", configIndex++ ); + err = TestConfiguration( config ); + /* Give user a chance to bail out. */ + if( err == 1 ) + { + err = paNoError; + goto done; + } + else if( err != paNoError ) goto error; + } + } + } + } + } + +done: + Pa_Terminate(); + printf("Full duplex sound test complete.\n"); fflush(stdout); + printf("Hit ENTER to quit.\n"); fflush(stdout); + getchar(); + return 0; + +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + printf("Hit ENTER to quit.\n"); fflush(stdout); + getchar(); + return -1; +} + +static PaError TestConfiguration( WireConfig_t *config ) +{ + int c; + PaError err; + PaStream *stream; + PaStreamParameters inputParameters, outputParameters; + + printf("input %sinterleaved!\n", (config->isInputInterleaved ? " " : "NOT ") ); + printf("output %sinterleaved!\n", (config->isOutputInterleaved ? " " : "NOT ") ); + printf("input channels = %d\n", config->numInputChannels ); + printf("output channels = %d\n", config->numOutputChannels ); + printf("framesPerCallback = %d\n", config->framesPerCallback ); + + inputParameters.device = INPUT_DEVICE; /* default input device */ + inputParameters.channelCount = config->numInputChannels; + inputParameters.sampleFormat = INPUT_FORMAT | (config->isInputInterleaved ? 0 : paNonInterleaved); + inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = OUTPUT_DEVICE; /* default output device */ + outputParameters.channelCount = config->numOutputChannels; + outputParameters.sampleFormat = OUTPUT_FORMAT | (config->isOutputInterleaved ? 0 : paNonInterleaved); + outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + &inputParameters, + &outputParameters, + SAMPLE_RATE, + config->framesPerCallback, /* frames per buffer */ + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + wireCallback, + config ); + if( err != paNoError ) goto error; + + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Hit ENTER for next configuration, or 'q' to quit.\n"); fflush(stdout); + c = getchar(); + + printf("Closing stream.\n"); + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + if( c == 'q' ) return 1; + +error: + return err; +} diff --git a/portaudio-v19/test/patest_write_sine.c b/portaudio-v19/test/patest_write_sine.c new file mode 100644 index 000000000..f0fcba0b6 --- /dev/null +++ b/portaudio-v19/test/patest_write_sine.c @@ -0,0 +1,147 @@ +/** @file patest_write_sine.c + @brief Play a sine wave for several seconds using the blocking API (Pa_WriteStream()) + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) + + +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + float buffer[FRAMES_PER_BUFFER][2]; /* stereo output buffer */ + float sine[TABLE_SIZE]; /* sine wavetable */ + int left_phase = 0; + int right_phase = 0; + int left_inc = 1; + int right_inc = 3; /* higher pitch so we can distinguish left and right. */ + int i, j, k; + int bufferCount; + + + printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + + printf( "Play 3 times, higher each time.\n" ); + + for( k=0; k < 3; ++k ) + { + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Play for %d seconds.\n", NUM_SECONDS ); + + bufferCount = ((NUM_SECONDS * SAMPLE_RATE) / FRAMES_PER_BUFFER); + + for( i=0; i < bufferCount; i++ ) + { + for( j=0; j < FRAMES_PER_BUFFER; j++ ) + { + buffer[j][0] = sine[left_phase]; /* left */ + buffer[j][1] = sine[right_phase]; /* right */ + left_phase += left_inc; + if( left_phase >= TABLE_SIZE ) left_phase -= TABLE_SIZE; + right_phase += right_inc; + if( right_phase >= TABLE_SIZE ) right_phase -= TABLE_SIZE; + } + + err = Pa_WriteStream( stream, buffer, FRAMES_PER_BUFFER ); + if( err != paNoError ) goto error; + } + + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + ++left_inc; + ++right_inc; + + Pa_Sleep( 1000 ); + } + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} diff --git a/portaudio-v19/test/patest_write_stop.c b/portaudio-v19/test/patest_write_stop.c new file mode 100644 index 000000000..e615ecece --- /dev/null +++ b/portaudio-v19/test/patest_write_stop.c @@ -0,0 +1,158 @@ +/** @file patest_write_stop.c + @brief Play a few seconds of silence followed by a few cycles of a sine wave. Tests to make sure that pa_StopStream() completes playback in blocking I/O + @author Bjorn Roche of XO Audio (www.xoaudio.com) + @author Ross Bencina + @author Phil Burk +*/ +/* + * $Id$ + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * 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. + * + * 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. + * + * 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. + * + */ +#include +#include +#include "portaudio.h" + +#define NUM_SECONDS (5) +#define SAMPLE_RATE (44100) +#define FRAMES_PER_BUFFER (1024) + +#ifndef M_PI +#define M_PI (3.14159265) +#endif + +#define TABLE_SIZE (200) + + +int main(void); +int main(void) +{ + PaStreamParameters outputParameters; + PaStream *stream; + PaError err; + float buffer[FRAMES_PER_BUFFER][2]; /* stereo output buffer */ + float sine[TABLE_SIZE]; /* sine wavetable */ + int left_phase = 0; + int right_phase = 0; + int left_inc = 1; + int right_inc = 3; /* higher pitch so we can distinguish left and right. */ + int i, j; + int bufferCount; + const int framesBy2 = FRAMES_PER_BUFFER >> 1; + const float framesBy2f = (float) framesBy2 ; + + + printf( "PortAudio Test: output silence, followed by one buffer of a ramped sine wave. SR = %d, BufSize = %d\n", + SAMPLE_RATE, FRAMES_PER_BUFFER); + + /* initialise sinusoidal wavetable */ + for( i=0; idefaultHighOutputLatency * 5; + outputParameters.hostApiSpecificStreamInfo = NULL; + + /* open the stream */ + err = Pa_OpenStream( + &stream, + NULL, /* no input */ + &outputParameters, + SAMPLE_RATE, + FRAMES_PER_BUFFER, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + NULL, /* no callback, use blocking API */ + NULL ); /* no callback, so no callback userData */ + if( err != paNoError ) goto error; + + /* start the stream */ + err = Pa_StartStream( stream ); + if( err != paNoError ) goto error; + + printf("Playing %d seconds of silence followed by one buffer of a ramped sinusoid.\n", NUM_SECONDS ); + + bufferCount = ((NUM_SECONDS * SAMPLE_RATE) / FRAMES_PER_BUFFER); + + /* clear buffer */ + for( j=0; j < FRAMES_PER_BUFFER; j++ ) + { + buffer[j][0] = 0; /* left */ + buffer[j][1] = 0; /* right */ + } + /* play the silent buffer a bunch o' times */ + for( i=0; i < bufferCount; i++ ) + { + err = Pa_WriteStream( stream, buffer, FRAMES_PER_BUFFER ); + if( err != paNoError ) goto error; + } + /* play a non-silent buffer once */ + for( j=0; j < FRAMES_PER_BUFFER; j++ ) + { + float ramp = 1; + if( j < framesBy2 ) + ramp = j / framesBy2f; + else + ramp = (FRAMES_PER_BUFFER - j) / framesBy2f ; + + buffer[j][0] = sine[left_phase] * ramp; /* left */ + buffer[j][1] = sine[right_phase] * ramp; /* right */ + left_phase += left_inc; + if( left_phase >= TABLE_SIZE ) left_phase -= TABLE_SIZE; + right_phase += right_inc; + if( right_phase >= TABLE_SIZE ) right_phase -= TABLE_SIZE; + } + err = Pa_WriteStream( stream, buffer, FRAMES_PER_BUFFER ); + if( err != paNoError ) goto error; + + /* stop stream, close, and terminate */ + err = Pa_StopStream( stream ); + if( err != paNoError ) goto error; + + err = Pa_CloseStream( stream ); + if( err != paNoError ) goto error; + + Pa_Terminate(); + printf("Test finished.\n"); + + return err; +error: + Pa_Terminate(); + fprintf( stderr, "An error occured while using the portaudio stream\n" ); + fprintf( stderr, "Error number: %d\n", err ); + fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} From 59b201d52c6dd065999ae8659fda9c21ca4d893d Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 9 Aug 2006 20:11:10 +0000 Subject: [PATCH 190/811] - This looks specific to windows only, however imported for completeness git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@250 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- portaudio-v19/build/dev-cpp/Makefile-dll | 78 +++++++ portaudio-v19/build/dev-cpp/Makefile-static | 75 +++++++ portaudio-v19/build/dev-cpp/portaudio-dll.dev | 209 ++++++++++++++++++ .../build/dev-cpp/portaudio-static.dev | 209 ++++++++++++++++++ portaudio-v19/build/dev-cpp/readme.txt | 23 ++ portaudio-v19/build/msvc/Makefile.msvc | 159 +++++++++++++ portaudio-v19/build/msvc/clean.bat | 7 + portaudio-v19/build/msvc/make.bat | 8 + portaudio-v19/build/msvc/portaudio.def | 43 ++++ portaudio-v19/build/msvc/readme.txt | 56 +++++ portaudio-v19/build/msvc/setenv.bat | 1 + portaudio-v19/build/scons/SConscript_common | 28 +++ portaudio-v19/build/scons/SConscript_opts | 92 ++++++++ 13 files changed, 988 insertions(+) create mode 100644 portaudio-v19/build/dev-cpp/Makefile-dll create mode 100644 portaudio-v19/build/dev-cpp/Makefile-static create mode 100644 portaudio-v19/build/dev-cpp/portaudio-dll.dev create mode 100644 portaudio-v19/build/dev-cpp/portaudio-static.dev create mode 100644 portaudio-v19/build/dev-cpp/readme.txt create mode 100644 portaudio-v19/build/msvc/Makefile.msvc create mode 100755 portaudio-v19/build/msvc/clean.bat create mode 100755 portaudio-v19/build/msvc/make.bat create mode 100644 portaudio-v19/build/msvc/portaudio.def create mode 100644 portaudio-v19/build/msvc/readme.txt create mode 100755 portaudio-v19/build/msvc/setenv.bat create mode 100644 portaudio-v19/build/scons/SConscript_common create mode 100644 portaudio-v19/build/scons/SConscript_opts diff --git a/portaudio-v19/build/dev-cpp/Makefile-dll b/portaudio-v19/build/dev-cpp/Makefile-dll new file mode 100644 index 000000000..856af638e --- /dev/null +++ b/portaudio-v19/build/dev-cpp/Makefile-dll @@ -0,0 +1,78 @@ +# Project: portaudio-dll +# Makefile created by Dev-C++ 4.9.8.2 + +CPP = g++.exe +CC = gcc.exe +WINDRES = windres.exe +RES = +OBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) +LINKOBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) +LIBS = -L"C:/Dev-CPP/lib" -fmessage-length=0 --no-export-all-symbols --add-stdcall-alias ../../../asiosdk2/asiosdk2.a -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm -O3 -s +INCS = -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" +CXXINCS = -I"C:/Dev-CPP/include/c++" -I"C:/Dev-CPP/include/c++/mingw32" -I"C:/Dev-CPP/include/c++/backward" -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" +BIN = portaudio-dll.dll +CXXFLAGS = $(CXXINCS)-O3 -fmessage-length=0 -Wall +CFLAGS = $(INCS)-DBUILDING_DLL=1 -O3 -fmessage-length=0 -Wall + +.PHONY: all all-before all-after clean clean-custom + +all: all-before portaudio-dll.dll all-after + + +clean: clean-custom + rm -f $(OBJ) $(BIN) + +DLLWRAP=dllwrap.exe +DEFFILE=libportaudio-dll.def +STATICLIB=libportaudio-dll.a + +$(BIN): $(LINKOBJ) + $(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(LINKOBJ) $(LIBS) -o $(BIN) + +./pa_skeleton.o: ../../pa_common/pa_skeleton.c + $(CPP) -c ../../pa_common/pa_skeleton.c -o ./pa_skeleton.o $(CXXFLAGS) + +./pa_stream.o: ../../pa_common/pa_stream.c + $(CPP) -c ../../pa_common/pa_stream.c -o ./pa_stream.o $(CXXFLAGS) + +./pa_trace.o: ../../pa_common/pa_trace.c + $(CPP) -c ../../pa_common/pa_trace.c -o ./pa_trace.o $(CXXFLAGS) + +./pa_allocation.o: ../../pa_common/pa_allocation.c + $(CPP) -c ../../pa_common/pa_allocation.c -o ./pa_allocation.o $(CXXFLAGS) + +./pa_converters.o: ../../pa_common/pa_converters.c + $(CPP) -c ../../pa_common/pa_converters.c -o ./pa_converters.o $(CXXFLAGS) + +./pa_cpuload.o: ../../pa_common/pa_cpuload.c + $(CPP) -c ../../pa_common/pa_cpuload.c -o ./pa_cpuload.o $(CXXFLAGS) + +./pa_dither.o: ../../pa_common/pa_dither.c + $(CPP) -c ../../pa_common/pa_dither.c -o ./pa_dither.o $(CXXFLAGS) + +./pa_front.o: ../../pa_common/pa_front.c + $(CPP) -c ../../pa_common/pa_front.c -o ./pa_front.o $(CXXFLAGS) + +./pa_process.o: ../../pa_common/pa_process.c + $(CPP) -c ../../pa_common/pa_process.c -o ./pa_process.o $(CXXFLAGS) + +./pa_asio.o: ../../pa_asio/pa_asio.cpp + $(CPP) -c ../../pa_asio/pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) + +./pa_win_util.o: ../pa_win_util.c + $(CPP) -c ../pa_win_util.c -o ./pa_win_util.o $(CXXFLAGS) + +./pa_win_hostapis.o: ../pa_win_hostapis.c + $(CPP) -c ../pa_win_hostapis.c -o ./pa_win_hostapis.o $(CXXFLAGS) + +./pa_win_ds.o: ../../pa_win_ds/pa_win_ds.c + $(CPP) -c ../../pa_win_ds/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS) + +./dsound_wrapper.o: ../../pa_win_ds/dsound_wrapper.c + $(CPP) -c ../../pa_win_ds/dsound_wrapper.c -o ./dsound_wrapper.o $(CXXFLAGS) + +./pa_win_wmme.o: ../../pa_win_wmme/pa_win_wmme.c + $(CPP) -c ../../pa_win_wmme/pa_win_wmme.c -o ./pa_win_wmme.o $(CXXFLAGS) + +./iasiothiscallresolver.o: ../../pa_asio/iasiothiscallresolver.cpp + $(CPP) -c ../../pa_asio/iasiothiscallresolver.cpp -o ./iasiothiscallresolver.o $(CXXFLAGS) diff --git a/portaudio-v19/build/dev-cpp/Makefile-static b/portaudio-v19/build/dev-cpp/Makefile-static new file mode 100644 index 000000000..2a1647ddc --- /dev/null +++ b/portaudio-v19/build/dev-cpp/Makefile-static @@ -0,0 +1,75 @@ +# Project: portaudio-static +# Makefile created by Dev-C++ 4.9.8.2 + +CPP = g++.exe +CC = gcc.exe +WINDRES = windres.exe +RES = +OBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) +LINKOBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) +LIBS = -L"C:/Dev-CPP/lib" -fmessage-length=0 -O3 -s +INCS = -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" +CXXINCS = -I"C:/Dev-CPP/include/c++" -I"C:/Dev-CPP/include/c++/mingw32" -I"C:/Dev-CPP/include/c++/backward" -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" +BIN = portaudio-static.a +CXXFLAGS = $(CXXINCS)-O3 -fmessage-length=0 -Wall +CFLAGS = $(INCS)-O3 -fmessage-length=0 -Wall + +.PHONY: all all-before all-after clean clean-custom + +all: all-before portaudio-static.a all-after + + +clean: clean-custom + rm -f $(OBJ) $(BIN) + +$(BIN): $(LINKOBJ) + ar r $(BIN) $(LINKOBJ) + ranlib $(BIN) + +./pa_skeleton.o: ../../pa_common/pa_skeleton.c + $(CPP) -c ../../pa_common/pa_skeleton.c -o ./pa_skeleton.o $(CXXFLAGS) + +./pa_stream.o: ../../pa_common/pa_stream.c + $(CPP) -c ../../pa_common/pa_stream.c -o ./pa_stream.o $(CXXFLAGS) + +./pa_trace.o: ../../pa_common/pa_trace.c + $(CPP) -c ../../pa_common/pa_trace.c -o ./pa_trace.o $(CXXFLAGS) + +./pa_allocation.o: ../../pa_common/pa_allocation.c + $(CPP) -c ../../pa_common/pa_allocation.c -o ./pa_allocation.o $(CXXFLAGS) + +./pa_converters.o: ../../pa_common/pa_converters.c + $(CPP) -c ../../pa_common/pa_converters.c -o ./pa_converters.o $(CXXFLAGS) + +./pa_cpuload.o: ../../pa_common/pa_cpuload.c + $(CPP) -c ../../pa_common/pa_cpuload.c -o ./pa_cpuload.o $(CXXFLAGS) + +./pa_dither.o: ../../pa_common/pa_dither.c + $(CPP) -c ../../pa_common/pa_dither.c -o ./pa_dither.o $(CXXFLAGS) + +./pa_front.o: ../../pa_common/pa_front.c + $(CPP) -c ../../pa_common/pa_front.c -o ./pa_front.o $(CXXFLAGS) + +./pa_process.o: ../../pa_common/pa_process.c + $(CPP) -c ../../pa_common/pa_process.c -o ./pa_process.o $(CXXFLAGS) + +./pa_asio.o: ../../pa_asio/pa_asio.cpp + $(CPP) -c ../../pa_asio/pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) + +./pa_win_util.o: ../pa_win_util.c + $(CPP) -c ../pa_win_util.c -o ./pa_win_util.o $(CXXFLAGS) + +./pa_win_hostapis.o: ../pa_win_hostapis.c + $(CPP) -c ../pa_win_hostapis.c -o ./pa_win_hostapis.o $(CXXFLAGS) + +./pa_win_ds.o: ../../pa_win_ds/pa_win_ds.c + $(CPP) -c ../../pa_win_ds/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS) + +./dsound_wrapper.o: ../../pa_win_ds/dsound_wrapper.c + $(CPP) -c ../../pa_win_ds/dsound_wrapper.c -o ./dsound_wrapper.o $(CXXFLAGS) + +./pa_win_wmme.o: ../../pa_win_wmme/pa_win_wmme.c + $(CPP) -c ../../pa_win_wmme/pa_win_wmme.c -o ./pa_win_wmme.o $(CXXFLAGS) + +./iasiothiscallresolver.o: ../../pa_asio/iasiothiscallresolver.cpp + $(CPP) -c ../../pa_asio/iasiothiscallresolver.cpp -o ./iasiothiscallresolver.o $(CXXFLAGS) diff --git a/portaudio-v19/build/dev-cpp/portaudio-dll.dev b/portaudio-v19/build/dev-cpp/portaudio-dll.dev new file mode 100644 index 000000000..086e109ee --- /dev/null +++ b/portaudio-v19/build/dev-cpp/portaudio-dll.dev @@ -0,0 +1,209 @@ +[Project] +FileName=portaudio-dll.dev +Name=portaudio-dll +UnitCount=16 +Type=3 +Ver=1 +ObjFiles= +Includes=..\..\..\asiosdk2;..\..\..\asiosdk2\common;..\..\..\asiosdk2\host;..\..\..\asiosdk2\host\pc;..\..\pa_common +Libs= +PrivateResource= +ResourceIncludes= +MakeIncludes= +Compiler=-DBUILDING_DLL=1_@@_-O3_@@_ +CppCompiler=-O3_@@_ +Linker=--no-export-all-symbols --add-stdcall-alias_@@_../../../asiosdk2/asiosdk2.a_@@_-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm_@@_-O3 -s_@@_ +IsCpp=1 +Icon= +ExeOutput=. +ObjectOutput=. +OverrideOutput=0 +OverrideOutputName=portaudio.a +HostApplication= +Folders= +CommandLine= +IncludeVersionInfo=0 +SupportXPThemes=0 +CompilerSet=0 +CompilerSettings=0000000000000000000 +UseCustomMakefile=0 +CustomMakefile= + +[Unit1] +FileName=..\..\pa_common\pa_skeleton.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_skeleton.c -o ./pa_skeleton.o $(CFLAGS) + +[Unit2] +FileName=..\..\pa_common\pa_stream.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_stream.c -o ./pa_stream.o $(CFLAGS) + +[Unit3] +FileName=..\..\pa_common\pa_trace.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_trace.c -o ./pa_trace.o $(CFLAGS) + +[Unit4] +FileName=..\..\pa_common\pa_allocation.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_allocation.c -o ./pa_allocation.o $(CFLAGS) + +[Unit5] +FileName=..\..\pa_common\pa_converters.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_converters.c -o ./pa_converters.o $(CFLAGS) + +[Unit6] +FileName=..\..\pa_common\pa_cpuload.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_cpuload.c -o ./pa_cpuload.o $(CFLAGS) + +[Unit7] +FileName=..\..\pa_common\pa_dither.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_dither.c -o ./pa_dither.o $(CFLAGS) + +[Unit8] +FileName=..\..\pa_common\pa_front.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_front.c -o ./pa_front.o $(CFLAGS) + +[Unit9] +FileName=..\..\pa_common\pa_process.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_process.c -o ./pa_process.o $(CFLAGS) + +[VersionInfo] +Major=0 +Minor=1 +Release=1 +Build=1 +LanguageID=1033 +CharsetID=1252 +CompanyName= +FileVersion= +FileDescription=Developed using the Dev-C++ IDE +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion= +AutoIncBuildNr=0 + +[Unit10] +FileName=..\..\pa_asio\pa_asio.cpp +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CPP) -c pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) + +[Unit11] +FileName=..\pa_win_util.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_util.c -o ./pa_win_util.o $(CFLAGS) + +[Unit12] +FileName=..\pa_win_hostapis.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_hostapis.c -o ./pa_win_hostapis.o $(CFLAGS) + +[Unit13] +FileName=..\..\pa_win_ds\pa_win_ds.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_ds.c -o ./pa_win_ds.o $(CFLAGS) + +[Unit14] +FileName=..\..\pa_win_ds\dsound_wrapper.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c dsound_wrapper.c -o ./dsound_wrapper.o $(CFLAGS) + +[Unit15] +FileName=..\..\pa_win_wmme\pa_win_wmme.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_wmme.c -o ./pa_win_wmme.o $(CFLAGS) + +[Unit16] +FileName=..\..\pa_asio\iasiothiscallresolver.cpp +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + diff --git a/portaudio-v19/build/dev-cpp/portaudio-static.dev b/portaudio-v19/build/dev-cpp/portaudio-static.dev new file mode 100644 index 000000000..2aae584df --- /dev/null +++ b/portaudio-v19/build/dev-cpp/portaudio-static.dev @@ -0,0 +1,209 @@ +[Project] +FileName=portaudio-static.dev +Name=portaudio-static +UnitCount=16 +Type=2 +Ver=1 +ObjFiles= +Includes=..\..\..\asiosdk2;..\..\..\asiosdk2\common;..\..\..\asiosdk2\host;..\..\..\asiosdk2\host\pc;..\..\pa_common +Libs= +PrivateResource= +ResourceIncludes= +MakeIncludes= +Compiler=-O3_@@_ +CppCompiler=-O3_@@_ +Linker=-O3 -s_@@_ +IsCpp=1 +Icon= +ExeOutput=. +ObjectOutput=. +OverrideOutput=0 +OverrideOutputName=portaudio.a +HostApplication= +Folders= +CommandLine= +IncludeVersionInfo=0 +SupportXPThemes=0 +CompilerSet=0 +CompilerSettings=0000000000000000000 +UseCustomMakefile=0 +CustomMakefile= + +[Unit1] +FileName=..\..\pa_common\pa_skeleton.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_skeleton.c -o ./pa_skeleton.o $(CFLAGS) + +[Unit2] +FileName=..\..\pa_common\pa_stream.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_stream.c -o ./pa_stream.o $(CFLAGS) + +[Unit3] +FileName=..\..\pa_common\pa_trace.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_trace.c -o ./pa_trace.o $(CFLAGS) + +[Unit4] +FileName=..\..\pa_common\pa_allocation.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_allocation.c -o ./pa_allocation.o $(CFLAGS) + +[Unit5] +FileName=..\..\pa_common\pa_converters.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_converters.c -o ./pa_converters.o $(CFLAGS) + +[Unit6] +FileName=..\..\pa_common\pa_cpuload.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_cpuload.c -o ./pa_cpuload.o $(CFLAGS) + +[Unit7] +FileName=..\..\pa_common\pa_dither.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_dither.c -o ./pa_dither.o $(CFLAGS) + +[Unit8] +FileName=..\..\pa_common\pa_front.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_front.c -o ./pa_front.o $(CFLAGS) + +[Unit9] +FileName=..\..\pa_common\pa_process.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_process.c -o ./pa_process.o $(CFLAGS) + +[VersionInfo] +Major=0 +Minor=1 +Release=1 +Build=1 +LanguageID=1033 +CharsetID=1252 +CompanyName= +FileVersion= +FileDescription=Developed using the Dev-C++ IDE +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion= +AutoIncBuildNr=0 + +[Unit10] +FileName=..\..\pa_asio\pa_asio.cpp +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CPP) -c pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) + +[Unit11] +FileName=..\..\pa_win\pa_win_util.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_util.c -o ./pa_win_util.o $(CFLAGS) + +[Unit12] +FileName=..\..\pa_win\pa_win_hostapis.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_hostapis.c -o ./pa_win_hostapis.o $(CFLAGS) + +[Unit13] +FileName=..\..\pa_win_ds\pa_win_ds.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_ds.c -o ./pa_win_ds.o $(CFLAGS) + +[Unit14] +FileName=..\..\pa_win_ds\dsound_wrapper.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c dsound_wrapper.c -o ./dsound_wrapper.o $(CFLAGS) + +[Unit15] +FileName=..\..\pa_win_wmme\pa_win_wmme.c +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd=$(CC) -c pa_win_wmme.c -o ./pa_win_wmme.o $(CFLAGS) + +[Unit16] +FileName=..\..\pa_asio\iasiothiscallresolver.cpp +CompileCpp=1 +Folder=portaudio +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + diff --git a/portaudio-v19/build/dev-cpp/readme.txt b/portaudio-v19/build/dev-cpp/readme.txt new file mode 100644 index 000000000..07108a7dd --- /dev/null +++ b/portaudio-v19/build/dev-cpp/readme.txt @@ -0,0 +1,23 @@ +From: "Peter L Jones" +Sent: Wednesday, September 17, 2003 5:18 AM +Subject: Dev-C++ project files + +I attach two project files intended for portaudio/pa_win/dev-cpp (i.e. in +parallel with the msvc directory), if you want them. One is for a static +library build and one for a DLL. I've used the static library (in building +a single monolithic DLL) but I can't guarantee the DLL version will build a +working library (I think it's mostly there, though!). + +I also attach the resulting makefiles, which may be of use to other MinGW +users. + +They're rooted in the directory given above and drop their object and +library files in the same place. They assume the asiosdk2 files are in the +same directory as portaudio/ in a sub-directory called asiosdk2/. Oh! The +DLL is built against a static asiosdk2.a library... maybe not the best way +to do it... I ought to figure out how to link against a "home made" dll in +Dev-C++, I guess ;-) + +Cheers, + +-- Peter diff --git a/portaudio-v19/build/msvc/Makefile.msvc b/portaudio-v19/build/msvc/Makefile.msvc new file mode 100644 index 000000000..2f1a104e7 --- /dev/null +++ b/portaudio-v19/build/msvc/Makefile.msvc @@ -0,0 +1,159 @@ +# Portaudio v1.9-devel VC6 DLL makefile 1.0 +# +# David Viens, davidv@plogue.com +# (im far from a VC6 makefile expert, so please bear with me :) +# +# For more info, look at readme.txt +# +#if you keep the ASIODIR as ".", it will use the SDK files that direclty in "pa_win/msvc" dir +ASIODIR=. +ASIOINC=/I ".\host" /I ".\host\pc" /I ".\common" +# + +LIBZ=kernel32.lib user32.lib gdi32.lib wininet.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib dsound.lib dxguid.lib + +CPP=cl.exe +LINK32=link.exe + +#release +CFLAGS=/nologo /MD /W3 /GX /O2 /Ob2 /I "src" /I "Win32" /I "$(MSVCDir)\Include" /D "WIN32" /D "NDEBUG" /D "_USRDLL" /YX /FD +DLL_LINK_FLAGS= /nologo /dll /incremental:no /libpath:"$(MSVCDir)\Lib" $(LIBZ) /pdb:"portaudio.pdb" /implib:".\portaudio.lib" /machine:I386 /out:"portaudio.dll" + + +COMMONINC=/I "..\..\pa_common" /I "." + +#==================================================================== +# Targets + +ALL : portaudio.dll + +CLEAN : + -@erase "*.obj" + +#==================================================================== + + +LINK32_OBJS= \ + ".\pa_allocation.obj" \ + ".\pa_converters.obj" \ + ".\pa_x86_plain_converters.obj" \ +# ".\pa_cppHelp.obj" \ + ".\pa_cpuload.obj" \ + ".\pa_dither.obj" \ + ".\pa_front.obj" \ + ".\pa_process.obj" \ + ".\pa_skeleton.obj" \ + ".\pa_stream.obj" \ + ".\pa_trace.obj" \ +# + ".\pa_win_hostapis.obj" \ + ".\pa_win_util.obj" \ +# + ".\pa_win_wmme.obj" \ +# + ".\pa_win_ds.obj" \ + ".\dsound_wrapper.obj" \ +# + ".\pa_asio.obj" \ +# + ".\asio.obj" \ + ".\ASIOConvertSamples.obj" \ + ".\asiodrivers.obj" \ + ".\asiolist.obj" \ + ".\combase.obj" \ + ".\debugmessage.obj" \ +# ".\dllentry.obj" \ + ".\register.obj" + + +portaudio.dll : $(LINK32_OBJS) ".\portaudio.def" + $(LINK32) $(DLL_LINK_FLAGS) /def:".\portaudio.def" $(LINK32_OBJS) + +#==================================================================== +# asio files (need to agree to steinberg agreement) +# this makefile assumes all files have being copied in the pa_win/msvc dir (for now) +# see readme.txt for details + +".\asio.obj" : ".\common\asio.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\asio.obj" /c ".\common\asio.cpp" + +".\ASIOConvertSamples.obj" : ".\host\ASIOConvertSamples.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\ASIOConvertSamples.obj" /c ".\host\ASIOConvertSamples.cpp" + +".\asiodrivers.obj" : ".\host\asiodrivers.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\asiodrivers.obj" /c ".\host\asiodrivers.cpp" + +".\asiolist.obj" : ".\host\pc\asiolist.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\asiolist.obj" /c ".\host\pc\asiolist.cpp" + +".\combase.obj" : ".\common\combase.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\combase.obj" /c ".\common\combase.cpp" + +".\debugmessage.obj" : ".\common\debugmessage.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\debugmessage.obj" /c ".\common\debugmessage.cpp" + +".\register.obj" : ".\common\register.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) /Fo".\register.obj" /c ".\common\register.cpp" + +#==================================================================== +# Portaudio Common +# +".\pa_allocation.obj" : "..\..\pa_common\pa_allocation.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_allocation.obj" /c "..\..\pa_common\pa_allocation.c" + +".\pa_converters.obj" : "..\..\pa_common\pa_converters.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_converters.obj" /c "..\..\pa_common\pa_converters.c" + +".\pa_cppHelp.obj" : "..\..\pa_common\pa_cppHelp.cpp" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_cppHelp.obj" /c "..\..\pa_common\pa_cppHelp.cpp" + +".\pa_cpuload.obj" : "..\..\pa_common\pa_cpuload.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_cpuload.obj" /c "..\..\pa_common\pa_cpuload.c" + +".\pa_dither.obj" : "..\..\pa_common\pa_dither.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_dither.obj" /c "..\..\pa_common\pa_dither.c" + +".\pa_front.obj" : "..\..\pa_common\pa_front.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_front.obj" /c "..\..\pa_common\pa_front.c" + +".\pa_process.obj" : "..\..\pa_common\pa_process.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_process.obj" /c "..\..\pa_common\pa_process.c" + +".\pa_skeleton.obj" : "..\..\pa_common\pa_skeleton.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_skeleton.obj" /c "..\..\pa_common\pa_skeleton.c" + +".\pa_stream.obj" : "..\..\pa_common\pa_stream.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_stream.obj" /c "..\..\pa_common\pa_stream.c" + +".\pa_trace.obj" : "..\..\pa_common\pa_trace.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_trace.obj" /c "..\..\pa_common\pa_trace.c" + +#==================================================================== +# Portaudio implementations +# + +".\pa_win_hostapis.obj" : "..\..\pa_win\pa_win_hostapis.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_win_hostapis.obj" /c "..\..\pa_win\pa_win_hostapis.c" + +".\pa_win_util.obj" : "..\..\pa_win\pa_win_util.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_win_util.obj" /c "..\..\pa_win\pa_win_util.c" + +".\pa_x86_plain_converters.obj" : "..\..\pa_win\pa_x86_plain_converters.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_x86_plain_converters.obj" /c "..\..\pa_win\pa_x86_plain_converters.c" + +".\pa_asio.obj" : "..\..\pa_asio\pa_asio.cpp" + $(CPP) $(CFLAGS) $(ASIOINC) $(COMMONINC) /Fo".\pa_asio.obj" /c "..\..\pa_asio\pa_asio.cpp" + +".\pa_win_wmme.obj" : "..\..\pa_win_wmme\pa_win_wmme.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_win_wmme.obj" /c "..\..\pa_win_wmme\pa_win_wmme.c" + +".\pa_win_ds.obj" : "..\..\pa_win_ds\pa_win_ds.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\pa_win_ds.obj" /c "..\..\pa_win_ds\pa_win_ds.c" + +".\dsound_wrapper.obj" : "..\..\pa_win_ds\dsound_wrapper.c" + $(CPP) $(CFLAGS) $(COMMONINC) /Fo".\dsound_wrapper.obj" /c "..\..\pa_win_ds\dsound_wrapper.c" + + +# End of Makefile +#==================================================================== +# \ No newline at end of file diff --git a/portaudio-v19/build/msvc/clean.bat b/portaudio-v19/build/msvc/clean.bat new file mode 100755 index 000000000..601c0d314 --- /dev/null +++ b/portaudio-v19/build/msvc/clean.bat @@ -0,0 +1,7 @@ +del *.obj +del *.dll +del *.lib +del *.exp +del *.pch +del *.idb + diff --git a/portaudio-v19/build/msvc/make.bat b/portaudio-v19/build/msvc/make.bat new file mode 100755 index 000000000..34d6aed48 --- /dev/null +++ b/portaudio-v19/build/msvc/make.bat @@ -0,0 +1,8 @@ +CALL C:\progra~1\micros~2\VC98\bin\vcvars32 +del *.dll +del *.lib +nmake Makefile.msvc +del *.obj +del *.exp +del *.pch +del *.idb diff --git a/portaudio-v19/build/msvc/portaudio.def b/portaudio-v19/build/msvc/portaudio.def new file mode 100644 index 000000000..97a1c3502 --- /dev/null +++ b/portaudio-v19/build/msvc/portaudio.def @@ -0,0 +1,43 @@ +LIBRARY portaudio.dll +EXPORTS + +; +Pa_GetVersion @1 +Pa_GetVersionText @2 +Pa_GetErrorText @3 +Pa_Initialize @4 +Pa_Terminate @5 +Pa_GetHostApiCount @6 +Pa_GetDefaultHostApi @7 +Pa_GetHostApiInfo @8 +Pa_HostApiTypeIdToHostApiIndex @9 +Pa_HostApiDeviceIndexToDeviceIndex @10 +Pa_GetLastHostErrorInfo @11 +Pa_GetDeviceCount @12 +Pa_GetDefaultInputDevice @13 +Pa_GetDefaultOutputDevice @14 +Pa_GetDeviceInfo @15 +Pa_IsFormatSupported @16 +Pa_OpenStream @17 +Pa_OpenDefaultStream @18 +Pa_CloseStream @19 +Pa_SetStreamFinishedCallback @20 +Pa_StartStream @21 +Pa_StopStream @22 +Pa_AbortStream @23 +Pa_IsStreamStopped @24 +Pa_IsStreamActive @25 +Pa_GetStreamInfo @26 +Pa_GetStreamTime @27 +Pa_GetStreamCpuLoad @28 +Pa_ReadStream @29 +Pa_WriteStream @30 +Pa_GetStreamReadAvailable @31 +Pa_GetStreamWriteAvailable @32 +Pa_GetSampleSize @33 +Pa_Sleep @34 +PaAsio_GetAvailableLatencyValues @50 +PaAsio_ShowControlPanel @51 +PaUtil_InitializeX86PlainConverters @52 +PaAsio_GetInputChannelName @53 +PaAsio_GetOutputChannelName @54 \ No newline at end of file diff --git a/portaudio-v19/build/msvc/readme.txt b/portaudio-v19/build/msvc/readme.txt new file mode 100644 index 000000000..19ced4c4c --- /dev/null +++ b/portaudio-v19/build/msvc/readme.txt @@ -0,0 +1,56 @@ +Hello + + This is a small list of steps in order to build portaudio +(Currently v19-devel) into a VC6 DLL and lib file. +This DLL contains all 3 current win32 PA APIS (MM/DS/ASIO) + +1)Copy the source dirs that comes with the ASIO SDK inside pa_win\msvc + so you should now have: + + pa_win\msvc\common + pa_win\msvc\host + pa_win\msvc\host\sample + pa_win\msvc\host\pc + pa_win\msvc\host\mac (not needed) + + You dont need "driver" + + +2)execure "make.bat", this assumes VC6 is installed in + C:\Program Files\Microsoft Visual Studio\ + + if its not, + + Open a command Prompt and execute "vcvars32.bat" which sets the environment + so that you can use Microsoft's "nmake" + EX: C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat + or (C:\progra~1\micros~2\VC98\bin\vcvars32) dumb de dumb + + You should now have seen a line that said: + "Setting environment for using Microsoft Visual C++ tools." + While in pa_win\msvc , type "nmake makefile.msvc" + this _should_ create portaudio.dll and portaudio.lib + +3)Now in any VC6 project, in which you require portaudio, + you can just link with portaudio.lib, and of course include the + relevant headers + (portaudio.h, and/or pa_asio.h , pa_x86_plain_converters.h) See (*) + +4) Your new exe should now use portaudio.dll. + + +Have fun! + +(*): you may want to add/remove some DLL entry points. +Right now those 3 entries are _not_ from portaudio.h + +(from portaudio.def) +(...) +PaAsio_GetAvailableLatencyValues @50 +PaAsio_ShowControlPanel @51 +PaUtil_InitializeX86PlainConverters @52 + + +----- +last update April 16th 2003 +David Viens, davidv@plogue.com \ No newline at end of file diff --git a/portaudio-v19/build/msvc/setenv.bat b/portaudio-v19/build/msvc/setenv.bat new file mode 100755 index 000000000..f4c815a78 --- /dev/null +++ b/portaudio-v19/build/msvc/setenv.bat @@ -0,0 +1 @@ +C:\progra~1\micros~2\VC98\bin\vcvars32 diff --git a/portaudio-v19/build/scons/SConscript_common b/portaudio-v19/build/scons/SConscript_common new file mode 100644 index 000000000..e5d164751 --- /dev/null +++ b/portaudio-v19/build/scons/SConscript_common @@ -0,0 +1,28 @@ +import os.path, sys + +class ConfigurationError(Exception): + def __init__(self, reason): + Exception.__init__(self, "Configuration failed: %s" % reason) + +env = Environment() + +# sunos, aix, hpux, irix, sunos appear to be platforms known by SCons, assuming they're POSIX compliant +Posix = ("linux", "darwin", "sunos", "aix", "hpux", "irix", "sunos") +Windows = ("win32", "cygwin") + +if env["PLATFORM"] == "posix": + if sys.platform[:5] == "linux": + Platform = "linux" + else: + raise ConfigurationError("Unknown platform %s" % sys.platform) +else: + if not env["PLATFORM"] in ("win32", "cygwin") + Posix: + raise ConfigurationError("Unknown platform %s" % env["PLATFORM"]) + Platform = env["PLATFORM"] + +# Inspired by the versioning scheme followed by Qt, it seems sensible enough. There are three components: major, minor +# and micro. Major changes with each subtraction from the API (backward-incompatible, i.e. V19 vs. V18), minor changes +# with each addition to the API (backward-compatible), micro changes with each revision of the source code. +ApiVer = "2.0.0" + +Export("Platform", "Posix", "ConfigurationError", "ApiVer") diff --git a/portaudio-v19/build/scons/SConscript_opts b/portaudio-v19/build/scons/SConscript_opts new file mode 100644 index 000000000..7c9204c3b --- /dev/null +++ b/portaudio-v19/build/scons/SConscript_opts @@ -0,0 +1,92 @@ +import os.path, sys + +def _PackageOption(pkgName, default=1): + """ Allow user to choose whether a package should be used if available. This results in a commandline option use, + where Pkgname is the name of the package with a capitalized first letter. + @param pkgName: Name of package. + @param default: The default value for this option ("yes"/"no"). + """ + return BoolOption("use%s" % pkgName[0].upper() + pkgName[1:], "use %s if available" % (pkgName), default) + +def _BoolOption(opt, explanation, default=1): + """ Allow user to enable/disable a certain option. This results in a commandline option enable