uisp-20050207/0000777000175100017510000000000010201771606007742 500000000000000uisp-20050207/doc/0000777000175100017510000000000010201771606010507 500000000000000uisp-20050207/doc/HOWTO.windows0000644000175100017510000000640407633415270012752 00000000000000$Id: HOWTO.windows,v 1.2 2003/03/11 17:19:52 troth Exp $ MINI-HOWTO to build and use uisp under cygwin/w32. ---------------------------------------------------------------------------- ----------- 2002-06-23 Marc Wetzel * First release. Cygwin part. 2002-06-24 Theodore A. Roth * Minor formatting changes. Cygwin: ------- Short version: -------------- Get uisp-source. ./bootstrap (Only needed if you get source from CVS) ./configure make make install Long version: -------------- Install cygwin as explained by redhat Be sure to also install the development tools: GNU-C and GNU-CPP, and don't forget to install 'make', too :) Create a directory e.g. "/home/username/uisp-cvs". Get the latest cvs source/ or snapshot out of savannah.gnu.org into this directory. CVS: cvs -z3 -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/uisp login cvs -z3 -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/uisp co uisp Create the configure script by calling `./bootstrap`. Now we call `./configure` to create the necessary makefiles depending on your system. Your are ready to type `make && make install` to build UISP. This build will link uisp with the cygwin dll's to provide the unix subsystem (posix layer) on a plain windows box. See the cygwin site to get a deeper knowledge of it. But you can use this uisp/w32 by just copying the necessary dll's out of your cygwin directory into the windows\system or system32 directory. Necessary are the following 3 dlls: 13.12.2001 11:33 22.016 cygintl-1.dll 22.11.2001 00:16 41.105 cygpcre.dll 25.02.2002 18:16 769.352 cygwin1.dll Installing the printer-port driver: ----------------------------------- Under Windows NT or Windows 2000 you need to install a special driver to get access to system resources like the printer port. A ready to use lpt-driver for uisp is for example giveio. One place where GIVEIO is found is e.g. here: . Unzip the downloaded file to a location of your choice: e.g. "c:\Program Files\Giveio". Copy the unzipped giveio.sys to your "winnt\system32\drivers" directory. Now run the program loaddrv.exe to install the driver, you'll have to change the "Full pathname of driver" to the location you copied the giveio.sys to: e.g. "C:\WINNT\SYSTEM32\DRIVERS\GIVEIO.SYS". Now press install, then start. You should see the status change to "Operation was successful" - Now the driver is installed. You should now extend your preferred compiler-startup-batch e.g. `run.cmd` with the line `net start giveio` as this driver is not installed automatically. Or run the loaddrv.exe (with changing to the right path) and press the start-button. You could extend your makefiles with the following two lines to have a new rule `make install` to flash the built .rom file into your avr. My programming-interface is a stk200 compatible one, and I like the hashes to see that uisp is still working... ISP = C:/PATH-TO-UISP/uisp.exe install: $(TARG) $(ISP) -v=3 -dprog=stk200 --hash=1024 --erase --upload if=$(TARG).hex MinGW: To be continued... Any comments and/or corrections go to Marc Wetzel: uisp-20050207/doc/README.stk5000000644000175100017510000001567107546615520012354 00000000000000$Id: README.stk500,v 1.2 2002/10/02 16:14:08 troth Exp $ NOTE: Atmel has finally released the specs for the protocol for talking to the stk500 over a serial line. Here's where to get the files: ftp://www.atmel.com/pub/atmel/avr061.zip http://www.atmel.com/atmel/acrobat/doc2525.pdf STK500 Commands **preliminary information** --------------- Extracted by Jason Kyle 20010701 Updated 200201 The latest version of this document can be found at www.avr1.org. Notes: - Incomplete but sufficient to make progress on free tools. - All commands are terminated by 0x20 - All successful responses are framed 0x14 data 0x10 (i.e. NULL response is 0x14 0x10) - Commands invalid in current mode (i.e not in pgm mode, pgm page) give 0x14 0x13 response. STK500 BOARD COMMANDS --------------------- ** ?STK500 Command 0x30 0x20 Response 0x14 0x10 Use Establish STK500 presence and UART sync. Re-send n times until response. Notes STK500 won't respond to other commands unless this has been sent. ** BoardID Command 0x31 0x20 Response 0x14 "AVR STK" 0x10 Use Identify board. Notes ** VTargetSet Command 0x40 0x84 VTarget 0x20 Response 0x14 0x10 Use Set VTarget voltage. Notes 0x33 = 5.1V , 0x34 = 5.2V , 0x32 = 5.0V ** ARefSet Command 0x40 0x85 ARef 0x20 Response 0x14 0x10 Use Set ARef voltage. Notes Same count/V relationship as VTargetRead ** POscSet Command 0x40 0x86 POsc 0x20 Response 0x14 0x10 Use Set P parameter. Notes ** NOscSet Command 0x40 0x87 NOsc 0x20 Response 0x14 0x10 Use Set N parameter. Notes ** SDOscSet Command 0x40 0x89 SDOsc 0x20 Response 0x14 0x10 Use Set SD parameter. Notes ** HWver Command 0x41 0x80 0x20 Response 0x14 0x02 0x10 Use Hardware version identification. Notes ** SWmajor Command 0x41 0x81 0x20 Response 0x14 0x01 0x10 Use Software major version identification. Notes ** SWminor Command 0x41 0x82 0x20 Response 0x14 0x07 0x10 Use Software minor version identification. Notes ** VTargetRead Command 0x41 0x84 0x20 Response 0x14 0x33 0x10 Use Query present VTarget voltage. Notes 0x33 = 5.1V , 0x34 = 5.2V , 0x32 = 5.0V ** ARefRead Command 0x41 0x85 0x20 Response 0x14 0x33 0x10 Use Query present ARef voltage. Notes Same count/V relationship as VTargetRead ** POscRead Command 0x41 0x86 0x20 Response 0x14 0x01 0x10 Use Query present P parameter. Notes ** NOscRead Command 0x41 0x87 0x20 Response 0x14 0x00 0x10 Use Query present N parameter. Notes ** SDOscRead Command 0x41 0x89 0x20 Response 0x14 0x01 0x10 Use Query present SD parameter. Notes ** DeviceParam Command 0x42 (20 device specific bytes) 0x20 Response 0x14 0x10 Use Tell programmer how to program device, i.e data polling byte returns. Notes See table for more details ** MagicNumber Command 0x45 0x03 0x00 0xD7 0xA0 0x20 Response 0x14 0x10 Use Ask Atmel. Sent before entering programming mode. Notes This may well be a code checksum, software version requested first. STK500 PROGRAMMING COMMANDS --------------------------- ** EnterPgmMode Command 0x50 0x20 Response 0x14 0x10 Use Enter programming mode, nRESET = low. Notes ** LeavePgmMode Command 0x51 0x20 Response 0x14 0x10 Use Leave programming mode, nRESET = high. Notes ** EraseDevice Command 0x52 0x20 Response 0x14 0x10 Use Erase device. Notes ** SetAddress Command 0x55 AddrL AddrH 0x20 Response 0x14 0x10 Use Set address for read/write operation Notes Word address FLASH, Byte address EEPROM ** UniversalCmd Command 0x56 0xAC 0xFD 0x00 0xFF 0x20 Response 0x14 0x00 0x10 Use Sending lock and fuse bits. Notes Could probably be used for byte by byte programming of devices. The 0x00 returned is read from byte 4 SPI return value, i.e. if read program memory SPI command sent then this is the byte returned. ** WriteMemory Command 0x64 LenH LenL 0x46 DataBytes 0x20 Response 0x14 0x10 Use Programming FLASH/EEPROM/PageBuffer Notes Change 0x46 ("F") to 0x45 ("E") for EEPROM. Length in bytes. Written in 0x0100 chunks for 8515 ** ReadMemory Command 0x74 LenH LenL 0x46 0x20 Response 0x14 DataBytes 0x10 Use Reading FLASH/EEPROM Notes Change 0x46 ("F") to 0x45 ("E") for EEPROM. Length in bytes. Read in 0x0100 chunks for 8515. ** GetSignature Command 0x75 0x20 Response 0x14 0x1E 0x93 0x01 0x10 Use Requesting device signature bytes Notes Response shown for 8515 ** ReadOscCal Command 0x76 0x20 Response 0x14 0x42 0x10 Use Read current oscillator calibration value Notes Varies between devices, 0x42 in an ATmega163L-4PI 0035 COMMAND SEQUENCES ----------------- Startup: ?STK500 , BoardID , HWver , SWmajor , SWminor ReadSignature: ?STK500 , DeviceParam , SWminor , SWmajor, MagicNumber , EnterPgmMode , GetSignature , LeavePgmMode WriteLockBits: ?STK500 , DeviceParam , SWminor , SWmajor , MagicNumber , EnterPgmMode , UniversalCmd , LeavePgmMode WriteMemory: ?STK500 , DeviceParam , SWminor , SWmajor , MagicNumber , EnterPgmMode , EraseDevice , SetAddress 0x0000 , PgmBlockMode n bytes , SetAddress 0x0000 , ReadBlockMode n bytes , LeavePgmMode ReadMemory: ?STK500 , DeviceParam , SWminor , SWmajor , MagicNumber , EnterPgmMode , SetAddress 0x0000 , ReadBlockMode n bytes , LeavePgmMode Normally memory is programmed or read in 0x0100 byte chunks, obviously if a program doesn't align to an 0x0100 length then there will be a < 0x0100 chunk at the end. Writing mega163. Set address to 0x0000, write 0x0100 bytes, set address to 0x0080, write 0x0100 bytes etc... STK500 must auto detect end of page boundry and write current page to address specified in last setaddress cmd. Set device paramters and programming mode command for STK500 8515 42 60 00 00 01 01 00 01 01 7f 7f 80 7f 00 00 02 00 00 00 20 00 20 4414 42 50 00 00 01 01 00 01 01 7f 7f 80 7f 00 00 01 00 00 00 10 00 20 2313 42 40 00 00 01 01 00 01 01 7f 7f 80 7f 00 00 00 80 00 00 08 00 20 1200 42 33 00 00 01 01 00 01 01 ff ff 00 ff 00 00 00 40 00 00 04 00 20 2323 42 41 00 00 00 01 00 01 01 ff ff 00 ff 00 00 00 80 00 00 08 00 20 2343 42 43 00 00 00 01 00 01 01 ff ff 00 ff 00 00 00 80 00 00 08 00 20 2233 42 42 00 00 01 01 00 01 01 ff ff 00 ff 00 00 00 80 00 00 08 00 20 4433 42 51 00 00 01 01 00 01 01 ff ff 00 ff 00 00 01 00 00 00 10 00 20 4434 42 52 00 00 01 01 00 01 01 ff ff 00 ff 00 00 01 00 00 00 10 00 20 8535 42 61 00 00 01 01 00 01 01 ff ff 00 ff 00 00 02 00 00 00 20 00 20 tiny11 42 11 00 00 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 04 00 20 tiny12 42 12 00 00 00 01 01 01 01 ff ff ff ff 00 00 00 40 00 00 04 00 20 tiny15 42 13 00 00 00 01 01 01 01 ff ff ff ff 00 00 00 40 00 00 04 00 20 tiny22 42 20 00 00 00 01 00 01 01 ff ff 00 ff 00 00 00 80 00 00 08 00 20 tiny28 42 22 00 00 01 00 01 01 01 00 00 00 00 00 00 00 00 00 00 08 00 20 mega32 42 90 00 00 01 01 01 01 02 ff ff ff ff 00 80 04 00 00 00 80 00 20 mega161 42 80 00 00 01 01 01 01 01 ff ff ff ff 00 80 02 00 00 00 40 00 20 mega163 42 81 00 00 01 01 01 01 02 ff ff ff ff 00 80 02 00 00 00 40 00 20 mega103 42 b1 00 00 01 00 00 01 01 00 00 00 00 01 00 10 00 00 02 00 00 20 mega128 42 b2 00 00 01 01 01 01 03 ff ff ff ff 01 00 10 00 00 02 00 00 20 uisp-20050207/doc/README.xilinx0000644000175100017510000000032107530345226012617 00000000000000I've made a quick hack to support Xilinx HW-JTAG-PC cable. Connection is as follows: TCK --> SCK TDO --> MISO TDI --> MOSI TMS --> RESET# -- Tetsuya Okada Computer Creators, Inc. uisp-20050207/doc/README.rs2320000644000175100017510000000142710050201634012150 00000000000000This info was obtained from: http://www.aggsoft.com/rs232-pinout-cable/pinout-and-signal.htm Serial (RS232) port interface pinout and signals DB-9 DB-25 Signal Direction Desc 1 8 DCD <<-- Data Carrier Detect (Modem connected to another) 2 3 RxD <<-- Receives bytes into PC 3 2 TxD -->> Transmits bytes out of PC 4 20 DTR -->> Data Terminal Ready (I'm ready to communicate) 5 7 GND n/a Signal Ground 6 6 DSR <<-- Data Set Ready (I'm ready to communicate) 7 4 RTS -->> Request to Send (flow control) 8 5 CTS <<-- Clear to Send (flow control) 9 22 RI <<-- Ring Indicator (telephone line is ringing) Note: DCD is sometimes labeled CD uisp-20050207/doc/uisp-parport-connect.txt0000644000175100017510000000134707664751135015303 00000000000000 Connect AVR with parallel port AVR Parallel Port Signal name Pin Pin Signal name GND 20 ------------ 19 GND GND 20 ------------ 21 GND SCK 8 ------------ 1 Strobe MOSI 6 ------------ 2 Data 0 MISO 7 ------------ 11 Busy Reset 9 ------------ 16 Init This scheme works with all parallel port modes (EPP,ECP, classic). Copyright (C) 1998 by Alexey Lapshin and Sergey Larin. This scheme can be modifyed as described in send_byte.s Note: The ATmega128 (maybe other megas too) uses PDI and PDO for spi programming instead of MISO and MOSI. You will need to modify the connections accordingly. uisp-20050207/kernel/0000777000175100017510000000000010201771605011221 500000000000000uisp-20050207/kernel/patch-2.2.17-ppdev1.gz0000644000175100017510000003310407473750422014534 000000000000009patch-2.2.17-ppdev1[mw9ƻ308vbq6\ӧVn/ٻoUI7⹻{p}|xiJRh4^| <ˍm~ -6֜7r{lhE;Svjvo&5Zoۇ-}J57 }ȃF4-Ζf`.w"<Ĭ: pyP*U{5>==iX/f0g"`f` k fҦZ6 =}Oh4(.a{JT;;#<tmrzZx<7>?x&E(ݢHt<)V2tYda3Wr ֞~3]xYV+%uI7[ 0q[)V$Ty|^Î]4q_>knCA֓z5n+ۄ<*:yABs=yf PH=ٻnig]n<4yfpFM;s4_wo5P#+*px2ECkF(E-mQ 7%s9= s s 7q.0b3(՚Aݔ1.q? '@y;|[%yi?+D,З3tӒyFлʅ4N<e|ˊ8`8dMKٰQdXQqX Wצ&d9 `Wѵq\K`pt0q:.wXp2~P@Ԏk4]A7%t$1JaQBHF2 H@%\eBLC$Hy>=v" Yʗ #6$2"謌4?'YX,x}4PXw x%$^}sw@E"< ȑc:=c6uk*d=BDa$ ܋!u .K#O]w@=Nûbnmqs ;))0s?*kLH[֊,:QH%E^^srcr77l^bv!ajwle=xs6̇hI$\OB%h3zcynE 81K# rbl0cIDx4Owp$qA(qA~8VI*PI99nw[Go_cH`y}{pvξpWVc5;Z}0rc /~2m.U{X9Ѣmdz}Sdp54*S?`D+b "Iy|Ѵ1g?cdG}}w~Jpտ\]`<%eQ/P)I/@Pfn_I=О Cwnu9{d |3d^-3YC {]wzoBG*?euq BX:9JSZQrypb<C}6B̭\' Gû>p ^}ol0ikeNp|zEe+_%ꛍa\@pb01,躮=Y].]aQ# HjƳpbkMe]-ԳW2Kø% `ȘΓx'#?5\dA!e !uy':x3a</anj(~[o`˜X.*0^PT=nA\ sȥOQH+­) YSi2%-կ ?0fo=*z]:K`jՅpn|?%z ^nr$YCbw~$ud:X@@ Oa{&;kh%֝ |ahz$YPZK}TeU$m^2yNA T,AU"u r)5SbIϕۢzYT~6 (2RHCid&98SK@cf r d9xU음=ƐכB 8(gQfEeHKB.bBX+ikY+4WT.ܝw]?q&['Xٓ F4tΝ`'%:[bCwSaID,v/U>jլw s?JRG!``R,mBf|9W"jwl6#nHBࡕ;Ŭ kT!>/%~0 C ozT6Z*  <ag eWD`@GSa,J$bhW`PhԿԅVP+[td :]B)W0u W*[kWW1go2mݱ?}^84G,6S\Si^T;]1M5AZ1bO8;>[ p|? UõY^ eφ:T6|ϐu|aA2RҬI6|c?Jg .lK" P|e\Bu~UFjre# 6f&bG7E%jnVIPKDDtH NVb)„ #>:2 X, vW͜0ZS­FAa2ěTh dz@rHB q/acN1kO3p2@U,t3j)ݫ FW^BH0s=ag)Kwd2L>==JQIOդ._lK먣2 $az|$,TKБcBLh)_I;`i_" a80)֒pv |KJ+ \}E3W[Ȗ խZe(@!|hE;Qܥ[.{0O'XxlF)wU"(O}e v 8 Kyk|zr" JII_`B{43xWW9 p۔k$mtkCZi lJ'J J+JfĀ娠%UQJTgxo1L_~?1s,"h*2TTyDcwN{@A32 u^iL+s\tz2W.?jɫ;ѼM/V^ԞxDVE !WUzb5?0Vf忈̜F}*<`);vt1}(N UH1FQ<ғW96~`ZWCcءj)zC3RG9G&.Pma _;- Kr\4̏ եt8nbUF2`A0o&He4fbG]%nPi}7ƑegLrv͚'<<ꀬ֣4m2Ǣ}u{1yԬO,SQfUY[lw6}B͞52ݤOe r#=3= Zoݭn$9p8`Kݵ{.Ͻ> DAv;^l{ e G#F~nWvZ4?c\1feH` gJc& !mF`w%iS@E{\@y`|䒶v1oa {tXN8Q kn8}NmvQldYj5nZgd- jH,c{Y|NNXCƌ+D,p aXH1ˊM2礪ұ`?*o'3tNj}ţ)]x]:^A5>\PZ1hBՄ~ڕ2:p ;ιH瀥XDt2O1ͮ ѺŵFJ.3N=>:AH'rv3~.ٱ1 YN(I5؅RF5a!" \*1B5.e)&w;ؖ\-g V98.8qJ&A?>ZV*TnU>}uMX%xҌOK UHPeh]DRhAu8&! ekGҍDB %Rb'NYF(!<.j->[I1 PPGiJ<j15Wpeã?MQ3^^ţje"LEx19ڤ!FWPqhRJ,]^qrƅRZP>y#B0_h"=]-7t$\q}x)⃶ȅ* Q8suMA:ea%%TweOE}Ñ{LVmHw{te?BހڭNt9| eMOdtKfdGN?/1r&?MǗPpJ{k16"yߜSSf;>S=B)́Y 6} 99oSl+?ڋ6[47F^*{K+"K>=yJ5`؝PFa,IK 0մ?w>MkEzI0τ'pxn&9,fN&)B}%V\v!&=jS(F A߸?MI}~' , [WSJv$9|xk`Hd3ۋ.h &2g4˞1!HhIkmxe Ϟ%6n&^]M>Uf+\%ڄa=._f8nMT1p54!\9ڛg3߀(M*"^2滑̟b};yʴ&/sO|~8A#q3)ԂS+(Ŧer>ba<^szi-^bT K)|9⸪x&(b~$IK͒t,񭷾^$Ab9&_Q=%y S T@[B:c¥tPR#&eȗy/W0A!J434;\^)CNW+ꩀ!MG"`TR-;?o +L\X!%?eQ&+_~a;]]D]mWDSƒjO[VnmQop!=uV~|E/K4J`Ci j( QKEAvcWa(䍀v|Г{i #()U(n5^P 9! %zBV[i~_K -g^/[K7ͼk$t mŤSUj9y 7uՉYd#-Wx!Zw\;i׼fp*EP7S,l(?"k!bͧX.R%$},qDd(x4P,}Dz#>BFG Ys*4BDaӔJ ÎpcYTTNc4؎e_FYs]p|GG!/},vC$áѭP=Qq+΀p&N>.(vCkK^Ag焻%oPM'  ں ->%SW{K!D5 3Ab^6`)߯iƉꐀIY[:p)ʛMRBݸ1+="$).DuB#!3CaZ1ՒWmlX...i(R)c,AN~ d9ܛ!oMaw(ˣu`. 1tJsٔ>lʤ%*z1lGM]*Wd({uWVNV4(Vpe+ѶA 1Rbtzb*YFi@D$pOIkC_^0 « $dz! [f]ϩ $_tUO#a/RɌA,_馐$|7^O1餐 5{#Se,-@5e Y\ x b#yHqp N㍂!lHӱw/;8U(nG">o뤢?oΏ2zM?;:*)akKB,n xswE]M?J^DGB1`W%(|B9~rsl݀MJ~h4Y?)p3 8Ԕ-PԶ̯=,$ 0JS ",oɓ QOY^=P*/$5E+*y/WnG`I*Ub\ZFA)qߨl[IsjߗxEF E!Pdd:> t$S6Jo [>ޫKǗ3H #ʓ8ؙY{,5c]@.oӓtJlDnݣmY_ x{J}y[^qH(qZ8zeO5ϻ/w\+ݬfX<x)O`_|HV]B T: Uu@#:Wr'+ݮ NDHulSn"Vz tu6B5N՜"|C\\/ 0*Ef/;y:},vknvV}a[='.U^F*xE+1= S> j#MV8a {pxԠƳiG[ƳΩ>꟎_ zU-ǖ<4y@^ q\{e ѵnE\l+7c%^Z-x0q՛TqԹan PQSucSIhkJ%m*&3.ZәZ3:̩T+w˜@8ןjZXdc9Y(ޞ'-T[P\Q((=!*&(m%h'F7:1^9<|]'ϔd-rK@ijw,6`;3DfJd*ށ$ cpg+xی> i5a_ۺU ͷNR(/,£0#Nm#۫P seǚ6ow]P)udU͒{$h|sO(u+ kWT} [P^A]p+C jv;Bvqyitt:!*Q ƴA"T /döt P} B-Vg nfd"w%й PXF+P k 럓|^k?f G}`%#֢md$q m^gx\~^ w1f'uP +b{~l7ITg+Y ँ`5!q_Ɇєဨloҁ$x5:&qמŎS|KQkvG7SHM[[i`6QM.y.x C)i!l)z#fܥ3uD*Y@&o7)(n{nwZ\+{_[9>Tr.Â~qbOo4|]3 (t;zt.z?[(Pt#gm 9TS.DtWWDocmh_mي7gy*O;@C=%|OsMSo1ŌY(%&˃ I_ 㒡AVl`~[c#˗Dd?'px{J8j8Gx_ J&\U] ,)t|O@ >[)]Y*1aEXtq )eK^,,'Z07l)ޱ 6F)FCMj,w3e`Fqè_uJh'47e6s$GxGhR.ʺINnL 1zۣPk?^Flw/ 7M;v&6:+g] Q#egn~{`vɃZMg&yu ~$4wqJ`17\ Usv6PH_i:bYu>kF\p=IuUUWsHW8ԅ΋_ӷ'z{&`"6U'm-46XtNg˫Qgq2Ǽ"0PrFK_Ac,]]بoߝbE Ĭ?%i=G+f=Aᙼպ.~Fet]Xm aAHT O&R }5WRWsn6-\u9Md7\<* |,A=588BPmut5N}PYn_Yј@3Pt˟0<eEݮ6LnC8/Sr6;䂎)ď3.>D[CA$ּJ>cvJ6 Q)n0 K-Sn@- Bo.n}ּF:\N߰ g(vxK }G~ԁy@zsf#8`LdYRc}8n>A }?y`>3PO#ZGY_2U}u4D[dT?ku-#5np$hC)(<< .JQ<_H+)":ŷ;=9AW̱6#jF&poްD'Y+UKW6֠ P~zV1Reu8ttei_) m .{\CP˫ZqXI~Id~h~rΓ%` 5d+)rxv?SDz2QTD%:B) ,YÃWGGxJZ d.u:db5@5@6R;A+p+-:q8[ 5G5*OIB#8bYRwjI?QKp9I^54:=mnM@ׂ%"[TEƟ&A:q'_ɋ$8OqKuisp-20050207/pavr/0000777000175100017510000000000010201771605010711 500000000000000uisp-20050207/pavr/Makefile0000644000175100017510000000165610002555317012274 00000000000000MCU = -mmcu=at90s2313 CC = avr-gcc CFLAGS = $(MCU) -Wall -W -Wstrict-prototypes # --save-temps -v #CFLAGS += -O3 #CFLAGS += -O2 CFLAGS += -Os CFLAGS += -mtiny-stack -mcall-prologues #CFLAGS += -mno-tablejump CFLAGS += -mrtl CFLAGS += -g LD = avr-gcc LDFLAGS = $(MCU) -Wl,-M PRG = uisp -dprog=stk200 -dlpt=/dev/parport0 -v=3 OBJS = pavr.o OUT = pavr.elf SREC = pavr.srec IHEX = pavr.hex MAP = pavr.map LST = pavr.lst all: $(IHEX) $(LST) $(SREC): $(OUT) avr-objcopy --output-target=srec $(OUT) $(SREC) $(IHEX): $(OUT) avr-objcopy --output-target=ihex $(OUT) $(IHEX) $(LST): $(OUT) avr-objdump -S -h -D $(OUT) > $(LST) flash-dump: $(PRG) --download of=rom.dump flash-erase: $(PRG) --erase flash-write: $(SREC) $(PRG) --upload --verify if=$(SREC) flash: $(SREC) $(PRG) --erase --upload --verify if=$(SREC) $(OUT): $(OBJS) $(LD) $(OBJS) -o $(OUT) $(LDFLAGS) > $(MAP) clean: rm -f $(OBJS) $(OUT) $(SREC) $(IHEX) $(MAP) $(LST) uisp-20050207/pavr/pavr.c0000644000175100017510000003465010002556512011746 00000000000000/* * $Id: pavr.c,v 1.6 2004/01/18 19:23:54 troth Exp $ * **************************************************************************** * * pAVR Project - Atmel AVR serial programmer * Copyright (C) 2000,2003 Jason Kyle * * 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 * **************************************************************************** */ /* pavr V0.2 Target = Atmel AVR AT90S2313 20030714 Added support for ATmega8,16,32,128,161 Fixed universal commands so they actually work Changed MOSI and MISO around, error in AVR910 app note. Fixed AT89S53 device probably needs some work. >8kB flash is in same location as EEPROM in 89S8252 so will need special handling?? Notes: Device ID's AVR Prog V1.31 knows about 0x10 AT90S1200 Rev A 0x11 AT90S1200 Rev B 0x12 AT90S1200 Rev C 0x13 AT90S1200 Rev D (current) 0x20 AT90S2313 0x28 AT90S4414 (End Of Line) 0x30 AT90S4433 0x34 AT90S2333 (End Of Line) 0x38 AT90S8515 0x41 ATmega103 0x42 ATmega603 (End Of Line) 0x48 AT90S2323 0x4c AT90S2343 0x50 ATtiny11 0x51 ATtiny10 (vapourware) 0x55 ATtiny12 0x56 ATtiny15 0x58 ATtiny19 (vapourware. NB ATtiny22 missing) 0x5c ATtiny28 (?) 0x60 ATmega161 (vapourware?) 0x64 ATmega163 0x65 ATmega83 (vapourware?) 0x68 AT90S8535 0x70 AT90C8534 (parallel pgm only) 0x72 ATmega323 (vapourware?) 0x80 AT89C1051 (parallel pgm only) 0x81 AT89C2051 (parallel pgm only) 0x86 AT89S8252 0x87 AT89S53 AT89Sxxxx Subset: 0x86 AT89S8252 0x87 AT89S53 AT90S(non-EOL), ATmega(non-vapourware) Subset: 0x13 AT90S1200 0x20 AT90S2313 0x48 AT90S2323 0x4c AT90S2343 0x30 AT90S4433 0x38 AT90S8515 0x68 AT90S8535 0x41 ATmega103 0x64 ATmega163 */ /* Hacked a little by Marek Michalkiewicz 20010909: - ATmega163 support - device features as bits in dev_flags (page write, AT89S*) - fix a few gcc warnings - make a few global variables local, smaller code (SRAM -> registers) - add erased EEPROM detection */ #include #include #include #include #include #define F_CPU 4000000 //#define F_CPU 3686400 #define UART_BAUD_RATE 19200 #define ATmega103 0x41 #define ATmega128 0x43 #define ATmega161 0x60 #define ATmega163 0x64 #define ATmega8 0x76 #define ATmega16 0x74 #define ATmega32 0x72 #define AT89S8252 0x86 #define AT89S53 0x87 #define SCK PB7 //Connects to SCK (slave) on target #define MISO PB6 //Connects to MISO (slave) on target #define MOSI PB5 //Connects to MOSI (slave) on target #define RESET PB4 //Connects to !RESET on target #define LED PD6 //LED Indicator on target #define SCK1 PD3 //SCK to AT45D081 SCK pin #define MISO1 PD5 //MISO to AT45D081 SO pin #define MOSI1 PD4 //MOSI to AT45D081 SI pin #define CSn PD2 //CSn to AT45D081 CSn pin const char __attribute__((progmem)) sw_version[]="20\0"; const char __attribute__((progmem)) hw_version[]="10\0"; #define ResetDelay 21 //Period = 21ms Active + 21ms Inactive #define ErasePeriod 102 //Longest time to wait for Chip Erase (mega103L@3.2V) #define FuseLockPeriod 56 //No real info on this one, used page pgm from mega103L@3.2V - longest const char __attribute__((progmem)) flashPeriod[] = {4, //AT90Sxxxx @ 5.0V 5, //ATmega8,16,32,128 @ any voltage 9, //AT90Sxxxx @ 3.2V 16, //ATmega163,161 @ any voltage 22, //ATmega103 @ 5.0V 56}; //ATmega103 @ 3.2V const char __attribute__((progmem)) eepromPeriod[] = {4, //AT90Sxxxx @ 5.0V 9, //ATmega8,16,32,128 @ any voltage 9, //AT90Sxxxx @ 3.2V 4, //ATmega163,161 @ any voltage 4, //ATmega103 @ 5.0V 9}; //ATmega103 @ 3.2V const char __attribute__((progmem)) sckPeriod[] = {1, //1us (XTAL > 4MHz) Actually about 4us (1MHz) 4, //4us (XTAL > 0.5MHz) 63}; //63us (XTAL > 32kHz) const char __attribute__((progmem)) devID[] = {0x13, //AT90S1200 0x20, //AT90S2313 0x48, //AT90S2323 0x4c, //AT90S2343 0x30, //AT90S4433 0x38, //AT90S8515 0x68, //AT90S8535 0x76, //ATmega8 0x74, //ATmega16 0x72, //ATmega32 0x41, //ATmega103 0x43, //ATmega128 0x60, //ATmega161 0x64, //ATmega163 0x86, //AT89S8252 0x87, //AT89S53 0x00}; //NULL terminated (treated as string) void send_prog_str(const char *buf); void putc(uint8_t); uint8_t getc(void); void put_nibble(uint8_t); void put_hex(uint8_t); void spi_clk(void); void spi_wr(uint8_t); uint8_t spi_rd(void); void delay_100us(uint8_t); void delay_1ms(uint8_t); void terminal_mode(void) __attribute__((noreturn)); uint8_t get_number(void); uint8_t get_digit(uint8_t); void put_number(uint8_t); union addr_u { uint16_t word; uint8_t byte[2]; }; uint8_t fPeriod,ePeriod,cPeriod; #define DEV_PAGE 0x01 #define DEV_AT89 0x02 int main(void) { uint8_t ch,i; uint8_t device = 0, dev_flags = 0; union addr_u addr; addr.word = 0x0000; outp(BV(CSn)|BV(LED),PORTD); //CSn and LED set high outp(BV(SCK1)|BV(MISO1)|BV(MOSI1)|BV(CSn)|BV(LED),DDRD); //Driven outputs outp((F_CPU/(UART_BAUD_RATE*16L)-1), UBRR); outp(BV(TXEN)|BV(RXEN),UCR); outp(BV(CS01),TCCR0); //TC0 source CK/8 wdt_enable(4); wdt_reset(); putc('\0'); /* Load timing parameters from EEPROM, set to defaults if out of range */ i = eeprom_rb(0x0001); if (i >= sizeof(flashPeriod)) i = 1; fPeriod = PRG_RDB(flashPeriod + i); ePeriod = PRG_RDB(eepromPeriod + i); i = eeprom_rb(0x0002); if (i >= sizeof(sckPeriod)) i = 0; cPeriod = PRG_RDB(sckPeriod + i); for (;;) { ch = getc(); switch(ch) { case 'T': //Set device type device=getc(); dev_flags = 0; if (device == ATmega103 || device == ATmega128 || device == ATmega161 || device == ATmega163 || device == ATmega8 || device == ATmega16 || device == ATmega32) dev_flags |= DEV_PAGE; if (device == AT89S8252 || device == AT89S53) dev_flags |= DEV_AT89; putc(0x0d); break; case 'S': send_prog_str(PSTR("AVR ISP")); break; case 'V': send_prog_str(sw_version); break; case 'v': send_prog_str(hw_version); break; case 't': send_prog_str(devID); //Return supported devices putc(0x00); //NULL terminate supported devices array break; case 'p': putc('S'); //Return programmer type (serial) break; case 'x': getc(); cbi(PORTD,LED); putc(0x0d); //Set LED break; case 'y': getc(); sbi(PORTD,LED); putc(0x0d); //Clear LED break; case 'P': //Enter programming mode if (dev_flags & DEV_AT89) outp(BV(MISO),PORTB); else outp(BV(MISO)|BV(RESET),PORTB); outp(BV(SCK)|BV(MOSI)|BV(RESET),DDRB); delay_1ms(ResetDelay); if (dev_flags & DEV_AT89) sbi(PORTB,RESET); else cbi(PORTB,RESET); delay_1ms(ResetDelay); //Wait 21ms (datasheet says at least 20ms) if (dev_flags & DEV_AT89) { spi_wr(0xac); spi_wr(0x53); spi_wr(0x00); } else { //AT90S device, try and sync up SPI comms if necessary i=0; do { spi_wr(0xac); spi_wr(0x53); if (spi_rd() == 0x53) i=100; //Force exit, after sending last byte else spi_clk(); spi_wr(0x00); i++; } while (i < 32); } putc(0x0d); break; case 'C': //Write program memory (high byte) i=getc(); if (dev_flags & DEV_AT89) putc('?'); else { spi_wr(0x48); spi_wr(addr.byte[1]); spi_wr(addr.byte[0]); spi_wr(i); if(!(dev_flags & DEV_PAGE)) delay_1ms(fPeriod); putc(0x0d); } addr.word++; break; case 'c': //Write program memory (low byte) i=getc(); if (dev_flags & DEV_AT89) { spi_wr((addr.byte[1]<<3) | 0x02); } else { spi_wr(0x40); spi_wr(addr.byte[1]); } spi_wr(addr.byte[0]); spi_wr(i); if(!(dev_flags & DEV_PAGE)) delay_1ms(fPeriod); putc(0x0d); break; case 'm': //Write page, verify this actually works spi_wr(0x4c); spi_wr(addr.byte[1]); spi_wr(addr.byte[0]); spi_wr(0x00); delay_1ms(fPeriod); // if (device == ATmega163 || device == ATmega32) delay_1ms(16); // else delay_1ms(56); // ATmega103 @ 3.2V putc(0x0d); break; case 'R': //Read program memory if (dev_flags & DEV_AT89) { spi_wr((addr.byte[1]<<3) | 0x01); } else { spi_wr(0x28); spi_wr(addr.byte[1]); } spi_wr(addr.byte[0]); putc(spi_rd()); if (!(dev_flags & DEV_AT89)) { spi_wr(0x20); spi_wr(addr.byte[1]); spi_wr(addr.byte[0]); putc(spi_rd()); } addr.word++; break; case 'A': //Load address addr.byte[1]=getc(); addr.byte[0]=getc(); putc(0x0d); break; case 'D': //Write data memory i=getc(); if (device == AT89S8252) { spi_wr((addr.byte[1]<<3) | 0x06); } else { spi_wr(0xc0); spi_wr(addr.byte[1]); } spi_wr(addr.byte[0]); spi_wr(i); delay_1ms(ePeriod); putc(0x0d); addr.word++; break; case 'd': //Read data memory if (device == AT89S8252) { spi_wr((addr.byte[1]<<3) | 0x05); } else { spi_wr(0xa0); spi_wr(addr.byte[1]); } spi_wr(addr.byte[0]); putc(spi_rd()); addr.word++; break; case 'L': //Leave programming mode outp(0x00,DDRB); //Pins not driven outp(0x00,PORTB); //No pull ups either, Hi-Z putc(0x0d); break; case 'e': //Erase device spi_wr(0xac); if (!(dev_flags & DEV_AT89)) spi_wr(0x80); spi_wr(0x04); spi_wr(0x00); delay_1ms(ErasePeriod); //Wait for Chip Erase putc(0x0d); break; case 'l': //Write lock bits i=getc(); spi_wr(0xac); if (dev_flags & DEV_AT89) { spi_wr((i & 0xe0) | 0x07); //Check if this is right spi_wr(0x00); } else { spi_wr((i & 0x06) | 0xe0); //Check spi_wr(0xff); spi_wr((i >> 1) | 0xfc); // for ATmega163 etc. (no BLBxx yet) } delay_1ms(FuseLockPeriod); //Wait for Lock bits to program putc(0x0d); break; case 'f': //Write fuse bits, parallel programmer only ? putc(0x0d); break; case 'F': //Read fuse and lock bits, parallel programmer only ? putc(0x00); break; case 's': //Read device signature bytes i=3; do { i--; spi_wr(0x30); spi_wr(0x00); spi_wr(i); putc(spi_rd()); } while (i); break; case ':': //Intended for writing fuse bits on m103,8535,4433,2333 etc spi_wr(getc()); spi_wr(getc()); spi_wr(getc()); putc(spi_rd()); delay_1ms(FuseLockPeriod); //Wait for Lock / Fuse bits to program putc(0x0d); break; case '.': //At last, good idea Atmel. Universal instruction i=getc(); spi_wr(i); spi_wr(getc()); spi_wr(getc()); if (i>0x7f) { //Write command spi_wr(getc()); delay_1ms(FuseLockPeriod); //Wait for Lock / Fuse bits to program putc(0x00); } else { getc(); putc(spi_rd()); } putc(0x0d); break; case 0x1b: //ESC received, do nothing break; case '!': if (getc()=='!') terminal_mode(); break; default: for(i=0;i<=strlen_P(devID);i++) { if (ch == PRG_RDB(devID + i)) break; //Character matches a device ID byte } if (i == strlen_P(devID)+1) putc('?'); //Only send if ch wasn't a device ID byte } } } void putc(uint8_t ch) { while (!(inp(USR) & BV(UDRE))) wdt_reset(); outp(ch,UDR); } uint8_t getc(void) { while(!(inp(USR) & BV(RXC))) wdt_reset(); return (inp(UDR)); } void send_prog_str(const char *flash) { char ch; while ((ch = pgm_read_byte((uint16_t) flash)) != 0) { putc(ch); flash++; } } void spi_clk(void) { sbi(PORTB,SCK); if(cPeriod>2){ // outp(0x00,TCCR0); //Stop timer outp(256 - cPeriod/(16000000/F_CPU),TCNT0); outp(BV(TOV0),TIFR); // outp(BV(CS01),TCCR0); while(!(inp(TIFR) & BV(TOV0))); } cbi(PORTB,SCK); if(cPeriod>2){ // outp(0x00,TCCR0); outp(256 - cPeriod/(16000000/F_CPU),TCNT0); outp(BV(TOV0),TIFR); // outp(BV(CS01),TCCR0); while(!(inp(TIFR) & BV(TOV0))); } } void spi_wr(uint8_t send) { uint8_t i; i=0x80; do{ if (send & i) sbi(PORTB,MOSI); else cbi(PORTB,MOSI); spi_clk(); i=i>>1; } while(i); } uint8_t spi_rd(void) { uint8_t i,rx; i=0x80; rx=0; do{ if (bit_is_set(PINB,MISO)) rx=rx+i; spi_clk(); i=i>>1; } while(i); return rx; } /* For test only void put_nibble(uint8_t ch) { ch = ch & 0x0f; if (ch > 9) ch += 'A' - 10; else ch += '0'; putc(ch); } void put_hex(uint8_t ch) { put_nibble(ch >> 4); put_nibble(ch); } */ void delay_100us(uint8_t count) { while(count) { outp(256 - ((F_CPU/80000)-1),TCNT0); outp(BV(TOV0),TIFR); while(!(inp(TIFR) & BV(TOV0))); wdt_reset(); count--; } } void delay_1ms(uint8_t count) { while(count) { delay_100us(10); count--; } } void terminal_mode(void){ uint8_t ch; do { loop_until_bit_is_clear(EECR,EEWE); send_prog_str(PSTR("\r\npAVR Setup\r\n#")); ch = getc(); putc(ch); //Echo if(ch=='F'){ //Set Flash and EEPROM period eeprom_wb(0x0001,getc()-0x30); //NB No error checking!! send_prog_str(PSTR(" OK")); } else if(ch=='C'){ //Set SCK period eeprom_wb(0x0002,getc()-0x30); send_prog_str(PSTR(" OK")); } else if(ch=='f') putc(fPeriod+0x30); else if(ch=='e') putc(ePeriod+0x30); else if(ch=='c') putc(cPeriod+0x30); } while(ch!='Q'); while(1); //Force wdt to reset device } uisp-20050207/Makefile.in0000644000175100017510000004752610201761023011731 00000000000000# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # $Id: Makefile.am,v 1.9 2004/05/11 16:47:19 troth Exp $ # # uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. # Copyright (C) 2002, 2003, 2004 Theodore A. Roth # # 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 # # Makefile.am -- Process this file with automake to produce Makefile.in # 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 = : ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ 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@ POW_LIB = @POW_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUX_DIST = install-sh missing mkinstalldirs depcomp man_MANS = uisp.1 AUX_DIST_EXTRA = EXTRA_DIST = bootstrap \ CHANGES CHANGES.old \ kernel/patch-2.2.17-ppdev1.gz \ pavr/Makefile pavr/pavr.c \ doc/HOWTO.windows doc/README.stk500 \ doc/README.xilinx \ doc/README.rs232 \ doc/uisp-parport-connect.txt \ uisp.1.in \ ChangeLog-2002 \ ChangeLog-2003 SUBDIRS = src DIST_SUBDIRS = src MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure src/config-h.in \ src/stamp-h.in $(AUX_DIST) install_aux_files = AUTHORS COPYING INSTALL CHANGES CHANGES.old TODO \ ChangeLog ChangeLog-2003 ChangeLog-2002 DOC_INST_DIR = $(DESTDIR)$(datadir)/doc/uisp-$(VERSION) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = uisp.1 uisp.spec DIST_SOURCES = NROFF = nroff MANS = $(man_MANS) RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ ps-recursive install-info-recursive uninstall-info-recursive \ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL Makefile.am NEWS TODO aclocal.m4 configure \ configure.ac depcomp install-sh missing mkinstalldirs uisp.1.in \ uisp.spec.in all: all-recursive .SUFFIXES: am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): configure.ac cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) uisp.1: $(top_builddir)/config.status uisp.1.in cd $(top_builddir) && $(SHELL) ./config.status $@ uisp.spec: $(top_builddir)/config.status uisp.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ uninstall-info-am: man1dir = $(mandir)/man1 install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ 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): @set fnord $$MAKEFLAGS; amf=$$2; \ 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) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ 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: @set fnord $$MAKEFLAGS; amf=$$2; \ 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) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ 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 ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS 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-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; \ else \ include_option=--include; \ 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; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique 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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/. $(distdir)/doc $(distdir)/kernel $(distdir)/pavr @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"; \ $(mkinstalldirs) "$(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 $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | 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 $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - 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 ../.. && $(mkinstalldirs) "$$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-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;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 $(MANS) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(man1dir) 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: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-data-local install-man install-exec-am: install-info: install-info-recursive install-man: install-man1 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 pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-local uninstall-man uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man1 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ clean-generic clean-recursive ctags ctags-recursive dist \ dist-all dist-gzip distcheck distclean distclean-generic \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-local install-data-recursive install-exec \ install-exec-am install-exec-recursive install-info \ install-info-am install-info-recursive install-man install-man1 \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ ps-recursive tags tags-recursive uninstall uninstall-am \ uninstall-info-am uninstall-info-recursive uninstall-local \ uninstall-man uninstall-man1 uninstall-recursive install-data-local: $(mkinstalldirs) $(DOC_INST_DIR) for file in $(install_aux_files) ; do \ echo " $(INSTALL_DATA) $$file $(DOC_INST_DIR)/$$file"; \ $(INSTALL_DATA) $(srcdir)/$$file $(DOC_INST_DIR)/$$file; \ done uninstall-local: rm -rf $(DOC_INST_DIR) dist-hook: uisp.spec cp uisp.spec $(distdir)/uisp.spec # 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: uisp-20050207/configure0000755000175100017510000061712210201761023011566 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for uisp 20050207. # # Report bugs to . # # 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 # 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='uisp' PACKAGE_TARNAME='uisp' PACKAGE_VERSION='20050207' PACKAGE_STRING='uisp 20050207' PACKAGE_BUGREPORT='uisp-dev@nongnu.org' ac_unique_file="src/Main.C" # 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 AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS POW_LIB DATE 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_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_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_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_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 uisp 20050207 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 _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of uisp 20050207:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors Some influential environment variables: CXX C++ compiler command CXXFLAGS 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 CC C compiler command CFLAGS C 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. Report bugs to . _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 uisp configure 20050207 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 uisp $as_me 20050207, 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 ac_config_headers="$ac_config_headers src/config.h:src/config-h.in" am__api_version="1.7" 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 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='uisp' VERSION='20050207' 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"} AMTAR=${AMTAR-"${am_missing_run}tar"} 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. # Checks for programs. 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); } 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_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 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="$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 : > 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 # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' 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 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); } 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 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 : > 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 # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' 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 # Checks for libraries. # Checks for header files. 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 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 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 fcntl.h inttypes.h stdlib.h string.h sys/ioctl.h sys/time.h termios.h unistd.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 uisp-dev@nongnu.org ## ## ---------------------------------- ## _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 # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 if test "${ac_cv_header_stdbool_h+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 #ifndef bool # error bool is not defined #endif #ifndef false # error false is not defined #endif #if false # error false is not 0 #endif #ifndef true # error true is not defined #endif #if true != 1 # error true is not 1 #endif #ifndef __bool_true_false_are_defined # error __bool_true_false_are_defined is not defined #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) -0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) -0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; int main () { return !a + !b + !c + !d + !e + !f + !g + !h + !i; ; 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_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 if test "${ac_cv_type__Bool+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 ((_Bool *) 0) return 0; if (sizeof (_Bool)) 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__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6 if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+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 () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #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_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_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. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) 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_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include 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>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_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi 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 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi # Checks for library functions. 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 /* 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 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 /* 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 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 for ac_header in stdlib.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 uisp-dev@nongnu.org ## ## ---------------------------------- ## _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 echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { exit (malloc (0) ? 0 : 1); ; 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_func_malloc_0_nonnull=yes 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_func_malloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case $LIBOBJS in "malloc.$ac_objext" | \ *" malloc.$ac_objext" | \ "malloc.$ac_objext "* | \ *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no 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 () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = 0x40, c1 = 0x80, c2 = 0x81; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) exit (1); /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) exit (1); } exit (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_func_memcmp_working=yes 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_func_memcmp_working=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 test $ac_cv_func_memcmp_working = no && case $LIBOBJS in "memcmp.$ac_objext" | \ *" memcmp.$ac_objext" | \ "memcmp.$ac_objext "* | \ *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in sys/select.h sys/socket.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 uisp-dev@nongnu.org ## ## ---------------------------------- ## _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 echo "$as_me:$LINENO: checking types of arguments for select" >&5 echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6 if test "${ac_cv_func_select_args+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; 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 #if HAVE_SYS_SELECT_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; 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_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 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 done done # Provide a safe default value. : ${ac_cv_func_select_args='int,int *,struct timeval *'} fi echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 echo "${ECHO_T}$ac_cv_func_select_args" >&6 ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* echo "$as_me:$LINENO: checking for working strtod" >&5 echo $ECHO_N "checking for working strtod... $ECHO_C" >&6 if test "${ac_cv_func_strtod+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_strtod=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ double strtod (); int main() { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) exit (1); } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) exit (1); } 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 ac_cv_func_strtod=yes 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_func_strtod=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5 echo "${ECHO_T}$ac_cv_func_strtod" >&6 if test $ac_cv_func_strtod = no; then case $LIBOBJS in "strtod.$ac_objext" | \ *" strtod.$ac_objext" | \ "strtod.$ac_objext "* | \ *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac echo "$as_me:$LINENO: checking for pow" >&5 echo $ECHO_N "checking for pow... $ECHO_C" >&6 if test "${ac_cv_func_pow+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 pow to an innocuous variant, in case declares pow. For example, HP-UX 11i declares gettimeofday. */ #define pow innocuous_pow /* System header to define __stub macros and hopefully few prototypes, which can conflict with char pow (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef pow /* 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 pow (); /* 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_pow) || defined (__stub___pow) choke me #else char (*f) () = pow; #endif #ifdef __cplusplus } #endif int main () { return f != pow; ; 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_pow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_pow=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5 echo "${ECHO_T}$ac_cv_func_pow" >&6 if test $ac_cv_func_pow = no; then echo "$as_me:$LINENO: checking for pow in -lm" >&5 echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_pow+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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 pow (); int main () { pow (); ; 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_m_pow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_pow=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_m_pow" >&5 echo "${ECHO_T}$ac_cv_lib_m_pow" >&6 if test $ac_cv_lib_m_pow = yes; then POW_LIB=-lm else { echo "$as_me:$LINENO: WARNING: cannot find library containing definition of pow" >&5 echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi fi for ac_func in vprintf 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 echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+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 _doprnt to an innocuous variant, in case declares _doprnt. For example, HP-UX 11i declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _doprnt /* 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 _doprnt (); /* 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__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; 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__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in gettimeofday memset select strcasecmp strncasecmp strstr strtol 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 # Set the DATE variable for the man page DATE=`date "+%B, %Y"` ac_config_files="$ac_config_files Makefile uisp.1 uisp.spec src/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 DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_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 "${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__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 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 : ${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 uisp $as_me 20050207, 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 --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ uisp config.status 20050207 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" ;; "uisp.1" ) CONFIG_FILES="$CONFIG_FILES uisp.1" ;; "uisp.spec" ) CONFIG_FILES="$CONFIG_FILES uisp.spec" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:src/config-h.in" ;; *) { { 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 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,@AMTAR@,$AMTAR,;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,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;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,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;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,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@POW_LIB@,$POW_LIB,;t t s,@DATE@,$DATE,;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 # 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; } 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 $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; }; } # Do quote $f, to prevent DOS paths from being IFS'd. 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 grep "^[ ]*#[ ]*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 # grep' >>$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 diff $ac_file $tmp/config.h >/dev/null 2>&1; 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'` { 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; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(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'`/stamp-h$_am_stamp_count 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 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //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 uisp-20050207/AUTHORS0000644000175100017510000000117110201757735010735 00000000000000 Original Author: Uros Platise Current maintainers: Margarita Manterola Marek Michalkiewicz Contributors: Theodore A. Roth Dean Ferreyra Daniel Berntsson Jason Kyle Uwe Bonnes Bryce Denney Alexander Popov Hamish Moffatt See the ChangeLog file for other minor contributors. If you have made contributions and your name is missing, send an email saying so to . uisp-20050207/COPYING0000644000175100017510000004312707473750422010732 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 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) 19yy 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 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) 19yy 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. uisp-20050207/ChangeLog0000644000175100017510000001302610201764223011427 000000000000002005-02-07 Margarita Manterola Release version 20050207 2005-02-07 Margarita Manterola * NEWS: * AUTHORS: * INSTALL: Update the docs for the upcoming release. 2005-02-07 Margarita Manterola * configure.ac (AC_INIT): Bump version. * src/Avr.C: * src/Avrdummy.C: Improve the error messages a little bit. 2004-12-28 Margarita Manterola [Contributed by James Lamanna ] * configure.ac (AC_INIT): Bump version. * src/Avr.C: * src/Stk500.C: Add support for AtMega48 and AtMega88. 2004-11-16 Theodore A. Roth [Contributed by Juergen Weigert ] * src/Main.C: * src/MotIntl.C: * src/MotIntl.h: Enabled --hash for download, added --size for download. 2004-11-16 Theodore A. Roth [Contributed by Walter Christian ] * configure.ac (AC_INIT): Bump version. * src/DAPA.C: Include sys/types.h for FreeBSD-5.2.1. 2004-10-20 Margarita Manterola * configure.ac (AC_INIT): Bump version. * uisp.1.in: * NEWS: * src/DAPA.C: * src/Main.C: Fix Datamekatornik -> Datamekatronic typo. 2004-10-14 Margarita Manterola * TODO: Remove ATDH and AT89S items, since both are done now. * NEWS: Add item about the new cables supported (ATDH, DM04 and DASA3). 2004-10-14 Margarita Manterola * configure.ac (AC_INIT): Bump version. * uisp.1.in: * src/DAPA.C: * src/DAPA.h: * src/Main.C: Add DM04 programmer; SCK=!SEL MOSI=INIT MISO=PAPEROUT R_IN=ACK, __no reset bit__ the reset button has to be manually pressed. 2004-10-11 Theodore A. Roth [Contributed by Margarita Manterola ] * configure.ac (AC_INIT): Bump version. * src/Global.h: Include stddef.h so that NULL is always defined, making the code g++-3.4 compatible. 2004-10-06 Theodore A. Roth [Contributed by Margarita Manterola ] * configure.ac (AC_INIT): Bump version. * uisp.1.in: * src/DAPA.h: * src/Main.C: Add ATDH programmer; RESET=!SEL SCK=!STROBE MOSI=D0 MISO=ACK. * src/DAPA.C: Add ATDH programmer. Add verbose levels 4 and 5 for cable debugging. Make -dinvert invert the current reset level, instead of switching to 1. Add comments about all "low active" pins, so that it is clear why the inverted values are used. 2004-05-20 Theodore A. Roth [Contributed by Dean Ferreyra ] * configure.ac (AC_INIT): Bump version. * src/Stk500.C: * src/Stk500.h: Don't program unprogrammed low addresses. Speeds up boot-loader uploading considerably. [patch #2863] 2004-05-11 Theodore A. Roth [Contributed by Jean Schurger ] * uisp.1.in: * src/DAPA.C: * src/DAPA.h: * src/Main.C: Add DASA3 programmer; RESET=!DTR SCK=RTS MOSI=TXD MISO=CTS. 2004-05-11 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * Makefile.am (EXTRA_DIST): Add doc/README.rs232 file. * doc/README.rs232: New file. 2004-03-30 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * NEWS: Add note about tiny2313. * src/Avr.C: * src/Avr.h: Add support for tiny2313. Still need more info to get stk500 working. This partially fixes [Bug #8012]. 2004-03-11 Theodore A. Roth Release version 20040311. 2004-02-07 Theodore A. Roth * configure.ac (AC_INIT): Set version to 20040311. * NEWS: Updated. 2004-02-07 Theodore A. Roth [Contributed by Wojtek Kaniewski ] * src/AvrDummy.C (TAvrDummy::ChipErase): Enforce minimum 500ms delay when erasing at89 devices. 2004-02-07 Theodore A. Roth [Contributed by Terran Melconian ] * src/Stk500.C (TStk500::TStk500): Fix a logical bug when calculating the oscillator byte to be sent to the stk500 to change osc freq. 2004-02-07 Theodore A. Roth [Contributed by Wojtek Kaniewski ] * uisp.1.in: * src/Avr.C: * src/Avr.h: * src/AvrDummy.C: * src/DAPA.C: * src/DAPA.h: * src/Main.C: Add DAPA support for at89s51 and at89s52 deivces. 2004-02-07 Theodore A. Roth [Contributed by Terran Melconian ] * configure.ac (AC_INIT): Set version to 20040207cvs. * src/Stk500.C (TStk500::ReadLockBits): Use correct command byte. 2004-01-26 Theodore A. Roth * configure.ac (AC_INIT): Set version to 20040126cvs. * src/DAPA.C, src/DAPA.h: Change PAT_AVRISP to PAT_PARAVRISP. * src/Main.C, src/Serial.C: Change avrisp to be an alias for stk500. Rename avrisp parallel programmer to paravrisp to avoid confussion with Atmel's AVRISP serial programmer. 2004-01-19 Theodore A. Roth * configure.ac (AC_INIT): Set version to 20040119cvs. Update copyright year. * ChangeLog-2002, ChangeLog-2002, ChangeLog: Cycle the ChangeLog. * Makefile.ac: Update copyright year. (EXTRA_DIST): Add ChangeLog-2002 and ChangeLog-2003 files. (install_aux_files): Ditto. * bootstrap: Remove any autom4te.cache directory left over from a previous run of bootstrap. 2004-01-18 Theodore A. Roth * pavr/pavr.c (send_prog_str): Use pgm_read_byte() install of __lpm_inline() macro. 2004-01-18 Theodore A. Roth * pavr/Makefile, pavr/pavr.c: Sync up with Jason Kyle's source at www.avr1.org. uisp-20050207/INSTALL0000644000175100017510000000120010201760623010675 00000000000000 Micro In-System Programmer Brief Installation Notes Enter the src directory. If uisp does not compile successfully, add switch -DNO_DIRECT_IO in the Makefile to remove support for direct I/O port access (that may be necessary on non-PC architectures). Parallel port access should still work if you have the Linux ppdev driver (patch for 2.2.17 is in the kernel directory, ppdev is standard in 2.4 kernels). Please lobby Alan Cox to include this tiny little driver in 2.2.x too :). To make it type: make and to install it: make install If you have any further doubts, please consult UISP's homepage: http://www.nongnu.org/uisp/ uisp-20050207/Makefile.am0000644000175100017510000000436010050201627011706 00000000000000# # $Id: Makefile.am,v 1.9 2004/05/11 16:47:19 troth Exp $ # # uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. # Copyright (C) 2002, 2003, 2004 Theodore A. Roth # # 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 # # Makefile.am -- Process this file with automake to produce Makefile.in # AUX_DIST = install-sh missing mkinstalldirs depcomp man_MANS = uisp.1 AUX_DIST_EXTRA = EXTRA_DIST = bootstrap \ CHANGES CHANGES.old \ kernel/patch-2.2.17-ppdev1.gz \ pavr/Makefile pavr/pavr.c \ doc/HOWTO.windows doc/README.stk500 \ doc/README.xilinx \ doc/README.rs232 \ doc/uisp-parport-connect.txt \ uisp.1.in \ ChangeLog-2002 \ ChangeLog-2003 SUBDIRS = src DIST_SUBDIRS = src MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure src/config-h.in \ src/stamp-h.in $(AUX_DIST) install_aux_files = AUTHORS COPYING INSTALL CHANGES CHANGES.old TODO \ ChangeLog ChangeLog-2003 ChangeLog-2002 DOC_INST_DIR = $(DESTDIR)$(datadir)/doc/uisp-$(VERSION) install-data-local: $(mkinstalldirs) $(DOC_INST_DIR) for file in $(install_aux_files) ; do \ echo " $(INSTALL_DATA) $$file $(DOC_INST_DIR)/$$file"; \ $(INSTALL_DATA) $(srcdir)/$$file $(DOC_INST_DIR)/$$file; \ done uninstall-local: rm -rf $(DOC_INST_DIR) dist-hook: uisp.spec cp uisp.spec $(distdir)/uisp.spec uisp-20050207/NEWS0000644000175100017510000000346010201760246010356 00000000000000Summary of changes in 20050207 release since 20040311 release: - Add parallel programmer support for tiny2313. Still need the stk500 codes. - Add support for AtMega88 and AtMega48 - Add DASA3 cable support (-dprog=dasa3), ATDH1150VPC cable support (-dprog=atdh), Datamekatronik 2004 cable support (-dprog=dm04). - Improve error messages a little bit - Fix compatibility with g++-3.4 Summary of changes in 20040311 release since 20030618 release: - Add DAPA support for at89s51 and at89s52 devices. - Rename avrisp programmer to paravrisp to avoid confusion with Atmel's AVRISP pod. The AVRISP pod is really a subset of stk500 so -dprog=stk500 option should be used instead. - Update Jason Kyle's pavr firmware. - Allow selecting serial port from either -dlpt or -dserial for dasa and dasa2. - Stk500 support for mega64. - Converted build system to use autoconf-2.57 and automake-1.7.x. - Change -dparallel option to -dhiv to avoid confusion. - Add --rd_osc and --wr_osc options for Stk500. - Work around a bug in recent Linux kernels which causes a seq fault when calling ioperm(). Summary of changes in 20030618 release since last release: - Stk500 support for new devices (mega8, mega16, mega32, mega162, mega169, at90s8534, mega8515, mega8535) - Some updates related to appnote avr061 (stk500 protocol doc). - Parallel programming with stk500. - Read/set ARef and Vtg voltages on stk500. - Add support for ETT parallel port programmer from Futurlec. - Fix handling of checksums in Intex hex input files. - Fixes to allowing compiling and running on Windows via cygwin. - Fix long standing bug in which programming a at90s1200 would hang, but then cycling the power would cause the program to run as if the programming was successful. I have a suspicion that this is also the real fix for Bug #784. Last Release 20021201 uisp-20050207/TODO0000644000175100017510000000456610133511365010357 00000000000000 - The handling of fuse and lock bits needs some serious work. As it stands it does not work with Hi-V parallel programming (on stk500). I've started working on this, but it was way too intusive a change to do just before a release. [TRoth/2003-05-27] - improve pavr support (many thanks to Jason Kyle for sending me one of these nice programmers, see http://www.avr1.org/pavr/pavr.html): - add option to force device type for chips with broken signature bytes - use consistent -dpart=... device names - more firmware improvements, speed optimizations (send OK response and receive the next command while executing the previous one, use data polling if supported by device, etc.) - support for parallel port JTAG programming of ATmega8/16/323/128 - option to generate XTAL1 clock for target device while programming, as in FBPRG / AVREAL / modified ByteBlaster / STK200 (LED output) - how to talk to these new USB programmers Kanda is advertising now? - better documentation - clean rewrite in C ;) (for parallel port interfaces only, maybe port the program already available at http://www.bsdhome.com/avrprog/ from FreeBSD to Linux and extend it to support all these different cables? [This program is now called avrdude and has been ported to linux and cygwin.]) or at least, some better way to add all these parallel interfaces invented by various people, with different pin assignments. See also "cisp" by Marko Makela available from http://www.funet.fi/pub/cbm/crossplatform/transfer/C2N232/firmware/ cisp-1.0.tar.gz - cleaner way to describe all these different cables - free/open firmware for the STK500 (which is based on AT90S8535, and schematics are available on avrfreaks), implementing the same and/or our own different protocol - uisp-compatible (avr910/pavr mode) boot loader for recent ATmega chips, share common parts of the code (comm protocol) with pavr.c ? add multi-word read/write/verify commands (faster) mostly done, needs to be merged - see http://tlw.com/bryce/robot/avr/ - pavr firmware for ATmega8: new hardware design, more features possible than with the original 2313, board with TQFP32 part should still fit in that nice small DB9-DB9 housing, and it would be nice to be able to flash the firmware through the same serial port, using a boot loader and uisp of course :) uisp-20050207/aclocal.m40000644000175100017510000007436610201761021011524 00000000000000# generated automatically by aclocal 1.7.9 -*- Autoconf -*- # Copyright (C) 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. # 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. # Do all the work for Automake. -*- Autoconf -*- # 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. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 10 AC_PREREQ([2.54]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # 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_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_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # 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([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 2002 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., 59 Temple Place - Suite 330, Boston, MA # 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.7"]) # 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.7.9])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _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. # # Copyright 1996, 1997, 2000, 2001 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # 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)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # 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 ]) # AM_AUX_DIR_EXPAND # Copyright 2001 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. 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)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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])]) # -*- Autoconf -*- # Copyright (C) 2003 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 # 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])]) # serial 5 -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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 : > 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 # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' 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 builds --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 1999, 2000, 2001, 2002 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _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 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //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"]) ]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # 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 ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [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])]) uisp-20050207/configure.ac0000644000175100017510000000362410201757614012154 00000000000000# -*- Autoconf -*- # # $Id: configure.ac,v 1.19 2005/02/07 21:37:16 marga Exp $ # # uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. # Copyright (C) 2002, 2003, 2004 Theodore A. Roth # # 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 # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT(uisp, 20050207, uisp-dev@nongnu.org) AC_CONFIG_SRCDIR([src/Main.C]) AC_CONFIG_HEADER([src/config.h:src/config-h.in]) AM_INIT_AUTOMAKE # Checks for programs. AC_PROG_CXX AC_PROG_CC # Checks for libraries. # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h inttypes.h stdlib.h string.h sys/ioctl.h sys/time.h termios.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_SELECT_ARGTYPES AC_FUNC_STRTOD AC_FUNC_VPRINTF AC_CHECK_FUNCS([gettimeofday memset select strcasecmp strncasecmp strstr strtol]) # Set the DATE variable for the man page DATE=`date "+%B, %Y"` AC_SUBST(DATE) AC_CONFIG_FILES([Makefile uisp.1 uisp.spec src/Makefile]) AC_OUTPUT uisp-20050207/depcomp0000755000175100017510000003305210133507707011241 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000, 2003 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., 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 Alexandre Oliva . 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 # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi 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 tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi 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 '/^# [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 uisp-20050207/install-sh0000755000175100017510000001572210133507707011674 00000000000000#!/bin/sh # # install - install a program, script, or datafile # # 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}" 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 "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog 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" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : 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 : 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 : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; 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 : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$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 $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # 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 [ -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 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } uisp-20050207/missing0000755000175100017510000002403210133507707011261 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -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]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. 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' is missing on your system. 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 missing on your system. 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) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # 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 you do not seem to have it handy on your system. 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 uisp-20050207/mkinstalldirs0000755000175100017510000000370410133507707012473 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here uisp-20050207/uisp.1.in0000644000175100017510000001263110135510543011325 00000000000000.TH UISP "1" "@DATE@" "uisp version @VERSION@" "User Commands" .SH NAME uisp \- manual page for uisp .SH SYNOPSIS .B uisp [\fIOPTION\fR].. \fI-dprog=TYPE\fR \fI-dpart=AT90XXX\fR \fI--FUNCTION\fR.. [\fIif=SOURCE\fR] [\fIof=DEST\fR] .SH DESCRIPTION .IP .SS "Programming Methods:" \fB\-dprog\fR=avr910|pavr|stk500 .RS .TP avr910 Standard Atmel Serial Programmer/Atmel Low Cost Programmer .TP pavr http://www.avr1.org/pavr/pavr.html .TP stk500 Atmel STK500 .RE .HP \fB\-dprog\fR=dapa|stk200|abb|atdh|avrisp|bsd|fbprg|dt006|maxi|dm04|dasa|dasa2|dasa3 .RS .TP dapa Direct AVR Parallel Access .TP stk200 Parallel Starter Kit STK200, STK300 .TP abb Altera ByteBlasterMV Parallel Port Download Cable .TP atdh Atmel-ISP Download Cable (P/N ATDH1150VPC) .TP avrisp Atmel AVR ISP (?) .TP bsd http://www.bsdhome.com/avrdude/ (parallel) .TP fbprg http://ln.com.ua/~real/avreal/adapters.html (parallel) .TP dt006 http://www.dontronics.com/dt006.html (parallel) .TP maxi Investment Technologies Maxi (parallel) .TP dm04 Datamekatronik 2004 (parallel) .TP dasa serial (RESET=RTS SCK=DTR MOSI=TXD MISO=CTS) .TP dasa2 serial (RESET=!TXD SCK=RTS MOSI=DTR MISO=CTS) .TP dasa3 serial (RESET=!DTR SCK=RTS MOSI=TXD MISO=CTS) .RE .SS "Target Device Selection:" .TP \fB\-dpart\fR=part Set target abbreviated name or number. For some programmers, if \fB\-dpart\fR is not given programmer's supported devices are listed. Set \fB\-dpart\fR=\fIauto\fR for auto-select. Auto-select does not work with all programmers, so it is recommended to always specify a target device explicitly. .SS "Parallel Device Settings:" .TP \fB\-dlpt\fR=address|device name specify device name (Linux ppdev, FreeBSD ppi, serial) or direct I/O parallel port address (0x378, 0x278, 0x3BC) .TP \fB\-dno\-poll\fR Program without data polling (a little slower) .TP \fB\-dno\-retry\fR Disable retries of program enable command .TP \fB\-dvoltage\fR=value Set timing specs according to the power supply voltage in [V] (default 3.0) .TP \fB\-dt_sck\fR=time Set minimum SCK high/low time in micro-seconds (default 5) .TP \fB\-dt_wd_flash\fR=time Set FLASH maximum write delay time in micro-seconds .TP \fB\-dt_wd_eeprom\fR=time Set EEPROM maximum write delay time in micro-seconds .TP \fB\-dt_reset\fR=time Set reset inactive (high) time in micro-seconds .TP \fB\-dinvert\fR=[sck[,mosi[,miso[,reset]]]]] Invert specified lines Use \fB\-v\fR=\fI3\fR option to see current settings. .TP \fB\-d89\fR Allow parallel programming of AT89S51 and AT89S52 devices. .SS "Atmel Low Cost Programmer Serial Device Settings:" .TP \fB\-dserial\fR=device name Set serial interface as /dev/ttyS* (default /dev/avr) .TP \fB\-dspeed\fR=1200|2400|4800|9600|19200|38400|57600|115200 Set speed of the serial interface (default 19200) .SS "Stk500 specific options:" .TP \fB\-dhiv\fR Use Hi-V programming instead of SPI (default is SPI). .TP \fB\-\-rd_aref\fR Read the ARef Voltage. Note that due to a bug in the stk500 firmware, the read value is sometimes off by 0.1 from the actual value measured with a volt meter. .TP \fB\-\-wr_aref\fR=value Set the ARef Voltage. Valid values are 0.0 to 6.0 volts in 0.1 volt increments. Value can not be larger than the VTarget value. .TP \fB\-\-rd_vtg\fR Read the Vtarget Voltage. Note that due to a bug in the stk500 firmware, the read value is sometimes off by 0.1 from the actual value measured with a volt meter. .TP \fB\-\-wr_vtg\fR=value Set the VTarget Voltage. Valid values are 0.0 to 6.0 volts in 0.1 volt increments. Value can not be smaller than the ARef value. .TP \fB\-\-rd_osc\fR Read the oscillator frequency in Hertz. .TP \fB\-\-wr_osc\fR=value Set the oscillator frequency in Hertz, from 14.06 to 3686400. .SS "Functions:" .TP \fB\-\-upload\fR Upload "input_file" to the AVR memory. .TP \fB\-\-verify\fR Verify "input_file" (processed after the \fB\-\-upload\fR opt.) .TP \fB\-\-download\fR Download AVR memory to "output_file" or stdout. .TP \fB\-\-erase\fR Erase device. .TP \fB\-\-segment\fR=flash|eeprom|fuse Set active segment (auto-select for AVA Motorola output) .SS "Fuse/Lock Bit Operations:" .TP \fB\-\-rd_fuses\fR Read all fuses and print values to stdout .TP \fB\-\-wr_fuse_l\fR=byte Write fuse low byte .TP \fB\-\-wr_fuse_h\fR=byte Write fuse high byte .TP \fB\-\-wr_fuse_e\fR=byte Write fuse extended byte .TP \fB\-\-wr_lock\fR=byte Write lock bits. Argument is a byte where each bit is: Bit5 -> blb12 Bit4 -> blb11 Bit3 -> blb02 Bit2 -> blb01 Bit1 -> lb2 Bit0 -> lb1 .TP \fB\-\-lock\fR Write lock bits [old method; deprecated]. .SS "Files:" .TP \fBif\fR=filename Input file for the \fB\-\-upload\fR and \fB\-\-verify\fR functions in Motorola S-records (S1 or S2) or 16 bit Intel format .TP \fBof\fR=filename Output file for the \fB\-\-download\fR function in Motorola S-records format, default is standard output .SS "Other Options:" .TP \fB\-v\fR=level Set verbose level (-v equals \fB\-v\fR=\fI2\fR, min/max: 0/4, default 1) .TP \fB\-\-hash\fR=perbytes Print hash (default is 32 bytes) .TP \fB\-\-help\fR \fB\-h\fR Help .TP \fB\-\-version\fR Print version information .TP \fB\-\-terminal\fR Invoke shell-like terminal .SH "AUTHOR" Written by Uros Platise. .SH "REPORTING BUGS" Report bugs to .SH "SEE ALSO" http://savannah.nongnu.org/download/uisp/ .SH "COPYRIGHT" (c) 1997-1999 Uros Platise, 2000-2004 Marek Michalkiewicz .PP uisp is free software, covered by the GNU General Public License. You are welcome to change it and/or distribute copies of it under the conditions of the GNU General Public License. uisp-20050207/uisp.spec.in0000644000175100017510000000470707723323052012132 00000000000000## -*- mode: rpm-spec; -*- ## ## $Id: uisp.spec.in,v 1.3 2003/08/28 06:50:18 troth Exp $ ## ## @configure_input@ ## %define debug_package %{nil} %define uispVersion @VERSION@ Summary: Universal In-System Programmer for Atmel AVR and 8051. Name: uisp Version: %{uispVersion} Release: 1 License: GPL Group: Development/Tools URL: http://freesoftware.fsf.org/download/uisp Source: http://freesoftware.fsf.org/download/uisp/uisp-%{uispVersion}.tar.gz Buildroot: %{_tmppath}/%{name}-%{version}-root %description Uisp is utility for downloading/uploading programs to AVR devices. Can also be used for some Atmel 8051 type devices. In addition, uisp can erase the device, write lock bits, verify and set the active segment. For use with the following hardware to program the devices: pavr http://avr.jpk.co.nz/pavr/pavr.html stk500 Atmel STK500 dapa Direct AVR Parallel Access stk200 Parallel Starter Kit STK200, STK300 abb Altera ByteBlasterMV Parallel Port Download Cable avrisp Atmel AVR ISP (?) bsd http://www.bsdhome.com/avrprog/ (parallel) fbprg http://ln.com.ua/~real/avreal/adapters.html (parallel) dt006 http://www.dontronics.com/dt006.html (parallel) dasa serial (RESET=RTS SCK=DTR MOSI=TXD MISO=CTS) dasa2 serial (RESET=!TXD SCK=RTS MOSI=DTR MISO=CTS) %prep %setup -q %build ./configure --prefix=%{_prefix} --mandir=%{_mandir} make %install rm -rf $RPM_BUILD_ROOT make prefix=$RPM_BUILD_ROOT%{_prefix} mandir=$RPM_BUILD_ROOT%{_mandir} install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc ChangeLog AUTHORS CHANGES CHANGES.old COPYING INSTALL TODO kernel pavr %{_prefix}/bin/uisp %{_mandir}/man1/uisp.1.gz %changelog * Wed Aug 27 2003 Theodore A. Roth - Add man page to package. - Disable building of debug package. * Sun May 26 2002 Theodore A. Roth - Integrated in to build system. * Sat Apr 20 2002 Theodore A. Roth - Update to new 20020420 release. * Fri Apr 18 2002 Theodore A. Roth - Added patch to fix reading cal byte on tiny15. (from Alexander Popov) * Mon Apr 08 2002 Theodore A. Roth - Added patch to fix reading signature bytes. - Added patch to fix some problems with srec uploading. * Tue Mar 17 2002 Theodore A. Roth - Added kernel/ and pavr/ directories to %doc files. * Tue Mar 17 2002 Theodore A. Roth - Initial spec file. uisp-20050207/bootstrap0000755000175100017510000000253210003023153011606 00000000000000#! /bin/sh # # $Id: bootstrap,v 1.4 2004/01/19 18:48:11 troth Exp $ # # bootstrap script to build all the *.in files and configure script. # # NOTE: You should use automake-1.7.x and autoconf-2.57. export AUTOMAKE AUTOCONF ACLOCAL AUTOHEADER status="fail" for AUTOMAKE in automake automake17 automake-1.7 automake1.7 do AUTOMAKE_VER=`(${AUTOMAKE} --version | head -n 1 | cut -d ' ' -f 4 | cut -c -3) 2>/dev/null` if [ $? != 0 ] then continue fi if [ "$AUTOMAKE_VER" = "1.7" ] then status="" ACLOCAL=aclocal`expr "$AUTOMAKE" : 'automake\(.*\)'` break fi done if [ -n "$status" ] then echo "You need to use automake version 1.7.x (preferrably 1.7.6)." echo "You are using `automake --version | head -n 1`." echo exit 1 fi status="fail" for AUTOCONF in autoconf autoconf257 autoconf-2.57 autoconf2.57 do AUTOCONF_VER=`(${AUTOCONF} --version 2>/dev/null | head -n 1 | cut -d ' ' -f 4) 2>/dev/null` if [ $? != 0 ] then continue fi if [ "$AUTOCONF_VER" = "2.57" ] then status="" AUTOHEADER=autoheader`expr "$AUTOCONF" : 'autoconf\(.*\)'` break fi done if [ -n "$status" ] then echo "You need to use autoconf version 2.57." echo "You are using `autoconf --version | head -n 1`." echo exit 1 fi # to see what is executed set -x rm -rf autom4te.cache ${ACLOCAL} ${AUTOHEADER} ${AUTOCONF} ${AUTOMAKE} --foreign --add-missing --copy uisp-20050207/CHANGES0000644000175100017510000002246707633415270010673 00000000000000From 20020524 on, see the ChangeLog file. The project is now hosted on http://savannah.gnu.org/projects/uisp/ . Changes in uisp-20020524: - add (GPL) copyright notices to all files, as required before the project can be added to savannah.gnu.org (again, thanks to Theodore A. Roth) - add preliminary ATmega8515 and ATmega162 support (untested, not yet supported by pavr/stk500, just added signature bytes to the list) - add a few items to the TODO list :) Changes in uisp-20020420: - add preliminary ATtiny26 and ATmega32 support (untested, not yet supported by pavr/stk500) - another parallel port programmer (MAXI - http://www.invtech.com.au/), thanks to Hamish Moffatt - fix upload/verify of >64K srec/ihex files, fix STK500 swapped signature bytes, and support case-insensitive AVR device names, thanks to Theodore A. Roth - ATtiny15 has a calibration byte, too (was not in an older version of the datasheet), thanks to Alexander Popov Changes in uisp-20020303: - add support for fuse bits with avr910/pavr programmers, and fix NULL pointer segfaults with no -dprog, thanks to Bryce Denney Changes in uisp-20011025: - DASA2 (aka PonyProg interface) fixes (thanks to Uwe Bonnes): AVR RESET# = inverted TXD (so sending BREAK resets the AVR) -dinvert=sck,miso,mosi,reset (invert each specified line) -dt_reset=N (reset inactive high time in microseconds) - add S2/S3 record support necessary for ATmega103 (thanks to Uwe Bonnes) - add ATmega64 to the device table (untested) - read/write ATmega64/128 extended fuse bits (untested, no pavr support yet) - tested on ATmega323 (thanks to Lars Thore W. Aarrestad for sending me samples) Changes in uisp-20011006: - add ATmega103-old back (bad sig bytes), these chips still exist :) - comment out free(argv_ok) to work around a segfault Changes in uisp-20010909: - add preliminary ATmega8/ATmega16/ATmega128 support based on recently released datasheets (not tested, no extended fuse bits, no pavr yet) - add support for yet another parallel port cable (DT006) - include pavr firmware source (hacked a little by me) as part of uisp (should also work in existing old "Atmel low cost" programmers after 1200 -> 2313 upgrade, assuming the original 1200 was in a socket...) Changes in uisp-20010818: - clear O_NONBLOCK flag with fcntl() instead of re-opening serial ports (failed with "Permission denied" on Cygwin, reported by Jason Kyle) - enable direct serial support only if TIOCMGET is defined, remove dummy TIOCM* defines added for Cygwin port Changes in uisp-20010813: - STK500 support (not yet complete, reverse-engineered communication protocol), thanks to Daniel Berntsson - Win9x/ME/NT/2K (Cygwin) port (needs the giveio.sys driver for direct I/O port access), thanks to Dean Ferreyra Changes in uisp-20010805: - fix recent termios changes (forgot to clear CRTSCTS and set VMIN, VTIME), also now set termios modes for dasa, dasa2 (still untested) - rename ATmega32 to ATmega323 (now that the official datasheet is out) - accept -dprog=pavr (for now as alias for -dprog=avr910, but may include more features in the future, see http://avr.jpk.co.nz/pavr/pavr.html) Changes in uisp-20010715: - rename AVR3 to FBPRG (-dprog=fbprg), as it seems that smartcard development boards might have illegal uses in some countries ;) - fix avr910 page write for ATmega163 (please test ATmega103 too!) - save/restore termios modes on serial ports, please test - change -datmel to -dprog=avr910 - uisp --help now prints to stdout, not stderr - change #include to #include - #include in Terminal.C - fix -dspeed handling in Serial.C Changes in uisp-20010701: - fix compile with g++ 3.0 - fix Programming Enable error message after 32 retries - add yet another parallel port interface (FBPRG/AVR3) - more about --download of=file in uisp --help Changes in uisp-20010616: - hopefully fix serial support (can't test), broken by my 20010211 -dpart changes, in code common to both serial and parallel modes that use different AVR device names :( - CHANGES -> CHANGES.old, README -> CHANGES, TODO - document FBPRG interface (not yet supported), and possible new design using tables to make adding these new cables easier, in DAPA.C comments Changes in uisp-20010501: - direct serial support: -dlpt=/dev/ttyS0 -dprog=dasa (or dasa2, see help) warning: completely untested, might or might not work - incompatible change: programmer type (for all these dummy parallel and serial programmers) is specified with -dprog=... (-dstk200 etc. is gone) - more portability changes (please test especially on non-x86 Linux and FreeBSD, and send me patches if I broke something...) - fix AT90S2323 signature byte (0x02 not 0x04) - increase SCK delay (4us to 5us) for devices with slow RC oscillators - don't skip 0xFF for page write - fix a few typos - remove OLD_DELAY_LOOP - longer timeout for -datmel (500ms -> 1s) Changes in uisp-20010211: - now available from http://www.amelek.gda.pl/avr/uisp/ and officially maintained by me (many thanks to Uros for all previous work) - device type can be specified if auto-detection fails, necessary for AT90S1200 and other parts with erased signature bytes: -dpart=at90s1200 - assume -dno-retry -dno-poll for AT90S1200 (data polling should work according to the datasheet, but bug reports indicate it doesn't, and 1K of program memory doesn't take that long to write anyway...) - support for yet another AVR ISP parallel port cable (not tested), based on information from http://www.bsdhome.com/avrprog/ - FreeBSD support (not tested, uncomment -DHAVE_PPI in the Makefile and tell me if it works, or send me a patch if it doesn't :) Changes in uisp-20001216: - ATmega163 now supported, and tested (many thanks to Odd Jostein Svendsli of Atmel Norway for help - sending me two samples of these new chips) - reading Flash and EEPROM contents to a srec file (--download of=file) - read/write fuse bits and boot lock bits, read calibration byte (use --segment=fuse, address 0 = fuse low, 1 = fuse high, 2 = calibration, 3 = lock bits: 1 1 BLB12 BLB11 BLB02 BLB01 LB2 LB1) - data polling with page write, if supported by device - added timer{add,sub,cmp} macros for systems that don't have them - security fix, drop privileges before opening the serial device too (warning: installation setuid root still not recommended, these are just random fixes, and not a complete review for security holes; using ppdev instead of direct I/O is highly recommended) Changes in uisp-20001125: - fix a bug where erasing a locked device (not possible to identify) might fail, now always wait 200 ms for chip erase - add support for "Atmel AVR ISP" parallel port cable - various cleanups (duplicated code to report statistics, etc.) Changes in uisp-20001118: - make it possible to compile without direct I/O port access for non-PC architectures, but still allow parallel port access via /dev/parportX (Linux ppdev driver) - include the latest ppdev driver (kernel patch) for Linux 2.2.17 - security: drop privileges before opening /dev/parportX (only matters if accidentally installed setuid root - still not recommended!) - data polling statistics reworked: min/avg/max ms/byte (so you can compare them with datasheet specs - maybe it helps in detecting chips that were programmed too many times) - fix a longstanding bug in data polling that caused random programming failures (could be worked around by specifying longer t_wd_flash - no, that really wasn't the chips failing :) - update write timing specs from the current datasheets (flash 8ms -> 4ms for most chips, programs a bit faster - now that the above bug is gone) - add more device codes for "Atmel low cost" (serial port) programmer (still looking for updated avr910.asm - it must exist somewhere, as avrprog.exe from AVR Studio claims to support all devices...) - started work on fuse bits (not finished yet), will be needed for ATmega163 (internal RC oscillator enabled by default) Changes in uisp-20001014: - fix some stupid bugs (SCK delay, writing lock bits) - avoid "invalid parameter" errors for -dt_wd_flash etc. if device locked - updated help and version information Changes in uisp-20000930: - compiles with g++ 2.95.2 (tested on Debian 2.2), does not depend on kernel header files for parallel port bit definitions - as in PonyProg, support for the "ppdev" Linux driver (included in pre-2.4.0 kernels, available separately for 2.2.x - please bug Alan to add it to 2.2.18 :), as well as the old direct I/O port access (works with any kernel, but requires root privileges) - more reliable delays on very fast machines, using gettimeofday() (programming may be very slow on <=486 but should work otherwise) - support for more new devices, such as ATmega161 (not tested) - support for programming lock bits with --lock option (currently only both at the same time, and no ATmega161 BLBxx bits yet) - when not programming, try to disable (PS/2) parallel port data outputs - this may allow cheap cables (no 74HC244 inside) to work if the ISP pins are also used for other things (not tested) - removed endian_bug backwards compatibility, various other cleanups uisp-20050207/CHANGES.old0000644000175100017510000000333407473750422011443 00000000000000 Micro In-System Programmer CHANGES Uros Platise (c) 1997-1999 0.1.2 -> 0.1.3 ============== * NEW: Parallel command line option support. * Some little bug fixes for the parallel uploading (thanks to Denis) 0.1.3 -> 0.1.4 (?. February 1999) ================================= * BUG FIX: Parallel Port Selection (PSPI.C and Main.C) * BUG FIX: --DPCAvr command line parameters (Main.C) 0.2 beta (2. August 1999) ========================= * NEW: * Parallel Access Improved (again) * ATmega Page Programming support for the parallel access (not tested) * STK200 support (thanks to Marek Michalkiewicz) * Motorola S-record S1/S2 (16bit/24bit) format * Standard Intel 16 bit format * Improved Support for the standard serial Atmel Programmers (e.g. Atmel Low Cost Programmer) - uploading/downloading speed increased for more than 100% * Auto-Select support for the Atmel Programmers Switch: -dpart=auto Use -v to trace trials ... * ATmega support for the Atmel Programmers (not tested) * No Direct AVR Parallel Access support for non-Intel systems * and more, I cannot remember everything :) * FORGOTTEN: uTools a.out format bugs :) CHANGES 21-26 October: ====================== * Standard Atmel Programmator -favr_endianbug option added * ATmega Page bug fixed; thanks to Simon *?* Page buffer 0xff bug is still present. To workaround this bug convert S-rec to bin and then back from bin to S-rec. * Altera Byte BlasterMV Parallel Download Cable Support Connect: TMS - Reset TDI - MOSI TDO - MISO TCK - SCK VCC - VCC GND - GND * Atmel Low Cost Programmater Address Auto Increment Detect (disabled for software versions lower than 2) uisp-20050207/ChangeLog-20020000644000175100017510000001746310003023153012007 000000000000002002-12-19 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * src/Stk500.C: Add struct entry for mega8. 2002-12-01 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Reset version to 20021201cvs. 2002-12-01 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Cut 20021201 release. 2002-11-22 Theodore A. Roth (Thanks to Jake McGuire for the patch and porting to Mac OS X for use with a USB-to-RS232 dongle.) * configure.in (AM_INIT_AUTOMAKE): Bump version. * src/DAPA.C: Make sure the ioport_*() functions are defined in all cases. If par_release() isn't available, define it to nothing instead of (0). 2002-11-15 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * src/DAPA.C: Use /dev/parport0 as the default interface instead of direct port access via ioperm(). Using uisp at root or setuid root is frowned upon so it should not be the default. 2002-11-15 Theodore A. Roth (Thanks to Christopher X. Candreva for reporting this.) * src/Serial.h: Increase serial timeout. Programming 8535 parts with the stk500 was timing out to early and caused failures. This also seems to affect the at90s1200 devices (also reported by Klaus Rudolph ). 2002-10-30 Theodore A. Roth (Thanks to Seth LaForge for pointing out the buffer overflow problems.) * configure.in (AM_INIT_AUTOMAKE): Bump version. * src/Main.C: Add comment about dropping setuid privies. * src/AvrAtmel.C: Remove unused variables. * src/Makefile.am: Add -Wall and -Werror compile flags. * src/MotIntl.C (Htoi): Make sure hex digit is valid. (UploadMotorola): Increase size of seg_name[] to avoid buffer overflow. (UploadMotorola): Check for possible read past end of line_buf. (UploadMotorola): Add case for "S3" records. (UploadIntel): Check for possible read past end of line_buf. 2002-10-29 Theodore A. Roth * doc/srecord.htm: New file (from Marek's site). 2002-10-28 Theodore A. Roth * src/Stk500.C: Allow firmware version >= 1.7. 2002-10-28 Theodore A. Roth * bootstrap: Check for proper autotools. * configure.in: Check for autoconf version 2.13. * config/check_autoconf213.m4: New file. 2002-10-28 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. Make cvs version rpm compatible. * src/AvrAtmel.C: Make -dpart more compatible with gcc device names. 2002-10-05 Theodore A. Roth * Makefile.am: Add man page. * configure.in: Ditto. (AM_INIT_AUTOMAKE): Bump version. * uisp.1.in: New file. [Thanks to Shaun Jackman ] 2002-10-02 Theodore A. Roth * src/Stk500.C: Use struct for programming parameters instead of just a byte array. Add tiny26 support. * src/Stk500.h: Define SPrgParams structure. 2002-10-02 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * doc/README.stk500: Add note about specs available from Atmel. 2002-08-19 Theodore A. Roth [Patch from Tetsuya Okada ] * configure.in (AM_INIT_AUTOMAKE): Bump version. * src/DAPA.C: Added Xilinx cable support. * src/DAPA.h: Added Xilinx cable support. * src/Main.C: Added Xilinx cable support. * doc/README.xilinx: New file. 2002-07-04 Marek Michalkiewicz * src/DAPA.C (OutReset, Init): Fix PAT_BSD bug. 2002-06-26 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Update version for release. 2002-06-24 Theodore A. Roth * doc/HOWTO.windows: New file. Thanks to Marc Wetzel . * Makefile.am (EXTRA_DIST): Added doc files. 2002-06-24 Marek Michalkiewicz * configure.in (AM_INIT_AUTOMAKE): Update version. * pavr/pavr.c: Add ATmega323 support. * src/AvrAtmel.C (ChipErase): Wait up to 5 seconds for chip erase. * src/Serial.C (Tx, Rx): Use Info() instead of fprintf() to log sent and received characters (now enabled at run time with -v=4). (Send): Accept optional timeout argument, default is 1 second. * src/Serial.h (DEBUG_LOG_TX, DEBUG_LOG_RX): Remove. (Send): Update for optional timeout argument. Thanks to Bryce Denney for suggestions. 2002-06-13 Marek Michalkiewicz * src/DAPA.C (SendRecv): Read MISO just before SCK falling edge, leaving more room for propagation delays. 2002-06-13 Marek Michalkiewicz * configure.in (AM_INIT_AUTOMAKE): Update version. * src/MotIntl.C (UploadIntel): Handle hex record types 3, 4, 5. 2002-06-09 Marek Michalkiewicz * pavr/pavr.c: Fix to build with latest avr-libc. 2002-06-08 Marek Michalkiewicz * configure.in (AM_INIT_AUTOMAKE): Update version. * src/Avr.C (parts): Add ATmega8535 signature bytes. * src/AvrAtmel.C (prg_part): Update list to match AvrProg 1.37 distributed with AVR Studio 3.54. Sort by device code. 2002-06-03 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Update version. * src/Avr.h, src/AvrAtmel.C, src/AvrDummy.C, src/Main.C, src/Stk500.h: Implemented the new '--wr_lock' command line option. * src/Stk500.C: Implemented WriteLockBits. Simplified usage of UniversalCmd. * src/Avr.C, src/AvrAtmel.C, src/AvrDummy.C, src/DAPA.C, src/MotIntl.C, src/Serial.C, src/Stk500.C, src/Terminal.C, src/cygwinp.C: Add include for config.h. 2002-06-02 Marek Michalkiewicz * configure.in (AM_INIT_AUTOMAKE): Update version. * src/Avr.C, src/DAPA.C, src/Main.C, src/Terminal.C: Fixes for g++ 3.1 errors. Please test with older compilers. 2002-06-02 Marek Michalkiewicz * src/Main.C (main): Fix typo (missing %) in 4 format strings. 2002-06-01 Theodore A. Roth * src/Avr.h, src/AvrAtmel.C, src/AvrDummy.C, src/Main.C, src/Stk500.C: Added new command lines options for reading/writing fuses. Stubbed out code for new lock bit writing implementation. 2002-05-30 Theodore A. Roth * configure.in: Changed version to -cvs. * src/Stk500.C, src/Stk500.h: Added functionality to write lock/fuse bits. * src/Stk500.C, src/Stk500.h: Added functionality to read lock/fuse/calibration bits. * src/Terminal.C: Added space to prompt. * src/Stk500.C, src/Stk500.h: Fix write_buffer (separate buffers for flash and eeprom segments). * src/Stk500.C, src/Stk500.h: Fix read_buffer (separate buffers for flash and eeprom segments). 2002-05-27 Theodore A. Roth * doc/README.stk500: New file from Jason Kyle. * TODO: Remove note about autoconf/automake. * CHANGES: Added note about new ChangeLog file. * AUTHORS: Added Hamish Moffatt. * Makefile.am, acconfig.h, bootstrap, config/README, configure.in, src/Main.C, src/Makefile, src/Makefile.am: Conversion to use autoconf/automake for build system. * uisp.spec.in: New file. * AUTHORS: New file. 2002-05-25 marekm * CHANGES: Added notice that uisp is now on savannah, mainly to test CVS write access. 2002-05-25 Theodore A. Roth * CHANGES, CHANGES.old, COPYING, INSTALL, TODO, kernel/patch-2.2.17-ppdev1.gz, pavr/Makefile, pavr/pavr.c, src/Avr.C, src/Avr.h, src/AvrAtmel.C, src/AvrAtmel.h, src/AvrDummy.C, src/AvrDummy.h, src/DAPA.C, src/DAPA.h, src/Error.h, src/Global.h, src/Main.C, src/Makefile, src/MotIntl.C, src/MotIntl.h, src/Serial.C, src/Serial.h, src/Stk500.C, src/Stk500.h, src/Terminal.C, src/Terminal.h, src/cygwinp.C, src/cygwinp.h, src/parport.h, src/ppdev.h, src/timeradd.h: Import sources from uisp-20020524. uisp-20050207/ChangeLog-20030000644000175100017510000002443610003023153012006 000000000000002003-11-16 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * src/DAPA.C (TDAPA::TDAPA): Allow getting serial port from either -dlpt or -dserial if programmer is dasa or dasa2. 2003-10-17 Theodore A. Roth [Submitted by Russel Howe * configure.ac (AC_INIT): Bump version. * src/Stk500.C: Add support for mega64. * src/Stk500.h: Add note clarifying what the reset_disable extended parameter flag represents. 2003-10-06 Theodore A. Roth [Thanks to Dean Ferreyra ] * configure.ac (AC_INIT): Bump version. * src/cygwinp.C (cygwinp_delay_usec): Don't initialize freq since it seems to break the build when using gcc-3.3.1 and latest cygwin. 2003-08-27 Theodore A. Roth * configure.ac (AC_INIT): Bump version. * Makefile.am (dist-hook): Remove reference to config dir. * uisp.spec.in: Add man page to package. Disable building of debug package. 2003-08-11 Theodore A. Roth * acconfig.h: Remove file. 2003-08-11 Theodore A. Roth * Makefile.am (auxdir): Remove variable and usage. (AUX_DIST): Remove auxdir usage and add depcomp. (EXTRA_DIST): Remove references to config/ and acconfig.h. (AUTOMAKE_OPTIONS): Remove variable. (ACLOCAL): Remove variable. * NEWS: Add note about conversion to autoconf-2.57 and automake-1.7.x. * bootstrap: Convert to check for and use autoconf-2.57 and automake-1.7.x. * configure.ac: New file. * configure.in: Remove file. * config/README: Remove file. * config/check_autoconf213.m4: Remove file. 2003-08-07 Theodore A. Roth * NEWS: Updated. 2003-08-07 Theodore A. Roth * src/Main.C: Reformat -dhiv usage output. 2003-08-07 Theodore A. Roth * configure.in: Bump version. * uisp.1.in: * src/Main.C: * src/Stk500.C: * src/Stk500.h: Change -dparallel option to -dhiv. 2003-07-14 Theodore A. Roth * configure.in: Bump version. * AUTHORS: Add note about ChangeLog. * NEWS: Updated. 2003-07-14 Theodore A. Roth [Thanks to Terran Melconian ] * uisp.1.in: Add --rd_osc and --wr_osc option info. Reorder --wr_aref option info. * src/Main.C: Reorder --wr_aref option info in usage. Add --rd_osc and --wr_osc option info to usage. * src/Stk500.C: Add handling of --rd_osc and --wr_osc options. 2003-07-07 Theodore A. Roth * src/Serial.C: Fix seg fault when accessing obsolete -datmel option. 2003-06-20 Theodore A. Roth * configure.in: Bump version (back to cvs track). * src/DAPA.C: There's some bug in recent linux kernels which makes ioperm I/O port permission changes be delayed (you get a segmentation fault at the instruction accessing the I/O port). May be related to this: http://www.securitytracker.com/alerts/2003/May/1006778.html. Known to affect RedHat's 2.4.20-13.9 kernel. [Thanks to David Gay for finding and fixing this and for the link.] 2003-06-18: Theodore A. Roth * Release 20030618. 2003-06-18 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Cut 20030618 release. * NEWS: Minor update to note release. 2003-05-27 Theodore A. Roth * Makefile.am (EXTRA_DIST): Add doc/uisp-parport-connect.txt. * doc/uisp-parport-connect.txt: Add note about mega128 PDI/PDO pins. 2003-05-27 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * TODO: Add note about fuse and lock bits. * doc/uisp-parport-connect.txt: New file (found on net). 2003-05-18 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * NEWS: Fix spelling mistake. 2003-05-13 Theodore A. Roth * configure.in: Update copyright year. * src/Avr.C: Ditto. * src/Avr.h: Ditto. * src/DAPA.C: Ditto. * src/DAPA.h: Ditto. * src/Error.h: Ditto. * src/MotIntl.C: Ditto. * src/Serial.C: Ditto. 2003-05-12 Theodore A. Roth * uisp.1.in: Added new options. If an option takes an argument, show what it should be. * src/Main.C: Make a few usage notes more verbose to clarify some of the options. 2003-05-12 Theodore A. Roth * uisp.1.in: Update pavr URL. Update bsd URL. Update bug report email address. Update download URL. 2003-05-12 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * src/DAPA.C: Fix a bug in which setting -dlpt= for direct IO tries to open the default port name instead of the direct port. [Thanks to Pavel Celeda for reporting the problem and isolating a fix.] 2003-05-10 Theodore A. Roth * src/Main.C: Update URLs for pavr and bsd programmers. s/Futurtec/Futurlec/ for ett programmer. * TODO: Update pavr URL. 2003-05-10 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * src/Serial.C: Fix select() failure on cygwin due to use of getdtablesize() function. [Thanks to Marc Wetzel for the fix and Jason Kyle for reporting.] 2003-05-08 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * NEWS: Add note about pagesize fix. * src/Stk500.C: Fix num fuse bytes for mega162/mega169/mega103. When writing a page to the stk500, set the pagesize based on the pagesize parameter or if the parameter is zero, to 128 (this was causing programming of a 1200 to hang since the pagesize was fixed at 256 which was too long). 2003-05-08 Theodore A. Roth * src/Avr.C: Mega162 has 3 fuse bytes, so set flags to AVR_M128 instead of AVR_M163. [Thanks to John Norgaard for reporting this.] 2003-05-05 Theodore A. Roth * src/Stk500.C: Add a unique string to some "Device is not responding correctly." error messages. 2003-05-04 Theodore A. Roth * NEWS: New file. 2003-04-18 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * TODO: Updated. * src/DAPA.C: Handle TIOCMGET #ifdef's so that enum values are still valid in switch statements. Also, add check to see if TIOCCBRK is defined before using it. (This was causing the build to fail on cygwin. 2003-04-16 Theodore A. Roth * src/DAPA.C: * src/Error.h: * src/Main.C: * src/MotIntl.C: * src/Serial.C: When throwing an Error_C, pass an argument so that the user has a clue as to the cause of the failure. (Maybe the user won't then have to spend two hours looking for what went wrong. *cough*) 2003-03-24 Theodore A. Roth * configure.in: Add check for strtod function. * src/MotIntl.C: Calculate ihex checksum even on ignored records. [submitted by Pavel Celeda ] [patch #1322] * src/Stk500.C: Use strtod() instead of strtof() [strtof isn't available when using gcc-2.95.x (debian)] 2003-03-11 Theodore A. Roth * CHANGES: * ChangeLog: * uisp.spec.in: * doc/HOWTO.windows: Update all occurences of my email address. 2003-03-02 Theodore A. Roth [Thanks to Richard Barrington ] * src/DAPA.C: Add support for Futurlec ETT parallel port programmer. * src/DAPA.h: Ditto. * src/Main.C: Add note about ETT programmer to Usage(). 2003-03-02 Theodore A. Roth [Thanks to Klaus Rudolph as this is based on his patch] * src/Main.C: Add --{rd,wr}_{aref,vtg} options to Usage(). * src/Stk500.C: Add read/write of aref and vtg voltages. * src/Stk500.h: Add ReadParam() and WriteParam() prototypes. 2003-02-21 Theodore A. Roth * src/Main.C: Update copyright year. 2003-02-20 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * uisp.1.in: Fix -v option so max is 4. 2003-02-19 Theodore A. Roth * AUTHORS: Update email addresses. * src/Avr.C: Remove const from parts array so we can change some values at runtime. * src/Avr.h: Ditto. * src/Main.C: Add command switch '-dparallel' for stk500. Fix -v option when printing help to note max is 4 instead of 3. Update email and URL addresses. * src/Stk500.C: Rename VerifyPresense() to Initialize(). Remove const from prg_part[] array so we can change some values at runtime. Before calling Initialize() process the -dparallel option. * src/Stk500.h: Rename VerifyPresense() to Initialize(). Remove const from prg_part[] array so we can change some values at runtime. 2003-02-19 Theodore A. Roth * src/Stk500.C: Add support for firmware version 1.14. Add support for at90s8534, mega8515, mega8535, mega32. * src/Stk500.h: Remove cmd, len and sync from SPrgExtDevParams struct since its len varies depending on the firmware version. 2003-02-18 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * src/Avr.C: Add support for mega169. * src/Stk500.C: Add support for mega162 and mega169. 2003-02-17 Theodore A. Roth * src/Stk500.C: Change MagicNumber to ExtDevParams (see appnote AVR061). Add ext dev params initialization to prg_part structure init. Wrap a few line strings. Change the "Device is not responding correctly." error messages so we can tell where they originated in the code. Add VerifyPresense() method: does most of what was in EnterProgrammingMode(). Simplify EnterProgrammingMode(): doesn't really need to set the params every time it's called. * src/Stk500.h: Add struct SPrgExtDevParams. Remove MagicNumber. Add VerifyPresense() method prototype. 2003-02-17 Theodore A. Roth * src/timeradd.h: Fix some typos in timeradd & timersub macros. 2003-02-17 Theodore A. Roth * src/Terminal.C: Remove C++ iostream usage since this was the only file to use it and it was not consistently used. 2003-02-15 Theodore A. Roth * src/Stk500.C: Add support for mega16. 2003-02-15 Theodore A. Roth * configure.in (AM_INIT_AUTOMAKE): Bump version. * pavr/Makefile: Create .lst file. Change default lpt port to parport0. * pavr/pavr.c: Use latest avr-libc headers. * src/Stk500.C: Print out the version of the stk500 firmware. uisp-20050207/src/0000777000175100017510000000000010201771606010531 500000000000000uisp-20050207/src/Makefile.in0000644000175100017510000003606210201761035012514 00000000000000# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # $Id: Makefile.am,v 1.2 2002/10/30 23:22:07 troth Exp $ # # uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. # Copyright (C) 2002 Theodore A. Roth # # 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 # # Makefile.am -- Process this file with automake to produce Makefile.in # 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 = : ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ 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@ POW_LIB = @POW_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ MAINTAINERCLEANFILES = Makefile.in #SUBDIRS = #DIST_SUBDIRS = #EXTRA_DIST = # Turn on all warnings and consider them errors. This kinda forces you to have # to use gcc, but I'd rather have all warnings eliminated. AM_CXXFLAGS = -Wall -Werror bin_PROGRAMS = uisp uisp_SOURCES = \ Avr.C \ Avr.h \ AvrAtmel.C \ AvrAtmel.h \ AvrDummy.C \ AvrDummy.h \ DAPA.C \ DAPA.h \ Error.h \ Global.h \ Main.C \ MotIntl.C \ MotIntl.h \ Serial.C \ Serial.h \ Stk500.C \ Stk500.h \ Terminal.C \ Terminal.h \ cygwinp.C \ cygwinp.h \ parport.h \ ppdev.h \ timeradd.h subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = bin_PROGRAMS = uisp$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_uisp_OBJECTS = Avr.$(OBJEXT) AvrAtmel.$(OBJEXT) AvrDummy.$(OBJEXT) \ DAPA.$(OBJEXT) Main.$(OBJEXT) MotIntl.$(OBJEXT) \ Serial.$(OBJEXT) Stk500.$(OBJEXT) Terminal.$(OBJEXT) \ cygwinp.$(OBJEXT) uisp_OBJECTS = $(am_uisp_OBJECTS) uisp_LDADD = $(LDADD) uisp_DEPENDENCIES = uisp_LDFLAGS = DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/Avr.Po ./$(DEPDIR)/AvrAtmel.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/AvrDummy.Po ./$(DEPDIR)/DAPA.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/Main.Po ./$(DEPDIR)/MotIntl.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/Serial.Po ./$(DEPDIR)/Stk500.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/Terminal.Po ./$(DEPDIR)/cygwinp.Po CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(uisp_SOURCES) DIST_COMMON = $(srcdir)/Makefile.in Makefile.am config-h.in SOURCES = $(uisp_SOURCES) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .C .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config-h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config-h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/config-h.in distclean-hdr: -rm -f config.h stamp-h1 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) uisp$(EXEEXT): $(uisp_OBJECTS) $(uisp_DEPENDENCIES) @rm -f uisp$(EXEEXT) $(CXXLINK) $(uisp_LDFLAGS) $(uisp_OBJECTS) $(uisp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Avr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AvrAtmel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AvrDummy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DAPA.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MotIntl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Serial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Stk500.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Terminal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cygwinp.Po@am__quote@ .C.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .C.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS 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: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ 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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) 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"; \ $(mkinstalldirs) "$(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) config.h installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) 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: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \ distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distdir dvi \ dvi-am info info-am install install-am install-binPROGRAMS \ 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 pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS 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: uisp-20050207/src/Makefile.am0000644000175100017510000000342407560064637012521 00000000000000# # $Id: Makefile.am,v 1.2 2002/10/30 23:22:07 troth Exp $ # # uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. # Copyright (C) 2002 Theodore A. Roth # # 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 # # Makefile.am -- Process this file with automake to produce Makefile.in # MAINTAINERCLEANFILES = Makefile.in #SUBDIRS = #DIST_SUBDIRS = #EXTRA_DIST = # Turn on all warnings and consider them errors. This kinda forces you to have # to use gcc, but I'd rather have all warnings eliminated. AM_CXXFLAGS = -Wall -Werror bin_PROGRAMS = uisp uisp_SOURCES = \ Avr.C \ Avr.h \ AvrAtmel.C \ AvrAtmel.h \ AvrDummy.C \ AvrDummy.h \ DAPA.C \ DAPA.h \ Error.h \ Global.h \ Main.C \ MotIntl.C \ MotIntl.h \ Serial.C \ Serial.h \ Stk500.C \ Stk500.h \ Terminal.C \ Terminal.h \ cygwinp.C \ cygwinp.h \ parport.h \ ppdev.h \ timeradd.h uisp-20050207/src/config-h.in0000644000175100017510000000653410201761035012472 00000000000000/* src/config-h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `unsigned' if does not define. */ #undef size_t uisp-20050207/src/Avr.C0000644000175100017510000002711410201770714011305 00000000000000/* * $Id: Avr.C,v 1.13 2005/02/07 22:55:08 marga Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002, 2003 Uros Platise * * 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 * **************************************************************************** */ /* Avr.C Top class of the AVR micro controllers Uros Platise (c) 1999 */ #include "config.h" #include #include #include #include #include "Avr.h" #include "Error.h" #define TARGET_MISSING 0xff #define DEVICE_LOCKED 0x1 /* ATMEL AVR codes */ TAvr::TPart TAvr::parts [] = { /* device sig. bytes flash page EEPROM twdFL twdEE flags */ { "AT90S1200", 0x90, 0x01, 1024, 0, 64, 4000, 4000, AVR_1200 }, { "ATtiny12", 0x90, 0x05, 1024, 0, 64, 1700, 3400, AVR_TN12 }, { "ATtiny15", 0x90, 0x06, 1024, 0, 64, 2000, 4000, AVR_TN15 }, #if 0 /* 12V serial programming only; here just for the evidence */ /* ATtiny10 = QuickFlash(TM) OTP */ { "ATtiny10", 0x90, 0x03, 1024, 0, 0, 8000, 0, 0 }, { "ATtiny11", 0x90, 0x04, 1024, 0, 0, 8000, 0, 0 }, #endif { "AT90S2313", 0x91, 0x01, 2048, 0, 128, 4000, 4000, AVR_2313 }, { "AT90S2343", 0x91, 0x03, 2048, 0, 128, 4000, 4000, AVR_8535 }, { "AT90S2323", 0x91, 0x02, 2048, 0, 128, 4000, 4000, AVR_8535 }, /* no longer in production? 2333 -> 4433, tiny22 -> 2343? */ { "AT90S2333", 0x91, 0x05, 2048, 0, 128, 4000, 4000, AVR_4433 }, { "ATtiny22", 0x91, 0x06, 2048, 0, 128, 4000, 4000, AVR_TN22 }, { "ATtiny26", 0x91, 0x09, 2048, 32, 128, 4500, 9000, AVR_TN26 }, { "ATtiny2313", 0x91, 0x0A, 2048, 0, 128, 4000, 4000, AVR_TN2313 }, #if 0 /* 12V parallel programming only; here just for the evidence */ { "ATtiny28", 0x91, 0x07, 2048, 0, 0, 8000, 0, 0 }, #endif { "AT90S4433", 0x92, 0x03, 4096, 0, 256, 4000, 4000, AVR_4433 }, /* no longer in production? -> use 8515, 8535 instead */ { "AT90S4414", 0x92, 0x01, 4096, 0, 256, 4000, 4000, AVR_2313 }, { "AT90S4434", 0x92, 0x02, 4096, 0, 256, 4000, 4000, AVR_8535 }, { "ATmega48", 0x92, 0x05, 4096, 0, 256, 4000, 4000, AVR_M163 }, { "AT90S8515", 0x93, 0x01, 8192, 0, 512, 4000, 4000, AVR_2313 }, { "AT90S8535", 0x93, 0x03, 8192, 0, 512, 4000, 4000, AVR_8535 }, #if 0 /* aka AT90S8555 - probably doesn't exist, use ATmega8535 */ { "ATmega83", 0x93, 0x05, 8192, 128, 512, 11000, 4000, AVR_M163 }, #endif { "ATmega8515", 0x93, 0x06, 8192, 64, 512, 4500, 9000, AVR_M163 }, { "ATmega8", 0x93, 0x07, 8192, 64, 512, 4500, 9000, AVR_M163 }, { "ATmega8535", 0x93, 0x08, 8192, 64, 512, 4500, 9000, AVR_M163 }, { "ATmega88", 0x93, 0x0a, 8192, 64, 512, 4000, 4000, AVR_M163 }, #if 0 /* 12V parallel programming only; here just for the evidence */ { "AT90C8534", 0x93, 0x04, 8192, 0, 512, 8000, 4000, 0 }, #endif { "ATmega161", 0x94, 0x01, 16384, 128, 512, 11000, 4000, AVR_M161 }, { "ATmega163", 0x94, 0x02, 16384, 128, 512, 15000, 3800, AVR_M163 }, { "ATmega16", 0x94, 0x03, 16384, 128, 512, 4500, 9000, AVR_M163 }, { "ATmega162", 0x94, 0x04, 16384, 128, 512, 4500, 9000, AVR_M128 }, { "ATmega169", 0x94, 0x05, 16384, 128, 512, 4500, 9000, AVR_M128 }, { "ATmega323", 0x95, 0x01, 32768, 128, 1024, 15000, 3800, AVR_M163 }, { "ATmega32", 0x95, 0x02, 32768, 128, 1024, 4500, 9000, AVR_M163 }, { "ATmega64", 0x96, 0x02, 65536, 256, 2048, 4500, 9000, AVR_M128 }, { "ATmega103", 0x97, 0x01, 131072, 256, 4096, 22000, 4000, AVR_M103 }, { "ATmega128", 0x97, 0x02, 131072, 256, 4096, 4500, 9000, AVR_M128 }, { "ATmega103-old",0x01, 0x01, 131072, 256, 4096, 22000, 4000, AVR_M103 }, #if 0 { "ATmega603", 0x96, 0x01, 65536, 256, 2048, 22000, 4000, AVR_M103 }, { "ATmega603-old",0x06, 0x01, 65536, 256, 2048, 22000, 4000, AVR_M103 }, #endif { "AT89S51", 0x51, 0x06, 4096, 0, 0, 1000, 0, AT89S51 }, { "AT89S52", 0x52, 0x06, 8192, 0, 0, 1000, 0, AT89S52 }, { "", TARGET_MISSING, 0, 0, 0, 0, 0, 0, 0 }, { "locked", DEVICE_LOCKED, 0, 0, 0, 0, 0, 0, 0 }, { "", 0x0, 0, 0, 0, 0, 0, 0, 0 } }; const char* TAvr::segment_names[] = {"flash", "eeprom", "fuse", NULL}; /* Private Functions */ TAddr TAvr::GetWritePageSize(){ if (device_locked){return 0;} assert(part!=NULL); return part->flash_page_size; } /* Protected Functions */ void TAvr::OverridePart(const char *part_name) { int i; for (i = 0; parts[i].name[0]; i++) { if (strcasecmp(parts[i].name, part_name) == 0) break; } if (parts[i].name[0]) { if (vendor_code != 0x1e || part_family != parts[i].part_family || part_number != parts[i].part_number) { vendor_code = 0x1e; part_family = parts[i].part_family; part_number = parts[i].part_number; Info(3, "Override signature bytes, device %s assumed.\n", parts[i].name); } } else throw Error_Device("Unknown device specified", part_name); } void TAvr::Identify() { const char* vendor = "Device"; Info(3, "Vendor Code: 0x%02x\nPart Family: 0x%02x\nPart Number: 0x%02x\n", vendor_code, part_family, part_number); /* Identify AVR Part according to the vendor_code ... */ if (vendor_code == 0x1e) { if ((part_family == 0x51) || (part_family == 0x52)) vendor = "Atmel AT89"; else vendor = "Atmel AVR"; } if (vendor_code==0 && part_family==DEVICE_LOCKED && part_number==0x02){ device_locked=true; Info(0, "Cannot identify device because it is locked.\n"); /* XXX hack to avoid "invalid parameter" errors if device is locked */ GetCmdParam("-dt_wd_eeprom"); GetCmdParam("-dt_wd_flash"); GetCmdParam("-dvoltage"); #if 0 return; #endif } else{device_locked=false;} if (part_family==TARGET_MISSING){ Info(0, "An error has occurred during the AVR initialization.\n" " * Target status:\n" " Vendor Code = 0x%02x, Part Family = 0x%02x, Part Number = 0x%02x\n\n", vendor_code, part_family, part_number); throw Error_Device(" Check if the programmer is properly connected. \n" " The wiring may be incorrect or target" " might be 'damaged'."); } int i,n; for(i=0; parts[i].part_family != 0x0; i++){ if (part_family == parts[i].part_family){ for (n=i; parts[n].part_family==part_family; n++){ if (part_number == parts[n].part_number){i=n; break;} } if (i==n){Info(1, "%s %s is found.\n", vendor, parts[i].name);} else{Info(1, "%s similar to the %s is found.\n", vendor, parts[i].name);} part = &parts[i]; break; } } if (parts[i].part_family == 0x0) { throw Error_Device ("Probably the AVR MCU is not in the RESET state.\n" "Check it out and run me again.");} if (!GetCmdParam("--download", false)) SetWriteTimings(); } /* This looks like a good approximation to make the device table simpler (only specify the 5V timings). */ #define CALC_FLASH_T_wd(voltage) ((long) \ ((part ? part->t_wd_flash_50 : 22000) * (5.0 * 5.0) / (voltage * voltage))) #define CALC_EEPROM_T_wd(voltage) ((long) \ ((part ? part->t_wd_eeprom_50 : 4000) * (5.0 * 5.0) / (voltage * voltage))) void TAvr::SetWriteTimings(){ const char* val; page_size = GetWritePageSize(); if (page_size) Info(3, "Page Write Enabled, size=%d\n", (int) page_size); else Info(3, "Page Write Disabled\n"); /* defaults */ t_wd_flash = CALC_FLASH_T_wd(AVR_DEFAULT_VOLTAGE); t_wd_eeprom = CALC_EEPROM_T_wd(AVR_DEFAULT_VOLTAGE); /* set FLASH write delay */ if ((val=GetCmdParam("-dt_wd_flash"))){ t_wd_flash = atol(val); Info(0, "t_wd_flash = %ld\n", t_wd_flash); if (t_wd_flash < CALC_FLASH_T_wd(AVR_MAX_VOLTAGE)){ Info(0, " * According to the Atmel specs the t_wd_flash\n" " should be at least %ld us\n", CALC_FLASH_T_wd(AVR_MAX_VOLTAGE)); #if 0 throw Error_Device("-dt_wd_flash: Value out of range."); #endif } } /* set EEPROM write delay */ if ((val=GetCmdParam("-dt_wd_eeprom"))){ t_wd_eeprom = atol(val); if (t_wd_eeprom < CALC_EEPROM_T_wd(AVR_MAX_VOLTAGE)){ Info(0, " * According to the Atmel specs the t_wd_eeprom\n" " should be at least %ld us\n", CALC_EEPROM_T_wd(AVR_MAX_VOLTAGE)); #if 0 throw Error_Device("-dt_wd_eeprom: Value out of range."); #endif } } /* Set Timings according to the Power Supply Voltage */ if ((val=GetCmdParam("-dvoltage"))){ double voltage = atof(val); if (voltage < AVR_MIN_VOLTAGE || voltage > AVR_MAX_VOLTAGE){ Info(0, " * Atmel AVR MCUs operate in range from %.1f to %.1f V\n", AVR_MIN_VOLTAGE, AVR_MAX_VOLTAGE); throw Error_Device("-dvoltage: Value out of range."); } t_wd_flash = CALC_FLASH_T_wd(voltage); t_wd_eeprom = CALC_EEPROM_T_wd(voltage); } Info(3, "FLASH Write Delay (t_wd_flash): %ld us\n" "EEPROM Write Delay (t_wd_eeprom): %ld us\n", t_wd_flash, t_wd_eeprom); } const char* TAvr::GetPartName(){ return part->name; } TAddr TAvr::GetSegmentSize() { switch (segment) { case SEG_FLASH: return part->flash_size; case SEG_EEPROM: return part->eeprom_size; case SEG_FUSE: return 5; } throw Error_MemoryRange(); } bool TAvr::TestFeatures(unsigned int mask) { return ((part->flags & mask) == mask); } void TAvr::CheckMemoryRange(TAddr addr){ if (device_locked){ Info(0, "Device is locked.\n"); throw Error_MemoryRange(); } if (addr >= GetSegmentSize()) { throw Error_MemoryRange(); } } long TAvr::Get_t_wd_flash() const { return t_wd_flash; } long TAvr::Get_t_wd_eeprom() const { return t_wd_eeprom; } long TAvr::Get_t_wd_erase() const{ #if 0 return 3*t_wd_flash; /* right factor is 2, but just in case */ #else /* Device might be locked and not possible to identify, assume 200ms which should be long enough for any device, and is not that long compared to the program time itself. */ return 200000; #endif } /* Device Interface Functions */ bool TAvr::SetSegment(const char* segment_name){ for (int i=0; segment_names[i]!=NULL; i++){ if (strcmp(segment_names[i], segment_name)==0){ segment=i; return true; } } return false; } const char* TAvr::TellActiveSegment(){ return segment_names[segment]; } const char* TAvr::ListSegment(unsigned index){ if (index>3){return NULL;} return segment_names[index]; } const char* TAvr::ReadByteDescription(TAddr addr){ static const char* no_desc = "No description available."; CheckMemoryRange(addr); return no_desc; } /* Constructor/Destructor */ TAvr::TAvr(): part(NULL), page_size(0), page_addr_fetched(false), page_poll_byte(0xFF), segment(SEG_FLASH){ } TAvr::~TAvr(){ } uisp-20050207/src/Avr.h0000644000175100017510000001472710032426050011351 00000000000000/* * $Id: Avr.h,v 1.7 2004/03/31 02:25:44 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002, 2003 Uros Platise * * 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 * **************************************************************************** */ /* Avr.h Top class of the AVR micro controllers Uros Platise (c) 1999 */ #ifndef __AVR #define __AVR #include "Global.h" /* Virtual Addresses for fuse and lock bytes. These are used to map a read/write of a byte in the fuse segment to the underlying operation. The real address may be different, but should be hidden in the more specific code. */ enum { AVR_FUSE_LOW_ADDR = 0, AVR_FUSE_HIGH_ADDR = 1, AVR_CAL_ADDR = 2, AVR_LOCK_ADDR = 3, AVR_FUSE_EXT_ADDR = 4, }; /* Define the lock bits */ enum { LB1 = 0x01, LB2 = 0x02, BLB01 = 0x04, BLB02 = 0x08, BLB11 = 0x10, BLB12 = 0x20, }; /* Flags for device features: */ /* Old command (LB1=b7, LB2=b6) for Read Lock and Fuse Bits. */ #define AVR_LOCK_RD76 0x0001 /* New command (LB1=b1, LB2=b2) for Read Lock Bits. */ #define AVR_LOCK_RD12 0x0002 /* Read/Write Boot Lock Bits (BLB12,11,02,01,LB2,LB1=b5...b0). */ #define AVR_LOCK_BOOT 0x0004 /* Read Fuse Bits (0x50) command supported. */ #define AVR_FUSE_RD 0x0008 /* Old command (bits 0-4 of byte 2) for Write Fuse Bits. */ #define AVR_FUSE_OLDWR 0x0010 /* New command (all bits of byte 4) for Write Fuse (Low) Bits. */ #define AVR_FUSE_NEWWR 0x0020 /* Read/Write Fuse High Bits. */ #define AVR_FUSE_HIGH 0x0040 /* Read Calibration Byte. */ #define AVR_CAL_RD 0x0080 /* Data Polling supported for Flash page write. */ #define AVR_PAGE_POLL 0x0100 /* Data Polling supported for byte write (XXX not on AT90S1200?). */ #define AVR_BYTE_POLL 0x0200 /* Has 3 bytes of fuse bits (ATmega128). */ #define AVR_FUSE_EXT 0x0400 /* AT89S5x family. */ #define AT89S 0x0800 /* Read Lock Bits at bits 4, 3, 2. */ #define AT89S_LOCK_RD432 0x1000 /* Aliases. */ #define AT89S_BYTE_POLL AVR_BYTE_POLL #define AT89S_PAGE_POLL AVR_PAGE_POLL /* Sets of the above flags ORed for different classes of devices. */ #define AVR_1200 0 /* XXX no polling */ #define AVR_2313 (AVR_BYTE_POLL) #define AVR_TN22 (AVR_BYTE_POLL | AVR_LOCK_RD76) #define AVR_8535 (AVR_BYTE_POLL | AVR_LOCK_RD76 | AVR_FUSE_OLDWR) #define AVR_4433 (AVR_BYTE_POLL | AVR_LOCK_RD12 | AVR_FUSE_RD | AVR_FUSE_OLDWR) #define AVR_M103 (AVR_BYTE_POLL | AVR_LOCK_RD12 | AVR_FUSE_RD | AVR_FUSE_OLDWR) #define AVR_TN12 (AVR_BYTE_POLL | AVR_LOCK_RD12 | AVR_FUSE_RD | AVR_FUSE_NEWWR \ | AVR_CAL_RD) #define AVR_TN15 (AVR_BYTE_POLL | AVR_LOCK_RD12 | AVR_FUSE_RD | AVR_FUSE_NEWWR \ | AVR_CAL_RD) #define AVR_M161 (AVR_BYTE_POLL | AVR_PAGE_POLL | AVR_LOCK_BOOT | AVR_FUSE_RD \ | AVR_FUSE_NEWWR) #define AVR_M163 (AVR_BYTE_POLL | AVR_PAGE_POLL | AVR_LOCK_BOOT | AVR_FUSE_RD \ | AVR_FUSE_NEWWR | AVR_CAL_RD | AVR_FUSE_HIGH) #define AVR_M128 (AVR_BYTE_POLL | AVR_PAGE_POLL | AVR_LOCK_BOOT | AVR_FUSE_RD \ | AVR_FUSE_NEWWR | AVR_CAL_RD | AVR_FUSE_HIGH | AVR_FUSE_EXT) /* XXX no boot lock bits, but ordinary lock bits are in bits 1 and 0. XXX has 4 calibration bytes for 1/2/4/8 MHz, can only read one for now. */ #define AVR_TN26 (AVR_BYTE_POLL | AVR_PAGE_POLL | AVR_LOCK_BOOT | AVR_FUSE_RD \ | AVR_FUSE_NEWWR | AVR_CAL_RD | AVR_FUSE_HIGH) #define AVR_TN2313 (AVR_BYTE_POLL | AVR_PAGE_POLL | AVR_LOCK_BOOT \ | AVR_FUSE_RD | AVR_FUSE_NEWWR | AVR_CAL_RD \ | AVR_FUSE_HIGH | AVR_FUSE_EXT) #define AT89S51 (AT89S | AT89S_BYTE_POLL | AT89S_LOCK_RD432) #define AT89S52 (AT89S | AT89S_BYTE_POLL | AT89S_LOCK_RD432) #define AVR_MIN_VOLTAGE 2.7 /* V */ #define AVR_MAX_VOLTAGE 6.0 /* V */ #define AVR_DEFAULT_VOLTAGE 3.0 /* V */ class TAvr: public TDevice{ private: /* AVR Family Device (Part) List */ struct TPart { char* name; TByte part_family; TByte part_number; TAddr flash_size; TAddr flash_page_size; TAddr eeprom_size; long t_wd_flash_50; /* flash programming delay at 5.0 V */ long t_wd_eeprom_50; unsigned int flags; }; TPart* part; bool device_locked; long t_wd_flash; long t_wd_eeprom; protected: enum TSegment{SEG_FLASH=0, SEG_EEPROM=1, SEG_FUSE=2}; /* ATmega page programming */ TAddr page_size; TAddr page_addr_fetched; /* Becomes true when first byte is written */ TAddr page_addr; /* Fetched Page Address */ /* Page Write Polling */ TAddr page_poll_addr; /* address of the last non-0xFF byte written */ TByte page_poll_byte; /* value of the last non-0xFF byte written */ /* Variables and Functions */ private: static TPart parts[]; TAddr GetWritePageSize(); void SetWriteTimings(); protected: int segment; static const char* segment_names[]; /* AVR Signs/Info */ TByte vendor_code; TByte part_family; TByte part_number; void Identify(); void OverridePart(const char *); const char* GetPartName(); TAddr GetSegmentSize(); bool TestFeatures(unsigned int mask); void CheckMemoryRange(TAddr addr); long Get_t_wd_flash() const; long Get_t_wd_eeprom() const; long Get_t_wd_erase() const; public: /* Set active segment. Returns true if segment exists, otherwise false */ bool SetSegment(const char* segment_name); /* Returns char pointer of current active segment name. */ const char* TellActiveSegment(); /* Returns char pointer of the indexed segment name. Index is in range [0,no_of_segments]. When index is out of range NULL is returned. */ const char* ListSegment(unsigned index); /* Read byte description at address addr (as security bits) */ const char* ReadByteDescription(TAddr addr); TAvr(); ~TAvr(); }; #endif uisp-20050207/src/AvrAtmel.C0000644000175100017510000004506107560064637012307 00000000000000/* * $Id: AvrAtmel.C,v 1.8 2002/10/30 23:22:07 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ /* AvrAtmel.C Device driver for the Serial Atmel Low Cost Programmer Uros Platise (c) 1999 */ #include "config.h" #include #include #include #include #include #include #include "AvrAtmel.h" #define AUTO_SELECT 0 /* Low Cost Atmel Programmer AVR Codes Valid for software version: SW_MAJOR=2 SW_MINOR=0 Code 0xff is reserved for invalid code. Update the TAvrAtmel constructor if Atmel comes up with it. The list is current as of AVRProg 1.37 (shipped with AVR Studio 3.54). */ TAvrAtmel::SPrgPart TAvrAtmel::prg_part [] = { {"S1200A", 0x10, "AT90S1200 rev. A", false}, /* old */ {"S1200B", 0x11, "AT90S1200 rev. B", false}, /* old */ {"S1200C", 0x12, "AT90S1200 rev. C", false}, /* old */ {"S1200", 0x13, "AT90S1200", false}, {"S2313", 0x20, "AT90S2313", false}, {"S4414", 0x28, "AT90S4414", false}, {"S4433", 0x30, "AT90S4433", false}, {"S2333", 0x34, "AT90S2333", false}, {"S8515", 0x38, "AT90S8515", false}, {"M8515", 0x3A, "ATmega8515", false}, {"M8515b", 0x3B, "ATmega8515 BOOT", false}, {"M103C", 0x40, "ATmega103 rev. C", false}, /* old */ {"M103", 0x41, "ATmega103", false}, {"M603", 0x42, "ATmega603", false}, {"M128", 0x43, "ATmega128", false}, {"M128b", 0x44, "ATmega128 BOOT", false}, {"S2323", 0x48, "AT90S2323", false}, {"S2343", 0x4C, "AT90S2343", false}, /* ATtiny22 too */ {"TN11", 0x50, "ATtiny11", false}, /* parallel */ {"TN10", 0x51, "ATtiny10", false}, /* parallel */ {"TN12", 0x55, "ATtiny12", false}, {"TN15", 0x56, "ATtiny15", false}, {"TN19", 0x58, "ATtiny19", false}, /* parallel */ {"TN28", 0x5C, "ATtiny28", false}, /* parallel */ {"TN26", 0x5E, "ATtiny26", false}, {"M161", 0x60, "ATmega161", false}, {"M161b", 0x61, "ATmega161 BOOT", false}, {"M163", 0x64, "ATmega163", false}, {"M83", 0x65, "ATmega83", false}, /* ATmega8535 ??? */ {"M163b", 0x66, "ATmega163 BOOT", false}, {"M83b", 0x67, "ATmega83 BOOT", false}, {"S8535", 0x68, "AT90S8535", false}, {"S4434", 0x6C, "AT90S4434", false}, {"C8534", 0x70, "AT90C8534", false}, /* parallel */ {"C8544", 0x71, "AT90C8544", false}, /* parallel ??? */ {"M32", 0x72, "ATmega32", false}, /* XXX no ATmega323 */ {"M32b", 0x73, "ATmega32 BOOT", false}, {"M16", 0x74, "ATmega16", false}, {"M16b", 0x75, "ATmega16 BOOT", false}, {"M8", 0x76, "ATmega8", false}, {"M8b", 0x77, "ATmega8 BOOT", false}, {"89C1051",0x80, "AT89C1051", false}, /* parallel */ {"89C2051",0x81, "AT89C2051", false}, /* parallel */ {"89C51", 0x82, "AT89C51", false}, /* parallel */ {"89LV51", 0x83, "AT89LV51", false}, /* parallel */ {"89C52", 0x84, "AT89C52", false}, /* parallel */ {"89LV52", 0x85, "AT89LV52", false}, /* parallel */ {"S8252", 0x86, "AT89S8252", false}, {"89S53", 0x87, "AT89S53", false}, /* 0x88..0xDF reserved for AT89, 0xE0..0xFF reserved */ {"auto", AUTO_SELECT, "Auto detect", false}, {"", 0x00, "", false} }; /* Private Functions */ void TAvrAtmel::EnterProgrammingMode(){ /* Select Device Type */ TByte set_device[2] = {'T', desired_avrcode}; Send(set_device, 2, 1); CheckResponse(set_device[0]); /* Enter Programming Mode */ TByte enter_prg[1] = {'P'}; Send(enter_prg, 1); CheckResponse(enter_prg[0]); /* Read Signature Bytes */ TByte sig_bytes[3] = {'s', 0, 0}; Send(sig_bytes, 1, 3); part_number = sig_bytes[0]; part_family = sig_bytes[1]; vendor_code = sig_bytes[2]; } void TAvrAtmel::LeaveProgrammingMode(){ TByte leave_prg [1] = { 'L' }; Send(leave_prg, 1); } void TAvrAtmel::CheckResponse(TByte x){ if (x!=13){throw Error_Device ("Device is not responding correctly.");} } void TAvrAtmel::EnableAvr(){ bool auto_select = desired_avrcode == AUTO_SELECT; for (unsigned pidx=0; prg_part[pidx].code != AUTO_SELECT; pidx++){ if (!prg_part[pidx].supported && auto_select){continue;} if (auto_select){ desired_avrcode = prg_part[pidx].code; Info(2, "Trying with: %s\n", prg_part[pidx].description); } EnterProgrammingMode(); if (!auto_select || !(vendor_code==0 && part_family==1 && part_number==2)){ break; } LeaveProgrammingMode(); } // OverridePart("atmega163"); // XXXXX local hack for broken signature bytes Identify(); if (auto_select){ /* If avr was recongnized by the Identify(), try to find better match in the support list. */ unsigned better_pidx = 0; TByte better_avrcode = desired_avrcode; for (unsigned pidx=0; prg_part[pidx].code != AUTO_SELECT; pidx++){ if (!prg_part[pidx].supported){continue;} if (strstr(prg_part[pidx].description, GetPartName())){ better_avrcode = prg_part[better_pidx = pidx].code; } } if (better_avrcode != desired_avrcode){ Info(2, "Retrying with better match: %s\n", prg_part[better_pidx].description); desired_avrcode = better_avrcode; LeaveProgrammingMode(); EnterProgrammingMode(); Identify(); } } } void TAvrAtmel::SetAddress(TAddr addr){ apc_address = addr; TByte setAddr [3] = { 'A', (addr>>8)&0xff, addr&0xff}; Send(setAddr, 3, 1); CheckResponse(setAddr [0]); } void TAvrAtmel::WriteProgramMemoryPage(){ SetAddress(page_addr >> 1); TByte prg_page [1] = { 'm' }; Send(prg_page, 1); } /* Device Interface Functions */ TByte TAvrAtmel::ReadByte(TAddr addr){ CheckMemoryRange(addr); if (segment==SEG_FLASH){ TAddr saddr = addr>>1; TByte rdF [2] = { 'R', 0 }; if (buf_addr==addr && cache_lowbyte==true){return buf_lowbyte;} if (apc_address!=saddr || apc_autoinc==false) SetAddress(saddr); apc_address++; Send(rdF, 1, 2); /* cache low byte */ cache_lowbyte = true; buf_addr = (saddr<<1) + 1; buf_lowbyte = rdF[0]; return rdF [1 - (addr&1)]; } else if (segment==SEG_EEPROM){ SetAddress(addr); TByte readEE [1] = { 'd' }; Send(readEE, 1); return readEE[0]; } else if (segment==SEG_FUSE) { TByte readback = 0xff; switch (addr) { case AVR_FUSE_LOW_ADDR: if (TestFeatures(AVR_FUSE_RD)) readback = ReadFuseLowBits(); #if 0 /* TRoth/2002-06-03: This case is handled by ReadLockBits() so we don't need it here. Can I delete it completely? */ else if (TestFeatures(AVR_LOCK_RD76)) readback = ReadLockFuseBits(); #endif break; case AVR_FUSE_HIGH_ADDR: if (TestFeatures(AVR_FUSE_HIGH)) readback = ReadFuseHighBits(); else Info (1, "Cannot read high fuse bits on this device. Returning 0xff\n"); break; case AVR_CAL_ADDR: if (TestFeatures(AVR_CAL_RD)) readback = ReadCalByte(0); else Info (1, "Cannot read calibration byte on this device. Returning 0xff\n"); break; case AVR_LOCK_ADDR: readback = ReadLockBits(); break; case AVR_FUSE_EXT_ADDR: if (TestFeatures(AVR_FUSE_EXT)) readback = ReadFuseExtBits(); else Info (1, "Cannot read extended fuse bits on this device. Returning 0xff\n"); break; } Info(3, "Read fuse/cal/lock: byte %d = 0x%02X\n", (int) addr, (int) readback); return readback; } else return 0; } void TAvrAtmel::WriteByte(TAddr addr, TByte byte, bool flush_buffer){ CheckMemoryRange(addr); /* do not check if byte is already written -- it spoils auto-increment feature which reduces the speed for 50%! */ if (segment==SEG_FLASH){ cache_lowbyte = false; /* clear read cache buffer */ if (!page_size && byte==0xff) return; /* PAGE MODE PROGRAMMING: If page mode is enabled cache page address. When current address is out of the page address flush page buffer and continue programming. */ if (page_size){ Info(4, "Loading data to address: %d (page_addr_fetched=%s)\n", addr, page_addr_fetched?"Yes":"No"); if (page_addr_fetched && page_addr != (addr & ~(page_size - 1))){ WriteProgramMemoryPage(); page_addr_fetched = false; } if (page_addr_fetched==false){ page_addr=addr & ~(page_size - 1); page_addr_fetched=true; } if (flush_buffer){WriteProgramMemoryPage();} } TByte wrF [2] = { (addr&1)?'C':'c', byte }; if (apc_address!=(addr>>1) || apc_autoinc==false) SetAddress (addr>>1); if (wrF[0]=='C') apc_address++; Send(wrF, 2, 1); CheckResponse(wrF[0]); } else if (segment==SEG_EEPROM){ SetAddress(addr); TByte writeEE [2] = { 'D', byte }; Send(writeEE, 2, 1); CheckResponse(writeEE[0]); } else if (segment==SEG_FUSE){ Info(3, "Write fuse/lock: byte %d = 0x%02X\n", (int) addr, (int) byte); switch (addr) { case AVR_FUSE_LOW_ADDR: if (TestFeatures(AVR_FUSE_NEWWR)) WriteFuseLowBits(byte); else if (TestFeatures(AVR_FUSE_OLDWR)) WriteOldFuseBits(byte); break; case AVR_FUSE_HIGH_ADDR: if (TestFeatures(AVR_FUSE_HIGH)) WriteFuseHighBits(byte); else Info (1, "Cannot write high fuse bits on this device"); break; /* calibration byte (addr == 2) is read only */ case AVR_CAL_ADDR: Info (1, "Cannot write calibration byte. It is read-only.\n"); break; case AVR_LOCK_ADDR: WriteLockBits(byte); break; case AVR_FUSE_EXT_ADDR: if (TestFeatures(AVR_FUSE_EXT)) WriteFuseExtBits(byte); } } } /* Write Fuse Bits (old): 7 6 5 4 3 2 1 0 2323,8535: x x x 1 1 1 1 FSTRT 2343: x x x 1 1 1 1 RCEN 2333,4433: x x x BODLV BODEN CKSL2 CKSL1 CKSL0 m103,m603: x x x 1 EESAV 1 SUT1 SUT0 */ void TAvrAtmel::WriteOldFuseBits (TByte val) { TByte buf[5] = {'.', 0xac, (val & 0x1f) | 0xa0, 0x00, 0xd2 }; Info (2, "Write fuse high bits: %02x\n", (int)val); Send (buf, 5, 2); CheckResponse (buf[1]); } /* Write Fuse Bits (Low, new): 7 6 5 4 3 2 1 0 m161: 1 BTRST 1 BODLV BODEN CKSL2 CKSL1 CKSL0 m163,m323: BODLV BODEN 1 1 CKSL3 CKSL2 CKSL1 CKSL0 m8,m16,m64,m128: BODLV BODEN SUT1 SUT0 CKSL3 CKSL2 CKSL1 CKSL0 tn12: BODLV BODEN SPIEN RSTDI CKSL3 CKSL2 CKSL1 CKSL0 tn15: BODLV BODEN SPIEN RSTDI 1 1 CKSL1 CKSL0 WARNING (tn12,tn15): writing SPIEN=1 disables further low voltage programming! */ void TAvrAtmel::WriteFuseLowBits (TByte val) { // use new universal command. TByte buf[5] = {'.', 0xac, 0xa0, 0x00, val }; Info (2, "Write fuse high bits: %02x\n", (int)val); Send (buf, 5, 2); CheckResponse (buf[1]); } /* Write Fuse Bits High: 7 6 5 4 3 2 1 0 m163: 1 1 1 1 1 BTSZ1 BTSZ0 BTRST m323: OCDEN JTGEN 1 1 EESAV BTSZ1 BTSZ0 BTRST m16,m64,m128: OCDEN JTGEN x CKOPT EESAV BTSZ1 BTSZ0 BTRST m8: RSTDI WDTON x CKOPT EESAV BTSZ1 BTSZ0 BTRST */ void TAvrAtmel::WriteFuseHighBits (TByte val) { // use new universal command. TByte buf[5] = {'.', 0xac, 0xa8, 0x00, val }; Info (2, "Write fuse high bits: %02x\n", (int)val); Send (buf, 5, 2); CheckResponse (buf[1]); } /* Write Extended Fuse Bits: 7 6 5 4 3 2 1 0 m64,m128: x x x x x x M103C WDTON */ void TAvrAtmel::WriteFuseExtBits (TByte val) { // use new universal command. TByte buf[5] = {'.', 0xac, 0xa4, 0x00, val }; Info (2, "Write fuse extended bits: %02x\n", (int)val); Send (buf, 5, 2); CheckResponse (buf[1]); } void TAvrAtmel::FlushWriteBuffer(){ if (page_addr_fetched){ WriteProgramMemoryPage(); } } /* Chip erase can take a few seconds when talking to a boot loader, which does it one page at a time. */ #ifndef CHIP_ERASE_TIMEOUT #define CHIP_ERASE_TIMEOUT 5 #endif void TAvrAtmel::ChipErase(){ TByte eraseTarget [1] = { 'e' }; Send (eraseTarget, 1, -1, CHIP_ERASE_TIMEOUT); CheckResponse(eraseTarget [0]); Info(1, "Erasing device ...\nReinitializing device\n"); EnableAvr(); } void TAvrAtmel::WriteLockBits(TByte bits){ TByte lockTarget [2] = { 'l', 0xF9 | ((bits << 1) & 0x06) }; Send (lockTarget, 2, 1); CheckResponse(lockTarget [0]); Info(1, "Writing lock bits ...\nReinitializing device\n"); EnableAvr(); } TByte TAvrAtmel::ReadFuseLowBits () { // use new universal command. TByte buf[5] = {'.', 0x50, 0x00, 0x00, 0x00 }; Send (buf, 5, 2); CheckResponse (buf[1]); Info (2, "Read fuse low bits: %02x\n", (int)buf[0]); return buf[0]; } TByte TAvrAtmel::ReadFuseHighBits () { // use new universal command. TByte buf[5] = {'.', 0x58, 0x08, 0x00, 0x00 }; Send (buf, 5, 2); CheckResponse (buf[1]); Info (2, "Read fuse high bits: %02x\n", (int)buf[0]); return buf[0]; } TByte TAvrAtmel::ReadCalByte(TByte addr) { // use new universal command. TByte buf[5] = {'.', 0x38, 0x00, addr, 0x00 }; Send (buf, 5, 2); CheckResponse (buf[1]); Info (2, "Read calibration byte: %02x\n", (int)buf[0]); return buf[0]; } TByte TAvrAtmel::ReadFuseExtBits () { // use new universal command. TByte buf[5] = {'.', 0x50, 0x08, 0x00, 0x00 }; Send (buf, 5, 2); CheckResponse (buf[1]); return buf[0]; Info (2, "Read extended fuse bits: %02x\n", (int)buf[0]); return buf[0]; } TByte TAvrAtmel::ReadLockFuseBits () { // use new universal command. TByte buf[5] = {'.', 0x58, 0x00, 0x00, 0x00 }; Send (buf, 5, 2); CheckResponse (buf[1]); Info (2, "Read lock bits: %02x\n", (int)buf[0]); return buf[0]; } // ReadLockBits tries to return the lock bits in a uniform order, despite // the differences in different AVR versions. The goal is to get the lock // bits into this order: // x x BLB12 BLB11 BLB02 BLB01 LB2 LB1 // For devices that don't support a boot block, the BLB bits will be 1. TByte TAvrAtmel::ReadLockBits() { TByte rbits = 0xFF; if (TestFeatures(AVR_LOCK_BOOT)) { /* x x BLB12 BLB11 BLB02 BLB01 LB2 LB1 */ rbits = ReadLockFuseBits(); } else if (TestFeatures(AVR_LOCK_RD76)) { rbits = ReadLockFuseBits(); /* LB1 LB2 x x x x x x -> 1 1 1 1 1 1 LB2 LB1 */ rbits = ((rbits >> 7) & 1) | ((rbits >> 5) & 1) | 0xFC; } else if (TestFeatures(AVR_LOCK_RD12)) { rbits = ReadLockFuseBits(); /* x x x x x LB2 LB1 x -> 1 1 1 1 1 1 LB2 LB1 */ rbits = ((rbits >> 1) & 3) | 0xFC; } else { // if its signature returns 0,1,2 then say it's locked. /* Read Signature Bytes */ TByte sig_bytes[3] = {'s', 0, 0}; Send(sig_bytes, 1, 3); if (sig_bytes[0]==0 && sig_bytes[1]==1 && sig_bytes[2]==2) rbits = 0xFC; else throw Error_Device ("ReadLockBits failed: are you sure this device has lock bits?"); } return rbits; } /* Constructor/Destructor */ TAvrAtmel::TAvrAtmel(): cache_lowbyte(false), apc_address(0x10000), apc_autoinc(false) { /* Select Part by Number or Name */ desired_avrcode=0xff; const char* desired_partname = GetCmdParam("-dpart"); bool got_device=false; if (desired_partname!=NULL) { if (desired_partname[0] >= '0' && desired_partname[0] <= '9'){ desired_avrcode = strtol(&desired_partname[0],(char**)NULL,16); } else{ int j; for (j=0; prg_part[j].name[0] != 0; j++){ if ((strcasecmp (desired_partname, prg_part[j].name)==0) || (strcasecmp (desired_partname, prg_part[j].description)==0)) { desired_avrcode = prg_part[j].code; break; } } if (prg_part[j].name[0]==0){throw Error_Device("-dpart: Invalid name.");} } } /* check: software version and supported part codes */ TByte sw_version [2] = {'V', 0}; TByte hw_version [2] = {'v', 0}; Send(sw_version, 1, 2); Send(hw_version, 1, 2); Info(1, "Programmer Information:\n" " Software Version: %c.%c, Hardware Version: %c.%c\n", sw_version [0], sw_version [1], hw_version [0], hw_version [1]); /* Detect Auto-Increment */ if (sw_version[0]>='2'){ apc_autoinc=true; Info(2, "Address Auto Increment Optimization Enabled\n"); } /* Retrieve supported codes */ TByte sup_codes[1] = {'t'}; Tx(sup_codes, 1); TByte buf_code; timeval timeout = {1, 0}; if (desired_partname==NULL){ Info(1, " Supported Parts:\n\tNo\tAbbreviation\tDescription\n"); } do{ Rx(&buf_code, 1, &timeout); if (buf_code==0){break;} if (desired_partname!=NULL){ if (buf_code==desired_avrcode){got_device=true;} if (desired_avrcode!=AUTO_SELECT) continue; } int j; for (j=0; prg_part[j].name[0] != 0; j++){ if (prg_part[j].code == buf_code){ prg_part[j].supported = true; if (desired_avrcode!=AUTO_SELECT){ Info(1, "\t%.2x\t%s\t\t%s\n", buf_code, prg_part[j].name, prg_part[j].description); } break; } } if (prg_part[j].code == 0) { Info(1, " - %.2xh (not on the uisp's list yet)\n", buf_code); } } while (1); Info(1, "\n"); if (got_device==false) { if (desired_partname==NULL){ throw Error_Device("Select a part from the list with the: -dpart\n" "or use the -dpart=auto option for auto-select.\n"); } else if (desired_avrcode!=AUTO_SELECT){ throw Error_Device("Programmer does not supported chosen device."); } } EnableAvr(); } TAvrAtmel::~TAvrAtmel(){ /* leave programming mode! Due to this procedure, enableAvr had to be taken out of TAtmelAvr::TAtmelAvr func. */ LeaveProgrammingMode(); } uisp-20050207/src/AvrAtmel.h0000644000175100017510000000513207473750422012344 00000000000000/* * $Id: AvrAtmel.h,v 1.1 2002/05/25 17:59:46 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ /* AvrAtmel.h, Uros Platise (c) 1999 */ #ifndef __AVR_ATMEL #define __AVR_ATMEL #include "Global.h" #include "Serial.h" #include "Avr.h" class TAvrAtmel: public TAvr, TSerial { private: /* Programmer AVR codes */ struct SPrgPart{ const char* name; TByte code; const char* description; bool supported; }; static SPrgPart prg_part[]; TByte desired_avrcode; /* Flash word's lower byte cache */ bool cache_lowbyte; TByte buf_lowbyte; TAddr buf_addr; /* Speed-up Transfer by using the Auto-Increment Option */ TAddr apc_address; /* AVR Programmer's Current Address */ bool apc_autoinc; /* Auto Increment Supported by AVR ISP SoftVer 2 */ private: void EnterProgrammingMode(); void LeaveProgrammingMode(); void CheckResponse(TByte x); void EnableAvr(); void SetAddress(TAddr addr); void WriteProgramMemoryPage(); TByte ReadFuseLowBits (); TByte ReadFuseHighBits (); TByte ReadCalByte(TByte addr); TByte ReadFuseExtBits (); TByte ReadLockFuseBits (); TByte ReadLockBits (); void WriteOldFuseBits (TByte val); void WriteFuseLowBits (TByte val); void WriteFuseHighBits (TByte val); void WriteFuseExtBits (TByte val); public: /* Read byte from active segment at address addr. */ TByte ReadByte(TAddr addr); /* Write byte to active segment at address addr */ void WriteByte(TAddr addr, TByte byte, bool flush_buffer=true); void FlushWriteBuffer(); /* Chip Erase */ void ChipErase(); /* Write lock bits */ void WriteLockBits(TByte bits); TAvrAtmel(); ~TAvrAtmel(); }; #endif uisp-20050207/src/AvrDummy.C0000644000175100017510000004223010201761711012312 00000000000000/* * $Id: AvrDummy.C,v 1.8 2005/02/07 21:55:21 marga Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ /* AvrDummy.C Dummy device driver for the AVR parallel access Uros Platise (c) 1999 */ #ifndef NO_DAPA #include "config.h" #include "timeradd.h" #include "AvrDummy.h" /* Private Functions */ void TAvrDummy::EnableAvr(){ unsigned char prg [4] = { 0xAC, 0x53, 0, 0 }; int try_number = 32; bool no_retry = GetCmdParam("-dno-retry", false); const char *part_name = GetCmdParam("-dpart"); if (part_name && strcasecmp(part_name, "at90s1200") == 0) no_retry = true; /* XXX */ /* Enable AVR programming mode */ do{ prg[0]=0xAC; prg[1]=0x53; prg[2]=prg[3]=0; Send(prg, 4); if (no_retry) break; if (prg[2] == 0x53) break; if (at89 && prg[3] == 0x69) break; PulseSck(); } while (try_number--); if (try_number>=0){ Info(2,"AVR Direct Parallel Access succeeded after %d retries.\n", 32-try_number); } else { Info(2,"AVR Direct Parallel Access failed after 32 retries.\n"); } /* Get AVR Info */ vendor_code = GetPartInfo(0); part_family = GetPartInfo(1); part_number = GetPartInfo(2); if (part_name) OverridePart(part_name); Identify(); } TByte TAvrDummy::GetPartInfo(TAddr addr) { if (at89) { TByte info [4] = { 0x28, addr & 0x1f, 0, 0 }; Send(info, 4); return info[3]; } TByte info [4] = { 0x30, 0, addr, 0 }; Send(info, 4); return info[3]; } void TAvrDummy::WriteProgramMemoryPage() { struct timeval t_start_wr, t_start_poll, t_wait, t_timeout, t_end, t_write; bool poll_data = use_data_polling && TestFeatures(AVR_PAGE_POLL) && (page_poll_byte != 0xFF); TByte prg_page [4] = { 0x4C, (TByte)((page_addr >> 9) & 0xff), (TByte)((page_addr >> 1) & 0xff), 0 }; gettimeofday(&t_start_wr, NULL); t_wait.tv_sec = 0; t_wait.tv_usec = Get_t_wd_flash(); Info(4, "Programming page address: %d (%.2x, %.2x, %.2x, %.2x)\n", page_addr, prg_page[0], prg_page[1], prg_page[2], prg_page[3]); Send(prg_page, 4); gettimeofday(&t_start_poll, NULL); timeradd(&t_start_poll, &t_wait, &t_timeout); /* Wait */ do { gettimeofday(&t_end, NULL); if (poll_data) { TByte rbyte = ReadByte(page_poll_addr); if (rbyte == page_poll_byte) break; } } while (timercmp(&t_end, &t_timeout, <)); /* Write Statistics */ timersub(&t_end, &t_start_wr, &t_write); /* t_write = t_end - t_start_wr */ if (poll_data) { float write_time = 1.0e-6 * t_write.tv_usec + t_write.tv_sec; total_poll_time += write_time; if (max_poll_time < write_time) max_poll_time = write_time; if (min_poll_time > write_time) min_poll_time = write_time; total_poll_cnt++; } page_addr_fetched=false; page_poll_byte = 0xFF; } /* Device Interface Functions */ TByte TAvrDummy::ReadByte(TAddr addr) { TByte readback = 0xFF; CheckMemoryRange(addr); if (segment == SEG_FLASH) { if (at89) addr <<= 1; TByte hl = (addr & 1) ? 0x28 : 0x20; TByte flash[4] = { hl, (TByte)((addr >> 9) & 0xff), (TByte)((addr >> 1) & 0xff), 0 }; Send(flash, 4); readback = flash[3]; } else if (segment == SEG_EEPROM) { TByte eeprom [4] = { 0xA0, (TByte)((addr>>8)&0xff), (TByte)(addr&0xff), 0 }; Send(eeprom, 4); readback = eeprom[3]; } else if (segment==SEG_FUSE) { switch (addr) { case AVR_FUSE_LOW_ADDR: if (TestFeatures(AVR_FUSE_RD)) readback = ReadFuseLowBits(); #if 0 /* TRoth/2002-06-03: This case is handled by ReadLockBits() so we don't need it here. Can I delete it completely? */ else if (TestFeatures(AVR_LOCK_RD76)) readback = ReadLockFuseBits(); #endif break; case AVR_FUSE_HIGH_ADDR: if (TestFeatures(AVR_FUSE_HIGH)) readback = ReadFuseHighBits(); break; case AVR_CAL_ADDR: if (TestFeatures(AVR_CAL_RD)) readback = ReadCalByte(0); break; case AVR_LOCK_ADDR: readback = ReadLockBits(); break; case AVR_FUSE_EXT_ADDR: if (TestFeatures(AVR_FUSE_EXT)) readback = ReadFuseExtBits(); } Info(3, "Read fuse/cal/lock: byte %d = 0x%02X\n", (int) addr, (int) readback); } return readback; } /* Read Lock/Fuse Bits: 7 6 5 4 3 2 1 0 2333,4433,m103,m603,tn12,tn15: x x x x x LB2 LB1 x 2323,8535: LB1 LB2 SPIEN x x x x FSTRT 2343: LB1 LB2 SPIEN x x x x RCEN tn22: LB1 LB2 SPIEN x x x x 0 m161,m163,m323,m128: x x BLB12 BLB11 BLB02 BLB01 LB2 LB1 tn26: x x x x x x LB2 LB1 */ TByte TAvrDummy::ReadLockFuseBits() { TByte lockfuse[4] = { 0x58, 0, 0, 0 }; if (at89) lockfuse[0] = 0x24; Send(lockfuse, 4); return lockfuse[3]; } /* Read Fuse Bits (Low): 7 6 5 4 3 2 1 0 2333,4433: x x SPIEN BODLV BODEN CKSL2 CKSL1 CKSL0 m103,m603: x x SPIEN x EESAV 1 SUT1 SUT0 tn12: BODLV BODEN SPIEN RSTDI CKSL3 CKSL2 CKSL1 CKSL0 tn15: BODLV BODEN SPIEN RSTDI x x CKSL1 CKSL0 m161: x BTRST SPIEN BODLV BODEN CKSL2 CKSL1 CKSL0 m163,m323: BODLV BODEN x x CKSL3 CKSL2 CKSL1 CKSL0 m8,m16,m32,m64,m128: BODLV BODEN SUT1 SUT0 CKSL3 CKSL2 CKSL1 CKSL0 tn26: PLLCK CKOPT SUT1 SUT0 CKSL3 CKSL2 CKSL1 CKSL0 */ TByte TAvrDummy::ReadFuseLowBits() { TByte fuselow[4] = { 0x50, 0, 0, 0 }; Send(fuselow, 4); return fuselow[3]; } /* Read Fuse Bits High: 7 6 5 4 3 2 1 0 m163: x x x x 1 BTSZ1 BTSZ0 BTRST m323: OCDEN JTGEN x x EESAV BTSZ1 BTSZ0 BTRST m16,m32,m64,m128: OCDEN JTGEN SPIEN CKOPT EESAV BTSZ1 BTSZ0 BTRST m8: RSTDI WDTON SPIEN CKOPT EESAV BTSZ1 BTSZ0 BTRST tn26: 1 1 1 RSTDI SPIEN EESAV BODLV BODEN */ TByte TAvrDummy::ReadFuseHighBits() { TByte fusehigh[4] = { 0x58, 0x08, 0, 0 }; Send(fusehigh, 4); return fusehigh[3]; } /* Read Extended Fuse Bits: 7 6 5 4 3 2 1 0 m64,m128: x x x x x x M103C WDTON */ TByte TAvrDummy::ReadFuseExtBits() { TByte fuseext[4] = { 0x50, 0x08, 0, 0 }; Send(fuseext, 4); return fuseext[3]; } /* Read Calibration Byte (m163, m323, m128, tn12, tn15, tn26) addr=0...3 for tn26, addr=0 for other devices */ TByte TAvrDummy::ReadCalByte(TByte addr) { TByte cal[4] = { 0x38, 0, addr, 0 }; Send(cal, 4); return cal[3]; } /* Write Fuse Bits (old): 7 6 5 4 3 2 1 0 2323,8535: x x x 1 1 1 1 FSTRT 2343: x x x 1 1 1 1 RCEN 2333,4433: x x x BODLV BODEN CKSL2 CKSL1 CKSL0 m103,m603: x x x 1 EESAV 1 SUT1 SUT0 */ void TAvrDummy::WriteOldFuseBits(TByte val) { TByte oldfuse[4] = { 0xAC, (val & 0x1F) | 0xA0, 0, 0xD2 }; Send(oldfuse, 4); } /* Write Fuse Bits (Low, new): 7 6 5 4 3 2 1 0 m161: 1 BTRST 1 BODLV BODEN CKSL2 CKSL1 CKSL0 m163,m323: BODLV BODEN 1 1 CKSL3 CKSL2 CKSL1 CKSL0 m8,m16,m64,m128: BODLV BODEN SUT1 SUT0 CKSL3 CKSL2 CKSL1 CKSL0 tn12: BODLV BODEN SPIEN RSTDI CKSL3 CKSL2 CKSL1 CKSL0 tn15: BODLV BODEN SPIEN RSTDI 1 1 CKSL1 CKSL0 tn26: PLLCK CKOPT SUT1 SUT0 CKSL3 CKSL2 CKSL1 CKSL0 WARNING (tn12,tn15): writing SPIEN=1 disables further low voltage programming! */ void TAvrDummy::WriteFuseLowBits(TByte val) { TByte fuselow[4] = { 0xAC, 0xA0, 0, val }; Send(fuselow, 4); } /* Write Fuse Bits High: 7 6 5 4 3 2 1 0 m163: 1 1 1 1 1 BTSZ1 BTSZ0 BTRST m323: OCDEN JTGEN 1 1 EESAV BTSZ1 BTSZ0 BTRST m16,m64,m128: OCDEN JTGEN x CKOPT EESAV BTSZ1 BTSZ0 BTRST m8: RSTDI WDTON x CKOPT EESAV BTSZ1 BTSZ0 BTRST tn26: 1 1 1 RSTDI SPIEN EESAV BODLV BODEN */ void TAvrDummy::WriteFuseHighBits(TByte val) { TByte fusehigh[4] = { 0xAC, 0xA8, 0, val }; Send(fusehigh, 4); } /* Write Extended Fuse Bits: 7 6 5 4 3 2 1 0 m64,m128: x x x x x x M103C WDTON */ void TAvrDummy::WriteFuseExtBits(TByte val) { TByte fuseext[4] = { 0xAC, 0xA4, 0, val }; Send(fuseext, 4); } void TAvrDummy::WriteByte(TAddr addr, TByte byte, bool flush_buffer) { struct timeval t_start_wr, t_start_poll, t_wait, t_timeout, t_end, t_write; TByte rbyte=0; bool device_not_erased=false; /* Poll data if use_data_polling is enabled and if page mode is enabled, flash is not selected */ bool poll_data = ((segment==SEG_FLASH && !page_size) || segment==SEG_EEPROM) && use_data_polling && TestFeatures(AVR_BYTE_POLL); CheckMemoryRange(addr); /* For speed, don't program a byte that is already there (such as 0xFF after chip erase). */ if (poll_data){ rbyte=ReadByte(addr); if (rbyte == byte){return;} if (rbyte != 0xff){device_not_erased=true;} } t_wait.tv_sec = 0; t_wait.tv_usec = 500000; gettimeofday(&t_start_wr, NULL); if (segment==SEG_FLASH){ /* PAGE MODE PROGRAMMING: If page mode is enabled cache page address. When current address is out of the page address flush page buffer and continue programming. */ if (page_size) { Info(4, "Loading data to address: %d (page_addr_fetched=%s)\n", addr, page_addr_fetched?"Yes":"No"); if (page_addr_fetched && page_addr != (addr & ~(page_size - 1))){ WriteProgramMemoryPage(); } if (page_addr_fetched==false){ page_addr=addr & ~(page_size - 1); page_addr_fetched=true; } if (flush_buffer){WriteProgramMemoryPage();} } if (at89) addr <<= 1; TByte hl = (addr & 1) ? 0x48 : 0x40; TByte flash [4] = { hl, (TByte)((addr >> 9) & 0xff), (TByte)((addr >> 1) & 0xff), byte }; Send(flash, 4); if (at89) addr >>= 1; /* Remember the last non-0xFF byte written, for page write polling. */ if (byte != 0xFF) { page_poll_addr = addr; page_poll_byte = byte; } /* We do not need to wait for each byte in page mode programming */ if (page_size){return;} t_wait.tv_usec = Get_t_wd_flash(); } else if (segment==SEG_EEPROM){ TByte eeprom [4] = { 0xC0, (TByte)((addr>>8)&0xff), (TByte)(addr&0xff), byte }; Send(eeprom, 4); t_wait.tv_usec = Get_t_wd_eeprom(); } else if (segment==SEG_FUSE) { Info(3, "Write fuse/lock: byte %d = 0x%02X\n", (int) addr, (int) byte); switch (addr) { case AVR_FUSE_LOW_ADDR: if (TestFeatures(AVR_FUSE_NEWWR)) WriteFuseLowBits(byte); else if (TestFeatures(AVR_FUSE_OLDWR)) WriteOldFuseBits(byte); break; case AVR_FUSE_HIGH_ADDR: if (TestFeatures(AVR_FUSE_HIGH)) WriteFuseHighBits(byte); break; case AVR_CAL_ADDR: /* calibration byte (addr == 2) is read only */ break; case AVR_LOCK_ADDR: WriteLockBits(byte); break; case AVR_FUSE_EXT_ADDR: if (TestFeatures(AVR_FUSE_EXT)) WriteFuseExtBits(byte); } t_wait.tv_usec = Get_t_wd_eeprom(); } gettimeofday(&t_start_poll, NULL); /* t_timeout = now + t_wd_prog */ timeradd(&t_start_poll, &t_wait, &t_timeout); do { /* Data Polling: if the programmed value reads correctly, and is not equal to any of the possible P1, P2 read back values, it is done; else wait until tWD_PROG time has elapsed. The busy loop here is to avoid rounding up the programming wait time to 10ms timer ticks (for Linux/x86). Programming is not really "hard real time" but 10ms instead of ~4ms for every byte makes it slow. gettimeofday() reads the 8254 timer registers (or Pentium cycle counter if available), so it has much better (microsecond) resolution. */ gettimeofday(&t_end, NULL); if (poll_data){ if ((byte == (rbyte = ReadByte(addr))) && (byte != 0) && (byte != 0x7F) && (byte != 0x80) && (byte != 0xFF)){ break; } } } while (timercmp(&t_end, &t_timeout, <)); /* Write Statistics */ timersub(&t_end, &t_start_wr, &t_write); /* t_write = t_end - t_start_wr */ if (poll_data) { float write_time = 1.0e-6 * t_write.tv_usec + t_write.tv_sec; total_poll_time += write_time; if (max_poll_time < write_time) max_poll_time = write_time; if (min_poll_time > write_time) min_poll_time = write_time; total_poll_cnt++; } if (poll_data && byte != rbyte){ if (device_not_erased){ Info(0, "Warning: It seems that device is not erased.\n" " Erase it with the --erase option.\n" " If it has been erased, check that no address is being overwritten.\n"); } Info(0, "Error: Data polling readback status: write=0x%02x read=0x%02x\n", byte, rbyte); throw Error_Device("If device was erased disable polling with the " "-dno-poll option."); } } void TAvrDummy::FlushWriteBuffer() { if (page_addr_fetched){ WriteProgramMemoryPage(); } } void TAvrDummy::ChipErase() { int delay; TByte chip_erase [4] = { 0xAC, 0x80, 0x00, 0x00 }; Info(1, "Erasing device ...\n"); Send (chip_erase, 4); delay = Get_t_wd_erase(); if (at89 && delay < 500000) delay = 500000; Delay_usec(delay); PulseReset(); Info(1, "Reinitializing device\n"); EnableAvr(); } /* 0 = program (clear bit), 1 = leave unchanged bit 0 = LB1 bit 1 = LB2 bit 2 = BLB01 bit 3 = BLB02 bit 4 = BLB11 bit 5 = BLB12 bit 6 = 1 (reserved) bit 7 = 1 (reserved) */ void TAvrDummy::WriteLockBits(TByte bits) { /* This handles both old (byte 2, bits 1-2) and new (byte 4, bits 0-5) devices. */ TByte lock[4] = { 0xAC, 0xF9 | ((bits << 1) & 0x06), 0xFF, bits }; TByte rbits; if (at89) lock[1] = 0xe0 | (bits & 0x03); Info(1, "Writing lock bits ...\n"); Send(lock, 4); Delay_usec(Get_t_wd_erase()); PulseReset(); Info(1, "Reinitializing device\n"); EnableAvr(); rbits = ReadLockBits(); if (rbits & ~bits) Info(0, "Warning: lock bits write=0x%02X read=0x%02X\n", (int) bits, (int) rbits); } TByte TAvrDummy::ReadLockBits() { TByte rbits = 0xFF; if (TestFeatures(AVR_LOCK_BOOT)) { /* x x BLB12 BLB11 BLB02 BLB01 LB2 LB1 */ rbits = ReadLockFuseBits(); } else if (TestFeatures(AVR_LOCK_RD76)) { rbits = ReadLockFuseBits(); /* LB1 LB2 x x x x x x -> 1 1 1 1 1 1 LB2 LB1 */ rbits = ((rbits >> 7) & 1) | ((rbits >> 5) & 1) | 0xFC; } else if (TestFeatures(AVR_LOCK_RD12)) { rbits = ReadLockFuseBits(); /* x x x x x LB2 LB1 x -> 1 1 1 1 1 1 LB2 LB1 */ rbits = ((rbits >> 1) & 3) | 0xFC; } else if (TestFeatures(AT89S_LOCK_RD432)) { rbits = ReadLockFuseBits(); /* x x x LB3 LB2 LB1 x x -> 0 0 0 0 0 LB3 LB2 LB1 */ rbits = (rbits >> 2) & 7; } else if (GetPartInfo(0) == 0 && GetPartInfo(1) == 1 && GetPartInfo(2) == 2) { rbits = 0xFC; } else throw Error_Device ("ReadLockBits failed: are you sure this device has lock bits?"); return rbits; } unsigned int TAvrDummy::GetPollCount() { return total_poll_cnt; } float TAvrDummy::GetMinPollTime() { return min_poll_time; } float TAvrDummy::GetMaxPollTime() { return max_poll_time; } float TAvrDummy::GetTotPollTime() { return total_poll_time; } void TAvrDummy::ResetMinMax() { min_poll_time = 1.0; max_poll_time = 0.0; total_poll_time = 0.0; total_poll_cnt = 0; } /* Constructor */ TAvrDummy::TAvrDummy(): use_data_polling(true) { ResetMinMax(); /* Device Command line options ... */ if (GetCmdParam("-dno-poll", false)){use_data_polling=false;} EnableAvr(); } #endif /* eof */ uisp-20050207/src/AvrDummy.h0000644000175100017510000000445307473750422012402 00000000000000/* * $Id: AvrDummy.h,v 1.1 2002/05/25 17:59:46 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ /* AvrDummy.h, Uros Platise (c) 1999 */ #ifndef __AVR_DUMMY #define __AVR_DUMMY #include "Global.h" #include "Avr.h" #include "DAPA.h" class TAvrDummy: public TAvr, TDAPA { private: bool use_data_polling; float min_poll_time, max_poll_time, total_poll_time; unsigned long total_poll_cnt; /* bytes or pages */ void EnableAvr(); TByte GetPartInfo(TAddr addr); void WriteProgramMemoryPage(); TByte ReadLockFuseBits(); TByte ReadFuseLowBits(); TByte ReadFuseHighBits(); TByte ReadFuseExtBits(); TByte ReadCalByte(TByte addr); void WriteOldFuseBits(TByte val); /* 5 bits */ void WriteFuseLowBits(TByte val); void WriteFuseHighBits(TByte val); void WriteFuseExtBits(TByte val); /* lock bits */ void WriteLockBits(TByte bits); TByte ReadLockBits(); public: /* Read byte from active segment at address addr. */ TByte ReadByte(TAddr addr); /* Write byte to active segment at address addr */ void WriteByte(TAddr addr, TByte byte, bool flush_buffer=true); void FlushWriteBuffer(); /* Chip Erase */ void ChipErase(); /* Transfer Statistics */ unsigned int GetPollCount(); float GetMinPollTime(); float GetTotPollTime(); float GetMaxPollTime(); void ResetMinMax(); TAvrDummy(); ~TAvrDummy(){} }; #endif uisp-20050207/src/DAPA.C0000644000175100017510000007634210164270052011267 00000000000000/* * $Id: DAPA.C,v 1.22 2004/11/17 02:59:37 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Sergey Larin * * 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 * **************************************************************************** */ /* DAPA.C Direct AVR Parallel Access (c) 1999 Originally written by Sergey Larin. Corrected by Denis Chertykov, Uros Platise and Marek Michalkiewicz */ #ifndef NO_DAPA //#define DEBUG //#define DEBUG1 #include "config.h" #include #include #include #include #ifndef NO_DIRECT_IO /* Linux and FreeBSD differ in the order of outb() arguments. XXX any other OS/architectures with PC-style parallel ports? XXX how about the other *BSDs? */ #if defined(__linux__) && defined(__i386__) #include #define ioport_read(port) inb(port) #define ioport_write(port, val) outb(val, port) #define ioport_enable(port, num) ({ \ int x = ioperm(port, num, 1); usleep(1); x; }) #define ioport_disable(port, num) ({ \ int x = ioperm(port, num, 0); usleep(1); x; }) #elif defined(__CYGWIN__) #include "cygwinp.h" #define ioport_read(port) inb(port) #define ioport_write(port, val) outb(val, port) #define ioport_enable(port, num) ioperm(port, num, 1) #define ioport_disable(port, num) ioperm(port, num, 0) #elif defined(__FreeBSD__) && defined(__i386__) #include #include #include #include #define ioport_read(port) inb(port) #define ioport_write(port, val) outb(port, val) #define ioport_enable(port, num) i386_set_ioperm(port, num, 1) #define ioport_disable(port, num) i386_set_ioperm(port, num, 0) #else /* Direct I/O port access not supported - ppdev/ppi kernel driver required for parallel port support to work at all. Only likely to work on PC-style parallel ports (all signals implemented) anyway. The only lines believed to be implemented in all parallel ports are: D0-D6 outputs (long long ago I heard of some non-PC machine with D7 hardwired to GND - don't remember what it was) BUSY input So far, only the dt006 interface happens to use a subset of the above. STROBE output might be pulsed by hardware and not be writable ACK input might only trigger an interrupt and not be readable Future designers of these "dongles" might want to keep this in mind. */ #define ioport_read(port) (0xFF) #define ioport_write(port, val) #define ioport_enable(port, num) (-1) #define ioport_disable(port, num) (0) #endif #else /* NO_DIRECT_IO */ #define ioport_read(port) (0xFF) #define ioport_write(port, val) #define ioport_enable(port, num) (-1) #define ioport_disable(port, num) (0) #endif /* NO_DIRECT_IO */ #include #include #include "timeradd.h" #include #include #include "parport.h" /* These should work on any architecture, not just i386. */ #if defined(__linux__) #include "ppdev.h" #define par_claim(fd) ioctl(fd, PPCLAIM, 0) #define par_read_status(fd, ptr) ioctl(fd, PPRSTATUS, ptr) #define par_write_data(fd, ptr) ioctl(fd, PPWDATA, ptr) #define par_write_ctrl(fd, ptr) ioctl(fd, PPWCONTROL, ptr) #define par_set_dir(fd, ptr) ioctl(fd, PPDATADIR, ptr) #define par_release(fd) ioctl(fd, PPRELEASE, 0) #elif defined(__FreeBSD__) #include #define par_claim(fd) (0) #define par_read_status(fd, ptr) ioctl(fd, PPIGSTATUS, ptr) #define par_write_data(fd, ptr) ioctl(fd, PPISDATA, ptr) #define par_write_ctrl(fd, ptr) ioctl(fd, PPISCTRL, ptr) /* par_set_dir not defined, par_write_ctrl used instead */ #define par_release(fd) #else /* Dummy defines if ppdev/ppi not supported by the kernel. */ #define par_claim(fd) (-1) #define par_read_status(fd, ptr) #define par_write_data(fd, ptr) #define par_write_ctrl(fd, ptr) #define par_release(fd) #endif #include "Global.h" #include "Error.h" #include "DAPA.h" #include "Avr.h" /* Parallel Port Base Address */ #define IOBASE parport_base #define IOSIZE 3 /* FIXME: rewrite using tables to define new interface types. For each of the logical outputs (SCK, MOSI, RESET, ENA1, ENA2, power, XTAL1) there should be two bit masks that define which physical bits (from the parallel port output data or control registers, or serial port DTR/RTS/TXD) are affected, and if they should be inverted. More than one output may be changed. For each of the inputs (MISO, maybe TEST?), define which bit (only one, from parallel port status or CTS/DCD/DSR/RI) should be tested and if it should be inverted. One struct as described above should be initialized for each of the supported hardware interfaces. */ /* Alex's Direct Avr Parallel Access */ #define DAPA_SCK PARPORT_CONTROL_STROBE /* base + 2 - low active*/ #define DAPA_RESET PARPORT_CONTROL_INIT /* base + 2 */ #define DAPA_DIN PARPORT_STATUS_BUSY /* base + 1 */ #define DAPA_DOUT 0x1 /* base */ /* STK200 Direct Parallel Access */ #define STK2_TEST1 0x01 /* D0 (base) - may be connected to POUT input */ #define STK2_TEST2 0x02 /* D1 (base) - may be connected to BUSY input */ #define STK2_ENA1 0x04 /* D2 (base) - ENABLE# for RESET#, MISO */ #define STK2_ENA2 0x08 /* D3 (base) - ENABLE# for SCK, MOSI, LED# */ #define STK2_SCK 0x10 /* D4 (base) - SCK */ #define STK2_DOUT 0x20 /* D5 (base) - MOSI */ #define STK2_LED 0x40 /* D6 (base) - LED# (optional) */ #define STK2_RESET 0x80 /* D7 (base) - RESET# */ #define STK2_DIN PARPORT_STATUS_ACK /* ACK (base + 1) - MISO */ /* Altera Byte Blaster Port Configuration */ #define ABB_EN PARPORT_CONTROL_AUTOFD /* low active */ #define ABB_LPAD 0x80 /* D7: loop back throught enable auto-detect */ #define ABB_SCK 0x01 /* D0: TCK (ISP conn. pin 1) */ #define ABB_RESET 0x02 /* D1: TMS (ISP conn. pin 5) */ #define ABB_DOUT 0x40 /* D6: TDI (ISP conn. pin 9) */ #define ABB_DIN PARPORT_STATUS_BUSY /* BUSY: TDO (ISP conn. pin 3) */ /* D5 (pin 7) connected to ACK (pin 10) directly */ /* D7 (pin 9) connected to POUT (pin 12) via 74HC244 buffer */ /* optional modification for AVREAL: D3 (pin 5) = XTAL1 (ISP conn. pin 8) */ #define ABB_XTAL1 0x08 /* Atmel-ISP Download Cable (P/N ATDH1150VPC) (10-pin connector similar to Altera Byte Blaster, but no 3-state outputs) http://www.atmel.com/atmel/acrobat/isp_c_v5.pdf VCC ---- 4 GND ---- 2,10 ---- GND SCK <- TCK(1) <- nSTROBE MISO -> TDO(3) -> nACK RESET <- TMS(5) <- SELECT MOSI <- TDI(9) <- D0 XTAL1 <- AF(8) <- AUTOFD (optional, not yet supported) */ #define ATDH_SCK PARPORT_CONTROL_STROBE /* low active */ #define ATDH_DOUT 0x01 /* D0 - TDI */ #define ATDH_RESET PARPORT_CONTROL_SELECT /* low active */ #define ATDH_DIN PARPORT_STATUS_ACK /* ACK - TDO */ #define ATDH_XTAL1 PARPORT_CONTROL_AUTOFD /* optional, not implemented */ /* "Atmel AVR ISP" cable (?) */ #define AISP_TSTOUT 0x08 /* D3 (base) - dongle test output */ #define AISP_SCK 0x10 /* D4 (base) - SCK */ #define AISP_DOUT 0x20 /* D5 (base) - MOSI */ #define AISP_ENA 0x40 /* D6 (base) - ENABLE# for MISO, MOSI, SCK */ #define AISP_RESET 0x80 /* D7 (base) - RESET# */ #define AISP_DIN PARPORT_STATUS_ACK /* ACK (base + 1) - MISO */ /* BUSY and POUT used as inputs to test for the dongle */ /* Yet another AVR ISP cable from http://www.bsdhome.com/avrprog/ */ #define BSD_POWER 0x0F /* D0-D3 (base) - power */ #define BSD_ENA 0x10 /* D4 (base) - ENABLE# */ #define BSD_RESET 0x20 /* D5 (base) - RESET# */ #define BSD_SCK 0x40 /* D6 (base) - SCK */ #define BSD_DOUT 0x80 /* D7 (base) - MOSI */ #define BSD_DIN PARPORT_STATUS_ACK /* ACK (base + 1) - MISO */ /* optional status LEDs, active low, not yet supported (base + 2) */ #define BSD_LED_ERR PARPORT_CONTROL_STROBE /* error - low active */ #define BSD_LED_RDY PARPORT_CONTROL_AUTOFD /* ready - low active */ #define BSD_LED_PGM PARPORT_CONTROL_INIT /* programming */ #define BSD_LED_VFY PARPORT_CONTROL_SELECT /* verifying - low active*/ /* FBPRG - http://ln.com.ua/~real/avreal/adapters.html */ #define FBPRG_POW 0x07 /* D0,D1,D2 (base) - power supply (XXX D7 too?) */ #define FBPRG_XTAL1 0x08 /* D3 (base) (not supported) */ #define FBPRG_RESET 0x10 /* D4 (base) */ #define FBPRG_DOUT 0x20 /* D5 (base) */ #define FBPRG_SCK 0x40 /* D6 (base) */ #define FBPRG_DIN PARPORT_STATUS_ACK /* ACK (base + 1) - MISO */ /* DT006/Sample Electronics Parallel Cable http://www.dontronics.com/dt006.html */ /* all at base, except for DT006_DIN at base + 1 */ #define DT006_SCK 0x08 #define DT006_RESET 0x04 #define DT006_DIN PARPORT_STATUS_BUSY #define DT006_DOUT 0x01 /* ETT-AVR V2.0 Programmer / Futurlec AT90S8535 */ #define ETT_SCK 0x01 /* DB25 Pin 2: D0 (Base + 0) -> SCK */ #define ETT_RESET 0x02 /* DB25 Pin 3: D1 (Base + 0) -> RESET */ #define ETT_DIN PARPORT_STATUS_ACK /* DB25 Pin 10: ACK (Base + 1) -> MISO */ #define ETT_DOUT PARPORT_CONTROL_STROBE /* DB25 Pin 1: STROBE (Base + 2) -> MOSI (low active) */ /* ABC Maxi - just like DT006 with two pins swapped */ /* all at base, except for MAXI_DIN at base + 1 */ #define MAXI_SCK 0x02 #define MAXI_RESET 0x04 #define MAXI_DIN PARPORT_STATUS_ACK #define MAXI_DOUT 0x01 /* Xilinx JTAG download cable RESET=TMS, SCK=TCK, MISO=TDO, MOSI=TDI */ #define XIL_DOUT 0x01 /* D0: TDI */ #define XIL_SCK 0x02 /* D1: TCK */ #define XIL_RESET 0x04 /* D2: TMS */ #define XIL_ENA 0x08 /* D3: ENABLE# */ #define XIL_DIN PARPORT_STATUS_SELECT /* SLCT: TDO */ /* Datamekatronik 2004 * It has two input bits and two output bits, so * a reset button has to be manually pressed. * * RST - IN2 - ACK * SCK - OUT2 - SELECT * MISO - IN1 - OUT-OF-PAPER * MOSI - OUT1 - INIT * VCC - VCC - D0-D7 */ #define DM04_SCK PARPORT_CONTROL_SELECT /* SCK - low active */ #define DM04_RESET PARPORT_STATUS_ACK /* Reset IN */ #define DM04_DIN PARPORT_STATUS_PAPEROUT /* Data IN */ #define DM04_DOUT PARPORT_CONTROL_INIT /* Data OUT */ /* Default value for minimum SCK high/low time in microseconds. */ #ifndef SCK_DELAY #define SCK_DELAY 5 #endif /* Minimum RESET# high time in microseconds. Should be enough to charge a capacitor between RESET# and GND (it is recommended to use a voltage detector with open collector output, and only something like 100 nF for noise immunity). Default value may be changed with -dt_reset=N microseconds. */ #ifndef RESET_HIGH_TIME #define RESET_HIGH_TIME 1000 #endif /* Delay from RESET# low to sending program enable command (the datasheet says it must be at least 20 ms). Also wait time for crystal oscillator to start after possible power down mode. */ #ifndef RESET_LOW_TIME #define RESET_LOW_TIME 30000 #endif void TDAPA::SckDelay() { Delay_usec(t_sck); } #ifndef MIN_SLEEP_USEC #define MIN_SLEEP_USEC 20000 #endif void TDAPA::Delay_usec(long t) { struct timeval t1, t2; #if defined(__CYGWIN__) if (cygwinp_delay_usec(t)) return; #endif if (t <= 0) return; /* very short delay for slow machines */ gettimeofday(&t1, NULL); if (t > MIN_SLEEP_USEC) usleep(t - MIN_SLEEP_USEC); /* loop for the remaining time */ t2.tv_sec = t / 1000000UL; t2.tv_usec = t % 1000000UL; timeradd(&t1, &t2, &t1); do { gettimeofday(&t2, NULL); } while (timercmp(&t2, &t1, <)); } void TDAPA::ParportSetDir(int dir) { if (dir) par_ctrl |= PARPORT_CONTROL_DIRECTION; else par_ctrl &= ~PARPORT_CONTROL_DIRECTION; if (ppdev_fd != -1) { #ifdef par_set_dir par_set_dir(ppdev_fd, &dir); #else par_write_ctrl(ppdev_fd, &par_ctrl); #endif } else ioport_write(IOBASE+2, par_ctrl); } void TDAPA::ParportWriteCtrl() { Info(5, "Control: %x \n", par_ctrl); if (ppdev_fd != -1) par_write_ctrl(ppdev_fd, &par_ctrl); else ioport_write(IOBASE+2, par_ctrl); } void TDAPA::ParportWriteData() { Info(5, "Data: %x \n", par_data); if (ppdev_fd != -1) par_write_data(ppdev_fd, &par_data); else ioport_write(IOBASE, par_data); } void TDAPA::ParportReadStatus() { if (ppdev_fd != -1) par_read_status(ppdev_fd, &par_status); else par_status = ioport_read(IOBASE+1); Info(5,"Status: %x \n", par_status); } void TDAPA::SerialReadCtrl() { #ifdef TIOCMGET ioctl(ppdev_fd, TIOCMGET, &ser_ctrl); #else ser_ctrl = 0; #endif } void TDAPA::SerialWriteCtrl() { #ifdef TIOCMGET ioctl(ppdev_fd, TIOCMSET, &ser_ctrl); #endif } void TDAPA::OutReset(int b) /* FALSE means active Reset at the AVR */ { if (reset_invert) b = !b; Info(4, "Reseting: %d\n", b); switch (pa_type) { case PAT_DAPA: if (b) par_ctrl |= DAPA_RESET; else par_ctrl &= ~DAPA_RESET; ParportWriteCtrl(); break; case PAT_STK200: if (b) par_data |= STK2_RESET; else par_data &= ~STK2_RESET; ParportWriteData(); break; case PAT_ABB: if (b) par_data |= ABB_RESET; else par_data &= ~ABB_RESET; ParportWriteData(); break; case PAT_ATDH: if (b) par_ctrl |= ATDH_RESET; else par_ctrl &= ~ATDH_RESET; ParportWriteCtrl(); break; case PAT_PARAVRISP: if (b) par_data |= AISP_RESET; else par_data &= ~AISP_RESET; ParportWriteData(); break; case PAT_BSD: if (b) par_data |= BSD_RESET; else par_data &= ~BSD_RESET; ParportWriteData(); break; case PAT_FBPRG: if (b) par_data |= FBPRG_RESET; else par_data &= ~FBPRG_RESET; ParportWriteData(); break; case PAT_DT006: if (b) par_data |= DT006_RESET; else par_data &= ~DT006_RESET; ParportWriteData(); break; case PAT_ETT: if (b) par_data |= ETT_RESET; else par_data &= ~ETT_RESET; ParportWriteData(); break; case PAT_MAXI: if (b) par_data |= MAXI_RESET; else par_data &= ~MAXI_RESET; ParportWriteData(); break; case PAT_XIL: if (b) par_data |= XIL_RESET; else par_data &= ~XIL_RESET; ParportWriteData(); break; case PAT_DM04: break; case PAT_DASA: #ifdef TIOCMGET SerialReadCtrl(); if (b) ser_ctrl |= TIOCM_RTS; else ser_ctrl &= ~TIOCM_RTS; SerialWriteCtrl(); #endif /* TIOCMGET */ break; case PAT_DASA2: #if defined(TIOCMGET) && defined(TIOCCBRK) ioctl(ppdev_fd, b ? TIOCCBRK : TIOCSBRK, 0); #endif /* TIOCMGET */ break; case PAT_DASA3: #if defined(TIOCMGET) if (!b) ser_ctrl |= TIOCM_DTR; else ser_ctrl &= ~TIOCM_DTR; SerialWriteCtrl(); #endif /* TIOCMGET */ break; } Delay_usec(b ? reset_high_time : RESET_LOW_TIME ); } void TDAPA::OutSck(int b) { if (sck_invert) b = !b; #ifdef DEBUG1 printf("%c",(b)?'S':'s'); #endif switch (pa_type) { case PAT_DAPA: if (b) par_ctrl &= ~DAPA_SCK; else par_ctrl |= DAPA_SCK; ParportWriteCtrl(); break; case PAT_DM04: if (b) par_ctrl &= ~DM04_SCK; else par_ctrl |= DM04_SCK; ParportWriteCtrl(); break; case PAT_STK200: if (b) par_data |= STK2_SCK; else par_data &= ~STK2_SCK; ParportWriteData(); break; case PAT_ABB: if (b) par_data |= ABB_SCK; else par_data &= ~ABB_SCK; ParportWriteData(); break; case PAT_ATDH: if (b) par_ctrl |= ATDH_SCK; else par_ctrl &= ~ATDH_SCK; ParportWriteCtrl(); break; case PAT_PARAVRISP: if (b) par_data |= AISP_SCK; else par_data &= ~AISP_SCK; ParportWriteData(); break; case PAT_BSD: if (b) par_data |= BSD_SCK; else par_data &= ~BSD_SCK; ParportWriteData(); break; case PAT_FBPRG: if (b) par_data |= FBPRG_SCK; else par_data &= ~FBPRG_SCK; ParportWriteData(); break; case PAT_DT006: if (b) par_data |= DT006_SCK; else par_data &= ~DT006_SCK; ParportWriteData(); break; case PAT_ETT: if (b) par_data |= ETT_SCK; else par_data &= ~ETT_SCK; ParportWriteData(); break; case PAT_MAXI: if (b) par_data |= MAXI_SCK; else par_data &= ~MAXI_SCK; ParportWriteData(); break; case PAT_XIL: if (b) par_data |= XIL_SCK; else par_data &= ~XIL_SCK; ParportWriteData(); break; case PAT_DASA: #if defined(TIOCMGET) SerialReadCtrl(); if (b) ser_ctrl |= TIOCM_DTR; else ser_ctrl &= ~TIOCM_DTR; SerialWriteCtrl(); #endif /* TIOCMGET */ break; case PAT_DASA2: case PAT_DASA3: #if defined(TIOCMGET) if (b) ser_ctrl |= TIOCM_RTS; else ser_ctrl &= ~TIOCM_RTS; SerialWriteCtrl(); #endif /* TIOCMGET */ break; } } void TDAPA::OutEnaReset(int b) { bool no_ps2_hack = GetCmdParam("-dno-ps2-hack", false); switch (pa_type) { case PAT_DAPA: case PAT_FBPRG: case PAT_ATDH: case PAT_DT006: case PAT_ETT: case PAT_MAXI: if (b) { ParportSetDir(0); } else if (!no_ps2_hack) { /* No special enable line on these interfaces, for PAT_DAPA this only disables the data line (MOSI) and not SCK. */ ParportSetDir(1); } break; case PAT_STK200: if (b) { /* Make sure outputs are enabled. */ ParportSetDir(0); SckDelay(); par_data &= ~STK2_ENA1; ParportWriteData(); } else { par_data |= STK2_ENA1; ParportWriteData(); if (!no_ps2_hack) { /* Experimental: disable outputs (PS/2 parallel port), for cheap STK200-like cable without the '244. Should work with the real STK200 too (disabled outputs should still have pull-up resistors, ENA1 and ENA2 are high, and the '244 remains disabled). This way the SPI pins can be used by the application too. Please report if it doesn't work on some parallel ports. */ SckDelay(); ParportSetDir(1); } } break; case PAT_ABB: if (b) { ParportSetDir(0); par_ctrl |= ABB_EN; ParportWriteCtrl(); } else { par_ctrl &= ~ABB_EN; ParportWriteCtrl(); if (!no_ps2_hack) { SckDelay(); ParportSetDir(1); } } break; case PAT_PARAVRISP: if (b) { ParportSetDir(0); SckDelay(); par_data &= ~AISP_ENA; ParportWriteData(); } else { par_data |= AISP_ENA; ParportWriteData(); if (!no_ps2_hack) { SckDelay(); ParportSetDir(1); } } break; case PAT_BSD: if (b) { ParportSetDir(0); SckDelay(); par_data &= ~BSD_ENA; ParportWriteData(); } else { par_data |= BSD_ENA; ParportWriteData(); if (!no_ps2_hack) { SckDelay(); ParportSetDir(1); } } break; case PAT_XIL: if (b) { ParportSetDir(0); par_data &= ~XIL_ENA; ParportWriteData(); } else { par_data |= XIL_ENA; ParportWriteData(); if (!no_ps2_hack) { SckDelay(); ParportSetDir(1); } } break; case PAT_DASA: case PAT_DASA2: case PAT_DASA3: case PAT_DM04: break; } } void TDAPA::OutEnaSck(int b) { switch (pa_type) { case PAT_STK200: if (b) par_data &= ~(STK2_ENA2 | STK2_LED); else par_data |= (STK2_ENA2 | STK2_LED); ParportWriteData(); break; case PAT_DAPA: case PAT_ABB: case PAT_ATDH: case PAT_PARAVRISP: case PAT_BSD: case PAT_FBPRG: case PAT_DT006: case PAT_ETT: case PAT_MAXI: case PAT_XIL: case PAT_DM04: case PAT_DASA: case PAT_DASA2: case PAT_DASA3: /* no separate enable for SCK and MOSI */ break; } } void TDAPA::PulseSck() { SckDelay(); OutSck(1); SckDelay(); OutSck(0); } void TDAPA::PulseReset() { /* necessary delays already included in these methods */ OutReset(1); OutReset(0); } void TDAPA::OutData(int b) { if (mosi_invert) b = !b; #ifdef DEBUG1 printf("%c",(b)?'D':'d'); #endif switch (pa_type) { case PAT_DAPA: if (b) par_data |= DAPA_DOUT; else par_data &= ~DAPA_DOUT; ParportWriteData(); break; case PAT_STK200: if (b) par_data |= STK2_DOUT; else par_data &= ~STK2_DOUT; ParportWriteData(); break; case PAT_ABB: if (b) par_data |= ABB_DOUT; else par_data &= ~ABB_DOUT; ParportWriteData(); break; case PAT_ATDH: if (b) par_data |= ATDH_DOUT; else par_data &= ~ATDH_DOUT; ParportWriteData(); break; case PAT_PARAVRISP: if (b) par_data |= AISP_DOUT; else par_data &= ~AISP_DOUT; ParportWriteData(); break; case PAT_BSD: if (b) par_data |= BSD_DOUT; else par_data &= ~BSD_DOUT; ParportWriteData(); break; case PAT_FBPRG: if (b) par_data |= FBPRG_DOUT; else par_data &= ~FBPRG_DOUT; ParportWriteData(); break; case PAT_DT006: if (b) par_data |= DT006_DOUT; else par_data &= ~DT006_DOUT; ParportWriteData(); break; case PAT_ETT: if (b) par_ctrl |= ETT_DOUT; else par_ctrl &= ~ETT_DOUT; ParportWriteCtrl(); break; case PAT_MAXI: if (b) par_data |= MAXI_DOUT; else par_data &= ~MAXI_DOUT; ParportWriteData(); break; case PAT_XIL: if (b) par_data |= XIL_DOUT; else par_data &= ~XIL_DOUT; ParportWriteData(); break; case PAT_DM04: if (b) par_ctrl |= DM04_DOUT; else par_ctrl &= ~DM04_DOUT; ParportWriteCtrl(); break; case PAT_DASA: #if defined(TIOCMGET) && defined(TIOCCBRK) ioctl(ppdev_fd, b ? TIOCSBRK : TIOCCBRK, 0); #endif /* TIOCMGET */ break; case PAT_DASA2: #if defined(TIOCMGET) if (b) ser_ctrl |= TIOCM_DTR; else ser_ctrl &= ~TIOCM_DTR; SerialWriteCtrl(); #endif /* TIOCMGET */ break; case PAT_DASA3: #if defined(TIOCMGET) && defined(TIOCCBRK) ioctl(ppdev_fd, (!b) ? TIOCCBRK : TIOCSBRK, 0); #endif /* TIOCMGET */ break; } } int TDAPA::InData() { int b = 0; switch (pa_type) { case PAT_DAPA: case PAT_ABB: case PAT_DT006: ParportReadStatus(); /* STATUS_BUSY is an inverted pin*/ b = (~par_status & PARPORT_STATUS_BUSY); break; case PAT_ETT: ParportReadStatus(); b = (par_status & ETT_DIN); break; case PAT_STK200: case PAT_ATDH: case PAT_PARAVRISP: case PAT_BSD: case PAT_FBPRG: case PAT_MAXI: ParportReadStatus(); b = (par_status & PARPORT_STATUS_ACK); break; case PAT_XIL: ParportReadStatus(); b = (par_status & PARPORT_STATUS_SELECT); break; case PAT_DM04: ParportReadStatus(); b = (par_status & DM04_DIN); break; case PAT_DASA: case PAT_DASA2: case PAT_DASA3: #ifdef TIOCMGET SerialReadCtrl(); #ifdef DEBUG1 printf("%c",(ser_ctrl & TIOCM_CTS)?'I':'i'); #endif b = (ser_ctrl & TIOCM_CTS); #endif /* TIOCMGET */ break; } if (miso_invert) b = !b; return b; } void TDAPA::Init() { /* data=1, reset=0, sck=0 */ switch (pa_type) { case PAT_DAPA: par_ctrl = DAPA_SCK; par_data = 0xFF; break; case PAT_STK200: par_ctrl = 0; par_data = 0xFF & ~(STK2_ENA1 | STK2_SCK); break; case PAT_ABB: par_ctrl = ABB_EN; par_data = 0xFF & ~ABB_SCK; break; case PAT_ATDH: par_ctrl = 0; par_data = 0xFF; break; case PAT_PARAVRISP: par_ctrl = 0; par_data = 0xFF & ~(AISP_ENA | AISP_SCK); break; case PAT_BSD: par_ctrl = 0; par_data = BSD_POWER | BSD_RESET; break; case PAT_FBPRG: par_ctrl = 0; par_data = FBPRG_POW | FBPRG_RESET; break; case PAT_ETT: par_ctrl = ETT_DOUT; par_data = ETT_SCK | ETT_RESET; mosi_invert = 1; break; case PAT_DT006: case PAT_MAXI: par_ctrl = 0; par_data = 0xFF; break; case PAT_XIL: par_ctrl = 0; par_data = 0xFF & ~(XIL_ENA | XIL_SCK | XIL_RESET); break; case PAT_DM04: par_ctrl = DM04_SCK; par_data = 0xFF; printf("Press and hold RESET\n"); ParportReadStatus(); /* Wait 30 seconds for the reset button to be pressed. */ for (int timeout=3000; (par_status & DM04_RESET) && timeout > 0; timeout--) { ParportReadStatus(); usleep(10000); } break; case PAT_DASA: case PAT_DASA2: case PAT_DASA3: break; } if (!pa_type_is_serial) { ParportWriteCtrl(); ParportWriteData(); SckDelay(); ParportReadStatus(); } OutEnaReset(1); OutReset(0); OutEnaSck(1); OutSck(0); /* Wait 100 ms as recommended for ATmega163 (SCK not low on power up). */ Delay_usec(100000); PulseReset(); } int TDAPA::SendRecv(int b) { unsigned int mask, received=0; Info(4, "Sending: %d \n", b); for (mask = 0x80; mask; mask >>= 1) { OutData(b & mask); SckDelay(); /* MM 20020613: we used to read the bit here, but ... */ OutSck(1); SckDelay(); /* ... here we have more room for propagation delays (almost the whole SCK period, instead of half of it) - good for long cables, slow RS232 drivers/receivers, opto-isolated interfaces, etc. */ if (InData()) received |= mask; OutSck(0); } Info(4, "Received: %d \n", received); return received; } int TDAPA::Send (unsigned char* queue, int queueSize, int rec_queueSize) { unsigned char *p = queue, ch; int i = queueSize; if (rec_queueSize==-1){rec_queueSize = queueSize;} #ifdef DEBUG printf ("send(recv): "); #endif while (i--){ #ifdef DEBUG printf ("%02X(", (unsigned int)*p); #endif ch = SendRecv(*p); #ifdef DEBUG printf ("%02X) ", (unsigned int)ch); #endif *p++ = ch; } #ifdef DEBUG printf ("\n"); #endif return queueSize; } TDAPA::TDAPA(): parport_base(0x378), ppdev_fd(-1) { const char *val; /* If the user doesn't specify -dlpt option, use /dev/parport0 as the default instead of defaulting to using ioperm (ick!). If the user wants to run uisp as root (or setuid root) they should know what they are doing and can suffer the consequences. Joe user should not be told about ioperm failure due to permission denied. */ const char *ppdev_name = "/dev/parport0"; sck_invert = 0; mosi_invert = 0; miso_invert = 0; reset_invert = 0; at89 = 0; if (GetCmdParam("-d89",false)) { reset_invert = 1; at89 = 1; } /* Enable Parallel Port */ val = GetCmdParam("-dprog"); if (val && strcmp(val, "dapa") == 0) pa_type = PAT_DAPA; else if (val && strcmp(val, "stk200") == 0) pa_type = PAT_STK200; else if (val && strcmp(val, "abb") == 0) pa_type = PAT_ABB; else if (val && strcmp(val, "atdh") == 0) { pa_type = PAT_ATDH; // The ATDH RESET pin is hardware inverted reset_invert = !reset_invert; } else if (val && strcmp(val, "paravrisp") == 0) pa_type = PAT_PARAVRISP; else if (val && strcmp(val, "bsd") == 0) pa_type = PAT_BSD; else if (val && strcmp(val, "fbprg") == 0) pa_type = PAT_FBPRG; else if (val && strcmp(val, "dt006") == 0) pa_type = PAT_DT006; else if (val && strcmp(val, "ett") == 0) pa_type = PAT_ETT; else if (val && strcmp(val, "maxi") == 0) pa_type = PAT_MAXI; else if (val && strcmp(val, "xil") == 0) pa_type = PAT_XIL; else if (val && strcmp(val, "dasa") == 0) pa_type = PAT_DASA; else if (val && strcmp(val, "dasa2") == 0) pa_type = PAT_DASA2; else if (val && strcmp(val, "dasa3") == 0) pa_type = PAT_DASA3; else if (val && strcmp(val, "dm04") == 0) pa_type = PAT_DM04; else { throw Error_Device("Direct Parallel Access not defined."); } pa_type_is_serial = (pa_type == PAT_DASA || pa_type == PAT_DASA2 || pa_type == PAT_DASA3); /* Parse Command Line Switches */ #ifndef NO_DIRECT_IO if ((val = GetCmdParam("-dlpt")) != NULL) { if (!strcmp(val, "1")) { parport_base = 0x378; ppdev_name = NULL; } else if (!strcmp(val, "2")) { parport_base = 0x278; ppdev_name = NULL; } else if (!strcmp(val, "3")) { parport_base = 0x3bc; ppdev_name = NULL; } else if (*val != '/') { parport_base = strtol(val, NULL, 0); ppdev_name = NULL; } else { ppdev_name = val; } } else if ((val = GetCmdParam("-dserial")) != NULL) { ppdev_name = val; } if (!ppdev_name && !pa_type_is_serial) { if (parport_base!=0x278 && parport_base!=0x378 && parport_base!=0x3bc) { /* TODO: option to override this if you really know what you're doing (only if running as root). */ throw Error_Device("Bad device address."); } if (ioport_enable(IOBASE, IOSIZE) != 0) { perror("ioperm"); throw Error_Device("Failed to get direct I/O port access."); } } #endif /* Drop privileges (if installed setuid root - NOT RECOMMENDED). */ setgid(getgid()); setuid(getuid()); #ifdef NO_DIRECT_IO if ((val = GetCmdParam("-dlpt")) != NULL) { ppdev_name = val; } else if ((val = GetCmdParam("-dserial")) != NULL) { ppdev_name = val; } #endif if (ppdev_name) { if (pa_type_is_serial) { ppdev_fd = open(ppdev_name, O_RDWR | O_NOCTTY | O_NONBLOCK); if (ppdev_fd != -1) { struct termios pmode; tcgetattr(ppdev_fd, &pmode); saved_modes = pmode; cfmakeraw(&pmode); pmode.c_iflag &= ~(INPCK | IXOFF | IXON); pmode.c_cflag &= ~(HUPCL | CSTOPB | CRTSCTS); pmode.c_cflag |= (CLOCAL | CREAD); pmode.c_cc [VMIN] = 1; pmode.c_cc [VTIME] = 0; tcsetattr(ppdev_fd, TCSANOW, &pmode); /* Clear O_NONBLOCK flag. */ int flags = fcntl(ppdev_fd, F_GETFL, 0); if (flags == -1) { throw Error_C("Can not get flags"); } flags &= ~O_NONBLOCK; if (fcntl(ppdev_fd, F_SETFL, flags) == -1) { throw Error_C("Can not clear nonblock flag"); } } } else { ppdev_fd = open(ppdev_name, O_RDWR, 0); } if (ppdev_fd == -1) { perror(ppdev_name); throw Error_Device("Failed to open ppdev."); } if (!pa_type_is_serial && par_claim(ppdev_fd) != 0) { perror("ioctl PPCLAIM"); close(ppdev_fd); ppdev_fd = -1; throw Error_Device("Failed to claim ppdev."); } } t_sck = SCK_DELAY; if (pa_type_is_serial) t_sck *= 3; /* more delay for slow RS232 drivers */ val = GetCmdParam("-dt_sck"); if (val) t_sck = strtol(val, NULL, 0); if ((val=GetCmdParam("-dinvert"))) { #define MAXLINESIZE 256 char temp[MAXLINESIZE]; char * p; strncpy(temp, val, MAXLINESIZE-1); temp[MAXLINESIZE-1] = '\0'; for (p=temp; *p; p++) *p=toupper(*p); Info(3, "Inverting %s\n",temp); if (strstr(temp,"SCK")) sck_invert=!sck_invert; if (strstr(temp,"MOSI")) mosi_invert=!mosi_invert; if (strstr(temp,"MISO")) miso_invert=!miso_invert; if (strstr(temp,"RESET")) reset_invert=!reset_invert; } reset_high_time = RESET_HIGH_TIME; if ((val=GetCmdParam("-dt_reset"))) { reset_high_time = atoi(val); } Info(3, "Reset inactive time (t_reset) %d us\n", reset_high_time); Init(); } TDAPA::~TDAPA() { OutData(1); SckDelay(); OutSck(1); SckDelay(); OutEnaSck(0); OutReset(1); OutEnaReset(0); if (ppdev_fd != -1) { if (pa_type_is_serial) tcsetattr(ppdev_fd, TCSADRAIN, &saved_modes); else par_release(ppdev_fd); close(ppdev_fd); ppdev_fd = -1; } else (void) ioport_disable(IOBASE, IOSIZE); } #endif /* eof */ uisp-20050207/src/DAPA.h0000644000175100017510000000507410133511074011324 00000000000000/* * $Id: DAPA.h,v 1.9 2004/10/14 14:50:36 marga Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Uros Platise * * 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 * **************************************************************************** */ /* DAPA.h Direct AVR Parallel Access (c) copyright 1997, Uros Platise */ #ifndef __DAPA #define __DAPA #include #include #include #include #include #include "Error.h" class TDAPA { public: enum TPaType{ PAT_DAPA, PAT_STK200, PAT_ABB, PAT_ATDH, PAT_PARAVRISP, PAT_BSD, PAT_FBPRG, PAT_DT006, PAT_ETT, PAT_MAXI, PAT_XIL, PAT_DASA, PAT_DASA2, PAT_DASA3, PAT_DM04 }; private: int mosi_invert; int miso_invert; int sck_invert; int reset_invert; int reset_high_time; int parport_base; int ppdev_fd; long t_sck; TPaType pa_type; bool pa_type_is_serial; /* not ppdev/ppi */ struct termios saved_modes; unsigned char par_data, par_ctrl; /* write */ unsigned char par_status; /* read */ unsigned int ser_ctrl; /* TIOCMGET/TIOCMSET */ protected: int at89; private: int SendRecv(int); /* low level access to parallel port lines */ void OutReset(int); void OutSck(int); void OutData(int); void SckDelay(); int InData(); void OutEnaReset(int); void OutEnaSck(int); void ParportSetDir(int); void ParportWriteCtrl(); void ParportWriteData(); void ParportReadStatus(); void SerialReadCtrl(); void SerialWriteCtrl(); public: /* If enable command 0x53 did not echo back, give a positive SCK pulse and retry again. */ void PulseSck(); void PulseReset(); void Init(); int Send(unsigned char*, int, int rec_queueSize=-1); void Delay_usec(long); TDAPA(); ~TDAPA(); }; #endif uisp-20050207/src/Error.h0000644000175100017510000000401307660271145011715 00000000000000/* * $Id: Error.h,v 1.3 2003/05/13 22:32:05 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Uros Platise * * 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 * **************************************************************************** */ /* ** Error.h ** Uros Platise, (c) 1997, November */ #ifndef __Error #define __Error #include /* This error class is used to express standard C errors. */ class Error_C { public: Error_C (const char* _arg) : arg(_arg) { } void print (void) { if (arg != NULL) { printf (" -> %s\n", arg); } } private: const char *arg; }; /* Out of memory error class informs terminal or upload/download tools that it has gone out of valid memory - and that's all. Program should not terminate. */ class Error_MemoryRange {}; /* General internal error reporting class that normally force uisp to exit after proper destruction of all objects. */ class Error_Device { public: Error_Device (const char *_errMsg, const char *_arg=NULL) : errMsg(_errMsg), arg(_arg) { } void print () { if (arg==NULL) { printf ("%s\n", errMsg); } else { printf ("%s: %s\n", errMsg, arg); } } private: const char* errMsg; const char* arg; }; #endif uisp-20050207/src/Global.h0000644000175100017510000000774110132547416012032 00000000000000/* * $Id: Global.h,v 1.2 2004/10/11 18:21:02 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ /* Global.h, Uros Platise (c) 1999 */ #ifndef __GLOBAL #define __GLOBAL #include #include typedef unsigned char TByte; typedef unsigned TAddr; /* Smart Pointer Class */ template class TPt{ private: TRec* Addr; void MkRef(){if (Addr!=NULL){Addr->CRef++;}} void UnRef(){if (Addr!=NULL){Addr->CRef--;if (Addr->CRef==0){delete Addr;}}} public: TPt():Addr(NULL){} TPt(TRec* _Addr): Addr(_Addr){MkRef();} TPt(const TPt& Pt): Addr(Pt.Addr){MkRef();} ~TPt(){UnRef();} TPt& operator=(const TPt& Pt){ if (this!=&Pt){UnRef(); Addr=Pt.Addr; MkRef();} return *this;} TPt& operator=(TRec* _Addr){ if (Addr!=_Addr){UnRef();Addr=_Addr;MkRef();} return *this;} bool operator==(const TPt& Pt) const {return Addr==Pt.Addr;} TRec* operator->() const {assert(Addr!=NULL); return Addr;} TRec& operator*() const {assert(Addr!=NULL); return *Addr;} TRec& operator[](int RecN) const {assert(Addr!=NULL); return Addr[RecN];} TRec* operator()() const {return Addr;} /* think once more! */ bool operator<(const TPt& Pt){return Addr < Pt.Addr;} }; class TDevice{ private: int CRef; public: /* Set active segment. Returns true if segment exists, otherwise false */ virtual bool SetSegment(const char* segment_name)=0; /* Returns char pointer of current active segment name. */ virtual const char* TellActiveSegment()=0; /* Returns char pointer of the indexed segment name. Index is in range [0,no_of_segments]. When index is out of range NULL is returned. */ virtual const char* ListSegment(unsigned index)=0; virtual TAddr GetSegmentSize()=0; /* Read byte from active segment at address addr. */ virtual TByte ReadByte(TAddr addr)=0; /* Read byte description at address addr (as security bits) */ virtual const char* ReadByteDescription(TAddr addr)=0; /* Write byte to active segment at address addr */ virtual void WriteByte(TAddr addr, TByte byte, bool flush_buffer=true)=0; virtual void FlushWriteBuffer(){} /* Chip Erase */ virtual void ChipErase()=0; /* lock bits */ virtual void WriteLockBits(TByte bits)=0; virtual TByte ReadLockBits(){return 0;} /* Transfer Statistics in Bytes/Seconds */ virtual unsigned int GetPollCount(){return 0;} virtual float GetMinPollTime(){return 0;} virtual float GetTotPollTime(){return 0;} virtual float GetMaxPollTime(){return 0;} virtual void ResetMinMax(){} TDevice():CRef(0){} virtual ~TDevice(){} friend class TPt; }; typedef TPt PDevice; extern PDevice device; /* Find command line parameter's value. It searches the command line parameters of the form: argv_name=value Returns pointer to the value. */ const char* GetCmdParam(const char* argv_name, bool value_required=true); /* Print Status Information to the Standard Error Output. */ bool Info(unsigned _verbose_level, const char* fmt, ...) __attribute__((format (printf, 2, 3))); #endif uisp-20050207/src/Main.C0000644000175100017510000003632310164270052011441 00000000000000/* * $Id: Main.C,v 1.25 2004/11/17 03:18:33 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Uros Platise * * 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 * **************************************************************************** */ /* Main.C Micro In-System Programmer Uros Platise (C) 1997-1999 */ #include "config.h" #include #include #include #include #include "Terminal.h" #include "MotIntl.h" #include "AvrAtmel.h" #include "Stk500.h" #ifndef NO_DAPA # include "AvrDummy.h" #endif /* Globals */ int argc; const char** argv; char* argv_ok; unsigned verbose_level; PDevice device; TMotIntl motintl; TTerminal terminal; const char* version = "uisp version %s\n" "(C) 1997-1999 Uros Platise, 2000-2003 Marek Michalkiewicz\n" "\nuisp is free software, covered by the GNU General Public License.\n" "You are welcome to change it and/or distribute copies of it under\n" "the conditions of the GNU General Public License.\n\n"; const char* help_screen = "Syntax: uisp [-v{=level}] [-h] [--help] [--version] [--hash=perbytes]\n" " [-dprog=avr910|pavr|stk500]" #ifndef NO_DAPA " [-dprog=type]\n" " [-dlpt=address|/dev/parportX] [-dno-poll] [-dno-retry]\n" " [-dvoltage=...] [-dt_sck=time] [-dt_wd_{flash|eeprom}=time]\n" " [-dt_reset=time] [-dinvert=sck,mosi,miso,reset]" #endif "\n" " [-dserial=device] [-dpart=name|no]\n" " [-dspeed=1200|2400|4800|9600|19200|38400|57600|115200]" "\n" " [--upload] [--verify] [--erase] [if=input_file]\n" " [--download] [--size=bytes] [of=output_file]\n" " [--segment=flash|eeprom|fuse] [--terminal]\n" " [--rd_fuses] [--wr_fuse_l=byte] [--wr_fuse_h=byte]\n" " [--wr_fuse_e=byte] [--wr_lock=byte]\n\n" "Programming Methods:\n" " -dprog=avr910 Standard Atmel Serial Programmer/Atmel Low Cost Programmer\n" " pavr http://www.avr1.org/pavr/pavr.html\n" " stk500 Atmel STK500\n" " avrisp Atmel AVRISP (uses stk500 protocol, but can only perform\n" " serial programming using SPI)\n" #ifndef NO_DAPA " -dprog=dapa|stk200|abb|atdh|avrisp|bsd|fbprg|dt006|maxi|xil|dasa|dasa2|dasa3\n" " Programmer type:\n" " dapa Direct AVR Parallel Access\n" " stk200 Parallel Starter Kit STK200, STK300\n" " abb Altera ByteBlasterMV Parallel Port Download Cable\n" " atdh Atmel-ISP Download Cable \n" " paravrisp [Unknown origin] Parallel port programmer\n" " bsd http://www.bsdhome.com/avrdude/ (parallel)\n" " fbprg http://ln.com.ua/~real/avreal/adapters.html (parallel)\n" " dt006 http://www.dontronics.com/dt006.html (parallel)\n" " maxi Investment Technologies Maxi (parallel)\n" " xil Xilinx HW-JTAG-PC Cable (parallel)\n" " ett ETT AVR Programmer V2.0 [from Futurlec] (parallel)\n" " dm04 Datamekatronik 2004 (parallel)\n" " dasa serial (RESET=RTS SCK=DTR MOSI=TXD MISO=CTS)\n" " dasa2 serial (RESET=!TXD SCK=RTS MOSI=DTR MISO=CTS)\n" " dasa3 serial (RESET=!DTR SCK=RTS MOSI=TXD MISO=CTS)\n" "\n" "Target Device Selection:\n" " -dpart Set target abbreviated name or number. For some programmers, if\n" " -dpart is not given programmer's supported devices are listed.\n" " Set -dpart=auto for auto-select. Auto-select does not work with\n" " all programmers, so it is recommended to always specify a target\n" " device explicitly.\n" "\n" "Parallel Device Settings:\n" " -dlpt= specify device name (Linux ppdev, FreeBSD ppi, serial)\n" #ifndef NO_DIRECT_IO " or direct I/O parallel port address (0x378, 0x278, 0x3BC)\n" #endif " -dno-poll Program without data polling (a little slower)\n" " -dno-retry Disable retries of program enable command\n" " -dvoltage Set timing specs according to the power supply voltage in [V]\n" " (default 3.0)\n" " -dt_sck Set minimum SCK high/low time in micro-seconds (default 5)\n" " -dt_wd_flash Set FLASH maximum write delay time in micro-seconds\n" " -dt_wd_eeprom Set EEPROM maximum write delay time in micro-seconds\n" " -dt_reset Set reset inactive (high) time in micro-seconds\n" " -dinvert=... Invert specified lines\n" " Use -v=3 option to see current settings.\n" " -d89 Allow parallel programming of AT89S51 and AT89S52 devices.\n" #endif "\n" "Atmel Low Cost Programmer Serial Device Settings:\n" " -dserial Set serial interface as /dev/ttyS* (default /dev/avr)\n" " -dspeed Set speed of the serial interface (default 19200)\n" "\n" "Stk500 specific options:\n" " -dhiv Use Hi-Voltage programming instead of SPI (default is SPI)\n" " --rd_aref Read the ARef Voltage. Note that due to a bug in the\n" " stk500 firmware, the read value is sometimes off by 0.1\n" " from the actual value measured with a volt meter.\n" " --wr_aref Set the ARef Voltage. Valid values are 0.0 to 6.0 volts in\n" " 0.1 volt increments. Value can not be larger than the\n" " VTarget value.\n" " --rd_vtg Read the Vtarget Voltage. Note that due to a bug in the\n" " stk500 firmware, the read value is sometimes off by 0.1\n" " from the actual value measured with a volt meter.\n" " --wr_vtg Set the VTarget Voltage. Valid values are 0.0 to 6.0 volts in\n" " 0.1 volt increments. Value can not be smaller than the\n" " ARef value.\n" " --rd_osc Read the oscillator frequency in Hertz.\n" " --wr_osc Set the oscillator frequency in Hertz, from 14.06 to 3686400.\n" "\n" "Functions:\n" " --upload Upload \"input_file\" to the AVR memory.\n" " --verify Verify \"input_file\" (processed after the --upload opt.)\n" " --download Download AVR memory to \"output_file\" or stdout.\n" " --erase Erase device.\n" " --segment Set active segment (auto-select for AVA Motorola output)\n" " --size Set segment size for download (default entire segment)\n" "\n" "Fuse/Lock Bit Operations:\n" " --rd_fuses Read all fuses and print values to stdout\n" " --wr_fuse_l Write fuse low byte\n" " --wr_fuse_h Write fuse high byte\n" " --wr_fuse_e Write fuse extended byte\n" " --wr_lock Write lock bits. Argument is a byte where each bit is:\n" " Bit5 -> blb12\n" " Bit4 -> blb11\n" " Bit3 -> blb02\n" " Bit2 -> blb01\n" " Bit1 -> lb2\n" " Bit0 -> lb1\n" " --lock Write lock bits [old method; deprecated].\n" "\n" "Files:\n" " if Input file for the --upload and --verify functions in\n" " Motorola S-records (S1 or S2) or 16 bit Intel format\n" " of Output file for the --download function in\n" " Motorola S-records format, default is standard output\n" "\n" "Other Options:\n" " -v Set verbose level (-v equals -v=2, min/max: 0/4, default 1)\n" " --hash Print hash (default is 32 bytes)\n" " --help -h Help\n" " --version Print version information\n" " --terminal Invoke shell-like terminal\n" "\n" "Report bugs to: Maintainers \n" "Updates: http://savannah.nongnu.org/projects/uisp\n"; /* Find command line parameter's value. It searches the command line parameters of the form: argv_name=value Returns pointer to the value. */ const char* GetCmdParam(const char* argv_name, bool value_required) { int argv_name_len = strlen(argv_name); for (int i=1; i verbose_level){return false;} va_list ap; va_start(ap,fmt); vfprintf(stderr,fmt,ap); va_end(ap); return true; } int main(int _argc, const char* _argv[]){ int return_val=0; argc = _argc; argv = _argv; verbose_level=1; if (argc==1){ Info(0, "%s: No commands specified. " "Try '%s --help' for list of commands.\n", argv[0], argv[0]); exit(1); } argv_ok = (char *)malloc(argc); for (int i=1; iSetSegment(val)){ Info(0, "--segment=%s: bad segment name\n", val); } } /* Device Operations: */ if (GetCmdParam("--download", false)) { motintl.Write(GetCmdParam("of")); } if (GetCmdParam("--erase", false)){device->ChipErase();} /* Input file */ if ((val=GetCmdParam("if"))) { if (GetCmdParam("--upload", false)){motintl.Read(val, true, false);} if (GetCmdParam("--verify", false)){motintl.Read(val, false, true);} } if (GetCmdParam("--rd_fuses",false)) { TByte bits; const char *old_seg = device->TellActiveSegment(); device->SetSegment("fuse"); printf("\n"); printf("Fuse Low Byte = 0x%02x\n", device->ReadByte(AVR_FUSE_LOW_ADDR)); printf("Fuse High Byte = 0x%02x\n", device->ReadByte(AVR_FUSE_HIGH_ADDR)); printf("Fuse Extended Byte = 0x%02x\n", device->ReadByte(AVR_FUSE_EXT_ADDR)); printf("Calibration Byte = 0x%02x -- Read Only\n", device->ReadByte(AVR_CAL_ADDR)); bits = device->ReadByte(AVR_LOCK_ADDR); printf("Lock Bits = 0x%02x\n", bits); printf(" BLB12 -> %d\n", ((bits & BLB12) == BLB12)); printf(" BLB11 -> %d\n", ((bits & BLB11) == BLB11)); printf(" BLB02 -> %d\n", ((bits & BLB02) == BLB02)); printf(" BLB01 -> %d\n", ((bits & BLB01) == BLB01)); printf(" LB2 -> %d\n", ((bits & LB2) == LB2)); printf(" LB1 -> %d\n", ((bits & LB1) == LB1)); printf("\n"); device->SetSegment(old_seg); } if ((val=GetCmdParam("--wr_fuse_l")) != NULL) { unsigned int bits; const char *old_seg = device->TellActiveSegment(); device->SetSegment("fuse"); if (sscanf(val, "%x", &bits) == 1) { device->WriteByte( AVR_FUSE_LOW_ADDR, (TByte)bits ); printf("\nFuse Low Byte set to 0x%02x\n", (TByte)bits); } else throw Error_Device("Invalid argument for --wr_fuse_l."); device->SetSegment(old_seg); } if ((val=GetCmdParam("--wr_fuse_h")) != NULL) { unsigned int bits; const char *old_seg = device->TellActiveSegment(); device->SetSegment("fuse"); if (sscanf(val, "%x", &bits) == 1) { device->WriteByte( AVR_FUSE_HIGH_ADDR, (TByte)bits ); printf("\nFuse High Byte set to 0x%02x\n", (TByte)bits); } else throw Error_Device("Invalid argument for --wr_fuse_h."); device->SetSegment(old_seg); } if ((val=GetCmdParam("--wr_fuse_e")) != NULL) { unsigned int bits; const char *old_seg = device->TellActiveSegment(); device->SetSegment("fuse"); if (sscanf(val, "%x", &bits) == 1) { device->WriteByte( AVR_FUSE_EXT_ADDR, (TByte)bits ); printf("\nFuse Extended Byte set to 0x%02x\n", (TByte)bits); } else throw Error_Device("Invalid argument for --wr_fuse_e."); device->SetSegment(old_seg); } if ((val=GetCmdParam("--wr_lock")) != NULL) { unsigned int bits; if (sscanf(val, "%x", &bits) == 1) { device->WriteLockBits( (TByte)bits ); printf("\nLock Bits set to 0x%02x\n", (TByte)bits); } else throw Error_Device("Invalid argument for --wr_lock."); } if (GetCmdParam("--lock", false)) { Info(0, "NOTE: '--lock' is deprecated. Used '--wr_lock' instead.\n"); device->WriteLockBits(0xFC); printf("\nLock Bits set to 0x%02x\n", 0xfc); } /* enter terminal */ if (GetCmdParam("--terminal", false)){terminal.Run();} /* Check bad command line parameters */ for (int i=1; i #include #include #include #include "timeradd.h" #include "Global.h" #include "Error.h" #include "MotIntl.h" TByte TMotIntl::Htoi(const char* p){ unsigned char val = 0; if (*p>='0' && *p<='9') val += *p-'0'; else if (*p>='A' && *p<='F') val += *p-'A'+10; else if (*p>='a' && *p<='f') val += *p-'a'+10; else throw Error_Device("Bad file format."); val <<= 4; p++; if (*p>='0' && *p<='9') val += *p-'0'; else if (*p>='A' && *p<='F') val += *p-'A'+10; else if (*p>='a' && *p<='f') val += *p-'a'+10; else throw Error_Device("Bad file format."); cc_sum += val; return val; } void TMotIntl::InfoOperation(const char* prefix, const char* seg_name){ Info(1, "%s", prefix); if (!upload && !verify) { Info(1, "Downloading"); } if (upload){Info(1, "Uploading");} if (upload && verify){Info(1, "/");} if (verify){Info(1, "Verifying");} Info(1, ": %s\n", seg_name); } void TMotIntl::ReportStats(float elapsed, TAddr total_bytes) { float rate = (float)total_bytes / elapsed; Info(2, "\n(total %u bytes transferred in %.2f s (%.0f bytes/s)\n", total_bytes, elapsed, rate); if (upload) { unsigned int total_polled = device->GetPollCount(); if (total_polled) { float min_poll_time = device->GetMinPollTime() * 1000.0; float max_poll_time = device->GetMaxPollTime() * 1000.0; float avg_poll_time = device->GetTotPollTime() * (1000.0 / total_polled); Info(2, "Polling: count = %u, min/avg/max = %.2f/%.2f/%.2f ms\n", total_polled, min_poll_time, avg_poll_time, max_poll_time); } } } void TMotIntl::UploadMotorola(){ unsigned char srec_len, buf_len, srec_cc_sum; char seg_name[256]; /* data field length is a byte, so this is safe */ char* p; /* line buffer pointer */ TAddr addr; TAddr total_bytes_uploaded=0; TAddr hash_cnt=0; TByte byte; struct timeval t1, t2; device->ResetMinMax(); do{ /* convert to upper case */ buf_len = strlen(line_buf); for (int i=0;i MI_LINEBUF_SIZE) throw ("Bad Motorola file format."); /* Load address */ addr = Htoi(p); p+=2; addr <<= 8; addr += Htoi(p); p+=2; switch(line_buf[1]){ case '0':{ /* Load segment name */ int i; for (i=0;iSetSegment(seg_name)){InfoOperation("Auto-", seg_name);} else{InfoOperation("", device->TellActiveSegment());} /* Print first hash */ if (device->GetSegmentSize() >= 16) Info(2, "#"); hash_cnt=0; /* Set statistic variables */ total_bytes_uploaded = 0; gettimeofday(&t1, NULL); } break; /* 4 byte address */ case '3': addr <<= 8; addr += Htoi(p); p+=2; srec_len--; /* Note that we fall through. */ /* 3 byte address */ case '2': addr <<= 8; addr += Htoi(p); p+=2; srec_len--; /* Note that we fall through. */ /* 2 byte address */ case '1':{ /* Upload/Verify bytes */ total_bytes_uploaded += srec_len; while(srec_len-->0){ byte = Htoi(p); if (upload){device->WriteByte(addr, byte, false);} if (verify){ TByte rbyte = device->ReadByte(addr); if (rbyte != byte){ Info(0, "%s error at address 0x%x: file=0x%02x, mem=0x%02x\n", device->TellActiveSegment(), addr, (int) byte, (int) rbyte); } } p+=2; addr++; if (total_bytes_uploaded >= hash_cnt+hash_marker){ Info(2, "#"); hash_cnt+=hash_marker; } } } break; case '7': case '8': case '9':{ if (upload){device->FlushWriteBuffer();} gettimeofday(&t2, NULL); timersub(&t2, &t1, &t2); float elapsed = t2.tv_sec + t2.tv_usec*1e-6; ReportStats(elapsed, total_bytes_uploaded); /* verify check sum */ for (int i=0;iTellActiveSegment()); /* Print first hash */ if (device->GetSegmentSize() >= 16) Info(2, "#"); /* Set statistic variables */ total_bytes_uploaded = 0; gettimeofday(&t1, NULL); device->ResetMinMax(); do{ /* convert to upper case */ buf_len = strlen(line_buf); for (int i=0;i MI_LINEBUF_SIZE) throw ("Bad Intel file format."); /* Load address */ addr = Htoi(p); p+=2; addr <<= 8; addr += Htoi(p); p+=2; rec_type = Htoi(p); p+=2; /* read control byte: 00-data, 01-end, 02-seg_offset */ addr += seg_offset; /* this allows access to more than 64K */ switch(rec_type) { case 0x00:{ /* Upload/Verify bytes */ total_bytes_uploaded += ihex_len; while(ihex_len-->0){ byte = Htoi(p); if (upload){device->WriteByte(addr, byte, false);} if (verify){ TByte rbyte = device->ReadByte(addr); if (rbyte != byte){ Info(0, "%s error at address 0x%x: file=0x%02x, mem=0x%02x\n", device->TellActiveSegment(), addr, (int) byte, (int) rbyte); } } p+=2; addr++; if (total_bytes_uploaded >= hash_cnt+hash_marker){ Info(2, "#"); hash_cnt+=hash_marker; } } } break; case 0x01: /* end */ case 0x03: /* start address record */ case 0x05: /* start linear address record */ /* don't need to do anything, except calculate the checksum */ while (ihex_len-- > 0) { byte = Htoi(p); p += 2; } break; case 0x02:{ seg_offset = Htoi(p); p+=2; seg_offset <<=8; seg_offset += Htoi(p); p+=2; /* seg_offset is bits 4-19 of addr, so shift to that. */ seg_offset <<=4; } break; case 0x04: /* extended linear address record */ seg_offset = Htoi(p); p += 2; seg_offset <<= 8; seg_offset += Htoi(p); p += 2; seg_offset <<= 16; break; default: throw Error_Device("Bad Intel Hex record.\n"); } /* Read Check Sum and give a report */ ihex_cc_sum = Htoi(p); if (cc_sum != 0x0){ Info(2, "Intel check sum: %d uisp check sum: %d\n", (unsigned)ihex_cc_sum, (unsigned)cc_sum); throw Error_Device("Check sum error.\n"); } } while(fgets(line_buf, MI_LINEBUF_SIZE, fd)!=NULL); if (upload){device->FlushWriteBuffer();} /* Print transfer statistics */ gettimeofday(&t2, NULL); timersub(&t2, &t1, &t2); float elapsed = t2.tv_sec + t2.tv_usec*1e-6; ReportStats(elapsed, total_bytes_uploaded); } void TMotIntl::Read(const char* filename, bool _upload, bool _verify){ upload = _upload; verify = _verify; if ((fd=fopen(filename,"rt"))==NULL){ throw Error_C(filename); } /* Set-up Hash Marker */ const char* val = GetCmdParam("--hash"); if (val!=NULL){hash_marker = atoi(val);} /* auto-detect Motorola or Intel file format */ fgets(line_buf, MI_LINEBUF_SIZE, fd); if (strncasecmp(line_buf, "S0", 2)==0){UploadMotorola();} else if (line_buf[0]==':'){UploadIntel();} else {throw Error_Device("Unknown file format.");} fclose(fd); } void TMotIntl::SrecWrite(unsigned int type, const unsigned char *buf, unsigned int len) { unsigned i, sum; fprintf(fd, "S%01X%02X", type, len + 1); sum = len + 1; for (i = 0; i < len; i++) { sum += buf[i]; fprintf(fd, "%02X", (unsigned int) buf[i]); } fprintf(fd, "%02X\r\n", (unsigned int)(~sum & 0xFF)); } void TMotIntl::DownloadMotorola(int max_size) { /* A short description of S-Records may be found at http://www.ndsu.nodak.edu/instruct/tareski/373f98/notes/srecord.htm */ TAddr addr, size; TAddr total_bytes_uploaded=0; TAddr hash_cnt=0; struct timeval t1, t2; unsigned char buf[40]; const char *seg; int s5count=0; seg = device->TellActiveSegment(); InfoOperation("", seg); /* Set statistic variables */ total_bytes_uploaded = 0; gettimeofday(&t1, NULL); device->ResetMinMax(); size = device->GetSegmentSize(); if (max_size && size > (TAddr)max_size) { Info(2, "size=0x%x, was 0x%x\n", max_size, size); size = (TAddr)max_size; } /* Print first hash (except for fuse bits) */ if (size >= 16) Info(2, "#"); buf[0] = 0; buf[1] = 0; strncpy((char *) buf+2, seg, 16); buf[18] = 0; SrecWrite(0, buf, 2 + strlen((const char *) buf + 2)); for (addr = 0; addr < size; addr += 16) { int i, len; len = size - addr; if (len > 16) len = 16; buf[0] = (addr >> 24) & 0xFF; buf[1] = (addr >> 16) & 0xFF; buf[2] = (addr >> 8) & 0xFF; buf[3] = addr & 0xFF; for (i = 0; i < len; i++) { TByte rbyte = device->ReadByte(addr + i); buf[4 + i] = rbyte; total_bytes_uploaded++; if (total_bytes_uploaded >= hash_cnt + hash_marker) { Info(2, "#"); hash_cnt += hash_marker; } } if (addr < 0x10000) SrecWrite(1, buf + 2, 2 + len); else if (addr < 0x1000000) SrecWrite(2, buf + 1, 3 + len); else SrecWrite(3, buf , 4 + len); s5count++; } /* number of S1/2/3 records written */ buf[0] = (s5count >> 8) & 0xFF; buf[1] = s5count & 0xFF; SrecWrite(5, buf, 2 ); /* starting address is 0 */ buf[0] = 0; buf[1] = 0; buf[2] = 0; buf[3] = 0; if (addr < 0x10000) SrecWrite(9, buf+2, 2 ); else if (addr < 0x1000000) SrecWrite(8, buf+1, 3); else SrecWrite(7, buf, 4); /* Print transfer statistics */ gettimeofday(&t2, NULL); timersub(&t2, &t1, &t2); float elapsed = t2.tv_sec + t2.tv_usec*1e-6; ReportStats(elapsed, total_bytes_uploaded); } void TMotIntl::Write(const char *filename) { int size_value = 0; const char *val = GetCmdParam("--size"); if (val!=NULL){size_value = atoi(val);} if (filename) { fd = fopen(filename, "wb"); if (!fd) { throw Error_C(filename); } const char* val = GetCmdParam("--hash"); if (val!=NULL){hash_marker = atoi(val);} DownloadMotorola(size_value); fclose(fd); } else { fd = stdout; DownloadMotorola(size_value); } } TMotIntl::TMotIntl(): hash_marker(32){ } uisp-20050207/src/MotIntl.h0000644000175100017510000000360210164270052012202 00000000000000/* * $Id: MotIntl.h,v 1.2 2004/11/17 03:18:33 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ /* MotIntl.h Motorola and Intel Uploading/Downloading Routines Uros Platise (c) 1999 */ #ifndef __MOTINTL #define __MOTINTL #include #include "Global.h" #define MI_LINEBUF_SIZE 128 class TMotIntl{ public: enum TFormatType{TF_MOTOROLA, TF_INTEL}; private: char line_buf [MI_LINEBUF_SIZE]; unsigned char cc_sum; unsigned int hash_marker; FILE* fd; bool upload, verify; TByte Htoi(const char* p); void InfoOperation(const char* prefix, const char* seg_name); void ReportStats(float, TAddr); void UploadMotorola(); void UploadIntel(); void SrecWrite(unsigned int, const unsigned char *, unsigned int); void DownloadMotorola(int); public: void Read(const char* filename, bool _upload, bool _verify); void Write(const char *filename); TMotIntl(); ~TMotIntl(){} }; extern TMotIntl motintl; #endif uisp-20050207/src/Serial.C0000644000175100017510000001143310005270307011764 00000000000000/* * $Id: Serial.C,v 1.8 2004/01/26 19:55:51 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Uros Platise * * 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 * **************************************************************************** */ /* Serial.C Serial Interface Uros Platise, (c) 1997-1999 */ #include "config.h" #include #include #include #include #include #include #include #include #include "Global.h" #include "Serial.h" int TSerial::Tx(unsigned char* queue, int queue_size) { Info(4, "Transmit: { "); for (int n=0; narg[0] != 0; speed_item++){ if (strcmp(speed_item->arg, val) == 0) { speed = speed_item->speed; break; } } if (speed_item->arg[0]==0){throw Error_Device("-dspeed: Invalid speed.");} } /* Open port and set serial attributes */ if ((serline = open(dev_name, O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0) { throw Error_C(dev_name); } tcgetattr(serline, &pmode); saved_modes = pmode; cfmakeraw(&pmode); pmode.c_iflag &= ~(INPCK | IXOFF | IXON); pmode.c_cflag &= ~(HUPCL | CSTOPB | CRTSCTS); pmode.c_cflag |= (CLOCAL | CREAD); pmode.c_cc [VMIN] = 1; pmode.c_cc [VTIME] = 0; cfsetispeed(&pmode, speed); cfsetospeed(&pmode, speed); tcsetattr(serline, TCSANOW, &pmode); #if 0 /* Reopen port */ int fd = serline; if ((serline = open(dev_name, O_RDWR | O_NOCTTY)) < 0){throw Error_C();} close(fd); #else /* Clear O_NONBLOCK flag. */ int flags = fcntl(serline, F_GETFL, 0); if (flags == -1) { throw Error_C("Can not get flags"); } flags &= ~O_NONBLOCK; if (fcntl(serline, F_SETFL, flags) == -1) { throw Error_C("Can not clear nonblock flag"); } #endif } TSerial::~TSerial(){ tcsetattr(serline, TCSADRAIN, &saved_modes); close(serline); } uisp-20050207/src/Serial.h0000644000175100017510000000334507565264671012064 00000000000000/* * $Id: Serial.h,v 1.3 2002/11/15 21:40:09 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ /* Serial.h RS232 Serial Interface for the standard Atmel Programmer Uros Platise(c) copyright 1997-1999 */ #ifndef __Serial #define __Serial #include #if defined(__CYGWIN__) #include "cygwinp.h" #endif #include #include #include #include #include "Global.h" #include "Error.h" class TSerial{ private: int serline; struct termios saved_modes; protected: int Tx(unsigned char* queue, int queue_size); int Rx(unsigned char* queue, int queue_size, timeval* timeout); public: int Send(unsigned char* queue, int queue_size, int rec_queue_size=-1, int timeout = 4); TSerial(); ~TSerial(); }; #endif uisp-20050207/src/Stk500.C0000644000175100017510000006346410164271623011556 00000000000000/* * $Id: Stk500.C,v 1.29 2004/12/28 14:54:11 marga Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 2001, 2002, 2003, 2004 Daniel Berntsson * * 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 * **************************************************************************** */ /* Stk500.C, Daniel Berntsson, 2001 */ #include #include "config.h" #include "Stk500.h" #include "Serial.h" int clockbase=3686400; int clockscale[]={0,1,8,32,64,128,256,1024}; /* from page 19 of STK500 docs */ const TByte TStk500::pSTK500[] = { 0x30, 0x20 }; const TByte TStk500::pSTK500_Reply[] = { 0x14, 0x10 }; const TByte TStk500::SWminor[] = { 0x41, 0x82, 0x20 }; const TByte TStk500::SWminor_Reply[] = { 0x14, 0x07, 0x10 }; const TByte TStk500::SWmajor[] = { 0x41, 0x81, 0x20 }; const TByte TStk500::SWmajor_Reply[] = {0x14, 0x01, 0x10 }; const TByte TStk500::EnterPgmMode[] = { 0x50, 0x20 }; const TByte TStk500::EnterPgmMode_Reply[] = { 0x14, 0x10 }; const TByte TStk500::LeavePgmMode[] = { 0x51, 0x20 }; const TByte TStk500::LeavePgmMode_Reply[] = { 0x14, 0x10 }; const TByte TStk500::SetAddress[] = { 0x55, '?', '?', 0x20 }; const TByte TStk500::SetAddress_Reply[] = { 0x14, 0x10 }; const TByte TStk500::EraseDevice[] = { 0x52, 0x20 }; const TByte TStk500::EraseDevice_Reply[] = { 0x14, 0x10 }; const TByte TStk500::WriteMemory[] = { 0x64, '?', '?', '?' }; const TByte TStk500::WriteMemory_Reply[] = { 0x14, 0x10 }; const TByte TStk500::ReadMemory[] = { 0x74, 0x01, 0x00, '?', 0x20 }; const TByte TStk500::ReadMemory_Reply[] = { 0x14 }; const TByte TStk500::GetSignature[] = {0x75, 0x20}; const TByte TStk500::GetSignature_Reply[] = {0x75, '?', '?', '?', 0x20}; const TByte TStk500::CmdStopByte[] = { 0x20 }; const TByte TStk500::ReplyStopByte[] = { 0x10 }; const TByte TStk500::Flash = 'F'; const TByte TStk500::EEPROM = 'E'; const TByte TStk500::DeviceParam_Reply[] = { 0x14, 0x10 }; const TByte TStk500::ExtDevParams_Reply[] = { 0x14, 0x10 }; /* FIXME: troth/2002-10-02: Get rid of all these magic numbers now that we know what they mean. (See REAME.stk500) */ TStk500::SPrgPart TStk500::prg_part[] = { {"AT90S4414", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x50, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x7f, 0x7f, 0x80, 0x7f, {0x00, 0x00}, {0x01, 0x00}, {0x00, 0x00, 0x10, 0x00}, 0x20} }, {"AT90S2313", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x40, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x7f, 0x7f, 0x80, 0x7f, {0x00, 0x00}, {0x00, 0x80}, {0x00, 0x00, 0x08, 0x00}, 0x20} }, {"AT90S1200", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x33, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, {0x00, 0x00}, {0x00, 0x40}, {0x00, 0x00, 0x04, 0x00}, 0x20} }, {"AT90S2323", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, {0x00, 0x00}, {0x00, 0x80}, {0x00, 0x00, 0x08, 0x00}, 0x20} }, {"AT90S2343", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x43, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, {0x00, 0x00}, {0x00, 0x80}, {0x00, 0x00, 0x08, 0x00}, 0x20} }, {"AT90S2333", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x42, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, {0x00, 0x00}, {0x00, 0x80}, {0x00, 0x00, 0x08, 0x00}, 0x20} }, {"AT90S4433", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x51, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, {0x00, 0x00}, {0x01, 0x00}, {0x00, 0x00, 0x10, 0x00}, 0x20} }, {"AT90S4434", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x52, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, {0x00, 0x00}, {0x01, 0x00}, {0x00, 0x00, 0x10, 0x00}, 0x20} }, {"AT90S8515", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x60, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x7f, 0x7f, 0x80, 0x7f, {0x00, 0x00}, {0x02, 0x00}, {0x00, 0x00, 0x20, 0x00}, 0x20} }, {"AT90S8535", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x61, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, {0x00, 0x00}, {0x02, 0x00}, {0x00, 0x00, 0x20, 0x00}, 0x20} }, {"AT90S8534", /* NOTE (20030216): experimental and untested */ {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x62, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, {0x00, 0x00}, {0x02, 0x00}, {0x00, 0x00, 0x20, 0x00}, 0x20} }, {"ATmega8515", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x63, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, {0x00, 0x40}, {0x02, 0x00}, {0x00, 0x00, 0x20, 0x00}, 0x20} }, {"ATmega8535", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x64, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, {0x00, 0x40}, {0x02, 0x00}, {0x00, 0x00, 0x20, 0x00}, 0x20} }, {"ATtiny11", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00, 0x04, 0x00}, 0x20} }, {"ATtiny12", {0x00, 0xD7, 0xA0, 0x01}, {0x42, 0x12, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, {0x00, 0x00}, {0x00, 0x40}, {0x00, 0x00, 0x04, 0x00}, 0x20} }, {"ATtiny15", {0x00, 0xD7, 0xA0, 0x01}, {0x42, 0x13, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, {0x00, 0x00}, {0x00, 0x40}, {0x00, 0x00, 0x04, 0x00}, 0x20} }, {"ATtiny22", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, {0x00, 0x00}, {0x00, 0x80}, {0x00, 0x00, 0x08, 0x00}, 0x20} }, {"ATtiny26", {0x04, 0xD7, 0xA0, 0x01}, {0x42, 0x21, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, {0x00, 0x20}, {0x00, 0x80}, {0x00, 0x00, 0x08, 0x00}, 0x20} }, {"ATtiny28", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x22, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00, 0x08, 0x00}, 0x20} }, {"ATmega8", {0x04, 0xD7, 0xA0, 0x01}, {0x42, 0x70, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, {0x00, 0x40}, {0x02, 0x00}, {0x00, 0x00, 0x20, 0x00}, 0x20} }, {"ATmega323", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x90, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, {0x00, 0x80}, {0x04, 0x00}, {0x00, 0x00, 0x80, 0x00}, 0x20} }, {"ATmega32", {0x04, 0xD7, 0xA0, 0x00}, {0x42, 0x91, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, {0x00, 0x80}, {0x04, 0x00}, {0x00, 0x00, 0x80, 0x00}, 0x20} }, {"ATmega64", {0x08, 0xD7, 0xA0, 0x00}, {0x42, 0x20, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, {0x01, 0x00}, {0x08, 0x00}, {0x00, 0x01, 0x00, 0x00}, 0x20} }, {"ATmega161", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x80, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, {0x00, 0x80}, {0x02, 0x00}, {0x00, 0x00, 0x40, 0x00}, 0x20} }, {"ATmega163", {0x00, 0xD7, 0xA0, 0x00}, {0x42, 0x81, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, {0x00, 0x80}, {0x02, 0x00}, {0x00, 0x00, 0x40, 0x00}, 0x20} }, {"ATmega16", {0x04, 0xD7, 0xA0, 0x00}, {0x42, 0x82, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, {0x00, 0x80}, {0x02, 0x00}, {0x00, 0x00, 0x40, 0x00}, 0x20} }, {"ATmega162", {0x04, 0xD7, 0xA0, 0x00}, {0x42, 0x83, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, {0x00, 0x80}, {0x02, 0x00}, {0x00, 0x00, 0x40, 0x00}, 0x20} }, {"ATmega169", {0x04, 0xD7, 0xA0, 0x01}, {0x42, 0x84, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, {0x00, 0x80}, {0x02, 0x00}, {0x00, 0x00, 0x40, 0x00}, 0x20} }, {"ATmega103", {0x00, 0xA0, 0xD7, 0x00}, {0x42, 0xb1, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, {0x01, 0x00}, {0x10, 0x00}, {0x00, 0x02, 0x00, 0x00}, 0x20} }, {"ATmega128", {0x08, 0xD7, 0xA0, 0x00}, {0x42, 0xb2, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, {0x01, 0x00}, {0x10, 0x00}, {0x00, 0x02, 0x00, 0x00}, 0x20} }, {"ATmega48", {0x04, 0xD7, 0xA0, 0x01}, {0x42, 0x59, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, {0x00, 0x40}, {0x01, 0x00}, {0x00, 0x00, 0x10, 0x00}, 0x20} }, {"ATmega88", {0x04, 0xD7, 0xA0, 0x01}, {0x42, 0x73, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, {0x00, 0x40}, {0x02, 0x00}, {0x00, 0x00, 0x20, 0x00}, 0x20} }, // FIXME: add at86rf401, at89s51, at89s52 {"", {0,0,0,0},{0,0,0,0, 0,0,0,0, 0,0,0,0, 0, {0}, {0}, {0}, 0}} }; /* Get a stk500 parameter value */ TByte TStk500::ReadParam(TByte param) { TByte buf[0x80]; TByte rd_param[] = { 0x41, param, 0x20 }; TByte rd_param_reply[] = { 0x14, '?', 0x10 }; memcpy(buf, rd_param, sizeof(rd_param)); Send(buf, sizeof(rd_param), sizeof(rd_param_reply)); if ((buf[0] != rd_param_reply[0]) || (buf[2] != rd_param_reply[2])) { throw Error_Device ("Failed to read parameter"); } return buf[1]; } /* Set a stk500 parameter value */ void TStk500::WriteParam(TByte param, TByte val) { TByte buf[0x80]; TByte wr_param[] = { 0x40, param, val, 0x20 }; TByte wr_param_reply[] = { 0x14, 0x10 }; memcpy(buf, wr_param, sizeof(wr_param)); Send(buf, sizeof(wr_param), sizeof(wr_param_reply)); if (memcmp(buf, wr_param_reply, sizeof(wr_param_reply)) != 0) { throw Error_Device ("Failed to write parameter"); } } /* Read byte from active segment at address addr. */ TByte TStk500::ReadByte(TAddr addr) { TByte val = 0xff; if (segment == SEG_FUSE) { switch (addr) { case AVR_FUSE_LOW_ADDR: if (TestFeatures(AVR_FUSE_RD)) val = ReadFuseLowBits(); else Info (1, "Cannot read low fuse bits on this device. " "Returning 0xff\n"); break; case AVR_FUSE_HIGH_ADDR: if (TestFeatures(AVR_FUSE_HIGH)) val = ReadFuseHighBits(); else Info (1, "Cannot read high fuse bits on this device. " "Returning 0xff\n"); break; case AVR_CAL_ADDR: if (TestFeatures(AVR_CAL_RD)) val = ReadCalFuseBits(0); else Info (1, "Cannot read calibration byte on this device. " "Returning 0xff\n"); break; case AVR_LOCK_ADDR: val = ReadLockBits(); break; case AVR_FUSE_EXT_ADDR: if (TestFeatures(AVR_FUSE_EXT)) val = ReadFuseExtBits(); else Info (1, "Cannot read extended fuse bits on this device. " "Returning 0xff\n"); break; } } else { /* FIXME: TRoth/2002-05-29: This is still broken. If flash or eeprom changes after the calling ReadMem(), you won't ever see the change. */ if (read_buffer[segment] == NULL) ReadMem(); val = read_buffer[segment][addr]; } return val; } /* Write byte to active segment */ void TStk500::WriteByte(TAddr addr, TByte byte, bool flush_buffer) { if (segment == SEG_FUSE) { switch (addr) { case AVR_FUSE_LOW_ADDR: if (TestFeatures(AVR_FUSE_RD)) WriteFuseLowBits(byte); else Info (1, "Cannot write low fuse bits on this device.\n"); break; case AVR_FUSE_HIGH_ADDR: if (TestFeatures(AVR_FUSE_HIGH)) WriteFuseHighBits(byte); else Info (1, "Cannot write high fuse bits on this device.\n"); break; case AVR_CAL_ADDR: /* Calibration byte is always readonly. */ break; case AVR_LOCK_ADDR: WriteLockBits(byte); break; case AVR_FUSE_EXT_ADDR: if (TestFeatures(AVR_FUSE_EXT)) WriteFuseExtBits(byte); else Info (1, "Cannot read extended fuse bits on this device.\n"); break; } } else { if (write_buffer[segment] == NULL) { write_buffer[segment] = new TByte[GetSegmentSize()]; memset(write_buffer[segment], 0xff, GetSegmentSize()); } if (addr > maxaddr) maxaddr = addr; if (addr < minaddr) minaddr = addr; write_buffer[segment][addr] = byte; if (flush_buffer) { FlushWriteBuffer(); } } } void TStk500::FlushWriteBuffer(){ TByte buf[0x200]; int wordsize; TByte seg; const TByte *pgsz; int pagesize; if (segment == SEG_FLASH) { wordsize = 2; seg = Flash; } else { wordsize = 1; seg = EEPROM; } pgsz = prg_part[desired_part].params.pagesize; pagesize = (pgsz[0]) << 8 + pgsz[1]; if (pagesize == 0) { pagesize = 128; } EnterProgrammingMode(); for (TAddr addr=minaddr - minaddr % pagesize; addr> 8) & 0xff; Send(buf, sizeof(SetAddress), sizeof(SetAddress_Reply)); if (memcmp(buf, SetAddress_Reply, sizeof(SetAddress_Reply)) != 0) { throw Error_Device ("[FWB 1] Device is not responding correctly."); } memcpy(buf, WriteMemory, sizeof(WriteMemory)); buf[1] = pagesize >> 8; buf[2] = pagesize & 0xff; buf[3] = seg; memcpy(buf+sizeof(WriteMemory), write_buffer[segment]+addr, pagesize); memcpy(buf+sizeof(WriteMemory)+pagesize, CmdStopByte, sizeof(CmdStopByte)); Send(buf, sizeof(WriteMemory)+pagesize+sizeof(CmdStopByte), sizeof(WriteMemory_Reply)); if (memcmp(buf, WriteMemory_Reply, sizeof(WriteMemory_Reply)) != 0) { throw Error_Device ("[FWB 2] Device is not responding correctly."); } } LeaveProgrammingMode(); } /* Chip Erase */ void TStk500::ChipErase(){ TByte buf[100]; EnterProgrammingMode(); memcpy(buf, EraseDevice, sizeof(EraseDevice)); Send(buf, sizeof(EraseDevice), sizeof(EraseDevice_Reply)); if (memcmp(buf, EraseDevice_Reply, sizeof(EraseDevice_Reply)) != 0) { throw Error_Device ("[CE] Device is not responding correctly."); } LeaveProgrammingMode(); } TByte TStk500::ReadLockFuseBits() { TByte cmd[] = { 0x58, 0x00, 0x00, 0x00 }; return UniversalCmd(cmd); } /* ReadLockBits tries to return the lock bits in a uniform order, despite the differences in different AVR versions. The goal is to get the lock bits into this order: x x BLB12 BLB11 BLB02 BLB01 LB2 LB1 For devices that don't support a boot block, the BLB bits will be 1. */ TByte TStk500::ReadLockBits() { TByte rbits = 0xFF; if (TestFeatures(AVR_LOCK_BOOT)) { /* x x BLB12 BLB11 BLB02 BLB01 LB2 LB1 */ rbits = ReadLockFuseBits(); } else if (TestFeatures(AVR_LOCK_RD76)) { rbits = ReadLockFuseBits(); /* LB1 LB2 x x x x x x -> 1 1 1 1 1 1 LB2 LB1 */ rbits = ((rbits >> 7) & 1) | ((rbits >> 5) & 1) | 0xFC; } else if (TestFeatures(AVR_LOCK_RD12)) { rbits = ReadLockFuseBits(); /* x x x x x LB2 LB1 x -> 1 1 1 1 1 1 LB2 LB1 */ rbits = ((rbits >> 1) & 3) | 0xFC; } else { /* if its signature returns 0,1,2 then say it's locked. */ EnterProgrammingMode(); ReadSignature(); LeaveProgrammingMode(); if (vendor_code == 0 && part_family == 1 && part_number == 2) { rbits = 0xFC; } else { throw Error_Device ("ReadLockBits failed: are you sure this device " "has lock bits?"); } } return rbits; } TByte TStk500::ReadCalFuseBits(int addr) { TByte cmd[] = { 0x38, 0x00, addr, 0x00 }; return UniversalCmd(cmd); } TByte TStk500::ReadFuseLowBits() { TByte cmd[] = { 0x50, 0x00, 0x00, 0x00 }; return UniversalCmd(cmd); } TByte TStk500::ReadFuseHighBits() { TByte cmd[] = { 0x58, 0x08, 0x00, 0x00 }; return UniversalCmd(cmd); } TByte TStk500::ReadFuseExtBits() { TByte cmd[] = { 0x50, 0x08, 0x00, 0x00 }; return UniversalCmd(cmd); } void TStk500::WriteLockFuseBits(TByte bits) { TByte cmd[] = { 0xac, 0xff, 0xff, bits }; UniversalCmd(cmd); } void TStk500::WriteFuseLowBits(TByte bits) { TByte cmd[] = { 0xac, 0xa0, 0xff, bits }; UniversalCmd(cmd); } void TStk500::WriteFuseHighBits(TByte bits) { TByte cmd[] = { 0xac, 0xa8, 0xff, bits }; UniversalCmd(cmd); } void TStk500::WriteFuseExtBits(TByte bits) { TByte cmd[] = { 0xac, 0xa4, 0xff, bits }; UniversalCmd(cmd); } /* 0 = program (clear bit), 1 = leave unchanged bit 0 = LB1 bit 1 = LB2 bit 2 = BLB01 bit 3 = BLB02 bit 4 = BLB11 bit 5 = BLB12 bit 6 = 1 (reserved) bit 7 = 1 (reserved) */ void TStk500::WriteLockBits(TByte bits) { TByte wbits; if (TestFeatures(AVR_LOCK_BOOT)) { /* x x BLB12 BLB11 BLB02 BLB01 LB2 LB1 */ wbits = bits; } else if (TestFeatures(AVR_LOCK_RD76)) { /* x x x x x x LB2 LB1 -> LB1 LB2 1 1 1 1 1 1 */ wbits = ((bits << 7) & 0x80) | ((bits << 5) & 0x40) | 0x3f; } else if (TestFeatures(AVR_LOCK_RD12)) { /* x x x x x x LB2 LB1 -> 1 1 1 1 1 LB2 LB1 1 */ wbits = ((bits << 1) & 0x06) | 0xF9; } else { Info (0, "WriteLockBits failed: are you sure this device has lock bits?"); return; } WriteLockFuseBits(wbits); } void TStk500::Initialize() { TByte buf[100]; TByte vmajor; TByte vminor; TByte num_ext_parms = 3; memcpy(buf, pSTK500, sizeof(pSTK500)); Send(buf, sizeof(pSTK500), sizeof(pSTK500_Reply)); if (memcmp(buf, pSTK500_Reply, sizeof(pSTK500_Reply)) != 0) { throw Error_Device ("[VP 1] Device is not responding correctly."); } memcpy(buf, &prg_part[desired_part].params, sizeof(prg_part[desired_part].params)); Send(buf, sizeof(prg_part[desired_part].params), sizeof(DeviceParam_Reply)); if (memcmp(buf, DeviceParam_Reply, sizeof(DeviceParam_Reply)) != 0) { throw Error_Device ("[VP 2] Device is not responding correctly."); } memcpy(buf, SWminor, sizeof(SWminor)); Send(buf, sizeof(SWminor), sizeof(SWminor_Reply)); vminor = buf[1]; memcpy(buf, SWmajor, sizeof(SWmajor)); Send(buf, sizeof(SWmajor), sizeof(SWmajor_Reply)); vmajor = buf[1]; printf ("Firmware Version: %d.%d\n", vmajor, vminor); if (! ((vmajor == 1 && vminor >= 7) || (vmajor > 1))) throw Error_Device ("Need STK500 firmware version 1.7 or newer."); if ((vmajor == 1 && vminor >= 14) || (vmajor > 1)) num_ext_parms = 4; buf[0] = 0x45; buf[1] = num_ext_parms; memcpy(buf+2, &prg_part[desired_part].ext_params, num_ext_parms); buf[num_ext_parms+2] = 0x20; Send(buf, num_ext_parms+3, sizeof(ExtDevParams_Reply)); if (memcmp(buf, ExtDevParams_Reply, sizeof(ExtDevParams_Reply)) != 0) { throw Error_Device ("[VP 3] Device is not responding correctly."); } } void TStk500::EnterProgrammingMode() { TByte buf[100]; memcpy(buf, EnterPgmMode, sizeof(EnterPgmMode)); Send(buf, sizeof(EnterPgmMode), sizeof(EnterPgmMode_Reply)); if (memcmp(buf, EnterPgmMode_Reply, sizeof(EnterPgmMode_Reply)) != 0) { throw Error_Device ("Failed to enter programming mode."); } } void TStk500::LeaveProgrammingMode() { TByte buf[100]; memcpy(buf, LeavePgmMode, sizeof(LeavePgmMode)); Send(buf, sizeof(LeavePgmMode), sizeof(LeavePgmMode_Reply)); if (memcmp(buf, LeavePgmMode_Reply, sizeof(LeavePgmMode_Reply)) != 0) { throw Error_Device ("[LPM] Device is not responding correctly."); } } /* TRoth/2002-05-28: A Universal Command seems to be just the 4 bytes of an SPI command. I'm basing this on my interpretation of the doc/README.stk500 and Table 129 of the mega128 datasheet (page 300). */ TByte TStk500::UniversalCmd(TByte cmd[]) { TByte buf[6] = { 0x56, 0x00, 0x00, 0x00, 0x00, 0x20 }; memcpy(buf+1, cmd, 4); EnterProgrammingMode(); /* Expected response is { 0x14, , 0x10 } */ Send(buf, sizeof(buf), 3); LeaveProgrammingMode(); if ((buf[0] != 0x14) || (buf[2] != 0x10)) { throw Error_Device ("[UC] Device is not responding correctly."); } return buf[1]; } void TStk500::ReadSignature() { TByte buf[100]; memcpy(buf, GetSignature, sizeof(GetSignature)); Send(buf, sizeof(GetSignature), sizeof(GetSignature_Reply)); vendor_code = buf[1]; part_family = buf[2]; part_number = buf[3]; } void TStk500::ReadMem(){ TByte buf[0x200]; int wordsize; TAddr addr; TByte seg; if (segment == SEG_FLASH) { wordsize = 2; seg = Flash; } else if (segment == SEG_EEPROM) { wordsize = 1; seg = EEPROM; } else { throw Error_Device ("TStk500::ReadMem() called for invalid segment."); } read_buffer[segment] = new TByte[GetSegmentSize()]; EnterProgrammingMode(); addr = 0; for (unsigned int addr=0; addr> 8) & 0xff; Send(buf, sizeof(SetAddress), sizeof(SetAddress_Reply)); if (memcmp(buf, SetAddress_Reply, sizeof(SetAddress_Reply)) != 0) { throw Error_Device ("[RM] Device is not responding correctly."); } memcpy(buf, ReadMemory, sizeof(ReadMemory)); buf[3] = seg; Send(buf, sizeof(ReadMemory), 2+0x100); memcpy(read_buffer[segment]+addr, buf+1, 0x100); } LeaveProgrammingMode(); } static TByte convert_voltage (const char *val) { char *endptr; double v = strtod (val, &endptr); if (endptr == val) throw Error_Device ("Bad voltage value."); if (v > 6.0) throw Error_Device ("Voltages can not be greater than 6.0 volts"); if (v < 0.0) throw Error_Device ("Voltages can not be less the 0.0 volts"); TByte res = (int)(v * 10.01); return res; } TStk500::TStk500() { /* Select Part by name */ desired_part=-1; const char* desired_partname = GetCmdParam("-dpart"); if (desired_partname!=NULL) { int j; for (j=0; prg_part[j].name[0] != 0; j++){ if (strcasecmp (desired_partname, prg_part[j].name)==0){ desired_part = j; break; } } if (prg_part[j].name[0]==0){throw Error_Device("-dpart: Invalid name.");} } else { int i = 0; Info(0, "No part specified, supported devices are:\n"); while (prg_part[i].name[0] != '\0') Info(0, "%s\n", prg_part[i++].name); throw Error_Device(""); } /* Force parallel programming mode if the use wants it, otherwise, just use what the device prefers (usually serial programming). */ if (GetCmdParam("-dhiv",false)) prg_part[desired_part].params.progtype = STK500_PROG_HIV; Initialize(); /* Handle Reading/Writing ARef voltage level. */ const char *val; if ((val=GetCmdParam("--wr_vtg", true))) { TByte value = convert_voltage (val); printf ("Setting VTarget to %d.%d V\n", value/10, value%10); TByte aref = ReadParam(0x85); if (aref > value) { printf ("Setting ARef == VTarget to avoid damaging device.\n"); WriteParam(0x85, value); } WriteParam(0x84, value); } if ((val=GetCmdParam("--wr_aref", true))) { TByte value = convert_voltage (val); printf ("Setting ARef to %d.%d V\n", value/10, value%10); TByte vtg = ReadParam(0x84); if (vtg < value) { printf ("Setting ARef == VTarget to avoid damaging device.\n"); WriteParam(0x84, value); } WriteParam(0x85, value); } if (GetCmdParam("--rd_vtg", false)) { TByte val = ReadParam(0x84); printf("VTarget = %d.%d V\n", val/10, val%10); } if (GetCmdParam("--rd_aref", false)) { TByte val = ReadParam(0x85); printf("ARef = %d.%d V\n", val/10, val%10); } if (GetCmdParam("--rd_osc", false)) { TByte p = ReadParam(0x86); TByte n = ReadParam(0x87); TByte sc = ReadParam(0x89); printf("Oscillator: p=%x, n=%x, sc=%x, ",p,n,sc); if (p==0) printf ("0 Hz (stopped)\n"); else { double freq=clockbase/clockscale[p] / (n+1.0); printf ("frequency=%.8g Hz\n", freq); } } if ((val=GetCmdParam("--wr_osc", true))) { /* See page 19 of the STK500 protocol documentation from Atmel */ TByte p,n,sc; double freq=atof(val); double setfreq; if (val == 0) { /* Special case for stopped */ p=0; n=0; sc=0xff; } else { /* Select lowest usable prescaler value */ for (p=1; p<=7; p++) { if (clockbase / clockscale[p] / freq <= 256) break; } if (p > 7) { p=7; n=0xff; } else n=(int)(clockbase/clockscale[p]/freq+.5) - 1; setfreq=clockbase/clockscale[p]/(n+1.0); if (8000000/setfreq-1 > 0xff) sc=0xff; else sc=(int)(8000000/setfreq) - 1; printf ("Setting oscillator frequency to %.8g (p=%d,n=%d,sc=%d)\n", setfreq, p, n, sc); WriteParam(0x86, p); WriteParam(0x87, n); WriteParam(0x89, sc); } } EnterProgrammingMode(); ReadSignature(); LeaveProgrammingMode(); Identify(); /* For some unknown reason, some stk500 boards with firmware version 1.14, * don't work right without this sleep and re-init. * Reported 2003-07-31 by Simon Allen */ sleep(1); Initialize(); write_buffer[SEG_FLASH] = NULL; write_buffer[SEG_EEPROM] = NULL; read_buffer[SEG_FLASH] = NULL; read_buffer[SEG_EEPROM] = NULL; minaddr = TAddr(-1); maxaddr = 0; } TStk500::~TStk500() { delete write_buffer[SEG_FLASH]; delete write_buffer[SEG_EEPROM]; delete read_buffer[SEG_FLASH]; delete read_buffer[SEG_EEPROM]; } uisp-20050207/src/Stk500.h0000644000175100017510000001476110053163155011614 00000000000000/* * $Id: Stk500.h,v 1.15 2004/05/20 17:10:05 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 2001, 2002, 2003 Daniel Berntsson * * 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 * **************************************************************************** */ /* Stk500.h, Daniel Berntsson, 2001 */ #ifndef __STK500 #define __STK500 #include "Global.h" #include "Serial.h" #include "Avr.h" #define STK500_PROG_SPI 0 #define STK500_PROG_HIV 1 struct SPrgParams { const TByte cmd; // Always 0x42 (Cmnd_STK_SET_DEVICE) const TByte devicecode; // Device code (as defined above) const TByte revision; // Device revision. Not used, set to 0. TByte progtype; // Defines which Program modes are supported: // 0 - Both parallel/Hi-V and SPI mode // 1 - Parallel/Hi-V only const TByte parmode; // Defines if the device has a full parallel // interface or a pseudo parallel programming // interface: 0 - pseudo; 1 - full const TByte polling; // Defines if polling may be used during SPI // access: 0 - no; 1 - yes const TByte selftimed; // Defines if prog insns are self timed: // 0 - no; 1 - yes const TByte lockbytes; // Number of lock bytes. Currently not used // but should be set for future compat. const TByte fusebytes; // Number of fuse bytes. Currently not used // but should be set for future compat. const TByte flashpollval1; // FLASH polling value. See dev data sheet. const TByte flashpollval2; // FLASH polling value. Same as val1. const TByte eeprompollval1; // EEPROM polling value 1 (P1). See dev data // sheet. const TByte eeprompollval2; // EEPROM polling value 2 (P2). See dev data // sheet. // The following multi-byte values are sent to the stk500 in big endian // order. const TByte pagesize[2]; // Page size in bytes for pagemode parts const TByte eepromsize[2]; // Size of eeprom in bytes. const TByte flashsize[4]; // Size of FLASH in bytes. const TByte sync; // Always 0x20 (Sync_CRC_EOP) }; /* Set the Extened Device Programming parameters. In the future, this may require more than 3 arguments. */ struct SPrgExtDevParams { const TByte eepgsz; // EEPROM page size in bytes. const TByte sig_pagel; // Defines which port pin the PAGEL signal // should be mapped on to. e.g. 0xD7 maps to // PORTD7. const TByte sig_bs2; // Defines which port pin the BS2 signal // should be mapped on to. const TByte reset_disable; // Req'd by firmware version 1.14. It's a // flag which tells whether a device uses the // reset pin as an IO pin. Where 0x00 = // Dedicated RESET pin, 0x01 = Can't rely on // RESET pin for going into programming // mode. Not needed for SPI programming // though. [From appnote-061: This is set if // the device has a RSTDSBL fuse.] }; class TStk500: public TAvr, TSerial { private: struct SPrgPart{ const char *name; struct SPrgExtDevParams ext_params; struct SPrgParams params; }; int desired_part; TByte* write_buffer[2]; /* buffer for SEG_FLASH and SEG_EEPROM */ TByte* read_buffer[2]; /* buffer for SEG_FLASH and SEG_EEPROM */ TAddr minaddr; TAddr maxaddr; static const TByte pSTK500[]; static const TByte pSTK500_Reply[]; static const TByte SWminor[]; static const TByte SWminor_Reply[]; static const TByte SWmajor[]; static const TByte SWmajor_Reply[]; static const TByte EnterPgmMode[]; static const TByte EnterPgmMode_Reply[]; static const TByte LeavePgmMode[]; static const TByte LeavePgmMode_Reply[]; static const TByte SetAddress[]; static const TByte SetAddress_Reply[]; static const TByte EraseDevice[]; static const TByte EraseDevice_Reply[]; static const TByte WriteMemory[]; static const TByte WriteMemory_Reply[]; static const TByte ReadMemory[]; static const TByte ReadMemory_Reply[]; static const TByte GetSignature[]; static const TByte GetSignature_Reply[]; static const TByte CmdStopByte[]; static const TByte ReplyStopByte[]; static const TByte Flash; static const TByte EEPROM; static const TByte DeviceParam_Reply[]; static const TByte ExtDevParams_Reply[]; static SPrgPart prg_part[]; void Initialize(); void EnterProgrammingMode(); void LeaveProgrammingMode(); void ReadSignature(); void ReadMem(); TByte ReadParam(TByte param); void WriteParam(TByte param, TByte val); TByte UniversalCmd(TByte cmd[]); TByte ReadLockFuseBits(); TByte ReadCalFuseBits(int addr); TByte ReadFuseLowBits(); TByte ReadFuseHighBits(); TByte ReadFuseExtBits(); TByte ReadLockBits(); void WriteLockFuseBits(TByte bits); void WriteFuseLowBits(TByte bits); void WriteFuseHighBits(TByte bits); void WriteFuseExtBits(TByte bits); public: /* Read byte from active segment at address addr. */ TByte ReadByte(TAddr addr); /* Write byte to active segment at address addr */ void WriteByte(TAddr addr, TByte byte, bool flush_buffer=true); void FlushWriteBuffer(); /* Chip Erase */ void ChipErase(); /* Write lock bits */ void WriteLockBits(TByte bits); TStk500(); ~TStk500(); }; #endif uisp-20050207/src/Terminal.C0000644000175100017510000001152007624216011012322 00000000000000/* * $Id: Terminal.C,v 1.5 2003/02/17 17:29:45 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002, 2003 Uros Platise * * 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 * **************************************************************************** */ /* Terminal.C Device Terminal Access Uros Platise (c) 1999 */ #include "config.h" #include #include #include "Global.h" #include "Error.h" #include "Terminal.h" #include "MotIntl.h" void TTerminal::Run() { #if 0 enableAvr (); if (isDeviceLocked ()) { char q[20]; printf ("Do you want to clear it and enter normal mode now " "(enter y for yes): "); if (fgets (q,sizeof(q),stdin)) { if (q[0]=='y') { chipErase (); } else { return; } } } #endif printf ("Entering the AVR Terminal. ?-help, q-quit.\n"); char cmd[32]; TAddr addr = 0; do { try { printf("avr> "); scanf("%s",cmd); if (!strcmp(cmd,"?")){ printf ("AVR Terminal supports the following commands:\n" "ul fileName - uploads data from Motorola/Intel format.\n" "vf fileName - verify file with memory\n" /* "dl fileName[%segs] - downloads data to Micro Output File\n" */ "ls - list segments\n" "ss seg_name - set segment\n" "ce - perform chip erase\n" "rd addr - read a byte from a segment\n" "wr addr byte - write a 'byte' to a segment at address 'addr'\n" "du addr - dump segment starting at address 'addr'\n" ", - continue segment dump\n" "\n" "Written by Uros Platise (c) 1997-1999, uros.platise@ijs.si\n"); } else if (!strcmp(cmd,"ul")) { char inputFileName [64]; scanf ("%s", inputFileName); try{ motintl.Read(inputFileName, true, false); } catch (Error_Device& errDev) { errDev.print (); } catch (Error_C) { perror ("Error"); } } else if (!strcmp(cmd,"vf")) { char inputFileName [64]; scanf ("%s", inputFileName); try{ motintl.Read(inputFileName, false, true); } catch (Error_Device& errDev) { errDev.print (); } catch (Error_C) { perror ("Error"); } } /* else if (cmd=="dl") { char outputFileName [64]; scanf ("%s", outputFileName); try { TAout outAout (outputFileName, "wt"); download (&outAout); } catch (Error_Device& errDev) { errDev.print (); } catch (Error_C) { perror ("Error"); } } */ else if (!strcmp(cmd,"ls")){ printf("Available segments: "); const char* seg_name; for (unsigned i=0; (seg_name=device->ListSegment(i))!=NULL; i++){ if (i>0){printf(", ");} printf("%s", seg_name); } putchar('\n'); } else if (!strcmp(cmd,"ss")){ char seg_name [32]; scanf("%s", seg_name); if (!device->SetSegment(seg_name)){ printf("Invalid segment: `%s'\n", seg_name); } else {addr=0;} } else if (!strcmp(cmd,"ce")){ device->ChipErase(); } /* else if (cmd=="rsb") { unsigned char byte = readLockBits (); printf ("Lock and Fuse bits status: %.2x\n", byte ); } else if (cmd=="wlb") { string mode; cin >> mode; if (mode=="wr") { writeLockBits (lckPrg); } else if (mode=="rdwr") { writeLockBits (lckPrgRd); } else { printf ("Invalid parameter: %s\n", mode); } } */ else if (!strcmp(cmd,"rd")){ scanf ("%x", &addr); printf("%s: $%.2x\n", device->TellActiveSegment(), device->ReadByte(addr)); } else if (!strcmp(cmd,"wr")){ unsigned x; scanf("%x%x", &addr, &x); device->WriteByte(addr, TByte(x)); } else if (!strcmp(cmd,"du")){ scanf ("%x", &addr); goto list_contents; } else if (!strcmp(cmd,",")){ list_contents: int i,l=0; while (l<4) { printf ("%s $%.5x: ", device->TellActiveSegment(), addr); for (i=0; i<0x8; addr++,i++) printf ("%.2x ", device->ReadByte(addr)); printf ("\n"); l++; } } else printf ("Ouch.\n"); } catch (Error_MemoryRange){Info(0,"Out of memory range!\n");putchar('\n');} } while (strcmp(cmd,"q")); } uisp-20050207/src/Terminal.h0000644000175100017510000000232507473750422012405 00000000000000/* * $Id: Terminal.h,v 1.1 2002/05/25 17:59:46 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ /* Terminal.h, Uros Platise (c) 1999 */ #ifndef __TERMINAL #define __TERMINAL class TTerminal{ public: void Run(); TTerminal(){} ~TTerminal(){} }; #endif uisp-20050207/src/cygwinp.C0000644000175100017510000000565507740372116012253 00000000000000/* * $Id: cygwinp.C,v 1.3 2003/10/06 23:01:34 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ #if defined(__CYGWIN__) #include "config.h" #include #include #include "cygwinp.h" #include "DAPA.h" unsigned char inb(unsigned short port) { unsigned char t; asm volatile ("in %1, %0" : "=a" (t) : "d" (port)); return t; } void outb(unsigned char value, unsigned short port) { asm volatile ("out %1, %0" : : "d" (port), "a" (value) ); } int ioperm(unsigned short port, int num, int enable) { if (enable) { // Only try to use directio under Windows NT/2000. OSVERSIONINFO ver_info; memset(&ver_info, 0, sizeof(ver_info)); ver_info.dwOSVersionInfoSize = sizeof(ver_info); if (! GetVersionEx(&ver_info)) return -1; else if (ver_info.dwPlatformId == VER_PLATFORM_WIN32_NT) { HANDLE h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) return -1; CloseHandle(h); } } return 0; } bool cygwinp_delay_usec(long t) { static bool perf_counter_checked = false; static bool use_perf_counter = false; static LARGE_INTEGER freq; if (! perf_counter_checked) { if (QueryPerformanceFrequency(&freq)) use_perf_counter = true; perf_counter_checked = true; } if (! use_perf_counter) return false; else { LARGE_INTEGER now; LARGE_INTEGER finish; QueryPerformanceCounter(&now); finish.QuadPart = now.QuadPart + (t * freq.QuadPart) / 1000000; do { QueryPerformanceCounter(&now); } while (now.QuadPart < finish.QuadPart); return true; } } int cfmakeraw(struct termios *termios_p) { termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP |INLCR|IGNCR|ICRNL|IXON); termios_p->c_oflag &= ~OPOST; termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); termios_p->c_cflag &= ~(CSIZE|PARENB); termios_p->c_cflag |= CS8; return 0; } #endif uisp-20050207/src/cygwinp.h0000644000175100017510000000244607473750422012316 00000000000000/* * $Id: cygwinp.h,v 1.1 2002/05/25 17:59:46 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ #include unsigned char inb(unsigned short port); void outb(unsigned char value, unsigned short port); int ioperm(unsigned short port, int num, int enable); int cfmakeraw(struct termios *termios_p); bool cygwinp_delay_usec(long t); uisp-20050207/src/parport.h0000644000175100017510000003734607473750422012334 00000000000000/* * $Id: parport.h,v 1.1 2002/05/25 17:59:46 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1999, 2000, 2001, 2002 Uros Platise * * 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 * **************************************************************************** */ /* Id: parport.h,v 1.1 1998/05/17 10:57:52 andrea Exp andrea */ #ifndef _PARPORT_H_ #define _PARPORT_H_ /* Start off with user-visible constants */ /* Maximum of 8 ports per machine */ #define PARPORT_MAX 8 /* Magic numbers */ #define PARPORT_IRQ_NONE -1 #define PARPORT_DMA_NONE -1 #define PARPORT_IRQ_AUTO -2 #define PARPORT_DMA_AUTO -2 #define PARPORT_DISABLE -2 #define PARPORT_IRQ_PROBEONLY -3 #define PARPORT_CONTROL_STROBE 0x1 #define PARPORT_CONTROL_AUTOFD 0x2 #define PARPORT_CONTROL_INIT 0x4 #define PARPORT_CONTROL_SELECT 0x8 #define PARPORT_CONTROL_INTEN 0x10 #define PARPORT_CONTROL_DIRECTION 0x20 #define PARPORT_STATUS_ERROR 0x8 #define PARPORT_STATUS_SELECT 0x10 #define PARPORT_STATUS_PAPEROUT 0x20 #define PARPORT_STATUS_ACK 0x40 #define PARPORT_STATUS_BUSY 0x80 /* Type classes for Plug-and-Play probe. */ typedef enum { PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */ PARPORT_CLASS_PRINTER, PARPORT_CLASS_MODEM, PARPORT_CLASS_NET, PARPORT_CLASS_HDC, /* Hard disk controller */ PARPORT_CLASS_PCMCIA, PARPORT_CLASS_MEDIA, /* Multimedia device */ PARPORT_CLASS_FDC, /* Floppy disk controller */ PARPORT_CLASS_PORTS, PARPORT_CLASS_SCANNER, PARPORT_CLASS_DIGCAM, PARPORT_CLASS_OTHER, /* Anything else */ PARPORT_CLASS_UNSPEC /* No CLS field in ID */ } parport_device_class; /* The "modes" entry in parport is a bit field representing the following * modes. * Note that PARPORT_MODE_PCECPEPP is for the SMC EPP+ECP mode which is NOT * 100% compatible with EPP. */ #define PARPORT_MODE_PCSPP 0x0001 #define PARPORT_MODE_PCPS2 0x0002 #define PARPORT_MODE_PCEPP 0x0004 #define PARPORT_MODE_PCECP 0x0008 #define PARPORT_MODE_PCECPEPP 0x0010 #define PARPORT_MODE_PCECR 0x0020 /* ECR Register Exists */ #define PARPORT_MODE_PCECPPS2 0x0040 /* The rest is for the kernel only */ #ifdef __KERNEL__ #include #include #include #include #include #define PARPORT_NEED_GENERIC_OPS /* Define this later. */ struct parport; struct pc_parport_state { unsigned int ctr; unsigned int ecr; }; struct parport_state { union { struct pc_parport_state pc; /* ARC has no state. */ /* AX uses same state information as PC */ void *misc; } u; }; struct parport_operations { void (*write_data)(struct parport *, unsigned char); unsigned char (*read_data)(struct parport *); void (*write_control)(struct parport *, unsigned char); unsigned char (*read_control)(struct parport *); unsigned char (*frob_control)(struct parport *, unsigned char mask, unsigned char val); void (*write_econtrol)(struct parport *, unsigned char); unsigned char (*read_econtrol)(struct parport *); unsigned char (*frob_econtrol)(struct parport *, unsigned char mask, unsigned char val); void (*write_status)(struct parport *, unsigned char); unsigned char (*read_status)(struct parport *); void (*write_fifo)(struct parport *, unsigned char); unsigned char (*read_fifo)(struct parport *); void (*change_mode)(struct parport *, int); void (*release_resources)(struct parport *); int (*claim_resources)(struct parport *); void (*epp_write_data)(struct parport *, unsigned char); unsigned char (*epp_read_data)(struct parport *); void (*epp_write_addr)(struct parport *, unsigned char); unsigned char (*epp_read_addr)(struct parport *); int (*epp_check_timeout)(struct parport *); size_t (*epp_write_block)(struct parport *, void *, size_t); size_t (*epp_read_block)(struct parport *, void *, size_t); int (*ecp_write_block)(struct parport *, void *, size_t, void (*fn)(struct parport *, void *, size_t), void *); int (*ecp_read_block)(struct parport *, void *, size_t, void (*fn)(struct parport *, void *, size_t), void *); void (*init_state)(struct parport_state *); void (*save_state)(struct parport *, struct parport_state *); void (*restore_state)(struct parport *, struct parport_state *); void (*enable_irq)(struct parport *); void (*disable_irq)(struct parport *); void (*interrupt)(int, void *, struct pt_regs *); void (*inc_use_count)(void); void (*dec_use_count)(void); void (*fill_inode)(struct inode *inode, int fill); }; struct parport_device_info { parport_device_class class; const char *class_name; const char *mfr; const char *model; const char *cmdset; const char *description; }; /* Each device can have two callback functions: * 1) a preemption function, called by the resource manager to request * that the driver relinquish control of the port. The driver should * return zero if it agrees to release the port, and nonzero if it * refuses. Do not call parport_release() - the kernel will do this * implicitly. * * 2) a wake-up function, called by the resource manager to tell drivers * that the port is available to be claimed. If a driver wants to use * the port, it should call parport_claim() here. */ /* A parallel port device */ struct pardevice { const char *name; struct parport *port; int (*preempt)(void *); void (*wakeup)(void *); void *private; void (*irq_func)(int, void *, struct pt_regs *); unsigned int flags; struct pardevice *next; struct pardevice *prev; struct parport_state *state; /* saved status over preemption */ struct wait_queue *wait_q; unsigned long int time; unsigned long int timeslice; unsigned int waiting; struct pardevice *waitprev; struct pardevice *waitnext; }; /* Directory information for the /proc interface */ struct parport_dir { struct proc_dir_entry *entry; /* Directory /proc/parport/X */ struct proc_dir_entry *irq; /* .../irq */ struct proc_dir_entry *devices; /* .../devices */ struct proc_dir_entry *hardware; /* .../hardware */ struct proc_dir_entry *probe; /* .../autoprobe */ char name[4]; }; /* A parallel port */ struct parport { unsigned long base; /* base address */ unsigned int size; /* IO extent */ const char *name; int irq; /* interrupt (or -1 for none) */ int dma; unsigned int modes; struct pardevice *devices; struct pardevice *cad; /* port owner */ struct pardevice *waithead; struct pardevice *waittail; struct parport *next; unsigned int flags; struct parport_dir pdir; struct parport_device_info probe_info; struct parport_operations *ops; void *private_data; /* for lowlevel driver */ int number; /* port index - the `n' in `parportn' */ spinlock_t pardevice_lock; spinlock_t waitlist_lock; rwlock_t cad_lock; /* PCI parallel I/O card support. */ unsigned long base_hi; /* base address (hi - ECR) */ }; /* parport_register_port registers a new parallel port at the given address (if * one does not already exist) and returns a pointer to it. This entails * claiming the I/O region, IRQ and DMA. * NULL is returned if initialisation fails. */ struct parport *parport_register_port(unsigned long base, int irq, int dma, struct parport_operations *ops); /* Unregister a port. */ extern void parport_unregister_port(struct parport *port); /* parport_in_use returns nonzero if there are devices attached to a port. */ #define parport_in_use(x) ((x)->devices != NULL) /* Put a parallel port to sleep; release its hardware resources. Only possible * if no devices are registered. */ extern void parport_quiesce(struct parport *); /* parport_enumerate returns a pointer to the linked list of all the ports * in this machine. */ struct parport *parport_enumerate(void); /* parport_register_device declares that a device is connected to a port, and * tells the kernel all it needs to know. * pf is the preemption function (may be NULL for no callback) * kf is the wake-up function (may be NULL for no callback) * irq_func is the interrupt handler (may be NULL for no interrupts) * handle is a user pointer that gets handed to callback functions. */ struct pardevice *parport_register_device(struct parport *port, const char *name, int (*pf)(void *), void (*kf)(void *), void (*irq_func)(int, void *, struct pt_regs *), int flags, void *handle); /* parport_unregister unlinks a device from the chain. */ extern void parport_unregister_device(struct pardevice *dev); /* parport_claim tries to gain ownership of the port for a particular driver. * This may fail (return non-zero) if another driver is busy. If this * driver has registered an interrupt handler, it will be enabled. */ extern int parport_claim(struct pardevice *dev); /* parport_claim_or_block is the same, but sleeps if the port cannot be claimed. Return value is 1 if it slept, 0 normally and -errno on error. */ extern int parport_claim_or_block(struct pardevice *dev); /* parport_release reverses a previous parport_claim. This can never fail, * though the effects are undefined (except that they are bad) if you didn't * previously own the port. Once you have released the port you should make * sure that neither your code nor the hardware on the port tries to initiate * any communication without first re-claiming the port. * If you mess with the port state (enabling ECP for example) you should * clean up before releasing the port. */ extern void parport_release(struct pardevice *dev); /* parport_yield relinquishes the port if it would be helpful to other * drivers. The return value is the same as for parport_claim. */ extern __inline__ int parport_yield(struct pardevice *dev) { unsigned long int timeslip = (jiffies - dev->time); if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice)) return 0; parport_release(dev); return parport_claim(dev); } /* parport_yield_blocking is the same but uses parport_claim_or_block * instead of parport_claim. */ extern __inline__ int parport_yield_blocking(struct pardevice *dev) { unsigned long int timeslip = (jiffies - dev->time); if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice)) return 0; parport_release(dev); return parport_claim_or_block(dev); } /* * Lowlevel drivers _can_ call this support function to handle irqs. */ extern __inline__ void parport_generic_irq(int irq, struct parport *port, struct pt_regs *regs) { read_lock(&port->cad_lock); if (!port->cad) goto out_unlock; if (port->cad->irq_func) port->cad->irq_func(irq, port->cad->private, regs); else printk(KERN_ERR "%s: irq%d happened with irq_func NULL " "with %s as cad!\n", port->name, irq, port->cad->name); out_unlock: read_unlock(&port->cad_lock); } /* Flags used to identify what a device does. */ #define PARPORT_DEV_TRAN 0 /* WARNING !! DEPRECATED !! */ #define PARPORT_DEV_LURK (1<<0) /* WARNING !! DEPRECATED !! */ #define PARPORT_DEV_EXCL (1<<1) /* Need exclusive access. */ #define PARPORT_FLAG_COMA (1<<0) #define PARPORT_FLAG_EXCL (1<<1) /* EXCL driver registered. */ extern void parport_parse_irqs(int, const char *[], int irqval[]); extern int parport_ieee1284_nibble_mode_ok(struct parport *, unsigned char); extern int parport_wait_peripheral(struct parport *, unsigned char, unsigned char); /* Prototypes from parport_procfs */ extern int parport_proc_init(void); extern void parport_proc_cleanup(void); extern int parport_proc_register(struct parport *pp); extern int parport_proc_unregister(struct parport *pp); extern void dec_parport_count(void); extern void inc_parport_count(void); extern int parport_probe(struct parport *port, char *buffer, int len); extern void parport_probe_one(struct parport *port); extern void (*parport_probe_hook)(struct parport *port); /* If PC hardware is the only type supported, we can optimise a bit. */ #if (defined(CONFIG_PARPORT_PC) || defined(CONFIG_PARPORT_PC_MODULE)) && !(defined(CONFIG_PARPORT_AX) || defined(CONFIG_PARPORT_AX_MODULE)) && !(defined(CONFIG_PARPORT_ARC) || defined(CONFIG_PARPORT_ARC_MODULE)) && !defined(CONFIG_PARPORT_OTHER) #undef PARPORT_NEED_GENERIC_OPS #include #define parport_write_data(p,x) parport_pc_write_data(p,x) #define parport_read_data(p) parport_pc_read_data(p) #define parport_write_control(p,x) parport_pc_write_control(p,x) #define parport_read_control(p) parport_pc_read_control(p) #define parport_frob_control(p,m,v) parport_pc_frob_control(p,m,v) #define parport_write_econtrol(p,x) parport_pc_write_econtrol(p,x) #define parport_read_econtrol(p) parport_pc_read_econtrol(p) #define parport_frob_econtrol(p,m,v) parport_pc_frob_econtrol(p,m,v) #define parport_write_status(p,v) parport_pc_write_status(p,v) #define parport_read_status(p) parport_pc_read_status(p) #define parport_write_fifo(p,v) parport_pc_write_fifo(p,v) #define parport_read_fifo(p) parport_pc_read_fifo(p) #define parport_change_mode(p,m) parport_pc_change_mode(p,m) #define parport_release_resources(p) parport_pc_release_resources(p) #define parport_claim_resources(p) parport_pc_claim_resources(p) #define parport_epp_write_data(p,x) parport_pc_write_epp(p,x) #define parport_epp_read_data(p) parport_pc_read_epp(p) #define parport_epp_write_addr(p,x) parport_pc_write_epp_addr(p,x) #define parport_epp_read_addr(p) parport_pc_read_epp_addr(p) #define parport_epp_check_timeout(p) parport_pc_check_epp_timeout(p) #endif #ifdef PARPORT_NEED_GENERIC_OPS /* Generic operations vector through the dispatch table. */ #define parport_write_data(p,x) (p)->ops->write_data(p,x) #define parport_read_data(p) (p)->ops->read_data(p) #define parport_write_control(p,x) (p)->ops->write_control(p,x) #define parport_read_control(p) (p)->ops->read_control(p) #define parport_frob_control(p,m,v) (p)->ops->frob_control(p,m,v) #define parport_write_econtrol(p,x) (p)->ops->write_econtrol(p,x) #define parport_read_econtrol(p) (p)->ops->read_econtrol(p) #define parport_frob_econtrol(p,m,v) (p)->ops->frob_econtrol(p,m,v) #define parport_write_status(p,v) (p)->ops->write_status(p,v) #define parport_read_status(p) (p)->ops->read_status(p) #define parport_write_fifo(p,v) (p)->ops->write_fifo(p,v) #define parport_read_fifo(p) (p)->ops->read_fifo(p) #define parport_change_mode(p,m) (p)->ops->change_mode(p,m) #define parport_release_resources(p) (p)->ops->release_resources(p) #define parport_claim_resources(p) (p)->ops->claim_resources(p) #define parport_epp_write_data(p,x) (p)->ops->epp_write_data(p,x) #define parport_epp_read_data(p) (p)->ops->epp_read_data(p) #define parport_epp_write_addr(p,x) (p)->ops->epp_write_addr(p,x) #define parport_epp_read_addr(p) (p)->ops->epp_read_addr(p) #define parport_epp_check_timeout(p) (p)->ops->epp_check_timeout(p) #endif #endif /* __KERNEL__ */ #endif /* _PARPORT_H_ */ uisp-20050207/src/ppdev.h0000644000175100017510000001144307473750422011751 00000000000000/* * $Id: ppdev.h,v 1.1 2002/05/25 17:59:46 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 1998-9 Tim Waugh * * 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 * **************************************************************************** */ /* * linux/drivers/char/ppdev.h * * User-space parallel port device driver (header file). * * Added PPGETTIME/PPSETTIME, Fred Barnes, 1999. */ #define PP_MAJOR 99 #define PP_IOCTL 'p' /* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */ #define PPSETMODE _IOW(PP_IOCTL, 0x80, int) /* Read status */ #define PPRSTATUS _IOR(PP_IOCTL, 0x81, unsigned char) #define PPWSTATUS OBSOLETE__IOW(PP_IOCTL, 0x82, unsigned char) /* Read/write control */ #define PPRCONTROL _IOR(PP_IOCTL, 0x83, unsigned char) #define PPWCONTROL _IOW(PP_IOCTL, 0x84, unsigned char) struct ppdev_frob_struct { unsigned char mask; unsigned char val; }; #define PPFCONTROL _IOW(PP_IOCTL, 0x8e, struct ppdev_frob_struct) /* Read/write data */ #define PPRDATA _IOR(PP_IOCTL, 0x85, unsigned char) #define PPWDATA _IOW(PP_IOCTL, 0x86, unsigned char) /* Read/write econtrol (not used) */ #define PPRECONTROL OBSOLETE__IOR(PP_IOCTL, 0x87, unsigned char) #define PPWECONTROL OBSOLETE__IOW(PP_IOCTL, 0x88, unsigned char) /* Read/write FIFO (not used) */ #define PPRFIFO OBSOLETE__IOR(PP_IOCTL, 0x89, unsigned char) #define PPWFIFO OBSOLETE__IOW(PP_IOCTL, 0x8a, unsigned char) /* Claim the port to start using it */ #define PPCLAIM _IO(PP_IOCTL, 0x8b) /* Release the port when you aren't using it */ #define PPRELEASE _IO(PP_IOCTL, 0x8c) /* Yield the port (release it if another driver is waiting, * then reclaim) */ #define PPYIELD _IO(PP_IOCTL, 0x8d) /* Register device exclusively (must be before PPCLAIM). */ #define PPEXCL _IO(PP_IOCTL, 0x8f) /* Data line direction: non-zero for input mode. */ #define PPDATADIR _IOW(PP_IOCTL, 0x90, int) /* Negotiate a particular IEEE 1284 mode. */ #define PPNEGOT _IOW(PP_IOCTL, 0x91, int) /* Set control lines when an interrupt occurs. */ #define PPWCTLONIRQ _IOW(PP_IOCTL, 0x92, unsigned char) /* Clear (and return) interrupt count. */ #define PPCLRIRQ _IOR(PP_IOCTL, 0x93, int) /* Set the IEEE 1284 phase that we're in (e.g. IEEE1284_PH_FWD_IDLE) */ #define PPSETPHASE _IOW(PP_IOCTL, 0x94, int) /* Set and get port timeout (struct timeval's) */ #define PPGETTIME _IOR(PP_IOCTL, 0x95, struct timeval) #define PPSETTIME _IOW(PP_IOCTL, 0x96, struct timeval) /* IEEE1284 modes: Nibble mode, byte mode, ECP, ECPRLE and EPP are their own 'extensibility request' values. Others are special. 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. */ #define IEEE1284_MODE_NIBBLE 0 #define IEEE1284_MODE_BYTE (1<<0) #define IEEE1284_MODE_COMPAT (1<<8) #define IEEE1284_MODE_BECP (1<<9) /* Bounded ECP mode */ #define IEEE1284_MODE_ECP (1<<4) #define IEEE1284_MODE_ECPRLE (IEEE1284_MODE_ECP | (1<<5)) #define IEEE1284_MODE_ECPSWE (1<<10) /* Software-emulated */ #define IEEE1284_MODE_EPP (1<<6) #define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */ #define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */ #define IEEE1284_DEVICEID (1<<2) /* This is a flag */ #define IEEE1284_EXT_LINK (1<<14) /* This flag causes the * extensibility link to * be requested, using * bits 0-6. */ /* For the benefit of parport_read/write, you can use these with * parport_negotiate to use address operations. They have no effect * other than to make parport_read/write use address transfers. */ #define IEEE1284_ADDR (1<<13) /* This is a flag */ #define IEEE1284_DATA 0 /* So is this */ /* IEEE1284 phases */ enum ieee1284_phase { IEEE1284_PH_FWD_DATA, IEEE1284_PH_FWD_IDLE, IEEE1284_PH_TERMINATE, IEEE1284_PH_NEGOTIATION, IEEE1284_PH_HBUSY_DNA, IEEE1284_PH_REV_IDLE, IEEE1284_PH_HBUSY_DAVAIL, IEEE1284_PH_REV_DATA, IEEE1284_PH_ECP_SETUP, IEEE1284_PH_ECP_FWD_TO_REV, IEEE1284_PH_ECP_REV_TO_FWD }; uisp-20050207/src/timeradd.h0000644000175100017510000000413707624220327012420 00000000000000/* * $Id: timeradd.h,v 1.3 2003/02/17 17:50:15 troth Exp $ * **************************************************************************** * * uisp - The Micro In-System Programmer for Atmel AVR microcontrollers. * Copyright (C) 2002, 2003 Marek Michalkiewicz * * 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 * **************************************************************************** */ /* I'm not sure how portable is to use these macros (they are available on my system, but not mentioned in the glibc manual I have). Similar macros are provided here for systems that don't have them. -MM */ #include #ifndef timeradd #define timeradd(_a, _b, _res) \ do { \ (_res)->tv_usec = (_a)->tv_usec + (_b)->tv_usec; \ (_res)->tv_sec = (_a)->tv_sec + (_b)->tv_sec; \ if ((_res)->tv_usec >= 1000000) \ { \ (_res)->tv_usec -= 1000000; \ (_res)->tv_sec++; \ } \ } while (0) #endif #ifndef timersub #define timersub(_a, _b, _res) \ do { \ (_res)->tv_usec = (_a)->tv_usec - (_b)->tv_usec; \ (_res)->tv_sec = (_a)->tv_sec - (_b)->tv_sec; \ if ((_res)->tv_usec < 0) { \ (_res)->tv_usec += 1000000; \ (_res)->tv_sec--; \ } \ } while (0) #endif #ifndef timercmp #define timercmp(_a, _b, _cmp) \ (((_a)->tv_sec == (_b)->tv_sec) ? \ ((_a)->tv_usec _cmp (_b)->tv_usec) : \ ((_a)->tv_sec _cmp (_b)->tv_sec)) #endif uisp-20050207/uisp.spec0000644000175100017510000000475210201771606011522 00000000000000## -*- mode: rpm-spec; -*- ## ## $Id: uisp.spec.in,v 1.3 2003/08/28 06:50:18 troth Exp $ ## ## uisp.spec. Generated from uisp.spec.in by configure. ## %define debug_package %{nil} %define uispVersion 20050207 Summary: Universal In-System Programmer for Atmel AVR and 8051. Name: uisp Version: %{uispVersion} Release: 1 License: GPL Group: Development/Tools URL: http://freesoftware.fsf.org/download/uisp Source: http://freesoftware.fsf.org/download/uisp/uisp-%{uispVersion}.tar.gz Buildroot: %{_tmppath}/%{name}-%{version}-root %description Uisp is utility for downloading/uploading programs to AVR devices. Can also be used for some Atmel 8051 type devices. In addition, uisp can erase the device, write lock bits, verify and set the active segment. For use with the following hardware to program the devices: pavr http://avr.jpk.co.nz/pavr/pavr.html stk500 Atmel STK500 dapa Direct AVR Parallel Access stk200 Parallel Starter Kit STK200, STK300 abb Altera ByteBlasterMV Parallel Port Download Cable avrisp Atmel AVR ISP (?) bsd http://www.bsdhome.com/avrprog/ (parallel) fbprg http://ln.com.ua/~real/avreal/adapters.html (parallel) dt006 http://www.dontronics.com/dt006.html (parallel) dasa serial (RESET=RTS SCK=DTR MOSI=TXD MISO=CTS) dasa2 serial (RESET=!TXD SCK=RTS MOSI=DTR MISO=CTS) %prep %setup -q %build ./configure --prefix=%{_prefix} --mandir=%{_mandir} make %install rm -rf $RPM_BUILD_ROOT make prefix=$RPM_BUILD_ROOT%{_prefix} mandir=$RPM_BUILD_ROOT%{_mandir} install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc ChangeLog AUTHORS CHANGES CHANGES.old COPYING INSTALL TODO kernel pavr %{_prefix}/bin/uisp %{_mandir}/man1/uisp.1.gz %changelog * Wed Aug 27 2003 Theodore A. Roth - Add man page to package. - Disable building of debug package. * Sun May 26 2002 Theodore A. Roth - Integrated in to build system. * Sat Apr 20 2002 Theodore A. Roth - Update to new 20020420 release. * Fri Apr 18 2002 Theodore A. Roth - Added patch to fix reading cal byte on tiny15. (from Alexander Popov) * Mon Apr 08 2002 Theodore A. Roth - Added patch to fix reading signature bytes. - Added patch to fix some problems with srec uploading. * Tue Mar 17 2002 Theodore A. Roth - Added kernel/ and pavr/ directories to %doc files. * Tue Mar 17 2002 Theodore A. Roth - Initial spec file.